DirectFB-1.2.10/0000777000175000017500000000000011307522571010225 500000000000000DirectFB-1.2.10/wm/0000777000175000017500000000000011307522566010654 500000000000000DirectFB-1.2.10/wm/unique/0000777000175000017500000000000011307522566012162 500000000000000DirectFB-1.2.10/wm/unique/input_channel.h0000644000175000017500000000554511245562152015103 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__INPUT_CHANNEL_H__ #define __UNIQUE__INPUT_CHANNEL_H__ #include #include #include #include DFBResult unique_input_channel_create ( CoreDFB *core, UniqueContext *context, UniqueInputChannel **ret_channel ); DFBResult unique_input_channel_destroy ( UniqueInputChannel *channel ); DFBResult unique_input_channel_attach ( UniqueInputChannel *channel, ReactionFunc func, void *ctx, Reaction *reaction ); DFBResult unique_input_channel_detach ( UniqueInputChannel *channel, Reaction *reaction ); DFBResult unique_input_channel_attach_global( UniqueInputChannel *channel, int index, void *ctx, GlobalReaction *reaction ); DFBResult unique_input_channel_detach_global( UniqueInputChannel *channel, GlobalReaction *reaction ); DFBResult unique_input_channel_dispatch ( UniqueInputChannel *channel, const UniqueInputEvent *event ); /* global reactions */ typedef enum { UNIQUE_WINDOW_INPUT_CHANNEL_LISTENER } UNIQUE_INPUT_CHANNEL_GLOBALS; #endif DirectFB-1.2.10/wm/unique/context.c0000644000175000017500000005137711245562152013737 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include /* FIXME */ #include #include #include #include /* FIXME */ #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Context, "UniQuE/Context", "UniQuE's Stack Context" ); static const ReactionFunc unique_context_globals[] = { _unique_wm_module_context_listener, NULL }; /**************************************************************************************************/ static void context_destructor( FusionObject *object, bool zombie, void *ctx ) { int i; UniqueContext *context = (UniqueContext*) object; D_DEBUG_AT( UniQuE_Context, "destroying %p (stack %p)%s\n", context, context->stack, zombie ? " (ZOMBIE)" : ""); D_ASSUME( fusion_vector_is_empty( &context->windows ) ); unique_context_notify( context, UCNF_DESTROYED ); unique_device_detach_global( context->devices[UDCI_POINTER], &context->cursor_reaction ); unique_input_switch_drop( context->input_switch, context->foo_channel ); unique_input_channel_destroy( context->foo_channel ); unique_input_switch_destroy( context->input_switch ); for (i=0; i<_UDCI_NUM; i++) unique_device_destroy( context->devices[i] ); while (fusion_vector_has_elements( &context->windows )) { unique_window_destroy( fusion_vector_at( &context->windows, 0 ) ); } stret_region_destroy( context->root ); fusion_vector_destroy( &context->windows ); dfb_surface_unlink( &context->surface ); dfb_layer_region_unlink( &context->region ); D_MAGIC_CLEAR( context ); fusion_object_destroy( object ); } FusionObjectPool * unique_context_pool_create( const FusionWorld *world ) { return fusion_object_pool_create( "UniQuE Context Pool", sizeof(UniqueContext), sizeof(UniqueContextNotification), context_destructor, NULL, world ); } /**************************************************************************************************/ static DFBEnumerationResult connect_device( CoreInputDevice *source, void *ctx ) { UniqueDevice *device = ctx; D_MAGIC_ASSERT( device, UniqueDevice ); unique_device_connect( device, source ); return DFENUM_OK; } static DFBResult create_devices( CoreDFB *core, UniqueContext *context, WMShared *shared ) { int i; DFBResult ret; D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( shared, WMShared ); for (i=0; i<_UDCI_NUM; i++) { DFBInputDeviceCapabilities caps; ret = unique_device_create( core, context, shared->device_classes[i], context, &context->devices[i] ); if (ret) goto error; ret = unique_input_switch_add( context->input_switch, context->devices[i] ); if (ret) goto error_add; switch (i) { case UDCI_POINTER: caps = DICAPS_AXES | DICAPS_BUTTONS; break; case UDCI_WHEEL: caps = DICAPS_AXES; break; case UDCI_KEYBOARD: caps = DICAPS_KEYS; break; default: caps = DICAPS_ALL; break; } dfb_input_enumerate_devices( connect_device, context->devices[i], caps ); } return DFB_OK; error_add: unique_device_destroy( context->devices[i] ); error: while (--i >= 0) unique_device_destroy( context->devices[i] ); return ret; } /**************************************************************************************************/ DFBResult unique_context_create( CoreDFB *core, CoreWindowStack *stack, CoreLayerRegion *region, DFBDisplayLayerID layer_id, WMShared *shared, UniqueContext **ret_context ) { int i; DFBResult ret; UniqueContext *context; D_ASSERT( stack != NULL ); D_MAGIC_ASSERT( shared, WMShared ); D_ASSERT( ret_context != NULL ); context = unique_wm_create_context(); if (!context) return DFB_FUSION; context->stack = stack; context->shared = shared; context->layer_id = layer_id; context->color = (DFBColor) { 0xff, 0xa0, 0xd0, 0xf0 }; context->shmpool = stack->shmpool; fusion_vector_init( &context->windows, 16, context->shmpool ); /* Create Root Region. */ ret = stret_region_create( shared->region_classes[URCI_ROOT], context, 0, SRF_ACTIVE | SRF_OUTPUT, _UNRL_NUM, 0, 0, INT_MAX, INT_MAX, NULL, 0, context->shmpool, &context->root ); if (ret) goto error; /* Link layer region. */ ret = dfb_layer_region_link( &context->region, region ); if (ret) goto error; /* Get the region's surface. */ ret = dfb_layer_region_get_surface( region, &context->surface ); if (ret) goto error; /* Make it global. */ ret = dfb_surface_globalize( context->surface ); if (ret) { dfb_surface_unref( context->surface ); goto error; } D_MAGIC_SET( context, UniqueContext ); ret = unique_input_switch_create( context, &context->input_switch ); if (ret) goto error_switch; ret = create_devices( core, context, shared ); if (ret) goto error_devices; ret = unique_input_channel_create( core, context, &context->foo_channel ); if (ret) goto error_foo_channel; ret = unique_device_attach_global( context->devices[UDCI_POINTER], UNIQUE_CURSOR_DEVICE_LISTENER, context, &context->cursor_reaction ); if (ret) goto error_attach_cursor; /* Change global reaction lock. */ fusion_object_set_lock( &context->object, &context->stack->context->lock ); /* Activate Object. */ fusion_object_activate( &context->object ); /* Return new context. */ *ret_context = context; return DFB_OK; error_attach_cursor: unique_input_channel_destroy( context->foo_channel ); error_foo_channel: for (i=0; i<_UDCI_NUM; i++) unique_device_destroy( context->devices[i] ); error_devices: unique_input_switch_destroy( context->input_switch ); error_switch: D_MAGIC_CLEAR( context ); dfb_surface_unlink( &context->surface ); error: if (context->region) dfb_layer_region_unlink( &context->region ); if (context->root) stret_region_destroy( context->root ); fusion_vector_destroy( &context->windows ); fusion_object_destroy( &context->object ); return ret; } DFBResult unique_context_notify( UniqueContext *context, UniqueContextNotificationFlags flags ) { UniqueContextNotification notification; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( flags != UCNF_NONE ); D_ASSERT( ! (flags & ~UCNF_ALL) ); notification.flags = flags; notification.context = context; return unique_context_dispatch( context, ¬ification, unique_context_globals ); } DFBResult unique_context_set_active( UniqueContext *context, bool active ) { D_MAGIC_ASSERT( context, UniqueContext ); D_ASSUME( context->active != active ); if (context->active == active) return DFB_OK; context->active = active; if (active) return dfb_windowstack_repaint_all( context->stack ); /* Force release of all pressed keys. */ return unique_context_flush_keys( context ); } DFBResult unique_context_set_color( UniqueContext *context, const DFBColor *color ) { D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( color != NULL ); context->color = *color; return dfb_windowstack_repaint_all( context->stack ); } /* HACK: dumped in here for now, will move into cursor class */ void unique_draw_cursor( CoreWindowStack *stack, UniqueContext *context, CardState *state, DFBRegion *region ) { DFBRectangle src; DFBSurfaceBlittingFlags flags = DSBLIT_BLEND_ALPHACHANNEL; D_ASSERT( stack != NULL ); D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( state, CardState ); DFB_REGION_ASSERT( region ); D_ASSUME( stack->cursor.opacity > 0 ); /* Initialize source rectangle. */ src.x = region->x1 - stack->cursor.x + stack->cursor.hot.x; src.y = region->y1 - stack->cursor.y + stack->cursor.hot.y; src.w = region->x2 - region->x1 + 1; src.h = region->y2 - region->y1 + 1; /* Use global alpha blending. */ if (stack->cursor.opacity != 0xFF) { flags |= DSBLIT_BLEND_COLORALPHA; /* Set opacity as blending factor. */ if (state->color.a != stack->cursor.opacity) { state->color.a = stack->cursor.opacity; state->modified |= SMF_COLOR; } } /* Different compositing methods depending on destination format. */ if (flags & DSBLIT_BLEND_ALPHACHANNEL) { if (DFB_PIXELFORMAT_HAS_ALPHA( state->destination->config.format )) { /* * Always use compliant Porter/Duff SRC_OVER, * if the destination has an alpha channel. * * Cd = destination color (non-premultiplied) * Ad = destination alpha * * Cs = source color (non-premultiplied) * As = source alpha * * Ac = color alpha * * cd = Cd * Ad (premultiply destination) * cs = Cs * As (premultiply source) * * The full equation to calculate resulting color and alpha (premultiplied): * * cx = cd * (1-As*Ac) + cs * Ac * ax = Ad * (1-As*Ac) + As * Ac */ dfb_state_set_src_blend( state, DSBF_ONE ); /* Need to premultiply source with As*Ac or only with Ac? */ if (! (stack->cursor.surface->config.caps & DSCAPS_PREMULTIPLIED)) flags |= DSBLIT_SRC_PREMULTIPLY; else if (flags & DSBLIT_BLEND_COLORALPHA) flags |= DSBLIT_SRC_PREMULTCOLOR; /* Need to premultiply/demultiply destination? */ // if (! (state->destination->caps & DSCAPS_PREMULTIPLIED)) // flags |= DSBLIT_DST_PREMULTIPLY | DSBLIT_DEMULTIPLY; } else { /* * We can avoid DSBLIT_SRC_PREMULTIPLY for destinations without an alpha channel * by using another blending function, which is more likely that it's accelerated * than premultiplication at this point in time. * * This way the resulting alpha (ax) doesn't comply with SRC_OVER, * but as the destination doesn't have an alpha channel it's no problem. * * As the destination's alpha value is always 1.0 there's no need for * premultiplication. The resulting alpha value will also be 1.0 without * exceptions, therefore no need for demultiplication. * * cx = Cd * (1-As*Ac) + Cs*As * Ac (still same effect as above) * ax = Ad * (1-As*Ac) + As*As * Ac (wrong, but discarded anyways) */ if (stack->cursor.surface->config.caps & DSCAPS_PREMULTIPLIED) { /* Need to premultiply source with Ac? */ if (flags & DSBLIT_BLEND_COLORALPHA) flags |= DSBLIT_SRC_PREMULTCOLOR; dfb_state_set_src_blend( state, DSBF_ONE ); } else dfb_state_set_src_blend( state, DSBF_SRCALPHA ); } } /* Set blitting flags. */ dfb_state_set_blitting_flags( state, flags ); /* Set blitting source. */ state->source = stack->cursor.surface; state->modified |= SMF_SOURCE; /* Blit from the window to the region being updated. */ dfb_gfxcard_blit( &src, region->x1, region->y1, state ); /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; } DFBResult unique_context_update( UniqueContext *context, const DFBRegion *updates, int num, DFBSurfaceFlipFlags flags ) { int i; CoreLayer *layer; CardState *state; int count = 0; DFBRegion root; DFBRegion regions[num]; DFBRegion cursor_inter; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( context->stack != NULL ); D_ASSERT( updates != NULL ); D_ASSERT( num > 0 ); if (!context->active) return DFB_OK; D_DEBUG_AT( UniQuE_Context, "unique_context_update( num %d, flags 0x%08x )\n", num, flags ); layer = dfb_layer_at( context->layer_id ); state = dfb_layer_state( layer ); root = DFB_REGION_INIT_FROM_RECTANGLE_VALS( 0, 0, context->width, context->height ); for (i=0; i No intersection with root!\n" ); return DFB_OK; } /* Set destination. */ state->destination = context->surface; state->modified |= SMF_DESTINATION; for (i=0; iroot, update, state ); /* Update cursor? */ cursor_inter = context->cursor_region; if (context->cursor_drawn && dfb_region_region_intersect( &cursor_inter, update )) { DFBRectangle rect = DFB_RECTANGLE_INIT_FROM_REGION( &cursor_inter ); D_ASSUME( context->cursor_bs_valid ); dfb_gfx_copy_to( context->surface, context->cursor_bs, &rect, rect.x - context->cursor_region.x1, rect.y - context->cursor_region.y1, true ); unique_draw_cursor( context->stack, context, state, &cursor_inter ); } } /* Reset destination. */ state->destination = NULL; state->modified |= SMF_DESTINATION; /* Software cursor code relies on a valid back buffer. */ if (context->stack->cursor.enabled) flags |= DSFLIP_BLIT; /* Flip all updated regions. */ for (i=0; iregion, update, flags ); } return DFB_OK; } DFBResult unique_context_resize( UniqueContext *context, int width, int height ) { D_MAGIC_ASSERT( context, UniqueContext ); context->width = width; context->height = height; stret_region_resize( context->root, width, height ); return DFB_OK; } DFBResult unique_context_flush_keys( UniqueContext *context ) { D_MAGIC_ASSERT( context, UniqueContext ); return DFB_OK; } DFBResult unique_context_window_at( UniqueContext *context, int x, int y, UniqueWindow **ret_window ) { int i; CoreWindowStack *stack; WMShared *shared; UniqueWindow *window = NULL; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( ret_window != NULL ); stack = context->stack; shared = context->shared; D_ASSERT( stack != NULL ); D_MAGIC_ASSERT( shared, WMShared ); if (stack->cursor.enabled) { StretRegion *region; if (x < 0) x = stack->cursor.x; if (y < 0) y = stack->cursor.y; region = stret_region_at( context->root, x, y, SRF_INPUT, SRCID_UNKNOWN ); if (region && (region->clazz == shared->region_classes[URCI_FOO] || region->clazz == shared->region_classes[URCI_WINDOW])) { window = stret_region_data( region ); D_MAGIC_ASSERT( window, UniqueWindow ); } } else { fusion_vector_foreach_reverse (window, i, context->windows) if (window->opacity && !(window->options & DWOP_GHOST)) break; if (i < 0) window = NULL; } D_MAGIC_ASSERT_IF( window, UniqueWindow ); *ret_window = window; return DFB_OK; } DFBResult unique_context_lookup_window( UniqueContext *context, DFBWindowID window_id, UniqueWindow **ret_window ) { int i; UniqueWindow *window = NULL; D_ASSERT( ret_window != NULL ); D_MAGIC_ASSERT( context, UniqueContext ); fusion_vector_foreach_reverse (window, i, context->windows) { if (window->window->id == window_id) break; } *ret_window = window; return DFB_OK; } DFBResult unique_context_enum_windows( UniqueContext *context, CoreWMWindowCallback callback, void *callback_ctx ) { int i; UniqueWindow *window = NULL; D_ASSERT( callback != NULL ); D_MAGIC_ASSERT( context, UniqueContext ); fusion_vector_foreach_reverse (window, i, context->windows) { if (callback( window->window, callback_ctx ) != DFENUM_OK) break; } return DFB_OK; } /**************************************************************************************************/ ReactionResult _unique_cursor_device_listener( const void *msg_data, void *ctx ) { const UniqueInputEvent *event = msg_data; UniqueContext *context = ctx; D_ASSERT( event != NULL ); D_MAGIC_ASSERT( context, UniqueContext ); D_DEBUG_AT( UniQuE_Context, "_unique_cursor_device_listener( %p, %p )\n", event, context ); switch (event->type) { case UIET_MOTION: dfb_windowstack_cursor_warp( context->stack, event->pointer.x, event->pointer.y ); break; default: break; } return RS_OK; } DirectFB-1.2.10/wm/unique/test_color.c0000644000175000017500000001414211245562152014415 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include /*****************************************************************************/ static IDirectFB *dfb = NULL; static const char *filename = NULL; static DFBBoolean color = DFB_FALSE; /*****************************************************************************/ static DFBBoolean parse_command_line ( int argc, char *argv[] ); static void set_color ( void ); /*****************************************************************************/ static UniqueContext *context; static bool context_callback( FusionObjectPool *pool, FusionObject *object, void *ctx ) { if (object->state != FOS_ACTIVE) return true; context = (UniqueContext*) object; if (unique_context_ref( context )) { D_ERROR( "UniQuE/Test: unique_context_ref() failed!\n" ); return true; } return false; } int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { DirectFBError( "DirectFBCreate() failed", ret ); return -3; } if (!unique_wm_running()) { D_ERROR( "UniQuE/Test: This session doesn't run UniQuE!\n" ); dfb->Release( dfb ); return EXIT_FAILURE; } unique_wm_enum_contexts( context_callback, NULL ); if (!context) { D_ERROR( "UniQuE/Test: No context available!\n" ); dfb->Release( dfb ); return EXIT_FAILURE; } /* Set the background according to the users wishes. */ if (color) set_color(); unique_context_unref( context ); /* Release the super interface. */ dfb->Release( dfb ); return EXIT_SUCCESS; } /*****************************************************************************/ static void print_usage( const char *prg_name ) { fprintf( stderr, "\n" "UniQuE Test Application (version %s)\n" "\n" "Usage: %s [options] \n" "\n" "Options:\n" " -c, --color Set in AARRGGBB format (hexadecimal)\n" " -h, --help Show this help message\n" " -v, --version Print version information\n" "\n", DIRECTFB_VERSION, prg_name ); } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; const char *prg_name = strrchr( argv[0], '/' ); if (prg_name) prg_name++; else prg_name = argv[0]; for (n = 1; n < argc; n++) { const char *a = argv[n]; if (*a != '-') { if (!filename) { filename = a; continue; } else { print_usage( prg_name ); return DFB_FALSE; } } if (strcmp (a, "-h") == 0 || strcmp (a, "--help") == 0) { print_usage( prg_name ); return DFB_FALSE; } if (strcmp (a, "-v") == 0 || strcmp (a, "--version") == 0) { fprintf (stderr, "dfbg version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } if (strcmp (a, "-c") == 0 || strcmp (a, "--color") == 0) { color = DFB_TRUE; continue; } } if (!filename) { print_usage( prg_name ); return DFB_FALSE; } return DFB_TRUE; } static void set_color( void ) { DFBResult ret; char *error; u32 argb; DFBColor color; if (*filename == '#') filename++; argb = strtoul( filename, &error, 16 ); if (*error) { fprintf( stderr, "Invalid characters in color string: '%s'\n", error ); return; } color.a = (argb & 0xFF000000) >> 24; color.r = (argb & 0xFF0000) >> 16; color.g = (argb & 0xFF00) >> 8; color.b = (argb & 0xFF); ret = unique_context_set_color( context, &color ); if (ret) D_DERROR( ret, "UniQuE/Test: unique_context_set_color() failed!\n" ); } DirectFB-1.2.10/wm/unique/stret.h0000644000175000017500000001351511245562152013411 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__STRET_H__ #define __UNIQUE__STRET_H__ #include #include /* * A 'StReT' is a Stack Region Tree. */ typedef enum { SRF_NONE = 0x00000000, SRF_INPUT = 0x00000001, SRF_OUTPUT = 0x00000002, SRF_ACTIVE = 0x00000004, SRF_OPAQUE = 0x00000010, SRF_SHAPED = 0x00000020, SRF_ALL = 0x00000037 } StretRegionFlags; typedef struct { DFBResult (*GetInput)( StretRegion *region, void *region_data, unsigned long arg, int index, int x, int y, UniqueInputChannel **ret_channel ); void (*Update) ( StretRegion *region, void *region_data, void *update_data, unsigned long arg, int x, int y, const DFBRegion *updates, int num ); } StretRegionClass; typedef int StretRegionClassID; #define SRCID_UNKNOWN -1 #define SRCID_DEFAULT 0 DFBResult stret_class_register ( const StretRegionClass *clazz, StretRegionClassID *ret_id ); DFBResult stret_class_unregister( StretRegionClassID id ); DFBResult stret_region_create ( StretRegionClassID class_id, void *data, unsigned long arg, StretRegionFlags flags, int levels, int x, int y, int width, int height, StretRegion *parent, int level, FusionSHMPoolShared *pool, StretRegion **ret_region ); DFBResult stret_region_destroy ( StretRegion *region ); DFBResult stret_region_enable ( StretRegion *region, StretRegionFlags flags ); DFBResult stret_region_disable ( StretRegion *region, StretRegionFlags flags ); DFBResult stret_region_move ( StretRegion *region, int dx, int dy ); DFBResult stret_region_resize ( StretRegion *region, int width, int height ); DFBResult stret_region_restack ( StretRegion *region, int index ); void stret_region_get_abs ( StretRegion *region, DFBRegion *ret_bounds ); void stret_region_get_size ( StretRegion *region, DFBDimension *ret_size ); DFBResult stret_region_get_input( StretRegion *region, int index, int x, int y, UniqueInputChannel **ret_channel ); DFBResult stret_region_visible ( StretRegion *region, const DFBRegion *base, bool children, DFBRegion *ret_regions, int max_num, int *ret_num ); DFBResult stret_region_update ( StretRegion *region, const DFBRegion *update, void *update_data ); StretRegion *stret_region_at ( StretRegion *region, int x, int y, StretRegionFlags flags, StretRegionClassID class_id ); void *stret_region_data ( const StretRegion *region ); #endif DirectFB-1.2.10/wm/unique/classes/0000777000175000017500000000000011307522566013617 500000000000000DirectFB-1.2.10/wm/unique/classes/Makefile.am0000644000175000017500000000061711164361026015564 00000000000000## Makefile.am for DirectFB/wm/unique/classes INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/wm AM_CPPFLAGS = \ -DMODULEDIR=\"@MODULEDIR@\" \ -DSOPATH=\"@SOPATH@\" noinst_LTLIBRARIES = libunique_classes.la libunique_classes_la_SOURCES = \ foo.c \ frame.c \ root.c \ window.c DirectFB-1.2.10/wm/unique/classes/Makefile.in0000644000175000017500000003725611307521507015607 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = wm/unique/classes DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libunique_classes_la_LIBADD = am_libunique_classes_la_OBJECTS = foo.lo frame.lo root.lo window.lo libunique_classes_la_OBJECTS = $(am_libunique_classes_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libunique_classes_la_SOURCES) DIST_SOURCES = $(libunique_classes_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/wm AM_CPPFLAGS = \ -DMODULEDIR=\"@MODULEDIR@\" \ -DSOPATH=\"@SOPATH@\" noinst_LTLIBRARIES = libunique_classes.la libunique_classes_la_SOURCES = \ foo.c \ frame.c \ root.c \ window.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu wm/unique/classes/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu wm/unique/classes/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libunique_classes.la: $(libunique_classes_la_OBJECTS) $(libunique_classes_la_DEPENDENCIES) $(LINK) $(libunique_classes_la_OBJECTS) $(libunique_classes_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frame.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/root.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/wm/unique/classes/foo.c0000644000175000017500000001563311245562152014466 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Foo, "UniQuE/Foo", "UniQuE's Foo Region Class" ); static DFBResult foo_get_input( StretRegion *region, void *region_data, unsigned long arg, int index, int x, int y, UniqueInputChannel **ret_channel ) { UniqueContext *context; UniqueWindow *window = region_data; D_MAGIC_ASSERT( region, StretRegion ); D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( ret_channel != NULL ); D_DEBUG_AT( UniQuE_Foo, "foo_get_input( region %p, window %p, index %d, x %d, y %d )\n", region, window, index, x, y ); switch (index) { case UDCI_KEYBOARD: case UDCI_WHEEL: *ret_channel = window->channel; break; case UDCI_POINTER: *ret_channel = window->channel; // *ret_channel = context->foo_channel; break; default: *ret_channel = NULL; break; } return DFB_OK; } static void foo_update( StretRegion *region, void *region_data, void *update_data, unsigned long arg, int x, int y, const DFBRegion *updates, int num ) { int i; DFBRegion clip; DFBDimension size; bool visible; WMShared *shared; UniqueContext *context; UniqueWindow *window = region_data; CardState *state = update_data; DFBSurfaceBlittingFlags flags = DSBLIT_NOFX; D_ASSERT( region != NULL ); D_ASSERT( region_data != NULL ); D_ASSERT( update_data != NULL ); D_ASSERT( updates != NULL ); D_MAGIC_ASSERT( window, UniqueWindow ); D_MAGIC_ASSERT( state, CardState ); shared = window->shared; D_MAGIC_ASSERT( shared, WMShared ); D_ASSERT( shared->foo_surface != NULL ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); visible = D_FLAGS_IS_SET( window->flags, UWF_VISIBLE ); D_DEBUG_AT( UniQuE_Foo, "foo_update( region %p, window %p, visible %s, num %d )\n", region, window, visible ? "yes" : "no", num ); #if D_DEBUG_ENABLED for (i=0; iopacity != 0xFF) { flags |= DSBLIT_BLEND_COLORALPHA; /* Set opacity as blending factor. */ if (state->color.a != window->opacity) { state->color.a = window->opacity; state->modified |= SMF_COLOR; } } /* Use colorizing if the color is not white. */ if (context->color.r != 0xff || context->color.g != 0xff || context->color.b != 0xff) { flags |= DSBLIT_COLORIZE; state->color.r = context->color.r; state->color.g = context->color.g; state->color.b = context->color.b; state->modified |= SMF_COLOR; } /* Set blitting flags. */ dfb_state_set_blitting_flags( state, flags ); /* Set blitting source. */ state->source = shared->foo_surface; state->modified |= SMF_SOURCE; switch (arg) { case UFI_N: case UFI_E: case UFI_S: case UFI_W: clip = state->clip; /* for (i=0; ifoo_rects[arg]; DFBRectangle dest = { x, y, size.w, size.h }; dfb_state_set_clip( state, &update ); dfb_gfxcard_stretchblit( &source, &dest, state ); }*/ for (i=0; ifoo_rects[arg]; dfb_state_set_clip( state, &update ); dfb_gfxcard_tileblit( &source, x, y, x + size.w - 1, y + size.h - 1, state ); } dfb_state_set_clip( state, &clip ); break; case UFI_NE: case UFI_SE: case UFI_SW: case UFI_NW: for (i=0; ifoo_rects[arg].x, shared->foo_rects[arg].y ); dfb_gfxcard_blit( &rect, x + updates[i].x1, y + updates[i].y1, state ); } break; default: D_BUG( "invalid arg" ); } /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; } const StretRegionClass unique_foo_region_class = { .GetInput = foo_get_input, .Update = foo_update, }; DirectFB-1.2.10/wm/unique/classes/root.c0000644000175000017500000001517311245562152014665 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Root, "UniQuE/Root", "UniQuE's Root Region Class" ); static void root_update( StretRegion *region, void *region_data, void *update_data, unsigned long arg, int x, int y, const DFBRegion *updates, int num ) { int i; CoreWindowStack *stack; UniqueContext *context = region_data; CardState *state = update_data; D_ASSERT( region != NULL ); D_ASSERT( region_data != NULL ); D_ASSERT( update_data != NULL ); D_ASSERT( updates != NULL ); D_ASSERT( x == 0 ); D_ASSERT( y == 0 ); D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( state, CardState ); stack = context->stack; D_ASSERT( stack != NULL ); D_ASSERT( stack->bg.image != NULL || (stack->bg.mode != DLBM_IMAGE && stack->bg.mode != DLBM_TILE) ); D_DEBUG_AT( UniQuE_Root, "root_update( region %p, num %d )\n", region, num ); #if D_DEBUG_ENABLED for (i=0; ibg.mode) { case DLBM_COLOR: { CoreSurface *dest = state->destination; DFBColor *color = &stack->bg.color; DFBRectangle rects[num]; /* Set the background color. */ if (DFB_PIXELFORMAT_IS_INDEXED( dest->config.format )) dfb_state_set_color_index( state, dfb_palette_search( dest->palette, color->r, color->g, color->b, color->a ) ); else dfb_state_set_color( state, color ); for (i=0; ibg.image; /* Set blitting source. */ state->source = bg; state->modified |= SMF_SOURCE; /* Set blitting flags. */ dfb_state_set_blitting_flags( state, DSBLIT_NOFX ); /* Check the size of the background image. */ if (bg->config.size.w == stack->width && bg->config.size.h == stack->height) { for (i=0; iclip; for (i=0; iconfig.size.w, bg->config.size.h }; DFBRectangle dst = { 0, 0, stack->width, stack->height }; /* Change clipping region. */ dfb_state_set_clip( state, &updates[i] ); /* Stretch blit for non fitting background images. */ dfb_gfxcard_stretchblit( &src, &dst, state ); } /* Restore clipping region. */ dfb_state_set_clip( state, &clip ); } /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; break; } case DLBM_TILE: { CoreSurface *bg = stack->bg.image; DFBRegion clip = state->clip; /* Set blitting source. */ state->source = bg; state->modified |= SMF_SOURCE; /* Set blitting flags. */ dfb_state_set_blitting_flags( state, DSBLIT_NOFX ); for (i=0; iconfig.size.w, bg->config.size.h }; /* Change clipping region. */ dfb_state_set_clip( state, &updates[i] ); /* Tiled blit (aligned). */ dfb_gfxcard_tileblit( &src, 0, 0, stack->width, stack->height, state ); } /* Restore clipping region. */ dfb_state_set_clip( state, &clip ); /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; break; } case DLBM_DONTCARE: break; default: D_BUG( "unknown background mode" ); break; } } /* * The root region is the desktop background. */ const StretRegionClass unique_root_region_class = { .Update = root_update, }; DirectFB-1.2.10/wm/unique/classes/window.c0000644000175000017500000001204611245562152015205 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Window, "UniQuE/WindowReg", "UniQuE's Window Region Class" ); static DFBResult window_get_input( StretRegion *region, void *region_data, unsigned long arg, int index, int x, int y, UniqueInputChannel **ret_channel ) { UniqueWindow *window = region_data; D_MAGIC_ASSERT( region, StretRegion ); D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( ret_channel != NULL ); D_DEBUG_AT( UniQuE_Window, "window_get_input( region %p, window %p, index %d, x %d, y %d )\n", region, window, index, x, y ); *ret_channel = window->channel; return DFB_OK; } static void window_update( StretRegion *region, void *region_data, void *update_data, unsigned long arg, int x, int y, const DFBRegion *updates, int num ) { int i; DFBSurfaceBlittingFlags flags = DSBLIT_NOFX; UniqueWindow *window = region_data; CardState *state = update_data; bool alpha = arg; bool visible; D_ASSERT( updates != NULL ); D_MAGIC_ASSERT( region, StretRegion ); D_MAGIC_ASSERT( window, UniqueWindow ); D_MAGIC_ASSERT( state, CardState ); D_ASSERT( window->surface != NULL ); visible = D_FLAGS_IS_SET( window->flags, UWF_VISIBLE ); D_DEBUG_AT( UniQuE_Window, "window_update( region %p, window %p, visible %s, num %d )\n", region, window, visible ? "yes" : "no", num ); #if D_DEBUG_ENABLED for (i=0; ioptions & DWOP_ALPHACHANNEL)) flags |= DSBLIT_BLEND_ALPHACHANNEL; /* Use global alpha blending. */ if (window->opacity != 0xFF) { flags |= DSBLIT_BLEND_COLORALPHA; /* Set opacity as blending factor. */ if (state->color.a != window->opacity) { state->color.a = window->opacity; state->modified |= SMF_COLOR; } } /* Use source color keying. */ if (window->options & DWOP_COLORKEYING) { flags |= DSBLIT_SRC_COLORKEY; /* Set window color key. */ dfb_state_set_src_colorkey( state, window->color_key ); } /* Use automatic deinterlacing. */ if (window->surface->config.caps & DSCAPS_INTERLACED) flags |= DSBLIT_DEINTERLACE; /* Set blitting flags. */ dfb_state_set_blitting_flags( state, flags ); /* Set blitting source. */ state->source = window->surface; state->modified |= SMF_SOURCE; for (i=0; isource = NULL; state->modified |= SMF_SOURCE; } const StretRegionClass unique_window_region_class = { .GetInput = window_get_input, .Update = window_update, }; DirectFB-1.2.10/wm/unique/classes/frame.c0000644000175000017500000000317011245562152014766 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include //D_DEBUG_DOMAIN( UniQuE_Frame, "UniQuE/Frame", "UniQuE's Frame Region Class" ); const StretRegionClass unique_frame_region_class = { .GetInput = NULL, }; DirectFB-1.2.10/wm/unique/devices/0000777000175000017500000000000011307522566013604 500000000000000DirectFB-1.2.10/wm/unique/devices/wheel.c0000644000175000017500000001173411245562152014772 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Wheel, "UniQuE/Wheel", "UniQuE's Wheel Device Class" ); typedef struct { int magic; } WheelData; /**************************************************************************************************/ static DFBResult wheel_initialize( UniqueDevice *device, void *data, void *ctx ) { WheelData *wheel = data; D_MAGIC_ASSERT( device, UniqueDevice ); D_DEBUG_AT( UniQuE_Wheel, "wheel_initialize( %p, %p, %p )\n", device, data, ctx ); D_MAGIC_SET( wheel, WheelData ); return DFB_OK; } static void wheel_shutdown( UniqueDevice *device, void *data, void *ctx ) { WheelData *wheel = data; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( wheel, WheelData ); D_DEBUG_AT( UniQuE_Wheel, "wheel_shutdown( %p, %p, %p )\n", device, data, ctx ); D_MAGIC_CLEAR( wheel ); } static void wheel_connected( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ) { WheelData *wheel = data; (void) wheel; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( wheel, WheelData ); D_ASSERT( source != NULL ); D_DEBUG_AT( UniQuE_Wheel, "wheel_connected( %p, %p, %p, %p )\n", device, data, ctx, source ); } static void wheel_disconnected( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ) { WheelData *wheel = data; (void) wheel; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( wheel, WheelData ); D_ASSERT( source != NULL ); D_DEBUG_AT( UniQuE_Wheel, "wheel_disconnected( %p, %p, %p, %p )\n", device, data, ctx, source ); } static void wheel_process_event( UniqueDevice *device, void *data, void *ctx, const DFBInputEvent *event ) { UniqueInputEvent evt; WheelData *wheel = data; (void) wheel; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( wheel, WheelData ); D_ASSERT( event != NULL ); D_DEBUG_AT( UniQuE_Wheel, "wheel_process_event( %p, %p, %p, %p ) <- type 0x%08x\n", device, data, ctx, event, event->type ); switch (event->type) { case DIET_AXISMOTION: switch (event->axis) { case DIAI_Z: evt.type = UIET_WHEEL; evt.wheel.device_id = event->device_id; if (event->flags & DIEF_AXISREL) evt.wheel.value = -event->axisrel; else if (event->flags & DIEF_AXISABS) evt.wheel.value = event->axisabs; else break; unique_device_dispatch( device, &evt ); break; default: break; } break; default: break; } } const UniqueDeviceClass unique_wheel_device_class = { data_size: sizeof(WheelData), Initialize: wheel_initialize, Shutdown: wheel_shutdown, Connected: wheel_connected, Disconnected: wheel_disconnected, ProcessEvent: wheel_process_event }; DirectFB-1.2.10/wm/unique/devices/Makefile.am0000644000175000017500000000061111164361026015543 00000000000000## Makefile.am for DirectFB/wm/unique/devices INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/wm AM_CPPFLAGS = \ -DMODULEDIR=\"@MODULEDIR@\" \ -DSOPATH=\"@SOPATH@\" noinst_LTLIBRARIES = libunique_devices.la libunique_devices_la_SOURCES = \ pointer.c \ wheel.c \ keyboard.c DirectFB-1.2.10/wm/unique/devices/Makefile.in0000644000175000017500000003714711307521510015565 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = wm/unique/devices DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libunique_devices_la_LIBADD = am_libunique_devices_la_OBJECTS = pointer.lo wheel.lo keyboard.lo libunique_devices_la_OBJECTS = $(am_libunique_devices_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libunique_devices_la_SOURCES) DIST_SOURCES = $(libunique_devices_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/wm AM_CPPFLAGS = \ -DMODULEDIR=\"@MODULEDIR@\" \ -DSOPATH=\"@SOPATH@\" noinst_LTLIBRARIES = libunique_devices.la libunique_devices_la_SOURCES = \ pointer.c \ wheel.c \ keyboard.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu wm/unique/devices/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu wm/unique/devices/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libunique_devices.la: $(libunique_devices_la_OBJECTS) $(libunique_devices_la_DEPENDENCIES) $(LINK) $(libunique_devices_la_OBJECTS) $(libunique_devices_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wheel.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/wm/unique/devices/keyboard.c0000644000175000017500000001313111245562152015457 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Keyboard, "UniQuE/Keyboard", "UniQuE's Keyboard Device Class" ); typedef struct { int magic; } KeyboardData; /**************************************************************************************************/ static DFBResult keyboard_initialize( UniqueDevice *device, void *data, void *ctx ) { KeyboardData *keyboard = data; D_MAGIC_ASSERT( device, UniqueDevice ); D_DEBUG_AT( UniQuE_Keyboard, "keyboard_initialize( %p, %p, %p )\n", device, data, ctx ); D_MAGIC_SET( keyboard, KeyboardData ); return DFB_OK; } static void keyboard_shutdown( UniqueDevice *device, void *data, void *ctx ) { KeyboardData *keyboard = data; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( keyboard, KeyboardData ); D_DEBUG_AT( UniQuE_Keyboard, "keyboard_shutdown( %p, %p, %p )\n", device, data, ctx ); D_MAGIC_CLEAR( keyboard ); } static void keyboard_connected( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ) { KeyboardData *keyboard = data; (void) keyboard; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( keyboard, KeyboardData ); D_ASSERT( source != NULL ); D_DEBUG_AT( UniQuE_Keyboard, "keyboard_connected( %p, %p, %p, %p )\n", device, data, ctx, source ); } static void keyboard_disconnected( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ) { KeyboardData *keyboard = data; (void) keyboard; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( keyboard, KeyboardData ); D_ASSERT( source != NULL ); D_DEBUG_AT( UniQuE_Keyboard, "keyboard_disconnected( %p, %p, %p, %p )\n", device, data, ctx, source ); } static void keyboard_process_event( UniqueDevice *device, void *data, void *ctx, const DFBInputEvent *event ) { UniqueInputEvent evt; KeyboardData *keyboard = data; (void) keyboard; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( keyboard, KeyboardData ); D_ASSERT( event != NULL ); D_DEBUG_AT( UniQuE_Keyboard, "keyboard_process_event( %p, %p, %p, %p ) <- type 0x%08x\n", device, data, ctx, event, event->type ); switch (event->type) { case DIET_KEYPRESS: case DIET_KEYRELEASE: evt.type = UIET_KEY; evt.keyboard.device_id = event->device_id; evt.keyboard.press = (event->type == DIET_KEYPRESS); evt.keyboard.key_code = event->key_code; evt.keyboard.key_id = event->key_id; evt.keyboard.key_symbol = event->key_symbol; evt.keyboard.modifiers = event->modifiers; evt.keyboard.locks = event->locks; unique_device_dispatch( device, &evt ); break; default: break; } } static bool keyboard_filter_event( const UniqueInputEvent *event, const UniqueInputEvent *filter ) { D_ASSERT( event != NULL ); D_ASSERT( filter != NULL ); D_DEBUG_AT( UniQuE_Keyboard, "keyboard_filter_event( %p, %p )\n", event, filter ); if (filter->keyboard.key_code != -1) return (filter->keyboard.key_code == event->keyboard.key_code); return (event->keyboard.modifiers == filter->keyboard.modifiers && event->keyboard.key_symbol == filter->keyboard.key_symbol); } const UniqueDeviceClass unique_keyboard_device_class = { data_size: sizeof(KeyboardData), Initialize: keyboard_initialize, Shutdown: keyboard_shutdown, Connected: keyboard_connected, Disconnected: keyboard_disconnected, ProcessEvent: keyboard_process_event, FilterEvent: keyboard_filter_event }; DirectFB-1.2.10/wm/unique/devices/pointer.c0000644000175000017500000001676211245562152015354 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Pointer, "UniQuE/Pointer", "UniQuE's Pointer Device Class" ); typedef struct { int magic; int x; int y; } PointerData; /**************************************************************************************************/ static DFBResult pointer_initialize( UniqueDevice *device, void *data, void *ctx ) { PointerData *pointer = data; D_MAGIC_ASSERT( device, UniqueDevice ); D_DEBUG_AT( UniQuE_Pointer, "pointer_initialize( %p, %p, %p )\n", device, data, ctx ); D_MAGIC_SET( pointer, PointerData ); return DFB_OK; } static void pointer_shutdown( UniqueDevice *device, void *data, void *ctx ) { PointerData *pointer = data; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( pointer, PointerData ); D_DEBUG_AT( UniQuE_Pointer, "pointer_shutdown( %p, %p, %p )\n", device, data, ctx ); D_MAGIC_CLEAR( pointer ); } static void pointer_connected( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ) { PointerData *pointer = data; (void) pointer; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( pointer, PointerData ); D_ASSERT( source != NULL ); D_DEBUG_AT( UniQuE_Pointer, "pointer_connected( %p, %p, %p, %p )\n", device, data, ctx, source ); } static void pointer_disconnected( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ) { PointerData *pointer = data; (void) pointer; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( pointer, PointerData ); D_ASSERT( source != NULL ); D_DEBUG_AT( UniQuE_Pointer, "pointer_disconnected( %p, %p, %p, %p )\n", device, data, ctx, source ); } static void pointer_process_event( UniqueDevice *device, void *data, void *ctx, const DFBInputEvent *event ) { UniqueInputEvent evt; PointerData *pointer = data; UniqueContext *context = ctx; CoreWindowStack *stack; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( pointer, PointerData ); D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( event != NULL ); D_DEBUG_AT( UniQuE_Pointer, "pointer_process_event( %p, %p, %p, %p ) <- type 0x%08x\n", device, data, ctx, event, event->type ); stack = context->stack; D_ASSERT( stack != NULL ); switch (event->type) { case DIET_AXISMOTION: { /*int x = pointer->x; int y = pointer->y;*/ int x = stack->cursor.x; int y = stack->cursor.y; if (event->flags & DIEF_AXISREL) { int rel = event->axisrel; /* handle cursor acceleration */ if (rel > stack->cursor.threshold) rel += (rel - stack->cursor.threshold) * stack->cursor.numerator / stack->cursor.denominator; else if (rel < -stack->cursor.threshold) rel += (rel + stack->cursor.threshold) * stack->cursor.numerator / stack->cursor.denominator; switch (event->axis) { case DIAI_X: x += rel; break; case DIAI_Y: y += rel; break; default: return; } } else if (event->flags & DIEF_AXISABS) { switch (event->axis) { case DIAI_X: x = event->axisabs; break; case DIAI_Y: y = event->axisabs; break; default: return; } } else return; if (x < 0) x = 0; else if (x >= context->width) x = context->width - 1; if (y < 0) y = 0; else if (y >= context->height) y = context->height - 1; if (x == pointer->x && y == pointer->y) return; pointer->x = x; pointer->y = y; evt.type = UIET_MOTION; evt.pointer.device_id = event->device_id; evt.pointer.x = x; evt.pointer.y = y; evt.pointer.buttons = event->buttons; unique_device_dispatch( device, &evt ); break; } case DIET_BUTTONPRESS: case DIET_BUTTONRELEASE: evt.type = UIET_BUTTON; evt.pointer.device_id = event->device_id; evt.pointer.press = (event->type == DIET_BUTTONPRESS); evt.pointer.x = pointer->x; evt.pointer.y = pointer->y; evt.pointer.button = event->button; evt.pointer.buttons = event->buttons; unique_device_dispatch( device, &evt ); break; default: break; } } const UniqueDeviceClass unique_pointer_device_class = { data_size: sizeof(PointerData), Initialize: pointer_initialize, Shutdown: pointer_shutdown, Connected: pointer_connected, Disconnected: pointer_disconnected, ProcessEvent: pointer_process_event }; DirectFB-1.2.10/wm/unique/input_channel.c0000644000175000017500000001532411245562152015072 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_InputChan, "UniQuE/InputChan", "UniQuE's Input Channel" ); static const ReactionFunc unique_input_channel_globals[] = { _unique_window_input_channel_listener, NULL }; /**************************************************************************************************/ DFBResult unique_input_channel_create( CoreDFB *core, UniqueContext *context, UniqueInputChannel **ret_channel ) { UniqueInputChannel *channel; D_DEBUG_AT( UniQuE_InputChan, "unique_input_channel_create( context %p )\n", context ); D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( ret_channel != NULL ); /* Allocate channel data. */ channel = SHCALLOC( context->shmpool, 1, sizeof(UniqueInputChannel) ); if (!channel) { D_WARN( "out of (shared) memory" ); return D_OOSHM(); } /* Initialize channel data. */ channel->context = context; /* Create reactor for dispatching events. */ channel->reactor = fusion_reactor_new( sizeof(UniqueInputEvent), "UniQuE Input Channel", dfb_core_world(core) ); if (!channel->reactor) { SHFREE( context->shmpool, channel ); return DFB_FUSION; } fusion_reactor_set_lock( channel->reactor, &context->stack->context->lock ); D_MAGIC_SET( channel, UniqueInputChannel ); D_DEBUG_AT( UniQuE_InputChan, " -> channel created (%p)\n", channel ); *ret_channel = channel; return DFB_OK; } DFBResult unique_input_channel_destroy( UniqueInputChannel *channel ) { UniqueContext *context; D_MAGIC_ASSERT( channel, UniqueInputChannel ); context = channel->context; D_MAGIC_ASSERT( context, UniqueContext ); D_DEBUG_AT( UniQuE_InputChan, "unique_input_channel_destroy( %p )\n", channel ); fusion_reactor_free( channel->reactor ); D_MAGIC_CLEAR( channel ); SHFREE( context->shmpool, channel ); return DFB_OK; } DFBResult unique_input_channel_attach( UniqueInputChannel *channel, ReactionFunc func, void *ctx, Reaction *reaction ) { D_MAGIC_ASSERT( channel, UniqueInputChannel ); return fusion_reactor_attach( channel->reactor, func, ctx, reaction ); } DFBResult unique_input_channel_detach( UniqueInputChannel *channel, Reaction *reaction ) { D_MAGIC_ASSERT( channel, UniqueInputChannel ); return fusion_reactor_detach( channel->reactor, reaction ); } DFBResult unique_input_channel_attach_global( UniqueInputChannel *channel, int index, void *ctx, GlobalReaction *reaction ) { D_MAGIC_ASSERT( channel, UniqueInputChannel ); return fusion_reactor_attach_global( channel->reactor, index, ctx, reaction ); } DFBResult unique_input_channel_detach_global( UniqueInputChannel *channel, GlobalReaction *reaction ) { D_MAGIC_ASSERT( channel, UniqueInputChannel ); return fusion_reactor_detach_global( channel->reactor, reaction ); } DFBResult unique_input_channel_dispatch( UniqueInputChannel *channel, const UniqueInputEvent *event ) { D_MAGIC_ASSERT( channel, UniqueInputChannel ); D_ASSERT( event != NULL ); D_DEBUG_AT( UniQuE_InputChan, "unique_input_channel_dispatch( %p, %p ) <- type 0x%08x\n", channel, event, event->type ); switch (event->type) { case UIET_MOTION: D_DEBUG_AT( UniQuE_InputChan, " -> MOTION %d, %d, buttons 0x%04x\n", event->pointer.x, event->pointer.y, event->pointer.buttons ); break; case UIET_BUTTON: D_DEBUG_AT( UniQuE_InputChan, " -> BUTTON %d, %d, buttons 0x%04x, button %d, %s\n", event->pointer.x, event->pointer.y, event->pointer.buttons, event->pointer.button, event->pointer.press ? "pressed" : "released" ); break; case UIET_WHEEL: D_DEBUG_AT( UniQuE_InputChan, " -> WHEEL %d\n", event->wheel.value ); break; case UIET_KEY: D_DEBUG_AT( UniQuE_InputChan, " -> KEY 0x%08x, modifiers 0x%04x, %s\n", event->keyboard.key_symbol, event->keyboard.modifiers, event->keyboard.press ? "pressed" : "released" ); break; case UIET_CHANNEL: D_DEBUG_AT( UniQuE_InputChan, " -> CHANNEL %d, %d, index %d, %s\n", event->channel.x, event->channel.y, event->channel.index, event->channel.selected ? "selected" : "deselected" ); break; default: D_DEBUG_AT( UniQuE_InputChan, " -> unknown type 0x%08x\n", event->type ); break; } return fusion_reactor_dispatch( channel->reactor, event, true, unique_input_channel_globals ); } DirectFB-1.2.10/wm/unique/types.h0000644000175000017500000000376311245562152013420 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__TYPES_H__ #define __UNIQUE__TYPES_H__ typedef struct __UniQuE_UniqueContext UniqueContext; typedef struct __UniQuE_UniqueDecoration UniqueDecoration; typedef struct __UniQuE_UniqueDecorationItem UniqueDecorationItem; typedef struct __UniQuE_UniqueDevice UniqueDevice; typedef struct __UniQuE_UniqueLayout UniqueLayout; typedef struct __UniQuE_UniqueWindow UniqueWindow; typedef struct __UniQuE_UniqueInputChannel UniqueInputChannel; typedef union __UniQuE_UniqueInputEvent UniqueInputEvent; typedef struct __UniQuE_UniqueInputFilter UniqueInputFilter; typedef struct __UniQuE_UniqueInputSwitch UniqueInputSwitch; typedef struct __UniQuE_StretRegion StretRegion; typedef struct __UniQuE_WMData WMData; typedef struct __UniQuE_WMShared WMShared; #endif DirectFB-1.2.10/wm/unique/Makefile.am0000644000175000017500000000574211164361026014133 00000000000000## Makefile.am for DirectFB/wm/unique SUBDIRS = classes data devices INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/wm \ -I$(top_builddir)/wm bin_PROGRAMS = uwmdump noinst_PROGRAMS = test_color test_foo stret_test uwmdump_SOURCES = uwmdump.c uwmdump_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la test_color_SOURCES = test_color.c test_color_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la test_foo_SOURCES = test_foo.c test_foo_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la stret_test_SOURCES = stret_test.c stret_test_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la # Set module installation directory wmdir = $(MODULEDIR)/wm # Build wm module wm_LTLIBRARIES = libdirectfbwm_unique.la if BUILD_STATIC wm_DATA = libdirectfbwm_unique.o endif libdirectfbwm_unique_la_SOURCES = \ unique.c # Link module against uniquewm library libdirectfbwm_unique_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la \ libuniquewm.la libdirectfbwm_unique_la_LDFLAGS = \ -avoid-version \ -module # Set header installation directory includedir = @INCLUDEDIR@/unique # Install uniquewm's library header files include_HEADERS = \ context.h \ decoration.h \ device.h \ input_channel.h \ input_events.h \ input_switch.h \ stret.h \ stret_iteration.h \ types.h \ uniquewm.h \ window.h # Build uniquewm library lib_LTLIBRARIES = libuniquewm.la libuniquewm_la_SOURCES = \ context.c \ decoration.c \ device.c \ input_channel.c \ input_switch.c \ internal.h \ stret.c \ stret_iteration.c \ uniquewm.c \ window.c libuniquewm_la_LIBADD = \ classes/libunique_classes.la \ devices/libunique_devices.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libuniquewm_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) include $(top_srcdir)/rules/libobject.make # ## and now rebuild the static version with the *correct* object files # if BUILD_STATIC clean-local: rm -f libuniquewm_fixed.a all-local: libuniquewm_fixed.a libuniquewm_fixed.a: .libs/libuniquewm.a rm -f libuniquewm_fixed.a ${AR} cru libuniquewm_fixed.a `find . -name "*.o" | grep -v '.libs'` ${RANLIB} libuniquewm_fixed.a cp -pf libuniquewm_fixed.a .libs/libuniquewm.a .libs/libuniquewm.a: libuniquewm.la else clean-local: all-local: endif DirectFB-1.2.10/wm/unique/decoration.h0000644000175000017500000000734211245562152014400 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__DECORATION_H__ #define __UNIQUE__DECORATION_H__ #include #include typedef enum { UDF_NONE = 0x00000000, UDF_DESTROYED = 0x00000001, UDF_ALL = 0x00000001 } UniqueDecorationFlags; typedef enum { UDNF_NONE = 0x00000000, UDNF_DESTROYED = 0x00000001, UDNF_ALL = 0x00000001 } UniqueDecorationNotificationFlags; typedef struct { UniqueDecorationNotificationFlags flags; UniqueDecoration *decoration; } UniqueDecorationNotification; typedef enum { UPOR_TOP_LEFT, UPOR_TOP_MIDDLE, UPOR_TOP_RIGHT, UPOR_MIDDLE_LEFT, UPOR_MIDDLE_MIDDLE, UPOR_MIDDLE_RIGHT, UPOR_BOTTOM_LEFT, UPOR_BOTTOM_MIDDLE, UPOR_BOTTOM_RIGHT } UniquePointOfReference; typedef enum { UDSM_BOTH_ABSOLUTE, UDSM_BOTH_RELATIVE, UDSM_ABSOLUTE_WIDTH, UDSM_ABSOLUTE_HEIGHT } UniqueDecorationSizeMode; typedef struct { const UniqueLayout *other; UniquePointOfReference first; UniquePointOfReference second; DFBPoint offset; } UniqueLayoutRelation; struct __UniQuE_UniqueLayout { UniqueLayoutRelation origin; UniqueLayoutRelation extent; UniqueLayoutRelation optional; }; DFBResult unique_decoration_create ( UniqueWindow *window, UniqueDecorationFlags flags, UniqueDecoration **ret_decoration ); DFBResult unique_decoration_destroy ( UniqueDecoration *decoration ); DFBResult unique_decoration_notify ( UniqueDecoration *decoration, UniqueDecorationNotificationFlags flags ); DFBResult unique_decoration_update ( UniqueDecoration *decoration, const DFBRegion *region ); DFBResult unique_decoration_add_item( UniqueDecoration *decoration, const UniqueLayout *layout, UniqueDecorationItem **ret_item ); /* * Creates a pool of decoration objects. */ FusionObjectPool *unique_decoration_pool_create( const FusionWorld *world ); /* * Generates unique_decoration_ref(), unique_decoration_attach() etc. */ FUSION_OBJECT_METHODS( UniqueDecoration, unique_decoration ) /* global reactions */ typedef enum { UNIQUE_FOO_DECORATION_LISTENER } UNIQUE_DECORATION_GLOBALS; #endif DirectFB-1.2.10/wm/unique/Makefile.in0000644000175000017500000010007711307521507014142 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = uwmdump$(EXEEXT) noinst_PROGRAMS = test_color$(EXEEXT) test_foo$(EXEEXT) \ stret_test$(EXEEXT) DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/rules/libobject.make subdir = wm/unique ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(wmdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(wmdir)" \ "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) wmLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) $(wm_LTLIBRARIES) libdirectfbwm_unique_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libuniquewm.la am_libdirectfbwm_unique_la_OBJECTS = unique.lo libdirectfbwm_unique_la_OBJECTS = \ $(am_libdirectfbwm_unique_la_OBJECTS) libdirectfbwm_unique_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfbwm_unique_la_LDFLAGS) $(LDFLAGS) -o $@ libuniquewm_la_DEPENDENCIES = classes/libunique_classes.la \ devices/libunique_devices.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libuniquewm_la_OBJECTS = context.lo decoration.lo device.lo \ input_channel.lo input_switch.lo stret.lo stret_iteration.lo \ uniquewm.lo window.lo libuniquewm_la_OBJECTS = $(am_libuniquewm_la_OBJECTS) libuniquewm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libuniquewm_la_LDFLAGS) $(LDFLAGS) -o $@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_stret_test_OBJECTS = stret_test.$(OBJEXT) stret_test_OBJECTS = $(am_stret_test_OBJECTS) stret_test_DEPENDENCIES = libuniquewm.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_test_color_OBJECTS = test_color.$(OBJEXT) test_color_OBJECTS = $(am_test_color_OBJECTS) test_color_DEPENDENCIES = libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_test_foo_OBJECTS = test_foo.$(OBJEXT) test_foo_OBJECTS = $(am_test_foo_OBJECTS) test_foo_DEPENDENCIES = libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_uwmdump_OBJECTS = uwmdump.$(OBJEXT) uwmdump_OBJECTS = $(am_uwmdump_OBJECTS) uwmdump_DEPENDENCIES = libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfbwm_unique_la_SOURCES) $(libuniquewm_la_SOURCES) \ $(stret_test_SOURCES) $(test_color_SOURCES) \ $(test_foo_SOURCES) $(uwmdump_SOURCES) DIST_SOURCES = $(libdirectfbwm_unique_la_SOURCES) \ $(libuniquewm_la_SOURCES) $(stret_test_SOURCES) \ $(test_color_SOURCES) $(test_foo_SOURCES) $(uwmdump_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive wmDATA_INSTALL = $(INSTALL_DATA) DATA = $(wm_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ # Set header installation directory includedir = @INCLUDEDIR@/unique infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = classes data devices INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/wm \ -I$(top_builddir)/wm uwmdump_SOURCES = uwmdump.c uwmdump_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la test_color_SOURCES = test_color.c test_color_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la test_foo_SOURCES = test_foo.c test_foo_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la stret_test_SOURCES = stret_test.c stret_test_LDADD = \ libuniquewm.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la # Set module installation directory wmdir = $(MODULEDIR)/wm # Build wm module wm_LTLIBRARIES = libdirectfbwm_unique.la @BUILD_STATIC_TRUE@wm_DATA = libdirectfbwm_unique.o libdirectfbwm_unique_la_SOURCES = \ unique.c # Link module against uniquewm library libdirectfbwm_unique_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la \ libuniquewm.la libdirectfbwm_unique_la_LDFLAGS = \ -avoid-version \ -module # Install uniquewm's library header files include_HEADERS = \ context.h \ decoration.h \ device.h \ input_channel.h \ input_events.h \ input_switch.h \ stret.h \ stret_iteration.h \ types.h \ uniquewm.h \ window.h # Build uniquewm library lib_LTLIBRARIES = libuniquewm.la libuniquewm_la_SOURCES = \ context.c \ decoration.c \ device.c \ input_channel.c \ input_switch.c \ internal.h \ stret.c \ stret_iteration.c \ uniquewm.c \ window.c libuniquewm_la_LIBADD = \ classes/libunique_classes.la \ devices/libunique_devices.la \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libuniquewm_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu wm/unique/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu wm/unique/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-wmLTLIBRARIES: $(wm_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(wmdir)" || $(MKDIR_P) "$(DESTDIR)$(wmdir)" @list='$(wm_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(wmLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(wmdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(wmLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(wmdir)/$$f"; \ else :; fi; \ done uninstall-wmLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(wm_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(wmdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(wmdir)/$$p"; \ done clean-wmLTLIBRARIES: -test -z "$(wm_LTLIBRARIES)" || rm -f $(wm_LTLIBRARIES) @list='$(wm_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfbwm_unique.la: $(libdirectfbwm_unique_la_OBJECTS) $(libdirectfbwm_unique_la_DEPENDENCIES) $(libdirectfbwm_unique_la_LINK) -rpath $(wmdir) $(libdirectfbwm_unique_la_OBJECTS) $(libdirectfbwm_unique_la_LIBADD) $(LIBS) libuniquewm.la: $(libuniquewm_la_OBJECTS) $(libuniquewm_la_DEPENDENCIES) $(libuniquewm_la_LINK) -rpath $(libdir) $(libuniquewm_la_OBJECTS) $(libuniquewm_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done stret_test$(EXEEXT): $(stret_test_OBJECTS) $(stret_test_DEPENDENCIES) @rm -f stret_test$(EXEEXT) $(LINK) $(stret_test_OBJECTS) $(stret_test_LDADD) $(LIBS) test_color$(EXEEXT): $(test_color_OBJECTS) $(test_color_DEPENDENCIES) @rm -f test_color$(EXEEXT) $(LINK) $(test_color_OBJECTS) $(test_color_LDADD) $(LIBS) test_foo$(EXEEXT): $(test_foo_OBJECTS) $(test_foo_DEPENDENCIES) @rm -f test_foo$(EXEEXT) $(LINK) $(test_foo_OBJECTS) $(test_foo_LDADD) $(LIBS) uwmdump$(EXEEXT): $(uwmdump_OBJECTS) $(uwmdump_DEPENDENCIES) @rm -f uwmdump$(EXEEXT) $(LINK) $(uwmdump_OBJECTS) $(uwmdump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decoration.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input_channel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input_switch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stret.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stret_iteration.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stret_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_color.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_foo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unique.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uniquewm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uwmdump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-wmDATA: $(wm_DATA) @$(NORMAL_INSTALL) test -z "$(wmdir)" || $(MKDIR_P) "$(DESTDIR)$(wmdir)" @list='$(wm_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(wmDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wmdir)/$$f'"; \ $(wmDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wmdir)/$$f"; \ done uninstall-wmDATA: @$(NORMAL_UNINSTALL) @list='$(wm_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(wmdir)/$$f'"; \ rm -f "$(DESTDIR)$(wmdir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \ all-local install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(wmdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(wmdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local clean-noinstPROGRAMS \ clean-wmLTLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-includeHEADERS install-wmDATA \ install-wmLTLIBRARIES install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-wmDATA \ uninstall-wmLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstPROGRAMS clean-wmLTLIBRARIES ctags ctags-recursive \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip install-wmDATA \ install-wmLTLIBRARIES installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-wmDATA uninstall-wmLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # # @BUILD_STATIC_TRUE@clean-local: @BUILD_STATIC_TRUE@ rm -f libuniquewm_fixed.a @BUILD_STATIC_TRUE@all-local: libuniquewm_fixed.a @BUILD_STATIC_TRUE@libuniquewm_fixed.a: .libs/libuniquewm.a @BUILD_STATIC_TRUE@ rm -f libuniquewm_fixed.a @BUILD_STATIC_TRUE@ ${AR} cru libuniquewm_fixed.a `find . -name "*.o" | grep -v '.libs'` @BUILD_STATIC_TRUE@ ${RANLIB} libuniquewm_fixed.a @BUILD_STATIC_TRUE@ cp -pf libuniquewm_fixed.a .libs/libuniquewm.a @BUILD_STATIC_TRUE@.libs/libuniquewm.a: libuniquewm.la @BUILD_STATIC_FALSE@clean-local: @BUILD_STATIC_FALSE@all-local: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/wm/unique/window.h0000644000175000017500000001035211245562152013553 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__WINDOW_H__ #define __UNIQUE__WINDOW_H__ #include #include #include typedef enum { UWF_NONE = 0x00000000, UWF_VISIBLE = 0x00000001, UWF_DECORATED = 0x00000002, UWF_DESTROYED = 0x00000010, UWF_ALL = 0x00000013 } UniqueWindowFlags; typedef enum { UWNF_NONE = 0x00000000, UWNF_DESTROYED = 0x00000001, UWNF_UPDATE = 0x00000010, UWNF_ALL = 0x00000011 } UniqueWindowNotificationFlags; typedef struct { UniqueWindowNotificationFlags flags; UniqueWindow *window; DFBRegion update; } UniqueWindowNotification; DFBResult unique_window_create ( CoreDFB *core, CoreWindow *window, UniqueContext *context, DFBWindowCapabilities caps, const CoreWindowConfig *config, UniqueWindow **ret_window ); DFBResult unique_window_close ( UniqueWindow *window ); DFBResult unique_window_destroy ( UniqueWindow *window ); DFBResult unique_window_notify ( UniqueWindow *window, UniqueWindowNotificationFlags flags ); DFBResult unique_window_update ( UniqueWindow *window, const DFBRegion *region, DFBSurfaceFlipFlags flags ); DFBResult unique_window_post_event ( UniqueWindow *window, DFBWindowEvent *event ); DFBResult unique_window_set_config ( UniqueWindow *window, const CoreWindowConfig *config, CoreWindowConfigFlags flags ); DFBResult unique_window_get_config ( UniqueWindow *window, CoreWindowConfig *config ); DFBResult unique_window_restack ( UniqueWindow *window, UniqueWindow *relative, int relation ); DFBResult unique_window_grab ( UniqueWindow *window, const CoreWMGrab *grab ); DFBResult unique_window_ungrab ( UniqueWindow *window, const CoreWMGrab *grab ); DFBResult unique_window_request_focus( UniqueWindow *window ); /* * Creates a pool of window objects. */ FusionObjectPool *unique_window_pool_create( const FusionWorld *world ); /* * Generates unique_window_ref(), unique_window_attach() etc. */ FUSION_OBJECT_METHODS( UniqueWindow, unique_window ) /* global reactions */ typedef enum { UNIQUE_WM_MODULE_WINDOW_LISTENER } UNIQUE_WINDOW_GLOBALS; #endif DirectFB-1.2.10/wm/unique/input_switch.c0000644000175000017500000005370411245562152014767 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_InpSw, "UniQuE/InpSwitch", "UniQuE's Input Switch" ); typedef struct { DirectLink link; int magic; UniqueDevice *device; GlobalReaction reaction; } SwitchConnection; /**************************************************************************************************/ static void purge_connection( UniqueInputSwitch *input_switch, SwitchConnection *connection ); static bool target_switch ( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ); static bool update_targets ( UniqueInputSwitch *input_switch ); /**************************************************************************************************/ DFBResult unique_input_switch_create( UniqueContext *context, UniqueInputSwitch **ret_switch ) { int i; WMShared *shared; UniqueInputSwitch *input_switch; D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_create( context %p )\n", context ); D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( ret_switch != NULL ); shared = context->shared; D_MAGIC_ASSERT( shared, WMShared ); /* Allocate switch data. */ input_switch = SHCALLOC( context->shmpool, 1, sizeof(UniqueInputSwitch) ); if (!input_switch) { D_WARN( "out of (shared) memory" ); return D_OOSHM(); } /* Initialize input_switch data. */ input_switch->context = context; /* Set class ID of each target. */ for (i=0; i<_UDCI_NUM; i++) input_switch->targets[i].clazz = shared->device_classes[i]; D_MAGIC_SET( input_switch, UniqueInputSwitch ); D_DEBUG_AT( UniQuE_InpSw, " -> input_switch created (%p)\n", input_switch ); *ret_switch = input_switch; return DFB_OK; } DFBResult unique_input_switch_destroy( UniqueInputSwitch *input_switch ) { int i; DirectLink *n; SwitchConnection *connection; UniqueContext *context; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_destroy( %p )\n", input_switch ); direct_list_foreach_safe (connection, n, input_switch->connections) { D_MAGIC_ASSERT( connection, SwitchConnection ); purge_connection( input_switch, connection ); } D_ASSERT( input_switch->connections == NULL ); for (i=0; i<_UDCI_NUM; i++) { UniqueInputFilter *filter; UniqueInputTarget *target = &input_switch->targets[i]; direct_list_foreach_safe (filter, n, target->filters) { D_MAGIC_ASSERT( filter, UniqueInputFilter ); D_MAGIC_ASSERT( filter->channel, UniqueInputChannel ); D_DEBUG_AT( UniQuE_InpSw, " -> filter %p, index %d, channel %p\n", filter, filter->index, filter->channel ); direct_list_remove( &target->filters, &filter->link ); D_MAGIC_CLEAR( filter ); SHFREE( context->shmpool, filter ); } D_ASSERT( target->filters == NULL ); } D_MAGIC_CLEAR( input_switch ); SHFREE( context->shmpool, input_switch ); return DFB_OK; } DFBResult unique_input_switch_add( UniqueInputSwitch *input_switch, UniqueDevice *device ) { DFBResult ret; SwitchConnection *connection; UniqueContext *context; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( device, UniqueDevice ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_add( %p, %p )\n", input_switch, device ); /* Allocate connection structure. */ connection = SHCALLOC( context->shmpool, 1, sizeof(SwitchConnection) ); if (!connection) { D_WARN( "out of (shared) memory" ); return D_OOSHM(); } /* Initialize connection structure. */ connection->device = device; /* Attach global reaction for processing events. */ ret = unique_device_attach_global( device, UNIQUE_INPUT_SWITCH_DEVICE_LISTENER, input_switch, &connection->reaction ); if (ret) { D_DERROR( ret, "UniQuE/InpSwitch: Could not attach global device reaction!\n" ); SHFREE( context->shmpool, connection ); return ret; } /* Add the new connection to the list. */ direct_list_append( &input_switch->connections, &connection->link ); D_MAGIC_SET( connection, SwitchConnection ); return DFB_OK; } DFBResult unique_input_switch_remove( UniqueInputSwitch *input_switch, UniqueDevice *device ) { SwitchConnection *connection; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( device, UniqueDevice ); D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_remove( %p, %p )\n", input_switch, device ); direct_list_foreach (connection, input_switch->connections) { D_MAGIC_ASSERT( connection, SwitchConnection ); if (connection->device == device) break; } if (!connection) { D_WARN( "device not found amoung connections" ); return DFB_ITEMNOTFOUND; } purge_connection( input_switch, connection ); return DFB_OK; } DFBResult unique_input_switch_select( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ) { UniqueInputTarget *target; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( channel, UniqueInputChannel ); D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_select( %p, %d, %p )\n", input_switch, index, channel ); D_ASSERT( index >= 0 ); D_ASSERT( index < _UDCI_NUM ); target = &input_switch->targets[index]; target->normal = channel; if (!target->fixed && !target->implicit) target_switch( input_switch, index, channel ); return DFB_OK; } DFBResult unique_input_switch_set( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ) { UniqueInputTarget *target; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( channel, UniqueInputChannel ); D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_set( %p, %d, %p )\n", input_switch, index, channel ); D_ASSERT( index >= 0 ); D_ASSERT( index < _UDCI_NUM ); target = &input_switch->targets[index]; if (target->fixed) return DFB_BUSY; target->fixed = channel; target_switch( input_switch, index, channel ); return DFB_OK; } DFBResult unique_input_switch_unset( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ) { UniqueInputTarget *target; D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_unset( %p, %d, %p )\n", input_switch, index, channel ); D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( channel, UniqueInputChannel ); D_ASSERT( index >= 0 ); D_ASSERT( index < _UDCI_NUM ); target = &input_switch->targets[index]; if (target->fixed != channel) return DFB_ACCESSDENIED; target->fixed = NULL; update_targets( input_switch ); //target_switch( input_switch, index, target->normal ); return DFB_OK; } DFBResult unique_input_switch_set_filter( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel, const UniqueInputEvent *event, UniqueInputFilter **ret_filter ) { UniqueInputFilter *filter; UniqueInputTarget *target; UniqueContext *context; D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_set_filter( %p, %d, %p, %p )\n", input_switch, index, channel, event ); D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( channel, UniqueInputChannel ); D_ASSERT( index >= 0 ); D_ASSERT( index < _UDCI_NUM ); D_ASSERT( event != NULL ); D_ASSERT( ret_filter != NULL ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); target = &input_switch->targets[index]; direct_list_foreach (filter, target->filters) { D_MAGIC_ASSERT( filter, UniqueInputFilter ); if (unique_device_filter( target->clazz, event, &filter->filter )) return DFB_BUSY; } /* Allocate new filter. */ filter = SHCALLOC( context->shmpool, 1, sizeof(UniqueInputFilter) ); if (!filter) return D_OOSHM(); filter->index = index; filter->channel = channel; filter->filter = *event; direct_list_append( &target->filters, &filter->link ); D_MAGIC_SET( filter, UniqueInputFilter ); *ret_filter = filter; return DFB_OK; } DFBResult unique_input_switch_unset_filter( UniqueInputSwitch *input_switch, UniqueInputFilter *filter ) { UniqueInputTarget *target; UniqueContext *context; D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_unset_filter( %p, %p )\n", input_switch, filter ); D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( filter, UniqueInputFilter ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( filter->index >= 0 ); D_ASSERT( filter->index < _UDCI_NUM ); target = &input_switch->targets[filter->index]; direct_list_remove( &target->filters, &filter->link ); D_MAGIC_CLEAR( filter ); SHFREE( context->shmpool, filter ); return DFB_OK; } DFBResult unique_input_switch_drop( UniqueInputSwitch *input_switch, UniqueInputChannel *channel ) { int i; UniqueContext *context; D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_drop( %p, %p )\n", input_switch, channel ); D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( channel, UniqueInputChannel ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); for (i=0; i<_UDCI_NUM; i++) { DirectLink *n; UniqueInputFilter *filter; UniqueInputTarget *target = &input_switch->targets[i]; if (target->normal == channel) target->normal = NULL; if (target->fixed == channel) target->fixed = NULL; if (target->implicit == channel) target->implicit = NULL; if (target->current == channel) target->current = NULL; D_DEBUG_AT( UniQuE_InpSw, " -> index %d, filters %p\n", i, target->filters ); direct_list_foreach_safe (filter, n, target->filters) { D_MAGIC_ASSERT( filter, UniqueInputFilter ); D_MAGIC_ASSERT( filter->channel, UniqueInputChannel ); D_DEBUG_AT( UniQuE_InpSw, " -> filter %p, channel %p\n", filter, filter->channel ); D_ASSUME( filter->channel != channel ); if (filter->channel == channel) { direct_list_remove( &target->filters, &filter->link ); D_MAGIC_CLEAR( filter ); SHFREE( context->shmpool, filter ); } } } if (!input_switch->targets[UDCI_POINTER].fixed) update_targets( input_switch ); return DFB_OK; } DFBResult unique_input_switch_update( UniqueInputSwitch *input_switch, UniqueInputChannel *channel ) { int x, y, i; StretRegion *region; UniqueContext *context; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); x = input_switch->x; y = input_switch->y; D_DEBUG_AT( UniQuE_InpSw, "unique_input_switch_update( %d, %d )\n", x, y ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); region = stret_region_at( context->root, x, y, SRF_INPUT, SRCID_UNKNOWN ); if (region) { for (i=0; i<_UDCI_NUM; i++) { UniqueInputTarget *target = &input_switch->targets[i]; if (target->normal == channel) stret_region_get_input( region, i, x, y, &target->normal ); } } else { for (i=0; i<_UDCI_NUM; i++) { UniqueInputTarget *target = &input_switch->targets[i]; if (target->normal == channel) target->normal = NULL; } } for (i=0; i<_UDCI_NUM; i++) { UniqueInputTarget *target = &input_switch->targets[i]; target_switch( input_switch, i, target->fixed ? : target->implicit ? : target->normal ); } return DFB_OK; } /**************************************************************************************************/ static bool target_switch( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ) { UniqueInputEvent evt; UniqueInputTarget *target; UniqueInputChannel *current; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_ASSERT( index >= 0 ); D_ASSERT( index < _UDCI_NUM ); target = &input_switch->targets[index]; current = target->current; D_MAGIC_ASSERT_IF( channel, UniqueInputChannel ); D_MAGIC_ASSERT_IF( current, UniqueInputChannel ); if (channel == current) return false; D_DEBUG_AT( UniQuE_InpSw, "target_switch( index %d, x %d, y %d, channel %p )\n", index, input_switch->x, input_switch->y, channel ); evt.type = UIET_CHANNEL; evt.channel.index = index; evt.channel.x = input_switch->x; evt.channel.y = input_switch->y; if (current) { evt.channel.selected = false; unique_input_channel_dispatch( current, &evt ); } target->current = channel; if (channel) { evt.channel.selected = true; unique_input_channel_dispatch( channel, &evt ); } return true; } static void target_dispatch( UniqueInputTarget *target, const UniqueInputEvent *event ) { UniqueInputFilter *filter; UniqueInputChannel *channel; D_ASSERT( target != NULL ); D_ASSERT( event != NULL ); channel = target->current; D_MAGIC_ASSERT_IF( channel, UniqueInputChannel ); direct_list_foreach (filter, target->filters) { D_MAGIC_ASSERT( filter, UniqueInputFilter ); if (unique_device_filter( target->clazz, event, &filter->filter )) { channel = filter->channel; D_MAGIC_ASSERT( channel, UniqueInputChannel ); break; } } if (channel) unique_input_channel_dispatch( channel, event ); else D_DEBUG_AT( UniQuE_InpSw, "target_dispatch( class %d ) " "<- no selected channel, dropping event.\n", target->clazz ); } static bool update_targets( UniqueInputSwitch *input_switch ) { int x, y, i; StretRegion *region; UniqueContext *context; bool updated[_UDCI_NUM]; D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); x = input_switch->x; y = input_switch->y; D_DEBUG_AT( UniQuE_InpSw, "update_targets( %d, %d )\n", x, y ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); region = stret_region_at( context->root, x, y, SRF_INPUT, SRCID_UNKNOWN ); if (region) { for (i=0; i<_UDCI_NUM; i++) stret_region_get_input( region, i, x, y, &input_switch->targets[i].normal ); } else { for (i=0; i<_UDCI_NUM; i++) input_switch->targets[i].normal = NULL; } for (i=0; i<_UDCI_NUM; i++) { UniqueInputTarget *target = &input_switch->targets[i]; updated[i] = target_switch( input_switch, i, target->fixed ? : target->implicit ? : target->normal ); } return updated[UDCI_POINTER]; } ReactionResult _unique_input_switch_device_listener( const void *msg_data, void *ctx ) { const UniqueInputEvent *event = msg_data; UniqueInputSwitch *inpsw = ctx; UniqueInputTarget *target = NULL; UniqueContext *context; (void) event; (void) inpsw; D_ASSERT( event != NULL ); D_MAGIC_ASSERT( inpsw, UniqueInputSwitch ); context = inpsw->context; D_MAGIC_ASSERT( context, UniqueContext ); if (dfb_windowstack_lock( context->stack )) return RS_OK; if (!context->active) { dfb_windowstack_unlock( context->stack ); return RS_OK; } D_DEBUG_AT( UniQuE_InpSw, "_unique_input_switch_device_listener( %p, %p )\n", event, inpsw ); switch (event->type) { case UIET_MOTION: target = &inpsw->targets[UDCI_POINTER]; inpsw->x = event->pointer.x; inpsw->y = event->pointer.y; if (!target->fixed && !target->implicit && update_targets( inpsw )) break; target_dispatch( target, event ); break; case UIET_BUTTON: target = &inpsw->targets[UDCI_POINTER]; if (event->pointer.press && !target->implicit) { D_DEBUG_AT( UniQuE_InpSw, " -> implicit pointer grab, %p\n", target->current ); target->implicit = target->current; } target_dispatch( target, event ); if (!event->pointer.press && !event->pointer.buttons) { D_ASSUME( target->implicit != NULL ); if (target->implicit) { D_DEBUG_AT( UniQuE_InpSw, " -> implicit pointer ungrab, %p\n", target->implicit ); target->implicit = NULL; if (!target->fixed) update_targets( inpsw ); } } break; case UIET_WHEEL: target_dispatch( &inpsw->targets[UDCI_WHEEL], event ); break; case UIET_KEY: target = &inpsw->targets[UDCI_KEYBOARD]; if (event->keyboard.press && !target->implicit) { D_DEBUG_AT( UniQuE_InpSw, " -> implicit keyboard grab, %p\n", target->current ); target->implicit = target->current; } target_dispatch( target, event ); if (!event->keyboard.press && !event->keyboard.modifiers) { //D_ASSUME( target->implicit != NULL ); if (target->implicit) { D_DEBUG_AT( UniQuE_InpSw, " -> implicit keyboard ungrab, %p\n", target->implicit ); if (!target->fixed) target_switch( inpsw, UDCI_KEYBOARD, target->normal ); target->implicit = NULL; } } break; default: D_ONCE( "unknown event type" ); break; } dfb_windowstack_unlock( context->stack ); return RS_OK; } /**************************************************************************************************/ static void purge_connection( UniqueInputSwitch *input_switch, SwitchConnection *connection ) { UniqueContext *context; D_DEBUG_AT( UniQuE_InpSw, "purge_connection( %p, %p )\n", input_switch, connection ); D_MAGIC_ASSERT( input_switch, UniqueInputSwitch ); D_MAGIC_ASSERT( connection, SwitchConnection ); context = input_switch->context; D_MAGIC_ASSERT( context, UniqueContext ); /* Detach global reaction for receiving events. */ unique_device_detach_global( connection->device, &connection->reaction ); direct_list_remove( &input_switch->connections, &connection->link ); D_MAGIC_CLEAR( connection ); SHFREE( context->shmpool, connection ); } DirectFB-1.2.10/wm/unique/uniquewm.c0000644000175000017500000003226711245562152014122 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_WM, "UniQuE/WM", "UniQuE - Universal Quark Emitter" ); /**************************************************************************************************/ static CoreDFB *dfb_core; static WMData *wm_data; static WMShared *wm_shared; /**************************************************************************************************/ static const StretRegionClass *region_classes[_URCI_NUM] = { &unique_root_region_class, &unique_frame_region_class, &unique_window_region_class, &unique_foo_region_class }; static DFBResult register_region_classes ( WMShared *shared, bool master ); static DFBResult unregister_region_classes( WMShared *shared ); /**************************************************************************************************/ static const UniqueDeviceClass *device_classes[_UDCI_NUM] = { &unique_pointer_device_class, &unique_wheel_device_class, &unique_keyboard_device_class }; static DFBResult register_device_classes ( WMShared *shared, bool master ); static DFBResult unregister_device_classes( WMShared *shared ); /**************************************************************************************************/ static DFBResult load_foo( CoreDFB *core, WMShared *shared ) { int i; DFBResult ret; CoreSurfaceBufferLock lock; D_ASSERT( core != NULL ); D_MAGIC_ASSERT( shared, WMShared ); ret = dfb_surface_create_simple( core, foo_desc.width, foo_desc.height, foo_desc.pixelformat, DSCAPS_NONE, CSTF_SHARED, 0, NULL, &shared->foo_surface ); if (ret) { D_DERROR( ret, "UniQuE/WM: Could not create %dx%d surface for border tiles!\n", foo_desc.width, foo_desc.height ); return ret; } ret = dfb_surface_lock_buffer( shared->foo_surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); if (ret) { D_DERROR( ret, "UniQuE/WM: Could not lock surface for border tiles!\n" ); dfb_surface_unref( shared->foo_surface ); return ret; } for (i=0; ifoo_surface, lock.addr, lock.pitch, 0, i ), foo_data + i * foo_desc.preallocated[0].pitch, DFB_BYTES_PER_LINE( foo_desc.pixelformat, foo_desc.width ) ); } dfb_surface_unlock_buffer( shared->foo_surface, &lock ); dfb_surface_globalize( shared->foo_surface ); return DFB_OK; } static void unload_foo( WMShared *shared ) { D_MAGIC_ASSERT( shared, WMShared ); dfb_surface_unlink( &shared->foo_surface ); } /**************************************************************************************************/ DFBResult unique_wm_module_init( CoreDFB *core, WMData *data, WMShared *shared, bool master ) { DFBResult ret; D_DEBUG_AT( UniQuE_WM, "unique_wm_init( core %p, data %p, shared %p, %s )\n", core, data, shared, master ? "master" : "slave" ); D_ASSERT( core != NULL ); D_ASSERT( data != NULL ); D_ASSERT( data->context_notify != NULL ); D_ASSERT( data->window_notify != NULL ); D_MAGIC_ASSERT( shared, WMShared ); D_ASSERT( dfb_core == NULL ); D_ASSERT( wm_data == NULL ); D_ASSERT( wm_shared == NULL ); if (data->module_abi != UNIQUE_WM_ABI_VERSION) { D_ERROR( "UniQuE/WM: Module ABI version (%d) does not match %d!\n", data->module_abi, UNIQUE_WM_ABI_VERSION ); return DFB_VERSIONMISMATCH; } ret = register_region_classes( shared, master ); if (ret) return ret; ret = register_device_classes( shared, master ); if (ret) goto error_device; if (master) { int i; ret = load_foo( core, shared ); if (ret) goto error_foo; ret = dfb_input_add_global( _unique_device_listener, &shared->device_listener ); if (ret) goto error_global; shared->context_pool = unique_context_pool_create( data->world ); shared->decoration_pool = unique_decoration_pool_create( data->world ); shared->window_pool = unique_window_pool_create( data->world ); shared->insets.l = foo[UFI_W].rect.w; shared->insets.t = foo[UFI_N].rect.h; shared->insets.r = foo[UFI_E].rect.w; shared->insets.b = foo[UFI_S].rect.h; for (i=0; i<8; i++) shared->foo_rects[i] = foo[i].rect; } else dfb_input_set_global( _unique_device_listener, shared->device_listener ); dfb_core = core; wm_data = data; wm_shared = shared; return DFB_OK; error_global: unload_foo( shared ); error_foo: unregister_device_classes( shared ); error_device: unregister_region_classes( shared ); return ret; } void unique_wm_module_deinit( WMData *data, WMShared *shared, bool master, bool emergency ) { D_DEBUG_AT( UniQuE_WM, "unique_wm_deinit( %s%s ) <- core %p, data %p, shared %p\n", master ? "master" : "slave", emergency ? ", emergency" : "", dfb_core, wm_data, wm_shared ); D_ASSERT( dfb_core != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( wm_data == data ); D_MAGIC_ASSERT( shared, WMShared ); D_ASSERT( wm_shared == shared ); if (master) { fusion_object_pool_destroy( shared->window_pool, data->world ); fusion_object_pool_destroy( shared->decoration_pool, data->world ); fusion_object_pool_destroy( shared->context_pool, data->world ); } unregister_device_classes( shared ); unregister_region_classes( shared ); //FIXME unload_foo( wm_shared ); dfb_core = NULL; wm_data = NULL; wm_shared = NULL; } ReactionResult _unique_wm_module_context_listener( const void *msg_data, void *ctx ) { const UniqueContextNotification *notification = msg_data; D_ASSERT( wm_data != NULL ); D_ASSERT( wm_data->context_notify != NULL ); D_ASSERT( notification != NULL ); D_ASSERT( ! D_FLAGS_IS_SET( notification->flags, ~UCNF_ALL ) ); D_DEBUG_AT( UniQuE_WM, "%s( context %p, flags 0x%08x )\n", __FUNCTION__, notification->context, notification->flags ); return wm_data->context_notify( wm_data, notification, ctx ); } ReactionResult _unique_wm_module_window_listener ( const void *msg_data, void *ctx ) { const UniqueWindowNotification *notification = msg_data; D_ASSERT( wm_data != NULL ); D_ASSERT( wm_data->window_notify != NULL ); D_ASSERT( notification != NULL ); D_ASSERT( ! D_FLAGS_IS_SET( notification->flags, ~UWNF_ALL ) ); D_DEBUG_AT( UniQuE_WM, "%s( window %p, flags 0x%08x )\n", __FUNCTION__, notification->window, notification->flags ); return wm_data->window_notify( wm_data, notification, ctx ); } UniqueContext * unique_wm_create_context( void ) { D_ASSERT( dfb_core != NULL ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( wm_shared, WMShared ); D_ASSERT( wm_shared->context_pool != NULL ); return (UniqueContext*) fusion_object_create( wm_shared->context_pool, wm_data->world ); } UniqueDecoration * unique_wm_create_decoration( void ) { D_ASSERT( dfb_core != NULL ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( wm_shared, WMShared ); D_ASSERT( wm_shared->decoration_pool != NULL ); return (UniqueDecoration*) fusion_object_create( wm_shared->decoration_pool, wm_data->world ); } UniqueWindow * unique_wm_create_window( void ) { D_ASSERT( dfb_core != NULL ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( wm_shared, WMShared ); D_ASSERT( wm_shared->window_pool != NULL ); return (UniqueWindow*) fusion_object_create( wm_shared->window_pool, wm_data->world ); } /**************************************************************************************************/ bool unique_wm_running( void ) { if (dfb_core) { if (!wm_data || !wm_shared) { D_BUG( "partly initialized module (%p,%p,%p)", dfb_core, wm_data, wm_shared ); return false; } return true; } return false; } DirectResult unique_wm_enum_contexts( FusionObjectCallback callback, void *ctx ) { D_ASSERT( dfb_core != NULL ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( wm_shared, WMShared ); D_ASSERT( wm_shared->context_pool != NULL ); return fusion_object_pool_enum( wm_shared->context_pool, callback, ctx ); } DirectResult unique_wm_enum_windows( FusionObjectCallback callback, void *ctx ) { D_ASSERT( dfb_core != NULL ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( wm_shared, WMShared ); D_ASSERT( wm_shared->context_pool != NULL ); return fusion_object_pool_enum( wm_shared->window_pool, callback, ctx ); } /**************************************************************************************************/ static DFBResult register_region_classes( WMShared *shared, bool master ) { int i; DFBResult ret; StretRegionClassID class_id; D_MAGIC_ASSERT( shared, WMShared ); for (i=0; i<_URCI_NUM; i++) { ret = stret_class_register( region_classes[i], &class_id ); if (ret) { D_DERROR( ret, "UniQuE/WM: Failed to register region class %d!\n", i ); goto error; } if (master) shared->region_classes[i] = class_id; else if (shared->region_classes[i] != class_id) { D_ERROR( "UniQuE/WM: Class IDs mismatch (%d/%d)!\n", class_id, shared->region_classes[i] ); stret_class_unregister( class_id ); ret = DFB_VERSIONMISMATCH; goto error; } } return DFB_OK; error: while (--i >= 0) stret_class_unregister( shared->region_classes[i] ); return ret; } static DFBResult unregister_region_classes( WMShared *shared ) { int i; D_MAGIC_ASSERT( shared, WMShared ); for (i=_URCI_NUM-1; i>=0; i--) stret_class_unregister( shared->region_classes[i] ); return DFB_OK; } static DFBResult register_device_classes( WMShared *shared, bool master ) { int i; DFBResult ret; UniqueDeviceClassID class_id; D_MAGIC_ASSERT( shared, WMShared ); for (i=0; i<_UDCI_NUM; i++) { ret = unique_device_class_register( device_classes[i], &class_id ); if (ret) { D_DERROR( ret, "UniQuE/WM: Failed to register device class %d!\n", i ); goto error; } if (master) shared->device_classes[i] = class_id; else if (shared->device_classes[i] != class_id) { D_ERROR( "UniQuE/WM: Class IDs mismatch (%d/%d)!\n", class_id, shared->device_classes[i] ); unique_device_class_unregister( class_id ); ret = DFB_VERSIONMISMATCH; goto error; } } return DFB_OK; error: while (--i >= 0) unique_device_class_unregister( shared->device_classes[i] ); return ret; } static DFBResult unregister_device_classes( WMShared *shared ) { int i; D_MAGIC_ASSERT( shared, WMShared ); for (i=_UDCI_NUM-1; i>=0; i--) unique_device_class_unregister( shared->device_classes[i] ); return DFB_OK; } DirectFB-1.2.10/wm/unique/stret_test.c0000644000175000017500000001263111245562152014441 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include int main( int argc, char *argv[] ) { DirectResult ret; FusionWorld *world; StretRegion *root; StretRegion *child[16]; int child_num = 0; StretIteration iteration; DFBRegion clip; FusionSHMPoolShared *pool; ret = fusion_enter( -1, 0, FER_ANY, &world ); if (ret) return -1; ret = fusion_shm_pool_create( world, "StReT Test Pool", 0x10000, direct_config->debug, &pool ); if (ret) { fusion_exit( world, false ); return -1; } D_INFO( "StReT/Test: Starting...\n" ); ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 2, 0, 0, 1000, 1000, NULL, 0, pool, &root ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create root region!\n" ); goto error_root; } else { ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 1, 10, 10, 100, 100, root, 1, pool, &child[child_num++] ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create child region!\n" ); goto error_child; } else { ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 1, 50, 50, 30, 30, child[0], 0, pool, &child[child_num++] ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create child region!\n" ); goto error_child; } ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 1, 20, 20, 30, 30, child[0], 0, pool, &child[child_num++] ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create child region!\n" ); goto error_child; } else { ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 1, 10, 10, 10, 10, child[2], 0, pool, &child[child_num++] ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create child region!\n" ); goto error_child; } ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 1, 20, 20, 10, 10, child[2], 0, pool, &child[child_num++] ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create child region!\n" ); goto error_child; } } } ret = stret_region_create( 0, NULL, 0, SRF_ACTIVE, 1, 200, 10, 200, 200, root, 0, pool, &child[child_num++] ); if (ret) { D_DERROR( ret, "StReT/Test: Could not create child region!\n" ); goto error_child; } } stret_iteration_init( &iteration, root, NULL ); clip = (DFBRegion) { 50, 50, 200, 59 }; D_ASSERT( stret_iteration_next( &iteration, &clip ) == child[4] ); //D_ASSERT( stret_iteration_next( &iteration, &clip ) == child[3] ); D_ASSERT( stret_iteration_next( &iteration, &clip ) == child[2] ); //D_ASSERT( stret_iteration_next( &iteration, &clip ) == child[1] ); D_ASSERT( stret_iteration_next( &iteration, &clip ) == child[0] ); D_ASSERT( stret_iteration_next( &iteration, &clip ) == child[5] ); D_ASSERT( stret_iteration_next( &iteration, &clip ) == root ); D_ASSERT( stret_iteration_next( &iteration, &clip ) == NULL ); stret_region_destroy( child[child_num-1] ); error_child: while (--child_num) stret_region_destroy( child[child_num-1] ); stret_region_destroy( root ); error_root: fusion_shm_pool_destroy( world, pool ); fusion_exit( world, false ); return 0; } DirectFB-1.2.10/wm/unique/uniquewm.h0000644000175000017500000000316311245562152014120 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__UNIQUEWM_H__ #define __UNIQUE__UNIQUEWM_H__ #include #include #include bool unique_wm_running ( void ); DirectResult unique_wm_enum_contexts( FusionObjectCallback callback, void *ctx ); DirectResult unique_wm_enum_windows ( FusionObjectCallback callback, void *ctx ); #endif DirectFB-1.2.10/wm/unique/device.h0000644000175000017500000001200111245562152013474 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__DEVICE_H__ #define __UNIQUE__DEVICE_H__ #include #include #include #include typedef struct { int data_size; DFBResult (*Initialize) ( UniqueDevice *device, void *data, void *ctx ); void (*Shutdown) ( UniqueDevice *device, void *data, void *ctx ); void (*Connected) ( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ); void (*Disconnected)( UniqueDevice *device, void *data, void *ctx, CoreInputDevice *source ); void (*ProcessEvent)( UniqueDevice *device, void *data, void *ctx, const DFBInputEvent *event ); bool (*FilterEvent) ( const UniqueInputEvent *event, const UniqueInputEvent *filter ); } UniqueDeviceClass; typedef unsigned int UniqueDeviceID; typedef unsigned int UniqueDeviceClassID; typedef enum { UDCI_POINTER, UDCI_WHEEL, UDCI_KEYBOARD, _UDCI_NUM } UniqueDeviceClassIndex; DFBResult unique_device_class_register ( const UniqueDeviceClass *clazz, UniqueDeviceClassID *ret_id ); DFBResult unique_device_class_unregister( UniqueDeviceClassID id ); DFBResult unique_device_create ( CoreDFB *core, UniqueContext *context, UniqueDeviceClassID class_id, void *ctx, UniqueDevice **ret_device ); DFBResult unique_device_destroy ( UniqueDevice *device ); DFBResult unique_device_connect ( UniqueDevice *device, CoreInputDevice *source ); DFBResult unique_device_disconnect ( UniqueDevice *device, CoreInputDevice *source ); DFBResult unique_device_attach ( UniqueDevice *device, ReactionFunc func, void *ctx, Reaction *reaction ); DFBResult unique_device_detach ( UniqueDevice *device, Reaction *reaction ); DFBResult unique_device_attach_global( UniqueDevice *device, int index, void *ctx, GlobalReaction *reaction ); DFBResult unique_device_detach_global( UniqueDevice *device, GlobalReaction *reaction ); DFBResult unique_device_dispatch ( UniqueDevice *device, const UniqueInputEvent *event ); bool unique_device_filter ( UniqueDeviceClassID class_id, const UniqueInputEvent *event, const UniqueInputEvent *filter ); /* global reactions */ typedef enum { UNIQUE_INPUT_SWITCH_DEVICE_LISTENER, UNIQUE_CURSOR_DEVICE_LISTENER } UNIQUE_DEVICE_GLOBALS; #endif DirectFB-1.2.10/wm/unique/uwmdump.c0000644000175000017500000001576211245562152013747 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include static void print_usage( const char *prg_name ) { fprintf( stderr, "\n" "UniQuE Dump (version %s)\n" "\n" "Usage: %s [options]\n" "\n" "Options:\n" " -h, --help Show this help message\n" " -v, --version Print version information\n" "\n", DIRECTFB_VERSION, prg_name ); } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; const char *prg_name = strrchr( argv[0], '/' ); if (prg_name) prg_name++; else prg_name = argv[0]; for (n = 1; n < argc; n++) { const char *a = argv[n]; if (*a != '-') { print_usage( prg_name ); return DFB_FALSE; } if (strcmp (a, "-h") == 0 || strcmp (a, "--help") == 0) { print_usage( prg_name ); return DFB_FALSE; } if (strcmp (a, "-v") == 0 || strcmp (a, "--version") == 0) { fprintf (stderr, "dfbg version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } } return DFB_TRUE; } static bool window_callback( UniqueWindow *window ) { int refs; DirectResult ret; DFBRectangle *bounds = &window->bounds; if (window->object.state != FOS_ACTIVE) return true; ret = fusion_ref_stat( &window->object.ref, &refs ); if (ret) { printf( "Fusion error %d!\n", ret ); return false; } #if FUSION_BUILD_MULTI printf( "0x%08x : ", window->object.ref.multi.id ); #else printf( "N/A : " ); #endif printf( "%3d ", refs ); printf( "%4d, %4d ", bounds->x, bounds->y ); printf( "%4d x %4d ", bounds->w, bounds->h ); printf( "0x%02x ", window->opacity ); printf( "%5d ", dfb_window_id( window->window ) ); switch (window->stacking) { case DWSC_UPPER: printf( "^ " ); break; case DWSC_MIDDLE: printf( "- " ); break; case DWSC_LOWER: printf( "v " ); break; default: printf( "? " ); break; } if (D_FLAGS_IS_SET( window->flags, UWF_VISIBLE )) printf( "VISIBLE " ); if (D_FLAGS_IS_SET( window->flags, UWF_DECORATED )) printf( "DECORATED " ); if (D_FLAGS_IS_SET( window->flags, UWF_DESTROYED )) printf( "DESTROYED " ); printf( "\n" ); return true; } static bool context_callback( FusionObjectPool *pool, FusionObject *object, void *ctx ) { int refs; DirectResult ret; UniqueContext *context = (UniqueContext*) object; if (object->state != FOS_ACTIVE) return true; ret = fusion_ref_stat( &object->ref, &refs ); if (ret) { printf( "Fusion error %d!\n", ret ); return false; } printf( "\n" "-------[ Contexts ]-------\n" "Reference . Refs Windows\n" "--------------------------\n" ); #if FUSION_BUILD_MULTI printf( "0x%08x : ", object->ref.multi.id ); #else printf( "N/A : " ); #endif printf( "%3d ", refs ); printf( "%2d ", fusion_vector_size( &context->windows ) ); printf( "\n" ); ret = dfb_windowstack_lock( context->stack ); if (ret) { D_DERROR( ret, "UniQuE/Dump: Could not lock window stack!\n" ); return true; } if (fusion_vector_has_elements( &context->windows )) { int index; UniqueWindow *window; printf( "\n" "-----------------------------------[ Windows ]------------------------------------\n" ); printf( "Reference . Refs X Y Width Height Opacity ID Flags\n" ); printf( "----------------------------------------------------------------------------------\n" ); fusion_vector_foreach_reverse( window, index, context->windows ) window_callback( window ); } dfb_windowstack_unlock( context->stack ); printf( "\n" ); return true; } int main( int argc, char *argv[] ) { DFBResult ret; CoreDFB *core; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Create the super interface. */ ret = dfb_core_create( &core ); if (ret) { DirectFBError( "dfb_core_create() failed", ret ); return -3; } if (!unique_wm_running()) { D_ERROR( "UniQuE/Dump: This session doesn't run UniQuE!\n" ); dfb_core_destroy( core, false ); return EXIT_FAILURE; } unique_wm_enum_contexts( context_callback, NULL ); /* Release the super interface. */ dfb_core_destroy( core, false ); return EXIT_SUCCESS; } DirectFB-1.2.10/wm/unique/decoration.c0000644000175000017500000001237111245562152014371 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include /* FIXME */ #include /* FIXME */ #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Decoration, "UniQuE/Decoration", "UniQuE's Decoration Object" ); static const ReactionFunc unique_decoration_globals[] = { /* _unique_foo_decoration_listener,*/ NULL }; /**************************************************************************************************/ static void decoration_destructor( FusionObject *object, bool zombie, void *ctx ) { UniqueDecoration *decoration = (UniqueDecoration*) object; D_MAGIC_ASSERT( decoration, UniqueDecoration ); D_DEBUG_AT( UniQuE_Decoration, "destroying %p%s\n", decoration, zombie ? " (ZOMBIE)" : ""); unique_window_unlink( &decoration->window ); unique_context_unlink( &decoration->context ); D_MAGIC_CLEAR( decoration ); fusion_object_destroy( object ); } FusionObjectPool * unique_decoration_pool_create( const FusionWorld *world ) { return fusion_object_pool_create( "UniQuE Decoration Pool", sizeof(UniqueDecoration), sizeof(UniqueDecorationNotification), decoration_destructor, NULL, world ); } /**************************************************************************************************/ DFBResult unique_decoration_create( UniqueWindow *window, UniqueDecorationFlags flags, UniqueDecoration **ret_decoration ) { DFBResult ret; UniqueDecoration *decoration; UniqueContext *context; D_ASSERT( window != NULL ); D_ASSERT( D_FLAGS_ARE_IN( flags, UDF_ALL ) ); D_ASSERT( ret_decoration != NULL ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); /* Create a decoration object. */ decoration = unique_wm_create_decoration(); if (!decoration) return DFB_FUSION; /* Initialize deocration data. */ decoration->flags = flags; ret = unique_window_link( &decoration->window, window ); if (ret) goto error; ret = unique_context_link( &decoration->context, window->context ); if (ret) goto error; D_MAGIC_SET( decoration, UniqueDecoration ); /* Change global reaction lock. */ fusion_object_set_lock( &decoration->object, &context->stack->context->lock ); /* activate object */ fusion_object_activate( &decoration->object ); /* return the new decoration */ *ret_decoration = decoration; return DFB_OK; error: if (decoration->context) unique_context_unlink( &decoration->context ); if (decoration->window) unique_window_unlink( &decoration->window ); fusion_object_destroy( &decoration->object ); return ret; } DFBResult unique_decoration_destroy( UniqueDecoration *decoration ) { D_MAGIC_ASSERT( decoration, UniqueDecoration ); D_FLAGS_SET( decoration->flags, UDF_DESTROYED ); unique_decoration_notify( decoration, UDNF_DESTROYED ); return DFB_OK; } DFBResult unique_decoration_notify( UniqueDecoration *decoration, UniqueDecorationNotificationFlags flags ) { UniqueDecorationNotification notification; D_MAGIC_ASSERT( decoration, UniqueDecoration ); D_ASSERT( flags != UDNF_NONE ); D_ASSERT( ! (flags & ~UDNF_ALL) ); notification.flags = flags; notification.decoration = decoration; return unique_decoration_dispatch( decoration, ¬ification, unique_decoration_globals ); } DFBResult unique_decoration_update( UniqueDecoration *decoration, const DFBRegion *region ) { D_MAGIC_ASSERT( decoration, UniqueDecoration ); DFB_REGION_ASSERT_IF( region ); D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } DirectFB-1.2.10/wm/unique/internal.h0000644000175000017500000002666511245562152014076 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__INTERNAL_H__ #define __UNIQUE__INTERNAL_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #define UNIQUE_WM_ABI_VERSION 12 extern const StretRegionClass unique_root_region_class; extern const StretRegionClass unique_frame_region_class; extern const StretRegionClass unique_window_region_class; extern const StretRegionClass unique_foo_region_class; extern const UniqueDeviceClass unique_pointer_device_class; extern const UniqueDeviceClass unique_wheel_device_class; extern const UniqueDeviceClass unique_keyboard_device_class; typedef enum { URCI_ROOT, URCI_FRAME, URCI_WINDOW, URCI_FOO, _URCI_NUM } UniqueRegionClassIndex; typedef enum { UFI_N, UFI_NE, UFI_E, UFI_SE, UFI_S, UFI_SW, UFI_W, UFI_NW } UniqueFooIndex; typedef ReactionResult (*UniqueWMContextNotify)( WMData *data, const UniqueContextNotification *notification, void *ctx ); typedef ReactionResult (*UniqueWMWindowNotify) ( WMData *data, const UniqueWindowNotification *notification, void *ctx ); struct __UniQuE_WMData { int module_abi; CoreDFB *core; FusionWorld *world; WMShared *shared; UniqueWMContextNotify context_notify; UniqueWMWindowNotify window_notify; }; struct __UniQuE_WMShared { int magic; FusionObjectPool *context_pool; FusionObjectPool *decoration_pool; FusionObjectPool *window_pool; StretRegionClassID region_classes[_URCI_NUM]; UniqueDeviceClassID device_classes[_UDCI_NUM]; int device_listener; /* index of the registered global */ DFBInsets insets; DFBRectangle foo_rects[8]; CoreSurface *foo_surface; }; typedef enum { UNRL_DESKTOP, /* Icons, redirected fullscreen apps (force-desktop) */ UNRL_USER, /* User windows (all currently available stacking classes) */ UNRL_SYSTEM, /* Dock/Panel, Glass, Expos?, Clipboard, Virtual Keyboard, IMs */ UNRL_CURSOR, /* Cursor shape and attached objects, e.g. Drag'N'Drop */ UNRL_SCREEN, /* Display Locking, Screensaver */ _UNRL_NUM } UniqueRootLevel; typedef enum { UNFL_BACKGROUND, /* Background for blended content, effects, decorations */ UNFL_CONTENT, /* The actual DirectFB Window, i.e. its content */ UNFL_FOREGROUND, /* Decorations, effects, any other content overlay */ _UNFL_NUM } UniqueFrameLevel; typedef struct { DirectLink link; DFBInputDeviceKeySymbol symbol; DFBInputDeviceModifierMask modifiers; UniqueWindow *owner; } GrabbedKey; struct __UniQuE_UniqueContext { FusionObject object; int magic; CoreWindowStack *stack; WMShared *shared; CoreLayerRegion *region; CoreSurface *surface; DFBDisplayLayerID layer_id; bool active; DFBColor color; int width; int height; StretRegion *root; FusionVector windows; UniqueInputSwitch *input_switch; UniqueDevice *devices[_UDCI_NUM]; GlobalReaction cursor_reaction; FusionSHMPoolShared *shmpool; UniqueInputChannel *foo_channel; CoreSurface *cursor_bs; /* backing store for region under cursor */ bool cursor_bs_valid; DFBRegion cursor_region; bool cursor_drawn; }; struct __UniQuE_UniqueWindow { FusionObject object; int magic; CoreWindow *window; UniqueContext *context; WMShared *shared; CoreSurface *surface; UniqueInputChannel *channel; GlobalReaction channel_reaction; DirectLink *filters; DFBWindowCapabilities caps; UniqueWindowFlags flags; StretRegion *frame; StretRegion *region; StretRegion *foos[8]; DFBInsets insets; DFBRectangle bounds; /* absolute bounds of the content */ DFBRectangle full; /* absolute bounds of the full frame */ int opacity; /* global alpha factor */ DFBWindowStackingClass stacking; /* level boundaries */ int priority; /* derived from stacking class */ DFBWindowOptions options; /* flags for appearance/behaviour */ DFBWindowEventType events; /* mask of enabled events */ u32 color_key; /* transparent pixel */ DFBRegion opaque; /* region of the window forced to be opaque */ }; struct __UniQuE_UniqueDecoration { FusionObject object; int magic; UniqueWindow *window; UniqueContext *context; UniqueDecorationFlags flags; }; struct __UniQuE_UniqueDecorationItem { const UniqueLayout *layout; DFBPoint pos; /* current offset from window origin */ DFBDimension size; /* current dimensions */ }; struct __UniQuE_StretRegion { int magic; StretRegion *parent; /* Is NULL for the root region. */ int level; /* Level within the parent. */ int index; /* Index within the level. */ int levels; /* Number of levels provided. */ FusionVector *children; /* Children of each level. */ StretRegionFlags flags; /* Control appearance and activity. */ DFBRegion bounds; /* Relative to its parent. */ StretRegionClassID clazz; /* Region class (implementation) used for rendering etc. */ void *data; /* Optional private data of region class. */ unsigned long arg; /* Optional argument for region class instance. */ FusionSHMPoolShared *shmpool; }; struct __UniQuE_UniqueDevice { int magic; UniqueContext *context; UniqueDeviceClassID clazz; /* Device class (implementation) used for processing etc. */ void *data; /* Optional private data of device class. */ void *ctx; /* Optional context for device class instance. */ FusionReactor *reactor; /* UniqueInputEvent deployment */ DirectLink *connections; /* CoreInputDevice connections */ }; struct __UniQuE_UniqueInputFilter { DirectLink link; int magic; UniqueDeviceClassIndex index; UniqueInputChannel *channel; UniqueInputEvent filter; }; typedef struct { UniqueDeviceClassID clazz; UniqueInputChannel *current; UniqueInputChannel *normal; UniqueInputChannel *fixed; UniqueInputChannel *implicit; DirectLink *filters; } UniqueInputTarget; struct __UniQuE_UniqueInputSwitch { int magic; UniqueContext *context; DirectLink *connections; /* UniqueDevice connections */ int x; int y; UniqueInputTarget targets[_UDCI_NUM]; }; struct __UniQuE_UniqueInputChannel { int magic; UniqueContext *context; FusionReactor *reactor; /* UniqueInputEvent arrival */ }; DFBResult unique_wm_module_init ( CoreDFB *core, WMData *data, WMShared *shared, bool master ); void unique_wm_module_deinit( WMData *data, WMShared *shared, bool master, bool emergency ); UniqueContext *unique_wm_create_context( void ); UniqueDecoration *unique_wm_create_decoration( void ); UniqueWindow *unique_wm_create_window( void ); /* HACK: temporary, will move into cursor class */ void unique_draw_cursor( CoreWindowStack *stack, UniqueContext *context, CardState *state, DFBRegion *region ); /* global reactions */ ReactionResult _unique_device_listener ( const void *msg_data, void *ctx ); ReactionResult _unique_wm_module_context_listener ( const void *msg_data, void *ctx ); ReactionResult _unique_wm_module_window_listener ( const void *msg_data, void *ctx ); ReactionResult _unique_cursor_device_listener ( const void *msg_data, void *ctx ); ReactionResult _unique_input_switch_device_listener ( const void *msg_data, void *ctx ); ReactionResult _unique_window_input_channel_listener( const void *msg_data, void *ctx ); #endif DirectFB-1.2.10/wm/unique/input_switch.h0000644000175000017500000000667411245562152015000 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__INPUT_SWITCH_H__ #define __UNIQUE__INPUT_SWITCH_H__ #include #include #include DFBResult unique_input_switch_create ( UniqueContext *context, UniqueInputSwitch **ret_switch ); DFBResult unique_input_switch_destroy ( UniqueInputSwitch *input_switch ); DFBResult unique_input_switch_add ( UniqueInputSwitch *input_switch, UniqueDevice *device ); DFBResult unique_input_switch_remove ( UniqueInputSwitch *input_switch, UniqueDevice *device ); DFBResult unique_input_switch_select ( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ); DFBResult unique_input_switch_set ( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ); DFBResult unique_input_switch_unset ( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel ); DFBResult unique_input_switch_set_filter ( UniqueInputSwitch *input_switch, UniqueDeviceClassIndex index, UniqueInputChannel *channel, const UniqueInputEvent *event, UniqueInputFilter **ret_filter ); DFBResult unique_input_switch_unset_filter( UniqueInputSwitch *input_switch, UniqueInputFilter *filter ); DFBResult unique_input_switch_drop ( UniqueInputSwitch *input_switch, UniqueInputChannel *channel ); DFBResult unique_input_switch_update ( UniqueInputSwitch *input_switch, UniqueInputChannel *channel ); #endif DirectFB-1.2.10/wm/unique/test_foo.c0000644000175000017500000001426711245562152014072 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_TestFoo, "UniQuE/TestFoo", "UniQuE's Test Foo Application" ); /*****************************************************************************/ static IDirectFB *dfb = NULL; /*****************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ); /*****************************************************************************/ static UniqueContext *context; static bool context_callback( FusionObjectPool *pool, FusionObject *object, void *ctx ) { if (object->state != FOS_ACTIVE) return true; context = (UniqueContext*) object; if (unique_context_ref( context )) { D_ERROR( "UniQuE/Test: unique_context_ref() failed!\n" ); return true; } return false; } static ReactionResult foo_channel_listener( const void *msg_data, void *ctx ) { const UniqueInputEvent *event = msg_data; UniqueContext *context = ctx; (void) context; D_ASSERT( event != NULL ); D_MAGIC_ASSERT( context, UniqueContext ); D_DEBUG_AT( UniQuE_TestFoo, "foo_channel_listener( %p, %p )\n", event, context ); switch (event->type) { case UIET_MOTION: //dispatch_motion( window, event ); break; case UIET_BUTTON: //dispatch_button( window, event ); break; case UIET_WHEEL: //dispatch_wheel( window, event ); break; case UIET_KEY: //dispatch_key( window, event ); break; case UIET_CHANNEL: //dispatch_channel( window, event ); break; default: D_ONCE( "unknown event type" ); break; } return RS_OK; } int main( int argc, char *argv[] ) { DFBResult ret; Reaction reaction; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { DirectFBError( "DirectFBCreate() failed", ret ); return -3; } if (!unique_wm_running()) { D_ERROR( "UniQuE/Test: This session doesn't run UniQuE!\n" ); dfb->Release( dfb ); return EXIT_FAILURE; } unique_wm_enum_contexts( context_callback, NULL ); if (!context) { D_ERROR( "UniQuE/Test: No context available!\n" ); dfb->Release( dfb ); return EXIT_FAILURE; } unique_input_channel_attach( context->foo_channel, foo_channel_listener, context, &reaction ); pause(); unique_input_channel_detach( context->foo_channel, &reaction ); unique_context_unref( context ); /* Release the super interface. */ dfb->Release( dfb ); return EXIT_SUCCESS; } /*****************************************************************************/ static void print_usage( const char *prg_name ) { fprintf( stderr, "\n" "UniQuE Foo Test (version %s)\n" "\n" "Usage: %s [options]\n" "\n" "Options:\n" " -h, --help Show this help message\n" " -v, --version Print version information\n" "\n", DIRECTFB_VERSION, prg_name ); } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; const char *prg_name = strrchr( argv[0], '/' ); if (prg_name) prg_name++; else prg_name = argv[0]; for (n = 1; n < argc; n++) { const char *a = argv[n]; if (*a != '-') { print_usage( prg_name ); return DFB_FALSE; } if (strcmp (a, "-h") == 0 || strcmp (a, "--help") == 0) { print_usage( prg_name ); return DFB_FALSE; } if (strcmp (a, "-v") == 0 || strcmp (a, "--version") == 0) { fprintf (stderr, "dfbg version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } } return DFB_TRUE; } DirectFB-1.2.10/wm/unique/stret_iteration.h0000644000175000017500000000413711245562152015467 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__STRET_ITERATION_H__ #define __UNIQUE__STRET_ITERATION_H__ #include #include #define STRET_ITERATION_MAX_DEPTH 4 typedef struct { StretRegion *region; int level; int index; } StretIterationStackFrame; typedef struct { int magic; StretIterationStackFrame stack[STRET_ITERATION_MAX_DEPTH]; int frame; int x0; int y0; StretRegion *abort; } StretIteration; void stret_iteration_init ( StretIteration *iteration, StretRegion *region, StretRegion *abort_at ); StretRegion *stret_iteration_next ( StretIteration *iteration, const DFBRegion *clip ); void stret_iteration_abort( StretIteration *iteration ); #endif DirectFB-1.2.10/wm/unique/device.c0000644000175000017500000003222511245562152013501 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MAX_CLASSES 16 D_DEBUG_DOMAIN( UniQuE_Device, "UniQuE/Device", "UniQuE's Devices" ); static const ReactionFunc unique_device_globals[] = { _unique_input_switch_device_listener, _unique_cursor_device_listener, NULL }; /**************************************************************************************************/ typedef struct { DirectLink link; int magic; DFBInputDeviceID source; GlobalReaction reaction; } DeviceConnection; /**************************************************************************************************/ static void purge_connection( UniqueDevice *device, DeviceConnection *connection ); /**************************************************************************************************/ static const UniqueDeviceClass *classes[MAX_CLASSES] = { NULL }; static pthread_mutex_t classes_lock = PTHREAD_MUTEX_INITIALIZER; static int classes_count = 0; /**************************************************************************************************/ DFBResult unique_device_class_register( const UniqueDeviceClass *clazz, UniqueDeviceClassID *ret_id ) { int i; D_DEBUG_AT( UniQuE_Device, "unique_device_class_register( %p )\n", clazz ); D_ASSERT( clazz != NULL ); D_ASSERT( ret_id != NULL ); pthread_mutex_lock( &classes_lock ); if (classes_count == MAX_CLASSES) { D_WARN( "too many classes" ); pthread_mutex_unlock( &classes_lock ); return DFB_LIMITEXCEEDED; } classes_count++; for (i=0; i New class ID is %d.\n", i ); D_ASSERT( i < MAX_CLASSES ); *ret_id = i; pthread_mutex_unlock( &classes_lock ); return DFB_OK; } DFBResult unique_device_class_unregister( UniqueDeviceClassID id ) { D_DEBUG_AT( UniQuE_Device, "unique_device_class_unregister( %d )\n", id ); pthread_mutex_lock( &classes_lock ); D_ASSERT( id >= 0 ); D_ASSERT( id < MAX_CLASSES ); D_ASSERT( classes[id] != NULL ); classes[id] = NULL; classes_count--; pthread_mutex_unlock( &classes_lock ); return DFB_OK; } /**************************************************************************************************/ DFBResult unique_device_create( CoreDFB *core, UniqueContext *context, UniqueDeviceClassID class_id, void *ctx, UniqueDevice **ret_device ) { DFBResult ret; UniqueDevice *device; const UniqueDeviceClass *clazz; D_DEBUG_AT( UniQuE_Device, "unique_device_create( class %d )\n", class_id ); D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( class_id >= 0 ); D_ASSERT( class_id < MAX_CLASSES ); clazz = classes[class_id]; D_ASSERT( clazz != NULL ); D_ASSERT( ret_device != NULL ); /* Allocate device data. */ device = SHCALLOC( context->shmpool, 1, sizeof(UniqueDevice) ); if (!device) { D_WARN( "out of (shared) memory" ); return D_OOSHM(); } /* Initialize device data. */ device->context = context; device->clazz = class_id; device->ctx = ctx; /* Allocate private device data. */ if (clazz->data_size) { device->data = SHCALLOC( context->shmpool, 1, clazz->data_size ); if (!device->data) { ret = D_OOSHM(); goto error; } } /* Create reactor for dispatching generated events. */ device->reactor = fusion_reactor_new( sizeof(UniqueInputEvent), "UniQuE Device", dfb_core_world(core) ); if (!device->reactor) { ret = DFB_FUSION; goto error; } fusion_reactor_set_lock( device->reactor, &context->stack->context->lock ); D_MAGIC_SET( device, UniqueDevice ); if (clazz->Initialize) { ret = clazz->Initialize( device, device->data, device->ctx ); if (ret) { D_MAGIC_CLEAR( device ); goto error; } } D_DEBUG_AT( UniQuE_Device, " -> device created (%p)\n", device ); *ret_device = device; return DFB_OK; error: if (device->reactor) fusion_reactor_free( device->reactor ); if (device->data) SHFREE( context->shmpool, device->data ); SHFREE( context->shmpool, device ); return ret; } DFBResult unique_device_destroy( UniqueDevice *device ) { DirectLink *n; DeviceConnection *connection; UniqueContext *context; const UniqueDeviceClass *clazz; D_MAGIC_ASSERT( device, UniqueDevice ); context = device->context; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( device->clazz >= 0 ); D_ASSERT( device->clazz < MAX_CLASSES ); clazz = classes[device->clazz]; D_ASSERT( clazz != NULL ); D_DEBUG_AT( UniQuE_Device, "unique_device_destroy( %p )\n", device ); direct_list_foreach_safe (connection, n, device->connections) { D_MAGIC_ASSERT( connection, DeviceConnection ); purge_connection( device, connection ); } D_ASSERT( device->connections == NULL ); if (clazz->Shutdown) clazz->Shutdown( device, device->data, device->ctx ); fusion_reactor_free( device->reactor ); if (device->data) SHFREE( context->shmpool, device->data ); D_MAGIC_CLEAR( device ); SHFREE( context->shmpool, device ); return DFB_OK; } DFBResult unique_device_connect( UniqueDevice *device, CoreInputDevice *source ) { DFBResult ret; WMShared *shared; UniqueContext *context; DeviceConnection *connection; D_MAGIC_ASSERT( device, UniqueDevice ); D_ASSERT( source != NULL ); D_ASSERT( device->clazz >= 0 ); D_ASSERT( device->clazz < MAX_CLASSES ); D_ASSERT( classes[device->clazz] != NULL ); context = device->context; D_MAGIC_ASSERT( context, UniqueContext ); shared = context->shared; D_MAGIC_ASSERT( shared, WMShared ); D_DEBUG_AT( UniQuE_Device, "unique_device_connect( %p, %p, ID %d )\n", device, source, dfb_input_device_id( source ) ); /* Allocate connection structure. */ connection = SHCALLOC( context->shmpool, 1, sizeof(DeviceConnection) ); if (!connection) return D_OOSHM(); /* Initialize connection structure. */ connection->source = dfb_input_device_id( source ); /* Attach global reaction for processing events. */ ret = dfb_input_attach_global( source, shared->device_listener, device, &connection->reaction ); if (ret) { SHFREE( context->shmpool, connection ); return ret; } /* Add the new connection to the list. */ direct_list_append( &device->connections, &connection->link ); D_MAGIC_SET( connection, DeviceConnection ); if (classes[device->clazz]->Connected) classes[device->clazz]->Connected( device, device->data, device->ctx, source ); return DFB_OK; } DFBResult unique_device_disconnect( UniqueDevice *device, CoreInputDevice *source ) { DFBInputDeviceID source_id; DeviceConnection *connection; D_MAGIC_ASSERT( device, UniqueDevice ); D_ASSERT( source != NULL ); D_ASSERT( device->clazz >= 0 ); D_ASSERT( device->clazz < MAX_CLASSES ); D_ASSERT( classes[device->clazz] != NULL ); source_id = dfb_input_device_id( source ); direct_list_foreach (connection, device->connections) { D_MAGIC_ASSERT( connection, DeviceConnection ); if (connection->source == source_id) break; } if (!connection) { D_WARN( "source not found amoung connections" ); return DFB_ITEMNOTFOUND; } purge_connection( device, connection ); return DFB_OK; } DFBResult unique_device_attach( UniqueDevice *device, ReactionFunc func, void *ctx, Reaction *reaction ) { D_MAGIC_ASSERT( device, UniqueDevice ); return fusion_reactor_attach( device->reactor, func, ctx, reaction ); } DFBResult unique_device_detach( UniqueDevice *device, Reaction *reaction ) { D_MAGIC_ASSERT( device, UniqueDevice ); return fusion_reactor_detach( device->reactor, reaction ); } DFBResult unique_device_attach_global( UniqueDevice *device, int index, void *ctx, GlobalReaction *reaction ) { D_MAGIC_ASSERT( device, UniqueDevice ); return fusion_reactor_attach_global( device->reactor, index, ctx, reaction ); } DFBResult unique_device_detach_global( UniqueDevice *device, GlobalReaction *reaction ) { D_MAGIC_ASSERT( device, UniqueDevice ); return fusion_reactor_detach_global( device->reactor, reaction ); } DFBResult unique_device_dispatch( UniqueDevice *device, const UniqueInputEvent *event ) { D_MAGIC_ASSERT( device, UniqueDevice ); return fusion_reactor_dispatch( device->reactor, event, true, unique_device_globals ); } bool unique_device_filter ( UniqueDeviceClassID class_id, const UniqueInputEvent *event, const UniqueInputEvent *filter ) { const UniqueDeviceClass *clazz; D_ASSERT( class_id >= 0 ); D_ASSERT( class_id < MAX_CLASSES ); D_ASSERT( event != NULL ); D_ASSERT( filter != NULL ); clazz = classes[class_id]; D_ASSERT( clazz != NULL ); if (clazz->FilterEvent) return clazz->FilterEvent( event, filter ); return false; } /**************************************************************************************************/ ReactionResult _unique_device_listener( const void *msg_data, void *ctx ) { const DFBInputEvent *event = msg_data; UniqueDevice *device = ctx; D_ASSERT( event != NULL ); D_MAGIC_ASSERT( device, UniqueDevice ); D_ASSERT( device->clazz >= 0 ); D_ASSERT( device->clazz < MAX_CLASSES ); D_ASSERT( classes[device->clazz] != NULL ); D_ASSERT( classes[device->clazz]->ProcessEvent != NULL ); classes[device->clazz]->ProcessEvent( device, device->data, device->ctx, event ); return RS_OK; } /**************************************************************************************************/ static void purge_connection( UniqueDevice *device, DeviceConnection *connection ) { CoreInputDevice *source; UniqueContext *context; D_MAGIC_ASSERT( device, UniqueDevice ); D_MAGIC_ASSERT( connection, DeviceConnection ); context = device->context; D_MAGIC_ASSERT( context, UniqueContext ); source = dfb_input_device_at( connection->source ); D_ASSERT( source != NULL ); /* Detach global reaction for processing events. */ dfb_input_detach_global( source, &connection->reaction ); direct_list_remove( &device->connections, &connection->link ); if (classes[device->clazz]->Disconnected) classes[device->clazz]->Disconnected( device, device->data, device->ctx, source ); D_MAGIC_CLEAR( connection ); SHFREE( context->shmpool, connection ); } DirectFB-1.2.10/wm/unique/unique.c0000644000175000017500000007375311245562152013563 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( WM_Unique, "WM/UniQuE", "UniQuE - Universal Quark Emitter" ); DFB_WINDOW_MANAGER( unique ); /**************************************************************************************************/ typedef struct { int magic; CoreWindowStack *stack; UniqueContext *context; GlobalReaction context_reaction; } StackData; typedef struct { int magic; UniqueContext *context; UniqueWindow *window; GlobalReaction window_reaction; } WindowData; /**************************************************************************************************/ static ReactionResult context_notify( WMData *data, const UniqueContextNotification *notification, void *ctx ) { StackData *stack_data = ctx; D_ASSERT( data != NULL ); D_ASSERT( notification != NULL ); D_ASSERT( notification->context != NULL ); D_MAGIC_ASSERT( stack_data, StackData ); D_ASSERT( notification->context == stack_data->context ); D_MAGIC_ASSERT( stack_data->context, UniqueContext ); D_ASSERT( ! D_FLAGS_IS_SET( notification->flags, ~UCNF_ALL ) ); D_DEBUG_AT( WM_Unique, "context_notify( wm_data %p, stack_data %p )\n", data, stack_data ); if (notification->flags & UCNF_DESTROYED) { D_DEBUG_AT( WM_Unique, " -> context destroyed.\n" ); stack_data->context = NULL; return RS_REMOVE; } return RS_OK; } static ReactionResult window_notify( WMData *data, const UniqueWindowNotification *notification, void *ctx ) { WindowData *window_data = ctx; D_ASSERT( data != NULL ); D_ASSERT( notification != NULL ); D_ASSERT( notification->window != NULL ); D_MAGIC_ASSERT( window_data, WindowData ); D_ASSERT( notification->window == window_data->window ); D_MAGIC_ASSERT( window_data->window, UniqueWindow ); D_ASSERT( ! D_FLAGS_IS_SET( notification->flags, ~UWNF_ALL ) ); D_DEBUG_AT( WM_Unique, "window_notify( wm_data %p, window_data %p )\n", data, window_data ); if (notification->flags & UWNF_DESTROYED) { D_DEBUG_AT( WM_Unique, " -> window destroyed.\n" ); window_data->window = NULL; return RS_REMOVE; } return RS_OK; } /**************************************************************************************************/ static void initialize_data( CoreDFB *core, WMData *data, WMShared *shared ) { D_ASSERT( data != NULL ); /* Initialize local data. */ data->core = core; data->world = dfb_core_world( core ); data->shared = shared; data->module_abi = UNIQUE_WM_ABI_VERSION; /* Set module callbacks. */ data->context_notify = context_notify; data->window_notify = window_notify; } /**************************************************************************************************/ static void wm_get_info( CoreWMInfo *info ) { info->version.major = 0; info->version.minor = 4; info->version.binary = UNIQUE_WM_ABI_VERSION; snprintf( info->name, DFB_CORE_WM_INFO_NAME_LENGTH, "UniQuE" ); snprintf( info->vendor, DFB_CORE_WM_INFO_VENDOR_LENGTH, "Denis Oliver Kropp" ); info->wm_data_size = sizeof(WMData); info->wm_shared_size = sizeof(WMShared); info->stack_data_size = sizeof(StackData); info->window_data_size = sizeof(WindowData); } static DFBResult wm_initialize( CoreDFB *core, void *wm_data, void *shared_data ) { WMData *data = wm_data; WMShared *shared = shared_data; D_DEBUG_AT( WM_Unique, "wm_initialize()\n" ); initialize_data( core, data, shared ); D_MAGIC_SET( shared, WMShared ); return unique_wm_module_init( core, data, shared, true ); } static DFBResult wm_join( CoreDFB *core, void *wm_data, void *shared_data ) { WMData *data = wm_data; WMShared *shared = shared_data; D_DEBUG_AT( WM_Unique, "wm_join()\n" ); initialize_data( core, data, shared ); return unique_wm_module_init( core, data, shared, false ); } static DFBResult wm_shutdown( bool emergency, void *wm_data, void *shared_data ) { WMShared *shared = shared_data; (void) shared; D_DEBUG_AT( WM_Unique, "wm_shutdown()\n" ); unique_wm_module_deinit( wm_data, shared_data, true, emergency ); D_MAGIC_CLEAR( shared ); return DFB_OK; } static DFBResult wm_leave( bool emergency, void *wm_data, void *shared_data ) { D_DEBUG_AT( WM_Unique, "wm_leave()\n" ); unique_wm_module_deinit( wm_data, shared_data, false, emergency ); return DFB_OK; } static DFBResult wm_suspend( void *wm_data, void *shared_data ) { D_DEBUG_AT( WM_Unique, "wm_suspend()\n" ); return DFB_OK; } static DFBResult wm_resume( void *wm_data, void *shared_data ) { D_DEBUG_AT( WM_Unique, "wm_resume()\n" ); return DFB_OK; } static DFBResult wm_post_init( void *wm_data, void *shared_data ) { D_DEBUG_AT( WM_Unique, "wm_post_init()\n" ); return DFB_OK; } /**************************************************************************************************/ static DFBResult wm_init_stack( CoreWindowStack *stack, void *wm_data, void *stack_data ) { DFBResult ret; StackData *data = stack_data; WMData *wmdata = wm_data; CoreLayerContext *context; CoreLayerRegion *region; D_ASSERT( stack != NULL ); D_ASSERT( stack->context != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); context = stack->context; D_ASSERT( context != NULL ); ret = dfb_layer_context_get_primary_region( context, true, ®ion ); if (ret) { D_DERROR( ret, "WM/UniQuE: Could not get the primary region!\n" ); return ret; } /* Create the unique context. */ ret = unique_context_create( wmdata->core, stack, region, context->layer_id, wmdata->shared, &data->context ); dfb_layer_region_unref( region ); if (ret) { D_DERROR( ret, "WM/UniQuE: Could not create the context!\n" ); return ret; } /* Attach the global context listener. */ ret = unique_context_attach_global( data->context, UNIQUE_WM_MODULE_CONTEXT_LISTENER, data, &data->context_reaction ); if (ret) { unique_context_unref( data->context ); D_DERROR( ret, "WM/UniQuE: Could not attach global context listener!\n" ); return ret; } /* Inherit all local references from the layer context. */ ret = unique_context_inherit( data->context, context ); unique_context_unref( data->context ); if (ret) { unique_context_detach_global( data->context, &data->context_reaction ); D_DERROR( ret, "WM/UniQuE: Could not inherit from layer context!\n" ); return ret; } data->stack = stack; D_MAGIC_SET( data, StackData ); return DFB_OK; } static DFBResult wm_close_stack( CoreWindowStack *stack, void *wm_data, void *stack_data ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); D_ASSUME( data->context == NULL ); if (data->context) unique_context_detach_global( data->context, &data->context_reaction ); D_MAGIC_CLEAR( data ); return DFB_OK; } static DFBResult wm_set_active( CoreWindowStack *stack, void *wm_data, void *stack_data, bool active ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) { D_ASSERT( !active ); return DFB_OK; } return unique_context_set_active( data->context, active ); } static DFBResult wm_resize_stack( CoreWindowStack *stack, void *wm_data, void *stack_data, int width, int height ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) return DFB_DESTROYED; return unique_context_resize( data->context, width, height ); } static DFBResult wm_process_input( CoreWindowStack *stack, void *wm_data, void *stack_data, const DFBInputEvent *event ) { StackData *data = stack_data; (void) data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( event != NULL ); D_MAGIC_ASSERT( data, StackData ); return DFB_OK; } static DFBResult wm_flush_keys( CoreWindowStack *stack, void *wm_data, void *stack_data ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) return DFB_DESTROYED; return unique_context_flush_keys( data->context ); } static DFBResult wm_window_at( CoreWindowStack *stack, void *wm_data, void *stack_data, int x, int y, CoreWindow **ret_window ) { DFBResult ret; UniqueWindow *window; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( ret_window != NULL ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) return DFB_DESTROYED; ret = unique_context_window_at( data->context, x, y, &window ); if (ret) return ret; D_MAGIC_ASSERT( window, UniqueWindow ); *ret_window = window->window; return DFB_OK; } static DFBResult wm_window_lookup( CoreWindowStack *stack, void *wm_data, void *stack_data, DFBWindowID window_id, CoreWindow **ret_window ) { DFBResult ret; UniqueWindow *window; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( ret_window != NULL ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) return DFB_DESTROYED; ret = unique_context_lookup_window( data->context, window_id, &window ); if (ret) return ret; D_MAGIC_ASSERT( window, UniqueWindow ); *ret_window = window->window; return DFB_OK; } static DFBResult wm_enum_windows( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWMWindowCallback callback, void *callback_ctx ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( callback != NULL ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) return DFB_DESTROYED; return unique_context_enum_windows( data->context, callback, callback_ctx ); } /**************************************************************************************************/ static DFBResult wm_get_insets( CoreWindowStack *stack, CoreWindow *window, DFBInsets *insets ) { if( insets ) { insets->l=0; insets->t=0; insets->r=0; insets->b=0; } return DFB_OK; } static DFBResult wm_preconfigure_window( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data ) { return DFB_OK; } static DFBResult wm_set_window_property( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data, const char *key, void *value, void **ret_old_value ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( key != NULL ); fusion_object_set_property((FusionObject*)window, key,value,ret_old_value); return DFB_OK; } static DFBResult wm_get_window_property( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data, const char *key, void **ret_value ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( key != NULL ); D_ASSERT( ret_value != NULL ); *ret_value=fusion_object_get_property((FusionObject*)window,key); return DFB_OK; } static DFBResult wm_remove_window_property( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data, const char *key, void **ret_value ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( key != NULL ); fusion_object_remove_property((FusionObject*)window,key,ret_value); return DFB_OK; } static DFBResult wm_add_window( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data ) { DFBResult ret; StackData *sdata = stack_data; WindowData *data = window_data; WMData *wmdata = wm_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( sdata, StackData ); D_MAGIC_ASSERT( sdata->context, UniqueContext ); data->context = sdata->context; /* Create the unique window. */ ret = unique_window_create( wmdata->core, window, data->context, window->caps, &window->config, &data->window ); if (ret) { D_DERROR( ret, "WM/UniQuE: Could not create window!\n" ); return ret; } /* Attach the global window listener. */ ret = unique_window_attach_global( data->window, UNIQUE_WM_MODULE_WINDOW_LISTENER, data, &data->window_reaction ); if (ret) { unique_window_unref( data->window ); D_DERROR( ret, "WM/UniQuE: Could not attach global window listener!\n" ); return ret; } /* Inherit all local references from the layer window. */ ret = unique_window_inherit( data->window, window ); unique_window_unref( data->window ); if (ret) { unique_window_detach_global( data->window, &data->window_reaction ); D_DERROR( ret, "WM/UniQuE: Could not inherit from core window!\n" ); return ret; } unique_window_get_config( data->window, &window->config ); D_MAGIC_SET( data, WindowData ); return DFB_OK; } static DFBResult wm_remove_window( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data ) { WindowData *data = window_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); // D_ASSUME( data->window == NULL ); if (data->window) unique_window_detach_global( data->window, &data->window_reaction ); D_MAGIC_CLEAR( data ); return DFB_OK; } static DFBResult wm_set_window_config( CoreWindow *window, void *wm_data, void *window_data, const CoreWindowConfig *config, CoreWindowConfigFlags flags ) { DFBResult ret; WindowData *data = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( config != NULL ); D_MAGIC_ASSERT( data, WindowData ); if (!data->window) return DFB_DESTROYED; ret = unique_window_set_config( data->window, config, flags ); unique_window_get_config( data->window, &window->config ); return ret; } static DFBResult wm_restack_window( CoreWindow *window, void *wm_data, void *window_data, CoreWindow *relative, void *relative_data, int relation ) { WindowData *data = window_data; WindowData *rel_data = relative_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); D_ASSERT( relative == NULL || relative_data != NULL ); D_ASSERT( relative == NULL || relative == window || relation != 0); if (!data->window) return DFB_DESTROYED; return unique_window_restack( data->window, rel_data ? rel_data->window : NULL, relation ); } static DFBResult wm_grab( CoreWindow *window, void *wm_data, void *window_data, CoreWMGrab *grab ) { WindowData *data = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( grab != NULL ); D_MAGIC_ASSERT( data, WindowData ); if (!data->window) return DFB_DESTROYED; return unique_window_grab( data->window, grab ); } static DFBResult wm_ungrab( CoreWindow *window, void *wm_data, void *window_data, CoreWMGrab *grab ) { WindowData *data = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( grab != NULL ); D_MAGIC_ASSERT( data, WindowData ); if (!data->window) return DFB_DESTROYED; return unique_window_ungrab( data->window, grab ); } static DFBResult wm_request_focus( CoreWindow *window, void *wm_data, void *window_data ) { WindowData *data = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); if (!data->window) return DFB_DESTROYED; return unique_window_request_focus( data->window ); } /**************************************************************************************************/ static DFBResult wm_update_stack( CoreWindowStack *stack, void *wm_data, void *stack_data, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); DFB_REGION_ASSERT( region ); D_MAGIC_ASSERT( data, StackData ); if (!data->context) return DFB_DESTROYED; return unique_context_update( data->context, region, 1, flags ); } static DFBResult wm_update_window( CoreWindow *window, void *wm_data, void *window_data, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { WindowData *data = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); DFB_REGION_ASSERT_IF( region ); D_MAGIC_ASSERT( data, WindowData ); if (!data->window) return DFB_DESTROYED; return unique_window_update( data->window, region, flags ); } /**************************************************************************************************/ /* HACK: implementation dumped in here for now, will move into context */ static DFBResult wm_update_cursor( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreCursorUpdateFlags flags ) { DFBResult ret; DFBRegion old_region; WMData *wmdata = wm_data; StackData *data = stack_data; bool restored = false; CoreLayer *layer; CoreLayerRegion *region; CardState *state; CoreSurface *surface; UniqueContext *context; D_ASSERT( stack != NULL ); D_ASSERT( stack->context != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); context = data->context; D_MAGIC_ASSERT( context, UniqueContext ); /* Optimize case of invisible cursor moving. */ if (!(flags & ~(CCUF_POSITION | CCUF_SHAPE)) && (!stack->cursor.opacity || !stack->cursor.enabled)) { context->cursor_bs_valid = false; return DFB_OK; } layer = dfb_layer_at( context->layer_id ); state = &layer->state; region = context->region; surface = context->surface; D_ASSERT( region != NULL ); D_ASSERT( surface != NULL ); if (flags & CCUF_ENABLE) { CoreSurface *cursor_bs; DFBSurfaceCapabilities caps = DSCAPS_NONE; dfb_surface_caps_apply_policy( stack->cursor.policy, &caps ); D_ASSERT( context->cursor_bs == NULL ); /* Create the cursor backing store surface. */ ret = dfb_surface_create_simple( wmdata->core, stack->cursor.size.w, stack->cursor.size.h, region->config.format, caps, CSTF_SHARED | CSTF_CURSOR, 0, /* FIXME: no shared cursor objects, no cursor id */ NULL, &cursor_bs ); if (ret) { D_ERROR( "WM/Default: Failed creating backing store for cursor!\n" ); return ret; } ret = dfb_surface_globalize( cursor_bs ); D_ASSERT( ret == DFB_OK ); /* Ensure valid back buffer for now. * FIXME: Keep a flag to know when back/front have been swapped and need a sync. */ switch (region->config.buffermode) { case DLBM_BACKVIDEO: case DLBM_TRIPLE: dfb_gfx_copy( surface, surface, NULL ); break; default: break; } context->cursor_bs = cursor_bs; } else { D_ASSERT( context->cursor_bs != NULL ); /* restore region under cursor */ if (context->cursor_drawn) { DFBRectangle rect = { 0, 0, context->cursor_region.x2 - context->cursor_region.x1 + 1, context->cursor_region.y2 - context->cursor_region.y1 + 1 }; D_ASSERT( stack->cursor.opacity || (flags & CCUF_OPACITY) ); D_ASSERT( context->cursor_bs_valid ); dfb_gfx_copy_to( context->cursor_bs, surface, &rect, context->cursor_region.x1, context->cursor_region.y1, false ); context->cursor_drawn = false; old_region = context->cursor_region; restored = true; } if (flags & CCUF_SIZE) { ret = dfb_surface_reformat( context->cursor_bs, stack->cursor.size.w, stack->cursor.size.h, context->cursor_bs->config.format ); if (ret) { D_ERROR( "WM/Default: Failed resizing backing store for cursor!\n" ); return ret; } } } if (flags & (CCUF_ENABLE | CCUF_POSITION | CCUF_SIZE | CCUF_OPACITY)) { context->cursor_bs_valid = false; context->cursor_region.x1 = stack->cursor.x - stack->cursor.hot.x; context->cursor_region.y1 = stack->cursor.y - stack->cursor.hot.y; context->cursor_region.x2 = context->cursor_region.x1 + stack->cursor.size.w - 1; context->cursor_region.y2 = context->cursor_region.y1 + stack->cursor.size.h - 1; if (!dfb_region_intersect( &context->cursor_region, 0, 0, stack->width - 1, stack->height - 1 )) { D_BUG( "invalid cursor region" ); return DFB_BUG; } } D_ASSERT( context->cursor_bs != NULL ); if (flags & CCUF_DISABLE) { dfb_surface_unlink( &context->cursor_bs ); } else if (stack->cursor.opacity) { /* backup region under cursor */ if (!context->cursor_bs_valid) { DFBRectangle rect = DFB_RECTANGLE_INIT_FROM_REGION( &context->cursor_region ); D_ASSERT( !context->cursor_drawn ); /* FIXME: this requires using blitted flipping all the time, but fixing it seems impossible, for now DSFLIP_BLIT is forced in repaint_stack() when the cursor is enabled. */ dfb_gfx_copy_to( surface, context->cursor_bs, &rect, 0, 0, true ); context->cursor_bs_valid = true; } /* Set destination. */ state->destination = surface; state->modified |= SMF_DESTINATION; /* Set clipping region. */ dfb_state_set_clip( state, &context->cursor_region ); /* draw cursor */ unique_draw_cursor( stack, context, state, &context->cursor_region ); /* Reset destination. */ state->destination = NULL; state->modified |= SMF_DESTINATION; context->cursor_drawn = true; if (restored) { if (dfb_region_region_intersects( &old_region, &context->cursor_region )) dfb_region_region_union( &old_region, &context->cursor_region ); else dfb_layer_region_flip_update( region, &context->cursor_region, DSFLIP_BLIT ); dfb_layer_region_flip_update( region, &old_region, DSFLIP_BLIT ); } else dfb_layer_region_flip_update( region, &context->cursor_region, DSFLIP_BLIT ); } else if (restored) dfb_layer_region_flip_update( region, &old_region, DSFLIP_BLIT ); return DFB_OK; } DirectFB-1.2.10/wm/unique/context.h0000644000175000017500000001203411245562152013727 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__CONTEXT_H__ #define __UNIQUE__CONTEXT_H__ #include #include #include #include typedef enum { UCNF_NONE = 0x00000000, UCNF_DESTROYED = 0x00000001, UCNF_WINDOW_ADDED = 0x00000010, UCNF_WINDOW_REMOVED = 0x00000020, UCNF_ACTIVATE = 0x00000100, UCNF_DEACTIVATE = 0x00000200, UCNF_RESIZE = 0x00001000, UCNF_WARP_CURSOR = 0x00010000, UCNF_ALL = 0x00011331 } UniqueContextNotificationFlags; typedef struct { UniqueContextNotificationFlags flags; UniqueContext *context; DFBPoint pos; /* New cursor position (UCNF_WARP_CURSOR) */ DFBDimension size; /* New root (desktop) size (UCNF_RESIZE) */ } UniqueContextNotification; DFBResult unique_context_create ( CoreDFB *core, CoreWindowStack *stack, CoreLayerRegion *region, DFBDisplayLayerID layer_id, WMShared *shared, UniqueContext **ret_context ); DFBResult unique_context_notify ( UniqueContext *context, UniqueContextNotificationFlags flags ); DFBResult unique_context_set_active ( UniqueContext *context, bool active ); DFBResult unique_context_set_color ( UniqueContext *context, const DFBColor *color ); DFBResult unique_context_update ( UniqueContext *context, const DFBRegion *updates, int num, DFBSurfaceFlipFlags flags ); DFBResult unique_context_resize ( UniqueContext *context, int width, int height ); DFBResult unique_context_flush_keys ( UniqueContext *context ); DFBResult unique_context_window_at ( UniqueContext *context, int x, int y, UniqueWindow **ret_window ); DFBResult unique_context_lookup_window( UniqueContext *context, DFBWindowID window_id, UniqueWindow **ret_window ); DFBResult unique_context_enum_windows ( UniqueContext *context, CoreWMWindowCallback callback, void *callback_ctx ); DFBResult unique_context_warp_cursor ( UniqueContext *context, int x, int y ); /* * Creates a pool of context objects. */ FusionObjectPool *unique_context_pool_create( const FusionWorld *world ); /* * Generates unique_context_ref(), unique_context_attach() etc. */ FUSION_OBJECT_METHODS( UniqueContext, unique_context ) /* global reactions */ typedef enum { UNIQUE_WM_MODULE_CONTEXT_LISTENER } UNIQUE_CONTEXT_GLOBALS; #endif DirectFB-1.2.10/wm/unique/window.c0000644000175000017500000012433711245562152013557 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include /* FIXME */ #include #include #include /* FIXME */ #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_Window, "UniQuE/Window", "UniQuE's Window" ); static const ReactionFunc unique_window_globals[] = { _unique_wm_module_window_listener, NULL }; /**************************************************************************************************/ typedef struct { DirectLink link; int magic; DFBInputDeviceKeySymbol symbol; DFBInputDeviceModifierMask modifiers; UniqueInputFilter *filter; } KeyFilter; /**************************************************************************************************/ static DFBResult add_key_filter ( UniqueWindow *window, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers, UniqueInputFilter *filter ); static DFBResult remove_key_filter ( UniqueWindow *window, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ); static void remove_all_filters( UniqueWindow *window ); /**************************************************************************************************/ static DFBResult create_regions ( UniqueWindow *window ); static void insert_window ( UniqueContext *context, UniqueWindow *window ); static void remove_window ( UniqueWindow *window ); static void update_foo_frame( UniqueWindow *window, UniqueContext *context, WMShared *shared ); static DFBResult update_window ( UniqueWindow *window, const DFBRegion *region, DFBSurfaceFlipFlags flags, bool complete ); static void update_flags ( UniqueWindow *window ); static void set_opacity ( UniqueWindow *window, u8 opacity ); static DFBResult move_window ( UniqueWindow *window, int dx, int dy ); static DFBResult resize_window ( UniqueWindow *window, int width, int height ); static DFBResult restack_window ( UniqueWindow *window, UniqueWindow *relative, int relation, DFBWindowStackingClass stacking ); /**************************************************************************************************/ static inline int get_priority( DFBWindowCapabilities caps, DFBWindowStackingClass stacking ); /**************************************************************************************************/ static void window_destructor( FusionObject *object, bool zombie, void *ctx ) { int i; UniqueContext *context; UniqueWindow *window = (UniqueWindow*) object; D_MAGIC_ASSERT( window, UniqueWindow ); D_DEBUG_AT( UniQuE_Window, "destroying %p (%dx%d - %dx%d)%s\n", window, DFB_RECTANGLE_VALS( &window->bounds ), zombie ? " (ZOMBIE)" : ""); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); D_FLAGS_SET( window->flags, UWF_DESTROYED ); unique_window_notify( window, UWNF_DESTROYED ); set_opacity( window, 0 ); remove_window( window ); for (i=0; i<8; i++) { if (window->foos[i]) stret_region_destroy( window->foos[i] ); } stret_region_destroy( window->region ); stret_region_destroy( window->frame ); remove_all_filters( window ); unique_input_switch_drop( context->input_switch, window->channel ); unique_input_channel_detach_global( window->channel, &window->channel_reaction ); unique_input_channel_destroy( window->channel ); if (window->surface) dfb_surface_unlink( &window->surface ); unique_context_unlink( &window->context ); dfb_window_unlink( &window->window ); D_MAGIC_CLEAR( window ); fusion_object_destroy( object ); } FusionObjectPool * unique_window_pool_create( const FusionWorld *world ) { return fusion_object_pool_create( "UniQuE Window Pool", sizeof(UniqueWindow), sizeof(UniqueWindowNotification), window_destructor, NULL, world ); } /**************************************************************************************************/ DFBResult unique_window_create( CoreDFB *core, CoreWindow *window, UniqueContext *context, DFBWindowCapabilities caps, const CoreWindowConfig *config, UniqueWindow **ret_window ) { DFBResult ret; UniqueWindow *uniwin; WMShared *shared; CoreSurface *surface; DFBRectangle bounds; D_ASSERT( window != NULL ); D_ASSERT( ret_window != NULL ); D_MAGIC_ASSERT( context, UniqueContext ); shared = context->shared; D_MAGIC_ASSERT( shared, WMShared ); surface = dfb_window_surface( window ); D_ASSERT( surface != NULL || (caps & DWCAPS_INPUTONLY)); uniwin = unique_wm_create_window(); if (!uniwin) return DFB_FUSION; bounds = config->bounds; /*if (bounds.x == 0 && bounds.y == 0) { bounds.x = (context->width - bounds.w) / 2; bounds.y = (context->height - bounds.h) / 2; }*/ /* Initialize window data. */ uniwin->shared = context->shared; uniwin->caps = caps; uniwin->flags = UWF_NONE; uniwin->bounds = bounds; uniwin->opacity = config->opacity; uniwin->stacking = config->stacking; uniwin->priority = get_priority( caps, config->stacking ); uniwin->options = config->options; uniwin->events = config->events; uniwin->color_key = config->color_key; uniwin->opaque = config->opaque; if (dfb_config->decorations && ! (caps & (DWCAPS_INPUTONLY | DWCAPS_NODECORATION))) { uniwin->flags |= UWF_DECORATED; uniwin->insets = shared->insets; } dfb_rectangle_from_rectangle_plus_insets( &uniwin->full, &uniwin->bounds, &uniwin->insets ); ret = dfb_window_link( &uniwin->window, window ); if (ret) goto error; ret = unique_context_link( &uniwin->context, context ); if (ret) goto error; if (surface) { ret = dfb_surface_link( &uniwin->surface, surface ); if (ret) goto error; } ret = unique_input_channel_create( core, context, &uniwin->channel ); if (ret) goto error; ret = unique_input_channel_attach_global( uniwin->channel, UNIQUE_WINDOW_INPUT_CHANNEL_LISTENER, uniwin, &uniwin->channel_reaction ); if (ret) goto error; D_MAGIC_SET( uniwin, UniqueWindow ); ret = create_regions( uniwin ); if (ret) { D_MAGIC_CLEAR( uniwin ); goto error; } /* Change global reaction lock. */ fusion_object_set_lock( &uniwin->object, &context->stack->context->lock ); /* activate object */ fusion_object_activate( &uniwin->object ); /* Actually add the window to the stack. */ insert_window( context, uniwin ); /* Possibly switch focus to the new window. */ //unique_context_update_focus( context ); /* return the new context */ *ret_window = uniwin; return DFB_OK; error: if (uniwin->channel_reaction.attached) unique_input_channel_detach_global( uniwin->channel, &uniwin->channel_reaction ); if (uniwin->channel) unique_input_channel_destroy( uniwin->channel ); if (uniwin->surface) dfb_surface_unlink( &uniwin->surface ); if (uniwin->context) unique_context_unlink( &uniwin->context ); if (uniwin->window) dfb_window_unlink( &uniwin->window ); fusion_object_destroy( &uniwin->object ); return ret; } DFBResult unique_window_close( UniqueWindow *window ) { D_MAGIC_ASSERT( window, UniqueWindow ); D_UNIMPLEMENTED(); return DFB_OK; } DFBResult unique_window_destroy( UniqueWindow *window ) { D_MAGIC_ASSERT( window, UniqueWindow ); D_UNIMPLEMENTED(); return DFB_OK; } DFBResult unique_window_notify( UniqueWindow *window, UniqueWindowNotificationFlags flags ) { UniqueWindowNotification notification; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( flags != UWNF_NONE ); D_ASSERT( ! (flags & ~UWNF_ALL) ); notification.flags = flags; notification.window = window; return unique_window_dispatch( window, ¬ification, unique_window_globals ); } DFBResult unique_window_update( UniqueWindow *window, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { D_MAGIC_ASSERT( window, UniqueWindow ); DFB_REGION_ASSERT_IF( region ); return update_window( window, region, flags, false ); } DFBResult unique_window_post_event( UniqueWindow *window, DFBWindowEvent *event ) { UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); if (!D_FLAGS_IS_SET( window->events, event->type )) return DFB_OK; context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); dfb_window_post_event( window->window, event ); return DFB_OK; } DFBResult unique_window_set_config( UniqueWindow *window, const CoreWindowConfig *config, CoreWindowConfigFlags flags ) { D_MAGIC_ASSERT( window, UniqueWindow ); if (flags & CWCF_OPTIONS) { window->options = config->options; update_flags( window ); } if (flags & CWCF_EVENTS) window->events = config->events; if (flags & CWCF_COLOR) return DFB_UNSUPPORTED; if (flags & CWCF_COLOR_KEY) window->color_key = config->color_key; if (flags & CWCF_OPAQUE) window->opaque = config->opaque; if (flags & CWCF_OPACITY && !config->opacity) set_opacity( window, config->opacity ); if (flags & CWCF_POSITION) move_window( window, config->bounds.x - window->bounds.x, config->bounds.y - window->bounds.y ); if (flags & CWCF_STACKING) restack_window( window, window, 0, config->stacking ); if (flags & CWCF_OPACITY && config->opacity) set_opacity( window, config->opacity ); if (flags & CWCF_SIZE) return resize_window( window, config->bounds.w, config->bounds.h ); return DFB_OK; } DFBResult unique_window_get_config( UniqueWindow *window, CoreWindowConfig *config ) { D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( config != NULL ); config->bounds = window->bounds; config->opacity = window->opacity; config->stacking = window->stacking; config->options = window->options; config->events = window->events; config->color_key = window->color_key; config->opaque = window->opaque; return DFB_OK; } DFBResult unique_window_restack( UniqueWindow *window, UniqueWindow *relative, int relation ) { D_MAGIC_ASSERT( window, UniqueWindow ); return restack_window( window, relative, relation, window->stacking ); } DFBResult unique_window_grab( UniqueWindow *window, const CoreWMGrab *grab ) { UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); switch (grab->target) { case CWMGT_KEYBOARD: return unique_input_switch_set( context->input_switch, UDCI_KEYBOARD, window->channel ); case CWMGT_POINTER: return unique_input_switch_set( context->input_switch, UDCI_POINTER, window->channel ); case CWMGT_KEY: { DFBResult ret; UniqueInputEvent event; UniqueInputFilter *filter; event.keyboard.key_code = -1; event.keyboard.key_symbol = grab->symbol; event.keyboard.modifiers = grab->modifiers; ret = unique_input_switch_set_filter( context->input_switch, UDCI_KEYBOARD, window->channel, &event, &filter ); if (ret) { D_DERROR( ret, "UniQuE/Window: Could not set input filter for key grab!\n" ); return ret; } ret = add_key_filter( window, grab->symbol, grab->modifiers, filter ); if (ret) { unique_input_switch_unset_filter( context->input_switch, filter ); return ret; } break; } default: D_BUG( "unknown grab target" ); break; } return DFB_OK; } DFBResult unique_window_ungrab( UniqueWindow *window, const CoreWMGrab *grab ) { UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); switch (grab->target) { case CWMGT_KEYBOARD: return unique_input_switch_unset( context->input_switch, UDCI_KEYBOARD, window->channel ); case CWMGT_POINTER: return unique_input_switch_unset( context->input_switch, UDCI_POINTER, window->channel ); case CWMGT_KEY: return remove_key_filter( window, grab->symbol, grab->modifiers ); default: D_BUG( "unknown grab target" ); break; } return DFB_OK; } DFBResult unique_window_request_focus( UniqueWindow *window ) { UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); return unique_input_switch_select( context->input_switch, UDCI_KEYBOARD, window->channel ); } /**************************************************************************************************/ static DFBResult add_key_filter( UniqueWindow *window, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers, UniqueInputFilter *filter ) { KeyFilter *key; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); key = SHCALLOC( context->shmpool, 1, sizeof(KeyFilter) ); if (!key) return D_OOSHM(); key->symbol = symbol; key->modifiers = modifiers; key->filter = filter; direct_list_append( &window->filters, &key->link ); D_MAGIC_SET( key, KeyFilter ); return DFB_OK; } static DFBResult remove_key_filter( UniqueWindow *window, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { KeyFilter *key; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); direct_list_foreach (key, window->filters) { D_MAGIC_ASSERT( key, KeyFilter ); if (key->symbol == symbol && key->modifiers == modifiers) break; } if (!key) return DFB_ITEMNOTFOUND; unique_input_switch_unset_filter( context->input_switch, key->filter ); direct_list_remove( &window->filters, &key->link ); D_MAGIC_CLEAR( key ); SHFREE( context->shmpool, key ); return DFB_OK; } static void remove_all_filters( UniqueWindow *window ) { DirectLink *n; KeyFilter *key; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); direct_list_foreach_safe (key, n, window->filters) { D_MAGIC_ASSERT( key, KeyFilter ); unique_input_switch_unset_filter( context->input_switch, key->filter ); D_MAGIC_CLEAR( key ); SHFREE( context->shmpool, key ); } window->filters = NULL; } /**************************************************************************************************/ static void dispatch_motion( UniqueWindow *window, const UniqueInputEvent *event ) { DFBWindowEvent evt; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); evt.type = DWET_MOTION; evt.cx = event->pointer.x; evt.cy = event->pointer.y; evt.x = event->pointer.x - window->bounds.x; evt.y = event->pointer.y - window->bounds.y; evt.buttons = event->pointer.buttons; dfb_window_post_event( window->window, &evt ); } static void dispatch_button( UniqueWindow *window, const UniqueInputEvent *event ) { DFBWindowEvent evt; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); evt.type = event->pointer.press ? DWET_BUTTONDOWN : DWET_BUTTONUP; evt.cx = event->pointer.x; evt.cy = event->pointer.y; evt.x = event->pointer.x - window->bounds.x; evt.y = event->pointer.y - window->bounds.y; evt.button = event->pointer.button; evt.buttons = event->pointer.buttons; dfb_window_post_event( window->window, &evt ); } static void dispatch_wheel( UniqueWindow *window, const UniqueInputEvent *event ) { DFBWindowEvent evt; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); evt.type = DWET_WHEEL; evt.step = event->wheel.value; dfb_window_post_event( window->window, &evt ); } static void dispatch_key( UniqueWindow *window, const UniqueInputEvent *event ) { DFBWindowEvent evt; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); evt.type = event->keyboard.press ? DWET_KEYDOWN : DWET_KEYUP; evt.key_code = event->keyboard.key_code; evt.key_id = event->keyboard.key_id; evt.key_symbol = event->keyboard.key_symbol; evt.modifiers = event->keyboard.modifiers; evt.locks = event->keyboard.locks; dfb_window_post_event( window->window, &evt ); } static void dispatch_channel( UniqueWindow *window, const UniqueInputEvent *event ) { DFBWindowEvent evt; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); switch (event->channel.index) { case UDCI_POINTER: evt.type = event->channel.selected ? DWET_ENTER : DWET_LEAVE; break; case UDCI_KEYBOARD: evt.type = event->channel.selected ? DWET_GOTFOCUS : DWET_LOSTFOCUS; break; default: return; } evt.cx = event->channel.x; evt.cy = event->channel.y; evt.x = event->channel.x - window->bounds.x; evt.y = event->channel.y - window->bounds.y; dfb_window_post_event( window->window, &evt ); } ReactionResult _unique_window_input_channel_listener( const void *msg_data, void *ctx ) { const UniqueInputEvent *event = msg_data; UniqueWindow *window = ctx; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( event != NULL ); D_DEBUG_AT( UniQuE_Window, "_unique_window_input_channel_listener( %p, %p )\n", event, window ); switch (event->type) { case UIET_MOTION: dispatch_motion( window, event ); break; case UIET_BUTTON: dispatch_button( window, event ); break; case UIET_WHEEL: dispatch_wheel( window, event ); break; case UIET_KEY: dispatch_key( window, event ); break; case UIET_CHANNEL: dispatch_channel( window, event ); break; default: D_ONCE( "unknown event type" ); break; } return RS_OK; } /**************************************************************************************************/ static inline int get_priority( DFBWindowCapabilities caps, DFBWindowStackingClass stacking ) { switch (stacking) { case DWSC_UPPER: return 1; case DWSC_MIDDLE: return 0; case DWSC_LOWER: return -1; default: D_BUG( "unknown stacking class" ); break; } return 0; } static inline int get_index( UniqueWindow *window ) { UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( fusion_vector_contains( &context->windows, window ) ); return fusion_vector_index_of( &context->windows, window ); } static DFBResult update_window( UniqueWindow *window, const DFBRegion *region, DFBSurfaceFlipFlags flags, bool complete ) { DFBRegion regions[32]; int num_regions; D_MAGIC_ASSERT( window, UniqueWindow ); DFB_REGION_ASSERT_IF( region ); if (complete || stret_region_visible( window->region, region, true, regions, 32, &num_regions )) { if (region) { DFBRegion area = DFB_REGION_INIT_TRANSLATED( region, window->bounds.x, window->bounds.y ); unique_context_update( window->context, &area, 1, flags ); } else { DFBRegion area = DFB_REGION_INIT_FROM_RECTANGLE( &window->bounds ); unique_context_update( window->context, &area, 1, flags ); } } else if (num_regions > 0) unique_context_update( window->context, regions, num_regions, flags ); return DFB_OK; } static DFBResult update_frame( UniqueWindow *window, const DFBRegion *region, DFBSurfaceFlipFlags flags, bool complete ) { DFBRegion regions[32]; int num_regions; D_MAGIC_ASSERT( window, UniqueWindow ); DFB_REGION_ASSERT_IF( region ); if (complete || stret_region_visible( window->frame, region, true, regions, 32, &num_regions )) { if (region) { DFBRegion area = DFB_REGION_INIT_TRANSLATED( region, window->full.x, window->full.y ); unique_context_update( window->context, &area, 1, flags ); } else { DFBRegion area = DFB_REGION_INIT_FROM_RECTANGLE( &window->full ); unique_context_update( window->context, &area, 1, flags ); } } else if (num_regions > 0) unique_context_update( window->context, regions, num_regions, flags ); return DFB_OK; } /**************************************************************************************************/ /**************************************************************************************************/ static void insert_window( UniqueContext *context, UniqueWindow *window ) { int index; UniqueWindow *other; D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( window, UniqueWindow ); /* * Iterate from bottom to top, * stopping at the first window with a higher priority. */ fusion_vector_foreach (other, index, context->windows) { D_MAGIC_ASSERT( other, UniqueWindow ); if (other->priority > window->priority) break; } /* Insert the window at the acquired position. */ fusion_vector_insert( &context->windows, window, index ); stret_region_restack( window->frame, index ); } static void remove_window( UniqueWindow *window ) { int index; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); D_ASSERT( fusion_vector_contains( &context->windows, window ) ); index = fusion_vector_index_of( &context->windows, window ); fusion_vector_remove( &context->windows, index ); } /**************************************************************************************************/ static DFBResult move_window( UniqueWindow *window, int dx, int dy ) { DFBWindowEvent evt; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); dfb_rectangle_translate( &window->bounds, dx, dy ); dfb_rectangle_translate( &window->full, dx, dy ); stret_region_move( window->frame, dx, dy ); if (D_FLAGS_IS_SET( window->flags, UWF_VISIBLE )) { DFBRegion region = { 0, 0, window->full.w - 1, window->full.h - 1 }; if (dx > 0) region.x1 -= dx; else if (dx < 0) region.x2 -= dx; if (dy > 0) region.y1 -= dy; else if (dy < 0) region.y2 -= dy; update_frame( window, ®ion, DSFLIP_NONE, false ); } /* Send new position */ evt.type = DWET_POSITION; evt.x = window->bounds.x; evt.y = window->bounds.y; unique_window_post_event( window, &evt ); return DFB_OK; } static DFBResult resize_window( UniqueWindow *window, int width, int height ) { DFBResult ret; DFBWindowEvent evt; int ow; int oh; UniqueContext *context; WMShared *shared; DFBRectangle *sizes; D_MAGIC_ASSERT( window, UniqueWindow ); D_ASSERT( width > 0 ); D_ASSERT( height > 0 ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); shared = context->shared; D_MAGIC_ASSERT( shared, WMShared ); sizes = shared->foo_rects; if (width > 4096 || height > 4096) return DFB_LIMITEXCEEDED; if (window->surface) { ret = dfb_surface_reformat( window->surface, width, height, window->surface->config.format ); if (ret) return ret; } ow = window->bounds.w; oh = window->bounds.h; window->bounds.w = width; window->bounds.h = height; window->full.w += width - ow; window->full.h += height - oh; stret_region_resize( window->frame, window->full.w, window->full.h ); stret_region_resize( window->region, window->bounds.w, window->bounds.h ); update_foo_frame( window, window->context, window->shared ); if (D_FLAGS_IS_SET( window->flags, UWF_VISIBLE )) { int dw = ow - width; int dh = oh - height; if (D_FLAGS_IS_SET( window->flags, UWF_DECORATED )) { int bw = dw - sizes[UFI_NE].w + sizes[UFI_E].w; int bh = dh - sizes[UFI_SW].h + sizes[UFI_S].h; DFBInsets *in = &window->insets; if (bw < 0) { DFBRegion region = { in->l + width + bw, 0, in->l + width - 1, in->t - 1 }; update_frame( window, ®ion, 0, false ); } if (bh < 0) { DFBRegion region = { 0, in->t + height + bh, in->l - 1, in->t + height - 1 }; update_frame( window, ®ion, 0, false ); } if (dw < 0) dw = 0; if (dh < 0) dh = 0; dw += in->r; dh += in->b; if (dw > 0) { DFBRegion region = { in->l + width, 0, in->l + width + dw - 1, in->t + height - 1 }; update_frame( window, ®ion, 0, false ); } if (dh > 0) { DFBRegion region = { 0, in->t + height, in->l + width + dw - 1, in->t + height + dh - 1 }; update_frame( window, ®ion, 0, false ); } } else { if (dw < 0) dw = 0; if (dh < 0) dh = 0; if (dw > 0) { DFBRegion region = { width, 0, width + dw - 1, height - 1 }; update_frame( window, ®ion, 0, false ); } if (dh > 0) { DFBRegion region = { 0, height, width + dw - 1, height + dh - 1 }; update_frame( window, ®ion, 0, false ); } } } /* Send new size */ evt.type = DWET_SIZE; evt.w = window->bounds.w; evt.h = window->bounds.h; unique_window_post_event( window, &evt ); unique_input_switch_update( context->input_switch, window->channel ); //unique_context_update_focus( context ); return DFB_OK; } static DFBResult restack_window( UniqueWindow *window, UniqueWindow *relative, int relation, DFBWindowStackingClass stacking ) { int old; int index; int priority; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); D_MAGIC_ASSERT_IF( relative, UniqueWindow ); D_ASSERT( relative == NULL || relative == window || relation != 0); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); /* Change stacking class. */ if (stacking != window->stacking) { window->stacking = stacking; window->priority = get_priority( window->caps, stacking ); } /* Get the (new) priority. */ priority = window->priority; /* Get the old index. */ old = get_index( window ); /* Calculate the desired index. */ if (relative) { index = get_index( relative ); if (relation > 0) { if (old < index) index--; } else if (relation < 0) { if (old > index) index++; } index += relation; if (index < 0) index = 0; else if (index > fusion_vector_size( &context->windows ) - 1) index = fusion_vector_size( &context->windows ) - 1; } else if (relation) index = fusion_vector_size( &context->windows ) - 1; else index = 0; /* Assure window won't be above any window with a higher priority. */ while (index > 0) { int below = (old < index) ? index : index - 1; UniqueWindow *other = fusion_vector_at( &context->windows, below ); D_MAGIC_ASSERT( other, UniqueWindow ); if (priority < other->priority) index--; else break; } /* Assure window won't be below any window with a lower priority. */ while (index < fusion_vector_size( &context->windows ) - 1) { int above = (old > index) ? index : index + 1; UniqueWindow *other = fusion_vector_at( &context->windows, above ); D_MAGIC_ASSERT( other, UniqueWindow ); if (priority > other->priority) index++; else break; } /* Return if index hasn't changed. */ if (index == old) return DFB_OK; /* Actually change the stacking order now. */ fusion_vector_move( &context->windows, old, index ); stret_region_restack( window->frame, index ); update_frame( window, NULL, DSFLIP_NONE, (index < old) ); if (index < old) unique_input_switch_update( context->input_switch, window->channel ); return DFB_OK; } static void set_opacity( UniqueWindow *window, u8 opacity ) { u8 old; UniqueContext *context; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); old = window->opacity; if (!dfb_config->translucent_windows && opacity) opacity = 0xFF; if (old != opacity) { bool show = !old && opacity; bool hide = old && !opacity; window->opacity = opacity; if (show) { stret_region_enable( window->frame, SRF_ACTIVE ); D_FLAGS_SET( window->flags, UWF_VISIBLE ); } if (hide) D_FLAGS_CLEAR( window->flags, UWF_VISIBLE ); if (! (window->options & (DWOP_ALPHACHANNEL | DWOP_COLORKEYING))) { if (opacity == 0xff && old != 0xff) stret_region_enable( window->region, SRF_OPAQUE ); else if (opacity != 0xff && old == 0xff) stret_region_disable( window->region, SRF_OPAQUE ); } update_frame( window, NULL, DSFLIP_NONE, false ); /* Check focus after window appeared or disappeared */ if (/*show ||*/ hide) unique_input_switch_update( context->input_switch, window->channel ); // unique_context_update_focus( context ); /* If window disappeared... */ if (hide) { stret_region_disable( window->frame, SRF_ACTIVE ); /* Ungrab pointer/keyboard, release focus */ unique_input_switch_drop( context->input_switch, window->channel ); } } } /**************************************************************************************************/ static void foo_rects( UniqueWindow *window, UniqueContext *context, WMShared *shared, DFBRectangle *ret_rects ) { int width; int height; DFBRectangle *sizes; D_MAGIC_ASSERT( window, UniqueWindow ); D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( shared, WMShared ); D_ASSERT( ret_rects != NULL ); width = window->full.w; height = window->full.h; sizes = shared->foo_rects; if (width <= sizes[UFI_NW].w + sizes[UFI_NE].w) width = sizes[UFI_NW].w + sizes[UFI_NE].w + 1; if (width <= sizes[UFI_SW].w + sizes[UFI_SE].w) width = sizes[UFI_SW].w + sizes[UFI_SE].w + 1; if (height <= sizes[UFI_NW].h + sizes[UFI_SW].h) height = sizes[UFI_NW].h + sizes[UFI_SW].h + 1; if (height <= sizes[UFI_NE].h + sizes[UFI_SE].h) height = sizes[UFI_NE].h + sizes[UFI_SE].h + 1; ret_rects[UFI_N].x = sizes[UFI_NW].w; ret_rects[UFI_N].y = 0; ret_rects[UFI_N].w = width - sizes[UFI_NW].w - sizes[UFI_NE].w; ret_rects[UFI_N].h = sizes[UFI_N].h; ret_rects[UFI_NE].x = width - sizes[UFI_NE].w; ret_rects[UFI_NE].y = 0; ret_rects[UFI_NE].w = sizes[UFI_NE].w; ret_rects[UFI_NE].h = sizes[UFI_NE].h; ret_rects[UFI_E].x = width - sizes[UFI_E].w; ret_rects[UFI_E].y = sizes[UFI_NE].h; ret_rects[UFI_E].w = sizes[UFI_E].w; ret_rects[UFI_E].h = height - sizes[UFI_NE].h - sizes[UFI_SE].h; ret_rects[UFI_SE].x = width - sizes[UFI_SE].w; ret_rects[UFI_SE].y = height - sizes[UFI_SE].h; ret_rects[UFI_SE].w = sizes[UFI_SE].w; ret_rects[UFI_SE].h = sizes[UFI_SE].h; ret_rects[UFI_S].x = sizes[UFI_SW].w; ret_rects[UFI_S].y = height - sizes[UFI_S].h; ret_rects[UFI_S].w = width - sizes[UFI_SE].w - sizes[UFI_SW].w; ret_rects[UFI_S].h = sizes[UFI_S].h; ret_rects[UFI_SW].x = 0; ret_rects[UFI_SW].y = height - sizes[UFI_SW].h; ret_rects[UFI_SW].w = sizes[UFI_SW].w; ret_rects[UFI_SW].h = sizes[UFI_SW].h; ret_rects[UFI_W].x = 0; ret_rects[UFI_W].y = sizes[UFI_NW].h; ret_rects[UFI_W].w = sizes[UFI_W].w; ret_rects[UFI_W].h = height - sizes[UFI_NW].h - sizes[UFI_SW].h; ret_rects[UFI_NW].x = 0; ret_rects[UFI_NW].y = 0; ret_rects[UFI_NW].w = sizes[UFI_NW].w; ret_rects[UFI_NW].h = sizes[UFI_NW].h; } static void update_foo_frame( UniqueWindow *window, UniqueContext *context, WMShared *shared ) { int i; DFBRectangle rects[8]; D_MAGIC_ASSERT( window, UniqueWindow ); D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( shared, WMShared ); if (!window->foos[0]) return; foo_rects( window, context, shared, rects ); for (i=0; i<8; i++) window->foos[i]->bounds = DFB_REGION_INIT_FROM_RECTANGLE( &rects[i] ); } static void update_flags( UniqueWindow *window ) { int i; D_MAGIC_ASSERT( window, UniqueWindow ); if (! (window->options & DWOP_GHOST)) { if (window->foos[0]) { for (i=0; i<8; i++) window->foos[i]->flags |= SRF_INPUT; } window->region->flags |= SRF_INPUT; } else { if (window->foos[0]) { for (i=0; i<8; i++) window->foos[i]->flags &= ~SRF_INPUT; } window->region->flags &= ~SRF_INPUT; } } static DFBResult create_foos( UniqueWindow *window, UniqueContext *context, WMShared *shared ) { int i; DFBResult ret; DFBRectangle rects[8]; StretRegionFlags flags = SRF_ACTIVE | SRF_OUTPUT; D_MAGIC_ASSERT( window, UniqueWindow ); D_MAGIC_ASSERT( context, UniqueContext ); D_MAGIC_ASSERT( shared, WMShared ); foo_rects( window, context, shared, rects ); if (! (window->options & DWOP_GHOST)) flags |= SRF_INPUT; for (i=0; i<8; i++) { ret = stret_region_create( shared->region_classes[URCI_FOO], window, i, flags, 1, DFB_RECTANGLE_VALS( &rects[i] ), window->frame, UNFL_FOREGROUND, context->shmpool, &window->foos[i] ); if (ret) goto error; } return DFB_OK; error: for (--i; i>0; --i) stret_region_destroy( window->foos[i] ); return ret; } static DFBResult create_regions( UniqueWindow *window ) { DFBResult ret; UniqueContext *context; WMShared *shared; StretRegionFlags flags = SRF_ACTIVE; D_MAGIC_ASSERT( window, UniqueWindow ); context = window->context; D_MAGIC_ASSERT( context, UniqueContext ); shared = context->shared; D_MAGIC_ASSERT( shared, WMShared ); if (! (window->options & DWOP_GHOST)) flags |= SRF_INPUT; if (! (window->caps & DWCAPS_INPUTONLY)) flags |= SRF_OUTPUT; if (window->options & DWOP_SHAPED) flags |= SRF_SHAPED; /* Frame */ ret = stret_region_create( shared->region_classes[URCI_FRAME], window, 0, SRF_NONE, _UNFL_NUM, DFB_RECTANGLE_VALS( &window->full ), context->root, UNRL_USER, context->shmpool, &window->frame ); if (ret) return ret; /* Content */ ret = stret_region_create( shared->region_classes[URCI_WINDOW], window, true, flags, 1, window->insets.l, window->insets.t, window->bounds.w, window->bounds.h, window->frame, UNFL_CONTENT, context->shmpool, &window->region ); if (ret) { stret_region_destroy( window->frame ); return ret; } /* Foos */ if (D_FLAGS_IS_SET( window->flags, UWF_DECORATED )) { ret = create_foos( window, context, shared ); if (ret) { stret_region_destroy( window->region ); stret_region_destroy( window->frame ); return ret; } } return DFB_OK; } DirectFB-1.2.10/wm/unique/stret.c0000644000175000017500000005424411245562152013410 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #define MAX_CLASSES 16 D_DEBUG_DOMAIN( UniQuE_StReT, "UniQuE/StReT", "UniQuE's Stack Region Tree" ); /**************************************************************************************************/ static void default_update( StretRegion *region, void *region_data, void *update_data, unsigned long arg, int x, int y, const DFBRegion *updates, int num ) { D_DEBUG_AT( UniQuE_StReT, "default_update( %p, %p, %p, %lu, %d, %d, %p, %d )\n", region, region_data, update_data, arg, x, y, updates, num ); } static const StretRegionClass default_class = { .Update = default_update, }; /**************************************************************************************************/ static const StretRegionClass *classes[MAX_CLASSES] = { &default_class, NULL }; static pthread_mutex_t classes_lock = PTHREAD_MUTEX_INITIALIZER; static int classes_count = 1; /**************************************************************************************************/ DFBResult stret_class_register( const StretRegionClass *clazz, StretRegionClassID *ret_id ) { int i; D_DEBUG_AT( UniQuE_StReT, "stret_class_register( %p )\n", clazz ); D_ASSERT( clazz != NULL ); D_ASSERT( ret_id != NULL ); pthread_mutex_lock( &classes_lock ); if (classes_count == MAX_CLASSES) { D_WARN( "too many classes" ); pthread_mutex_unlock( &classes_lock ); return DFB_LIMITEXCEEDED; } classes_count++; for (i=0; i New class ID is %d.\n", i ); D_ASSERT( i < MAX_CLASSES ); *ret_id = i; pthread_mutex_unlock( &classes_lock ); return DFB_OK; } DFBResult stret_class_unregister( StretRegionClassID id ) { D_DEBUG_AT( UniQuE_StReT, "stret_class_unregister( %d )\n", id ); pthread_mutex_lock( &classes_lock ); D_ASSERT( id >= 0 ); D_ASSERT( id < MAX_CLASSES ); D_ASSERT( classes[id] != NULL ); classes[id] = NULL; classes_count--; pthread_mutex_unlock( &classes_lock ); return DFB_OK; } DFBResult stret_region_create( StretRegionClassID class_id, void *data, unsigned long arg, StretRegionFlags flags, int levels, int x, int y, int width, int height, StretRegion *parent, int level, FusionSHMPoolShared *pool, StretRegion **ret_region ) { int i; StretRegion *region; D_DEBUG_AT( UniQuE_StReT, "stret_region_create( class %d, flags 0x%08x, %d,%d - %dx%d (%d), " "parent %p [%d/%d] )\n", class_id, flags, x, y, width, height, levels, parent, level, parent ? parent->levels-1 : 0 ); D_ASSERT( class_id >= 0 ); D_ASSERT( class_id < MAX_CLASSES ); D_ASSERT( classes[class_id] != NULL ); D_ASSERT( ! (flags & ~SRF_ALL) ); D_ASSERT( levels > 0 ); D_ASSERT( width > 0 ); D_ASSERT( height > 0 ); D_MAGIC_ASSERT_IF( parent, StretRegion ); if (parent) D_ASSERT( level < parent->levels ); D_ASSERT( ret_region != NULL ); /* Allocate region data. */ region = SHCALLOC( pool, 1, sizeof(StretRegion) + sizeof(FusionVector) * levels ); if (!region) { D_WARN( "out of (shared) memory" ); return D_OOSHM(); } /* Initialize region data. */ region->parent = parent; region->level = level; region->levels = levels; region->children = (FusionVector*)(region + 1); region->flags = flags; region->bounds = (DFBRegion) { x, y, x + width - 1, y + height - 1 }; region->clazz = class_id; region->data = data; region->arg = arg; region->shmpool = pool; /* Initialize levels. */ for (i=0; ichildren[i], 4, pool ); /* Add the region to its parent. */ if (parent) { FusionVector *children = &parent->children[level]; region->index = fusion_vector_size( children ); if (fusion_vector_add( children, region )) { D_WARN( "out of (shared) memory" ); SHFREE( pool, region ); return D_OOSHM(); } } D_MAGIC_SET( region, StretRegion ); #if D_DEBUG_ENABLED { DFBRegion bounds; stret_region_get_abs( region, &bounds ); D_DEBUG_AT( UniQuE_StReT, " -> Index %d, absolute bounds: %d,%d - %dx%d\n", region->index, DFB_RECTANGLE_VALS_FROM_REGION( &bounds ) ); } #endif *ret_region = region; return DFB_OK; } DFBResult stret_region_destroy( StretRegion *region ) { int i; int index; StretRegion *parent; StretRegion *child; D_MAGIC_ASSERT( region, StretRegion ); D_DEBUG_AT( UniQuE_StReT, "stret_region_destroy( %d, %d - %dx%d, level %d, index %d )\n", DFB_RECTANGLE_VALS_FROM_REGION( ®ion->bounds ), region->level, region->index ); parent = region->parent; if (parent) { FusionVector *children = &parent->children[region->level]; D_MAGIC_ASSERT( parent, StretRegion ); index = region->index; D_ASSERT( index >= 0 ); D_ASSERT( index == fusion_vector_index_of( children, region ) ); fusion_vector_remove( children, index ); for (; indexindex = index; } } for (i=0; ilevels; i++) { FusionVector *children = ®ion->children[i]; D_ASSUME( ! fusion_vector_has_elements( children ) ); fusion_vector_foreach( child, index, *children ) { D_MAGIC_ASSERT( child, StretRegion ); D_ASSERT( child->parent == region ); child->parent = NULL; } fusion_vector_destroy( children ); } D_MAGIC_CLEAR( region ); SHFREE( region->shmpool, region ); return DFB_OK; } DFBResult stret_region_enable( StretRegion *region, StretRegionFlags flags ) { D_MAGIC_ASSERT( region, StretRegion ); region->flags |= flags; return DFB_OK; } DFBResult stret_region_disable( StretRegion *region, StretRegionFlags flags ) { D_MAGIC_ASSERT( region, StretRegion ); region->flags &= ~flags; return DFB_OK; } DFBResult stret_region_move( StretRegion *region, int dx, int dy ) { D_MAGIC_ASSERT( region, StretRegion ); dfb_region_translate( ®ion->bounds, dx, dy ); return DFB_OK; } DFBResult stret_region_resize( StretRegion *region, int width, int height ) { D_MAGIC_ASSERT( region, StretRegion ); dfb_region_resize( ®ion->bounds, width, height ); return DFB_OK; } DFBResult stret_region_restack( StretRegion *region, int index ) { StretRegion *parent; D_MAGIC_ASSERT( region, StretRegion ); D_ASSUME( region->parent != NULL ); parent = region->parent; if (parent) { int old; FusionVector *children = &parent->children[region->level]; D_MAGIC_ASSERT( parent, StretRegion ); old = region->index; D_ASSERT( old >= 0 ); D_ASSERT( old == fusion_vector_index_of( children, region ) ); fusion_vector_move( children, old, index ); for (index = MIN(index,old); indexindex = index; } } return DFB_OK; } void stret_region_get_abs( StretRegion *region, DFBRegion *ret_bounds ) { DFBRegion bounds; D_MAGIC_ASSERT( region, StretRegion ); D_ASSERT( ret_bounds != NULL ); bounds = region->bounds; while (region->parent) { StretRegion *parent = region->parent; D_MAGIC_ASSERT( parent, StretRegion ); dfb_region_translate( &bounds, parent->bounds.x1, parent->bounds.y1 ); region = parent; } *ret_bounds = bounds; } void stret_region_get_size( StretRegion *region, DFBDimension *ret_size ) { D_MAGIC_ASSERT( region, StretRegion ); D_ASSERT( ret_size != NULL ); ret_size->w = region->bounds.x2 - region->bounds.x1 + 1; ret_size->h = region->bounds.y2 - region->bounds.y1 + 1; } DFBResult stret_region_get_input( StretRegion *region, int index, int x, int y, UniqueInputChannel **ret_channel ) { const StretRegionClass *clazz; D_MAGIC_ASSERT( region, StretRegion ); D_ASSERT( ret_channel != NULL ); D_ASSERT( region->clazz >= 0 ); D_ASSERT( region->clazz < MAX_CLASSES ); clazz = classes[region->clazz]; D_ASSERT( clazz != NULL ); if (clazz->GetInput) return clazz->GetInput( region, region->data, region->arg, index, x, y, ret_channel ); return DFB_UNSUPPORTED; } typedef struct { int num; int max; DFBRegion *regions; StretRegion *region; } ClipOutContext; static void clip_out( StretIteration *iteration, ClipOutContext *context, int x1, int y1, int x2, int y2 ) { StretRegion *region; DFBRegion cutout; DFBRegion area = { x1, y1, x2, y2 }; D_DEBUG_AT( UniQuE_StReT, " clip_out( %4d, %4d - %4dx%4d )\n", DFB_RECTANGLE_VALS_FROM_REGION( &area ) ); D_ASSERT( x1 <= x2 ); D_ASSERT( y1 <= y2 ); while (true) { region = stret_iteration_next( iteration, &area ); if (!region || region == context->region) { context->num++; if (context->num <= context->max) { DFBRegion *region = &context->regions[ context->num - 1 ]; D_DEBUG_AT( UniQuE_StReT, " (%2d) %4d, %4d - %4dx%4d\n", context->num - 1, x1, y1, x2 - x1 + 1, y2 - y1 + 1 ); region->x1 = x1; region->y1 = y1; region->x2 = x2; region->y2 = y2; } else D_DEBUG_AT( UniQuE_StReT, " Maximum number of regions exceeded, dropping...\n" ); if (region) stret_iteration_abort( iteration ); return; } D_MAGIC_ASSERT( region, StretRegion ); if (D_FLAGS_ARE_SET( region->flags, SRF_OUTPUT | SRF_OPAQUE )) break; } cutout = DFB_REGION_INIT_TRANSLATED( ®ion->bounds, iteration->x0, iteration->y0 ); dfb_region_clip( &cutout, x1, y1, x2, y2 ); /* upper */ if (cutout.y1 != y1) { StretIteration fork = *iteration; clip_out( &fork, context, x1, y1, x2, cutout.y1 - 1 ); } /* left */ if (cutout.x1 != x1) { StretIteration fork = *iteration; clip_out( &fork, context, x1, cutout.y1, cutout.x1 - 1, cutout.y2 ); } /* right */ if (cutout.x2 != x2) { StretIteration fork = *iteration; clip_out( &fork, context, cutout.x2 + 1, cutout.y1, x2, cutout.y2 ); } /* lower */ if (cutout.y2 != y2) { StretIteration fork = *iteration; clip_out( &fork, context, x1, cutout.y2 + 1, x2, y2 ); } stret_iteration_abort( iteration ); } DFBResult stret_region_visible( StretRegion *region, const DFBRegion *base, bool children, DFBRegion *ret_regions, int max_num, int *ret_num ) { bool visible = true; DFBRegion area; ClipOutContext context; StretIteration iteration; StretRegion *root; int x0, y0; D_MAGIC_ASSERT( region, StretRegion ); DFB_REGION_ASSERT_IF( base ); D_ASSERT( ret_regions != NULL ); D_ASSERT( max_num > 0 ); D_ASSERT( ret_num != NULL ); if (base) { D_DEBUG_AT( UniQuE_StReT, "stret_region_visible( %d, %d - %dx%d of %d, %d - %dx%d )\n", DFB_RECTANGLE_VALS_FROM_REGION( base ), DFB_RECTANGLE_VALS_FROM_REGION( ®ion->bounds ) ); area = *base; } else { D_DEBUG_AT( UniQuE_StReT, "stret_region_visible( %d, %d - %dx%d )\n", DFB_RECTANGLE_VALS_FROM_REGION( ®ion->bounds ) ); area.x1 = 0; area.y1 = 0; area.x2 = region->bounds.x2 - region->bounds.x1; area.y2 = region->bounds.y2 - region->bounds.y1; } if (! D_FLAGS_IS_SET( region->flags, SRF_ACTIVE )) { D_DEBUG_AT( UniQuE_StReT, " -> Region is not active and therefore invisible!\n" ); *ret_num = 0; return DFB_OK; } context.num = 0; context.max = max_num; context.regions = ret_regions; context.region = region; x0 = region->bounds.x1; y0 = region->bounds.y1; root = region; if (region->parent) { int rx2; int ry2; StretRegion *parent = region->parent; do { D_MAGIC_ASSERT( parent, StretRegion ); if (! D_FLAGS_IS_SET( parent->flags, SRF_ACTIVE )) { D_DEBUG_AT( UniQuE_StReT, " -> At least one parent is not active!\n" ); *ret_num = 0; return DFB_OK; } x0 += parent->bounds.x1; y0 += parent->bounds.y1; rx2 = parent->bounds.x2; ry2 = parent->bounds.y2; root = parent; visible = dfb_region_intersect( &area, - x0, - y0, rx2 - x0, ry2 - y0 ); parent = parent->parent; } while (visible && parent); } else if (base) visible = dfb_region_intersect( &area, 0, 0, region->bounds.x2, region->bounds.y2 ); if (!visible) { D_DEBUG_AT( UniQuE_StReT, " -> Region is fully clipped by ancestors!\n" ); *ret_num = 0; return DFB_OK; } stret_iteration_init( &iteration, root, children ? region : NULL ); clip_out( &iteration, &context, x0 + area.x1, y0 + area.y1, x0 + area.x2, y0 + area.y2 ); *ret_num = context.num; if (context.num > context.max) { D_DEBUG_AT( UniQuE_StReT, " -> Failed with %d/%d regions!\n", context.num, context.max ); return DFB_LIMITEXCEEDED; } D_DEBUG_AT( UniQuE_StReT, " -> Succeeded with %d/%d regions.\n", context.num, context.max ); return DFB_OK; } typedef struct { StretIteration iteration; void *update_data; } UpdateContext; static void region_update( UpdateContext *context, int x1, int y1, int x2, int y2 ) { int x0, y0; DFBRegion area = { x1, y1, x2, y2 }; StretRegion *region; D_DEBUG_AT( UniQuE_StReT, " region_update( %4d, %4d - %4dx%4d )\n", x1, y1, x2 - x1 + 1, y2 - y1 + 1 ); D_ASSERT( x1 <= x2 ); D_ASSERT( y1 <= y2 ); while (true) { region = stret_iteration_next( &context->iteration, &area ); if (!region) return; D_MAGIC_ASSERT( region, StretRegion ); if (D_FLAGS_IS_SET( region->flags, SRF_OUTPUT )) break; } x0 = context->iteration.x0; y0 = context->iteration.y0; D_DEBUG_AT( UniQuE_StReT, " -> %4d, %4d - %4dx%4d @ %4d, %4d (class %d, index %d)\n", DFB_RECTANGLE_VALS_FROM_REGION( ®ion->bounds ), x0, y0, region->clazz, region->index ); dfb_region_clip( &area, DFB_REGION_VALS_TRANSLATED( ®ion->bounds, x0, y0 ) ); if (D_FLAGS_IS_SET( region->flags, SRF_OPAQUE )) { /* upper */ if (area.y1 != y1) { UpdateContext fork = *context; region_update( &fork, x1, y1, x2, area.y1 - 1 ); } /* left */ if (area.x1 != x1) { UpdateContext fork = *context; region_update( &fork, x1, area.y1, area.x1 - 1, area.y2 ); } /* right */ if (area.x2 != x2) { UpdateContext fork = *context; region_update( &fork, area.x2 + 1, area.y1, x2, area.y2 ); } /* lower */ if (area.y2 != y2) { UpdateContext fork = *context; region_update( &fork, x1, area.y2 + 1, x2, y2 ); } stret_iteration_abort( &context->iteration ); } else region_update( context, x1, y1, x2, y2 ); x0 += region->bounds.x1; y0 += region->bounds.y1; dfb_region_translate( &area, - x0, - y0 ); D_DEBUG_AT( UniQuE_StReT, " => %4d, %4d - %4dx%4d @ %4d, %4d (class %d, index %d)\n", DFB_RECTANGLE_VALS_FROM_REGION( &area ), x0, y0, region->clazz, region->index ); D_ASSERT( classes[region->clazz]->Update ); classes[region->clazz]->Update( region, region->data, context->update_data, region->arg, x0, y0, &area, 1 ); } DFBResult stret_region_update( StretRegion *region, const DFBRegion *clip, void *update_data ) { DFBRegion area; UpdateContext context; D_MAGIC_ASSERT( region, StretRegion ); DFB_REGION_ASSERT_IF( clip ); if (clip) D_DEBUG_AT( UniQuE_StReT, "stret_region_update( %d, %d - %dx%d of %d, %d - %dx%d )\n", DFB_RECTANGLE_VALS_FROM_REGION( clip ), DFB_RECTANGLE_VALS_FROM_REGION( ®ion->bounds ) ); else D_DEBUG_AT( UniQuE_StReT, "stret_region_update( %d, %d - %dx%d )\n", DFB_RECTANGLE_VALS_FROM_REGION( ®ion->bounds ) ); if (! D_FLAGS_IS_SET( region->flags, SRF_ACTIVE )) { D_DEBUG_AT( UniQuE_StReT, " -> Region is not active and therefore invisible.\n" ); return DFB_OK; } area.x1 = 0; area.y1 = 0; area.x2 = region->bounds.x2 - region->bounds.x1; area.y2 = region->bounds.y2 - region->bounds.y1; if (clip && !dfb_region_region_intersect( &area, clip )) { D_DEBUG_AT( UniQuE_StReT, " -> Region doesn't intersect with clip.\n" ); return DFB_OK; } stret_iteration_init( &context.iteration, region, NULL ); context.update_data = update_data; region_update( &context, area.x1, area.y1, area.x2, area.y2 ); return DFB_OK; } StretRegion * stret_region_at( StretRegion *region, int x, int y, StretRegionFlags flags, StretRegionClassID class_id ) { StretIteration iteration; DFBRegion area = { x, y, x, y }; D_MAGIC_ASSERT( region, StretRegion ); D_DEBUG_AT( UniQuE_StReT, "stret_region_at( %p, %d, %d, 0x%08x )\n", region, x, y, flags ); if (! D_FLAGS_IS_SET( region->flags, SRF_ACTIVE )) { D_DEBUG_AT( UniQuE_StReT, " -> Region is not active.\n" ); return NULL; } stret_iteration_init( &iteration, region, NULL ); while ((region = stret_iteration_next( &iteration, &area )) != NULL) { if (! D_FLAGS_ARE_SET( region->flags, flags )) continue; if (class_id != SRCID_UNKNOWN && region->clazz != class_id) continue; return region; } return NULL; } void * stret_region_data( const StretRegion *region ) { D_MAGIC_ASSERT( region, StretRegion ); return region->data; } DirectFB-1.2.10/wm/unique/input_events.h0000644000175000017500000000615411245562152014774 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __UNIQUE__INPUT_EVENTS_H__ #define __UNIQUE__INPUT_EVENTS_H__ #include #include #include typedef enum { UIET_NONE = 0x00000000, UIET_MOTION = 0x00000001, UIET_BUTTON = 0x00000002, UIET_WHEEL = 0x00000010, UIET_KEY = 0x00000100, UIET_CHANNEL = 0x00001000, UIET_ALL = 0x00001113 } UniqueInputEventType; typedef struct { UniqueInputEventType type; DFBInputDeviceID device_id; bool press; int x; int y; DFBInputDeviceButtonIdentifier button; DFBInputDeviceButtonMask buttons; } UniqueInputPointerEvent; typedef struct { UniqueInputEventType type; DFBInputDeviceID device_id; int value; } UniqueInputWheelEvent; typedef struct { UniqueInputEventType type; DFBInputDeviceID device_id; bool press; int key_code; DFBInputDeviceKeyIdentifier key_id; DFBInputDeviceKeySymbol key_symbol; DFBInputDeviceModifierMask modifiers; DFBInputDeviceLockState locks; } UniqueInputKeyboardEvent; typedef struct { UniqueInputEventType type; bool selected; UniqueDeviceClassIndex index; int x; int y; } UniqueInputChannelEvent; union __UniQuE_UniqueInputEvent { UniqueInputEventType type; UniqueInputPointerEvent pointer; UniqueInputWheelEvent wheel; UniqueInputKeyboardEvent keyboard; UniqueInputChannelEvent channel; }; #endif DirectFB-1.2.10/wm/unique/stret_iteration.c0000644000175000017500000001461411245562152015463 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include D_DEBUG_DOMAIN( UniQuE_StReT, "UniQuE/StReT", "UniQuE's Stack Region Tree" ); static inline bool accept_region( StretRegion *region, int x0, int y0, const DFBRegion *clip ) { if (!D_FLAGS_IS_SET( region->flags, SRF_ACTIVE )) return false; if (!clip) return true; return dfb_region_intersects( clip, DFB_REGION_VALS_TRANSLATED( ®ion->bounds, x0, y0 ) ); } static inline bool check_depth( int frame ) { if (frame >= STRET_ITERATION_MAX_DEPTH) { D_WARN( "refusing to exceed depth limit of %d", STRET_ITERATION_MAX_DEPTH ); return false; } return true; } void stret_iteration_init( StretIteration *iteration, StretRegion *region, StretRegion *abort_at ) { D_ASSERT( iteration != NULL ); D_MAGIC_ASSERT( region, StretRegion ); D_MAGIC_ASSERT_IF( abort_at, StretRegion ); D_DEBUG_AT( UniQuE_StReT, "stret_iteration_init()\n" ); iteration->frame = -1; iteration->x0 = 0; iteration->y0 = 0; iteration->abort = abort_at; do { int last_level = region->levels - 1; int last_child = fusion_vector_size( ®ion->children[last_level] ) - 1; iteration->frame++; iteration->x0 += region->bounds.x1; iteration->y0 += region->bounds.y1; iteration->stack[iteration->frame].region = region; iteration->stack[iteration->frame].level = last_level; iteration->stack[iteration->frame].index = last_child - 1; D_DEBUG_AT( UniQuE_StReT, " -> (%d) %p, last level %d, last index %d\n", iteration->frame, region, last_level, last_child ); if (last_child >= 0) { region = fusion_vector_at( ®ion->children[last_level], last_child ); D_MAGIC_ASSERT( region, StretRegion ); } } while (fusion_vector_size( ®ion->children[region->levels - 1] ) && check_depth( iteration->frame + 1 )); iteration->stack[iteration->frame].index++; D_MAGIC_SET( iteration, StretIteration ); } StretRegion * stret_iteration_next( StretIteration *iteration, const DFBRegion *clip ) { int index; int level; StretRegion *region; D_MAGIC_ASSERT( iteration, StretIteration ); DFB_REGION_ASSERT_IF( clip ); if (clip) D_DEBUG_AT( UniQuE_StReT, "stret_iteration_next( %d, %d - %dx%d )\n", DFB_RECTANGLE_VALS_FROM_REGION( clip ) ); else D_DEBUG_AT( UniQuE_StReT, "stret_iteration_next()\n" ); while (iteration->frame >= 0) { StretIterationStackFrame *frame = &iteration->stack[iteration->frame]; region = frame->region; level = frame->level; index = frame->index--; D_MAGIC_ASSERT( region, StretRegion ); D_DEBUG_AT( UniQuE_StReT, " -> (%d) %p, level [%d/%d], index %d\n", iteration->frame, region, level, region->levels - 1, index ); if (iteration->abort && region == iteration->abort) { D_MAGIC_CLEAR( iteration ); return NULL; } if (index < 0) { level = --frame->level; if (level < 0) { iteration->frame--; iteration->x0 -= region->bounds.x1; iteration->y0 -= region->bounds.y1; if (accept_region( region, iteration->x0, iteration->y0, clip )) return region; } else { frame->index = fusion_vector_size( ®ion->children[level] ) - 1; } } else { region = fusion_vector_at( ®ion->children[level], index ); D_MAGIC_ASSERT( region, StretRegion ); if (iteration->abort && region == iteration->abort) { D_MAGIC_CLEAR( iteration ); return NULL; } if (accept_region( region, iteration->x0, iteration->y0, clip )) { level = region->levels - 1; while (fusion_vector_is_empty( ®ion->children[level] )) { if (level) level--; else return region; } if (check_depth( iteration->frame + 1 )) { frame = &iteration->stack[++iteration->frame]; iteration->x0 += region->bounds.x1; iteration->y0 += region->bounds.y1; frame->region = region; frame->level = level; frame->index = fusion_vector_size( ®ion->children[level] ) - 1; continue; } return region; } } } D_ASSUME( iteration->x0 == 0 ); D_ASSUME( iteration->y0 == 0 ); D_MAGIC_CLEAR( iteration ); return NULL; } void stret_iteration_abort( StretIteration *iteration ) { D_MAGIC_CLEAR( iteration ); } DirectFB-1.2.10/wm/unique/data/0000777000175000017500000000000011307522566013073 500000000000000DirectFB-1.2.10/wm/unique/data/foo_s.png0000644000175000017500000000025111164361026014611 00000000000000PNG  IHDR@mpIDATXӱ EQ21J+ 97ѻZk O{lwG `9Zkh-ȋ{?h3Z?4@JB9N@Edl%"yIENDB`DirectFB-1.2.10/wm/unique/data/Makefile.am0000644000175000017500000000102611164361026015033 00000000000000## Makefile.am for DirectFB/wm/unique/data uniquedatadir = $(DATADIR)/unique all-local: foo.h clean-local: rm -f foo.h EXTRA_DIST = \ foo_n.png \ foo_ne.png \ foo_e.png \ foo_se.png \ foo_s.png \ foo_sw.png \ foo_w.png \ foo_nw.png if CROSS_COMPILING directfb_csource = $(DIRECTFB_CSOURCE) else if BUILD_TOOLS directfb_csource = $(top_builddir)/tools/directfb-csource else directfb_csource = $(DIRECTFB_CSOURCE) endif endif foo.h: $(EXTRA_DIST) $(directfb_csource) --name=foo $(EXTRA_DIST:%=$(srcdir)/%) > foo.h DirectFB-1.2.10/wm/unique/data/Makefile.in0000644000175000017500000002645611307521507015063 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = wm/unique/data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ uniquedatadir = $(DATADIR)/unique EXTRA_DIST = \ foo_n.png \ foo_ne.png \ foo_e.png \ foo_se.png \ foo_s.png \ foo_sw.png \ foo_w.png \ foo_nw.png @BUILD_TOOLS_FALSE@@CROSS_COMPILING_FALSE@directfb_csource = $(DIRECTFB_CSOURCE) @BUILD_TOOLS_TRUE@@CROSS_COMPILING_FALSE@directfb_csource = $(top_builddir)/tools/directfb-csource @CROSS_COMPILING_TRUE@directfb_csource = $(DIRECTFB_CSOURCE) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu wm/unique/data/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu wm/unique/data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am all-local: foo.h clean-local: rm -f foo.h foo.h: $(EXTRA_DIST) $(directfb_csource) --name=foo $(EXTRA_DIST:%=$(srcdir)/%) > foo.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/wm/unique/data/foo_ne.png0000644000175000017500000000127111164361026014754 00000000000000PNG  IHDRSIDATxڅTANHrwah.H\yw_8B 6m*s,-9"#•[G{=D!ݷ-www9cG*G;̜$^^^gc63T/*^__l6;...puuKL:AJ 4a&;( dmJIFmBD`f B 3ArijUC)^KW03H"E$䜩B("z DZʄER$}Y)ņaR $uD^? '$s&YTuRUh;ɿ}FS `zvvtw "m$#Iq1n6ڶj䉻HkfIDb9*i:V59@ИYC2"IwGjfS۶.L0jPJ2  fR ܽV!|8WqvH)-,TpIR@! 7g9RwP}7MR Tߖ"G4$9^f# H.BH2QuU:?<<|S4hIENDB`DirectFB-1.2.10/wm/unique/data/foo_se.png0000644000175000017500000000141611164361026014762 00000000000000PNG  IHDR6s7bKGD pHYs  ~tIME!axRM0WU5OOOOV4_l/<~l[Ji#iONN>ˍ 0mIRx/p}}a/iA/VOr~~}DIWI691l[vYX, `rbO+Hb+gI+KIK+164777K05 @`0mDQR")39}Af ҿ8v$S ÿ7>]!`xf{CݓlG1qQ^uZL2{})k$$ml9 )U5jK۰==Iq*JۻIZҚd#%γ mۢg5I6l{"K46Ж!I! fjHζSf0SJN.C{Ybs8̝dC!}Ji(F1Ƹm6bu/*E)BȒ$%Iy>gI9#a0Ҷ>P1C9笪svJ UU{TUzaRBGmۢwiQIENDB`DirectFB-1.2.10/wm/unique/data/foo_n.png0000644000175000017500000000025511164361026014610 00000000000000PNG  IHDR@ItIDATX ! DQD6)bl!?S#FQ+轗 pAK0"%.A9g!4@k-;}kh.bf03 V6@ < IENDB`DirectFB-1.2.10/wm/unique/data/foo_w.png0000644000175000017500000000014511164361026014617 00000000000000PNG  IHDR@:,IDAT8cTTTdbbbdaacddaddgbFGGGG:?wvVIENDB`DirectFB-1.2.10/wm/unique/data/foo_sw.png0000644000175000017500000000120411164361026014777 00000000000000PNG  IHDR6s7KIDATxڭAn7Ed # @'t! Wd)۲GiVenCH>X$P⧮m{m7^5=?.)篇/cBRHjCf} 82MS؞"b)3O@u߫jZDD'`~!3Kf֛ӹXV=HRIz[3U Q-d[:u@Y %!)3sy&`t08z0 df % $iGOK߱*ϑ~V7RR p8|i8䜹ggg$iǑeYtqq%f$^^^H4HA){\__# eY轓jvmwB;8~OD`fdI{pa03,ED1{Jk (0Hi!Z+7rδ 9wfv~89 f6D9g$QJ!猻$!=6+qoooǕ< I IiZ6$`\}sָDN-Yw*RJ5֊ydff|#<Ϙ/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/wm/default/0000777000175000017500000000000011307522566012300 500000000000000DirectFB-1.2.10/wm/default/Makefile.am0000644000175000017500000000116211164361026014241 00000000000000## Makefile.am for DirectFB/wm/default INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src wmdir = $(MODULEDIR)/wm if BUILD_STATIC wm_DATA = libdirectfbwm_default.o endif wm_LTLIBRARIES = libdirectfbwm_default.la libdirectfbwm_default_la_LDFLAGS = \ -avoid-version \ -module libdirectfbwm_default_la_SOURCES = \ default.c libdirectfbwm_default_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/wm/default/Makefile.in0000644000175000017500000004450111307521507014257 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = wm/default ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(wmdir)" "$(DESTDIR)$(wmdir)" wmLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(wm_LTLIBRARIES) libdirectfbwm_default_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfbwm_default_la_OBJECTS = default.lo libdirectfbwm_default_la_OBJECTS = \ $(am_libdirectfbwm_default_la_OBJECTS) libdirectfbwm_default_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfbwm_default_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfbwm_default_la_SOURCES) DIST_SOURCES = $(libdirectfbwm_default_la_SOURCES) wmDATA_INSTALL = $(INSTALL_DATA) DATA = $(wm_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src wmdir = $(MODULEDIR)/wm @BUILD_STATIC_TRUE@wm_DATA = libdirectfbwm_default.o wm_LTLIBRARIES = libdirectfbwm_default.la libdirectfbwm_default_la_LDFLAGS = \ -avoid-version \ -module libdirectfbwm_default_la_SOURCES = \ default.c libdirectfbwm_default_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu wm/default/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu wm/default/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-wmLTLIBRARIES: $(wm_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(wmdir)" || $(MKDIR_P) "$(DESTDIR)$(wmdir)" @list='$(wm_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(wmLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(wmdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(wmLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(wmdir)/$$f"; \ else :; fi; \ done uninstall-wmLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(wm_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(wmdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(wmdir)/$$p"; \ done clean-wmLTLIBRARIES: -test -z "$(wm_LTLIBRARIES)" || rm -f $(wm_LTLIBRARIES) @list='$(wm_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfbwm_default.la: $(libdirectfbwm_default_la_OBJECTS) $(libdirectfbwm_default_la_DEPENDENCIES) $(libdirectfbwm_default_la_LINK) -rpath $(wmdir) $(libdirectfbwm_default_la_OBJECTS) $(libdirectfbwm_default_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/default.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-wmDATA: $(wm_DATA) @$(NORMAL_INSTALL) test -z "$(wmdir)" || $(MKDIR_P) "$(DESTDIR)$(wmdir)" @list='$(wm_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(wmDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wmdir)/$$f'"; \ $(wmDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wmdir)/$$f"; \ done uninstall-wmDATA: @$(NORMAL_UNINSTALL) @list='$(wm_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(wmdir)/$$f'"; \ rm -f "$(DESTDIR)$(wmdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(wmdir)" "$(DESTDIR)$(wmdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-wmLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-wmDATA install-wmLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-wmDATA uninstall-wmLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-wmLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-wmDATA install-wmLTLIBRARIES \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-wmDATA \ uninstall-wmLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/wm/default/default.c0000644000175000017500000035620411307507172014012 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( WM_Default, "WM/Default", "Default window manager module" ); DFB_WINDOW_MANAGER( default ) typedef struct { DirectLink link; DFBInputDeviceKeySymbol symbol; DFBInputDeviceModifierMask modifiers; CoreWindow *owner; } GrabbedKey; /**************************************************************************************************/ #define MAX_KEYS 16 #define MAX_UPDATE_REGIONS 8 typedef struct { CoreDFB *core; } WMData; typedef struct { int magic; CoreWindowStack *stack; DFBUpdates updates; DFBRegion update_regions[MAX_UPDATE_REGIONS]; DFBInputDeviceButtonMask buttons; DFBInputDeviceModifierMask modifiers; DFBInputDeviceLockState locks; bool active; int wm_level; int wm_cycle; FusionVector windows; CoreWindow *pointer_window; /* window grabbing the pointer */ CoreWindow *keyboard_window; /* window grabbing the keyboard */ CoreWindow *focused_window; /* window having the focus */ CoreWindow *entered_window; /* window under the pointer */ CoreWindow *unselkeys_window; /* window grabbing unselected keys */ DirectLink *grabbed_keys; /* List of currently grabbed keys. */ struct { DFBInputDeviceKeySymbol symbol; DFBInputDeviceKeyIdentifier id; int code; CoreWindow *owner; } keys[MAX_KEYS]; CoreSurface *cursor_bs; /* backing store for region under cursor */ bool cursor_bs_valid; DFBRegion cursor_region; bool cursor_drawn; int cursor_dx; int cursor_dy; } StackData; typedef struct { int magic; CoreWindow *window; StackData *stack_data; int priority; /* derived from stacking class */ CoreLayerRegionConfig config; } WindowData; /**************************************************************************************************/ static DFBResult restack_window( CoreWindow *window, WindowData *window_data, CoreWindow *relative, WindowData *relative_data, int relation, DFBWindowStackingClass stacking ); static DFBResult update_window( CoreWindow *window, WindowData *window_data, const DFBRegion *region, DFBSurfaceFlipFlags flags, bool force_complete, bool force_invisible, bool scale_region ); /**************************************************************************************************/ static int keys_compare( const void *key1, const void *key2 ) { return *(const DFBInputDeviceKeySymbol*) key1 - *(const DFBInputDeviceKeySymbol*) key2; } /**************************************************************************************************/ static void post_event( CoreWindow *window, StackData *data, DFBWindowEvent *event ) { D_ASSERT( window != NULL ); D_ASSERT( window->stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); event->buttons = data->buttons; event->modifiers = data->modifiers; event->locks = data->locks; dfb_window_post_event( window, event ); } static void send_key_event( CoreWindow *window, StackData *data, const DFBInputEvent *event ) { DFBWindowEvent we; D_ASSERT( window != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); we.type = (event->type == DIET_KEYPRESS) ? DWET_KEYDOWN : DWET_KEYUP; we.flags = (event->flags & DIEF_REPEAT) ? DWEF_REPEAT : 0; we.key_code = event->key_code; we.key_id = event->key_id; we.key_symbol = event->key_symbol; post_event( window, data, &we ); } static void send_button_event( CoreWindow *window, StackData *data, const DFBInputEvent *event ) { DFBWindowEvent we; D_ASSERT( window != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); we.type = (event->type == DIET_BUTTONPRESS) ? DWET_BUTTONDOWN : DWET_BUTTONUP; we.x = window->stack->cursor.x - window->config.bounds.x; we.y = window->stack->cursor.y - window->config.bounds.y; we.button = (data->wm_level & 2) ? (event->button + 2) : event->button; post_event( window, data, &we ); } /**************************************************************************************************/ static inline int get_priority( const CoreWindow *window ) { D_ASSERT( window != NULL ); switch (window->config.stacking) { case DWSC_UPPER: return 1; case DWSC_MIDDLE: return 0; case DWSC_LOWER: return -1; default: D_BUG( "unknown stacking class" ); break; } return 0; } static inline int get_index( const StackData *data, const CoreWindow *window ) { D_ASSERT( data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( fusion_vector_contains( &data->windows, window ) ); return fusion_vector_index_of( &data->windows, window ); } static CoreWindow * get_keyboard_window( CoreWindowStack *stack, StackData *data, const DFBInputEvent *event ) { DirectLink *l; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_KEYPRESS || event->type == DIET_KEYRELEASE ); /* Check explicit key grabs first. */ direct_list_foreach (l, data->grabbed_keys) { GrabbedKey *key = (GrabbedKey*) l; if (key->symbol == event->key_symbol && key->modifiers == data->modifiers) return key->owner; } /* Don't do implicit grabs on keys without a hardware index. */ if (event->key_code == -1) return (data->keyboard_window ? data->keyboard_window : data->focused_window); /* Implicitly grab (press) or ungrab (release) key. */ if (event->type == DIET_KEYPRESS) { int i; int free_key = -1; CoreWindow *window; /* Check active grabs. */ for (i=0; ikeys[i].code == event->key_code) return data->keys[i].owner; /* Remember first free array item. */ if (free_key == -1 && data->keys[i].code == -1) free_key = i; } /* Key is not grabbed, check for explicit keyboard grab or focus. */ window = data->keyboard_window ? data->keyboard_window : data->focused_window; if (!window) return NULL; /* Check key selection. */ switch (window->config.key_selection) { case DWKS_ALL: break; case DWKS_LIST: D_ASSERT( window->config.keys != NULL ); D_ASSERT( window->config.num_keys > 0 ); if (bsearch( &event->key_symbol, window->config.keys, window->config.num_keys, sizeof(DFBInputDeviceKeySymbol), keys_compare )) break; /* fall through */ case DWKS_NONE: return data->unselkeys_window; } /* Check if a free array item was found. */ if (free_key == -1) { D_WARN( "maximum number of owned keys reached" ); return NULL; } /* Implicitly grab the key. */ data->keys[free_key].symbol = event->key_symbol; data->keys[free_key].id = event->key_id; data->keys[free_key].code = event->key_code; data->keys[free_key].owner = window; return window; } else { int i; /* Lookup owner and ungrab the key. */ for (i=0; ikeys[i].code == event->key_code) { data->keys[i].code = -1; /* Return owner (NULL if destroyed). */ return data->keys[i].owner; } } } /* No owner for release event found, discard it. */ return NULL; } static CoreWindow* window_at_pointer( CoreWindowStack *stack, StackData *data, WMData *wmdata, int x, int y ) { int i; CoreWindow *window; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); if (!stack->cursor.enabled) { fusion_vector_foreach_reverse (window, i, data->windows) if (window->config.opacity && !(window->config.options & DWOP_GHOST)) return window; return NULL; } if (x < 0) x = stack->cursor.x; if (y < 0) y = stack->cursor.y; fusion_vector_foreach_reverse (window, i, data->windows) { CoreWindowConfig *config = &window->config; DFBRectangle *bounds = &config->bounds; DFBWindowOptions options = config->options; if (!(options & DWOP_GHOST) && config->opacity && x >= bounds->x && x < bounds->x + bounds->w && y >= bounds->y && y < bounds->y + bounds->h) { int wx = x - bounds->x; int wy = y - bounds->y; if ( !(options & DWOP_SHAPED) || !(options &(DWOP_ALPHACHANNEL|DWOP_COLORKEYING)) || !window->surface || ((options & DWOP_OPAQUE_REGION) && (wx >= config->opaque.x1 && wx <= config->opaque.x2 && wy >= config->opaque.y1 && wy <= config->opaque.y2))) { return window; } else { CoreSurface *surface = window->surface; DFBSurfacePixelFormat format = surface->config.format; CoreSurfaceBufferLock lock; if (dfb_surface_lock_buffer( surface, CSBR_FRONT, CSAF_CPU_READ, &lock ) == DFB_OK) { void *data = lock.addr; int pitch = lock.pitch; if (options & DWOP_ALPHACHANNEL) { int alpha = -1; D_ASSERT( DFB_PIXELFORMAT_HAS_ALPHA( format ) ); switch (format) { case DSPF_AiRGB: alpha = 0xff - (*(u32*)(data + 4 * wx + pitch * wy) >> 24); break; case DSPF_ARGB: case DSPF_AYUV: alpha = *(u32*)(data + 4 * wx + pitch * wy) >> 24; break; case DSPF_ARGB1555: case DSPF_ARGB2554: case DSPF_ARGB4444: alpha = *(u16*)(data + 2 * wx + pitch * wy) & 0x8000; alpha = alpha ? 0xff : 0x00; break; case DSPF_ALUT44: alpha = *(u8*)(data + wx + pitch * wy) & 0xf0; alpha |= alpha >> 4; break; case DSPF_LUT2: case DSPF_LUT8: { CorePalette *palette = surface->palette; u8 pix = *((u8*) data + wx + pitch * wy); if (palette && pix < palette->num_entries) { alpha = palette->entries[pix].a; break; } /* fall through */ } default: D_ONCE( "unknown format 0x%x", surface->config.format ); break; } if (alpha) { /* alpha == -1 on error */ dfb_surface_unlock_buffer( surface, &lock ); return window; } } if (options & DWOP_COLORKEYING) { int pixel = 0; u8 *p; switch (format) { case DSPF_ARGB: case DSPF_AiRGB: case DSPF_RGB32: pixel = *(u32*)(data + 4 * wx + pitch * wy) & 0x00ffffff; break; case DSPF_RGB24: p = (data + 3 * wx + pitch * wy); #ifdef WORDS_BIGENDIAN pixel = (p[0] << 16) | (p[1] << 8) | p[2]; #else pixel = (p[2] << 16) | (p[1] << 8) | p[0]; #endif break; case DSPF_RGB16: pixel = *(u16*)(data + 2 * wx + pitch * wy); break; case DSPF_ARGB4444: case DSPF_RGB444: pixel = *(u16*)(data + 2 * wx + pitch * wy) & 0xfff; break; case DSPF_ARGB1555: case DSPF_RGB555: case DSPF_BGR555: pixel = *(u16*)(data + 2 * wx + pitch * wy) & 0x7fff; break; case DSPF_RGB332: case DSPF_LUT8: pixel = *(u8*)(data + wx + pitch * wy); break; case DSPF_ALUT44: pixel = *(u8*)(data + wx + pitch * wy) & 0x0f; break; default: D_ONCE( "unknown format 0x%x", surface->config.format ); break; } if ( pixel != config->color_key ) { dfb_surface_unlock_buffer( surface, &lock ); return window; } } dfb_surface_unlock_buffer( surface, &lock ); } } } } return NULL; } static void switch_focus( CoreWindowStack *stack, StackData *data, CoreWindow *to ) { DFBWindowEvent evt; CoreWindow *from; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); from = data->focused_window; if (from == to) return; if (to && to->caps & DWCAPS_NOFOCUS) return; if (from) { evt.type = DWET_LOSTFOCUS; post_event( from, data, &evt ); } if (to) { if (to->surface && to->surface->palette && !stack->hw_mode) { CoreSurface *surface; D_ASSERT( to->primary_region != NULL ); if (dfb_layer_region_get_surface( to->primary_region, &surface ) == DFB_OK) { if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) dfb_surface_set_palette( surface, to->surface->palette ); dfb_surface_unref( surface ); } } evt.type = DWET_GOTFOCUS; post_event( to, data, &evt ); } data->focused_window = to; } static bool update_focus( CoreWindowStack *stack, StackData *data, WMData *wmdata ) { D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); /* if pointer is not grabbed */ if (!data->pointer_window) { CoreWindow *before = data->entered_window; CoreWindow *after = window_at_pointer( stack, data, wmdata, -1, -1 ); /* and the window under the cursor is another one now */ if (before != after) { DFBWindowEvent we; /* send leave event */ if (before) { we.type = DWET_LEAVE; we.x = stack->cursor.x - before->config.bounds.x; we.y = stack->cursor.y - before->config.bounds.y; post_event( before, data, &we ); } /* switch focus and send enter event */ switch_focus( stack, data, after ); if (after) { we.type = DWET_ENTER; we.x = stack->cursor.x - after->config.bounds.x; we.y = stack->cursor.y - after->config.bounds.y; post_event( after, data, &we ); } /* update pointer to window under the cursor */ data->entered_window = after; return true; } } return false; } static void ensure_focus( CoreWindowStack *stack, StackData *data ) { int i; CoreWindow *window; if (data->focused_window) return; fusion_vector_foreach_reverse (window, i, data->windows) { if (window->config.opacity && !(window->config.options & DWOP_GHOST)) { switch_focus( stack, data, window ); break; } } } /**************************************************************************************************/ /**************************************************************************************************/ static void draw_cursor( CoreWindowStack *stack, StackData *data, CardState *state, DFBRegion *region ) { DFBRectangle src; DFBRectangle clip; DFBSurfaceBlittingFlags flags = DSBLIT_BLEND_ALPHACHANNEL; D_ASSERT( stack != NULL ); D_MAGIC_ASSERT( data, StackData ); D_MAGIC_ASSERT( state, CardState ); DFB_REGION_ASSERT( region ); D_ASSUME( stack->cursor.opacity > 0 ); /* Initialize source rectangle. */ src.x = region->x1 - stack->cursor.x + stack->cursor.hot.x; src.y = region->y1 - stack->cursor.y + stack->cursor.hot.y; src.w = region->x2 - region->x1 + 1; src.h = region->y2 - region->y1 + 1; /* Initialize source clipping rectangle */ clip.x = clip.y = 0; clip.w = stack->cursor.surface->config.size.w; clip.h = stack->cursor.surface->config.size.h; /* Intersect rectangles */ if (!dfb_rectangle_intersect( &src, &clip )) return; /* Use global alpha blending. */ if (stack->cursor.opacity != 0xFF) { flags |= DSBLIT_BLEND_COLORALPHA; /* Set opacity as blending factor. */ if (state->color.a != stack->cursor.opacity) { state->color.a = stack->cursor.opacity; state->modified |= SMF_COLOR; } } /* Different compositing methods depending on destination format. */ if (flags & DSBLIT_BLEND_ALPHACHANNEL) { if (DFB_PIXELFORMAT_HAS_ALPHA( state->destination->config.format )) { /* * Always use compliant Porter/Duff SRC_OVER, * if the destination has an alpha channel. * * Cd = destination color (non-premultiplied) * Ad = destination alpha * * Cs = source color (non-premultiplied) * As = source alpha * * Ac = color alpha * * cd = Cd * Ad (premultiply destination) * cs = Cs * As (premultiply source) * * The full equation to calculate resulting color and alpha (premultiplied): * * cx = cd * (1-As*Ac) + cs * Ac * ax = Ad * (1-As*Ac) + As * Ac */ dfb_state_set_src_blend( state, DSBF_ONE ); /* Need to premultiply source with As*Ac or only with Ac? */ if (! (stack->cursor.surface->config.caps & DSCAPS_PREMULTIPLIED)) flags |= DSBLIT_SRC_PREMULTIPLY; else if (flags & DSBLIT_BLEND_COLORALPHA) flags |= DSBLIT_SRC_PREMULTCOLOR; /* Need to premultiply/demultiply destination? */ // if (! (state->destination->caps & DSCAPS_PREMULTIPLIED)) // flags |= DSBLIT_DST_PREMULTIPLY | DSBLIT_DEMULTIPLY; } else { /* * We can avoid DSBLIT_SRC_PREMULTIPLY for destinations without an alpha channel * by using another blending function, which is more likely that it's accelerated * than premultiplication at this point in time. * * This way the resulting alpha (ax) doesn't comply with SRC_OVER, * but as the destination doesn't have an alpha channel it's no problem. * * As the destination's alpha value is always 1.0 there's no need for * premultiplication. The resulting alpha value will also be 1.0 without * exceptions, therefore no need for demultiplication. * * cx = Cd * (1-As*Ac) + Cs*As * Ac (still same effect as above) * ax = Ad * (1-As*Ac) + As*As * Ac (wrong, but discarded anyways) */ if (stack->cursor.surface->config.caps & DSCAPS_PREMULTIPLIED) { /* Need to premultiply source with Ac? */ if (flags & DSBLIT_BLEND_COLORALPHA) flags |= DSBLIT_SRC_PREMULTCOLOR; dfb_state_set_src_blend( state, DSBF_ONE ); } else dfb_state_set_src_blend( state, DSBF_SRCALPHA ); } } /* Set blitting flags. */ dfb_state_set_blitting_flags( state, flags ); /* Set blitting source. */ state->source = stack->cursor.surface; state->modified |= SMF_SOURCE; /* Blit from the window to the region being updated. */ dfb_gfxcard_blit( &src, region->x1, region->y1, state ); /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; } static void draw_window( CoreWindow *window, CardState *state, DFBRegion *region, bool alpha_channel ) { DFBRectangle src; DFBSurfaceBlittingFlags flags = DSBLIT_NOFX; CoreWindowConfig *config; D_ASSERT( window != NULL ); D_MAGIC_ASSERT( state, CardState ); DFB_REGION_ASSERT( region ); config = &window->config; /* Initialize source rectangle. */ dfb_rectangle_from_region( &src, region ); /* Subtract window offset. */ src.x -= config->bounds.x; src.y -= config->bounds.y; /* Use per pixel alpha blending. */ if (alpha_channel && (config->options & DWOP_ALPHACHANNEL)) flags |= DSBLIT_BLEND_ALPHACHANNEL; /* Use global alpha blending. */ if (config->opacity != 0xFF) { flags |= DSBLIT_BLEND_COLORALPHA; /* Set opacity as blending factor. */ if (state->color.a != config->opacity) { state->color.a = config->opacity; state->modified |= SMF_COLOR; } } /* Use source color keying. */ if (config->options & DWOP_COLORKEYING) { flags |= DSBLIT_SRC_COLORKEY; /* Set window color key. */ dfb_state_set_src_colorkey( state, config->color_key ); } /* Use automatic deinterlacing. */ if (window->surface->config.caps & DSCAPS_INTERLACED) flags |= DSBLIT_DEINTERLACE; /* Different compositing methods depending on destination format. */ if (flags & DSBLIT_BLEND_ALPHACHANNEL) { if (DFB_PIXELFORMAT_HAS_ALPHA( state->destination->config.format )) { /* * Always use compliant Porter/Duff SRC_OVER, * if the destination has an alpha channel. * * Cd = destination color (non-premultiplied) * Ad = destination alpha * * Cs = source color (non-premultiplied) * As = source alpha * * Ac = color alpha * * cd = Cd * Ad (premultiply destination) * cs = Cs * As (premultiply source) * * The full equation to calculate resulting color and alpha (premultiplied): * * cx = cd * (1-As*Ac) + cs * Ac * ax = Ad * (1-As*Ac) + As * Ac */ dfb_state_set_src_blend( state, DSBF_ONE ); /* Need to premultiply source with As*Ac or only with Ac? */ if (! (window->surface->config.caps & DSCAPS_PREMULTIPLIED)) flags |= DSBLIT_SRC_PREMULTIPLY; else if (flags & DSBLIT_BLEND_COLORALPHA) flags |= DSBLIT_SRC_PREMULTCOLOR; /* Need to premultiply/demultiply destination? */ // if (! (state->destination->caps & DSCAPS_PREMULTIPLIED)) // flags |= DSBLIT_DST_PREMULTIPLY | DSBLIT_DEMULTIPLY; } else { /* * We can avoid DSBLIT_SRC_PREMULTIPLY for destinations without an alpha channel * by using another blending function, which is more likely that it's accelerated * than premultiplication at this point in time. * * This way the resulting alpha (ax) doesn't comply with SRC_OVER, * but as the destination doesn't have an alpha channel it's no problem. * * As the destination's alpha value is always 1.0 there's no need for * premultiplication. The resulting alpha value will also be 1.0 without * exceptions, therefore no need for demultiplication. * * cx = Cd * (1-As*Ac) + Cs*As * Ac (still same effect as above) * ax = Ad * (1-As*Ac) + As*As * Ac (wrong, but discarded anyways) */ if (window->surface->config.caps & DSCAPS_PREMULTIPLIED) { /* Need to premultiply source with Ac? */ if (flags & DSBLIT_BLEND_COLORALPHA) flags |= DSBLIT_SRC_PREMULTCOLOR; dfb_state_set_src_blend( state, DSBF_ONE ); } else dfb_state_set_src_blend( state, DSBF_SRCALPHA ); } } /* Set blitting flags. */ dfb_state_set_blitting_flags( state, flags ); /* Set blitting source. */ state->source = window->surface; state->modified |= SMF_SOURCE; if (window->config.options & DWOP_SCALE) { DFBRegion clip = state->clip; DFBRectangle dst = window->config.bounds; DFBRectangle src = { 0, 0, window->surface->config.size.w, window->surface->config.size.h }; /* Change clipping region. */ dfb_state_set_clip( state, region ); /* Scale window to the screen clipped by the region being updated. */ dfb_gfxcard_stretchblit( &src, &dst, state ); /* Restore clipping region. */ dfb_state_set_clip( state, &clip ); } else { D_ASSERT( window->surface->config.size.w == window->config.bounds.w ); D_ASSERT( window->surface->config.size.h == window->config.bounds.h ); /* Blit from the window to the region being updated. */ dfb_gfxcard_blit( &src, region->x1, region->y1, state ); } /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; } static void draw_background( CoreWindowStack *stack, CardState *state, DFBRegion *region ) { DFBRectangle dst; D_ASSERT( stack != NULL ); D_MAGIC_ASSERT( state, CardState ); DFB_REGION_ASSERT( region ); D_ASSERT( stack->bg.image != NULL || (stack->bg.mode != DLBM_IMAGE && stack->bg.mode != DLBM_TILE) ); /* Initialize destination rectangle. */ dfb_rectangle_from_region( &dst, region ); switch (stack->bg.mode) { case DLBM_COLOR: { CoreSurface *dest = state->destination; DFBColor *color = &stack->bg.color; /* Set the background color. */ if (DFB_PIXELFORMAT_IS_INDEXED( dest->config.format )) dfb_state_set_color_index( state, /* FIXME: don't search every time */ dfb_palette_search( dest->palette, color->r, color->g, color->b, color->a ) ); else dfb_state_set_color( state, color ); /* Simply fill the background. */ dfb_gfxcard_fillrectangles( &dst, 1, state ); break; } case DLBM_IMAGE: { CoreSurface *bg = stack->bg.image; /* Set blitting source. */ state->source = bg; state->modified |= SMF_SOURCE; /* Set blitting flags. */ dfb_state_set_blitting_flags( state, DSBLIT_NOFX ); /* Check the size of the background image. */ if (bg->config.size.w == stack->width && bg->config.size.h == stack->height) { /* Simple blit for 100% fitting background image. */ dfb_gfxcard_blit( &dst, dst.x, dst.y, state ); } else { DFBRegion clip = state->clip; DFBRectangle src = { 0, 0, bg->config.size.w, bg->config.size.h }; /* Change clipping region. */ dfb_state_set_clip( state, region ); /* * Scale image to fill the whole screen * clipped to the region being updated. */ dst.x = 0; dst.y = 0; dst.w = stack->width; dst.h = stack->height; /* Stretch blit for non fitting background images. */ dfb_gfxcard_stretchblit( &src, &dst, state ); /* Restore clipping region. */ dfb_state_set_clip( state, &clip ); } /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; break; } case DLBM_TILE: { CoreSurface *bg = stack->bg.image; DFBRegion clip = state->clip; DFBRectangle src = { 0, 0, bg->config.size.w, bg->config.size.h }; /* Set blitting source. */ state->source = bg; state->modified |= SMF_SOURCE; /* Set blitting flags. */ dfb_state_set_blitting_flags( state, DSBLIT_NOFX ); /* Change clipping region. */ dfb_state_set_clip( state, region ); /* Tiled blit (aligned). */ dfb_gfxcard_tileblit( &src, (region->x1 / src.w) * src.w, (region->y1 / src.h) * src.h, (region->x2 / src.w + 1) * src.w, (region->y2 / src.h + 1) * src.h, state ); /* Restore clipping region. */ dfb_state_set_clip( state, &clip ); /* Reset blitting source. */ state->source = NULL; state->modified |= SMF_SOURCE; break; } case DLBM_DONTCARE: break; default: D_BUG( "unknown background mode" ); break; } } static void update_region( CoreWindowStack *stack, StackData *data, CardState *state, int start, int x1, int y1, int x2, int y2 ) { int i = start; DFBRegion region = { x1, y1, x2, y2 }; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_MAGIC_ASSERT( state, CardState ); D_ASSERT( start < fusion_vector_size( &data->windows ) ); D_ASSERT( x1 <= x2 ); D_ASSERT( y1 <= y2 ); /* Find next intersecting window. */ while (i >= 0) { CoreWindow *window = fusion_vector_at( &data->windows, i ); if (VISIBLE_WINDOW( window )) { if (dfb_region_intersect( ®ion, DFB_REGION_VALS_FROM_RECTANGLE( &window->config.bounds ))) break; } i--; } /* Intersecting window found? */ if (i >= 0) { CoreWindow *window = fusion_vector_at( &data->windows, i ); CoreWindowConfig *config = &window->config; if (D_FLAGS_ARE_SET( config->options, DWOP_ALPHACHANNEL | DWOP_OPAQUE_REGION )) { DFBRegion opaque = DFB_REGION_INIT_TRANSLATED( &config->opaque, config->bounds.x, config->bounds.y ); if (!dfb_region_region_intersect( &opaque, ®ion )) { update_region( stack, data, state, i-1, x1, y1, x2, y2 ); draw_window( window, state, ®ion, true ); } else { if ((config->opacity < 0xff) || (config->options & DWOP_COLORKEYING)) { /* draw everything below */ update_region( stack, data, state, i-1, x1, y1, x2, y2 ); } else { /* left */ if (opaque.x1 != x1) update_region( stack, data, state, i-1, x1, opaque.y1, opaque.x1-1, opaque.y2 ); /* upper */ if (opaque.y1 != y1) update_region( stack, data, state, i-1, x1, y1, x2, opaque.y1-1 ); /* right */ if (opaque.x2 != x2) update_region( stack, data, state, i-1, opaque.x2+1, opaque.y1, x2, opaque.y2 ); /* lower */ if (opaque.y2 != y2) update_region( stack, data, state, i-1, x1, opaque.y2+1, x2, y2 ); } /* left */ if (opaque.x1 != region.x1) { DFBRegion r = { region.x1, opaque.y1, opaque.x1 - 1, opaque.y2 }; draw_window( window, state, &r, true ); } /* upper */ if (opaque.y1 != region.y1) { DFBRegion r = { region.x1, region.y1, region.x2, opaque.y1 - 1 }; draw_window( window, state, &r, true ); } /* right */ if (opaque.x2 != region.x2) { DFBRegion r = { opaque.x2 + 1, opaque.y1, region.x2, opaque.y2 }; draw_window( window, state, &r, true ); } /* lower */ if (opaque.y2 != region.y2) { DFBRegion r = { region.x1, opaque.y2 + 1, region.x2, region.y2 }; draw_window( window, state, &r, true ); } /* inner */ draw_window( window, state, &opaque, false ); } } else { if (TRANSLUCENT_WINDOW( window )) { /* draw everything below */ update_region( stack, data, state, i-1, x1, y1, x2, y2 ); } else { /* left */ if (region.x1 != x1) update_region( stack, data, state, i-1, x1, region.y1, region.x1-1, region.y2 ); /* upper */ if (region.y1 != y1) update_region( stack, data, state, i-1, x1, y1, x2, region.y1-1 ); /* right */ if (region.x2 != x2) update_region( stack, data, state, i-1, region.x2+1, region.y1, x2, region.y2 ); /* lower */ if (region.y2 != y2) update_region( stack, data, state, i-1, x1, region.y2+1, x2, y2 ); } draw_window( window, state, ®ion, true ); } } else draw_background( stack, state, ®ion ); } /**************************************************************************************************/ /**************************************************************************************************/ static void repaint_stack( CoreWindowStack *stack, StackData *data, CoreLayerRegion *region, const DFBRegion *updates, int num_updates, DFBSurfaceFlipFlags flags ) { int i; CoreLayer *layer; CardState *state; CoreSurface *surface; DFBRegion cursor_inter; D_ASSERT( stack != NULL ); D_ASSERT( stack->context != NULL ); D_ASSERT( data != NULL ); D_ASSERT( region != NULL ); D_ASSERT( num_updates > 0 ); layer = dfb_layer_at( stack->context->layer_id ); state = &layer->state; surface = region->surface; if (!data->active || !surface) return; D_DEBUG_AT( WM_Default, "repaint_stack( %d region(s), flags %x )\n", num_updates, flags ); /* Set destination. */ state->destination = surface; state->modified |= SMF_DESTINATION; for (i=0; i %d, %d - %dx%d (%d)\n", DFB_RECTANGLE_VALS_FROM_REGION( update ), i ); /* Set clipping region. */ dfb_state_set_clip( state, update ); /* Compose updated region. */ update_region( stack, data, state, fusion_vector_size( &data->windows ) - 1, update->x1, update->y1, update->x2, update->y2 ); /* Update cursor? */ cursor_inter = data->cursor_region; if (data->cursor_drawn && dfb_region_region_intersect( &cursor_inter, update )) { DFBRectangle rect = DFB_RECTANGLE_INIT_FROM_REGION( &cursor_inter ); D_ASSUME( data->cursor_bs_valid ); dfb_gfx_copy_to( surface, data->cursor_bs, &rect, rect.x - data->cursor_region.x1, rect.y - data->cursor_region.y1, true ); draw_cursor( stack, data, state, &cursor_inter ); } } /* Reset destination. */ state->destination = NULL; state->modified |= SMF_DESTINATION; /* Software cursor code relies on a valid back buffer. */ if (stack->cursor.enabled) flags |= DSFLIP_BLIT; for (i=0; icontext; D_ASSERT( context != NULL ); if (!data->updates.num_regions) return DFB_OK; /* Get the primary region. */ if (!region) { ret = dfb_layer_context_get_primary_region( stack->context, false, &primary ); if (ret) return ret; } dfb_updates_stat( &data->updates, &total, &bounding ); n = data->updates.max_regions - data->updates.num_regions + 1; d = n + 1; /* FIXME: depend on buffer mode, hw accel etc. */ if (total > stack->width * stack->height * 9 / 10) { DFBRegion region = { 0, 0, stack->width - 1, stack->height - 1 }; // direct_log_printf( NULL, "%s() <- %d regions, total %d, bounding %d (%d/%d: %d), FULL UPDATE\n", // __FUNCTION__, data->updates.num_regions, total, bounding, n, d, bounding*n/d ); repaint_stack( stack, data, primary, ®ion, 1, flags ); } else if (data->updates.num_regions < 2 || total < bounding * n / d) repaint_stack( stack, data, primary, data->updates.regions, data->updates.num_regions, flags ); else { // direct_log_printf( NULL, "%s() <- %d regions, total %d, bounding %d (%d/%d: %d)\n", // __FUNCTION__, data->updates.num_regions, total, bounding, n, d, bounding*n/d ); repaint_stack( stack, data, primary, &data->updates.bounding, 1, flags ); } dfb_updates_reset( &data->updates ); /* Unref primary region. */ if (!region) dfb_layer_region_unref( primary ); return DFB_OK; } /* skipping opaque windows that are above the window that changed */ static void wind_of_change( CoreWindowStack *stack, StackData *data, CoreLayerRegion *region, DFBRegion *update, DFBSurfaceFlipFlags flags, int current, int changed ) { D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( region != NULL ); D_ASSERT( update != NULL ); /* loop through windows above */ for (; current > changed; current--) { CoreWindow *window; CoreWindowConfig *config; DFBRectangle *bounds; DFBRegion opaque; DFBWindowOptions options; D_ASSERT( changed >= 0 ); D_ASSERT( current >= changed ); D_ASSERT( current < fusion_vector_size( &data->windows ) ); window = fusion_vector_at( &data->windows, current ); config = &window->config; bounds = &config->bounds; options = config->options; /* can skip opaque region */ if (( //can skip all opaque window? (config->opacity == 0xff) && !(options & (DWOP_COLORKEYING | DWOP_ALPHACHANNEL)) && (opaque=*update,dfb_region_intersect( &opaque, bounds->x, bounds->y, bounds->x + bounds->w - 1, bounds->y + bounds->h -1 ) ) )||( //can skip opaque region? (options & DWOP_ALPHACHANNEL) && (options & DWOP_OPAQUE_REGION) && (config->opacity == 0xff) && !(options & DWOP_COLORKEYING) && (opaque=*update,dfb_region_intersect( &opaque, bounds->x + config->opaque.x1, bounds->y + config->opaque.y1, bounds->x + config->opaque.x2, bounds->y + config->opaque.y2 )) )) { /* left */ if (opaque.x1 != update->x1) { DFBRegion left = { update->x1, opaque.y1, opaque.x1-1, opaque.y2}; wind_of_change( stack, data, region, &left, flags, current-1, changed ); } /* upper */ if (opaque.y1 != update->y1) { DFBRegion upper = { update->x1, update->y1, update->x2, opaque.y1-1}; wind_of_change( stack, data, region, &upper, flags, current-1, changed ); } /* right */ if (opaque.x2 != update->x2) { DFBRegion right = { opaque.x2+1, opaque.y1, update->x2, opaque.y2}; wind_of_change( stack, data, region, &right, flags, current-1, changed ); } /* lower */ if (opaque.y2 != update->y2) { DFBRegion lower = { update->x1, opaque.y2+1, update->x2, update->y2}; wind_of_change( stack, data, region, &lower, flags, current-1, changed ); } return; } } dfb_updates_add( &data->updates, update ); } static void repaint_stack_for_window( CoreWindowStack *stack, StackData *data, CoreLayerRegion *region, DFBRegion *update, DFBSurfaceFlipFlags flags, int window ) { D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( region != NULL ); D_ASSERT( update != NULL ); D_ASSERT( window >= 0 ); D_ASSERT( window < fusion_vector_size( &data->windows ) ); if (fusion_vector_has_elements( &data->windows ) && window >= 0) { int num = fusion_vector_size( &data->windows ); D_ASSERT( window < num ); wind_of_change( stack, data, region, update, flags, num - 1, window ); } else dfb_updates_add( &data->updates, update ); } /**************************************************************************************************/ static DFBResult update_window( CoreWindow *window, WindowData *window_data, const DFBRegion *region, DFBSurfaceFlipFlags flags, bool force_complete, bool force_invisible, bool scale_region ) { DFBRegion area; StackData *data; CoreWindowStack *stack; DFBRectangle *bounds; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); D_ASSERT( window_data->stack_data->stack != NULL ); DFB_REGION_ASSERT_IF( region ); data = window_data->stack_data; stack = data->stack; if (!VISIBLE_WINDOW(window) && !force_invisible) return DFB_OK; if (stack->hw_mode) return DFB_OK; bounds = &window->config.bounds; if (region) { if (scale_region && (window->config.options & DWOP_SCALE)) { int sw = window->surface->config.size.w; int sh = window->surface->config.size.h; /* horizontal */ if (bounds->w > sw) { /* upscaling */ area.x1 = (region->x1 - 1) * bounds->w / sw; area.x2 = (region->x2 + 1) * bounds->w / sw; } else { /* downscaling */ area.x1 = region->x1 * bounds->w / sw - 1; area.x2 = region->x2 * bounds->w / sw + 1; } /* vertical */ if (bounds->h > sh) { /* upscaling */ area.y1 = (region->y1 - 1) * bounds->h / sh; area.y2 = (region->y2 + 1) * bounds->h / sh; } else { /* downscaling */ area.y1 = region->y1 * bounds->h / sh - 1; area.y2 = region->y2 * bounds->h / sh + 1; } /* limit to window area */ dfb_region_clip( &area, 0, 0, bounds->w - 1, bounds->h - 1 ); /* screen offset */ dfb_region_translate( &area, bounds->x, bounds->y ); } else area = DFB_REGION_INIT_TRANSLATED( region, bounds->x, bounds->y ); } else area = DFB_REGION_INIT_FROM_RECTANGLE( bounds ); if (!dfb_unsafe_region_intersect( &area, 0, 0, stack->width - 1, stack->height - 1 )) return DFB_OK; if (force_complete) dfb_updates_add( &data->updates, &area ); else repaint_stack_for_window( stack, data, window->primary_region, &area, flags, get_index( data, window ) ); return DFB_OK; } /**************************************************************************************************/ /**************************************************************************************************/ static void insert_window( CoreWindowStack *stack, StackData *data, CoreWindow *window, WindowData *window_data ) { int index; CoreWindow *other; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); /* * Iterate from bottom to top, * stopping at the first window with a higher priority. */ fusion_vector_foreach (other, index, data->windows) { WindowData *other_data = other->window_data; D_ASSERT( other->window_data != NULL ); if (other_data->priority > window_data->priority) break; } /* Insert the window at the acquired position. */ fusion_vector_insert( &data->windows, window, index ); } static void withdraw_window( CoreWindowStack *stack, StackData *data, CoreWindow *window, WindowData *window_data ) { int i; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window->stack != NULL ); D_ASSERT( DFB_WINDOW_INITIALIZED( window ) ); /* No longer be the 'entered window'. */ if (data->entered_window == window) data->entered_window = NULL; /* Remove focus from window. */ if (data->focused_window == window) data->focused_window = NULL; /* Release explicit keyboard grab. */ if (data->keyboard_window == window) data->keyboard_window = NULL; /* Release explicit pointer grab. */ if (data->pointer_window == window) data->pointer_window = NULL; /* Release all implicit key grabs. */ for (i=0; ikeys[i].code != -1 && data->keys[i].owner == window) { if (!DFB_WINDOW_DESTROYED( window )) { DFBWindowEvent we; we.type = DWET_KEYUP; we.key_code = data->keys[i].code; we.key_id = data->keys[i].id; we.key_symbol = data->keys[i].symbol; post_event( window, data, &we ); } data->keys[i].code = -1; data->keys[i].owner = NULL; } } /* Release grab of unselected keys. */ if (data->unselkeys_window == window) data->unselkeys_window = NULL; } static void remove_window( CoreWindowStack *stack, StackData *data, CoreWindow *window, WindowData *window_data ) { DirectLink *l, *n; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window->config.opacity == 0 ); D_ASSERT( DFB_WINDOW_INITIALIZED( window ) ); D_ASSERT( fusion_vector_contains( &data->windows, window ) ); /* Release implicit grabs, focus etc. */ withdraw_window( stack, data, window, window_data ); /* Release all explicit key grabs. */ direct_list_foreach_safe (l, n, data->grabbed_keys) { GrabbedKey *key = (GrabbedKey*) l; if (key->owner == window) { direct_list_remove( &data->grabbed_keys, &key->link ); SHFREE( stack->shmpool, key ); } } fusion_vector_remove( &data->windows, fusion_vector_index_of( &data->windows, window ) ); } /**************************************************************************************************/ static DFBResult move_window( CoreWindow *window, WindowData *data, int dx, int dy ) { DFBResult ret; DFBWindowEvent evt; DFBRectangle *bounds = &window->config.bounds; bounds->x += dx; bounds->y += dy; if (window->region) { data->config.dest.x += dx; data->config.dest.y += dy; ret = dfb_layer_region_set_configuration( window->region, &data->config, CLRCF_DEST ); if (ret) { bounds->x -= dx; bounds->y -= dy; data->config.dest.x -= dx; data->config.dest.y -= dy; return ret; } } else if (VISIBLE_WINDOW(window)) { DFBRegion region = { 0, 0, bounds->w - 1, bounds->h - 1 }; update_window( window, data, ®ion, 0, false, false, false ); dfb_region_translate( ®ion, -dx, -dy ); update_window( window, data, ®ion, 0, false, false, false ); } /* Send new position */ evt.type = DWET_POSITION; evt.x = bounds->x; evt.y = bounds->y; post_event( window, data->stack_data, &evt ); return DFB_OK; } static DFBResult resize_window( CoreWindow *window, WMData *wm_data, WindowData *data, int width, int height ) { DFBResult ret; DFBWindowEvent evt; CoreWindowStack *stack = window->stack; DFBRectangle *bounds = &window->config.bounds; int ow = bounds->w; int oh = bounds->h; D_DEBUG_AT( WM_Default, "resize_window( %d, %d )\n", width, height ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); D_ASSERT( width > 0 ); D_ASSERT( height > 0 ); if (width > 4096 || height > 4096) return DFB_LIMITEXCEEDED; if (window->surface && !(window->config.options & DWOP_SCALE)) { CoreSurfaceConfig config; config.flags = CSCONF_SIZE; config.size.w = width; config.size.h = height; ret = dfb_surface_reconfig( window->surface, &config ); if (ret) return ret; } bounds->w = width; bounds->h = height; if (window->region) { data->config.dest.w = data->config.source.w = data->config.width = width; data->config.dest.h = data->config.source.h = data->config.height = height; ret = dfb_layer_region_set_configuration( window->region, &data->config, CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_SURFACE | CLRCF_DEST | CLRCF_SOURCE ); if (ret) { data->config.dest.w = data->config.source.w = data->config.width = bounds->w = ow; data->config.dest.h = data->config.source.h = data->config.height = bounds->h = oh; return ret; } } else { dfb_region_intersect( &window->config.opaque, 0, 0, width - 1, height - 1 ); if (VISIBLE_WINDOW (window)) { if (ow > bounds->w) { DFBRegion region = { bounds->w, 0, ow - 1, MIN(bounds->h, oh) - 1 }; update_window( window, data, ®ion, 0, false, false, false ); } if (oh > bounds->h) { DFBRegion region = { 0, bounds->h, MAX(bounds->w, ow) - 1, oh - 1 }; update_window( window, data, ®ion, 0, false, false, false ); } } } /* Send new size */ evt.type = DWET_SIZE; evt.w = bounds->w; evt.h = bounds->h; post_event( window, data->stack_data, &evt ); update_focus( stack, data->stack_data, wm_data ); return DFB_OK; } static DFBResult set_window_bounds( CoreWindow *window, WMData *wm_data, WindowData *data, int x, int y, int width, int height) { DFBResult ret; DFBWindowEvent evt; CoreWindowStack *stack = window->stack; DFBRegion old_region; DFBRegion new_region; D_DEBUG_AT( WM_Default, "%s( %p [%d] %d, %d - %dx%d )\n", __FUNCTION__, window, window->id, x, y, width, height ); D_ASSERT( wm_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); D_ASSERT( width > 0 ); D_ASSERT( height > 0 ); if (width > 4096 || height > 4096) return DFB_LIMITEXCEEDED; if (window->surface && !(window->config.options & DWOP_SCALE)) { ret = dfb_surface_reformat( window->surface, width, height, window->surface->config.format ); if (ret) return ret; } old_region.x1 = window->config.bounds.x - x; old_region.y1 = window->config.bounds.y - y; old_region.x2 = old_region.x1 + window->config.bounds.w - 1; old_region.y2 = old_region.y1 + window->config.bounds.h - 1; window->config.bounds.x = x; window->config.bounds.y = y; window->config.bounds.w = width; window->config.bounds.h = height; new_region.x1 = 0; new_region.y1 = 0; new_region.x2 = width - 1; new_region.y2 = height - 1; if (!dfb_region_region_intersect( &window->config.opaque, &new_region )) window->config.opaque = new_region; /* Update exposed area. */ if (VISIBLE_WINDOW( window )) { if (dfb_region_region_intersect( &new_region, &old_region )) { /* left */ if (new_region.x1 > old_region.x1) { DFBRegion region = { old_region.x1, old_region.y1, new_region.x1 - 1, new_region.y2 }; update_window( window, data, ®ion, 0, false, false, false ); } /* upper */ if (new_region.y1 > old_region.y1) { DFBRegion region = { old_region.x1, old_region.y1, old_region.x2, new_region.y1 - 1 }; update_window( window, data, ®ion, 0, false, false, false ); } /* right */ if (new_region.x2 < old_region.x2) { DFBRegion region = { new_region.x2 + 1, new_region.y1, old_region.x2, new_region.y2 }; update_window( window, data, ®ion, 0, false, false, false ); } /* lower */ if (new_region.y2 < old_region.y2) { DFBRegion region = { old_region.x1, new_region.y2 + 1, old_region.x2, old_region.y2 }; update_window( window, data, ®ion, 0, false, false, false ); } } else update_window( window, data, &old_region, 0, false, false, false ); } /* Send new position and size */ evt.type = DWET_POSITION_SIZE; evt.x = window->config.bounds.x; evt.y = window->config.bounds.y; evt.w = window->config.bounds.w; evt.h = window->config.bounds.h; post_event( window, data->stack_data, &evt ); update_focus( stack, data->stack_data, wm_data ); return DFB_OK; } static DFBResult restack_window( CoreWindow *window, WindowData *window_data, CoreWindow *relative, WindowData *relative_data, int relation, DFBWindowStackingClass stacking ) { StackData *data; int old; int index; int priority; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); D_ASSERT( relative == NULL || relative_data != NULL ); D_ASSERT( relative == NULL || relative == window || relation != 0); data = window_data->stack_data; /* Change stacking class. */ if (stacking != window->config.stacking) { window->config.stacking = stacking; window_data->priority = get_priority( window ); } /* Get the (new) priority. */ priority = window_data->priority; /* Get the old index. */ old = get_index( data, window ); /* Calculate the desired index. */ if (relative) { index = get_index( data, relative ); if (relation > 0) { if (old < index) index--; } else if (relation < 0) { if (old > index) index++; } index += relation; if (index < 0) index = 0; else if (index > fusion_vector_size( &data->windows ) - 1) index = fusion_vector_size( &data->windows ) - 1; } else if (relation) index = fusion_vector_size( &data->windows ) - 1; else index = 0; /* Assure window won't be above any window with a higher priority. */ while (index > 0) { int below = (old < index) ? index : index - 1; CoreWindow *other = fusion_vector_at( &data->windows, below ); WindowData *other_data = other->window_data; D_ASSERT( other->window_data != NULL ); if (priority < other_data->priority) index--; else break; } /* Assure window won't be below any window with a lower priority. */ while (index < fusion_vector_size( &data->windows ) - 1) { int above = (old > index) ? index : index + 1; CoreWindow *other = fusion_vector_at( &data->windows, above ); WindowData *other_data = other->window_data; D_ASSERT( other->window_data != NULL ); if (priority > other_data->priority) index++; else break; } /* Return if index hasn't changed. */ if (index == old) return DFB_OK; /* Actually change the stacking order now. */ fusion_vector_move( &data->windows, old, index ); update_window( window, window_data, NULL, DSFLIP_NONE, (index < old), false, false ); return DFB_OK; } static void set_opacity( CoreWindow *window, WindowData *window_data, WMData *wmdata, u8 opacity ) { u8 old; StackData *data; CoreWindowStack *stack; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); D_ASSERT( window_data->stack_data->stack != NULL ); old = window->config.opacity; data = window_data->stack_data; stack = data->stack; if (!stack->hw_mode && !dfb_config->translucent_windows && opacity) opacity = 0xFF; if (old != opacity) { bool show = !old && opacity; bool hide = old && !opacity; window->config.opacity = opacity; if (window->region) { window_data->config.opacity = opacity; dfb_layer_region_set_configuration( window->region, &window_data->config, CLRCF_OPACITY ); } else update_window( window, window_data, NULL, DSFLIP_NONE, false, true, false ); /* Check focus after window appeared or disappeared */ if (show || hide) update_focus( stack, data, wmdata ); /* If window disappeared... */ if (hide) { /* Ungrab pointer/keyboard */ withdraw_window( stack, data, window, window_data ); /* Always try to have a focused window */ ensure_focus( stack, data ); } } } static DFBResult grab_keyboard( CoreWindow *window, WindowData *window_data ) { StackData *data; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); data = window_data->stack_data; if (data->keyboard_window) return DFB_LOCKED; data->keyboard_window = window; return DFB_OK; } static DFBResult ungrab_keyboard( CoreWindow *window, WindowData *window_data ) { StackData *data; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); data = window_data->stack_data; if (data->keyboard_window == window) data->keyboard_window = NULL; return DFB_OK; } static DFBResult grab_pointer( CoreWindow *window, WindowData *window_data ) { StackData *data; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); data = window_data->stack_data; if (data->pointer_window) return DFB_LOCKED; data->pointer_window = window; return DFB_OK; } static DFBResult ungrab_pointer( CoreWindow *window, WindowData *window_data, WMData *wmdata ) { StackData *data; CoreWindowStack *stack; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); data = window_data->stack_data; stack = data->stack; if (data->pointer_window == window) { data->pointer_window = NULL; /* Possibly change focus to window that's now under the cursor */ update_focus( stack, data, wmdata ); } return DFB_OK; } static DFBResult grab_key( CoreWindow *window, WindowData *window_data, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { int i; StackData *data; GrabbedKey *grab; CoreWindowStack *stack; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); D_ASSERT( window_data->stack_data->stack != NULL ); data = window_data->stack_data; stack = data->stack; /* Reject if already grabbed. */ direct_list_foreach (grab, data->grabbed_keys) if (grab->symbol == symbol && grab->modifiers == modifiers) return DFB_LOCKED; /* Allocate grab information. */ grab = SHCALLOC( stack->shmpool, 1, sizeof(GrabbedKey) ); /* Fill grab information. */ grab->symbol = symbol; grab->modifiers = modifiers; grab->owner = window; /* Add to list of key grabs. */ direct_list_append( &data->grabbed_keys, &grab->link ); /* Remove implicit grabs for this key. */ for (i=0; ikeys[i].code != -1 && data->keys[i].symbol == symbol) data->keys[i].code = -1; return DFB_OK; } static DFBResult ungrab_key( CoreWindow *window, WindowData *window_data, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { DirectLink *l; StackData *data; CoreWindowStack *stack; D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); D_ASSERT( window_data->stack_data->stack != NULL ); data = window_data->stack_data; stack = data->stack; direct_list_foreach (l, data->grabbed_keys) { GrabbedKey *key = (GrabbedKey*) l; if (key->symbol == symbol && key->modifiers == modifiers && key->owner == window) { direct_list_remove( &data->grabbed_keys, &key->link ); SHFREE( stack->shmpool, key ); return DFB_OK; } } return DFB_IDNOTFOUND; } static DFBResult request_focus( CoreWindow *window, WindowData *window_data ) { StackData *data; CoreWindowStack *stack; CoreWindow *entered; D_ASSERT( window != NULL ); D_ASSERT( !(window->config.options & DWOP_GHOST) ); D_ASSERT( window_data != NULL ); D_ASSERT( window_data->stack_data != NULL ); data = window_data->stack_data; stack = data->stack; switch_focus( stack, data, window ); entered = data->entered_window; if (entered && entered != window) { DFBWindowEvent we; we.type = DWET_LEAVE; we.x = stack->cursor.x - entered->config.bounds.x; we.y = stack->cursor.y - entered->config.bounds.y; post_event( entered, data, &we ); data->entered_window = NULL; } return DFB_OK; } /**************************************************************************************************/ /**************************************************************************************************/ static bool handle_wm_key( CoreWindowStack *stack, StackData *data, WMData *wmdata, const DFBInputEvent *event ) { int i, num; CoreWindow *entered; CoreWindow *focused; CoreWindow *window; DFBRegion region; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( data->wm_level > 0 ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_KEYPRESS ); entered = data->entered_window; focused = data->focused_window; switch (DFB_LOWER_CASE(event->key_symbol)) { case DIKS_SMALL_X: num = fusion_vector_size( &data->windows ); if (data->wm_cycle <= 0) data->wm_cycle = num; if (num) { int looped = 0; int index = MIN( num, data->wm_cycle ); while (index--) { CoreWindow *window = fusion_vector_at( &data->windows, index ); if ((window->config.options & (DWOP_GHOST | DWOP_KEEP_STACKING)) || ! VISIBLE_WINDOW(window) || window == data->focused_window) { if (index == 0 && !looped) { looped = 1; index = num - 1; } continue; } restack_window( window, window->window_data, NULL, NULL, 1, window->config.stacking ); request_focus( window, window->window_data ); break; } data->wm_cycle = index; } break; case DIKS_SMALL_S: fusion_vector_foreach (window, i, data->windows) { if (VISIBLE_WINDOW(window) && window->config.stacking == DWSC_MIDDLE && ! (window->config.options & (DWOP_GHOST | DWOP_KEEP_STACKING))) { restack_window( window, window->window_data, NULL, NULL, 1, window->config.stacking ); request_focus( window, window->window_data ); break; } } break; case DIKS_SMALL_C: if (entered) { DFBWindowEvent event; event.type = DWET_CLOSE; post_event( entered, data, &event ); } break; case DIKS_SMALL_E: update_focus( stack, data, wmdata ); break; case DIKS_SMALL_A: if (focused && !(focused->config.options & DWOP_KEEP_STACKING)) { restack_window( focused, focused->window_data, NULL, NULL, 0, focused->config.stacking ); update_focus( stack, data, wmdata ); } break; case DIKS_SMALL_W: if (focused && !(focused->config.options & DWOP_KEEP_STACKING)) restack_window( focused, focused->window_data, NULL, NULL, 1, focused->config.stacking ); break; case DIKS_SMALL_D: if (entered && !(entered->config.options & DWOP_INDESTRUCTIBLE)) dfb_window_destroy( entered ); break; case DIKS_SMALL_P: /* Enable and show cursor. */ if (stack->cursor.set) { dfb_windowstack_cursor_set_opacity( stack, 0xff ); dfb_windowstack_cursor_enable( wmdata->core, stack, true ); } /* Ungrab pointer. */ data->pointer_window = NULL; /* TODO: set new cursor shape, the current one might be completely transparent */ break; case DIKS_PRINT: if (dfb_config->screenshot_dir && focused && focused->surface) dfb_surface_dump_buffer( focused->surface, CSBR_FRONT, dfb_config->screenshot_dir, "dfb_window" ); break; case DIKS_F12: region.x1 = 0; region.y1 = 0; region.x2 = stack->width; region.y2 = stack->height; dfb_updates_reset( &data->updates ); dfb_updates_add( &data->updates, ®ion ); break; default: return false; } return true; } static bool is_wm_key( DFBInputDeviceKeySymbol key_symbol ) { switch (DFB_LOWER_CASE(key_symbol)) { case DIKS_SMALL_X: case DIKS_SMALL_S: case DIKS_SMALL_C: case DIKS_SMALL_E: case DIKS_SMALL_A: case DIKS_SMALL_W: case DIKS_SMALL_D: case DIKS_SMALL_P: case DIKS_PRINT: break; default: return false; } return true; } /**************************************************************************************************/ static DFBResult handle_key_press( CoreWindowStack *stack, StackData *data, WMData *wmdata, const DFBInputEvent *event ) { CoreWindow *window; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_KEYPRESS ); if (data->wm_level) { switch (event->key_symbol) { case DIKS_META: data->wm_level |= 1; break; case DIKS_CONTROL: data->wm_level |= 2; break; case DIKS_ALT: data->wm_level |= 4; break; default: if (handle_wm_key( stack, data, wmdata, event )) return DFB_OK; break; } } else if (event->key_symbol == DIKS_META) { data->wm_level |= 1; data->wm_cycle = 0; } window = get_keyboard_window( stack, data, event ); if (window) send_key_event( window, data, event ); return DFB_OK; } static DFBResult handle_key_release( CoreWindowStack *stack, StackData *data, const DFBInputEvent *event ) { CoreWindow *window; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_KEYRELEASE ); if (data->wm_level) { switch (event->key_symbol) { case DIKS_META: data->wm_level &= ~1; break; case DIKS_CONTROL: data->wm_level &= ~2; break; case DIKS_ALT: data->wm_level &= ~4; break; default: if (is_wm_key( event->key_symbol )) return DFB_OK; break; } } window = get_keyboard_window( stack, data, event ); if (window) send_key_event( window, data, event ); return DFB_OK; } /**************************************************************************************************/ static DFBResult handle_button_press( CoreWindowStack *stack, StackData *data, const DFBInputEvent *event ) { CoreWindow *window; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_BUTTONPRESS ); if (!stack->cursor.enabled) return DFB_OK; switch (data->wm_level) { case 1: window = data->entered_window; if (window && !(window->config.options & DWOP_KEEP_STACKING)) dfb_window_raisetotop( data->entered_window ); break; default: window = data->pointer_window ? data->pointer_window : data->entered_window; if (window) send_button_event( window, data, event ); break; } return DFB_OK; } static DFBResult handle_button_release( CoreWindowStack *stack, StackData *data, const DFBInputEvent *event ) { CoreWindow *window; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_BUTTONRELEASE ); if (!stack->cursor.enabled) return DFB_OK; switch (data->wm_level) { case 1: break; default: window = data->pointer_window ? data->pointer_window : data->entered_window; if (window) send_button_event( window, data, event ); break; } return DFB_OK; } /**************************************************************************************************/ static void perform_motion( CoreWindowStack *stack, StackData *data, WMData *wmdata, int dx, int dy ) { int old_cx, old_cy; DFBWindowEvent we; CoreWindow *entered; CoreWindowConfig *config = NULL; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); if (!stack->cursor.enabled) return; old_cx = stack->cursor.x; old_cy = stack->cursor.y; dfb_windowstack_cursor_warp( stack, old_cx + dx, old_cy + dy ); dx = stack->cursor.x - old_cx; dy = stack->cursor.y - old_cy; if (!dx && !dy) return; entered = data->entered_window; if (entered) config = &entered->config; switch (data->wm_level) { case 7: case 6: case 5: case 4: if (entered) { int opacity = config->opacity + dx; if (opacity < 8) opacity = 8; else if (opacity > 255) opacity = 255; dfb_window_set_opacity( entered, opacity ); } break; case 3: case 2: if (entered && !(config->options & DWOP_KEEP_SIZE)) { int width = config->bounds.w + dx; int height = config->bounds.h + dy; if (width < 48) width = 48; if (height < 48) height = 48; if (width > 2048) width = 2048; if (height > 2048) height = 2048; dfb_window_resize( entered, width, height ); } break; case 1: if (entered && !(config->options & DWOP_KEEP_POSITION)) dfb_window_move( entered, dx, dy, true ); break; case 0: if (data->pointer_window) { CoreWindow *window = data->pointer_window; we.type = DWET_MOTION; we.x = stack->cursor.x - window->config.bounds.x; we.y = stack->cursor.y - window->config.bounds.y; post_event( window, data, &we ); } else if (!update_focus( stack, data, wmdata ) && data->entered_window) { CoreWindow *window = data->entered_window; we.type = DWET_MOTION; we.x = stack->cursor.x - window->config.bounds.x; we.y = stack->cursor.y - window->config.bounds.y; post_event( window, data, &we ); } break; default: ; } } static void flush_motion( CoreWindowStack *stack, StackData *data, WMData *wmdata ) { D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( wmdata != NULL ); if (data->cursor_dx || data->cursor_dy) { perform_motion( stack, data, wmdata, data->cursor_dx, data->cursor_dy ); data->cursor_dx = 0; data->cursor_dy = 0; } } static void handle_wheel( CoreWindowStack *stack, StackData *data, int dz ) { DFBWindowEvent we; CoreWindow *window = NULL; D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); if (!stack->cursor.enabled) return; window = data->pointer_window ? data->pointer_window : data->entered_window; if (window) { if (data->wm_level) { int opacity = window->config.opacity + dz*7; if (opacity < 0x01) opacity = 1; if (opacity > 0xFF) opacity = 0xFF; dfb_window_set_opacity( window, opacity ); } else { we.type = DWET_WHEEL; we.x = stack->cursor.x - window->config.bounds.x; we.y = stack->cursor.y - window->config.bounds.y; we.step = dz; post_event( window, data, &we ); } } } static DFBResult handle_axis_motion( CoreWindowStack *stack, StackData *data, WMData *wmdata, const DFBInputEvent *event ) { D_ASSERT( stack != NULL ); D_ASSERT( data != NULL ); D_ASSERT( event != NULL ); D_ASSERT( event->type == DIET_AXISMOTION ); if (event->flags & DIEF_AXISREL) { int rel = event->axisrel; /* handle cursor acceleration */ if (rel > stack->cursor.threshold) rel += (rel - stack->cursor.threshold) * stack->cursor.numerator / stack->cursor.denominator; else if (rel < -stack->cursor.threshold) rel += (rel + stack->cursor.threshold) * stack->cursor.numerator / stack->cursor.denominator; switch (event->axis) { case DIAI_X: data->cursor_dx += rel; break; case DIAI_Y: data->cursor_dy += rel; break; case DIAI_Z: flush_motion( stack, data, wmdata ); handle_wheel( stack, data, - event->axisrel ); break; default: ; } } else if (event->flags & DIEF_AXISABS) { int axismin = 0; int axisabs = event->axisabs; if (event->flags & DIEF_MIN) { axismin = event->min; axisabs -= axismin; } switch (event->axis) { case DIAI_X: if (event->flags & DIEF_MAX) axisabs = axisabs * stack->width / (event->max - axismin + 1); data->cursor_dx = axisabs - stack->cursor.x; break; case DIAI_Y: if (event->flags & DIEF_MAX) axisabs = axisabs * stack->height / (event->max - axismin + 1); data->cursor_dy = axisabs - stack->cursor.y; break; default: ; } } return DFB_OK; } /**************************************************************************************************/ /**************************************************************************************************/ static void wm_get_info( CoreWMInfo *info ) { info->version.major = 0; info->version.minor = 3; info->version.binary = 2; snprintf( info->name, DFB_CORE_WM_INFO_NAME_LENGTH, "Default" ); snprintf( info->vendor, DFB_CORE_WM_INFO_VENDOR_LENGTH, "directfb.org" ); info->wm_data_size = sizeof(WMData); info->stack_data_size = sizeof(StackData); info->window_data_size = sizeof(WindowData); } static DFBResult wm_initialize( CoreDFB *core, void *wm_data, void *shared_data ) { WMData *data = wm_data; data->core = core; return DFB_OK; } static DFBResult wm_join( CoreDFB *core, void *wm_data, void *shared_data ) { WMData *data = wm_data; data->core = core; return DFB_OK; } static DFBResult wm_shutdown( bool emergency, void *wm_data, void *shared_data ) { return DFB_OK; } static DFBResult wm_leave( bool emergency, void *wm_data, void *shared_data ) { return DFB_OK; } static DFBResult wm_suspend( void *wm_data, void *shared_data ) { return DFB_OK; } static DFBResult wm_resume( void *wm_data, void *shared_data ) { return DFB_OK; } static DFBResult wm_post_init( void *wm_data, void *shared_data ) { return DFB_OK; } /**************************************************************************************************/ static DFBResult wm_init_stack( CoreWindowStack *stack, void *wm_data, void *stack_data ) { int i; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); data->stack = stack; /* Initialize update manager. */ dfb_updates_init( &data->updates, data->update_regions, MAX_UPDATE_REGIONS ); fusion_vector_init( &data->windows, 64, stack->shmpool ); for (i=0; ikeys[i].code = -1; D_MAGIC_SET( data, StackData ); return DFB_OK; } static DFBResult wm_close_stack( CoreWindowStack *stack, void *wm_data, void *stack_data ) { DirectLink *l, *next; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); D_MAGIC_CLEAR( data ); D_ASSUME( fusion_vector_is_empty( &data->windows ) ); if (fusion_vector_has_elements( &data->windows )) { int i; CoreWindow *window; fusion_vector_foreach (window, i, data->windows) { D_WARN( "setting window->stack = NULL" ); window->stack = NULL; } } fusion_vector_destroy( &data->windows ); /* Destroy backing store of software cursor. */ if (data->cursor_bs) dfb_surface_unlink( &data->cursor_bs ); /* Free grabbed keys. */ direct_list_foreach_safe (l, next, data->grabbed_keys) SHFREE( stack->shmpool, l ); return DFB_OK; } static DFBResult wm_set_active( CoreWindowStack *stack, void *wm_data, void *stack_data, bool active ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); D_ASSUME( data->active != active ); if (data->active == active) return DFB_OK; data->active = active; if (active) return dfb_windowstack_repaint_all( stack ); /* Force release of all pressed keys. */ return wm_flush_keys( stack, wm_data, stack_data ); } static DFBResult wm_resize_stack( CoreWindowStack *stack, void *wm_data, void *stack_data, int width, int height ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); return DFB_OK; } static DFBResult wm_process_input( CoreWindowStack *stack, void *wm_data, void *stack_data, const DFBInputEvent *event ) { DFBResult ret; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( event != NULL ); D_MAGIC_ASSERT( data, StackData ); D_DEBUG_AT( WM_Default, "Processing input event (device %d, type 0x%08x, flags 0x%08x)...\n", event->device_id, event->type, event->flags ); /* FIXME: handle multiple devices */ if (event->flags & DIEF_BUTTONS) data->buttons = event->buttons; if (event->flags & DIEF_MODIFIERS) data->modifiers = event->modifiers; if (event->flags & DIEF_LOCKS) data->locks = event->locks; if (event->type != DIET_AXISMOTION) flush_motion( stack, data, wm_data ); switch (event->type) { case DIET_KEYPRESS: ret = handle_key_press( stack, data, wm_data, event ); break; case DIET_KEYRELEASE: ret = handle_key_release( stack, data, event ); break; case DIET_BUTTONPRESS: ret = handle_button_press( stack, data, event ); break; case DIET_BUTTONRELEASE: ret = handle_button_release( stack, data, event ); break; case DIET_AXISMOTION: ret = handle_axis_motion( stack, data, wm_data, event ); break; default: D_ONCE( "unknown input event type" ); ret = DFB_UNSUPPORTED; break; } if (!D_FLAGS_IS_SET( event->flags, DIEF_FOLLOW )) flush_motion( stack, data, wm_data ); process_updates( data, wm_data, stack, NULL, DSFLIP_NONE ); return ret; } static DFBResult wm_flush_keys( CoreWindowStack *stack, void *wm_data, void *stack_data ) { int i; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); for (i=0; ikeys[i].code != -1) { DFBWindowEvent we; we.type = DWET_KEYUP; we.key_code = data->keys[i].code; we.key_id = data->keys[i].id; we.key_symbol = data->keys[i].symbol; post_event( data->keys[i].owner, data, &we ); data->keys[i].code = -1; } } return DFB_OK; } static DFBResult wm_window_at( CoreWindowStack *stack, void *wm_data, void *stack_data, int x, int y, CoreWindow **ret_window ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( ret_window != NULL ); *ret_window = window_at_pointer( stack, data, wm_data, x, y ); return DFB_OK; } static DFBResult wm_window_lookup( CoreWindowStack *stack, void *wm_data, void *stack_data, DFBWindowID window_id, CoreWindow **ret_window ) { int i; CoreWindow *window = NULL; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( ret_window != NULL ); D_MAGIC_ASSERT( data, StackData ); fusion_vector_foreach_reverse (window, i, data->windows) { if (window->id == window_id) { break; } } *ret_window = window; return DFB_OK; } static DFBResult wm_enum_windows( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWMWindowCallback callback, void *callback_ctx ) { int i; CoreWindow *window = NULL; StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( callback != NULL ); D_MAGIC_ASSERT( data, StackData ); fusion_vector_foreach_reverse (window, i, data->windows) { if (callback( window, callback_ctx ) != DFENUM_OK) break; } return DFB_OK; } /**************************************************************************************************/ static DFBResult wm_get_insets( CoreWindowStack *stack, CoreWindow *window, DFBInsets *insets ) { insets->l = 0; insets->t = 0; insets->r = 0; insets->b = 0; return DFB_OK; } static DFBResult wm_preconfigure_window( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data ) { if (window->config.association) return DFB_UNIMPLEMENTED; return DFB_OK; } static DFBResult wm_set_window_property( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data, const char *key, void *value, void **ret_old_value ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( key != NULL ); fusion_object_set_property((FusionObject*)window, key,value,ret_old_value); return DFB_OK; } static DFBResult wm_get_window_property( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data, const char *key, void **ret_value ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( key != NULL ); D_ASSERT( ret_value != NULL ); *ret_value = fusion_object_get_property((FusionObject*)window,key); return DFB_OK; } static DFBResult wm_remove_window_property( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data, const char *key, void **ret_value ) { D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( key != NULL ); fusion_object_remove_property((FusionObject*)window,key,ret_value); return DFB_OK; } static DFBResult wm_add_window( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data ) { WindowData *data = window_data; StackData *sdata = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( sdata, StackData ); /* Initialize window data. */ data->window = window; data->stack_data = stack_data; data->priority = get_priority( window ); if (window->region) dfb_layer_region_get_configuration( window->region, &data->config ); D_MAGIC_SET( data, WindowData ); /* Actually add the window to the stack. */ insert_window( stack, sdata, window, data ); /* Possibly switch focus to the new window. */ update_focus( stack, sdata, wm_data ); process_updates( sdata, wm_data, stack, window->primary_region, DSFLIP_NONE ); return DFB_OK; } static DFBResult wm_remove_window( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreWindow *window, void *window_data ) { WindowData *data = window_data; StackData *sdata = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( window != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); D_MAGIC_ASSERT( sdata, StackData ); remove_window( stack, sdata, window, data ); /* Free key list. */ if (window->config.keys) { SHFREE( stack->shmpool, window->config.keys ); window->config.keys = NULL; window->config.num_keys = 0; } D_MAGIC_CLEAR( data ); return DFB_OK; } static DFBResult wm_set_window_config( CoreWindow *window, void *wm_data, void *window_data, const CoreWindowConfig *config, CoreWindowConfigFlags flags ) { DFBResult ret; CoreWindowStack *stack; D_ASSERT( window != NULL ); D_ASSERT( window->stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( config != NULL ); stack = window->stack; D_ASSERT( stack != NULL ); if (flags & CWCF_OPTIONS) { if ((window->config.options & DWOP_SCALE) && !(config->options & DWOP_SCALE) && window->surface) { if (window->config.bounds.w != window->surface->config.size.w || window->config.bounds.h != window->surface->config.size.h) { ret = dfb_surface_reformat( window->surface, window->config.bounds.w, window->config.bounds.h, window->surface->config.format ); if (ret) { D_DERROR( ret, "WM/Default: Could not resize surface " "(%dx%d -> %dx%d) to remove DWOP_SCALE!\n", window->surface->config.size.w, window->surface->config.size.h, window->config.bounds.w, window->config.bounds.h ); return ret; } } } window->config.options = config->options; } if (flags & CWCF_EVENTS) window->config.events = config->events; if (flags & CWCF_COLOR) return DFB_UNSUPPORTED; if (flags & CWCF_COLOR_KEY) window->config.color_key = config->color_key; if (flags & CWCF_OPAQUE) window->config.opaque = config->opaque; if (flags & CWCF_OPACITY && !config->opacity) set_opacity( window, window_data, wm_data, config->opacity ); if (flags == (CWCF_POSITION | CWCF_SIZE)) { ret = set_window_bounds (window, wm_data, window_data, config->bounds.x, config->bounds.y, config->bounds.w, config->bounds.h); if (ret) return ret; } else { if (flags & CWCF_POSITION) { ret = move_window( window, window_data, config->bounds.x - window->config.bounds.x, config->bounds.y - window->config.bounds.y ); if (ret) return ret; } if (flags & CWCF_SIZE) { ret = resize_window( window, wm_data, window_data, config->bounds.w, config->bounds.h ); if (ret) return ret; } } if (flags & CWCF_STACKING) restack_window( window, window_data, window, window_data, 0, config->stacking ); if (flags & CWCF_OPACITY && config->opacity) set_opacity( window, window_data, wm_data, config->opacity ); if (flags & CWCF_KEY_SELECTION) { if (config->key_selection == DWKS_LIST) { unsigned int bytes = sizeof(DFBInputDeviceKeySymbol) * config->num_keys; DFBInputDeviceKeySymbol *keys; D_ASSERT( config->keys != NULL ); D_ASSERT( config->num_keys > 0 ); keys = SHMALLOC( window->stack->shmpool, bytes ); if (!keys) { D_ERROR( "WM/Default: Could not allocate %d bytes for list " "of selected keys (%d)!\n", bytes, config->num_keys ); return D_OOSHM(); } direct_memcpy( keys, config->keys, bytes ); qsort( keys, config->num_keys, sizeof(DFBInputDeviceKeySymbol), keys_compare ); if (window->config.keys) SHFREE( window->stack->shmpool, window->config.keys ); window->config.keys = keys; window->config.num_keys = config->num_keys; } else if (window->config.keys) { SHFREE( window->stack->shmpool, window->config.keys ); window->config.keys = NULL; window->config.num_keys = 0; } window->config.key_selection = config->key_selection; } process_updates( stack->stack_data, wm_data, stack, window->primary_region, DSFLIP_NONE ); return DFB_OK; } static DFBResult wm_restack_window( CoreWindow *window, void *wm_data, void *window_data, CoreWindow *relative, void *relative_data, int relation ) { DFBResult ret; WindowData *data = window_data; StackData *sdata; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_MAGIC_ASSERT( data, WindowData ); D_ASSERT( relative == NULL || relative_data != NULL ); D_ASSERT( relative == NULL || relative == window || relation != 0); sdata = data->stack_data; D_ASSERT( sdata != NULL ); D_ASSERT( sdata->stack != NULL ); ret = restack_window( window, window_data, relative, relative_data, relation, window->config.stacking ); if (ret) return ret; /* Possibly switch focus to window now under the cursor */ update_focus( sdata->stack, sdata, wm_data ); process_updates( sdata, wm_data, window->stack, window->primary_region, DSFLIP_NONE ); return DFB_OK; } static DFBResult wm_grab( CoreWindow *window, void *wm_data, void *window_data, CoreWMGrab *grab ) { StackData *sdata; WindowData *wdata = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( grab != NULL ); D_ASSERT( wdata->stack_data != NULL ); sdata = wdata->stack_data; switch (grab->target) { case CWMGT_KEYBOARD: return grab_keyboard( window, window_data ); case CWMGT_POINTER: return grab_pointer( window, window_data ); case CWMGT_KEY: return grab_key( window, window_data, grab->symbol, grab->modifiers ); case CWMGT_UNSELECTED_KEYS: if (sdata->unselkeys_window) return DFB_LOCKED; sdata->unselkeys_window = window; return DFB_OK; default: D_BUG( "unknown grab target" ); break; } return DFB_BUG; } static DFBResult wm_ungrab( CoreWindow *window, void *wm_data, void *window_data, CoreWMGrab *grab ) { StackData *sdata; WindowData *wdata = window_data; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); D_ASSERT( grab != NULL ); D_ASSERT( wdata->stack_data != NULL ); sdata = wdata->stack_data; switch (grab->target) { case CWMGT_KEYBOARD: return ungrab_keyboard( window, window_data ); case CWMGT_POINTER: return ungrab_pointer( window, window_data, wm_data ); case CWMGT_KEY: return ungrab_key( window, window_data, grab->symbol, grab->modifiers ); case CWMGT_UNSELECTED_KEYS: if (sdata->unselkeys_window == window) sdata->unselkeys_window = NULL; return DFB_OK; default: D_BUG( "unknown grab target" ); break; } return DFB_BUG; } static DFBResult wm_request_focus( CoreWindow *window, void *wm_data, void *window_data ) { D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); return request_focus( window, window_data ); } /**************************************************************************************************/ static DFBResult wm_update_stack( CoreWindowStack *stack, void *wm_data, void *stack_data, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { StackData *data = stack_data; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_ASSERT( region != NULL ); D_MAGIC_ASSERT( data, StackData ); dfb_updates_add( &data->updates, region ); process_updates( data, wm_data, stack, NULL, flags ); return DFB_OK; } static DFBResult wm_update_window( CoreWindow *window, void *wm_data, void *window_data, const DFBRegion *region, /* surface coordinates! */ DFBSurfaceFlipFlags flags ) { CoreWindowStack *stack; D_ASSERT( window != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( window_data != NULL ); DFB_REGION_ASSERT_IF( region ); stack = window->stack; D_ASSERT( stack != NULL ); update_window( window, window_data, region, flags, false, false, true ); process_updates( stack->stack_data, wm_data, stack, window->primary_region, flags ); return DFB_OK; } static DFBResult wm_update_cursor( CoreWindowStack *stack, void *wm_data, void *stack_data, CoreCursorUpdateFlags flags ) { DFBResult ret; DFBRegion old_region; WMData *wmdata = wm_data; StackData *data = stack_data; bool restored = false; CoreLayerContext *context; CoreLayerRegion *primary; CoreSurface *surface; D_ASSERT( stack != NULL ); D_ASSERT( wm_data != NULL ); D_ASSERT( stack_data != NULL ); D_MAGIC_ASSERT( data, StackData ); old_region = data->cursor_region; if (flags & (CCUF_ENABLE | CCUF_POSITION | CCUF_SIZE)) { data->cursor_bs_valid = false; data->cursor_region.x1 = stack->cursor.x - stack->cursor.hot.x; data->cursor_region.y1 = stack->cursor.y - stack->cursor.hot.y; data->cursor_region.x2 = data->cursor_region.x1 + stack->cursor.size.w - 1; data->cursor_region.y2 = data->cursor_region.y1 + stack->cursor.size.h - 1; if (!dfb_region_intersect( &data->cursor_region, 0, 0, stack->width - 1, stack->height - 1 )) { D_BUG( "invalid cursor region" ); return DFB_BUG; } } /* Optimize case of invisible cursor moving. */ if (!(flags & ~(CCUF_POSITION | CCUF_SHAPE)) && (!stack->cursor.opacity || !stack->cursor.enabled)) return DFB_OK; context = stack->context; D_ASSERT( context != NULL ); if (!data->cursor_bs) { CoreSurface *cursor_bs; DFBSurfaceCapabilities caps = DSCAPS_NONE; D_ASSUME( flags & CCUF_ENABLE ); dfb_surface_caps_apply_policy( stack->cursor.policy, &caps ); /* Create the cursor backing store surface. */ ret = dfb_surface_create_simple( wmdata->core, stack->cursor.size.w, stack->cursor.size.h, context->config.pixelformat, caps, CSTF_SHARED | CSTF_CURSOR, 0, /* FIXME: no shared cursor objects, no cursor id */ NULL, &cursor_bs ); if (ret) { D_ERROR( "WM/Default: Failed creating backing store for cursor!\n" ); return ret; } ret = dfb_surface_globalize( cursor_bs ); D_ASSERT( ret == DFB_OK ); data->cursor_bs = cursor_bs; } D_ASSERT( data->cursor_bs != NULL ); /* Get the primary region. */ ret = dfb_layer_context_get_primary_region( context, false, &primary ); if (ret) return ret; surface = primary->surface; D_ASSERT( surface != NULL ); if (flags & CCUF_ENABLE) { /* Ensure valid back buffer. From now on swapping is prevented until cursor is disabled. * FIXME: Keep a flag to know when back/front have been swapped and need a sync. */ switch (context->config.buffermode) { case DLBM_BACKVIDEO: case DLBM_TRIPLE: dfb_gfx_copy( surface, surface, NULL ); break; default: break; } } /* restore region under cursor */ if (data->cursor_drawn) { DFBRectangle rect = { 0, 0, old_region.x2 - old_region.x1 + 1, old_region.y2 - old_region.y1 + 1 }; D_ASSERT( stack->cursor.opacity || (flags & CCUF_OPACITY) ); dfb_gfx_copy_to( data->cursor_bs, surface, &rect, old_region.x1, old_region.y1, false ); data->cursor_drawn = false; restored = true; } if (flags & CCUF_SIZE) { ret = dfb_surface_reformat( data->cursor_bs, stack->cursor.size.w, stack->cursor.size.h, data->cursor_bs->config.format ); if (ret) D_DERROR( ret, "WM/Default: Failed resizing backing store for cursor from %dx%d to %dx%d!\n", data->cursor_bs->config.size.w, data->cursor_bs->config.size.h, stack->cursor.size.w, stack->cursor.size.h ); } if (flags & CCUF_DISABLE) { dfb_surface_unlink( &data->cursor_bs ); } else if (stack->cursor.opacity) { CoreLayer *layer = dfb_layer_at( context->layer_id ); CardState *state = &layer->state; DFBRectangle source = primary->config.source; /* backup region under cursor */ if (!data->cursor_bs_valid) { DFBRectangle rect = DFB_RECTANGLE_INIT_FROM_REGION( &data->cursor_region ); D_ASSERT( !data->cursor_drawn ); /* FIXME: this requires using blitted flipping all the time, but fixing it seems impossible, for now DSFLIP_BLIT is forced in repaint_stack() when the cursor is enabled. */ dfb_gfx_copy_to( surface, data->cursor_bs, &rect, 0, 0, true ); data->cursor_bs_valid = true; } /* Set destination. */ state->destination = surface; state->modified |= SMF_DESTINATION; /* Set clipping region. */ dfb_state_set_clip( state, &data->cursor_region ); /* draw cursor */ draw_cursor( stack, data, state, &data->cursor_region ); /* Reset destination. */ state->destination = NULL; state->modified |= SMF_DESTINATION; data->cursor_drawn = true; if (restored) { if (dfb_region_region_intersects( &old_region, &data->cursor_region )) dfb_region_region_union( &old_region, &data->cursor_region ); else dfb_layer_region_flip_update( primary, &data->cursor_region, DSFLIP_BLIT ); dfb_layer_region_flip_update( primary, &old_region, DSFLIP_BLIT ); } else dfb_layer_region_flip_update( primary, &data->cursor_region, DSFLIP_BLIT ); /* Pan to follow the cursor. */ if (source.x > stack->cursor.x) source.x = stack->cursor.x; else if (source.x + source.w - 1 < stack->cursor.x) source.x = stack->cursor.x - source.w + 1; if (source.y > stack->cursor.y) source.y = stack->cursor.y; else if (source.y + source.h - 1 < stack->cursor.y) source.y = stack->cursor.y - source.h + 1; dfb_layer_context_set_sourcerectangle( context, &source ); } else if (restored) dfb_layer_region_flip_update( primary, &old_region, DSFLIP_BLIT ); /* Unref primary region. */ dfb_layer_region_unref( primary ); return DFB_OK; } DirectFB-1.2.10/README0000644000175000017500000004013711245562152011026 00000000000000DirectFB README --------------- This is a developers release of DirectFB. DirectFB is a graphics library which was designed with embedded systems in mind. It offers maximum hardware accelerated performance at a minimum of resource usage and overhead. Check http://www.directfb.org/ for more and up to date infos. Supported Operating Systems --------------------------- - GNU/Linux Using SDL (without acceleration support), DirectFB also supports the following operating systems: - FreeBSD (last tested: DirectFB 0.9.21 on FreeBSD 5.2) - NetBSD (tested on NetBSD 1.6) - OpenBSD (tested on OpenBSD 3.2) (If you have problems, try ./configure --disable-mmx) Please note that SDL support is experimental and incomplete. It is intended for developers to allow development of DirectFB applications in various environments. Native (non SDL) support for the following operating systems is in progress: - Mac OS X (tested on Mac OS X 10.3.5) We do not have the resources to ensure that every release of DirectFB works on all supported platforms. If you are a user of one of the operating system listed above, and have the time to test the CVS version regularly, your help is greatly appreciated. Build Requirements ------------------ Mandatory are - libc - libpthread - libm - libdl For regenerating autofoo (./autogen.sh or autoreconf) - autoconf - automake - libtool - pkg-config Optionally, depending on the configuration you want: FBDev - Linux kernel 2.2.x or newer with working frame buffer device (check /proc/fb) for the fbdev system. SDL - libSDL (Simple Direct Media Layer) for the sdl system. X11 - libX11 (X11 client library) for the X11 system (libx11-dev and libxext-dev packages). The following libraries are optional, but important (Debian package names): Fonts - libfreetype6-dev for TrueType and other fonts Images - libjpeg-dev for Joint Picture Expert Group images - libpng-dev for Portable Network Graphics Extra - zlib1g-dev for compressed screenshot support (also needed by libpng) The multi application core also requires , see the section "Running multiple DirectFB applications" for more details. The build of the image and font providers can be disabled but we strongly suggest that you don't do this since the code examples and a lot of DirectFB applications depend on the functionality provided by them. The libmpeg3 video provider requires the libmpeg3 library which is not commonly installed. We provide this package on our web-site at http://www.directfb.org/download/contrib/. The avifile and flash video providers that used to be shipped with DirectFB have been moved to the DirectFB-extra package. We suggest you also install pkg-config available from http://www.freedesktop.org/software/pkgconfig/. It will help you to compile applications based on DirectFB. Usage Requirements ------------------ Depending on the DirectFB application you want to run, you need some or all of these: - A working frame buffer device (check the output of 'fbset -i'). - A keyboard (if it works on the console, everything should be fine). - A PS/2 or serial mouse for windowing. USB and ADB mice do also work via PS/2 emulation. Using the single application core you always need access to /dev/tty0, /dev/fb0 and the mouse device (/dev/psaux, /dev/mouse). You can either run all DirectFB applications as root or allow users to access these devices. A reasonable way to do this is to add users to the group tty (or some other group) and allow this group to read and write the files in /dev: crw-rw---- 1 root tty 29, 0 /dev/fb0 crw-rw---- 1 root tty 10, 1 /dev/psaux crw-r----- 1 root tty 4, 0 /dev/tty0 If you are using the multi application core, only the master process needs access to all of these devices. Additional processes (slaves) just need access to /dev/fb0 and: crw-rw---- 1 root fusion 29, 0 /dev/fusion/0 Note that the master creates a shared memory file, probably in '/dev/shm/fusion.0'. It's read/writeable for anyone matching the master process' user or group. Some applications from the DirectFB-examples package have additional requirements: - A video card supported by video4linux for df_video. - A joystick for df_joystick. Running multiple DirectFB applications at the same time ------------------------------------------------------- With the default build of the DirectFB library, only one DirectFB application may be running. However you have the option to use the multi application core of DirectFB which allows multiple DirectFB applications to run at the same time within a session. DirectFB applications communicate through a layer we called Fusion. This layer was previously implemented completely in user space using semaphores and message queues. But since 0.9.15 the Fusion Kernel Device is required which implements critical parts of Fusion and thus lead to better performance and decent stability. To install this kernel module (only available for Linux yet), check out the linux-fusion module from our CVS repository or use the patch provided by this release (in the patches directory). Note that you don't need to patch your kernel using the CVS version of Fusion. Compile DirectFB with multi-application core enabled: ./configure --enable-multi Make sure your Linux kernel supports tmpfs. This is explained in the kernel sources in Documentation/filesystems/tmpfs.txt. Mount a tmpfs filesystem as /dev/shm: mount tmpfs /dev/shm -ttmpfs Optionally a mount point can be specified via the "tmpfs" option, see directfbrc(5). The option has to be the same for all processes. A good way to test the multi-application core is to install the lite toolkit and DFBTerm, a DirectFB terminal (both available in the DirectFB CVS repository). You can then start DirectFB applications from dfbterm. Recommendations --------------- To take full advantage of hardware acceleration, a Matrox G200/G400/G450/G550 graphics card is recommend for this version of DirectFB. The drivers for ATI128, Voodoo 3/4/5/Banshee, NeoMagic and S3 Savage cards included with this release are work in progress and only yet support a subset of the possible accelerations. Installation ------------ 1) In the DirectFB directory type: ./configure make make install (as superuser) Use './configure --help' to get a list of possible configure options. Imported options include: --enable-multi Enables the Multi Application Core --enable-debug Enables many debug messages and assertions --enable-trace Enables run time stack trace information Debugging and especially stack trace support are a performance impact. It may be noticably slower in some areas, e.g. text drawing. You may use the options "no-debug" and "no-trace" by default, e.g. in '/etc/directfbrc', and use "--dfb:debug,trace" on the command line if needed. 2) Make sure that "/lib" is listed in your /etc/ld.so.conf. The default prefix is "/usr/local". After adding it you have to run 'ldconfig' as superuser. Alternatively, you can add the path to the environment variable LD_LIBRARY_PATH. This is useful for temporarily switching to another installed version. 3) You might want to copy fb.modes to /etc or merge it with your existing /etc/fb.modes file. The first entry will be used by default - copy other entries you may need. 4) If you want to use a serial mouse, create a link called /dev/mouse that points to serial device (e.g. /dev/ttyS0). Then add a line describing your mouse-protocol to /etc/directfbrc or ~/.directfbrc: "mouse-protocol=[ms|ms3|mouseman|mousesystems]". 5) If you are cross compiling and have installed the required libraries someplace other than /usr/local/lib be sure to add the bin directory for those libraries to the front of your 'PATH'. For instance if you configured using: --prefix=/dfb/usr/local then be sure to export PATH=/dfb/usr/local/bin:$PATH before compiling and installing. Configuring DirectFB -------------------- There are lots of things that can be configured. We try to ship DirectFB with reasonable defaults but you might have to tweak things. There are several ways to do this. You may edit the system-wide configuration file /etc/directfbrc or the user-specific $HOME/.directfbrc. There's a manual page called directfbrc(5) that documents all the settings. The same manual page also explains how DirectFB application can be configured via the command-line. Configuring the Linux frame buffer device ----------------------------------------- DirectFB needs a Linux kernel with frame buffer support. Check the documentation in the kernel tree (/usr/src/linux/Documentation/fb/) on how to enable the frame buffer device for your graphics card. The generic VESA frame buffer device does not support mode switching and you will not get hardware acceleration. To make DirectFB work with veasfb, you should add the following lines to /etc/lilo.conf: append="video=vesa:ywrap,mtrr" 'ywrap' enables panning with wraparound. 'mtrr' enables setting caching type for the frame buffer to write-combining. vga=791 This sets the mode on startup. 791 means 1024x768@16, 788 means 800x600@16. All VESA Video Modes: Bits 640x480 800x600 1024x768 1280x1024 1600x1200 8 769 771 773 775 796 16 785 788 791 794 798 32 786 789 792 795 799 Other frame buffer devices support mode switching. DirectFB will only support modes listed in your /etc/fb.modes file. By default the first entry found is used. If you have a Matrox card you may want to try the vsync patch found in the patches directory that enables applications to "idle wait" for the vertical retrace. Using the builtin "window manager" ---------------------------------- Since DirectFB lacks a real window manager, we added a hack to the window stack to allow for basic window management. While pressing the (or Windows) key or alternatively you can do the following: - Drag your mouse to move the focused window. - Drag and press to resize the focused window. - Drag and press to change the opacity of the focused window. - Press C to close the focused window. - Press A to lower the focused window to the bottom. - Press X to cycle the focus through the windows. - Press S to raise the lowest window to the top. - Press P to enable and show the mouse cursor. - Press E to focus the window currently under the mouse cursor, useful in conjunction with 'X'. - Press Escape to return from fullscreen mode to the desktop. (currently not advisable if the fullscreen app is still flipping) - Press F12 to redraw the whole window stack. You might want to use the "capslock-meta" option (see directfbrc(5)) if you don't have a key. Documentation ------------- A complete API reference documentation in HTML format is created during the build in the docs directory. You may also access the API reference as well as a concepts overview, tutorials and the FAQ online at http://www.directfb.org/documentation/. Thanks to --------- Johannes Zellner Till Adam Joachim Steiger Felix von Leitner Johannes Stezenbach Michael Natterer Holger Waechtler Kim JeongHoe Jason Gaiser W. Michael Petullo Jiri Svoboda Hallvar Helleseth Topi Kanerva Daniel Mack Ara Hacopian Mike Haertel Enno Brehm Martin Mueller Sebastian Klemke Fredrik Hallenberg Antonino Daplas Scott A McConnell Alex SONG Ville Syrjl Brian J. Murrell Tim Janik Billy Biggs Andreas Oberritter Simon Ueng Scott Brumbaugh Sebastian Ley James Su Sarma Kolluru Oliver Schwartz Florian J.P. Delport Michel Dnzer Maurizio Monge Tim Wright Liam Girdwood Andreas Robinson Michael Hunold Brandon M. Reynolds Micha Nelissen Vadim Catana Henning Glawe Ed Millard Claudio Ciccani Tom Bridgwater Oskar Liljeblad Bryce Nichols Stefan Lucke Mws Ivan Daniluk Mark Salter Martin Ltken Sylvain Meyer Mark Adams Damian Kowalewski Jakub Bogusz Nathanael D. Noblet Ryan Burns Colin Watson Guillem Jover Jeff Bailey Andreas Jochens Daniel J Laird Marko Mkel Nils Magnus Larsgard Pr Degerman Michel van Noorloos Gery Shane Paul Mackerras Attilio Fiandrotti Vaclav Slavik Philip Jgenstedt sridewa Eugene Everson Mike Crowe Kieran Bingham Luis Mondesi +lemsx1 +gmail,com Keith Mok GARDET Guillaume Phil Endecott Brian Austin Keith Mok Special thanks to Ville Syrjala for his great work on the Matrox TV-Out support and for his several patches including fixes and enhancements for the whole library. He also did several ports like UAE or mplayer for DirectFB. Check out his site at 'http://www.sci.fi/~syrjala/'. Legal stuff ----------- (c) Copyright 2001-2007 The DirectFB Organization (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The complete text of the license is found in the file COPYING. DirectFB-1.2.10/interfaces/0000777000175000017500000000000011307522566012354 500000000000000DirectFB-1.2.10/interfaces/IDirectFBImageProvider/0000777000175000017500000000000011307522566016565 500000000000000DirectFB-1.2.10/interfaces/IDirectFBImageProvider/idirectfbimageprovider_png.c0000644000175000017500000006725211245562152024232 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBImageProvider *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, PNG ) enum { STAGE_ABORT = -2, STAGE_ERROR = -1, STAGE_START = 0, STAGE_INFO, STAGE_IMAGE, STAGE_END }; /* * private data struct of IDirectFBImageProvider_PNG */ typedef struct { int ref; /* reference counter */ IDirectFBDataBuffer *buffer; int stage; int rows; png_structp png_ptr; png_infop info_ptr; png_uint_32 width; png_uint_32 height; int bpp; int color_type; png_uint_32 color_key; bool color_keyed; void *image; int pitch; u32 palette[256]; DFBColor colors[256]; DIRenderCallback render_callback; void *render_callback_context; CoreDFB *core; } IDirectFBImageProvider_PNG_data; static DirectResult IDirectFBImageProvider_PNG_AddRef ( IDirectFBImageProvider *thiz ); static DirectResult IDirectFBImageProvider_PNG_Release ( IDirectFBImageProvider *thiz ); static DFBResult IDirectFBImageProvider_PNG_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect ); static DFBResult IDirectFBImageProvider_PNG_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ); static DFBResult IDirectFBImageProvider_PNG_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc ); static DFBResult IDirectFBImageProvider_PNG_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *dsc ); /* Called at the start of the progressive load, once we have image info */ static void png_info_callback (png_structp png_read_ptr, png_infop png_info_ptr); /* Called for each row; note that you will get duplicate row numbers for interlaced PNGs */ static void png_row_callback (png_structp png_read_ptr, png_bytep new_row, png_uint_32 row_num, int pass_num); /* Called after reading the entire image */ static void png_end_callback (png_structp png_read_ptr, png_infop png_info_ptr); /* Pipes data into libpng until stage is different from the one specified. */ static DFBResult push_data_until_stage (IDirectFBImageProvider_PNG_data *data, int stage, int buffer_size); /**********************************************************************************************************************/ static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ) { if (png_check_sig( ctx->header, 8 )) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, ... ) { DFBResult ret = DFB_FAILURE; IDirectFBDataBuffer *buffer; CoreDFB *core; va_list tag; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_PNG) va_start( tag, thiz ); buffer = va_arg( tag, IDirectFBDataBuffer * ); core = va_arg( tag, CoreDFB * ); va_end( tag ); data->ref = 1; data->buffer = buffer; data->core = core; /* Increase the data buffer reference counter. */ buffer->AddRef( buffer ); /* Create the PNG read handle. */ data->png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL ); if (!data->png_ptr) goto error; if (setjmp( data->png_ptr->jmpbuf )) { D_ERROR( "ImageProvider/PNG: Error reading header!\n" ); goto error; } /* Create the PNG info handle. */ data->info_ptr = png_create_info_struct( data->png_ptr ); if (!data->info_ptr) goto error; /* Setup progressive image loading. */ png_set_progressive_read_fn( data->png_ptr, data, png_info_callback, png_row_callback, png_end_callback ); /* Read until info callback is called. */ ret = push_data_until_stage( data, STAGE_INFO, 64 ); if (ret) goto error; thiz->AddRef = IDirectFBImageProvider_PNG_AddRef; thiz->Release = IDirectFBImageProvider_PNG_Release; thiz->RenderTo = IDirectFBImageProvider_PNG_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_PNG_SetRenderCallback; thiz->GetImageDescription = IDirectFBImageProvider_PNG_GetImageDescription; thiz->GetSurfaceDescription = IDirectFBImageProvider_PNG_GetSurfaceDescription; return DFB_OK; error: if (data->png_ptr) png_destroy_read_struct( &data->png_ptr, &data->info_ptr, NULL ); buffer->Release( buffer ); if (data->image) D_FREE( data->image ); DIRECT_DEALLOCATE_INTERFACE(thiz); return ret; } /**********************************************************************************************************************/ static void IDirectFBImageProvider_PNG_Destruct( IDirectFBImageProvider *thiz ) { IDirectFBImageProvider_PNG_data *data = (IDirectFBImageProvider_PNG_data*)thiz->priv; png_destroy_read_struct( &data->png_ptr, &data->info_ptr, NULL ); /* Decrease the data buffer reference counter. */ data->buffer->Release( data->buffer ); /* Deallocate image data. */ if (data->image) D_FREE( data->image ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBImageProvider_PNG_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_PNG) data->ref++; return DFB_OK; } static DirectResult IDirectFBImageProvider_PNG_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_PNG) if (--data->ref == 0) { IDirectFBImageProvider_PNG_Destruct( thiz ); } return DFB_OK; } /**********************************************************************************************************************/ static DFBResult IDirectFBImageProvider_PNG_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dest_rect ) { DFBResult ret = DFB_OK; IDirectFBSurface_data *dst_data; CoreSurface *dst_surface; DFBRegion clip; DFBRectangle rect; png_infop info; int x, y; DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_PNG) info = data->info_ptr; dst_data = (IDirectFBSurface_data*) destination->priv; if (!dst_data) return DFB_DEAD; dst_surface = dst_data->surface; if (!dst_surface) return DFB_DESTROYED; dfb_region_from_rectangle( &clip, &dst_data->area.current ); if (dest_rect) { if (dest_rect->w < 1 || dest_rect->h < 1) return DFB_INVARG; rect = *dest_rect; rect.x += dst_data->area.wanted.x; rect.y += dst_data->area.wanted.y; } else { rect = dst_data->area.wanted; } if (setjmp( data->png_ptr->jmpbuf )) { D_ERROR( "ImageProvider/PNG: Error during decoding!\n" ); if (data->stage < STAGE_IMAGE) return DFB_FAILURE; data->stage = STAGE_ERROR; } /* Read until image is completely decoded. */ if (data->stage != STAGE_ERROR) { ret = push_data_until_stage( data, STAGE_END, 16384 ); if (ret) return ret; } /* actual rendering */ if (dfb_rectangle_region_intersects( &rect, &clip )) { CoreSurfaceBufferLock lock; ret = dfb_surface_lock_buffer( dst_surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); if (ret) return ret; switch (data->color_type) { case PNG_COLOR_TYPE_PALETTE: if (dst_surface->config.format == DSPF_LUT8 && data->info_ptr->bit_depth == 8) { /* * Special indexed PNG to LUT8 loading. */ /* FIXME: Limitation for LUT8 is to load complete surface only. */ dfb_clip_rectangle( &clip, &rect ); if (rect.x == 0 && rect.y == 0 && rect.w == dst_surface->config.size.w && rect.h == dst_surface->config.size.h && rect.w == data->width && rect.h == data->height) { for (y=0; yheight; y++) direct_memcpy( lock.addr + lock.pitch * y, data->image + data->pitch * y, data->width ); break; } } /* fall through */ case PNG_COLOR_TYPE_GRAY: { /* * Convert to ARGB and use generic loading code. */ // FIXME: allocates four additional bytes because the scaling functions // in src/misc/gfx_util.c have an off-by-one bug which causes // segfaults on darwin/osx (not on linux) int size = data->width * data->height * 4 + 4; /* allocate image data */ void *image_argb = D_MALLOC( size ); if (!image_argb) { D_ERROR( "DirectFB/ImageProvider_PNG: Could not " "allocate %d bytes of system memory!\n", size ); ret = DFB_NOSYSTEMMEMORY; } else { if (data->color_type == PNG_COLOR_TYPE_GRAY) { int num = 1 << data->info_ptr->bit_depth; for (x=0; xpalette[x] = 0xff000000 | (value << 16) | (value << 8) | value; } } switch (data->info_ptr->bit_depth) { case 8: for (y=0; yheight; y++) { u8 *S = data->image + data->pitch * y; u32 *D = image_argb + data->width * y * 4; for (x=0; xwidth; x++) D[x] = data->palette[ S[x] ]; } break; case 4: for (y=0; yheight; y++) { u8 *S = data->image + data->pitch * y; u32 *D = image_argb + data->width * y * 4; for (x=0; xwidth; x++) { if (x & 1) D[x] = data->palette[ S[x>>1] & 0xf ]; else D[x] = data->palette[ S[x>>1] >> 4 ]; } } break; case 2: for (y=0; yheight; y++) { int n = 6; u8 *S = data->image + data->pitch * y; u32 *D = image_argb + data->width * y * 4; for (x=0; xwidth; x++) { D[x] = data->palette[ (S[x>>2] >> n) & 3 ]; n = (n ? n - 2 : 6); } } break; case 1: for (y=0; yheight; y++) { int n = 7; u8 *S = data->image + data->pitch * y; u32 *D = image_argb + data->width * y * 4; for (x=0; xwidth; x++) { D[x] = data->palette[ (S[x>>3] >> n) & 1 ]; n = (n ? n - 1 : 7); } } break; default: D_ERROR( "ImageProvider/PNG: Unsupported indexed bit depth %d!\n", data->info_ptr->bit_depth ); } dfb_scale_linear_32( image_argb, data->width, data->height, lock.addr, lock.pitch, &rect, dst_surface, &clip ); D_FREE( image_argb ); } break; } default: /* * Generic loading code. */ dfb_scale_linear_32( data->image, data->width, data->height, lock.addr, lock.pitch, &rect, dst_surface, &clip ); break; } dfb_surface_unlock_buffer( dst_surface, &lock ); } if (data->stage != STAGE_END) ret = DFB_INCOMPLETE; return ret; } static DFBResult IDirectFBImageProvider_PNG_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_PNG) data->render_callback = callback; data->render_callback_context = context; return DFB_OK; } static DFBResult IDirectFBImageProvider_PNG_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc ) { DFBSurfacePixelFormat primary_format = dfb_primary_layer_pixelformat(); DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_PNG) dsc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; dsc->width = data->width; dsc->height = data->height; if (data->color_type & PNG_COLOR_MASK_ALPHA) dsc->pixelformat = DFB_PIXELFORMAT_HAS_ALPHA(primary_format) ? primary_format : DSPF_ARGB; else dsc->pixelformat = primary_format; if (data->color_type == PNG_COLOR_TYPE_PALETTE) { dsc->flags |= DSDESC_PALETTE; dsc->palette.entries = data->colors; /* FIXME */ dsc->palette.size = 256; } return DFB_OK; } static DFBResult IDirectFBImageProvider_PNG_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *dsc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_PNG) if (!dsc) return DFB_INVARG; dsc->caps = DICAPS_NONE; if (data->color_type & PNG_COLOR_MASK_ALPHA) dsc->caps |= DICAPS_ALPHACHANNEL; if (data->color_keyed) { dsc->caps |= DICAPS_COLORKEY; dsc->colorkey_r = (data->color_key & 0xff0000) >> 16; dsc->colorkey_g = (data->color_key & 0x00ff00) >> 8; dsc->colorkey_b = (data->color_key & 0x0000ff); } return DFB_OK; } /**********************************************************************************************************************/ #define MAXCOLORMAPSIZE 256 static int SortColors (const void *a, const void *b) { return (*((const u8 *) a) - *((const u8 *) b)); } /* looks for a color that is not in the colormap and ideally not even close to the colors used in the colormap */ static u32 FindColorKey( int n_colors, u8 *cmap ) { u32 color = 0xFF000000; u8 csort[n_colors]; int i, j, index, d; if (n_colors < 1) return color; for (i = 0; i < 3; i++) { direct_memcpy( csort, cmap + (n_colors * i), n_colors ); qsort( csort, n_colors, 1, SortColors ); for (j = 1, index = 0, d = 0; j < n_colors; j++) { if (csort[j] - csort[j-1] > d) { d = csort[j] - csort[j-1]; index = j; } } if ((csort[0] - 0x0) > d) { d = csort[0] - 0x0; index = n_colors; } if (0xFF - (csort[n_colors - 1]) > d) { index = n_colors + 1; } if (index < n_colors) csort[0] = csort[index] - (d/2); else if (index == n_colors) csort[0] = 0x0; else csort[0] = 0xFF; color |= (csort[0] << (8 * (2 - i))); } return color; } /* Called at the start of the progressive load, once we have image info */ static void png_info_callback( png_structp png_read_ptr, png_infop png_info_ptr ) { int i; IDirectFBImageProvider_PNG_data *data; data = png_get_progressive_ptr( png_read_ptr ); /* error stage? */ if (data->stage < 0) return; /* set info stage */ data->stage = STAGE_INFO; png_get_IHDR( data->png_ptr, data->info_ptr, &data->width, &data->height, &data->bpp, &data->color_type, NULL, NULL, NULL ); if (png_get_valid( data->png_ptr, data->info_ptr, PNG_INFO_tRNS )) { data->color_keyed = true; /* generate color key based on palette... */ if (data->color_type == PNG_COLOR_TYPE_PALETTE) { u32 key; png_colorp palette = data->info_ptr->palette; png_bytep trans = data->info_ptr->trans; int num_colors = MIN( MAXCOLORMAPSIZE, data->info_ptr->num_palette ); u8 cmap[3][num_colors]; for (i=0; iinfo_ptr->num_trans; i++) { if (!trans[i]) { palette[i].red = (key & 0xff0000) >> 16; palette[i].green = (key & 0x00ff00) >> 8; palette[i].blue = (key & 0x0000ff); } } data->color_key = key; } else { /* ...or based on trans rgb value */ png_color_16p trans = &data->info_ptr->trans_values; data->color_key = (((trans->red & 0xff00) << 8) | ((trans->green & 0xff00)) | ((trans->blue & 0xff00) >> 8)); } } switch (data->color_type) { case PNG_COLOR_TYPE_PALETTE: { png_colorp palette = data->info_ptr->palette; png_bytep trans = data->info_ptr->trans; int num_trans = data->info_ptr->num_trans; int num_colors = MIN( MAXCOLORMAPSIZE, data->info_ptr->num_palette ); for (i=0; icolors[i].a = (i < num_trans) ? trans[i] : 0xff; data->colors[i].r = palette[i].red; data->colors[i].g = palette[i].green; data->colors[i].b = palette[i].blue; data->palette[i] = PIXEL_ARGB( data->colors[i].a, data->colors[i].r, data->colors[i].g, data->colors[i].b ); } data->pitch = (data->width + 7) & ~7; break; } case PNG_COLOR_TYPE_GRAY: data->pitch = data->width; if (data->bpp == 16) png_set_strip_16( data->png_ptr ); break; case PNG_COLOR_TYPE_GRAY_ALPHA: png_set_gray_to_rgb( data->png_ptr ); /* fall through */ default: data->pitch = data->width * 4; if (data->bpp == 16) png_set_strip_16( data->png_ptr ); #ifdef WORDS_BIGENDIAN if (!(data->color_type & PNG_COLOR_MASK_ALPHA)) png_set_filler( data->png_ptr, 0xFF, PNG_FILLER_BEFORE ); png_set_swap_alpha( data->png_ptr ); #else if (!(data->color_type & PNG_COLOR_MASK_ALPHA)) png_set_filler( data->png_ptr, 0xFF, PNG_FILLER_AFTER ); png_set_bgr( data->png_ptr ); #endif break; } png_set_interlace_handling( data->png_ptr ); /* Update the info to reflect our transformations */ png_read_update_info( data->png_ptr, data->info_ptr ); } /* Called for each row; note that you will get duplicate row numbers for interlaced PNGs */ static void png_row_callback( png_structp png_read_ptr, png_bytep new_row, png_uint_32 row_num, int pass_num ) { IDirectFBImageProvider_PNG_data *data; data = png_get_progressive_ptr( png_read_ptr ); /* error stage? */ if (data->stage < 0) return; /* set image decoding stage */ data->stage = STAGE_IMAGE; /* check image data pointer */ if (!data->image) { // FIXME: allocates four additional bytes because the scaling functions // in src/misc/gfx_util.c have an off-by-one bug which causes // segfaults on darwin/osx (not on linux) int size = data->pitch * data->height + 4; /* allocate image data */ data->image = D_CALLOC( 1, size ); if (!data->image) { D_ERROR("DirectFB/ImageProvider_PNG: Could not " "allocate %d bytes of system memory!\n", size); /* set error stage */ data->stage = STAGE_ERROR; return; } } /* write to image data */ png_progressive_combine_row( data->png_ptr, (png_bytep) (data->image + row_num * data->pitch), new_row ); /* increase row counter, FIXME: interlaced? */ data->rows++; if (data->render_callback) { DIRenderCallbackResult r; DFBRectangle rect = { 0, row_num, data->width, 1 }; r = data->render_callback( &rect, data->render_callback_context ); if (r != DIRCR_OK) data->stage = STAGE_ABORT; } } /* Called after reading the entire image */ static void png_end_callback (png_structp png_read_ptr, png_infop png_info_ptr) { IDirectFBImageProvider_PNG_data *data; data = png_get_progressive_ptr( png_read_ptr ); /* error stage? */ if (data->stage < 0) return; /* set end stage */ data->stage = STAGE_END; } /* Pipes data into libpng until stage is different from the one specified. */ static DFBResult push_data_until_stage (IDirectFBImageProvider_PNG_data *data, int stage, int buffer_size) { DFBResult ret; IDirectFBDataBuffer *buffer = data->buffer; while (data->stage < stage) { unsigned int len; unsigned char buf[buffer_size]; if (data->stage < 0) return DFB_FAILURE; while (buffer->HasData( buffer ) == DFB_OK) { D_DEBUG( "ImageProvider/PNG: Retrieving data (up to %d bytes)...\n", buffer_size ); ret = buffer->GetData( buffer, buffer_size, buf, &len ); if (ret) return ret; D_DEBUG( "ImageProvider/PNG: Got %d bytes...\n", len ); png_process_data( data->png_ptr, data->info_ptr, buf, len ); D_DEBUG( "ImageProvider/PNG: ...processed %d bytes.\n", len ); /* are we there yet? */ if (data->stage < 0 || data->stage >= stage) { switch (data->stage) { case STAGE_ABORT: return DFB_INTERRUPTED; case STAGE_ERROR: return DFB_FAILURE; default: return DFB_OK; } } } D_DEBUG( "ImageProvider/PNG: Waiting for data...\n" ); if (buffer->WaitForData( buffer, 1 ) == DFB_EOF) return DFB_FAILURE; } return DFB_OK; } DirectFB-1.2.10/interfaces/IDirectFBImageProvider/Makefile.am0000644000175000017500000000400111245562152020524 00000000000000## Makefile.am for DirectFB/interfaces/IDirectFBImageProvider idirectfbimageproviderdir = $(MODULEDIR)/interfaces/IDirectFBImageProvider if GIF_PROVIDER GIF_PROVIDER_LTLIB = libidirectfbimageprovider_gif.la else GIF_PROVIDER_LTLIB = endif if JPEG_PROVIDER JPEG_PROVIDER_LTLIB = libidirectfbimageprovider_jpeg.la else JPEG_PROVIDER_LTLIB = endif if PNG_PROVIDER PNG_PROVIDER_LTLIB = libidirectfbimageprovider_png.la else PNG_PROVIDER_LTLIB = endif INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src AM_CPPFLAGS = -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" idirectfbimageprovider_LTLIBRARIES = \ libidirectfbimageprovider_dfiff.la \ $(GIF_PROVIDER_LTLIB) \ $(JPEG_PROVIDER_LTLIB) \ $(PNG_PROVIDER_LTLIB) if BUILD_STATIC idirectfbimageprovider_DATA = $(idirectfbimageprovider_LTLIBRARIES:.la=.o) endif libidirectfbimageprovider_png_la_SOURCES = idirectfbimageprovider_png.c libidirectfbimageprovider_png_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(LIBPNG) libidirectfbimageprovider_png_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_dfiff_la_SOURCES = idirectfbimageprovider_dfiff.c libidirectfbimageprovider_dfiff_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la libidirectfbimageprovider_dfiff_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_gif_la_SOURCES = idirectfbimageprovider_gif.c libidirectfbimageprovider_gif_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la libidirectfbimageprovider_gif_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_jpeg_la_SOURCES = idirectfbimageprovider_jpeg.c libidirectfbimageprovider_jpeg_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(LIBJPEG) libidirectfbimageprovider_jpeg_la_LDFLAGS = -avoid-version -module include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/interfaces/IDirectFBImageProvider/idirectfbimageprovider_gif.c0000644000175000017500000006532511245562152024212 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBImageProvider *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, GIF ) #ifndef NODEBUG #define GIFERRORMSG(x...) { fprintf( stderr, "(GIFLOADER) "x ); \ fprintf( stderr, "\n" ); } #else #define GIFERRORMSG(x...) #endif #define MAXCOLORMAPSIZE 256 #define CM_RED 0 #define CM_GREEN 1 #define CM_BLUE 2 #define MAX_LWZ_BITS 12 #define INTERLACE 0x40 #define LOCALCOLORMAP 0x80 #define BitSet(byte, bit) (((byte) & (bit)) == (bit)) #define LM_to_uint(a,b) (((b)<<8)|(a)) /* * private data struct of IDirectFBImageProvider_GIF */ typedef struct { int ref; /* reference counter */ IDirectFBDataBuffer *buffer; u32 *image; int image_width; int image_height; bool image_transparency; u32 image_colorkey; unsigned int Width; unsigned int Height; u8 ColorMap[3][MAXCOLORMAPSIZE]; unsigned int BitPixel; unsigned int ColorResolution; u32 Background; unsigned int AspectRatio; int GrayScale; int transparent; int delayTime; int inputFlag; int disposal; u8 buf[280]; int curbit, lastbit, done, last_byte; int fresh; int code_size, set_code_size; int max_code, max_code_size; int firstcode, oldcode; int clear_code, end_code; int table[2][(1<< MAX_LWZ_BITS)]; int stack[(1<<(MAX_LWZ_BITS))*2], *sp; DIRenderCallback render_callback; void *render_callback_ctx; CoreDFB *core; } IDirectFBImageProvider_GIF_data; static bool verbose = false; static bool showComment = false; static bool ZeroDataBlock = false; static u32* ReadGIF( IDirectFBImageProvider_GIF_data *data, int imageNumber, int *width, int *height, bool *transparency, u32 *key_rgb, bool alpha, bool headeronly); static bool ReadOK( IDirectFBDataBuffer *buffer, void *data, unsigned int len ); static DirectResult IDirectFBImageProvider_GIF_AddRef ( IDirectFBImageProvider *thiz ); static DirectResult IDirectFBImageProvider_GIF_Release ( IDirectFBImageProvider *thiz ); static DFBResult IDirectFBImageProvider_GIF_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect ); static DFBResult IDirectFBImageProvider_GIF_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ); static DFBResult IDirectFBImageProvider_GIF_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc ); static DFBResult IDirectFBImageProvider_GIF_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *dsc ); static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ) { if (strncmp ((char*) ctx->header, "GIF8", 4) == 0) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, ... ) { IDirectFBDataBuffer *buffer; CoreDFB *core; va_list tag; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_GIF) va_start( tag, thiz ); buffer = va_arg( tag, IDirectFBDataBuffer * ); core = va_arg( tag, CoreDFB * ); va_end( tag ); data->ref = 1; data->GrayScale = -1; data->transparent = -1; data->delayTime = -1; data->core = core; data->buffer = buffer; buffer->AddRef( buffer ); data->image = ReadGIF( data, 1, &data->image_width, &data->image_height, &data->image_transparency, &data->image_colorkey, true, false ); buffer->Release( buffer ); data->buffer = NULL; if (!data->image) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_FAILURE; } thiz->AddRef = IDirectFBImageProvider_GIF_AddRef; thiz->Release = IDirectFBImageProvider_GIF_Release; thiz->RenderTo = IDirectFBImageProvider_GIF_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_GIF_SetRenderCallback; thiz->GetImageDescription = IDirectFBImageProvider_GIF_GetImageDescription; thiz->GetSurfaceDescription = IDirectFBImageProvider_GIF_GetSurfaceDescription; return DFB_OK; } static void IDirectFBImageProvider_GIF_Destruct( IDirectFBImageProvider *thiz ) { IDirectFBImageProvider_GIF_data *data = (IDirectFBImageProvider_GIF_data*)thiz->priv; if (data->image) D_FREE( data->image ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBImageProvider_GIF_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_GIF) data->ref++; return DFB_OK; } static DirectResult IDirectFBImageProvider_GIF_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_GIF) if (--data->ref == 0) { IDirectFBImageProvider_GIF_Destruct( thiz ); } return DFB_OK; } static DFBResult IDirectFBImageProvider_GIF_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dest_rect ) { DFBResult ret; DFBRegion clip; DFBRectangle rect; DFBSurfacePixelFormat format; IDirectFBSurface_data *dst_data; CoreSurface *dst_surface; DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_GIF) dst_data = (IDirectFBSurface_data*) destination->priv; if (!dst_data) return DFB_DEAD; dst_surface = dst_data->surface; if (!dst_surface) return DFB_DESTROYED; dfb_region_from_rectangle( &clip, &dst_data->area.current ); if (dest_rect) { if (dest_rect->w < 1 || dest_rect->h < 1) return DFB_INVARG; rect = *dest_rect; rect.x += dst_data->area.wanted.x; rect.y += dst_data->area.wanted.y; } else { rect = dst_data->area.wanted; } ret = destination->GetPixelFormat( destination, &format ); if (ret) return ret; /* actual loading and rendering */ if (dfb_rectangle_region_intersects( &rect, &clip )) { CoreSurfaceBufferLock lock; ret = dfb_surface_lock_buffer( dst_surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); if (ret) return ret; dfb_scale_linear_32( data->image, data->image_width, data->image_height, lock.addr, lock.pitch, &rect, dst_surface, &clip ); dfb_surface_unlock_buffer( dst_surface, &lock ); if (data->render_callback) { DIRenderCallbackResult r; rect.x = 0; rect.y = 0; rect.w = data->image_width; rect.h = data->image_height; r = data->render_callback( &rect, data->render_callback_ctx ); if (r != DIRCR_OK) return DFB_INTERRUPTED; } } return DFB_OK; } static DFBResult IDirectFBImageProvider_GIF_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_GIF) data->render_callback = callback; data->render_callback_ctx = context; return DFB_OK; } static DFBResult IDirectFBImageProvider_GIF_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_GIF) dsc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; dsc->width = data->image_width; dsc->height = data->image_height; dsc->pixelformat = dfb_primary_layer_pixelformat(); return DFB_OK; } static DFBResult IDirectFBImageProvider_GIF_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *dsc ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_GIF) if (data->image_transparency) { dsc->caps = DICAPS_COLORKEY; dsc->colorkey_r = (data->image_colorkey & 0xff0000) >> 16; dsc->colorkey_g = (data->image_colorkey & 0x00ff00) >> 8; dsc->colorkey_b = (data->image_colorkey & 0x0000ff); } else dsc->caps = DICAPS_NONE; return DFB_OK; } /********************************** GIF Loader Code **********************************/ static int ReadColorMap( IDirectFBDataBuffer *buffer, int number, u8 buf[3][MAXCOLORMAPSIZE] ) { int i; u8 rgb[3]; for (i = 0; i < number; ++i) { if (! ReadOK( buffer, rgb, sizeof(rgb) )) { GIFERRORMSG("bad colormap" ); return true; } buf[CM_RED][i] = rgb[0] ; buf[CM_GREEN][i] = rgb[1] ; buf[CM_BLUE][i] = rgb[2] ; } return false; } static int GetDataBlock(IDirectFBDataBuffer *buffer, u8 *buf) { unsigned char count; if (! ReadOK( buffer, &count, 1 )) { GIFERRORMSG("error in getting DataBlock size" ); return -1; } ZeroDataBlock = count == 0; if ((count != 0) && (! ReadOK( buffer, buf, count ))) { GIFERRORMSG("error in reading DataBlock" ); return -1; } return count; } static int GetCode(IDirectFBImageProvider_GIF_data *data, int code_size, int flag) { int i, j, ret; unsigned char count; if (flag) { data->curbit = 0; data->lastbit = 0; data->done = false; return 0; } if ( (data->curbit+code_size) >= data->lastbit) { if (data->done) { if (data->curbit >= data->lastbit) { GIFERRORMSG("ran off the end of my bits" ); } return -1; } data->buf[0] = data->buf[data->last_byte-2]; data->buf[1] = data->buf[data->last_byte-1]; if ((count = GetDataBlock( data->buffer, &data->buf[2] )) == 0) { data->done = true; } data->last_byte = 2 + count; data->curbit = (data->curbit - data->lastbit) + 16; data->lastbit = (2+count) * 8; } ret = 0; for (i = data->curbit, j = 0; j < code_size; ++i, ++j) { ret |= ((data->buf[ i / 8 ] & (1 << (i % 8))) != 0) << j; } data->curbit += code_size; return ret; } static int DoExtension( IDirectFBImageProvider_GIF_data *data, int label ) { unsigned char buf[256] = { 0 }; char *str; switch (label) { case 0x01: /* Plain Text Extension */ str = "Plain Text Extension"; break; case 0xff: /* Application Extension */ str = "Application Extension"; break; case 0xfe: /* Comment Extension */ str = "Comment Extension"; while (GetDataBlock( data->buffer, (u8*) buf ) != 0) { if (showComment) GIFERRORMSG("gif comment: %s", buf ); } return false; case 0xf9: /* Graphic Control Extension */ str = "Graphic Control Extension"; (void) GetDataBlock( data->buffer, (u8*) buf ); data->disposal = (buf[0] >> 2) & 0x7; data->inputFlag = (buf[0] >> 1) & 0x1; data->delayTime = LM_to_uint( buf[1], buf[2] ); if ((buf[0] & 0x1) != 0) { data->transparent = buf[3]; } while (GetDataBlock( data->buffer, (u8*) buf ) != 0) ; return false; default: str = (char*) buf; snprintf(str, 256, "UNKNOWN (0x%02x)", label); break; } if (verbose) GIFERRORMSG("got a '%s' extension", str ); while (GetDataBlock( data->buffer, (u8*) buf ) != 0) ; return false; } static int LWZReadByte( IDirectFBImageProvider_GIF_data *data, int flag, int input_code_size ) { int code, incode; int i; if (flag) { data->set_code_size = input_code_size; data->code_size = data->set_code_size+1; data->clear_code = 1 << data->set_code_size ; data->end_code = data->clear_code + 1; data->max_code_size = 2*data->clear_code; data->max_code = data->clear_code+2; GetCode(data, 0, true); data->fresh = true; for (i = 0; i < data->clear_code; ++i) { data->table[0][i] = 0; data->table[1][i] = i; } for (; i < (1<table[0][i] = data->table[1][0] = 0; } data->sp = data->stack; return 0; } else if (data->fresh) { data->fresh = false; do { data->firstcode = data->oldcode = GetCode( data, data->code_size, false ); } while (data->firstcode == data->clear_code); return data->firstcode; } if (data->sp > data->stack) { return *--data->sp; } while ((code = GetCode( data, data->code_size, false )) >= 0) { if (code == data->clear_code) { for (i = 0; i < data->clear_code; ++i) { data->table[0][i] = 0; data->table[1][i] = i; } for (; i < (1<table[0][i] = data->table[1][i] = 0; } data->code_size = data->set_code_size+1; data->max_code_size = 2*data->clear_code; data->max_code = data->clear_code+2; data->sp = data->stack; data->firstcode = data->oldcode = GetCode( data, data->code_size, false ); return data->firstcode; } else if (code == data->end_code) { int count; u8 buf[260]; if (ZeroDataBlock) { return -2; } while ((count = GetDataBlock( data->buffer, buf )) > 0) ; if (count != 0) GIFERRORMSG("missing EOD in data stream " "(common occurence)"); return -2; } incode = code; if (code >= data->max_code) { *data->sp++ = data->firstcode; code = data->oldcode; } while (code >= data->clear_code) { *data->sp++ = data->table[1][code]; if (code == data->table[0][code]) { GIFERRORMSG("circular table entry BIG ERROR"); } code = data->table[0][code]; } *data->sp++ = data->firstcode = data->table[1][code]; if ((code = data->max_code) <(1<table[0][code] = data->oldcode; data->table[1][code] = data->firstcode; ++data->max_code; if ((data->max_code >= data->max_code_size) && (data->max_code_size < (1<max_code_size *= 2; ++data->code_size; } } data->oldcode = incode; if (data->sp > data->stack) { return *--data->sp; } } return code; } static int SortColors (const void *a, const void *b) { return (*((const u8 *) a) - *((const u8 *) b)); } /* looks for a color that is not in the colormap and ideally not even close to the colors used in the colormap */ static u32 FindColorKey( int n_colors, u8 cmap[3][MAXCOLORMAPSIZE] ) { u32 color = 0xFF000000; u8 csort[MAXCOLORMAPSIZE]; int i, j, index, d; if (n_colors < 1) return color; D_ASSERT( n_colors <= MAXCOLORMAPSIZE ); for (i = 0; i < 3; i++) { direct_memcpy( csort, cmap[i], n_colors ); qsort( csort, n_colors, 1, SortColors ); for (j = 1, index = 0, d = 0; j < n_colors; j++) { if (csort[j] - csort[j-1] > d) { d = csort[j] - csort[j-1]; index = j; } } if ((csort[0] - 0x0) > d) { d = csort[0] - 0x0; index = n_colors; } if (0xFF - (csort[n_colors - 1]) > d) { index = n_colors + 1; } if (index < n_colors) csort[0] = csort[index] - (d/2); else if (index == n_colors) csort[0] = 0x0; else csort[0] = 0xFF; color |= (csort[0] << (8 * (2 - i))); } return color; } static u32* ReadImage( IDirectFBImageProvider_GIF_data *data, int width, int height, u8 cmap[3][MAXCOLORMAPSIZE], u32 key_rgb, bool interlace, bool ignore ) { u8 c; int v; int xpos = 0, ypos = 0, pass = 0; u32 *image; /* ** Initialize the decompression routines */ if (! ReadOK( data->buffer, &c, 1 )) GIFERRORMSG("EOF / read error on image data" ); if (LWZReadByte( data, true, c ) < 0) GIFERRORMSG("error reading image" ); /* ** If this is an "uninteresting picture" ignore it. */ if (ignore) { if (verbose) GIFERRORMSG("skipping image..." ); while (LWZReadByte( data, false, c ) >= 0) ; return NULL; } // FIXME: allocates four additional bytes because the scaling functions // in src/misc/gfx_util.c have an off-by-one bug which causes // segfaults on darwin/osx (not on linux) if ((image = D_MALLOC(width * height * 4 + 4)) == NULL) { GIFERRORMSG("couldn't alloc space for image" ); } if (verbose) { GIFERRORMSG("reading %d by %d%s GIF image", width, height, interlace ? " interlaced" : "" ); } while ((v = LWZReadByte( data, false, c )) >= 0 ) { u32 *dst = image + (ypos * width + xpos); if (v == data->transparent) { *dst++ = key_rgb; } else { *dst++ = (0xFF000000 | cmap[CM_RED][v] << 16 | cmap[CM_GREEN][v] << 8 | cmap[CM_BLUE][v]); } ++xpos; if (xpos == width) { xpos = 0; if (interlace) { switch (pass) { case 0: case 1: ypos += 8; break; case 2: ypos += 4; break; case 3: ypos += 2; break; } if (ypos >= height) { ++pass; switch (pass) { case 1: ypos = 4; break; case 2: ypos = 2; break; case 3: ypos = 1; break; default: goto fini; } } } else { ++ypos; } } if (ypos >= height) { break; } } fini: if (LWZReadByte( data, false, c ) >= 0) { GIFERRORMSG("too much input data, ignoring extra..."); } return image; } static u32* ReadGIF( IDirectFBImageProvider_GIF_data *data, int imageNumber, int *width, int *height, bool *transparency, u32 *key_rgb, bool alpha, bool headeronly) { u8 buf[16]; u8 c; u8 localColorMap[3][MAXCOLORMAPSIZE]; u32 colorKey = 0; bool useGlobalColormap; int bitPixel; int imageCount = 0; char version[4]; if (! ReadOK( data->buffer, buf, 6 )) { GIFERRORMSG("error reading magic number" ); } if (strncmp( (char *)buf, "GIF", 3 ) != 0) { GIFERRORMSG("not a GIF file" ); } direct_snputs( version, (char *)buf + 3, 4 ); if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { GIFERRORMSG("bad version number, not '87a' or '89a'" ); } if (! ReadOK(data->buffer,buf,7)) { GIFERRORMSG("failed to read screen descriptor" ); } data->Width = LM_to_uint( buf[0], buf[1] ); data->Height = LM_to_uint( buf[2], buf[3] ); data->BitPixel = 2 << (buf[4] & 0x07); data->ColorResolution = (((buf[4] & 0x70) >> 3) + 1); data->Background = buf[5]; data->AspectRatio = buf[6]; if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ if (ReadColorMap( data->buffer, data->BitPixel, data->ColorMap )) { GIFERRORMSG("error reading global colormap" ); } } if (data->AspectRatio != 0 && data->AspectRatio != 49) { /* float r = ( (float) data->AspectRatio + 15.0 ) / 64.0; */ GIFERRORMSG("warning - non-square pixels"); } data->transparent = -1; data->delayTime = -1; data->inputFlag = -1; data->disposal = 0; for (;;) { if (! ReadOK( data->buffer, &c, 1)) { GIFERRORMSG("EOF / read error on image data" ); } if (c == ';') { /* GIF terminator */ if (imageCount < imageNumber) { GIFERRORMSG("only %d image%s found in file", imageCount, imageCount>1?"s":"" ); } return NULL; } if (c == '!') { /* Extension */ if (! ReadOK( data->buffer, &c, 1)) { GIFERRORMSG("OF / read error on extention function code"); } DoExtension( data, c ); continue; } if (c != ',') { /* Not a valid start character */ GIFERRORMSG("bogus character 0x%02x, ignoring", (int) c ); continue; } ++imageCount; if (! ReadOK( data->buffer, buf, 9 )) { GIFERRORMSG("couldn't read left/top/width/height"); } *width = LM_to_uint( buf[4], buf[5] ); *height = LM_to_uint( buf[6], buf[7] ); *transparency = (data->transparent != -1); if (headeronly && !(*transparency && key_rgb)) return NULL; useGlobalColormap = ! BitSet( buf[8], LOCALCOLORMAP ); if (useGlobalColormap) { if (*transparency && (key_rgb || !headeronly)) colorKey = FindColorKey( data->BitPixel, data->ColorMap ); } else { bitPixel = 2 << (buf[8] & 0x07); if (ReadColorMap( data->buffer, bitPixel, localColorMap )) GIFERRORMSG("error reading local colormap" ); if (*transparency && (key_rgb || !headeronly)) colorKey = FindColorKey( bitPixel, localColorMap ); } if (key_rgb) *key_rgb = colorKey; if (headeronly) return NULL; if (alpha) colorKey &= 0x00FFFFFF; return ReadImage( data, *width, *height, (useGlobalColormap ? data->ColorMap : localColorMap), colorKey, BitSet( buf[8], INTERLACE ), imageCount != imageNumber); } } static bool ReadOK( IDirectFBDataBuffer *buffer, void *data, unsigned int len ) { DFBResult ret; ret = buffer->WaitForData( buffer, len ); if (ret) { DirectFBError( "(DirectFB/ImageProvider_GIF) WaitForData failed", ret ); return false; } ret = buffer->GetData( buffer, len, data, NULL ); if (ret) { DirectFBError( "(DirectFB/ImageProvider_GIF) GetData failed", ret ); return false; } return true; } DirectFB-1.2.10/interfaces/IDirectFBImageProvider/Makefile.in0000644000175000017500000006043311307521503020542 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = interfaces/IDirectFBImageProvider ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(idirectfbimageproviderdir)" \ "$(DESTDIR)$(idirectfbimageproviderdir)" idirectfbimageproviderLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(idirectfbimageprovider_LTLIBRARIES) libidirectfbimageprovider_dfiff_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libidirectfbimageprovider_dfiff_la_OBJECTS = \ idirectfbimageprovider_dfiff.lo libidirectfbimageprovider_dfiff_la_OBJECTS = \ $(am_libidirectfbimageprovider_dfiff_la_OBJECTS) libidirectfbimageprovider_dfiff_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbimageprovider_dfiff_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbimageprovider_gif_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libidirectfbimageprovider_gif_la_OBJECTS = \ idirectfbimageprovider_gif.lo libidirectfbimageprovider_gif_la_OBJECTS = \ $(am_libidirectfbimageprovider_gif_la_OBJECTS) libidirectfbimageprovider_gif_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbimageprovider_gif_la_LDFLAGS) $(LDFLAGS) -o $@ @GIF_PROVIDER_TRUE@am_libidirectfbimageprovider_gif_la_rpath = -rpath \ @GIF_PROVIDER_TRUE@ $(idirectfbimageproviderdir) am__DEPENDENCIES_1 = libidirectfbimageprovider_jpeg_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1) am_libidirectfbimageprovider_jpeg_la_OBJECTS = \ idirectfbimageprovider_jpeg.lo libidirectfbimageprovider_jpeg_la_OBJECTS = \ $(am_libidirectfbimageprovider_jpeg_la_OBJECTS) libidirectfbimageprovider_jpeg_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbimageprovider_jpeg_la_LDFLAGS) $(LDFLAGS) -o $@ @JPEG_PROVIDER_TRUE@am_libidirectfbimageprovider_jpeg_la_rpath = \ @JPEG_PROVIDER_TRUE@ -rpath $(idirectfbimageproviderdir) libidirectfbimageprovider_png_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1) am_libidirectfbimageprovider_png_la_OBJECTS = \ idirectfbimageprovider_png.lo libidirectfbimageprovider_png_la_OBJECTS = \ $(am_libidirectfbimageprovider_png_la_OBJECTS) libidirectfbimageprovider_png_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbimageprovider_png_la_LDFLAGS) $(LDFLAGS) -o $@ @PNG_PROVIDER_TRUE@am_libidirectfbimageprovider_png_la_rpath = -rpath \ @PNG_PROVIDER_TRUE@ $(idirectfbimageproviderdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libidirectfbimageprovider_dfiff_la_SOURCES) \ $(libidirectfbimageprovider_gif_la_SOURCES) \ $(libidirectfbimageprovider_jpeg_la_SOURCES) \ $(libidirectfbimageprovider_png_la_SOURCES) DIST_SOURCES = $(libidirectfbimageprovider_dfiff_la_SOURCES) \ $(libidirectfbimageprovider_gif_la_SOURCES) \ $(libidirectfbimageprovider_jpeg_la_SOURCES) \ $(libidirectfbimageprovider_png_la_SOURCES) idirectfbimageproviderDATA_INSTALL = $(INSTALL_DATA) DATA = $(idirectfbimageprovider_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ idirectfbimageproviderdir = $(MODULEDIR)/interfaces/IDirectFBImageProvider @GIF_PROVIDER_FALSE@GIF_PROVIDER_LTLIB = @GIF_PROVIDER_TRUE@GIF_PROVIDER_LTLIB = libidirectfbimageprovider_gif.la @JPEG_PROVIDER_FALSE@JPEG_PROVIDER_LTLIB = @JPEG_PROVIDER_TRUE@JPEG_PROVIDER_LTLIB = libidirectfbimageprovider_jpeg.la @PNG_PROVIDER_FALSE@PNG_PROVIDER_LTLIB = @PNG_PROVIDER_TRUE@PNG_PROVIDER_LTLIB = libidirectfbimageprovider_png.la INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src AM_CPPFLAGS = -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" idirectfbimageprovider_LTLIBRARIES = \ libidirectfbimageprovider_dfiff.la \ $(GIF_PROVIDER_LTLIB) \ $(JPEG_PROVIDER_LTLIB) \ $(PNG_PROVIDER_LTLIB) @BUILD_STATIC_TRUE@idirectfbimageprovider_DATA = $(idirectfbimageprovider_LTLIBRARIES:.la=.o) libidirectfbimageprovider_png_la_SOURCES = idirectfbimageprovider_png.c libidirectfbimageprovider_png_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(LIBPNG) libidirectfbimageprovider_png_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_dfiff_la_SOURCES = idirectfbimageprovider_dfiff.c libidirectfbimageprovider_dfiff_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la libidirectfbimageprovider_dfiff_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_gif_la_SOURCES = idirectfbimageprovider_gif.c libidirectfbimageprovider_gif_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la libidirectfbimageprovider_gif_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_jpeg_la_SOURCES = idirectfbimageprovider_jpeg.c libidirectfbimageprovider_jpeg_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(LIBJPEG) libidirectfbimageprovider_jpeg_la_LDFLAGS = -avoid-version -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu interfaces/IDirectFBImageProvider/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu interfaces/IDirectFBImageProvider/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-idirectfbimageproviderLTLIBRARIES: $(idirectfbimageprovider_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbimageproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbimageproviderdir)" @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbimageproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbimageproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbimageproviderLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbimageproviderdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbimageproviderdir)/$$p"; \ done clean-idirectfbimageproviderLTLIBRARIES: -test -z "$(idirectfbimageprovider_LTLIBRARIES)" || rm -f $(idirectfbimageprovider_LTLIBRARIES) @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libidirectfbimageprovider_dfiff.la: $(libidirectfbimageprovider_dfiff_la_OBJECTS) $(libidirectfbimageprovider_dfiff_la_DEPENDENCIES) $(libidirectfbimageprovider_dfiff_la_LINK) -rpath $(idirectfbimageproviderdir) $(libidirectfbimageprovider_dfiff_la_OBJECTS) $(libidirectfbimageprovider_dfiff_la_LIBADD) $(LIBS) libidirectfbimageprovider_gif.la: $(libidirectfbimageprovider_gif_la_OBJECTS) $(libidirectfbimageprovider_gif_la_DEPENDENCIES) $(libidirectfbimageprovider_gif_la_LINK) $(am_libidirectfbimageprovider_gif_la_rpath) $(libidirectfbimageprovider_gif_la_OBJECTS) $(libidirectfbimageprovider_gif_la_LIBADD) $(LIBS) libidirectfbimageprovider_jpeg.la: $(libidirectfbimageprovider_jpeg_la_OBJECTS) $(libidirectfbimageprovider_jpeg_la_DEPENDENCIES) $(libidirectfbimageprovider_jpeg_la_LINK) $(am_libidirectfbimageprovider_jpeg_la_rpath) $(libidirectfbimageprovider_jpeg_la_OBJECTS) $(libidirectfbimageprovider_jpeg_la_LIBADD) $(LIBS) libidirectfbimageprovider_png.la: $(libidirectfbimageprovider_png_la_OBJECTS) $(libidirectfbimageprovider_png_la_DEPENDENCIES) $(libidirectfbimageprovider_png_la_LINK) $(am_libidirectfbimageprovider_png_la_rpath) $(libidirectfbimageprovider_png_la_OBJECTS) $(libidirectfbimageprovider_png_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_dfiff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_gif.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_jpeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_png.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idirectfbimageproviderDATA: $(idirectfbimageprovider_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbimageproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbimageproviderdir)" @list='$(idirectfbimageprovider_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbimageproviderDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ $(idirectfbimageproviderDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ done uninstall-idirectfbimageproviderDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbimageprovider_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(idirectfbimageproviderdir)" "$(DESTDIR)$(idirectfbimageproviderdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-idirectfbimageproviderLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-idirectfbimageproviderDATA \ install-idirectfbimageproviderLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idirectfbimageproviderDATA \ uninstall-idirectfbimageproviderLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-idirectfbimageproviderLTLIBRARIES clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-idirectfbimageproviderDATA \ install-idirectfbimageproviderLTLIBRARIES install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am \ uninstall-idirectfbimageproviderDATA \ uninstall-idirectfbimageproviderLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/interfaces/IDirectFBImageProvider/idirectfbimageprovider_dfiff.c0000644000175000017500000002521211245562152024512 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBImageProvider *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, DFIFF ) /* * private data struct of IDirectFBImageProvider_DFIFF */ typedef struct { int ref; /* reference counter */ void *ptr; /* pointer to raw file data (mapped) */ int len; /* data length, i.e. file size */ DIRenderCallback render_callback; void *render_callback_context; CoreDFB *core; } IDirectFBImageProvider_DFIFF_data; static void IDirectFBImageProvider_DFIFF_Destruct( IDirectFBImageProvider *thiz ) { IDirectFBImageProvider_DFIFF_data *data = thiz->priv; munmap( data->ptr, data->len ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBImageProvider_DFIFF_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_DFIFF) data->ref++; return DFB_OK; } static DirectResult IDirectFBImageProvider_DFIFF_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_DFIFF) if (--data->ref == 0) { IDirectFBImageProvider_DFIFF_Destruct( thiz ); } return DFB_OK; } static DFBResult IDirectFBImageProvider_DFIFF_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dest_rect ) { DFBResult ret; IDirectFBSurface_data *dst_data; CoreSurface *dst_surface; const DFIFFHeader *header; DFBRectangle rect; DFBRectangle clipped; DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_DFIFF) if (!destination) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM (destination, dst_data, IDirectFBSurface); dst_surface = dst_data->surface; if (!dst_surface) return DFB_DEAD; if (dest_rect) { rect.x = dest_rect->x + dst_data->area.wanted.x; rect.y = dest_rect->y + dst_data->area.wanted.y; rect.w = dest_rect->w; rect.h = dest_rect->h; } else rect = dst_data->area.wanted; if (rect.w < 1 || rect.h < 1) return DFB_INVAREA; clipped = rect; if (!dfb_rectangle_intersect( &clipped, &dst_data->area.current )) return DFB_INVAREA; header = data->ptr; if (DFB_RECTANGLE_EQUAL( rect, clipped ) && rect.w == header->width && rect.h == header->height && dst_surface->config.format == header->format) { ret = dfb_surface_write_buffer( dst_surface, CSBR_BACK, data->ptr + sizeof(DFIFFHeader), header->pitch, &rect ); if (ret) return ret; } else { IDirectFBSurface *source; DFBSurfaceDescription desc; DFBSurfaceCapabilities caps; DFBRegion clip = DFB_REGION_INIT_FROM_RECTANGLE( &clipped ); DFBRegion old_clip; thiz->GetSurfaceDescription( thiz, &desc ); desc.flags |= DSDESC_PREALLOCATED; desc.preallocated[0].data = data->ptr + sizeof(DFIFFHeader); desc.preallocated[0].pitch = header->pitch; ret = idirectfb_singleton->CreateSurface( idirectfb_singleton, &desc, &source ); if (ret) return ret; destination->GetCapabilities( destination, &caps ); if (caps & DSCAPS_PREMULTIPLIED && DFB_PIXELFORMAT_HAS_ALPHA(desc.pixelformat)) destination->SetBlittingFlags( destination, DSBLIT_SRC_PREMULTIPLY ); else destination->SetBlittingFlags( destination, DSBLIT_NOFX ); destination->GetClip( destination, &old_clip ); destination->SetClip( destination, &clip ); destination->StretchBlit( destination, source, NULL, &rect ); destination->SetClip( destination, &old_clip ); destination->SetBlittingFlags( destination, DSBLIT_NOFX ); destination->ReleaseSource( destination ); source->Release( source ); } if (data->render_callback) { DFBRectangle rect = { 0, 0, clipped.w, clipped.h }; data->render_callback( &rect, data->render_callback_context ); } return DFB_OK; } static DFBResult IDirectFBImageProvider_DFIFF_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_DFIFF) data->render_callback = callback; data->render_callback_context = context; return DFB_OK; } /* Loading routines */ static DFBResult IDirectFBImageProvider_DFIFF_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc ) { const DFIFFHeader *header; DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_DFIFF) header = data->ptr; dsc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; dsc->width = header->width; dsc->height = header->height; dsc->pixelformat = header->format; return DFB_OK; } static DFBResult IDirectFBImageProvider_DFIFF_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *desc ) { const DFIFFHeader *header; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_DFIFF) if (!desc) return DFB_INVARG; header = data->ptr; desc->caps = DICAPS_NONE; if (DFB_PIXELFORMAT_HAS_ALPHA( header->format )) desc->caps |= DICAPS_ALPHACHANNEL; return DFB_OK; } static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ) { if (!strncmp( (const char*) ctx->header, "DFIFF", 5 )) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, ... ) { DFBResult ret; struct stat stat; void *ptr; int fd = -1; IDirectFBDataBuffer_data *buffer_data; IDirectFBDataBuffer *buffer; CoreDFB *core; va_list tag; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_DFIFF) va_start( tag, thiz ); buffer = va_arg( tag, IDirectFBDataBuffer * ); core = va_arg( tag, CoreDFB * ); va_end( tag ); D_MAGIC_ASSERT( (IAny*) buffer, DirectInterface ); /* Get the buffer's private data. */ buffer_data = buffer->priv; if (!buffer_data) { ret = DFB_DEAD; goto error; } /* Check for valid filename. */ if (!buffer_data->filename) { ret = DFB_UNSUPPORTED; goto error; } /* Open the file. */ fd = open( buffer_data->filename, O_RDONLY ); if (fd < 0) { ret = errno2result( errno ); D_PERROR( "ImageProvider/DFIFF: Failure during open() of '%s'!\n", buffer_data->filename ); goto error; } /* Query file size etc. */ if (fstat( fd, &stat ) < 0) { ret = errno2result( errno ); D_PERROR( "ImageProvider/DFIFF: Failure during fstat() of '%s'!\n", buffer_data->filename ); goto error; } /* Memory map the file. */ ptr = mmap( NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0 ); if (ptr == MAP_FAILED) { ret = errno2result( errno ); D_PERROR( "ImageProvider/DFIFF: Failure during mmap() of '%s'!\n", buffer_data->filename ); goto error; } /* Already close, we still have the map. */ close( fd ); data->ref = 1; data->ptr = ptr; data->len = stat.st_size; data->core = core; thiz->AddRef = IDirectFBImageProvider_DFIFF_AddRef; thiz->Release = IDirectFBImageProvider_DFIFF_Release; thiz->RenderTo = IDirectFBImageProvider_DFIFF_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_DFIFF_SetRenderCallback; thiz->GetImageDescription = IDirectFBImageProvider_DFIFF_GetImageDescription; thiz->GetSurfaceDescription = IDirectFBImageProvider_DFIFF_GetSurfaceDescription; return DFB_OK; error: if (fd != -1) close( fd ); DIRECT_DEALLOCATE_INTERFACE(thiz); return ret; } DirectFB-1.2.10/interfaces/IDirectFBImageProvider/idirectfbimageprovider_jpeg.c0000644000175000017500000004715111245562152024367 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef HAVE_STDLIB_H #include static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBImageProvider *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, JPEG ) /* * private data struct of IDirectFBImageProvider_JPEG */ typedef struct { int ref; /* reference counter */ IDirectFBDataBuffer *buffer; DIRenderCallback render_callback; void *render_callback_context; u32 *image; int width; int height; CoreDFB *core; } IDirectFBImageProvider_JPEG_data; static DirectResult IDirectFBImageProvider_JPEG_AddRef ( IDirectFBImageProvider *thiz ); static DirectResult IDirectFBImageProvider_JPEG_Release ( IDirectFBImageProvider *thiz ); static DFBResult IDirectFBImageProvider_JPEG_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect ); static DFBResult IDirectFBImageProvider_JPEG_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ); static DFBResult IDirectFBImageProvider_JPEG_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc); static DFBResult IDirectFBImageProvider_JPEG_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *dsc ); #define JPEG_PROG_BUF_SIZE 0x10000 typedef struct { struct jpeg_source_mgr pub; /* public fields */ JOCTET *data; /* start of buffer */ IDirectFBDataBuffer *buffer; int peekonly; int peekoffset; } buffer_source_mgr; typedef buffer_source_mgr * buffer_src_ptr; static void buffer_init_source (j_decompress_ptr cinfo) { buffer_src_ptr src = (buffer_src_ptr) cinfo->src; IDirectFBDataBuffer *buffer = src->buffer; buffer->SeekTo( buffer, 0 ); /* ignore return value */ } static boolean buffer_fill_input_buffer (j_decompress_ptr cinfo) { DFBResult ret; unsigned int nbytes = 0; buffer_src_ptr src = (buffer_src_ptr) cinfo->src; IDirectFBDataBuffer *buffer = src->buffer; buffer->WaitForDataWithTimeout( buffer, JPEG_PROG_BUF_SIZE, 1, 0 ); if (src->peekonly) { ret = buffer->PeekData( buffer, JPEG_PROG_BUF_SIZE, src->peekoffset, src->data, &nbytes ); src->peekoffset += MAX( nbytes, 0 ); } else { ret = buffer->GetData( buffer, JPEG_PROG_BUF_SIZE, src->data, &nbytes ); } if (ret || nbytes <= 0) { /* Insert a fake EOI marker */ src->data[0] = (JOCTET) 0xFF; src->data[1] = (JOCTET) JPEG_EOI; nbytes = 2; if (ret && ret != DFB_EOF) DirectFBError( "(DirectFB/ImageProvider_JPEG) GetData failed", ret ); } src->pub.next_input_byte = src->data; src->pub.bytes_in_buffer = nbytes; return TRUE; } static void buffer_skip_input_data (j_decompress_ptr cinfo, long num_bytes) { buffer_src_ptr src = (buffer_src_ptr) cinfo->src; if (num_bytes > 0) { while (num_bytes > (long) src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; (void)buffer_fill_input_buffer(cinfo); } src->pub.next_input_byte += (size_t) num_bytes; src->pub.bytes_in_buffer -= (size_t) num_bytes; } } static void buffer_term_source (j_decompress_ptr cinfo) { } static void jpeg_buffer_src (j_decompress_ptr cinfo, IDirectFBDataBuffer *buffer, int peekonly) { buffer_src_ptr src; cinfo->src = (struct jpeg_source_mgr *) cinfo->mem->alloc_small ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (buffer_source_mgr)); src = (buffer_src_ptr) cinfo->src; src->data = (JOCTET *) cinfo->mem->alloc_small ((j_common_ptr) cinfo, JPOOL_PERMANENT, JPEG_PROG_BUF_SIZE * sizeof (JOCTET)); src->buffer = buffer; src->peekonly = peekonly; src->peekoffset = 0; src->pub.init_source = buffer_init_source; src->pub.fill_input_buffer = buffer_fill_input_buffer; src->pub.skip_input_data = buffer_skip_input_data; src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->pub.term_source = buffer_term_source; src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ src->pub.next_input_byte = NULL; /* until buffer loaded */ } struct my_error_mgr { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; static void jpeglib_panic(j_common_ptr cinfo) { struct my_error_mgr *myerr = (struct my_error_mgr*) cinfo->err; longjmp(myerr->setjmp_buffer, 1); } static inline void copy_line32( u32 *argb, const u8 *rgb, int width ) { while (width--) { *argb++ = 0xFF000000 | (rgb[0] << 16) | (rgb[1] << 8) | rgb[2]; rgb += 3; } } static inline void copy_line_nv16( u16 *yy, u16 *cbcr, const u8 *src_ycbcr, int width ) { int x; for (x=0; x> 1); #else yy[x] = (src_ycbcr[3] << 8) | src_ycbcr[0]; cbcr[x] = (((src_ycbcr[2] + src_ycbcr[5]) << 7) & 0xff00) | ((src_ycbcr[1] + src_ycbcr[4]) >> 1); #endif src_ycbcr += 6; } if (width & 1) { u8 *y = (u8*) yy; y[width-1] = src_ycbcr[0]; #ifdef WORDS_BIGENDIAN cbcr[x] = (src_ycbcr[1] << 8) | src_ycbcr[2]; #else cbcr[x] = (src_ycbcr[2] << 8) | src_ycbcr[1]; #endif } } static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ) { if (ctx->header[0] == 0xff && ctx->header[1] == 0xd8) { if (strncmp ((char*) ctx->header + 6, "JFIF", 4) == 0 || strncmp ((char*) ctx->header + 6, "Exif", 4) == 0) return DFB_OK; if (ctx->filename && strchr (ctx->filename, '.' ) && (strcasecmp ( strchr (ctx->filename, '.' ), ".jpg" ) == 0 || strcasecmp ( strchr (ctx->filename, '.' ), ".jpeg") == 0)) return DFB_OK; } return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, ... ) { struct jpeg_decompress_struct cinfo; struct my_error_mgr jerr; IDirectFBDataBuffer *buffer; CoreDFB *core; va_list tag; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_JPEG) va_start( tag, thiz ); buffer = va_arg( tag, IDirectFBDataBuffer * ); core = va_arg( tag, CoreDFB * ); va_end( tag ); data->ref = 1; data->buffer = buffer; data->core = core; buffer->AddRef( buffer ); cinfo.err = jpeg_std_error(&jerr.pub); jerr.pub.error_exit = jpeglib_panic; if (setjmp(jerr.setjmp_buffer)) { D_ERROR( "ImageProvider/JPEG: Error while reading headers!\n" ); jpeg_destroy_decompress(&cinfo); buffer->Release( buffer ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_FAILURE; } jpeg_create_decompress(&cinfo); jpeg_buffer_src(&cinfo, buffer, 1); jpeg_read_header(&cinfo, TRUE); jpeg_start_decompress(&cinfo); data->width = cinfo.output_width; data->height = cinfo.output_height; jpeg_abort_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); thiz->AddRef = IDirectFBImageProvider_JPEG_AddRef; thiz->Release = IDirectFBImageProvider_JPEG_Release; thiz->RenderTo = IDirectFBImageProvider_JPEG_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_JPEG_SetRenderCallback; thiz->GetImageDescription =IDirectFBImageProvider_JPEG_GetImageDescription; thiz->GetSurfaceDescription = IDirectFBImageProvider_JPEG_GetSurfaceDescription; return DFB_OK; } static void IDirectFBImageProvider_JPEG_Destruct( IDirectFBImageProvider *thiz ) { IDirectFBImageProvider_JPEG_data *data = (IDirectFBImageProvider_JPEG_data*)thiz->priv; data->buffer->Release( data->buffer ); if (data->image) D_FREE( data->image ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBImageProvider_JPEG_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_JPEG) data->ref++; return DFB_OK; } static DirectResult IDirectFBImageProvider_JPEG_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_JPEG) if (--data->ref == 0) { IDirectFBImageProvider_JPEG_Destruct( thiz ); } return DFB_OK; } static DFBResult IDirectFBImageProvider_JPEG_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dest_rect ) { DFBResult ret; bool direct = false; DFBRegion clip; DFBRectangle rect; DFBSurfacePixelFormat format; IDirectFBSurface_data *dst_data; CoreSurface *dst_surface; CoreSurfaceBufferLock lock; DIRenderCallbackResult cb_result = DIRCR_OK; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_JPEG) dst_data = (IDirectFBSurface_data*) destination->priv; if (!dst_data) return DFB_DEAD; dst_surface = dst_data->surface; if (!dst_surface) return DFB_DESTROYED; ret = destination->GetPixelFormat( destination, &format ); if (ret) return ret; dfb_region_from_rectangle( &clip, &dst_data->area.current ); if (dest_rect) { if (dest_rect->w < 1 || dest_rect->h < 1) return DFB_INVARG; rect = *dest_rect; rect.x += dst_data->area.wanted.x; rect.y += dst_data->area.wanted.y; if (!dfb_rectangle_region_intersects( &rect, &clip )) return DFB_OK; } else { rect = dst_data->area.wanted; } ret = dfb_surface_lock_buffer( dst_surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); if (ret) return ret; /* actual loading and rendering */ if (!data->image) { struct jpeg_decompress_struct cinfo; struct my_error_mgr jerr; JSAMPARRAY buffer; /* Output row buffer */ int row_stride; /* physical row width in output buffer */ u32 *row_ptr; int y = 0; int uv_offset = 0; cinfo.err = jpeg_std_error(&jerr.pub); jerr.pub.error_exit = jpeglib_panic; if (setjmp(jerr.setjmp_buffer)) { D_ERROR( "ImageProvider/JPEG: Error during decoding!\n" ); jpeg_destroy_decompress(&cinfo); if (data->image) { dfb_scale_linear_32( data->image, data->width, data->height, lock.addr, lock.pitch, &rect, dst_surface, &clip ); dfb_surface_unlock_buffer( dst_surface, &lock ); if (data->render_callback) { DFBRectangle r = { 0, 0, data->width, data->height }; if (data->render_callback( &r, data->render_callback_context ) != DIRCR_OK) return DFB_INTERRUPTED; } return DFB_INCOMPLETE; } else dfb_surface_unlock_buffer( dst_surface, &lock ); return DFB_FAILURE; } jpeg_create_decompress(&cinfo); jpeg_buffer_src(&cinfo, data->buffer, 0); jpeg_read_header(&cinfo, TRUE); jpeg_calc_output_dimensions(&cinfo); if (cinfo.output_width == rect.w && cinfo.output_height == rect.h) direct = true; cinfo.output_components = 3; switch (dst_surface->config.format) { case DSPF_NV16: uv_offset = dst_surface->config.size.h * lock.pitch; if (direct && !rect.x && !rect.y) { D_INFO( "JPEG: Using YCbCr color space directly! (%dx%d)\n", cinfo.output_width, cinfo.output_height ); cinfo.out_color_space = JCS_YCbCr; break; } D_INFO( "JPEG: Going through RGB color space! (%dx%d -> %dx%d @%d,%d)\n", cinfo.output_width, cinfo.output_height, rect.w, rect.h, rect.x, rect.y ); default: cinfo.out_color_space = JCS_RGB; break; } jpeg_start_decompress(&cinfo); data->width = cinfo.output_width; data->height = cinfo.output_height; row_stride = cinfo.output_width * 3; buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); data->image = D_CALLOC( data->height, data->width * 4 ); if (!data->image) { dfb_surface_unlock_buffer( dst_surface, &lock ); return D_OOM(); } row_ptr = data->image; while (cinfo.output_scanline < cinfo.output_height && cb_result == DIRCR_OK) { jpeg_read_scanlines(&cinfo, buffer, 1); switch (dst_surface->config.format) { case DSPF_NV16: if (direct) { copy_line_nv16( lock.addr, lock.addr + uv_offset, *buffer, rect.w ); lock.addr += lock.pitch; if (data->render_callback) { DFBRectangle r = { 0, y, data->width, 1 }; cb_result = data->render_callback( &r, data->render_callback_context ); } break; } default: copy_line32( row_ptr, *buffer, data->width); if (direct) { DFBRectangle r = { rect.x, rect.y+y, rect.w, 1 }; dfb_copy_buffer_32( row_ptr, lock.addr, lock.pitch, &r, dst_surface, &clip ); if (data->render_callback) { r = (DFBRectangle){ 0, y, data->width, 1 }; cb_result = data->render_callback( &r, data->render_callback_context ); } } break; } row_ptr += data->width; y++; } if (!direct) { dfb_scale_linear_32( data->image, data->width, data->height, lock.addr, lock.pitch, &rect, dst_surface, &clip ); if (data->render_callback) { DFBRectangle r = { 0, 0, data->width, data->height }; cb_result = data->render_callback( &r, data->render_callback_context ); } } if (cb_result != DIRCR_OK) { jpeg_abort_decompress(&cinfo); D_FREE( data->image ); data->image = NULL; } else { jpeg_finish_decompress(&cinfo); } jpeg_destroy_decompress(&cinfo); } else { dfb_scale_linear_32( data->image, data->width, data->height, lock.addr, lock.pitch, &rect, dst_surface, &clip ); if (data->render_callback) { DFBRectangle r = { 0, 0, data->width, data->height }; data->render_callback( &r, data->render_callback_context ); } } dfb_surface_unlock_buffer( dst_surface, &lock ); if (cb_result != DIRCR_OK) return DFB_INTERRUPTED; return DFB_OK; } static DFBResult IDirectFBImageProvider_JPEG_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_JPEG) data->render_callback = callback; data->render_callback_context = context; return DFB_OK; } static DFBResult IDirectFBImageProvider_JPEG_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *dsc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_JPEG) dsc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; dsc->height = data->height; dsc->width = data->width; dsc->pixelformat = dfb_primary_layer_pixelformat(); return DFB_OK; } static DFBResult IDirectFBImageProvider_JPEG_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *dsc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_JPEG) if (!dsc) return DFB_INVARG; dsc->caps = DICAPS_NONE; return DFB_OK; } DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/0000777000175000017500000000000011307522566016611 500000000000000DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/Makefile.am0000644000175000017500000000260611164361026020556 00000000000000## Makefile.am for DirectFB/interfaces/IDirectFBVideoProvider idirectfbvideoproviderdir = $(MODULEDIR)/interfaces/IDirectFBVideoProvider EXTRA_DIST = videodev.h videodev2.h if V4L_PROVIDER V4L_PROVIDER_LTLIB = libidirectfbvideoprovider_v4l.la else V4L_PROVIDER_LTLIB = endif if GIF_PROVIDER GIF_PROVIDER_LTLIB = libidirectfbvideoprovider_gif.la else GIF_PROVIDER_LTLIB = endif INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" idirectfbvideoprovider_LTLIBRARIES = \ $(GIF_PROVIDER_LTLIB) \ $(V4L_PROVIDER_LTLIB) if BUILD_STATIC idirectfbvideoprovider_DATA = $(idirectfbvideoprovider_LTLIBRARIES:.la=.o) endif libidirectfbvideoprovider_v4l_la_SOURCES = idirectfbvideoprovider_v4l.c libidirectfbvideoprovider_v4l_la_LDFLAGS = -avoid-version -module libidirectfbvideoprovider_v4l_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libidirectfbvideoprovider_gif_la_SOURCES = idirectfbvideoprovider_gif.c libidirectfbvideoprovider_gif_la_LDFLAGS = -avoid-version -module libidirectfbvideoprovider_gif_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/Makefile.in0000644000175000017500000005305611307521503020571 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = interfaces/IDirectFBVideoProvider ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(idirectfbvideoproviderdir)" \ "$(DESTDIR)$(idirectfbvideoproviderdir)" idirectfbvideoproviderLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(idirectfbvideoprovider_LTLIBRARIES) libidirectfbvideoprovider_gif_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libidirectfbvideoprovider_gif_la_OBJECTS = \ idirectfbvideoprovider_gif.lo libidirectfbvideoprovider_gif_la_OBJECTS = \ $(am_libidirectfbvideoprovider_gif_la_OBJECTS) libidirectfbvideoprovider_gif_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbvideoprovider_gif_la_LDFLAGS) $(LDFLAGS) -o $@ @GIF_PROVIDER_TRUE@am_libidirectfbvideoprovider_gif_la_rpath = -rpath \ @GIF_PROVIDER_TRUE@ $(idirectfbvideoproviderdir) libidirectfbvideoprovider_v4l_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libidirectfbvideoprovider_v4l_la_OBJECTS = \ idirectfbvideoprovider_v4l.lo libidirectfbvideoprovider_v4l_la_OBJECTS = \ $(am_libidirectfbvideoprovider_v4l_la_OBJECTS) libidirectfbvideoprovider_v4l_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbvideoprovider_v4l_la_LDFLAGS) $(LDFLAGS) -o $@ @V4L_PROVIDER_TRUE@am_libidirectfbvideoprovider_v4l_la_rpath = -rpath \ @V4L_PROVIDER_TRUE@ $(idirectfbvideoproviderdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libidirectfbvideoprovider_gif_la_SOURCES) \ $(libidirectfbvideoprovider_v4l_la_SOURCES) DIST_SOURCES = $(libidirectfbvideoprovider_gif_la_SOURCES) \ $(libidirectfbvideoprovider_v4l_la_SOURCES) idirectfbvideoproviderDATA_INSTALL = $(INSTALL_DATA) DATA = $(idirectfbvideoprovider_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ idirectfbvideoproviderdir = $(MODULEDIR)/interfaces/IDirectFBVideoProvider EXTRA_DIST = videodev.h videodev2.h @V4L_PROVIDER_FALSE@V4L_PROVIDER_LTLIB = @V4L_PROVIDER_TRUE@V4L_PROVIDER_LTLIB = libidirectfbvideoprovider_v4l.la @GIF_PROVIDER_FALSE@GIF_PROVIDER_LTLIB = @GIF_PROVIDER_TRUE@GIF_PROVIDER_LTLIB = libidirectfbvideoprovider_gif.la INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" idirectfbvideoprovider_LTLIBRARIES = \ $(GIF_PROVIDER_LTLIB) \ $(V4L_PROVIDER_LTLIB) @BUILD_STATIC_TRUE@idirectfbvideoprovider_DATA = $(idirectfbvideoprovider_LTLIBRARIES:.la=.o) libidirectfbvideoprovider_v4l_la_SOURCES = idirectfbvideoprovider_v4l.c libidirectfbvideoprovider_v4l_la_LDFLAGS = -avoid-version -module libidirectfbvideoprovider_v4l_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libidirectfbvideoprovider_gif_la_SOURCES = idirectfbvideoprovider_gif.c libidirectfbvideoprovider_gif_la_LDFLAGS = -avoid-version -module libidirectfbvideoprovider_gif_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu interfaces/IDirectFBVideoProvider/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu interfaces/IDirectFBVideoProvider/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-idirectfbvideoproviderLTLIBRARIES: $(idirectfbvideoprovider_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbvideoproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbvideoproviderdir)" @list='$(idirectfbvideoprovider_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbvideoproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbvideoproviderdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbvideoproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbvideoproviderdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbvideoproviderLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbvideoprovider_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbvideoproviderdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbvideoproviderdir)/$$p"; \ done clean-idirectfbvideoproviderLTLIBRARIES: -test -z "$(idirectfbvideoprovider_LTLIBRARIES)" || rm -f $(idirectfbvideoprovider_LTLIBRARIES) @list='$(idirectfbvideoprovider_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libidirectfbvideoprovider_gif.la: $(libidirectfbvideoprovider_gif_la_OBJECTS) $(libidirectfbvideoprovider_gif_la_DEPENDENCIES) $(libidirectfbvideoprovider_gif_la_LINK) $(am_libidirectfbvideoprovider_gif_la_rpath) $(libidirectfbvideoprovider_gif_la_OBJECTS) $(libidirectfbvideoprovider_gif_la_LIBADD) $(LIBS) libidirectfbvideoprovider_v4l.la: $(libidirectfbvideoprovider_v4l_la_OBJECTS) $(libidirectfbvideoprovider_v4l_la_DEPENDENCIES) $(libidirectfbvideoprovider_v4l_la_LINK) $(am_libidirectfbvideoprovider_v4l_la_rpath) $(libidirectfbvideoprovider_v4l_la_OBJECTS) $(libidirectfbvideoprovider_v4l_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbvideoprovider_gif.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbvideoprovider_v4l.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idirectfbvideoproviderDATA: $(idirectfbvideoprovider_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbvideoproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbvideoproviderdir)" @list='$(idirectfbvideoprovider_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbvideoproviderDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbvideoproviderdir)/$$f'"; \ $(idirectfbvideoproviderDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbvideoproviderdir)/$$f"; \ done uninstall-idirectfbvideoproviderDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbvideoprovider_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbvideoproviderdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbvideoproviderdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(idirectfbvideoproviderdir)" "$(DESTDIR)$(idirectfbvideoproviderdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-idirectfbvideoproviderLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-idirectfbvideoproviderDATA \ install-idirectfbvideoproviderLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idirectfbvideoproviderDATA \ uninstall-idirectfbvideoproviderLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-idirectfbvideoproviderLTLIBRARIES clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-idirectfbvideoproviderDATA \ install-idirectfbvideoproviderLTLIBRARIES install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am \ uninstall-idirectfbvideoproviderDATA \ uninstall-idirectfbvideoproviderLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/videodev.h0000644000175000017500000002717011164361026020503 00000000000000#ifndef __LINUX_VIDEODEV_H #define __LINUX_VIDEODEV_H #include #include #define HAVE_V4L2 1 #include "videodev2.h" #define VID_TYPE_CAPTURE 1 /* Can capture */ #define VID_TYPE_TUNER 2 /* Can tune */ #define VID_TYPE_TELETEXT 4 /* Does teletext */ #define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ #define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ #define VID_TYPE_CLIPPING 32 /* Can clip */ #define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ #define VID_TYPE_SCALES 128 /* Scalable */ #define VID_TYPE_MONOCHROME 256 /* Monochrome only */ #define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ #define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ #define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ #define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ #define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ struct video_capability { char name[32]; int type; int channels; /* Num channels */ int audios; /* Num audio devices */ int maxwidth; /* Supported width */ int maxheight; /* And height */ int minwidth; /* Supported width */ int minheight; /* And height */ }; struct video_channel { int channel; char name[32]; int tuners; __u32 flags; #define VIDEO_VC_TUNER 1 /* Channel has a tuner */ #define VIDEO_VC_AUDIO 2 /* Channel has audio */ __u16 type; #define VIDEO_TYPE_TV 1 #define VIDEO_TYPE_CAMERA 2 __u16 norm; /* Norm set by channel */ }; struct video_tuner { int tuner; char name[32]; unsigned long rangelow, rangehigh; /* Tuner range */ __u32 flags; #define VIDEO_TUNER_PAL 1 #define VIDEO_TUNER_NTSC 2 #define VIDEO_TUNER_SECAM 4 #define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ #define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ #define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ #define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ #define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ __u16 mode; /* PAL/NTSC/SECAM/OTHER */ #define VIDEO_MODE_PAL 0 #define VIDEO_MODE_NTSC 1 #define VIDEO_MODE_SECAM 2 #define VIDEO_MODE_AUTO 3 __u16 signal; /* Signal strength 16bit scale */ }; struct video_picture { __u16 brightness; __u16 hue; __u16 colour; __u16 contrast; __u16 whiteness; /* Black and white only */ __u16 depth; /* Capture depth */ __u16 palette; /* Palette in use */ #define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ #define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ #define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ #define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ #define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ #define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ #define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ #define VIDEO_PALETTE_YUYV 8 #define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ #define VIDEO_PALETTE_YUV420 10 #define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ #define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ #define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ #define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ #define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ #define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ #define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ #define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ }; struct video_audio { int audio; /* Audio channel */ __u16 volume; /* If settable */ __u16 bass, treble; __u32 flags; #define VIDEO_AUDIO_MUTE 1 #define VIDEO_AUDIO_MUTABLE 2 #define VIDEO_AUDIO_VOLUME 4 #define VIDEO_AUDIO_BASS 8 #define VIDEO_AUDIO_TREBLE 16 #define VIDEO_AUDIO_BALANCE 32 char name[16]; #define VIDEO_SOUND_MONO 1 #define VIDEO_SOUND_STEREO 2 #define VIDEO_SOUND_LANG1 4 #define VIDEO_SOUND_LANG2 8 __u16 mode; __u16 balance; /* Stereo balance */ __u16 step; /* Step actual volume uses */ }; struct video_clip { __s32 x,y; __s32 width, height; struct video_clip *next; /* For user use/driver use only */ }; struct video_window { __u32 x,y; /* Position of window */ __u32 width,height; /* Its size */ __u32 chromakey; __u32 flags; struct video_clip *clips; /* Set only */ int clipcount; #define VIDEO_WINDOW_INTERLACE 1 #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ #define VIDEO_CLIP_BITMAP -1 /* bitmap is 1024x625, a '1' bit represents a clipped pixel */ #define VIDEO_CLIPMAP_SIZE (128 * 625) }; struct video_capture { __u32 x,y; /* Offsets into image */ __u32 width, height; /* Area to capture */ __u16 decimation; /* Decimation divider */ __u16 flags; /* Flags for capture */ #define VIDEO_CAPTURE_ODD 0 /* Temporal */ #define VIDEO_CAPTURE_EVEN 1 }; struct video_buffer { void *base; int height,width; int depth; int bytesperline; }; struct video_mmap { unsigned int frame; /* Frame (0 - n) for double buffer */ int height,width; unsigned int format; /* should be VIDEO_PALETTE_* */ }; struct video_key { __u8 key[8]; __u32 flags; }; #define VIDEO_MAX_FRAME 32 struct video_mbuf { int size; /* Total memory to map */ int frames; /* Frames */ int offsets[VIDEO_MAX_FRAME]; }; #define VIDEO_NO_UNIT (-1) struct video_unit { int video; /* Video minor */ int vbi; /* VBI minor */ int radio; /* Radio minor */ int audio; /* Audio minor */ int teletext; /* Teletext minor */ }; struct vbi_format { __u32 sampling_rate; /* in Hz */ __u32 samples_per_line; __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ __s32 start[2]; /* starting line for each frame */ __u32 count[2]; /* count of lines for each frame */ __u32 flags; #define VBI_UNSYNC 1 /* can distingues between top/bottom field */ #define VBI_INTERLACED 2 /* lines are interlaced */ }; /* video_info is biased towards hardware mpeg encode/decode */ /* but it could apply generically to any hardware compressor/decompressor */ struct video_info { __u32 frame_count; /* frames output since decode/encode began */ __u32 h_size; /* current unscaled horizontal size */ __u32 v_size; /* current unscaled veritcal size */ __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */ __u32 picture_type; /* current picture type */ __u32 temporal_reference; /* current temporal reference */ __u8 user_data[256]; /* user data last found in compressed stream */ /* user_data[0] contains user data flags, user_data[1] has count */ }; /* generic structure for setting playback modes */ struct video_play_mode { int mode; int p1; int p2; }; /* for loading microcode / fpga programming */ struct video_code { char loadwhat[16]; /* name or tag of file being passed */ int datasize; __u8 *data; }; #define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ #define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ #define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ #define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ #define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ #define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ #define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ #define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ #define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ #define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ #define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ #define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ #define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ #define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ #define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ #define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ #define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ #define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ #define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ #define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ #define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ #define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ #define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ #define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ #define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ #define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ #define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ #define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ #define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ #define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ /* VIDIOCSWRITEMODE */ #define VID_WRITE_MPEG_AUD 0 #define VID_WRITE_MPEG_VID 1 #define VID_WRITE_OSD 2 #define VID_WRITE_TTX 3 #define VID_WRITE_CC 4 #define VID_WRITE_MJPEG 5 /* VIDIOCSPLAYMODE */ #define VID_PLAY_VID_OUT_MODE 0 /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ #define VID_PLAY_GENLOCK 1 /* p1: 0 = OFF, 1 = ON */ /* p2: GENLOCK FINE DELAY value */ #define VID_PLAY_NORMAL 2 #define VID_PLAY_PAUSE 3 #define VID_PLAY_SINGLE_FRAME 4 #define VID_PLAY_FAST_FORWARD 5 #define VID_PLAY_SLOW_MOTION 6 #define VID_PLAY_IMMEDIATE_NORMAL 7 #define VID_PLAY_SWITCH_CHANNELS 8 #define VID_PLAY_FREEZE_FRAME 9 #define VID_PLAY_STILL_MODE 10 #define VID_PLAY_MASTER_MODE 11 /* p1: see below */ #define VID_PLAY_MASTER_NONE 1 #define VID_PLAY_MASTER_VIDEO 2 #define VID_PLAY_MASTER_AUDIO 3 #define VID_PLAY_ACTIVE_SCANLINES 12 /* p1 = first active; p2 = last active */ #define VID_PLAY_RESET 13 #define VID_PLAY_END_MARK 14 #define VID_HARDWARE_BT848 1 #define VID_HARDWARE_QCAM_BW 2 #define VID_HARDWARE_PMS 3 #define VID_HARDWARE_QCAM_C 4 #define VID_HARDWARE_PSEUDO 5 #define VID_HARDWARE_SAA5249 6 #define VID_HARDWARE_AZTECH 7 #define VID_HARDWARE_SF16MI 8 #define VID_HARDWARE_RTRACK 9 #define VID_HARDWARE_ZOLTRIX 10 #define VID_HARDWARE_SAA7146 11 #define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */ #define VID_HARDWARE_RTRACK2 13 #define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */ #define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */ #define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */ #define VID_HARDWARE_BROADWAY 17 /* Broadway project */ #define VID_HARDWARE_GEMTEK 18 #define VID_HARDWARE_TYPHOON 19 #define VID_HARDWARE_VINO 20 /* SGI Indy Vino */ #define VID_HARDWARE_CADET 21 /* Cadet radio */ #define VID_HARDWARE_TRUST 22 /* Trust FM Radio */ #define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */ #define VID_HARDWARE_CPIA 24 #define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */ #define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */ #define VID_HARDWARE_OV511 27 #define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */ #define VID_HARDWARE_W9966 29 #define VID_HARDWARE_SE401 30 /* SE401 USB webcams */ #define VID_HARDWARE_PWC 31 /* Philips webcams */ #define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */ #define VID_HARDWARE_CPIA2 33 #define VID_HARDWARE_VICAM 34 #define VID_HARDWARE_SF16FMR2 35 #define VID_HARDWARE_W9968CF 36 #define VID_HARDWARE_SAA7114H 37 #endif /* __LINUX_VIDEODEV_H */ /* * Local variables: * c-basic-offset: 8 * End: */ DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_gif.c0000644000175000017500000007761611245562152024270 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static DFBResult Probe( IDirectFBVideoProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBVideoProvider *thiz, IDirectFBDataBuffer *buffer ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBVideoProvider, Gif ) /*****************************************************************************/ #define MAXCOLORMAPSIZE 256 #define CM_RED 0 #define CM_GREEN 1 #define CM_BLUE 2 #define MAX_LWZ_BITS 12 #define INTERLACE 0x40 #define LOCALCOLORMAP 0x80 #define BitSet(byte, bit) (((byte) & (bit)) == (bit)) #define LM_to_uint(a,b) (((b)<<8)|(a)) typedef struct { int ref; /* reference counter */ IDirectFBDataBuffer *buffer; DFBBoolean seekable; IDirectFBSurface *destination; IDirectFBSurface_data *dst_data; DFBRectangle dst_rect; u32 *image; DirectThread *thread; pthread_mutex_t lock; pthread_cond_t cond; DFBVideoProviderStatus status; DFBVideoProviderPlaybackFlags flags; double speed; unsigned int start_pos; char Version[4]; unsigned int Width; unsigned int Height; u8 ColorMap[3][MAXCOLORMAPSIZE]; unsigned int BitPixel; unsigned int ColorResolution; u32 Background; unsigned int AspectRatio; int transparent; unsigned int delayTime; int inputFlag; int disposal; u8 buf[280]; int curbit, lastbit, done, last_byte; int fresh; int code_size, set_code_size; int max_code, max_code_size; int firstcode, oldcode; int clear_code, end_code; int table[2][(1<< MAX_LWZ_BITS)]; int stack[(1<<(MAX_LWZ_BITS))*2], *sp; DVFrameCallback callback; void *callback_ctx; } IDirectFBVideoProvider_GIF_data; #define GIFERRORMSG(x, ...) \ D_ERROR( "IDirectFBVideoProvider_GIF: " #x "!\n", ## __VA_ARGS__ ) #define GIFDEBUGMSG(x, ...) \ D_DEBUG( "IDirectFBVideoProvider_GIF: " #x "!\n", ## __VA_ARGS__ ) /*****************************************************************************/ static int ZeroDataBlock = 0; static DFBResult FetchData( IDirectFBDataBuffer *buffer, void *data, unsigned int len ) { DFBResult ret = DFB_OK; do { unsigned int read = 0; ret = buffer->WaitForData( buffer, len ); if (ret == DFB_OK) ret = buffer->GetData( buffer, len, data, &read ); if (ret) break; data += read; len -= read; } while (len); return ret; } static int ReadColorMap( IDirectFBDataBuffer *buffer, int number, u8 buf[3][MAXCOLORMAPSIZE] ) { int i; u8 rgb[3*number]; if (FetchData( buffer, rgb, sizeof(rgb) )) { GIFERRORMSG("bad colormap"); return -1; } for (i = 0; i < number; ++i) { buf[CM_RED][i] = rgb[i*3+0]; buf[CM_GREEN][i] = rgb[i*3+1]; buf[CM_BLUE][i] = rgb[i*3+2]; } return 0; } static int GetDataBlock(IDirectFBDataBuffer *buffer, u8 *buf) { unsigned char count; if (FetchData( buffer, &count, 1 )) { GIFERRORMSG("error in getting DataBlock size"); return -1; } ZeroDataBlock = (count == 0); if ((count != 0) && FetchData( buffer, buf, count )) { GIFERRORMSG("error in reading DataBlock"); return -1; } return count; } static int GetCode(IDirectFBVideoProvider_GIF_data *data, int code_size, int flag) { int i, j, ret; unsigned char count; if (flag) { data->curbit = 0; data->lastbit = 0; data->done = false; return 0; } if ( (data->curbit+code_size) >= data->lastbit) { if (data->done) { if (data->curbit >= data->lastbit) { GIFERRORMSG("ran off the end of my bits"); } return -1; } data->buf[0] = data->buf[data->last_byte-2]; data->buf[1] = data->buf[data->last_byte-1]; if ((count = GetDataBlock( data->buffer, &data->buf[2] )) == 0) { data->done = true; } data->last_byte = 2 + count; data->curbit = (data->curbit - data->lastbit) + 16; data->lastbit = (2+count) * 8; } ret = 0; for (i = data->curbit, j = 0; j < code_size; ++i, ++j) { ret |= ((data->buf[ i / 8 ] & (1 << (i % 8))) != 0) << j; } data->curbit += code_size; return ret; } static int DoExtension( IDirectFBVideoProvider_GIF_data *data, int label ) { unsigned char buf[256] = { 0 }; char *str; switch (label) { case 0x01: /* Plain Text Extension */ str = "Plain Text Extension"; break; case 0xff: /* Application Extension */ str = "Application Extension"; break; case 0xfe: /* Comment Extension */ str = "Comment Extension"; while (GetDataBlock( data->buffer, (u8*) buf ) != 0) GIFDEBUGMSG("gif comment: %s", buf); return false; case 0xf9: /* Graphic Control Extension */ str = "Graphic Control Extension"; (void) GetDataBlock( data->buffer, (u8*) buf ); data->disposal = (buf[0] >> 2) & 0x7; data->inputFlag = (buf[0] >> 1) & 0x1; if (LM_to_uint( buf[1], buf[2] )) data->delayTime = LM_to_uint( buf[1], buf[2] ) * 10000; if ((buf[0] & 0x1) != 0) data->transparent = buf[3]; else data->transparent = -1; while (GetDataBlock( data->buffer, (u8*) buf ) != 0) ; return false; default: str = (char*) buf; snprintf(str, 256, "UNKNOWN (0x%02x)", label); break; } GIFDEBUGMSG("got a '%s' extension", str ); while (GetDataBlock( data->buffer, (u8*) buf ) != 0); return 0; } static int LWZReadByte( IDirectFBVideoProvider_GIF_data *data, int flag, int input_code_size ) { int code, incode; int i; if (flag) { data->set_code_size = input_code_size; data->code_size = data->set_code_size+1; data->clear_code = 1 << data->set_code_size ; data->end_code = data->clear_code + 1; data->max_code_size = 2*data->clear_code; data->max_code = data->clear_code+2; GetCode(data, 0, true); data->fresh = true; for (i = 0; i < data->clear_code; ++i) { data->table[0][i] = 0; data->table[1][i] = i; } for (; i < (1<table[0][i] = data->table[1][0] = 0; } data->sp = data->stack; return 0; } else if (data->fresh) { data->fresh = false; do { data->firstcode = data->oldcode = GetCode( data, data->code_size, false ); } while (data->firstcode == data->clear_code); return data->firstcode; } if (data->sp > data->stack) { return *--data->sp; } while ((code = GetCode( data, data->code_size, false )) >= 0) { if (code == data->clear_code) { for (i = 0; i < data->clear_code; ++i) { data->table[0][i] = 0; data->table[1][i] = i; } for (; i < (1<table[0][i] = data->table[1][i] = 0; } data->code_size = data->set_code_size+1; data->max_code_size = 2*data->clear_code; data->max_code = data->clear_code+2; data->sp = data->stack; data->firstcode = data->oldcode = GetCode( data, data->code_size, false ); return data->firstcode; } else if (code == data->end_code) { int count; u8 buf[260]; if (ZeroDataBlock) { return -2; } while ((count = GetDataBlock( data->buffer, buf )) > 0) ; if (count != 0) GIFERRORMSG("missing EOD in data stream (common occurence)"); return -2; } incode = code; if (code >= data->max_code) { *data->sp++ = data->firstcode; code = data->oldcode; } while (code >= data->clear_code) { *data->sp++ = data->table[1][code]; if (code == data->table[0][code]) { GIFERRORMSG("circular table entry BIG ERROR"); } code = data->table[0][code]; } *data->sp++ = data->firstcode = data->table[1][code]; if ((code = data->max_code) <(1<table[0][code] = data->oldcode; data->table[1][code] = data->firstcode; ++data->max_code; if ((data->max_code >= data->max_code_size) && (data->max_code_size < (1<max_code_size *= 2; ++data->code_size; } } data->oldcode = incode; if (data->sp > data->stack) { return *--data->sp; } } return code; } static int ReadImage( IDirectFBVideoProvider_GIF_data *data, int left, int top, int width, int height, u8 cmap[3][MAXCOLORMAPSIZE], bool interlace, bool ignore ) { u8 c; int v; int xpos = 0, ypos = 0, pass = 0; u32 *image, *dst; /* ** Initialize the decompression routines */ if (FetchData( data->buffer, &c, 1 )) GIFERRORMSG("EOF / read error on image data"); if (LWZReadByte( data, true, c ) < 0) GIFERRORMSG("error reading image"); /* ** If this is an "uninteresting picture" ignore it. */ if (ignore) { GIFDEBUGMSG("skipping image..."); while (LWZReadByte( data, false, c ) >= 0) ; return 0; } switch (data->disposal) { case 2: GIFDEBUGMSG("restoring to background color..."); memset( data->image, 0, data->Width * data->Height * 4 ); break; case 3: GIFERRORMSG("restoring to previous frame is unsupported"); break; default: break; } dst = image = data->image + (top * data->Width + left); GIFDEBUGMSG("reading %dx%d at %dx%d %sGIF image", width, height, left, top, interlace ? " interlaced " : "" ); while ((v = LWZReadByte( data, false, c )) >= 0 ) { if (v != data->transparent) { dst[xpos] = (0xFF000000 | cmap[CM_RED][v] << 16 | cmap[CM_GREEN][v] << 8 | cmap[CM_BLUE][v]); } ++xpos; if (xpos == width) { xpos = 0; if (interlace) { switch (pass) { case 0: case 1: ypos += 8; break; case 2: ypos += 4; break; case 3: ypos += 2; break; } if (ypos >= height) { ++pass; switch (pass) { case 1: ypos = 4; break; case 2: ypos = 2; break; case 3: ypos = 1; break; default: goto fini; } } } else { ++ypos; } dst = image + ypos * data->Width; } if (ypos >= height) { break; } } fini: if (LWZReadByte( data, false, c ) >= 0) { GIFERRORMSG("too much input data, ignoring extra..."); //while (LWZReadByte( data, false, c ) >= 0); } return 0; } static void GIFReset( IDirectFBVideoProvider_GIF_data *data ) { data->transparent = -1; data->delayTime = 1000000; /* default: 1s */ data->inputFlag = -1; data->disposal = 0; if (data->image) memset( data->image, 0, data->Width*data->Height*4 ); } static DFBResult GIFReadHeader( IDirectFBVideoProvider_GIF_data *data ) { DFBResult ret; u8 buf[7]; ret = FetchData( data->buffer, buf, 6 ); if (ret) { GIFERRORMSG("error reading header"); return ret; } if (memcmp( buf, "GIF", 3 )) { GIFERRORMSG("bad magic"); return DFB_UNSUPPORTED; } memcpy( data->Version, &buf[3], 3 ); data->Version[3] = '\0'; ret = FetchData( data->buffer, buf, 7 ); if (ret) { GIFERRORMSG("error reading screen descriptor"); return ret; } data->Width = LM_to_uint( buf[0], buf[1] ); data->Height = LM_to_uint( buf[2], buf[3] ); data->BitPixel = 2 << (buf[4] & 0x07); data->ColorResolution = (((buf[4] & 0x70) >> 3) + 1); data->Background = buf[5]; data->AspectRatio = buf[6]; if (data->AspectRatio) data->AspectRatio = ((data->AspectRatio + 15) << 8) >> 6; else data->AspectRatio = (data->Width << 8) / data->Height; if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ if (ReadColorMap( data->buffer, data->BitPixel, data->ColorMap )) { GIFERRORMSG("error reading global colormap"); return DFB_FAILURE; } } return DFB_OK; } static DFBResult GIFReadFrame( IDirectFBVideoProvider_GIF_data *data ) { u8 buf[16], c; int top, left; int width, height; u8 localColorMap[3][MAXCOLORMAPSIZE]; bool useGlobalColormap; data->curbit = data->lastbit = data->done = data->last_byte = 0; data->fresh = data->code_size = data->set_code_size = data->max_code = data->max_code_size = data->firstcode = data->oldcode = data->clear_code = data->end_code = 0; for (;;) { DFBResult ret; ret = FetchData( data->buffer, &c, 1); if (ret) { GIFERRORMSG("EOF / read error on image data" ); return DFB_EOF; } if (c == ';') /* GIF terminator */ return DFB_EOF; if (c == '!') { /* Extension */ if (FetchData( data->buffer, &c, 1)) { GIFERRORMSG("EOF / read error on extention function code"); return DFB_EOF; } DoExtension( data, c ); continue; } if (c != ',') { /* Not a valid start character */ GIFERRORMSG("bogus character 0x%02x, ignoring", (int) c ); continue; } ret = FetchData( data->buffer, buf, 9 ); if (ret) { GIFERRORMSG("couldn't read left/top/width/height"); return ret; } left = LM_to_uint( buf[0], buf[1] ); top = LM_to_uint( buf[2], buf[3] ); width = LM_to_uint( buf[4], buf[5] ); height = LM_to_uint( buf[6], buf[7] ); useGlobalColormap = !BitSet( buf[8], LOCALCOLORMAP ); if (!useGlobalColormap) { int bitPixel = 2 << (buf[8] & 0x07); if (ReadColorMap( data->buffer, bitPixel, localColorMap )) GIFERRORMSG("error reading local colormap"); } if (ReadImage( data, left, top, width, height, (useGlobalColormap ? data->ColorMap : localColorMap), BitSet( buf[8], INTERLACE ), 0 )) { GIFERRORMSG("error reading image"); return DFB_FAILURE; } break; } return DFB_OK; } /*****************************************************************************/ static void IDirectFBVideoProvider_GIF_Destruct( IDirectFBVideoProvider *thiz ) { IDirectFBVideoProvider_GIF_data *data = thiz->priv; thiz->Stop( thiz ); if (data->image) D_FREE( data->image ); if (data->buffer) data->buffer->Release( data->buffer ); pthread_cond_destroy( &data->cond ); pthread_mutex_destroy( &data->lock ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBVideoProvider_GIF_AddRef( IDirectFBVideoProvider *thiz ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) data->ref++; return DFB_OK; } static DirectResult IDirectFBVideoProvider_GIF_Release( IDirectFBVideoProvider *thiz ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (--data->ref == 0) IDirectFBVideoProvider_GIF_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_GetCapabilities( IDirectFBVideoProvider *thiz, DFBVideoProviderCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!caps) return DFB_INVARG; *caps = DVCAPS_BASIC | DVCAPS_SCALE | DVCAPS_SPEED; return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_GetSurfaceDescription( IDirectFBVideoProvider *thiz, DFBSurfaceDescription *desc ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!desc) return DFB_INVARG; desc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; desc->width = data->Width; desc->height = data->Height; desc->pixelformat = DSPF_ARGB; return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_GetStreamDescription( IDirectFBVideoProvider *thiz, DFBStreamDescription *desc ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!desc) return DFB_INVARG; desc->caps = DVSCAPS_VIDEO; snprintf( desc->video.encoding, DFB_STREAM_DESC_ENCODING_LENGTH, "GIF %s", data->Version ); desc->video.framerate = 0; desc->video.aspect = (double)data->AspectRatio/256.0; desc->video.bitrate = 0; desc->title[0] = desc->author[0] = desc->album[0] = desc->genre[0] = desc->comment[0] = 0; desc->year = 0; return DFB_OK; } static void* GIFVideo( DirectThread *self, void *arg ) { IDirectFBVideoProvider_GIF_data *data = arg; pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, NULL ); while (!direct_thread_is_canceled( self )) { DFBResult ret; DFBRectangle rect; DFBRegion clip; CoreSurface *surface; CoreSurfaceBufferLock lock; pthread_mutex_lock( &data->lock ); if (direct_thread_is_canceled( self )) { pthread_mutex_unlock( &data->lock ); break; } ret = GIFReadFrame( data ); if (ret) { if (ret == DFB_EOF) { GIFReset( data ); if (data->flags & DVPLAY_LOOPING) { data->buffer->SeekTo( data->buffer, data->start_pos ); } else { data->status = DVSTATE_FINISHED; pthread_mutex_unlock( &data->lock ); break; } } pthread_mutex_unlock( &data->lock ); continue; } rect = (data->dst_rect.w == 0) ? data->dst_data->area.wanted : data->dst_rect; dfb_region_from_rectangle( &clip, &data->dst_data->area.current ); surface = data->dst_data->surface; D_MAGIC_ASSERT( surface, CoreSurface ); if (dfb_rectangle_region_intersects( &rect, &clip ) && dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ) == DFB_OK) { dfb_scale_linear_32( data->image, data->Width, data->Height, lock.addr, lock.pitch, &rect, data->dst_data->surface, &clip ); dfb_surface_unlock_buffer( surface, &lock ); if (data->callback) data->callback( data->callback_ctx ); } if (!data->speed) { pthread_cond_wait( &data->cond, &data->lock ); } else { struct timespec ts; struct timeval tv; unsigned long us; gettimeofday( &tv, NULL ); us = data->delayTime; if (data->speed != 1.0) us = ((double)us / data->speed + .5); us += tv.tv_usec; ts.tv_sec = tv.tv_sec + us/1000000; ts.tv_nsec = (us%1000000) * 1000; pthread_cond_timedwait( &data->cond, &data->lock, &ts ); } pthread_mutex_unlock( &data->lock ); } return (void*)0; } static DFBResult IDirectFBVideoProvider_GIF_PlayTo( IDirectFBVideoProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dest_rect, DVFrameCallback callback, void *ctx ) { IDirectFBSurface_data *dst_data; DFBRectangle rect = { 0, 0, 0, 0 }; DFBResult ret; DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!destination) return DFB_INVARG; dst_data = destination->priv; if (!dst_data || !dst_data->surface) return DFB_DESTROYED; if (dest_rect) { if (dest_rect->w < 1 || dest_rect->h < 1) return DFB_INVARG; rect = *dest_rect; rect.x += dst_data->area.wanted.x; rect.y += dst_data->area.wanted.y; } pthread_mutex_lock( &data->lock ); if (data->status == DVSTATE_FINISHED) { ret = data->buffer->SeekTo( data->buffer, data->start_pos ); if (ret) { pthread_mutex_unlock( &data->lock ); return ret; } } data->status = DVSTATE_PLAY; if (!data->image) { data->image = D_CALLOC( 4, data->Width * data->Height ); if (!data->image) { pthread_mutex_unlock( &data->lock ); return D_OOM(); } } if (data->destination) data->destination->Release( data->destination ); destination->AddRef( destination ); data->destination = destination; data->dst_data = dst_data; data->dst_rect = rect; data->callback = callback; data->callback_ctx = ctx; if (!data->thread) { data->thread = direct_thread_create( DTT_DEFAULT, GIFVideo, (void*)data, "GIF Video" ); } pthread_mutex_unlock( &data->lock ); return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_Stop( IDirectFBVideoProvider *thiz ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (data->thread) { direct_thread_cancel( data->thread ); pthread_mutex_lock( &data->lock ); pthread_cond_signal( &data->cond ); pthread_mutex_unlock( &data->lock ); direct_thread_join( data->thread ); direct_thread_destroy( data->thread ); data->thread = NULL; } if (data->destination) { data->destination->Release( data->destination ); data->destination = NULL; data->dst_data = NULL; } data->status = DVSTATE_STOP; return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_GetStatus( IDirectFBVideoProvider *thiz, DFBVideoProviderStatus *status ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!status) return DFB_INVARG; *status = data->status; return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_SeekTo( IDirectFBVideoProvider *thiz, double seconds ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (seconds < 0.0) return DFB_INVARG; return DFB_UNSUPPORTED; } static DFBResult IDirectFBVideoProvider_GIF_GetPos( IDirectFBVideoProvider *thiz, double *seconds ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!seconds) return DFB_INVARG; *seconds = 0.0; return DFB_UNSUPPORTED; } static DFBResult IDirectFBVideoProvider_GIF_GetLength( IDirectFBVideoProvider *thiz, double *seconds ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!seconds) return DFB_INVARG; *seconds = 0.0; return DFB_UNSUPPORTED; } static DFBResult IDirectFBVideoProvider_GIF_SetPlaybackFlags( IDirectFBVideoProvider *thiz, DFBVideoProviderPlaybackFlags flags ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (flags & ~DVPLAY_LOOPING) return DFB_UNSUPPORTED; if (flags & DVPLAY_LOOPING && !data->seekable) return DFB_UNSUPPORTED; data->flags = flags; return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_SetSpeed( IDirectFBVideoProvider *thiz, double multiplier ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (multiplier < 0.0) return DFB_INVARG; if (data->speed != multiplier) { pthread_mutex_lock( &data->lock ); data->speed = multiplier; pthread_cond_signal( &data->cond ); pthread_mutex_unlock( &data->lock ); } return DFB_OK; } static DFBResult IDirectFBVideoProvider_GIF_GetSpeed( IDirectFBVideoProvider *thiz, double *multiplier ) { DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_GIF ) if (!multiplier) return DFB_INVARG; *multiplier = data->speed; return DFB_OK; } /* exported symbols */ static DFBResult Probe( IDirectFBVideoProvider_ProbeContext *ctx ) { if (!memcmp( ctx->header, "GIF89", 5 )) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBVideoProvider *thiz, IDirectFBDataBuffer *buffer ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBVideoProvider_GIF ) data->ref = 1; data->status = DVSTATE_STOP; data->buffer = buffer; data->speed = 1.0; buffer->AddRef( buffer ); data->seekable = (buffer->SeekTo( buffer, 0 ) == DFB_OK); GIFReset( data ); ret = GIFReadHeader( data ); if (ret) { IDirectFBVideoProvider_GIF_Destruct( thiz ); return ret; } data->buffer->GetPosition( data->buffer, &data->start_pos ); direct_util_recursive_pthread_mutex_init( &data->lock ); pthread_cond_init( &data->cond, NULL ); thiz->AddRef = IDirectFBVideoProvider_GIF_AddRef; thiz->Release = IDirectFBVideoProvider_GIF_Release; thiz->GetCapabilities = IDirectFBVideoProvider_GIF_GetCapabilities; thiz->GetSurfaceDescription = IDirectFBVideoProvider_GIF_GetSurfaceDescription; thiz->GetStreamDescription = IDirectFBVideoProvider_GIF_GetStreamDescription; thiz->PlayTo = IDirectFBVideoProvider_GIF_PlayTo; thiz->Stop = IDirectFBVideoProvider_GIF_Stop; thiz->GetStatus = IDirectFBVideoProvider_GIF_GetStatus; thiz->SeekTo = IDirectFBVideoProvider_GIF_SeekTo; thiz->GetPos = IDirectFBVideoProvider_GIF_GetPos; thiz->GetLength = IDirectFBVideoProvider_GIF_GetLength; thiz->SetPlaybackFlags = IDirectFBVideoProvider_GIF_SetPlaybackFlags; thiz->SetSpeed = IDirectFBVideoProvider_GIF_SetSpeed; thiz->GetSpeed = IDirectFBVideoProvider_GIF_GetSpeed; return DFB_OK; } DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/videodev2.h0000644000175000017500000006661011164361026020567 00000000000000#ifndef __LINUX_VIDEODEV2_H #define __LINUX_VIDEODEV2_H /* * Video for Linux Two * * Header file for v4l or V4L2 drivers and applications, for * Linux kernels 2.2.x or 2.4.x. * * See http://bytesex.org/v4l/ for API specs and other * v4l2 documentation. * * Author: Bill Dirks * Justin Schoeman * et al. */ /* * M I S C E L L A N E O U S */ /* Four-character-code (FOURCC) */ #define v4l2_fourcc(a,b,c,d)\ (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) /* * E N U M S */ enum v4l2_field { V4L2_FIELD_ANY = 0, /* driver can choose from none, top, bottom, interlaced depending on whatever it thinks is approximate ... */ V4L2_FIELD_NONE = 1, /* this device has no fields ... */ V4L2_FIELD_TOP = 2, /* top field only */ V4L2_FIELD_BOTTOM = 3, /* bottom field only */ V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */ V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one buffer, top-bottom order */ V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */ V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into separate buffers */ }; #define V4L2_FIELD_HAS_TOP(field) \ ((field) == V4L2_FIELD_TOP ||\ (field) == V4L2_FIELD_INTERLACED ||\ (field) == V4L2_FIELD_SEQ_TB ||\ (field) == V4L2_FIELD_SEQ_BT) #define V4L2_FIELD_HAS_BOTTOM(field) \ ((field) == V4L2_FIELD_BOTTOM ||\ (field) == V4L2_FIELD_INTERLACED ||\ (field) == V4L2_FIELD_SEQ_TB ||\ (field) == V4L2_FIELD_SEQ_BT) #define V4L2_FIELD_HAS_BOTH(field) \ ((field) == V4L2_FIELD_INTERLACED ||\ (field) == V4L2_FIELD_SEQ_TB ||\ (field) == V4L2_FIELD_SEQ_BT) enum v4l2_buf_type { V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, V4L2_BUF_TYPE_VBI_CAPTURE = 4, V4L2_BUF_TYPE_VBI_OUTPUT = 5, V4L2_BUF_TYPE_PRIVATE = 0x80, }; enum v4l2_ctrl_type { V4L2_CTRL_TYPE_INTEGER = 1, V4L2_CTRL_TYPE_BOOLEAN = 2, V4L2_CTRL_TYPE_MENU = 3, V4L2_CTRL_TYPE_BUTTON = 4, }; enum v4l2_tuner_type { V4L2_TUNER_RADIO = 1, V4L2_TUNER_ANALOG_TV = 2, }; enum v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, }; /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ enum v4l2_colorspace { /* ITU-R 601 -- broadcast NTSC/PAL */ V4L2_COLORSPACE_SMPTE170M = 1, /* 1125-Line (US) HDTV */ V4L2_COLORSPACE_SMPTE240M = 2, /* HD and modern captures. */ V4L2_COLORSPACE_REC709 = 3, /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */ V4L2_COLORSPACE_BT878 = 4, /* These should be useful. Assume 601 extents. */ V4L2_COLORSPACE_470_SYSTEM_M = 5, V4L2_COLORSPACE_470_SYSTEM_BG = 6, /* I know there will be cameras that send this. So, this is * unspecified chromaticities and full 0-255 on each of the * Y'CbCr components */ V4L2_COLORSPACE_JPEG = 7, /* For RGB colourspaces, this is probably a good start. */ V4L2_COLORSPACE_SRGB = 8, }; enum v4l2_priority { V4L2_PRIORITY_UNSET = 0, /* not initialized */ V4L2_PRIORITY_BACKGROUND = 1, V4L2_PRIORITY_INTERACTIVE = 2, V4L2_PRIORITY_RECORD = 3, V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE, }; struct v4l2_rect { __s32 left; __s32 top; __s32 width; __s32 height; }; struct v4l2_fract { __u32 numerator; __u32 denominator; }; /* * D R I V E R C A P A B I L I T I E S */ struct v4l2_capability { __u8 driver[16]; /* i.e. "bttv" */ __u8 card[32]; /* i.e. "Hauppauge WinTV" */ __u8 bus_info[32]; /* "PCI:" + pci_name(pci_dev) */ __u32 version; /* should use KERNEL_VERSION() */ __u32 capabilities; /* Device capabilities */ __u32 reserved[4]; }; /* Values for 'capabilities' field */ #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a VBI capture device */ #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a VBI output device */ #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ /* * V I D E O I M A G E F O R M A T */ struct v4l2_pix_format { __u32 width; __u32 height; __u32 pixelformat; enum v4l2_field field; __u32 bytesperline; /* for padding, zero if unused */ __u32 sizeimage; enum v4l2_colorspace colorspace; __u32 priv; /* private data, depends on pixelformat */ }; /* Pixel format FOURCC depth Description */ #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q') /* 16 RGB-5-5-5 BE */ #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R') /* 16 RGB-5-6-5 BE */ #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3') /* 24 BGR-8-8-8 */ #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3') /* 24 RGB-8-8-8 */ #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4') /* 32 BGR-8-8-8-8 */ #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4') /* 32 RGB-8-8-8-8 */ #define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y') /* 8 Greyscale */ #define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9') /* 9 YVU 4:1:0 */ #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2') /* 12 YVU 4:2:0 */ #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V') /* 16 YUV 4:2:2 */ #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y') /* 16 YUV 4:2:2 */ #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P') /* 16 YVU422 planar */ #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P') /* 16 YVU411 planar */ #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P') /* 12 YUV 4:1:1 */ /* two planes -- one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2') /* 12 Y/CbCr 4:2:0 */ #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1') /* 12 Y/CrCb 4:2:0 */ /* The following formats are not defined in the V4L2 specification */ #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9') /* 9 YUV 4:1:0 */ #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ /* compressed formats */ #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG */ /* Vendor-specific formats */ #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ /* * F O R M A T E N U M E R A T I O N */ struct v4l2_fmtdesc { __u32 index; /* Format number */ enum v4l2_buf_type type; /* buffer type */ __u32 flags; __u8 description[32]; /* Description string */ __u32 pixelformat; /* Format fourcc */ __u32 reserved[4]; }; #define V4L2_FMT_FLAG_COMPRESSED 0x0001 /* * T I M E C O D E */ struct v4l2_timecode { __u32 type; __u32 flags; __u8 frames; __u8 seconds; __u8 minutes; __u8 hours; __u8 userbits[4]; }; /* Type */ #define V4L2_TC_TYPE_24FPS 1 #define V4L2_TC_TYPE_25FPS 2 #define V4L2_TC_TYPE_30FPS 3 #define V4L2_TC_TYPE_50FPS 4 #define V4L2_TC_TYPE_60FPS 5 /* Flags */ #define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */ #define V4L2_TC_FLAG_COLORFRAME 0x0002 #define V4L2_TC_USERBITS_field 0x000C #define V4L2_TC_USERBITS_USERDEFINED 0x0000 #define V4L2_TC_USERBITS_8BITCHARS 0x0008 /* The above is based on SMPTE timecodes */ /* * C O M P R E S S I O N P A R A M E T E R S */ #if 0 /* ### generic compression settings don't work, there is too much * ### codec-specific stuff. Maybe reuse that for MPEG codec settings * ### later ... */ struct v4l2_compression { __u32 quality; __u32 keyframerate; __u32 pframerate; __u32 reserved[5]; /* what we'll need for MPEG, extracted from some postings on the v4l list (Gert Vervoort, PlasmaJohn). system stream: - type: elementary stream(ES), packatised elementary stream(s) (PES) program stream(PS), transport stream(TS) - system bitrate - PS packet size (DVD: 2048 bytes, VCD: 2324 bytes) - TS video PID - TS audio PID - TS PCR PID - TS system information tables (PAT, PMT, CAT, NIT and SIT) - (MPEG-1 systems stream vs. MPEG-2 program stream (TS not supported by MPEG-1 systems) audio: - type: MPEG (+Layer I,II,III), AC-3, LPCM - bitrate - sampling frequency (DVD: 48 Khz, VCD: 44.1 KHz, 32 kHz) - Trick Modes? (ff, rew) - Copyright - Inverse Telecine video: - picturesize (SIF, 1/2 D1, 2/3 D1, D1) and PAL/NTSC norm can be set through excisting V4L2 controls - noise reduction, parameters encoder specific? - MPEG video version: MPEG-1, MPEG-2 - GOP (Group Of Pictures) definition: - N: number of frames per GOP - M: distance between reference (I,P) frames - open/closed GOP - quantiser matrix: inter Q matrix (64 bytes) and intra Q matrix (64 bytes) - quantiser scale: linear or logarithmic - scanning: alternate or zigzag - bitrate mode: CBR (constant bitrate) or VBR (variable bitrate). - target video bitrate for CBR - target video bitrate for VBR - maximum video bitrate for VBR - min. quantiser value for VBR - max. quantiser value for VBR - adaptive quantisation value - return the number of bytes per GOP or bitrate for bitrate monitoring */ }; #endif struct v4l2_jpegcompression { int quality; int APPn; /* Number of APP segment to be written, * must be 0..15 */ int APP_len; /* Length of data in JPEG APPn segment */ char APP_data[60]; /* Data in the JPEG APPn segment. */ int COM_len; /* Length of data in JPEG COM segment */ char COM_data[60]; /* Data in JPEG COM segment */ __u32 jpeg_markers; /* Which markers should go into the JPEG * output. Unless you exactly know what * you do, leave them untouched. * Inluding less markers will make the * resulting code smaller, but there will * be fewer aplications which can read it. * The presence of the APP and COM marker * is influenced by APP_len and COM_len * ONLY, not by this property! */ #define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */ #define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */ #define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ #define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ #define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will * allways use APP0 */ }; /* * M E M O R Y - M A P P I N G B U F F E R S */ struct v4l2_requestbuffers { __u32 count; enum v4l2_buf_type type; enum v4l2_memory memory; __u32 reserved[2]; }; struct v4l2_buffer { __u32 index; enum v4l2_buf_type type; __u32 bytesused; __u32 flags; enum v4l2_field field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; /* memory location */ enum v4l2_memory memory; union { __u32 offset; unsigned long userptr; } m; __u32 length; __u32 reserved[2]; }; /* Flags for 'flags' field */ #define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */ #define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */ #define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */ #define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ #define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ #define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ #define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ /* * O V E R L A Y P R E V I E W */ struct v4l2_framebuffer { __u32 capability; __u32 flags; /* FIXME: in theory we should pass something like PCI device + memory * region + offset instead of some physical address */ void* base; struct v4l2_pix_format fmt; }; /* Flags for the 'capability' field. Read only */ #define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001 #define V4L2_FBUF_CAP_CHROMAKEY 0x0002 #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004 #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008 /* Flags for the 'flags' field. */ #define V4L2_FBUF_FLAG_PRIMARY 0x0001 #define V4L2_FBUF_FLAG_OVERLAY 0x0002 #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004 struct v4l2_clip { struct v4l2_rect c; struct v4l2_clip *next; }; struct v4l2_window { struct v4l2_rect w; enum v4l2_field field; __u32 chromakey; struct v4l2_clip *clips; __u32 clipcount; void *bitmap; }; /* * C A P T U R E P A R A M E T E R S */ struct v4l2_captureparm { __u32 capability; /* Supported modes */ __u32 capturemode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in .1us units */ __u32 extendedmode; /* Driver-specific extensions */ __u32 readbuffers; /* # of buffers for read */ __u32 reserved[4]; }; /* Flags for 'capability' and 'capturemode' fields */ #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ struct v4l2_outputparm { __u32 capability; /* Supported modes */ __u32 outputmode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in seconds */ __u32 extendedmode; /* Driver-specific extensions */ __u32 writebuffers; /* # of buffers for write */ __u32 reserved[4]; }; /* * I N P U T I M A G E C R O P P I N G */ struct v4l2_cropcap { enum v4l2_buf_type type; struct v4l2_rect bounds; struct v4l2_rect defrect; struct v4l2_fract pixelaspect; }; struct v4l2_crop { enum v4l2_buf_type type; struct v4l2_rect c; }; /* * A N A L O G V I D E O S T A N D A R D */ typedef __u64 v4l2_std_id; /* one bit for each */ #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001) #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002) #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004) #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008) #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010) #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020) #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040) #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080) #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100) #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200) #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400) #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800) #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000) #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000) #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000) #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000) #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000) /* ATSC/HDTV */ #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) /* some common needed stuff */ #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ V4L2_STD_PAL_B1 |\ V4L2_STD_PAL_G) #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ V4L2_STD_PAL_D1 |\ V4L2_STD_PAL_K) #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ V4L2_STD_PAL_DK |\ V4L2_STD_PAL_H |\ V4L2_STD_PAL_I) #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ V4L2_STD_NTSC_M_JP) #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ V4L2_STD_SECAM_D |\ V4L2_STD_SECAM_G |\ V4L2_STD_SECAM_H |\ V4L2_STD_SECAM_K |\ V4L2_STD_SECAM_K1 |\ V4L2_STD_SECAM_L) #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ V4L2_STD_PAL_60 |\ V4L2_STD_NTSC) #define V4L2_STD_625_50 (V4L2_STD_PAL |\ V4L2_STD_PAL_N |\ V4L2_STD_PAL_Nc |\ V4L2_STD_SECAM) #define V4L2_STD_UNKNOWN 0 #define V4L2_STD_ALL (V4L2_STD_525_60 |\ V4L2_STD_625_50) struct v4l2_standard { __u32 index; v4l2_std_id id; __u8 name[24]; struct v4l2_fract frameperiod; /* Frames, not fields */ __u32 framelines; __u32 reserved[4]; }; /* * V I D E O I N P U T S */ struct v4l2_input { __u32 index; /* Which input */ __u8 name[32]; /* Label */ __u32 type; /* Type of input */ __u32 audioset; /* Associated audios (bitfield) */ __u32 tuner; /* Associated tuner */ v4l2_std_id std; __u32 status; __u32 reserved[4]; }; /* Values for the 'type' field */ #define V4L2_INPUT_TYPE_TUNER 1 #define V4L2_INPUT_TYPE_CAMERA 2 /* field 'status' - general */ #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */ #define V4L2_IN_ST_NO_SIGNAL 0x00000002 #define V4L2_IN_ST_NO_COLOR 0x00000004 /* field 'status' - analog */ #define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */ #define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */ /* field 'status' - digital */ #define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */ #define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */ #define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */ /* field 'status' - VCR and set-top box */ #define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */ #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ /* * V I D E O O U T P U T S */ struct v4l2_output { __u32 index; /* Which output */ __u8 name[32]; /* Label */ __u32 type; /* Type of output */ __u32 audioset; /* Associated audios (bitfield) */ __u32 modulator; /* Associated modulator */ v4l2_std_id std; __u32 reserved[4]; }; /* Values for the 'type' field */ #define V4L2_OUTPUT_TYPE_MODULATOR 1 #define V4L2_OUTPUT_TYPE_ANALOG 2 #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 /* * C O N T R O L S */ struct v4l2_control { __u32 id; __s32 value; }; /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ struct v4l2_queryctrl { __u32 id; enum v4l2_ctrl_type type; __u8 name[32]; /* Whatever */ __s32 minimum; /* Note signedness */ __s32 maximum; __s32 step; __s32 default_value; __u32 flags; __u32 reserved[2]; }; /* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */ struct v4l2_querymenu { __u32 id; __u32 index; __u8 name[32]; /* Whatever */ __u32 reserved; }; /* Control flags */ #define V4L2_CTRL_FLAG_DISABLED 0x0001 #define V4L2_CTRL_FLAG_GRABBED 0x0002 /* Control IDs defined by V4L2 */ #define V4L2_CID_BASE 0x00980900 /* IDs reserved for driver specific controls */ #define V4L2_CID_PRIVATE_BASE 0x08000000 #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) #define V4L2_CID_HUE (V4L2_CID_BASE+3) #define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5) #define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6) #define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7) #define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8) #define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9) #define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10) #define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) #define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12) #define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13) #define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14) #define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15) #define V4L2_CID_GAMMA (V4L2_CID_BASE+16) #define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* ? Not sure */ #define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17) #define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18) #define V4L2_CID_GAIN (V4L2_CID_BASE+19) #define V4L2_CID_HFLIP (V4L2_CID_BASE+20) #define V4L2_CID_VFLIP (V4L2_CID_BASE+21) #define V4L2_CID_HCENTER (V4L2_CID_BASE+22) #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ /* * T U N I N G */ struct v4l2_tuner { __u32 index; __u8 name[32]; enum v4l2_tuner_type type; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 rxsubchans; __u32 audmode; __s32 signal; __s32 afc; __u32 reserved[4]; }; struct v4l2_modulator { __u32 index; __u8 name[32]; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 txsubchans; __u32 reserved[4]; }; /* Flags for the 'capability' field */ #define V4L2_TUNER_CAP_LOW 0x0001 #define V4L2_TUNER_CAP_NORM 0x0002 #define V4L2_TUNER_CAP_STEREO 0x0010 #define V4L2_TUNER_CAP_LANG2 0x0020 #define V4L2_TUNER_CAP_SAP 0x0020 #define V4L2_TUNER_CAP_LANG1 0x0040 /* Flags for the 'rxsubchans' field */ #define V4L2_TUNER_SUB_MONO 0x0001 #define V4L2_TUNER_SUB_STEREO 0x0002 #define V4L2_TUNER_SUB_LANG2 0x0004 #define V4L2_TUNER_SUB_SAP 0x0004 #define V4L2_TUNER_SUB_LANG1 0x0008 /* Values for the 'audmode' field */ #define V4L2_TUNER_MODE_MONO 0x0000 #define V4L2_TUNER_MODE_STEREO 0x0001 #define V4L2_TUNER_MODE_LANG2 0x0002 #define V4L2_TUNER_MODE_SAP 0x0002 #define V4L2_TUNER_MODE_LANG1 0x0003 struct v4l2_frequency { __u32 tuner; enum v4l2_tuner_type type; __u32 frequency; __u32 reserved[8]; }; /* * A U D I O */ struct v4l2_audio { __u32 index; __u8 name[32]; __u32 capability; __u32 mode; __u32 reserved[2]; }; /* Flags for the 'capability' field */ #define V4L2_AUDCAP_STEREO 0x00001 #define V4L2_AUDCAP_AVL 0x00002 /* Flags for the 'mode' field */ #define V4L2_AUDMODE_AVL 0x00001 struct v4l2_audioout { __u32 index; __u8 name[32]; __u32 capability; __u32 mode; __u32 reserved[2]; }; /* * D A T A S E R V I C E S ( V B I ) * * Data services API by Michael Schimek */ struct v4l2_vbi_format { __u32 sampling_rate; /* in 1 Hz */ __u32 offset; __u32 samples_per_line; __u32 sample_format; /* V4L2_PIX_FMT_* */ __s32 start[2]; __u32 count[2]; __u32 flags; /* V4L2_VBI_* */ __u32 reserved[2]; /* must be zero */ }; /* VBI flags */ #define V4L2_VBI_UNSYNC (1<< 0) #define V4L2_VBI_INTERLACED (1<< 1) /* * A G G R E G A T E S T R U C T U R E S */ /* Stream data format */ struct v4l2_format { enum v4l2_buf_type type; union { struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE __u8 raw_data[200]; // user-defined } fmt; }; /* Stream type-dependent parameters */ struct v4l2_streamparm { enum v4l2_buf_type type; union { struct v4l2_captureparm capture; struct v4l2_outputparm output; __u8 raw_data[200]; /* user-defined */ } parm; }; /* * I O C T L C O D E S F O R V I D E O D E V I C E S * */ #define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability) #define VIDIOC_RESERVED _IO ('V', 1) #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) #if 0 #define VIDIOC_G_COMP _IOR ('V', 6, struct v4l2_compression) #define VIDIOC_S_COMP _IOW ('V', 7, struct v4l2_compression) #endif #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) #define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer) #define VIDIOC_OVERLAY _IOW ('V', 14, int) #define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer) #define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer) #define VIDIOC_STREAMON _IOW ('V', 18, int) #define VIDIOC_STREAMOFF _IOW ('V', 19, int) #define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm) #define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm) #define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id) #define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id) #define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard) #define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input) #define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control) #define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control) #define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner) #define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner) #define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio) #define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio) #define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl) #define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu) #define VIDIOC_G_INPUT _IOR ('V', 38, int) #define VIDIOC_S_INPUT _IOWR ('V', 39, int) #define VIDIOC_G_OUTPUT _IOR ('V', 46, int) #define VIDIOC_S_OUTPUT _IOWR ('V', 47, int) #define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output) #define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout) #define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout) #define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator) #define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator) #define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency) #define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency) #define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap) #define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop) #define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop) #define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression) #define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression) #define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id) #define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format) #define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio) #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) /* for compatibility, will go away some day */ #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) #define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control) #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ #endif /* __LINUX_VIDEODEV2_H */ /* * Local variables: * c-basic-offset: 8 * End: */ DirectFB-1.2.10/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_v4l.c0000644000175000017500000013174211245562152024217 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined(__dietlibc__) && !defined(_BSD_SOURCE) #define _BSD_SOURCE #endif #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LINUX_COMPILER_H #include #endif #include "videodev.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef DFB_HAVE_V4L2 #include "videodev2.h" #endif static DFBResult Probe( IDirectFBVideoProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBVideoProvider *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBVideoProvider, V4L ) /* * private data struct of IDirectFBVideoProvider */ typedef struct { int ref; /* reference counter */ char *filename; int fd; #ifdef DFB_HAVE_V4L2 #define NUMBER_OF_BUFFERS 2 bool is_v4l2; struct v4l2_format fmt; struct v4l2_capability caps; struct v4l2_queryctrl brightness; struct v4l2_queryctrl contrast; struct v4l2_queryctrl saturation; struct v4l2_queryctrl hue; struct v4l2_requestbuffers req; struct v4l2_buffer vidbuf[NUMBER_OF_BUFFERS]; char *ptr[NUMBER_OF_BUFFERS]; /* only used for capture to system memory */ bool framebuffer_or_system; #endif struct video_capability vcap; struct video_mmap vmmap; struct video_mbuf vmbuf; void *buffer; bool grab_mode; DirectThread *thread; CoreSurface *destination; CoreSurfaceBufferLock destinationlock; DVFrameCallback callback; void *ctx; CoreCleanup *cleanup; bool running; pthread_mutex_t lock; Reaction reaction; /* for the destination listener */ CoreDFB *core; } IDirectFBVideoProvider_V4L_data; static const unsigned int zero = 0; static const unsigned int one = 1; static void* OverlayThread( DirectThread *thread, void *context ); static void* GrabThread( DirectThread *thread, void *context ); static ReactionResult v4l_videosurface_listener( const void *msg_data, void *ctx ); static ReactionResult v4l_systemsurface_listener( const void *msg_data, void *ctx ); static DFBResult v4l_to_surface_overlay( CoreSurface *surface, DFBRectangle *rect, IDirectFBVideoProvider_V4L_data *data ); static DFBResult v4l_to_surface_grab( CoreSurface *surface, DFBRectangle *rect, IDirectFBVideoProvider_V4L_data *data ); static DFBResult v4l_stop( IDirectFBVideoProvider_V4L_data *data, bool detach ); static void v4l_deinit( IDirectFBVideoProvider_V4L_data *data ); static void v4l_cleanup( void *data, int emergency ); #ifdef DFB_HAVE_V4L2 static DFBResult v4l2_playto( CoreSurface *surface, DFBRectangle *rect, IDirectFBVideoProvider_V4L_data *data ); #endif static void IDirectFBVideoProvider_V4L_Destruct( IDirectFBVideoProvider *thiz ) { IDirectFBVideoProvider_V4L_data *data = (IDirectFBVideoProvider_V4L_data*)thiz->priv; if (data->cleanup) dfb_core_cleanup_remove( NULL, data->cleanup ); v4l_deinit( data ); D_FREE( data->filename ); pthread_mutex_destroy( &data->lock ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBVideoProvider_V4L_AddRef( IDirectFBVideoProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) data->ref++; return DFB_OK; } static DirectResult IDirectFBVideoProvider_V4L_Release( IDirectFBVideoProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (--data->ref == 0) { IDirectFBVideoProvider_V4L_Destruct( thiz ); } return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_GetCapabilities( IDirectFBVideoProvider *thiz, DFBVideoProviderCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!caps) return DFB_INVARG; #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { *caps = 0; data->saturation.id = V4L2_CID_SATURATION; if (ioctl( data->fd, VIDIOC_G_CTRL, &data->saturation )) { *caps |= DVCAPS_SATURATION; } else { data->saturation.id = 0; } data->brightness.id = V4L2_CID_BRIGHTNESS; if (ioctl( data->fd, VIDIOC_G_CTRL, &data->brightness )) { *caps |= DVCAPS_BRIGHTNESS; } else { data->brightness.id = 0; } data->contrast.id = V4L2_CID_CONTRAST; if (ioctl( data->fd, VIDIOC_G_CTRL, &data->contrast )) { *caps |= DVCAPS_CONTRAST; } else { data->contrast.id = 0; } data->hue.id = V4L2_CID_HUE; if (ioctl( data->fd, VIDIOC_G_CTRL, &data->hue )) { *caps |= DVCAPS_HUE; } else { data->hue.id = 0; } /* fixme: interlaced might not be true for field capture */ *caps |= DVCAPS_BASIC | DVCAPS_SCALE | DVCAPS_INTERLACED; } else #endif { *caps = ( DVCAPS_BASIC | DVCAPS_BRIGHTNESS | DVCAPS_CONTRAST | DVCAPS_HUE | DVCAPS_SATURATION | DVCAPS_INTERLACED ); if (data->vcap.type & VID_TYPE_SCALES) *caps |= DVCAPS_SCALE; } return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_GetSurfaceDescription( IDirectFBVideoProvider *thiz, DFBSurfaceDescription *desc ) { IDirectFBVideoProvider_V4L_data *data; if (!thiz || !desc) return DFB_INVARG; data = (IDirectFBVideoProvider_V4L_data*)thiz->priv; if (!data) return DFB_DEAD; desc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS; #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { desc->width = 720; /* fimxe: depends on the selected standard: query standard and set accordingly */ desc->height = 576; } else #endif { desc->width = data->vcap.maxwidth; desc->height = data->vcap.maxheight; } desc->pixelformat = dfb_primary_layer_pixelformat(); desc->caps = DSCAPS_INTERLACED; return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_GetStreamDescription( IDirectFBVideoProvider *thiz, DFBStreamDescription *desc ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!desc) return DFB_INVARG; desc->caps = DVSCAPS_VIDEO; desc->video.encoding[0] = 0; desc->video.framerate = 10; // assume 10fps #ifdef DFB_HAVE_V4L2 desc->video.aspect = 720.0/576.0; #else desc->video.aspect = (double)data->vcap.maxwidth / (double)data->vcap.maxheight; #endif desc->video.bitrate = 0; desc->title[0] = desc->author[0] = desc->album[0] = desc->year = desc->genre[0] = desc->comment[0] = 0; return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_PlayTo( IDirectFBVideoProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dstrect, DVFrameCallback callback, void *ctx ) { DFBRectangle rect; IDirectFBSurface_data *dst_data; CoreSurface *surface = 0; DFBResult ret; DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!destination) return DFB_INVARG; dst_data = (IDirectFBSurface_data*)destination->priv; if (!dst_data) return DFB_DEAD; if (!dst_data->area.current.w || !dst_data->area.current.h) return DFB_INVAREA; if (dstrect) { if (dstrect->w < 1 || dstrect->h < 1) return DFB_INVARG; rect = *dstrect; rect.x += dst_data->area.wanted.x; rect.y += dst_data->area.wanted.y; } else rect = dst_data->area.wanted; if (!dfb_rectangle_intersect( &rect, &dst_data->area.current )) return DFB_INVAREA; v4l_stop( data, true ); pthread_mutex_lock( &data->lock ); data->callback = callback; data->ctx = ctx; surface = dst_data->surface; #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { ret = v4l2_playto( surface, &rect, data ); } else #endif { data->grab_mode = false; if (getenv( "DFB_V4L_GRAB" ) || (surface->config.caps & DSCAPS_SYSTEMONLY) || (surface->config.caps & DSCAPS_FLIPPING) || !(VID_TYPE_OVERLAY & data->vcap.type)) data->grab_mode = true; else { /* * Because we're constantly writing to the surface we * permanently lock it. */ ret = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_GPU_WRITE, &data->destinationlock ); if (ret) { pthread_mutex_unlock( &data->lock ); return ret; } } if (data->grab_mode) ret = v4l_to_surface_grab( surface, &rect, data ); else ret = v4l_to_surface_overlay( surface, &rect, data ); } if (ret && !data->grab_mode) dfb_surface_unlock_buffer( surface, &data->destinationlock ); pthread_mutex_unlock( &data->lock ); return ret; } static DFBResult IDirectFBVideoProvider_V4L_Stop( IDirectFBVideoProvider *thiz ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) return v4l_stop( data, true ); } static DFBResult IDirectFBVideoProvider_V4L_GetStatus( IDirectFBVideoProvider *thiz, DFBVideoProviderStatus *status ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!status) return DFB_INVARG; *status = data->running ? DVSTATE_PLAY : DVSTATE_STOP; return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_SeekTo( IDirectFBVideoProvider *thiz, double seconds ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBVideoProvider_V4L_GetPos( IDirectFBVideoProvider *thiz, double *seconds ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) return DFB_UNSUPPORTED; } static DFBResult IDirectFBVideoProvider_V4L_GetLength( IDirectFBVideoProvider *thiz, double *seconds ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) return DFB_UNSUPPORTED; } static DFBResult IDirectFBVideoProvider_V4L_GetColorAdjustment( IDirectFBVideoProvider *thiz, DFBColorAdjustment *adj ) { struct video_picture pic; DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!adj) return DFB_INVARG; #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { struct v4l2_control ctrl; if (data->brightness.id) { ctrl.id = data->brightness.id; if (!ioctl( data->fd, VIDIOC_G_CTRL, &ctrl )) { adj->flags |= DCAF_BRIGHTNESS; adj->brightness = 0xffff * ctrl.value / (data->brightness.maximum - data->brightness.minimum); } } if (data->contrast.id) { ctrl.id = data->contrast.id; if (!ioctl( data->fd, VIDIOC_G_CTRL, &ctrl )) { adj->flags |= DCAF_CONTRAST; adj->contrast = 0xffff * ctrl.value / (data->contrast.maximum - data->contrast.minimum); } } if (data->hue.id) { ctrl.id = data->hue.id; if (!ioctl( data->fd, VIDIOC_G_CTRL, &ctrl )) { adj->flags |= DCAF_HUE; adj->hue = 0xffff * ctrl.value / (data->hue.maximum - data->hue.minimum); } } if (data->saturation.id) { ctrl.id = data->saturation.id; if (!ioctl( data->fd, VIDIOC_G_CTRL, &ctrl )) { adj->flags |= DCAF_SATURATION; adj->saturation = 0xffff * ctrl.value / (data->saturation.maximum - data->saturation.minimum); } } } else #endif { ioctl( data->fd, VIDIOCGPICT, &pic ); adj->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_HUE | DCAF_SATURATION; adj->brightness = pic.brightness; adj->contrast = pic.contrast; adj->hue = pic.hue; adj->saturation = pic.colour; } return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_SetColorAdjustment( IDirectFBVideoProvider *thiz, const DFBColorAdjustment *adj ) { struct video_picture pic; DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) if (!adj) return DFB_INVARG; if (adj->flags == DCAF_NONE) return DFB_OK; #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { struct v4l2_control ctrl; if ((adj->flags & DCAF_BRIGHTNESS) && data->brightness.id) { ctrl.id = data->brightness.id; ctrl.value = (adj->brightness * (data->brightness.maximum - data->brightness.minimum)) / 0xfff; ioctl( data->fd, VIDIOC_S_CTRL, &ctrl ); } if ((adj->flags & DCAF_CONTRAST) && data->contrast.id) { ctrl.id = data->contrast.id; ctrl.value = (adj->contrast * (data->contrast.maximum - data->contrast.minimum)) / 0xfff; ioctl( data->fd, VIDIOC_S_CTRL, &ctrl ); } if ((adj->flags & DCAF_HUE) && data->hue.id) { ctrl.id = data->hue.id; ctrl.value = (adj->hue * (data->hue.maximum - data->hue.minimum)) / 0xfff; ioctl( data->fd, VIDIOC_S_CTRL, &ctrl ); } if ((adj->flags & DCAF_SATURATION) && data->saturation.id) { ctrl.id = data->saturation.id; ctrl.value = (adj->saturation * (data->saturation.maximum - data->saturation.minimum)) / 0xfff; ioctl( data->fd, VIDIOC_S_CTRL, &ctrl ); } } else #endif { if (ioctl( data->fd, VIDIOCGPICT, &pic ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: VIDIOCGPICT failed!\n" ); return ret; } if (adj->flags & DCAF_BRIGHTNESS) pic.brightness = adj->brightness; if (adj->flags & DCAF_CONTRAST) pic.contrast = adj->contrast; if (adj->flags & DCAF_HUE) pic.hue = adj->hue; if (adj->flags & DCAF_SATURATION) pic.colour = adj->saturation; if (ioctl( data->fd, VIDIOCSPICT, &pic ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: VIDIOCSPICT failed!\n" ); return ret; } } return DFB_OK; } static DFBResult IDirectFBVideoProvider_V4L_SendEvent( IDirectFBVideoProvider *thiz, const DFBEvent *evt ) { DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L) return DFB_UNSUPPORTED; } /* exported symbols */ static DFBResult Probe( IDirectFBVideoProvider_ProbeContext *ctx ) { if (ctx->filename) { if (strncmp( ctx->filename, "/dev/video", 10 ) == 0) return DFB_OK; if (strncmp( ctx->filename, "/dev/v4l/video", 14 ) == 0) return DFB_OK; } return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBVideoProvider *thiz, ... ) { int fd; IDirectFBDataBuffer *buffer; IDirectFBDataBuffer_data *buffer_data; CoreDFB *core; va_list tag; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBVideoProvider_V4L) va_start( tag, thiz ); buffer = va_arg( tag, IDirectFBDataBuffer * ); core = va_arg( tag, CoreDFB * ); va_end( tag ); data->ref = 1; data->core = core; buffer_data = (IDirectFBDataBuffer_data*) buffer->priv; fd = open( buffer_data->filename, O_RDWR ); if (fd < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: Cannot open `%s'!\n", buffer_data->filename ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } direct_util_recursive_pthread_mutex_init( &data->lock ); #ifdef DFB_HAVE_V4L2 data->is_v4l2 = 0; /* look if the device is a v4l2 device */ if (!ioctl( fd, VIDIOC_QUERYCAP, &data->caps )) { D_INFO( "DirectFB/Video4Linux: This is a Video4Linux-2 device.\n" ); data->is_v4l2 = 1; } if (data->is_v4l2) { /* hmm, anything to do here? */ } else #endif { D_INFO( "DirectFB/Video4Linux: This is a Video4Linux-1 device.\n" ); ioctl( fd, VIDIOCGCAP, &data->vcap ); ioctl( fd, VIDIOCCAPTURE, &zero ); ioctl( fd, VIDIOCGMBUF, &data->vmbuf ); data->buffer = mmap( NULL, data->vmbuf.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 ); } data->filename = D_STRDUP( buffer_data->filename ); data->fd = fd; thiz->AddRef = IDirectFBVideoProvider_V4L_AddRef; thiz->Release = IDirectFBVideoProvider_V4L_Release; thiz->GetCapabilities = IDirectFBVideoProvider_V4L_GetCapabilities; thiz->GetSurfaceDescription = IDirectFBVideoProvider_V4L_GetSurfaceDescription; thiz->GetStreamDescription = IDirectFBVideoProvider_V4L_GetStreamDescription; thiz->PlayTo = IDirectFBVideoProvider_V4L_PlayTo; thiz->Stop = IDirectFBVideoProvider_V4L_Stop; thiz->GetStatus = IDirectFBVideoProvider_V4L_GetStatus; thiz->SeekTo = IDirectFBVideoProvider_V4L_SeekTo; thiz->GetPos = IDirectFBVideoProvider_V4L_GetPos; thiz->GetLength = IDirectFBVideoProvider_V4L_GetLength; thiz->GetColorAdjustment = IDirectFBVideoProvider_V4L_GetColorAdjustment; thiz->SetColorAdjustment = IDirectFBVideoProvider_V4L_SetColorAdjustment; thiz->SendEvent = IDirectFBVideoProvider_V4L_SendEvent; return DFB_OK; } /*****************/ /* * bogus thread to generate callback, * because video4linux does not support syncing in overlay mode */ static void * OverlayThread( DirectThread *thread, void *ctx ) { IDirectFBVideoProvider_V4L_data *data = (IDirectFBVideoProvider_V4L_data*)ctx; int field = 0; struct timeval tv; while (data->running) { tv.tv_sec = 0; tv.tv_usec = 20000; select( 0, 0, 0, 0, &tv ); if (!data->running) break; if (data->destination && (data->destination->config.caps & DSCAPS_INTERLACED)) { dfb_surface_set_field( data->destination, field ); field = !field; } if (!data->running) break; if (data->callback) data->callback( data->ctx ); } return NULL; } /* * thread to capture data from v4l buffers and generate callback */ static void * GrabThread( DirectThread *thread, void *ctx ) { IDirectFBVideoProvider_V4L_data *data = (IDirectFBVideoProvider_V4L_data*)ctx; CoreSurface *surface = data->destination; void *src, *dst; int dst_pitch, src_pitch, h; int frame = 0; D_DEBUG( "DirectFB/Video4Linux: %s started.\n", __FUNCTION__ ); src_pitch = DFB_BYTES_PER_LINE( surface->config.format, surface->config.size.w ); while (frame < data->vmbuf.frames) { data->vmmap.frame = frame; ioctl( data->fd, VIDIOCMCAPTURE, &data->vmmap ); frame++; } if (dfb_surface_ref( surface )) { D_ERROR( "DirectFB/Video4Linux: dfb_surface_ref() failed!\n" ); return NULL; } frame = 0; while (data->running) { ioctl( data->fd, VIDIOCSYNC, &frame ); if (!data->running) break; h = surface->config.size.h; src = data->buffer + data->vmbuf.offsets[frame]; dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_CPU_WRITE, &data->destinationlock ); dst = data->destinationlock.addr; dst_pitch = data->destinationlock.pitch; while (h--) { direct_memcpy( dst, src, src_pitch ); dst += dst_pitch; src += src_pitch; } if (surface->config.format == DSPF_I420) { h = surface->config.size.h; while (h--) { direct_memcpy( dst, src, src_pitch >> 1 ); dst += dst_pitch >> 1; src += src_pitch >> 1; } } else if (surface->config.format == DSPF_YV12) { h = surface->config.size.h >> 1; src += h * (src_pitch >> 1); while (h--) { direct_memcpy( dst, src, src_pitch >> 1 ); dst += dst_pitch >> 1; src += src_pitch >> 1; } h = surface->config.size.h >> 1; src -= 2 * h * (src_pitch >> 1); while (h--) { direct_memcpy( dst, src, src_pitch >> 1 ); dst += dst_pitch >> 1; src += src_pitch >> 1; } } dfb_surface_unlock_buffer( surface, &data->destinationlock ); data->vmmap.frame = frame; ioctl( data->fd, VIDIOCMCAPTURE, &data->vmmap ); if (!data->running) break; if (surface->config.caps & DSCAPS_INTERLACED) dfb_surface_set_field( surface, 0 ); if (data->callback) data->callback( data->ctx ); if (!data->running) break; sched_yield(); if (surface->config.caps & DSCAPS_INTERLACED) { if (!data->running) break; dfb_surface_set_field( surface, 1 ); if (data->callback) data->callback( data->ctx ); if (!data->running) break; sched_yield(); } if (++frame == data->vmbuf.frames) frame = 0; } dfb_surface_unref( surface ); return NULL; } static ReactionResult v4l_videosurface_listener( const void *msg_data, void *ctx ) { // const CoreSurfaceNotification *notification = msg_data; // IDirectFBVideoProvider_V4L_data *data = ctx; // CoreSurface *surface = notification->surface; /* if ((notification->flags & CSNF_SIZEFORMAT) || (surface->back_buffer->video.health != CSH_STORED)) { v4l_stop( data, false ); return RS_REMOVE; } */ return RS_OK; } static ReactionResult v4l_systemsurface_listener( const void *msg_data, void *ctx ) { // const CoreSurfaceNotification *notification = msg_data; // IDirectFBVideoProvider_V4L_data *data = ctx; // CoreSurface *surface = notification->surface; /* if ((notification->flags & CSNF_SIZEFORMAT) || (surface->back_buffer->system.health != CSH_STORED && surface->back_buffer->video.health != CSH_STORED)) { v4l_stop( data, false ); return RS_REMOVE; } */ return RS_OK; } /************/ static DFBResult v4l_to_surface_overlay( CoreSurface *surface, DFBRectangle *rect, IDirectFBVideoProvider_V4L_data *data ) { int bpp, palette; D_DEBUG( "DirectFB/Video4Linux: %s (%p, %d,%d - %dx%d)\n", __FUNCTION__, surface, rect->x, rect->y, rect->w, rect->h ); /* * Sanity check. Overlay to system surface isn't possible. */ if (surface->config.caps & DSCAPS_SYSTEMONLY) return DFB_UNSUPPORTED; switch (surface->config.format) { case DSPF_YUY2: bpp = 16; palette = VIDEO_PALETTE_YUYV; break; case DSPF_UYVY: bpp = 16; palette = VIDEO_PALETTE_UYVY; break; case DSPF_I420: bpp = 8; palette = VIDEO_PALETTE_YUV420P; break; case DSPF_ARGB1555: bpp = 15; palette = VIDEO_PALETTE_RGB555; break; case DSPF_RGB16: bpp = 16; palette = VIDEO_PALETTE_RGB565; break; case DSPF_RGB24: bpp = 24; palette = VIDEO_PALETTE_RGB24; break; case DSPF_ARGB: case DSPF_AiRGB: case DSPF_RGB32: bpp = 32; palette = VIDEO_PALETTE_RGB32; break; default: return DFB_UNSUPPORTED; } { struct video_buffer b; /* in overlay mode, the destinationlock is already taken * and pointing to the back buffer */ CoreSurfaceBufferLock *lock = &data->destinationlock; b.base = (void*)dfb_gfxcard_memory_physical( NULL, lock->offset ); b.width = lock->pitch / ((bpp + 7) / 8); b.height = surface->config.size.h; b.depth = bpp; b.bytesperline = lock->pitch; if (ioctl( data->fd, VIDIOCSFBUF, &b ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: VIDIOCSFBUF failed, must run being root!\n" ); return ret; } } { struct video_picture p; if (ioctl( data->fd, VIDIOCGPICT, &p ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: VIDIOCGPICT failed!\n" ); return ret; } p.depth = bpp; p.palette = palette; if (ioctl( data->fd, VIDIOCSPICT, &p ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: VIDIOCSPICT failed!\n" ); return ret; } } { struct video_window win; win.width = rect->w; win.height = rect->h; win.x = rect->x; win.y = rect->y; win.flags = 0; win.clips = NULL; win.clipcount = 0; win.chromakey = 0; if (ioctl( data->fd, VIDIOCSWIN, &win ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: VIDIOCSWIN failed!\n" ); return ret; } } if (!data->cleanup) data->cleanup = dfb_core_cleanup_add( NULL, v4l_cleanup, data, true ); if (ioctl( data->fd, VIDIOCCAPTURE, &one ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: Could not start capturing (VIDIOCCAPTURE failed)!\n" ); return ret; } data->destination = surface; dfb_surface_attach( surface, v4l_videosurface_listener, data, &data->reaction ); data->running = true; if (data->callback || (surface->config.caps & DSCAPS_INTERLACED)) data->thread = direct_thread_create( DTT_CRITICAL, OverlayThread, data, "V4L Overlay" ); return DFB_OK; } static DFBResult v4l_to_surface_grab( CoreSurface *surface, DFBRectangle *rect, IDirectFBVideoProvider_V4L_data *data ) { int palette; D_DEBUG( "DirectFB/Video4Linux: %s...\n", __FUNCTION__ ); if (!data->vmbuf.frames) return DFB_UNSUPPORTED; switch (surface->config.format) { case DSPF_YUY2: palette = VIDEO_PALETTE_YUYV; break; case DSPF_UYVY: palette = VIDEO_PALETTE_UYVY; break; case DSPF_I420: case DSPF_YV12: palette = VIDEO_PALETTE_YUV420P; break; case DSPF_ARGB1555: palette = VIDEO_PALETTE_RGB555; break; case DSPF_RGB16: palette = VIDEO_PALETTE_RGB565; break; case DSPF_RGB24: palette = VIDEO_PALETTE_RGB24; break; case DSPF_ARGB: case DSPF_AiRGB: case DSPF_RGB32: palette = VIDEO_PALETTE_RGB32; break; default: return DFB_UNSUPPORTED; } data->vmmap.width = surface->config.size.w; data->vmmap.height = surface->config.size.h; data->vmmap.format = palette; data->vmmap.frame = 0; if (ioctl( data->fd, VIDIOCMCAPTURE, &data->vmmap ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux: Could not start capturing (VIDIOCMCAPTURE failed)!\n" ); return ret; } if (!data->cleanup) data->cleanup = dfb_core_cleanup_add( NULL, v4l_cleanup, data, true ); data->destination = surface; dfb_surface_attach( surface, v4l_systemsurface_listener, data, &data->reaction ); data->running = true; data->thread = direct_thread_create( DTT_INPUT, GrabThread, data, "V4L Grabber" ); return DFB_OK; } static DFBResult v4l_stop( IDirectFBVideoProvider_V4L_data *data, bool detach ) { CoreSurface *destination; D_DEBUG( "DirectFB/Video4Linux: %s...\n", __FUNCTION__ ); pthread_mutex_lock( &data->lock ); if (!data->running) { pthread_mutex_unlock( &data->lock ); return DFB_OK; } if (data->thread) { data->running = false; direct_thread_join( data->thread ); direct_thread_destroy( data->thread ); data->thread = NULL; } #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { /* turn off streaming */ int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; int err = ioctl( data->fd, VIDIOC_STREAMOFF, &type ); if (err) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_STREAMOFF.\n" ); /* don't quit here */ } } else #endif { if (!data->grab_mode) { if (ioctl( data->fd, VIDIOCCAPTURE, &zero ) < 0) D_PERROR( "DirectFB/Video4Linux: " "Could not stop capturing (VIDIOCCAPTURE failed)!\n" ); } } destination = data->destination; if (!destination) { pthread_mutex_unlock( &data->lock ); return DFB_OK; } #ifdef DFB_HAVE_V4L2 if (data->is_v4l2) { /* unmap all buffers, if necessary */ if (data->framebuffer_or_system) { int i; for (i = 0; i < data->req.count; i++) { struct v4l2_buffer *vidbuf = &data->vidbuf[i]; D_DEBUG( "DirectFB/Video4Linux2: %d => 0x%08x, len:%d\n", i, (u32) data->ptr[i], vidbuf->length ); if (munmap( data->ptr[i], vidbuf->length )) { D_PERROR( "DirectFB/Video4Linux2: munmap().\n" ); } } } else { dfb_surface_unlock_buffer( destination, &data->destinationlock ); } } else #endif { if (!data->grab_mode) dfb_surface_unlock_buffer( destination, &data->destinationlock ); } data->destination = NULL; pthread_mutex_unlock( &data->lock ); if (detach) dfb_surface_detach( destination, &data->reaction ); return DFB_OK; } static void v4l_deinit( IDirectFBVideoProvider_V4L_data *data ) { if (data->fd == -1) { D_BUG( "v4l_deinit with 'fd == -1'" ); return; } v4l_stop( data, true ); munmap( data->buffer, data->vmbuf.size ); close( data->fd ); data->fd = -1; } static void v4l_cleanup( void *ctx, int emergency ) { IDirectFBVideoProvider_V4L_data *data = (IDirectFBVideoProvider_V4L_data*)ctx; if (emergency) v4l_stop( data, false ); else v4l_deinit( data ); } /* v4l2 specific stuff */ #ifdef DFB_HAVE_V4L2 static int wait_for_buffer( int vid, struct v4l2_buffer *cur ) { fd_set rdset; struct timeval timeout; int n, err; // D_DEBUG("DirectFB/Video4Linux2: %s...\n", __FUNCTION__); cur->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; FD_ZERO( &rdset ); FD_SET( vid, &rdset ); timeout.tv_sec = 5; timeout.tv_usec = 0; n = select( vid + 1, &rdset, NULL, NULL, &timeout ); if (n == -1) { D_PERROR( "DirectFB/Video4Linux2: select().\n" ); return -1; /* fixme */ } else if (n == 0) { D_PERROR( "DirectFB/Video4Linux2: select(), timeout.\n" ); return -1; /* fixme */ } else if (FD_ISSET( vid, &rdset )) { err = ioctl( vid, VIDIOC_DQBUF, cur ); if (err) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_DQBUF.\n" ); return -1; /* fixme */ } } return 0; } static void * V4L2_Thread( DirectThread *thread, void *ctx ) { int type = V4L2_BUF_TYPE_VIDEO_CAPTURE; int i, err; IDirectFBVideoProvider_V4L_data *data = (IDirectFBVideoProvider_V4L_data *) ctx; CoreSurface *surface = data->destination; void *src, *dst; int dst_pitch, src_pitch, h; D_DEBUG( "DirectFB/Video4Linux2: %s started.\n", __FUNCTION__ ); src_pitch = DFB_BYTES_PER_LINE( surface->config.format, surface->config.size.w ); /* Queue all buffers */ for (i = 0; i < data->req.count; i++) { struct v4l2_buffer *vidbuf = &data->vidbuf[i]; if (!data->framebuffer_or_system) { vidbuf->m.offset = data->destinationlock.offset; } err = ioctl( data->fd, VIDIOC_QBUF, vidbuf ); if (err) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_QBUF.\n" ); return NULL; } } /* start streaming */ if (ioctl( data->fd, VIDIOC_STREAMON, &type )) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_STREAMON.\n" ); return NULL; /* fixme */ } while (data->running) { struct v4l2_buffer cur; if (wait_for_buffer( data->fd, &cur )) { return NULL; } if (data->framebuffer_or_system) { CoreSurfaceBufferLock lock; D_DEBUG( "DirectFB/Video4Linux2: index:%d, to system memory.\n", cur.index ); h = surface->config.size.h; src = data->ptr[cur.index]; dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); dst = lock.addr; dst_pitch = lock.pitch; while (h--) { direct_memcpy( dst, src, src_pitch ); dst += dst_pitch; src += src_pitch; } if (surface->config.format == DSPF_I420) { h = surface->config.size.h; while (h--) { direct_memcpy( dst, src, src_pitch >> 1 ); dst += dst_pitch >> 1; src += src_pitch >> 1; } } else if (surface->config.format == DSPF_YV12) { h = surface->config.size.h >> 1; src += h * (src_pitch >> 1); while (h--) { direct_memcpy( dst, src, src_pitch >> 1 ); dst += dst_pitch >> 1; src += src_pitch >> 1; } h = surface->config.size.h >> 1; src -= 2 * h * (src_pitch >> 1); while (h--) { direct_memcpy( dst, src, src_pitch >> 1 ); dst += dst_pitch >> 1; src += src_pitch >> 1; } } else if (surface->config.format == DSPF_NV12 || surface->config.format == DSPF_NV21) { h = surface->config.size.h >> 1; while (h--) { direct_memcpy( dst, src, src_pitch ); dst += dst_pitch; src += src_pitch; } } dfb_surface_unlock_buffer( surface, &lock ); } else { D_DEBUG( "DirectFB/Video4Linux2: index:%d, to overlay surface\n", cur.index ); } if (data->callback) data->callback( data->ctx ); if (ioctl( data->fd, VIDIOC_QBUF, &cur )) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_QBUF.\n" ); return NULL; } } return NULL; } static DFBResult v4l2_playto( CoreSurface *surface, DFBRectangle *rect, IDirectFBVideoProvider_V4L_data *data ) { int palette; int err; int i; D_DEBUG( "DirectFB/Video4Linux2: %s...\n", __FUNCTION__ ); switch (surface->config.format) { case DSPF_YUY2: palette = V4L2_PIX_FMT_YUYV; break; case DSPF_UYVY: palette = V4L2_PIX_FMT_UYVY; break; case DSPF_I420: palette = V4L2_PIX_FMT_YUV420; break; case DSPF_YV12: palette = V4L2_PIX_FMT_YVU420; break; case DSPF_NV12: palette = V4L2_PIX_FMT_NV12; break; case DSPF_NV21: palette = V4L2_PIX_FMT_NV21; break; case DSPF_RGB332: palette = V4L2_PIX_FMT_RGB332; break; case DSPF_ARGB1555: palette = V4L2_PIX_FMT_RGB555; break; case DSPF_RGB16: palette = V4L2_PIX_FMT_RGB565; break; case DSPF_RGB24: palette = V4L2_PIX_FMT_BGR24; break; case DSPF_ARGB: case DSPF_AiRGB: case DSPF_RGB32: palette = V4L2_PIX_FMT_BGR32; break; default: return DFB_UNSUPPORTED; } err = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_GPU_WRITE, &data->destinationlock ); if (err) return err; data->fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; data->fmt.fmt.pix.width = surface->config.size.w; data->fmt.fmt.pix.height = surface->config.size.h; data->fmt.fmt.pix.pixelformat = palette; data->fmt.fmt.pix.bytesperline = data->destinationlock.pitch; data->fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; /* fixme: we can do field based capture, too */ D_DEBUG( "DirectFB/Video4Linux2: surface->config.size.w:%d, surface->config.size.h:%d.\n", surface->config.size.w, surface->config.size.h ); err = ioctl( data->fd, VIDIOC_S_FMT, &data->fmt ); if (err) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_S_FMT.\n" ); dfb_surface_unlock_buffer( surface, &data->destinationlock ); return err; } if (data->fmt.fmt.pix.width != surface->config.size.w || data->fmt.fmt.pix.height != surface->config.size.h) { D_PERROR( "DirectFB/Video4Linux2: driver cannot fulfill application request.\n" ); dfb_surface_unlock_buffer( surface, &data->destinationlock ); return DFB_UNSUPPORTED; /* fixme */ } if (data->brightness.id) { ioctl( data->fd, VIDIOC_G_CTRL, &data->brightness ); } if (data->contrast.id) { ioctl( data->fd, VIDIOC_G_CTRL, &data->contrast ); } if (data->saturation.id) { ioctl( data->fd, VIDIOC_G_CTRL, &data->saturation ); } if (data->hue.id) { ioctl( data->fd, VIDIOC_G_CTRL, &data->hue ); } if (surface->config.caps & DSCAPS_SYSTEMONLY) { data->framebuffer_or_system = 1; data->req.memory = V4L2_MEMORY_MMAP; dfb_surface_unlock_buffer( surface, &data->destinationlock ); } else { struct v4l2_framebuffer fb; data->framebuffer_or_system = 0; data->req.memory = V4L2_MEMORY_OVERLAY; fb.base = (void *) dfb_gfxcard_memory_physical( NULL, 0 ); fb.fmt.width = surface->config.size.w; fb.fmt.height = surface->config.size.h; fb.fmt.pixelformat = palette; D_DEBUG( "w:%d, h:%d, bpl:%d, base:0x%08lx\n", fb.fmt.width, fb.fmt.height, fb.fmt.bytesperline, (unsigned long)fb.base ); if (ioctl( data->fd, VIDIOC_S_FBUF, &fb ) < 0) { DFBResult ret = errno2result( errno ); D_PERROR( "DirectFB/Video4Linux2: VIDIOC_S_FBUF failed, must run being root!\n" ); dfb_surface_unlock_buffer( surface, &data->destinationlock ); return ret; } } /* Ask Video Device for Buffers */ data->req.count = NUMBER_OF_BUFFERS; data->req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; err = ioctl( data->fd, VIDIOC_REQBUFS, &data->req ); if (err < 0 || data->req.count < NUMBER_OF_BUFFERS) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_REQBUFS: %d, %d.\n", err, data->req.count ); if (!data->framebuffer_or_system) dfb_surface_unlock_buffer( surface, &data->destinationlock ); return err; } /* Query each buffer and map it to the video device if necessary */ for (i = 0; i < data->req.count; i++) { struct v4l2_buffer *vidbuf = &data->vidbuf[i]; vidbuf->index = i; vidbuf->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; err = ioctl( data->fd, VIDIOC_QUERYBUF, vidbuf ); if (err < 0) { D_PERROR( "DirectFB/Video4Linux2: VIDIOC_QUERYBUF.\n" ); if (!data->framebuffer_or_system) dfb_surface_unlock_buffer( surface, &data->destinationlock ); return err; } /* if (vidbuf->length == 0) { D_PERROR( "DirectFB/Video4Linux2: length is zero!\n" ); return -EINVAL; } */ if (data->framebuffer_or_system) { data->ptr[i] = mmap( 0, vidbuf->length, PROT_READ | PROT_WRITE, MAP_SHARED, data->fd, vidbuf->m.offset ); if (data->ptr[i] == MAP_FAILED) { D_PERROR( "DirectFB/Video4Linux2: mmap().\n" ); if (!data->framebuffer_or_system) dfb_surface_unlock_buffer( surface, &data->destinationlock ); return err; } } D_DEBUG( "DirectFB/Video4Linux2: len:0x%08x, %d => 0x%08x\n", vidbuf->length, i, (u32) data->ptr[i] ); } if (!data->cleanup) data->cleanup = dfb_core_cleanup_add( NULL, v4l_cleanup, data, true ); data->destination = surface; dfb_surface_attach( surface, v4l_systemsurface_listener, data, &data->reaction ); data->running = true; data->thread = direct_thread_create( DTT_DEFAULT, V4L2_Thread, data, "Video4Linux 2" ); return DFB_OK; } #endif DirectFB-1.2.10/interfaces/Makefile.am0000644000175000017500000000017011164361026014313 00000000000000## Makefile.am for DirectFB/interfaces SUBDIRS = \ IDirectFBFont \ IDirectFBImageProvider \ IDirectFBVideoProvider DirectFB-1.2.10/interfaces/Makefile.in0000644000175000017500000004047311307521503014333 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = interfaces DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = \ IDirectFBFont \ IDirectFBImageProvider \ IDirectFBVideoProvider all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu interfaces/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu interfaces/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/interfaces/IDirectFBFont/0000777000175000017500000000000011307522566014736 500000000000000DirectFB-1.2.10/interfaces/IDirectFBFont/idirectfbfont_ft2.c0000644000175000017500000006770311245562152020424 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef SIZEOF_LONG #include #include FT_GLYPH_H #ifndef FT_LOAD_TARGET_MONO /* FT_LOAD_TARGET_MONO was added in FreeType-2.1.3, we have to use (less good) FT_LOAD_MONOCHROME with older versions. Make it an alias for code simplicity. */ #define FT_LOAD_TARGET_MONO FT_LOAD_MONOCHROME #endif static DFBResult Probe( IDirectFBFont_ProbeContext *ctx ); static DFBResult Construct( IDirectFBFont *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, FT2 ) static FT_Library library = NULL; static int library_ref_count = 0; static pthread_mutex_t library_mutex = PTHREAD_MUTEX_INITIALIZER; #define KERNING_CACHE_MIN 0 #define KERNING_CACHE_MAX 127 #define KERNING_CACHE_SIZE (KERNING_CACHE_MAX - KERNING_CACHE_MIN + 1) #define KERNING_DO_CACHE(a,b) ((a) >= KERNING_CACHE_MIN && \ (a) <= KERNING_CACHE_MAX && \ (b) >= KERNING_CACHE_MIN && \ (b) <= KERNING_CACHE_MAX) #define KERNING_CACHE_ENTRY(a,b) \ (data->kerning[(a)-KERNING_CACHE_MIN][(b)-KERNING_CACHE_MIN]) #define CHAR_INDEX(c) (((c) < 256) ? data->indices[c] : FT_Get_Char_Index( data->face, c )) typedef struct { FT_Face face; int disable_charmap; int fixed_advance; bool fixed_clip; unsigned int indices[256]; } FT2ImplData; typedef struct { signed char x; signed char y; } KerningCacheEntry; typedef struct { FT2ImplData base; KerningCacheEntry kerning[KERNING_CACHE_SIZE][KERNING_CACHE_SIZE]; } FT2ImplKerningData; /**********************************************************************************************************************/ static DFBResult ft2UTF8GetCharacterIndex( CoreFont *thiz, unsigned int character, unsigned int *ret_index ) { FT2ImplData *data = thiz->impl_data; D_MAGIC_ASSERT( thiz, CoreFont ); if (data->disable_charmap) *ret_index = character; else { pthread_mutex_lock ( &library_mutex ); *ret_index = CHAR_INDEX( character ); pthread_mutex_unlock ( &library_mutex ); } return DFB_OK; } static DFBResult ft2UTF8DecodeText( CoreFont *thiz, const void *text, int length, unsigned int *ret_indices, int *ret_num ) { int pos = 0, num = 0; const u8 *bytes = text; FT2ImplData *data = thiz->impl_data; D_MAGIC_ASSERT( thiz, CoreFont ); D_ASSERT( text != NULL ); D_ASSERT( length >= 0 ); D_ASSERT( ret_indices != NULL ); D_ASSERT( ret_num != NULL ); pthread_mutex_lock ( &library_mutex ); while (pos < length) { unsigned int c; if (bytes[pos] < 128) c = bytes[pos++]; else { c = DIRECT_UTF8_GET_CHAR( &bytes[pos] ); pos += DIRECT_UTF8_SKIP(bytes[pos]); } if (data->disable_charmap) ret_indices[num++] = c; else ret_indices[num++] = CHAR_INDEX( c ); } pthread_mutex_unlock ( &library_mutex ); *ret_num = num; return DFB_OK; } static const CoreFontEncodingFuncs ft2UTF8Funcs = { .GetCharacterIndex = ft2UTF8GetCharacterIndex, .DecodeText = ft2UTF8DecodeText, }; /**********************************************************************************************************************/ static DFBResult ft2Latin1GetCharacterIndex( CoreFont *thiz, unsigned int character, unsigned int *ret_index ) { FT2ImplData *data = thiz->impl_data; D_MAGIC_ASSERT( thiz, CoreFont ); if (data->disable_charmap) *ret_index = character; else *ret_index = data->indices[character]; return DFB_OK; } static DFBResult ft2Latin1DecodeText( CoreFont *thiz, const void *text, int length, unsigned int *ret_indices, int *ret_num ) { int i; const u8 *bytes = text; FT2ImplData *data = thiz->impl_data; D_MAGIC_ASSERT( thiz, CoreFont ); D_ASSERT( text != NULL ); D_ASSERT( length >= 0 ); D_ASSERT( ret_indices != NULL ); D_ASSERT( ret_num != NULL ); if (data->disable_charmap) { for (i=0; iindices[bytes[i]]; } *ret_num = length; return DFB_OK; } static const CoreFontEncodingFuncs ft2Latin1Funcs = { .GetCharacterIndex = ft2Latin1GetCharacterIndex, .DecodeText = ft2Latin1DecodeText, }; /**********************************************************************************************************************/ static DFBResult render_glyph( CoreFont *thiz, unsigned int index, CoreGlyphData *info ) { FT_Error err; FT_Face face; FT_Int load_flags; u8 *src; int y; FT2ImplData *data = thiz->impl_data; CoreSurface *surface = info->surface; CoreSurfaceBufferLock lock; pthread_mutex_lock ( &library_mutex ); face = data->face; load_flags = (unsigned long) face->generic.data; load_flags |= FT_LOAD_RENDER; if ((err = FT_Load_Glyph( face, index, load_flags ))) { D_DEBUG( "DirectFB/FontFT2: Could not render glyph for character index #%d!\n", index ); pthread_mutex_unlock ( &library_mutex ); return DFB_FAILURE; } pthread_mutex_unlock ( &library_mutex ); err = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); if (err) { D_DERROR( err, "DirectFB/FontFT2: Unable to lock surface!\n" ); return err; } info->width = face->glyph->bitmap.width; if (info->width + info->start > surface->config.size.w) info->width = surface->config.size.w - info->start; info->height = face->glyph->bitmap.rows; if (info->height > surface->config.size.h) info->height = surface->config.size.h; info->left = face->glyph->bitmap_left; info->top = thiz->ascender - face->glyph->bitmap_top; if (data->fixed_clip) { while (info->left + info->width > data->fixed_advance) info->left--; if (info->left < 0) info->left = 0; if (info->width > data->fixed_advance) info->width = data->fixed_advance; } src = face->glyph->bitmap.buffer; lock.addr += DFB_BYTES_PER_LINE(surface->config.format, info->start); for (y=0; y < info->height; y++) { int i, j, n; u8 *dst8 = lock.addr; u16 *dst16 = lock.addr; u32 *dst32 = lock.addr; switch (face->glyph->bitmap.pixel_mode) { case ft_pixel_mode_grays: switch (surface->config.format) { case DSPF_ARGB: if (thiz->surface_caps & DSCAPS_PREMULTIPLIED) { for (i=0; iwidth; i++) dst32[i] = src[i] * 0x01010101; } else for (i=0; iwidth; i++) dst32[i] = (src[i] << 24) | 0xFFFFFF; break; case DSPF_AiRGB: for (i=0; iwidth; i++) dst32[i] = ((src[i] ^ 0xFF) << 24) | 0xFFFFFF; break; case DSPF_ARGB4444: if (thiz->surface_caps & DSCAPS_PREMULTIPLIED) { for (i=0; iwidth; i++) dst16[i] = (src[i] >> 4) * 0x1111; } else { for (i=0; iwidth; i++) dst16[i] = (src[i] << 8) | 0xFFF; } break; case DSPF_ARGB2554: for (i=0; iwidth; i++) dst16[i] = (src[i] << 8) | 0x3FFF; break; case DSPF_ARGB1555: for (i=0; iwidth; i++) dst16[i] = (src[i] << 8) | 0x7FFF; break; case DSPF_A8: direct_memcpy( lock.addr, src, info->width ); break; case DSPF_A4: for (i=0, j=0; iwidth; i+=2, j++) dst8[j] = (src[i] & 0xF0) | (src[i+1] >> 4); break; case DSPF_A1: for (i=0, j=0; i < info->width; ++j) { register u8 p = 0; for (n=0; n<8 && iwidth; ++i, ++n) p |= (src[i] & 0x80) >> n; dst8[j] = p; } break; case DSPF_LUT2: for (i=0, j=0; i < info->width; ++j) { register u8 p = 0; for (n=0; n<8 && iwidth; ++i, n+=2) p |= (src[i] & 0xC0) >> n; dst8[j] = p; } break; default: D_UNIMPLEMENTED(); break; } break; case ft_pixel_mode_mono: switch (surface->config.format) { case DSPF_ARGB: for (i=0; iwidth; i++) dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0xFF : 0x00) << 24) | 0xFFFFFF; break; case DSPF_AiRGB: for (i=0; iwidth; i++) dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0x00 : 0xFF) << 24) | 0xFFFFFF; break; case DSPF_ARGB4444: for (i=0; iwidth; i++) dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0xF : 0x0) << 12) | 0xFFF; break; case DSPF_ARGB2554: for (i=0; iwidth; i++) dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0x3 : 0x0) << 14) | 0x3FFF; break; case DSPF_ARGB1555: for (i=0; iwidth; i++) dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0x1 : 0x0) << 15) | 0x7FFF; break; case DSPF_A8: for (i=0; iwidth; i++) dst8[i] = (src[i>>3] & (1<<(7-(i%8)))) ? 0xFF : 0x00; break; case DSPF_A4: for (i=0, j=0; iwidth; i+=2, j++) dst8[j] = ((src[i>>3] & (1<<(7-(i%8)))) ? 0xF0 : 0x00) | ((src[(i+1)>>3] & (1<<(7-((i+1)%8)))) ? 0x0F : 0x00); break; case DSPF_A1: direct_memcpy( lock.addr, src, DFB_BYTES_PER_LINE(DSPF_A1, info->width) ); break; default: D_UNIMPLEMENTED(); break; } break; default: break; } src += face->glyph->bitmap.pitch; lock.addr += lock.pitch; } dfb_surface_unlock_buffer( surface, &lock ); return DFB_OK; } static DFBResult get_glyph_info( CoreFont *thiz, unsigned int index, CoreGlyphData *info ) { FT_Error err; FT_Face face; FT_Int load_flags; FT2ImplData *data = (FT2ImplData*) thiz->impl_data; pthread_mutex_lock ( &library_mutex ); face = data->face; load_flags = (unsigned long) face->generic.data; if ((err = FT_Load_Glyph( face, index, load_flags ))) { D_DEBUG( "DirectFB/FontFT2: Could not load glyph for character index #%d!\n", index ); pthread_mutex_unlock ( &library_mutex ); return DFB_FAILURE; } if (face->glyph->format != ft_glyph_format_bitmap) { err = FT_Render_Glyph( face->glyph, (load_flags & FT_LOAD_TARGET_MONO) ? ft_render_mode_mono : ft_render_mode_normal ); if (err) { D_ERROR( "DirectFB/FontFT2: Could not render glyph for character index #%d!\n", index ); pthread_mutex_unlock ( &library_mutex ); return DFB_FAILURE; } } pthread_mutex_unlock ( &library_mutex ); info->width = face->glyph->bitmap.width; info->height = face->glyph->bitmap.rows; info->advance = data->fixed_advance ? data->fixed_advance : (face->glyph->advance.x >> 6); if (data->fixed_clip && info->width > data->fixed_advance) info->width = data->fixed_advance; return DFB_OK; } static DFBResult get_kerning( CoreFont *thiz, unsigned int prev, unsigned int current, int *kern_x, int *kern_y) { FT_Vector vector; FT2ImplKerningData *data = thiz->impl_data; KerningCacheEntry *cache = NULL; D_ASSUME( (kern_x != NULL) || (kern_y != NULL) ); /* * Use cached values if characters are in the * cachable range and the cache entry is already filled. */ if (KERNING_DO_CACHE (prev, current)) { cache = &KERNING_CACHE_ENTRY (prev, current); if (kern_x) *kern_x = (int) cache->x; if (kern_y) *kern_y = (int) cache->y; return DFB_OK; } pthread_mutex_lock ( &library_mutex ); /* Lookup kerning values for the character pair. */ FT_Get_Kerning( data->base.face, prev, current, ft_kerning_default, &vector ); pthread_mutex_unlock ( &library_mutex ); /* Convert to integer. */ if (kern_x) *kern_x = vector.x >> 6; if (kern_y) *kern_y = vector.y >> 6; return DFB_OK; } static void init_kerning_cache( FT2ImplKerningData *data ) { int a, b; pthread_mutex_lock ( &library_mutex ); for (a=KERNING_CACHE_MIN; a<=KERNING_CACHE_MAX; a++) { for (b=KERNING_CACHE_MIN; b<=KERNING_CACHE_MAX; b++) { FT_Vector vector; KerningCacheEntry *cache = &KERNING_CACHE_ENTRY( a, b ); /* Lookup kerning values for the character pair. */ FT_Get_Kerning( data->base.face, a, b, ft_kerning_default, &vector ); cache->x = (signed char) (vector.x >> 6); cache->y = (signed char) (vector.y >> 6); } } pthread_mutex_unlock ( &library_mutex ); } static DFBResult init_freetype( void ) { FT_Error err; pthread_mutex_lock ( &library_mutex ); if (!library) { D_DEBUG( "DirectFB/FontFT2: Initializing the FreeType2 library.\n" ); err = FT_Init_FreeType( &library ); if (err) { D_ERROR( "DirectFB/FontFT2: " "Initialization of the FreeType2 library failed!\n" ); library = NULL; pthread_mutex_unlock( &library_mutex ); return DFB_FAILURE; } } library_ref_count++; pthread_mutex_unlock( &library_mutex ); return DFB_OK; } static void release_freetype( void ) { pthread_mutex_lock( &library_mutex ); if (library && --library_ref_count == 0) { D_DEBUG( "DirectFB/FontFT2: Releasing the FreeType2 library.\n" ); FT_Done_FreeType( library ); library = NULL; } pthread_mutex_unlock( &library_mutex ); } static void IDirectFBFont_FT2_Destruct( IDirectFBFont *thiz ) { IDirectFBFont_data *data = (IDirectFBFont_data*)thiz->priv; if (data->font->impl_data) { FT2ImplData *impl_data = (FT2ImplData*) data->font->impl_data; pthread_mutex_lock ( &library_mutex ); FT_Done_Face( impl_data->face ); pthread_mutex_unlock ( &library_mutex ); D_FREE( impl_data ); data->font->impl_data = NULL; } IDirectFBFont_Destruct( thiz ); release_freetype(); } static DirectResult IDirectFBFont_FT2_Release( IDirectFBFont *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont) if (--data->ref == 0) { IDirectFBFont_FT2_Destruct( thiz ); } return DFB_OK; } static DFBResult Probe( IDirectFBFont_ProbeContext *ctx ) { FT_Error err; FT_Face face; D_DEBUG( "DirectFB/FontFT2: Probe font `%s'.\n", ctx->filename ); if (!ctx->filename) return DFB_UNSUPPORTED; if (init_freetype() != DFB_OK) { return DFB_FAILURE; } pthread_mutex_lock ( &library_mutex ); /* * This should be * err = FT_New_Face( library, ctx->filename, -1, NULL ); * but due to freetype bugs it doesn't work. */ err = FT_New_Face( library, ctx->filename, 0, &face ); if (!err) FT_Done_Face( face ); pthread_mutex_unlock ( &library_mutex ); release_freetype(); return err ? DFB_UNSUPPORTED : DFB_OK; } static DFBResult Construct( IDirectFBFont *thiz, ... ) { int i; DFBResult ret; CoreFont *font; FT_Face face; FT_Error err; FT_Int load_flags = FT_LOAD_DEFAULT; FT2ImplData *data; bool disable_charmap = false; bool disable_kerning = false; bool load_mono = false; u32 mask = 0; CoreDFB *core; char *filename; DFBFontDescription *desc; va_list tag; va_start(tag, thiz); core = va_arg(tag, CoreDFB *); filename = va_arg(tag, char *); desc = va_arg(tag, DFBFontDescription *); va_end( tag ); D_DEBUG( "DirectFB/FontFT2: " "Construct font from file `%s' (index %d) at pixel size %d x %d.\n", filename, (desc->flags & DFDESC_INDEX) ? desc->index : 0, (desc->flags & DFDESC_WIDTH) ? desc->width : 0, (desc->flags & DFDESC_HEIGHT) ? desc->height : 0 ); if (init_freetype() != DFB_OK) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_FAILURE; } pthread_mutex_lock ( &library_mutex ); err = FT_New_Face( library, filename, (desc->flags & DFDESC_INDEX) ? desc->index : 0, &face ); pthread_mutex_unlock ( &library_mutex ); if (err) { switch (err) { case FT_Err_Unknown_File_Format: D_ERROR( "DirectFB/FontFT2: " "Unsupported font format in file `%s'!\n", filename ); break; default: D_ERROR( "DirectFB/FontFT2: " "Failed loading face %d from font file `%s'!\n", (desc->flags & DFDESC_INDEX) ? desc->index : 0, filename ); break; } DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_FAILURE; } if (dfb_config->font_format == DSPF_A1 || dfb_config->font_format == DSPF_ARGB1555) load_mono = true; if (desc->flags & DFDESC_ATTRIBUTES) { if (desc->attributes & DFFA_NOHINTING) load_flags |= FT_LOAD_NO_HINTING; if (desc->attributes & DFFA_NOCHARMAP) disable_charmap = true; if (desc->attributes & DFFA_NOKERNING) disable_kerning = true; if (desc->attributes & DFFA_MONOCHROME) load_mono = true; } if (load_mono) load_flags |= FT_LOAD_TARGET_MONO; if (!disable_charmap) { pthread_mutex_lock ( &library_mutex ); err = FT_Select_Charmap( face, ft_encoding_unicode ); pthread_mutex_unlock ( &library_mutex ); #if FREETYPE_MINOR > 0 /* ft_encoding_latin_1 has been introduced in freetype-2.1 */ if (err) { D_DEBUG( "DirectFB/FontFT2: " "Couldn't select Unicode encoding, " "falling back to Latin1.\n"); pthread_mutex_lock ( &library_mutex ); err = FT_Select_Charmap( face, ft_encoding_latin_1 ); pthread_mutex_unlock ( &library_mutex ); } #endif if (err) { D_DEBUG( "DirectFB/FontFT2: " "Couldn't select Unicode/Latin1 encoding, " "trying Symbol.\n"); pthread_mutex_lock ( &library_mutex ); err = FT_Select_Charmap( face, ft_encoding_symbol ); pthread_mutex_unlock ( &library_mutex ); if (!err) mask = 0xf000; } } #if 0 if (err) { D_ERROR( "DirectFB/FontFT2: " "Couldn't select a suitable encoding for face %d from font file `%s'!\n", (desc->flags & DFDESC_INDEX) ? desc->index : 0, filename ); pthread_mutex_lock ( &library_mutex ); FT_Done_Face( face ); pthread_mutex_unlock ( &library_mutex ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_FAILURE; } #endif if (desc->flags & (DFDESC_HEIGHT | DFDESC_WIDTH | DFDESC_FRACT_HEIGHT | DFDESC_FRACT_WIDTH)) { int fw = 0, fh = 0; if (desc->flags & DFDESC_FRACT_HEIGHT) fh = desc->fract_height; else if (desc->flags & DFDESC_HEIGHT) fh = desc->height << 6; if (desc->flags & DFDESC_FRACT_WIDTH) fw = desc->fract_width; else if (desc->flags & DFDESC_WIDTH) fw = desc->width << 6; pthread_mutex_lock ( &library_mutex ); err = FT_Set_Char_Size( face, fw, fh, 0, 0 ); pthread_mutex_unlock ( &library_mutex ); if (err) { D_ERROR( "DirectB/FontFT2: " "Could not set pixel size to %d x %d!\n", (desc->flags & DFDESC_WIDTH) ? desc->width : 0, (desc->flags & DFDESC_HEIGHT) ? desc->height : 0 ); pthread_mutex_lock ( &library_mutex ); FT_Done_Face( face ); pthread_mutex_unlock ( &library_mutex ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_FAILURE; } } face->generic.data = (void *)(unsigned long) load_flags; face->generic.finalizer = NULL; ret = dfb_font_create( core, &font ); if (ret) { pthread_mutex_lock ( &library_mutex ); FT_Done_Face( face ); pthread_mutex_unlock ( &library_mutex ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } D_ASSERT( font->pixel_format == DSPF_ARGB || font->pixel_format == DSPF_AiRGB || font->pixel_format == DSPF_ARGB4444 || font->pixel_format == DSPF_ARGB2554 || font->pixel_format == DSPF_ARGB1555 || font->pixel_format == DSPF_A8 || font->pixel_format == DSPF_A4 || font->pixel_format == DSPF_A1 ); font->ascender = face->size->metrics.ascender >> 6; font->descender = face->size->metrics.descender >> 6; font->height = font->ascender + ABS(font->descender) + 1; font->maxadvance = face->size->metrics.max_advance >> 6; D_DEBUG( "DirectFB/FontFT2: height = %d, ascender = %d, descender = %d, maxadvance = %d\n", font->height, font->ascender, font->descender, font->maxadvance ); font->GetGlyphData = get_glyph_info; font->RenderGlyph = render_glyph; if (FT_HAS_KERNING(face) && !disable_kerning) { font->GetKerning = get_kerning; data = D_CALLOC( 1, sizeof(FT2ImplKerningData) ); } else data = D_CALLOC( 1, sizeof(FT2ImplData) ); data->face = face; data->disable_charmap = disable_charmap; if (FT_HAS_KERNING(face) && !disable_kerning) init_kerning_cache( (FT2ImplKerningData*) data ); if (desc->flags & DFDESC_FIXEDADVANCE) { data->fixed_advance = desc->fixed_advance; font->maxadvance = desc->fixed_advance; if ((desc->flags & DFDESC_ATTRIBUTES) && (desc->attributes & DFFA_FIXEDCLIP)) data->fixed_clip = true; } for (i=0; i<256; i++) data->indices[i] = FT_Get_Char_Index( face, i | mask ); font->impl_data = data; dfb_font_register_encoding( font, "UTF8", &ft2UTF8Funcs, DTEID_UTF8 ); dfb_font_register_encoding( font, "Latin1", &ft2Latin1Funcs, DTEID_OTHER ); IDirectFBFont_Construct( thiz, font ); thiz->Release = IDirectFBFont_FT2_Release; return DFB_OK; } DirectFB-1.2.10/interfaces/IDirectFBFont/Makefile.am0000644000175000017500000000267611164361026016712 00000000000000## Makefile.am for DirectFB/interfaces/IDirectFBFont idirectfbfontdir = $(MODULEDIR)/interfaces/IDirectFBFont if FREETYPE_PROVIDER FREETYPE_PROVIDER_LTLIB = libidirectfbfont_ft2.la else FREETYPE_PROVIDER_LTLIB = endif INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" AM_CFLAGS = $(FREETYPE_CFLAGS) idirectfbfont_LTLIBRARIES = \ libidirectfbfont_default.la \ $(FREETYPE_PROVIDER_LTLIB) \ libidirectfbfont_dgiff.la if BUILD_STATIC idirectfbfont_DATA = $(idirectfbfont_LTLIBRARIES:.la=.o) endif libidirectfbfont_default_la_SOURCES = idirectfbfont_default.c default_font.h libidirectfbfont_default_la_LDFLAGS = -avoid-version -module libidirectfbfont_default_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la libidirectfbfont_dgiff_la_SOURCES = idirectfbfont_dgiff.c libidirectfbfont_dgiff_la_LDFLAGS = -avoid-version -module libidirectfbfont_dgiff_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libidirectfbfont_ft2_la_SOURCES = idirectfbfont_ft2.c libidirectfbfont_ft2_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(FREETYPE_LIBS) libidirectfbfont_ft2_la_LDFLAGS = -avoid-version -module include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/interfaces/IDirectFBFont/Makefile.in0000644000175000017500000005316711307521503016721 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = interfaces/IDirectFBFont ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(idirectfbfontdir)" \ "$(DESTDIR)$(idirectfbfontdir)" idirectfbfontLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(idirectfbfont_LTLIBRARIES) libidirectfbfont_default_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libidirectfbfont_default_la_OBJECTS = idirectfbfont_default.lo libidirectfbfont_default_la_OBJECTS = \ $(am_libidirectfbfont_default_la_OBJECTS) libidirectfbfont_default_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libidirectfbfont_default_la_LDFLAGS) \ $(LDFLAGS) -o $@ libidirectfbfont_dgiff_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libidirectfbfont_dgiff_la_OBJECTS = idirectfbfont_dgiff.lo libidirectfbfont_dgiff_la_OBJECTS = \ $(am_libidirectfbfont_dgiff_la_OBJECTS) libidirectfbfont_dgiff_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libidirectfbfont_dgiff_la_LDFLAGS) \ $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = libidirectfbfont_ft2_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1) am_libidirectfbfont_ft2_la_OBJECTS = idirectfbfont_ft2.lo libidirectfbfont_ft2_la_OBJECTS = \ $(am_libidirectfbfont_ft2_la_OBJECTS) libidirectfbfont_ft2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbfont_ft2_la_LDFLAGS) $(LDFLAGS) -o $@ @FREETYPE_PROVIDER_TRUE@am_libidirectfbfont_ft2_la_rpath = -rpath \ @FREETYPE_PROVIDER_TRUE@ $(idirectfbfontdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libidirectfbfont_default_la_SOURCES) \ $(libidirectfbfont_dgiff_la_SOURCES) \ $(libidirectfbfont_ft2_la_SOURCES) DIST_SOURCES = $(libidirectfbfont_default_la_SOURCES) \ $(libidirectfbfont_dgiff_la_SOURCES) \ $(libidirectfbfont_ft2_la_SOURCES) idirectfbfontDATA_INSTALL = $(INSTALL_DATA) DATA = $(idirectfbfont_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ idirectfbfontdir = $(MODULEDIR)/interfaces/IDirectFBFont @FREETYPE_PROVIDER_FALSE@FREETYPE_PROVIDER_LTLIB = @FREETYPE_PROVIDER_TRUE@FREETYPE_PROVIDER_LTLIB = libidirectfbfont_ft2.la INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" AM_CFLAGS = $(FREETYPE_CFLAGS) idirectfbfont_LTLIBRARIES = \ libidirectfbfont_default.la \ $(FREETYPE_PROVIDER_LTLIB) \ libidirectfbfont_dgiff.la @BUILD_STATIC_TRUE@idirectfbfont_DATA = $(idirectfbfont_LTLIBRARIES:.la=.o) libidirectfbfont_default_la_SOURCES = idirectfbfont_default.c default_font.h libidirectfbfont_default_la_LDFLAGS = -avoid-version -module libidirectfbfont_default_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la libidirectfbfont_dgiff_la_SOURCES = idirectfbfont_dgiff.c libidirectfbfont_dgiff_la_LDFLAGS = -avoid-version -module libidirectfbfont_dgiff_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la libidirectfbfont_ft2_la_SOURCES = idirectfbfont_ft2.c libidirectfbfont_ft2_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(FREETYPE_LIBS) libidirectfbfont_ft2_la_LDFLAGS = -avoid-version -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu interfaces/IDirectFBFont/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu interfaces/IDirectFBFont/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-idirectfbfontLTLIBRARIES: $(idirectfbfont_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbfontLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbfontdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbfontdir)/$$p"; \ done clean-idirectfbfontLTLIBRARIES: -test -z "$(idirectfbfont_LTLIBRARIES)" || rm -f $(idirectfbfont_LTLIBRARIES) @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libidirectfbfont_default.la: $(libidirectfbfont_default_la_OBJECTS) $(libidirectfbfont_default_la_DEPENDENCIES) $(libidirectfbfont_default_la_LINK) -rpath $(idirectfbfontdir) $(libidirectfbfont_default_la_OBJECTS) $(libidirectfbfont_default_la_LIBADD) $(LIBS) libidirectfbfont_dgiff.la: $(libidirectfbfont_dgiff_la_OBJECTS) $(libidirectfbfont_dgiff_la_DEPENDENCIES) $(libidirectfbfont_dgiff_la_LINK) -rpath $(idirectfbfontdir) $(libidirectfbfont_dgiff_la_OBJECTS) $(libidirectfbfont_dgiff_la_LIBADD) $(LIBS) libidirectfbfont_ft2.la: $(libidirectfbfont_ft2_la_OBJECTS) $(libidirectfbfont_ft2_la_DEPENDENCIES) $(libidirectfbfont_ft2_la_LINK) $(am_libidirectfbfont_ft2_la_rpath) $(libidirectfbfont_ft2_la_OBJECTS) $(libidirectfbfont_ft2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_default.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_dgiff.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_ft2.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idirectfbfontDATA: $(idirectfbfont_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" @list='$(idirectfbfont_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbfontDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ $(idirectfbfontDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ done uninstall-idirectfbfontDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbfont_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(idirectfbfontdir)" "$(DESTDIR)$(idirectfbfontdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-idirectfbfontLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-idirectfbfontDATA \ install-idirectfbfontLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idirectfbfontDATA \ uninstall-idirectfbfontLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-idirectfbfontLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-idirectfbfontDATA \ install-idirectfbfontLTLIBRARIES install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-idirectfbfontDATA \ uninstall-idirectfbfontLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/interfaces/IDirectFBFont/idirectfbfont_dgiff.c0000644000175000017500000002320011245562152020770 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /**********************************************************************************************************************/ static DFBResult Probe( IDirectFBFont_ProbeContext *ctx ); static DFBResult Construct( IDirectFBFont *thiz, CoreDFB *core, const char *filename, DFBFontDescription *desc ); /**********************************************************************************************************************/ #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, DGIFF ) /**********************************************************************************************************************/ typedef struct { void *map; /* Memory map of the file. */ int size; /* Size of the memory map. */ } DGIFFImplData; /**********************************************************************************************************************/ static void IDirectFBFont_DGIFF_Destruct( IDirectFBFont *thiz ) { IDirectFBFont_data *data = thiz->priv; CoreFont *font = data->font; DGIFFImplData *impl = font->impl_data; munmap( impl->map, impl->size ); D_FREE( impl ); IDirectFBFont_Destruct( thiz ); } static DirectResult IDirectFBFont_DGIFF_Release( IDirectFBFont *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont) if (--data->ref == 0) { IDirectFBFont_DGIFF_Destruct( thiz ); } return DFB_OK; } static DFBResult Probe( IDirectFBFont_ProbeContext *ctx ) { DFBResult ret = DFB_OK; int fd; DGIFFHeader header; if (!ctx->filename) return DFB_UNSUPPORTED; /* Open the file. */ fd = open( ctx->filename, O_RDONLY ); if (fd < 0) { ret = errno2result( errno ); D_PERROR( "Font/DGIFF: Failure during open() of '%s'!\n", ctx->filename ); goto out; } /* Read the header. */ if (read( fd, &header, sizeof(header) ) != sizeof(header)) { ret = errno2result( errno ); D_PERROR( "Font/DGIFF: Failure reading %zu bytes from '%s'!\n", sizeof(header), ctx->filename ); goto out; } /* Check the magic. */ if (strncmp( (char*) header.magic, "DGIFF", 5 )) ret = DFB_UNSUPPORTED; out: if (fd >= 0) close( fd ); return ret; } static DFBResult Construct( IDirectFBFont *thiz, CoreDFB *core, const char *filename, DFBFontDescription *desc ) { DFBResult ret; int i; int fd; struct stat stat; void *ptr = MAP_FAILED; CoreFont *font = NULL; DGIFFHeader *header; DGIFFFaceHeader *face; DGIFFGlyphInfo *glyphs; DGIFFGlyphRow *row; DGIFFImplData *data; CoreSurfaceConfig config; // if (desc->flags & (DFDESC_WIDTH | DFDESC_ATTRIBUTES | DFDESC_FIXEDADVANCE)) // return DFB_UNSUPPORTED; /* Open the file. */ fd = open( filename, O_RDONLY ); if (fd < 0) { ret = errno2result( errno ); D_PERROR( "Font/DGIFF: Failure during open() of '%s'!\n", filename ); return ret; } /* Query file size etc. */ if (fstat( fd, &stat ) < 0) { ret = errno2result( errno ); D_PERROR( "Font/DGIFF: Failure during fstat() of '%s'!\n", filename ); goto error; } /* Memory map the file. */ ptr = mmap( NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0 ); if (ptr == MAP_FAILED) { ret = errno2result( errno ); D_PERROR( "Font/DGIFF: Failure during mmap() of '%s'!\n", filename ); goto error; } /* Keep entry pointers for main header and face. */ header = ptr; face = ptr + sizeof(DGIFFHeader); /* Lookup requested face, otherwise use first if nothing requested or show error if not found. */ if (desc->flags & DFDESC_HEIGHT) { for (i=0; inum_faces; i++) { if (face->size == desc->height) break; face = ((void*) face) + face->next_face; } if (i == header->num_faces) { ret = DFB_UNSUPPORTED; D_ERROR( "Font/DGIFF: Requested size %d not found in '%s'!\n", desc->height, filename ); goto error; } } glyphs = (void*)(face + 1); row = (void*)(glyphs + face->num_glyphs); /* Create the core object. */ ret = dfb_font_create( core, &font ); if (ret) goto error; /* Fill font information. */ font->ascender = face->ascender; font->descender = face->descender; font->height = face->height; font->maxadvance = face->max_advance; font->pixel_format = face->pixelformat; font->num_rows = face->num_rows; /* Allocate array for glyph cache rows. */ font->rows = D_CALLOC( face->num_rows, sizeof(void*) ); if (!font->rows) { ret = D_OOM(); goto error; } /* Build glyph cache rows. */ config.flags = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_PREALLOCATED; config.format = face->pixelformat; config.preallocated[1].addr = NULL; config.preallocated[1].pitch = 0; for (i=0; inum_rows; i++) { font->rows[i] = D_CALLOC( 1, sizeof(CoreFontCacheRow) ); if (!font->rows[i]) { ret = D_OOM(); goto error; } config.size.w = row->width; config.size.h = row->height; config.preallocated[0].addr = (void*)(row+1); config.preallocated[0].pitch = row->pitch; ret = dfb_surface_create( core, &config, CSTF_PREALLOCATED, 0, NULL, &font->rows[i]->surface ); if (ret) { D_DERROR( ret, "DGIFF/Font: Could not create preallocated %s %dx%d glyph row surface!\n", dfb_pixelformat_name(face->pixelformat), row->width, row->height ); goto error; } D_MAGIC_SET( font->rows[i], CoreFontCacheRow ); /* Jump to next row. */ row = (void*)(row + 1) + row->pitch * row->height; } /* Build glyph infos. */ for (i=0; inum_glyphs; i++) { CoreGlyphData *data; DGIFFGlyphInfo *glyph = &glyphs[i]; data = D_CALLOC( 1, sizeof(CoreGlyphData) ); if (!data) { ret = D_OOM(); goto error; } data->surface = font->rows[glyph->row]->surface; data->start = glyph->offset; data->width = glyph->width; data->height = glyph->height; data->left = glyph->left; data->top = glyph->top; data->advance = glyph->advance; D_MAGIC_SET( data, CoreGlyphData ); direct_hash_insert( font->glyph_hash, glyph->unicode, data ); if (glyph->unicode < 128) font->glyph_data[glyph->unicode] = data; } data = D_CALLOC( 1, sizeof(DGIFFImplData) ); if (!data) { ret = D_OOM(); goto error; } data->map = ptr; data->size = stat.st_size; font->impl_data = data; /* Already close, we still have the map. */ close( fd ); ret = IDirectFBFont_Construct( thiz, font ); D_ASSERT( ret == DFB_OK ); thiz->Release = IDirectFBFont_DGIFF_Release; return DFB_OK; error: if (font) { if (font->rows) { for (i=0; inum_rows; i++) { if (font->rows[i]) { if (font->rows[i]->surface) dfb_surface_unref( font->rows[i]->surface ); D_FREE( font->rows[i] ); } } D_FREE( font->rows ); font->rows = NULL; } dfb_font_destroy( font ); } if (ptr != MAP_FAILED) munmap( ptr, stat.st_size ); close( fd ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } DirectFB-1.2.10/interfaces/IDirectFBFont/idirectfbfont_default.c0000644000175000017500000002472211245562152021347 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "default_font.h" #define DEFAULT_FONT_HEIGHT 24 #define DEFAULT_FONT_ASCENDER 16 #define DEFAULT_FONT_DESCENDER -4 static DFBResult Probe( IDirectFBFont_ProbeContext *ctx ); static DFBResult Construct( IDirectFBFont *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, Default ) static DFBResult Probe( IDirectFBFont_ProbeContext *ctx ) { /* default font is created with a NULL filename */ if (ctx->filename) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult Construct( IDirectFBFont *thiz, ... ) { DFBResult ret; CoreFont *font; CoreSurface *surface; CoreFontCacheRow *row; u8 *pixels; int i; CoreDFB *core; char *filename; DFBFontDescription *desc; CoreSurfaceConfig config; va_list tag; va_start(tag, thiz); core = va_arg(tag, CoreDFB *); filename = va_arg(tag, char *); desc = va_arg(tag, DFBFontDescription *); va_end( tag ); D_DEBUG( "DirectFB/FontDefault: Construct default font"); ret = dfb_font_create( core, &font ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } D_ASSERT( font->pixel_format == DSPF_ARGB || font->pixel_format == DSPF_AiRGB || font->pixel_format == DSPF_ARGB4444 || font->pixel_format == DSPF_ARGB2554 || font->pixel_format == DSPF_ARGB1555 || font->pixel_format == DSPF_A8 || font->pixel_format == DSPF_A4 || font->pixel_format == DSPF_A1 ); font->height = DEFAULT_FONT_HEIGHT; font->ascender = DEFAULT_FONT_ASCENDER; font->descender = DEFAULT_FONT_DESCENDER; row = D_CALLOC( 1, sizeof(CoreFontCacheRow) ); if (!row) { D_OOM(); dfb_font_destroy( font ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return DFB_NOSYSTEMMEMORY; } config.flags = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_CAPS; config.size.w = font_desc.width; config.size.h = font_desc.height; config.format = font->pixel_format; config.caps = font->surface_caps; ret = dfb_surface_create( core, &config, CSTF_FONT, 0, NULL, &surface ); if (ret) { dfb_font_destroy( font ); return ret; } font->num_rows = 1; font->row_width = font_desc.width; font->rows = D_MALLOC(sizeof (void *)); font->rows[0] = row; row->surface = surface; D_MAGIC_SET( row, CoreFontCacheRow ); pixels = font_data; { CoreGlyphData *data; int use_unicode; int start = 0; int index = 0; int key; const char *glyphs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "01234567890!\"$%&/()=?^<>" // FIXME: '0' is repeated! "|,;.:-_{[]}\\`+*~#'"; if (desc && (desc->flags & DFDESC_ATTRIBUTES) && (desc->attributes & DFFA_NOCHARMAP)) use_unicode = 0; else use_unicode = 1; for (i = 0; i < font_desc.width; i++) { if (pixels[i] == 0xFF) { if (use_unicode) key = glyphs[index]; else key = index; if (!direct_hash_lookup( font->glyph_hash, key )) { data = D_CALLOC( 1, sizeof(CoreGlyphData) ); data->surface = surface; data->start = start; data->width = i - start + 1; data->height = font_desc.height - 1; data->left = 0; data->top = 0; data->advance = ((desc && (desc->flags & DFDESC_FIXEDADVANCE)) ? desc->fixed_advance : data->width + 1); D_DEBUG( "DirectFB/core/fonts: " "glyph '%c' at %d, width %d\n", glyphs[index], start, i-start ); D_MAGIC_SET( data, CoreGlyphData ); if (font->maxadvance < data->advance) font->maxadvance = data->advance; direct_hash_insert( font->glyph_hash, key, data ); } start = i + 1; index++; } if (glyphs[index] == '\0') break; } /* space */ data = D_CALLOC( 1, sizeof(CoreGlyphData) ); data->advance = 5; D_MAGIC_SET( data, CoreGlyphData ); if (use_unicode) key = 32; else key = index; direct_hash_insert( font->glyph_hash, key, data ); } { CoreSurfaceBufferLock lock; ret = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAF_CPU_WRITE, &lock ); if (ret) { D_DERROR( ret, "IDirectFBFont_Default: Could not lock surface buffer!\n" ); } else { for (i = 1; i < font_desc.height; i++) { int i, j, n; u8 *dst8 = lock.addr; u16 *dst16 = lock.addr; u32 *dst32 = lock.addr; pixels += font_desc.preallocated[0].pitch; switch (surface->config.format) { case DSPF_ARGB: if (surface->config.caps & DSCAPS_PREMULTIPLIED) { for (i=0; iconfig.caps & DSCAPS_PREMULTIPLIED) { for (i=0; i> 4) * 0x1111; } else { for (i=0; i> 4); break; case DSPF_A1: for (i=0, j=0; i < font_desc.width; ++j) { register u8 p = 0; for (n=0; n<8 && i> n; dst8[j] = p; } break; case DSPF_LUT2: for (i=0, j=0; i < font_desc.width; ++j) { register u8 p = 0; for (n=0; n<8 && i> n; dst8[j] = p; } break; default: D_UNIMPLEMENTED(); break; } lock.addr += lock.pitch; } dfb_surface_unlock_buffer( surface, &lock ); } } return IDirectFBFont_Construct (thiz, font); } DirectFB-1.2.10/interfaces/IDirectFBFont/default_font.h0000644000175000017500000013047711164361026017502 00000000000000/* DirectFB surface dump created by directfb-csource 0.9.17 */ static unsigned char font_data[] = "\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377" "\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0" "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\377\0\0\0\0\0\377" "\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0" "\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0" "\0\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0" "\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0" "\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0" "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0" "\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377" "\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\377" "\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0" "\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377" "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\377\0" "\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0" "\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0" "\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0" "\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377" "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0" "\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\377" "\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0" "\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\377\0" "\0\0\0\377\0\0\377\0\0\0\0\377\0\0\0\377\0\0\0\0\377\0\0\0\0\0\0\0\0" "\0\0\377\0\0\0\0\0\0\377\0\0\0\0\377\0\0\0\0\377\0\0\0\0\0\0\377\0\0" "\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377" "\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8U8\0\34UUU\34\34" "UUU\34""8U\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0""8U\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\0\0\0\0" "\0\0\0\0\0\0\0\0""8U8\0\0\0\0\0\0\0\0\0\0""8U\34\0\0\0\0\0\0\0""88\0" "\0\0\34U\0\0\0UU\0\0\0\0\0\0\34U8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\34U8\0UU\0\0\0\0\0\0\377\252\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34U\34\0\0qU\0\0" "\215U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34U8\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377\377\252\0U" "\377\377\377UU\377\377\377U\252\377\3778\0\0\0""8U\0\0\0\0\0\0\2158\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\34U8\0\0\0\0""8\252\2528\0\0\0\0\0q\252\252\252" "\252\2528\0\0\0\0\0\0""8\215\252\252U\0\0""8\252\252\252\252\2158\0\0" "\0\0""8\252\252\252\252\252\252q\0\0q\252\252\252\252\252\252\0\0\0\0" "8\215\252\252q\34\0\0\0\252\252\0\0\0\0q\2528\0\0""8\252q\0\0\0\252\252" "\0\0\0q\2528\0\0\34\252\2528\0q\2528\0\0\0\0\0\0\252\252q\0\0\0\0q\252" "\252\0\0\0""8\252\252U\0\0\0""8\252q\0\0\0\0U\252\252\2158\0\0\0\0""8" "\252\252\252\252\215\34\0\0\0\0\0U\252\252\2158\0\0\0\0""8\252\252\252" "\252\252U\0\0\0\0\0\34\215\252\252q\34\0q\252\252\252\252\252\252\252" "\252\0q\2528\0\0\0\0\252\252\0\0\252\2528\0\0\0\0""8\252q\0\252\2528" "\0\0\0\252\252\215\0\0\0U\252q\0\252\252U\0\0\0\0\215\25288\252\252\34" "\0\0\0""8\252\252\0q\252\252\252\252\252\252q\0\0\0\0\0\0\0\0\0\0\0\252" "\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0" "\0\0\215\377\377\377U\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0""8\377\377" "8\0\0\342\377\215\0\0\377\377\0\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0UU\34\0\0\0\0\0\0\0\0\0\0\0\0\34UU\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0U\377\252\0\0U\377\252\0\377\377\0\0\0\0\0\34\377" "\306\34\0\0\0\0\0\0UU\0\0\0\0\0\342\252\0\0\0\0\0\0\0\0\0U\252\252q\0" "\0\0\0\0\0\0\0\0q\3778\0\34\377\252\0\0\342\306\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\34\215\342\377\342U\0\0\0\0\0\0\306\377\342\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377U8\0U\377\215U\34\34" "U\215\377U8q\377\252\0\0\0\252\377\34\0\0\0\0""8\377\377\215\34\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\252\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\252U\0\34\2528\0\0U\377\252\0\0\0\0\252\377\377\252\0\0\0\0\0\252\377" "\377\377\377\377\377\252\0\0\0\0\252\377\377\377\377\377\34\0U\377\377" "\377\377\377\377\252\0\0\0U\377\377\377\377\377\377\252\0\0\252\377\377" "\377\377\377\377\0\0\0\252\377\377\377\377\377\377\0\0\0\377\377\0\0" "\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377U\0\0\306\377\306" "\0\0\252\377U\0\0\0\0\0\0\377\377\342\0\0\0\0\342\377\377\0\0\0U\377" "\377\342\0\0\0U\377\252\0\0\0\252\377\377\377\377\377U\0\0\0U\377\377" "\377\377\377\377U\0\0\0\252\377\377\377\377\377U\0\0\0U\377\377\377\377" "\377\377\342\0\0\0U\377\377\377\377\377\215\0\252\377\377\377\377\377" "\377\377\377\0\252\377U\0\0\0\0\377\377\0\0\306\377\215\0\0\0\0\215\377" "\252\0\342\377U\0\0""8\377\377\377\0\0\0\252\377q\0q\377\377\34\0\0q" "\377\342\0\0\342\377\215\0\0\0\252\377\252\0\252\377\377\377\377\377" "\377\252\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\377\377q\215\34\0\0\0\0\0\0\0" "\0\0\252\377U\0\0\0\0\0\0""8\377\3778\0\0\342\377\215\0\0\377\377\0\0" "\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0U\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\377\377\377\0\0\0\0\0\0" "\0\0\0\0\0\215\377\377\377\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0U\377\252\0\0""8\377\252\0\377\342\0\0\0\34\306\377\377\377\377\342" "\0\0\0\34\342\377\377\342\34\0\0""8\377\215\0\0\0\0\0\0\0\0\252\377\377" "\377\377\252\0\0\0\0\0\0\0\0\306\377\0\0\215\377U\0\0\215\3778\0\0\0" "\0\0\0\0\0\0\0\0\0\0""8\377\342\252\377\3778\0\0\0\0""8\377\342\377q" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0" "\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0U\377q\0\0\0\0\0U\306\377\342" "8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0U\377q\0U\377U\0\0""8\377\252\0\0\0\0\377\342\377\377\0\0\0\0\0\252" "\377U\0\0U\377\377\34\0\0\215\377\3068\0""8q\0\0U\377\252\0\0""8\342" "\377q\0\0U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\215\377\3068\0" "\34qq\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0" "\252\377U\0q\377\342\34\0\0\252\377U\0\0\0\0\0\34\377\377\377\34\0\0" "\34\377\377\3778\0\0U\377\342\377U\0\0U\377\252\0\0q\377\252\34\0U\377" "\377\34\0\0U\377\252\0\0U\377\377\0\0q\377\252\34\0U\377\377\34\0\0U" "\377\252\0\0\34\342\377q\0\34\377\3778\0\34q8\0\0\0\0U\377\252\0\0\0" "\0\252\377U\0\0\0\0\377\377\0\0q\377\306\0\0\0\0\306\377U\0\252\377\252" "\0\0U\377\306\3778\0\0\306\377U\0\0\342\377\215\0\0\342\3778\0\0q\377" "\342\0\0\0\377\3778\0\0\0\0\0\0q\377U\0\0\0\0\0\0\0\0\0\0\0\252\377U" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0" "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0""88\0\0\0\34" "U\0\0\0\377\377\0\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8U8\0\0\0\0\0\0\0""8\0\0\0\0""8U8\0" "\0\0\0\0""8UU\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\342" "qq\215\0\0\0\0\0\0\0\0\0\0q\377\342Uq\377\377\34\0\0\0\0UU\34\0\0\0\0" "\0\0UU\34\0\0\0\0U\377\252\0\0\0\377\252\0\377\252\0\0\0\342\377\306" "\377\342\252\377\0\0\0\215\377qq\377\252\0\0\215\3778\0\0\0\0\0\0\0""8" "\377\342\34\34\342\3778\0\0\0\0\0\0\0\377\252\0\0\342\377\0\0\0U\377" "\215\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\34\0q\377\252\0\0\0\0\306\3778\377" "\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252" "\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0\377\252\0\0\0\0\0\0\0" "8\252\0\0\0\0\0\0\0\0\0\0\0\0\215\342\215\306\377\215\342\215\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0U\377U\0U\377\34\0\0\0\377\252\0\0\0""8\377\252\252" "\377U\0\0\0\0\252\377U\0\0\0\252\377U\0\34\377\377\34\0\0\0\0\0\0U\377" "\252\0\0\0""8\377\342\0\0U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\34" "\377\377\34\0\0\0\0\0\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0" "\0\377\377\0\0\0\252\377U\34\342\377U\0\0\0\252\377U\0\0\0\0\0U\377\306" "\377U\0\0U\377\342\377U\0\0U\377\252\377\306\0\0U\377\252\0\0\342\377" "\34\0\0\0q\377\215\0\0U\377\252\0\0\0\306\377U\0\342\377\34\0\0\0q\377" "\215\0\0U\377\252\0\0\0U\377\252\0U\377\252\0\0\0\0\0\0\0\0\0U\377\252" "\0\0\0\0\252\377U\0\0\0\0\377\377\0\0""8\377\377\0\0\0\0\377\377\0\0" "\215\377\252\0\0\252\377q\377U\0\0\377\377\34\0\0U\377\377\34q\377\306" "\0\0\0\34\377\3778\0q\377\306\0\0\0\0\0\0\34\377\306\0\0\0\0\0\0\0\0" "\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0" "\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377\377\377\306\34\0" "\0\34q\342\252\0\0U\342\377\377\377\306\34\0""8\342\377\377\377\342U" "\0\0\0\0""8\377\252\0\0\0\0U\377\377\377\377\377\252\0\0\0\342\377\34" "\0\0\0\0U\377\377\377\377\377\377\3778\252\377U\0\0\306\377U\0\0U\377" "\377\377\377\215\0\0\0\34\342\377\377\377\215\0\0\0U\377\252\0\0\0\377" "\252\0\377\252\0\0U\377\306\0\377\252\0\0\0\0\0\377\306\0\0\306\377\0" "\0\306\377\0\0\0\0\0\0\0\0U\377\252\0\0\252\377U\0\0\0\0\0\0U\377U\0" "\34\377\252\0\0\0\0\377\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377\252" "\0\0\0""8\377\215\0\215\377q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0" "\306\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\215\342\377\377" "\306q\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\215\3778\0\252\377\0\0\0\0\377\252" "\0\0\0\215\377Uq\377\215\0\0\0\0\252\377U\0\0\0\252\3778\0U\377\252\0" "\0\0\0\0\0\0U\377\252\0\0\0\0\377\377\34\0U\377\252\0\0\0\0\0\0\0\252" "\377U\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\252\377U\0" "\0U\377\252\0\0\0\377\377\0\0\0\252\377U\252\377\252\0\0\0\0\252\377" "U\0\0\0\0\0U\377\252\377\252\0\0\252\377\252\377U\0\0U\377\252\306\377" "\34\0U\377\252\0\34\377\342\0\0\0\0""8\377\306\0\0U\377\252\0\0\0\252" "\377U\34\377\342\0\0\0\0""8\377\306\0\0U\377\252\0\0\0q\377\215\0U\377" "\342\34\0\0\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0\0\0\0\377\377\0\0" "\0\342\377U\0\0U\377\306\0\0U\377\342\0\0\306\3778\377\215\0\0\377\377" "\0\0\0\0\306\377\215\342\377\34\0\0\0\0\215\377\252\0\306\3778\0\0\0" "\0\0\0\306\3778\0\0\0""8\306\377\377\342U\0\0\0\252\377q\306\377\306" "8\0\0\0\34\252\377\377\306\0\0\34\252\377\342U\377\377\0\0\0q\342\377" "\342U\0U\377\377\377\377\377\0\0q\342\377\377\377\377\215\0\252\377q" "\215\377\377U\0\0\0\377\377\0\0\0\252\377U\0\0\377\377\0\0\342\377\215" "\0U\377\252\0\0U\377Uq\377\377\215\34\306\377\342U\0\0U\377Uq\342\377" "\252\0\0\0\0q\342\377\342q\0\0\0\252\377\34\306\377\342U\0\0\0U\342\377" "\306\34\377\252\0\0\377\252U\342\3778\0\215\377\377\342qU\377\377\377" "\377\252\0U\377\252\0\0U\377\252\0\252\377\215\0\0\34\377\377U\377\342" "\0\0""8\377\377U\0\0\252\377U\215\377\306\0\0U\377\342\0\377\3778\0\0" "8\377\306\0\377\377\377\377\377\377\0\0\215\377\306U\252\377\215\0q\377" "\377\377\252\0\0q\377\215U\306\377\215\0\34\377\215U\215\377\342\0\0" "\0\0\215\3778\0\0\0\0U\377\306\252\252\252q\0\0""8\377\252\0\0\0\0\0" "8\252\252\252\252\252\377\377\0\252\377q\0\0\306\377U\0\34\377\377qU" "\342\3778\0\0\342\377\215U\342\3778\0\0""8\377\252\0\0\0\0\0\0\0\0\0" "\0U\377\252\0\377\252\0\0\0\0\0\377\252\0\0\252\377\0\34\377\252\0\0" "\0\0\0\0\0\0""8\377\342\0\0\342\377\34\0\0\0\0\0\0\252\377\34\0U\377" "\252\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\342\377q\0\0\0" "\306\377\34\0\34\377\342\0\0\0\0\0\0\0\0""8\252\252\0U\3068\0\0\0\0\0" "\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0" "q\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\34U\34\0\0\0\0\0\0q\377\377U\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\252\377\377\377\377\377\377\377\377\377\0\0\0\0" "\0\0\0\306\37788\377\342\0\0\0\0\252\377U\0\0U\377\252\0\0\252\377U\0" "\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0U\377\306UUUU\0\0\0\252\377U" "\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\377\377UUUU\306\377U\0\0U\377\252" "\0\0\0\377\377\0\0\0\252\377\252\377\342\34\0\0\0\0\252\377U\0\0\0\0" "\0U\377\252\306\342\0\0\342\342\252\377U\0\0U\377\252U\377\215\0U\377" "\252\0U\377\252\0\0\0\0\0\377\377\0\0U\377\252\0\0\0\342\3778U\377\252" "\0\0\0\0\0\377\377\0\0U\377\252\0\0""8\342\3778\0\0\342\377\342q\0\0" "\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0\0\0\0\377\377\0\0\0\252\377\215" "\0\0\215\377q\0\0""8\377\377\0\0\377\252\0\377\252\0U\377\252\0\0\0\0" "8\377\377\377\215\0\0\0\0\0\34\377\377\34\377\306\0\0\0\0\0\0U\377\215" "\0\0\0\0q\377\252\252\377\3778\0\0\252\377\377\306\306\377\342\0\0\34" "\342\377\306\306\342\0\0\215\377\342\252\377\377\377\0\0q\377\342\252" "\377\37788\252\377\377\252\252\0q\377\342\252\306\377\342U\0\252\377" "\377\306\252\377\3778\0\0\377\377\0\0\0\252\377U\0\0\377\377\0q\377\306" "\0\0U\377\252\0\0U\377\377\342\252\377\377\342\306\306\377\342\0\0U\377" "\377\342\252\342\377\215\0\0q\377\342\252\342\377\215\0\0\252\377\377" "\306\306\377\342\34\0\34\342\377\306\306\377\377\252\0\0\377\377\342" "\306\377\34q\377\342\252\342\2158\252\377\377\252q\0U\377\252\0\0U\377" "\252\0U\377\306\0\0U\377\252\0\377\377\0\0q\377\377\215\0\0\377\377\0" "\34\342\3778\0\342\3778\0\252\377q\0\0q\377\215\0\252\252\252\252\377" "\377\0\0\377\377\34\0\34\377\377\0q\342\252\377\252\0\0\0""8\0\0\34\377" "\377\0\0\34\0\0\0\306\377U\0\0\0\377\306\0\0\0\0\0U\377U\0\0\0\0\0\0" "q\377\215\306\377\342U\0\0\0\0\0\0U\377\252\0""8\377\342\34U\377\342" "\0\0\215\377\215\0\0U\377\252\0U\377\306\0\0q\377\252\0\0\0\377\252\0" "\0\0\0\0\0\0\0\0\0\34\377\377q\377\252\0\0\0\0\0\377\252\0\0\252\377" "\0U\377U\0\34UU\0\0\0\0\0\252\377\252\252\377\252\0\0\0\0\0\0\0\342\306" "\0\0\215\377U\0\0\0\0\252\377U\0""8\252\252\252\252\252\252\252\252\252" "\0\0\0\0q\377\342\34\0\0""8\377\215\0\0\0\215\377q\0\0\0\0\0""8\306\377" "\377q\0""8\342\377\342q\0\0\0\0\0U\377U\0\0\0\0\0\0\252\377U\0\0\0\0" "\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\377\252\0\0\0U\377" "U\0\0\0\0U\377U\0\0\377\342\0\0\0\0""8\377\215\0\0\0\0\0\0\0\0\0\0\0" "\0\0U\377U\0\0\0\0\0""8\377q\215\377\34\0\0\0\0\0\0\0\0\0\0\0\0\0q\252" "\377\377\252\252\377\342\252q\0\0\0\0\0\0\34\377\377\0\0\377\3778\0\0" "\0\252\377\377\377\377\377\306\0\0\0\252\377U\0\0\0\0\0\0\0U\377\252" "\0\0\0\0\252\377U\0U\377\377\377\377\377\377U\0\0\252\377\377\377\377" "\377\252\0\252\377U\0U\377\377\377\377\0\0\0\377\377\377\377\377\377" "\377\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377\377\377\215\0\0\0" "\0\0\252\377U\0\0\0\0\0q\377\215\215\377\34\34\377\252\215\377q\0\0U" "\377\252\0\342\342\0U\377\252\0U\377\252\0\0\0\0\0\377\377\0\0U\377\306" "UU\306\377\306\0U\377\252\0\0\0\0\0\377\377\0\0U\377\377\377\377\377" "\3068\0\0\0U\342\377\377\342q\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0\0" "\0\0\377\377\0\0\0U\377\306\0\0\306\3778\0\0\0\377\377\34""8\377\215" "\0\306\377\0U\377\252\0\0\0\0\0\252\377\377\34\0\0\0\0\0\0\215\377\252" "\3778\0\0\0\0\0\0\342\377\34\0\0\0\0\0\0\0\0q\377\252\0\0\252\377\306" "\0\0\306\377U\0\215\377\215\0\0\0\0\0\377\377\34\0q\377\377\0\0\377\377" "\34\0q\377\252\0\0\377\377\0\0\0\342\377\34\0\0\342\377\34\0\252\377" "\306\0\0\252\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\34\377\377\34" "\0\0U\377\252\0\0U\377\306\0\0\252\377\306\0\0\377\377\0\0U\377\377\34" "\0U\377\252\0\0\377\377\34\0\34\377\377\0\0\252\377\306\0\0\306\377U" "\0U\377\306\0\0\306\377\252\0\0\377\377U\0U\0\252\377U\0\0\0\0\0\377" "\377\0\0\0U\377\252\0\0U\377\252\0\0\377\377\0\0\252\377q\0\342\3778" "\0\252\377\342\306\0\0\377\306\0\0U\377\306q\377\215\0\0U\377\306\0\0" "\252\377U\0\0\0\0q\377\215\0""8\377\306\0\0\0\306\377U\0\0U\377\252\0" "\0\0\0\0\0\0\377\377\0\0\0\0\0\0\306\377U\0\0q\377q\0\0\0\0\0\252\377" "U\0\0\0\0\0\0\252\377\377\306\306\377\342\34\0\0\0\0\0\252\377U\0\0U" "\377\377\377\342\34\0\0\252\377U\0\0\0\377\342\0\215\377q\0\0\34\377" "\377\0\0\0\377\252\0\0\0\0\0\0\0\0\0\0\0U\377\377\377\342q\0\0\0\0\252" "\377\34\34\377\306\0\252\377\34U\377\377\377\342\34\0\0\0""8\377\377" "\377\215\0\0\0\0\0\0\0""8\377\215\0\0\252\377U\0\0\0\0\252\377U\0U\377" "\377\377\377\377\377\377\377\377\0\0\0\34\342\377U\0\0\0\306\377\34\0" "\0\0\0\342\342\0\0\0""8\306\377\342q\34\0\0\0\0q\306\377\342q\0\0\0U" "\377U\0\0\0\0\0\0\377\377\252\0\0\0\0\0\377\377\252\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0""8\342\3778\0\0\0U\377U\0\0\0\0U\377U\0\0q\377\3068" "\0\0\0\342\342\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0U\306\0\0\306" "8\0\0\0""8\252\2158\0\0\0""8\0\0\0\0\377\252\0\0\377\252\0\0\0\0\0\0" "\0\0U\377\252\0\0\252\377q\0\0\0\252\377\306\252\252\342\377\342\34\0" "\252\377U\0\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0U\377\306UUUU\0\0" "\0\252\377\306\252\252\252q\0\252\377U\0""8\252\252\377\377\0\0\0\377" "\377UUUU\306\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377\215\377\377" "\34\0\0\0\0\252\377U\0\0\0\0\0\252\377UU\377UU\377UU\377\252\0\0U\377" "\252\0q\377UU\377\252\0U\377\252\0\0\0\0\0\377\377\0\0U\377\377\377\377" "\377\306\34\0U\377\252\0\0\0\0\0\377\377\0\0U\377\342\252\342\377\252" "\0\0\0\0\0\34\215\342\377\377\252\0\0\0\0U\377\252\0\0\0\0\252\377U\0" "\0\0\0\377\377\0\0\0\0\377\377\0\0\377\342\0\0\0\0\342\377UU\377U\0\252" "\377\34\215\377U\0\0\0\0\0\342\377\377q\0\0\0\0\0\0\34\377\377\306\0" "\0\0\0\0\0q\377q\0\0\0\0\0\0\0""8U\215\377\252\0\0\252\377q\0\0q\377" "\252\0\342\377\34\0\0\0\0U\377\306\0\0\34\377\377\0U\377\252\0\0\0\377" "\342\0\0\377\377\0\0\0\377\377\0\0\0\252\377U\0\252\377U\0\0\252\377" "U\0\0\377\377\0\0\0\252\377U\0\0\377\377\252\377U\0\0\0U\377\252\0\0" "U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0U\377\306" "\0\0\0\306\377U\0\252\377U\0\0q\377\252\0\252\377U\0\0q\377\252\0\0\377" "\377\0\0\0\0\215\377\3428\0\0\0\0\377\377\0\0\0U\377\252\0\0U\377\252" "\0\0\306\377U\0\306\377\34\0\252\377U\0\342\306\252\377\0U\377\252\0" "\0\0\306\377\342\342\0\0\0\0\377\377\0\0\377\377\0\0\0\0\34\377\342\0" "\0U\377\252\0\0\0\252\377U\0\0U\377\252\0\0\0\0\0\0q\377\306\0\0\0\0" "\34q\377\342\0\0\0\306\377\0""8\3778\0\0\252\377\215\252\252q\0\0\0\252" "\377\306\0\0\306\377q\0\0\0\0\34\377\377\0\0\34\342\377\306\342\377\252" "\0\0\252\377U\0\0\0\377\377\0\252\377U\0\0\0\377\377\0\0\0\377\252\0" "\0\0\0\0\0\0\0\0\0\0\0""8\252\377\377\377\342\34\0\0""8\377\377\377\377" "8\0\377\306\0\342\342Uq\377\252\0\0\34\342\377\377\377\34\0U\377U\0\0" "\0q\3778\0\0\252\377U\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377" "\306\0\0\0""8\377\215\0\0\0\0\0q\377U\0\215\377\306U\0\0\0\0\0\0\0\0" "\0""8\252\377\342\0\0U\377U\0\0\0\0\0\0U\252\34\0\0\0\0\0U\252\34\0""8" "UUU8\0\0\0\0\0\0\0\0\0\0\0\252\377\306\0\0\0\0U\377U\0\0\0\0U\377U\0" "\0\34\306\377\252\0\0\0\215\377\34\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0" "\0\0\0\0\0\0\0\0\0\0\0\215\377\377\377\377\306U\252\377\0\0\0\0\377\252" "\0""8\377q\0\0\0\0\0\0\0\0\252\377\252UU\252\377\306\0\0\0\252\377U\0" "\0\0\215\377\306\0\252\377U\0\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0" "U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\252\377U\0\0\0\0\377\377\0" "\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377" "U\306\377\306\0\0\0\0\252\377U\0\0\0\0\0\252\377U\0\377\252\252\377\34" "U\377\252\0\0U\377\252\0\34\377\306U\377\252\0U\377\252\0\0\0\0\0\377" "\377\0\0U\377\306UU8\0\0\0U\377\252\0\0\0\0\0\377\377\0\0U\377\252\0" "\34\342\377\215\0\0\0\0\0\0\0\252\377\377\34\0\0\0U\377\252\0\0\0\0\252" "\377U\0\0\0\0\377\377\0\0\0\0\306\377UU\377\252\0\0\0\0\252\377U\252" "\377\34\0U\377U\252\377U\0\0\0\0\215\377\306\377\377\34\0\0\0\0\0\0\306" "\377U\0\0\0\0\0\34\377\342\0\0\0\0\0\0U\377\377\377\377\377\252\0\0\252" "\377U\0\0U\377\252\0\377\377\0\0\0\0\0U\377\252\0\0\0\377\377\0U\377" "\377\377\377\377\377\377\0\0\377\377\0\0\0\342\3778\0\0\342\3778\0\252" "\377U\0\0\252\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\377\377\34" "\0\0\0U\377\252\0\0U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U" "\377\252\0U\377\252\0\0\0\252\377U\0\252\377U\0\0U\377\252\0\252\377" "U\0\0U\377\252\0\0\377\377\0\0\0\0\0\252\377\377\252\34\0\0\377\377\0" "\0\0U\377\252\0\0U\377\252\0\0q\377q\0\377\342\0\0U\377\252\34\377\252" "\215\3778q\377U\0\0\0""8\377\377q\0\0\0\0\306\377U8\377\306\0\0\0\0\252" "\3778\0\0U\377\252\0\0\0\252\377U\0\0U\377\252\0\0\0\0\0\34\342\377q" "\0\0\0\252\377\377\342\34\0\0\34\377\252\0U\377U\0\0\252\377\377\377" "\377\377\215\0\0\252\377U\0\0U\377\252\0\0\0\0q\377\252\0\0\252\377q" "\0\34\342\377q\0\215\377\252\0\0""8\377\377\0\252\377U\0\0\0\377\377" "\0\0\0\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\306\342\377\252\0\0\0" "8\252\2528\0""8\377\215U\377q\0\0\306\377\0\0\215\377\252U\377\342\34" "U\377U\0\0\0\306\377\0\0\0\252\377U\0\0\0\0\252\377U\0\34UUUUUUUUU\0" "\0\0\252\377U\0\0\0\0""8\34\0\0\0\0\0\0U\0\0q\377\377\306U\0\0\0\0\0" "\0\0""8\215\342\377\306\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\252\377\377\377\252\0\0\0\0\0\0\0\0\0\0\0\0\252\377q\0\0\0U\377U\0\0" "\0\0U\377U\0\0\306\377q\0\0\0\0U\377q\0\0\0\0\0\0\0\0\0\252\377\377\377" "\377\377\377\377\252\0\0\0\0\0\0\0\0\0\0Uq\0""8\306\377\377\377U\0""8" "\377\377\377\377\377\377\377\377\377U\0\0\0\0\0\0\377\377\377\377\377" "\377\377\377\34\0\0\252\377U\0\0\0\0\377\377\0U\377\252\0\0\0\0\0\0\0" "U\377\252\0\0\0\0\342\377\34\0U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0" "\0\0q\377\252\0\0\0\0\377\377\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377" "\252\0\0\0\377\377\0\0\0\252\377U\34\377\377q\0\0\0\252\377U\0\0\0\0" "\0\252\377U\0\306\342\306\306\0U\377\252\0\0U\377\252\0\0\252\377q\377" "\252\0\34\377\342\0\0\0\0""8\377\306\0\0U\377\252\0\0\0\0\0\0\34\377" "\342\0\0\0\0""8\377\306\0\0U\377\252\0\0""8\377\377\34\0\0\0\0\0\0\0" "\306\377U\0\0\0U\377\252\0\0\0\0\252\377U\0\0\0\0\377\377\0\0\0\0q\377" "\215\215\377U\0\0\0\0q\377\252\306\377\0\0""8\377q\342\377\0\0\0\0\34" "\377\377\34\306\377\252\0\0\0\0\0\0\252\377U\0\0\0\0\0\252\3778\0\0\0" "\0\0\34\377\377\215U\215\377\252\0\0\252\377U\0\0U\377\252\0\377\377" "\0\0\0\0\0U\377\252\0\0\0\377\377\0U\377\342\252\252\252\252\252\0\0" "\377\377\0\0\0q\377\342\252\306\377\306\0\0\252\377U\0\0\252\377U\0\0" "\377\377\0\0\0\252\377U\0\0\377\377\215\377\306\0\0\0U\377\252\0\0U\377" "U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0U\377\252\0\0\0" "\252\377U\0\252\377U\0\0U\377\252\0\252\377U\0\0U\377\252\0\0\377\377" "\0\0\0\0\0\0""8\342\377\342\0\0\377\377\0\0\0U\377\252\0\0U\377\252\0" "\0""8\377\252U\377\215\0\0\34\377\252U\377UU\377q\252\3778\0\0\0\215" "\377\377\342\0\0\0\0q\377\215q\377\215\0\0\0U\377\252\0\0\0U\377\252" "\0\0\0\252\377U\0\0U\377\252\0\0\0\0\34\342\377\252\0\0\0\0q\252\377" "\377\252\0\0\215\3778\0\215\377U\0\0U\377\215\0""8\377\377\34\0\252\377" "U\0\0U\377\252\0\0\0\0\306\377U\0\0\377\377\0\0\0U\377\252\0""8\377\377" "qU\342\377\377\0\252\377U\0\0\0\377\377\0\0\0\215U\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\377\252\34\377\377\0\0\0\0\0\0\0\0\215\3778U\377U\0\0\252" "\377\0\0\377\377\0\0U\377\342\342\377\34\0\0\0\377\252\0\0\0\252\377" "U\0\0\0\0\252\377U\0U\377\377\377\377\377\377\377\377\377\0\0\0U\252" "8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34q\342\377\377\2528\0\34\215\342\377" "\377\2158\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8UUU8\0\0" "\0\0\0\0\0\0\0\0\0\0\34\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\306" "\0\0\0\0\0\0\377\306\0\0\0\0\0\0\0\0\0q\252\252\306\377\306\252\252q" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34U\34\0\0""8\252\306\377\306\252\342" "\377\252\252\34\0\0\0\0\0""8\377\377UUUU\342\377q\0\0\252\377U\0\0\0" "\34\377\377\0\34\377\377\34\0\0\0\0\0\0U\377\252\0\0\0""8\377\342\0\0" "U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\34\377\377\34\0\0\0\377\377" "\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252" "\377U\0\215\377\342\34\0\0\252\377U\0\0\0\0\0\252\377U\0\215\377\377" "\215\0U\377\252\0\0U\377\252\0\0""8\377\306\377\252\0\0\342\377\34\0" "\0\0q\377\215\0\0U\377\252\0\0\0\0\0\0\0\342\377\34\0\0\0q\377\215\0" "\0U\377\252\0\0\0\306\377q\0\0\0\0\0\0\0\252\377U\0\0\0U\377\252\0\0" "\0\0\252\377q\0\0\0\34\377\377\0\0\0\0\34\377\252\252\377\0\0\0\0\0U" "\377\252\377\252\0\0\0\377\252\377\377\0\0\0\0\306\377\215\0""8\377\377" "8\0\0\0\0\0\252\377U\0\0\0\0""8\377\306\0\0\0\0\0\0U\377\252\0\0U\377" "\252\0\0\252\377q\0\0q\377\215\0\306\3778\0\0\0\0""8\377\306\0\0\34\377" "\377\0\34\377\306\0\0\0\0\0\0\0\377\377\0\0\0\0\342\377\377\377\215\34" "\0\0\252\377U\0\0\252\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\0\342" "\377q\0\0U\377\252\0\0U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0" "\0U\377\252\0\34\377\342\0\0\0\342\377\34\0\252\377\215\0\0q\377\215" "\0\215\377q\0\0\215\377\252\0\0\377\377\0\0\0\0\0\0\0\0\306\377U\0\377" "\377\0\0\0U\377\252\0\0q\377\252\0\0\0\342\377q\377U\0\0\0\342\377\215" "\377\34\0\377\252\306\377\0\0\0""8\377\306\306\377\215\0\0\0\34\377\306" "\252\3778\0\0\0\342\342\34\0\0\0\34\377\377\0\0\0\377\377\0\0\0U\377" "\252\0\0\0\34\342\377\252\0\0\0\0\0\0\0\34\342\377q\0\342\342\0\0\252" "\377U\0\0\0\0\0\0\0\252\377U\0q\377q\0\0q\377\215\0\0\0\34\377\377\0" "\0\0\377\377\0\0\0U\377\252\0\0U\377\377\377\252\377\377\0q\377\252\0" "\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\377\377\0" "\0\0\0\0\0\0\0\306\342\0U\377U\0\0\252\377\0\0\377\377\0\0\0U\377\377" "\306\0\0\0U\377U\0\0\0U\377\252\0\0\0\0\342\377\0\0\34UUUUUUUUU\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\252\377\252\0U\377\306" "q\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252" "\0\0\0\0\0\0\252\377\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\215\377\34\0\252\377\0\0\0\0\0\0\0\0" "\215\377\252\0\0\0\0\252\377\252\0\0\252\377U\0\0\34\252\377\306\0\0" "\215\377\3068\0\34U\0\0U\377\252\0\0""8\342\377q\0\0U\377\252\0\0\0\0" "\0\0\0\252\377U\0\0\0\0\0\0\252\377\3068\0\0\377\377\0\0\0\377\377\0" "\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377U\0\34\342\377" "\215\0\0\252\377U\0\0\0\0\0\377\377\0\0U\377\377U\0\0\377\377\0\0U\377" "\252\0\0\0\342\342\377\252\0\0q\377\342\34\0U\377\377\34\0\0U\377\252" "\0\0\0\0\0\0\0q\377\342\34\0U\377\377\34\0\0U\377\252\0\0\0q\377\342" "\0\0\252U\0\0q\377\342\0\0\0\0U\377\252\0\0\0\0U\377\3428\0\34\252\377" "\215\0\0\0\0\0\342\377\377\306\0\0\0\0\0\34\377\252\377\215\0\0\0\306" "\252\377\252\0\0\0""8\377\342\34\0\0\306\377\306\0\0\0\0\0\252\377U\0" "\0\0\0\306\3778\0\0\0\0\0\0U\377\306\0\34\342\377\252\0\0\252\377\342" "\34\34\342\377U\0q\377\306\34\0\34\0\0\377\377U\0\252\377\377\0\0\342" "\377q\0\0U\34\0\0\377\377\0\0\0""8\377q\0\0\0\0\0\0\252\377U\0\0\252" "\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\0q\377\342\34\0U\377\252" "\0\0U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0\0\306" "\377U\0U\377\342\0\0\252\377\342\34\34\342\377U\0U\377\342\34\34\342" "\377\252\0\0\377\377\0\0\0\0UU\0\0\306\377U\0\377\377\34\0\0U\377\306" "\0\34\342\377\252\0\0\0\252\377\252\377\0\0\0\0\252\377\252\377\0\0\306" "\306\377\252\0\0\0\342\3778\34\377\377\34\0\0\0\306\377\342\377\0\0\0" "\215\377q\0\0\0\0\0\306\377q\0\215\377\306\0\0\0U\377\252\0\0U\377\377" "\252\0\0\0\0\0\0\0\0\0U\377\252U\377\342\252\252\342\377\306q\0\0\0\0" "\0\0\252\377U\0\34\377\342\34\34\342\3778\0\0\0q\377\252\0\0\0\306\377" "\215\0\34\306\377q\0\0\0\34U8\34\377\306\0\34\377\377\34\34\306\377q" "\0\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\215U\0\377\306\252\377\252\0\0\0" "\0\0\0\0\34\377\252\0\0\377\306\0\34\377\306\0\0\306\377\252\34\0U\342" "\377\252\0\0\0\252\377\34\0\0\0""8\377\252\0\0\0\0\377\342\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\34""8\0\34\34\0\0\0\0\0\0\0\0U\377U\0\34\342\342\34\0\252\377U\34" "\342\342\34\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252" "\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0\0\0q\377U\0\0\0\0\0\0" "\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252" "\377\0\0\306\342\0\0\0\0\0\0\0\0\306\377U\0\0\0\0U\377\377\0\0\252\377" "\377\377\377\377\377\342\34\0\0\0\252\377\377\377\377\377\34\0U\377\377" "\377\377\377\377\252\0\0\0U\377\377\377\377\377\377\342\0\0\252\377U" "\0\0\0\0\0\0\34\306\377\377\377\377\377\377\0\0\0\377\377\0\0\0\0\252" "\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377U\0\0q\377\3778\0\252\377" "\377\377\377\377\377\0\377\377\0\0\0UU\0\0\0\377\377\0\0U\377\252\0\0" "\0q\377\377\252\0\0\0\252\377\377\377\377\377U\0\0\0U\377\252\0\0\0\0" "\0\0\0\0\252\377\377\377\377\377\3428\0\0U\377\252\0\0\0""8\377\3778" "U\377\377\377\377\377\377U\0\0\0\0U\377\252\0\0\0\0\0\252\377\377\377" "\377\377\342\34\0\0\0\0\0\215\377\377q\0\0\0\0\0\0\377\377\377U\0\0\0" "\252\377\377\252\0\0\0\342\377q\0\0\0\34\377\377q\0\0\0\0\252\377U\0" "\0\0\0\377\377\377\377\377\377\377\377\0\0\342\377\377\377\342\377\252" "\0\0\252\377\306\377\377\377\342\0\0\0\342\377\377\377\377\34\0\215\377" "\377\377\342\342\377\0\0""8\377\377\377\377\377\215\0\0\377\377\0\0\0" "8\377\377\377\377\377\306\34\0\252\377U\0\0\252\377U\0\0\377\377\0\0" "\0\252\377U\0\0\377\377\0\0\306\377\252\0""8\377\377\377UU\377U\0\0\252" "\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0\0""8\377\377\377\377\377" "8\0\0\252\377\377\377\377\377\306\0\0\0\306\377\377\377\377\377\252\0" "\0\377\377\0\0\0\0\377\377\377\377\377\306\0\0\342\377\377\342\0\34\377" "\377\377\377\306\377\252\0\0\0U\377\377\252\0\0\0\0q\377\342\252\0\0" "\252\377\377\215\0\0q\377\252\0\0\215\377\306\0\0\0q\377\377\252\0\0" "\0\377\377\377\377\377\377U\0""8\377\377\377\377\342\34\0U\377\377\377" "\377\377\0\252\377\377\377\377\377\377U\0\0\0\0\0U\377\252U\377\377\377" "\377\377\377\377\252\0\0\0\0\0\0\306\3778\0\0\215\377\377\377\377\252" "\0\0\0\0\306\377U\0\0\0""8\342\377\377\377\377\342\0\0\0\0\0\0\0q\377" "\215\0\0\215\377\377\377\377\252\0\0\0\252\377\377\0\0\0\0\0\0\0\0\0" "\0U\377\377\377\377\377\377\342\34\0\0\0\0\0\0\0U\377U\0\0\215\377\377" "\377\3778\0\0\34\342\377\377\377\377\377\306\377\252\0\0\342\306\0\0" "\0\0\0\377\377\0\0\0""8\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" "\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0U\377U\0U\377\377U\0\377\377\252U\377\377U\0\377\377\252\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0" "\377\252\0\0\0\0\0\0\34\377\252\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\306\342\0\0\377\252\0\0\0\0" "\0\0\0\0\252\252\34\0\0\0\0\0\252\252\34\0q\252\252\252\252\252q\34\0" "\0\0\0\0""8\252\252\252U\0\0""8\252\252\252\252\2528\0\0\0\0""8\252\252" "\252\252\252\252\215\0\0U\252\34\0\0\0\0\0\0\0\0U\252\252\252q\34\0\0" "\0\252\252\0\0\0\0q\2528\0\0""8\252q\0\0\0\377\377\0\0\0q\2528\0\0\0" "\215\252q\0q\252\252\252\252\252\252\0\252\252\0\0\0\0\0\0\0\0\252\252" "\0\0""8\252q\0\0\0\34\252\252q\0\0\0\0U\252\252\2158\0\0\0\0""8\252q" "\0\0\0\0\0\0\0\0\0U\252\252\215q\377\377\252\0""8\252q\0\0\0\0\215\252" "8\0U\215\252\252\215\34\0\0\0\0\0""8\252q\0\0\0\0\0\0U\252\252\252q\0" "\0\0\0\0\0\0""8\252\252\34\0\0\0\0\0\0\215\252\252\34\0\0\0U\252\252" "8\0\0""8\252\252\0\0\0\0\0q\252q\0\0\0\0q\2528\0\0\0\0\252\252\252\252" "\252\252\252\252\0\0\34\215\252q\34\252\252\0\0q\252\0\215\252\215\34" "\0\0\0\0q\252\252\215\34\0\0q\252\252\34q\252\0\0\0\34\215\252\252q\34" "\0\0\252\252\0\0\0\0q\252\252\252\306\377\306\0q\2528\0\0q\2528\0\0\252" "\252\0\0\0\252\377U\0\0\252\252\0\0""8\252\252\0\0q\252\252\34""8\252" "8\0\0q\2528\0\0\252\252\0\0""8\252q\0\0""8\252q\0\0\0\34\215\252\215" "\34\0\0\0\252\377U\215\252\215\34\0\0\0\34\215\252\215U\377\252\0\0\252" "\252\0\0\0\0""8\215\252\252q\0\0\0\34\252\252\215\0\0""8\252\252U\0\252" "q\0\0\0\0\252\252U\0\0\0\0\34\252\252U\0\0""8\252\2528\0\0\252\252\34" "\0\0\34\252\252\34\0\0\0q\377q\0\0\0\252\252\252\252\252\2528\0\0\34" "\215\252\215\34\0\0""8\252\252\252\252\252\0q\252\252\252\252\252\252" "8\0\0\0\0\0\306\377q\0\0\0\0\0\252\377U\0\0\0\0\0\0""8\377\342\0\0\0" "\0U\252\252q\0\0\0\0\34\377\377\0\0\0\0\0\34\215\252\252q\0\0\0\0\0\0" "\0\0\342\3778\0\0\0""8\252\252q\0\0\0\0\34\252U\0\0\0\0\0\0\0\0\0\0\0" "U\252\252\377\342q\0\0\0\0\0\0\0\0\0\252\377\0\0\0\0q\252\2528\0\0\0" "\0\34q\252\252q\34\0\342\215\0""8\377\215\0\0\0\0\0\252\3778\0\0q\377" "U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\252\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\306\3778\0q\377\215" "\0\215\215\0\0U\252\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252" "\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0\0\0\0\342\342\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\252q\0\0\252U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\252" "\0\0\0\0\306\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0U\377\252\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\306\3778\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\306\377" "\342\0\0\0\0\0\0\252\377U\0\0\0\0\34q\377\377U\0\0\0\0\0\0\0\0\0\0\0" "\0q\377\306\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\342\377\252\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0\0\0\0\0\0" "\0\0\0\252\215\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\3778\0\0" "\0\0\0""8\377\215\0\0\306\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377" "U\0\34\377\252\0\0\306\342\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\377\342\0\0\0U\377U\0\0\0\0U\377U\0""8\377\252\0\0\0\0" "\0\0\0\215\3778\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0q\377\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34""8\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\342\377\215\0\0""8\342\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34" "\342\3778\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0U" "\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377" "\306\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0U\377\377\377\377\306\34\0\0\0\0\0\0\252\377U\0\0\252\377\377\377" "\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377q\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\252\377\377\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\252q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0q\252\0\0\0\0\0\0\0\252\215\0\0\342q\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0U\377U\0\34\215\0\0\0\215\34\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0U\377\377\377\377\377\377\377\377\377U\0\0\252\377\377\252" "\0U\377\377\377UU\377\377\377U\252\377\377q\0\0\0\0\0\0\0""8\2528\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0""8\377\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\377" "\377\377\377\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\342\377\252\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0U\377\252\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377\3778\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34\252\252" "q8\0\0\0\0\0\0\0\0""8U\34\0\0U\252\252U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\252q8\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\34UUUUUUUUU\34\0\0\34\215\252q\0""8\252\252\252" "88\252\252\2528q\252\215\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2158\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\215\252\252q\34\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0Uq\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\2528\0\0\0" "\0\0\0\0\0\0\0\0""8\252q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\34\252\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; static DFBSurfaceDescription font_desc = { flags : DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED, width : 824, height : 21, pixelformat : DSPF_A8, preallocated : {{ data : (void *) font_data, pitch : 824 }} }; DirectFB-1.2.10/ltmain.sh0000644000175000017500000060646710752724413012006 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION="1.5.26 Debian 1.5.26-1ubuntu1" TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "\ $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; *.sx) xform=sx ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$deplibdir/$depdepl" ; then depdepl="$deplibdir/$depdepl" elif test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" else # Can't find it, oh well... depdepl= fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) case " $deplibs" in *\ -l* | *\ -L*) $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;; esac if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then major=`expr $current - $age` else major=`expr $current - $age + 1` fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then case $archive_cmds in *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; esac else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) case " $deplibs" in *\ -l* | *\ -L*) $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;; esac if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: DirectFB-1.2.10/TODO0000644000175000017500000000430711164361026010632 00000000000000Incomplete (roughly sorted by priority) --------------------------------------- New Surface Core - Test DSCAPS_STATIC_ALLOC. - Revive depth buffers. - Revive CSLF_FORCE for locking buffers in(to) INTERNAL memory. - Revive surface setinels. - Fix preallocated surface acceleration. - Finish FBDev surface pool using the old surface manager code. - Fix pool/gfxcard init order (using workaround at the moment). - Defragment free space. - Readd auxiliary memory pool using its own instance of the manager. - Get all system modules working again. - Probably more modules and tools need updates... - v4l video provider - Make use of Read/Write if locks for CPU are not possible and implement an OpenGL based system module with OpenGL acceleration. IDirectFBSurface::Flip() with multiple regions. Support rotated screens (180 is implemented). Support vga16, i.e. add DSPF_LUT4. Move config system to libdirect with more features and much smaller/generic code. Finish VT switching. - Save/restore video only buffers. - Handle(?) buffers being permanently locked in video memory. - Support(?) switching during exclusive access to a layer. Write well documented driver skeletons. Finish implementation of cooperative levels. Finish module unloading (done for most cases). Convert all D_DEBUG usage to D_DEBUG_AT using some D_DEBUG_DOMAINs. Implement debug levels, one setting per domain. Modularize pixel formats (eventually with dynamic extension support). Run time single/multi app core selection (both enabled during build). Add core cursor component with animated shape support and better integrated changes caused by entering different windows. Implement CoreFont sharing between applications to save glyph rendering and surface allocations. Add cooperative levels to input devices, implement sharing/distinction for applications (e.g. PS/2 Keyboard + PS/2 Mouse driver XDirectFB on Monitor out, USB-Keyboard + USB-Mouse drive XDirectFB and/or other applications on TV Out, USB-Wacom Tablet with mouse and pen can be assigned or switched to either, preferrably during runtime) Virtual window resolution with scrolling/panning. Rework cursor and palette handling in the window stack. [...lots of things missing here...] DirectFB-1.2.10/NEWS0000644000175000017500000051703311307522550010646 000000000000001.2.10 ------ Some minor edits to align with SaWMan. The main reason is to make the SaWMan release easier, and not relying on too many macros in it - so we add a few enums and whatnots: DSFLIP_ONCE DWEF_REPEAT dfb_updates_deinit() This release does not break or extend the ABI. 1.2.9 ----- Several bugfixes that already flowed into the 1.4.x branch are now backported. The main reason for shipping 1.2.9 is support for the 1.4.x SaWMan branch; several API features that are required by SaWMan have been added. DirectFB 1.2.9 is required for SaWMan 1.4.2 and upwards. API changes - Add application_id to a window with IDirectFBWindow_Set/GetApplicationID - dynamic window association via IDirectFBWindow::SetAssociation() - add DWCAPS_COLOR to the window capabilities - allow the window config value "color" to colorize the window config - add missing include path for builddir != srcdir - fixed missing JPEG=yes setting when LIBJPEG is set manually - fix so trace will also print static funcs in stack dump drivers - fbdev: fixed RGB fields sizes in dfb_fbdev_set_gamma_ramp - fbdev: fix for BGR555 - input: Implement driver_get_axis_info() in the linux-input driver core - consistently use doubles to calculate the inverse scale factors - fix timing problems with vt-switching - prevent deadlock when destroying context - don't touch the module entry after dlclose() to prevent segfault - fix for switching source from surface to surfaceless (video). - add support for the DESTINATION Porter/Duff rule gfx - Bugs in pixel format convertion fixed (primarily 16 bit formats) - converting to RGB32 sets alpha to ff - buffer unlocking fixes in error paths - jpeg: plug mem leak on file read error and several other bugfixes. 1.2.8 ----- Fusion - update to use new 'unified' fusion kernel module. When using multi-app, please use fusion 8.1.1 or newer. Core - Added IDirectFBSurface::Read and ::Write - small fix to local "System Memory" pool cleanup 1.2.7 ----- Config - added config option to override module search dir. - read /proc/self/cmdline if DirectFBInit() does not receive argv/argc. - added option to override initial screen size. - Fix build when srcdir != builddir. Core - added documentation for blend functions and some desktop-buffer-mode options - better out-of-memory error handling - fixed alpha handling for palette SetEntriesYUV - rectified changes to surface policy in case a surface is allocated again, of reallocated - fixed memory leak in local "System Memory" pool when deallocating due to IDirectFB::Release Systems - fbdev: Fixes for pan & zoom functionality Gfxsystems - matrox: Wrong chroma plane offset was being used with deinterlace blits. - omap: Added omapfb.h to release zipfile. - SH772x: LCD parameters not obtained via fbdev ioctl - SH772x: improved JPEG Encode/decode performance, JPEG fixes, JPU by default disabled due to conflicts - SH772x: detection broadened to SH772x revisions Input - Fix possible array overruns - added direct_modules_unregister() when unloading the module - linuxinput: Fix LED handling, Count KEY_M - font loading: Support premultiplied font formats. - Video4Linux: add sources to release zipfile. Conform v4l and v4l2 to new core architecture. libfusion - fixed skirmish wait argument not taken as msec but usec Tools - dfbdump: fixed to show correct buffer allocation sizes for certain formats. 1.2.6 ----- Core - Call fusion_stop_dispatcher() before destroying pools to fix lots of shutdown issues. WM Core - Lots of useful debug messages. libfusion - Added fusion_stop_dispatcher() to be called before destroying pools etc... fixing lots of shutdown issues! libdirect - Added direct_thread_wait() / _notify(), _lock(), _unlock() and _terminate(). - Added some debug messages to DirectInterface code. Utilities - Added dfb_updates_get_rectangles() for convenience, doing bounding box trade off etc... X11 System - Fixed remaining crash with expose events that ran into a NULL window. 1.2.5 ----- Fonts - Fixed alignment on eight byte boundary, thanks to Nikita Egorov! Software Rendering - Don't switch to fill rectangle in DrawLine() if matrix is used. SH772x - More fixes for JPEG encoding with up/down scaling and offset. 1.2.4 ----- API | IDirectFBInputDevice - Added DFBInputDeviceAxisInfo(Flags) with DIAIF_ABS_MIN/MAX flags and abs_min/max fields. - Added DIEF_MIN/MAX and min/max to DFBInputEvent, e.g. for axis boundaries. API | IDirectFBWindow - Added DWCAPS_NOFOCUS: window will never get focus or receive key events, unless it grabs them. Runtime Options - New option "[no-]software-trace" to show every stage of the software rendering pipeline. Build Options - Switch to pkg-config for SDL and FreeType2, thanks to Keith Mok! Graphics Core - Only have DSRO_MATRIX be mandatory for now. Other flags no longer prohibit acceleration. Worst case was when DSRO_SMOOTH_UP/DOWNSCALE was turned on globally via "smooth-upscale" or "smooth-downscale" runtime option which caused all operations to use software fallbacks, not only StretchBlit()! Input Core - Added GetAxisInfo() to InputDriverFuncs to query information about one axis. Make use of it in input_driver.h only if driver has defined DFB_INPUTDRIVER_HAS_AXIS_INFO to avoid having to change all input drivers. - Query axis information from driver and put it into events. Layer Core - Set background mode of new contexts to DLBM_DONTCARE. Pixel Formats - Rewrote YCbCr<->RGB conversion routines without lookups which are much more expensive on embedded devices. - Fixed many NV12, NV16 and NV21 code areas, mostly for big endian. Software Rendering - Rewrote Dacc_RGB_to_YCbCr_C and Dacc_YCbCr_to_RGB_C using Duff's device with macros. Conversion also supports 4:4:4 by this change, not optimizing for 4:2:x cases. - Get rid of YUV tables saving 5k binary size! - Added optimized Bop_argb_blend_alphachannel_one_invsrc_Aop_argb() -> 6x speed Utilities - Added exported dfb_pixelformat_names[] and replaced relevant code. libdirect - Important fix for having multiple interface implementations in one module. - Added file and symbol lookup functions to trace code for external usage. New functions are direct_trace_lookup_file(), direct_trace_lookup_symbol() and a convenience function combining the above called direct_trace_lookup_symbol_at(). - Fixed missing magic value in thread structure created for non-direct threads. Davinci Driver - In ARGB OSD dithering use task buffer and add missing locks. - Raise OSD surface pool priority to allocate in frame buffer rather than /dev/mem. - Workaround broken DSP cache invalidation function. SH7722 Driver - Build only for SH4. - Fixed missing update of rendering destination buffer. - Fixes for JPEG encoding with conversion, cleanups... - Fixed software fallback for JPEG decoding to unsupported formats. SH7723 Driver - Added support for SH7723 to SH7722 driver and kernel module. Default WM - Use min/max values from absolute axis motion events if present. - Implemented DWCAPS_NOFOCUS. X11 System - Update X11 system module with cleaned up code from 1.3.x. - Fixes in input driver and layer output. JPEG Image Provider - Fix direct decoding to NV16 (no to+from RGB) for little endian. dfbtest_blit - Added test program for (Stretch)Blit with an image from file. 1.2.3 ----- X11 System - Fixed new bug with reopening X11 window when layer resizes. 1.2.2 ----- API | IDirectFBSurface - Added missing layer context locking around dfb_wm_get_insets() in IDirectFBSurface_Window_Construct(). API | IDirectFBWindow - Added missing locks around direct dfb_wm_... calls... API | Utilities - Generate name/value pairs for DFBWindowCapabilities and DFBWindowOptions. Layer Core - Fixed failing context lock assertion in dfb_wm_close_stack() by locking in context destructor. - Added debug message to print context being returned by dfb_layer_get_active_context(). Window Core - Avoid recursive dfb_wm_close_stack() caused by SaWMan's CloseStack() unref on the layer region. This issue happens only in single app build, where the layer region constructor gets called synchronously and destroys the window stack structure before the dfb_wm_close_stack() has finished. Fixed by calling CloseStack() at the end dfb_wm_close_stack(), moving the list removal and flag clearing before the call and freeing the stack data in dfb_windowstack_destroy() or recurring dfb_wm_init_stack(). - Fixed crash in window destructor caused by (un)locking the stack. - In dfb_wm_close_all_stacks() lock each context and temporarily ref it for following unlock. libdirect - Added DirectUnregisterInterface() and destructor to call it. - Added magic value to interface implementation structure and use D_CALLOC/D_FREE. libfusion - Fixed single app skirmish lock counting (copy'n'paste bug). Default WM - Avoid most of the recursive calls of wind_of_change(). - Make sure window has a surface before restoring its size when disabling scaling. X11 System - Fixed race condition and X error when switching resolution quickly. - Implemented primaryRemoveRegion() with a new call to destroy the X11 window. - Improve shutdown behaviour of X11 module. Certain race conditions at shutdown prevented, leading to lock or crash. x11input and x11 modules combined into one. dfbmaster tool - Added very simple dedicated master for safety, stability or enhanced testing pleasure. 1.2.1 ----- API | IDirectFBSurface - Added MakeSubSurface() to make this surface a sub surface or adjust the rectangle of this sub surface. - Fix Lock() on layer surfaces with system memory back buffer. This reverts commit 4cc82baddbc3a9849c2ff6c4979a65bcfb6ba96b and fixes GetFramebufferOffset() properly by not adding CSAF_GPU_READ in Lock(), but checking if there's a physical address provided by the surface pool via the buffer lock in GetFramebufferOffset(). API | IDirectFBImageProvider - Added simple WriteBack() method for encoding surface data. Runtime Options - New option "warn=" to print warnings on surface/window creation or surface buffer allocations. Example: 'warn = allocate-buffer:300x300' - Prints a warning for every surface buffer allocation made with both width and height of 300 or above. - Added "keep-accumulators = " to allow freeing of accumulators above the limit. Setting -1 never frees accumulators until the state is destroyed (previous behaviour). The default is 1024 which already means up to 16kB are kept! - Allocate palette on demand saving 16kB of the 60kB allocated until after DirectFBCreate(). Layer Core - Fix failing assertion due to recent code cleanup. Surface Core - Cleanup complex assertions, no CORE_SURFACE_ALLOCATION_ASSERT within CORE_SURFACE_BUFFER_LOCK_ASSERT, only D_ASSERTs. - A bit more debug when locking buffers. - Use convenience functions where possible, e.g. dfb_surface_lock_buffer() instead of dfb_surface_get_buffer() and dfb_surface_buffer_lock() etc. - Implemented strategy for surface allocations when pools are out of memory. - Extended dfb_surface_pools_negotiate() to return a list of capable pools order by priority including pools out of memory at the end of the list. - Added MuckOut() to the surface pool API to tag all allocations for removal to free up memory for a new allocation. If not provided by the pool, a fallback implementation will do the job, but that's not implemented yet. - Added dfb_surface_pool_displace() to muck out and backup allocations and do the new allocation. - Moved allocate_buffer() from surface buffer to surface pool code as dfb_surface_pools_allocate() with extended negotiation using a list of possible pools and with ability to muck out allocations. - Changed static update_allocation() to exported dfb_surface_allocation_update(). - Added dfb_surface_trylock() for a fusion_skirmish_swoop() on the surface lock. - Call dfb_surface_lock() and dfb_surface_unlock() in surface_destructor(). - Moved surface core initialization before system module to have generic pools always at the same position (with the same pool IDs). - Keep an ordered list of surface pool IDs based on priority. - Have a pointer to a backup pool in every pool which is set to the shared memory surface pool by default. - Enhanced backup strategy when mucking out allocations. - First check if any of the existing allocations is up to date, otherwise try to update one of the existing allocations. - Enforce same order of joining pools as of initializing them. - Fixed invalid 'buffer->written' allocation pointer when using "thrifty-surface-buffers" option. - Fixed wrong order of joining surface pools in slaves. - Fixes for mucking out multiple allocations. - Use fusion_ref_set_name() to show the same info as with the skirmish. - Cleanup buffer initialization and reset with two new convenience functions. - Other fixes and enhanced debugging output. Surface Manager (FBDev, DevMem, X11 Virtual Physical testing pool) - Enhancements to surface manager code and fixes for old behaviour (without virtual physical surface pool). - Extend dfb_surfacemanager_displace() to check policies, reimplement toleration code and take free space before and after an occupied chunk into account. - Cleanup dfb_surfacemanager_allocate() to only check for free chunks. - Always initialize x11(Shm)Image surface pool, regardless of virtual physical surface pool being enabled. - Never fail in x11TestConfig() if virtual physical surface pool is not enabled, but use Fusion shared memory allocations as a fallback (previous behaviour). - Update allocation size from chunk length which is usually bigger (at least 16 bytes of safety area). - Enhance surface manager to find the best matching group of allocations to muck out. - This is the first time multiple smaller allocations can be mucked out for a bigger one. The code that determines these allocations is still O(1) and finds the best matching group within all possible combinations. Window Core - Shutdown fixes in the window management and new flags for the state of the stack. - Added CoreWindowStackFlags with CWSF_INITIALIZED and CWSF_ACTIVATED to CoreWindowStack. - In dfb_wm_close_all_stacks() simply call dfb_wm_close_stack() for any stack with CWSF_INITIALIZED set. The previous code did only half of it, just clearing context->stack pointer and clearing the magic value resulting in the notification handler for the background image accessing a stack structure without magic. - In dfb_wm_close_stack() first deactivate the stack if CWSF_ACTIVATED is set. - Safe state handling in dfb_wm_set_active(). - Moved magic value set/clear from wm.c to windowstack.c where the structure is allocated and freed. - Check return value of dfb_wm_init_stack(). libfusion - Fixed dead lock with references in single app mode. fusion_ref_zero_lock() no longer leaves the mutex locked. Turned 'waiting' into 'locked' to keep size for binary compatibility. - Print warning for FUSION_CALL_RETURN if caller could not receive result due to a signal. - Clear object list (pointer to NULL) after cleanup for safety. - Added fusion_ref_set_name(), e.g. for better debug information on object references. Conversion - Added conversion to RGB555 and from AYUV (added to all conversion functions). SH7722 Driver - Added hardware JPEG encoding support, code moved into library, JPEG lock and buffer allocation in kernel VMWare Driver - Fixed copy'n'paste bug in virtual driver. Keyboard Input Driver - Only become active if FBDev or DevMem is used to avoid grabbing keyboard from X11 for example. DevMem System - Partially reverted cleanup of surface manager code. The workaround for the surface manager creation happening before graphics driver initialization with possible dfb_gfxcard_reserve_memory() calls is still required. - Update surface manager code from X11 virtual physical testing pool. FBDev System - Update surface manager code from X11 virtual physical testing pool. X11 System - Take first matching visual for each format instead of last and handle RGB32 and ARGB separately (depth 24 and 32). - Fixed bytes per pixel and pitch calculation for fallback XCreateImage() when no XShm is available. - Output ARGB when depth is 32, support AYUV input (layer format). - XShm fixes and new virtual physical surface pool for development and testing. - Specifying 'video-length = ' option will create a shared memory block of that size and initialize a surface pool with a surface manager supporting the new MuckOut() call. - Changed x11(Shm)Image pool to only allow allocations for supported visuals (no fallback shared memory allocations) when the new option is used. - Return accelerator ID 51 for testing with the virtual acceleration (currently called vmware). - Make usage of XShmQueryVersion() to check for XShm support. - Return accelerator as set in config. - Set buffer lock offset in fallback mode to satisfy assumption in surface core. - Other cleanups and fixes. dfbdump tool - Show capacity in pool info (with "-p") and only dump shared or explicitly specified surfaces to avoid crashes. dfblayer tool - Add testing Lock() with read/write, read only or write only. 1.2.0 ----- Overall - Minor fixes and cleanups, fixed compiler warnings etc. - Debugging messages and utility macros have been added. API | IDirectFB - Added sanity limit of 20480x20480 to CreateSurface(). - Fixed input device enumeration and event collection for devices without caps. API | IDirectFBFont - Bug fixes in GetStringBreak(), thanks to Keith Mok! API | IDirectFBSurface - Don't build hierarchy of sub surfaces internally, if start-stop is not used (speeds up sub surface construct/destruct). - Optimized DrawLines() to use rectangle filling if all lines are horizontal/vertical. This allows hardware acceleration to be used, e.g. in GTK+ using gdk_directfb_draw_segments() a lot with only horizontal and vertical lines for widgets. API | IDirectFBVideoProvider - Fixed copy'n'paste(?) bug in SetStreamAttributes() argument. The argument was DFBStreamDescription, but obviously should be DFBStreamAttributes. Pixel Formats - Added BGR555 as a new pixel format, thanks to GARDET Guillaume! Runtime Options - Added "[no-]cursor-updates" to never show a cursor, but still handle it. - New runtime option "thread-priority-scale=<100th>" to apply a scaling factor on thread type based priorities. Graphics Core - Removed dfb_gfxcard_sync() call from slave leaving procedure. - Added CCF_RENDEROPTS that needs to be set by the driver to allow acceleration when != DSRO_NONE. Input Core - Only suspend the input core during shutdown if it has been initialized already. - If a device has no caps at all, let it match with any caps being requested. Layer Core - Added CLRCF_FREEZE for dfb_layer_region_set_configuration() to set CLRSF_FROZEN. Changes are not applied until dfb_layer_region_flip_update() is called. - Check if region surface is system only and avoid using CSAF_GPU_READ which would fail. - Keep a list of window stacks, added dfb_wm_close_all_stacks() called early during core shutdown. Software fallbacks - Dacc_premultiply_color_alpha() also needs Cacc.a to be set, thanks to Mandy Wu for spotting! libdirect - Important Fix: Actual realloc() was missing in runtime-disabled debug mode (default). - Remove check on element in direct_list_contains_element_EXPENSIVE() used for debugging. When checking for existence in a list, avoid crashes due to already freed elements being passed in as a pointer and checked for existence in a list. TI Davinci driver - Added scaling support to video layer using the Davinci Resizer. - Added local task buffer for preparing a list of commands and send at once (CPU load reduced). - Fixed timeout detection in DAVINCI_IOCTL_WAIT_LOW. - Fix kernel module Makefile for newer kernels. - Use FBIO_GET_TIMING to query screen size. - Build and install a library and header files. - Update allocations during Lock(). - Allow external definition of DAVINCI_C64X_IDLE_MAX for c64xdump tool. - Added lots of debug messages to 2D acceleration. - Set StretchBlit() hook statically. - Replaced all hard coded addressing of 32MB DSP working area by DAVINCI_C64X_MEM. DAVINCI_C64X_MEM is defined in to be 0x8e000000 if not defined from outside. - Moved call to set buffer start address to videoUpdateRegion(). Also made videoSetRegion() very lightweight, e.g. when only the surface is changed. - Commented out davinci_c64x_write_back_all() in EngineSync() which is still not working properly anyhow. CirrusLogic EP9xx - New driver, thanks to Brian Austin! DGIFF Font - Revival of the DGIFF (DirectFB Glyph Image File Format). Thanks to Vaclav Slavik! FBDev System - Ignore panning errors as before. X11 System - Fixed double wheel events by discarding ButtonUps. - Added missing check of layer pixel format based on conversion routines available. - Don't use XShm for offscreen surfaces, but always use Fusion SHM. Keyboard Input driver - Make driver usable without fbdev/vt just for the sake of a keymap. Linux Input driver - Thanks to Phil Endecott for adding F13 to F24 support! directfb-config - Teach directfb-config about SYSROOT and removes -L/usr/X11R6/lib, thanks to Marc Kleine-Budde! 1.2.0-rc1 --------- API | IDirectFBSurface - Added IDirectFBSurface::SetSourceMask() - yes, a third blitting operand :) - Added DSBLIT_SRC_MASK_ALPHA to modulate source alpha channel with alpha channel from source mask. - Added DSBLIT_SRC_MASK_COLOR to modulate source color channels with color channels from source mask. - Added SetSourceMask() with a surface argument plus x/y offset and flags. - Added DFBSurfaceMaskFlags with DSMF_STENCIL to make x/y offset absolute and always start at a fixed position in the mask, otherwise x/y from the Blit() are added. - Allow second string (prefix) in Dump() to be NULL to dump without numbering. - Added FillTriangles(). - Changed SetMatrix() to take a 3x3 matrix. API | IDirectFBEventBuffer - Don't allow posting of universal events bigger than DFBEvent. API | IDirectFBImageProvider - Don't fail if PeekData() is not supported, same behaviour as video providers... API | IDirectFBVideoProvider - New events and SetAudioDelay(). Thanks to Daniel J Laird! - Applied patch from Daniel Laird adding buffer threshold control/notifications. Thanks! Runtime Options - Added option "[no-]software-warn" to show warnings when doing/dropping software operations. No longer print a warning when software fallbacks are disabled. Use the new option! - Added "[no-]fatal-break", d_debug_at() and direct_debug_at_always(). - Added option "surface-shmpool-size=" to set the size of the shared memory pool used for shared system memory surfaces. - Added options to set default priority, policy and stack size for threads. - Don't enable mouse motion compression at input drivers by default. - New runtime option "quiet=" to disable only certain message types. Thanks to Niels Roest! Build Options - Added "--without-software" to save 100k+ binary size if really not needed. - Fixed typo in X11 detection. libdirect - Added extensible result codes and made other fixes to ban from libdirect and others. - Made DirectResult the primary type for result codes. - Added D_RESULT_TYPE_BASE, D_RESULT_TYPE_MAX and D_RESULT_TYPE_IS for extended result codes. - Changed most of DFB_ codes to be assigned the corresponding DR_ code. - Three DirectFB specific codes remain, after DFB__RESULT_OFFSET defined as D_RESULT_TYPE_BASE('D','F','B'). - Added DirectEnumerationResult. - Further cleanup of debugging code. New minimal debug mode to support D_DEBUG_AT, D_ASSERT and D_ASSUME when debug support is disabled, but DIRECT_ENABLE_DEBUG or DIRECT_FORCE_DEBUG have been defined. No domain filters, just formatted output (all or nothing). - Fixed 'log-file' and 'log-udp' option. - Strip off "lt-" at the beginning of a program name (for config file). - Fixed allocation debugging always being used when available. libfusion - Check whether mount point is writable in find_tmpfs(). - Implemented lock counter in single app build. - Added fusion_world_get_fork_action() and fusion_world_set_fork_callback(). Graphics Core - Added mask of clipped functions to internal CardCapabilities (gfx drivers). Instead of providing clipping for none or for all functions (CCF_CLIPPING) a driver can set individual functions to be hardware clipped, e.g. DFXL_STRETCHBLIT where clipping is crucial. - Added minimum glyph alignment of 8 bytes. - Fixed state handling bug causing wrong acceleration masks. - Added special graphics state debug messages in domain "Core/GfxState". - Added dfb_line_segment_intersect(). Gets the intersection point between a line and segment within the given segment. - Implemented (real) triangle clipping. - Started implementing affine transformations in software. - Also fixed incorrect clipping when DSRO_MATRIX is set. - Added support for affine transformations to dfb_gfxcard_draw_string(). Actually this is done by using gStretchBlit. Direct glyph transformation (done by the font provider) would be better. Input Core - Added dfb_input_event_type_name() and event debug at Core/Input/Evt. - Fix crashes during shutdown by suspending the input core before shutting down anything. Layer Core - Only sync with accelerator in dfb_layer_region_flip_update() when DSFLIP_PIPELINE is not set. Surface Core - Support NV16 in dfb_surface_dump() and so IDirectFBSurface::Dump(). - Added size field to description for pools with a defined maximum. - Added CORE_SURFACE_BUFFER_LOCK_ASSERT(lock) and CORE_SURFACE_ALLOCATION_ASSERT(lock). These two macros are consisting of assertions for all they could check. Software Renderer - Print blend funcs in warning caused by 'no-software'. - Allow DSBLIT_SRC_PREMULTIPLY while scaling from indexed to alpha formats. - Scaling an image which has alpha values != 255 (non-premultiplied) now produces premultiplied output (smooth scaling only). Support for non-indexed sources still needs to be added. nVidia driver - Implemented affine transformations. - In case of unsupported arch (NV40), skip objects and fifo setup. - Cleanup overlay code. Enbale using NV12 (requires NV30 or newer). - Fixed buggy vertices formation in TextureTriangles. Radeon driver - Implemented affine transformation (all cards) and source masking (R100/R200 only). - Implemented antialiasing (R100 and R200 only). - Fixed conversion+blend with A8 destination. - Use LINE primitive for transformed DrawRectangle. - Use POINT primitive for 1x1 rectangles. - Implemented DSPF_DSTALPHA/INVDSTALPHA for A8. - Implemented DSBLIT_SRC_PREMULTIPLY (R100/R200 only). - Emit transformed rectangle using TRIANGLE_LIST instead of TRIANGLE_FAN. SH7722 driver - JPEG decoding, supports NV12 and NV16 (4:2:0 and 4:2:2 images) - Use VEU for scaling and format conversion of JPEG decoded data (line buffer mode). Supports 4:2:0 and 4:2:2 to NV12, NV16, RGB16, RGB24, RGB32. - Implemented LUT8 support for the third layer. Added lock for BEU code called for different layers. - Automatic parent input system selection and other fixes, allowing to run df_fire on third and df_dok with alpha channel on first layer. - Implemented XOR for drawing and blitting. - Implemented DSBLIT_SRC_MASK_ALPHA, cleaned up and optimized state handling. - Fixed byte swapping issues, e.g. no more swapping between BEU and LCDC, correct swapping of BEU input depending on number of bytes per pixel. TI Davinci driver - More acceleration (StretchBlit for ARGB, ARGB/RGB32->RGB16 conversion and FillRectangle() blending). - Added colorizing support to blend functions. No additional cycles in DSP :) - Added properly clipped (phases!) StretchBlit() for ARGB and RGB32 without any blitting flags. - Added ARGB/RGB32 conversion to RGB16 without any flags (currently writing alpha data to scratch area). - Real IRQ based synchronization, optimization for opaque filled rectangles. - Fixed color calculation for filling/drawing to UYVY. - Allow explicit driver usage without probing by setting accelerator id to 6400. - Suppress errors of custom ioctls for now. - Added small tool c64xdump for showing DSP status (queues, load). - Further DSP interface updates and cleanups. - Work around missing alpha plane pitch setting (when differing from RGB plane). The DSP function needs to be extended to fix it properly. - Patch from Eric Nelson to support HD OSD planes. Linux Input driver - Set DIEF_FOLLOW on all events known not to be the last. FBDev system module - Don't pan at all when it's not supported by the device. - Important fixes for mode switching, restructuring and cleanup. Still not working again is support for virtual resolutions with panning, not double/triple buffering which works. SDL system module - Fix mode switching/surface creation, having working accelerated SDL backend again. X11 system module - Bring in line with 1.0 features, expose handler, format conversion, SHM, SMP 8-) - Fixed threading issues using XLock/UnlockDisplay(). - Use XNextEvent() again instead of usleep() based polling after fixes. Pull up to 100 events per round, i.e. until accumulated motion events are flushed and thread exit status is checked. - Send ClientMessage to wake up thread from blocking XNextEvent(). - Reduced invisible 16x16 cursor to 1x1, minor cleanups. Default WM - Combine multiple x and/or y motion events before sending events or updating the cursor. This is a better way as opposed to have the driver do the work, otherwise there was too much cursor acceleration in such a case. JPEG Image Provider - Implemented directly loading to NV16 surfaces staying in YCbCr space. dfbdump tool - Added option "-ds" for dumping surfaces. - Show buffers' lock status again. dfbinfo tool - Show min/max keycodes. dfbinspector tool - Added dfbinspector as a small C app (graphics driver capability probing). gendoc tool - Lots of improvements to parser and generated documentation. 1.1.1 ----- API - Added 3x2 transformation for all drawing and blitting. - Added render option DSRO_MATRIX and IDirectFBSurface::SetMatrix(). The matrix consists of 3x2 fixed point 16.16 values. The order in the array is from left to right and from top to bottom. All drawing and blitting will be transformed: X' = X * v0 + Y * v1 + v2 Y' = X * v3 + Y * v4 + v5 - Added DSRO_ANTIALIAS to enable anti-aliasing for edges, lines... API | IDirectFB - Added DSCAPS_SHARED for creating shared surfaces, not using local (malloced) memory pool. API | IDirectFBDisplayLayer - Added DFBDisplayLayerSourceCaps featuring DDLSCAPS_SURFACE. - Added resource_id to DFBWindowDescription and DWDESC_RESOURCE_ID to specify the resource id to use for window surface creation, rather than using the window id for that. API | IDirectFBFont - Fixed missing translation of characters to indices in GetKerning(). API | IDirectFBSurface - Added DSBLIT_COLORKEY_PROTECT to prohibit writing the color that the destination surface uses as a source color key. - Fixed GetFramebufferOffset() by adding CSAF_GPU_READ when Lock() is called on a DSCAPS_VIDEOONLY surface. API | IDirectFBVideoProvider - Added DVPET_FINISHED, sent when playback is finished. - Added DVPET_SURFACECHANGE, sent when size/format change. Runtime Options - Added "[no-]autoflip-window" to automatically flip non-flipping windowed primary surfaces. Previously, the default was to automatically Flip() in a thread. Now it's not. - Added "[no-]font-premult" for premultiplication in case of ARGB glyph images. Default is enabled. - Added "[no-]linux-input-grab" that will control whether linux_input will grab the devices. This is useful in cases where multiple processes want to receive input events. - Added "linux-input-devices" and "tslib-devices" options. - Added "no-init-layer [= ]" option to disable initialization of layers. Primary layer is initialized by default, use this option to avoid that. - Added "[no-]thread-block-signals". - Fix background color index support. - Fixed missing color key flags when only index is set via config file. - Reimplemented "thrifty-surface-buffers". Build Options - Added "--with-smooth-scaling", turned off by default to avoid 100k+ binary size increase. Display Core - Implemented defered region realization by adding CLRSF_FROZEN which is set initially on every region that is created. - As long as CLRSF_FROZEN is set, all SetRegion() calls to the driver (and buffer allocations due to it) are simply discarded. - Only when dfb_layer_region_flip_update() is called and the region is enabled and active, the flag is removed and the region is either realized or the config is just set if it was already/still realized. - Added GetMixerState() to screen driver API and dfb_screen_get_layer_dimension() to be used instead of the deprecated dfb_screen_get_screen_size(). - Added capabilities for display layer sources. Check source capabilities if present when determining whether to allocate a surface for a layer region. This allows to add layer sources in addition to DLSID_SURFACE that have a surface without using DLCAPS_SURFACE which enables surfaces for all sources. - Deallocate layer region surface buffers if the region is being unrealized. - Made DisplayLayerFuncs const when being passed or used. - When switching to an indexed layer format, use dfb_surface_init_palette() if no palette exists already. Graphics Core - Added dfb_gfxcard_get_driver_data(). - If alpha is zero, still check for RGB when looking up the best match in a palette. - When resetting the 'checked' flags also reset the same in 'accel' flags. Fixes accidental hw usage. - Skip prechecking clip in FillRectangles() if DSRO_MATRIX is used. Other functions are also affected, but not fixed yet. Surface Core - Fixes to CPU/GPU read/write access interlock management. - Added dfb_surface_buffer_dump() implementation. - Fixed lock+reconfig bug: fail when trying to reconfig a locked surface. - Added convenience functions dfb_surface_read/write_buffer() and dfb_surface_dump_buffer(). - Moved surface palette creation from dfb_surface_create() into new dfb_surface_init_palette(). - Added CSALF_PREALLOCATED. The "thrifty-surface-buffers" option is implemented by iterating through all allocations at the end of an update_allocation() and deallocate all other allocations, unless they have the CSALF_PREALLOCATED flag. In the latter case it would not be a benefit, but the disadvantage of losing an allocation that is still up to date and would probably be faster (CPU read) than others. The 'preallocated' surface pool sets CSALF_PREALLOCATED upon allocation. - Another flag CSALF_VOLATILE has been introduced. In case of a write access to one allocation, any other allocation is deallocated if it has the flag. This is independent of the "thrifty-surface-buffers" option. The 'local', 'shared' and 'preallocated' surface pools set CSALF_VOLATILE upon allocation. Window Core - Refuse to set non-shared surfaces as a background image for a window stack. Software Render - Added LUT8 -> ARGB4444 smooth scaling. - Made smooth scaling support source rectangles not starting at 0,0. - Fast RGB32/ARGB to RGB16 conversion (little endian). Utilities - Added dfb_convert_to_a4() and added RGB32/ARGB support to dfb_convert_to_rgb16(). - Added dfb_convert_to_uyvy() and dfb_convert_to_yuy2(), only copy supported yet. libdirect - Added direct_cleanup_handler_{add/remove} to install a cleanup handler called upon exit. - Added direct_page_align(). - Added mutex and condition for thread initialization to eliminate sched_yield()s. - Improved debug messages in thread code. Added "Direct/Thread/Init" domain to watch creation, wait, startup, initialization, notification ... - Initialize libdirect in DirectFBCreate() already. - Added new URI fd:/. Used to create a DirectStream from an already opened file descriptor. - Added direct_log_lock()/unlock() for ensuring multiple prints are not mixed with others. - Use direct_log_lock()/unlock() to ensure stack traces are one contiguous block. - Added sanity checks in build header if debug support is disabled. If DIRECT_ENABLE_DEBUG is defined, silently undefine it. If DIRECT_FORCE_DEBUG is define, show a warning and undefine it. - Do not use PAGE_SIZE at all on Linux, thanks to Guillem Jover. - Do not leak private labraries for dynamic linking, thanks to Guillem Jover. libdirect (network support) - Join multicast group if family is AF_INET and IN_MULTICAST is true. - Use bind() instead of connect() for receiving UDP data. - Use SO_REUSEADDR in case of multicast. libfusion - Print an alert message when using builtin implementation of fusion. - Moved FUSION_ID_MASTER definition to types.h. - Fix missing fusion_shm_enum_pools() for single app core. - Added fusion_reactor_set_name() to change the name of a reactor after its creation. - Implemented fusion_reactor_set_dispatch_callback(). - (Pre)Parse shmfile group in fusion_config_set(). - Added "ramfs" to possible types during mount point probing. libfusion (builtin multi) - Provide a REAL implementation of fusion_skirmish_wait/notify(). - Always free resources allocated in builtin implementation of fusion_skirmish_wait(), either if the skirmish was destroyed. - Check for dead local references in fusion_ref_zero_lock()/trylock(). - Return DFB_NOSHAREDMEMORY if requested allocation exceeds the maximum address of the shm pool. - When fusion_skirmish_wait() gets called with a timeout value, check whether the timeout expired *before* sleeping. - Use fusion_skirmish_wait() instead of usleep() in fusion_ref_zerolock(). - In fusion_ref_zerolock(): check local references before entering the loop. - Check for dead property purchaser. - Honor FCEF_ONEWAY in fusion_call_execute(). Execute ref watcher with the FCEF_ONEWAY flag. - Fail in fusion_skirmish_notify() if skirmish was destroyed. Sleep for at least 10ms in fusion_skirmish_prevail(). - Enable sleeping in fusion_property_lease()/purchase(). - Moved socket directory from "/tmp/fusion.#" to "/tmp/.fusion-#". - Change socket ownership according to shmfile group. - Speed up fusion_call_execute(FCEF_ONEWAY) by not creating a new socket. - chown() the sockets directory according to "shmfile-group". Voodoo - Implemented some more requestor/dispatcher methods. - Fixed alignment issues by applying VOODOO_MSG_ALIGN() on each message block. Graphics drivers - Port ati128, cle266, cyber5k, i810, i830, neomagic, nsc, savage, sis315, tdfx, unichrome to the new surface core. Only compile tested. Radeon driver - Instead of emitting vertices instantly, store them in a buffer that is submitted on EmitCommands() (this way DrawString() is about 45% faster with my 9200SE). - R100/R200: Dropped some blend functions when destination format is A8 ((INV)DEST alpha never worked because A8 isn't really supported as dest format). - R300: Implemented BLEND_COLORALPHA, COLORIZE, PREMULTCOLOR with some limitations (source must be premultiplied and COLORALPHA+ALPHABLEND isn't supported at all). - Sleep for 10 usec in WaitVSync loop. nVidia driver - Fixed texture uploading: use the current surface lock instead of locking again. - Replaced state->modified by state->mod_hw. - Disabled some features not working with the new surface core. - Sleep for 10 usec in WaitVSync loop. Renesas SH7722 driver - Added driver for SH7722 SoC from Renesas Solutions Corp. - Supports DrawString(), FillRectangle(), DrawRectangle(), FillTriangle(), DrawLine(), FillSpans(), Blit() and StretchBlit(). - Supports DSDRAW_BLEND, DSBLIT_BLEND_ALPHACHANNEL, DSBLIT_BLEND_COLORALPHA, DSBLIT_SRC_COLORKEY, DSBLIT_ROTATE180 and DSBLIT_COLORIZE. - Use hardware 3x2 matrix to implement DSRO_MATRIX for all blitting and most drawing. - Transform coordinates in driver for DrawLine() and DrawRectangle(). - Implemented DSRO_ANTIALIAS for all drawing operations. - The hardware provides "anti-aliased" lines by drawing a line with doubled pixel width (minor axis). This should be drawn with a transparency factor. Finally the original line is drawn on top of this. - For filled rectangles and triangles, only the double width line is drawn and then the shape is filled. TI Davinci - Added TI Davinci driver. - Supports OSD and Video with positioning, color key, opacity, alpha channel and vsync. - The driver uses the devmem system and opens all frame buffer devices itself. This is required for extended ioctls like setting the OSD position, but also to support alpha channels which are stored in a different frame buffer device. In case of ARGB for the OSD, the alpha channel (3 bit!) is dithered during conversion. - Implemented surface pools for OSD and Video layer. This enables direct usage of the frame buffers in case of RGB16 for OSD and UYVY for Video. - Added patch for davincifb to support triple buffering on OSD. - Hardware acceleration using the DSP with a special firmware and kernel module. - Driver still runs without DSP module, but unaccelerated. - Supports DrawString(), FillRectangle(), FillSpans() and Blit(). - Supports DSBLIT_BLEND_ALPHACHANNEL, DSBLIT_BLEND_COLORALPHA, DSBLIT_SRC_COLORKEY, DSBLIT_SRC_PREMULTIPLY and DSBLIT_SRC_PREMULTCOLOR. - Supports RGB16, RGB32 and UYVY for simple filling and blitting with color keying. - Supports ARGB for blending and premultiplication. - No support for different source and destination formats. - No support for color keying in conjunction with blending. - DrawString() is not colorized yet, but enabled for testing (all text is white). TI OMAP driver - Added TI OMAP gfxdriver. - No video layer or other fancy stuff yet. Enough to run XDirectFB on the Nokia N800 though. Unichrome driver - Fix a pointer buglet. The pfetch pointer was compared/set instead of the value to which it pointed. Keyboard (TTY) input driver - Sleep 2ms when read returns 0, to avoid CPU hogging. Thanks to Luis Mondesi lemsx1 gmail. Serial input driver - Fixed illness in processing read data in serial driver and fixed error path. Default WM - Added WM key combo - to redraw the whole window stack. Unique WM - Fixed wheel direction. - Commented out auto center. DFIFF image provider - Make DFIFF fast for the standard case again (60->483 MPixel/sec). - Added support for sub surfaces with proper clipping/offset. - Check for unscaled and unclipped loading without format conversion and just use dfb_surface_write_buffer(). FT2 font module - Optimized pixel premultiplication. FBDev system module - Fixed SetMode / Panning Bug, thanks to Kieran Bingham! - Fixed allocation size for planar formats in FBDev Surface Pool. - Add missing libsysfs when statically linking, thanks to Guillem Jover. DevMem system module - Implement surface pool using surface manager. - Added local/shared system data. - Added configure.in and Makefile.am parts. Linux Input driver - Ignore input devices matching the TSLIB_TSDEVICE environment variable. tslib driver - Check the device in $TSLIB_TSDEVICE when guessing (no option given). dfbdump tool - Added "-dl" or "--dumplayer" for dumping the front buffer of each active contexts' primary region. dfbfx tool - Based on "fx", with command line options, documented code... - Simulates blitting flags given a source and destination ARGB pixel. 1.1.0 ----- API - Extend list of custom key definitions: DIKS_CUSTOM<0-99> API | IDirectFB - Fix code that controls single/double buffer window creation for primary surfaces in windowed mode. If DSCAPS_FLIPPING is set, it uses one buffer which already requires a Flip due to the window. Only if DOUBLE is set explicitly, create two buffers. API | IDirectFBDisplayLayer - Added IDirectFBDisplayLayer::SetRotation(). API | IDirectFBFont - Added DFFA_FIXEDCLIP that can be used in addition to fixed advance and cuts off glyphs if they are wider than that. API | IDirectFBImageProvider - Added DFB_INCOMPLETE and return it from image providers if rendering has been aborted by the render callback. API | IDirectFBPalette - Added IDirectFBPalette::SetEntriesYUV(), GetEntriesYUV() and FindBestMatchYUV(). API | IDirectFBScreen - HD extensions, thanks to Daniel J Laird! API | IDirectFBSurface - Added IDirectFBSurface::SetRenderOptions() as a new state element, but not mandatory for graphics drivers. At the moment it's used by the software driver to choose smooth or standard scaling. - Made DisableAcceleration( DFXL_DRAWSTRING ) work. - Each sub surface interface has a reference to its parent and a list of its children. - Added DSBLIT_ROTATE180 with a basic software implementation. - Added universal resource id (unsigned long) that belongs to each surface, e.g. the layer id or window id. General purpose surfaces can be given an id by using the new flag DSDESC_RESOURCE_ID and setting the resource_id field. API | IDirectFBVideoProvider - Thanks to Daniel J Laird for Video Provider Events! - Extended video provider capabilities, thanks to Daniel J Laird! API | IDirectFBWindow - Added IDirectFBWindow::Bind()/Unbind(). - Added DWDESC_OPTIONS and DWDESC_STACKING to give initial values in the DFBWindowDescription using the new fields 'options' and 'stacking'. - Added DWDESC_PARENT to DFBWindowDescriptionFlags and 'parent_id' to DFBWindowDescription. This can be used to associate a window to another, but it's up to the WM to implement it. - Added IDirectFBWindow::SetKeySelection() that selects a mode for filtering keys while being focused. The selection defines whether all, none or a specific set (list) of keys is selected. - Added DFBWindowKeySelection featuring DWKS_ALL, DWKS_NONE and DWKS_LIST. - Added IDirectFBWindow::GrabUnselectedKeys() and UngrabUnselectedKeys() to have a key collector window receiving all keys that the focused window did not select. - Added DFBWindowEventFlags featuring DWEF_RETURNED so far, which means that the event has been returned, i.e. has not been consumed by the original recipient. The DFBWindowEvent field 'flags' has also been added. - Added advanced window geometry for positioning and scaling of windows relative to their own bounds, with ability derive from parent geometry. - DFBWindowGeometryMode: DWGM_DEFAULT, DWGM_FOLLOW, DWGM_RECTANGLE, DWGM_LOCATION. DFBWindowGeometry: mode, rectangle, location. - IDirectFBWindow::SetSrcGeometry() and IDirectFBWindow::SetDstGeometry(). - Added generic dfb_window_set_config() for simplifying core code and moving config handling into interfaces. - Added DWOP_KEEP_ABOVE and DWOP_KEEP_UNDER. Runtime Options - Achtung! DirectFB is using sysconfdir now! E.g. use /usr/local/etc/directfbrc. - New layer configuration system, staying compatible with older options: - init-layer= chooses layer with ID to configure (following layer- options apply) - layer-size=x sets the pixel resolution - layer-format= sets the pixel format - layer-depth= sets the pixel depth - layer-buffer-mode=(auto|triple|backvideo|backsystem|frontonly|windows) - layer-bg-none disables background clear - layer-bg-color=AARRGGBB sets a background color (hex) - layer-bg-image= sets a background image - layer-bg-tile= sets a tiled background image - layer-src-key=AARRGGBB enables color keying (hex) - New option "surface-sentinel" to enable surface sentinels at the end of chunks in video memory. - Added "smooth-upscale" and "smooth-downscale" options to enable smooth scaling by default. - Added "[no-]madv-remove" to get around the auto detection. - Added layer palette initialization via "layer-palette- = " option. - Added option "layer-bg-color-index = n". - Added option "layer-rotate = " with 0 and 180 supported. - Added option "layer-src-key-index". Pixel formats - Added DSPF_RGB444 and DSPF_RGB555, thanks to Daniel J Laird! Core - Use a Skirmish to synchronize slaves with the master's post core initialization. The new function dfb_core_activate() will allow other processes to join. - Explicit shutdown order of core parts and pools. Graphics Core - API break! Drivers must use "state->mod_hw" instead of "state->modified"! - Validate clip in dfb_state_update() also if destination was just set manually, not via dfb_state_set_destination(). - Added YUV palette support. CorePalette has a second array for YUV entries. Both arrays are kept synchronized. Drivers can choose. - Implemented StartDrawing/StopDrawing() for states. When a surface is being rendered to, its graphics state is set to DRAWING. Upon Flip() the state is flushed. The new mechanism needs to be enabled via "startstop" option. StartDrawing/StopDrawing() can be implemented by the graphics driver. e.g. to keep track dirty surfaces and defer flipping if it would reveal other's drawing. - Added multifunctional color configuration function dfb_state_set_color_or_index(). Always tries to set both color and index. If color index is -1, color is used and searched in palette of destination surface if present. If color index is valid the color is looked up in palette if present. - Added dfb_gfx_back_to_front_copy_180(). - Added DFBColorKey which is binary compatible with DFBColor for RGB, but has an 8 bit color index instead of the alpha value. Layer Core - Use DFBColorKey instead of DFBColor in the CoreLayerRegionConfig. - Fix potential dead lock in layer context initialization. - Fix potential dead lock in dfb_layer_context_get_primary_region(). Surface Core - NEW SURFACE CORE WORK IN PROGRESS (really usable, but not everything supported yet). Check TODO! - dfb_surface_reformat() no longer fails immediatly if the surface is locked, instead it waits for 3 loops before doing it. - If no alignment is specified (0), default to 8 bytes offset and pitch alignment. To disable alignment, simply set to 1. Window Core - API break! Replaced dfb_wm_start_desktop() by dfb_wm_post_init(). Removed StartDesktop which had no context pointers from WM API and added PostInit with proper context pointers. - Simplified internal dfb_layer_context_create_window() and dfb_window_create() and replaced dfb_window_*grab*() by dfb_window_change_grab(). libdirect - API break! Changed DirectHash's u32 key to be unsigned long. This allows to use pointers. - Added direct_thread_detach() and direct_thread_is_detached(). - Use pthread cleanup to free the DirectThread structure etc. - Added direct_thread_get_tid(). - Avoid "unused warning" if debug domains are declared, but not used. - Fix 64 bit symbol address parsing in trace code. - Fix missing target directory for nm-n files. - Readded "%.nm" as an alternative to "nm-n.%". - Added direct_sched_yield(). - Open log file with mode 0664. Automatically flush stderr. - Added direct_list_foreach_reverse(). - Added direct_serial_check() returning true if the target serial is not higher. - Flush stdout and stderr before showing the signal handler message. - Rearrange locks in debug message code to avoid dead locks in certain circumstances. libfusion - API break! Changed call handler function type. The return value defines the library's behaviour after exiting from the handler. To return a value immediately, write to *ret_val and return FCHR_RETURN. If you want to make a call later on to fusion_call_return() yourself, use FCHR_RETAIN. - The new serial value allows to have more than one call pending while calls can be returned in any order. The caller is still blocked on its single call, of course. - API break! Added "ctx" argument to fusion_object_pool_create() and FusionObjectDestructor. - Close file descriptor of shared memory files and be happy with just the static mmap() and the filename for using truncate() instead of ftruncate(). - Reinitialize entries in static pool array properly. - Added fusion_hash_set_autofree() to enable/disable automatic freeing of values and/or keys. - Use FusionHash for arena fields. - Fix general dead lock problem with reactors by using read/write locks. - Fix zero FusionID in forked process by entering the world after reopening it. - Added fusion_dispatcher_tid(). - Fix lock order in fusion_shm_pool_destroy(). - Added fusion_reactor_set_lock_only() which does not lock and use it in fusion_object_set_lock() as this is called during object initialization. - Added FUSION_SKIRMISH_ASSERT macro for debug mode failing if the skirmish is not locked by the current thread. - Added fusion_reactor_set_dispatch_callback() with a test. - Added fusion_reactor_attach/dispatch_channel() with the older calls using channel zero. - Added fusion_skirmish_wait() and fusion_skirmish_notify(). When you hold the lock you can wait until you get notified, where others can get the lock while you're waiting. At the moment it requires the notifier to acquire the lock. - Added timeout to fusion_skirmish_wait(), 0 means unlimited. - Added a new Fusion/IPC implementation using standard system calls: - Skirmish gets implemented by using sched_yield()+usleep, exactly like linuxthreads does with pthread mutexes, but it's also capable of automatically unlocking whether the owner process died without doing it. - Property works like Skirmish, but it doesn't sleep and it doesn't check for a dead owner. - Dispatching and co. make use of raw unix sockets: there is a local address specific to each fusionee (/tmp/fusion.@WORLD_INDEX@/@HEX_FUSION_ID@) and each call (/tmp/fusion.@WORLD_INDEX@/call.@HEX_CALL_ID@.@HEX_CALL_SERIAL@), and messages are sent directly from the generator to the socket of the listeners. From a network point of view, this is similar to UDP Multicast (e.g. conference or meeting). - The new implementation gets build when --enable-bulti is specified but no usable linux/fusion.h was found (however you can edit fusion/build.h to force building it). - Raise max number of shm pools to 16. Software Rendering - Fixed RGB24 to RGB16 conversion. - Fix ARGB on RGB16 blending. Use Duff's Device and optimize for 0% and 100% opaque. - Fix hi/lo mixup for big/little endian in 32 bit wise 16 bit color keying code. - Added smooth up/down scaling for different formats. - Fix 64bit implementations of RGB32 source and destination color keying. DFIFF Image provider - Use a preallocated surface to render the image (this should fix support for destinations that are premultiplied, separated, and co.). PNG Image provider - Avoid abort() caused by libpng and return an error instead. - Plug a memory leak in the PNG image provider. Thanks to Eugene Everson. - Fixes for grayscale PNGs. Mach64 driver - Ported to new surface core. - Added RGB444 and RGB555 support. Matrox driver - Ported to new surface core. - Added RGB444 and RGB555 support. - Eliminate libsysfs dependency from i2c detection. - Reset besvcnt to 0 prior to disabling the backend scaler. - Sometimes the BES would not turn off with just BESCTL. It seems besvcnt not being programmed to zero has something to do with it since resetting BESGLOBCTL before BESCTL seems to help. nVidia driver - Added support for RGB555. - Fixed support for premultiplied surfaces. - Dropped down blits from system memory on the NV20 (crashes on Xbox). - Optimizations and cleanup. Radeon driver - Ported to new surface core. - Support RGB555 and RGB444. - RGB555 support on Overlay and CRTC2. - Removed limit of 8x8 surfaces: apparently it comes from the Rage128 driver but it doesn't apply to Radeon(s). - Implemented DSBLIT_ROTATE180. Unichrome driver - Fix blitting of planar surfaces (YV12/I420) when a source rectangle is used or the source and destination surfaces are different sizes. Linux Input driver - Fix evdev ioctl() parameters. - Only use FBDev system module data in linux input driver if system is built. - Don't bail out with other system modules if LINUX_INPUT_USE_FBDEV is not set. FBDev System module - Add source rectangle support to fbdev layer. - Check fbdev pan/wrap capabilities for double/triple buffering. - Fix fbdev_ioctl_call_handler() return value. - Fix transfer of errno from master to slaves when doing ioctls. - Do FBIOPAN_DISPLAY ioctls directly. DevMem System module - Added generic /dev/mem based system module. - There's no screen or layer registered, a graphics driver is required. - Added some new runtime options for the new system module. - video-phys= sets the physical start of video memory. - video-length= sets the length of video memory. - mmio-phys= sets the physical start of MMIO area. - mmio-length= sets the length of MMIO area. - accelerator= sets the accelerator ID for selecting the graphics driver. SDL System module - Support different DirectFB formats on 32 and 16 bit displays. - Disable SDL backend by default. X11 System module - Support different DirectFB formats on 32 and 16 bit displays. - Use an ShmImage with twice the height of the output. Alternate between bottom and top image and do XSync() BEFORE doing the next XShmPutImage(). Only call XShmPutImage() for the updated region. - Takes advantage of SMP now. - Added true keymap support to X11 input driver. Read the X11 keymap entries properly and translate to identifier and symbols. Only send key code in events. X KeySym to DFBInputDeviceKeySymbol translation might not be complete for everyone. - Provide the original timestamps from the X events. - Use DIEF_FOLLOW for x/y motion. - Added call to XFlush() after XShmPutImage() boosting df_andi from 100 to 130 FPS and making window stack updates really smooth and no longer distorted. - Use preallocated shared memory for calls, the layer context lock allows this. - Support non-SHM connections. - Fall back to non-shm if XShmAttach() or XShmPutImage() fail after XShmQuesryExtension() returned success. - Handle expose events. - Enable X11 System Module by default. Default WM module - Pan the layer to follow the mouse cursor (aka. virtual resolution). - Actually fail if a parent window for the newly created one was specified (not supported). dfbdump tool - List buffers in video memory if "-s" is passed. dfblayer tool - Added option "-R ". directfb-csource tool - Add --raw option to directfb-csource to allow encoding data files in headers 1.0.0 ----- libfusion - Use local memory for FusionVector (D_MALLOC instead of SHMALLOC) if pool is NULL in fusion_vector_init(). SDL Input - Thanks to Ben Combee for adding DIEF_FOLLOW support! dfbdump tool - Align output of summarized surface memory again. 1.0.0-rc5 --------- API | IDirectFBVideoProvider - Another (binary compatible) API change: added DVSTATE_BUFFERING. Build Options - This patch adds '--with-message-size=SIZE' to allow fusion messages up to SIZE bytes (default is 1024). Runtime Options - New option "shmfile-group=" to set the group that owns shared memory files. - Added option "[no-]thrifty-surface-buffers" to free sysmem instance on xfer to video memory. - Don't abort if an unsupported option is found, but give a fat warning. - New option "vt-num=" to use given VT instead of current/new one. Graphics Core - Added dfb_gfxcard_get_device_data(). - This fixes unconditional access to conditionally allocated font row data, thanks to Ben Combee! - Surface manager always deallocates all auto video instances when suspending. This has the nice side effect of free space being defragmented after resume :) Window Core - Don't notify WM if cursor opacity didn't actually change. Software Rendering - Added fast RGB24 to RGB16 conversion (little endian only). libdirect (optional part) - Finally found the way to embed MPEG streams within the RMF container. - Dropped down RTSP seekability (never worked fine). PNG Image Provider - Implemented 1 and 2 bit indexed PNG support. Keyboard (TTY) - Added keypad equal support. Linux Input - Added keypad equal support. - Fixed segfault in event thread. H3600 Touchscreen - Thanks to Philip Jägenstedt :philipj 0pera c0m: for fixing the H3600 check! FBDev System - Improved robustness of VT switching, e.g. for rapidly switching back and forth. - Set FD_CLOEXEC on the frame buffer device file descriptor. dfbdump tool - Show creator of references (of windows, surfaces, contexts etc). 1.0.0-rc4 --------- FBDev System Module - Many thanks to Vaclav Slavik for fixing up VT initialization. Check the ChangeLog for a detailed description. Unichrome Driver - Allow for improved timing of video layer flips when the FIELD_PARITY option is in use. The improvement is only possible if the kernel framebuffer supports it. If not, we do the best we can but occasional glitches may occur under high processor load. Misc/minor (usually not in a summary, but due to the few changes...) - Distribute autogen.sh - Add new lines to work around nested structs being taken by the doc generator. - Avoid cutting away the last pixel of a planar yuv row. 1.0.0-rc3 --------- API - Added IDirectFBWindow::SetBounds() to do a move and resize in one step. - New window option DWOP_SCALE prevents the surface from being resized when the window size on screen changes, i.e. via IDirectFBWindow::Resize() or SetBounds(). - The surface can be resized separately using IDirectFBWindow::ResizeSurface() if needed. - Enable DWOP_SCALE by default for windowed primary surface (IDirectFB::CreateSurface). - Fixed DIKT_UNICODE detection in DFB_KEY_TYPE(symbol) for values > 255. Runtime Options - New runtime option "scaled=x" scales the window to the specified size for 'force-windowed' apps. The surface size will not be affected, still set via "mode=". - Added options "debugmem" and "debugshm" to turn on local/shared memory allocation debugging separately from "debug" option. - Let "debugmem" option only influence output of allocations, but always track them in debug enabled builds. - Added option "no-software" to disable software fallbacks. This is mainly for debugging/profiling purpose. It will print out a warning with the operation and flags each time a fallback would occur. - Read DIRECTFB_SESSION variable after reading all files and DFBARGS, so only the command line can override the current session. - Added runtime option "force-slave" to always enter as a slave, waiting for the master, if not already there. This feature only works with recent kernel module. Graphics Core - Added InvalidateState() at driver level API to notify the driver that the current rendering state is no longer valid. Surface Core - Added ability to let only one Fusionee write to a surface, set via owner field of CoreSurface. - Don't try to immediately allocate the new video instance when reallocating a buffer (unless the policy is CSP_VIDEOONLY). Fixes corruption problems in XDirectFB caused by window resize failing. - Dispatch surface's notifications directly (if local). This change fixes an assertion failure that happens in the following case: Resize (Downsize) Surface ... and immediatly after ... Blit to Surface. Layer Core - Support DLBM_BACKSYSTEM as a (driver) default. Window Core - Give the WM a chance to provide its own surface. The WM may link a surface to the window in the PreConfigureWindow() call. - Dispatch window's notifications directly (if local). Software Rendering - Added Bop_argb_blend_alphachannel_src_invsrc_Aop_PFI[] as a fast path for blending from ARGB with SRCALPHA / INVSRCALPHA. Implemented for RGB16 and RGB32 so far. - Use cpp templates for 16bpp and 32bpp code. - Removes duplicated code. - Implements some missing gfx funcs. - Fixes missing EXPAND() calls in some acc funcs. - Fixes blit direction handling in some 16bpp blit funcs. Utils - Added some basic update region management (DFBUpdates) with functions for adding updates, keeping a maximum number of regions, merging if possible or required. First version, IQ 10. libdirect - Autodetect clock skew. - Added direct_list_move_to_front( **list, *link ). - Added direct_snputs(s,d,n) to set a string with a maximum size including the zero termination. This acts like a strncpy(d,s,n), but always terminates the string like snprintf(d,n,"%s",s) which is more or less slower. - If trace support and shared libraries are enabled, for each library to install, also generate a file containing the output of "nm -n ". That's the command that is used at runtime via popen(). - Now the code first checks if it can fopen() a file with the same name as the one passed to "nm -n", but with an "nm-n." prefix. This is both a performance improvement and a nice solution for (embedded) targets without 'nm' being available or fast enough. libdirect (optional part) - Implemented seekability over RTSP. libfusion - Use MADV_REMOVE if possible to give memory back to the system after freeing a block in the middle of the heap. - No more signal handler used, because no more mremap() is done, only ftruncate() is called to resize the shared memory heap. The initial mmap() now covers the whole address range. - Initialize the heap info table to serve for the maximum pool size specified at creation of the pool. Previously, the initial table served for 4 MB heap. If there were more allocations, the heap info table was reallocated at the end of the heap, i.e. at 4 MB making it impossible to ever go back below the 4 MB heap size. Next barrier was 8 MB, 16 MB ...these are gone. - The maximum size specified during creation of a pool is now taken as an additional size after the heap info table. Previously, it could happen that the size was too small to host the fixed sized heap info table. - Include Fusion ID of allocator and offset within heap in shm allocation debug info. - Print shared memory leaks on pool shutdown (debug mode and 'debugshm' option). - Added fusion_reactor_direct(bool) to specify whether local message handlers (reactions) should be called directly, which has been the previous behaviour for years... - Fall back to /dev/shm if no mount point could be determined. - Added FCEF_NODIRECT which forces execution of the call in the Fusion Dispatch thread even if it's the calling process' own call. - Only call fusion_sync() if the pool that is to be destroyed has objects. - Fixed fusion_sync() timeout during XDirectFB shutdown. - Fixed concurrent startup of master and slaves. Voodoo - Missing methods added and more implemented. PNG Image Provider - Support loading of indexed PNG files directly to LUT8 surface. - Provide palette of image via GetSurfaceDescription(). FT2 Font - Added support for LUT2 fonts for using fast antialiased text rendering with indexed to indexed translation. - Thanks to Vaclav Slavik for fixing loading of mono-only fonts. Default WM - Added support for scaled windows. - Make cursor area backing store surface same format as layer. - Use DFBUpdates to manage an update queue and do optimizations like taking the bounding box instead of multiple smaller regions if the number of pixels in the bounding box is not much higher than the total of the smaller ones. - Even this takes the number of smaller regions into account, because of the increasing overhead per region. - Next to performance, the visual experience is enhanced by coalesced updates. - Another advantage is that when multiple regions are updated, first it renders all regions and then it flips all regions. Previously, each time the flip was done immediately for each rendered region. Radeon Driver - Implemented StretchBlit, TextureTriangles, Alphablend, Deinterlacing for the R300 chipset family, thanks to Timon +timon37 * interia-pl+!!! - Support color keying for TMU based functions on R300. Unichrome Driver - Implemented acceleration for blits involving the AiRGB pixel format. - DSPF_AiRGB is now supported as a source format for most blits and stretch blits. - Blits _to_ AiRGB surfaces are also accelerated provided they don't require blending. Linux Input - Added Touchpad support! tslib Input - New driver, thanks to Shane Volpe! dfbdump tool - Added the option "-p" to pause() dfbdump after initialization, e.g. to run it as a master and look at the foot print or other things that are there before any application specific stuff happens. - Show allocations in both DirectFB shared memory pools with option "-s". 1.0.0-rc2 --------- API - Breaking API Freeze but keeping source and binary compatibility! - All __u8, __s16 etc. types have been changed to u8, s16 etc. - Compatibility is in place unless DIRECTFB_NO_CRUFT is defined. - Added DSPF_LUT2 being indexed 2 bit per pixel packed, i.e. four pixel in one byte. API | IDirectFBSurface - Added SetIndexTranslation() that sets a translation table used for fast indexed to indexed pixel format conversion. Negative or undefined values in the table will result in no pixel being written. - Added DSBLIT_INDEX_TRANSLATION to do fast indexed to indexed translation, this flag is mutual exclusive with all others. - So far only LUT2 to LUT8 is supported, used for fast anti-aliased text rendering to indexed format. The translation table contains "-1, 36, 37, 38" for example. First entry makes the background transparent and the other three are shaded versions of the text color. Build Options - Use libpng-config if present. Thanks to Gery ! Runtime Options - Added "primary-only" to tell applications only about the primary layer, pretending there are no others. - Fixed "tmpfs" option. - Fixed "pixelformat" option. - Don't depend on "debug" option when printing interface leakage at exit time (only debug builds). Core - No longer create a new process group in dfb_core_create(). - Don't take certain locks in core shutdown functions if emergency is true. Layer Core - In dfb_layer_context_get_primary_region() if increasing the ref count of the existing primary region fails, due it being destroyed, wait for a short time and try again, probably recreating the region. Surface Core - Fixed bug in auto-video surface locking that could return a NULL pointer. libfusion - Safely cycle through hash nodes while freeing them. - Don't print an error if an object revived after it's ref count reached zero but got increased again before the destructor is called. That applies to the multi application core only. In the single application core the destructor is called synchronously. libdirect - Use readdir_r() instead of readdir(). - Don't include config.h in direct/types.h. Fix stdbool.h warnings. - No longer use pthread_kill(KILL) which doesn't only kill the specified thread, use pthread_cancel(). - Let direct_assert() and others try raise(TRAP) first, then killpg(0,TRAP) and pthread_exit(). - At the end of the global signal handler no longer use killpg(0,KILL) but remove all handlers, raise(num), abort() and then exit( -num ). But the exit shouldn't be reached. - Register signal handler with empty instead of full blocking mask and use SA_NODEFER except for SIGSEGV. Also no longer use SA_RESTART. - Use recursive mutexes in trace support if available. libdirect (optional network stuff) - Replaced the usage of setitimer()+recv() in net_peek() with a single call to select(). - Fixed username/password parsing. DGIFF - DirectFB Glyph Image File Format - Purpose of DGIFF is to offload as much as possible from runtime, especially during application startup when loading the default or system fonts. - Added a new font module and a tool called mkdgiff to generate .dgiff from .ttf or other. - mkdgiff uses FreeType2 to load the glyphs of the font and stores them in one or more ready to use font cache rows, up to 2047 pixels wide right now. - The loader creates preallocated surfaces from the mmapped font file. The only copy ever made would be when the surface is transfered to video memory for acceleration. - DGIFF supports different sizes of one face in a single file. DFIFF - Build mkdfiff only if PNG support is enabled. FT2 Font - Made DFFA_NOCHARMAP work again. - If Unicode/Latin1 failed, try Symbol Encoding and do some 0xf000 magic. Mach64 - Disable dithering when doing alpha blended blits. Dithering it is applied even when the source pixels are completely transparent. This change makes the mouse cursor look sane. Matrox - Include and now. SiS315 - Include now. - Build only if this header is found by configure. Linux Input - Ignore repeat events for mouse buttons. FBDev System - Use other signals than SIGUSR1/SIGUSR2 for vt-switching. Other fixes - Plugged mem leak of AttachedWindow struct when DetachEventBuffer() happens after the window has been destroyed. - Fix Bop_a8_set_alphapixel_Aop_yuy2() for big endian. - Remove/relicense GPL code. 1.0.0-rc1 --------- API - Added DIEF_FOLLOW to DFBInputEventFlags which indicates that another event will follow immediately. In the mouse driver this is used to "link" the x/y axis motion events. The window manager no longer sends two motion events (x/0, 0/y) for one x/y mouse movement (x and y axis at once). Zig-zag cursor/window movement and double event/update rate are gone. - Moved DirectFBGL header to the proper location. We need the header here since the DirectFBGL interface is strongly integrated within DirectFB and we want to support external implementations. - More Porter/Duff rules (SRC_ATOP,DST_ATOP,ADD,XOR). - Added DFB_SUSPENDED error meaning "The requested object is suspended!". - Added 4 bit packed alpha pixel format DSPF_A4, e.g. for fonts. - Added support for the 18bpp format family. API | IDirectFBDisplayLayer - Added SwitchContext() that switches between the shared and the exclusive context if present. - Added SetClipRegions() that, if supported by hardware, sets the clipping regions that are used to to enable or disable visibility of parts of the layer. The number of regions is stated in the display layer description. The layer will be shown only in these regions or except in these regions. API | IDirectFBFont - Added GetStringBreak() to break a text line by line. Thanks to sridewa . - Added EnumEncodings() enumerating all provided encodings, also see Fonts section below. - Added FindEncoding() to look up an encoding directly by its name. - Added SetEncoding() for choosing the encoding for local interface methods and as a default for the surfaces. API | IDirectFBImageProvider - Added DIRenderCallbackResult to DIRenderCallback to be able to abort rendering. API | IDirectFBInputDevice - Added DetachEventBuffer() to detach an event buffer explicitly. API | IDirectFBScreen - Allow connectors to be selected at the encoders without the need to define outputs, add slow blanking, thanks to Daniel J Laird . - Populating screen API a bit more, thanks to Daniel Laird . - Added GetSize(). API | IDirectFBSurface - Added ReleaseSource() to release a possibly attached source, e.g. after blitting from it only once and from nothing else afterwards. - Added GetFramebufferOffset() returning the offset within the graphics memory, thanks to Stefan Lucke . - Added GetPosition() returning the offset of a sub surface. - Finally decided to catch horizontal/vertical lines in DrawLine() and optimize them using rectangle filling. - Added SetEncoding() to choose an encoding for the text routines, will be overwritten by SetFont() which takes the default encoding of the new font, also see Fonts section below. API | IDirectFBVideoProvider - Removed return value from DVFrameCallback. - Added SetPlaybackFlags(), SetSpeed() and GetSpeed(). - Added SetVolume() and GetVolume(). API | IDirectFBWindow - Added DetachEventBuffer() to detach an event buffer explicitly. Build Options - Added option --enable-netork to enable/disable building network protocols handlers. Fonts - Added support for other encodings than UTF8. Encodings are (or can be) provided with each font implementation. This model reduces code sharing slightly, but allows higher efficiency via optimized combination of decoding and translation. - Every encoding just has a name and an ID, where the name can be chosen freely, except for DTEID_UTF8 which is always available and has the name "UTF8". - Implemented UTF8 and "Latin1" encoding in FT2 font loader. Nice demonstration how different encodings can be used, while still having a single glyph cache, which is no longer based on character codes, but on their raw indices. - See ChangeLog from 2006-05-06 for more details. Graphics Core - Added DFBResult return value to graphics driver's EngineSync() and WaitSerial() to be able to return DFB_TIMEDOUT or other errors. In these cases the core resets the accelerator via EngineReset() and takes care of state invalidation etc. - dfb_gfxcard_sync() and dfb_gfxcard_waitserial() also lease the graphics property, i.e. there are no more concurrent calls to the driver, e.g. FillRectangle() along with EngineSync(). - Moved clipping from dfb_clip_stretchblit() to gStretchBlit() doing all clipping, phase and offset calculations in place, otherwise clipping suffered from rounding and off-by-one errors due to going back to integer in between. - In case of no hardware clipping but rectangle filling, if in DrawRectangle() the whole rectangle outline was outside the clipping area, the clipping area was drawn in the software fallback code. - In dfb_surfacemanager_deallocate() make sure no hardware read or write access on the buffer is pending before freeing the chunk. - Added global function pointer __DFB_CoreRegisterHook with __DFB_CoreRegisterHookCtx to allow application level layer (and screen) implementations building on top of existing layers. - New capabilities for setting destination size limit. If the rectangle is too big, first try clip, then try again and eventually fall back to software. - Implemented font cache limit, currently hardcoded to five rows, each row stores a number of glyphs. When the maximum number is reached it will reuse the least recently used row, kicking out all glyphs that have been on it. - Before every graphics operation, i.e. in dfb_gfxcard_state_check(), clip the state's clipping region to the destination surface dimension. Input Core - First and fully working implementation of dead key handling using static tables for mapping of dead keys and following symbols to the combined symbol. Surface Core - Some changes that decrease system memory usage for surface buffers, especially where graphics memory is available. - Allocate system instance of auto-video buffers on first access, not immediately during creation of the surface. - Deallocate system memory when buffer is written to in video memory. Reallocate it if the buffer is kicked out of video memory. - Implemented "suspended" surface buffers, temporarily deallocated. No valid instance at all until it's resumed. - Added dfb_surface_buffer_suspend/resume(). - Added SBF_SUSPENDED. - Align pitch of system memory buffers to be a multiple of 8 instead 4. - Add extra 16 bytes at the end of a buffer as a dummy area for optimized routines, e.g. to avoid segfaults due to prefetching. Window Core - Rewritten cursor handling (software cursor) to use a surface instead of a window. The window manager module gets notified about all kinds of updates regarding the cursor. All window manager modules use the same code for now, using backing store for the region under the cursor. This avoids revealing window content that hasn't been commited via Flip(), yet. It should also be faster as it no longer depends on the windows that are covered by the cursor. - Check if window is destroyed and return DFB_DESTROYED in all functions which would have called the WM, because a destroyed window is no longer known to the WM and the WM's window data structure is deallocated. Software Renderer - Fix unaligned 32 bit accesses in color keying code. - Allocate the accumulator only if it will be used. - Check if palettes are equal when blitting indexed formats. Misc - Added dfb_rectangle_subtract() to subtract insets from rectangle. - Added DFB_RECTANGLE_CONTAINS_POINT and DFB_REGION_CONTAINS_POINT macros. - Added dfb_gfx_copy_to() as an extension of dfb_gfx_copy(). The advantages are different x/y offset for source/destination and blitting from back buffer. The latter was a must for the backing store based software cursor. libdirect - Reworked Direct/Stream to gain more efficiency, added several optional network protocols. - Added direct_stream_mime() that returns mime description of the stream. - In addition to DIRECT_FORCE_DEBUG one can use DIRECT_ENABLE_DEBUG now. - Only duplicate used portion of array in direct_trace_copy_buffer(), set limit from 256 to 200. - Added BSWAP16 and BSWAP32 macros, direct_base64_encode, direct_base64_decode and direct_md5_sum. - Due to increasing amount of debug messages the default is "no-debug" now. It makes more sense to only enable wanted debug domains by hand, e.g. "debug=core/font". Otherwise, "debug" option still works, too. - Replaced direct_stream_fopen() by direct_stream_fileno(). - Added direct_stream_dup() to increase the stream's reference counter. - In the stack trace show base address of each file to allow offset calculation 'by hand' within dynamically loaded modules, i.e. where ldd doesn't help. libfusion - Local 'local reactions' are no longer processed before dispatching further via the kernel device. This causes all local reactions within each Fusionee to be called by the Fusion Dispatcher only, in chronological order. It's a fundamental change in runtime behaviour which might break some code that relies on the synchronous execution of the dispatcher's own local reactions. - Implemented experimental fork() handling in Fusion. Added FusionForkAction being FFA_CLOSE by default, which can be changed to FFA_FORK with a call to fusion_world_set_fork_action() for each Fusionee/World. - Added "name" parameter to fusion_ref_init() like others already have. - Return DFB_LOCKED in fusion_ref_up() if EAGAIN is received (ref is zero locked). - New shared hash table implementation and property support for object. - Added fusion_skirmish_lock_count() returning the lock counter if held by the caller. - Added fusion_reactor_destroy() like fusion_reactor_free() but without freeing the shared structure etc. - No longer (need to) access the shared structure during local message processing in the Fusion dispatcher. i830 driver - Fixed overlay destination color keying for 8/15/16 bit primary layer formats, add "i8xx_overlay_pipe_b" option, thanks to Stefan Lucke . Matrox driver - Added field based blitting support. - Added DSCAPS_SEPARATED support to BES, CRTC2 and SPIC. - Fixed pixelpitch alignment for YUY2/UYVY. - PAL-60 support (or at least close enough for Ville's TV). nVidia driver - Avoid to set the overlay memory limit, it's already done by the kernel. - Basic acceleration for ALUT44. - Disable host-to-video hardware blit for simple blits without format conversion. - Added nvEngineReset(). Radeon driver - R300: Support FillTriangle() and DSDRAW_BLEND. - RV250: Dropped YUV->RGB support. - Enable VC_32BIT_SWAP on big-endian machines. - Removed (erroneously set) flag VF_RADEON_MODE in r200DoDrawRectangle3D(). - Added patch to radeonfb fixing support for R300 chipsets (it also adds new devices). - Use different settings for R300 and non-R300 when setting MC_FB_LOCATION. - Added the possibility to use the graphics layer as an OSD. It works exactly the same way as in the unichrome driver: Set the video layer level to -1 and enable DLOP_ALPHACHANNEL on the graphics layer. - Applied patch by Christer Palm : fixes word swapping on PPC. Unichrome driver - Disable hardware cursor in VIA_REG_CURSOR_MODE. Thanks to Michel van Noorloos . - Added PCI ID for CN700. DynaPro input driver - New 3M DynaPro Touchscreen driver, thanks to Pr Degerman ! Keyboard input driver - Added support for dead keys. Linux Input input driver - Added support for dead keys. DFIFF image provider - New DirectFB Fast Image File Format with a fast image provider module and a tool to convert images from PNG to DFIFF. GIF image provider - Dropped support for GIF87 (can't be animated). GIF video provider - New animated GIF video provider. V4L video provider - Fixed planar data copy. - Added more pixelformats for v4l2. FBDev System - Clean up error handling in system_initialize() and fix bug with shared memory (de)allocation. - Treat fbdev format 8/16,8/8,8/0,0/0 as ARGB when ARGB was requested (that because framebuffer drivers tend to ignore the alpha channel). - Don't touch console blanking when using graphics-vt. SDL System - Better keymap emulation. - Fake video modes by reading fb.modes, just like the fbdev backend. directfb-csource tool - Added option --rgbformat which in contrast to the --format option only is effective if the image doesn't require an alpha channel. That's useful e.g. with RGB16 for opaque and ARGB for blended images, when the primary format will be RGB16. So far directfb-csource either used ARGB/RGB32 automatically, or it always used RGB16 or whatever you specified via --format. - Make structs and pixel data const, helps with use in shared libs. fx tool - Very basic program to emulate/illustrate the pixel pipeline, blitting flags etc. No 100% guarantee that itself is correct, but in the end it will serve as a verification for software/hardware driver. 0.9.25 ------ API - Added DSPF_AYUV, a 32bit packed AYUV format for graphics, being the counterpart of ARGB in the YUV color space. API | IDirectFBSurface - Added GetClip(). API | IDirectFBDisplayLayer - Allow empty flags in SetColorAdjustment(). - Allow to control background and cursor in exclusive cooperative level. API | IDirectFBEventBuffer - Added DFBEventBufferStats containing various counters for the event queue, e.g. total number of events, number of window events, motion events etc. These reflect the current content of the queue, i.e. dequeueing decrements. - Added EnableStatistics() to enable/disable collection. - Added GetStatistics() to query current statistics. API | IDirectFBVideoProvider - Added SendEvent() to send a window or input event to video providers that supports interactivity (DVCAPS_INTERACTIVE). For cursor events, coordinates must be in the destination rectangle space. - Added GetStreamDescription() to query informations about the stream. - Added IDirectFBVideoProvider::GetStatus() to get the status of the playback; this method replaces the previous end-of-playback detection method using GetPos(). Runtime Options - Added config option unichrome-revision= to manually set the hardware revision number for the unichrome driver. This cannot be determined automatically unless the process runs as root. - Added option [no-]dma (disabled by default). - Added option fatal-level=: Abort on NONE, ASSERT (default) or ASSUME (incl. assert) Graphics Core - Added FlushReadCache() to the graphics driver API. Used in the matrox driver to flush the direct access read cache. - Pass CoreDFB to graphics drivers as a new argument to driver_init_driver(). - Added dfb_gfxcard_surface_{enter/leave}(), called when a software access to video memory begins/finishes. - Fix negative line width handling in fill_tri(). Surface Core - Added support for surfaces stored in auxiliray memory (PCI/AGP/PCIE). - Added support for Surface Managers with a variable number of heaps. - In dfb_surfacemanager_allocate() do dfb_gfxcard_sync() only if hardware has read from the buffer about to be kicked out. The call to dfb_surfacemanager_assure_system() should already take care of the hardware write case. - Change dfb_surfacemanager_assure_system() to call dfb_gfxcard_wait_serial() instead of dfb_gfxcard_sync() since we're only interested whether the hardware has written to the buffer. - Use a separate shared memory pool for surface buffer data. Input Core - Don't toggle lock states repeatedly when holding a lock key. - Added FusionCall to each input device for maintenance via master, driver calls etc. using new CoreInputDeviceCommand enum. - Added dfb_input_device_reload_keymap() implemented via the new call passing the CIDC_RELOAD_KEYMAP command. The master will reload the whole keymap via driver API. - Added a new tool called "dfbinput" which features keymap dump/reload so far. - DIKI_ALTGR is gone. The key right to the space bar is the right alt key. No matter which map is loaded, the identifiers are just named hardware keys, where you really specify the physical entity on your keyboard. In this case it's always DIKI_ALT_R, no matter if it's mapped to DIKS_ALTGR or DIKS_ALT. On standard keyboards it's also always the same hardware key code, no matter if you by a German keyboard with AltGr or a U.$. one with Alt. - Changed the input core logic for keeping track of modifiers. If DIKI_ALT_R is pressed, also look at the symbol to decide if DIMM_ALT or DIMM_ALTGR is to be added/removed. - Now application developers don't need to check for both DIKI_ALTGR and DIKI_ALT_R if they want to check for the key right next to the space bar :) Software Rasterizer - Almost completed support for Planar YUV formats (lacks colorkeying). - Fixed Cb/Cr offset computation (height*pitch/4 is different from height/2*pitch/2 if height is odd). libdirect - Made debug/release versions binary compatible, being able to link dynamically against both or even run in the same session. - Added D_OOM() message if thread structure can't be allocated. - Added D_MAGIC_SET_ONLY which is D_MAGIC_SET without assuming that the magic hasn't been set already. Useful to avoid compiler warnings when acting on uninitialized structures on the stack. - Removed dependency on -D_GNU_SOURCE when including : - Made direct_util_recursive_pthread_mutex_init() non-static-inline. - Removed DIRECT_UTIL_RECURSIVE_PTHREAD_MUTEX_INITIALIZER and replaced all of its occurences by PTHREAD_MUTEX_INITIALIZER. These didn't need to be recursive. If there's a recursive mutex required, you can still use the utility function direct_util_recursive_pthread_mutex_init(). - Removed -D_GNU_SOURCE from direct.pc and directfb-config. - Added DIRECT_SIGNAL_ANY as a replacement for the magic -1. - If the debug domain being registered contains a slash, but didn't exactly match an entry in directfbrc, check to see if the domain is descended from an entry in directfbrc, e.g. 'ui/field/messages' matches 'ui' or 'ui/field'. - New D_DEBUG_ENTER and D_DEBUG_EXIT to ease debug messages for tracing function calls. - Added UDP support to DirectStream. - Added symbol resolving support for static binaries. - Replaced the enum based bool definition by a typedef to __u8. - Defined false and true via macros like stdbool.h does. - Allow NULL argument in direct_free(). - Thanks to Andy Stewart for fixing the hash table reallocation which didn't check for collisions during reinsertion. libfusion - Using the new Fusion Kernel API 2.0 - Parallel Fusion Worlds in one process via extended API - Multiple Shared Memory Pools in one world via new API - No race condition between (potential master) processes starting in parallel - Fusion APIs have been extended to support different worlds and pools. - Added fusion_reactor_sized_dispatch() to dispatch a message to any attached reaction with a given size. Instead of using the size defined by the reactor, the caller can specify the size of the data. - Added a parameter to fusion_enter() - FusionEnterRole - to specify either FER_ANY, FER_MASTER or FER_SLAVE. If the world can't be entered playing the specified role, an error message is printed and DFB_UNSUPPORTED is returned. - Added FusionCallExecFlags parameter to fusion_call_execute(). - Allow pending reactions (in local dispatcher queue) to be executed after the shared reactor part has been destroyed. This fixes for example occasionally missing DWET_DESTROYED events. libvoodoo - Avoid tons of warnings by using D_MAGIC_SET_ONLY instead of D_MAGIC_SET. - More Requester/Dispatcher method implementations. Radeon driver - New unified Radeon driver for R100/R200/R300+. - Supports smooth page flipping. - Supports seconday head output. - Supports overlay on secondary head. - Improved overlay RGB rendering. - Improved R100/R200 3d functions performance. - Fixed 2d/3d engines synchronization. - Added support for surfaces stored in AGP memory. - Use the POINT primitive to fill rectangles with size=1 (i.e. to draw points) [~60% faster]. - Speed up FillRectangle, Blit and StretchBlit by using the RECTANGLE_LIST primitive instead of QUAD_LIST [~15% faster]. :) - Reset MC_FB_LOCATION to avoid problems with X (thanks to Michel Danzer). - Check for integrated GPUs. - When AGP support is enabled, turn off pci gart and turn on bus mastering. - Added acceleration for AYUV, but color conversion is not supported because radeon supports AVYU instead of AYUV. Matrox Driver - Support for DSDRAW_SRC_PREMULTIPLY. - Limited support for DSBLIT_SRC_PREMULTIPLY. - PCI device ID cleanup. - Fixed Mystique vs. Mystique 220 detection. - Allow DSPF_ARGB surface for BES. - Finally remove DLOP_FLICKER_FILTERING on CRTC2. - Don't reinitialize the whole TV encoder when changing field parity. - Disable BES if the destination region is completely off-screen. - Allow surface height up to 2048 with DLOP_DEINTERLACING (BES). - Limit surface width with DLOP_DEINTERLACING to guarantee BESPITCH < 4096. - Disable vertical filtering when surface width > 1024 (BES). - G200 BES doesn't support color adjustments. - Don't touch hardware in SetRegion() if nothing changed (SPIC). - Separated spic_calc_buffer() out of spic_set_buffer(). - Fixes for G100 with SDRAM. - Fixed YUY2/UYVY and texture LUT state handling. - Fixed color keying mask, G100 doesn't have TEXCTL2 so TEXTRANS must be used to disable color keying. - Completely untested PPC support. - Misc. cleanups. Mach64 driver - Added support for DSDRAW_SRC_PREMULTIPLY and DSBLIT_SRC_PREMULTCOLOR. - Don't advertise DFXL_STRETCHBLIT when it hasn't been checked. - Fixed scaler/texture color key for chips < 3D Rage Pro. - Avoid chip lockups with destination color keying. - Fixed surface size limits (Overlay). - Fixed color keying on 264VT2 (Overlay). - Check the chip type in ovSetColorAdjustment(). - Enabled SCALE_Y2R_TEMP. - Minor cleanup. nVidia driver - Added support for AGP - Added support for DMA using AGP or Framebuffer memory. - Finally fixed the "random-crashes-when-blitting-from-system-memory" problem. Unichrome driver - Fix hardware revision number detection and allow override via new config option unichrome-revision=. The revision number can only be auto-detected if the process runs as root. - Added simple script to determine revision number for addition to directfbrc. - Added support for DLOP_FIELD_PARITY. For this to work, the kernel framebuffer must support an extension of the WAITFORVSYNC ioctl that allows waiting for the top or bottom field. - YV12, I420, YUY2 and AiRGB simple blits, AiRGB 2D drawing - Disable broken SetColorAdjustment for the overlay and remove color keying diagnostic. - Round to nearest when positioning up-scaled YV12/I420 video to reduce error. - Fix YV12/I420 video layer corruption on revision 0x11 hardware. Also fix bug setting SUBP_CONTROL_STRIDE register in uc_spic_set_buffer. Sadly subpicture layer still doesn't work. - ARGB4444 as source and destination pixel format for all supported operations. - Overhaul of LEVELS, OPACITY and primary ALPHACHANNEL features which were previously only partially implemented and did not work together. - The video overlay and the primary layer now both support the OPACITY option and either can be on top. The order is determined by the 'level' assigned to the video layer. The primary also supports an alpha channel which is useful when the video layer is positioned behind. - The old DFB_CLE266_UNDERLAY environment variable switch has been removed. FBDev System module - Added AGP support. SDL System module - Decoupled screen updates from Fusion Dispatcher. Updates are handled in a separate thread; they're accumulated rather than queued in case an update is already pending. - Use the flag FCEF_ONEWAY to not wait for the call being executed, otherwise a deadlock could occur. The return value is meaningless anyways. Queued updates will be merged on the receiving side (master) to avoid a lag and improve performance. Gunze Input driver - Added Gunze Touchscreen driver, thanks to Nathanael D. Noblet ! PenMount Input driver - Added input driver for PenMount 9509 serial touchscreen. PS/2 Input driver - Applied patch from Christian Krause that allows usage of the option "mouse-source" without "mouse-gpm-source". dfbdump tool - Show "1k" again for '0 < bytes < 1024'. dfbsummon tool - Avoid division by zero if no video memory is available. fusion_bench tool - Do the shmalloc benchmark once with debug and once without. 0.9.24 ------ - Added missing source (header) files to their appropriate Makefile.am, mostly from voodoo. - Don't use fusion_reactor_free() too early in case of an error in init_devices(). Thanks to "Jakub Bogusz " for this and other patches. - IDirectFBVideoProvider::GetPos() returns DFB_EOF to notify end-of-playback. After stream has reached the end, the next call to PlayTo() restarts playback from the beginning. - No need for and anymore. - Build all graphics drivers without checking for FB_ACCEL_* in , because we have a fallback for each of those ids. - Don't build cle266 by default as it's obsolete because of the unichrome driver. 0.9.23 ------ Authors - Added "Claudio Ciccani " to main authors, welcome number five and thanks for your appreciated work :-) API - Added IDirectFBSurface::DisableAcceleration( DFBAccelerationMask mask ). - Added DSBLIT_SRC_PREMULTCOLOR which modulates the source color with the color alpha value only. - Replaced IDirectFB::GetCardCapabilities() by GetDeviceDescription() and DFBCardCapabilities by DFBGraphicsDeviceDescription which contains additional information like device and driver name, version etc. - Added more enums to the autogenerated directfb_strings.h. - Added errorcode DFB_EOF. - Added DSBLIT_XOR. - Added universal event class for custom usage with variable size. New structure DFBUniversalEvent has a 'clazz' and a 'size' member. The clazz is always DFEC_UNIVERSAL and the size is at least sizeof(DFBUniversalEvent). There are no other members, but any amount of additional data may follow according to the specified size. Best usage would be to derive from the struct. - Added new input event flag DIEF_REPEAT indicating a repeated key or button press. - Support fractional font sizes in DFBFontDescription. - Added IDirectFBDataBuffer::CreateVideoProvider(). - Added IDirectFBDataBuffer::Finish(): used to notify a streaming databuffer that the end-of-file has been reached. Runtime Options - Fixed pixelformat=NV21 option. - Added option 'busid' to specify the graphics card bus id (unused if sysfs support is enabled). Build Options - Allow predefinition of FREETYPE_CFLAGS and FREETYPE_LIBS outside of configure. - New configure option "--with-sysroot=DIR" lets you prepend a path to the runtime library/module paths. Graphics Core - Added support for system to video memory blits in (semi-)hardware. - Some 24bit big endian fixes, thanks to Mark Salter ! - Added dfb_gfxcard_invalidate_state() which sets the state pointer to NULL and therefore forces a full SetState() before the next operation is executed. - If the destination has premultiplied alpha do real Porter/Duff SRC_OVER composition for glyphs. - Fixed build_clipped_rectangle_outlines() to handle special cases where width and/or height is/are one or two. - Take into consideration DSDRAW_DST_COLORKEY and DSDRAW_XOR when drawing strings. - Added RGB332 and LUT8 support to dfb_surface_dump(). - Fixed artifacts produced by clipped triangles, thanks to Damian Kowalewski ! Layer & Screen Core - Fixed missing updates to the hardware state under some circumstances. - It's allowed to create and use windows in exclusive mode, showing the own windows only, of course. - Changed EnableCursor() to be allowed in exclusive mode, too. - Added dfb_screens_hook_primary() using it in some drivers instead of dfb_screen_register_primary(). - During flip using blitting, wait for pending writes to the back buffer before issuing the blit command from back to front buffer to avoid lags caused by too much queued commands. Windowing Core - Support windows with premultiplied alpha by checking if their surface has DSCAPS_PREMULTIPLIED. - Support premultiplied cursor shapes. - If during window creation the pixel format for windows with an alpha channel is unspecified, don't always take DSPF_ARGB, but the layer's format if it has alpha. Software Rasterizer - Fixed inverted YV12 colors. - Changed Bop_a8_set_alphapixel_Aop_argb() to be a fast path for real SRC_OVER DrawString() that uses DSBLIT_SRC_PREMULTIPLY and DSBLIT_BLEND_ALPHACHANNEL with SrcBlend = ONE and DstBlend = INVSRCALPHA. Other formats will follow. - Fixed DSDRAW_SRC_PREMULTIPLY if used without blending. - Implemented DSBLIT_SRC_PREMULTCOLOR. - Added optimization for drawing blended with Src = ONE, Dst = ZERO. - Improved Dacc_YCbCr_to_RGB_MMX. - Fixed A8 to A8 font rendering. - Added some functions optimized for 64bit architectures. - Added duff's device for 8 bit color keying. Image Loading - Premultiply image data when loading into premultiplied alpha surfaces. - Limit number of weights to 64 in x and y direction for down scaling. Without this limitation down scaling to 1x1 or similar could take minutes on embedded platforms. - If JFIF or Exif header detection failed, try detecting by filename extension. - For PNGs with alpha don't always suggest DSPF_ARGB, but the primary layer format if it has alpha. Font Loading - If the font format is ARGB, use premultiplied font surfaces. - Use "signed char" explicitly to fix kerning in FT2 loader on PPC, thanks to Uli ! - Support fractional font sizes in FT2 loader. - Fixed segmentation fault when loading OpenType fonts with FT2 loader. libdirect - A lot of code is using D_DEBUG_AT, D_ASSERT, D_MAGIC_ASSERT etc. now. - Added D_MAGIC_ASSUME. - Added D_FLAGS_ASSERT(flags,f) being D_ASSERT( D_FLAGS_ARE_IN(flags,f) ). - Protect against bogus siginfo_t pointer by checking if it's smaller than 0x100. - Some changes to support KallistiOS. - Enable X86 memcpy()s on AMD64. - Added a generic memcpy() for 64bit Architectures. - MMX and SSE support on AMD64. - Fixed a bug in direct_list_remove()! If the last item is removed while other items exist, the first item's "prev" pointer was not updated (pointing to the last element). - Added low level logging abstraction. Added runtime options "log-file = " and "log-udp = :" for configuring the default log. - Added direct_thread_set_name() for setting the name of threads that haven't been created by direct_thread_create(). - Added DirectStream, a wrapper for accessing files locally and through network (http, ftp and generic tcp). libfusion - Added fusion_object_get() that gets a pool and an object id and returns the appropriate object with a local reference added to it. If the object is not found DFB_IDNOTFOUND is returned, or any abnormal other error from locking or referencing. - Added FusionObjectID to replace plain int usage. - Fixed an evil dead lock that only occured by moving a window with one of my new mice, having superior precision generating lots of events, thanks for spotting this bug, Logitech :) - Fixed a rare crash in single application mode, thanks to Mark Adams ! i830 - Fixed multi application support, but it only works with root privileges so far. - Fixes for coexistence with intelfb and for color adjustments, thanks to Sylvain Meyer ! i810 - Implemented destination color keying for overlay. - Merged back multi app fixed from i830 driver. Mach64 - Cleaned up register definitions and added all known register names. - Improved chip type detection. - Made LCD register access work on 3D Rage LT. - Big overlay code update including support for DLOP_DEINTERLACING. - Scaler/3D acceleration now works on older GT chips. Tested on Rage II+ and IIC. - ARGB4444 support for GT chips. - Other minor fixes. Matrox - Always use alphamode = ALPHACHANNEL. - Implemented DSBLIT_SRC_PREMULTCOLOR using the Color ALU. If it's already used for colorizing, simply modulate the color values with the alpha, otherwise overwrite them. nVidia - Rewrite of the driver, following the structure of other drivers, e.g. Matrox. - Overlay and blitting supports Deinterlacing. - WaitForSync no longer burns the CPU (but actually requires a 2.6 kernel). - Decide texture buffer size according to available video memory. - StretchBlit() on A8,LUT8,RGB332 (>= NV20). - FillRectangle(),DrawRectangle(),FillTriangle(),DrawLine(),Blit() on LUT8,RGB332 and A8. - StretchBlit(),TextureTriangles(),[DrawString()],Alphablend and Colorize from A8 (>= NV10). - Alphachannel blend for ARGB1555. - Added support for system to video memory blits. - Improved TextureTriangles() performance. - NV30 supports StretchBlit(), blit with format conversion, alphablend and colorize. - Fixed NV30 initialization. - Made the driver work with the new nvidiafb framebuffer driver. - Made deinterlacing work properly with TextureTriangles(). R200 - New driver for ATI Radeon R200 based cards by Claudio Ciccani ! - Accelerates FillRectangle,FillTriangle,DrawRectangle,DrawLine, Blit,StretchBlit,TextureTriangles. - Supported Drawing Flags: Blend, Xor. - Supported Blitting Flags: Alphablend, Coloralpha, Colorize, SrcPremultColor, SrcColorKey, Deinterlace. - Supported Formats: A8, RGB332, RGB16, RGB32, ARGB, ARGB1555, ARGB2554, ARGB4444, AiRGB, LUT8, ALUT44, YUY2, UYVY, YV12, I420. - Overlay supports YUY2, UYVY, YV12, I420, ARGB1555, RGB16, RGB32 and ARGB, color adjustments, DLOP_DEINTERLACE, DLOP_DST_COLORKEY and DLOP_OPACITY. SiS 315 - Compatibility stuff for newer fb driver versions. Unichrome - Added missing flag DLCAPS_LEVEL, thanks to Stefan Lucke ! Linux Input - Fixed AltGr. - Added translation of KEY_FASTFORWARD, KEY_SOUND, KEY_QUESTION, KEY_EMAIL and KEY_CANCEL. - Better touchscreen/smartpad detection, thanks to Stefan Lucke ! - Don't abort if checking for LEDs fails. MuTouch Input - Improved packet reading loop, thanks to Ivan Daniluk ! PS/2 Mouse Input - Added GPM support. The mouse-protocol option specifies the protocol for the mice or the repeater (supported values: PS/2 and IMPS/2). FBDev System - When restoring the video mode during shutdown, set xoffset and yoffset to 0. - Keep the original display offset if no mode has been set, e.g. just running "dfbinfo". - Added ARGB4444 support. SDL System - Hide the SDL cursor so DirectFB one shows. VNC Server System - Preliminary system module using libvncserver. X11 System - Preliminary native X11 support, thanks to Martin Luetken ! Unique WM - Started work on the decoration framework, still not usable. dfbdump - Show 'premultiplied' surface capability. directfb-config - Added options "--system=" and "--wm=" for static linking. - Option "-s" additionally shows the shared memory file size. 0.9.22 ------ API - Added DLCAPS_ALPHA_RAMP: Alpha values for formats with one or two alpha bits can be chosen, i.e. using ARGB1555 or ARGB2554 the user can define the meaning of the two or four possibilities. In short, this feature provides a lookup table for the alpha of these formats. - Added DLCAPS_PREMULTIPLIED indicating that a display layer can display surfaces with premultiplied alpha. - Added DSCAPS_PREMULTIPLIED indicating that the surface has premultiplied alpha data. - Added DLCONF_SURFACE_CAPS and field 'surface_caps' to DFBDisplayLayerConfig to specify any combination of the flags: DSCAPS_INTERLACED, DSCAPS_SEPARATED or DSCAPS_PREMULTIPLIED. - Added DLCAPS_SCREEN_POSITION and DLCAPS_SCREEN_SIZE. These are set if DLCAPS_SCREEN_LOCATION is set and vice versa. Unscalable layers just have DLCAPS_SCREEN_POSITION. - Added DSECAPS_BRIGHTNESS, DSECAPS_CONTRAST, DSECAPS_HUE, DSECAPS_SATURATION. - Added DSECONF_ADJUSTMENT to DFBScreenEncoderConfigFlags. - Added 'DFBColorAdjustment adjustment' to DFBScreenEncoderConfig. API | IDirectFB - Cleaned up the way CreateSurface() determines the primary surface pixelformat and size. Previously the behavior varied depending on cooperative level and the force-desktop option. New behavior: 1. DSDESC_{WIDTH,HEIGTH,PIXELFORMAT} 2. SetVideoMode() 3. mode= and pixelformat= options 4. current layer config API | IDirectFBDisplayLayer - Added IDirectFBDisplayLayer::SetScreenPosition() which sets the position of the layer on the screen specified in pixels. - Added IDirectFBDisplayLayer::SetScreenRectangle() which sets the position and size of the layer on the screen specified in pixels. API | IDirectFBSurface - Added IDirectFBSurface::SetAlphaRamp(a0,a1,a2,a3): Either all four values or the first and the last one are used, depending on the format. Default values are: 0x00, 0x55, 0xaa, 0xff. - Added IDirectFBSurface::FillRectangles(). Build Options - Added option "--with-inputdrivers=..." for selecting drivers to build, thanks to Marcel Siegert ! Runtime Options - Replaced "argb-font" and "a1-font" with a more flexible "font-format" option. - Make "graphics-vt" the default. - Added "h3600-device", keeping the default of "/dev/ts". - Added "mut-device" which must be used to enable the driver. Pixel Formats - Added DSPF_ARGB2554. - Added DSPF_ARGB4444. - Added DSPF_NV21 (like NV12, but with swapped CbCr). Software Driver - Added support for YUY2/UYVY->RGB conversion (with src colorkeying). - Force alignment to even coordinates if blitting YUY2 or UYVY. - Added NV12/NV21/NV16 blitting and rectangle filling. - Made YV12<->I420 blitting possible. - Fixed YUV422 handling on big-endian architectures. - Optimized Bop_yuy2_Sto_Aop() and Bop_uyvy_Sto_Aop(), these are used for StretchBlit() using YUY2 or UYVY. Display Layer Core - Keep a list of all realized (added) regions to remove them during emergency shutdown, e.g. signal received or missing deinit of master app. - Added CLRCF_SURFACE_CAPS and field 'surface_caps' to CoreLayerRegionConfig in the display layer driver API. - HW Windows created with DWDESC_SURFACE_CAPS and DSCAPS_PREMULTIPLIED in 'desc.surface_caps' are created as premultiplied layer regions. - Store normalized and pixel based destination area in a layer context. - Added CoreLayerLayoutMode which defines incorporation of configuration based size changes and destination area values. - Activate the most recent context instead of the primary (shared) context when the current context is removed. - Restore color adjustment when (re)activating a context. Windowing Core - Create layer regions for hw windows in single buffered mode, unless explicitly configured using DSCAPS_DOUBLE/TRIPLE or DWCAPS_DOUBLEBUFFER. This is a preliminary solution, because by default a window surface should require a Flip() to make changes visible. - Activate DWOP_ALPHACHANNEL for other non indexed alpha formats, too. - Implemented hw window resizing. libfusion - Take the largest one, if multiple tmpfs are found. Proxy Interface Implementations (Voodoo) - Implemented BatchBlit() in IDirectFBSurface_Requester and _Dispatcher. Fixes (excerpt) - Fixed a video memory leak in dfb_surface_reconfig() that happened if a surface with multiple buffers is configured to have less, e.g. switching a layer from DLBM_TRIPLE/BACKVIDEO to DLBM_FRONTONLY. dfblayer - Show the layer level if supported. Intel - Added i830 driver (overlay support only) for Servision Ltd. (http://www.servision.net/) - Note, due to unsolved conflicts regarding ring buffer usage you have to load the "intelfb" module with the parameter "accel=0". Matrox - Added DSPF_ARGB4444 support. - Added DSPF_NV21 support. - Added support for G400 dual head add-on (disabled by default). - Alpha ramp support for CRTC2. - Added support for progressive chroma on CRTC2. - Added support for progressive half-height sub-picture. - Dropped I420/YV12 support for old chips. - NV12/NV21 Blit() for >= G200. - NV12/NV21 StretchBlit() for >= G400. - Accelerated I420/YV12/NV12/NV21 FillRectangle(). - YUY2/UYVY FillRectangle(), Blit() and StretchBlit(). NSC - Perform additional check (returned phys. fb base) before considering the fb driver to be the one that it's expected to be. nVidia - Experimental alpha blending support for Riva TNT. - Fixed NV20 and GeForce3 Xbox support, Blit() should work on the latter now. - Added experimental support for NV30 chipsets. - Found the way to make NVScaledImageFromMemory (used for StretchBlit, Alphablend, Color Conversion) work on NV20 chipset: it was another rivafb bug, therefore the rivafb-nv20fix-* patch is absolutely required. - Added basic support for drawing with alphablend on NV20. - Great performance improvements: it's possible to move a translucent window at 32bpp while the cpu stays idle. - No longer return a surface stored in system memory for YUY2 and UYVY; return directly the video surface instead. - Added FillRectangle() and Blit() (without effects) for YUY2 and UYVY. - Added an hack to do StretchBlit() on YUV422 (result is almost acceptable). Joystick Input - Do not dispatch events if unknown or JS_EVENT_INIT are received. Fixes crash upon initialization under some conditions. DreamBox Remote - Added dreamboxremote driver mainly based on dbox2remote, thanks to Marcel Siegert ! Unique WM Module - Lots of changes that have been lying around for more than two months, but this module is still not fully usable, yet. 0.9.21 ------ API - Added DFBLocation which is like DFBRectangle but has normalized coordinates. - Added macros to compare rectangles, regions, locations, colors etc. - Added diagonal cursor keys. - Added more types to the auto generated "directfb_strings.h". - Added DFBVertex containing transformed x, y, z, w, s and t coordinates. - Added DSCAPS_DOUBLE and changed DSCAPS_FLIPPING to be a combination of DSCAPS_DOUBLE and DSCAPS_TRIPLE. - Added "const" to some parameters. - Added DFXL_DRAWSTRING for IDirectFBSurface::GetAccelerationMask(). - Added prefix "ret_" to all output parameters. - Added DFBSpan containing x and width of a span. - When specified use the pixelformat of the surface description to create a windowed primary surface. - Added DFB_VERSIONMISMATCH and DFB_NOSHAREDMEMORY error codes. - Added DFBInsets specifying a distance from each edge of a rectangle: left, top, right, bottom. - Added DLCAPS_SOURCES which indicates that the layer supports multiple sources that can be selected, e.g. from frame buffer (surface) or from hardware decoders (using buffers outside of the frame buffer). - Added DFBDisplayLayerSourceID with pre-defined DLSID_SURFACE. - Added number of supported sources to DFBDisplayLayerDescription. - Added DFBDisplayLayerSourceDescription containing the ID and a name. - Added DLCONF_SOURCE along with a field in DFBDisplayLayerConfig to select the source to be used. API | IDirectFB - Added IDirectFB::EnumScreens() and IDirectFB::GetScreen(). API | IDirectFBEventBuffer - Added IDirectFBEventBuffer::CreateFileDescriptor() returning a file descriptor that can be read from, including support for select(). API | IDirectFBDisplayLayer - Added IDirectFBDisplayLayer::GetScreen(). - Moved IDirectFBDisplayLayer::SetScreenPowerMode() to IDirectFBScreen, called SetPowerMode(). - Added IDirectFBDisplayLayer::SetSourceRectangle() for source cropping etc. - Added IDirectFBDisplayLayer::GetSourceDescriptions(). API | IDirectFBScreen - New interface IDirectFBScreen for mixer, encoder and output settings. - An output is connected to an encoder which is connected to a mixer which combines selected display layers. - Added a lot of types for description and configuration of these components. (see the API Reference Manual for more details) API | IDirectFBSurface - Added IDirectFBSurface::TextureTriangles() using a surface as the texture, a pointer to a DFBVertex array, an optional index array, the array size and the DFBTriangleFormation which can be DTTF_LIST, DTTF_STRIP or DTTF_FAN. - Added IDirectFBSurface::BatchBlit() which increases pixel throughput of many small blits with same source and destination, e.g. custom font rendering like GTK+-DirectFB does. - Preliminary depth buffer support using DSCAPS_DEPTH to allocate and use it, currently hard coded to 16 bit, only useful for TextureTriangles(). - Added DSFLIP_PIPELINE for advanced synchronization with the accelerator, currently implemented for Flip() on window surfaces. This feature is for accelerators with a command buffer that can store more graphics operations than required to render one frame. - Added IDirectFBSurface::FillSpans() which is passed a DFBSpan array. Runtime Options - Added "force-desktop" to run fullscreen applications in the background. - Added "a1-font" to force usage of monochrome fonts (FreeType2). - Added "linux-input-ir-only" which tells the linux input driver to ignore all non-IR Linux Input devices. - Added "wm=" to select the window manager module to use. - Added "[no-]trace". - Users can enable/disable debug output separately, e.g. using "no-debug,debug=direct,no-debug=direct/memcpy". - Added "vt-switching" which is enabled by default. - Added "no-vt" which disables usage of VT code completely. - Added "no-decorations" to disable automatic window decorations of the "UniQuE" window manager implementation. Build Options - Allow "--enable-static" and "--enable-trace" at the same time. - Added "--enable-zlib" that activates gzipped screen shots etc. - Added "--enable-voodoo", default is no. - V4L2 has to be enabled explicitly via "--enable-video4linux2". - Detect cygwin, default to static builds and don't require libdl. - In static build mode, add an ".o" version of the ".a" module file. Applications can link statically against the ".o" files without having to specify an extra linker option for each module, e.g. "-Wl,-udirectfb_sdl". - Applied patch from "Oskar Liljeblad " which adds the configure option "--disable-sonypi-jogdial". - Added "--disable-wm97xx" to disable WM97xx driver. - With "--disable-gettid" one can enforce usage of getpid(), e.g. on broken systems where gettid() simply segfaults, though the system call is present in . - Added "--enable-unique", disabled by default. Pixel Formats - Added DSPF_AiRGB, i.e. DSPF_ARGB with inverted alpha channel. - Added DSPF_A1, e.g. for monochrome fonts. - Removed DSPF_RGB15 in the flavor of DSPF_ARGB1555. - Added DFB_COLOR_BITS_PER_PIXEL(format), DFB_ALPHA_BITS_PER_PIXEL(format) and DFB_PIXELFORMAT_INV_ALPHA(format). - Added DFB_PIXELFORMAT_ALIGNMENT(format) which is non-zero if alignment is required to do byte aligned access, e.g. 7 for DSPF_A1. - Added DSPF_NV12 (planar YUV). (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) - Added DSPF_NV16 (planar YUV). (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) System - Use gettid() instead of getpid() if available. Graphics Core - Minimize state changes during text drawing. - Drivers can choose between byte/pixel pitch alignment, or even use both. - Added convenience macros and inline functions for setting state members. - Added CoreGraphicsSerial storing the "serial" of a certain graphics operation. - Added GetSerial() and WaitSerial() to the graphics driver API: GetSerial() returns the serial of the last queued graphics operation. WaitSerial() waits until the operation with the specified serial is finished. - Store the serial of the most recent accelerated graphics operation that has been queued for writing to a surface buffer. - dfb_layer_region_flip_update() is no longer waiting for an idle accelerator, if the buffer that is becoming the front has or had a write operation queued. Instead it waits exactly for the last operation that is or was about to write to this buffer. If WaitSerial() is not supported by the driver and/or hardware, the fallback, of course, is to wait for each and every operation to finish. - Wait for only the last write operation queued for a buffer, if the software needs to access it. - Speed up tiled blitting by clipping in advance. - Implemented software clipping for hardware accelerated DrawRectangle(). - Use hardware accelerated FillRectangle() if DrawRectangle() is not accelerated. - Removed the surface listeners attached by dfb_state_set_destination() and dfb_state_set_source(). - Added dfb_state_update() which does the work of the removed listeners if direct_serial_update() returns true. Updating the source is optional. Only surfaces set via dfb_state_set_*() are handled. - Use dfb_state_update() in dfb_gfxcard_state_acquire() and gAcquire(). - Added parameter "write_front" to dfb_surface_flip_buffers() which is useful for triple buffering. If true, the new back buffer will be the front buffer. Drivers should detect if the current front buffer is not being shown already, in which case the idle buffer might be still shown and should not be written. - Added "__u32 dfb_color_to_aycbcr( const DFBColor *color )". Display Layer Core - Refactored display layer core. - Added contexts along with regions allocated within them. - Drivers are only aware of regions. Usually a driver supports one region per layer. Hardware windows are implemented via hardware regions. Input Core - Added dfb_input_add_global() and dfb_input_set_global() to register global reactions at run time, e.g. from another library or module in which case the static reaction table can't be initialized with the address of those functions. - Cleaned up input core code, e.g. by replacing the "inlined" singly linked list code by using a "DirectLink" and the "direct_list_*()" functions, or by adding usage of D_MAGIC_ASSERT() etc. Windowing Core - Pressing - + Left/Right Click generates 3rd/4th button event. - Switch to color keyed cursor if shape doesn't have alpha or if translucent windows are disabled. - Changed -'S' to raise the lowest window, e.g. to revert a -'A'. - Added - to switch from fullscreen mode to the desktop. (currently not advisable if a flipping fullscreen app is still rendering) - Modularized window management for different implementations on desktop and embedded systems. - Added new experimental window manager "UniQuE" with window decorations. - Added a CoreWindowConfig containing position, size, opacity, stacking, options, events, color key and opaque region. Software Driver - Added DSBLIT_DEINTERLACE support to gBlit. - Implemented missing blending modes. - Implemented lots of missing format specific code. - Implemented stretchblitting for YUV. - Fix a8 font rendering for argb1555, i.e. remove alpha pits around glyphs. - Replaced gDrawLine() by gFillRectangle() in rectangle outline drawing code. - Allocate accumulators dynamically. - Lots of optimizations and fixes. Debugging Support - Major speed up by using thread specific data instead of gettid(). - Use popen("nm -n ...") to load symbols of any module on demand. - Show static symbols in stack traces. - Produce gdb like stack dumps (output formatting). - Added thread names to debug output, stack traces etc. - Added interface instance tracking in debug mode, showing remaining instances at exit time (like it's done for allocated memory). - Added debug domains which can be enabled/disabled separately. - Added "-" debugging shortcut for dumping the stack of each thread of the master process. - Align debug output of domains. - Indent debug output if trace support is enabled by using direct_trace_debug_indent() which sets the flag TF_DEBUG for the current frame and returns the current debug message indention level by examining the stack, counting any upper frames that produced debug output. - Added tons of assertions and assumption, mostly to new code. - Added support for A8,YUY2 and UYVY surfaces in dfb_surface_dump(). Fixes (excerpt) - No need to call SetOpacity() before RequestFocus() for input only windows. - Don't allow GetWindow() on the cursor window. - Don't wait for Fusion Dispatch Thread during emergency shutdown. - Fixed missing MMX initialization in slaves, only the master used MMX before. - Use RTLD_NOW to detect undefined symbols before the module is used at all. libdirect - Migrated base functionality (threads, signals, interfaces, debugging, lists, modules etc.) into a separate library that can even be used by apps. - Added direct_clock_set_start() that is called by Fusion's initialization to synchronize time stamps of debug messages. - Added a minimalistic hash table implementation for usage with IDs as keys. - Added DirectResult which is the DFBResult outside of DirectFB. - Added message macro D_UNIMPLEMENTED which prints a warning once. - Added a name argument to direct_thread_create(), printed during creation and termination of threads. - Added direct_thread_self(), direct_thread_get_name(thread) and direct_thread_self_name(). - Added DIRECT_UTIL_RECURSIVE_PTHREAD_MUTEX_INITIALIZER. - Added direct_list_append() and changed the list structure to have the first element's 'prev' pointing to the last element of the list. - Added DirectThreadInitHandler which can be installed/uninstalled using direct_thread_add_init_handler() and direct_thread_remove_init_handler(). The registered init handler function is called at the beginning of new threads. - Allow per file debug mode forcing via definition of DIRECT_FORCE_DEBUG. - Added D_DERROR(ret,message) which acts like D_PERROR(message), but takes a DirectResult (DFBResult) instead of using errno. - Added D_ARRAY_SIZE(array) to calculate the size of an array. - Added D_FORMAT_PRINTF(n) to check the format of (debug) messages. - Added flag manipulation macros D_FLAGS_*. - Added D_CONST_FUNC to declare const functions. - Added DirectSerial providing a 64 bit serial number with functions for initialization, increasing, copying and updating. - Added D_DEBUG_ENABLED which is defined depending on three other macros. It's defined to be 1, if the D_DEBUG* macros produce code. Useful for embracing code that is just required for the debugging output. - Added D_OOM() which prints the warning "out of memory" and gives DFB_NOSYSTEMMEMORY if used as a (return) value. - Added D_OOSHM() which is the same as D_OOM() in single app build. Only in multi app build it prints the warning "out of shared memory" and gives DFB_NOSHAREDMEMORY if used as a (return) value. - Renamed direct_list_contains() to direct_list_contains_element_EXPENSIVE() to ensure that developers know that they shouldn't use it in non-debug code. - Added direct_list_count_elements_EXPENSIVE(). - Added direct_util_count_bits(), slow version, but at least optimized for bit sets with lower bits set only. libfusion - Migrated Fusion into a separate library to be used without DirectFB, e.g. using FusionSound without initializing DirectFB. - Added fusion_object_globalize() doing the often used combination of fusion_object_link() and fusion_object_unref(), i.e. increasing the global reference counter and decreasing the local reference counter. - Removed FusionResult using DirectResult instead. - Use new Fusion API for entering the world (including version checking). - Added fusion_ref_inherit() using the new ioctl FUSION_REF_INHERIT. - Added fusion_object_inherit() to inherit the local reference count from another object of any type. - Added "docs/ReferenceMaps.txt" which explains references and visualizes different cases of inter object referencing. - Heavily cleaned up code of FusionReactor and added lots of debug messages and comments. You should add "no-debug = fusion/reactor" to disable these loads of debug messages, while still showing other messages if "debug" is used. - Cleaned up FusionObject code and debug messages. - Added some assertions and assumptions to the shared memory code. - Added a parameter to fusion_skirmish_init() and fusion_reactor_init() to set the name of the skirmish or reactor using the ioctl FUSION_ENTRY_SET_INFO. - Don't create a skirmish for each reactor's global reactions, but use a single skirmish for all reactors which is created during Fusion's initialization. - Added fusion_reactor_set_lock() to use another skirmish for the global reactions of the reactor. - Added fusion_object_set_lock() to set the skirmish for the global reactions of the object's reactor, while default is the skirmish used to lock the pool. libvoodoo - Added network transparency to DirectFB, called Voodoo. (see the related news entry on the web page for more details) Reference Manual - Parse preceding comments within enums. - Fixed hyper link generation for "const" parameters. - Improved layout of types page. - Added macro definitions to types page. - Added callback definitions to types page. - Automatically generate links if comments include function names, e.g.: "... IDirectFB::GetDisplayLayer() ...". - Show index of types and definitions on the index page. directfb-config - Added "--fusionsound" and "--voodoo" to generate static linking parameters for FusionSound and Voodoo respectively. - Use new ".o" versions for all modules (static linking). directfb-csource - Support for combining multiple images into one surface. dfbdump - Dump layer contexts. - Option "-s" shows a list of all shared memory allocations (debug mode only). dfbinfo - Show all mixers, encoders and outputs. - Show display layer sources. dfblayer - Added option "-L, --level " to change the level of a layer. dfbscreen - Added configuration tool for mixers, encoders and outputs. fusion_bench - Replaced getpid() reference benchmark by an flock(2) benchmark. - Use recursive mutexes in threaded mutex benchmark. - Each benchmark runs for one second now. - Added shmalloc/shfree benchmark. FreeType2 Font Loader - Added DSPF_A1 (monochrome font) support. - Speed up kerning cache. Video4Linux Video Provider - Added deinterlacing support for grabbing mode, i.e. added dfb_surface_set_field() calls to grabbing thread and added second frame callback to the loop (to make 50Hz out of the 25Hz of v4l). - Use CSLF_FORCE, fixes failing PlayTo() on a fresh surface. - Some other fixes. FBDev System - Print error message if the given mode (via "mode=" option) is not supported. OSX System - Added native OSX support without using SDL. Matrox - Backend Scaler (BES) fixes and improvements. - SGRAM auto-detection via /proc/bus/pci. - Added sysfs support to i2c detection code. Now it works on 2.6 kernels. - Use better constants for black/white level calculation on G450/G550 CRTC2. - Implemented TextureTriangles(). - Added texture LUT support (G200) and some other 8bpp improvements. - Added support for DSPF_NV12 (BES). - Cleanups and optimizations. VIA CLE266 - Added video underlay mode. - Added DLOP_DEINTERLACING support to video layer. - Use fbdev to map registers, obsoletes cle266vgaio. Code still works with cle266vgaio for vesafb users... - Implemented DSBLIT_DEINTERLACE. - Implemented TextureTriangles(). - Fixed the broken fonts problem. - Thanks to Bryce Nichols for reducing the hardware rounding errors in 16 bit mode by rendering the upper left and lower right triangle pair instead of the upper right and lower left. - Other major improvements and fixes. VIA Unichrome - New driver based on the CLE266 driver. - Support for multiple north bridges. - DVD Sub Picture Layer support. - Destination Color Keying for the Video Layer. nVidia - Impressive improvements by Claudio Ciccani . - Added support for ARGB1555, RGB32 and ARGB. - Added support for blit with conversion (ARGB1555,RGB32,ARGB to all). - Added support for YUY2 and UYVY on Primary Layer. - Added support for adjusting Brightness, Contrast, Saturation and Hue. - Destination Color Keying for Video Layer. - Implemented TextureTriangles(). - Implemented StretchBlit(). - Implemented alpha blended blitting and drawing. - Added experimental support for Colorizing. - Added sysfs support. - Added a fast Flip() function (not using ioctl). - Experimental WaitForSync() support. - Fixed ram amount detection on Xbox (thanks to Oliver Schwartz). - Giant cleanup and rewrite of the objects configuration routines: we use runtime configuration instead of fixed tables now. - Cleanups and fixes. SiS 315 - Added by Andreas Oberritter . - Rectangle Filling/Drawing, Line Drawing in 8, 16 and 32 bit. - Blitting (with Source Color Keying) in 8 and 16 bit. - Destination Color Keying, Clipping. ATI Mach64 - Added by Ville Syrjala . - Drawing and (Stretch)Blitting with keying, blending, conversion etc. - Video Overlay with source and destination color keying. - SGRAM block write support. - Added texture engine blitting code using power of two textures. ATI Radeon - Video Overlay support by Vadim Catana . - State handling fixes. NSC Geode - Improvements by Ed Millard . - Blitting on GX1, though it is constrained by hardware to only blit surfaces whose width matches the stride of the frame buffer. LibMpeg3 Video Provider - Added FusionSound support for audio playback. - Moved to DirectFB-extra package. Linux Input - Take Linux Input key code as hardware keycode. - Use EVIOCGRAB ioctl to grab the device. - Primary mouse is also identified as a mouse now. - Added keyboard LED support. - Copied keymap support from the keyboard driver. - Support more axes. LIRC Input - Emulate keyboard like key repeat behaviour using select() with timeout and a counter to drop the first few repeats. PS/2 Mouse Input - Added /dev/misc/psaux. - Just use one of "/dev/psaux" and "/dev/misc/psaux" if both are available. - Don't try them at all if uname() yields release "2.5.*" or "2.6.*". Serial Mouse Input - GPM repeater support by Micha Nelissen . ELO Touchscreen Input - Added by Brandon M. Reynolds . SDL Input - Wheel event support by Tom Bridgwater . 0.9.20 ------ - Added CLE266 driver by Andreas Robinson , thanks! The driver supports alpha blending, color keying, video overlay etc. - Added WM97XX Touchscreen driver, thanks to Liam Girdwood ! - Added DWOP_SHAPED which enables shaped input handling, windows with an alpha channel or a color key are ignored if the pixel under the cursor is completely transparent. Thanks to Monge Maurizio ! - Added IDirectFBEventBuffer::WakeUp() causing any WaitForEvent() or WaitForEventWithTimeout() to return with DFB_INTERRUPTED. - Added new display layer buffer mode DLBM_WINDOWS where the layer itself has no surface, but the hardware is aware of each window and displays the window stack. Added DLCAPS_WINDOWS, too. - Added - hot key to make a screenshot of the focused window including its alpha channel if present. Creates a ppm (RGB) and a pgm (alpha). Use "pnmtopng -alpha foo.pgm foo.ppm > foo.png" to combine them. - Added IDirectFBSurface::Dump() similar to -, see above. - Added "memcpy = " option to save a lot of startup time. "time dfbinfo" went from 0.080 secs to < 0.010 secs on my machine. - New environment variable "DFBARGS" is now parsed like the "--dfb:" parameter. - Added Fusion Kernel Device patch for Linux 2.6. - Added a patch to set proper clocks on a G400 (great performance boost). - Updated vmwarefb for VMware Workstation 4.0 with resolution and depth switch at run time, can disable acceleration at run time. Also fixed palette mode. - Video4Linux 2 support by Michael Hunold , thanks! - Send valid button events in MuTouch driver, thanks to Tim Wright . - Added support for color keyed PNGs (palette converted to RGB with color key). - Enable key repeat in SDL input driver. - Fixed segfault in slave processes when no graphics driver is loaded. - Signal handler now displays the faulting address in case of SIGSEGV. - Added configure option "--enable-trace" activating stack trace dumps in the signal handler. Uses "-finstrument-functions" and therefor only includes functions of DirectFB unless you compile your code with that option, too. - Optimized window stack updates by Maurizio Monge . - Optimized auto-video surface handling, speeding up Create/Clear a lot. - Software driver optimizations for LUT8 (e.g. colorkeyed blitting). - Switching single/multi between builds doesn't require "make clean" anymore. - Improved output of dfbdump (multi app resource monitor). - Important bug fix in state handling (multi app only). - Enhanced stability and bug fixes. 0.9.19 ------ - Initial version of a Radeon DirectFB driver featuring solid drawing/filling and simple blitting with or without key by Michel Dnzer . - Added VT switching support which has to be enabled via option "vt-switching". It's pretty well working already, though there are some minor issues left. - Added support for multiple multi application worlds with new option "session=" selecting the multi application world being joined or created. VT switching between multiple DirectFB sessions rocks! - Added option "primary-layer=" to swap the primary with the specified one, this way all applications can be started on the second head (Matrox). - Added "dfblayer", a display layer configuration tool (for multi app). - Added IDirectFB::GetInterface() to load interface modules like "IFusionSound". - Added time stamp to DFBWindowEvent. - Quitting the master (first multi app process) sends SIGTERM to all slaves and waits for them to quit (with a timeout). - Core systems (currently FBDev and SDL) are dynamically loaded as modules, which prevents DirectFB from being linked against SDL if support is enabled. - Added window manager key 'E' to focus the window under the mouse cursor. - Moved all global variables of the software driver to a new struct resulting in a major increase of primitive throughput, e.g. FillRectangle(1x1) by 16%. - Enhanced tmpfs detection and added option "tmpfs=" to set it explicitly. - Enhanced locking and safety in v4l video provider. - Improved graphics primitive throughput up to 100% by saving locks. - Added shared memory allocation tracking like for local memory. - Modules and drivers are now binary compatible with single/multi app library. - No more bone collector threads (3/master), almost instant object destruction. - Other bug fixes and cleanups. 0.9.18 ------ - National Semiconductors Geode driver by Sarma Kolluru . Great thanks to NSC for their support!!! - nVidia Overlay support by Oliver Schwartz , currently hard coded to XBox. For plain nVidia graphics adapter you need to change line 618ff of nvidia_overlay.c (uncomment line 618, comment out line 620). - Added multi application support to SDL backend. - Added triple buffering for display layers. - Added DPMS support via IDirectFBDisplayLayer::SetScreenPowerMode(). - Added IDirectFB::GetClipboardTimeStamp(). - Added optional time stamp return value to IDirectFB::SetClipboardData(). - Added DFB_KEY_IS_ASCII for your convenience. - Split DSFLIP_WAITFORSYNC into DSFLIP_WAIT and DSFLIP_ONSYNC. - Added DSPF_ALUT44, a new pixel format having 4 bits of alpha and 4 bits being an index to a color lookup table. - Added DIEF_GLOBAL indicating that the event was received without focus. - Added IDirectFBWindow::SetOpaqueRegion() which excludes one rectangle of the window from alpha blending, e.g. for blended borders around fast opaque content. This is especially useful if the content has no valid alpha values. - Added DWOP_OPAQUE_REGION which enables the opaque region. - Made all unsigned width, height in the API signed. - Made text drawing honor DSDRAW_BLEND flag to render translucent text. - Added Intel i810 driver from Tony Daplas < adaplas at users.sourceforge.net >. - New Fusion synchronous RPC mechanism speeds up fbdev layer flipping by slaves. Benchmark shows that RPC flips take as long as three non-RPC flips. - Non global input event buffers now also get events if any window of the application is focused. - The cursor is no longer enabled in DirectFBCreate(), but automatically when the first window is created unless the cursor was enabled/disabled before. Option "no-cursor" now forces the cursor to be disabled forever. - Implemented more software driver routines for DSPF_LUT8. - Always blit from top to bottom if source and destination buffers differ in the software driver. - Fixed state handling and other bugs in the ATI driver. - Significantly improved speed of DrawString() with matrox driver, other fixes and improvements to the matrox driver. - Multi application core fixes and improvements. - Improved graphics card locking for coexistence with DRI drivers. - Improved video memory management. - Improved matroxfb-vsync-irq and matroxfb-32mb patch. - Added Matrox TV output cable type selection. - Added README describing Matrox TV-out functionality. - Fixed DSCAPS_SEPARATED with planar formats in software driver. - Fixed tiled layer background mode. - Fixed bug which resulted in black screens with some framebuffer drivers. - Fixed segfault in MPEG2 I-Frame image provider by avoiding alloca. - Nicer debug output (show time in seconds with three digits after the comma). - Many bug fixes, gcc-3.3 fixes, build cleanups, optimizations, updated patches. 0.9.17 ------ - Added input driver for Microtouch serial touchscreens. - Added input device name and vendor to DFBInputDeviceDescription. - Added clipboard functionality via IDirectFB::Set/GetClipboardData() including mime type. This is an intermediate solution that will be replaced. - Added new tool "dfbinfo" which currently enumerates input devices and layers. - Added IDirectFBDisplayLayer::SetFieldParity(), thanks to Ville. - Added cooperative level restrictions to many display layer functions. - Readded DSPF_RGB15 (= DSPF_ARGB1555). - Graphics drivers are now able to return false in graphics functions to trigger a 'late' software fallback. Useful if blitting direction can't be set. - It is finally possible to specify which gfxdrivers should be built. ./configure --with-gfxdrivers= - Fix "could not adjust heap offset message" if the primary layer surface consumes the whole video memory (thanks to Ville Syrjala). - Fix for planar formats and other fixes by Ville Syrjala . - Fixed "directfb-config" for static linking. - Fixed destination color keying for blended drawing in software driver. - Fixed blitting within one buffer with NeoMagic (scrolling errors). - Reject YUV for fbdev layer, thanks to Jiri Svoboda . - Many bug fixes, code cleanups, comments and assertions added etc. 0.9.16 ------ - Added IDirectFBWindow::GrabKey() and UngrabKey(). - Added IDirectFBWindow::SetColorKeyIndex(). - Added IDirectFBWindow::SetCursorShape(). - Added IDirectFBDisplayLayer::WaitForSync(), thanks to Ville Syrjala. - Made IDirectFBWindow::SetColorKey() lookup the index if the format is indexed. - Removed DSPF_RGB15 in favor of DSPF_ARGB1555, not completely tested yet. - Added DFB_COLOR_EQUAL macro to compare two DFBColor. - Added -P shortcut to enable the cursor manually. - Added new multi app core shortcut Ctrl-Alt-Break which sends a SIGKILL to fullscreen applications, useful if a fullscreen app hangs. - Added optimized memcpy routines for PPC (disabled in default build). - New automatic grabbing mechanism for fullscreen applications running windowed. - Added options for statically linking applications with selected modules to directfb-config. - DirectColor visual support by Antonino Daplas . - Color adjustment support on primary layer (via gamma ramp in direct color mode) by Antonino Daplas . - Fixed implementation of window stacking classes. - Fixed segfault with default font provider (non-FT2). - Some essiential fixes of outstanding multi app bugs related to layers. - Only detach slave processes from their terminal if it's really necessary. Framebuffer ioctls are executed by the master only via fast RPC mechanism. - Avoid short single frame flicker when starting fullscreen apps by temporarily switching to KD_GRAPHICS mode. - New configure option "--disable-text" which disables all init, debug and error messages and saves about ~20k binary size (tested on i386). - Other minor bug fixes and improvements. 0.9.15 ------ - IDirectFB::CreateEventBuffer() no longer attaches input devices and doesn't take input capabilities. It just creates an empty event buffer. - Added IDirectFB::CreateInputEventBuffer() which implements both the 0.9.14 and pre 0.9.14 behaviour of CreateEventBuffer(). - Added DFBBoolean (with DFB_TRUE and DFB_FALSE). - DFBWindowEvent fields cx, cy, buttons, locks and modifiers are always valid. - Added implicit key grabbing while a key is held down in a window. Fixes interoparability ugliness between XDirectFB and DFBTerm (e.g. Ctrl-D). - Great improvement of performance and stability of the multi application core via new Fusion Kernel Device. SysV IPC usage completely dropped. - Added Fusion benchmark application (no graphics, just for testing). - Added desktop background configuration tool for multi app sessions. - Implemented additional config file loading for each application. E.g. running ".../foo" loads "/etc/directfbrc.foo" and "~/.directfbrc.foo". - Option 'no-hardware' now only disables acceleration, but driver is loaded and additional layers can still be used. - Options 'mode=' and 'pixelformat=' are now always fully supported. Fullscreen applications forced to run windowed (with 'force-windowed' option) will have a window with the size and format specified. - Fixed fatal bug in FreeType2 font loader that made many apps look wrong. - Fixed off-by-one bug in image loading code. Fixes color keyed blits in df_dok. - Some other bug fixes and optimizations. 0.9.14 ------ - Added IDirectFB::CreatePalette(). - Added IDirectFBSurface::SetPalette(). - Added IDirectFBPalette::GetCapabilities(). - Added IDirectFBPalette::CreateCopy(). - Added IDirectFBSurface::SetSrcColorKeyIndex() and SetDstColorKeyIndex(). - Added experimental blitting flag DSBLIT_DEINTERLACE which is implemented only in the Matrox driver for now. - Added DFDESC_FIXEDADVANCE forcing proportional fonts to be fixed width. - Added LUT8 and RGB332 acceleration to NeoMagic driver. - Added Meta (or Windows) key to wm hack (moving window etc.). - Added MPEG2 I-Frame image provider derived from mpeg2decode (mpeg.org). - Added driver for ucb1x00 based touchscreens. - Added dfbdump, a DirectFB debugging tool. - Renamed DSCAPS_SEPERATED to DSCAPS_SEPARATED. - Started abstraction of the "core system" featuring the "fbdev" system like before and a new experimental "sdl" system. Yepp, DirectFB running on SDL. Use "--dfb:system=sdl" to run applications under X. - Made the code compile on a variety of BSD flavours. - Enabled support for RGB332 by default. - Implemented YUV rectangle filling support for planar and non-planar formats in software driver (Ville Syrjala ). - Added gfxdriver for CyberPro 5xxx, a card found mainly in settop-boxes. - Matrox second head support via additional layers. New option "matrox-crtc2" to activate this (Ville Syrjala ). - Updated matrox vsync irq patch to support the second head. - Planar YUV blitting support in Matrox driver (Ville Syrjala ) - Fixed nVidia driver for big endian hosts. - The window stack and video mode are now restored even if a fullscreen application simply exits or gets killed by any signal (multi app core). - Improved multi application core stability via optional kernel device. - Some bug fixes, especially (de/re)initialization, multi app. - Added a directfb.spec file (Till Adam ). 0.9.13 ------ - Added new interface IDirectFBDataBuffer with three implementations (File, Memory and Stream). - Made image providers use the new IDirectFBDataBuffer. - Added DFBDisplayLayerTypeFlags for a basic layer classification. - Added DFBDisplayLayerDescription (changes DFBDisplayLayerCallback). - Added (yet unimplemented) IDirectFBImageProvider::SetRenderCallback(). - Added input_only windows (windows w/o a surface). - Added support for interlaced surfaces with seperate field buffers to all drawing and blitting functions. - Added new drawing flag DSDRAW_XOR. - Added support for color lookup tables. Added new surface type DSPF_LUT8 and IDirectFBSurface::GetPalette() and IDirectFBSurface::SetPalette(). - Added DSDESC_PALETTE to IDirectFBSurfaceDescription. - Added DSCAPS_STATIC_ALLOC to DFBSurfaceCapabilities. - Added DWDESC_SURFACE_CAPS to DFBWindowDescriptionFlags. - Added DWOP_ALPHACHANNEL to DFBWindowOptions. - Added IDirectFBSurface::SetColorIndex() for indexed pixel formats. - Added pre/demultiplication to drawing functions. - Added IDirectFBDisplayLayer::GetWindow(). - Added input driver for linux input driver (/dev/input/eventX). - Improved resource management with automatic cleanup (multi app core). - Cleaned up vertical retrace handling. - Added DFFA_NOCHARMAP to DFBFontAttributes to allow to access glyphs by their raw indices. - Improved V4L video provider, added support for grabbing and planar YUV. Thanks to Ville Syrjala and Mike Pieper . - Fixed color key handling in GIF provider. - Improvements to the layer driver API. - Renamed DLCAPS_INTERLACED_VIDEO to DLCAPS_DEINTERLACING. - Renamed DLOP_INTERLACED_VIDEO to DLOP_DEINTERLACING. - Enabled acceleration for the second head of a dual head Matrox card. - Updated Matrox vsync IRQ patch. - Improved S3 Savage drivers, thanks to Alex Song . - Added directfb-csource, a C code generator for inline images. - Lots of bug-fixes, multi app core improvements. 0.9.12 ------ - Added IDirectFBSurface::DrawGlyph(). - Added IDirectFBFont::GetKerning(). - Added IDirectFBFont::GetGlyphExtents(). - Added experimental blitting flags DSBLIT_SRC_PREMULTIPLY, DSBLIT_DST_PREMULTIPLY and DSBLIT_DEMULTIPLY. - Added dfb_utf8_prev_char() and fixed dfb_utf8_next_char(). - Added a mask of currently pressed buttons to input and window events. - Added structs DFBPoint and DFBDimension. - Added DIDTF_VIRTUAL for virtual input devices. - Added DSFT_BOTTOM to DFBSurfaceTextFlags. - Added DFB_NUM_PIXELFORMATS macro. - Give font providers control over pixel format and blending function. - Define DFBKeyIdentifierNames in directfb_keynames.h. - Some smaller fixes to the keyboard mapping. - Support all keysymbols in the lirc input driver. - Implemented planar YUV blitting in software driver. - Optimizations in the software driver. - Fixed blitting and drawing to ARGB in matrox driver. - Implemented missing BES flipping in matrox driver. - Lots of bug-fixes. 0.9.11 ------ - Added IDirectFBSurface::Clear(). - Added IDirectFBWindow::EnableEvents() and DisableEvents(). - Added IDirectFBWindow::SetStackingClass(). - Added IDirectFBDisplayLayer::GetLevel() and SetLevel() - Added IDirectFBInputDevice::GetKeymapEntry() (see below). - Redone keyboard handling. Each key now has a unique key_id which is mapped to a Unicode-compatible key_symbol using the keymap provided by the driver. - Use kernel keymapping table in keyboard driver. - Added kernel patch for VMware SVGA frame buffer. - Added kernel patch for S3 Savage frame buffer (experimental). - Added S3 Savage driver (experimental). - The Print key can now be used to dump screenshots in PPM format. - Left and right modifiers have seperate key identifiers now. - Introduced kerning cache in FT2 font provider. - Added module probing to FT2 font provider. - Speed up text rendering by using a special state. - Allow to change the buffermode of layers. - Support buffermode changes for additional layers. - Fixed A8 font blitting bug in Matrox driver. - Install directfb headers in a directfb subdirectory. - Install and look for modules in versioned subdirectory. - Fixed vsync polling when MDA emulation is active. - Cleaned up config options (directfbrc and command-line options). - New option "videoram-limit=". - New option "dont-catch" to disable signal handlers. - Added directfbrc(5) man-page. - Made shared memory handling thread-safe (multi-application core). - Optimizations in software driver. - Lots of bug-fixes. 0.9.10 ------ - Added options "mode=x" and "depth=". - Added SonyPI Jogdial input driver acting as a third axis and button. - Added a destination rectangle to IDirectFBImageProvider::RenderTo(). - Added IDirectFBEventBuffer::HasEvent(). - Added IDirectFBDisplayLayer::SetCursorAcceleration(). - Added IDirectFBWindow::PutAtop and PutBelow for restacking windows relatively. - Added destination colorkeying for display layers (like Xv does). - Added IDirectFBWindow::SetOptions() and GetOptions(). - Added color keying option for windows (e.g. for shaped windows). - Added window options to disable moving, resizing, stacking and destruction by wm hack. Added an option to turn a window into a passive output only window. - Added brightness control to neomagic video overlay (by Martin Mueller). - Added tmpfs mount point detection by Sebastian Klemke . - The shared memory area is now reinitialized during startup if it already existed, but with no DirectFB apps running. Other multi app core fixes. - Added more cleanup code, less IPC resource leakage after shutdown. - Bit depths of fb.modes entries are ignored now when looking for a requested mode. However, the default bit depth is the one of the first entry. - Improved RGB332 rendering using precalculated lookup tables with 4/8 entries. - Greatly optimized 16Bit StretchBlit in generic driver doubling performance on PowerPC systems (others than Intel/PowerPC not tested). - Windows can now be resized and destroyed via wm hack (CapsLock shortcuts). - Window stack compositing optimizations. - Simplified and cleaned up internal layer driver API. - Major code cleanups in windowing and layer core. - Fixed NeoMagic driver, that was broken in 0.9.9. - Fixed doubled and interlaced video modes. - Enhanced reference manual including an introduction to IDirectFB. - Many, many bug/stability fixes. More code commented. Bigger TODO file ;) 0.9.9 ----- - Added DSPF_I420 and DSPF_YV12, two planar YUV formats. - Added ATI Overlay support for all four YUV formats. - Added NeoMagic YUV Overlay support. - Added static linking support. Minor changes to driver and interface modules. - There's a general IDirectFBEventBuffer now that can be connected to input devices and windows. Added DFBEvent union that can contain any specific event class. - Added DFBUserEvent that can be used by developers (user of the library). - Added IDirectFBEventBuffer::PostEvent that can be used for any event class. - Each window has a unique window id now. DFBWindowEvent contains the id. - Added GetID functions to IDirectFB- DisplayLayer, Window and InputDevice. - Added IDirectFBSurface::TileBlit. - IPAQ buttons support by Ara Hacopian . - Windows can now be created with a specific pixel format, e.g. YUV. - RGB332 acceleration on Matrox cards (including alpha blending). - Added fast memcpy routine that uses MMX, MMXEXT or SSE. - Changed DirectFB command-line parsing: The only recognized options are --dfb-help and --dfb: follow by a comma-separated list of DirectFB options. The format of the options is the same as used in the directfbrc file. - Surfaces can now be created using existing surface data. - New option "[no-]cursor" to enable/disable the default cursor on startup. - New option "disable-window-opacity" for testing/tweaking purposes. - New option "lefty" that enables swapping of left and right button. - Applied patch from Till Adam that adds DFBInputDeviceLockState, IDirectFBInputDevice::GetLockState() and LED handling in keyboard driver. - Rewritten Libmpeg3 provider based on OpenQuicktime provider (YUV/Sound). - Make usage of CON2FBMAP (by Jiri Svoboda ). - '/dev/input/js*' support by W. Michael Petullo . - Detailed documentation of dbox2 remote driver code (example driver). - More code documentation, especially state handling. - Additional frame buffer device can be used to debug the surface manager. - All global DirectFB symbols have the prefix "dfb_" now. - Enno Brehm added dlopen on libdirectfb with RTLD_GLOBAL. - Completely rewritten shmalloc stuff (used by Multi Application Core) based on libc5's GNU malloc. It now uses tmpfs (former shmfs). - Some optimizations, Matrox colorkeying fixes. - ATI state fix by Topi Kanerva . - USB and PS/2 mice fixes, endian fixes on parisc, many other bugfixes. 0.9.8 ----- - Merged multi application core, which is currently under development. Must be enabled at compile time (--enable-multi). It is *NOT* stable yet. - Input/Gfx driver API changes to be ready for multihead and multi application core. - Added OpenGL support via the new interface "IDirectFBGL". - Added support for IMPS/2 mice including wheel support. - Added remote control driver for dbox2. - Added DWET_WHEEL window event. Focused windows now receive events if the mouse wheel is use. - Added simple blitting support for nVidia cards . - Added "wm_hack" feature: press shift lock over a window and spin the mouse wheel to change the window opacity. - Completed support for RGB332 (8bit mode), not fully optimized yet. - New triange fillig code from Holger Waechtler. Adds clipping support and utilizes accelerated rectangles as a fallback if possible. - Removed rounding factor when blitting non-scaled with tmu, very big fonts looked incorrect (matrox driver). - Fixed triangle filling in tdfx driver - Fixed segfault when rendering pipeline is empty, e.g. using DSDRAW_BLEND with SrcFunc DSBF_ZERO and DstFunc DSBF_ONE. - In RGB332 mode initialize alpha values in palette. Corrected color values in palette. - Fixed segfault in jpeg provider with large images. - Fixed some small memory leaks. - Include SMF_SOURCE in SMF_ALL, could have caused blitting from the wrong source recently (longer for a very few drivers) when switching to another state. - Fixed "--fbdev=" option. - ABI version handling for all drivers. - Moved examples to extra package (DirectFB-examples). - The mouse cursor is now activated by default. - DirectFB can be build with dietlibc. - Some namespace cleanups. - Updated aty128fb patch for linux 2.4.16. 0.9.7 ----- - Added deinterlacing for interlaced video sources to Matrox Backend Scaler. - Added DSPF_UYVY and clarified description of both YUV formats. - Added acceleration for Matrox Mystique, Millennium I&II, G100. - Added support for YUV in V4L video provider. - Added support for deinterlacing in df_layer example. - Added option "--fbdev=" to specify another device than "/dev/fb0". - Added support for 'gsync true', 'csync high' and 'extsync true' in fb.modes. - Added 8bit RGB332 pixelformat, implementation is not complete yet. If you want RGB332, you have to enable it using ./configure --enable-rgb332. - Optimized RGB15/RGB16 color keyed blit (doubled performance on some CPUs). - Allow RGB15 mode on fbdev drivers that report to use one bit for alpha. - Fixed blocking of CreateImageProvider when called on /dev/video with BTTV. - DirectFB now restores the palette during deinitialization, turns cursor and blanking back on and restores the terminal attributes like local echo. These fixes help a lot when using DirectFB with the option "--no-vt-switch". - Updated NeoMagic frame buffer driver patch for 2.4.10 and above. - Updated aty128fb frame buffer driver patch. The patch was tested with kernel versions from 2.4.7 - 2.4.12. It may work with older versions too. - IDirectFBSurface::SetSrcColorKey has to be called on the source now, when blitting to a surface which has source color keying enabled. - SetSrcColorKey and SetDstColorKey take three values now: r, g and b. They will be converted to the pixelformat of the surface automatically. - Some minor fixes. 0.9.6 ----- - Added H3600 (ipaq) Touchscreen input driver. - We now accept compatible pixelformats, e.g. IPAQ's RGB 444 format is compatible with RGB 565. - Matrox Backend Scaler support as additional display layer. - YUY2 format added for video playback. - Added 'IDirectFBDisplayLayer::Set/GetColorAdjustment()'. - Added simple layer example which plays a video onto the second layer. - Added new window capability DWCAPS_DOUBLEBUFFER to create windows with two back buffers. This is useful for overlapping windows which both cause frequent updates of the window stack. - Added 'IDirectFBWindow::Close()' that puts a 'DWET_CLOSE' event into the window's event queue. The event dispatcher thread can then decide to close it. - Added 'IDirectFBWindow::Destroy()' which actually destroys the window after sending a 'DWET_DESTROYED' event, so the event dispatcher thread can notice and release any interfaces belonging to it. - Added result 'DFB_DESTROYED' which is currently returned by 'IDirectFBWindow' and 'IDirectFBSurface' if the window or surface has been destroyed. - Fixed surface manager bug causing inconsistency between video/system memory. - More changes to surface manager fixing problems when using many many threads. - Fixed segfault when loading big PNGs, seemed to be a problem with alloca. - Minor fixes to window stack code. - Some fixes to deinitialization code. 0.9.5 ----- - Added 'IDirectFB->CreateInputBuffer()' that allows to easily create input buffers for specific events. - Added 'IDirectFBInputDevice->AttachInputBuffer()' to attach an existing input buffer to another input device. - Added 'IDirectFBImageProvider->GetImageDescription()' to obtain information about alpha channel availability and possible color keys. - New LIRC input driver, name your keys (lirc config file) like the DirectFB keycode enum does without the "DIKC_" prefix, e.g. "OK", "MENU" or "VOLUMEUP". - First version of nVidia RIVA TNT/TNT2/GeForce driver (very limited right now). - Updated kernel patches, improved synchronization for FBIO_WAITFORVSYNC. - New pkg-config file "directfb-internal.pc" for better support for third party modules built outside the DirectFB source tree. - You can move windows with the mouse when holding down CapsLock. - Font width can now be set independent from height, e.g. for non-square pixels. - Set gamma ramp, fixes "strange-colors-effect" with some frame buffer drivers. - Accept interlaced or double scan modes, 320x200 looks really cool in some way. - Deinitialization code cleaned up and reactivated. - V4L capturing is now stopped by exit and signal handlers. - Matrox driver cleanup and blending state fixes. - More detailed generated API Reference (more comments in directfb.h). - Many bug fixes, some compile fixes. 0.9.4 ------ - Software driver pipeline optimization giving me 70% speed up for solid lines. - Several bugfixes for image loading, Matrox driver, mode handling and more. - Removed 'realloc()s' that caused callback functions to write into the old memory location if 'realloc()' returns a new one. - API rewrite for IDirectFBDisplayLayer with new capabilities, e.g. flicker filtering, better configuration handling by 'Get/Set/TestConfiguration()'. - Sub surface handling improved, especially for surface resizing. - More safety and sanity checks and new error codes (DFB_MISSINGIMAGE, DFB_INVAREA, DFB_THIZNULL and DFB_IDNOTFOUND). - Additions to IDirectFBVideoProvider: 'GetCapabilities()' retrieves info about the provider, 'Set/GetColorAdjustment()' set/get values like contrast etc. - Cursor can be enabled/disabled and opacity can be set independently. Also cursor appears centered now. - Experimental support for VT switching during runtime ;-) - New command line option "--force-windowed" which already works with most of the examples, levels other than DFSCL_NORMAL give DFB_ACCESSDENIED. - GIF loading to ARGB fixed, transparent GIFs are now supported as ARGB. - Several fixes to video mode list and pixelformat handling in 'read_modes()', 'fbdev_set_mode()' and 'fbdev_get_pixelformat()'. - Added IDirectFBSurface->DrawLines(), used by df_dok now. - Some optimizations in DrawString and core font handling. - Fixed font problems with Matrox cards, their texture cache is flushed now after writing the glyph into the frame buffer (i.e. into the texture). - Mouse cursor movements are now clipped by the screen ;-) - Fixed 'directfb.h', identifier "id" was also a keyword in Objective C. - Added IDirectFBInputBuffer->WaitForEventWithTimeout, was missing in last release. 0.9.3 ------ - All modules (drivers/providers) are built conditionally, can be disabled. configure spits out a summary of all modules. - Some license headers were forgotten to change to LGPL. - New remote control keycodes and remote control input type. - df_window can play video files and behaves like a window manager. - New "thanks to" section in README. - Window stack repaints optimized through recursive function. - Added DirectFBSetOption from Till Adam . - Added IDirectFBInputBuffer->WaitForEventWithTimeout. - Changed to pthread conditions in waiting code. - Matrox driver fixed when blitting from 32bit without blending. - Added DFBInputDeviceTypeFlags, removed DIDID_TYPE. - Several cleanups in core, common code moved into helper functions. - Fonts can be loaded monochrome and/or without kerning. - Console blanking now disabled. - Software alpha blending performance boost for non MMX machines. - Added inputdriver for serial mice with config option "mouse-protocol". - Modularized inputdrivers. - Even faster DrawString() software implementations. - New function Font->GetStringExtents. - Use of antialiasing, kerning and hinting for fonts is now configurable. - Some fixes in the software rendering functions. - Support for interlaced PNGs (thanks to Johannes Zellner). - Two new example applications in very early stage. - New function IDirectFB->WaitForSync. 0.9.2 ------ - Fix for loading jpegs unscaled into 24bpp surfaces - 15bpp support for jpeg provider - v4l provider support for devfs (/dev/v4l/video*) - API change for DFBSurfaceDescription (pixelformat field instead of bpp field, removed DSCAPS_ALPHA.) - DrawString() and GetStringWidth() support UTF-8 encoded strings now. They take an additional parameter that specifies the number of bytes to use from the passed string or -1 for the complete string. - Fonts are no longer loaded completely, instead glyphs are loaded on demand and are cached for later use. - Font kerning tables are no longer loaded by the core. - Removed default font from the core and made it a IDirectFBFont interface. Pass NULL as filename to CreateFont() to get the default font. - Added MPEG video provider written by Kim JeongHoe based on libmpeg3. - Performance improvements in the software functions for DrawLine(), 16 bit drawing functions and DrawString() in all depth. - Added GetPos() and GetLength() functions to the video provider API. - Use /dev/tty0 or /dev/vc/0 (for devfs) instead of /dev/console so DirectFB works on machines with serial consoles. - Removed dependency on libm. 0.9.1 ------ - pkg-config files are available for optionally installed interfaces like IDirectFBVideoProvider_AviFile, so apps can test for their existence. - Added IDirectFBInputDevice->GetButtonState() which returns the state of the specified button. GetButtons() is also still available. - New demo called "df_knuckles" draws a three dimensional lighted skull that can be rotated by the mouse. (Port from Mark Vojkovich's DGA demo) - Fixed accelerator ids in neomagic driver to match the ids in the current neofb kernel patch that is now included in "patches". - Moved command-line parsing out of DirectFBCreate() into DirectFBInit(). This means to inititalize DirectFB() there are now two calls necessary: DirectFBInit( &argc, &argv ); DirectFBCreate( &dfb ); - Added IDirectFBSurface->FillTriangle() for solid and blended triangles. Implemented in generic driver and Voodoo, Matrox acceleration. - Interfaces with a reference counter of zero are automatically freed unless you enabled debugging during configure. In debug mode a released interface returns DFB_DEAD if a function has been called. - Added Shockwave Flash Video Provider written by Joachim 'Roh' Steiger. You will need the libflash, that can be downloaded as a shared library from our download section. No modifications of libflash code. - Added an option to directfb-config that makes "--libs" output the suitable LDFLAGS that are needed to have AviFile symbols resolved. - Mouse cursor is no longer enabled by default. - AviFile Provider now probing for ".asf" files, too. - Fixed Stop in AviFile Provider, work around crashing AviFile call Player->Stop by using Pause and Continue. PlayTo can now be called several times without stopping to change the destination on the fly. - V4L Video Provider no longer gets a NULL pointer as the filename, but "/dev/video0" and so on. Removed v4l code from core. - AviFile Provider updated to compile with newest AviFile version. - Implemented flipping of surfaces that are no window or layer surfaces, when the surface is a subsurface, a flipping region has been specified or the flipping flag DSFLIP_BLIT has been used. - Improved documentation generator, a few parsing fixes. - Added missing "void *callbackdata" to DFBInputDeviceCallback and DFBVideoModeCallback. - Some minor fixes and cleanups. 0.9.0 ------ Initial release. DirectFB-1.2.10/aclocal.m40000644000175000017500000104075611307521472012015 00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.61],, [m4_warning([this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 52 Debian 1.5.26-1ubuntu1 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac _LT_REQUIRED_DARWIN_CHECKS AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # -------------------------- # Check for some things on darwin AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[0123]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac ]) # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" m4_if($1,[],[ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec], [lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"]) sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"]) sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognize shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognize a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP], [AC_REQUIRE([LT_AC_PROG_SED])dnl dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # ------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # Cheap backport of AS_EXECUTABLE_P and required macros # from Autoconf 2.59; we should not use $as_executable_p directly. # _AS_TEST_PREPARE # ---------------- m4_ifndef([_AS_TEST_PREPARE], [m4_defun([_AS_TEST_PREPARE], [if test -x / >/dev/null 2>&1; then as_executable_p='test -x' else as_executable_p='test -f' fi ])])# _AS_TEST_PREPARE # AS_EXECUTABLE_P # --------------- # Check whether a file is executable. m4_ifndef([AS_EXECUTABLE_P], [m4_defun([AS_EXECUTABLE_P], [AS_REQUIRE([_AS_TEST_PREPARE])dnl $as_executable_p $1[]dnl ])])# AS_EXECUTABLE_P # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/as-ac-expand.m4]) DirectFB-1.2.10/lib/0000777000175000017500000000000011307522564010775 500000000000000DirectFB-1.2.10/lib/voodoo/0000777000175000017500000000000011307522564012302 500000000000000DirectFB-1.2.10/lib/voodoo/client.c0000644000175000017500000001236611245562152013646 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct __V_VoodooClient { int fd; VoodooManager *manager; }; DirectResult voodoo_client_create( const char *hostname, int session, VoodooClient **ret_client ) { DirectResult ret; int err, fd; struct addrinfo hints; struct addrinfo *addr; VoodooClient *client; D_ASSERT( ret_client != NULL ); memset( &hints, 0, sizeof(hints) ); hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; hints.ai_family = PF_UNSPEC; D_INFO( "Voodoo/Client: Looking up host '%s'...\n", hostname ); err = getaddrinfo( hostname, "2323", &hints, &addr ); if (err) { switch (err) { case EAI_FAMILY: D_ERROR( "Direct/Log: Unsupported address family!\n" ); return DR_UNSUPPORTED; case EAI_SOCKTYPE: D_ERROR( "Direct/Log: Unsupported socket type!\n" ); return DR_UNSUPPORTED; case EAI_NONAME: D_ERROR( "Direct/Log: Host not found!\n" ); return DR_FAILURE; case EAI_SERVICE: D_ERROR( "Direct/Log: Port 2323 is unreachable!\n" ); return DR_FAILURE; case EAI_ADDRFAMILY: case EAI_NODATA: D_ERROR( "Direct/Log: Host found, but has no address!\n" ); return DR_FAILURE; case EAI_MEMORY: return D_OOM(); case EAI_FAIL: D_ERROR( "Direct/Log: A non-recoverable name server error occurred!\n" ); return DR_FAILURE; case EAI_AGAIN: D_ERROR( "Direct/Log: Temporary error, try again!\n" ); return DR_TEMPUNAVAIL; default: D_ERROR( "Direct/Log: Unknown error occured!?\n" ); return DR_FAILURE; } } /* Create the client socket. */ fd = socket( addr->ai_family, SOCK_STREAM, 0 ); if (fd < 0) { D_PERROR( "Voodoo/Client: Could not create the socket via socket()!\n" ); freeaddrinfo( addr ); return errno2result( errno ); } D_INFO( "Voodoo/Client: Connecting to '%s:2323'...\n", addr->ai_canonname ); /* Connect to the server. */ err = connect( fd, addr->ai_addr, addr->ai_addrlen ); freeaddrinfo( addr ); if (err) { ret = errno2result( errno ); D_PERROR( "Voodoo/Client: Could not connect() to the server!\n" ); close( fd ); return ret; } /* Allocate client structure. */ client = D_CALLOC( 1, sizeof(VoodooClient) ); if (!client) { D_WARN( "out of memory" ); close( fd ); return DR_NOLOCALMEMORY; } /* Initialize client structure. */ client->fd = fd; /* Create the manager. */ ret = voodoo_manager_create( fd, client, NULL, &client->manager ); if (ret) { D_FREE( client ); close( fd ); return ret; } /* Return the new client. */ *ret_client = client; return DR_OK; } DirectResult voodoo_client_destroy( VoodooClient *client ) { D_ASSERT( client != NULL ); voodoo_manager_destroy( client->manager ); close( client->fd ); D_FREE( client ); return DR_OK; } VoodooManager * voodoo_client_manager( const VoodooClient *client ) { D_ASSERT( client != NULL ); return client->manager; } DirectFB-1.2.10/lib/voodoo/conf.c0000644000175000017500000000242111245562152013304 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include static VoodooConfig config = { }; VoodooConfig *voodoo_config = &config; DirectFB-1.2.10/lib/voodoo/types.h0000644000175000017500000000502511245562152013533 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__TYPES_H__ #define __VOODOO__TYPES_H__ #include typedef u32 VoodooInstanceID; typedef u32 VoodooMethodID; typedef u64 VoodooMessageSerial; #define VOODOO_INSTANCE_NONE ((VoodooInstanceID) 0) typedef struct __V_VoodooMessageHeader VoodooMessageHeader; typedef struct __V_VoodooSuperMessage VoodooSuperMessage; typedef struct __V_VoodooRequestMessage VoodooRequestMessage; typedef struct __V_VoodooResponseMessage VoodooResponseMessage; typedef struct __V_VoodooClient VoodooClient; typedef struct __V_VoodooConfig VoodooConfig; typedef struct __V_VoodooManager VoodooManager; typedef struct __V_VoodooServer VoodooServer; typedef DirectResult (*VoodooSuperConstruct)( VoodooServer *server, VoodooManager *manager, const char *name, void *ctx, VoodooInstanceID *ret_instance ); typedef DirectResult (*VoodooDispatch) ( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ); #endif DirectFB-1.2.10/lib/voodoo/Makefile.am0000644000175000017500000000257111164361026014252 00000000000000## Makefile.am for DirectFB/lib/voodoo INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \ -DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = voodoo.pc # If the old location isn't cleared, builds of external modules fail install-exec-local: rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/voodoo includedir = @INCLUDEDIR@/voodoo include_HEADERS = \ build.h \ client.h \ conf.h \ interface.h \ manager.h \ message.h \ server.h \ types.h lib_LTLIBRARIES = libvoodoo.la libvoodoo_la_SOURCES = \ client.c \ conf.c \ interface.c \ internal.h \ manager.c \ server.c libvoodoo_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) libvoodoo_la_LIBADD = ../direct/libdirect.la # ## and now rebuild the static version with the *correct* object files # if BUILD_STATIC clean-local: rm -f libvoodoo_fixed.a all-local: libvoodoo_fixed.a libvoodoo_fixed.a: .libs/libvoodoo.a rm -f libvoodoo_fixed.a ${AR} cru libvoodoo_fixed.a `find . -name "*.o"` ${RANLIB} libvoodoo_fixed.a cp -pf libvoodoo_fixed.a .libs/libvoodoo.a .libs/libvoodoo.a: libvoodoo.la else clean-local: all-local: endif include $(top_srcdir)/rules/nmfile.make DirectFB-1.2.10/lib/voodoo/build.h0000644000175000017500000000221111307521522013453 00000000000000/* (c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2002-2004 convergence GmbH. All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann and Ville Syrjl . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__BUILD_H__ #define __VOODOO__BUILD_H__ /* nothing yet */ #endif DirectFB-1.2.10/lib/voodoo/Makefile.in0000644000175000017500000005163011307521504014261 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/build.h.in \ $(srcdir)/voodoo.pc.in $(top_srcdir)/rules/nmfile.make subdir = lib/voodoo ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = build.h voodoo.pc am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libvoodoo_la_DEPENDENCIES = ../direct/libdirect.la am_libvoodoo_la_OBJECTS = client.lo conf.lo interface.lo manager.lo \ server.lo libvoodoo_la_OBJECTS = $(am_libvoodoo_la_OBJECTS) libvoodoo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libvoodoo_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libvoodoo_la_SOURCES) DIST_SOURCES = $(libvoodoo_la_SOURCES) pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @INCLUDEDIR@/voodoo infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \ -DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = voodoo.pc include_HEADERS = \ build.h \ client.h \ conf.h \ interface.h \ manager.h \ message.h \ server.h \ types.h lib_LTLIBRARIES = libvoodoo.la libvoodoo_la_SOURCES = \ client.c \ conf.c \ interface.c \ internal.h \ manager.c \ server.c libvoodoo_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) libvoodoo_la_LIBADD = ../direct/libdirect.la @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@LIBTONM = $(LTLIBRARIES:.la=-$(LT_RELEASE).so.$(LT_BINARY)) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/nmfile.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/voodoo/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/voodoo/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh build.h: $(top_builddir)/config.status $(srcdir)/build.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ voodoo.pc: $(top_builddir)/config.status $(srcdir)/voodoo.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libvoodoo.la: $(libvoodoo_la_OBJECTS) $(libvoodoo_la_DEPENDENCIES) $(libvoodoo_la_LINK) -rpath $(libdir) $(libvoodoo_la_OBJECTS) $(libvoodoo_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) all-local installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @BUILD_SHARED_FALSE@install-data-local: @ENABLE_TRACE_FALSE@install-data-local: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-includeHEADERS \ install-pkgconfigDATA install-dvi: install-dvi-am install-exec-am: install-exec-local install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA # If the old location isn't cleared, builds of external modules fail install-exec-local: rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/voodoo # # @BUILD_STATIC_TRUE@clean-local: @BUILD_STATIC_TRUE@ rm -f libvoodoo_fixed.a @BUILD_STATIC_TRUE@all-local: libvoodoo_fixed.a @BUILD_STATIC_TRUE@libvoodoo_fixed.a: .libs/libvoodoo.a @BUILD_STATIC_TRUE@ rm -f libvoodoo_fixed.a @BUILD_STATIC_TRUE@ ${AR} cru libvoodoo_fixed.a `find . -name "*.o"` @BUILD_STATIC_TRUE@ ${RANLIB} libvoodoo_fixed.a @BUILD_STATIC_TRUE@ cp -pf libvoodoo_fixed.a .libs/libvoodoo.a @BUILD_STATIC_TRUE@.libs/libvoodoo.a: libvoodoo.la @BUILD_STATIC_FALSE@clean-local: @BUILD_STATIC_FALSE@all-local: @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)" @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/lib/voodoo/client.h0000644000175000017500000000311311245562152013641 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__CLIENT_H__ #define __VOODOO__CLIENT_H__ #include DirectResult voodoo_client_create ( const char *host, int session, VoodooClient **ret_client ); DirectResult voodoo_client_destroy( VoodooClient *client ); VoodooManager *voodoo_client_manager( const VoodooClient *client ); #endif DirectFB-1.2.10/lib/voodoo/message.h0000644000175000017500000002671211245562152014021 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__MESSAGE_H__ #define __VOODOO__MESSAGE_H__ #include #include #include #define VOODOO_MSG_ALIGN(i) (((i) + 3) & ~3) typedef enum { VMBT_NONE, VMBT_ID, VMBT_INT, VMBT_UINT, VMBT_DATA, VMBT_ODATA, VMBT_STRING } VoodooMessageBlockType; typedef enum { VREQ_NONE = 0x00000000, VREQ_RESPOND = 0x00000001, VREQ_ASYNC = 0x00000002, VREQ_QUEUE = 0x00000004 } VoodooRequestFlags; typedef enum { VMSG_SUPER, VMSG_REQUEST, VMSG_RESPONSE } VoodooMessageType; struct __V_VoodooMessageHeader { int size; VoodooMessageSerial serial; VoodooMessageType type; }; struct __V_VoodooSuperMessage { VoodooMessageHeader header; }; struct __V_VoodooRequestMessage { VoodooMessageHeader header; VoodooInstanceID instance; VoodooMethodID method; VoodooRequestFlags flags; }; struct __V_VoodooResponseMessage { VoodooMessageHeader header; VoodooMessageSerial request; DirectResult result; VoodooInstanceID instance; }; typedef struct { int magic; const void *msg; const void *ptr; } VoodooMessageParser; #define __VOODOO_PARSER_PROLOG( parser, req_type ) \ const void *_vp_ptr; \ VoodooMessageBlockType _vp_type; \ int _vp_length; \ \ D_MAGIC_ASSERT( &(parser), VoodooMessageParser ); \ \ _vp_ptr = (parser).ptr; \ \ /* Read message block type. */ \ _vp_type = *(const u32*) _vp_ptr; \ \ D_ASSERT( _vp_type == (req_type) ); \ \ /* Read data block length. */ \ _vp_length = *(const s32*) (_vp_ptr + 4) #define __VOODOO_PARSER_EPILOG( parser ) \ /* Advance message data pointer. */ \ (parser).ptr += 8 + VOODOO_MSG_ALIGN(_vp_length) #define VOODOO_PARSER_BEGIN( parser, message ) \ do { \ const VoodooMessageHeader *_vp_header = (const VoodooMessageHeader *) (message); \ \ D_ASSERT( (message) != NULL ); \ D_ASSERT( _vp_header->type == VMSG_REQUEST || _vp_header->type == VMSG_RESPONSE ); \ \ (parser).msg = (message); \ (parser).ptr = (parser).msg + (_vp_header->type == VMSG_REQUEST ? \ sizeof(VoodooRequestMessage) : sizeof(VoodooResponseMessage)); \ \ D_MAGIC_SET_ONLY( &(parser), VoodooMessageParser ); \ } while (0) #define VOODOO_PARSER_GET_ID( parser, ret_id ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_ID ); \ \ D_ASSERT( _vp_length == 4 ); \ \ /* Read the ID. */ \ (ret_id) = *(const u32*) (_vp_ptr + 8); \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_GET_INT( parser, ret_int ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_INT ); \ \ D_ASSERT( _vp_length == 4 ); \ \ /* Read the integer. */ \ (ret_int) = *(const s32*) (_vp_ptr + 8); \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_GET_UINT( parser, ret_uint ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_UINT ); \ \ D_ASSERT( _vp_length == 4 ); \ \ /* Read the unsigned integer. */ \ (ret_uint) = *(const u32*) (_vp_ptr + 8); \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_GET_DATA( parser, ret_data ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_DATA ); \ \ D_ASSERT( _vp_length > 0 ); \ \ /* Return pointer to data. */ \ (ret_data) = _vp_ptr + 8; \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_READ_DATA( parser, dst, max_len ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_DATA ); \ \ D_ASSERT( _vp_length > 0 ); \ D_ASSERT( _vp_length <= max_len ); \ \ /* Copy data block. */ \ direct_memcpy( (dst), _vp_ptr + 8, _vp_length ); \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_COPY_DATA( parser, ret_data ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_DATA ); \ \ D_ASSERT( _vp_length > 0 ); \ \ /* Allocate memory on the stack. */ \ (ret_data) = alloca( _vp_length ); \ \ /* Copy data block. */ \ direct_memcpy( (ret_data), _vp_ptr + 8, _vp_length ); \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_GET_ODATA( parser, ret_data ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_ODATA ); \ \ D_ASSERT( _vp_length >= 0 ); \ \ /* Return pointer to data or NULL. */ \ if (_vp_length) \ (ret_data) = _vp_ptr + 8; \ else \ (ret_data) = NULL; \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_GET_STRING( parser, ret_string ) \ do { \ __VOODOO_PARSER_PROLOG( parser, VMBT_STRING ); \ \ D_ASSERT( _vp_length > 0 ); \ \ /* Return pointer to string. */ \ (ret_string) = (const char*) (_vp_ptr + 8); \ \ __VOODOO_PARSER_EPILOG( parser ); \ } while (0) #define VOODOO_PARSER_END( parser ) \ do { \ D_MAGIC_ASSERT( &(parser), VoodooMessageParser ); \ \ D_ASSUME( *(const u32*) ((parser).ptr) == VMBT_NONE ); \ \ D_MAGIC_CLEAR( &(parser) ); \ } while (0) #endif DirectFB-1.2.10/lib/voodoo/internal.h0000644000175000017500000000415111245562152014202 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__INTERNAL_H__ #define __VOODOO__INTERNAL_H__ #include DirectResult voodoo_server_construct ( VoodooServer *server, VoodooManager *manager, const char *name, VoodooInstanceID *ret_instance ); DirectResult voodoo_manager_create ( int socket_fd, VoodooClient *client, /* Either client ... */ VoodooServer *server, /* ... or server is valid. */ VoodooManager **ret_manager ); DirectResult voodoo_manager_close ( VoodooManager *manager ); DirectResult voodoo_manager_destroy ( VoodooManager *manager ); bool voodoo_manager_is_closed ( const VoodooManager *manager ); #endif DirectFB-1.2.10/lib/voodoo/voodoo.pc.in0000644000175000017500000000036511164361026014453 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Voodoo Description: Interface based network transparency (like CORBA) Version: @VERSION@ Requires: direct Libs: -L${libdir} -lvoodoo Cflags: -I@INCLUDEDIR@ DirectFB-1.2.10/lib/voodoo/manager.c0000644000175000017500000013226111245562152013777 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define IN_BUF_MAX (32 * 1024) #define OUT_BUF_MAX (17 * 1024) #define MAX_MSG_SIZE (17 * 1024) typedef struct { bool super; IAny *proxy; IAny *real; VoodooDispatch dispatch; } VoodooInstance; struct __V_VoodooManager { int magic; int fd; bool quit; long long millis; VoodooClient *client; /* Either client ... */ VoodooServer *server; /* ... or server is valid. */ int msg_count; VoodooMessageSerial msg_serial; DirectThread *dispatcher; struct { pthread_mutex_t lock; DirectHash *local; DirectHash *remote; VoodooInstanceID last; } instances; struct { pthread_mutex_t lock; pthread_cond_t wait; VoodooResponseMessage *current; } response; struct { DirectThread *thread; pthread_mutex_t lock; pthread_cond_t wait; u8 buffer[IN_BUF_MAX + MAX_MSG_SIZE]; int start; int end; int max; } input; struct { DirectThread *thread; pthread_mutex_t lock; pthread_cond_t wait; u8 buffer[OUT_BUF_MAX]; int start; int end; } output; }; /**************************************************************************************************/ static void *manager_dispatch_loop( DirectThread *thread, void *arg ); static void *manager_input_loop ( DirectThread *thread, void *arg ); static void *manager_output_loop ( DirectThread *thread, void *arg ); /**************************************************************************************************/ static DirectResult manager_lock_output ( VoodooManager *manager, int length, void **ret_ptr ); static DirectResult manager_unlock_output ( VoodooManager *manager, bool flush ); /**************************************************************************************************/ static DirectResult manager_lock_response ( VoodooManager *manager, VoodooMessageSerial request, VoodooResponseMessage **ret_response ); static DirectResult manager_unlock_response( VoodooManager *manager, VoodooResponseMessage *response ); /**************************************************************************************************/ static const int one = 1; /**************************************************************************************************/ #define DUMP_SOCKET_OPTION(o) \ val = 0; \ len = 4; \ \ if (getsockopt( fd, SOL_SOCKET, o, &val, &len )) \ D_PERROR( "Voodoo/Manager: getsockopt() for " #o " failed!\n" ); \ else \ D_DEBUG( "Voodoo/Manager: " #o " is %d\n", val ); DirectResult voodoo_manager_create( int fd, VoodooClient *client, VoodooServer *server, VoodooManager **ret_manager ) { DirectResult ret; VoodooManager *manager; int val; unsigned int len; static const int tos = IPTOS_LOWDELAY; D_ASSERT( fd >= 0 ); D_ASSERT( (client != NULL) ^ (server != NULL) ); D_ASSERT( ret_manager != NULL ); /* Allocate manager structure. */ manager = D_CALLOC( 1, sizeof(VoodooManager) ); if (!manager) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } D_DEBUG( "Voodoo/Manager: Creating manager at %p.\n", manager ); if (setsockopt( fd, SOL_IP, IP_TOS, &tos, sizeof(tos) ) < 0) D_PERROR( "Voodoo/Manager: Could not set IP_TOS!\n" ); if (setsockopt( fd, SOL_TCP, TCP_NODELAY, &one, sizeof(one) ) < 0) D_PERROR( "Voodoo/Manager: Could not set TCP_NODELAY!\n" ); DUMP_SOCKET_OPTION( SO_SNDLOWAT ); DUMP_SOCKET_OPTION( SO_RCVLOWAT ); DUMP_SOCKET_OPTION( SO_SNDBUF ); DUMP_SOCKET_OPTION( SO_RCVBUF ); /* Create the hash table for dispatcher instances. */ ret = direct_hash_create( 251, &manager->instances.local ); if (ret) { D_FREE( manager ); return ret; } /* Create the hash table for requestor instances. */ ret = direct_hash_create( 251, &manager->instances.remote ); if (ret) { direct_hash_destroy( manager->instances.local ); D_FREE( manager ); return ret; } /* Store file descriptor. */ manager->fd = fd; /* Store client or server. */ manager->client = client; manager->server = server; /* Initialize all locks. */ direct_util_recursive_pthread_mutex_init( &manager->instances.lock ); direct_util_recursive_pthread_mutex_init( &manager->response.lock ); direct_util_recursive_pthread_mutex_init( &manager->input.lock ); direct_util_recursive_pthread_mutex_init( &manager->output.lock ); /* Initialize all wait conditions. */ pthread_cond_init( &manager->response.wait, NULL ); pthread_cond_init( &manager->input.wait, NULL ); pthread_cond_init( &manager->output.wait, NULL ); /* Set default buffer limit. */ manager->input.max = IN_BUF_MAX; D_MAGIC_SET( manager, VoodooManager ); /* Create all threads. */ manager->dispatcher = direct_thread_create( DTT_MESSAGING, manager_dispatch_loop, manager, "Voodoo Dispatch" ); manager->input.thread = direct_thread_create( DTT_INPUT, manager_input_loop, manager, "Voodoo Input" ); manager->output.thread = direct_thread_create( DTT_OUTPUT, manager_output_loop, manager, "Voodoo Output" ); /* Return the new manager. */ *ret_manager = manager; return DR_OK; } DirectResult voodoo_manager_quit( VoodooManager *manager ) { D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSUME( !manager->quit ); if (manager->quit) return DR_OK; D_DEBUG( "Voodoo/Manager: Quitting manager at %p!\n", manager ); /* Have all threads quit upon this. */ manager->quit = true; /* Acquire locks and wake up waiters. */ pthread_mutex_lock( &manager->input.lock ); pthread_cond_broadcast( &manager->input.wait ); pthread_mutex_unlock( &manager->input.lock ); pthread_mutex_lock( &manager->response.lock ); pthread_cond_broadcast( &manager->response.wait ); pthread_mutex_unlock( &manager->response.lock ); pthread_mutex_lock( &manager->output.lock ); pthread_cond_broadcast( &manager->output.wait ); pthread_mutex_unlock( &manager->output.lock ); return DR_OK; } static bool instance_iterator( DirectHash *hash, unsigned long key, void *value, void *ctx ) { bool super = (unsigned long) ctx; VoodooInstance *instance = value; D_ASSERT( instance != NULL ); if (instance->super != super) { if (super) D_FREE( instance ); return true; } D_DEBUG( "Voodoo/Manager: Releasing dispatcher interface %p %s(instance %lu)...\n", instance->proxy, instance->super ? "[super] " : "", key ); D_ASSERT( instance->proxy != NULL ); D_ASSERT( instance->proxy->Release != NULL ); instance->proxy->Release( instance->proxy ); D_DEBUG( "Voodoo/Manager: Releasing real interface %p %s(instance %lu)...\n", instance->real, instance->super ? "[super] " : "", key ); D_ASSERT( instance->real != NULL ); D_ASSERT( instance->real->Release != NULL ); instance->real->Release( instance->real ); if (super) D_FREE( instance ); return true; } DirectResult voodoo_manager_destroy( VoodooManager *manager ) { D_MAGIC_ASSERT( manager, VoodooManager ); D_DEBUG( "Voodoo/Manager: Destroying manager at %p!\n", manager ); if (!manager->quit) voodoo_manager_quit( manager ); /* Wait for manager threads exiting. */ direct_thread_join( manager->input.thread ); direct_thread_destroy( manager->input.thread ); direct_thread_join( manager->dispatcher ); direct_thread_destroy( manager->dispatcher ); direct_thread_join( manager->output.thread ); direct_thread_destroy( manager->output.thread ); /* Destroy conditions. */ pthread_cond_destroy( &manager->input.wait ); pthread_cond_destroy( &manager->response.wait ); pthread_cond_destroy( &manager->output.wait ); /* Destroy locks. */ pthread_mutex_destroy( &manager->instances.lock ); pthread_mutex_destroy( &manager->input.lock ); pthread_mutex_destroy( &manager->response.lock ); pthread_mutex_destroy( &manager->output.lock ); /* Release all remaining interfaces. */ direct_hash_iterate( manager->instances.local, instance_iterator, (void*) false ); direct_hash_iterate( manager->instances.local, instance_iterator, (void*) true ); direct_hash_destroy( manager->instances.local ); direct_hash_destroy( manager->instances.remote ); D_MAGIC_CLEAR( manager ); /* Deallocate manager structure. */ D_FREE( manager ); return DR_OK; } bool voodoo_manager_is_closed( const VoodooManager *manager ) { D_MAGIC_ASSERT( manager, VoodooManager ); return manager->quit; } /**************************************************************************************************/ DirectResult voodoo_manager_super( VoodooManager *manager, const char *name, VoodooInstanceID *ret_instance ) { DirectResult ret; int len; int size; void *ptr; VoodooMessageSerial serial; VoodooSuperMessage *msg; VoodooResponseMessage *response; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( name != NULL ); D_ASSERT( ret_instance != NULL ); /* Calculate the total message size. */ len = strlen( name ) + 1; size = sizeof(VoodooSuperMessage) + len; /* Lock the output buffer for direct writing. */ ret = manager_lock_output( manager, size, &ptr ); if (ret) return ret; msg = ptr; serial = manager->msg_serial++; /* Fill message header. */ msg->header.size = size; msg->header.serial = serial; msg->header.type = VMSG_SUPER; /* Append the name of the super interface to create. */ direct_memcpy( msg + 1, name, len ); D_DEBUG( "Voodoo/Manager: Sending SUPER message %llu for '%s' (%d bytes).\n", (unsigned long long)serial, name, size ); /* Unlock the output buffer. */ manager_unlock_output( manager, true ); /* Wait for and lock the response buffer. */ ret = manager_lock_response( manager, serial, &response ); if (ret) { D_ERROR( "Voodoo/Manager: " "Waiting for the response failed (%s)!\n", DirectResultString( ret ) ); return ret; } D_DEBUG( "Voodoo/Manager: Got response %llu (%s) with instance %u for request %llu " "(%d bytes).\n", (unsigned long long)response->header.serial, DirectResultString( ret ), response->instance, (unsigned long long)response->request, response->header.size ); ret = response->result; if (ret) { D_ERROR( "Voodoo/Manager: Could not create remote super interface '%s' (%s)!\n", name, DirectResultString( ret ) ); manager_unlock_response( manager, response ); return ret; } D_INFO( "Voodoo/Manager: Created remote super interface '%s'.\n", name ); /* Return the new instance ID. */ *ret_instance = response->instance; /* Unlock the response buffer. */ manager_unlock_response( manager, response ); return DR_OK; } static inline int calc_blocks( VoodooMessageBlockType type, va_list args ) { int size = 4; /* for the terminating VMBT_NONE */ while (type != VMBT_NONE) { u32 arg; s32 in; void *ptr; int len = 0; switch (type) { case VMBT_ID: len = 4; arg = va_arg( args, u32 ); D_DEBUG( "Voodoo/Message: + ID %u\n", arg ); break; case VMBT_INT: len = 4; in = va_arg( args, s32 ); D_DEBUG( "Voodoo/Message: + INT %d\n", in ); break; case VMBT_UINT: len = 4; arg = va_arg( args, u32 ); D_DEBUG( "Voodoo/Message: + UINT %u\n", arg ); break; case VMBT_DATA: len = va_arg( args, int ); ptr = va_arg( args, void * ); D_ASSERT( len > 0 ); D_ASSERT( ptr != NULL ); D_DEBUG( "Voodoo/Message: + DATA at %p with length %d\n", ptr, len ); break; case VMBT_ODATA: len = va_arg( args, int ); ptr = va_arg( args, void * ); D_ASSERT( len > 0 ); D_DEBUG( "Voodoo/Message: + ODATA at %p with length %d\n", ptr, len ); if (!ptr) len = 0; break; case VMBT_STRING: ptr = va_arg( args, char * ); len = strlen( ptr ) + 1; D_ASSERT( ptr != NULL ); D_DEBUG( "Voodoo/Message: + STRING '%s' at %p with length %d\n", (char*) ptr, ptr, len ); break; default: D_BREAK( "unknown message block type" ); } size += 8 + VOODOO_MSG_ALIGN(len); type = va_arg( args, VoodooMessageBlockType ); } return size; } static inline void write_blocks( void *dst, VoodooMessageBlockType type, va_list args ) { u32 *d32 = dst; while (type != VMBT_NONE) { u32 arg = 0; u32 len = 0; void *ptr = NULL; switch (type) { case VMBT_ID: case VMBT_INT: case VMBT_UINT: len = 4; arg = va_arg( args, u32 ); break; case VMBT_DATA: len = va_arg( args, int ); ptr = va_arg( args, void * ); break; case VMBT_ODATA: len = va_arg( args, int ); ptr = va_arg( args, void * ); if (!ptr) len = 0; break; case VMBT_STRING: ptr = va_arg( args, char * ); len = strlen( ptr ) + 1; break; default: D_BREAK( "unknown message block type" ); } /* Write block type and length. */ d32[0] = type; d32[1] = len; /* Write block content. */ if (ptr) direct_memcpy( &d32[2], ptr, len ); else if (len) { D_ASSERT( len == 4 ); d32[2] = arg; } /* Advance message data pointer. */ d32 += 2 + (VOODOO_MSG_ALIGN(len) >> 2); /* Fetch next message block type. */ type = va_arg( args, VoodooMessageBlockType ); } /* Write terminator. */ d32[0] = VMBT_NONE; } DirectResult voodoo_manager_request( VoodooManager *manager, VoodooInstanceID instance, VoodooMethodID method, VoodooRequestFlags flags, VoodooResponseMessage **ret_response, VoodooMessageBlockType block_type, ... ) { DirectResult ret; int size; void *ptr; VoodooMessageSerial serial; VoodooRequestMessage *msg; va_list args; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( instance != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_response != NULL || !(flags & VREQ_RESPOND) ); D_ASSUME( (flags & (VREQ_RESPOND | VREQ_QUEUE)) != (VREQ_RESPOND | VREQ_QUEUE) ); D_DEBUG( "Voodoo/Request: " "Instance %u, method %u, flags 0x%08x...\n", instance, method, flags ); /* Calculate the total message size. */ va_start( args, block_type ); size = sizeof(VoodooRequestMessage) + calc_blocks( block_type, args ); va_end( args ); D_DEBUG( "Voodoo/Request: --> complete message size: %d\n", size ); /* Lock the output buffer for direct writing. */ ret = manager_lock_output( manager, size, &ptr ); if (ret) return ret; msg = ptr; serial = manager->msg_serial++; /* Fill message header. */ msg->header.size = size; msg->header.serial = serial; msg->header.type = VMSG_REQUEST; /* Fill message body. */ msg->instance = instance; msg->method = method; msg->flags = flags; /* Append custom data. */ va_start( args, block_type ); write_blocks( msg + 1, block_type, args ); va_end( args ); D_DEBUG( "Voodoo/Manager: Sending REQUEST message %llu to %u::%u %s(%d bytes).\n", (unsigned long long)serial, instance, method, (flags & VREQ_RESPOND) ? "[RESPONDING] " : "", size ); /* Unlock the output buffer. */ manager_unlock_output( manager, !(flags & VREQ_QUEUE) ); /* Wait for and lock the response buffer. */ if (flags & VREQ_RESPOND) { VoodooResponseMessage *response; ret = manager_lock_response( manager, serial, &response ); if (ret) { D_ERROR( "Voodoo/Manager: " "Waiting for the response failed (%s)!\n", DirectResultString( ret ) ); return ret; } D_DEBUG( "Voodoo/Manager: Got response %llu (%s) with instance %u for request %llu " "(%d bytes).\n", (unsigned long long)response->header.serial, DirectResultString( response->result ), response->instance, (unsigned long long)response->request, response->header.size ); *ret_response = response; } return DR_OK; } DirectResult voodoo_manager_finish_request( VoodooManager *manager, VoodooResponseMessage *response ) { D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( response != NULL ); /* Unlock the response buffer. */ return manager_unlock_response( manager, response ); } DirectResult voodoo_manager_respond( VoodooManager *manager, VoodooMessageSerial request, DirectResult result, VoodooInstanceID instance, VoodooMessageBlockType block_type, ... ) { DirectResult ret; int size; void *ptr; VoodooMessageSerial serial; VoodooResponseMessage *msg; va_list args; D_MAGIC_ASSERT( manager, VoodooManager ); D_DEBUG( "Voodoo/Response: " "Request %llu, result %d, instance %u...\n", (unsigned long long)request, result, instance ); /* Calculate the total message size. */ va_start( args, block_type ); size = sizeof(VoodooResponseMessage) + calc_blocks( block_type, args ); va_end( args ); D_DEBUG( "Voodoo/Response: --> complete message size: %d\n", size ); /* Lock the output buffer for direct writing. */ ret = manager_lock_output( manager, size, &ptr ); if (ret) return ret; msg = ptr; serial = manager->msg_serial++; /* Fill message header. */ msg->header.size = size; msg->header.serial = serial; msg->header.type = VMSG_RESPONSE; /* Fill message body. */ msg->request = request; msg->result = result; msg->instance = instance; /* Append custom data. */ va_start( args, block_type ); write_blocks( msg + 1, block_type, args ); va_end( args ); D_DEBUG( "Voodoo/Manager: " "Sending RESPONSE message %llu (%s) with instance %u for request %llu (%d bytes).\n", (unsigned long long)serial, DirectResultString( result ), instance, (unsigned long long)request, size ); /* Unlock the output buffer. */ manager_unlock_output( manager, true ); return DR_OK; } DirectResult voodoo_manager_register_local( VoodooManager *manager, bool super, void *dispatcher, void *real, VoodooDispatch dispatch, VoodooInstanceID *ret_instance ) { DirectResult ret; VoodooInstance *instance; VoodooInstanceID instance_id; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( dispatcher != NULL ); D_ASSERT( real != NULL ); D_ASSERT( dispatch != NULL ); D_ASSERT( ret_instance != NULL ); instance = D_CALLOC( 1, sizeof(VoodooInstance) ); if (!instance) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } instance->super = super; instance->proxy = dispatcher; instance->real = real; instance->dispatch = dispatch; pthread_mutex_lock( &manager->instances.lock ); instance_id = ++manager->instances.last; ret = direct_hash_insert( manager->instances.local, instance_id, instance ); pthread_mutex_unlock( &manager->instances.lock ); if (ret) { D_ERROR( "Voodoo/Manager: Adding a new instance to the dispatcher hash table failed!\n" ); D_FREE( instance ); return ret; } D_DEBUG( "Voodoo/Manager: " "Added instance %u, dispatcher %p, real %p.\n", instance_id, dispatcher, real ); *ret_instance = instance_id; return DR_OK; } DirectResult voodoo_manager_lookup_local( VoodooManager *manager, VoodooInstanceID instance_id, void **ret_dispatcher, void **ret_real ) { VoodooInstance *instance; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( instance_id != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_dispatcher != NULL || ret_real != NULL ); pthread_mutex_lock( &manager->instances.lock ); instance = direct_hash_lookup( manager->instances.local, instance_id ); pthread_mutex_unlock( &manager->instances.lock ); if (!instance) return DR_NOSUCHINSTANCE; if (ret_dispatcher) *ret_dispatcher = instance->proxy; if (ret_real) *ret_real = instance->real; return DR_OK; } DirectResult voodoo_manager_register_remote( VoodooManager *manager, bool super, void *requestor, VoodooInstanceID instance_id ) { DirectResult ret; VoodooInstance *instance; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( requestor != NULL ); D_ASSERT( instance_id != VOODOO_INSTANCE_NONE ); instance = D_CALLOC( 1, sizeof(VoodooInstance) ); if (!instance) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } instance->super = super; instance->proxy = requestor; pthread_mutex_lock( &manager->instances.lock ); ret = direct_hash_insert( manager->instances.remote, instance_id, instance ); pthread_mutex_unlock( &manager->instances.lock ); if (ret) { D_ERROR( "Voodoo/Manager: Adding a new instance to the requestor hash table failed!\n" ); D_FREE( instance ); return ret; } D_DEBUG( "Voodoo/Manager: " "Added remote instance %u, requestor %p.\n", instance_id, requestor ); return DR_OK; } DirectResult voodoo_manager_lookup_remote( VoodooManager *manager, VoodooInstanceID instance_id, void **ret_requestor ) { VoodooInstance *instance; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( instance_id != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_requestor != NULL ); pthread_mutex_lock( &manager->instances.lock ); instance = direct_hash_lookup( manager->instances.remote, instance_id ); pthread_mutex_unlock( &manager->instances.lock ); if (!instance) return DR_NOSUCHINSTANCE; *ret_requestor = instance->proxy; return DR_OK; } /**************************************************************************************************/ static void handle_disconnect( VoodooManager *manager ) { D_MAGIC_ASSERT( manager, VoodooManager ); if (0) { int num; long long millis = direct_clock_get_millis(); long long diff = millis - manager->millis; num = manager->msg_count * 1000LL / diff; D_INFO( "Voodoo/Manager: Average number of messages: %d.%03d k/sec\n", num / 1000, num % 1000 ); } D_DEBUG( "Voodoo/Manager: Remote site disconnected from manager at %p!\n", manager ); voodoo_manager_quit( manager ); } static void handle_super( VoodooManager *manager, VoodooSuperMessage *super ) { DirectResult ret; const char *name; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( super != NULL ); D_ASSERT( super->header.size >= sizeof(VoodooSuperMessage) ); D_ASSERT( super->header.type == VMSG_SUPER ); name = (const char *) (super + 1); D_DEBUG( "Voodoo/Dispatch: Handling SUPER message %llu for '%s' (%d bytes).\n", (unsigned long long)super->header.serial, name, super->header.size ); if (manager->server) { VoodooInstanceID instance; ret = voodoo_server_construct( manager->server, manager, name, &instance ); if (ret) { voodoo_manager_respond( manager, super->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); return; } voodoo_manager_respond( manager, super->header.serial, DR_OK, instance, VMBT_NONE ); } else { D_WARN( "can't handle this as a client" ); voodoo_manager_respond( manager, super->header.serial, DR_UNSUPPORTED, VOODOO_INSTANCE_NONE, VMBT_NONE ); } } typedef struct { VoodooManager *manager; VoodooInstance *instance; VoodooRequestMessage *request; } DispatchAsyncContext; static void * dispatch_async_thread( void *arg ) { DirectResult ret; DispatchAsyncContext *context = arg; VoodooManager *manager = context->manager; VoodooInstance *instance = context->instance; VoodooRequestMessage *request = context->request; ret = instance->dispatch( instance->proxy, instance->real, manager, request ); if (ret && (request->flags & VREQ_RESPOND)) voodoo_manager_respond( manager, request->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); D_FREE( context ); return NULL; } static void handle_request( VoodooManager *manager, VoodooRequestMessage *request ) { DirectResult ret; VoodooInstance *instance; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( request != NULL ); D_ASSERT( request->header.size >= sizeof(VoodooRequestMessage) ); D_ASSERT( request->header.type == VMSG_REQUEST ); D_DEBUG( "Voodoo/Dispatch: Handling REQUEST message %llu to %u::%u %s%s(%d bytes).\n", (unsigned long long)request->header.serial, request->instance, request->method, (request->flags & VREQ_RESPOND) ? "[RESPONDING] " : "", (request->flags & VREQ_ASYNC) ? "[ASYNC] " : "", request->header.size ); pthread_mutex_lock( &manager->instances.lock ); instance = direct_hash_lookup( manager->instances.local, request->instance ); if (!instance) { pthread_mutex_unlock( &manager->instances.lock ); D_ERROR( "Voodoo/Dispatch: " "Requested instance %u doesn't exist (anymore)!\n", request->instance ); if (request->flags & VREQ_RESPOND) voodoo_manager_respond( manager, request->header.serial, DR_NOSUCHINSTANCE, VOODOO_INSTANCE_NONE, VMBT_NONE ); return; } if (request->flags & VREQ_ASYNC) { pthread_t thread; DispatchAsyncContext *context; context = D_MALLOC( sizeof(DispatchAsyncContext) + request->header.size ); if (!context) { D_WARN( "out of memory" ); pthread_mutex_unlock( &manager->instances.lock ); return; } context->manager = manager; context->instance = instance; context->request = (VoodooRequestMessage*) (context + 1); direct_memcpy( context->request, request, request->header.size ); pthread_create( &thread, NULL, dispatch_async_thread, context ); pthread_detach( thread ); } else { ret = instance->dispatch( instance->proxy, instance->real, manager, request ); if (ret && (request->flags & VREQ_RESPOND)) voodoo_manager_respond( manager, request->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } pthread_mutex_unlock( &manager->instances.lock ); } static void handle_response( VoodooManager *manager, VoodooResponseMessage *response ) { D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( response != NULL ); D_ASSERT( response->header.size >= sizeof(VoodooResponseMessage) ); D_ASSERT( response->header.type == VMSG_RESPONSE ); D_ASSERT( response->request < manager->msg_serial ); D_DEBUG( "Voodoo/Dispatch: Handling RESPONSE message %llu (%s) with instance %u for request " "%llu (%d bytes).\n", (unsigned long long)response->header.serial, DirectResultString( response->result ), response->instance, (unsigned long long)response->request, response->header.size ); pthread_mutex_lock( &manager->response.lock ); D_ASSERT( manager->response.current == NULL ); manager->response.current = response; pthread_cond_broadcast( &manager->response.wait ); while (manager->response.current && !manager->quit) pthread_cond_wait( &manager->response.wait, &manager->response.lock ); pthread_mutex_unlock( &manager->response.lock ); } /**************************************************************************************************/ static void * manager_dispatch_loop( DirectThread *thread, void *arg ) { VoodooManager *manager = arg; /* Lock the input buffer. */ pthread_mutex_lock( &manager->input.lock ); while (!manager->quit) { VoodooMessageHeader *header; int aligned; D_MAGIC_ASSERT( manager, VoodooManager ); D_DEBUG( "Voodoo/Dispatch: START %d, END %d, MAX %d\n", manager->input.start, manager->input.end, manager->input.max ); /* Wait for at least four bytes which contain the length of the message. */ while (manager->input.end - manager->input.start < 4) { D_DEBUG( "Voodoo/Dispatch: Waiting for messages...\n" ); pthread_cond_wait( &manager->input.wait, &manager->input.lock ); if (manager->quit) break; } if (manager->quit) break; /* Get the message header. */ header = (VoodooMessageHeader *)(manager->input.buffer + manager->input.start); aligned = VOODOO_MSG_ALIGN( header->size ); D_DEBUG( "Voodoo/Dispatch: Next message has %d (%d) bytes and is of type %d...\n", header->size, aligned, header->type ); D_ASSERT( header->size >= sizeof(VoodooMessageHeader) ); D_ASSERT( header->size <= MAX_MSG_SIZE ); /* Extend the buffer if the message doesn't fit into the default boundary. */ if (aligned > manager->input.max - manager->input.start) { D_ASSERT( manager->input.max == IN_BUF_MAX ); D_DEBUG( "Voodoo/Dispatch: ...fetching tail of message.\n" ); manager->input.max = manager->input.start + aligned; pthread_cond_broadcast( &manager->input.wait ); } /* Wait until the complete message is received. */ while (aligned > manager->input.end - manager->input.start) { pthread_cond_wait( &manager->input.wait, &manager->input.lock ); if (manager->quit) break; } if (manager->quit) break; /* Unlock the input buffer. */ pthread_mutex_unlock( &manager->input.lock ); switch (header->type) { case VMSG_SUPER: handle_super( manager, (VoodooSuperMessage*) header ); break; case VMSG_REQUEST: handle_request( manager, (VoodooRequestMessage*) header ); break; case VMSG_RESPONSE: handle_response( manager, (VoodooResponseMessage*) header ); break; default: D_BUG( "invalid message type %d", header->type ); break; } /* Lock the input buffer. */ pthread_mutex_lock( &manager->input.lock ); manager->input.start += aligned; if (manager->input.start == manager->input.end) { if (manager->input.start == manager->input.max) pthread_cond_broadcast( &manager->input.wait ); manager->input.start = manager->input.end = 0; manager->input.max = IN_BUF_MAX; } } /* Unlock the input buffer. */ pthread_mutex_unlock( &manager->input.lock ); return NULL; } static void * manager_input_loop( DirectThread *thread, void *arg ) { int len; struct pollfd pf; VoodooManager *manager = arg; manager->millis = direct_clock_get_millis(); while (!manager->quit) { D_MAGIC_ASSERT( manager, VoodooManager ); pf.fd = manager->fd; pf.events = POLLIN; switch (poll( &pf, 1, 100 )) { case -1: if (errno != EINTR) { D_PERROR( "Voodoo/Input: Could not poll() the socket!\n" ); usleep( 200000 ); } /* fall through */ case 0: continue; } pthread_mutex_lock( &manager->input.lock ); while (manager->input.end == manager->input.max) { pthread_cond_wait( &manager->input.wait, &manager->input.lock ); if (manager->quit) break; } if (!manager->quit) { len = recv( manager->fd, manager->input.buffer + manager->input.end, manager->input.max - manager->input.end, MSG_DONTWAIT ); if (len < 0) { switch (errno) { case EINTR: case EAGAIN: break; default: D_PERROR( "Voodoo/Input: Could not recv() data!\n" ); usleep( 200000 ); } } else if (len > 0) { D_DEBUG( "Voodoo/Input: Received %d bytes...\n", len ); manager->input.end += len; pthread_cond_broadcast( &manager->input.wait ); } else handle_disconnect( manager ); } pthread_mutex_unlock( &manager->input.lock ); } return NULL; } static void * manager_output_loop( DirectThread *thread, void *arg ) { int len; struct pollfd pf; VoodooManager *manager = arg; while (!manager->quit) { D_MAGIC_ASSERT( manager, VoodooManager ); pf.fd = manager->fd; pf.events = POLLOUT; switch (poll( &pf, 1, 100 )) { case -1: if (errno != EINTR) { D_PERROR( "Voodoo/Output: Could not poll() the socket!\n" ); usleep( 200000 ); } /* fall through */ case 0: continue; } pthread_mutex_lock( &manager->output.lock ); while (manager->output.start == manager->output.end) { struct timeval now; struct timespec timeout; D_ASSUME( manager->output.start == 0 ); D_ASSUME( manager->output.end == 0 ); gettimeofday( &now, NULL ); timeout.tv_sec = now.tv_sec; timeout.tv_nsec = (now.tv_usec + 50000) * 1000; timeout.tv_sec += timeout.tv_nsec / 1000000000; timeout.tv_nsec %= 1000000000; pthread_cond_timedwait( &manager->output.wait, &manager->output.lock, &timeout ); if (manager->quit) break; } if (!manager->quit) { len = send( manager->fd, manager->output.buffer + manager->output.start, manager->output.end - manager->output.start, MSG_DONTWAIT ); if (len < 0) { switch (errno) { case EINTR: case EAGAIN: break; default: D_PERROR( "Voodoo/Output: Could not send() data!\n" ); usleep( 200000 ); } } else { D_DEBUG( "Voodoo/Output: Sent %d/%d bytes...\n", len, manager->output.end - manager->output.start ); manager->output.start += len; if (manager->output.start == manager->output.end) { manager->output.start = manager->output.end = 0; pthread_cond_broadcast( &manager->output.wait ); } } } pthread_mutex_unlock( &manager->output.lock ); } return NULL; } /**************************************************************************************************/ static DirectResult manager_lock_output( VoodooManager *manager, int length, void **ret_ptr ) { int aligned; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( length >= sizeof(VoodooMessageHeader) ); D_ASSUME( length <= MAX_MSG_SIZE ); D_ASSERT( ret_ptr != NULL ); if (length > MAX_MSG_SIZE) { D_WARN( "%d exceeds maximum message size of %d", length, MAX_MSG_SIZE ); return DR_LIMITEXCEEDED; } aligned = VOODOO_MSG_ALIGN( length ); pthread_mutex_lock( &manager->output.lock ); while (manager->output.end + aligned > OUT_BUF_MAX) { pthread_cond_broadcast( &manager->output.wait ); pthread_cond_wait( &manager->output.wait, &manager->output.lock ); if (manager->quit) { pthread_mutex_lock( &manager->output.lock ); return DR_DESTROYED; } } *ret_ptr = manager->output.buffer + manager->output.end; manager->output.end += aligned; return DR_OK; } static DirectResult manager_unlock_output( VoodooManager *manager, bool flush ) { D_MAGIC_ASSERT( manager, VoodooManager ); if (flush) pthread_cond_broadcast( &manager->output.wait ); pthread_mutex_unlock( &manager->output.lock ); return DR_OK; } /**************************************************************************************************/ static DirectResult manager_lock_response( VoodooManager *manager, VoodooMessageSerial request, VoodooResponseMessage **ret_response ) { VoodooResponseMessage *response = NULL; D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( ret_response != NULL ); D_DEBUG( "Voodoo/Manager: Locking response to request %llu...\n", (unsigned long long)request ); pthread_mutex_lock( &manager->response.lock ); while (!manager->quit) { response = manager->response.current; if (response && response->request == request) break; if (response) D_DEBUG( "Voodoo/Manager: ...current response is for request %llu...\n", (unsigned long long)response->request ); D_DEBUG( "Voodoo/Manager: ...(still) waiting for response to request %llu...\n", (unsigned long long)request ); pthread_cond_wait( &manager->response.wait, &manager->response.lock ); } if (manager->quit) { pthread_mutex_unlock( &manager->response.lock ); return DR_DESTROYED; } D_DEBUG( "Voodoo/Manager: ...locked response %llu to request %llu (%d bytes).\n", (unsigned long long)response->header.serial, (unsigned long long)request, response->header.size ); *ret_response = response; return DR_OK; } static DirectResult manager_unlock_response( VoodooManager *manager, VoodooResponseMessage *response ) { D_MAGIC_ASSERT( manager, VoodooManager ); D_ASSERT( response != NULL ); D_ASSERT( response == manager->response.current ); D_DEBUG( "Voodoo/Manager: Unlocking response %llu to request %llu (%d bytes)...\n", (unsigned long long)response->header.serial, (unsigned long long)response->request, response->header.size ); manager->response.current = NULL; pthread_cond_broadcast( &manager->response.wait ); pthread_mutex_unlock( &manager->response.lock ); return DR_OK; } DirectFB-1.2.10/lib/voodoo/server.c0000644000175000017500000002157011245562152013673 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct { DirectLink link; int fd; VoodooManager *manager; } Connection; typedef struct { const char *name; VoodooSuperConstruct func; void *ctx; IAny *interface; } Super; #define MAX_SUPER 8 struct __V_VoodooServer { int fd; bool quit; DirectLink *connections; int num_super; Super supers[MAX_SUPER]; }; /**************************************************************************************************/ static DirectResult accept_connection( VoodooServer *server ); /**************************************************************************************************/ static const int one = 1; /**************************************************************************************************/ DirectResult voodoo_server_create( VoodooServer **ret_server ) { DirectResult ret; int fd; struct sockaddr_in addr; VoodooServer *server; D_ASSERT( ret_server != NULL ); /* Create the server socket. */ fd = socket( PF_INET, SOCK_STREAM, 0 ); if (fd < 0) { ret = errno2result( errno ); D_PERROR( "Voodoo/Server: Could not create the socket via socket()!\n" ); return ret; } /* Allow reuse of local address. */ if (setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one) ) < 0) D_PERROR( "Voodoo/Server: Could not set SO_REUSEADDR!\n" ); /* Bind the socket to the local port. */ addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr( "0.0.0.0" ); addr.sin_port = htons( 2323 ); if (bind( fd, &addr, sizeof(addr) )) { ret = errno2result( errno ); D_PERROR( "Voodoo/Server: Could not bind() the socket!\n" ); close( fd ); return ret; } /* Start listening. */ if (listen( fd, 4 )) { ret = errno2result( errno ); D_PERROR( "Voodoo/Server: Could not listen() to the socket!\n" ); close( fd ); return ret; } /* Allocate server structure. */ server = D_CALLOC( 1, sizeof(VoodooServer) ); if (!server) { D_WARN( "out of memory" ); close( fd ); return DR_NOLOCALMEMORY; } /* Initialize server structure. */ server->fd = fd; /* Return the new server. */ *ret_server = server; return DR_OK; } DirectResult voodoo_server_register( VoodooServer *server, const char *name, VoodooSuperConstruct func, void *ctx ) { Super *super; D_ASSERT( server != NULL ); D_ASSERT( name != NULL ); D_ASSERT( func != NULL ); if (server->num_super == MAX_SUPER) return DR_LIMITEXCEEDED; super = &server->supers[server->num_super++]; super->name = name; super->func = func; super->ctx = ctx; return DR_OK; } static inline Super * lookup_super( VoodooServer *server, const char *name ) { int i; D_ASSERT( server != NULL ); D_ASSERT( name != NULL ); for (i=0; inum_super; i++) { Super *super = &server->supers[i]; if (! strcmp( name, super->name )) return super; } return NULL; } DirectResult voodoo_server_construct( VoodooServer *server, VoodooManager *manager, const char *name, VoodooInstanceID *ret_instance ) { DirectResult ret; Super *super; VoodooInstanceID instance; D_ASSERT( server != NULL ); D_ASSERT( manager != NULL ); D_ASSERT( name != NULL ); D_ASSERT( ret_instance != NULL ); super = lookup_super( server, name ); if (!super) { D_ERROR( "Voodoo/Server: Super interface '%s' is not available!\n", name ); return DR_UNSUPPORTED; } ret = super->func( server, manager, name, super->ctx, &instance ); if (ret) { D_ERROR( "Voodoo/Server: " "Creating super interface '%s' failed (%s)!\n", name, DirectResultString(ret) ); return ret; } *ret_instance = instance; return DR_OK; } DirectResult voodoo_server_run( VoodooServer *server ) { DirectLink *l, *n; struct pollfd pf; D_ASSERT( server != NULL ); while (!server->quit) { /* Cleanup dead connections. */ direct_list_foreach_safe (l, n, server->connections) { Connection *connection = (Connection*) l; if (voodoo_manager_is_closed( connection->manager )) { voodoo_manager_destroy( connection->manager ); close( connection->fd ); direct_list_remove( &server->connections, l ); D_INFO( "Voodoo/Server: Closed connection.\n" ); D_FREE( connection ); if (!server->connections) return DR_OK; } } pf.fd = server->fd; pf.events = POLLIN; switch (poll( &pf, 1, 200 )) { default: accept_connection( server ); break; case 0: D_DEBUG( "Voodoo/Server: Timeout during poll()\n" ); break; case -1: if (errno != EINTR) { D_PERROR( "Voodoo/Server: Could not poll() the socket!\n" ); server->quit = true; } break; } } return DR_OK; } DirectResult voodoo_server_destroy( VoodooServer *server ) { DirectLink *l; D_ASSERT( server != NULL ); close( server->fd ); /* Close all connections. */ direct_list_foreach (l, server->connections) { Connection *connection = (Connection*) l; voodoo_manager_destroy( connection->manager ); close( connection->fd ); D_FREE( connection ); } D_FREE( server ); return DR_OK; } /**************************************************************************************************/ static DirectResult accept_connection( VoodooServer *server ) { DirectResult ret; struct sockaddr addr; socklen_t addrlen = sizeof(addr); Connection *connection; connection = D_CALLOC( 1, sizeof(Connection) ); if (!connection) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } connection->fd = accept( server->fd, &addr, &addrlen ); if (connection->fd < 0) { ret = errno2result( errno ); D_PERROR( "Voodoo/Server: Could not accept() incoming connection!\n" ); D_FREE( connection ); return ret; } D_INFO( "Voodoo/Server: Accepted connection.\n" ); ret = voodoo_manager_create( connection->fd, NULL, server, &connection->manager ); if (ret) { close( connection->fd ); D_FREE( connection ); return ret; } direct_list_prepend( &server->connections, &connection->link ); return DR_OK; } DirectFB-1.2.10/lib/voodoo/manager.h0000644000175000017500000000760511245562152014007 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__MANAGER_H__ #define __VOODOO__MANAGER_H__ #include #include DirectResult voodoo_manager_super ( VoodooManager *manager, const char *name, VoodooInstanceID *ret_instance ); DirectResult voodoo_manager_request ( VoodooManager *manager, VoodooInstanceID instance, VoodooMethodID method, VoodooRequestFlags flags, VoodooResponseMessage **ret_response, VoodooMessageBlockType block_type, ... ); DirectResult voodoo_manager_finish_request ( VoodooManager *manager, VoodooResponseMessage *response ); DirectResult voodoo_manager_respond ( VoodooManager *manager, VoodooMessageSerial request, DirectResult result, VoodooInstanceID instance, VoodooMessageBlockType block_type, ... ); DirectResult voodoo_manager_register_local ( VoodooManager *manager, bool super, void *dispatcher, void *real, VoodooDispatch dispatch, VoodooInstanceID *ret_instance ); DirectResult voodoo_manager_lookup_local ( VoodooManager *manager, VoodooInstanceID instance, void **ret_dispatcher, void **ret_real ); DirectResult voodoo_manager_register_remote( VoodooManager *manager, bool super, void *requestor, VoodooInstanceID instance ); DirectResult voodoo_manager_lookup_remote ( VoodooManager *manager, VoodooInstanceID instance, void **ret_requestor ); #endif DirectFB-1.2.10/lib/voodoo/server.h0000644000175000017500000000333111245562152013673 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__SERVER_H__ #define __VOODOO__SERVER_H__ #include DirectResult voodoo_server_create ( VoodooServer **ret_server ); DirectResult voodoo_server_register( VoodooServer *server, const char *name, VoodooSuperConstruct func, void *ctx ); DirectResult voodoo_server_run ( VoodooServer *server ); DirectResult voodoo_server_destroy ( VoodooServer *server ); #endif DirectFB-1.2.10/lib/voodoo/build.h.in0000644000175000017500000000221111164361026014062 00000000000000/* (c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2002-2004 convergence GmbH. All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann and Ville Syrjl . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__BUILD_H__ #define __VOODOO__BUILD_H__ /* nothing yet */ #endif DirectFB-1.2.10/lib/voodoo/interface.c0000644000175000017500000000705011245562152014322 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include DirectResult voodoo_construct_requestor( VoodooManager *manager, const char *name, VoodooInstanceID instance, void *arg, void **ret_requestor ) { DirectResult ret; DirectInterfaceFuncs *funcs; void *requestor; D_ASSERT( manager != NULL ); D_ASSERT( name != NULL ); D_ASSERT( instance != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_requestor != NULL ); ret = DirectGetInterface( &funcs, name, "Requestor", NULL, NULL ); if (ret) { D_ERROR( "Voodoo/Interface: Could not load 'Requestor' implementation of '%s'!\n", name ); return ret; } ret = funcs->Allocate( &requestor ); if (ret) return ret; ret = funcs->Construct( requestor, manager, instance, arg ); if (ret) return ret; *ret_requestor = requestor; return DR_OK; } DirectResult voodoo_construct_dispatcher( VoodooManager *manager, const char *name, void *interface, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance, void **ret_dispatcher ) { DirectResult ret; DirectInterfaceFuncs *funcs; void *dispatcher; VoodooInstanceID instance; D_ASSERT( manager != NULL ); D_ASSERT( name != NULL ); D_ASSERT( interface != NULL ); D_ASSERT( super != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_instance != NULL ); ret = DirectGetInterface( &funcs, name, "Dispatcher", NULL, NULL ); if (ret) { D_ERROR( "Voodoo/Interface: Could not load 'Dispatcher' implementation of '%s'!\n", name ); return ret; } ret = funcs->Allocate( &dispatcher ); if (ret) return ret; ret = funcs->Construct( dispatcher, interface, manager, super, arg, &instance ); if (ret) return ret; *ret_instance = instance; if (ret_dispatcher) *ret_dispatcher = dispatcher; return DR_OK; } DirectFB-1.2.10/lib/voodoo/interface.h0000644000175000017500000000370711245562152014334 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__INTERFACE_H__ #define __VOODOO__INTERFACE_H__ #include DirectResult voodoo_construct_requestor( VoodooManager *manager, const char *name, VoodooInstanceID instance, void *arg, void **ret_interface ); DirectResult voodoo_construct_dispatcher( VoodooManager *manager, const char *name, void *interface, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance, void **ret_dispatcher ); #endif DirectFB-1.2.10/lib/voodoo/conf.h0000644000175000017500000000251411245562152013314 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VOODOO__CONF_H__ #define __VOODOO__CONF_H__ #include struct __V_VoodooConfig { /* nothing yet */ }; extern VoodooConfig *voodoo_config; #endif DirectFB-1.2.10/lib/Makefile.am0000644000175000017500000000016311164361026012740 00000000000000## Makefile.am for DirectFB/lib if ENABLE_VOODOO VOODOO_DIR = voodoo endif SUBDIRS = direct fusion $(VOODOO_DIR) DirectFB-1.2.10/lib/Makefile.in0000644000175000017500000004045511307521504012757 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = direct fusion voodoo DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_VOODOO_TRUE@VOODOO_DIR = voodoo SUBDIRS = direct fusion $(VOODOO_DIR) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/lib/direct/0000777000175000017500000000000011307522564012247 500000000000000DirectFB-1.2.10/lib/direct/trace.c0000644000175000017500000004147011245562152013431 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef PIC #define DYNAMIC_LINKING #endif #if DIRECT_BUILD_TRACE #ifdef DYNAMIC_LINKING #include #endif #define MAX_BUFFERS 200 #define MAX_LEVEL 200 #define NAME_LEN 92 typedef enum { TF_NONE = 0x00000000, TF_DEBUG = 0x00000001 } TraceFlags; typedef struct { void *addr; TraceFlags flags; } Trace; struct __D_DirectTraceBuffer { pid_t tid; char *name; int level; bool in_trace; Trace trace[MAX_LEVEL]; }; /**************************************************************************************************/ static DirectTraceBuffer *buffers[MAX_BUFFERS]; static int buffers_num = 0; #ifdef HAVE_DECL_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP static pthread_mutex_t buffers_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; #else static pthread_mutex_t buffers_lock = PTHREAD_MUTEX_INITIALIZER; #endif static pthread_key_t trace_key = -1; /**************************************************************************************************/ __attribute__((no_instrument_function)) static void buffer_destroy( void *arg ) { int i; DirectTraceBuffer *buffer = arg; pthread_mutex_lock( &buffers_lock ); /* Remove from list. */ for (i=0; itid = direct_gettid(); buffer->name = name ? strdup( name ) : NULL; buffers[buffers_num++] = buffer; pthread_mutex_unlock( &buffers_lock ); } return buffer; } /**************************************************************************************************/ typedef struct { long offset; char name[NAME_LEN]; } Symbol; typedef struct { DirectLink link; char *filename; Symbol *symbols; int capacity; int num_symbols; } SymbolTable; static DirectLink *tables = NULL; #ifdef HAVE_DECL_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP static pthread_mutex_t tables_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; #else static pthread_mutex_t tables_lock = PTHREAD_MUTEX_INITIALIZER; #endif __attribute__((no_instrument_function)) static void add_symbol( SymbolTable *table, long offset, const char *name ) { Symbol *symbol; if (table->num_symbols == table->capacity) { Symbol *symbols; int capacity = table->capacity * 2; if (!capacity) capacity = 256; symbols = malloc( capacity * sizeof(Symbol) ); if (!symbols) { D_WARN( "out of memory" ); return; } direct_memcpy( symbols, table->symbols, table->num_symbols * sizeof(Symbol) ); free( table->symbols ); table->symbols = symbols; table->capacity = capacity; } symbol = &table->symbols[ table->num_symbols++ ]; symbol->offset = offset; direct_snputs( symbol->name, name, NAME_LEN ); } __attribute__((no_instrument_function)) static SymbolTable * load_symbols( const char *filename ) { SymbolTable *table; FILE *fp = NULL; bool is_pipe = false; char file[1024]; char line[1024]; int command_len; char *command; const char *full_path = filename; char *tmp; if (filename) { if (access( filename, R_OK ) < 0 && errno == ENOENT) { int len; if ((len = readlink( "/proc/self/exe", file, sizeof(file) - 1 )) < 0) { D_PERROR( "Direct/Trace: readlink( \"/proc/self/exe\" ) failed!\n" ); return NULL; } file[len] = 0; tmp = strrchr( file, '/' ); if (!tmp) return NULL; if (strcmp( filename, tmp + 1 )) return NULL; full_path = file; } } else { int len; if ((len = readlink( "/proc/self/exe", file, sizeof(file) - 1 )) < 0) { D_PERROR( "Direct/Trace: readlink( \"/proc/self/exe\" ) failed!\n" ); return NULL; } file[len] = 0; full_path = file; } command_len = strlen( full_path ) + 32; command = alloca( command_len ); /* First check if there's an "nm-n" file. */ tmp = strrchr( full_path, '/' ); if (!tmp) return NULL; *tmp = 0; snprintf( command, command_len, "%s/nm-n.%s", full_path, tmp + 1 ); *tmp = '/'; if (access( command, R_OK ) == 0) { fp = fopen( command, "r" ); if (!fp) D_PERROR( "Direct/Trace: fopen( \"%s\", \"r\" ) failed!\n", command ); } else { snprintf( command, command_len, "%s.nm", full_path ); if (access( command, R_OK ) == 0) { fp = fopen( command, "r" ); if (!fp) D_PERROR( "Direct/Trace: fopen( \"%s\", \"r\" ) failed!\n", command ); } } /* Fallback to live mode. */ if (!fp) { snprintf( command, command_len, "nm -n %s", full_path ); fp = popen( command, "r" ); if (!fp) { D_PERROR( "Direct/Trace: popen( \"%s\", \"r\" ) failed!\n", command ); return NULL; } is_pipe = true; } table = calloc( 1, sizeof(SymbolTable) ); if (!table) { D_OOM(); goto out; } if (filename) table->filename = strdup( filename ); while (fgets( line, sizeof(line), fp )) { int n; int digits = sizeof(long) * 2; long offset = 0; int length = strlen(line); if (line[0] == ' ' || length < (digits + 5) || line[length-1] != '\n') continue; if (line[digits + 1] != 't' && line[digits + 1] != 'T' && line[digits + 1] != 'W') continue; if (line[digits] != ' ' || line[digits + 2] != ' ' || line[digits + 3] == '.') continue; for (n=0; n= '0' && c <= '9') offset |= c - '0'; else offset |= c - 'a' + 10; } line[length-1] = 0; add_symbol( table, offset, line + digits + 3 ); } out: if (is_pipe) pclose( fp ); else fclose( fp ); return table; } __attribute__((no_instrument_function)) static int compare_symbols(const void *x, const void *y) { return *((const long*) x) - *((const long*) y); } __attribute__((no_instrument_function)) static SymbolTable * find_table( const char *filename ) { SymbolTable *table; if (filename) { direct_list_foreach (table, tables) { if (table->filename && !strcmp( filename, table->filename )) return table; } } else { direct_list_foreach (table, tables) { if (!table->filename) return table; } } return NULL; } /**************************************************************************************************/ __attribute__((no_instrument_function)) const char * direct_trace_lookup_symbol( const char *filename, long offset ) { Symbol *symbol; SymbolTable *table; pthread_mutex_lock( &tables_lock ); table = find_table( filename ); if (!table) { table = load_symbols( filename ); if (!table) { pthread_mutex_unlock( &tables_lock ); return false; } direct_list_prepend( &tables, &table->link ); } pthread_mutex_unlock( &tables_lock ); symbol = bsearch( &offset, table->symbols, table->num_symbols, sizeof(Symbol), compare_symbols ); return symbol ? symbol->name : NULL; } __attribute__((no_instrument_function)) const char * direct_trace_lookup_file( void *address, void **ret_base ) { #ifdef DYNAMIC_LINKING Dl_info info; if (dladdr( address, &info )) { if (ret_base) *ret_base = info.dli_fbase; return info.dli_fname; } else #endif { if (ret_base) *ret_base = NULL; } return NULL; } __attribute__((no_instrument_function)) void direct_trace_print_stack( DirectTraceBuffer *buffer ) { #ifdef DYNAMIC_LINKING Dl_info info; #endif int i; int level; if (!direct_config->trace) return; if (!buffer) buffer = get_trace_buffer(); if (buffer->in_trace) return; buffer->in_trace = true; level = buffer->level; if (level > MAX_LEVEL) { D_WARN( "only showing %d of %d items", MAX_LEVEL, level ); level = MAX_LEVEL; } else if (level == 0) { buffer->in_trace = false; return; } direct_log_lock( NULL ); if (buffer->name) direct_log_printf( NULL, "(-) [%5d: -STACK- '%s']\n", buffer->tid, buffer->name ); else direct_log_printf( NULL, "(-) [%5d: -STACK- ]\n", buffer->tid ); for (i=level-1; i>=0; i--) { void *fn = buffer->trace[i].addr; #ifdef DYNAMIC_LINKING if (dladdr( fn, &info )) { if (info.dli_fname) { const char *symbol = NULL;//info.dli_sname; if (!symbol) { symbol = direct_trace_lookup_symbol(info.dli_fname, (long)(fn - info.dli_fbase)); if (!symbol) { symbol = direct_trace_lookup_symbol(info.dli_fname, (long)(fn)); if (!symbol) { if (info.dli_sname) symbol = info.dli_sname; else symbol = "??"; } } } direct_log_printf( NULL, " #%-2d 0x%08lx in %s () from %s [%p]\n", level - i - 1, (unsigned long) fn, symbol, info.dli_fname, info.dli_fbase ); } else if (info.dli_sname) { direct_log_printf( NULL, " #%-2d 0x%08lx in %s ()\n", level - i - 1, (unsigned long) fn, info.dli_sname ); } else direct_log_printf( NULL, " #%-2d 0x%08lx in ?? ()\n", level - i - 1, (unsigned long) fn ); } else #endif { const char *symbol = direct_trace_lookup_symbol(NULL, (long)(fn)); direct_log_printf( NULL, " #%-2d 0x%08lx in %s ()\n", level - i - 1, (unsigned long) fn, symbol ? symbol : "??" ); } } direct_log_printf( NULL, "\n" ); direct_log_unlock( NULL ); buffer->in_trace = false; } __attribute__((no_instrument_function)) void direct_trace_print_stacks( void ) { int i; DirectTraceBuffer *buffer = get_trace_buffer(); if (buffer->level) direct_trace_print_stack( buffer ); pthread_mutex_lock( &buffers_lock ); for (i=0; ilevel) direct_trace_print_stack( buffers[i] ); } pthread_mutex_unlock( &buffers_lock ); } __attribute__((no_instrument_function)) int direct_trace_debug_indent( void ) { int in; DirectTraceBuffer *buffer = get_trace_buffer(); int level = buffer->level - 1; if (level < 0) return 0; buffer->trace[level--].flags |= TF_DEBUG; for (in=0; level>=0; level--) { if (buffer->trace[level].flags & TF_DEBUG) in++; } return in; } __attribute__((no_instrument_function)) DirectTraceBuffer * direct_trace_copy_buffer( DirectTraceBuffer *buffer ) { int level; DirectTraceBuffer *copy; if (!buffer) buffer = get_trace_buffer(); level = buffer->level; if (level > MAX_LEVEL) { D_WARN( "only copying %d of %d items", MAX_LEVEL, level ); level = MAX_LEVEL; } copy = calloc( 1, sizeof(*buffer) - sizeof(buffer->trace) + sizeof(buffer->trace[0]) * level ); if (!copy) return NULL; if (buffer->name) copy->name = strdup( buffer->name ); copy->tid = buffer->tid; copy->level = buffer->level; direct_memcpy( copy->trace, buffer->trace, level * sizeof(buffer->trace[0]) ); return copy; } __attribute__((no_instrument_function)) void direct_trace_free_buffer( DirectTraceBuffer *buffer ) { if (buffer->name) free( buffer->name ); free( buffer ); } /**************************************************************************************************/ __attribute__((no_instrument_function)) void __cyg_profile_func_enter (void *this_fn, void *call_site) { if (direct_config->trace) { DirectTraceBuffer *buffer = get_trace_buffer(); int level = buffer->level++; Trace *trace = &buffer->trace[level]; if (level < MAX_LEVEL) { trace->addr = this_fn; trace->flags = TF_NONE; } } } __attribute__((no_instrument_function)) void __cyg_profile_func_exit (void *this_fn, void *call_site) { if (direct_config->trace) { DirectTraceBuffer *buffer = get_trace_buffer(); if (buffer->level > 0) buffer->level--; } } #else const char * direct_trace_lookup_symbol( const char *filename, long offset ) { return NULL; } const char * direct_trace_lookup_file( void *address, void **ret_base ) { if (ret_base) *ret_base = NULL; return NULL; } void direct_trace_print_stack( DirectTraceBuffer *buffer ) { } void direct_trace_print_stacks( void ) { } int direct_trace_debug_indent( void ) { return 0; } DirectTraceBuffer * direct_trace_copy_buffer( DirectTraceBuffer *buffer ) { return NULL; } void direct_trace_free_buffer( DirectTraceBuffer *buffer ) { } #endif DirectFB-1.2.10/lib/direct/direct.h0000644000175000017500000000326511245562152013612 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__DIRECT_H__ #define __DIRECT__DIRECT_H__ #include DirectResult direct_initialize( void ); DirectResult direct_shutdown( void ); typedef void (*DirectCleanupHandlerFunc)( void *ctx ); DirectResult direct_cleanup_handler_add( DirectCleanupHandlerFunc func, void *ctx, DirectCleanupHandler **ret_handler ); DirectResult direct_cleanup_handler_remove( DirectCleanupHandler *handler ); #endif DirectFB-1.2.10/lib/direct/conf.c0000644000175000017500000003051211245562152013253 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include static DirectConfig config = { .debug = false, .trace = true, .sighandler = true, .fatal = DCFL_ASSERT, .fatal_break = true, .thread_block_signals = true, .thread_priority_scale = 100, }; DirectConfig *direct_config = &config; const char *direct_config_usage = "libdirect options:\n" " memcpy= Skip memcpy() probing (help = show list)\n" " [no-]quiet Disable text output except debug messages or direct logs\n" " [no-]quiet= Only quiet certain types (cumulative with 'quiet')\n" " [ info | warning | error | once | unimplemented ]\n" " [no-]debug Enable debug output\n" " [no-]debugmem Enable memory allocation tracking\n" " [no-]trace Enable stack trace support\n" " log-file= Write all messages to a file\n" " log-udp=: Send all messages via UDP to host:port\n" " fatal-level= Abort on NONE, ASSERT (default) or ASSUME (incl. assert)\n" " [no-]fatal-break Abort on BREAK (default)\n" " dont-catch=[[,]...] Don't catch these signals\n" " [no-]sighandler Enable signal handler\n" " [no-]thread-block-signals Block all signals in new threads?\n" " disable-module= suppress loading this module\n" " module-dir= Override default module search directory (default = $libdir/directfb-x.y-z)\n" " thread-priority-scale=<100th> Apply scaling factor on thread type based priorities\n" "\n"; /**********************************************************************************************************************/ DirectResult direct_config_set( const char *name, const char *value ) { if (strcmp (name, "disable-module" ) == 0) { if (value) { int n = 0; while (direct_config->disable_module && direct_config->disable_module[n]) n++; direct_config->disable_module = D_REALLOC( direct_config->disable_module, sizeof(char*) * (n + 2) ); direct_config->disable_module[n] = D_STRDUP( value ); direct_config->disable_module[n+1] = NULL; } else { D_ERROR("Direct/Config '%s': No module name specified!\n", name); return DR_INVARG; } } else if (strcmp (name, "module-dir" ) == 0) { if (value) { if (direct_config->module_dir) D_FREE( direct_config->module_dir ); direct_config->module_dir = D_STRDUP( value ); } else { D_ERROR("Direct/Config 'module-dir': No directory name specified!\n"); return DR_INVARG; } } else if (strcmp (name, "memcpy" ) == 0) { if (value) { if (direct_config->memcpy) D_FREE( direct_config->memcpy ); direct_config->memcpy = D_STRDUP( value ); } else { D_ERROR("Direct/Config '%s': No method specified!\n", name); return DR_INVARG; } } else if (strcmp (name, "quiet" ) == 0 || strcmp (name, "no-quiet" ) == 0) { /* Enable/disable all at once by default. */ DirectMessageType type = DMT_ALL; /* Find out the specific message type being configured. */ if (value) { if (!strcmp( value, "info" )) type = DMT_INFO; else if (!strcmp( value, "warning" )) type = DMT_WARNING; else if (!strcmp( value, "error" )) type = DMT_ERROR; else if (!strcmp( value, "once" )) type = DMT_ONCE; else if (!strcmp( value, "unimplemented" )) type = DMT_UNIMPLEMENTED; else { D_ERROR( "DirectFB/Config '%s': Unknown message type '%s'!\n", name, value ); return DR_INVARG; } } /* Set/clear the corresponding flag in the configuration. */ if (name[0] == 'q') direct_config->quiet |= type; else direct_config->quiet &= ~type; } else if (strcmp (name, "no-quiet" ) == 0) { direct_config->quiet = false; } else if (strcmp (name, "debug" ) == 0) { if (value) direct_debug_config_domain( value, true ); else direct_config->debug = true; } else if (strcmp (name, "no-debug" ) == 0) { if (value) direct_debug_config_domain( value, false ); else direct_config->debug = false; } else if (strcmp (name, "debugmem" ) == 0) { direct_config->debugmem = true; } else if (strcmp (name, "no-debugmem" ) == 0) { direct_config->debugmem = false; } else if (strcmp (name, "trace" ) == 0) { direct_config->trace = true; } else if (strcmp (name, "no-trace" ) == 0) { direct_config->trace = false; } else if (strcmp (name, "log-file" ) == 0 || strcmp (name, "log-udp" ) == 0) { if (value) { DirectResult ret; DirectLog *log; ret = direct_log_create( strcmp(name,"log-udp") ? DLT_FILE : DLT_UDP, value, &log ); if (ret) return ret; if (direct_config->log) direct_log_destroy( direct_config->log ); direct_config->log = log; direct_log_set_default( log ); } else { if (strcmp(name,"log-udp")) D_ERROR("Direct/Config '%s': No file name specified!\n", name); else D_ERROR("Direct/Config '%s': No host and port specified!\n", name); return DR_INVARG; } } else if (strcmp (name, "fatal-level" ) == 0) { if (strcasecmp (value, "none" ) == 0) { direct_config->fatal = DCFL_NONE; } else if (strcasecmp (value, "assert" ) == 0) { direct_config->fatal = DCFL_ASSERT; } else if (strcasecmp (value, "assume" ) == 0) { direct_config->fatal = DCFL_ASSUME; } else { D_ERROR("Direct/Config '%s': Unknown level specified (use 'none', 'assert', 'assume')!\n", name); return DR_INVARG; } } else if (strcmp (name, "fatal-break" ) == 0) { direct_config->fatal_break = true; } else if (strcmp (name, "no-fatal-break" ) == 0) { direct_config->fatal_break = false; } else if (strcmp (name, "sighandler" ) == 0) { direct_config->sighandler = true; } else if (strcmp (name, "no-sighandler" ) == 0) { direct_config->sighandler = false; } else if (strcmp (name, "dont-catch" ) == 0) { if (value) { char *signals = D_STRDUP( value ); char *p = NULL, *r, *s = signals; while ((r = strtok_r( s, ",", &p ))) { char *error; unsigned long signum; direct_trim( &r ); signum = strtoul( r, &error, 10 ); if (*error) { D_ERROR( "Direct/Config '%s': Error in number at '%s'!\n", name, error ); D_FREE( signals ); return DR_INVARG; } sigaddset( &direct_config->dont_catch, signum ); s = NULL; } D_FREE( signals ); } else { D_ERROR("Direct/Config '%s': No signals specified!\n", name); return DR_INVARG; } } else if (strcmp (name, "thread_block_signals") == 0) { direct_config->thread_block_signals = true; } else if (strcmp (name, "no-thread_block_signals") == 0) { direct_config->thread_block_signals = false; } else if (strcmp (name, "thread-priority-scale" ) == 0) { if (value) { int scale; if (sscanf( value, "%d", &scale ) < 1) { D_ERROR("Direct/Config '%s': Could not parse value!\n", name); return DR_INVARG; } direct_config->thread_priority_scale = scale; } else { D_ERROR("Direct/Config '%s': No value specified!\n", name); return DR_INVARG; } } else if (strcmp (name, "thread-priority" ) == 0) { /* Must be moved to lib/direct/conf.c in trunk! */ if (value) { int priority; if (sscanf( value, "%d", &priority ) < 1) { D_ERROR("Direct/Config '%s': Could not parse value!\n", name); return DR_INVARG; } direct_config->thread_priority = priority; } else { D_ERROR("Direct/Config '%s': No value specified!\n", name); return DR_INVARG; } } else if (strcmp (name, "thread-scheduler" ) == 0) { /* Must be moved to lib/direct/conf.c in trunk! */ if (value) { if (strcmp( value, "other" ) == 0) { direct_config->thread_scheduler = DCTS_OTHER; } else if (strcmp( value, "fifo" ) == 0) { direct_config->thread_scheduler = DCTS_FIFO; } else if (strcmp( value, "rr" ) == 0) { direct_config->thread_scheduler = DCTS_RR; } else { D_ERROR( "Direct/Config '%s': Unknown scheduler '%s'!\n", name, value ); return DR_INVARG; } } else { D_ERROR( "Direct/Config '%s': No value specified!\n", name ); return DR_INVARG; } } else if (strcmp (name, "thread-stacksize" ) == 0) { /* Must be moved to lib/direct/conf.c in trunk! */ if (value) { int size; if (sscanf( value, "%d", &size ) < 1) { D_ERROR( "Direct/Config '%s': Could not parse value!\n", name ); return DR_INVARG; } direct_config->thread_stack_size = size; } else { D_ERROR( "Direct/Config '%s': No value specified!\n", name ); return DR_INVARG; } } else return DR_UNSUPPORTED; return DR_OK; } DirectFB-1.2.10/lib/direct/mem.c0000644000175000017500000002351511245562152013111 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Mem, "Direct/Mem", "libdirect memory allocation (debugging)" ); /**********************************************************************************************************************/ typedef struct { const void *mem; size_t bytes; const char *func; const char *file; int line; DirectTraceBuffer *trace; } MemDesc; /**********************************************************************************************************************/ static int alloc_count = 0; static int alloc_capacity = 0; static MemDesc *alloc_list = NULL; static pthread_mutex_t alloc_lock = PTHREAD_MUTEX_INITIALIZER; /**********************************************************************************************************************/ void direct_print_memleaks( void ) { unsigned int i; /* Debug only. */ pthread_mutex_lock( &alloc_lock ); if (alloc_count && (!direct_config || direct_config->debugmem)) { direct_log_printf( NULL, "Local memory allocations remaining (%d): \n", alloc_count ); for (i=0; ibytes, desc->mem, desc->func, desc->file, desc->line ); if (desc->trace) direct_trace_print_stack( desc->trace ); } } pthread_mutex_unlock( &alloc_lock ); } /**********************************************************************************************************************/ /* FIXME: Replace array by linked list, or at least avoid the memmove on free of an item. */ static MemDesc * allocate_mem_desc( void ) { int cap = alloc_capacity; if (!cap) cap = 64; else if (cap == alloc_count) cap <<= 1; if (cap != alloc_capacity) { void *new_list = malloc( sizeof(MemDesc) * cap ); if (!new_list) { D_WARN( "could not allocate more descriptors (%d->%d)", alloc_capacity, cap ); return NULL; } direct_memcpy( new_list, alloc_list, sizeof(MemDesc) * alloc_count ); free( alloc_list ); alloc_capacity = cap; alloc_list = new_list; } return &alloc_list[alloc_count++]; } static inline void fill_mem_desc( MemDesc *desc, const void *mem, int bytes, const char *func, const char *file, int line, DirectTraceBuffer *trace ) { desc->mem = mem; desc->bytes = bytes; desc->func = func; desc->file = file; desc->line = line; desc->trace = trace; } /**********************************************************************************************************************/ void * direct_malloc( const char* file, int line, const char *func, size_t bytes ) { void *mem; MemDesc *desc; D_DEBUG_AT( Direct_Mem, " +%6zu bytes [%s:%d in %s()]\n", bytes, file, line, func ); mem = malloc( bytes ); if (!mem) return NULL; if (!direct_config->debugmem) return mem; /* Debug only. */ pthread_mutex_lock( &alloc_lock ); desc = allocate_mem_desc(); pthread_mutex_unlock( &alloc_lock ); if (desc) fill_mem_desc( desc, mem, bytes, func, file, line, direct_trace_copy_buffer(NULL) ); return mem; } void * direct_calloc( const char* file, int line, const char *func, size_t count, size_t bytes ) { void *mem; MemDesc *desc; D_DEBUG_AT( Direct_Mem, " +%6zu bytes [%s:%d in %s()]\n", count * bytes, file, line, func ); mem = calloc( count, bytes ); if (!mem) return NULL; if (!direct_config->debugmem) return mem; /* Debug only. */ pthread_mutex_lock( &alloc_lock ); desc = allocate_mem_desc(); pthread_mutex_unlock( &alloc_lock ); if (desc) fill_mem_desc( desc, mem, count * bytes, func, file, line, direct_trace_copy_buffer(NULL) ); return mem; } void * direct_realloc( const char *file, int line, const char *func, const char *what, void *mem, size_t bytes ) { int i; if (!mem) return direct_malloc( file, line, func, bytes ); if (!bytes) { direct_free( file, line, func, what, mem ); return NULL; } if (!direct_config->debugmem) { D_DEBUG_AT( Direct_Mem, " *%6zu bytes [%s:%d in %s()] '%s'\n", bytes, file, line, func, what ); return realloc( mem, bytes ); } /* Debug only. */ pthread_mutex_lock( &alloc_lock ); for (i=0; imem == mem) { void *new_mem = realloc( mem, bytes ); D_DEBUG_AT( Direct_Mem, " %c%6zu bytes [%s:%d in %s()] (%s%zu) <- %p -> %p '%s'\n", (bytes > desc->bytes) ? '>' : '<', bytes, file, line, func, (bytes > desc->bytes) ? "+" : "", bytes - desc->bytes, mem, new_mem, what); if (desc->trace) { direct_trace_free_buffer( desc->trace ); desc->trace = NULL; } if (!new_mem) { D_WARN( "could not reallocate memory (%p: %zu->%zu)", mem, desc->bytes, bytes ); alloc_count--; /* FIXME: This can be very slow. */ if (i < alloc_count) direct_memmove( desc, desc + 1, (alloc_count - i) * sizeof(MemDesc) ); } else fill_mem_desc( desc, new_mem, bytes, func, file, line, direct_trace_copy_buffer(NULL) ); pthread_mutex_unlock( &alloc_lock ); return new_mem; } } pthread_mutex_unlock( &alloc_lock ); D_ERROR( "Direct/Mem: Not reallocating unknown %p (%s) from [%s:%d in %s()] - corrupt/incomplete list?\n", mem, what, file, line, func ); return direct_malloc( file, line, func, bytes ); } void direct_free( const char *file, int line, const char *func, const char *what, void *mem ) { unsigned int i; if (!mem) { D_WARN( "%s (NULL) called", __FUNCTION__ ); return; } if (!direct_config->debugmem) { D_DEBUG_AT( Direct_Mem, " - number of bytes of %s [%s:%d in %s()] -> %p\n", what, file, line, func, mem ); free( mem ); return; } /* Debug only. */ pthread_mutex_lock( &alloc_lock ); for (i=0; imem == mem) { free( mem ); D_DEBUG_AT( Direct_Mem, " -%6zu bytes [%s:%d in %s()] -> %p '%s'\n", desc->bytes, file, line, func, mem, what ); if (desc->trace) direct_trace_free_buffer( desc->trace ); alloc_count--; /* FIXME: This can be very slow. */ if (i < alloc_count) direct_memmove( desc, desc + 1, (alloc_count - i) * sizeof(MemDesc) ); pthread_mutex_unlock( &alloc_lock ); return; } } pthread_mutex_unlock( &alloc_lock ); D_ERROR( "Direct/Mem: Not freeing unknown %p (%s) from [%s:%d in %s()] - corrupt/incomplete list?\n", mem, what, file, line, func ); } char * direct_strdup( const char* file, int line, const char *func, const char *string ) { void *mem; MemDesc *desc; size_t length = strlen( string ) + 1; mem = malloc( length ); D_DEBUG_AT( Direct_Mem, " +%6zu bytes [%s:%d in %s()] -> %p \"%30s\"\n", length, file, line, func, mem, string ); if (!mem) return NULL; direct_memcpy( mem, string, length ); if (!direct_config->debugmem) return mem; /* Debug only. */ pthread_mutex_lock( &alloc_lock ); desc = allocate_mem_desc(); pthread_mutex_unlock( &alloc_lock ); if (desc) fill_mem_desc( desc, mem, length, func, file, line, direct_trace_copy_buffer(NULL) ); return mem; } /**********************************************************************************************************************/ #else void direct_print_memleaks( void ) { } #endif DirectFB-1.2.10/lib/direct/clock.c0000644000175000017500000000534311245562152013425 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Clock, "Direct/Clock", "Time measurement etc." ); static struct timeval start_time = { 0, 0 }; long long direct_clock_get_micros( void ) { struct timeval tv; long long ret; if (start_time.tv_sec == 0) { gettimeofday( &start_time, NULL ); return 0; } gettimeofday( &tv, NULL ); ret = (long long)(tv.tv_sec - start_time.tv_sec) * 1000000LL + (long long)(tv.tv_usec - start_time.tv_usec); if (ret < 0) { D_DEBUG_AT( Direct_Clock, "Clock skew detected (%lld in the past)!\n", -ret ); start_time = tv; ret = 0; } return ret; } long long direct_clock_get_millis( void ) { return direct_clock_get_micros() / 1000LL; } void direct_clock_set_start( const struct timeval *start ) { long long diff; D_ASSERT( start != NULL ); diff = (long long)(start->tv_sec - start_time.tv_sec) * 1000LL + (long long)(start->tv_usec - start_time.tv_usec) / 1000LL; D_DEBUG_AT( Direct_Clock, "Adjusting start time " "(%lld.%lld seconds diff)\n", diff / 1000LL, ABS(diff) % 1000LL ); start_time = *start; } long long direct_clock_get_abs_micros( void ) { struct timeval tv; gettimeofday( &tv, NULL ); return (long long)(tv.tv_sec) * 1000000LL + (long long)(tv.tv_usec); } long long direct_clock_get_abs_millis( void ) { return direct_clock_get_abs_micros() / 1000LL; } DirectFB-1.2.10/lib/direct/system.h0000644000175000017500000000254711245562152013666 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__SYSTEM_H__ #define __DIRECT__SYSTEM_H__ #include pid_t direct_gettid( void ); long direct_pagesize( void ); unsigned long direct_page_align( unsigned long value ); #endif DirectFB-1.2.10/lib/direct/messages.h0000644000175000017500000002051511245562152014144 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__MESSAGES_H__ #define __DIRECT__MESSAGES_H__ #include #include #if __GNUC__ >= 3 #define D_FORMAT_PRINTF(n) __attribute__((__format__ (__printf__, n, n+1))) #else #define D_FORMAT_PRINTF(n) #endif typedef enum { DMT_NONE = 0x00000000, /* No message type. */ DMT_BANNER = 0x00000001, /* Startup banner. */ DMT_INFO = 0x00000002, /* Info messages. */ DMT_WARNING = 0x00000004, /* Warnings. */ DMT_ERROR = 0x00000008, /* Error messages: regular, with DFBResult, bugs, system call errors, dlopen errors */ DMT_UNIMPLEMENTED = 0x00000010, /* Messages notifying unimplemented functionality. */ DMT_ONCE = 0x00000020, /* One-shot messages .*/ DMT_ALL = 0x0000003f /* All types. */ } DirectMessageType; #if DIRECT_BUILD_TEXT #include #include void direct_messages_info ( const char *format, ... ) D_FORMAT_PRINTF(1); void direct_messages_error ( const char *format, ... ) D_FORMAT_PRINTF(1); void direct_messages_derror ( DirectResult result, const char *format, ... ) D_FORMAT_PRINTF(2); void direct_messages_perror ( int erno, const char *format, ... ) D_FORMAT_PRINTF(2); void direct_messages_dlerror ( const char *dlerr, const char *format, ... ) D_FORMAT_PRINTF(2); void direct_messages_once ( const char *func, const char *file, int line, const char *format, ... ) D_FORMAT_PRINTF(4); void direct_messages_unimplemented( const char *func, const char *file, int line ); void direct_messages_bug ( const char *func, const char *file, int line, const char *format, ... ) D_FORMAT_PRINTF(4); void direct_messages_warn ( const char *func, const char *file, int line, const char *format, ... ) D_FORMAT_PRINTF(4); #define D_INFO(x...) do { \ if (!(direct_config->quiet & DMT_INFO)) \ direct_messages_info( x ); \ } while (0) #define D_ERROR(x...) do { \ if (!(direct_config->quiet & DMT_ERROR)) \ direct_messages_error( x ); \ } while (0) #define D_DERROR(r,x...) do { \ if (!(direct_config->quiet & DMT_ERROR)) \ direct_messages_derror( r, x ); \ } while (0) #define D_PERROR(x...) do { \ if (!(direct_config->quiet & DMT_ERROR)) \ direct_messages_perror( errno, x ); \ } while (0) #define D_DLERROR(x...) do { \ if (!(direct_config->quiet & DMT_ERROR)) \ direct_messages_dlerror( dlerror(), x ); \ } while (0) #define D_ONCE(x...) do { \ if (!(direct_config->quiet & DMT_ONCE)) { \ static bool first = true; \ if (first) { \ direct_messages_once( __FUNCTION__, \ __FILE__, __LINE__, x ); \ first = false; \ } \ } \ } while (0) #define D_UNIMPLEMENTED() do { \ if (!(direct_config->quiet & DMT_UNIMPLEMENTED)) { \ static bool first = true; \ if (first) { \ direct_messages_unimplemented( __FUNCTION__, \ __FILE__, __LINE__ ); \ first = false; \ } \ } \ } while (0) #define D_BUG(x...) do { \ if (!(direct_config->quiet & DMT_ERROR)) \ direct_messages_bug( __FUNCTION__, __FILE__, __LINE__, x ); \ } while (0) #define D_WARN(x...) do { \ if (!(direct_config->quiet & DMT_WARNING)) \ direct_messages_warn( __FUNCTION__, __FILE__, __LINE__, x );\ } while (0) #define D_OOM() (direct_messages_warn( __FUNCTION__, __FILE__, __LINE__, \ "out of memory" ), DR_NOLOCALMEMORY) #else #define D_INFO(x...) do { } while (0) #define D_ERROR(x...) do { } while (0) #define D_DERROR(x...) do { } while (0) #define D_PERROR(x...) do { } while (0) #define D_DLERROR(x...) do { } while (0) #define D_ONCE(x...) do { } while (0) #define D_UNIMPLEMENTED() do { } while (0) #define D_BUG(x...) do { } while (0) #define D_WARN(x...) do { } while (0) #define D_OOM() (printf("out of memory\n"), DR_NOLOCALMEMORY) #endif #endif DirectFB-1.2.10/lib/direct/types.h0000644000175000017500000001453711245562152013510 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__TYPES_H__ #define __DIRECT__TYPES_H__ #include /* * Define the bool type by including stdbool.h (preferably)... */ #if DIRECT_BUILD_STDBOOL # include /* * ...or defining it ourself, if not using C++ or another definition */ #elif !defined(__cplusplus) && !defined(__bool_true_false_are_defined) # warning Fallback definition of bool using u8! Checking for 'flags & 0x100' or higher bits will be false :( typedef u8 bool; # ifndef false # define false (0) # endif # ifndef true # define true (!false) # endif #endif /* DIRECT_BUILD_STDBOOL */ #ifdef USE_KOS #include typedef uint8 u8; typedef uint16 u16; typedef uint32 u32; typedef uint64 u64; typedef sint8 s8; typedef sint16 s16; typedef sint32 s32; typedef sint64 s64; #else #include typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; typedef int8_t s8; typedef int16_t s16; typedef int32_t s32; typedef int64_t s64; #endif typedef enum { DR_OK = 0x00000000, /* No error occured. */ DR_FAILURE, /* A general or unknown error occured. */ DR_INIT, /* A general initialization error occured. */ DR_BUG, /* Internal bug or inconsistency has been detected. */ DR_DEAD, /* Interface has a zero reference counter (available in debug mode). */ DR_UNSUPPORTED, /* The requested operation or an argument is (currently) not supported. */ DR_UNIMPLEMENTED, /* The requested operation is not implemented, yet. */ DR_ACCESSDENIED, /* Access to the resource is denied. */ DR_INVAREA, /* An invalid area has been specified or detected. */ DR_INVARG, /* An invalid argument has been specified. */ DR_NOLOCALMEMORY, /* There's not enough local system memory. */ DR_NOSHAREDMEMORY, /* There's not enough shared system memory. */ DR_LOCKED, /* The resource is (already) locked. */ DR_BUFFEREMPTY, /* The buffer is empty. */ DR_FILENOTFOUND, /* The specified file has not been found. */ DR_IO, /* A general I/O error occured. */ DR_BUSY, /* The resource or device is busy. */ DR_NOIMPL, /* No implementation for this interface or content type has been found. */ DR_TIMEOUT, /* The operation timed out. */ DR_THIZNULL, /* 'thiz' pointer is NULL. */ DR_IDNOTFOUND, /* No resource has been found by the specified id. */ DR_DESTROYED, /* The requested object has been destroyed. */ DR_FUSION, /* Internal fusion error detected, most likely related to IPC resources. */ DR_BUFFERTOOLARGE, /* Buffer is too large. */ DR_INTERRUPTED, /* The operation has been interrupted. */ DR_NOCONTEXT, /* No context available. */ DR_TEMPUNAVAIL, /* Temporarily unavailable. */ DR_LIMITEXCEEDED, /* Attempted to exceed limit, i.e. any kind of maximum size, count etc. */ DR_NOSUCHMETHOD, /* Requested method is not known. */ DR_NOSUCHINSTANCE, /* Requested instance is not known. */ DR_ITEMNOTFOUND, /* No such item found. */ DR_VERSIONMISMATCH, /* Some versions didn't match. */ DR_EOF, /* Reached end of file. */ DR_SUSPENDED, /* The requested object is suspended. */ DR_INCOMPLETE, /* The operation has been executed, but not completely. */ DR_NOCORE /* Core part not available. */ } DirectResult; /* * Generate result code base for API 'A','B','C', e.g. 'D','F','B'. */ #define D_RESULT_TYPE_BASE( a,b,c ) ((((unsigned)(a)&0x7f) * 0x02000000) + \ (((unsigned)(b)&0x7f) * 0x00040000) + \ (((unsigned)(c)&0x7f) * 0x00000800)) /* * Generate result code maximum for API 'A','B','C', e.g. 'D','F','B'. */ #define D_RESULT_TYPE_MAX( a,b,c ) (D_RESULT_TYPE_BASE(a,b,c) + 0x7ff) /* * Check if given result code belongs to API 'A','B','C', e.g. 'D','F','B'. */ #define D_RESULT_TYPE_IS( code,a,b,c ) ((code) >= D_RESULT_TYPE_BASE(a,b,c) && (code) <= D_RESULT_TYPE_MAX(a,b,c)) /* * Return value of enumeration callbacks */ typedef enum { DENUM_OK = 0x00000000, /* Proceed with enumeration */ DENUM_CANCEL = 0x00000001 /* Cancel enumeration */ } DirectEnumerationResult; typedef u32 unichar; typedef struct __D_DirectCleanupHandler DirectCleanupHandler; typedef struct __D_DirectConfig DirectConfig; typedef struct __D_DirectHash DirectHash; typedef struct __D_DirectLink DirectLink; typedef struct __D_DirectLog DirectLog; typedef struct __D_DirectModuleDir DirectModuleDir; typedef struct __D_DirectModuleEntry DirectModuleEntry; typedef struct __D_DirectSerial DirectSerial; typedef struct __D_DirectSignalHandler DirectSignalHandler; typedef struct __D_DirectStream DirectStream; typedef struct __D_DirectTraceBuffer DirectTraceBuffer; typedef struct __D_DirectTree DirectTree; typedef struct __D_DirectThread DirectThread; typedef struct __D_DirectThreadInitHandler DirectThreadInitHandler; #endif DirectFB-1.2.10/lib/direct/Makefile.am0000644000175000017500000000411411245562152014215 00000000000000## Makefile.am for DirectFB/lib/direct INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \ -DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = direct.pc EXTRA_DIST = \ ppcasm_memcpy.S \ ppcasm_memcpy_cachable.S \ ppcasm_memcpy.h \ ppc_asm.h if BUILDPPCASM if HAVE_LINUX ppcasm_sources = ppcasm_memcpy.S ppcasm_memcpy_cachable.S else ppcasm_sources = ppcasm_memcpy.S endif ppcasm_headers = ppcasm_memcpy.h ppc_asm.h endif # If the old location isn't cleared, builds of external modules fail install-exec-local: rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/direct includedir = @INCLUDEDIR@/direct include_HEADERS = \ $(ppcasm_headers) \ build.h \ clock.h \ conf.h \ debug.h \ direct.h \ hash.h \ interface.h \ interface_implementation.h \ list.h \ log.h \ mem.h \ memcpy.h \ messages.h \ modules.h \ serial.h \ signals.h \ stream.h \ system.h \ thread.h \ trace.h \ tree.h \ types.h \ utf8.h \ util.h lib_LTLIBRARIES = libdirect.la libdirect_la_SOURCES = \ $(ppcasm_sources) \ clock.c \ conf.c \ debug.c \ direct.c \ hash.c \ interface.c \ list.c \ log.c \ mem.c \ memcpy.c \ messages.c \ modules.c \ signals.c \ stream.c \ system.c \ trace.c \ tree.c \ thread.c \ utf8.c \ util.c libdirect_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) # ## and now rebuild the static version with the *correct* object files # if BUILD_STATIC clean-local: rm -f libdirect_fixed.a all-local: libdirect_fixed.a libdirect_fixed.a: .libs/libdirect.a rm -f libdirect_fixed.a ${AR} cru libdirect_fixed.a `find . -name "*.o" | grep -v '.libs' | grep -v dtest` ${RANLIB} libdirect_fixed.a cp -pf libdirect_fixed.a .libs/libdirect.a .libs/libdirect.a: libdirect.la else clean-local: all-local: endif include $(top_srcdir)/rules/nmfile.make DirectFB-1.2.10/lib/direct/build.h0000644000175000017500000000317511307521522013432 00000000000000/* (c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2002-2004 convergence GmbH. All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann and Ville Syrjl . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__BUILD_H__ #define __DIRECT__BUILD_H__ #define DIRECT_BUILD_DEBUG (1) #define DIRECT_BUILD_DEBUGS (1) #define DIRECT_BUILD_TRACE (1) #define DIRECT_BUILD_TEXT (1) #define DIRECT_BUILD_GETTID (1) #define DIRECT_BUILD_NETWORK (1) #define DIRECT_BUILD_STDBOOL (1) #if !DIRECT_BUILD_DEBUGS #if defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #define DIRECT_MINI_DEBUG #endif #undef DIRECT_ENABLE_DEBUG #ifdef DIRECT_FORCE_DEBUG #warning DIRECT_FORCE_DEBUG used with 'pure release' library headers. #undef DIRECT_FORCE_DEBUG #endif #endif #endif DirectFB-1.2.10/lib/direct/system.c0000644000175000017500000000352711245562152013660 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #if DIRECT_BUILD_GETTID && defined(HAVE_LINUX_UNISTD_H) #include #endif __attribute__((no_instrument_function)) pid_t direct_gettid( void ) { pid_t tid = -1; #if DIRECT_BUILD_GETTID && defined(__NR_gettid) /* present on linux >= 2.4.20 */ tid = syscall(__NR_gettid); #endif if (tid < 0) tid = getpid(); return tid; } long direct_pagesize( void ) { return sysconf( _SC_PAGESIZE ); } unsigned long direct_page_align( unsigned long value ) { unsigned long mask = sysconf( _SC_PAGESIZE ) - 1; return (value + mask) & ~mask; } DirectFB-1.2.10/lib/direct/util.h0000644000175000017500000002020511245562152013306 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__UTIL_H__ #define __DIRECT__UTIL_H__ #include #ifdef _POSIX_PRIORITY_SCHEDULING #include #endif #include #include #include #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif #ifndef SIGN #define SIGN(x) (((x) < 0) ? -1 : (((x) > 0) ? 1 : 0)) #endif #ifndef ABS #define ABS(x) ((x) > 0 ? (x) : -(x)) #endif #ifndef CLAMP #define CLAMP(x,min,max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #endif #ifndef BSWAP16 #define BSWAP16(x) (((u16)(x)>>8) | ((u16)(x)<<8)) #endif #ifndef BSWAP32 #define BSWAP32(x) ((((u32)(x)>>24) & 0x000000ff) | (((u32)(x)>> 8) & 0x0000ff00) | \ (((u32)(x)<< 8) & 0x00ff0000) | (((u32)(x)<<24) & 0xff000000)) #endif #define D_FLAGS_SET(flags,f) do { (flags) |= (f); } while (0) #define D_FLAGS_CLEAR(flags,f) do { (flags) &= ~(f); } while (0) #define D_FLAGS_IS_SET(flags,f) (((flags) & (f)) != 0) #define D_FLAGS_ARE_SET(flags,f) (((flags) & (f)) == (f)) #define D_FLAGS_ARE_IN(flags,f) (((flags) & ~(f)) == 0) #define D_FLAGS_INVALID(flags,f) (((flags) & ~(f)) != 0) #define D_FLAGS_ASSERT(flags,f) D_ASSERT( D_FLAGS_ARE_IN(flags,f) ) #define D_ARRAY_SIZE(array) ((int)(sizeof(array) / sizeof((array)[0]))) #if __GNUC__ >= 3 #define D_CONST_FUNC __attribute__((const)) #else #define D_CONST_FUNC #endif #define D_BITn32(f) (((f) & 0x00000001) ? 0 : \ ((f) & 0x00000002) ? 1 : \ ((f) & 0x00000004) ? 2 : \ ((f) & 0x00000008) ? 3 : \ ((f) & 0x00000010) ? 4 : \ ((f) & 0x00000020) ? 5 : \ ((f) & 0x00000040) ? 6 : \ ((f) & 0x00000080) ? 7 : \ ((f) & 0x00000100) ? 8 : \ ((f) & 0x00000200) ? 9 : \ ((f) & 0x00000400) ? 10 : \ ((f) & 0x00000800) ? 11 : \ ((f) & 0x00001000) ? 12 : \ ((f) & 0x00002000) ? 13 : \ ((f) & 0x00004000) ? 14 : \ ((f) & 0x00008000) ? 15 : \ ((f) & 0x00010000) ? 16 : \ ((f) & 0x00020000) ? 17 : \ ((f) & 0x00040000) ? 18 : \ ((f) & 0x00080000) ? 19 : \ ((f) & 0x00100000) ? 20 : \ ((f) & 0x00200000) ? 21 : \ ((f) & 0x00400000) ? 22 : \ ((f) & 0x00800000) ? 23 : \ ((f) & 0x01000000) ? 24 : \ ((f) & 0x02000000) ? 25 : \ ((f) & 0x04000000) ? 26 : \ ((f) & 0x08000000) ? 27 : \ ((f) & 0x10000000) ? 28 : \ ((f) & 0x20000000) ? 29 : \ ((f) & 0x40000000) ? 30 : \ ((f) & 0x80000000) ? 31 : -1) /* * portable sched_yield() implementation */ #ifdef _POSIX_PRIORITY_SCHEDULING #define direct_sched_yield() sched_yield() #else #define direct_sched_yield() usleep(1) #endif /* * translates errno to DirectResult */ DirectResult errno2result( int erno ); const char *DirectResultString( DirectResult result ); /* * duplicates a file descriptor as needed to ensure it's not stdin, stdout, or stderr */ int direct_safe_dup( int fd ); int direct_try_open( const char *name1, const char *name2, int flags, bool error_msg ); void direct_trim( char **s ); /* * Set a string with a maximum size including the zero termination. * * This acts like a strncpy(d,s,n), but always terminates the string like snprintf(d,n,"%s",s). * * Returns dest or NULL if n is zero. */ static __inline__ char * direct_snputs( char *dest, const char *src, size_t n ) { char *start = dest; D_ASSERT( dest != NULL ); D_ASSERT( src != NULL ); if (!n) return NULL; for (; n>1 && *src; n--) *dest++ = *src++; *dest = 0; return start; } /* * Encode/Decode Base-64 strings. */ char *direct_base64_encode( const void *data, int size ); void *direct_base64_decode( const char *string, int *ret_size ); /* * Compute MD5 sum (store 16-bytes long result in "dst"). */ void direct_md5_sum( void *dst, const void *src, const int len ); /* * Slow implementation, but quite fast if only low bits are set. */ static __inline__ int direct_util_count_bits( unsigned int mask ) { register int ret = 0; while (mask) { ret += mask & 1; mask >>= 1; } return ret; } /* * Generic alignment routine. */ static __inline__ int direct_util_align( int value, int alignment ) { if (alignment > 1) { int tail = value % alignment; if (tail) value += alignment - tail; } return value; } /* * Utility function to initialize recursive mutexes. */ int direct_util_recursive_pthread_mutex_init( pthread_mutex_t *mutex ); /* floor and ceil implementation to get rid of libm */ /* IEEE floor for computers that round to nearest or even. 'f' must be between -4194304 and 4194303. This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1", but uses some IEEE specific tricks for better speed. */ static __inline__ int D_IFLOOR(float f) { int ai, bi; double af, bf; af = (3 << 22) + 0.5 + (double)f; bf = (3 << 22) + 0.5 - (double)f; #if defined(__GNUC__) && defined(__i386__) /* GCC generates an extra fstp/fld without this. */ __asm__ __volatile__ ("fstps %0" : "=m" (ai) : "t" (af) : "st"); __asm__ __volatile__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st"); #else { union { int i; float f; } u; u.f = af; ai = u.i; u.f = bf; bi = u.i; } #endif return (ai - bi) >> 1; } /* IEEE ceil for computers that round to nearest or even. 'f' must be between -4194304 and 4194303. This ceil operation is done by "(iround(f + .5) + iround(f - .5) + 1) >> 1", but uses some IEEE specific tricks for better speed. */ static __inline__ int D_ICEIL(float f) { int ai, bi; double af, bf; af = (3 << 22) + 0.5 + (double)f; bf = (3 << 22) + 0.5 - (double)f; #if defined(__GNUC__) && defined(__i386__) /* GCC generates an extra fstp/fld without this. */ __asm__ __volatile__ ("fstps %0" : "=m" (ai) : "t" (af) : "st"); __asm__ __volatile__ ("fstps %0" : "=m" (bi) : "t" (bf) : "st"); #else { union { int i; float f; } u; u.f = af; ai = u.i; u.f = bf; bi = u.i; } #endif return (ai - bi + 1) >> 1; } static __inline__ int direct_log2( int val ) { register int ret = 0; while (val >> ++ret); if ((1 << --ret) < val) ret++; return ret; } #endif DirectFB-1.2.10/lib/direct/stream.h0000644000175000017500000000766511245562152013643 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__STREAM_H__ #define __DIRECT__STREAM_H__ #include #include #include /* * Create a stream wrapper. * * 'filename' can be a plain file name or one of the following: * http://[:]/ * unsv://[:]/ * ftp://[:]/ * rtsp://[:]/ * tcp://: * udp://: * file:/ * fd:/ * stdin:/ */ DirectResult direct_stream_create ( const char *filename, DirectStream **ret_stream ); /* * Duplicate the stream (never fails). */ DirectStream *direct_stream_dup ( DirectStream *stream ); /* * Return the file descriptor associated to the stream. */ int direct_stream_fileno ( DirectStream *stream ); /* * True if stream is seekable. */ bool direct_stream_seekable( DirectStream *stream ); /* * True if stream originates from a remote host. */ bool direct_stream_remote ( DirectStream *stream ); /* * Get the mime description of the stream. * Returns NULL if the information is not available. */ const char* direct_stream_mime ( DirectStream *stream ); /* * Get stream length. */ unsigned int direct_stream_length ( DirectStream *stream ); /* * Get stream position. */ unsigned int direct_stream_offset ( DirectStream *stream ); /* * Wait for data to be available. * If 'timeout' is NULL, the function blocks indefinitely. * Set the 'timeout' to 0 to make the function return immediatly. */ DirectResult direct_stream_wait ( DirectStream *stream, unsigned int length, struct timeval *timeout ); /* * Peek 'length' bytes of data at offset 'offset' from the stream. */ DirectResult direct_stream_peek ( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ); /* * Fetch 'length' bytes of data from the stream. */ DirectResult direct_stream_read ( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ); /* * Seek to the specified absolute offset within the stream. */ DirectResult direct_stream_seek ( DirectStream *stream, unsigned int offset ); /* * Destroy the stream wrapper. */ void direct_stream_destroy ( DirectStream *stream ); #endif /* __DIRECT__STREAM_H__ */ DirectFB-1.2.10/lib/direct/Makefile.in0000644000175000017500000006230011307521504014222 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/build.h.in \ $(srcdir)/direct.pc.in $(top_srcdir)/rules/nmfile.make subdir = lib/direct ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = build.h direct.pc am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libdirect_la_LIBADD = am__libdirect_la_SOURCES_DIST = ppcasm_memcpy.S \ ppcasm_memcpy_cachable.S clock.c conf.c debug.c direct.c \ hash.c interface.c list.c log.c mem.c memcpy.c messages.c \ modules.c signals.c stream.c system.c trace.c tree.c thread.c \ utf8.c util.c @BUILDPPCASM_TRUE@@HAVE_LINUX_FALSE@am__objects_1 = ppcasm_memcpy.lo @BUILDPPCASM_TRUE@@HAVE_LINUX_TRUE@am__objects_1 = ppcasm_memcpy.lo \ @BUILDPPCASM_TRUE@@HAVE_LINUX_TRUE@ ppcasm_memcpy_cachable.lo am_libdirect_la_OBJECTS = $(am__objects_1) clock.lo conf.lo debug.lo \ direct.lo hash.lo interface.lo list.lo log.lo mem.lo memcpy.lo \ messages.lo modules.lo signals.lo stream.lo system.lo trace.lo \ tree.lo thread.lo utf8.lo util.lo libdirect_la_OBJECTS = $(am_libdirect_la_OBJECTS) libdirect_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirect_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirect_la_SOURCES) DIST_SOURCES = $(am__libdirect_la_SOURCES_DIST) pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) am__include_HEADERS_DIST = ppcasm_memcpy.h ppc_asm.h build.h clock.h \ conf.h debug.h direct.h hash.h interface.h \ interface_implementation.h list.h log.h mem.h memcpy.h \ messages.h modules.h serial.h signals.h stream.h system.h \ thread.h trace.h tree.h types.h utf8.h util.h includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @INCLUDEDIR@/direct infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \ -DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = direct.pc EXTRA_DIST = \ ppcasm_memcpy.S \ ppcasm_memcpy_cachable.S \ ppcasm_memcpy.h \ ppc_asm.h @BUILDPPCASM_TRUE@@HAVE_LINUX_FALSE@ppcasm_sources = ppcasm_memcpy.S @BUILDPPCASM_TRUE@@HAVE_LINUX_TRUE@ppcasm_sources = ppcasm_memcpy.S ppcasm_memcpy_cachable.S @BUILDPPCASM_TRUE@ppcasm_headers = ppcasm_memcpy.h ppc_asm.h include_HEADERS = \ $(ppcasm_headers) \ build.h \ clock.h \ conf.h \ debug.h \ direct.h \ hash.h \ interface.h \ interface_implementation.h \ list.h \ log.h \ mem.h \ memcpy.h \ messages.h \ modules.h \ serial.h \ signals.h \ stream.h \ system.h \ thread.h \ trace.h \ tree.h \ types.h \ utf8.h \ util.h lib_LTLIBRARIES = libdirect.la libdirect_la_SOURCES = \ $(ppcasm_sources) \ clock.c \ conf.c \ debug.c \ direct.c \ hash.c \ interface.c \ list.c \ log.c \ mem.c \ memcpy.c \ messages.c \ modules.c \ signals.c \ stream.c \ system.c \ trace.c \ tree.c \ thread.c \ utf8.c \ util.c libdirect_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@LIBTONM = $(LTLIBRARIES:.la=-$(LT_RELEASE).so.$(LT_BINARY)) all: all-am .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/nmfile.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/direct/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/direct/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh build.h: $(top_builddir)/config.status $(srcdir)/build.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ direct.pc: $(top_builddir)/config.status $(srcdir)/direct.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirect.la: $(libdirect_la_OBJECTS) $(libdirect_la_DEPENDENCIES) $(libdirect_la_LINK) -rpath $(libdir) $(libdirect_la_OBJECTS) $(libdirect_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/direct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/messages.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modules.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppcasm_memcpy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppcasm_memcpy_cachable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ .S.o: @am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCCAS_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $< .S.obj: @am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCCAS_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .S.lo: @am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCCAS_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $< .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) all-local installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @BUILD_SHARED_FALSE@install-data-local: @ENABLE_TRACE_FALSE@install-data-local: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-includeHEADERS \ install-pkgconfigDATA install-dvi: install-dvi-am install-exec-am: install-exec-local install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA # If the old location isn't cleared, builds of external modules fail install-exec-local: rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/direct # # @BUILD_STATIC_TRUE@clean-local: @BUILD_STATIC_TRUE@ rm -f libdirect_fixed.a @BUILD_STATIC_TRUE@all-local: libdirect_fixed.a @BUILD_STATIC_TRUE@libdirect_fixed.a: .libs/libdirect.a @BUILD_STATIC_TRUE@ rm -f libdirect_fixed.a @BUILD_STATIC_TRUE@ ${AR} cru libdirect_fixed.a `find . -name "*.o" | grep -v '.libs' | grep -v dtest` @BUILD_STATIC_TRUE@ ${RANLIB} libdirect_fixed.a @BUILD_STATIC_TRUE@ cp -pf libdirect_fixed.a .libs/libdirect.a @BUILD_STATIC_TRUE@.libs/libdirect.a: libdirect.la @BUILD_STATIC_FALSE@clean-local: @BUILD_STATIC_FALSE@all-local: @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)" @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/lib/direct/utf8.c0000644000175000017500000000237411245562152013221 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . UTF8 routines ported from glib-2.0 and optimized This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include DirectFB-1.2.10/lib/direct/list.h0000644000175000017500000001276011245562152013313 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__LIST_H__ #define __DIRECT__LIST_H__ #include #include struct __D_DirectLink { int magic; DirectLink *next; DirectLink *prev; /* The 'prev' pointer of the first element always points to the last element of the list, for fast appending ;-) */ }; static __inline__ void direct_list_prepend( DirectLink **list, DirectLink *link ) { DirectLink *first = *list; link->next = first; if (first) { D_MAGIC_ASSERT( first, DirectLink ); link->prev = first->prev; first->prev = link; } else link->prev = link; *list = link; D_MAGIC_SET( link, DirectLink ); } static __inline__ void direct_list_append( DirectLink **list, DirectLink *link ) { DirectLink *first = *list; link->next = NULL; if (first) { DirectLink *last = first->prev; D_MAGIC_ASSERT( first, DirectLink ); D_MAGIC_ASSERT( last, DirectLink ); link->prev = last; last->next = first->prev = link; } else *list = link->prev = link; D_MAGIC_SET( link, DirectLink ); } static __inline__ bool direct_list_contains_element_EXPENSIVE( DirectLink *list, DirectLink *link ) { D_MAGIC_ASSERT_IF( list, DirectLink ); while (list) { if (list == link) return true; list = list->next; } return false; } static __inline__ int direct_list_count_elements_EXPENSIVE( DirectLink *list ) { int count = 0; while (list) { D_MAGIC_ASSERT( list, DirectLink ); count++; list = list->next; } return count; } static __inline__ void direct_list_remove( DirectLink **list, DirectLink *link ) { DirectLink *next; DirectLink *prev; D_ASSERT( list != NULL ); D_ASSERT( direct_list_contains_element_EXPENSIVE( *list, link ) ); D_MAGIC_ASSERT( *list, DirectLink ); D_MAGIC_ASSERT( link, DirectLink ); next = link->next; prev = link->prev; if (next) { D_MAGIC_ASSERT( next, DirectLink ); next->prev = prev; } else (*list)->prev = prev; if (link == *list) *list = next; else { D_MAGIC_ASSERT( prev, DirectLink ); prev->next = next; } link->next = link->prev = NULL; D_MAGIC_CLEAR( link ); } static __inline__ void direct_list_move_to_front( DirectLink **list, DirectLink *link ) { DirectLink *next; DirectLink *prev; DirectLink *first; D_ASSERT( list != NULL ); first = *list; D_ASSERT( direct_list_contains_element_EXPENSIVE( first, link ) ); D_MAGIC_ASSERT( first, DirectLink ); D_MAGIC_ASSERT( link, DirectLink ); if (first == link) return; next = link->next; prev = link->prev; D_MAGIC_ASSERT_IF( next, DirectLink ); D_MAGIC_ASSERT( prev, DirectLink ); if (next) { next->prev = prev; link->prev = first->prev; } else link->prev = prev; prev->next = next; link->next = first; first->prev = link; *list = link; } static __inline__ bool direct_list_check_link( const DirectLink *link ) { D_MAGIC_ASSERT_IF( link, DirectLink ); return link != NULL; } #define direct_list_foreach(elem, list) \ for (elem = (__typeof__(elem))(list); \ direct_list_check_link( (DirectLink*)(elem) ); \ elem = (__typeof__(elem))(((DirectLink*)(elem))->next)) #define direct_list_foreach_reverse(elem, list) \ for (elem = (__typeof__(elem))((list) ? (list)->prev : NULL); \ direct_list_check_link( (DirectLink*)(elem) ); \ elem = (__typeof__(elem))((((DirectLink*)(elem))->prev->next) ? ((DirectLink*)(elem))->prev : NULL)) #define direct_list_foreach_safe(elem, temp, list) \ for (elem = (__typeof__(elem))(list), temp = ((__typeof__(temp))(elem) ? (__typeof__(temp))(((DirectLink*)(elem))->next) : NULL); \ direct_list_check_link( (DirectLink*)(elem) ); \ elem = (__typeof__(elem))(temp), temp = ((__typeof__(temp))(elem) ? (__typeof__(temp))(((DirectLink*)(elem))->next) : NULL)) #endif DirectFB-1.2.10/lib/direct/utf8.h0000644000175000017500000000457311245562152013231 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . UTF8 routines ported from glib-2.0 and optimized This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__UTF8_H__ #define __DIRECT__UTF8_H__ #include #define DIRECT_UTF8_SKIP(c) (((u8)(c) < 0xc0) ? 1 : __direct_utf8_skip[(u8)(c)&0x3f]) #define DIRECT_UTF8_GET_CHAR(p) (*(const u8*)(p) < 0xc0 ? \ *(const u8*)(p) : __direct_utf8_get_char((const u8*)(p))) /* * Actually the last two fields used to be zero since they indicate an * invalid UTF-8 string. Changed it to 1 to avoid endless looping on * invalid input. */ static const char __direct_utf8_skip[64] = { 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1 }; static __inline__ unichar __direct_utf8_get_char( const u8 *p ) { int len; register unichar result = p[0]; if (result < 0xc0) return result; if (result > 0xfd) return (unichar) -1; len = __direct_utf8_skip[result & 0x3f]; result &= 0x7c >> len; while (--len) { int c = *(++p); if ((c & 0xc0) != 0x80) return (unichar) -1; result = (result << 6) | (c & 0x3f); } return result; } #endif DirectFB-1.2.10/lib/direct/signals.h0000644000175000017500000000457611245562152014006 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__SIGNALS_H__ #define __DIRECT__SIGNALS_H__ #include typedef enum { DSHR_OK, DSHR_REMOVE, DSHR_RESUME } DirectSignalHandlerResult; typedef DirectSignalHandlerResult (*DirectSignalHandlerFunc)( int num, void *addr, void *ctx ); DirectResult direct_signals_initialize( void ); DirectResult direct_signals_shutdown( void ); /* * Modifies the current thread's signal mask to block everything. * Should be called by input threads once to avoid killing themselves * in the signal handler by deinitializing all input drivers. */ void direct_signals_block_all( void ); /* * Signal number to use when registering a handler for any interrupt. */ #define DIRECT_SIGNAL_ANY -1 DirectResult direct_signal_handler_add ( int num, DirectSignalHandlerFunc func, void *ctx, DirectSignalHandler **ret_handler ); DirectResult direct_signal_handler_remove( DirectSignalHandler *handler ); #endif DirectFB-1.2.10/lib/direct/signals.c0000644000175000017500000003214111245562152013766 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Signals, "Direct/Signals", "Signal handling" ); struct __D_DirectSignalHandler { DirectLink link; int magic; int num; DirectSignalHandlerFunc func; void *ctx; }; /**************************************************************************************************/ typedef struct { int signum; struct sigaction old_action; } SigHandled; static int sigs_to_handle[] = { /*SIGALRM,*/ SIGHUP, SIGINT, /*SIGPIPE,*/ /*SIGPOLL,*/ SIGTERM, /*SIGUSR1, SIGUSR2,*/ /*SIGVTALRM,*/ /*SIGSTKFLT,*/ SIGABRT, SIGFPE, SIGILL, SIGQUIT, SIGSEGV, SIGTRAP, /*SIGSYS, SIGEMT,*/ SIGBUS, SIGXCPU, SIGXFSZ }; #define NUM_SIGS_TO_HANDLE ((int)D_ARRAY_SIZE( sigs_to_handle )) static SigHandled sigs_handled[NUM_SIGS_TO_HANDLE]; static DirectLink *handlers = NULL; static pthread_mutex_t handlers_lock; /**************************************************************************************************/ static void install_handlers( void ); static void remove_handlers( void ); /**************************************************************************************************/ DirectResult direct_signals_initialize( void ) { D_DEBUG_AT( Direct_Signals, "Initializing...\n" ); direct_util_recursive_pthread_mutex_init( &handlers_lock ); install_handlers(); return DR_OK; } DirectResult direct_signals_shutdown( void ) { D_DEBUG_AT( Direct_Signals, "Shutting down...\n" ); remove_handlers(); pthread_mutex_destroy( &handlers_lock ); return DR_OK; } void direct_signals_block_all( void ) { sigset_t signals; D_DEBUG_AT( Direct_Signals, "Blocking all signals from now on!\n" ); sigfillset( &signals ); if (pthread_sigmask( SIG_BLOCK, &signals, NULL )) D_PERROR( "Direct/Signals: Setting signal mask failed!\n" ); } DirectResult direct_signal_handler_add( int num, DirectSignalHandlerFunc func, void *ctx, DirectSignalHandler **ret_handler ) { DirectSignalHandler *handler; D_ASSERT( func != NULL ); D_ASSERT( ret_handler != NULL ); D_DEBUG_AT( Direct_Signals, "Adding handler %p for signal %d with context %p...\n", func, num, ctx ); handler = D_CALLOC( 1, sizeof(DirectSignalHandler) ); if (!handler) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } handler->num = num; handler->func = func; handler->ctx = ctx; D_MAGIC_SET( handler, DirectSignalHandler ); pthread_mutex_lock( &handlers_lock ); direct_list_append( &handlers, &handler->link ); pthread_mutex_unlock( &handlers_lock ); *ret_handler = handler; return DR_OK; } DirectResult direct_signal_handler_remove( DirectSignalHandler *handler ) { D_MAGIC_ASSERT( handler, DirectSignalHandler ); D_DEBUG_AT( Direct_Signals, "Removing handler %p for signal %d with context %p...\n", handler->func, handler->num, handler->ctx ); pthread_mutex_lock( &handlers_lock ); direct_list_remove( &handlers, &handler->link ); pthread_mutex_unlock( &handlers_lock ); D_MAGIC_CLEAR( handler ); D_FREE( handler ); return DR_OK; } /**************************************************************************************************/ static bool show_segv( const siginfo_t *info ) { switch (info->si_code) { #ifdef SEGV_MAPERR case SEGV_MAPERR: direct_log_printf( NULL, " (at %p, invalid address) <--\n", info->si_addr ); return true; #endif #ifdef SEGV_ACCERR case SEGV_ACCERR: direct_log_printf( NULL, " (at %p, invalid permissions) <--\n", info->si_addr ); return true; #endif } return false; } static bool show_bus( const siginfo_t *info ) { switch (info->si_code) { #ifdef BUG_ADRALN case BUS_ADRALN: direct_log_printf( NULL, " (at %p, invalid address alignment) <--\n", info->si_addr ); return true; #endif #ifdef BUS_ADRERR case BUS_ADRERR: direct_log_printf( NULL, " (at %p, non-existent physical address) <--\n", info->si_addr ); return true; #endif #ifdef BUS_OBJERR case BUS_OBJERR: direct_log_printf( NULL, " (at %p, object specific hardware error) <--\n", info->si_addr ); return true; #endif } return false; } static bool show_ill( const siginfo_t *info ) { switch (info->si_code) { #ifdef ILL_ILLOPC case ILL_ILLOPC: direct_log_printf( NULL, " (at %p, illegal opcode) <--\n", info->si_addr ); return true; #endif #ifdef ILL_ILLOPN case ILL_ILLOPN: direct_log_printf( NULL, " (at %p, illegal operand) <--\n", info->si_addr ); return true; #endif #ifdef ILL_ILLADR case ILL_ILLADR: direct_log_printf( NULL, " (at %p, illegal addressing mode) <--\n", info->si_addr ); return true; #endif #ifdef ILL_ILLTRP case ILL_ILLTRP: direct_log_printf( NULL, " (at %p, illegal trap) <--\n", info->si_addr ); return true; #endif #ifdef ILL_PRVOPC case ILL_PRVOPC: direct_log_printf( NULL, " (at %p, privileged opcode) <--\n", info->si_addr ); return true; #endif #ifdef ILL_PRVREG case ILL_PRVREG: direct_log_printf( NULL, " (at %p, privileged register) <--\n", info->si_addr ); return true; #endif #ifdef ILL_COPROC case ILL_COPROC: direct_log_printf( NULL, " (at %p, coprocessor error) <--\n", info->si_addr ); return true; #endif #ifdef ILL_BADSTK case ILL_BADSTK: direct_log_printf( NULL, " (at %p, internal stack error) <--\n", info->si_addr ); return true; #endif } return false; } static bool show_fpe( const siginfo_t *info ) { switch (info->si_code) { #ifdef FPE_INTDIV case FPE_INTDIV: direct_log_printf( NULL, " (at %p, integer divide by zero) <--\n", info->si_addr ); return true; #endif #ifdef FPE_FLTDIV case FPE_FLTDIV: direct_log_printf( NULL, " (at %p, floating point divide by zero) <--\n", info->si_addr ); return true; #endif } direct_log_printf( NULL, " (at %p) <--\n", info->si_addr ); return true; } static bool show_any( const siginfo_t *info ) { switch (info->si_code) { #ifdef SI_USER case SI_USER: direct_log_printf( NULL, " (sent by pid %d, uid %d) <--\n", info->si_pid, info->si_uid ); return true; #endif #ifdef SI_KERNEL case SI_KERNEL: direct_log_printf( NULL, " (sent by the kernel) <--\n" ); return true; #endif } return false; } static void #ifdef SA_SIGINFO signal_handler( int num, siginfo_t *info, void *foo ) #else signal_handler( int num ) #endif { DirectLink *l, *n; void *addr = NULL; int pid = direct_gettid(); long long millis = direct_clock_get_millis(); fflush(stdout); fflush(stderr); direct_log_printf( NULL, "(!) [%5d: %4lld.%03lld] --> Caught signal %d", pid, millis/1000, millis%1000, num ); #ifdef SA_SIGINFO if (info && info > (siginfo_t*) 0x100) { bool shown = false; if (info->si_code > 0 && info->si_code < 0x80) { addr = info->si_addr; switch (num) { case SIGSEGV: shown = show_segv( info ); break; case SIGBUS: shown = show_bus( info ); break; case SIGILL: shown = show_ill( info ); break; case SIGFPE: shown = show_fpe( info ); break; default: direct_log_printf( NULL, " <--\n" ); addr = NULL; shown = true; break; } } else shown = show_any( info ); if (!shown) direct_log_printf( NULL, " (unknown origin) <--\n" ); } else #endif direct_log_printf( NULL, ", no siginfo available <--\n" ); direct_trace_print_stacks(); /* Loop through all handlers. */ pthread_mutex_lock( &handlers_lock ); direct_list_foreach_safe (l, n, handlers) { DirectSignalHandler *handler = (DirectSignalHandler*) l; if (handler->num != num && handler->num != DIRECT_SIGNAL_ANY) continue; switch (handler->func( num, addr, handler->ctx )) { case DSHR_OK: break; case DSHR_REMOVE: direct_list_remove( &handlers, &handler->link ); D_MAGIC_CLEAR( handler ); D_FREE( handler ); break; case DSHR_RESUME: millis = direct_clock_get_millis(); direct_log_printf( NULL, "(!) [%5d: %4lld.%03lld] -> cured!\n", pid, millis / 1000, millis % 1000 ); pthread_mutex_unlock( &handlers_lock ); return; default: D_BUG( "unknown result" ); break; } } pthread_mutex_unlock( &handlers_lock ); remove_handlers(); raise( num ); abort(); exit( -num ); } /**************************************************************************************************/ static void install_handlers( void ) { int i; for (i=0; isighandler && !sigismember( &direct_config->dont_catch, sigs_to_handle[i] )) { struct sigaction action; int signum = sigs_to_handle[i]; #ifdef SA_SIGINFO action.sa_sigaction = signal_handler; action.sa_flags = SA_SIGINFO; #else action.sa_handler = signal_handler; action.sa_flags = 0; #endif if (signum != SIGSEGV) action.sa_flags |= SA_NODEFER; sigemptyset( &action.sa_mask ); if (sigaction( signum, &action, &sigs_handled[i].old_action )) { D_PERROR( "Direct/Signals: " "Unable to install signal handler for signal %d!\n", signum ); continue; } sigs_handled[i].signum = signum; } } } static void remove_handlers( void ) { int i; for (i=0; i, Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct __D_DirectLog { int magic; DirectLogType type; int fd; pthread_mutex_t lock; }; /**********************************************************************************************************************/ /* Statically allocated to avoid endless loops between D_CALLOC() and D_DEBUG(), while the latter would only * call the allocation once, if there wouldn't be the loopback... */ static DirectLog fallback_log; static DirectLog *default_log = NULL; static pthread_once_t init_fallback = PTHREAD_ONCE_INIT; /**********************************************************************************************************************/ static DirectResult init_stderr( DirectLog *log ); static DirectResult init_file ( DirectLog *log, const char *filename ); static DirectResult init_udp ( DirectLog *log, const char *hostport ); /**********************************************************************************************************************/ DirectResult direct_log_create( DirectLogType type, const char *param, DirectLog **ret_log ) { DirectResult ret = DR_INVARG; DirectLog *log; log = D_CALLOC( 1, sizeof(DirectLog) ); if (!log) return D_OOM(); log->type = type; switch (type) { case DLT_STDERR: ret = init_stderr( log ); break; case DLT_FILE: ret = init_file( log, param ); break; case DLT_UDP: ret = init_udp( log, param ); break; } if (ret) D_FREE( log ); else { direct_util_recursive_pthread_mutex_init( &log->lock ); D_MAGIC_SET( log, DirectLog ); *ret_log = log; } return ret; } DirectResult direct_log_destroy( DirectLog *log ) { D_MAGIC_ASSERT( log, DirectLog ); D_ASSERT( &fallback_log != log ); if (log == default_log) default_log = NULL; close( log->fd ); D_MAGIC_CLEAR( log ); D_FREE( log ); return DR_OK; } __attribute__((no_instrument_function)) DirectResult direct_log_printf( DirectLog *log, const char *format, ... ) { va_list args; /* * Don't use D_MAGIC_ASSERT or any other * macros/functions that might cause an endless loop. */ va_start( args, format ); /* Use the default log if passed log is invalid. */ if (!log || log->magic != D_MAGIC("DirectLog")) log = direct_log_default(); /* Write to stderr as a fallback if default is invalid, too. */ if (!log || log->magic != D_MAGIC("DirectLog")) { vfprintf( stderr, format, args ); fflush( stderr ); } else { int len; char buf[512]; len = vsnprintf( buf, sizeof(buf), format, args ); pthread_mutex_lock( &log->lock ); write( log->fd, buf, len ); pthread_mutex_unlock( &log->lock ); } va_end( args ); return DR_OK; } DirectResult direct_log_set_default( DirectLog *log ) { D_MAGIC_ASSERT( log, DirectLog ); default_log = log; return DR_OK; } __attribute__((no_instrument_function)) void direct_log_lock( DirectLog *log ) { D_MAGIC_ASSERT_IF( log, DirectLog ); if (!log) log = direct_log_default(); D_MAGIC_ASSERT( log, DirectLog ); pthread_mutex_lock( &log->lock ); } __attribute__((no_instrument_function)) void direct_log_unlock( DirectLog *log ) { D_MAGIC_ASSERT_IF( log, DirectLog ); if (!log) log = direct_log_default(); D_MAGIC_ASSERT( log, DirectLog ); pthread_mutex_unlock( &log->lock ); } __attribute__((no_instrument_function)) static void init_fallback_log( void ) { fallback_log.type = DLT_STDERR; fallback_log.fd = fileno( stderr ); direct_util_recursive_pthread_mutex_init( &fallback_log.lock ); D_MAGIC_SET( &fallback_log, DirectLog ); } __attribute__((no_instrument_function)) DirectLog * direct_log_default( void ) { pthread_once( &init_fallback, init_fallback_log ); if (!default_log) default_log = &fallback_log; D_MAGIC_ASSERT( default_log, DirectLog ); return default_log; } /**********************************************************************************************************************/ static DirectResult init_stderr( DirectLog *log ) { log->fd = dup( fileno( stderr ) ); return DR_OK; } static DirectResult init_file( DirectLog *log, const char *filename ) { DirectResult ret; int fd; fd = open( filename, O_WRONLY | O_CREAT | O_APPEND, 0664 ); if (fd < 0) { ret = errno2result( errno ); D_PERROR( "Direct/Log: Could not open '%s' for writing!\n", filename ); return ret; } log->fd = fd; return DR_OK; } static DirectResult parse_host_addr( const char *hostport, struct addrinfo **ret_addr ) { int i, ret; int size = strlen( hostport ) + 1; char buf[size]; char *hoststr = buf; char *portstr = NULL; char *end; struct addrinfo hints; memcpy( buf, hostport, size ); for (i=0; i:'!\n", hostport ); return DR_INVARG; } strtoul( portstr, &end, 10 ); if (end && *end) { D_ERROR( "Direct/Log: Parse error in port number '%s'!\n", portstr ); return DR_INVARG; } memset( &hints, 0, sizeof(hints) ); hints.ai_socktype = SOCK_DGRAM; hints.ai_family = PF_UNSPEC; ret = getaddrinfo( hoststr, portstr, &hints, ret_addr ); if (ret) { switch (ret) { case EAI_FAMILY: D_ERROR( "Direct/Log: Unsupported address family!\n" ); return DR_UNSUPPORTED; case EAI_SOCKTYPE: D_ERROR( "Direct/Log: Unsupported socket type!\n" ); return DR_UNSUPPORTED; case EAI_NONAME: D_ERROR( "Direct/Log: Host not found!\n" ); return DR_FAILURE; case EAI_SERVICE: D_ERROR( "Direct/Log: Port %s is unreachable!\n", portstr ); return DR_FAILURE; case EAI_ADDRFAMILY: case EAI_NODATA: D_ERROR( "Direct/Log: Host found, but has no address!\n" ); return DR_FAILURE; case EAI_MEMORY: return D_OOM(); case EAI_FAIL: D_ERROR( "Direct/Log: A non-recoverable name server error occurred!\n" ); return DR_FAILURE; case EAI_AGAIN: D_ERROR( "Direct/Log: Temporary error, try again!\n" ); return DR_TEMPUNAVAIL; default: D_ERROR( "Direct/Log: Unknown error occured!?\n" ); return DR_FAILURE; } } return DR_OK; } static DirectResult init_udp( DirectLog *log, const char *hostport ) { DirectResult ret; int fd; struct addrinfo *addr; ret = parse_host_addr( hostport, &addr ); if (ret) return ret; fd = socket( addr->ai_family, SOCK_DGRAM, 0 ); if (fd < 0) { ret = errno2result( errno ); D_PERROR( "Direct/Log: Could not create a UDP socket!\n" ); freeaddrinfo( addr ); return ret; } ret = connect( fd, addr->ai_addr, addr->ai_addrlen ); freeaddrinfo( addr ); if (ret) { ret = errno2result( errno ); D_PERROR( "Direct/Log: Could not connect UDP socket to '%s'!\n", hostport ); close( fd ); return ret; } log->fd = fd; return DR_OK; } DirectFB-1.2.10/lib/direct/hash.h0000644000175000017500000000435611245562152013265 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__HASH_H__ #define __DIRECT__HASH_H__ #include typedef bool (*DirectHashIteratorFunc)( DirectHash *hash, unsigned long key, void *value, void *ctx ); DirectResult direct_hash_create ( int size, DirectHash **ret_hash ); void direct_hash_destroy( DirectHash *hash ); DirectResult direct_hash_insert ( DirectHash *hash, unsigned long key, void *value ); void direct_hash_remove ( DirectHash *hash, unsigned long key ); void *direct_hash_lookup ( DirectHash *hash, unsigned long key ); void direct_hash_iterate( DirectHash *hash, DirectHashIteratorFunc func, void *ctx ); #endif DirectFB-1.2.10/lib/direct/modules.c0000644000175000017500000003005111245562152013774 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #ifdef PIC #define DYNAMIC_LINKING #endif #ifdef DYNAMIC_LINKING #include #endif D_DEBUG_DOMAIN( Direct_Modules, "Direct/Modules", "Module loading and registration" ); /******************************************************************************/ #ifdef DYNAMIC_LINKING static DirectModuleEntry *lookup_by_name( const DirectModuleDir *directory, const char *name ); static DirectModuleEntry *lookup_by_file( const DirectModuleDir *directory, const char *file ); static void *open_module ( DirectModuleEntry *module ); static bool load_module ( DirectModuleEntry *module ); static void unload_module( DirectModuleEntry *module ); #endif /******************************************************************************/ static int suppress_module (const char *name) { int i = 0; if (!direct_config || !direct_config->disable_module) return 0; while (direct_config->disable_module[i]) { if (strcmp (direct_config->disable_module[i], name) == 0) { D_INFO( "Direct/Modules: suppress module '%s'\n", direct_config->disable_module[i] ); return 1; } i++; } return 0; } void direct_modules_register( DirectModuleDir *directory, unsigned int abi_version, const char *name, const void *funcs ) { DirectModuleEntry *entry; D_ASSERT( directory != NULL ); D_ASSERT( name != NULL ); D_ASSERT( funcs != NULL ); D_DEBUG_AT( Direct_Modules, "Registering '%s' ('%s')...\n", name, directory->path ); #ifdef DYNAMIC_LINKING if ((entry = lookup_by_name( directory, name )) != NULL) { D_MAGIC_ASSERT( entry, DirectModuleEntry ); entry->loaded = true; entry->funcs = funcs; return; } #endif if (directory->loading) { entry = directory->loading; D_MAGIC_ASSERT( entry, DirectModuleEntry ); directory->loading = NULL; } else { entry = D_CALLOC( 1, sizeof(DirectModuleEntry) ); if (!entry) { D_OOM(); return; } D_MAGIC_SET( entry, DirectModuleEntry ); } entry->directory = directory; entry->loaded = true; entry->name = D_STRDUP( name ); entry->funcs = funcs; entry->disabled = suppress_module( name ); if (abi_version != directory->abi_version) { D_ERROR( "Direct/Modules: ABI version of '%s' (%d) does not match %d!\n", entry->file ? entry->file : entry->name, abi_version, directory->abi_version ); entry->disabled = true; } direct_list_prepend( &directory->entries, &entry->link ); D_DEBUG_AT( Direct_Modules, "...registered.\n" ); } void direct_modules_unregister( DirectModuleDir *directory, const char *name ) { DirectModuleEntry *entry; D_DEBUG_AT( Direct_Modules, "Unregistering '%s' ('%s')...\n", name, directory->path ); #ifdef DYNAMIC_LINKING entry = lookup_by_name( directory, name ); if (!entry) { D_ERROR( "Direct/Modules: Unregister failed, could not find '%s' module!\n", name ); return; } D_MAGIC_ASSERT( entry, DirectModuleEntry ); D_FREE( entry->name ); direct_list_remove( &directory->entries, &entry->link ); D_MAGIC_CLEAR( entry ); D_FREE( entry ); #endif D_DEBUG_AT( Direct_Modules, "...unregistered.\n" ); } int direct_modules_explore_directory( DirectModuleDir *directory ) { #ifdef DYNAMIC_LINKING int dir_len; DIR *dir; struct dirent *entry = NULL; struct dirent tmp; int count = 0; const char *pathfront = ""; const char *path; char *buf; D_ASSERT( directory != NULL ); D_ASSERT( directory->path != NULL ); D_DEBUG_AT( Direct_Modules, "%s( '%s' )\n", __FUNCTION__, directory->path ); path = directory->path; if(path[0]!='/') { pathfront = direct_config->module_dir; if(!pathfront) pathfront = MODULEDIR; } buf = alloca( strlen(pathfront) + 1 + strlen(path) + 1 ); /* pre, slash, post, 0 */ sprintf( buf, "%s%s%s", pathfront, ( pathfront && path && (path[0] != '/') && (pathfront[strlen(pathfront)-1] != '/') ) ? "/" : "", path ); dir_len = strlen( buf ); dir = opendir( buf ); if (!dir) { D_DEBUG_AT( Direct_Modules, " -> ERROR opening directory: %s!\n", strerror(errno) ); return 0; } while (readdir_r( dir, &tmp, &entry ) == 0 && entry) { void *handle; DirectModuleEntry *module; int entry_len = strlen(entry->d_name); if (entry_len < 4 || entry->d_name[entry_len-1] != 'o' || entry->d_name[entry_len-2] != 's') continue; if (lookup_by_file( directory, entry->d_name )) continue; module = D_CALLOC( 1, sizeof(DirectModuleEntry) ); if (!module) continue; D_MAGIC_SET( module, DirectModuleEntry ); module->directory = directory; module->dynamic = true; module->file = D_STRDUP( entry->d_name ); directory->loading = module; if ((handle = open_module( module )) != NULL) { if (!module->loaded) { int len; void (*func)( void ); D_ERROR( "Direct/Modules: Module '%s' did not register itself after loading! " "Trying default module constructor...\n", entry->d_name ); len = strlen( entry->d_name ); entry->d_name[len-3] = 0; func = dlsym( handle, entry->d_name + 3 ); if (func) { func(); if (!module->loaded) { D_ERROR( "Direct/Modules: ... even did not register after " "explicitly calling the module constructor!\n" ); } } else { D_ERROR( "Direct/Modules: ... default contructor not found!\n" ); } if (!module->loaded) { module->disabled = true; direct_list_prepend( &directory->entries, &module->link ); } } if (module->disabled) { module->loaded = false; /* may call direct_modules_unregister() */ dlclose( handle ); } else { module->handle = handle; count++; } } else { module->disabled = true; direct_list_prepend( &directory->entries, &module->link ); } directory->loading = NULL; } closedir( dir ); return count; #else return 0; #endif } const void * direct_module_ref( DirectModuleEntry *module ) { D_MAGIC_ASSERT( module, DirectModuleEntry ); if (module->disabled) return NULL; #ifdef DYNAMIC_LINKING if (!module->loaded && !load_module( module )) return NULL; #endif module->refs++; return module->funcs; } void direct_module_unref( DirectModuleEntry *module ) { D_MAGIC_ASSERT( module, DirectModuleEntry ); D_ASSERT( module->refs > 0 ); if (--module->refs) return; #ifdef DYNAMIC_LINKING if (module->dynamic) unload_module( module ); #endif } /******************************************************************************/ #ifdef DYNAMIC_LINKING static DirectModuleEntry * lookup_by_name( const DirectModuleDir *directory, const char *name ) { DirectLink *l; D_ASSERT( directory != NULL ); D_ASSERT( name != NULL ); direct_list_foreach (l, directory->entries) { DirectModuleEntry *entry = (DirectModuleEntry*) l; D_MAGIC_ASSERT( entry, DirectModuleEntry ); if (!entry->name) continue; if (!strcmp( entry->name, name )) return entry; } return NULL; } static DirectModuleEntry * lookup_by_file( const DirectModuleDir *directory, const char *file ) { DirectLink *l; D_ASSERT( directory != NULL ); D_ASSERT( file != NULL ); direct_list_foreach (l, directory->entries) { DirectModuleEntry *entry = (DirectModuleEntry*) l; D_MAGIC_ASSERT( entry, DirectModuleEntry ); if (!entry->file) continue; if (!strcmp( entry->file, file )) return entry; } return NULL; } static bool load_module( DirectModuleEntry *module ) { D_MAGIC_ASSERT( module, DirectModuleEntry ); D_ASSERT( module->dynamic == true ); D_ASSERT( module->file != NULL ); D_ASSERT( module->loaded == false ); D_ASSERT( module->disabled == false ); module->handle = open_module( module ); return module->loaded; } static void unload_module( DirectModuleEntry *module ) { void *handle; D_MAGIC_ASSERT( module, DirectModuleEntry ); D_ASSERT( module->dynamic == true ); D_ASSERT( module->handle != NULL ); D_ASSERT( module->loaded == true ); handle = module->handle; module->handle = NULL; module->loaded = false; /* may call direct_modules_unregister() */ dlclose( handle ); } static void * open_module( DirectModuleEntry *module ) { DirectModuleDir *directory; void *handle; char *pathfront; const char *path; D_MAGIC_ASSERT( module, DirectModuleEntry ); directory = module->directory; path = directory->path; pathfront = ""; if(path[0]!='/') { pathfront = direct_config->module_dir; if(!pathfront) pathfront = MODULEDIR; } char buf[ strlen(pathfront) + 1 + strlen(path) + 1 + strlen(module->file) + 1 ]; sprintf( buf, "%s%s%s/%s", pathfront, ( pathfront && path && (path[0] != '/') && (pathfront[strlen(pathfront)-1] != '/') ) ? "/" : "", path, module->file ); D_DEBUG_AT( Direct_Modules, "Loading '%s'...\n", buf ); handle = dlopen( buf, RTLD_NOW ); if (!handle) D_DLERROR( "Direct/Modules: Unable to dlopen `%s'!\n", buf ); return handle; } #endif DirectFB-1.2.10/lib/direct/tree.h0000644000175000017500000000367311245562152013302 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . Balanced binary tree ported from glib by Sven Neumann . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__TREE_H__ #define __DIRECT__TREE_H__ #include typedef struct __D_DirectNode DirectNode; struct __D_DirectTree { DirectNode *root; void *fast_keys[128]; }; struct __D_DirectNode { int balance; DirectNode *left; DirectNode *right; void *key; void *value; }; DirectTree *direct_tree_new ( void ); void direct_tree_destroy( DirectTree *tree ); void direct_tree_insert ( DirectTree *tree, void *key, void *value ); void *direct_tree_lookup ( DirectTree *tree, void *key ); #endif DirectFB-1.2.10/lib/direct/debug.c0000644000175000017500000002734011245562152013421 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if DIRECT_BUILD_TEXT #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ typedef struct { DirectLink link; char *name; bool enabled; } DebugDomainEntry; /**************************************************************************************************/ static pthread_mutex_t domains_lock = PTHREAD_MUTEX_INITIALIZER; static unsigned int domains_age = 1; static DirectLink *domains = NULL; /**************************************************************************************************/ __attribute__((no_instrument_function)) static inline DebugDomainEntry * lookup_domain( const char *name, bool sub ) { DebugDomainEntry *entry; direct_list_foreach (entry, domains) { if (! strcasecmp( entry->name, name )) return entry; } /* * If the domain being registered contains a slash, but didn't exactly match an entry * in directfbrc, check to see if the domain is descended from an entry in directfbrc * (e.g. 'ui/field/messages' matches 'ui' or 'ui/field') */ if (sub && strchr(name, '/')) { int passed_name_len = strlen( name ); direct_list_foreach (entry, domains) { int entry_len = strlen( entry->name ); if ((passed_name_len > entry_len) && (name[entry_len] == '/') && (! strncasecmp( entry->name, name, entry_len))) { return entry; } } } return NULL; } __attribute__((no_instrument_function)) static inline bool check_domain( DirectDebugDomain *domain ) { if (domain->age != domains_age) { DebugDomainEntry *entry = lookup_domain( domain->name, true ); domain->age = domains_age; if (entry) { domain->registered = true; domain->enabled = entry->enabled; } } return domain->registered ? domain->enabled : direct_config->debug; } #endif /* DIRECT_BUILD_DEBUGS */ /**************************************************************************************************/ void direct_debug_config_domain( const char *name, bool enable ) { #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ DebugDomainEntry *entry; pthread_mutex_lock( &domains_lock ); entry = lookup_domain( name, false ); if (!entry) { entry = calloc( 1, sizeof(DebugDomainEntry) ); if (!entry) { D_WARN( "out of memory" ); pthread_mutex_unlock( &domains_lock ); return; } entry->name = strdup( name ); direct_list_prepend( &domains, &entry->link ); } entry->enabled = enable; if (! ++domains_age) domains_age++; pthread_mutex_unlock( &domains_lock ); #endif /* DIRECT_BUILD_DEBUGS */ } /**************************************************************************************************/ __attribute__((no_instrument_function)) static inline void debug_domain_vprintf( const char *name, int name_len, const char *format, va_list ap ) { char buf[512]; long long millis = direct_clock_get_millis(); const char *thread = direct_thread_self_name(); int indent = direct_trace_debug_indent() * 4; /* Prepare user message. */ vsnprintf( buf, sizeof(buf), format, ap ); /* Fill up domain name column after the colon, prepending remaining space (excl. ': ') to indent. */ indent += (name_len < 20 ? 20 : 36) - name_len - 2; /* Print full message. */ direct_log_printf( NULL, "(-) [%-15s %3lld.%03lld] (%5d) %s: %*s%s", thread ? thread : " NO NAME", millis / 1000LL, millis % 1000LL, direct_gettid(), name, indent, "", buf ); } #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ __attribute__((no_instrument_function)) void direct_debug( const char *format, ... ) { va_list ap; va_start( ap, format ); debug_domain_vprintf( "- - ", 4, format, ap ); va_end( ap ); } __attribute__((no_instrument_function)) void direct_debug_at( DirectDebugDomain *domain, const char *format, ... ) { bool enabled; pthread_mutex_lock( &domains_lock ); enabled = check_domain( domain ); pthread_mutex_unlock( &domains_lock ); if (enabled) { va_list ap; va_start( ap, format ); debug_domain_vprintf( domain->name, domain->name_len, format, ap ); va_end( ap ); } } #endif /* DIRECT_BUILD_DEBUGS */ __attribute__((no_instrument_function)) void direct_debug_at_always( DirectDebugDomain *domain, const char *format, ... ) { va_list ap; va_start( ap, format ); debug_domain_vprintf( domain->name, domain->name_len, format, ap ); va_end( ap ); } #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ __attribute__((no_instrument_function)) void direct_debug_enter( DirectDebugDomain *domain, const char *func, const char *file, int line, const char *format, ... ) { bool enabled; pthread_mutex_lock( &domains_lock ); enabled = check_domain( domain ); pthread_mutex_unlock( &domains_lock ); if (enabled) { int len; char dom[48]; char fmt[128]; char buf[512]; long long millis = direct_clock_get_millis(); const char *name = direct_thread_self_name(); va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); len = snprintf( dom, sizeof(dom), "%s:", domain->name ); if (len < 18) len = 18; else len = 28; len += direct_trace_debug_indent() * 4; snprintf( fmt, sizeof(fmt), "(>) [%%-15s %%3lld.%%03lld] (%%5d) %%-%ds Entering %%s%%s [%%s:%%d]\n", len ); direct_log_printf( NULL, fmt, name ? name : " NO NAME ", millis / 1000LL, millis % 1000LL, direct_gettid(), dom, func, buf, file, line ); } } __attribute__((no_instrument_function)) void direct_debug_exit( DirectDebugDomain *domain, const char *func, const char *file, int line, const char *format, ... ) { bool enabled; pthread_mutex_lock( &domains_lock ); enabled = check_domain( domain ); pthread_mutex_unlock( &domains_lock ); if (enabled) { int len; char dom[48]; char fmt[128]; char buf[512]; long long millis = direct_clock_get_millis(); const char *name = direct_thread_self_name(); va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); len = snprintf( dom, sizeof(dom), "%s:", domain->name ); if (len < 18) len = 18; else len = 28; len += direct_trace_debug_indent() * 4; snprintf( fmt, sizeof(fmt), "(<) [%%-15s %%3lld.%%03lld] (%%5d) %%-%ds Returning from %%s%%s [%%s:%%d]\n", len ); direct_log_printf( NULL, fmt, name ? name : " NO NAME ", millis / 1000LL, millis % 1000LL, direct_gettid(), dom, func, buf, file, line ); } } __attribute__((no_instrument_function)) static void trap( const char *domain ) { D_DEBUG( "Direct/%s: Raising SIGTRAP...\n", domain ); raise( SIGTRAP ); D_DEBUG( "Direct/%s: ...didn't catch signal on my own, calling killpg().\n", domain ); killpg( 0, SIGTRAP ); D_DEBUG( "Direct/%s: ...still running, calling pthread_exit().\n", domain ); pthread_exit( NULL ); } __attribute__((no_instrument_function)) void direct_break( const char *func, const char *file, int line, const char *format, ... ) { char buf[512]; long long millis = direct_clock_get_millis(); const char *name = direct_thread_self_name(); va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, "(!) [%-15s %3lld.%03lld] (%5d) *** Break [%s] *** [%s:%d in %s()]\n", name ? name : " NO NAME ", millis / 1000LL, millis % 1000LL, direct_gettid(), buf, file, line, func ); direct_trace_print_stack( NULL ); if (direct_config->fatal_break) trap( "Break" ); } __attribute__((no_instrument_function)) void direct_assertion( const char *exp, const char *func, const char *file, int line ) { long long millis = direct_clock_get_millis(); const char *name = direct_thread_self_name(); direct_log_printf( NULL, "(!) [%-15s %3lld.%03lld] (%5d) *** Assertion [%s] failed *** [%s:%d in %s()]\n", name ? name : " NO NAME ", millis / 1000LL, millis % 1000LL, direct_gettid(), exp, file, line, func ); direct_trace_print_stack( NULL ); if (direct_config->fatal >= DCFL_ASSERT) trap( "Assertion" ); } __attribute__((no_instrument_function)) void direct_assumption( const char *exp, const char *func, const char *file, int line ) { long long millis = direct_clock_get_millis(); const char *name = direct_thread_self_name(); direct_log_printf( NULL, "(!) [%-15s %3lld.%03lld] (%5d) *** Assumption [%s] failed *** [%s:%d in %s()]\n", name ? name : " NO NAME ", millis / 1000LL, millis % 1000LL, direct_gettid(), exp, file, line, func ); direct_trace_print_stack( NULL ); if (direct_config->fatal >= DCFL_ASSUME) trap( "Assumption" ); } #endif /* DIRECT_BUILD_DEBUGS */ #else void direct_debug_config_domain( const char *name, bool enable ) { } #endif /* DIRECT_BUILD_TEXT */ DirectFB-1.2.10/lib/direct/list.c0000644000175000017500000000233311245562152013301 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include DirectFB-1.2.10/lib/direct/util.c0000644000175000017500000002777211245562152013321 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include /* * translates errno to DirectResult */ DirectResult errno2result( int erno ) { switch (erno) { case 0: return DR_OK; case ENOENT: return DR_FILENOTFOUND; case EACCES: case EPERM: return DR_ACCESSDENIED; case EBUSY: case EAGAIN: return DR_BUSY; case ECONNREFUSED: return DR_ACCESSDENIED; case ENODEV: case ENXIO: #ifdef ENOTSUP /* ENOTSUP is not defined on NetBSD */ case ENOTSUP: #endif return DR_UNSUPPORTED; } return DR_FAILURE; } const char * DirectResultString( DirectResult result ) { if (!D_RESULT_TYPE_IS( result, 0, 0, 0 )) return "UNKNOWN RESULT CODE TYPE!"; switch (result) { case DR_OK: return "OK"; case DR_FAILURE: return "General failure!"; case DR_INIT: return "Initialization error!"; case DR_BUG: return "Internal bug!"; case DR_DEAD: return "Interface was released!"; case DR_UNSUPPORTED: return "Not supported!"; case DR_UNIMPLEMENTED: return "Not implemented!"; case DR_ACCESSDENIED: return "Access denied!"; case DR_INVARG: return "Invalid argument!"; case DR_NOLOCALMEMORY: return "Out of memory!"; case DR_LOCKED: return "Resource is locked!"; case DR_BUFFEREMPTY: return "Buffer is empty!"; case DR_FILENOTFOUND: return "File not found!"; case DR_IO: return "General I/O error!"; case DR_NOIMPL: return "No (suitable) implementation found!"; case DR_TIMEOUT: return "Operation timed out!"; case DR_BUSY: return "Resource is busy!"; case DR_THIZNULL: return "'thiz' argument is NULL!"; case DR_IDNOTFOUND: return "Requested ID not found!"; case DR_INVAREA: return "Invalid area present!"; case DR_DESTROYED: return "Resource was destroyed!"; case DR_FUSION: return "Fusion IPC error detected!"; case DR_BUFFERTOOLARGE: return "Buffer is too large!"; case DR_INTERRUPTED: return "Operation has been interrupted!"; case DR_NOCONTEXT: return "No context available!"; case DR_TEMPUNAVAIL: return "Resource temporarily unavailable!"; case DR_LIMITEXCEEDED: return "Limit has been exceeded!"; case DR_NOSUCHMETHOD: return "No such (remote) method!"; case DR_NOSUCHINSTANCE: return "No such (remote) instance!"; case DR_ITEMNOTFOUND: return "Appropriate item not found!"; case DR_VERSIONMISMATCH: return "Some versions didn't match!"; case DR_NOSHAREDMEMORY: return "Out of shared memory!"; case DR_EOF: return "End of file!"; case DR_SUSPENDED: return "Object is suspended!"; case DR_INCOMPLETE: return "Operation incomplete!"; case DR_NOCORE: return "No core (loaded)!"; default: break; } return "UNKNOWN RESULT CODE!"; } int direct_safe_dup( int fd ) { int n = 0; int fc[3]; while (fd >= 0 && fd <= 2) { fc[n++] = fd; fd = dup (fd); } while (n) close (fc[--n]); return fd; } int direct_try_open( const char *name1, const char *name2, int flags, bool error_msg ) { int fd; fd = open (name1, flags); if (fd >= 0) return direct_safe_dup (fd); if (errno != ENOENT) { if (error_msg) D_PERROR( "Direct/Util: opening '%s' failed\n", name1 ); return -1; } fd = open (name2, flags); if (fd >= 0) return direct_safe_dup (fd); if (error_msg) { if (errno == ENOENT) D_PERROR( "Direct/Util: opening '%s' and '%s' failed\n", name1, name2 ); else D_PERROR( "Direct/Util: opening '%s' failed\n", name2 ); } return -1; } void direct_trim( char **s ) { int i; int len = strlen( *s ); for (i = len-1; i >= 0; i--) if ((*s)[i] <= ' ') (*s)[i] = 0; else break; while (**s) if (**s <= ' ') (*s)++; else return; } /* * Utility function to initialize recursive mutexes. */ int direct_util_recursive_pthread_mutex_init( pthread_mutex_t *mutex ) { int ret; pthread_mutexattr_t attr; pthread_mutexattr_init( &attr ); #if HAVE_DECL_PTHREAD_MUTEX_RECURSIVE pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); #endif ret = pthread_mutex_init( mutex, &attr ); if (ret) D_PERROR( "Direct/Lock: Could not initialize recursive mutex!\n" ); pthread_mutexattr_destroy( &attr ); return ret; } /* * Encode/Decode Base-64. */ char* direct_base64_encode( const void *data, int size ) { static const char *enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/="; const unsigned char *src = (const unsigned char*)data; char *ret; char *buf; D_ASSERT( data != NULL ); buf = ret = D_MALLOC( (size + 2) / 3 * 4 + 1 ); if (!ret) return NULL; for (; size >= 3; size -= 3) { buf[0] = enc[((src[0] & 0xfc) >> 2)]; buf[1] = enc[((src[0] & 0x03) << 4) | ((src[1] & 0xf0) >> 4)]; buf[2] = enc[((src[1] & 0x0f) << 2) | ((src[2] & 0xc0) >> 6)]; buf[3] = enc[((src[2] & 0x3f))]; buf += 4; src += 3; } if (size > 0) { buf[0] = enc[(src[0] & 0xfc) >> 2]; if (size > 1) { buf[1] = enc[((src[0] & 0x03) << 4) | ((src[1] & 0xf0) >> 4)]; buf[2] = enc[((src[1] & 0x0f) << 2)]; } else { buf[1] = enc[(src[0] & 0x03) << 4]; buf[2] = '='; } buf[3] = '='; buf += 4; } *buf = '\0'; return ret; } void* direct_base64_decode( const char *string, int *ret_size ) { unsigned char dec[256]; unsigned char *ret; unsigned char *buf; int len; int i, j; D_ASSERT( string != NULL ); len = strlen( string ); buf = ret = D_MALLOC( len * 3 / 4 + 3 ); if (!ret) return NULL; /* generate decode table */ for (i = 0; i < 255; i++) dec[i] = 0x80; for (i = 'A'; i <= 'Z'; i++) dec[i] = 0 + (i - 'A'); for (i = 'a'; i <= 'z'; i++) dec[i] = 26 + (i - 'a'); for (i = '0'; i <= '9'; i++) dec[i] = 52 + (i - '0'); dec['+'] = 62; dec['/'] = 63; dec['='] = 0; /* decode */ for (j = 0; j < len; j += 4) { unsigned char a[4], b[4]; for (i = 0; i < 4; i++) { int c = string[i+j]; a[i] = c; b[i] = dec[c]; } *buf++ = (b[0] << 2) | (b[1] >> 4); *buf++ = (b[1] << 4) | (b[2] >> 2); *buf++ = (b[2] << 6) | (b[3] ); if (a[2] == '=' || a[3] == '=') break; } *buf = '\0'; if (ret_size) *ret_size = buf - ret; return ret; } /* * Compute MD5 sum. */ static const u8 S[4][4] = { { 7, 12, 17, 22 }, /* Round 1 */ { 5, 9, 14, 20 }, /* Round 2 */ { 4, 11, 16, 23 }, /* Round 3 */ { 6, 10, 15, 21 } /* Round 4 */ }; static const u32 T[64] = { 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, /* Round 1 */ 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, /* Round 2 */ 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, /* Round 3 */ 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, /* Round 4 */ 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391, }; static void md5_hash( u32 ABCD[4], u32 X[16] ) { u32 a = ABCD[3]; u32 b = ABCD[2]; u32 c = ABCD[1]; u32 d = ABCD[0]; int t; int i; #ifdef WORDS_BIGENDIAN for (i = 0; i < 16; i++) X[i] = BSWAP32(X[i]); #endif for (i = 0; i < 64; i++) { t = S[i>>4][i&3]; a += T[i]; switch (i>>4) { case 0: a += (d ^ (b&(c^d))) + X[ i &15]; break; case 1: a += (c ^ (d&(c^b))) + X[(1+5*i)&15]; break; case 2: a += (b^c^d) + X[(5+3*i)&15]; break; case 3: a += (c^(b|~d)) + X[( 7*i)&15]; break; } a = b + ((a << t) | (a >> (32 - t))); t = d; d = c; c = b; b = a; a = t; } ABCD[0] += d; ABCD[1] += c; ABCD[2] += b; ABCD[3] += a; } void direct_md5_sum( void *dst, const void *src, const int len ) { u8 block[64]; u32 ABCD[4]; int i, j; D_ASSERT( dst != NULL ); D_ASSERT( src != NULL ); ABCD[0] = 0x10325476; ABCD[1] = 0x98badcfe; ABCD[2] = 0xefcdab89; ABCD[3] = 0x67452301; for (i = 0, j = 0; i < len; i++) { block[j++] = ((const u8*)src)[i]; if (j == 64) { md5_hash( ABCD, (u32*)block ); j = 0; } } block[j++] = 0x80; memset( &block[j], 0, 64-j ); if (j > 56) { md5_hash( ABCD, (u32*)block ); memset( block, 0, 64 ); } for (i = 0; i < 8; i++) block[56+i] = ((u64)len << 3) >> (i << 3); md5_hash( ABCD, (u32*)block ); for (i = 0; i < 4; i++) #ifdef WORDS_BIGENDIAN ((u32*)dst)[i] = BSWAP32(ABCD[3-i]); #else ((u32*)dst)[i] = ABCD[3-i]; #endif } DirectFB-1.2.10/lib/direct/clock.h0000644000175000017500000000274611245562152013436 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__CLOCK_H__ #define __DIRECT__CLOCK_H__ #include long long direct_clock_get_micros( void ); long long direct_clock_get_millis( void ); void direct_clock_set_start( const struct timeval *start ); long long direct_clock_get_abs_micros( void ); long long direct_clock_get_abs_millis( void ); #endif DirectFB-1.2.10/lib/direct/tree.c0000644000175000017500000001731611245562152013274 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . Balanced binary tree ported from glib-2.0. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include static DirectNode *tree_node_new ( DirectTree *tree, void *key, void *value ); static void tree_node_destroy ( DirectTree *tree, DirectNode *node ); static DirectNode *tree_node_insert ( DirectTree *tree, DirectNode *node, void *key, void *value, int *inserted ); static DirectNode *tree_node_lookup ( DirectNode *node, void *key ); static DirectNode *tree_node_balance ( DirectNode *node ); static DirectNode *tree_node_rotate_left ( DirectNode *node ); static DirectNode *tree_node_rotate_right( DirectNode *node ); DirectTree * direct_tree_new( void ) { return D_CALLOC( 1, sizeof (DirectTree) ); } void direct_tree_destroy( DirectTree *tree ) { unsigned int i; for (i = 0; i < 128; i++) { if (tree->fast_keys[i]) D_FREE( tree->fast_keys[i] ); } tree_node_destroy( tree, tree->root ); D_FREE( tree ); } void direct_tree_insert( DirectTree *tree, void *key, void *value ) { int inserted = 0; unsigned long fast_key = (unsigned long) key; if (fast_key < 128) tree->fast_keys[fast_key] = value; else tree->root = tree_node_insert( tree, tree->root, key, value, &inserted ); } void * direct_tree_lookup( DirectTree *tree, void *key ) { DirectNode *node; unsigned long fast_key = (unsigned long) key; if (fast_key < 128) return tree->fast_keys[fast_key]; node = tree_node_lookup( tree->root, key ); return node ? node->value : NULL; } static DirectNode * tree_node_new( DirectTree *tree, void *key, void *value ) { DirectNode *node; node = D_MALLOC(sizeof (DirectNode)); node->balance = 0; node->left = NULL; node->right = NULL; node->key = key; node->value = value; return node; } static void tree_node_destroy (DirectTree *tree, DirectNode *node) { if (node) { tree_node_destroy (tree, node->left); tree_node_destroy (tree, node->right); if (node->value) D_FREE(node->value); D_FREE(node); } } static DirectNode * tree_node_insert (DirectTree *tree, DirectNode *node, void *key, void *value, int *inserted) { int cmp; int old_balance; if (!node) { *inserted = 1; return tree_node_new (tree, key, value); } cmp = key - node->key; if (cmp == 0) { node->value = value; return node; } if (cmp < 0) { if (node->left) { old_balance = node->left->balance; node->left = tree_node_insert (tree, node->left, key, value, inserted); if ((old_balance != node->left->balance) && node->left->balance) node->balance -= 1; } else { *inserted = 1; node->left = tree_node_new (tree, key, value); node->balance -= 1; } } else if (cmp > 0) { if (node->right) { old_balance = node->right->balance; node->right = tree_node_insert (tree, node->right, key, value, inserted); if ((old_balance != node->right->balance) && node->right->balance) node->balance += 1; } else { *inserted = 1; node->right = tree_node_new (tree, key, value); node->balance += 1; } } if (*inserted && (node->balance < -1 || node->balance > 1)) node = tree_node_balance (node); return node; } static DirectNode * tree_node_lookup (DirectNode *node, void *key) { int cmp; if (!node) return NULL; cmp = key - node->key; if (cmp == 0) return node; if (cmp < 0 && node->left) { return tree_node_lookup (node->left, key); } else if (cmp > 0 && node->right) { return tree_node_lookup (node->right, key); } return NULL; } static DirectNode * tree_node_balance (DirectNode *node) { if (node->balance < -1) { if (node->left->balance > 0) node->left = tree_node_rotate_left (node->left); node = tree_node_rotate_right (node); } else if (node->balance > 1) { if (node->right->balance < 0) node->right = tree_node_rotate_right (node->right); node = tree_node_rotate_left (node); } return node; } static DirectNode * tree_node_rotate_left (DirectNode *node) { DirectNode *right; int a_bal; int b_bal; right = node->right; node->right = right->left; right->left = node; a_bal = node->balance; b_bal = right->balance; if (b_bal <= 0) { if (a_bal >= 1) right->balance = b_bal - 1; else right->balance = a_bal + b_bal - 2; node->balance = a_bal - 1; } else { if (a_bal <= b_bal) right->balance = a_bal - 2; else right->balance = b_bal - 1; node->balance = a_bal - b_bal - 1; } return right; } static DirectNode * tree_node_rotate_right (DirectNode *node) { DirectNode *left; int a_bal; int b_bal; left = node->left; node->left = left->right; left->right = node; a_bal = node->balance; b_bal = left->balance; if (b_bal <= 0) { if (b_bal > a_bal) left->balance = b_bal + 1; else left->balance = a_bal + 2; node->balance = a_bal - b_bal + 1; } else { if (a_bal <= -1) left->balance = b_bal + 1; else left->balance = a_bal + b_bal + 2; node->balance = a_bal + 1; } return left; } DirectFB-1.2.10/lib/direct/serial.h0000644000175000017500000000613311245562152013614 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__SERIAL_H__ #define __DIRECT__SERIAL_H__ #include #include struct __D_DirectSerial { int magic; u32 value; u32 overflow; }; static __inline__ void direct_serial_init( DirectSerial *serial ) { D_ASSERT( serial != NULL ); serial->value = 0; serial->overflow = 0; D_MAGIC_SET( serial, DirectSerial ); } static __inline__ void direct_serial_deinit( DirectSerial *serial ) { D_MAGIC_CLEAR( serial ); } static __inline__ void direct_serial_increase( DirectSerial *serial ) { D_MAGIC_ASSERT( serial, DirectSerial ); if (! ++serial->value) serial->overflow++; } static __inline__ void direct_serial_copy( DirectSerial *serial, const DirectSerial *source ) { D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( source, DirectSerial ); serial->value = source->value; serial->overflow = source->overflow; } static __inline__ bool direct_serial_check( DirectSerial *serial, const DirectSerial *source ) { D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( source, DirectSerial ); if (serial->overflow < source->overflow) return false; else if (serial->overflow == source->overflow && serial->value < source->value) return false; D_ASSUME( serial->value == source->value ); return true; } static __inline__ bool direct_serial_update( DirectSerial *serial, const DirectSerial *source ) { D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( source, DirectSerial ); if (serial->overflow < source->overflow) { serial->overflow = source->overflow; serial->value = source->value; return true; } else if (serial->overflow == source->overflow && serial->value < source->value) { serial->value = source->value; return true; } D_ASSUME( serial->value == source->value ); return false; } #endif DirectFB-1.2.10/lib/direct/ppc_asm.h0000644000175000017500000000321511164361026013752 00000000000000/* Condition Register Bit Fields */ #define cr0 0 #define cr1 1 #define cr2 2 #define cr3 3 #define cr4 4 #define cr5 5 #define cr6 6 #define cr7 7 /* General Purpose Registers (GPRs) */ #define r0 0 #define r1 1 #define r2 2 #define r3 3 #define r4 4 #define r5 5 #define r6 6 #define r7 7 #define r8 8 #define r9 9 #define r10 10 #define r11 11 #define r12 12 #define r13 13 #define r14 14 #define r15 15 #define r16 16 #define r17 17 #define r18 18 #define r19 19 #define r20 20 #define r21 21 #define r22 22 #define r23 23 #define r24 24 #define r25 25 #define r26 26 #define r27 27 #define r28 28 #define r29 29 #define r30 30 #define r31 31 /* Floating Point Registers (FPRs) */ #define fr0 0 #define fr1 1 #define fr2 2 #define fr3 3 #define fr4 4 #define fr5 5 #define fr6 6 #define fr7 7 #define fr8 8 #define fr9 9 #define fr10 10 #define fr11 11 #define fr12 12 #define fr13 13 #define fr14 14 #define fr15 15 #define fr16 16 #define fr17 17 #define fr18 18 #define fr19 19 #define fr20 20 #define fr21 21 #define fr22 22 #define fr23 23 #define fr24 24 #define fr25 25 #define fr26 26 #define fr27 27 #define fr28 28 #define fr29 29 #define fr30 30 #define fr31 31 #define vr0 0 #define vr1 1 #define vr2 2 #define vr3 3 #define vr4 4 #define vr5 5 #define vr6 6 #define vr7 7 #define vr8 8 #define vr9 9 #define vr10 10 #define vr11 11 #define vr12 12 #define vr13 13 #define vr14 14 #define vr15 15 #define vr16 16 #define vr17 17 #define vr18 18 #define vr19 19 #define vr20 20 #define vr21 21 #define vr22 22 #define vr23 23 #define vr24 24 #define vr25 25 #define vr26 26 #define vr27 27 #define vr28 28 #define vr29 29 #define vr30 30 #define vr31 31 DirectFB-1.2.10/lib/direct/interface_implementation.h0000644000175000017500000001000511245562152017373 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__INTERFACE_IMPLEMENTATION_H__ #define __DIRECT__INTERFACE_IMPLEMENTATION_H__ #include static const char *GetType( void ); static const char *GetImplementation( void ); static DirectResult Allocate( void **interface ); static DirectInterfaceFuncs interface_funcs = { .GetType = GetType, .GetImplementation = GetImplementation, .Allocate = Allocate, .Probe = (DirectInterfaceGenericProbeFunc) Probe, .Construct = (DirectInterfaceGenericConstructFunc) Construct }; #define DIRECT_INTERFACE_IMPLEMENTATION(type, impl) \ \ static const char * \ GetType( void ) \ { \ return #type; \ } \ \ static const char * \ GetImplementation( void ) \ { \ return #impl; \ } \ \ static DirectResult \ Allocate( void **interface ) \ { \ DIRECT_ALLOCATE_INTERFACE( *interface, type ); \ return DR_OK; \ } \ \ __attribute__((constructor)) \ void \ type##_##impl##_ctor(void); \ \ __attribute__((constructor)) \ void \ type##_##impl##_ctor(void) \ { \ DirectRegisterInterface( &interface_funcs ); \ } \ \ __attribute__((destructor)) \ void \ type##_##impl##_dtor(void); \ \ __attribute__((destructor)) \ void \ type##_##impl##_dtor(void) \ { \ DirectUnregisterInterface( &interface_funcs ); \ } #endif DirectFB-1.2.10/lib/direct/ppcasm_memcpy_cachable.S0000644000175000017500000001012311164361026016736 00000000000000/* * String handling functions for PowerPC. * * Copyright (C) 1996 Paul Mackerras. * * * In a mail from Paul on 23.10.2006 05:47: * * You may put an LGPL permission statement on that code, replacing the * GPL permission statement. From a technical point of view, I'm not * sure that the code in ppcasm_memcpy_cachable.S is the best thing to * use in userspace, though; for one thing, it has a cache line size * assumption encoded into it. Why don't you just use the glibc memcpy? * It's pretty well optimized these days, AFAIK. * * Paul. * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #define __ASSEMBLY__ #include #if defined(CONFIG_8xx) || defined(CONFIG_403GCX) #define L1_CACHE_LINE_SIZE 16 #define LG_L1_CACHE_LINE_SIZE 4 #elif defined(CONFIG_PPC64BRIDGE) #define L1_CACHE_LINE_SIZE 128 #define LG_L1_CACHE_LINE_SIZE 7 #else #define L1_CACHE_LINE_SIZE 32 #define LG_L1_CACHE_LINE_SIZE 5 #endif #include "ppc_asm.h" #define COPY_16_BYTES \ lwz r7,4(r4); \ lwz r8,8(r4); \ lwz r9,12(r4); \ lwzu r10,16(r4); \ stw r7,4(r6); \ stw r8,8(r6); \ stw r9,12(r6); \ stwu r10,16(r6) #define COPY_16_BYTES_WITHEX(n) \ 8 ## n ## 0: \ lwz r7,4(r4); \ 8 ## n ## 1: \ lwz r8,8(r4); \ 8 ## n ## 2: \ lwz r9,12(r4); \ 8 ## n ## 3: \ lwzu r10,16(r4); \ 8 ## n ## 4: \ stw r7,4(r6); \ 8 ## n ## 5: \ stw r8,8(r6); \ 8 ## n ## 6: \ stw r9,12(r6); \ 8 ## n ## 7: \ stwu r10,16(r6) #define COPY_16_BYTES_EXCODE(n) \ 9 ## n ## 0: \ addi r5,r5,-(16 * n); \ b 104f; \ 9 ## n ## 1: \ addi r5,r5,-(16 * n); \ b 105f; \ .section __ex_table,"a"; \ .align 2; \ .long 8 ## n ## 0b,9 ## n ## 0b; \ .long 8 ## n ## 1b,9 ## n ## 0b; \ .long 8 ## n ## 2b,9 ## n ## 0b; \ .long 8 ## n ## 3b,9 ## n ## 0b; \ .long 8 ## n ## 4b,9 ## n ## 1b; \ .long 8 ## n ## 5b,9 ## n ## 1b; \ .long 8 ## n ## 6b,9 ## n ## 1b; \ .long 8 ## n ## 7b,9 ## n ## 1b; \ .text .text CACHELINE_MASK = (L1_CACHE_LINE_SIZE - 1) .global direct_ppcasm_cacheable_memcpy direct_ppcasm_cacheable_memcpy: #if 0 /* this part causes "error loading shared library: unexpected reloc type 0x0b (???) */ add r7,r3,r5 /* test if the src & dst overlap */ add r8,r4,r5 cmplw 0,r4,r7 cmplw 1,r3,r8 crand 0,0,4 /* cr0.lt &= cr1.lt */ blt ppcasm_memcpy /* if regions overlap */ #endif addi r4,r4,-4 addi r6,r3,-4 neg r0,r3 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */ beq 58f cmplw 0,r5,r0 /* is this more than total to do? */ blt 63f /* if not much to do */ andi. r8,r0,3 /* get it word-aligned first */ subf r5,r0,r5 mtctr r8 beq+ 61f 70: lbz r9,4(r4) /* do some bytes */ stb r9,4(r6) addi r4,r4,1 addi r6,r6,1 bdnz 70b 61: srwi. r0,r0,2 mtctr r0 beq 58f 72: lwzu r9,4(r4) /* do some words */ stwu r9,4(r6) bdnz 72b 58: srwi. r0,r5,LG_L1_CACHE_LINE_SIZE /* complete cachelines */ clrlwi r5,r5,32-LG_L1_CACHE_LINE_SIZE li r11,4 mtctr r0 beq 63f 53: #if !defined(CONFIG_8xx) dcbz r11,r6 #endif COPY_16_BYTES #if L1_CACHE_LINE_SIZE >= 32 COPY_16_BYTES #if L1_CACHE_LINE_SIZE >= 64 COPY_16_BYTES COPY_16_BYTES #if L1_CACHE_LINE_SIZE >= 128 COPY_16_BYTES COPY_16_BYTES COPY_16_BYTES COPY_16_BYTES #endif #endif #endif bdnz 53b 63: srwi. r0,r5,2 mtctr r0 beq 64f 30: lwzu r0,4(r4) stwu r0,4(r6) bdnz 30b 64: andi. r0,r5,3 mtctr r0 beq+ 65f 40: lbz r0,4(r4) stb r0,4(r6) addi r4,r4,1 addi r6,r6,1 bdnz 40b 65: blr DirectFB-1.2.10/lib/direct/hash.c0000644000175000017500000001521611245562152013255 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Hash, "Direct/Hash", "Hash table implementation" ); #define REMOVED ((void *) -1) typedef struct { unsigned long key; void *value; } Element; struct __D_DirectHash { int magic; int size; int count; int removed; Element *elements; }; /**************************************************************************************************/ static inline int locate_key( const DirectHash *hash, unsigned long key ) { int pos; const Element *element; pos = key % hash->size; element = &hash->elements[pos]; while (element->value) { if (element->value != REMOVED && element->key == key) return pos; if (++pos == hash->size) pos = 0; element = &hash->elements[pos]; } return -1; } /**************************************************************************************************/ DirectResult direct_hash_create( int size, DirectHash **ret_hash ) { DirectHash *hash; if (size < 17) size = 17; D_DEBUG_AT( Direct_Hash, "Creating hash table with initial capacity of %d...\n", size ); hash = D_CALLOC( 1, sizeof (DirectHash) ); if (!hash) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } hash->size = size; hash->elements = D_CALLOC( size, sizeof(Element) ); if (!hash->elements) { D_WARN( "out of memory" ); D_FREE( hash ); return DR_NOLOCALMEMORY; } D_MAGIC_SET( hash, DirectHash ); *ret_hash = hash; return DR_OK; } void direct_hash_destroy( DirectHash *hash ) { D_MAGIC_ASSERT( hash, DirectHash ); D_MAGIC_CLEAR( hash ); D_FREE( hash->elements ); D_FREE( hash ); } DirectResult direct_hash_insert( DirectHash *hash, unsigned long key, void *value ) { int pos; Element *element; D_MAGIC_ASSERT( hash, DirectHash ); D_ASSERT( value != NULL ); /* Need to resize the hash table? */ if ((hash->count + hash->removed) > hash->size / 4) { int i, size = hash->size * 3; Element *elements; D_DEBUG_AT( Direct_Hash, "Resizing from %d to %d... (count %d, removed %d)\n", hash->size, size, hash->count, hash->removed ); elements = D_CALLOC( size, sizeof(Element) ); if (!elements) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } for (i=0; isize; i++) { Element *element = &hash->elements[i]; Element *insertElement; if (element->value && element->value != REMOVED) { pos = element->key % size; insertElement = &elements[pos]; while (insertElement->value && insertElement->value != REMOVED) { if (++pos == size) pos = 0; insertElement = &elements[pos]; } elements[pos] = *element; } } D_FREE( hash->elements ); hash->size = size; hash->elements = elements; hash->removed = 0; } pos = key % hash->size; D_DEBUG_AT( Direct_Hash, "Attempting to insert key 0x%08lx at position %d...\n", key, pos ); element = &hash->elements[pos]; while (element->value && element->value != REMOVED) { if (element->key == key) { D_BUG( "key already exists" ); return DR_BUG; } if (++pos == hash->size) pos = 0; element = &hash->elements[pos]; } if (element->value == REMOVED) hash->removed--; element->key = key; element->value = value; hash->count++; D_DEBUG_AT( Direct_Hash, "...inserted at %d, new count = %d, removed = %d, size = %d, key = 0x%08lx.\n", pos, hash->count, hash->removed, hash->size, key ); return DR_OK; } void direct_hash_remove( DirectHash *hash, unsigned long key ) { int pos; D_MAGIC_ASSERT( hash, DirectHash ); pos = locate_key( hash, key ); if (pos == -1) { D_WARN( "key not found" ); return; } hash->elements[pos].value = REMOVED; hash->count--; hash->removed++; D_DEBUG_AT( Direct_Hash, "Removed key 0x%08lx at %d, new count = %d, removed = %d, size = %d.\n", key, pos, hash->count, hash->removed, hash->size ); } void * direct_hash_lookup( DirectHash *hash, unsigned long key ) { int pos; D_MAGIC_ASSERT( hash, DirectHash ); pos = locate_key( hash, key ); return (pos != -1) ? hash->elements[pos].value : NULL; } void direct_hash_iterate( DirectHash *hash, DirectHashIteratorFunc func, void *ctx ) { int i; D_MAGIC_ASSERT( hash, DirectHash ); for (i=0; isize; i++) { Element *element = &hash->elements[i]; if (!element->value || element->value == REMOVED) continue; if (!func( hash, element->key, element->value, ctx ) ) return; } } DirectFB-1.2.10/lib/direct/ppcasm_memcpy.h0000644000175000017500000000035511164361026015167 00000000000000#ifndef __DIRECT__PPCASM_MEMCPY_H__ #define __DIRECT__PPCASM_MEMCPY_H__ void *direct_ppcasm_cacheable_memcpy( void *dest, const void *src, size_t n); void *direct_ppcasm_memcpy ( void *dest, const void *src, size_t n); #endif DirectFB-1.2.10/lib/direct/modules.h0000644000175000017500000000561311245562152014007 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__MODULES_H__ #define __DIRECT__MODULES_H__ #include #include #include #include struct __D_DirectModuleEntry { DirectLink link; int magic; DirectModuleDir *directory; bool loaded; bool dynamic; bool disabled; char *name; const void *funcs; int refs; char *file; void *handle; }; struct __D_DirectModuleDir { pthread_mutex_t lock; const char *path; unsigned int abi_version; DirectLink *entries; DirectModuleEntry *loading; }; #define DECLARE_MODULE_DIRECTORY(d) \ extern DirectModuleDir d #define DEFINE_MODULE_DIRECTORY(d,p,n) \ DirectModuleDir d = { \ .lock = PTHREAD_MUTEX_INITIALIZER, \ .path = p, \ .abi_version = n, \ .entries = NULL, \ .loading = NULL, \ } int direct_modules_explore_directory( DirectModuleDir *directory ); void direct_modules_register( DirectModuleDir *directory, unsigned int abi_version, const char *name, const void *funcs ); void direct_modules_unregister( DirectModuleDir *directory, const char *name ); const void *direct_module_ref ( DirectModuleEntry *module ); void direct_module_unref( DirectModuleEntry *module ); #endif DirectFB-1.2.10/lib/direct/log.h0000644000175000017500000000532411245562152013117 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__LOG_H__ #define __DIRECT__LOG_H__ #include #include typedef enum { DLT_STDERR, /* Simply print out log on stderr. */ DLT_FILE, /* Write log into a file. */ DLT_UDP /* Send out log via UDP. */ } DirectLogType; /* * Creates a logging facility. * * For each 'type' the 'param' has a different meaning: * DLT_STDERR ignored (leave NULL) * DLT_FILE file name * DLT_UDP : */ DirectResult direct_log_create ( DirectLogType type, const char *param, DirectLog **ret_log ); /* * Destroys a logging facility. */ DirectResult direct_log_destroy ( DirectLog *log ); /* * Write to the log in a printf fashion. * * If log is NULL, the default log is used if it's valid, * otherwise stderr is used a fallback until now. */ DirectResult direct_log_printf ( DirectLog *log, const char *format, ... ) D_FORMAT_PRINTF(2); /* * Set the default log that's used when no valid log is passed. */ DirectResult direct_log_set_default( DirectLog *log ); /* * Locks a logging facility for non-intermixed output of multiple calls in multiple threads. Not mandatory. */ void direct_log_lock ( DirectLog *log ); /* * Unlocks a logging facility. */ void direct_log_unlock ( DirectLog *log ); /* * Returns the default log. */ DirectLog *direct_log_default( void ); #endif DirectFB-1.2.10/lib/direct/stream.c0000644000175000017500000020615511245562152013631 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct __D_DirectStream { int magic; int ref; int fd; unsigned int offset; int length; char *mime; /* cache for piped streams */ void *cache; unsigned int cache_size; #if DIRECT_BUILD_NETWORK /* remote streams data */ struct { int sd; char *host; int port; struct addrinfo *addr; char *user; char *pass; char *auth; char *path; int redirects; void *data; bool real_rtsp; bool real_pack; } remote; #endif DirectResult (*wait) ( DirectStream *stream, unsigned int length, struct timeval *tv ); DirectResult (*peek) ( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ); DirectResult (*read) ( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ); DirectResult (*seek) ( DirectStream *stream, unsigned int offset ); }; static void direct_stream_close( DirectStream *stream ); #if DIRECT_BUILD_NETWORK D_DEBUG_DOMAIN( Direct_Stream, "Direct/Stream", "Stream wrapper" ); #endif /************************** Begin Network Support ***************************/ #if DIRECT_BUILD_NETWORK #define NET_TIMEOUT 15 #define HTTP_PORT 80 #define FTP_PORT 21 #define RTSP_PORT 554 #define HTTP_MAX_REDIRECTS 15 static DirectResult http_open( DirectStream *stream, const char *filename ); static DirectResult ftp_open ( DirectStream *stream, const char *filename ); static DirectResult rtsp_open( DirectStream *stream, const char *filename ); static inline char* trim( char *s ) { char *e; #define space( c ) ((c) == ' ' || (c) == '\t' || \ (c) == '\r' || (c) == '\n' || \ (c) == '"' || (c) == '\'') for (; space(*s); s++); e = s + strlen(s) - 1; for (; e > s && space(*e); *e-- = '\0'); #undef space return s; } static void parse_url( const char *url, char **ret_host, int *ret_port, char **ret_user, char **ret_pass, char **ret_path ) { char *host = NULL; int port = 0; char *user = NULL; char *pass = NULL; char *path; char *tmp; tmp = strchr( url, '/' ); if (tmp) { host = alloca( tmp - url + 1 ); memcpy( host, url, tmp - url ); host[tmp-url] = '\0'; path = tmp; } else { host = alloca( strlen( url ) + 1 ); memcpy( host, url, strlen( url ) + 1 ); path = "/"; } tmp = strrchr( host, '@' ); if (tmp) { *tmp = '\0'; pass = strchr( host, ':' ); if (pass) { *pass = '\0'; pass++; } user = host; host = tmp + 1; } tmp = strchr( host, ':' ); if (tmp) { port = strtol( tmp+1, NULL, 10 ); *tmp = '\0'; } /* IPv6 variant (host within brackets) */ if (*host == '[') { host++; tmp = strchr( host, ']' ); if (tmp) *tmp = '\0'; } if (ret_host) *ret_host = D_STRDUP( host ); if (ret_port && port) *ret_port = port; if (ret_user && user) *ret_user = D_STRDUP( user ); if (ret_pass && pass) *ret_pass = D_STRDUP( pass ); if (ret_path) *ret_path = D_STRDUP( path ); } /*****************************************************************************/ static int net_response( DirectStream *stream, char *buf, size_t size ) { fd_set set; struct timeval tv; int i; FD_ZERO( &set ); FD_SET( stream->remote.sd, &set ); for (i = 0; i < size-1; i++) { tv.tv_sec = NET_TIMEOUT; tv.tv_usec = 0; select( stream->remote.sd+1, &set, NULL, NULL, &tv ); if (recv( stream->remote.sd, buf+i, 1, 0 ) != 1) break; if (buf[i] == '\n') { if (i > 0 && buf[i-1] == '\r') i--; break; } } buf[i] = '\0'; D_DEBUG_AT( Direct_Stream, "got [%s].\n", buf ); return i; } static int net_command( DirectStream *stream, char *buf, size_t size ) { fd_set s; struct timeval t; int status; int version; char space; FD_ZERO( &s ); FD_SET( stream->remote.sd, &s ); t.tv_sec = NET_TIMEOUT; t.tv_usec = 0; switch (select( stream->remote.sd+1, NULL, &s, NULL, &t )) { case 0: D_DEBUG_AT( Direct_Stream, "Timeout!\n" ); case -1: return -1; } send( stream->remote.sd, buf, strlen(buf), 0 ); send( stream->remote.sd, "\r\n", 2, 0 ); D_DEBUG_AT( Direct_Stream, "sent [%s].\n", buf ); while (net_response( stream, buf, size ) > 0) { status = 0; if (sscanf( buf, "HTTP/1.%d %3d", &version, &status ) == 2 || sscanf( buf, "RTSP/1.%d %3d", &version, &status ) == 2 || sscanf( buf, "ICY %3d", &status ) == 1 || sscanf( buf, "%3d%[ ]", &status, &space ) == 2) return status; } return 0; } static DirectResult net_wait( DirectStream *stream, unsigned int length, struct timeval *tv ) { fd_set s; if (stream->cache_size >= length) return DR_OK; if (stream->fd == -1) return DR_EOF; FD_ZERO( &s ); FD_SET( stream->fd, &s ); switch (select( stream->fd+1, &s, NULL, NULL, tv )) { case 0: if (!tv && !stream->cache_size) return DR_EOF; return DR_TIMEOUT; case -1: return errno2result( errno ); } return DR_OK; } static DirectResult net_peek( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ) { char *tmp; int size; if (offset < 0) return DR_UNSUPPORTED; tmp = alloca( length + offset ); size = recv( stream->fd, tmp, length+offset, MSG_PEEK ); switch (size) { case 0: return DR_EOF; case -1: if (errno == EAGAIN || errno == EWOULDBLOCK) return DR_BUFFEREMPTY; return errno2result( errno ); default: if (size < offset) return DR_BUFFEREMPTY; size -= offset; break; } direct_memcpy( buf, tmp+offset, size ); if (read_out) *read_out = size; return DR_OK; } static DirectResult net_read( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ) { int size; size = recv( stream->fd, buf, length, 0 ); switch (size) { case 0: return DR_EOF; case -1: if (errno == EAGAIN || errno == EWOULDBLOCK) return DR_BUFFEREMPTY; return errno2result( errno ); } stream->offset += size; if (read_out) *read_out = size; return DR_OK; } static DirectResult net_connect( struct addrinfo *addr, int sock, int proto, int *ret_fd ) { DirectResult ret = DR_OK; int fd = -1; struct addrinfo *tmp; D_ASSERT( addr != NULL ); D_ASSERT( ret_fd != NULL ); for (tmp = addr; tmp; tmp = tmp->ai_next) { int err; fd = socket( tmp->ai_family, sock, proto ); if (fd < 0) { ret = errno2result( errno ); D_DEBUG_AT( Direct_Stream, "failed to create socket!\n\t->%s", strerror(errno) ); continue; } fcntl( fd, F_SETFL, fcntl( fd, F_GETFL ) | O_NONBLOCK ); D_DEBUG_AT( Direct_Stream, "connecting to %s...\n", tmp->ai_canonname ); if (proto == IPPROTO_UDP) err = bind( fd, tmp->ai_addr, tmp->ai_addrlen ); else err = connect( fd, tmp->ai_addr, tmp->ai_addrlen ); if (err == 0 || errno == EINPROGRESS) { struct timeval t = { NET_TIMEOUT, 0 }; fd_set s; /* Join multicast group? */ if (tmp->ai_addr->sa_family == AF_INET) { struct sockaddr_in *saddr = (struct sockaddr_in *) tmp->ai_addr; if (IN_MULTICAST( ntohl(saddr->sin_addr.s_addr) )) { struct ip_mreq req; D_DEBUG_AT( Direct_Stream, "joining multicast group (%u.%u.%u.%u)...\n", (u8)tmp->ai_addr->sa_data[2], (u8)tmp->ai_addr->sa_data[3], (u8)tmp->ai_addr->sa_data[4], (u8)tmp->ai_addr->sa_data[5] ); req.imr_multiaddr.s_addr = saddr->sin_addr.s_addr; req.imr_interface.s_addr = 0; err = setsockopt( fd, SOL_IP, IP_ADD_MEMBERSHIP, &req, sizeof(req) ); if (err < 0) { ret = errno2result( errno ); D_PERROR( "Direct/Stream: Could not join multicast group (%u.%u.%u.%u)!\n", (u8)tmp->ai_addr->sa_data[2], (u8)tmp->ai_addr->sa_data[3], (u8)tmp->ai_addr->sa_data[4], (u8)tmp->ai_addr->sa_data[5] ); close( fd ); continue; } setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, saddr, sizeof(*saddr) ); } } FD_ZERO( &s ); FD_SET( fd, &s ); err = select( fd+1, NULL, &s, NULL, &t ); if (err < 1) { D_DEBUG_AT( Direct_Stream, "...connection failed.\n" ); close( fd ); fd = -1; if (err == 0) { ret = DR_TIMEOUT; continue; } else { ret = errno2result( errno ); break; } } D_DEBUG_AT( Direct_Stream, "...connected.\n" ); ret = DR_OK; break; } } *ret_fd = fd; return ret; } static DirectResult net_open( DirectStream *stream, const char *filename, int proto ) { DirectResult ret = DR_OK; int sock = (proto == IPPROTO_TCP) ? SOCK_STREAM : SOCK_DGRAM; struct addrinfo hints; char port[16]; parse_url( filename, &stream->remote.host, &stream->remote.port, &stream->remote.user, &stream->remote.pass, &stream->remote.path ); snprintf( port, sizeof(port), "%d", stream->remote.port ); memset( &hints, 0, sizeof(hints) ); hints.ai_flags = AI_CANONNAME; hints.ai_socktype = sock; hints.ai_family = PF_UNSPEC; if (getaddrinfo( stream->remote.host, port, &hints, &stream->remote.addr )) { D_ERROR( "Direct/Stream: " "failed to resolve host '%s'!\n", stream->remote.host ); return DR_FAILURE; } ret = net_connect( stream->remote.addr, sock, proto, &stream->remote.sd ); if (ret) return ret; stream->fd = stream->remote.sd; stream->length = -1; stream->wait = net_wait; stream->peek = net_peek; stream->read = net_read; return ret; } /*****************************************************************************/ static DirectResult http_seek( DirectStream *stream, unsigned int offset ) { DirectResult ret; char buf[1280]; int status, len; close( stream->remote.sd ); stream->remote.sd = -1; ret = net_connect( stream->remote.addr, SOCK_STREAM, IPPROTO_TCP, &stream->remote.sd ); if (ret) return ret; stream->fd = stream->remote.sd; len = snprintf( buf, sizeof(buf), "GET %s HTTP/1.0\r\n" "Host: %s:%d\r\n", stream->remote.path, stream->remote.host, stream->remote.port ); if (stream->remote.auth) { len += snprintf( buf+len, sizeof(buf)-len, "Authorization: Basic %s\r\n", stream->remote.auth ); } snprintf( buf+len, sizeof(buf)-len, "User-Agent: DirectFB/%s\r\n" "Accept: */*\r\n" "Range: bytes=%d-\r\n" "Connection: Close\r\n", DIRECTFB_VERSION, offset ); status = net_command( stream, buf, sizeof(buf) ); switch (status) { case 200 ... 299: stream->offset = offset; break; default: if (status) D_DEBUG_AT( Direct_Stream, "server returned status %d.\n", status ); return DR_FAILURE; } /* discard remaining headers */ while (net_response( stream, buf, sizeof(buf) ) > 0); return DR_OK; } static DirectResult http_open( DirectStream *stream, const char *filename ) { DirectResult ret; char buf[1280]; int status, len; stream->remote.port = HTTP_PORT; ret = net_open( stream, filename, IPPROTO_TCP ); if (ret) return ret; if (stream->remote.user) { char *tmp; if (stream->remote.pass) { tmp = alloca( strlen( stream->remote.user ) + strlen( stream->remote.pass ) + 2 ); len = sprintf( tmp, "%s:%s", stream->remote.user, stream->remote.pass ); } else { tmp = alloca( strlen( stream->remote.user ) + 2 ); len = sprintf( tmp, "%s:", stream->remote.user ); } stream->remote.auth = direct_base64_encode( tmp, len ); } len = snprintf( buf, sizeof(buf), "GET %s HTTP/1.0\r\n" "Host: %s:%d\r\n", stream->remote.path, stream->remote.host, stream->remote.port ); if (stream->remote.auth) { len += snprintf( buf+len, sizeof(buf)-len, "Authorization: Basic %s\r\n", stream->remote.auth ); } snprintf( buf+len, sizeof(buf)-len, "User-Agent: DirectFB/%s\r\n" "Accept: */*\r\n" "Connection: Close\r\n", DIRECTFB_VERSION ); status = net_command( stream, buf, sizeof(buf) ); while (net_response( stream, buf, sizeof(buf) ) > 0) { if (!strncasecmp( buf, "Accept-Ranges:", 14 )) { if (strcmp( trim( buf+14 ), "none" )) stream->seek = http_seek; } else if (!strncasecmp( buf, "Content-Type:", 13 )) { char *mime = trim( buf+13 ); char *tmp = strchr( mime, ';' ); if (tmp) *tmp = '\0'; if (stream->mime) D_FREE( stream->mime ); stream->mime = D_STRDUP( mime ); } else if (!strncasecmp( buf, "Content-Length:", 15 )) { char *tmp = trim( buf+15 ); if (sscanf( tmp, "%d", &stream->length ) < 1) sscanf( tmp, "bytes=%d", &stream->length ); } else if (!strncasecmp( buf, "Location:", 9 )) { direct_stream_close( stream ); stream->seek = NULL; if (++stream->remote.redirects > HTTP_MAX_REDIRECTS) { D_ERROR( "Direct/Stream: " "reached maximum number of redirects (%d).\n", HTTP_MAX_REDIRECTS ); return DR_LIMITEXCEEDED; } filename = trim( buf+9 ); if (!strncmp( filename, "http://", 7 )) return http_open( stream, filename+7 ); if (!strncmp( filename, "ftp://", 6 )) return ftp_open( stream, filename+6 ); if (!strncmp( filename, "rtsp://", 7 )) return rtsp_open( stream, filename+7 ); return DR_UNSUPPORTED; } } switch (status) { case 200 ... 299: break; default: if (status) D_DEBUG_AT( Direct_Stream, "server returned status %d.\n", status ); return (status == 404) ? DR_FILENOTFOUND : DR_FAILURE; } return DR_OK; } /*****************************************************************************/ static DirectResult ftp_open_pasv( DirectStream *stream, char *buf, size_t size ) { DirectResult ret; int i, len; snprintf( buf, size, "PASV" ); if (net_command( stream, buf, size ) != 227) return DR_FAILURE; /* parse IP and port for passive mode */ for (i = 4; buf[i]; i++) { unsigned int d[6]; if (sscanf( &buf[i], "%u,%u,%u,%u,%u,%u", &d[0], &d[1], &d[2], &d[3], &d[4], &d[5] ) == 6) { struct addrinfo hints, *addr; /* address */ len = snprintf( buf, size, "%u.%u.%u.%u", d[0], d[1], d[2], d[3] ); /* port */ snprintf( buf+len+1, size-len-1, "%u", ((d[4] & 0xff) << 8) | (d[5] & 0xff) ); memset( &hints, 0, sizeof(hints) ); hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; hints.ai_family = PF_UNSPEC; if (getaddrinfo( buf, buf+len+1, &hints, &addr )) { D_DEBUG_AT( Direct_Stream, "failed to resolve host '%s'.\n", buf ); return DR_FAILURE; } ret = net_connect( addr, SOCK_STREAM, IPPROTO_TCP, &stream->fd ); freeaddrinfo( addr ); return ret; } } return DR_FAILURE; } static DirectResult ftp_seek( DirectStream *stream, unsigned int offset ) { DirectResult ret = DR_OK; char buf[512]; if (stream->fd > 0) { int status; close( stream->fd ); stream->fd = -1; /* ignore response */ while (net_response( stream, buf, sizeof(buf) ) > 0) { if (sscanf( buf, "%3d%[ ]", &status, buf ) == 2) break; } } ret = ftp_open_pasv( stream, buf, sizeof(buf) ); if (ret) return ret; snprintf( buf, sizeof(buf), "REST %d", offset ); if (net_command( stream, buf, sizeof(buf) ) != 350) goto error; snprintf( buf, sizeof(buf), "RETR %s", stream->remote.path ); switch (net_command( stream, buf, sizeof(buf) )) { case 150: case 125: break; default: goto error; } stream->offset = offset; return DR_OK; error: close( stream->fd ); stream->fd = -1; return DR_FAILURE; } static DirectResult ftp_open( DirectStream *stream, const char *filename ) { DirectResult ret; int status = 0; char buf[512]; stream->remote.port = FTP_PORT; ret = net_open( stream, filename, IPPROTO_TCP ); if (ret) return ret; while (net_response( stream, buf, sizeof(buf) ) > 0) { if (sscanf( buf, "%3d%[ ]", &status, buf ) == 2) break; } if (status != 220) return DR_FAILURE; /* login */ snprintf( buf, sizeof(buf), "USER %s", stream->remote.user ? : "anonymous" ); switch (net_command( stream, buf, sizeof(buf) )) { case 230: case 331: break; default: return DR_FAILURE; } if (stream->remote.pass) { snprintf( buf, sizeof(buf), "PASS %s", stream->remote.pass ); if (net_command( stream, buf, sizeof(buf) ) != 230) return DR_FAILURE; } /* enter binary mode */ snprintf( buf, sizeof(buf), "TYPE I" ); if (net_command( stream, buf, sizeof(buf) ) != 200) return DR_FAILURE; /* get file size */ snprintf( buf, sizeof(buf), "SIZE %s", stream->remote.path ); if (net_command( stream, buf, sizeof(buf) ) == 213) stream->length = strtol( buf+4, NULL, 10 ); /* enter passive mode by default */ ret = ftp_open_pasv( stream, buf, sizeof(buf) ); if (ret) return ret; /* retrieve file */ snprintf( buf, sizeof(buf), "RETR %s", stream->remote.path ); switch (net_command( stream, buf, sizeof(buf) )) { case 125: case 150: break; default: return DR_FAILURE; } stream->seek = ftp_seek; return DR_OK; } /*****************************************************************************/ typedef struct { s8 pt; // payload type (-1: dymanic) u8 type; // codec type const char *name; const char *mime; u32 fcc; } RTPPayload; typedef struct { char *control; int pt; const RTPPayload *payload; int dur; // duration int abr; // avg bitrate int mbr; // max bitrate int aps; // avg packet size int mps; // max packet size int str; // start time int prl; // preroll char *mime; int mime_size; void *data; int data_size; } SDPStreamDesc; #define PAYLOAD_VIDEO 1 #define PAYLOAD_AUDIO 2 #define FCC( a, b, c, d ) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24)) static const RTPPayload payloads[] = { { 31, PAYLOAD_VIDEO, "H261", "video/h261", FCC('H','2','6','1') }, { 34, PAYLOAD_VIDEO, "H263", "video/h263", FCC('H','2','6','3') }, //{ -1, PAYLOAD_VIDEO, "H264", "video/h264", FCC('H','2','6','4') }, { 32, PAYLOAD_VIDEO, "MPV", "video/mpeg", FCC('M','P','E','G') }, { 33, 0, "MP2T", "video/mpegts", 0 }, { -1, PAYLOAD_VIDEO, "MP4V-ES", "video/mpeg4", FCC('M','P','4','S') }, { 14, PAYLOAD_AUDIO, "MPA", "audio/mpeg", 0x0055 }, //{ -1, PAYLOAD_AUDIO, "mpeg4-generic", "audio/aac", 0x00ff }, }; #define NUM_PAYLOADS D_ARRAY_SIZE( payloads ) static DirectResult sdp_parse( DirectStream *stream, int length, SDPStreamDesc **ret_streams, int *ret_num ) { char *buf, *tmp; SDPStreamDesc *desc = NULL; int num = 0; fd_set set; struct timeval tv; int i; buf = D_CALLOC( 1, length+1 ); if (!buf) return D_OOM(); FD_ZERO( &set ); FD_SET( stream->remote.sd, &set ); for (tmp = buf; length;) { int size; tv.tv_sec = NET_TIMEOUT; tv.tv_usec = 0; select( stream->remote.sd+1, &set, NULL, NULL, &tv ); size = recv( stream->remote.sd, tmp, length, MSG_WAITALL ); if (size < 1) break; tmp += size; length -= size; } for (tmp = buf; tmp && *tmp;) { char *end; end = strchr( tmp, '\n' ); if (end) { if (end > tmp && *(end-1) == '\r') *(end-1) = '\0'; *end = '\0'; } D_DEBUG_AT( Direct_Stream, "SDP [%s]\n", tmp ); switch (*tmp) { case 'm': /* media */ if (*(tmp+1) == '=') { desc = D_REALLOC( desc, ++num*sizeof(SDPStreamDesc) ); memset( &desc[num-1], 0, sizeof(SDPStreamDesc) ); tmp += 2; if (sscanf( tmp, "audio %d RTP/AVP %d", &i, &desc[num-1].pt ) == 2 || sscanf( tmp, "video %d RTP/AVP %d", &i, &desc[num-1].pt ) == 2) { for (i = 0; i < NUM_PAYLOADS; i++) { if (desc[num-1].pt == payloads[i].pt) { desc[num-1].payload = &payloads[i]; desc[num-1].mime = D_STRDUP( payloads[i].mime ); desc[num-1].mime_size = strlen( payloads[i].mime ); break; } } } } break; case 'a': /* attribute */ if (*(tmp+1) == '=' && num) { tmp += 2; if (!strncmp( tmp, "control:", 8 )) { desc[num-1].control = D_STRDUP( trim( tmp+8 ) ); } else if (!strncmp( tmp, "rtpmap:", 7 )) { if (!desc[num-1].payload && desc[num-1].pt) { char *sep; tmp = strchr( trim( tmp+7 ), ' ' ); if (!tmp) break; sep = strchr( ++tmp, '/' ); if (sep) *sep = '\0'; for (i = 0; i < NUM_PAYLOADS; i++) { if (strcmp( tmp, payloads[i].name )) continue; desc[num-1].payload = &payloads[i]; desc[num-1].mime = D_STRDUP( payloads[i].mime ); desc[num-1].mime_size = strlen( payloads[i].mime ); break; } } } else if (!strncmp( tmp, "length:npt=", 11 )) { double val = atof( tmp+11 ); desc[num-1].dur = val * 1000.0; } else if (!strncmp( tmp, "mimetype:string;", 16 )) { if (desc[num-1].mime) D_FREE( desc[num-1].mime ); desc[num-1].mime = D_STRDUP( trim( tmp+16 ) ); desc[num-1].mime_size = strlen( desc[num-1].mime ); } else if (!strncmp( tmp, "AvgBitRate:", 11 )) { sscanf( tmp+11, "integer;%d", &desc[num-1].abr ); } else if (!strncmp( tmp, "MaxBitRate:", 11 )) { sscanf( tmp+11, "integer;%d", &desc[num-1].mbr ); } else if (!strncmp( tmp, "AvgPacketSize:", 14 )) { sscanf( tmp+14, "integer;%d", &desc[num-1].aps ); } else if (!strncmp( tmp, "MaxPacketSize:", 14 )) { sscanf( tmp+14, "integer;%d", &desc[num-1].mps ); } else if (!strncmp( tmp, "StartTime:", 10 )) { sscanf( tmp+10, "integer;%d", &desc[num-1].str ); } else if (!strncmp( tmp, "Preroll:", 8 )) { sscanf( tmp+8, "integer;%d", &desc[num-1].prl ); } else if (!strncmp( tmp, "OpaqueData:buffer;", 18 )) { desc[num-1].data = direct_base64_decode( trim( tmp+18 ), &desc[num-1].data_size ); } } break; default: break; } tmp = end; if (tmp) tmp++; } D_FREE( buf ); *ret_streams = desc; *ret_num = num; return desc ? DR_OK : DR_EOF; } static void sdp_free( SDPStreamDesc *streams, int num ) { int i; for (i = 0; i < num; i++) { if (streams[i].control) D_FREE( streams[i].control ); if (streams[i].mime) D_FREE( streams[i].mime ); if (streams[i].data) D_FREE( streams[i].data ); } D_FREE( streams ); } static DirectResult rmf_write_header( SDPStreamDesc *streams, int n_streams, void **ret_buf, unsigned int *ret_size ) { unsigned char *dst, *tmp; int abr = 0; int mbr = 0; int aps = 0; int mps = 0; int str = 0; int prl = 0; int dur = 0; int i, len; len = 86 + n_streams*46; for (i = 0; i < n_streams; i++) { abr += streams[i].abr; aps += streams[i].aps; if (mbr < streams[i].mbr) mbr = streams[i].mbr; if (mps < streams[i].mps) mps = streams[i].mps; if (dur < streams[i].dur) dur = streams[i].dur; if (streams[i].mime) len += streams[i].mime_size; if (streams[i].data) len += streams[i].data_size; else if (streams[i].payload) len += 74; } *ret_buf = dst = D_MALLOC( len ); if (!dst) return D_OOM(); *ret_size = len; /* RMF */ dst[0] = '.'; dst[1] = 'R', dst[2] = 'M'; dst[3] = 'F'; dst[4] = dst[5] = dst[6] = 0; dst[7] = 18; // size dst[8] = dst[9] = 0; // version dst[10] = dst[11] = dst[12] = dst[13] = 0; // ?? dst[14] = dst[15] = dst[16] = 0; dst[17] = 4+n_streams; // num streams dst += 18; /* PROP */ dst[0] = 'P'; dst[1] = 'R'; dst[2] = 'O'; dst[3] = 'P'; dst[4] = dst[5] = dst[6] = 0; dst[7] = 50; dst[8] = dst[9] = 0; dst[10] = mbr>>24; dst[11] = mbr>>16; dst[12] = mbr>>8; dst[13] = mbr; dst[14] = abr>>24; dst[15] = abr>>16; dst[16] = abr>>8; dst[17] = abr; dst[18] = mps>>24; dst[19] = mps>>16; dst[20] = mps>>8; dst[21] = mps; dst[22] = aps>>24; dst[23] = aps>>16; dst[24] = aps>>8; dst[25] = aps; dst[26] = dst[27] = dst[28] = dst[29] = 0; // num packets dst[30] = dur>>24; dst[31] = dur>>16; dst[32] = dur>>8; dst[33] = dur; dst[34] = dst[35] = dst[36] = dst[37] = 0; // preroll dst[38] = dst[39] = dst[40] = dst[41] = 0; // index offset dst[42] = len>>24; dst[43] = len>>16; dst[44] = len>>8; dst[45] = len; dst[46] = 0; dst[47] = n_streams; // num streams dst[48] = 0; dst[49] = 7; // flags dst += 50; for (i = 0; i < n_streams; i++) { len = 46 + streams[i].mime_size; if (streams[i].data) len += streams[i].data_size; else if (streams[i].payload) len += 74; abr = streams[i].abr; mbr = streams[i].mbr; aps = streams[i].aps; mps = streams[i].mps; str = streams[i].str; prl = streams[i].prl; dur = streams[i].dur; /* MDPR */ dst[0] = 'M'; dst[1] = 'D'; dst[2] = 'P'; dst[3] = 'R'; dst[4] = len>>24; dst[5] = len>>16; dst[6] = len>>8; dst[7] = len; dst[8] = dst[9] = 0; dst[10] = 0; dst[11] = i; dst[12] = mbr>>24; dst[13] = mbr>>16; dst[14] = mbr>>8; dst[15] = mbr; dst[16] = abr>>24; dst[17] = abr>>16; dst[18] = abr>>8; dst[19] = abr; dst[20] = mps>>24; dst[21] = mps>>16; dst[22] = mps>>8; dst[23] = mps; dst[24] = aps>>24; dst[25] = aps>>16; dst[26] = aps>>8; dst[27] = aps; dst[28] = str>>24; dst[29] = str>>16; dst[30] = str>>8; dst[31] = str; dst[32] = prl>>24; dst[33] = prl>>16; dst[34] = prl>>8; dst[35] = prl; dst[36] = dur>>24; dst[37] = dur>>16; dst[38] = dur>>8; dst[39] = dur; dst += 40; /* description */ *dst++ = 0; /* mimetype */ *dst++ = streams[i].mime_size; for (tmp = (unsigned char*)streams[i].mime; tmp && *tmp;) *dst++ = *tmp++; /* codec data */ if (streams[i].data) { len = streams[i].data_size; dst[0] = len>>24; dst[1] = len>>16; dst[2] = len>>8; dst[3] = len; direct_memcpy( dst+4, streams[i].data, streams[i].data_size ); dst += len+4; } else if (streams[i].payload) { u32 fcc = streams[i].payload->fcc; dst[0] = dst[1] = dst[2] = 0; dst[3] = 74; dst += 4; memset( dst, 0, 74 ); if (streams[i].payload->type == PAYLOAD_AUDIO) { dst[0] = '.'; dst[1] = 'r'; dst[2] = 'a'; dst[3] = 0xfd; dst[4] = 0; dst[5] = 5; // version dst[66] = fcc; dst[67] = fcc>>8; dst[68] = fcc>>16; dst[69] = fcc>>24; } else { dst[0] = dst[1] = dst[2] = 0; dst[3] = 34; dst[4] = 'V'; dst[5] = 'I'; dst[6] = 'D'; dst[7] = 'O'; dst[8] = fcc; dst[9] = fcc>>8; dst[10] = fcc>>16; dst[11] = fcc>>24; dst[30] = 0x10; } dst += 74; } else { dst[0] = dst[1] = dst[2] = dst[3] = 0; dst += 4; } } /* DATA */ dst[0] = 'D'; dst[1] = 'A'; dst[2] = 'T'; dst[3] = 'A'; dst[4] = dst[5] = dst[6] = 0; dst[7] = 18; // size dst[8] = dst[9] = 0; // version dst[10] = dst[11] = dst[12] = dst[13] = 0; // num packets dst[14] = dst[15] = dst[16] = dst[17] = 0; // next data return DR_OK; } static int rmf_write_pheader( unsigned char *dst, int id, int sz, unsigned int ts ) { /* version */ dst[0] = dst[1] = 0; /* length */ dst[2] = (sz+12)>>8; dst[3] = sz+12; /* indentifier */ dst[4] = id>>8; dst[5] = id; /* timestamp */ dst[6] = ts>>24; dst[7] = ts>>16; dst[8] = ts>>8; dst[9] = ts; /* reserved */ dst[10] = 0; /* flags */ dst[11] = 0; return 12; } static void real_calc_challenge2( char response[64], char checksum[32], char *challenge ) { const unsigned char xor_table[37] = { 0x05, 0x18, 0x74, 0xd0, 0x0d, 0x09, 0x02, 0x53, 0xc0, 0x01, 0x05, 0x05, 0x67, 0x03, 0x19, 0x70, 0x08, 0x27, 0x66, 0x10, 0x10, 0x72, 0x08, 0x09, 0x63, 0x11, 0x03, 0x71, 0x08, 0x08, 0x70, 0x02, 0x10, 0x57, 0x05, 0x18, 0x54 }; char buf[128]; char md5[16]; int len; int i; memset( response, 0, 64 ); memset( checksum, 0, 32 ); buf[0] = 0xa1; buf[1] = 0xe9; buf[2] = 0x14; buf[3] = 0x9d; buf[4] = 0x0e; buf[5] = 0x6b; buf[6] = 0x3b; buf[7] = 0x59; memset( buf+8, 0, 120 ); len = strlen( challenge ); if (len == 40) { challenge[32] = '\0'; len = 32; } memcpy( buf+8, challenge, MAX(len,56) ); for (i = 0; i < 37; i++) buf[8+i] ^= xor_table[i]; /* compute response */ direct_md5_sum( md5, buf, 64 ); /* convert to ascii */ for (i = 0; i < 16; i++) { char a, b; a = (md5[i] >> 4) & 15; b = md5[i] & 15; response[i*2+0] = ((a < 10) ? (a + 48) : (a + 87)) & 255; response[i*2+1] = ((b < 10) ? (b + 48) : (b + 87)) & 255; } /* tail */ len = strlen( response ); direct_snputs( &response[len], "01d0a8e3", 64-len ); /* compute checksum */ for (i = 0; i < len/4; i++) checksum[i] = response[i*4]; } static DirectResult rtsp_session_open( DirectStream *stream ) { DirectResult ret; int status; int cseq = 0; SDPStreamDesc *streams = NULL; int n_streams = 0; char session[32] = {0, }; char challen[64] = {0, }; char buf[1280]; int i, len; snprintf( buf, sizeof(buf), "OPTIONS rtsp://%s:%d RTSP/1.0\r\n" "CSeq: %d\r\n" "User-Agent: DirectFB/%s\r\n" "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n" "PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n" "CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n" "GUID: 00000000-0000-0000-0000-000000000000\r\n" "RegionData: 0\r\n", stream->remote.host, stream->remote.port, ++cseq, DIRECTFB_VERSION ); if (net_command( stream, buf, sizeof(buf) ) != 200) return DR_FAILURE; while (net_response( stream, buf, sizeof(buf) ) > 0) { if (!strncmp( buf, "RealChallenge1:", 15 )) { snprintf( challen, sizeof(challen), "%s", trim( buf+15 ) ); stream->remote.real_rtsp = true; } } len = snprintf( buf, sizeof(buf), "DESCRIBE rtsp://%s:%d%s RTSP/1.0\r\n" "CSeq: %d\r\n" "Accept: application/sdp\r\n" "Bandwidth: 10485800\r\n", stream->remote.host, stream->remote.port, stream->remote.path, ++cseq ); if (stream->remote.real_rtsp) { snprintf( buf+len, sizeof(buf)-len, "GUID: 00000000-0000-0000-0000-000000000000\r\n" "RegionData: 0\r\n" "ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586\r\n" "SupportsMaximumASMBandwidth: 1\r\n" "Require: com.real.retain-entity-for-setup\r\n" ); } status = net_command( stream, buf, sizeof(buf) ); if (status != 200) return (status == 404) ? DR_FILENOTFOUND : DR_FAILURE; len = 0; while (net_response( stream, buf, sizeof(buf) ) > 0) { if (!strncasecmp( buf, "ETag:", 5 )) { snprintf( session, sizeof(session), "%s", trim( buf+5 ) ); } else if (!strncasecmp( buf, "Content-Length:", 15 )) { char *tmp = trim( buf+15 ); if (sscanf( tmp, "%d", &len ) != 1) sscanf( tmp, "bytes=%d", &len ); } } if (!len) { D_DEBUG_AT( Direct_Stream, "Couldn't get sdp length!\n" ); return DR_FAILURE; } ret = sdp_parse( stream, len, &streams, &n_streams ); if (ret) return ret; for (i = 0; i < n_streams; i++) { /* skip unhandled payload types */ if (!stream->remote.real_rtsp && !streams[i].payload) continue; len = snprintf( buf, sizeof(buf), "SETUP rtsp://%s:%d%s/%s RTSP/1.0\r\n" "CSeq: %d\r\n", stream->remote.host, stream->remote.port, stream->remote.path, streams[i].control, ++cseq ); if (*session) { if (*challen) { char response[64]; char checksum[32]; real_calc_challenge2( response, checksum, challen ); len += snprintf( buf+len, sizeof(buf)-len, "RealChallenge2: %s, sd=%s\r\n", response, checksum ); *challen = '\0'; } len += snprintf( buf+len, sizeof(buf)-len, "%s: %s\r\n", i ? "Session" : "If-Match", session ); } snprintf( buf+len, sizeof(buf)-len, "Transport: %s\r\n", stream->remote.real_rtsp ? "x-pn-tng/tcp;mode=play,rtp/avp/tcp;unicast;mode=play" : "RTP/AVP/TCP;unicast" ); if (net_command( stream, buf, sizeof(buf) ) != 200) { sdp_free( streams, n_streams ); return DR_FAILURE; } while (net_response( stream, buf, sizeof(buf) ) > 0) { if (!strncmp( buf, "Session:", 8 )) snprintf( session, sizeof(session), "%s", trim( buf+8 ) ); } } len = snprintf( buf, sizeof(buf), "PLAY rtsp://%s:%d%s RTSP/1.0\r\n" "CSeq: %d\r\n", stream->remote.host, stream->remote.port, stream->remote.path, ++cseq ); if (*session) { len += snprintf( buf+len, sizeof(buf)-len, "Session: %s\r\n", session ); } snprintf( buf+len, sizeof(buf)-len, "Range: npt=0-\r\n" "Connection: Close\r\n" ); if (net_command( stream, buf, sizeof(buf) ) != 200) { sdp_free( streams, n_streams ); return DR_FAILURE; } /* discard remaining headers */ while (net_response( stream, buf, sizeof(buf) ) > 0); /* revert to blocking mode */ fcntl( stream->fd, F_SETFL, fcntl( stream->fd, F_GETFL ) & ~O_NONBLOCK ); if (!stream->remote.real_rtsp) { RTPPayload *p; stream->remote.data = D_CALLOC( 1, (n_streams+1)*sizeof(RTPPayload) ); if (!stream->remote.data) { sdp_free( streams, n_streams ); return D_OOM(); } p = (RTPPayload*) stream->remote.data; for (i = 0; i < n_streams; i++) { if (streams[i].payload) { *p = *(streams[i].payload); p->pt = streams[i].pt; p++; } } } stream->remote.real_pack = true; if (n_streams == 1 && streams[0].mime) { if (!strcmp( streams[0].mime, "audio/mpeg" ) || !strcmp( streams[0].mime, "audio/aac" ) || !strcmp( streams[0].mime, "video/mpeg" ) || !strcmp( streams[0].mime, "video/mpegts" )) { stream->mime = D_STRDUP( streams[0].mime ); stream->remote.real_pack = false; } } if (stream->remote.real_pack) { ret = rmf_write_header( streams, n_streams, &stream->cache, &stream->cache_size ); if (ret) { sdp_free( streams, n_streams ); return ret; } stream->mime = D_STRDUP( "application/vnd.rn-realmedia" ); } sdp_free( streams, n_streams ); return DR_OK; } static DirectResult rvp_read_packet( DirectStream *stream ) { unsigned char buf[9]; int size; int len; unsigned char id; unsigned int ts; while (1) { do { size = recv( stream->fd, buf, 1, MSG_WAITALL ); if (size < 1) return DR_EOF; } while (buf[0] != '$'); size = recv( stream->fd, buf, 7, MSG_WAITALL ); if (size < 7) return DR_EOF; len = (buf[0] << 16) + (buf[1] << 8) + buf[2]; id = buf[3]; if (id != 0x40 && id != 0x42) { if (buf[5] == 0x06) // EOS return DR_EOF; size = recv( stream->fd, buf, 9, MSG_WAITALL ); if (size < 9) return DR_EOF; id = buf[5]; len -= 9; } id = (id >> 1) & 1; size = recv( stream->fd, buf, 6, MSG_WAITALL ); if (size < 6) return DR_EOF; ts = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; len -= 10; if (len > 0) { unsigned char *dst; size = len + 12; stream->cache = D_REALLOC( stream->cache, stream->cache_size+size ); if (!stream->cache) return D_OOM(); dst = stream->cache+stream->cache_size; stream->cache_size += size; dst += rmf_write_pheader( dst, id, len, ts ); while (len) { size = recv( stream->fd, dst, len, MSG_WAITALL ); if (size < 1) return DR_EOF; dst += size; len -= size; } break; } } return DR_OK; } static DirectResult rtp_read_packet( DirectStream *stream ) { RTPPayload *payloads = (RTPPayload*)stream->remote.data; unsigned char buf[12]; int size; int len; unsigned char id; unsigned short seq; unsigned int ts; int skip; while (1) { RTPPayload *p; do { size = recv( stream->fd, buf, 1, MSG_WAITALL ); if (size < 1) return DR_EOF; } while (buf[0] != '$'); size = recv( stream->fd, buf, 3, MSG_WAITALL ); if (size < 3) return DR_EOF; id = buf[0]; len = (buf[1] << 8) | buf[2]; if (len < 12) continue; size = recv( stream->fd, buf, 12, MSG_WAITALL ); if (size < 12) return DR_EOF; len -= 12; if ((buf[0] & 0xc0) != (2 << 6)) D_DEBUG_AT( Direct_Stream, "Bad RTP version %d!\n", buf[0] ); seq = (buf[2] << 8) | buf[3]; ts = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]; for (p = payloads; p->pt; p++) { if (p->pt == (buf[1] & 0x7f)) break; } switch (p->pt) { case 0: // Unhandled skip = len; break; case 14: // MPEG Audio skip = 4; break; case 32: // MPEG Video size = recv( stream->fd, buf, 1, MSG_WAITALL ); if (size < 1) return DR_EOF; len--; skip = 3; if (buf[0] & (1 << 2)) skip += 4; break; case 34: // H263 size = recv( stream->fd, buf, 1, MSG_WAITALL ); if (size < 1) return DR_EOF; len--; skip = 3; if (buf[0] & (1 << 7)) skip += 4; if (buf[0] & (1 << 6)) skip += 4; break; default: skip = 0; break; } while (skip) { size = recv( stream->fd, buf, MIN(skip,12), MSG_WAITALL ); if (size < 1) return DR_EOF; len -= size; skip -= size; } if (len > 0) { unsigned char *dst; size = len; if (stream->remote.real_pack) { size += 12; if (p->type == PAYLOAD_VIDEO) size += 7; } stream->cache = D_REALLOC( stream->cache, stream->cache_size+size ); if (!stream->cache) return D_OOM(); dst = stream->cache+stream->cache_size; stream->cache_size += size; if (stream->remote.real_pack) { if (p->type == PAYLOAD_VIDEO) { dst += rmf_write_pheader( dst, id, len+7, ts ); dst[0] = 0x81; dst[1] = 0x01; dst[2] = (len | 0x4000)>>8; dst[3] = len; dst[4] = (len | 0x4000)>>8; dst[5] = len; dst[6] = seq; dst += 7; } else { dst += rmf_write_pheader( dst, id, len, ts ); } } while (len) { size = recv( stream->fd, dst, len, MSG_WAITALL ); if (size < 1) return DR_EOF; dst += size; len -= size; } break; } } return DR_OK; } static DirectResult rtsp_peek( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ) { DirectResult ret; unsigned int len; if (offset < 0) return DR_UNSUPPORTED; len = length + offset; while (len > stream->cache_size) { ret = (stream->remote.real_rtsp) ? rvp_read_packet( stream ) : rtp_read_packet( stream ); if (ret) { if (stream->cache_size < offset) return ret; break; } } len = MIN( stream->cache_size-offset, length ); direct_memcpy( buf, stream->cache+offset, len ); if (read_out) *read_out = len; return DR_OK; } static DirectResult rtsp_read( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ) { DirectResult ret; unsigned int size = 0; while (size < length) { if (stream->cache_size) { unsigned int len = MIN( stream->cache_size, length-size ); direct_memcpy( buf+size, stream->cache, len ); size += len; stream->cache_size -= len; if (stream->cache_size) { direct_memcpy( stream->cache, stream->cache+len, stream->cache_size ); } else { D_FREE( stream->cache ); stream->cache = NULL; } } if (size < length) { ret = (stream->remote.real_rtsp) ? rvp_read_packet( stream ) : rtp_read_packet( stream ); if (ret) { if (!size) return ret; break; } } } stream->offset += size; if (read_out) *read_out = size; return DR_OK; } static DirectResult rtsp_open( DirectStream *stream, const char *filename ) { DirectResult ret; stream->remote.port = RTSP_PORT; ret = net_open( stream, filename, IPPROTO_TCP ); if (ret) return ret; ret = rtsp_session_open( stream ); if (ret) { close( stream->remote.sd ); return ret; } stream->peek = rtsp_peek; stream->read = rtsp_read; return DR_OK; } #endif /* DIRECT_BUILD_NETWORK */ /************************** End of Network Support ***************************/ static DirectResult pipe_wait( DirectStream *stream, unsigned int length, struct timeval *tv ) { fd_set s; if (stream->cache_size >= length) return DR_OK; FD_ZERO( &s ); FD_SET( stream->fd, &s ); switch (select( stream->fd+1, &s, NULL, NULL, tv )) { case 0: if (!tv && !stream->cache_size) return DR_EOF; return DR_TIMEOUT; case -1: return errno2result( errno ); } return DR_OK; } static DirectResult pipe_peek( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ) { unsigned int size = length; int len; if (offset < 0) return DR_UNSUPPORTED; len = length + offset; if (len > stream->cache_size) { ssize_t s; stream->cache = D_REALLOC( stream->cache, len ); if (!stream->cache) { stream->cache_size = 0; return D_OOM(); } s = read( stream->fd, stream->cache + stream->cache_size, len - stream->cache_size ); if (s < 0) { if (errno != EAGAIN || stream->cache_size == 0) return errno2result( errno ); s = 0; } stream->cache_size += s; if (stream->cache_size <= offset) return DR_BUFFEREMPTY; size = stream->cache_size - offset; } direct_memcpy( buf, stream->cache+offset, size ); if (read_out) *read_out = size; return DR_OK; } static DirectResult pipe_read( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ) { unsigned int size = 0; if (stream->cache_size) { size = MIN( stream->cache_size, length ); direct_memcpy( buf, stream->cache, size ); length -= size; stream->cache_size -= size; if (stream->cache_size) { direct_memcpy( stream->cache, stream->cache+size, stream->cache_size ); } else { D_FREE( stream->cache ); stream->cache = NULL; } } if (length) { ssize_t s; s = read( stream->fd, buf+size, length-size ); switch (s) { case 0: if (!size) return DR_EOF; break; case -1: if (!size) { return (errno == EAGAIN) ? DR_BUFFEREMPTY : errno2result( errno ); } break; default: size += s; break; } } stream->offset += size; if (read_out) *read_out = size; return DR_OK; } /*****************************************************************************/ static DirectResult file_peek( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ) { DirectResult ret = DR_OK; ssize_t size; if (lseek( stream->fd, offset, SEEK_CUR ) < 0) return DR_FAILURE; size = read( stream->fd, buf, length ); switch (size) { case 0: ret = DR_EOF; break; case -1: ret = (errno == EAGAIN) ? DR_BUFFEREMPTY : errno2result( errno ); size = 0; break; } if (lseek( stream->fd, - offset - size, SEEK_CUR ) < 0) return DR_FAILURE; if (read_out) *read_out = size; return ret; } static DirectResult file_read( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ) { ssize_t size; size = read( stream->fd, buf, length ); switch (size) { case 0: return DR_EOF; case -1: if (errno == EAGAIN) return DR_BUFFEREMPTY; return errno2result( errno ); } stream->offset += size; if (read_out) *read_out = size; return DR_OK; } static DirectResult file_seek( DirectStream *stream, unsigned int offset ) { off_t off; off = lseek( stream->fd, offset, SEEK_SET ); if (off < 0) return DR_FAILURE; stream->offset = off; return DR_OK; } static DirectResult file_open( DirectStream *stream, const char *filename, int fileno ) { if (filename) stream->fd = open( filename, O_RDONLY | O_NONBLOCK ); else stream->fd = dup( fileno ); if (stream->fd < 0) return errno2result( errno ); fcntl( stream->fd, F_SETFL, fcntl( stream->fd, F_GETFL ) | O_NONBLOCK ); if (lseek( stream->fd, 0, SEEK_CUR ) < 0 && errno == ESPIPE) { stream->length = -1; stream->wait = pipe_wait; stream->peek = pipe_peek; stream->read = pipe_read; } else { struct stat s; if (fstat( stream->fd, &s ) < 0) return errno2result( errno ); stream->length = s.st_size; stream->peek = file_peek; stream->read = file_read; stream->seek = file_seek; } return DR_OK; } /*****************************************************************************/ DirectResult direct_stream_create( const char *filename, DirectStream **ret_stream ) { DirectStream *stream; DirectResult ret; D_ASSERT( filename != NULL ); D_ASSERT( ret_stream != NULL ); stream = D_CALLOC( 1, sizeof(DirectStream) ); if (!stream) return D_OOM(); D_MAGIC_SET( stream, DirectStream ); stream->ref = 1; stream->fd = -1; if (!strncmp( filename, "stdin:/", 7 )) { ret = file_open( stream, NULL, STDIN_FILENO ); } else if (!strncmp( filename, "file:/", 6 )) { ret = file_open( stream, filename+6, -1 ); } else if (!strncmp( filename, "fd:/", 4 )) { ret = (filename[4] >= '0' && filename[4] <= '9') ? file_open( stream, NULL, atoi(filename+4) ) : DR_INVARG; } #if DIRECT_BUILD_NETWORK else if (!strncmp( filename, "http://", 7 ) || !strncmp( filename, "unsv://", 7 )) { ret = http_open( stream, filename+7 ); } else if (!strncmp( filename, "ftp://", 6 )) { ret = ftp_open( stream, filename+6 ); } else if (!strncmp( filename, "rtsp://", 7 )) { ret = rtsp_open( stream, filename+7 ); } else if (!strncmp( filename, "tcp://", 6 )) { ret = net_open( stream, filename+6, IPPROTO_TCP ); } else if (!strncmp( filename, "udp://", 6 )) { ret = net_open( stream, filename+6, IPPROTO_UDP ); } #endif else { ret = file_open( stream, filename, -1 ); } if (ret) { direct_stream_close( stream ); D_FREE( stream ); return ret; } *ret_stream = stream; return DR_OK; } DirectStream* direct_stream_dup( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); stream->ref++; return stream; } int direct_stream_fileno( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); return stream->fd; } bool direct_stream_seekable( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); return stream->seek ? true : false; } bool direct_stream_remote( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); #if DIRECT_BUILD_NETWORK if (stream->remote.host) return true; #endif return false; } const char* direct_stream_mime( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); return stream->mime; } unsigned int direct_stream_offset( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); return stream->offset; } unsigned int direct_stream_length( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); return (stream->length >= 0) ? stream->length : stream->offset; } DirectResult direct_stream_wait( DirectStream *stream, unsigned int length, struct timeval *tv ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); if (length && stream->wait) return stream->wait( stream, length, tv ); return DR_OK; } DirectResult direct_stream_peek( DirectStream *stream, unsigned int length, int offset, void *buf, unsigned int *read_out ) { D_ASSERT( stream != NULL ); D_ASSERT( length != 0 ); D_ASSERT( buf != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); if (stream->length >= 0 && (stream->offset + offset) >= stream->length) return DR_EOF; if (stream->peek) return stream->peek( stream, length, offset, buf, read_out ); return DR_UNSUPPORTED; } DirectResult direct_stream_read( DirectStream *stream, unsigned int length, void *buf, unsigned int *read_out ) { D_ASSERT( stream != NULL ); D_ASSERT( length != 0 ); D_ASSERT( buf != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); if (stream->length >= 0 && stream->offset >= stream->length) return DR_EOF; if (stream->read) return stream->read( stream, length, buf, read_out ); return DR_UNSUPPORTED; } DirectResult direct_stream_seek( DirectStream *stream, unsigned int offset ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); if (stream->offset == offset) return DR_OK; if (stream->length >= 0 && offset > stream->length) offset = stream->length; if (stream->seek) return stream->seek( stream, offset ); return DR_UNSUPPORTED; } static void direct_stream_close( DirectStream *stream ) { #if DIRECT_BUILD_NETWORK if (stream->remote.host) { D_FREE( stream->remote.host ); stream->remote.host = NULL; } if (stream->remote.user) { D_FREE( stream->remote.user ); stream->remote.user = NULL; } if (stream->remote.pass) { D_FREE( stream->remote.pass ); stream->remote.pass = NULL; } if (stream->remote.auth) { D_FREE( stream->remote.auth ); stream->remote.auth = NULL; } if (stream->remote.path) { D_FREE( stream->remote.path ); stream->remote.path = NULL; } if (stream->remote.addr) { freeaddrinfo( stream->remote.addr ); stream->remote.addr = NULL; } if (stream->remote.data) { D_FREE( stream->remote.data ); stream->remote.data = NULL; } if (stream->remote.sd > 0) { close( stream->remote.sd ); stream->remote.sd = -1; } #endif if (stream->mime) { D_FREE( stream->mime ); stream->mime = NULL; } if (stream->cache) { D_FREE( stream->cache ); stream->cache = NULL; stream->cache_size = 0; } if (stream->fd >= 0) { fcntl( stream->fd, F_SETFL, fcntl( stream->fd, F_GETFL ) & ~O_NONBLOCK ); close( stream->fd ); stream->fd = -1; } } void direct_stream_destroy( DirectStream *stream ) { D_ASSERT( stream != NULL ); D_MAGIC_ASSERT( stream, DirectStream ); if (--stream->ref == 0) { direct_stream_close( stream ); D_FREE( stream ); } } DirectFB-1.2.10/lib/direct/mem.h0000644000175000017500000000535311245562152013116 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__MEM_H__ #define __DIRECT__MEM_H__ #include #include void direct_print_memleaks( void ); void direct_free ( const char *file, int line, const char *func, const char *what, void *mem ); void *direct_malloc ( const char *file, int line, const char *func, size_t bytes ); void *direct_calloc ( const char *file, int line, const char *func, size_t count, size_t bytes); void *direct_realloc( const char *file, int line, const char *func, const char *what, void *mem, size_t bytes ); char *direct_strdup ( const char *file, int line, const char *func, const char *string ); #if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #if !DIRECT_BUILD_DEBUGS #warning Building with debug, but library headers suggest that debug is not supported. #endif #define D_FREE(mem) direct_free( __FILE__, __LINE__, __FUNCTION__, #mem, mem ) #define D_MALLOC(bytes) direct_malloc( __FILE__, __LINE__, __FUNCTION__, bytes ) #define D_CALLOC(count,bytes) direct_calloc( __FILE__, __LINE__, __FUNCTION__, count, bytes ) #define D_REALLOC(mem,bytes) direct_realloc( __FILE__, __LINE__, __FUNCTION__, #mem, mem, bytes ) #define D_STRDUP(string) direct_strdup( __FILE__, __LINE__, __FUNCTION__, string ) #else #include #include #define D_FREE free #define D_MALLOC malloc #define D_CALLOC calloc #define D_REALLOC realloc #define D_STRDUP strdup #endif #endif DirectFB-1.2.10/lib/direct/memcpy.h0000644000175000017500000000332611245562152013630 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__MEMCPY_H__ #define __DIRECT__MEMCPY_H__ #include #include void direct_find_best_memcpy( void ); void direct_print_memcpy_routines( void ); extern void *(*direct_memcpy)( void *to, const void *from, size_t len ); static __inline__ void *direct_memmove( void *to, const void *from, size_t len ) { if ((from < to && ((const char*) from + len) < ((char*) to)) || (((char*) to + len) < ((const char*) from))) return direct_memcpy( to, from, len ); else return memmove( to, from, len ); } #endif DirectFB-1.2.10/lib/direct/build.h.in0000644000175000017500000000340711164361026014037 00000000000000/* (c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2002-2004 convergence GmbH. All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann and Ville Syrjl . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__BUILD_H__ #define __DIRECT__BUILD_H__ #define DIRECT_BUILD_DEBUG (@DIRECT_BUILD_DEBUG@) #define DIRECT_BUILD_DEBUGS (@DIRECT_BUILD_DEBUGS@) #define DIRECT_BUILD_TRACE (@DIRECT_BUILD_TRACE@) #define DIRECT_BUILD_TEXT (@DIRECT_BUILD_TEXT@) #define DIRECT_BUILD_GETTID (@DIRECT_BUILD_GETTID@) #define DIRECT_BUILD_NETWORK (@DIRECT_BUILD_NETWORK@) #define DIRECT_BUILD_STDBOOL (@DIRECT_BUILD_STDBOOL@) #if !DIRECT_BUILD_DEBUGS #if defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #define DIRECT_MINI_DEBUG #endif #undef DIRECT_ENABLE_DEBUG #ifdef DIRECT_FORCE_DEBUG #warning DIRECT_FORCE_DEBUG used with 'pure release' library headers. #undef DIRECT_FORCE_DEBUG #endif #endif #endif DirectFB-1.2.10/lib/direct/trace.h0000644000175000017500000000557511245562152013444 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__TRACE_H__ #define __DIRECT__TRACE_H__ #include /*********************************************************************************************************************** ** Symbols */ /* * Returns filename on success or NULL. * * Stores load address of object in 'ret_base' on success. */ const char *direct_trace_lookup_file ( void *address, void **ret_base ); /* * Look up a symbol by filename and offset. * * Returns symbol name on success or NULL. */ const char *direct_trace_lookup_symbol( const char *filename, long offset ); /* * Convenience function combining direct_trace_lookup_file() and direct_trace_lookup_symbol(). */ static inline const char * direct_trace_lookup_symbol_at( void *address ) { void *base; const char *filename; filename = direct_trace_lookup_file( address, &base ); return direct_trace_lookup_symbol( filename, (unsigned long) address - (unsigned long) base ); } /*********************************************************************************************************************** ** Stacks */ /* * Print stack in 'buffer' or current if NULL. */ void direct_trace_print_stack( DirectTraceBuffer *buffer ); /* * Print stack of each known thread. */ void direct_trace_print_stacks( void ); /* * Returns indent level for debug output. */ int direct_trace_debug_indent( void ); /* * Create a copy of a stack in 'buffer' or of current if NULL. */ DirectTraceBuffer *direct_trace_copy_buffer( DirectTraceBuffer *buffer ); /* * Free a (copied) stack buffer. */ void direct_trace_free_buffer( DirectTraceBuffer *buffer ); #endif DirectFB-1.2.10/lib/direct/memcpy.c0000644000175000017500000001571711245562152013632 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . Fast memcpy code was taken from xine (see below). This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #if defined (ARCH_PPC) || (SIZEOF_LONG == 8) # define RUN_BENCHMARK 1 #else # define RUN_BENCHMARK 0 #endif #if RUN_BENCHMARK D_DEBUG_DOMAIN( Direct_Memcpy, "Direct/Memcpy", "Direct's Memcpy Routines" ); #endif #ifdef USE_PPCASM #include "ppcasm_memcpy.h" #endif #if SIZEOF_LONG == 8 static void * generic64_memcpy( void * to, const void * from, size_t len ) { register u8 *d = (u8*)to; register const u8 *s = (const u8*)from; size_t n; if (len >= 128) { unsigned long delta; /* Align destination to 8-byte boundary */ delta = (unsigned long)d & 7; if (delta) { len -= 8 - delta; if ((unsigned long)d & 1) { *d++ = *s++; } if ((unsigned long)d & 2) { *((u16*)d) = *((const u16*)s); d += 2; s += 2; } if ((unsigned long)d & 4) { *((u32*)d) = *((const u32*)s); d += 4; s += 4; } } n = len >> 6; len &= 63; for (; n; n--) { ((u64*)d)[0] = ((const u64*)s)[0]; ((u64*)d)[1] = ((const u64*)s)[1]; ((u64*)d)[2] = ((const u64*)s)[2]; ((u64*)d)[3] = ((const u64*)s)[3]; ((u64*)d)[4] = ((const u64*)s)[4]; ((u64*)d)[5] = ((const u64*)s)[5]; ((u64*)d)[6] = ((const u64*)s)[6]; ((u64*)d)[7] = ((const u64*)s)[7]; d += 64; s += 64; } } /* * Now do the tail of the block */ if (len) { n = len >> 3; for (; n; n--) { *((u64*)d) = *((const u64*)s); d += 8; s += 8; } if (len & 4) { *((u32*)d) = *((const u32*)s); d += 4; s += 4; } if (len & 2) { *((u16*)d) = *((const u16*)s); d += 2; s += 2; } if (len & 1) *d = *s; } return to; } #endif /* SIZEOF_LONG == 8 */ typedef void* (*memcpy_func)(void *to, const void *from, size_t len); static struct { char *name; char *desc; memcpy_func function; unsigned long long time; u32 cpu_require; } memcpy_method[] = { { NULL, NULL, NULL, 0, 0}, { "libc", "libc memcpy()", (memcpy_func) memcpy, 0, 0}, #if SIZEOF_LONG == 8 { "generic64","Generic 64bit memcpy()", generic64_memcpy, 0, 0}, #endif /* SIZEOF_LONG == 8 */ #ifdef USE_PPCASM { "ppc", "ppcasm_memcpy()", direct_ppcasm_memcpy, 0, 0}, #ifdef __LINUX__ { "ppccache", "ppcasm_cacheable_memcpy()", direct_ppcasm_cacheable_memcpy, 0, 0}, #endif /* __LINUX__ */ #endif /* USE_PPCASM */ { NULL, NULL, NULL, 0, 0} }; static inline unsigned long long int rdtsc( void ) { struct timeval tv; gettimeofday (&tv, NULL); return (tv.tv_sec * 1000000 + tv.tv_usec); } memcpy_func direct_memcpy = (memcpy_func) memcpy; #define BUFSIZE 1024 void direct_find_best_memcpy( void ) { /* Save library size and startup time on platforms without a special memcpy() implementation. */ #if RUN_BENCHMARK unsigned long long t; char *buf1, *buf2; int i, j, best = 0; u32 config_flags = 0; if (direct_config->memcpy) { for (i=1; memcpy_method[i].name; i++) { if (!strcmp( direct_config->memcpy, memcpy_method[i].name )) { if (memcpy_method[i].cpu_require & ~config_flags) break; direct_memcpy = memcpy_method[i].function; D_INFO( "Direct/Memcpy: Forced to use %s\n", memcpy_method[i].desc ); return; } } } if (!(buf1 = D_MALLOC( BUFSIZE * 500 ))) return; if (!(buf2 = D_MALLOC( BUFSIZE * 500 ))) { D_FREE( buf1 ); return; } D_DEBUG_AT( Direct_Memcpy, "Benchmarking memcpy methods (smaller is better):\n"); /* make sure buffers are present on physical memory */ memcpy( buf1, buf2, BUFSIZE * 500 ); memcpy( buf2, buf1, BUFSIZE * 500 ); for (i=1; memcpy_method[i].name; i++) { if (memcpy_method[i].cpu_require & ~config_flags) continue; t = rdtsc(); for (j=0; j<500; j++) memcpy_method[i].function( buf1 + j*BUFSIZE, buf2 + j*BUFSIZE, BUFSIZE ); t = rdtsc() - t; memcpy_method[i].time = t; D_DEBUG_AT( Direct_Memcpy, "\t%-10s %20lld\n", memcpy_method[i].name, t ); if (best == 0 || t < memcpy_method[best].time) best = i; } if (best) { direct_memcpy = memcpy_method[best].function; D_INFO( "Direct/Memcpy: Using %s\n", memcpy_method[best].desc ); } D_FREE( buf1 ); D_FREE( buf2 ); #endif } void direct_print_memcpy_routines( void ) { int i; u32 config_flags = 0; direct_log_printf( NULL, "\nPossible values for memcpy option are:\n\n" ); for (i=1; memcpy_method[i].name; i++) { bool unsupported = (memcpy_method[i].cpu_require & ~config_flags); direct_log_printf( NULL, " %-10s %-27s %s\n", memcpy_method[i].name, memcpy_method[i].desc, unsupported ? "" : "supported" ); } direct_log_printf( NULL, "\n" ); } DirectFB-1.2.10/lib/direct/interface.c0000644000175000017500000003242611245562152014274 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifndef USE_KOS #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef PIC #define DYNAMIC_LINKING #endif D_DEBUG_DOMAIN( Direct_Interface, "Direct/Interface", "Direct Interface" ); typedef struct { DirectLink link; int magic; char *filename; void *module_handle; DirectInterfaceFuncs *funcs; const char *type; const char *implementation; int references; } DirectInterfaceImplementation; static pthread_mutex_t implementations_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; static DirectLink *implementations = NULL; /**************************************************************************************************/ void DirectRegisterInterface( DirectInterfaceFuncs *funcs ) { DirectInterfaceImplementation *impl; D_DEBUG_AT( Direct_Interface, "%s( %p )\n", __FUNCTION__, funcs ); impl = D_CALLOC( 1, sizeof(DirectInterfaceImplementation) ); impl->funcs = funcs; impl->type = funcs->GetType(); impl->implementation = funcs->GetImplementation(); D_MAGIC_SET( impl, DirectInterfaceImplementation ); D_DEBUG_AT( Direct_Interface, " -> %s | %s\n", impl->type, impl->implementation ); pthread_mutex_lock( &implementations_mutex ); direct_list_prepend( &implementations, &impl->link ); pthread_mutex_unlock( &implementations_mutex ); } void DirectUnregisterInterface( DirectInterfaceFuncs *funcs ) { DirectInterfaceImplementation *impl; pthread_mutex_lock( &implementations_mutex ); direct_list_foreach (impl, implementations) { D_MAGIC_ASSERT( impl, DirectInterfaceImplementation ); if (impl->funcs == funcs) { direct_list_remove( &implementations, &impl->link ); break; } } pthread_mutex_unlock( &implementations_mutex ); if (!impl) { D_BUG( "implementation not found" ); return; } D_MAGIC_CLEAR( impl ); D_FREE( impl ); } DirectResult DirectProbeInterface( DirectInterfaceFuncs *funcs, void *ctx ) { return (funcs->Probe( ctx ) == DR_OK); } DirectResult DirectGetInterface( DirectInterfaceFuncs **funcs, const char *type, const char *implementation, DirectInterfaceProbeFunc probe, void *probe_ctx ) { #ifdef DYNAMIC_LINKING int len; DIR *dir; char *interface_dir; struct dirent *entry = NULL; struct dirent tmp; const char *path; #endif DirectLink *link; D_DEBUG_AT( Direct_Interface, "%s( %p, '%s', '%s', %p, %p )\n", __FUNCTION__, funcs, type, implementation, probe, probe_ctx ); pthread_mutex_lock( &implementations_mutex ); /* * Check existing implementations first. */ direct_list_foreach( link, implementations ) { DirectInterfaceImplementation *impl = (DirectInterfaceImplementation*) link; if (type && strcmp( type, impl->type )) continue; if (implementation && strcmp( implementation, impl->implementation )) continue; D_DEBUG_AT( Direct_Interface, " -> Probing '%s'...\n", impl->implementation ); if (probe && !probe( impl->funcs, probe_ctx )) continue; else { if (!impl->references) { D_INFO( "Direct/Interface: Using '%s' implementation of '%s'.\n", impl->implementation, impl->type ); } *funcs = impl->funcs; impl->references++; pthread_mutex_unlock( &implementations_mutex ); return DR_OK; } } #ifdef DYNAMIC_LINKING /* * Try to load it dynamically. */ /* NULL type means we can't find plugin, so stop immediately */ if (type == NULL) return DR_NOIMPL; path = direct_config->module_dir; if(!path) path = MODULEDIR; len = strlen(path) + strlen("/interfaces/") + strlen(type) + 1; interface_dir = alloca( len ); snprintf( interface_dir, len, "%s%sinterfaces/%s", path, (path[strlen(path)-1]=='/') ? "" : "/", type ); dir = opendir( interface_dir ); if (!dir) { D_DEBUG( "Could not open interface directory `%s'!\n", interface_dir ); pthread_mutex_unlock( &implementations_mutex ); return errno2result( errno ); } /* * Iterate directory. */ while (readdir_r( dir, &tmp, &entry ) == 0 && entry) { void *handle = NULL; char buf[4096]; DirectInterfaceImplementation *old_impl = (DirectInterfaceImplementation*) implementations; if (strlen(entry->d_name) < 4 || entry->d_name[strlen(entry->d_name)-1] != 'o' || entry->d_name[strlen(entry->d_name)-2] != 's') continue; snprintf( buf, 4096, "%s/%s", interface_dir, entry->d_name ); /* * Check if it got already loaded. */ direct_list_foreach( link, implementations ) { DirectInterfaceImplementation *impl = (DirectInterfaceImplementation*) link; if (impl->filename && !strcmp( impl->filename, buf )) { handle = impl->module_handle; break; } } /* * If already loaded take the next one. */ if (handle) continue; /* * Open it and check. */ handle = dlopen( buf, RTLD_NOW ); if (handle) { DirectInterfaceImplementation *impl = (DirectInterfaceImplementation*) implementations; /* * Check if it registered itself. */ if (impl == old_impl) { dlclose( handle ); continue; } /* * Keep filename and module handle. */ impl->filename = D_STRDUP( buf ); impl->module_handle = handle; /* * Almost the same stuff like above, TODO: make function. */ if (strcmp( type, impl->type )) continue; if (implementation && strcmp( implementation, impl->implementation )) continue; if (probe && !probe( impl->funcs, probe_ctx )) { continue; } else { D_INFO( "Direct/Interface: Loaded '%s' implementation of '%s'.\n", impl->implementation, impl->type ); *funcs = impl->funcs; impl->references++; closedir( dir ); pthread_mutex_unlock( &implementations_mutex ); return DR_OK; } } else D_DLERROR( "Direct/Interface: Unable to dlopen `%s'!\n", buf ); } closedir( dir ); pthread_mutex_unlock( &implementations_mutex ); #endif return DR_NOIMPL; } /**************************************************************************************************/ #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ typedef struct { const void *interface; char *name; char *what; const char *func; const char *file; int line; DirectTraceBuffer *trace; } InterfaceDesc; static int alloc_count = 0; static int alloc_capacity = 0; static InterfaceDesc *alloc_list = NULL; static pthread_mutex_t alloc_lock = PTHREAD_MUTEX_INITIALIZER; /**************************************************************************************************/ void direct_print_interface_leaks( void ) { unsigned int i; pthread_mutex_lock( &alloc_lock ); if (alloc_count /*&& (!direct_config || direct_config->debug)*/) { direct_log_printf( NULL, "Interface instances remaining (%d): \n", alloc_count ); for (i=0; iname, desc->interface, desc->what, desc->func, desc->file, desc->line ); if (desc->trace) direct_trace_print_stack( desc->trace ); } } pthread_mutex_unlock( &alloc_lock ); } /**************************************************************************************************/ static InterfaceDesc * allocate_interface_desc( void ) { int cap = alloc_capacity; if (!cap) cap = 64; else if (cap == alloc_count) cap <<= 1; if (cap != alloc_capacity) { alloc_capacity = cap; alloc_list = realloc( alloc_list, sizeof(InterfaceDesc) * cap ); D_ASSERT( alloc_list != NULL ); } return &alloc_list[alloc_count++]; } static inline void fill_interface_desc( InterfaceDesc *desc, const void *interface, const char *name, const char *func, const char *file, int line, const char *what, DirectTraceBuffer *trace ) { desc->interface = interface; desc->name = strdup( name ); desc->what = strdup( what ); desc->func = func; desc->file = file; desc->line = line; desc->trace = trace; } /**************************************************************************************************/ __attribute__((no_instrument_function)) void direct_dbg_interface_add( const char *func, const char *file, int line, const char *what, const void *interface, const char *name ) { InterfaceDesc *desc; pthread_mutex_lock( &alloc_lock ); desc = allocate_interface_desc(); fill_interface_desc( desc, interface, name, func, file, line, what, direct_trace_copy_buffer(NULL) ); pthread_mutex_unlock( &alloc_lock ); } __attribute__((no_instrument_function)) void direct_dbg_interface_remove( const char *func, const char *file, int line, const char *what, const void *interface ) { unsigned int i; pthread_mutex_lock( &alloc_lock ); for (i=0; iinterface == interface) { if (desc->trace) direct_trace_free_buffer( desc->trace ); free( desc->what ); free( desc->name ); if (i < --alloc_count) direct_memmove( desc, desc + 1, (alloc_count - i) * sizeof(InterfaceDesc) ); pthread_mutex_unlock( &alloc_lock ); return; } } pthread_mutex_unlock( &alloc_lock ); D_ERROR( "Direct/Interface: unknown instance %p (%s) from [%s:%d in %s()]\n", interface, what, file, line, func ); D_BREAK( "unknown instance" ); } #else /* DIRECT_BUILD_DEBUG */ void direct_print_interface_leaks( void ) { } #endif /* DIRECT_BUILD_DEBUG */ DirectFB-1.2.10/lib/direct/debug.h0000644000175000017500000002653111245562152013427 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__DEBUG_H__ #define __DIRECT__DEBUG_H__ #include #include #include #include #include #include #include #include #include #include #include typedef struct { unsigned int age; bool enabled; bool registered; const char *name; const char *description; int name_len; } DirectDebugDomain; void direct_debug_config_domain( const char *name, bool enable ); #if DIRECT_BUILD_TEXT #define D_DEBUG_DOMAIN(identifier,name,description) \ static DirectDebugDomain identifier __attribute__((unused)) \ = { 0, false, false, name, description, sizeof(name) - 1 } void direct_debug_at_always( DirectDebugDomain *domain, const char *format, ... ) D_FORMAT_PRINTF(2); #define d_debug_at( domain, x... ) direct_debug_at_always( &domain, x ) #if DIRECT_BUILD_DEBUGS void direct_debug( const char *format, ... ) D_FORMAT_PRINTF(1); void direct_debug_at( DirectDebugDomain *domain, const char *format, ... ) D_FORMAT_PRINTF(2); void direct_debug_enter( DirectDebugDomain *domain, const char *func, const char *file, int line, const char *format, ... ) D_FORMAT_PRINTF(5); void direct_debug_exit( DirectDebugDomain *domain, const char *func, const char *file, int line, const char *format, ... ) D_FORMAT_PRINTF(5); void direct_break( const char *func, const char *file, int line, const char *format, ... ) D_FORMAT_PRINTF(4); void direct_assertion( const char *exp, const char *func, const char *file, int line ); void direct_assumption( const char *exp, const char *func, const char *file, int line ); #endif #if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #define D_DEBUG_ENABLED (1) #define D_DEBUG(x...) \ do { \ if (!direct_config || direct_config->debug) \ direct_debug( x ); \ } while (0) #define D_DEBUG_AT(d,x...) \ do { \ direct_debug_at( &d, x ); \ } while (0) #define D_DEBUG_ENTER(d,x...) \ do { \ direct_debug_enter( &d, __FUNCTION__, __FILE__, __LINE__, x ); \ } while (0) #define D_DEBUG_EXIT(d,x...) \ do { \ direct_debug_exit( &d, __FUNCTION__, __FILE__, __LINE__, x ); \ } while (0) #define D_ASSERT(exp) \ do { \ if (!(exp)) \ direct_assertion( #exp, __FUNCTION__, __FILE__, __LINE__ ); \ } while (0) #define D_ASSUME(exp) \ do { \ if (!(exp)) \ direct_assumption( #exp, __FUNCTION__, __FILE__, __LINE__ ); \ } while (0) #define D_BREAK(x...) \ do { \ direct_break( __FUNCTION__, __FILE__, __LINE__, x ); \ } while (0) #elif defined(DIRECT_MINI_DEBUG) /* * Mini debug mode, only D_DEBUG_AT, no domain filters, simple assertion */ #define D_DEBUG_ENABLED (2) #define D_DEBUG_AT(d,x...) \ do { \ if (direct_config->debug) direct_debug_at_always( &d, x ); \ } while (0) #define D_CHECK(exp, aa) \ do { \ if (!(exp)) { \ long long millis = direct_clock_get_millis(); \ const char *name = direct_thread_self_name(); \ \ direct_log_printf( NULL, \ "(!) [%-15s %3lld.%03lld] (%5d) *** " #aa " [%s] failed *** [%s:%d in %s()]\n", \ name ? name : " NO NAME ", millis / 1000LL, millis % 1000LL, \ direct_gettid(), #exp, __FILE__, __LINE__, __FUNCTION__ ); \ \ direct_trace_print_stack( NULL ); \ } \ } while (0) #define D_ASSERT(exp) D_CHECK(exp, Assertion) #define D_ASSUME(exp) D_CHECK(exp, Assumption) #endif /* MINI_DEBUG / DIRECT_BUILD_DEBUG || DIRECT_ENABLE_DEBUG || DIRECT_FORCE_DEBUG */ #endif /* DIRECT_BUILD_TEXT */ /* * Fallback definitions, e.g. without DIRECT_BUILD_TEXT or DIRECT_ENABLE_DEBUG */ #ifndef D_DEBUG_ENABLED #define D_DEBUG_ENABLED (0) #endif #ifndef D_DEBUG #define D_DEBUG(x...) do {} while (0) #endif #ifndef D_DEBUG_AT #define D_DEBUG_AT(d,x...) do {} while (0) #endif #ifndef D_DEBUG_ENTER #define D_DEBUG_ENTER(d,x...) do {} while (0) #endif #ifndef D_DEBUG_EXIT #define D_DEBUG_EXIT(d,x...) do {} while (0) #endif #ifndef D_ASSERT #define D_ASSERT(exp) do {} while (0) #endif #ifndef D_ASSUME #define D_ASSUME(exp) do {} while (0) #endif #ifndef D_BREAK #define D_BREAK(x...) do {} while (0) #endif #ifndef d_debug_at #define d_debug_at( domain, x... ) do {} while (0) #endif #ifndef D_DEBUG_DOMAIN #define D_DEBUG_DOMAIN(i,n,d) #endif /* * Magic Assertions & Utilities */ #define D_MAGIC(spell) ( (((spell)[sizeof(spell)*8/9] << 24) | \ ((spell)[sizeof(spell)*7/9] << 16) | \ ((spell)[sizeof(spell)*6/9] << 8) | \ ((spell)[sizeof(spell)*5/9] )) ^ \ (((spell)[sizeof(spell)*4/9] << 24) | \ ((spell)[sizeof(spell)*3/9] << 16) | \ ((spell)[sizeof(spell)*2/9] << 8) | \ ((spell)[sizeof(spell)*1/9] )) ) #define D_MAGIC_SET(o,m) do { \ D_ASSERT( (o) != NULL ); \ D_ASSUME( (o)->magic != D_MAGIC(#m) ); \ \ (o)->magic = D_MAGIC(#m); \ } while (0) #define D_MAGIC_SET_ONLY(o,m) do { \ D_ASSERT( (o) != NULL ); \ \ (o)->magic = D_MAGIC(#m); \ } while (0) #define D_MAGIC_ASSERT(o,m) do { \ D_ASSERT( (o) != NULL ); \ D_ASSERT( (o)->magic == D_MAGIC(#m) ); \ } while (0) #define D_MAGIC_ASSUME(o,m) do { \ D_ASSUME( (o) != NULL ); \ if (o) \ D_ASSUME( (o)->magic == D_MAGIC(#m) ); \ } while (0) #define D_MAGIC_ASSERT_IF(o,m) do { \ if (o) \ D_ASSERT( (o)->magic == D_MAGIC(#m) ); \ } while (0) #define D_MAGIC_CLEAR(o) do { \ D_ASSERT( (o) != NULL ); \ D_ASSUME( (o)->magic != 0 ); \ \ (o)->magic = 0; \ } while (0) #endif DirectFB-1.2.10/lib/direct/thread.c0000644000175000017500000005224011245562152013577 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Thread, "Direct/Thread", "Thread management" ); D_DEBUG_DOMAIN( Direct_ThreadInit, "Direct/Thread/Init", "Thread initialization" ); /* FIXME: DIRECT_THREAD_WAIT_INIT is required, but should be optional. */ #define DIRECT_THREAD_WAIT_INIT struct __D_DirectThread { int magic; pthread_t thread; /* The pthread thread identifier. */ pid_t tid; char *name; DirectThreadType type; /* The thread's type, e.g. input thread. */ DirectThreadMainFunc main; /* The thread's main routine (or entry point). */ void *arg; /* Custom argument passed to the main routine. */ bool canceled; /* Set when direct_thread_cancel() is called. */ bool joining; /* Set when direct_thread_join() is called. */ bool joined; /* Set when direct_thread_join() has finished. */ bool detached; /* Set when direct_thread_detach() is called. */ bool terminated; /* Set when direct_thread_terminate() is called. */ #ifdef DIRECT_THREAD_WAIT_INIT bool init; /* Set to true before calling the main routine. */ #endif pthread_mutex_t lock; pthread_cond_t cond; unsigned int counter; }; struct __D_DirectThreadInitHandler { DirectLink link; int magic; DirectThreadInitFunc func; void *arg; }; /******************************************************************************/ /* * Wrapper around pthread's main routine to pass additional arguments * and setup things like signal masks and scheduling priorities. */ static void *direct_thread_main( void *arg ); /******************************************************************************/ static pthread_mutex_t handler_lock = PTHREAD_MUTEX_INITIALIZER; static DirectLink *handlers = NULL; /******************************************************************************/ DirectThreadInitHandler * direct_thread_add_init_handler( DirectThreadInitFunc func, void *arg ) { DirectThreadInitHandler *handler; handler = D_CALLOC( 1, sizeof(DirectThreadInitHandler) ); if (!handler) { D_WARN( "out of memory" ); return NULL; } handler->func = func; handler->arg = arg; D_MAGIC_SET( handler, DirectThreadInitHandler ); pthread_mutex_lock( &handler_lock ); direct_list_append( &handlers, &handler->link ); pthread_mutex_unlock( &handler_lock ); return handler; } void direct_thread_remove_init_handler( DirectThreadInitHandler *handler ) { D_MAGIC_ASSERT( handler, DirectThreadInitHandler ); pthread_mutex_lock( &handler_lock ); direct_list_remove( &handlers, &handler->link ); pthread_mutex_unlock( &handler_lock ); D_MAGIC_CLEAR( handler ); D_FREE( handler ); } /******************************************************************************/ static pthread_mutex_t key_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t thread_key = -1; /******************************************************************************/ DirectThread * direct_thread_create( DirectThreadType thread_type, DirectThreadMainFunc thread_main, void *arg, const char *name ) { DirectThread *thread; pthread_attr_t attr; struct sched_param param; int policy; int priority; size_t stack_size; D_ASSERT( thread_main != NULL ); D_ASSERT( name != NULL ); D_DEBUG_AT( Direct_Thread, "%s( %s, %p(%p), '%s' )\n", __FUNCTION__, direct_thread_type_name(thread_type), thread_main, arg, name ); /* Create the key for the TSD (thread specific data). */ pthread_mutex_lock( &key_lock ); if (thread_key == -1) pthread_key_create( &thread_key, NULL ); pthread_mutex_unlock( &key_lock ); /* Allocate thread structure. */ thread = D_CALLOC( 1, sizeof(DirectThread) ); if (!thread) { D_OOM(); return NULL; } /* Write thread information to structure. */ thread->name = D_STRDUP( name ); thread->type = thread_type; thread->main = thread_main; thread->arg = arg; /* Initialize to -1 for synchronization. */ thread->thread = (pthread_t) -1; thread->tid = (pid_t) -1; /* Initialize mutex and condition. */ direct_util_recursive_pthread_mutex_init( &thread->lock ); pthread_cond_init( &thread->cond, NULL ); D_MAGIC_SET( thread, DirectThread ); /* Initialize scheduling and other parameters. */ pthread_attr_init( &attr ); pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); /* Select scheduler. */ switch (direct_config->thread_scheduler) { case DCTS_FIFO: policy = SCHED_FIFO; break; case DCTS_RR: policy = SCHED_RR; break; default: policy = SCHED_OTHER; break; } if (pthread_attr_setschedpolicy( &attr, policy )) D_PERROR( "Direct/Thread: Could not set scheduling policy to %s!\n", direct_thread_policy_name(policy) ); /* Read (back) value. */ pthread_attr_getschedpolicy( &attr, &policy ); /* Select priority. */ switch (thread->type) { case DTT_CLEANUP: case DTT_INPUT: case DTT_OUTPUT: case DTT_MESSAGING: case DTT_CRITICAL: priority = thread->type * direct_config->thread_priority_scale / 100; break; default: priority = direct_config->thread_priority; break; } D_DEBUG_AT( Direct_ThreadInit, " -> %s (%d) [%d;%d]\n", direct_thread_policy_name(policy), priority, sched_get_priority_min( policy ), sched_get_priority_max( policy ) ); if (priority < sched_get_priority_min( policy )) priority = sched_get_priority_min( policy ); if (priority > sched_get_priority_max( policy )) priority = sched_get_priority_max( policy ); param.sched_priority = priority; if (pthread_attr_setschedparam( &attr, ¶m )) D_PERROR( "Direct/Thread: Could not set scheduling priority to %d!\n", priority ); /* Select stack size? */ if (direct_config->thread_stack_size > 0) { if (pthread_attr_setstacksize( &attr, direct_config->thread_stack_size )) D_PERROR( "Direct/Thread: Could not set stack size to %d!\n", direct_config->thread_stack_size ); } /* Read (back) value. */ pthread_attr_getstacksize( &attr, &stack_size ); /* Lock the thread mutex. */ D_DEBUG_AT( Direct_ThreadInit, " -> locking...\n" ); pthread_mutex_lock( &thread->lock ); /* Create and run the thread. */ D_DEBUG_AT( Direct_ThreadInit, " -> creating...\n" ); pthread_create( &thread->thread, &attr, direct_thread_main, thread ); pthread_attr_destroy( &attr ); pthread_getschedparam( thread->thread, &policy, ¶m ); D_INFO( "Direct/Thread: Started '%s' (%d) [%s %s/%s %d/%d] <%zu>...\n", name, thread->tid, direct_thread_type_name(thread_type), direct_thread_policy_name(policy), direct_thread_scheduler_name(direct_config->thread_scheduler), param.sched_priority, priority, stack_size ); #ifdef DIRECT_THREAD_WAIT_INIT /* Wait for completion of the thread's initialization. */ while (!thread->init) { D_DEBUG_AT( Direct_ThreadInit, " -> waiting...\n" ); pthread_cond_wait( &thread->cond, &thread->lock ); } D_DEBUG_AT( Direct_ThreadInit, " -> ...thread is running.\n" ); #endif /* Unlock the thread mutex. */ D_DEBUG_AT( Direct_ThreadInit, " -> unlocking...\n" ); pthread_mutex_unlock( &thread->lock ); D_DEBUG_AT( Direct_ThreadInit, " -> returning %p\n", thread ); return thread; } DirectThread * direct_thread_self( void ) { DirectThread *thread = pthread_getspecific( thread_key ); if (thread) D_MAGIC_ASSERT( thread, DirectThread ); return thread; } const char * direct_thread_get_name( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->name != NULL ); return thread->name; } pid_t direct_thread_get_tid( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); return thread->tid; } __attribute__((no_instrument_function)) const char * direct_thread_self_name( void ) { DirectThread *thread = pthread_getspecific( thread_key ); /* * This function is called by debugging functions, e.g. debug messages, assertions etc. * Therefore no assertions are made here, because they would loop forever if they fail. */ return thread ? thread->name : NULL; } void direct_thread_set_name( const char *name ) { char *copy; DirectThread *thread = pthread_getspecific( thread_key ); D_DEBUG_AT( Direct_Thread, "%s( '%s' )\n", __FUNCTION__, name ); /* Support this function for non-direct threads. */ if (!thread) { D_DEBUG_AT( Direct_Thread, " -> attaching unknown thread %d\n", direct_gettid() ); /* Create the key for the TSD (thread specific data). */ pthread_mutex_lock( &key_lock ); if (thread_key == -1) pthread_key_create( &thread_key, NULL ); pthread_mutex_unlock( &key_lock ); thread = D_CALLOC( 1, sizeof(DirectThread) ); if (!thread) { D_OOM(); return; } thread->thread = pthread_self(); thread->tid = direct_gettid(); D_MAGIC_SET( thread, DirectThread ); pthread_setspecific( thread_key, thread ); } else D_DEBUG_AT( Direct_Thread, " -> was '%s' (%d)\n", thread->name, direct_gettid() ); /* Duplicate string. */ copy = D_STRDUP( name ); if (!copy) { D_OOM(); return; } /* Free old string. */ if (thread->name) D_FREE( thread->name ); /* Keep the copy. */ thread->name = copy; } DirectResult direct_thread_wait( DirectThread *thread, int timeout_ms ) { unsigned int old_counter = thread->counter; D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d, %dms )\n", __FUNCTION__, thread->main, thread->name, thread->tid, timeout_ms ); while (old_counter == thread->counter && !thread->terminated) pthread_cond_wait( &thread->cond, &thread->lock ); if (thread->terminated) return DR_DEAD; return DR_OK; } void direct_thread_notify( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); pthread_mutex_lock( &thread->lock ); thread->counter++; pthread_mutex_unlock( &thread->lock ); pthread_cond_broadcast( &thread->cond ); } void direct_thread_lock( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); pthread_mutex_lock( &thread->lock ); } void direct_thread_unlock( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); pthread_mutex_unlock( &thread->lock ); } void direct_thread_terminate( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !pthread_equal( thread->thread, pthread_self() ) ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); thread->terminated = true; direct_thread_notify( thread ); } void direct_thread_cancel( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSERT( !pthread_equal( thread->thread, pthread_self() ) ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); thread->canceled = true; pthread_cancel( thread->thread ); } bool direct_thread_is_canceled( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); return thread->canceled; } void direct_thread_detach( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSERT( !pthread_equal( thread->thread, pthread_self() ) ); D_ASSUME( !thread->canceled ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); thread->detached = true; pthread_detach( thread->thread ); } bool direct_thread_is_detached( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); return thread->detached; } void direct_thread_testcancel( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSERT( pthread_equal( thread->thread, pthread_self() ) ); /* Quick check before calling the pthread function. */ if (thread->canceled) pthread_testcancel(); } void direct_thread_join( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSERT( thread->thread != -1 ); D_ASSUME( !pthread_equal( thread->thread, pthread_self() ) ); D_ASSUME( !thread->joining ); D_ASSUME( !thread->joined ); D_ASSUME( !thread->detached ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); if (thread->detached) { D_DEBUG_AT( Direct_Thread, " -> DETACHED!\n" ); return; } if (!thread->joining && !pthread_equal( thread->thread, pthread_self() )) { thread->joining = true; D_DEBUG_AT( Direct_Thread, " -> joining...\n" ); pthread_join( thread->thread, NULL ); thread->joined = true; D_DEBUG_AT( Direct_Thread, " -> joined.\n" ); } } bool direct_thread_is_joined( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); return thread->joined; } void direct_thread_destroy( DirectThread *thread ) { D_MAGIC_ASSERT( thread, DirectThread ); D_ASSUME( !pthread_equal( thread->thread, pthread_self() ) ); D_ASSUME( !thread->detached ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); if (thread->detached) { D_DEBUG_AT( Direct_Thread, " -> DETACHED!\n" ); return; } if (!thread->joined && !pthread_equal( thread->thread, pthread_self() )) { if (thread->canceled) D_DEBUG_AT( Direct_Thread, " -> cancled but not joined!\n" ); else { D_DEBUG_AT( Direct_Thread, " -> still running!\n" ); if (thread->name) D_ERROR( "Direct/Thread: Canceling '%s' (%d)!\n", thread->name, thread->tid ); else D_ERROR( "Direct/Thread: Canceling %d!\n", thread->tid ); thread->detached = true; pthread_detach( thread->thread ); pthread_cancel( thread->thread ); return; } } D_MAGIC_CLEAR( thread ); D_FREE( thread->name ); D_FREE( thread ); } /******************************************************************************/ #if DIRECT_BUILD_TEXT const char * direct_thread_type_name( DirectThreadType type ) { switch (type) { case DTT_DEFAULT: return "DEFAULT"; case DTT_CLEANUP: return "CLEANUP"; case DTT_INPUT: return "INPUT"; case DTT_OUTPUT: return "OUTPUT"; case DTT_MESSAGING: return "MESSAGING"; case DTT_CRITICAL: return "CRITICAL"; } return ""; } const char * direct_thread_scheduler_name( DirectConfigThreadScheduler scheduler ) { switch (scheduler) { case DCTS_OTHER: return "OTHER"; case DCTS_FIFO: return "FIFO"; case DCTS_RR: return "RR"; } return ""; } const char * direct_thread_policy_name( int policy ) { switch (policy) { case SCHED_OTHER: return "OTHER"; case SCHED_FIFO: return "FIFO"; case SCHED_RR: return "RR"; } return ""; } #endif /******************************************************************************/ static void direct_thread_cleanup( void *arg ) { DirectThread *thread = arg; D_MAGIC_ASSERT( thread, DirectThread ); D_DEBUG_AT( Direct_Thread, "%s( %p, '%s' %d )\n", __FUNCTION__, thread->main, thread->name, thread->tid ); if (thread->detached) { D_MAGIC_CLEAR( thread ); D_FREE( thread->name ); D_FREE( thread ); } } /******************************************************************************/ static void * direct_thread_main( void *arg ) { void *ret; DirectThread *thread = arg; DirectThreadInitHandler *handler; pid_t tid; tid = direct_gettid(); D_DEBUG_AT( Direct_ThreadInit, "%s( %p ) <- tid %d\n", __FUNCTION__, arg, tid ); D_DEBUG_AT( Direct_ThreadInit, " -> starting...\n" ); D_MAGIC_ASSERT( thread, DirectThread ); pthread_cleanup_push( direct_thread_cleanup, thread ); pthread_setspecific( thread_key, thread ); thread->tid = tid; /* Call all init handlers. */ pthread_mutex_lock( &handler_lock ); direct_list_foreach (handler, handlers) handler->func( thread, handler->arg ); pthread_mutex_unlock( &handler_lock ); /* Have all signals handled by the main thread. */ if (direct_config->thread_block_signals) direct_signals_block_all(); /* Lock the thread mutex. */ D_DEBUG_AT( Direct_ThreadInit, " -> locking...\n" ); pthread_mutex_lock( &thread->lock ); /* Indicate that our initialization has completed. */ thread->init = true; #ifdef DIRECT_THREAD_WAIT_INIT D_DEBUG_AT( Direct_ThreadInit, " -> signalling...\n" ); pthread_cond_signal( &thread->cond ); #endif /* Unlock the thread mutex. */ D_DEBUG_AT( Direct_ThreadInit, " -> unlocking...\n" ); pthread_mutex_unlock( &thread->lock ); if (thread->joining) { D_DEBUG_AT( Direct_Thread, " -> Being joined before entering main routine!\n" ); return NULL; } D_MAGIC_ASSERT( thread, DirectThread ); /* Call main routine. */ D_DEBUG_AT( Direct_ThreadInit, " -> running...\n" ); ret = thread->main( thread, thread->arg ); D_DEBUG_AT( Direct_Thread, " -> Returning %p from '%s' (%s, %d)...\n", ret, thread->name, direct_thread_type_name(thread->type), thread->tid ); D_MAGIC_ASSERT( thread, DirectThread ); pthread_cleanup_pop( 1 ); return ret; } DirectFB-1.2.10/lib/direct/thread.h0000644000175000017500000001147511245562152013611 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__THREAD_H__ #define __DIRECT__THREAD_H__ #include #include #include typedef enum { DTT_DEFAULT = 0, DTT_CLEANUP = -5, DTT_INPUT = -10, DTT_OUTPUT = -12, DTT_MESSAGING = -15, DTT_CRITICAL = -20 } DirectThreadType; typedef void * (*DirectThreadMainFunc)( DirectThread *thread, void *arg ); typedef void (*DirectThreadInitFunc)( DirectThread *thread, void *arg ); /* * Add a handler being called at the beginning of new threads. */ DirectThreadInitHandler *direct_thread_add_init_handler ( DirectThreadInitFunc func, void *arg ); /* * Remove the specified handler. */ void direct_thread_remove_init_handler( DirectThreadInitHandler *handler ); /* * Create a new thread and start it. * The thread type is relevant for the scheduling priority. */ DirectThread *direct_thread_create ( DirectThreadType thread_type, DirectThreadMainFunc thread_main, void *arg, const char *name ); /* * Returns the thread of the caller. */ DirectThread *direct_thread_self ( void ); /* * Returns the name of the specified thread. */ const char *direct_thread_get_name ( DirectThread *thread ); /* * Returns the thread ID of the specified thread. */ pid_t direct_thread_get_tid ( DirectThread *thread ); /* * Returns the name of the calling thread. */ const char *direct_thread_self_name ( void ); /* * Changes the name of the calling thread. */ void direct_thread_set_name ( const char *name ); /* * Wait on the thread object to be notified via direct_thread_notify(). */ DirectResult direct_thread_wait ( DirectThread *thread, int timeout_ms ); /* * Notify the thread object waking up callers of direct_thread_wait(). */ void direct_thread_notify ( DirectThread *thread ); void direct_thread_lock ( DirectThread *thread ); void direct_thread_unlock ( DirectThread *thread ); /* * Kindly ask the thread to terminate (for joining without thread cancellation). */ void direct_thread_terminate ( DirectThread *thread ); /* * Cancel a running thread. */ void direct_thread_cancel ( DirectThread *thread ); /* * Returns true if the specified thread has been canceled. */ bool direct_thread_is_canceled( DirectThread *thread ); /* * Detach a thread. */ void direct_thread_detach ( DirectThread *thread ); /* * Returns true if the specified thread has been detached. */ bool direct_thread_is_detached( DirectThread *thread ); /* * Check if the calling thread is canceled. * Must not be called by other threads than 'thread'. * This function won't return if the thread is canceled. */ void direct_thread_testcancel ( DirectThread *thread ); /* * Wait until a running thread is terminated. */ void direct_thread_join ( DirectThread *thread ); /* * Returns true if the specified thread has been join. */ bool direct_thread_is_joined ( DirectThread *thread ); /* * Free resources allocated by direct_thread_create. * If the thread is still running it will be killed. */ void direct_thread_destroy ( DirectThread *thread ); /* * Utilities for stringification. */ #if DIRECT_BUILD_TEXT const char *direct_thread_type_name ( DirectThreadType type ); const char *direct_thread_scheduler_name( DirectConfigThreadScheduler scheduler ); const char *direct_thread_policy_name ( int policy ); #endif #endif DirectFB-1.2.10/lib/direct/interface.h0000644000175000017500000002157011245562152014277 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__INTERFACE_H__ #define __DIRECT__INTERFACE_H__ #include #include /* * Forward declaration macro for interfaces. */ #define DECLARE_INTERFACE( IFACE ) \ typedef struct _##IFACE IFACE; /* * Macro for an interface definition. */ #define DEFINE_INTERFACE( IFACE, IDATA... ) \ struct _##IFACE { \ void *priv; \ int magic; \ \ DirectResult (*AddRef)( IFACE *thiz ); \ DirectResult (*Release)( IFACE *thiz ); \ \ IDATA \ }; /* * Declare base interface */ DECLARE_INTERFACE( IAny ) /* * Define base interface */ DEFINE_INTERFACE( IAny, ) /* * Function type for probing of interface implementations */ typedef DirectResult (*DirectInterfaceGenericProbeFunc)( void *ctx, ... ); /* * Function type for initialization of interface instances */ typedef DirectResult (*DirectInterfaceGenericConstructFunc)( void *interface, ... ); /* * Function table for interface implementations */ typedef struct { const char * (*GetType)(void); const char * (*GetImplementation)(void); DirectResult (*Allocate)( void **interface ); DirectInterfaceGenericProbeFunc Probe; DirectInterfaceGenericConstructFunc Construct; } DirectInterfaceFuncs; /* * Callback type for user probing interface implementations */ typedef DirectResult (*DirectInterfaceProbeFunc)( DirectInterfaceFuncs *impl, void *ctx ); /* * Loads an interface of a specific 'type'. * Optionally an 'implementation' can be chosen. * A 'probe' function can be used to check available implementations. * * After success 'funcs' is set. */ DirectResult DirectGetInterface( DirectInterfaceFuncs **funcs, const char *type, const char *implementation, DirectInterfaceProbeFunc probe, void *probe_ctx ); /* * Default probe function. Calls "funcs->Probe(ctx)". * Can be used as the 'probe' argument to DirectGetInterface. * 'probe_ctx' should then be set to the interface specific probe context. */ DirectResult DirectProbeInterface( DirectInterfaceFuncs *funcs, void *ctx ); /* * Called by implementation modules during 'dlopen'ing or at startup if linked * into the executable. */ void DirectRegisterInterface( DirectInterfaceFuncs *funcs ); void DirectUnregisterInterface( DirectInterfaceFuncs *funcs ); void direct_print_interface_leaks(void); #if DIRECT_BUILD_DEBUGS void direct_dbg_interface_add ( const char *func, const char *file, int line, const char *what, const void *interface, const char *name ); void direct_dbg_interface_remove( const char *func, const char *file, int line, const char *what, const void *interface ); #endif #if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #if !DIRECT_BUILD_DEBUGS #error Building with debug, but library headers suggest that debug is not supported. #endif #define DIRECT_DBG_INTERFACE_ADD direct_dbg_interface_add #define DIRECT_DBG_INTERFACE_REMOVE direct_dbg_interface_remove #else #define DIRECT_DBG_INTERFACE_ADD(func,file,line,what,interface,name) do {} while (0) #define DIRECT_DBG_INTERFACE_REMOVE(func,file,line,what,interface) do {} while (0) #endif #define DIRECT_ALLOCATE_INTERFACE(p,i) \ do { \ (p) = (__typeof__(p))D_CALLOC( 1, sizeof(i) ); \ \ D_MAGIC_SET( (IAny*)(p), DirectInterface ); \ \ DIRECT_DBG_INTERFACE_ADD( __FUNCTION__, __FILE__, __LINE__, #p, p, #i ); \ } while (0) #define DIRECT_ALLOCATE_INTERFACE_DATA(p,i) \ i##_data *data; \ \ D_MAGIC_ASSERT( (IAny*)(p), DirectInterface ); \ \ if (!(p)->priv) \ (p)->priv = D_CALLOC( 1, sizeof(i##_data) ); \ \ data = (i##_data*)((p)->priv); #define DIRECT_DEALLOCATE_INTERFACE(p) \ DIRECT_DBG_INTERFACE_REMOVE( __FUNCTION__, __FILE__, __LINE__, #p, p ); \ \ if ((p)->priv) { \ D_FREE( (p)->priv ); \ (p)->priv = NULL; \ } \ \ D_MAGIC_CLEAR( (IAny*)(p) ); \ \ D_FREE( (p) ); #define DIRECT_INTERFACE_GET_DATA(i) \ i##_data *data; \ \ if (!thiz) \ return DR_THIZNULL; \ \ D_MAGIC_ASSERT( (IAny*)thiz, DirectInterface ); \ \ data = (i##_data*) thiz->priv; \ \ if (!data) \ return DR_DEAD; #define DIRECT_INTERFACE_GET_DATA_FROM(interface,data,prefix) \ do { \ D_MAGIC_ASSERT( (IAny*)(interface), DirectInterface ); \ \ (data) = (prefix##_data*) (interface)->priv; \ \ if (!(data)) \ return DR_DEAD; \ } while (0) #endif DirectFB-1.2.10/lib/direct/messages.c0000644000175000017500000001155211245562152014140 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #if DIRECT_BUILD_TEXT __attribute__((no_instrument_function)) void direct_messages_info( const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, "(*) %s", buf ); } __attribute__((no_instrument_function)) void direct_messages_error( const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, "(!) %s", buf ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_derror( DirectResult result, const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, "(!) %s --> %s\n", buf, DirectResultString( result ) ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_perror( int erno, const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, "(!) %s --> %s\n", buf, strerror( erno ) ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_dlerror( const char *dlerr, const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, "(!) %s --> %s\n", buf, dlerr ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_once( const char *func, const char *file, int line, const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, " (!!!) *** ONCE [%s] *** [%s:%d in %s()]\n", buf, file, line, func ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_unimplemented( const char *func, const char *file, int line ) { direct_log_printf( NULL, " (!!!) *** UNIMPLEMENTED [%s] *** [%s:%d]\n", func, file, line ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_bug( const char *func, const char *file, int line, const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, " (!?!) *** BUG [%s] *** [%s:%d in %s()]\n", buf, file, line, func ); direct_trace_print_stack( NULL ); } __attribute__((no_instrument_function)) void direct_messages_warn( const char *func, const char *file, int line, const char *format, ... ) { char buf[512]; va_list ap; va_start( ap, format ); vsnprintf( buf, sizeof(buf), format, ap ); va_end( ap ); direct_log_printf( NULL, " (!!!) *** WARNING [%s] *** [%s:%d in %s()]\n", buf, file, line, func ); direct_trace_print_stack( NULL ); } #endif DirectFB-1.2.10/lib/direct/ppcasm_memcpy.S0000644000175000017500000000363511164361026015146 00000000000000/* * String handling functions for PowerPC. * * Copyright (C) 1996 Paul Mackerras. * * * In a mail from Paul on 23.10.2006 05:47: * * You may put an LGPL permission statement on that code, replacing the * GPL permission statement. From a technical point of view, I'm not * sure that the code in ppcasm_memcpy_cachable.S is the best thing to * use in userspace, though; for one thing, it has a cache line size * assumption encoded into it. Why don't you just use the glibc memcpy? * It's pretty well optimized these days, AFAIK. * * Paul. * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "ppc_asm.h" .globl direct_ppcasm_memcpy direct_ppcasm_memcpy: srwi. r7,r5,3 addi r6,r3,-4 addi r4,r4,-4 beq 2f /* if less than 8 bytes to do */ andi. r0,r6,3 /* get dest word aligned */ mtctr r7 bne 5f 1: lwz r7,4(r4) lwzu r8,8(r4) stw r7,4(r6) stwu r8,8(r6) bdnz 1b andi. r5,r5,7 2: cmplwi 0,r5,4 blt 3f lwzu r0,4(r4) addi r5,r5,-4 stwu r0,4(r6) 3: cmpwi 0,r5,0 beqlr mtctr r5 addi r4,r4,3 addi r6,r6,3 4: lbzu r0,1(r4) stbu r0,1(r6) bdnz 4b blr 5: subfic r0,r0,4 mtctr r0 6: lbz r7,4(r4) addi r4,r4,1 stb r7,4(r6) addi r6,r6,1 bdnz 6b subf r5,r0,r5 rlwinm. r7,r5,32-3,3,31 beq 2b mtctr r7 b 1b DirectFB-1.2.10/lib/direct/direct.c0000644000175000017500000001244011245562152013600 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Main, "Direct/Main", "Initialization and shutdown of libdirect" ); /**************************************************************************************************/ struct __D_DirectCleanupHandler { DirectLink link; int magic; DirectCleanupHandlerFunc func; void *ctx; }; /**************************************************************************************************/ static int refs = 0; static DirectLink *handlers = NULL; static pthread_mutex_t main_lock = PTHREAD_MUTEX_INITIALIZER; /**************************************************************************************************/ static void direct_cleanup( void ) { DirectCleanupHandler *handler, *temp; if (!refs) return; direct_list_foreach_safe (handler, temp, handlers) { D_DEBUG_AT( Direct_Main, "Calling cleanup func %p...\n", handler->func ); handler->func( handler->ctx ); /*direct_list_remove( &handlers, &handler->link ); D_MAGIC_CLEAR( handler ); D_FREE( handler );*/ } direct_print_memleaks(); direct_print_interface_leaks(); } /**************************************************************************************************/ DirectResult direct_cleanup_handler_add( DirectCleanupHandlerFunc func, void *ctx, DirectCleanupHandler **ret_handler ) { DirectCleanupHandler *handler; D_ASSERT( func != NULL ); D_ASSERT( ret_handler != NULL ); D_DEBUG_AT( Direct_Main, "Adding cleanup handler %p with context %p...\n", func, ctx ); handler = D_CALLOC( 1, sizeof(DirectCleanupHandler) ); if (!handler) { D_WARN( "out of memory" ); return DR_NOLOCALMEMORY; } handler->func = func; handler->ctx = ctx; D_MAGIC_SET( handler, DirectCleanupHandler ); pthread_mutex_lock( &main_lock ); if (handlers == NULL) atexit( direct_cleanup ); direct_list_append( &handlers, &handler->link ); pthread_mutex_unlock( &main_lock ); *ret_handler = handler; return DR_OK; } DirectResult direct_cleanup_handler_remove( DirectCleanupHandler *handler ) { D_ASSERT( handler != NULL ); D_MAGIC_ASSERT( handler, DirectCleanupHandler ); D_DEBUG_AT( Direct_Main, "Removing cleanup handler %p with context %p...\n", handler->func, handler->ctx ); pthread_mutex_lock( &main_lock ); direct_list_remove( &handlers, &handler->link ); pthread_mutex_unlock( &main_lock ); D_MAGIC_CLEAR( handler ); D_FREE( handler ); return DR_OK; } DirectResult direct_initialize( void ) { pthread_mutex_lock( &main_lock ); D_DEBUG_AT( Direct_Main, "direct_initialize() called...\n" ); if (refs++) { D_DEBUG_AT( Direct_Main, "...%d references now.\n", refs ); pthread_mutex_unlock( &main_lock ); return DR_OK; } else if (!direct_thread_self_name()) direct_thread_set_name( "Main Thread" ); D_DEBUG_AT( Direct_Main, "...initializing now.\n" ); direct_signals_initialize(); pthread_mutex_unlock( &main_lock ); return DR_OK; } DirectResult direct_shutdown( void ) { pthread_mutex_lock( &main_lock ); D_DEBUG_AT( Direct_Main, "direct_shutdown() called...\n" ); if (--refs) { D_DEBUG_AT( Direct_Main, "...%d references left.\n", refs ); pthread_mutex_unlock( &main_lock ); return DR_OK; } D_DEBUG_AT( Direct_Main, "...shutting down now.\n" ); direct_signals_shutdown(); pthread_mutex_unlock( &main_lock ); return DR_OK; } DirectFB-1.2.10/lib/direct/conf.h0000644000175000017500000000555211245562152013266 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECT__CONF_H__ #define __DIRECT__CONF_H__ #include #ifndef __LINUX__ #include #endif typedef enum { DCFL_NONE, /* None is fatal. */ DCFL_ASSERT, /* ASSERT is fatal. */ DCFL_ASSUME /* ASSERT and ASSUME are fatal. */ } DirectConfigFatalLevel; typedef enum { DCTS_OTHER, DCTS_FIFO, DCTS_RR } DirectConfigThreadScheduler; struct __D_DirectConfig { DirectMessageType quiet; bool debug; bool trace; char *memcpy; /* Don't probe for memcpy routines to save a lot of startup time. Use this one instead if it's set. */ char **disable_module; /* Never load these modules. */ char *module_dir; /* module dir override */ bool sighandler; sigset_t dont_catch; /* don't catch these signals */ DirectLog *log; DirectConfigFatalLevel fatal; bool debugmem; bool thread_block_signals; bool fatal_break; /* Should D_BREAK() cause a trap? */ int thread_priority; DirectConfigThreadScheduler thread_scheduler; int thread_stack_size; int thread_priority_scale; }; extern DirectConfig *direct_config; extern const char *direct_config_usage; DirectResult direct_config_set( const char *name, const char *value ); #endif DirectFB-1.2.10/lib/fusion/0000777000175000017500000000000011307522564012300 500000000000000DirectFB-1.2.10/lib/fusion/lock.c0000644000175000017500000004311211307520376013310 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" #if FUSION_BUILD_MULTI D_DEBUG_DOMAIN( Fusion_Skirmish, "Fusion/Skirmish", "Fusion's Skirmish (Mutex)" ); #if FUSION_BUILD_KERNEL DirectResult fusion_skirmish_init( FusionSkirmish *skirmish, const char *name, const FusionWorld *world ) { FusionEntryInfo info; D_ASSERT( skirmish != NULL ); D_ASSERT( name != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); D_DEBUG_AT( Fusion_Skirmish, "fusion_skirmish_init( %p, '%s' )\n", skirmish, name ? : "" ); while (ioctl( world->fusion_fd, FUSION_SKIRMISH_NEW, &skirmish->multi.id )) { if (errno == EINTR) continue; D_PERROR( "FUSION_SKIRMISH_NEW" ); return DR_FUSION; } D_DEBUG_AT( Fusion_Skirmish, " -> new skirmish %p [%d]\n", skirmish, skirmish->multi.id ); info.type = FT_SKIRMISH; info.id = skirmish->multi.id; direct_snputs( info.name, name, sizeof(info.name) ); ioctl( world->fusion_fd, FUSION_ENTRY_SET_INFO, &info ); /* Keep back pointer to shared world data. */ skirmish->multi.shared = world->shared; return DR_OK; } DirectResult fusion_skirmish_prevail( FusionSkirmish *skirmish ) { D_ASSERT( skirmish != NULL ); while (ioctl (_fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_PREVAIL, &skirmish->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_PREVAIL"); return DR_FUSION; } return DR_OK; } DirectResult fusion_skirmish_swoop( FusionSkirmish *skirmish ) { D_ASSERT( skirmish != NULL ); while (ioctl (_fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_SWOOP, &skirmish->multi.id)) { switch (errno) { case EINTR: continue; case EAGAIN: return DR_BUSY; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_SWOOP"); return DR_FUSION; } return DR_OK; } DirectResult fusion_skirmish_lock_count( FusionSkirmish *skirmish, int *lock_count ) { int data[2]; D_ASSERT( skirmish != NULL ); data[0] = skirmish->multi.id; data[1] = 0; while (ioctl (_fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_LOCK_COUNT, data)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_LOCK_COUNT"); return DR_FUSION; } *lock_count = data[1]; return DR_OK; } DirectResult fusion_skirmish_dismiss (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); while (ioctl (_fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_DISMISS, &skirmish->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_DISMISS"); return DR_FUSION; } return DR_OK; } DirectResult fusion_skirmish_destroy (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); D_DEBUG_AT( Fusion_Skirmish, "fusion_skirmish_destroy( %p [%d] )\n", skirmish, skirmish->multi.id ); while (ioctl( _fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_DESTROY, &skirmish->multi.id )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_DESTROY"); return DR_FUSION; } return DR_OK; } DirectResult fusion_skirmish_wait( FusionSkirmish *skirmish, unsigned int timeout ) { FusionSkirmishWait wait; D_ASSERT( skirmish != NULL ); wait.id = skirmish->multi.id; wait.timeout = timeout; wait.lock_count = 0; while (ioctl (_fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_WAIT, &wait)) { switch (errno) { case EINTR: continue; case ETIMEDOUT: return DR_TIMEOUT; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_WAIT"); return DR_FUSION; } return DR_OK; } DirectResult fusion_skirmish_notify( FusionSkirmish *skirmish ) { D_ASSERT( skirmish != NULL ); while (ioctl (_fusion_fd( skirmish->multi.shared ), FUSION_SKIRMISH_NOTIFY, &skirmish->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Lock: invalid skirmish\n"); return DR_DESTROYED; } D_PERROR ("FUSION_SKIRMISH_NOTIFY"); return DR_FUSION; } return DR_OK; } #else /* FUSION_BUILD_KERNEL */ #include #include #include typedef struct { DirectLink link; pid_t pid; bool notified; } WaitNode; DirectResult fusion_skirmish_init( FusionSkirmish *skirmish, const char *name, const FusionWorld *world ) { D_ASSERT( skirmish != NULL ); //D_ASSERT( name != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); D_DEBUG_AT( Fusion_Skirmish, "fusion_skirmish_init( %p, '%s' )\n", skirmish, name ? : "" ); skirmish->multi.id = ++world->shared->lock_ids; /* Set state to unlocked. */ skirmish->multi.builtin.locked = 0; skirmish->multi.builtin.owner = 0; skirmish->multi.builtin.waiting = NULL; skirmish->multi.builtin.requested = false; skirmish->multi.builtin.destroyed = false; /* Keep back pointer to shared world data. */ skirmish->multi.shared = world->shared; return DR_OK; } DirectResult fusion_skirmish_prevail( FusionSkirmish *skirmish ) { D_ASSERT( skirmish != NULL ); if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; asm( "" ::: "memory" ); if (skirmish->multi.builtin.locked && skirmish->multi.builtin.owner != direct_gettid()) { int count = 0; while (skirmish->multi.builtin.locked) { /* Check whether owner exited without unlocking. */ if (kill( skirmish->multi.builtin.owner, 0 ) < 0 && errno == ESRCH) { skirmish->multi.builtin.locked = 0; skirmish->multi.builtin.requested = false; break; } skirmish->multi.builtin.requested = true; asm( "" ::: "memory" ); if (++count > 1000) { usleep( 10000 ); count = 0; } else { direct_sched_yield(); } if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; } } skirmish->multi.builtin.locked++; skirmish->multi.builtin.owner = direct_gettid(); asm( "" ::: "memory" ); return DR_OK; } DirectResult fusion_skirmish_swoop( FusionSkirmish *skirmish ) { D_ASSERT( skirmish != NULL ); if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; asm( "" ::: "memory" ); if (skirmish->multi.builtin.locked && skirmish->multi.builtin.owner != direct_gettid()) { /* Check whether owner exited without unlocking. */ if (kill( skirmish->multi.builtin.owner, 0 ) < 0 && errno == ESRCH) { skirmish->multi.builtin.locked = 0; skirmish->multi.builtin.requested = false; } else return DR_BUSY; } skirmish->multi.builtin.locked++; skirmish->multi.builtin.owner = direct_gettid(); asm( "" ::: "memory" ); return DR_OK; } DirectResult fusion_skirmish_lock_count( FusionSkirmish *skirmish, int *lock_count ) { D_ASSERT( skirmish != NULL ); if (skirmish->multi.builtin.destroyed) { *lock_count = 0; return DR_DESTROYED; } *lock_count = skirmish->multi.builtin.locked; return DR_OK; } DirectResult fusion_skirmish_dismiss (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; asm( "" ::: "memory" ); if (skirmish->multi.builtin.locked) { if (skirmish->multi.builtin.owner != direct_gettid()) { D_ERROR( "Fusion/Skirmish: " "Tried to dismiss a skirmish not owned by current process!\n" ); return DR_ACCESSDENIED; } if (--skirmish->multi.builtin.locked == 0) { skirmish->multi.builtin.owner = 0; if (skirmish->multi.builtin.requested) { skirmish->multi.builtin.requested = false; direct_sched_yield(); } } } asm( "" ::: "memory" ); return DR_OK; } DirectResult fusion_skirmish_destroy (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); D_DEBUG_AT( Fusion_Skirmish, "fusion_skirmish_destroy( %p )\n", skirmish ); if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; if (skirmish->multi.builtin.waiting) fusion_skirmish_notify( skirmish ); skirmish->multi.builtin.destroyed = true; return DR_OK; } #ifdef SIGRTMAX # define SIGRESTART SIGRTMAX #else # define SIGRESTART SIGCONT #endif static void restart_handler( int s ) {} DirectResult fusion_skirmish_wait( FusionSkirmish *skirmish, unsigned int timeout ) { WaitNode *node; long long stop; struct sigaction act, oldact; sigset_t mask, set; DirectResult ret = DR_OK; D_ASSERT( skirmish != NULL ); if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; /* Set timeout. */ stop = direct_clock_get_micros() + timeout * 1000ll; /* Add ourself to the list of waiting processes. */ node = SHMALLOC( skirmish->multi.shared->main_pool, sizeof(WaitNode) ); if (!node) return D_OOSHM(); node->pid = direct_gettid(); node->notified = false; direct_list_append( &skirmish->multi.builtin.waiting, &node->link ); /* Install a (fake) signal handler for SIGRESTART. */ act.sa_handler = restart_handler; act.sa_flags = SA_RESETHAND | SA_RESTART | SA_NOMASK; sigaction( SIGRESTART, &act, &oldact ); /* Unblock SIGRESTART. */ sigprocmask( SIG_SETMASK, NULL, &mask ); sigdelset( &mask, SIGRESTART ); fusion_skirmish_dismiss( skirmish ); while (!node->notified) { if (timeout) { long long now = direct_clock_get_micros(); if (now >= stop) { /* Stop notifying us. */ node->notified = true; ret = DR_TIMEOUT; break; } sigprocmask( SIG_SETMASK, &mask, &set ); usleep( stop - now ); sigprocmask( SIG_SETMASK, &set, NULL ); } else { sigsuspend( &mask ); } } /* Flush pending signals. */ if (!sigpending( &set ) && sigismember( &set, SIGRESTART ) > 0) sigsuspend( &mask ); if (fusion_skirmish_prevail( skirmish )) ret = DR_DESTROYED; direct_list_remove( &skirmish->multi.builtin.waiting, &node->link ); SHFREE( skirmish->multi.shared->main_pool, node ); sigaction( SIGRESTART, &oldact, NULL ); return ret; } DirectResult fusion_skirmish_notify( FusionSkirmish *skirmish ) { WaitNode *node, *temp; D_ASSERT( skirmish != NULL ); if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; direct_list_foreach_safe (node, temp, skirmish->multi.builtin.waiting) { if (node->notified) continue; node->notified = true; if (kill( node->pid, SIGRESTART ) < 0) { if (errno == ESRCH) { /* Remove dead process. */ direct_list_remove( &skirmish->multi.builtin.waiting, &node->link ); SHFREE( skirmish->multi.shared->main_pool, node ); } else { D_PERROR( "Fusion/Skirmish: Couldn't send notification signal!\n" ); } } } return DR_OK; } #endif /* FUSION_BUILD_KERNEL */ #else /* FUSION_BUILD_MULTI */ DirectResult fusion_skirmish_init( FusionSkirmish *skirmish, const char *name, const FusionWorld *world ) { D_ASSERT( skirmish != NULL ); direct_util_recursive_pthread_mutex_init( &skirmish->single.lock ); pthread_cond_init( &skirmish->single.cond, NULL ); return DR_OK; } DirectResult fusion_skirmish_prevail (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); if (pthread_mutex_lock( &skirmish->single.lock )) return errno2result( errno ); skirmish->single.count++; return DR_OK; } DirectResult fusion_skirmish_swoop (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); if (pthread_mutex_trylock( &skirmish->single.lock )) return errno2result( errno ); skirmish->single.count++; return DR_OK; } DirectResult fusion_skirmish_lock_count( FusionSkirmish *skirmish, int *lock_count ) { D_ASSERT( skirmish != NULL ); D_ASSERT( lock_count != NULL ); if (pthread_mutex_trylock( &skirmish->single.lock )) { *lock_count = 0; return errno2result( errno ); } *lock_count = skirmish->single.count; pthread_mutex_unlock( &skirmish->single.lock ); return DR_OK; } DirectResult fusion_skirmish_dismiss (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); skirmish->single.count--; if (pthread_mutex_unlock( &skirmish->single.lock )) return errno2result( errno ); return DR_OK; } DirectResult fusion_skirmish_destroy (FusionSkirmish *skirmish) { D_ASSERT( skirmish != NULL ); pthread_cond_broadcast( &skirmish->single.cond ); pthread_cond_destroy( &skirmish->single.cond ); return pthread_mutex_destroy( &skirmish->single.lock ); } DirectResult fusion_skirmish_wait( FusionSkirmish *skirmish, unsigned int timeout ) { D_ASSERT( skirmish != NULL ); if (timeout) { struct timespec ts; struct timeval tv; int ret; gettimeofday( &tv, NULL ); ts.tv_nsec = tv.tv_usec*1000 + (timeout%1000)*1000000; ts.tv_sec = tv.tv_sec + timeout/1000 + ts.tv_nsec/1000000000; ts.tv_nsec = ts.tv_nsec % 1000000000; ret = pthread_cond_timedwait( &skirmish->single.cond, &skirmish->single.lock, &ts ); return (ret == ETIMEDOUT) ? DR_TIMEOUT : DR_OK; } return pthread_cond_wait( &skirmish->single.cond, &skirmish->single.lock ); } DirectResult fusion_skirmish_notify( FusionSkirmish *skirmish ) { D_ASSERT( skirmish != NULL ); pthread_cond_broadcast( &skirmish->single.cond ); return DR_OK; } #endif DirectFB-1.2.10/lib/fusion/vector.c0000644000175000017500000001443011245562152013662 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include static inline bool ensure_capacity( FusionVector *vector ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( vector->capacity > 0 ); if (!vector->elements) { if (vector->pool) vector->elements = SHMALLOC( vector->pool, vector->capacity * sizeof(void*) ); else vector->elements = D_MALLOC( vector->capacity * sizeof(void*) ); if (!vector->elements) return false; } else if (vector->count == vector->capacity) { void *elements; void *oldelements = vector->elements; int capacity = vector->capacity << 1; if (vector->pool) elements = SHMALLOC( vector->pool, capacity * sizeof(void*) ); else elements = D_MALLOC( capacity * sizeof(void*) ); if (!elements) return false; direct_memcpy( elements, vector->elements, vector->count * sizeof(void*) ); vector->elements = elements; vector->capacity = capacity; if (vector->pool) SHFREE( vector->pool, oldelements ); else D_FREE( oldelements ); } return true; } void fusion_vector_init( FusionVector *vector, int capacity, FusionSHMPoolShared *pool ) { D_ASSERT( vector != NULL ); D_ASSERT( capacity > 0 ); vector->elements = NULL; vector->count = 0; vector->capacity = capacity; vector->pool = pool; D_MAGIC_SET( vector, FusionVector ); } void fusion_vector_destroy( FusionVector *vector ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( vector->count == 0 || vector->elements != NULL ); if (vector->elements) { if (vector->pool) SHFREE( vector->pool, vector->elements ); else D_FREE( vector->elements ); vector->elements = NULL; } D_MAGIC_CLEAR( vector ); } DirectResult fusion_vector_add( FusionVector *vector, void *element ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( element != NULL ); /* Make sure there's a free entry left. */ if (!ensure_capacity( vector )) return D_OOSHM(); /* Add the element to the vector. */ vector->elements[vector->count++] = element; return DR_OK; } DirectResult fusion_vector_insert( FusionVector *vector, void *element, int index ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( element != NULL ); D_ASSERT( index >= 0 ); D_ASSERT( index <= vector->count ); /* Make sure there's a free entry left. */ if (!ensure_capacity( vector )) return D_OOSHM(); /* Move elements from insertion point one up. */ memmove( &vector->elements[ index + 1 ], &vector->elements[ index ], (vector->count - index) * sizeof(void*) ); /* Insert the element into the vector. */ vector->elements[index] = element; /* Increase the element counter. */ vector->count++; return DR_OK; } DirectResult fusion_vector_move( FusionVector *vector, int from, int to ) { void *element; D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( from >= 0 ); D_ASSERT( from < vector->count ); D_ASSERT( to >= 0 ); D_ASSERT( to < vector->count ); if (to == from) return DR_OK; /* Save the element. */ element = vector->elements[from]; /* Move elements that lie on the way to the new position. */ if (to > from) { /* Element is moving up -> move other elements down. */ memmove( &vector->elements[ from ], &vector->elements[ from + 1 ], (to - from) * sizeof(void*) ); } else { /* Element is moving down -> move other elements up. */ memmove( &vector->elements[ to + 1 ], &vector->elements[ to ], (from - to) * sizeof(void*) ); } /* Restore the element at the new position. */ vector->elements[to] = element; return DR_OK; } DirectResult fusion_vector_remove( FusionVector *vector, int index ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( index >= 0 ); D_ASSERT( index < vector->count ); /* Move elements after this element one down. */ memmove( &vector->elements[ index ], &vector->elements[ index + 1 ], (vector->count - index - 1) * sizeof(void*) ); /* Decrease the element counter. */ vector->count--; return DR_OK; } DirectResult fusion_vector_remove_last( FusionVector *vector ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( vector->count > 0 ); /* Decrease the element counter. */ vector->count--; return DR_OK; } DirectFB-1.2.10/lib/fusion/conf.c0000644000175000017500000000757411245562152013320 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include static FusionConfig config = { .tmpfs = NULL, .shmfile_gid = -1, }; FusionConfig *fusion_config = &config; const char *fusion_config_usage = "libfusion options:\n" " force-slave Always enter as a slave, waiting for the master, if not there\n" " tmpfs= Location of shared memory file\n" " shmfile-group= Group that owns shared memory files\n" " [no-]debugshm Enable shared memory allocation tracking\n" " [no-]madv-remove Enable usage of MADV_REMOVE (default = auto)\n" "\n"; /**********************************************************************************************************************/ DirectResult fusion_config_set( const char *name, const char *value ) { if (strcmp (name, "tmpfs" ) == 0) { if (value) { if (fusion_config->tmpfs) D_FREE( fusion_config->tmpfs ); fusion_config->tmpfs = D_STRDUP( value ); } else { D_ERROR("Fusion/Config 'tmpfs': No directory specified!\n"); return DR_INVARG; } } else if (strcmp (name, "shmfile-group" ) == 0) { if (value) { struct group *group_info; group_info = getgrnam( value ); if (group_info) fusion_config->shmfile_gid = group_info->gr_gid; else D_PERROR("Fusion/Config 'shmfile-group': Group '%s' not found!\n", value); } else { D_ERROR("Fusion/Config 'shmfile-group': No file group name specified!\n"); return DR_INVARG; } } else if (strcmp (name, "force-slave" ) == 0) { fusion_config->force_slave = true; } else if (strcmp (name, "no-force-slave" ) == 0) { fusion_config->force_slave = false; } else if (strcmp (name, "debugshm" ) == 0) { fusion_config->debugshm = true; } else if (strcmp (name, "no-debugshm" ) == 0) { fusion_config->debugshm = false; } else if (strcmp (name, "madv-remove" ) == 0) { fusion_config->madv_remove = true; fusion_config->madv_remove_force = true; } else if (strcmp (name, "no-madv-remove" ) == 0) { fusion_config->madv_remove = false; fusion_config->madv_remove_force = true; } else if (direct_config_set( name, value )) return DR_UNSUPPORTED; return DR_OK; } DirectFB-1.2.10/lib/fusion/lock.h0000644000175000017500000000756011245562152013323 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__LOCK_H__ #define __FUSION__LOCK_H__ #include #include #include #include typedef union { /* multi app */ struct { int id; const FusionWorldShared *shared; /* builtin impl */ struct { unsigned int locked; pid_t owner; DirectLink *waiting; bool requested; bool destroyed; } builtin; } multi; /* single app */ struct { pthread_mutex_t lock; pthread_cond_t cond; int count; } single; } FusionSkirmish; /* * Initialize. */ DirectResult fusion_skirmish_init ( FusionSkirmish *skirmish, const char *name, const FusionWorld *world ); /* * Lock. */ DirectResult fusion_skirmish_prevail( FusionSkirmish *skirmish ); /* * Try lock. */ DirectResult fusion_skirmish_swoop ( FusionSkirmish *skirmish ); /* * Find out how many times current thread has acquired lock. */ DirectResult fusion_skirmish_lock_count( FusionSkirmish *skirmish, int *lock_count ); /* * Unlock. */ DirectResult fusion_skirmish_dismiss( FusionSkirmish *skirmish ); /* * Deinitialize. */ DirectResult fusion_skirmish_destroy( FusionSkirmish *skirmish ); /* * Wait & Notify. * * Must be locked! */ DirectResult fusion_skirmish_wait ( FusionSkirmish *skirmish, unsigned int timeout ); DirectResult fusion_skirmish_notify ( FusionSkirmish *skirmish ); #if D_DEBUG_ENABLED #define FUSION_SKIRMISH_ASSERT(skirmish) \ do { \ int lock_count; \ \ D_ASSERT( skirmish != NULL ); \ \ D_ASSERT( fusion_skirmish_lock_count( skirmish, &lock_count ) == DR_OK ); \ D_ASSERT( lock_count > 0 ); \ } while (0) #else #define FUSION_SKIRMISH_ASSERT(skirmish) \ do { \ } while (0) #endif #endif DirectFB-1.2.10/lib/fusion/property.c0000644000175000017500000003325311245562152014250 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" #if FUSION_BUILD_MULTI #if FUSION_BUILD_KERNEL DirectResult fusion_property_init (FusionProperty *property, const FusionWorld *world) { D_ASSERT( property != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); while (ioctl (world->fusion_fd, FUSION_PROPERTY_NEW, &property->multi.id)) { switch (errno) { case EINTR: continue; default: break; } D_PERROR ("FUSION_PROPERTY_NEW"); return DR_FAILURE; } /* Keep back pointer to shared world data. */ property->multi.shared = world->shared; return DR_OK; } DirectResult fusion_property_lease (FusionProperty *property) { D_ASSERT( property != NULL ); while (ioctl (_fusion_fd( property->multi.shared ), FUSION_PROPERTY_LEASE, &property->multi.id)) { switch (errno) { case EINTR: continue; case EAGAIN: return DR_BUSY; case EINVAL: D_ERROR ("Fusion/Property: invalid property\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_PROPERTY_LEASE"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_property_purchase (FusionProperty *property) { D_ASSERT( property != NULL ); while (ioctl (_fusion_fd( property->multi.shared ), FUSION_PROPERTY_PURCHASE, &property->multi.id)) { switch (errno) { case EINTR: continue; case EAGAIN: return DR_BUSY; case EINVAL: D_ERROR ("Fusion/Property: invalid property\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_PROPERTY_PURCHASE"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_property_cede (FusionProperty *property) { D_ASSERT( property != NULL ); while (ioctl (_fusion_fd( property->multi.shared ), FUSION_PROPERTY_CEDE, &property->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Property: invalid property\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_PROPERTY_CEDE"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_property_holdup (FusionProperty *property) { D_ASSERT( property != NULL ); while (ioctl (_fusion_fd( property->multi.shared ), FUSION_PROPERTY_HOLDUP, &property->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Property: invalid property\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_PROPERTY_HOLDUP"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_property_destroy (FusionProperty *property) { D_ASSERT( property != NULL ); while (ioctl (_fusion_fd( property->multi.shared ), FUSION_PROPERTY_DESTROY, &property->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Property: invalid property\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_PROPERTY_DESTROY"); return DR_FAILURE; } return DR_OK; } #else /* FUSION_BUILD_KERNEL */ #include DirectResult fusion_property_init (FusionProperty *property, const FusionWorld *world) { D_ASSERT( property != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); /* Set state to available. */ property->multi.builtin.state = FUSION_PROPERTY_AVAILABLE; property->multi.builtin.owner = 0; property->multi.builtin.requested = false; property->multi.builtin.destroyed = false; /* Keep back pointer to shared world data. */ property->multi.shared = world->shared; return DR_OK; } DirectResult fusion_property_lease (FusionProperty *property) { int count = 0; D_ASSERT( property != NULL ); if (property->multi.builtin.destroyed) return DR_DESTROYED; D_ASSUME( property->multi.builtin.owner != direct_gettid() ); asm( "" ::: "memory" ); while (property->multi.builtin.state == FUSION_PROPERTY_LEASED) { /* Check whether owner exited without releasing. */ if (kill( property->multi.builtin.owner, 0 ) < 0 && errno == ESRCH) { property->multi.builtin.state = FUSION_PROPERTY_AVAILABLE; property->multi.builtin.requested = false; break; } property->multi.builtin.requested = true; asm( "" ::: "memory" ); if (++count > 1000) { usleep( 10000 ); count = 0; } else { direct_sched_yield(); } if (property->multi.builtin.destroyed) return DR_DESTROYED; } if (property->multi.builtin.state == FUSION_PROPERTY_PURCHASED) { /* Check whether owner exited without releasing. */ if (!(kill( property->multi.builtin.owner, 0 ) < 0 && errno == ESRCH)) return DR_BUSY; } property->multi.builtin.state = FUSION_PROPERTY_LEASED; property->multi.builtin.owner = direct_gettid(); asm( "" ::: "memory" ); return DR_OK; } DirectResult fusion_property_purchase (FusionProperty *property) { int count = 0; D_ASSERT( property != NULL ); if (property->multi.builtin.destroyed) return DR_DESTROYED; D_ASSUME( property->multi.builtin.owner != direct_gettid() ); asm( "" ::: "memory" ); while (property->multi.builtin.state == FUSION_PROPERTY_LEASED) { /* Check whether owner exited without releasing. */ if (kill( property->multi.builtin.owner, 0 ) < 0 && errno == ESRCH) { property->multi.builtin.state = FUSION_PROPERTY_AVAILABLE; property->multi.builtin.requested = false; break; } property->multi.builtin.requested = true; asm( "" ::: "memory" ); if (++count > 1000) { usleep( 10000 ); count = 0; } else { direct_sched_yield(); } if (property->multi.builtin.destroyed) return DR_DESTROYED; } if (property->multi.builtin.state == FUSION_PROPERTY_PURCHASED) { /* Check whether owner exited without releasing. */ if (!(kill( property->multi.builtin.owner, 0 ) < 0 && errno == ESRCH)) return DR_BUSY; } property->multi.builtin.state = FUSION_PROPERTY_PURCHASED; property->multi.builtin.owner = direct_gettid(); asm( "" ::: "memory" ); return DR_OK; } DirectResult fusion_property_cede (FusionProperty *property) { D_ASSERT( property != NULL ); if (property->multi.builtin.destroyed) return DR_DESTROYED; D_ASSUME( property->multi.builtin.state != FUSION_PROPERTY_AVAILABLE ); D_ASSUME( property->multi.builtin.owner == direct_gettid() ); property->multi.builtin.state = FUSION_PROPERTY_AVAILABLE; property->multi.builtin.owner = 0; asm( "" ::: "memory" ); if (property->multi.builtin.requested) { property->multi.builtin.requested = false; asm( "" ::: "memory" ); direct_sched_yield(); } return DR_OK; } DirectResult fusion_property_holdup (FusionProperty *property) { D_ASSERT( property != NULL ); if (property->multi.builtin.destroyed) return DR_DESTROYED; if (property->multi.builtin.state == FUSION_PROPERTY_PURCHASED && property->multi.builtin.owner != direct_gettid()) { pid_t pid = property->multi.builtin.owner; if (kill( pid, SIGKILL ) < 0 && errno != ESRCH) return DR_UNSUPPORTED; /* Wait process termination. */ while (kill( pid, 0 ) == 0) { if (property->multi.builtin.destroyed) return DR_DESTROYED; direct_sched_yield(); } property->multi.builtin.state = FUSION_PROPERTY_AVAILABLE; property->multi.builtin.owner = 0; property->multi.builtin.requested = false; } return DR_OK; } DirectResult fusion_property_destroy (FusionProperty *property) { D_ASSERT( property != NULL ); if (property->multi.builtin.destroyed) return DR_DESTROYED; property->multi.builtin.destroyed = true; return DR_OK; } #endif /* FUSION_BUILD_KERNEL */ #else /* FUSION_BUILD_MULTI */ #include /* * Initializes the property */ DirectResult fusion_property_init (FusionProperty *property, const FusionWorld *world) { D_ASSERT( property != NULL ); direct_util_recursive_pthread_mutex_init (&property->single.lock); pthread_cond_init (&property->single.cond, NULL); property->single.state = FUSION_PROPERTY_AVAILABLE; return DR_OK; } /* * Lease the property causing others to wait before leasing or purchasing. */ DirectResult fusion_property_lease (FusionProperty *property) { DirectResult ret = DR_OK; D_ASSERT( property != NULL ); pthread_mutex_lock (&property->single.lock); /* Wait as long as the property is leased by another party. */ while (property->single.state == FUSION_PROPERTY_LEASED) pthread_cond_wait (&property->single.cond, &property->single.lock); /* Fail if purchased by another party, otherwise succeed. */ if (property->single.state == FUSION_PROPERTY_PURCHASED) ret = DR_BUSY; else property->single.state = FUSION_PROPERTY_LEASED; pthread_mutex_unlock (&property->single.lock); return ret; } /* * Purchase the property disallowing others to lease or purchase it. */ DirectResult fusion_property_purchase (FusionProperty *property) { DirectResult ret = DR_OK; D_ASSERT( property != NULL ); pthread_mutex_lock (&property->single.lock); /* Wait as long as the property is leased by another party. */ while (property->single.state == FUSION_PROPERTY_LEASED) pthread_cond_wait (&property->single.cond, &property->single.lock); /* Fail if purchased by another party, otherwise succeed. */ if (property->single.state == FUSION_PROPERTY_PURCHASED) ret = DR_BUSY; else { property->single.state = FUSION_PROPERTY_PURCHASED; /* Wake up any other waiting party. */ pthread_cond_broadcast (&property->single.cond); } pthread_mutex_unlock (&property->single.lock); return ret; } /* * Cede the property allowing others to lease or purchase it. */ DirectResult fusion_property_cede (FusionProperty *property) { D_ASSERT( property != NULL ); pthread_mutex_lock (&property->single.lock); /* Simple error checking, maybe we should also check the owner. */ D_ASSERT( property->single.state != FUSION_PROPERTY_AVAILABLE ); /* Put back into 'available' state. */ property->single.state = FUSION_PROPERTY_AVAILABLE; /* Wake up one waiting party if there are any. */ pthread_cond_signal (&property->single.cond); pthread_mutex_unlock (&property->single.lock); return DR_OK; } /* * Does nothing to avoid killing ourself. */ DirectResult fusion_property_holdup (FusionProperty *property) { D_ASSERT( property != NULL ); return DR_OK; } /* * Destroys the property */ DirectResult fusion_property_destroy (FusionProperty *property) { D_ASSERT( property != NULL ); pthread_cond_destroy (&property->single.cond); pthread_mutex_destroy (&property->single.lock); return DR_OK; } #endif DirectFB-1.2.10/lib/fusion/arena.h0000644000175000017500000000524311245562152013455 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__ARENA_H__ #define __FUSION__ARENA_H__ #include typedef int (*ArenaEnterFunc) (FusionArena *arena, void *ctx); typedef int (*ArenaExitFunc) (FusionArena *arena, void *ctx, bool emergency); DirectResult fusion_arena_enter (FusionWorld *world, const char *name, ArenaEnterFunc initialize, ArenaEnterFunc join, void *ctx, FusionArena **ret_arena, int *ret_error); DirectResult fusion_arena_add_shared_field (FusionArena *arena, const char *name, void *data); DirectResult fusion_arena_get_shared_field (FusionArena *arena, const char *name, void **data); DirectResult fusion_arena_exit (FusionArena *arena, ArenaExitFunc shutdown, ArenaExitFunc leave, void *ctx, bool emergency, int *ret_error); #endif DirectFB-1.2.10/lib/fusion/shmalloc.c0000644000175000017500000005026711245562152014172 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #if FUSION_BUILD_MULTI /*************************** MULTI APPLICATION CORE ***************************/ #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ D_DEBUG_DOMAIN( Fusion_SHM, "Fusion/SHM", "Fusion Shared Memory" ); void fusion_dbg_print_memleaks( FusionSHMPoolShared *pool ) { DirectResult ret; SHMemDesc *desc; unsigned int total = 0; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not lock shared memory pool!\n" ); return; } if (pool->allocs) { direct_log_printf( NULL, "\nShared memory allocations remaining (%d) in '%s': \n", direct_list_count_elements_EXPENSIVE( pool->allocs ), pool->name ); direct_list_foreach (desc, pool->allocs) { direct_log_printf( NULL, " %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u)\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)pool->heap, desc->func, desc->fid, desc->file, desc->line ); total += desc->bytes; } direct_log_printf( NULL, " -------\n %7dk total\n", total >> 10 ); direct_log_printf( NULL, "\nShared memory file size: %dk\n", pool->heap->size >> 10 ); } fusion_skirmish_dismiss( &pool->lock ); } static SHMemDesc * fill_shmem_desc( SHMemDesc *desc, int bytes, const char *func, const char *file, int line, FusionID fusion_id ) { D_ASSERT( desc != NULL ); desc->mem = desc + 1; desc->bytes = bytes; snprintf( desc->func, SHMEMDESC_FUNC_NAME_LENGTH, func ); snprintf( desc->file, SHMEMDESC_FILE_NAME_LENGTH, file ); desc->line = line; desc->fid = fusion_id; return desc; } /* Allocate SIZE bytes of memory. */ void * fusion_dbg_shmalloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, size_t __size ) { DirectResult ret; SHMemDesc *desc; void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( file != NULL ); D_ASSERT( line > 0 ); D_ASSERT( func != NULL ); D_ASSERT( __size > 0 ); if (!pool->debug) return fusion_shmalloc( pool, __size ); /* Lock the pool. */ ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not lock shared memory pool!\n" ); return NULL; } /* Allocate memory from the pool. */ ret = fusion_shm_pool_allocate( pool, __size + sizeof(SHMemDesc), false, false, &data ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not allocate %zu bytes from pool!\n", __size + sizeof(SHMemDesc) ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Fill description. */ desc = fill_shmem_desc( data, __size, func, file, line, _fusion_id(pool->shm->world) ); D_DEBUG_AT( Fusion_SHM, "allocating %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u)\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)pool->heap, desc->func, desc->fid, desc->file, desc->line ); /* Add description to list. */ direct_list_append( &pool->allocs, &desc->link ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return data + sizeof(SHMemDesc); } /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ void * fusion_dbg_shcalloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, size_t __nmemb, size_t __size) { DirectResult ret; SHMemDesc *desc; void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( file != NULL ); D_ASSERT( line > 0 ); D_ASSERT( func != NULL ); D_ASSERT( __nmemb > 0 ); D_ASSERT( __size > 0 ); if (!pool->debug) return fusion_shcalloc( pool, __nmemb, __size ); /* Lock the pool. */ ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not lock shared memory pool!\n" ); return NULL; } /* Allocate memory from the pool. */ ret = fusion_shm_pool_allocate( pool, __nmemb * __size + sizeof(SHMemDesc), true, false, &data ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not allocate %zu bytes from pool!\n", __nmemb * __size + sizeof(SHMemDesc) ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Fill description. */ desc = fill_shmem_desc( data, __nmemb * __size, func, file, line, _fusion_id(pool->shm->world) ); D_DEBUG_AT( Fusion_SHM, "allocating %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u)\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)pool->heap, desc->func, desc->fid, desc->file, desc->line ); /* Add description to list. */ direct_list_append( &pool->allocs, &desc->link ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return data + sizeof(SHMemDesc); } /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ void * fusion_dbg_shrealloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *what, void *__ptr, size_t __size ) { DirectResult ret; SHMemDesc *desc; void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( file != NULL ); D_ASSERT( line > 0 ); D_ASSERT( func != NULL ); D_ASSERT( what != NULL ); if (!pool->debug) return fusion_shrealloc( pool, __ptr, __size ); if (!__ptr) return fusion_dbg_shmalloc( pool, file, line, func, __size ); if (!__size) { fusion_dbg_shfree( pool, file, line, func, what, __ptr ); return NULL; } /* Lock the pool. */ ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not lock shared memory pool!\n" ); return NULL; } /* Lookup the corresponding description. */ direct_list_foreach (desc, pool->allocs) { if (desc->mem == __ptr) break; } if (!desc) { D_ERROR( "Fusion/SHM: Cannot reallocate unknown chunk at %p (%s) from [%s:%d in %s()]!\n", __ptr, what, file, line, func ); D_BREAK( "unknown chunk" ); return NULL; /* shouldn't happen due to the break */ } /* Remove the description in case the block moves. */ direct_list_remove( &pool->allocs, &desc->link ); /* Reallocate the memory block. */ ret = fusion_shm_pool_reallocate( pool, __ptr - sizeof(SHMemDesc), __size + sizeof(SHMemDesc), false, &data ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not reallocate from %zu to %zu bytes!\n", desc->bytes + sizeof(SHMemDesc), __size + sizeof(SHMemDesc) ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Fill description. */ desc = fill_shmem_desc( data, __size, func, file, line, _fusion_id(pool->shm->world) ); D_DEBUG_AT( Fusion_SHM, "reallocating %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u) '%s'\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)pool->heap, desc->func, desc->fid, desc->file, desc->line, what ); /* Add description to list. */ direct_list_append( &pool->allocs, &desc->link ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return data + sizeof(SHMemDesc); } /* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */ void fusion_dbg_shfree( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *what, void *__ptr ) { DirectResult ret; SHMemDesc *desc; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( file != NULL ); D_ASSERT( line > 0 ); D_ASSERT( func != NULL ); D_ASSERT( what != NULL ); D_ASSERT( __ptr != NULL ); if (!pool->debug) return fusion_shfree( pool, __ptr ); /* Lock the pool. */ ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not lock shared memory pool!\n" ); return; } /* Lookup the corresponding description. */ direct_list_foreach (desc, pool->allocs) { if (desc->mem == __ptr) break; } if (!desc) { D_ERROR( "Fusion/SHM: Cannot free unknown chunk at %p (%s) from [%s:%d in %s()]!\n", __ptr, what, file, line, func ); D_BREAK( "unknown chunk" ); return; /* shouldn't happen due to the break */ } D_DEBUG_AT( Fusion_SHM, "freeing %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u) '%s'\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)pool->heap, desc->func, desc->fid, desc->file, desc->line, what ); /* Remove the description. */ direct_list_remove( &pool->allocs, &desc->link ); /* Free the memory block. */ fusion_shm_pool_deallocate( pool, __ptr - sizeof(SHMemDesc), false ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); } /* Duplicate string in shared memory. */ char * fusion_dbg_shstrdup( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *string ) { DirectResult ret; SHMemDesc *desc; void *data = NULL; int length; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( file != NULL ); D_ASSERT( line > 0 ); D_ASSERT( func != NULL ); D_ASSERT( string != NULL ); if (!pool->debug) return fusion_shstrdup( pool, string ); length = strlen( string ) + 1; /* Lock the pool. */ ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not lock shared memory pool!\n" ); return NULL; } /* Allocate memory from the pool. */ ret = fusion_shm_pool_allocate( pool, length + sizeof(SHMemDesc), false, false, &data ); if (ret) { D_DERROR( ret, "Fusion/SHM: Could not allocate %zu bytes from pool!\n", length + sizeof(SHMemDesc) ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Fill description. */ desc = fill_shmem_desc( data, length, func, file, line, _fusion_id(pool->shm->world) ); D_DEBUG_AT( Fusion_SHM, "allocating %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u) <- \"%s\"\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)pool->heap, desc->func, desc->fid, desc->file, desc->line, string ); D_DEBUG_AT( Fusion_SHM, " -> allocs: %p\n", pool->allocs ); /* Add description to list. */ direct_list_append( &pool->allocs, &desc->link ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); /* Copy string content. */ direct_memcpy( data + sizeof(SHMemDesc), string, length ); return data + sizeof(SHMemDesc); } #else void fusion_dbg_print_memleaks( FusionSHMPoolShared *pool ) { } #endif /**********************************************************************************************************************/ /* Allocate SIZE bytes of memory. */ void * fusion_shmalloc( FusionSHMPoolShared *pool, size_t __size ) { void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __size > 0 ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); if (fusion_shm_pool_allocate( pool, __size, false, true, &data )) return NULL; D_ASSERT( data != NULL ); return data; } /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ void * fusion_shcalloc( FusionSHMPoolShared *pool, size_t __nmemb, size_t __size ) { void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __nmemb > 0 ); D_ASSERT( __size > 0 ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); if (fusion_shm_pool_allocate( pool, __nmemb * __size, true, true, &data )) return NULL; D_ASSERT( data != NULL ); return data; } /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ void * fusion_shrealloc( FusionSHMPoolShared *pool, void *__ptr, size_t __size ) { void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); if (!__ptr) return fusion_shmalloc( pool, __size ); if (!__size) { fusion_shfree( pool, __ptr ); return NULL; } if (fusion_shm_pool_reallocate( pool, __ptr, __size, true, &data )) return NULL; D_ASSERT( data != NULL || __size == 0 ); return data; } /* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */ void fusion_shfree( FusionSHMPoolShared *pool, void *__ptr ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __ptr != NULL ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); fusion_shm_pool_deallocate( pool, __ptr, true ); } /* Duplicate string in shared memory. */ char * fusion_shstrdup( FusionSHMPoolShared *pool, const char* string ) { int len; void *data = NULL; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( string != NULL ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); len = strlen( string ) + 1; if (fusion_shm_pool_allocate( pool, len, false, true, &data )) return NULL; D_ASSERT( data != NULL ); direct_memcpy( data, string, len ); return data; } #else /************************** SINGLE APPLICATION CORE ***************************/ #include void fusion_dbg_print_memleaks( FusionSHMPoolShared *pool ) { } #if DIRECT_BUILD_DEBUGS /* Build with debug support? */ /* Allocate SIZE bytes of memory. */ void * fusion_dbg_shmalloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, size_t __size ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __size > 0 ); if (pool->debug) return direct_malloc( file, line, func, __size ); return malloc( __size ); } /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ void * fusion_dbg_shcalloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, size_t __nmemb, size_t __size) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __nmemb > 0 ); D_ASSERT( __size > 0 ); if (pool->debug) return direct_calloc( file, line, func, __nmemb, __size ); return calloc( __nmemb, __size ); } /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ void * fusion_dbg_shrealloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *what, void *__ptr, size_t __size ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); if (pool->debug) return direct_realloc( file, line, func, what, __ptr, __size ); return realloc( __ptr, __size ); } /* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */ void fusion_dbg_shfree( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *what, void *__ptr ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __ptr != NULL ); if (pool->debug) direct_free( file, line, func, what, __ptr ); else free( __ptr ); } /* Duplicate string in shared memory. */ char * fusion_dbg_shstrdup( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *string ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( string != NULL ); if (pool->debug) return direct_strdup( file, line, func, string ); return strdup( string ); } #endif /**********************************************************************************************************************/ /* Allocate SIZE bytes of memory. */ void * fusion_shmalloc (FusionSHMPoolShared *pool, size_t __size) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __size > 0 ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); return malloc( __size ); } /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ void * fusion_shcalloc (FusionSHMPoolShared *pool, size_t __nmemb, size_t __size) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __nmemb > 0 ); D_ASSERT( __size > 0 ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); return calloc( __nmemb, __size ); } /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ void * fusion_shrealloc (FusionSHMPoolShared *pool, void *__ptr, size_t __size) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); return realloc( __ptr, __size ); } /* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */ void fusion_shfree (FusionSHMPoolShared *pool, void *__ptr) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( __ptr != NULL ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); free( __ptr ); } /* Duplicate string in shared memory. */ char * fusion_shstrdup (FusionSHMPoolShared *pool, const char *string) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( string != NULL ); if (pool->debug) D_WARN( "Fusion/SHMMalloc: Pool runs in debug mode, but access from pure-release is attempted!\n" ); return strdup( string ); } #endif DirectFB-1.2.10/lib/fusion/types.h0000644000175000017500000000532011245562152013527 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__TYPES_H__ #define __FUSION__TYPES_H__ #include #if FUSION_BUILD_MULTI && FUSION_BUILD_KERNEL #include #define FUSION_API_MAJOR_REQUIRED 8 #define FUSION_API_MINOR_REQUIRED 0 #if FUSION_API_MAJOR_REQUIRED > FUSION_API_MAJOR_PROVIDED #error Major version of Fusion Kernel Module too low! Upgrade your kernel. #else #if FUSION_API_MAJOR_REQUIRED == FUSION_API_MAJOR_PROVIDED #if FUSION_API_MINOR_REQUIRED > FUSION_API_MINOR_PROVIDED #error Minor version of Fusion Kernel Module too low! Upgrade your kernel. #endif #endif #endif #else typedef unsigned long FusionID; #define FUSION_ID_MASTER 1L typedef enum { FCEF_NONE = 0x00000000, FCEF_ONEWAY = 0x00000001, FCEF_ALL = 0x00000001 } FusionCallExecFlags; #endif #define FCEF_NODIRECT 0x80000000 #include typedef struct __Fusion_FusionConfig FusionConfig; typedef struct __Fusion_FusionArena FusionArena; typedef struct __Fusion_FusionReactor FusionReactor; typedef struct __Fusion_FusionWorld FusionWorld; typedef struct __Fusion_FusionWorldShared FusionWorldShared; typedef struct __Fusion_FusionObject FusionObject; typedef struct __Fusion_FusionObjectPool FusionObjectPool; typedef struct __Fusion_FusionSHM FusionSHM; typedef struct __Fusion_FusionSHMShared FusionSHMShared; typedef struct __Fusion_FusionSHMPool FusionSHMPool; typedef struct __Fusion_FusionSHMPoolShared FusionSHMPoolShared; typedef struct __Fusion_FusionHash FusionHash; #endif DirectFB-1.2.10/lib/fusion/call.c0000644000175000017500000004113711245562152013277 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" D_DEBUG_DOMAIN( Fusion_Call, "Fusion/Call", "Fusion Call" ); #if FUSION_BUILD_MULTI #if FUSION_BUILD_KERNEL DirectResult fusion_call_init (FusionCall *call, FusionCallHandler handler, void *ctx, const FusionWorld *world) { FusionCallNew call_new; D_DEBUG_AT( Fusion_Call, "%s( %p, %p <%s>, %p, %p )\n", __FUNCTION__, call, handler, direct_trace_lookup_symbol_at( handler ), ctx, world ); D_ASSERT( call != NULL ); D_ASSERT( handler != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); /* Called from others. */ call_new.handler = handler; call_new.ctx = ctx; while (ioctl( world->fusion_fd, FUSION_CALL_NEW, &call_new )) { switch (errno) { case EINTR: continue; default: break; } D_PERROR ("FUSION_CALL_NEW"); return DR_FAILURE; } memset( call, 0, sizeof(FusionCall) ); /* Store handler, called directly when called by ourself. */ call->handler = handler; call->ctx = ctx; /* Store call and own fusion id. */ call->call_id = call_new.call_id; call->fusion_id = fusion_id( world ); /* Keep back pointer to shared world data. */ call->shared = world->shared; D_DEBUG_AT( Fusion_Call, " -> call id %d\n", call->call_id ); return DR_OK; } DirectResult fusion_call_execute (FusionCall *call, FusionCallExecFlags flags, int call_arg, void *call_ptr, int *ret_val) { D_DEBUG_AT( Fusion_Call, "%s( %p, 0x%x, %d, %p )\n", __FUNCTION__, call, flags, call_arg, call_ptr ); D_ASSERT( call != NULL ); if (!call->handler) return DR_DESTROYED; D_DEBUG_AT( Fusion_Call, " -> %s\n", direct_trace_lookup_symbol_at( call->handler ) ); if (!(flags & FCEF_NODIRECT) && call->fusion_id == _fusion_id( call->shared )) { int ret; FusionCallHandlerResult result; result = call->handler( _fusion_id( call->shared ), call_arg, call_ptr, call->ctx, 0, &ret ); if (result != FCHR_RETURN) D_WARN( "local call handler returned FCHR_RETAIN, need FCEF_NODIRECT" ); if (ret_val) *ret_val = ret; } else { FusionCallExecute execute; execute.call_id = call->call_id; execute.call_arg = call_arg; execute.call_ptr = call_ptr; execute.flags = flags; while (ioctl( _fusion_fd( call->shared ), FUSION_CALL_EXECUTE, &execute )) { switch (errno) { case EINTR: continue; case EINVAL: // D_ERROR ("Fusion/Call: invalid call\n"); return DR_INVARG; case EIDRM: return DR_DESTROYED; default: break; } D_PERROR ("FUSION_CALL_EXECUTE"); return DR_FAILURE; } if (ret_val) *ret_val = execute.ret_val; } return DR_OK; } DirectResult fusion_call_return( FusionCall *call, unsigned int serial, int val ) { FusionCallReturn call_ret; D_DEBUG_AT( Fusion_Call, "%s( %p, %u, %d )\n", __FUNCTION__, call, serial, val ); D_ASSERT( call != NULL ); D_DEBUG_AT( Fusion_Call, " -> %s\n", direct_trace_lookup_symbol_at( call->handler ) ); D_ASSUME( serial != 0 ); if (!serial) return DR_UNSUPPORTED; call_ret.call_id = call->call_id; call_ret.val = val; call_ret.serial = serial; while (ioctl (_fusion_fd( call->shared ), FUSION_CALL_RETURN, &call_ret)) { switch (errno) { case EINTR: continue; case EIDRM: D_WARN( "caller withdrawn (signal?)" ); return DR_NOCONTEXT; case EINVAL: D_ERROR( "Fusion/Call: invalid call\n" ); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_CALL_RETURN"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_call_destroy (FusionCall *call) { D_DEBUG_AT( Fusion_Call, "%s( %p )\n", __FUNCTION__, call ); D_ASSERT( call != NULL ); D_ASSERT( call->handler != NULL ); D_DEBUG_AT( Fusion_Call, " -> %s\n", direct_trace_lookup_symbol_at( call->handler ) ); while (ioctl (_fusion_fd( call->shared ), FUSION_CALL_DESTROY, &call->call_id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Call: invalid call\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_CALL_DESTROY"); return DR_FAILURE; } call->handler = NULL; return DR_OK; } void _fusion_call_process( FusionWorld *world, int call_id, FusionCallMessage *msg ) { FusionCallHandler call_handler; FusionCallReturn call_ret; FusionCallHandlerResult result; D_DEBUG_AT( Fusion_Call, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( msg != NULL ); call_handler = msg->handler; D_ASSERT( call_handler != NULL ); D_DEBUG_AT( Fusion_Call, " -> %s\n", direct_trace_lookup_symbol_at( call_handler ) ); call_ret.val = 0; result = call_handler( msg->caller, msg->call_arg, msg->call_ptr, msg->ctx, msg->serial, &call_ret.val ); switch (result) { case FCHR_RETURN: if (msg->serial) { call_ret.serial = msg->serial; call_ret.call_id = call_id; while (ioctl (world->fusion_fd, FUSION_CALL_RETURN, &call_ret)) { switch (errno) { case EINTR: continue; case EIDRM: D_WARN( "caller withdrawn (signal?)" ); return; case EINVAL: D_ERROR( "Fusion/Call: invalid call\n" ); return; default: D_PERROR( "FUSION_CALL_RETURN" ); return; } } } break; case FCHR_RETAIN: break; default: D_BUG( "unknown result %d from call handler", result ); } } #else /* FUSION_BUILD_KERNEL */ #include #include DirectResult fusion_call_init (FusionCall *call, FusionCallHandler handler, void *ctx, const FusionWorld *world) { D_ASSERT( call != NULL ); D_ASSERT( handler != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); memset( call, 0, sizeof(FusionCall) ); call->call_id = ++world->shared->call_ids; /* Store handler, called directly when called by ourself. */ call->handler = handler; call->ctx = ctx; /* Store own fusion id. */ call->fusion_id = fusion_id( world ); /* Keep back pointer to shared world data. */ call->shared = world->shared; return DR_OK; } DirectResult fusion_call_execute (FusionCall *call, FusionCallExecFlags flags, int call_arg, void *call_ptr, int *ret_val) { DirectResult ret = DR_OK; FusionWorld *world; FusionCallMessage msg; struct sockaddr_un addr; D_ASSERT( call != NULL ); if (!call->handler) return DR_DESTROYED; if (!(flags & FCEF_NODIRECT) && call->fusion_id == _fusion_id( call->shared )) { int ret; FusionCallHandlerResult result; result = call->handler( _fusion_id( call->shared ), call_arg, call_ptr, call->ctx, 0, &ret ); if (result != FCHR_RETURN) D_WARN( "local call handler returned FCHR_RETAIN, need FCEF_NODIRECT" ); if (ret_val) *ret_val = ret; return DR_OK; } world = _fusion_world( call->shared ); msg.type = FMT_CALL; msg.caller = world->fusion_id; msg.call_id = call->call_id; msg.call_arg = call_arg; msg.call_ptr = call_ptr; msg.handler = call->handler; msg.ctx = call->ctx; msg.flags = flags; if (flags & FCEF_ONEWAY) { /* Invalidate serial. */ msg.serial = -1; /* Send message. */ addr.sun_family = AF_UNIX; snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/%lx", call->shared->world_index, call->fusion_id ); ret = _fusion_send_message( world->fusion_fd, &msg, sizeof(msg), &addr ); } else { int fd; socklen_t len; int err; fd = socket( PF_LOCAL, SOCK_RAW, 0 ); if (fd < 0) { D_PERROR( "Fusion/Call: Error creating local socket!\n" ) ; return DR_IO; } /* Set close-on-exec flag. */ fcntl( fd, F_SETFD, FD_CLOEXEC ); addr.sun_family = AF_UNIX; len = snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/call.%x.", fusion_world_index( world ), call->call_id ); /* Generate call serial (socket address is based on it). */ for (msg.serial = 0; msg.serial <= 0xffffff; msg.serial++) { snprintf( addr.sun_path+len, sizeof(addr.sun_path)-len, "%x", msg.serial ); err = bind( fd, (struct sockaddr*)&addr, sizeof(addr) ); if (err == 0) { chmod( addr.sun_path, 0660 ); /* Change group, if requested. */ if (fusion_config->shmfile_gid != (gid_t)-1) chown( addr.sun_path, -1, fusion_config->shmfile_gid ); break; } } if (err < 0) { D_PERROR( "Fusion/Call: Error binding local socket!\n" ); close( fd ); return DR_IO; } /* Send message. */ snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/%lx", call->shared->world_index, call->fusion_id ); ret = _fusion_send_message( fd, &msg, sizeof(msg), &addr ); if (ret == DR_OK) { FusionCallReturn callret; /* Wait for reply. */ ret = _fusion_recv_message( fd, &callret, sizeof(callret), NULL ); if (ret == DR_OK) { if (ret_val) *ret_val = callret.val; } } len = sizeof(addr); if (getsockname( fd, (struct sockaddr*)&addr, &len ) == 0) unlink( addr.sun_path ); close( fd ); } return ret; } DirectResult fusion_call_return( FusionCall *call, unsigned int serial, int val ) { struct sockaddr_un addr; FusionCallReturn callret; D_ASSERT( call != NULL ); addr.sun_family = AF_UNIX; snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/call.%x.%x", call->shared->world_index, call->call_id, serial ); callret.type = FMT_CALLRET; callret.val = val; return _fusion_send_message( _fusion_fd( call->shared ), &callret, sizeof(callret), &addr ); } DirectResult fusion_call_destroy (FusionCall *call) { D_ASSERT( call != NULL ); D_ASSERT( call->handler != NULL ); call->handler = NULL; return DR_OK; } void _fusion_call_process( FusionWorld *world, int call_id, FusionCallMessage *msg ) { FusionCallHandler call_handler; FusionCallHandlerResult result; FusionCallReturn callret; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( msg != NULL ); call_handler = msg->handler; D_ASSERT( call_handler != NULL ); callret.type = FMT_CALLRET; callret.val = 0; result = call_handler( msg->caller, msg->call_arg, msg->call_ptr, msg->ctx, msg->serial, &callret.val ); switch (result) { case FCHR_RETURN: if (!(msg->flags & FCEF_ONEWAY)) { struct sockaddr_un addr; addr.sun_family = AF_UNIX; snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/call.%x.%x", fusion_world_index( world ), call_id, msg->serial ); if (_fusion_send_message( world->fusion_fd, &callret, sizeof(callret), &addr )) D_ERROR( "Fusion/Call: Couldn't send call return (serial: 0x%08x)!\n", msg->serial ); } break; case FCHR_RETAIN: break; default: D_BUG( "unknown result %d from call handler", result ); break; } } #endif /* FUSION_BUILD_KERNEL */ #else /* FUSION_BUILD_MULTI */ DirectResult fusion_call_init (FusionCall *call, FusionCallHandler handler, void *ctx, const FusionWorld *world) { D_ASSERT( call != NULL ); D_ASSERT( call->handler == NULL ); D_ASSERT( handler != NULL ); /* Called locally. */ call->handler = handler; call->ctx = ctx; return DR_OK; } DirectResult fusion_call_execute (FusionCall *call, FusionCallExecFlags flags, int call_arg, void *call_ptr, int *ret_val) { FusionCallHandlerResult ret; int val = 0; D_ASSERT( call != NULL ); if (!call->handler) return DR_DESTROYED; ret = call->handler( 1, call_arg, call_ptr, call->ctx, 0, &val ); if (ret != FCHR_RETURN) D_WARN( "only FCHR_RETURN supported in single app core at the moment" ); if (ret_val) *ret_val = val; return DR_OK; } DirectResult fusion_call_return( FusionCall *call, unsigned int serial, int val ) { return DR_UNIMPLEMENTED; } DirectResult fusion_call_destroy (FusionCall *call) { D_ASSERT( call != NULL ); D_ASSERT( call->handler != NULL ); call->handler = NULL; return DR_OK; } #endif DirectFB-1.2.10/lib/fusion/Makefile.am0000644000175000017500000000327211164361026014247 00000000000000## Makefile.am for DirectFB/lib/fusion SUBDIRS = shm INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \ -DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = fusion.pc # If the old location isn't cleared, builds of external modules fail install-exec-local: rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/core/fusion rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/fusion includedir = @INCLUDEDIR@/fusion include_HEADERS = \ arena.h \ build.h \ call.h \ conf.h \ fusion.h \ fusion_internal.h \ hash.h \ lock.h \ object.h \ property.h \ protocol.h \ reactor.h \ ref.h \ shmalloc.h \ types.h \ vector.h lib_LTLIBRARIES = libfusion.la libfusion_la_SOURCES = \ arena.c \ call.c \ conf.c \ fusion.c \ hash.c \ lock.c \ object.c \ property.c \ reactor.c \ ref.c \ shmalloc.c \ vector.c libfusion_la_LIBADD = \ shm/libfusion_shm.la \ ../direct/libdirect.la libfusion_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) # ## and now rebuild the static version with the *correct* object files # if BUILD_STATIC clean-local: rm -f libfusion_fixed.a all-local: libfusion_fixed.a libfusion_fixed.a: .libs/libfusion.a rm -f libfusion_fixed.a ${AR} cru libfusion_fixed.a `find . -name "*.o" | grep -v '.libs'` ${RANLIB} libfusion_fixed.a cp -pf libfusion_fixed.a .libs/libfusion.a .libs/libfusion.a: libfusion.la else clean-local: all-local: endif include $(top_srcdir)/rules/nmfile.make DirectFB-1.2.10/lib/fusion/build.h0000644000175000017500000000233511307521522013460 00000000000000/* (c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2002-2004 convergence GmbH. All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann and Ville Syrjl . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__BUILD_H__ #define __FUSION__BUILD_H__ #define FUSION_BUILD_MULTI (1) #define FUSION_BUILD_KERNEL (1) #define FUSION_MESSAGE_SIZE (1024) #endif DirectFB-1.2.10/lib/fusion/Makefile.in0000644000175000017500000006324411307521504014263 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/build.h.in \ $(srcdir)/fusion.pc.in $(top_srcdir)/rules/nmfile.make subdir = lib/fusion ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = build.h fusion.pc am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libfusion_la_DEPENDENCIES = shm/libfusion_shm.la \ ../direct/libdirect.la am_libfusion_la_OBJECTS = arena.lo call.lo conf.lo fusion.lo hash.lo \ lock.lo object.lo property.lo reactor.lo ref.lo shmalloc.lo \ vector.lo libfusion_la_OBJECTS = $(am_libfusion_la_OBJECTS) libfusion_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libfusion_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libfusion_la_SOURCES) DIST_SOURCES = $(libfusion_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @INCLUDEDIR@/fusion infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = shm INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" \ -DMODULEDIR=\"${RUNTIME_SYSROOT}@MODULEDIR@\" pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = fusion.pc include_HEADERS = \ arena.h \ build.h \ call.h \ conf.h \ fusion.h \ fusion_internal.h \ hash.h \ lock.h \ object.h \ property.h \ protocol.h \ reactor.h \ ref.h \ shmalloc.h \ types.h \ vector.h lib_LTLIBRARIES = libfusion.la libfusion_la_SOURCES = \ arena.c \ call.c \ conf.c \ fusion.c \ hash.c \ lock.c \ object.c \ property.c \ reactor.c \ ref.c \ shmalloc.c \ vector.c libfusion_la_LIBADD = \ shm/libfusion_shm.la \ ../direct/libdirect.la libfusion_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ $(DFB_LDFLAGS) @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@LIBTONM = $(LTLIBRARIES:.la=-$(LT_RELEASE).so.$(LT_BINARY)) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/nmfile.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/fusion/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/fusion/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh build.h: $(top_builddir)/config.status $(srcdir)/build.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fusion.pc: $(top_builddir)/config.status $(srcdir)/fusion.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libfusion.la: $(libfusion_la_OBJECTS) $(libfusion_la_DEPENDENCIES) $(libfusion_la_LINK) -rpath $(libdir) $(libfusion_la_OBJECTS) $(libfusion_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arena.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fusion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/property.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reactor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ref.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @BUILD_SHARED_FALSE@install-data-local: @ENABLE_TRACE_FALSE@install-data-local: clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-includeHEADERS \ install-pkgconfigDATA install-dvi: install-dvi-recursive install-exec-am: install-exec-local install-libLTLIBRARIES install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA # If the old location isn't cleared, builds of external modules fail install-exec-local: rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/core/fusion rm -rf $(DESTDIR)$(INTERNALINCLUDEDIR)/fusion # # @BUILD_STATIC_TRUE@clean-local: @BUILD_STATIC_TRUE@ rm -f libfusion_fixed.a @BUILD_STATIC_TRUE@all-local: libfusion_fixed.a @BUILD_STATIC_TRUE@libfusion_fixed.a: .libs/libfusion.a @BUILD_STATIC_TRUE@ rm -f libfusion_fixed.a @BUILD_STATIC_TRUE@ ${AR} cru libfusion_fixed.a `find . -name "*.o" | grep -v '.libs'` @BUILD_STATIC_TRUE@ ${RANLIB} libfusion_fixed.a @BUILD_STATIC_TRUE@ cp -pf libfusion_fixed.a .libs/libfusion.a @BUILD_STATIC_TRUE@.libs/libfusion.a: libfusion.la @BUILD_STATIC_FALSE@clean-local: @BUILD_STATIC_FALSE@all-local: @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@install-data-local: install-libLTLIBRARIES @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ mkdir -p -- "$(DESTDIR)$(libdir)" @BUILD_SHARED_TRUE@@ENABLE_TRACE_TRUE@ nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/lib/fusion/fusion.c0000644000175000017500000023506311245562152013672 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" #include #include #if FUSION_BUILD_MULTI D_DEBUG_DOMAIN( Fusion_Main, "Fusion/Main", "Fusion - High level IPC" ); D_DEBUG_DOMAIN( Fusion_Main_Dispatch, "Fusion/Main/Dispatch", "Fusion - High level IPC Dispatch" ); /**********************************************************************************************************************/ static void *fusion_dispatch_loop ( DirectThread *thread, void *arg ); /**********************************************************************************************************************/ static void fusion_fork_handler_prepare( void ); static void fusion_fork_handler_parent( void ); static void fusion_fork_handler_child( void ); /**********************************************************************************************************************/ static FusionWorld *fusion_worlds[FUSION_MAX_WORLDS]; static pthread_mutex_t fusion_worlds_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_once_t fusion_init_once = PTHREAD_ONCE_INIT; /**********************************************************************************************************************/ int _fusion_fd( const FusionWorldShared *shared ) { int index; FusionWorld *world; D_MAGIC_ASSERT( shared, FusionWorldShared ); index = shared->world_index; D_ASSERT( index >= 0 ); D_ASSERT( index < FUSION_MAX_WORLDS ); world = fusion_worlds[index]; D_MAGIC_ASSERT( world, FusionWorld ); return world->fusion_fd; } FusionID _fusion_id( const FusionWorldShared *shared ) { int index; FusionWorld *world; D_MAGIC_ASSERT( shared, FusionWorldShared ); index = shared->world_index; D_ASSERT( index >= 0 ); D_ASSERT( index < FUSION_MAX_WORLDS ); world = fusion_worlds[index]; D_MAGIC_ASSERT( world, FusionWorld ); return world->fusion_id; } FusionWorld * _fusion_world( const FusionWorldShared *shared ) { int index; FusionWorld *world; D_MAGIC_ASSERT( shared, FusionWorldShared ); index = shared->world_index; D_ASSERT( index >= 0 ); D_ASSERT( index < FUSION_MAX_WORLDS ); world = fusion_worlds[index]; D_MAGIC_ASSERT( world, FusionWorld ); return world; } /**********************************************************************************************************************/ static void init_once( void ) { struct utsname uts; int i, j, k, l; pthread_atfork( fusion_fork_handler_prepare, fusion_fork_handler_parent, fusion_fork_handler_child ); if (uname( &uts ) < 0) { D_PERROR( "Fusion/Init: uname() failed!\n" ); return; } #if !FUSION_BUILD_KERNEL D_INFO( "Fusion/Init: " "Builtin Implementation is still experimental! Crash/Deadlocks might occur!\n" ); #endif if (fusion_config->madv_remove_force) { if (fusion_config->madv_remove) D_INFO( "Fusion/SHM: Using MADV_REMOVE (forced)\n" ); else D_INFO( "Fusion/SHM: Not using MADV_REMOVE (forced)!\n" ); } else { switch (sscanf( uts.release, "%d.%d.%d.%d", &i, &j, &k, &l )) { case 3: l = 0; case 4: if (((i << 24) | (j << 16) | (k << 8) | l) >= 0x02061302) fusion_config->madv_remove = true; break; default: D_WARN( "could not parse kernel version '%s'", uts.release ); } if (fusion_config->madv_remove) D_INFO( "Fusion/SHM: Using MADV_REMOVE (%d.%d.%d.%d >= 2.6.19.2)\n", i, j, k, l ); else D_INFO( "Fusion/SHM: NOT using MADV_REMOVE (%d.%d.%d.%d < 2.6.19.2)! [0x%08x]\n", i, j, k, l, (i << 24) | (j << 16) | (k << 8) | l ); } } /**********************************************************************************************************************/ #if FUSION_BUILD_KERNEL static void fusion_world_fork( FusionWorld *world ) { int fd; char buf1[20]; char buf2[20]; FusionEnter enter; FusionFork fork; FusionWorldShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); snprintf( buf1, sizeof(buf1), "/dev/fusion%d", shared->world_index ); snprintf( buf2, sizeof(buf2), "/dev/fusion/%d", shared->world_index ); /* Open Fusion Kernel Device. */ fd = direct_try_open( buf1, buf2, O_RDWR | O_NONBLOCK, true ); if (fd < 0) { D_PERROR( "Fusion/Main: Reopening fusion device (world %d) failed!\n", shared->world_index ); raise(5); } /* Drop "identity" when running another program. */ if (fcntl( fd, F_SETFD, FD_CLOEXEC ) < 0) D_PERROR( "Fusion/Init: Setting FD_CLOEXEC flag failed!\n" ); /* Fill enter information. */ enter.api.major = FUSION_API_MAJOR_REQUIRED; enter.api.minor = FUSION_API_MINOR_REQUIRED; enter.fusion_id = 0; /* Clear for check below. */ /* Enter the fusion world. */ while (ioctl( fd, FUSION_ENTER, &enter )) { if (errno != EINTR) { D_PERROR( "Fusion/Init: Could not reenter world '%d'!\n", shared->world_index ); raise(5); } } /* Check for valid Fusion ID. */ if (!enter.fusion_id) { D_ERROR( "Fusion/Init: Got no ID from FUSION_ENTER! Kernel module might be too old.\n" ); raise(5); } D_DEBUG_AT( Fusion_Main, " -> Fusion ID 0x%08lx\n", enter.fusion_id ); /* Fill fork information. */ fork.fusion_id = world->fusion_id; /* Fork within the fusion world. */ while (ioctl( fd, FUSION_FORK, &fork )) { if (errno != EINTR) { D_PERROR( "Fusion/Main: Could not fork in world '%d'!\n", shared->world_index ); raise(5); } } D_DEBUG_AT( Fusion_Main, " -> Fusion ID 0x%08lx\n", fork.fusion_id ); /* Get new fusion id back. */ world->fusion_id = fork.fusion_id; /* Close old file descriptor. */ close( world->fusion_fd ); /* Write back new file descriptor. */ world->fusion_fd = fd; D_DEBUG_AT( Fusion_Main, " -> restarting dispatcher loop...\n" ); /* Restart the dispatcher thread. FIXME: free old struct */ world->dispatch_loop = direct_thread_create( DTT_MESSAGING, fusion_dispatch_loop, world, "Fusion Dispatch" ); if (!world->dispatch_loop) raise(5); } static void fusion_fork_handler_prepare( void ) { int i; D_DEBUG_AT( Fusion_Main, "%s()\n", __FUNCTION__ ); for (i=0; ifork_callback) world->fork_callback( world->fork_action, FFS_PREPARE ); } } static void fusion_fork_handler_parent( void ) { int i; D_DEBUG_AT( Fusion_Main, "%s()\n", __FUNCTION__ ); for (i=0; ishared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (world->fork_callback) world->fork_callback( world->fork_action, FFS_PARENT ); if (world->fork_action == FFA_FORK) { /* Increase the shared reference counter. */ if (fusion_master( world )) shared->refs++; } } } static void fusion_fork_handler_child( void ) { int i; D_DEBUG_AT( Fusion_Main, "%s()\n", __FUNCTION__ ); for (i=0; ifork_callback) world->fork_callback( world->fork_action, FFS_CHILD ); switch (world->fork_action) { default: D_BUG( "unknown fork action %d", world->fork_action ); case FFA_CLOSE: D_DEBUG_AT( Fusion_Main, " -> closing world %d\n", i ); /* Remove world from global list. */ fusion_worlds[i] = NULL; /* Unmap shared area. */ munmap( world->shared, sizeof(FusionWorldShared) ); /* Close Fusion Kernel Device. */ close( world->fusion_fd ); /* Free local world data. */ D_MAGIC_CLEAR( world ); D_FREE( world ); break; case FFA_FORK: D_DEBUG_AT( Fusion_Main, " -> forking in world %d\n", i ); fusion_world_fork( world ); break; } } } /**********************************************************************************************************************/ /* * Enters a fusion world by joining or creating it. * * If world is negative, the next free index is used to create a new world. * Otherwise the world with the specified index is joined or created. */ DirectResult fusion_enter( int world_index, int abi_version, FusionEnterRole role, FusionWorld **ret_world ) { DirectResult ret = DR_OK; int fd = -1; FusionWorld *world = NULL; FusionWorldShared *shared = NULL; FusionEnter enter; char buf1[20]; char buf2[20]; D_DEBUG_AT( Fusion_Main, "%s( %d, %d, %p )\n", __FUNCTION__, world_index, abi_version, ret_world ); D_ASSERT( ret_world != NULL ); if (world_index >= FUSION_MAX_WORLDS) { D_ERROR( "Fusion/Init: World index %d exceeds maximum index %d!\n", world_index, FUSION_MAX_WORLDS - 1 ); return DR_INVARG; } pthread_once( &fusion_init_once, init_once ); if (fusion_config->force_slave) role = FER_SLAVE; direct_initialize(); pthread_mutex_lock( &fusion_worlds_lock ); if (world_index < 0) { if (role == FER_SLAVE) { D_ERROR( "Fusion/Init: Slave role and a new world (index -1) was requested!\n" ); pthread_mutex_unlock( &fusion_worlds_lock ); return DR_INVARG; } for (world_index=0; world_indexrefs > 0 ); /* Check the role again. */ switch (role) { case FER_MASTER: if (world->fusion_id != FUSION_ID_MASTER) { D_ERROR( "Fusion/Init: Master role requested for a world (%d) " "we're already slave in!\n", world_index ); ret = DR_UNSUPPORTED; goto error; } break; case FER_SLAVE: if (world->fusion_id == FUSION_ID_MASTER) { D_ERROR( "Fusion/Init: Slave role requested for a world (%d) " "we're already master in!\n", world_index ); ret = DR_UNSUPPORTED; goto error; } break; case FER_ANY: break; } shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (shared->world_abi != abi_version) { D_ERROR( "Fusion/Init: World ABI (%d) of world '%d' doesn't match own (%d)!\n", shared->world_abi, world_index, abi_version ); ret = DR_VERSIONMISMATCH; goto error; } world->refs++; pthread_mutex_unlock( &fusion_worlds_lock ); D_DEBUG_AT( Fusion_Main, " -> using existing world %p [%d]\n", world, world_index ); /* Return the world. */ *ret_world = world; return DR_OK; } if (fd < 0) { D_PERROR( "Fusion/Init: Opening fusion device (world %d) as '%s' failed!\n", world_index, role == FER_ANY ? "any" : (role == FER_MASTER ? "master" : "slave") ); ret = DR_INIT; goto error; } /* Drop "identity" when running another program. */ if (fcntl( fd, F_SETFD, FD_CLOEXEC ) < 0) D_PERROR( "Fusion/Init: Setting FD_CLOEXEC flag failed!\n" ); /* Fill enter information. */ enter.api.major = FUSION_API_MAJOR_REQUIRED; enter.api.minor = FUSION_API_MINOR_REQUIRED; enter.fusion_id = 0; /* Clear for check below. */ /* Enter the fusion world. */ while (ioctl( fd, FUSION_ENTER, &enter )) { if (errno != EINTR) { D_PERROR( "Fusion/Init: Could not enter world '%d'!\n", world_index ); ret = DR_INIT; goto error; } } /* Check for valid Fusion ID. */ if (!enter.fusion_id) { D_ERROR( "Fusion/Init: Got no ID from FUSION_ENTER! Kernel module might be too old.\n" ); ret = DR_INIT; goto error; } D_DEBUG_AT( Fusion_Main, " -> Fusion ID 0x%08lx\n", enter.fusion_id ); /* Check slave role only, master is handled by O_EXCL earlier. */ if (role == FER_SLAVE && enter.fusion_id == FUSION_ID_MASTER) { D_PERROR( "Fusion/Init: Entering world '%d' as a slave failed!\n", world_index ); ret = DR_UNSUPPORTED; goto error; } /* Map shared area. */ shared = mmap( (void*) 0x20000000 + 0x2000 * world_index, sizeof(FusionWorldShared), PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd, 0 ); if (shared == MAP_FAILED) { D_PERROR( "Fusion/Init: Mapping shared area failed!\n" ); goto error; } D_DEBUG_AT( Fusion_Main, " -> shared area at %p, size %zu\n", shared, sizeof(FusionWorldShared) ); /* Initialize shared data. */ if (enter.fusion_id == FUSION_ID_MASTER) { /* Initialize reference counter. */ shared->refs = 1; /* Set ABI version. */ shared->world_abi = abi_version; /* Set the world index. */ shared->world_index = world_index; /* Set start time of world clock. */ gettimeofday( &shared->start_time, NULL ); D_MAGIC_SET( shared, FusionWorldShared ); } else { D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Check ABI version. */ if (shared->world_abi != abi_version) { D_ERROR( "Fusion/Init: World ABI (%d) doesn't match own (%d)!\n", shared->world_abi, abi_version ); ret = DR_VERSIONMISMATCH; goto error; } } /* Synchronize to world clock. */ direct_clock_set_start( &shared->start_time ); /* Allocate local data. */ world = D_CALLOC( 1, sizeof(FusionWorld) ); if (!world) { ret = D_OOM(); goto error; } /* Initialize local data. */ world->refs = 1; world->shared = shared; world->fusion_fd = fd; world->fusion_id = enter.fusion_id; D_MAGIC_SET( world, FusionWorld ); fusion_worlds[world_index] = world; /* Initialize shared memory part. */ ret = fusion_shm_init( world ); if (ret) goto error2; D_DEBUG_AT( Fusion_Main, " -> initializing other parts...\n" ); /* Initialize other parts. */ if (enter.fusion_id == FUSION_ID_MASTER) { fusion_skirmish_init( &shared->arenas_lock, "Fusion Arenas", world ); fusion_skirmish_init( &shared->reactor_globals, "Fusion Reactor Globals", world ); /* Create the main pool. */ ret = fusion_shm_pool_create( world, "Fusion Main Pool", 0x100000, fusion_config->debugshm, &shared->main_pool ); if (ret) goto error3; } D_DEBUG_AT( Fusion_Main, " -> starting dispatcher loop...\n" ); /* Start the dispatcher thread. */ world->dispatch_loop = direct_thread_create( DTT_MESSAGING, fusion_dispatch_loop, world, "Fusion Dispatch" ); if (!world->dispatch_loop) { ret = DR_FAILURE; goto error4; } /* Let others enter the world. */ if (enter.fusion_id == FUSION_ID_MASTER) { D_DEBUG_AT( Fusion_Main, " -> unblocking world...\n" ); while (ioctl( fd, FUSION_UNBLOCK )) { if (errno != EINTR) { D_PERROR( "Fusion/Init: Could not unblock world!\n" ); ret = DR_FUSION; goto error4; } } } D_DEBUG_AT( Fusion_Main, " -> done. (%p)\n", world ); pthread_mutex_unlock( &fusion_worlds_lock ); /* Return the fusion world. */ *ret_world = world; return DR_OK; error4: if (world->dispatch_loop) direct_thread_destroy( world->dispatch_loop ); if (enter.fusion_id == FUSION_ID_MASTER) fusion_shm_pool_destroy( world, shared->main_pool ); error3: if (enter.fusion_id == FUSION_ID_MASTER) { fusion_skirmish_destroy( &shared->arenas_lock ); fusion_skirmish_destroy( &shared->reactor_globals ); } fusion_shm_deinit( world ); error2: fusion_worlds[world_index] = world; D_MAGIC_CLEAR( world ); D_FREE( world ); error: if (shared && shared != MAP_FAILED) { if (enter.fusion_id == FUSION_ID_MASTER) D_MAGIC_CLEAR( shared ); munmap( shared, sizeof(FusionWorldShared) ); } if (fd != -1) close( fd ); pthread_mutex_unlock( &fusion_worlds_lock ); direct_shutdown(); return ret; } DirectResult fusion_stop_dispatcher( FusionWorld *world, bool emergency ) { if (!emergency) { fusion_sync( world ); direct_thread_lock( world->dispatch_loop ); } world->dispatch_stop = true; if (!emergency) { direct_thread_unlock( world->dispatch_loop ); fusion_sync( world ); } return DR_OK; } /* * Exits the fusion world. * * If 'emergency' is true the function won't join but kill the dispatcher thread. */ DirectResult fusion_exit( FusionWorld *world, bool emergency ) { FusionWorldShared *shared; D_DEBUG_AT( Fusion_Main, "%s( %p, %semergency )\n", __FUNCTION__, world, emergency ? "" : "no " ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); pthread_mutex_lock( &fusion_worlds_lock ); D_ASSERT( world->refs > 0 ); if (--world->refs) { pthread_mutex_unlock( &fusion_worlds_lock ); return DR_OK; } if (!emergency) { int foo; FusionSendMessage msg; /* Wake up the read loop thread. */ msg.fusion_id = world->fusion_id; msg.msg_id = 0; msg.msg_data = &foo; msg.msg_size = sizeof(foo); while (ioctl( world->fusion_fd, FUSION_SEND_MESSAGE, &msg ) < 0) { if (errno != EINTR) { D_PERROR( "FUSION_SEND_MESSAGE" ); direct_thread_cancel( world->dispatch_loop ); break; } } /* Wait for its termination. */ direct_thread_join( world->dispatch_loop ); } direct_thread_destroy( world->dispatch_loop ); /* Master has to deinitialize shared data. */ if (fusion_master( world )) { shared->refs--; if (shared->refs == 0) { fusion_skirmish_destroy( &shared->reactor_globals ); fusion_skirmish_destroy( &shared->arenas_lock ); fusion_shm_pool_destroy( world, shared->main_pool ); /* Deinitialize shared memory. */ fusion_shm_deinit( world ); } } else { /* Leave shared memory. */ fusion_shm_deinit( world ); } /* Reset local dispatch nodes. */ _fusion_reactor_free_all( world ); /* Remove world from global list. */ fusion_worlds[shared->world_index] = NULL; /* Unmap shared area. */ if (fusion_master( world ) && shared->refs == 0) D_MAGIC_CLEAR( shared ); munmap( shared, sizeof(FusionWorldShared) ); /* Close Fusion Kernel Device. */ close( world->fusion_fd ); /* Free local world data. */ D_MAGIC_CLEAR( world ); D_FREE( world ); pthread_mutex_unlock( &fusion_worlds_lock ); direct_shutdown(); return DR_OK; } /* * Sends a signal to one or more fusionees and optionally waits * for their processes to terminate. * * A fusion_id of zero means all fusionees but the calling one. * A timeout of zero means infinite waiting while a negative value * means no waiting at all. */ DirectResult fusion_kill( FusionWorld *world, FusionID fusion_id, int signal, int timeout_ms ) { FusionKill param; D_MAGIC_ASSERT( world, FusionWorld ); param.fusion_id = fusion_id; param.signal = signal; param.timeout_ms = timeout_ms; while (ioctl( world->fusion_fd, FUSION_KILL, ¶m )) { switch (errno) { case EINTR: continue; case ETIMEDOUT: return DR_TIMEOUT; default: break; } D_PERROR ("FUSION_KILL"); return DR_FAILURE; } return DR_OK; } /**********************************************************************************************************************/ static void * fusion_dispatch_loop( DirectThread *thread, void *arg ) { int len = 0; int result; char buf[FUSION_MESSAGE_SIZE]; fd_set set; FusionWorld *world = arg; D_DEBUG_AT( Fusion_Main_Dispatch, "%s() running...\n", __FUNCTION__ ); while (true) { char *buf_p = buf; D_MAGIC_ASSERT( world, FusionWorld ); FD_ZERO( &set ); FD_SET( world->fusion_fd, &set ); result = select( world->fusion_fd + 1, &set, NULL, NULL, NULL ); if (result < 0) { switch (errno) { case EINTR: continue; default: D_PERROR( "Fusion/Dispatcher: select() failed!\n" ); return NULL; } } D_MAGIC_ASSERT( world, FusionWorld ); if (FD_ISSET( world->fusion_fd, &set )) { len = read( world->fusion_fd, buf, FUSION_MESSAGE_SIZE ); if (len < 0) break; D_DEBUG_AT( Fusion_Main_Dispatch, " -> got %d bytes...\n", len ); direct_thread_lock( world->dispatch_loop ); if (world->dispatch_stop) { D_DEBUG_AT( Fusion_Main_Dispatch, " -> IGNORING (dispatch_stop!)\n" ); } else { while (buf_p < buf + len) { FusionReadMessage *header = (FusionReadMessage*) buf_p; void *data = buf_p + sizeof(FusionReadMessage); if (world->dispatch_stop) { D_DEBUG_AT( Fusion_Main_Dispatch, " -> ABORTING (dispatch_stop!)\n" ); break; } D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( (buf + len - buf_p) >= sizeof(FusionReadMessage) ); switch (header->msg_type) { case FMT_SEND: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_SEND!\n" ); break; case FMT_CALL: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_CALL...\n" ); _fusion_call_process( world, header->msg_id, data ); break; case FMT_REACTOR: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_REACTOR...\n" ); _fusion_reactor_process_message( world, header->msg_id, header->msg_channel, data ); break; case FMT_SHMPOOL: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_SHMPOOL...\n" ); _fusion_shmpool_process( world, header->msg_id, data ); break; default: D_DEBUG( "Fusion/Receiver: discarding message of unknown type '%d'\n", header->msg_type ); break; } buf_p = data + ((header->msg_size + 3) & ~3); } } direct_thread_unlock( world->dispatch_loop ); if (!world->refs) { D_DEBUG_AT( Fusion_Main_Dispatch, " -> good bye!\n" ); return NULL; } } } D_PERROR( "Fusion/Receiver: reading from fusion device failed!\n" ); return NULL; } /**********************************************************************************************************************/ #else /* FUSION_BUILD_KERNEL */ #include #include typedef struct { DirectLink link; FusionRef *ref; int count; } __FusioneeRef; typedef struct { DirectLink link; FusionID id; pid_t pid; DirectLink *refs; } __Fusionee; /**********************************************************************************************************************/ static DirectResult _fusion_add_fusionee( FusionWorld *world, FusionID fusion_id ) { DirectResult ret; FusionWorldShared *shared; __Fusionee *fusionee; D_DEBUG_AT( Fusion_Main, "%s( %p, %lu )\n", __FUNCTION__, world, fusion_id ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); fusionee = SHCALLOC( shared->main_pool, 1, sizeof(__Fusionee) ); if (!fusionee) return D_OOSHM(); fusionee->id = fusion_id; fusionee->pid = direct_gettid(); ret = fusion_skirmish_prevail( &shared->fusionees_lock ); if (ret) { SHFREE( shared->main_pool, fusionee ); return ret; } direct_list_append( &shared->fusionees, &fusionee->link ); fusion_skirmish_dismiss( &shared->fusionees_lock ); /* Set local pointer. */ world->fusionee = fusionee; return DR_OK; } void _fusion_add_local( FusionWorld *world, FusionRef *ref, int add ) { FusionWorldShared *shared; __Fusionee *fusionee; __FusioneeRef *fusionee_ref; //D_DEBUG_AT( Fusion_Main, "%s( %p, %p, %d )\n", __FUNCTION__, world, ref, add ); D_ASSERT( ref != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); fusionee = world->fusionee; D_ASSERT( fusionee != NULL ); direct_list_foreach (fusionee_ref, fusionee->refs) { if (fusionee_ref->ref == ref) break; } if (fusionee_ref) { fusionee_ref->count += add; //D_DEBUG_AT( Fusion_Main, " -> refs = %d\n", fusionee_ref->count ); if (fusionee_ref->count == 0) { direct_list_remove( &fusionee->refs, &fusionee_ref->link ); SHFREE( shared->main_pool, fusionee_ref ); } } else { if (add <= 0) /* called from _fusion_remove_fusionee() */ return; //D_DEBUG_AT( Fusion_Main, " -> new ref\n" ); fusionee_ref = SHCALLOC( shared->main_pool, 1, sizeof(__FusioneeRef) ); if (!fusionee_ref) { D_OOSHM(); return; } fusionee_ref->ref = ref; fusionee_ref->count = add; direct_list_prepend( &fusionee->refs, &fusionee_ref->link ); } } void _fusion_check_locals( FusionWorld *world, FusionRef *ref ) { FusionWorldShared *shared; __Fusionee *fusionee; __FusioneeRef *fusionee_ref, *temp; DirectLink *list = NULL; D_DEBUG_AT( Fusion_Main, "%s( %p, %p )\n", __FUNCTION__, world, ref ); D_ASSERT( ref != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (fusion_skirmish_prevail( &shared->fusionees_lock )) return; direct_list_foreach (fusionee, shared->fusionees) { if (fusionee->id == world->fusion_id) continue; direct_list_foreach (fusionee_ref, fusionee->refs) { if (fusionee_ref->ref == ref) { if (kill( fusionee->pid, 0 ) < 0 && errno == ESRCH) { direct_list_remove( &fusionee->refs, &fusionee_ref->link ); direct_list_append( &list, &fusionee_ref->link ); } break; } } } fusion_skirmish_dismiss( &shared->fusionees_lock ); direct_list_foreach_safe (fusionee_ref, temp, list) { _fusion_ref_change( ref, -fusionee_ref->count, false ); SHFREE( shared->main_pool, fusionee_ref ); } } void _fusion_remove_all_locals( FusionWorld *world, const FusionRef *ref ) { FusionWorldShared *shared; __Fusionee *fusionee; __FusioneeRef *fusionee_ref, *temp; D_DEBUG_AT( Fusion_Main, "%s( %p, %p )\n", __FUNCTION__, world, ref ); D_ASSERT( ref != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (fusion_skirmish_prevail( &shared->fusionees_lock )) return; direct_list_foreach (fusionee, shared->fusionees) { direct_list_foreach_safe (fusionee_ref, temp, fusionee->refs) { if (fusionee_ref->ref == ref) { direct_list_remove( &fusionee->refs, &fusionee_ref->link ); SHFREE( shared->main_pool, fusionee_ref ); } } } fusion_skirmish_dismiss( &shared->fusionees_lock ); } static void _fusion_remove_fusionee( FusionWorld *world, FusionID fusion_id ) { FusionWorldShared *shared; __Fusionee *fusionee; __FusioneeRef *fusionee_ref, *temp; D_DEBUG_AT( Fusion_Main, "%s( %p, %lu )\n", __FUNCTION__, world, fusion_id ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); fusion_skirmish_prevail( &shared->fusionees_lock ); if (fusion_id == world->fusion_id) { fusionee = world->fusionee; } else { direct_list_foreach (fusionee, shared->fusionees) { if (fusionee->id == fusion_id) break; } } if (!fusionee) { D_DEBUG_AT( Fusion_Main, "Fusionee %lu not found!\n", fusion_id ); fusion_skirmish_dismiss( &shared->fusionees_lock ); return; } direct_list_remove( &shared->fusionees, &fusionee->link ); fusion_skirmish_dismiss( &shared->fusionees_lock ); direct_list_foreach_safe (fusionee_ref, temp, fusionee->refs) { direct_list_remove( &fusionee->refs, &fusionee_ref->link ); _fusion_ref_change( fusionee_ref->ref, -fusionee_ref->count, false ); SHFREE( shared->main_pool, fusionee_ref ); } SHFREE( shared->main_pool, fusionee ); } /**********************************************************************************************************************/ DirectResult _fusion_send_message( int fd, const void *msg, size_t msg_size, struct sockaddr_un *addr ) { socklen_t len = sizeof(struct sockaddr_un); D_ASSERT( msg != NULL ); if (!addr) { addr = alloca( sizeof(struct sockaddr_un) ); getsockname( fd, (struct sockaddr*)addr, &len ); } while (sendto( fd, msg, msg_size, 0, (struct sockaddr*)addr, len ) < 0) { switch (errno) { case EINTR: continue; case ECONNREFUSED: return DR_FUSION; default: break; } D_PERROR( "Fusion: sendto()\n" ); return DR_IO; } return DR_OK; } DirectResult _fusion_recv_message( int fd, void *msg, size_t msg_size, struct sockaddr_un *addr ) { socklen_t len = addr ? sizeof(struct sockaddr_un) : 0; D_ASSERT( msg != NULL ); while (recvfrom( fd, msg, msg_size, 0, (struct sockaddr*)addr, &len ) < 0) { switch (errno) { case EINTR: continue; case ECONNREFUSED: return DR_FUSION; default: break; } D_PERROR( "Fusion: recvfrom()\n" ); return DR_IO; } return DR_OK; } /**********************************************************************************************************************/ static void fusion_fork_handler_prepare( void ) { int i; D_DEBUG_AT( Fusion_Main, "%s()\n", __FUNCTION__ ); for (i=0; ifork_callback) world->fork_callback( world->fork_action, FFS_PREPARE ); } } static void fusion_fork_handler_parent( void ) { int i; D_DEBUG_AT( Fusion_Main, "%s()\n", __FUNCTION__ ); for (i=0; ishared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (world->fork_callback) world->fork_callback( world->fork_action, FFS_PARENT ); if (world->fork_action == FFA_FORK) { /* Increase the shared reference counter. */ if (fusion_master( world )) shared->refs++; /* Cancel the dispatcher to prevent conflicts. */ direct_thread_cancel( world->dispatch_loop ); } } } static void fusion_fork_handler_child( void ) { int i; D_DEBUG_AT( Fusion_Main, "%s()\n", __FUNCTION__ ); for (i=0; ishared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (world->fork_callback) world->fork_callback( world->fork_action, FFS_CHILD ); switch (world->fork_action) { default: D_BUG( "unknown fork action %d", world->fork_action ); case FFA_CLOSE: D_DEBUG_AT( Fusion_Main, " -> closing world %d\n", i ); /* Remove world from global list. */ fusion_worlds[i] = NULL; /* Unmap shared area. */ munmap( world->shared, sizeof(FusionWorldShared) ); /* Close socket. */ close( world->fusion_fd ); /* Free local world data. */ D_MAGIC_CLEAR( world ); D_FREE( world ); break; case FFA_FORK: { __Fusionee *fusionee; __FusioneeRef *fusionee_ref; D_DEBUG_AT( Fusion_Main, " -> forking in world %d\n", i ); fusionee = world->fusionee; D_DEBUG_AT( Fusion_Main, " -> duplicating fusion id %lu\n", world->fusion_id ); fusion_skirmish_prevail( &shared->fusionees_lock ); if (_fusion_add_fusionee( world, world->fusion_id )) { fusion_skirmish_dismiss( &shared->fusionees_lock ); raise( SIGTRAP ); } D_DEBUG_AT( Fusion_Main, " -> duplicating local refs...\n" ); direct_list_foreach (fusionee_ref, fusionee->refs) { __FusioneeRef *new_ref; new_ref = SHCALLOC( shared->main_pool, 1, sizeof(__FusioneeRef) ); if (!new_ref) { D_OOSHM(); fusion_skirmish_dismiss( &shared->fusionees_lock ); raise( SIGTRAP ); } new_ref->ref = fusionee_ref->ref; new_ref->count = fusionee_ref->count; /* Avoid locking. */ new_ref->ref->multi.builtin.local += new_ref->count; direct_list_append( &((__Fusionee*)world->fusionee)->refs, &new_ref->link ); } fusion_skirmish_dismiss( &shared->fusionees_lock ); D_DEBUG_AT( Fusion_Main, " -> restarting dispatcher loop...\n" ); /* Restart the dispatcher thread. FIXME: free old struct */ world->dispatch_loop = direct_thread_create( DTT_MESSAGING, fusion_dispatch_loop, world, "Fusion Dispatch" ); if (!world->dispatch_loop) raise( SIGTRAP ); } break; } } } /**********************************************************************************************************************/ /* * Enters a fusion world by joining or creating it. * * If world is negative, the next free index is used to create a new world. * Otherwise the world with the specified index is joined or created. */ DirectResult fusion_enter( int world_index, int abi_version, FusionEnterRole role, FusionWorld **ret_world ) { DirectResult ret = DR_OK; int fd = -1; FusionID id = -1; FusionWorld *world = NULL; FusionWorldShared *shared = MAP_FAILED; struct sockaddr_un addr; char buf[128]; int len, err; D_DEBUG_AT( Fusion_Main, "%s( %d, %d, %p )\n", __FUNCTION__, world_index, abi_version, ret_world ); D_ASSERT( ret_world != NULL ); if (world_index >= FUSION_MAX_WORLDS) { D_ERROR( "Fusion/Init: World index %d exceeds maximum index %d!\n", world_index, FUSION_MAX_WORLDS - 1 ); return DR_INVARG; } if (fusion_config->force_slave) role = FER_SLAVE; pthread_once( &fusion_init_once, init_once ); direct_initialize(); fd = socket( PF_LOCAL, SOCK_RAW, 0 ); if (fd < 0) { D_PERROR( "Fusion/Init: Error creating local socket!\n" ); return DR_IO; } /* Set close-on-exec flag. */ if (fcntl( fd, F_SETFD, FD_CLOEXEC ) < 0) D_PERROR( "Fusion/Init: Couldn't set close-on-exec flag!\n" ); pthread_mutex_lock( &fusion_worlds_lock ); addr.sun_family = AF_UNIX; if (world_index < 0) { if (role == FER_SLAVE) { D_ERROR( "Fusion/Init: Slave role and a new world (index -1) was requested!\n" ); pthread_mutex_unlock( &fusion_worlds_lock ); close( fd ); return DR_INVARG; } for (world_index=0; world_indexshmfile_gid != (gid_t)-1) chown( addr.sun_path, -1, fusion_config->shmfile_gid ); } snprintf( addr.sun_path+len, sizeof(addr.sun_path)-len, "%lx", FUSION_ID_MASTER ); /* Bind to address. */ err = bind( fd, (struct sockaddr*)&addr, sizeof(addr) ); if (err == 0) { chmod( addr.sun_path, 0660 ); /* Change group, if requested. */ if (fusion_config->shmfile_gid != (gid_t)-1) chown( addr.sun_path, -1, fusion_config->shmfile_gid ); id = FUSION_ID_MASTER; break; } } } else { world = fusion_worlds[world_index]; if (!world) { len = snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/", world_index ); /* Make socket directory if it doesn't exits. */ if (mkdir( addr.sun_path, 0775 ) == 0) { chmod( addr.sun_path, 0775 ); if (fusion_config->shmfile_gid != (gid_t)-1) chown( addr.sun_path, -1, fusion_config->shmfile_gid ); } /* Check wether we are master. */ snprintf( addr.sun_path+len, sizeof(addr.sun_path)-len, "%lx", FUSION_ID_MASTER ); err = bind( fd, (struct sockaddr*)&addr, sizeof(addr) ); if (err < 0) { if (role == FER_MASTER) { D_ERROR( "Fusion/Main: Couldn't start session as master! Remove %s.\n", addr.sun_path ); ret = DR_INIT; goto error; } /* Auto generate slave id. */ for (id = FUSION_ID_MASTER+1; id < (FusionID)-1; id++) { snprintf( addr.sun_path+len, sizeof(addr.sun_path)-len, "%lx", id ); err = bind( fd, (struct sockaddr*)&addr, sizeof(addr) ); if (err == 0) { chmod( addr.sun_path, 0660 ); /* Change group, if requested. */ if (fusion_config->shmfile_gid != (gid_t)-1) chown( addr.sun_path, -1, fusion_config->shmfile_gid ); break; } } } else if (err == 0 && role != FER_SLAVE) { chmod( addr.sun_path, 0660 ); /* Change group, if requested. */ if (fusion_config->shmfile_gid != (gid_t)-1) chown( addr.sun_path, -1, fusion_config->shmfile_gid ); id = FUSION_ID_MASTER; } } } /* Enter a world again? */ if (world) { D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( world->refs > 0 ); /* Check the role again. */ switch (role) { case FER_MASTER: if (world->fusion_id != FUSION_ID_MASTER) { D_ERROR( "Fusion/Init: Master role requested for a world (%d) " "we're already slave in!\n", world_index ); ret = DR_UNSUPPORTED; goto error; } break; case FER_SLAVE: if (world->fusion_id == FUSION_ID_MASTER) { D_ERROR( "Fusion/Init: Slave role requested for a world (%d) " "we're already master in!\n", world_index ); ret = DR_UNSUPPORTED; goto error; } break; case FER_ANY: break; } shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); if (shared->world_abi != abi_version) { D_ERROR( "Fusion/Init: World ABI (%d) of world '%d' doesn't match own (%d)!\n", shared->world_abi, world_index, abi_version ); ret = DR_VERSIONMISMATCH; goto error; } world->refs++; pthread_mutex_unlock( &fusion_worlds_lock ); D_DEBUG_AT( Fusion_Main, " -> using existing world %p [%d]\n", world, world_index ); close( fd ); /* Return the world. */ *ret_world = world; return DR_OK; } if (id == (FusionID)-1) { D_ERROR( "Fusion/Init: Opening fusion socket (world %d) as '%s' failed!\n", world_index, role == FER_ANY ? "any" : (role == FER_MASTER ? "master" : "slave") ); ret = DR_INIT; goto error; } D_DEBUG_AT( Fusion_Main, " -> Fusion ID 0x%08lx\n", id ); if (id == FUSION_ID_MASTER) { int shared_fd; snprintf( buf, sizeof(buf), "%s/fusion.%d.core", fusion_config->tmpfs ? : "/dev/shm", world_index ); /* Open shared memory file. */ shared_fd = open( buf, O_RDWR | O_CREAT | O_TRUNC, 0660 ); if (shared_fd < 0) { D_PERROR( "Fusion/Init: Couldn't open shared memory file!\n" ); ret = DR_INIT; goto error; } if (fusion_config->shmfile_gid != (gid_t)-1) { if (fchown( shared_fd, -1, fusion_config->shmfile_gid ) != 0) D_INFO( "Fusion/Init: Changing owner on %s failed... continuing on.\n", buf ); } fchmod( shared_fd, 0660 ); ftruncate( shared_fd, sizeof(FusionWorldShared) ); /* Map shared area. */ shared = mmap( (void*) 0x20000000 + 0x2000 * world_index, sizeof(FusionWorldShared), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, shared_fd, 0 ); if (shared == MAP_FAILED) { D_PERROR( "Fusion/Init: Mapping shared area failed!\n" ); close( shared_fd ); ret = DR_INIT; goto error; } close( shared_fd ); D_DEBUG_AT( Fusion_Main, " -> shared area at %p, size %zu\n", shared, sizeof(FusionWorldShared) ); /* Initialize reference counter. */ shared->refs = 1; /* Set ABI version. */ shared->world_abi = abi_version; /* Set the world index. */ shared->world_index = world_index; /* Set pool allocation base/max. */ shared->pool_base = (void*)0x20000000 + 0x2000 * FUSION_MAX_WORLDS + 0x8000000 * world_index; shared->pool_max = shared->pool_base + 0x8000000 - 1; /* Set start time of world clock. */ gettimeofday( &shared->start_time, NULL ); D_MAGIC_SET( shared, FusionWorldShared ); } else { FusionEnter enter; int shared_fd; /* Fill enter information. */ enter.type = FMT_ENTER; enter.fusion_id = id; snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/%lx", world_index, FUSION_ID_MASTER ); /* Send enter message (used to sync with the master) */ ret = _fusion_send_message( fd, &enter, sizeof(FusionEnter), &addr ); if (ret == DR_OK) { ret = _fusion_recv_message( fd, &enter, sizeof(FusionEnter), NULL ); if (ret == DR_OK && enter.type != FMT_ENTER) { D_ERROR( "Fusion/Init: Expected message ENTER, got '%d'!\n", enter.type ); ret = DR_FUSION; } } if (ret) { D_ERROR( "Fusion/Init: Could not enter world '%d'!\n", world_index ); goto error; } snprintf( buf, sizeof(buf), "%s/fusion.%d.core", fusion_config->tmpfs ? : "/dev/shm", world_index ); /* Open shared memory file. */ shared_fd = open( buf, O_RDWR ); if (shared_fd < 0) { D_PERROR( "Fusion/Init: Couldn't open shared memory file!\n" ); ret = DR_INIT; goto error; } /* Map shared area. */ shared = mmap( (void*) 0x20000000 + 0x2000 * world_index, sizeof(FusionWorldShared), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, shared_fd, 0 ); if (shared == MAP_FAILED) { D_PERROR( "Fusion/Init: Mapping shared area failed!\n" ); close( shared_fd ); ret = DR_INIT; goto error; } close( shared_fd ); D_DEBUG_AT( Fusion_Main, " -> shared area at %p, size %zu\n", shared, sizeof(FusionWorldShared) ); D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Check ABI version. */ if (shared->world_abi != abi_version) { D_ERROR( "Fusion/Init: World ABI (%d) doesn't match own (%d)!\n", shared->world_abi, abi_version ); ret = DR_VERSIONMISMATCH; goto error; } } /* Synchronize to world clock. */ direct_clock_set_start( &shared->start_time ); /* Allocate local data. */ world = D_CALLOC( 1, sizeof(FusionWorld) ); if (!world) { ret = D_OOM(); goto error; } /* Initialize local data. */ world->refs = 1; world->shared = shared; world->fusion_fd = fd; world->fusion_id = id; D_MAGIC_SET( world, FusionWorld ); fusion_worlds[world_index] = world; /* Initialize shared memory part. */ ret = fusion_shm_init( world ); if (ret) goto error2; D_DEBUG_AT( Fusion_Main, " -> initializing other parts...\n" ); /* Initialize other parts. */ if (world->fusion_id == FUSION_ID_MASTER) { fusion_skirmish_init( &shared->arenas_lock, "Fusion Arenas", world ); fusion_skirmish_init( &shared->reactor_globals, "Fusion Reactor Globals", world ); fusion_skirmish_init( &shared->fusionees_lock, "Fusionees", world ); /* Create the main pool. */ ret = fusion_shm_pool_create( world, "Fusion Main Pool", 0x100000, fusion_config->debugshm, &shared->main_pool ); if (ret) goto error3; } /* Add ourselves to the list of fusionees. */ ret = _fusion_add_fusionee( world, id ); if (ret) goto error4; D_DEBUG_AT( Fusion_Main, " -> starting dispatcher loop...\n" ); /* Start the dispatcher thread. */ world->dispatch_loop = direct_thread_create( DTT_MESSAGING, fusion_dispatch_loop, world, "Fusion Dispatch" ); if (!world->dispatch_loop) { ret = DR_FAILURE; goto error5; } D_DEBUG_AT( Fusion_Main, " -> done. (%p)\n", world ); pthread_mutex_unlock( &fusion_worlds_lock ); /* Return the fusion world. */ *ret_world = world; return DR_OK; error5: if (world->dispatch_loop) direct_thread_destroy( world->dispatch_loop ); _fusion_remove_fusionee( world, id ); error4: if (world->fusion_id == FUSION_ID_MASTER) fusion_shm_pool_destroy( world, shared->main_pool ); error3: if (world->fusion_id == FUSION_ID_MASTER) { fusion_skirmish_destroy( &shared->arenas_lock ); fusion_skirmish_destroy( &shared->reactor_globals ); fusion_skirmish_destroy( &shared->fusionees_lock ); } fusion_shm_deinit( world ); error2: fusion_worlds[world_index] = world; D_MAGIC_CLEAR( world ); D_FREE( world ); error: if (shared != MAP_FAILED) { if (id == FUSION_ID_MASTER) D_MAGIC_CLEAR( shared ); munmap( shared, sizeof(FusionWorldShared) ); } if (fd != -1) { /* Unbind. */ socklen_t len = sizeof(addr); if (getsockname( fd, (struct sockaddr*)&addr, &len ) == 0) unlink( addr.sun_path ); close( fd ); } pthread_mutex_unlock( &fusion_worlds_lock ); direct_shutdown(); return ret; } DirectResult fusion_stop_dispatcher( FusionWorld *world, bool emergency ) { if (!emergency) { fusion_sync( world ); direct_thread_lock( world->dispatch_loop ); } world->dispatch_stop = true; if (!emergency) { direct_thread_unlock( world->dispatch_loop ); fusion_sync( world ); } return DR_OK; } /* * Exits the fusion world. * * If 'emergency' is true the function won't join but kill the dispatcher thread. */ DirectResult fusion_exit( FusionWorld *world, bool emergency ) { FusionWorldShared *shared; int world_index; bool clear = false; D_DEBUG_AT( Fusion_Main, "%s( %p, %semergency )\n", __FUNCTION__, world, emergency ? "" : "no " ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); world_index = shared->world_index; pthread_mutex_lock( &fusion_worlds_lock ); D_ASSERT( world->refs > 0 ); if (--world->refs) { pthread_mutex_unlock( &fusion_worlds_lock ); return DR_OK; } if (!emergency) { FusionMessageType msg = FMT_SEND; /* Wakeup dispatcher. */ if (_fusion_send_message( world->fusion_fd, &msg, sizeof(msg), NULL )) direct_thread_cancel( world->dispatch_loop ); /* Wait for its termination. */ direct_thread_join( world->dispatch_loop ); } direct_thread_destroy( world->dispatch_loop ); /* Remove ourselves from list. */ if (!emergency || fusion_master( world )) { _fusion_remove_fusionee( world, world->fusion_id ); } else { struct sockaddr_un addr; FusionLeave leave; addr.sun_family = AF_UNIX; snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/%lx", world_index, FUSION_ID_MASTER ); leave.type = FMT_LEAVE; leave.fusion_id = world->fusion_id; _fusion_send_message( world->fusion_fd, &leave, sizeof(FusionLeave), &addr ); } /* Master has to deinitialize shared data. */ if (fusion_master( world )) { shared->refs--; if (shared->refs == 0) { fusion_skirmish_destroy( &shared->reactor_globals ); fusion_skirmish_destroy( &shared->arenas_lock ); fusion_skirmish_destroy( &shared->fusionees_lock ); fusion_shm_pool_destroy( world, shared->main_pool ); /* Deinitialize shared memory. */ fusion_shm_deinit( world ); clear = true; } } else { /* Leave shared memory. */ fusion_shm_deinit( world ); } /* Reset local dispatch nodes. */ _fusion_reactor_free_all( world ); /* Remove world from global list. */ fusion_worlds[shared->world_index] = NULL; /* Unmap shared area. */ if (clear) D_MAGIC_CLEAR( shared ); munmap( shared, sizeof(FusionWorldShared) ); /* Close socket. */ close( world->fusion_fd ); if (clear) { DIR *dir; char buf[128]; int len; /* Remove core shmfile. */ snprintf( buf, sizeof(buf), "%s/fusion.%d.core", fusion_config->tmpfs ? : "/dev/shm", world_index ); D_DEBUG_AT( Fusion_Main, "Removing shmfile %s.\n", buf ); unlink( buf ); /* Cleanup socket directory. */ len = snprintf( buf, sizeof(buf), "/tmp/.fusion-%d/", world_index ); dir = opendir( buf ); if (dir) { struct dirent *entry = NULL; struct dirent tmp; while (readdir_r( dir, &tmp, &entry ) == 0 && entry) { if (entry->d_name[0] != '.') { struct stat st; direct_snputs( buf+len, entry->d_name, sizeof(buf)-len ); if (stat( buf, &st ) == 0 && S_ISSOCK(st.st_mode)) { D_DEBUG_AT( Fusion_Main, "Removing socket %s.\n", buf ); unlink( buf ); } } } closedir( dir ); } else { D_PERROR( "Fusion/Main: Couldn't open socket directory %s", buf ); } } /* Free local world data. */ D_MAGIC_CLEAR( world ); D_FREE( world ); D_DEBUG_AT( Fusion_Main, "%s( %p ) done.\n", __FUNCTION__, world ); pthread_mutex_unlock( &fusion_worlds_lock ); direct_shutdown(); return DR_OK; } /* * Sends a signal to one or more fusionees and optionally waits * for their processes to terminate. * * A fusion_id of zero means all fusionees but the calling one. * A timeout of zero means infinite waiting while a negative value * means no waiting at all. */ DirectResult fusion_kill( FusionWorld *world, FusionID fusion_id, int signal, int timeout_ms ) { FusionWorldShared *shared; __Fusionee *fusionee, *temp; int result; D_DEBUG_AT( Fusion_Main, "%s( %p, %lu, %d, %d )\n", __FUNCTION__, world, fusion_id, signal, timeout_ms ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); fusion_skirmish_prevail( &shared->fusionees_lock ); direct_list_foreach_safe (fusionee, temp, shared->fusionees) { if (fusion_id == 0 && fusionee->id == world->fusion_id) continue; if (fusion_id != 0 && fusionee->id != fusion_id) continue; D_DEBUG_AT( Fusion_Main, " -> killing fusionee %lu (%d)...\n", fusionee->id, fusionee->pid ); result = kill( fusionee->pid, signal ); if (result == 0 && timeout_ms >= 0) { pid_t pid = fusionee->pid; long long stop = timeout_ms ? (direct_clock_get_micros() + timeout_ms*1000) : 0; fusion_skirmish_dismiss( &shared->fusionees_lock ); while (kill( pid, 0 ) == 0) { usleep( 1000 ); if (timeout_ms && direct_clock_get_micros() >= stop) break; }; fusion_skirmish_prevail( &shared->fusionees_lock ); } else if (result < 0) { if (errno == ESRCH) { D_DEBUG_AT( Fusion_Main, " ... fusionee %lu exited without removing itself!\n", fusionee->id ); _fusion_remove_fusionee( world, fusionee->id ); } else { D_PERROR( "Fusion/Main: kill(%d, %d)\n", fusionee->pid, signal ); } } } fusion_skirmish_dismiss( &shared->fusionees_lock ); return DR_OK; } /**********************************************************************************************************************/ static void * fusion_dispatch_loop( DirectThread *self, void *arg ) { FusionWorld *world = arg; struct sockaddr_un addr; socklen_t addr_len = sizeof(addr); fd_set set; char buf[FUSION_MESSAGE_SIZE]; D_DEBUG_AT( Fusion_Main_Dispatch, "%s() running...\n", __FUNCTION__ ); while (true) { int result; D_MAGIC_ASSERT( world, FusionWorld ); FD_ZERO( &set ); FD_SET( world->fusion_fd, &set ); result = select( world->fusion_fd + 1, &set, NULL, NULL, NULL ); if (result < 0) { switch (errno) { case EINTR: continue; default: D_PERROR( "Fusion/Dispatcher: select() failed!\n" ); return NULL; } } D_MAGIC_ASSERT( world, FusionWorld ); if (FD_ISSET( world->fusion_fd, &set ) && recvfrom( world->fusion_fd, buf, sizeof(buf), 0, (struct sockaddr*)&addr, &addr_len ) > 0) { FusionMessage *msg = (FusionMessage*)buf; pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, NULL ); D_DEBUG_AT( Fusion_Main_Dispatch, " -> message from '%s'...\n", addr.sun_path ); direct_thread_lock( world->dispatch_loop ); if (world->dispatch_stop) { D_DEBUG_AT( Fusion_Main_Dispatch, " -> IGNORING (dispatch_stop!)\n" ); } else { switch (msg->type) { case FMT_SEND: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_SEND...\n" ); break; case FMT_ENTER: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_ENTER...\n" ); if (!fusion_master( world )) { D_ERROR( "Fusion/Dispatch: Got ENTER request, but I'm not master!\n" ); break; } if (msg->enter.fusion_id == world->fusion_id) { D_ERROR( "Fusion/Dispatch: Received ENTER request from myself!\n" ); break; } /* Nothing to do here. Send back message. */ _fusion_send_message( world->fusion_fd, msg, sizeof(FusionEnter), &addr ); break; case FMT_LEAVE: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_LEAVE...\n" ); if (!fusion_master( world )) { D_ERROR( "Fusion/Dispatch: Got LEAVE request, but I'm not master!\n" ); break; } if (msg->leave.fusion_id == world->fusion_id) { D_ERROR( "Fusion/Dispatch: Received LEAVE request from myself!\n" ); break; } _fusion_remove_fusionee( world, msg->leave.fusion_id ); break; case FMT_CALL: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_CALL...\n" ); _fusion_call_process( world, msg->call.call_id, &msg->call ); break; case FMT_REACTOR: D_DEBUG_AT( Fusion_Main_Dispatch, " -> FMT_REACTOR...\n" ); _fusion_reactor_process_message( world, msg->reactor.id, msg->reactor.channel, &buf[sizeof(FusionReactorMessage)] ); if (msg->reactor.ref) { fusion_ref_down( msg->reactor.ref, true ); if (fusion_ref_zero_trylock( msg->reactor.ref ) == DR_OK) { fusion_ref_destroy( msg->reactor.ref ); SHFREE( world->shared->main_pool, msg->reactor.ref ); } } break; default: D_BUG( "unexpected message type (%d)", msg->type ); break; } } direct_thread_unlock( world->dispatch_loop ); if (!world->refs) { D_DEBUG_AT( Fusion_Main_Dispatch, " -> good bye!\n" ); return NULL; } D_DEBUG_AT( Fusion_Main_Dispatch, " ...done\n" ); pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, NULL ); } } return NULL; } /**********************************************************************************************************************/ #endif /* FUSION_BUILD_KERNEL */ /* * Wait until all pending messages are processed. */ DirectResult fusion_sync( const FusionWorld *world ) { int result; fd_set set; struct timeval tv; int loops = 200; D_MAGIC_ASSERT( world, FusionWorld ); D_DEBUG_AT( Fusion_Main, "%s( %p )\n", __FUNCTION__, world ); D_DEBUG_AT( Fusion_Main, "syncing with fusion device...\n" ); while (loops--) { FD_ZERO( &set ); FD_SET( world->fusion_fd, &set ); tv.tv_sec = 0; tv.tv_usec = 20000; result = select( world->fusion_fd + 1, &set, NULL, NULL, &tv ); D_DEBUG_AT( Fusion_Main, " -> select() returned %d...\n", result ); switch (result) { case -1: if (errno == EINTR) return DR_OK; D_PERROR( "Fusion/Sync: select() failed!\n"); return DR_FAILURE; default: D_DEBUG_AT( Fusion_Main, " -> FD_ISSET %d...\n", FD_ISSET( world->fusion_fd, &set ) ); if (FD_ISSET( world->fusion_fd, &set )) { usleep( 20000 ); break; } case 0: D_DEBUG_AT( Fusion_Main, " -> synced.\n"); return DR_OK; } } D_DEBUG_AT( Fusion_Main, " -> timeout!\n"); D_ERROR( "Fusion/Main: Timeout waiting for empty message queue!\n" ); return DR_TIMEOUT; } /* * Sets the fork() action of the calling Fusionee within the world. */ void fusion_world_set_fork_action( FusionWorld *world, FusionForkAction action ) { D_MAGIC_ASSERT( world, FusionWorld ); world->fork_action = action; } /* * Gets the current fork() action. */ FusionForkAction fusion_world_get_fork_action( FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return world->fork_action; } /* * Registers a callback called upon fork(). */ void fusion_world_set_fork_callback( FusionWorld *world, FusionForkCallback callback ) { D_MAGIC_ASSERT( world, FusionWorld ); world->fork_callback = callback; } /* * Return the index of the specified world. */ int fusion_world_index( const FusionWorld *world ) { FusionWorldShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); return shared->world_index; } /* * Return the own Fusion ID within the specified world. */ FusionID fusion_id( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return world->fusion_id; } /* * Return if the world is a multi application world. */ bool fusion_is_multi( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return true; } /* * Return the thread ID of the Fusion Dispatcher within the specified world. */ pid_t fusion_dispatcher_tid( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return direct_thread_get_tid( world->dispatch_loop ); } /* * Return true if this process is the master. */ bool fusion_master( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return world->fusion_id == FUSION_ID_MASTER; } /* * Check if a pointer points to the shared memory. */ bool fusion_is_shared( FusionWorld *world, const void *ptr ) { int i; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); shm = &world->shm; D_MAGIC_ASSERT( shm, FusionSHM ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); if (ptr >= (void*) world->shared && ptr < (void*) world->shared + sizeof(FusionWorldShared)) return true; ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return false; for (i=0; ipools[i].active) { shmalloc_heap *heap; FusionSHMPoolShared *pool = &shared->pools[i]; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); heap = pool->heap; D_MAGIC_ASSERT( heap, shmalloc_heap ); if (ptr >= pool->addr_base && ptr < pool->addr_base + heap->size) { fusion_skirmish_dismiss( &shared->lock ); return true; } } } fusion_skirmish_dismiss( &shared->lock ); return false; } #else /* FUSION_BUILD_MULTI */ /* * Enters a fusion world by joining or creating it. * * If world_index is negative, the next free index is used to create a new world. * Otherwise the world with the specified index is joined or created. */ DirectResult fusion_enter( int world_index, int abi_version, FusionEnterRole role, FusionWorld **ret_world ) { DirectResult ret; FusionWorld *world = NULL; D_ASSERT( ret_world != NULL ); ret = direct_initialize(); if (ret) return ret; world = D_CALLOC( 1, sizeof(FusionWorld) ); if (!world) { ret = D_OOM(); goto error; } world->shared = D_CALLOC( 1, sizeof(FusionWorldShared) ); if (!world->shared) { ret = D_OOM(); goto error; } /* Create the main pool. */ ret = fusion_shm_pool_create( world, "Fusion Main Pool", 0x100000, fusion_config->debugshm, &world->shared->main_pool ); if (ret) goto error; D_MAGIC_SET( world, FusionWorld ); D_MAGIC_SET( world->shared, FusionWorldShared ); *ret_world = world; return DR_OK; error: if (world) { if (world->shared) D_FREE( world->shared ); D_FREE( world ); } direct_shutdown(); return ret; } DirectResult fusion_stop_dispatcher( FusionWorld *world, bool emergency ) { return DR_OK; } /* * Exits the fusion world. * * If 'emergency' is true the function won't join but kill the dispatcher thread. */ DirectResult fusion_exit( FusionWorld *world, bool emergency ) { D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); fusion_shm_pool_destroy( world, world->shared->main_pool ); D_MAGIC_CLEAR( world->shared ); D_FREE( world->shared ); D_MAGIC_CLEAR( world ); D_FREE( world ); direct_shutdown(); return DR_OK; } /* * Sets the fork() action of the calling Fusionee within the world. */ void fusion_world_set_fork_action( FusionWorld *world, FusionForkAction action ) { D_MAGIC_ASSERT( world, FusionWorld ); } /* * Gets the current fork() action. */ FusionForkAction fusion_world_get_fork_action( FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return world->fork_action; } /* * Registers a callback called upon fork(). */ void fusion_world_set_fork_callback( FusionWorld *world, FusionForkCallback callback ) { D_MAGIC_ASSERT( world, FusionWorld ); } /* * Return the index of the specified world. */ int fusion_world_index( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return 0; } /* * Return true if this process is the master. */ bool fusion_master( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return true; } /* * Sends a signal to one or more fusionees and optionally waits * for their processes to terminate. * * A fusion_id of zero means all fusionees but the calling one. * A timeout of zero means infinite waiting while a negative value * means no waiting at all. */ DirectResult fusion_kill( FusionWorld *world, FusionID fusion_id, int signal, int timeout_ms ) { D_MAGIC_ASSERT( world, FusionWorld ); return DR_OK; } /* * Return the own Fusion ID within the specified world. */ FusionID fusion_id( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return 1; } /* * Return if the world is a multi application world. */ bool fusion_is_multi( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return false; } /* * Wait until all pending messages are processed. */ DirectResult fusion_sync( const FusionWorld *world ) { D_MAGIC_ASSERT( world, FusionWorld ); return DR_OK; } /* Check if a pointer points to the shared memory. */ bool fusion_is_shared( FusionWorld *world, const void *ptr ) { D_MAGIC_ASSERT( world, FusionWorld ); return true; } #endif DirectFB-1.2.10/lib/fusion/shm/0000777000175000017500000000000011307522564013067 500000000000000DirectFB-1.2.10/lib/fusion/shm/Makefile.am0000644000175000017500000000100611164361026015027 00000000000000## Makefile.am for DirectFB/lib/fusion/shm INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"@DATADIR@\" \ -DMODULEDIR=\"@MODULEDIR@\" if ENABLE_MULTI SHMSOURCES = heap.c pool.c shm.c else SHMSOURCES = fake.c endif EXTRA_DIST = fake.c noinst_LTLIBRARIES = libfusion_shm.la libfusion_shm_la_SOURCES = \ $(SHMSOURCES) includedir = @INCLUDEDIR@/fusion/shm include_HEADERS = \ pool.h \ shm.h \ shm_internal.h DirectFB-1.2.10/lib/fusion/shm/Makefile.in0000644000175000017500000004207711307521504015053 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = lib/fusion/shm DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfusion_shm_la_LIBADD = am__libfusion_shm_la_SOURCES_DIST = fake.c heap.c pool.c shm.c @ENABLE_MULTI_FALSE@am__objects_1 = fake.lo @ENABLE_MULTI_TRUE@am__objects_1 = heap.lo pool.lo shm.lo am_libfusion_shm_la_OBJECTS = $(am__objects_1) libfusion_shm_la_OBJECTS = $(am_libfusion_shm_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libfusion_shm_la_SOURCES) DIST_SOURCES = $(am__libfusion_shm_la_SOURCES_DIST) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(includedir)" includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @INCLUDEDIR@/fusion/shm infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib AM_CPPFLAGS = \ -DDATADIR=\"@DATADIR@\" \ -DMODULEDIR=\"@MODULEDIR@\" @ENABLE_MULTI_FALSE@SHMSOURCES = fake.c @ENABLE_MULTI_TRUE@SHMSOURCES = heap.c pool.c shm.c EXTRA_DIST = fake.c noinst_LTLIBRARIES = libfusion_shm.la libfusion_shm_la_SOURCES = \ $(SHMSOURCES) include_HEADERS = \ pool.h \ shm.h \ shm_internal.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/fusion/shm/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/fusion/shm/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libfusion_shm.la: $(libfusion_shm_la_OBJECTS) $(libfusion_shm_la_DEPENDENCIES) $(LINK) $(libfusion_shm_la_OBJECTS) $(libfusion_shm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fake.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/lib/fusion/shm/fake.c0000644000175000017500000001012411245562152014051 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include DirectResult fusion_shm_pool_create( FusionWorld *world, const char *name, unsigned int max_size, bool debug, FusionSHMPoolShared **ret_pool ) { FusionSHMPoolShared *pool; #if !DIRECT_BUILD_DEBUGS debug = false; #endif pool = D_CALLOC( 1, sizeof(FusionSHMPoolShared) ); if (!pool) return D_OOM(); pool->debug = debug; D_MAGIC_SET( pool, FusionSHMPoolShared ); *ret_pool = pool; return DR_OK; } DirectResult fusion_shm_pool_destroy( FusionWorld *world, FusionSHMPoolShared *pool ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_MAGIC_CLEAR( pool ); D_FREE( pool ); return DR_OK; } DirectResult fusion_shm_pool_attach( FusionSHM *shm, FusionSHMPoolShared *pool ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); pool->index++; return DR_OK; } DirectResult fusion_shm_pool_detach( FusionSHM *shm, FusionSHMPoolShared *pool ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( pool->index > 0 ); pool->index--; return DR_OK; } DirectResult fusion_shm_pool_allocate( FusionSHMPoolShared *pool, int size, bool clear, bool lock, void **ret_data ) { void *data; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); data = clear ? D_CALLOC( 1, size ) : D_MALLOC( size ); if (!data) return DR_NOSHAREDMEMORY; *ret_data = data; return DR_OK; } DirectResult fusion_shm_pool_reallocate( FusionSHMPoolShared *pool, void *data, int size, bool lock, void **ret_data ) { void *new_data; D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); new_data = D_REALLOC( data, size ); if (!new_data) return DR_NOSHAREDMEMORY; *ret_data = new_data; return DR_OK; } DirectResult fusion_shm_pool_deallocate( FusionSHMPoolShared *pool, void *data, bool lock ) { D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_FREE( data ); return DR_OK; } DirectResult fusion_shm_enum_pools( FusionWorld *world, FusionSHMPoolCallback callback, void *ctx ) { return DR_OK; } DirectFB-1.2.10/lib/fusion/shm/heap.c0000644000175000017500000007372711245562152014102 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Heap management adapted from libc Copyright 1990, 1991, 1992 Free Software Foundation, Inc. Written May 1989 by Mike Haertel. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be reached (Email) at the address mike@ai.mit.edu, or (US mail) as Mike Haertel c/o Free Software Foundation. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Fusion_SHMHeap, "Fusion/SHMHeap", "Fusion Shared Memory Heap" ); /**********************************************************************************************************************/ /* Aligned allocation. */ static void * align( shmalloc_heap *heap, size_t size ) { void *result; unsigned long adj; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, %zu )\n", __FUNCTION__, heap, size ); D_MAGIC_ASSERT( heap, shmalloc_heap ); result = __shmalloc_brk( heap, size ); adj = (unsigned long) result % BLOCKSIZE; if (adj != 0) { adj = BLOCKSIZE - adj; __shmalloc_brk( heap, adj ); result = (char *) result + adj; } return result; } /* Get neatly aligned memory, initializing or growing the heap info table as necessary. */ static void * morecore( shmalloc_heap *heap, size_t size ) { void *result; shmalloc_info *newinfo, *oldinfo; size_t newsize; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, %zu )\n", __FUNCTION__, heap, size ); D_MAGIC_ASSERT( heap, shmalloc_heap ); result = align( heap, size ); if (result == NULL) return NULL; /* Check if we need to grow the info table. */ if ((size_t) BLOCK ((char *) result + size) > heap->heapsize) { newsize = heap->heapsize; while ((size_t) BLOCK ((char *) result + size) > newsize) newsize *= 2; newinfo = (shmalloc_info *) align( heap, newsize * sizeof (shmalloc_info) ); if (newinfo == NULL) { __shmalloc_brk( heap, -size ); return NULL; } direct_memcpy( newinfo, heap->heapinfo, heap->heapsize * sizeof (shmalloc_info) ); memset (newinfo + heap->heapsize, 0, (newsize - heap->heapsize) * sizeof (shmalloc_info)); oldinfo = heap->heapinfo; newinfo[BLOCK (oldinfo)].busy.type = 0; newinfo[BLOCK (oldinfo)].busy.info.size = BLOCKIFY (heap->heapsize * sizeof (shmalloc_info)); heap->heapinfo = newinfo; _fusion_shfree( heap, oldinfo ); heap->heapsize = newsize; } heap->heaplimit = BLOCK ((char *) result + size); return result; } /**********************************************************************************************************************/ /* Allocate memory from the heap. */ void * _fusion_shmalloc( shmalloc_heap *heap, size_t size ) { void *result; size_t block, blocks, lastblocks, start; register size_t i; struct list *next; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, %zu )\n", __FUNCTION__, heap, size ); D_MAGIC_ASSERT( heap, shmalloc_heap ); /* Some programs will call shmalloc (0). We let them pass. */ if (size == 0) return NULL; if (size < sizeof (struct list)) size = sizeof (struct list); /* Determine the allocation policy based on the request size. */ if (size <= BLOCKSIZE / 2) { /* Small allocation to receive a fragment of a block. Determine the logarithm to base two of the fragment size. */ register size_t log = 1; --size; while ((size /= 2) != 0) ++log; /* Look in the fragment lists for a free fragment of the desired size. */ next = heap->fraghead[log].next; if (next != NULL) { /* There are free fragments of this size. Pop a fragment out of the fragment list and return it. Update the block's nfree and first counters. */ result = (void *) next; next->prev->next = next->next; if (next->next != NULL) next->next->prev = next->prev; block = BLOCK (result); if (--(heap->heapinfo[block].busy.info.frag.nfree) != 0) heap->heapinfo[block].busy.info.frag.first = (unsigned long int) ((unsigned long int) ((char *) next->next - (char *) NULL) % BLOCKSIZE) >> log; /* Update the statistics. */ heap->chunks_used++; heap->bytes_used += 1 << log; heap->chunks_free--; heap->bytes_free -= 1 << log; } else { /* No free fragments of the desired size, so get a new block and break it into fragments, returning the first. */ result = _fusion_shmalloc( heap, BLOCKSIZE ); if (result == NULL) return NULL; #if 1 /* Adapted from Mike */ heap->fragblocks[log]++; #endif /* Link all fragments but the first into the free list. */ for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i) { next = (struct list *) ((char *) result + (i << log)); next->next = heap->fraghead[log].next; next->prev = &heap->fraghead[log]; next->prev->next = next; if (next->next != NULL) next->next->prev = next; } /* Initialize the nfree and first counters for this block. */ block = BLOCK (result); heap->heapinfo[block].busy.type = log; heap->heapinfo[block].busy.info.frag.nfree = i - 1; heap->heapinfo[block].busy.info.frag.first = i - 1; heap->chunks_free += (BLOCKSIZE >> log) - 1; heap->bytes_free += BLOCKSIZE - (1 << log); heap->bytes_used -= BLOCKSIZE - (1 << log); } } else { /* Large allocation to receive one or more blocks. Search the free list in a circle starting at the last place visited. If we loop completely around without finding a large enough space we will have to get more memory from the system. */ blocks = BLOCKIFY (size); start = block = heap->heapindex; while (heap->heapinfo[block].free.size < blocks) { block = heap->heapinfo[block].free.next; if (block == start) { /* Need to get more from the system. Check to see if the new core will be contiguous with the final free block; if so we don't need to get as much. */ block = heap->heapinfo[0].free.prev; lastblocks = heap->heapinfo[block].free.size; if (heap->heaplimit != 0 && block + lastblocks == heap->heaplimit && __shmalloc_brk( heap, 0 ) == ADDRESS (block + lastblocks) && (morecore( heap, (blocks - lastblocks) * BLOCKSIZE) ) != NULL) { #if 1 /* Adapted from Mike */ /* Note that morecore() can change the location of the final block if it moves the info table and the old one gets coalesced into the final block. */ block = heap->heapinfo[0].free.prev; heap->heapinfo[block].free.size += blocks - lastblocks; #else heap->heapinfo[block].free.size = blocks; #endif heap->bytes_free += (blocks - lastblocks) * BLOCKSIZE; continue; } result = morecore( heap, blocks * BLOCKSIZE ); if (result == NULL) return NULL; block = BLOCK (result); heap->heapinfo[block].busy.type = 0; heap->heapinfo[block].busy.info.size = blocks; heap->chunks_used++; heap->bytes_used += blocks * BLOCKSIZE; return result; } } /* At this point we have found a suitable free list entry. Figure out how to remove what we need from the list. */ result = ADDRESS (block); if (heap->heapinfo[block].free.size > blocks) { /* The block we found has a bit left over, so relink the tail end back into the free list. */ heap->heapinfo[block + blocks].free.size = heap->heapinfo[block].free.size - blocks; heap->heapinfo[block + blocks].free.next = heap->heapinfo[block].free.next; heap->heapinfo[block + blocks].free.prev = heap->heapinfo[block].free.prev; heap->heapinfo[heap->heapinfo[block].free.prev].free.next = heap->heapinfo[heap->heapinfo[block].free.next].free.prev = heap->heapindex = block + blocks; } else { /* The block exactly matches our requirements, so just remove it from the list. */ heap->heapinfo[heap->heapinfo[block].free.next].free.prev = heap->heapinfo[block].free.prev; heap->heapinfo[heap->heapinfo[block].free.prev].free.next = heap->heapindex = heap->heapinfo[block].free.next; heap->chunks_free--; } heap->heapinfo[block].busy.type = 0; heap->heapinfo[block].busy.info.size = blocks; heap->chunks_used++; heap->bytes_used += blocks * BLOCKSIZE; heap->bytes_free -= blocks * BLOCKSIZE; } return result; } /* Resize the given region to the new size, returning a pointer to the (possibly moved) region. This is optimized for speed; some benchmarks seem to indicate that greater compactness is achieved by unconditionally allocating and copying to a new region. This module has incestuous knowledge of the internals of both free and shmalloc. */ void * _fusion_shrealloc( shmalloc_heap *heap, void *ptr, size_t size ) { void *result; int type; size_t block, blocks, oldlimit; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, %p, %zu )\n", __FUNCTION__, heap, ptr, size ); D_MAGIC_ASSERT( heap, shmalloc_heap ); if (ptr == NULL) return _fusion_shmalloc( heap, size ); else if (size == 0) { _fusion_shfree( heap, ptr ); return NULL; } block = BLOCK (ptr); type = heap->heapinfo[block].busy.type; switch (type) { case 0: /* Maybe reallocate a large block to a small fragment. */ if (size <= BLOCKSIZE / 2) { result = _fusion_shmalloc( heap, size ); if (result != NULL) { direct_memcpy (result, ptr, size); _fusion_shfree( heap, ptr ); return result; } } /* The new size is a large allocation as well; see if we can hold it in place. */ blocks = BLOCKIFY (size); if (blocks < heap->heapinfo[block].busy.info.size) { /* The new size is smaller; return excess memory to the free list. */ heap->heapinfo[block + blocks].busy.type = 0; heap->heapinfo[block + blocks].busy.info.size = heap->heapinfo[block].busy.info.size - blocks; heap->heapinfo[block].busy.info.size = blocks; _fusion_shfree( heap, ADDRESS (block + blocks) ); result = ptr; } else if (blocks == heap->heapinfo[block].busy.info.size) /* No size change necessary. */ result = ptr; else { /* Won't fit, so allocate a new region that will. Free the old region first in case there is sufficient adjacent free space to grow without moving. */ blocks = heap->heapinfo[block].busy.info.size; /* Prevent free from actually returning memory to the system. */ oldlimit = heap->heaplimit; heap->heaplimit = 0; _fusion_shfree( heap, ptr ); heap->heaplimit = oldlimit; result = _fusion_shmalloc( heap, size ); if (result == NULL) { /* Now we're really in trouble. We have to unfree the thing we just freed. Unfortunately it might have been coalesced with its neighbors. */ if (heap->heapindex == block) (void) _fusion_shmalloc( heap, blocks * BLOCKSIZE ); else { void *previous = _fusion_shmalloc( heap, (block - heap->heapindex) * BLOCKSIZE ); (void) _fusion_shmalloc( heap, blocks * BLOCKSIZE ); _fusion_shfree( heap, previous ); } return NULL; } if (ptr != result) direct_memmove (result, ptr, blocks * BLOCKSIZE); } break; default: /* Old size is a fragment; type is logarithm to base two of the fragment size. */ if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) /* The new size is the same kind of fragment. */ result = ptr; else { /* The new size is different; allocate a new space, and copy the lesser of the new size and the old. */ result = _fusion_shmalloc( heap, size ); if (result == NULL) return NULL; direct_memcpy (result, ptr, MIN (size, (size_t) 1 << type)); _fusion_shfree( heap, ptr ); } break; } return result; } /* Return memory to the heap. */ void _fusion_shfree( shmalloc_heap *heap, void *ptr ) { int type; size_t block, blocks; register size_t i; struct list *prev, *next; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, %p )\n", __FUNCTION__, heap, ptr ); D_MAGIC_ASSERT( heap, shmalloc_heap ); if (ptr == NULL) return; block = BLOCK (ptr); type = heap->heapinfo[block].busy.type; switch (type) { case 0: /* Get as many statistics as early as we can. */ heap->chunks_used--; heap->bytes_used -= heap->heapinfo[block].busy.info.size * BLOCKSIZE; heap->bytes_free += heap->heapinfo[block].busy.info.size * BLOCKSIZE; /* Find the free cluster previous to this one in the free list. Start searching at the last block referenced; this may benefit programs with locality of allocation. */ i = heap->heapindex; if (i > block) while (i > block) i = heap->heapinfo[i].free.prev; else { do i = heap->heapinfo[i].free.next; while (i > 0 && i < block); i = heap->heapinfo[i].free.prev; } /* Determine how to link this block into the free list. */ if (block == i + heap->heapinfo[i].free.size) { /* Coalesce this block with its predecessor. */ heap->heapinfo[i].free.size += heap->heapinfo[block].busy.info.size; block = i; } else { /* Really link this block back into the free list. */ heap->heapinfo[block].free.size = heap->heapinfo[block].busy.info.size; heap->heapinfo[block].free.next = heap->heapinfo[i].free.next; heap->heapinfo[block].free.prev = i; heap->heapinfo[i].free.next = block; heap->heapinfo[heap->heapinfo[block].free.next].free.prev = block; heap->chunks_free++; } /* Now that the block is linked in, see if we can coalesce it with its successor (by deleting its successor from the list and adding in its size). */ if (block + heap->heapinfo[block].free.size == heap->heapinfo[block].free.next) { heap->heapinfo[block].free.size += heap->heapinfo[heap->heapinfo[block].free.next].free.size; heap->heapinfo[block].free.next = heap->heapinfo[heap->heapinfo[block].free.next].free.next; heap->heapinfo[heap->heapinfo[block].free.next].free.prev = block; heap->chunks_free--; } blocks = heap->heapinfo[block].free.size; /* FIXME: as this is used when kernel is detected as >= 2.6.19.2 only, this fallback definition should be ok for now */ #ifndef MADV_REMOVE #define MADV_REMOVE 9 #endif /* Punch a hole into the tmpfs file to really free RAM. */ if (fusion_config->madv_remove) madvise( ADDRESS(block), blocks * BLOCKSIZE, MADV_REMOVE ); /* Now see if we can truncate the end. */ if (blocks >= FINAL_FREE_BLOCKS && block + blocks == heap->heaplimit && __shmalloc_brk( heap, 0 ) == ADDRESS (block + blocks)) { register size_t bytes = blocks * BLOCKSIZE; heap->heaplimit -= blocks; __shmalloc_brk( heap, -bytes ); heap->heapinfo[heap->heapinfo[block].free.prev].free.next = heap->heapinfo[block].free.next; heap->heapinfo[heap->heapinfo[block].free.next].free.prev = heap->heapinfo[block].free.prev; block = heap->heapinfo[block].free.prev; heap->chunks_free--; heap->bytes_free -= bytes; } /* Set the next search to begin at this block. */ heap->heapindex = block; break; default: /* Do some of the statistics. */ heap->chunks_used--; heap->bytes_used -= 1 << type; heap->chunks_free++; heap->bytes_free += 1 << type; /* Get the address of the first free fragment in this block. */ prev = (struct list *) ((char *) ADDRESS (block) + (heap->heapinfo[block].busy.info.frag.first << type)); #if 1 /* Adapted from Mike */ if ((int)heap->heapinfo[block].busy.info.frag.nfree == (BLOCKSIZE >> type) - 1 && heap->fragblocks[type] > 1) #else if ((int)heap->heapinfo[block].busy.info.frag.nfree == (BLOCKSIZE >> type) - 1) #endif { /* If all fragments of this block are free, remove them from the fragment list and free the whole block. */ #if 1 /* Adapted from Mike */ heap->fragblocks[type]--; #endif next = prev; for (i = 1; i < (size_t) (BLOCKSIZE >> type); ++i) next = next->next; prev->prev->next = next; if (next != NULL) next->prev = prev->prev; heap->heapinfo[block].busy.type = 0; heap->heapinfo[block].busy.info.size = 1; /* Keep the statistics accurate. */ heap->chunks_used++; heap->bytes_used += BLOCKSIZE; heap->chunks_free -= BLOCKSIZE >> type; heap->bytes_free -= BLOCKSIZE; _fusion_shfree( heap, ADDRESS (block) ); } else if (heap->heapinfo[block].busy.info.frag.nfree != 0) { /* If some fragments of this block are free, link this fragment into the fragment list after the first free fragment of this block. */ next = (struct list *) ptr; next->next = prev->next; next->prev = prev; prev->next = next; if (next->next != NULL) next->next->prev = next; heap->heapinfo[block].busy.info.frag.nfree++; } else { /* No fragments of this block are free, so link this fragment into the fragment list and announce that it is the first free fragment of this block. */ prev = (struct list *) ptr; heap->heapinfo[block].busy.info.frag.nfree = 1; heap->heapinfo[block].busy.info.frag.first = (unsigned long int) ((unsigned long int) ((char *) ptr - (char *) NULL) % BLOCKSIZE >> type); prev->next = heap->fraghead[type].next; prev->prev = &heap->fraghead[type]; prev->prev->next = prev; if (prev->next != NULL) prev->next->prev = prev; } break; } } /**********************************************************************************************************************/ DirectResult __shmalloc_init_heap( FusionSHM *shm, const char *filename, void *addr_base, int space, int *ret_fd, int *ret_size ) { DirectResult ret; int size; FusionSHMShared *shared; int heapsize = (space + BLOCKSIZE-1) / BLOCKSIZE; int fd = -1; shmalloc_heap *heap = NULL; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, '%s', %p, %d, %p, %p )\n", __FUNCTION__, shm, filename, addr_base, space, ret_fd, ret_size ); D_MAGIC_ASSERT( shm, FusionSHM ); D_ASSERT( filename != NULL ); D_ASSERT( addr_base != NULL ); D_ASSERT( ret_fd != NULL ); D_ASSERT( ret_size != NULL ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); D_ASSERT( shared->tmpfs[0] != 0 ); size = BLOCKALIGN(sizeof(shmalloc_heap)) + BLOCKALIGN( heapsize * sizeof(shmalloc_info) ); D_DEBUG_AT( Fusion_SHMHeap, " -> opening shared memory file '%s'...\n", filename ); /* open the virtual file */ fd = open( filename, O_RDWR | O_CREAT | O_TRUNC, 0660 ); if (fd < 0) { ret = errno2result(errno); D_PERROR( "Fusion/SHM: Could not open shared memory file '%s'!\n", filename ); goto error; } if (fusion_config->shmfile_gid != (gid_t)-1) { /* chgrp the SH_FILE dev entry */ if (fchown( fd, -1, fusion_config->shmfile_gid ) != 0) D_WARN( "Fusion/SHM: Changing owner on %s failed... continuing on.", filename ); } fchmod( fd, 0660 ); ftruncate( fd, size ); D_DEBUG_AT( Fusion_SHMHeap, " -> mmaping shared memory file... (%d bytes)\n", size ); /* map it shared */ heap = mmap( addr_base, size + space, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0 ); if (heap == MAP_FAILED) { ret = errno2result(errno); D_PERROR( "Fusion/SHM: Could not mmap shared memory file '%s'!\n", filename ); goto error; } if (heap != addr_base) { D_ERROR( "Fusion/SHM: mmap() returned address (%p) differs from requested (%p)\n", heap, addr_base ); ret = DR_FUSION; goto error; } D_DEBUG_AT( Fusion_SHMHeap, " -> done.\n" ); heap->size = size; heap->heapsize = heapsize; heap->heapinfo = (void*) heap + BLOCKALIGN(sizeof(shmalloc_heap)); heap->heapbase = (char*) heap->heapinfo; D_MAGIC_SET( heap, shmalloc_heap ); *ret_fd = fd; *ret_size = size; return DR_OK; error: if (heap) munmap( heap, size ); if (fd != -1) { close( fd ); unlink( filename ); } return ret; } DirectResult __shmalloc_join_heap( FusionSHM *shm, const char *filename, void *addr_base, int size, int *ret_fd ) { DirectResult ret; FusionSHMShared *shared; int fd = -1; shmalloc_heap *heap = NULL; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, '%s', %p, %d, %p )\n", __FUNCTION__, shm, filename, addr_base, size, ret_fd ); D_MAGIC_ASSERT( shm, FusionSHM ); D_ASSERT( filename != NULL ); D_ASSERT( addr_base != NULL ); D_ASSERT( size >= sizeof(shmalloc_heap) ); D_ASSERT( ret_fd != NULL ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); D_ASSERT( shared->tmpfs[0] != 0 ); D_DEBUG_AT( Fusion_SHMHeap, " -> opening shared memory file '%s'...\n", filename ); /* open the virtual file */ fd = open( filename, O_RDWR ); if (fd < 0) { ret = errno2result(errno); D_PERROR( "Fusion/SHM: Could not open shared memory file '%s'!\n", filename ); goto error; } D_DEBUG_AT( Fusion_SHMHeap, " -> mmaping shared memory file... (%d bytes)\n", size ); /* map it shared */ heap = mmap( addr_base, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0 ); if (heap == MAP_FAILED) { ret = errno2result(errno); D_PERROR( "Fusion/SHM: Could not mmap shared memory file '%s'!\n", filename ); goto error; } if (heap != addr_base) { D_ERROR( "Fusion/SHM: mmap() returned address (%p) differs from requested (%p)\n", heap, addr_base ); ret = DR_FUSION; goto error; } D_MAGIC_ASSERT( heap, shmalloc_heap ); D_DEBUG_AT( Fusion_SHMHeap, " -> done.\n" ); *ret_fd = fd; return DR_OK; error: if (heap) munmap( heap, size ); if (fd != -1) close( fd ); return ret; } void * __shmalloc_brk( shmalloc_heap *heap, int increment ) { FusionSHMShared *shm; FusionWorld *world; FusionSHMPool *pool; FusionSHMPoolShared *shared; D_DEBUG_AT( Fusion_SHMHeap, "%s( %p, %d )\n", __FUNCTION__, heap, increment ); D_MAGIC_ASSERT( heap, shmalloc_heap ); shared = heap->pool; D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); shm = shared->shm; D_MAGIC_ASSERT( shm, FusionSHMShared ); world = _fusion_world( shm->world ); D_MAGIC_ASSERT( world, FusionWorld ); pool = &world->shm.pools[shared->index]; D_MAGIC_ASSERT( pool, FusionSHMPool ); if (increment) { int new_size = heap->size + increment; if (new_size > shared->max_size) { D_WARN( "maximum shared memory size exceeded!" ); fusion_dbg_print_memleaks( shared ); return NULL; } if (ftruncate( pool->fd, new_size ) < 0) { D_PERROR( "Fusion/SHM: ftruncating shared memory file failed!\n" ); return NULL; } heap->size = new_size; } return shared->addr_base + heap->size - increment; } DirectFB-1.2.10/lib/fusion/shm/shm.h0000644000175000017500000000342211245562152013742 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__SHM__SHM_H__ #define __FUSION__SHM__SHM_H__ #include typedef DirectEnumerationResult (*FusionSHMPoolCallback)( FusionSHMPool *pool, void *ctx ); DirectResult fusion_shm_init ( FusionWorld *world ); DirectResult fusion_shm_deinit( FusionWorld *world ); DirectResult fusion_shm_attach_unattached( FusionWorld *world ); DirectResult fusion_shm_enum_pools( FusionWorld *world, FusionSHMPoolCallback callback, void *ctx ); #endif DirectFB-1.2.10/lib/fusion/shm/pool.c0000644000175000017500000006560711245562152014134 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Fusion_SHMPool, "Fusion/SHMPool", "Fusion Shared Memory Pool" ); /**********************************************************************************************************************/ static DirectResult init_pool ( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared, const char *name, unsigned int max_size, bool debug ); static DirectResult join_pool ( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ); static void leave_pool ( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ); static void shutdown_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ); /**********************************************************************************************************************/ DirectResult fusion_shm_pool_create( FusionWorld *world, const char *name, unsigned int max_size, bool debug, FusionSHMPoolShared **ret_pool ) { int i; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); D_ASSERT( name != NULL ); D_ASSERT( max_size > 0 ); D_ASSERT( ret_pool != NULL ); D_DEBUG_AT( Fusion_SHMPool, "%s( %p [%d], '%s', %d, %p, %sdebug )\n", __FUNCTION__, world, world->shared->world_index, name, max_size, ret_pool, debug ? "" : "non-" ); #if !DIRECT_BUILD_DEBUGS debug = false; #endif shm = &world->shm; D_MAGIC_ASSERT( shm, FusionSHM ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); if (max_size < 8192) { D_ERROR( "Fusion/SHMPool: Maximum size (%d) should be 8192 at least!\n", max_size ); return DR_INVARG; } ret = fusion_skirmish_prevail( &shared->lock ); if (ret) goto error; if (shared->num_pools == FUSION_SHM_MAX_POOLS) { D_ERROR( "Fusion/SHMPool: Maximum number of pools (%d) already reached!\n", FUSION_SHM_MAX_POOLS ); ret = DR_LIMITEXCEEDED; goto error; } for (i=0; ipools[i].active) break; D_MAGIC_ASSERT( &shared->pools[i], FusionSHMPoolShared ); D_MAGIC_ASSUME( &shm->pools[i], FusionSHMPool ); } D_ASSERT( i < FUSION_SHM_MAX_POOLS ); D_DEBUG_AT( Fusion_SHMPool, " -> index %d\n", i ); memset( &shm->pools[i], 0, sizeof(FusionSHMPool) ); memset( &shared->pools[i], 0, sizeof(FusionSHMPoolShared) ); shared->pools[i].index = i; ret = init_pool( shm, &shm->pools[i], &shared->pools[i], name, max_size, debug ); if (ret) goto error; shared->num_pools++; fusion_skirmish_dismiss( &shared->lock ); *ret_pool = &shared->pools[i]; D_DEBUG_AT( Fusion_SHMPool, " -> %p\n", *ret_pool ); return DR_OK; error: fusion_skirmish_dismiss( &shared->lock ); return ret; } DirectResult fusion_shm_pool_destroy( FusionWorld *world, FusionSHMPoolShared *pool ) { DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p )\n", __FUNCTION__, world, pool ); D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); shm = &world->shm; D_MAGIC_ASSERT( shm, FusionSHM ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); D_ASSERT( shared == pool->shm ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return ret; ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { fusion_skirmish_dismiss( &shared->lock ); return ret; } D_ASSERT( pool->active ); D_ASSERT( pool->index >= 0 ); D_ASSERT( pool->index < FUSION_SHM_MAX_POOLS ); D_ASSERT( pool->pool_id == shm->pools[pool->index].pool_id ); D_ASSERT( pool == &shared->pools[pool->index] ); D_MAGIC_ASSERT( &shm->pools[pool->index], FusionSHMPool ); shutdown_pool( shm, &shm->pools[pool->index], pool ); shared->num_pools--; fusion_skirmish_dismiss( &shared->lock ); return DR_OK; } DirectResult fusion_shm_pool_attach( FusionSHM *shm, FusionSHMPoolShared *pool ) { DirectResult ret; FusionSHMShared *shared; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p )\n", __FUNCTION__, shm, pool ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); D_ASSERT( shared == pool->shm ); ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { return ret; } D_ASSERT( pool->active ); D_ASSERT( pool->index >= 0 ); D_ASSERT( pool->index < FUSION_SHM_MAX_POOLS ); D_ASSERT( pool == &shared->pools[pool->index] ); D_ASSERT( !shm->pools[pool->index].attached ); ret = join_pool( shm, &shm->pools[pool->index], pool ); fusion_skirmish_dismiss( &pool->lock ); return ret; } DirectResult fusion_shm_pool_detach( FusionSHM *shm, FusionSHMPoolShared *pool ) { DirectResult ret; FusionSHMShared *shared; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p )\n", __FUNCTION__, shm, pool ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); D_ASSERT( shared == pool->shm ); ret = fusion_skirmish_prevail( &pool->lock ); if (ret) { fusion_skirmish_dismiss( &shared->lock ); return ret; } D_ASSERT( pool->active ); D_ASSERT( pool->index >= 0 ); D_ASSERT( pool->index < FUSION_SHM_MAX_POOLS ); D_ASSERT( pool->pool_id == shm->pools[pool->index].pool_id ); D_ASSERT( pool == &shared->pools[pool->index] ); D_ASSERT( shm->pools[pool->index].attached ); D_MAGIC_ASSERT( &shm->pools[pool->index], FusionSHMPool ); leave_pool( shm, &shm->pools[pool->index], pool ); fusion_skirmish_dismiss( &pool->lock ); return DR_OK; } DirectResult fusion_shm_pool_allocate( FusionSHMPoolShared *pool, int size, bool clear, bool lock, void **ret_data ) { DirectResult ret; void *data; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %d, %sclear, %p )\n", __FUNCTION__, pool, size, clear ? "" : "un", ret_data ); D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( size > 0 ); D_ASSERT( ret_data != NULL ); if (lock) { ret = fusion_skirmish_prevail( &pool->lock ); if (ret) return ret; } __shmalloc_brk( pool->heap, 0 ); data = _fusion_shmalloc( pool->heap, size ); if (!data) { if (lock) fusion_skirmish_dismiss( &pool->lock ); return DR_NOSHAREDMEMORY; } if (clear) memset( data, 0, size ); *ret_data = data; if (lock) fusion_skirmish_dismiss( &pool->lock ); return DR_OK; } DirectResult fusion_shm_pool_reallocate( FusionSHMPoolShared *pool, void *data, int size, bool lock, void **ret_data ) { DirectResult ret; void *new_data; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %d, %p )\n", __FUNCTION__, pool, data, size, ret_data ); D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( data != NULL ); D_ASSERT( data >= pool->addr_base ); D_ASSERT( data < pool->addr_base + pool->max_size ); D_ASSERT( size > 0 ); D_ASSERT( ret_data != NULL ); if (lock) { ret = fusion_skirmish_prevail( &pool->lock ); if (ret) return ret; } __shmalloc_brk( pool->heap, 0 ); new_data = _fusion_shrealloc( pool->heap, data, size ); if (!new_data) { if (lock) fusion_skirmish_dismiss( &pool->lock ); return DR_NOSHAREDMEMORY; } *ret_data = new_data; if (lock) fusion_skirmish_dismiss( &pool->lock ); return DR_OK; } DirectResult fusion_shm_pool_deallocate( FusionSHMPoolShared *pool, void *data, bool lock ) { DirectResult ret; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p )\n", __FUNCTION__, pool, data ); D_MAGIC_ASSERT( pool, FusionSHMPoolShared ); D_ASSERT( data != NULL ); D_ASSERT( data >= pool->addr_base ); D_ASSERT( data < pool->addr_base + pool->max_size ); if (lock) { ret = fusion_skirmish_prevail( &pool->lock ); if (ret) return ret; } __shmalloc_brk( pool->heap, 0 ); _fusion_shfree( pool->heap, data ); if (lock) fusion_skirmish_dismiss( &pool->lock ); return DR_OK; } /**********************************************************************************************************************/ #if FUSION_BUILD_KERNEL static DirectResult init_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared, const char *name, unsigned int max_size, bool debug ) { DirectResult ret; int fd; int size; FusionWorld *world; FusionSHMPoolNew pool_new = { .pool_id = 0 }; FusionSHMPoolAttach pool_attach = { .pool_id = 0 }; FusionEntryInfo info; char buf[FUSION_SHM_TMPFS_PATH_NAME_LEN + 32]; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p, '%s', %d, %sdebug )\n", __FUNCTION__, shm, pool, shared, name, max_size, debug ? "" : "non-" ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( shm->shared, FusionSHMShared ); D_ASSERT( name != NULL ); D_ASSERT( max_size > sizeof(shmalloc_heap) ); world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( pool != NULL ); D_ASSERT( shared != NULL ); /* Fill out information for new pool. */ pool_new.max_size = max_size; pool_new.max_size += BLOCKALIGN(sizeof(shmalloc_heap)) + BLOCKALIGN( (max_size + BLOCKSIZE-1) / BLOCKSIZE * sizeof(shmalloc_info) ); /* Create the new pool. */ while (ioctl( world->fusion_fd, FUSION_SHMPOOL_NEW, &pool_new )) { if (errno == EINTR) continue; D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_NEW failed!\n" ); return DR_FUSION; } /* Set the pool info. */ info.type = FT_SHMPOOL; info.id = pool_new.pool_id; snprintf( info.name, sizeof(info.name), "%s", name ); ioctl( world->fusion_fd, FUSION_ENTRY_SET_INFO, &info ); /* Set pool to attach to. */ pool_attach.pool_id = pool_new.pool_id; /* Attach to the pool. */ while (ioctl( world->fusion_fd, FUSION_SHMPOOL_ATTACH, &pool_attach )) { if (errno == EINTR) continue; D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_ATTACH failed!\n" ); while (ioctl( world->fusion_fd, FUSION_SHMPOOL_DESTROY, &shared->pool_id )) { if (errno != EINTR) { D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_DESTROY failed!\n" ); break; } } return DR_FUSION; } /* Generate filename. */ snprintf( buf, sizeof(buf), "%s/fusion.%d.%d", shm->shared->tmpfs, fusion_world_index( shm->world ), pool_new.pool_id ); /* Initialize the heap. */ ret = __shmalloc_init_heap( shm, buf, pool_new.addr_base, max_size, &fd, &size ); if (ret) { while (ioctl( world->fusion_fd, FUSION_SHMPOOL_DESTROY, &shared->pool_id )) { if (errno != EINTR) { D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_DESTROY failed!\n" ); break; } } return ret; } /* Initialize local data. */ pool->attached = true; pool->shm = shm; pool->shared = shared; pool->pool_id = pool_new.pool_id; pool->fd = fd; pool->filename = D_STRDUP( buf ); /* Initialize shared data. */ shared->active = true; shared->debug = debug; shared->shm = shm->shared; shared->max_size = pool_new.max_size; shared->pool_id = pool_new.pool_id; shared->addr_base = pool_new.addr_base; shared->heap = pool_new.addr_base; shared->heap->pool = shared; fusion_skirmish_init( &shared->lock, name, world ); D_MAGIC_SET( pool, FusionSHMPool ); D_MAGIC_SET( shared, FusionSHMPoolShared ); shared->name = SHSTRDUP( shared, name ); return DR_OK; } static DirectResult join_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ) { DirectResult ret; int fd; FusionWorld *world; FusionSHMPoolAttach pool_attach = { .pool_id = 0 }; char buf[FUSION_SHM_TMPFS_PATH_NAME_LEN + 32]; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p )\n", __FUNCTION__, shm, pool, shared ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( shm->shared, FusionSHMShared ); D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); #if !DIRECT_BUILD_DEBUGS if (shared->debug) { D_ERROR( "Fusion/SHM: Can't join debug enabled pool with pure-release library!\n" ); return DR_UNSUPPORTED; } #endif world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); /* Set pool to attach to. */ pool_attach.pool_id = shared->pool_id; /* Attach to the pool. */ while (ioctl( world->fusion_fd, FUSION_SHMPOOL_ATTACH, &pool_attach )) { if (errno == EINTR) continue; D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_ATTACH failed!\n" ); return DR_FUSION; } /* Generate filename. */ snprintf( buf, sizeof(buf), "%s/fusion.%d.%d", shm->shared->tmpfs, fusion_world_index( shm->world ), shared->pool_id ); /* Join the heap. */ ret = __shmalloc_join_heap( shm, buf, pool_attach.addr_base, shared->max_size, &fd ); if (ret) { while (ioctl( world->fusion_fd, FUSION_SHMPOOL_DETACH, &shared->pool_id )) { if (errno != EINTR) { D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_DETACH failed!\n" ); break; } } return ret; } /* Initialize local data. */ pool->attached = true; pool->shm = shm; pool->shared = shared; pool->pool_id = shared->pool_id; pool->fd = fd; pool->filename = D_STRDUP( buf ); D_MAGIC_SET( pool, FusionSHMPool ); return DR_OK; } static void leave_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ) { FusionWorld *world; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p )\n", __FUNCTION__, shm, pool, shared ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( pool, FusionSHMPool ); D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); while (ioctl( world->fusion_fd, FUSION_SHMPOOL_DETACH, &shared->pool_id )) { if (errno != EINTR) { D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_DETACH failed!\n" ); break; } } if (munmap( shared->addr_base, shared->max_size )) D_PERROR( "Fusion/SHM: Could not munmap shared memory file '%s'!\n", pool->filename ); if (pool->fd != -1 && close( pool->fd )) D_PERROR( "Fusion/SHM: Could not close shared memory file '%s'!\n", pool->filename ); pool->attached = false; D_FREE( pool->filename ); D_MAGIC_CLEAR( pool ); } static void shutdown_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ) { FusionWorld *world; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p )\n", __FUNCTION__, shm, pool, shared ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( pool, FusionSHMPool ); D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); SHFREE( shared, shared->name ); fusion_dbg_print_memleaks( shared ); while (ioctl( world->fusion_fd, FUSION_SHMPOOL_DESTROY, &shared->pool_id )) { if (errno != EINTR) { D_PERROR( "Fusion/SHM: FUSION_SHMPOOL_DESTROY failed!\n" ); break; } } if (munmap( shared->addr_base, shared->max_size )) D_PERROR( "Fusion/SHM: Could not munmap shared memory file '%s'!\n", pool->filename ); if (pool->fd != -1 && close( pool->fd )) D_PERROR( "Fusion/SHM: Could not close shared memory file '%s'!\n", pool->filename ); if (unlink( pool->filename )) D_PERROR( "Fusion/SHM: Could not unlink shared memory file '%s'!\n", pool->filename ); shared->active = false; pool->attached = false; D_FREE( pool->filename ); D_MAGIC_CLEAR( pool ); fusion_skirmish_destroy( &shared->lock ); D_MAGIC_CLEAR( shared ); } #else /* FUSION_BUILD_KERNEL */ static DirectResult init_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared, const char *name, unsigned int max_size, bool debug ) { DirectResult ret; int fd; int size; long page_size; int pool_id; unsigned int pool_max_size; void *pool_addr_base = NULL; FusionWorld *world; char buf[FUSION_SHM_TMPFS_PATH_NAME_LEN + 32]; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p, '%s', %d, %sdebug )\n", __FUNCTION__, shm, pool, shared, name, max_size, debug ? "" : "non-" ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( shm->shared, FusionSHMShared ); D_ASSERT( name != NULL ); D_ASSERT( max_size > sizeof(shmalloc_heap) ); world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( pool != NULL ); D_ASSERT( shared != NULL ); page_size = direct_pagesize(); pool_id = ++world->shared->pool_ids; pool_max_size = max_size + BLOCKALIGN(sizeof(shmalloc_heap)) + BLOCKALIGN( (max_size + BLOCKSIZE-1) / BLOCKSIZE * sizeof(shmalloc_info) ); pool_addr_base = world->shared->pool_base; world->shared->pool_base += ((pool_max_size + page_size - 1) & ~(page_size - 1)) + page_size; /* Exceeded limit? */ if (world->shared->pool_base > world->shared->pool_max) return DR_NOSHAREDMEMORY; /* Generate filename. */ snprintf( buf, sizeof(buf), "%s/fusion.%d.%d", shm->shared->tmpfs, fusion_world_index( world ), pool_id ); /* Initialize the heap. */ ret = __shmalloc_init_heap( shm, buf, pool_addr_base, max_size, &fd, &size ); if (ret) return ret; /* Initialize local data. */ pool->attached = true; pool->shm = shm; pool->shared = shared; pool->pool_id = pool_id; pool->fd = fd; pool->filename = D_STRDUP( buf ); /* Initialize shared data. */ shared->active = true; shared->debug = debug; shared->shm = shm->shared; shared->max_size = pool_max_size; shared->pool_id = pool_id; shared->addr_base = pool_addr_base; shared->heap = pool_addr_base; shared->heap->pool = shared; fusion_skirmish_init( &shared->lock, name, world ); D_MAGIC_SET( pool, FusionSHMPool ); D_MAGIC_SET( shared, FusionSHMPoolShared ); shared->name = SHSTRDUP( shared, name ); return DR_OK; } static DirectResult join_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ) { DirectResult ret; int fd; FusionWorld *world; char buf[FUSION_SHM_TMPFS_PATH_NAME_LEN + 32]; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p )\n", __FUNCTION__, shm, pool, shared ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( shm->shared, FusionSHMShared ); D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); #if !DIRECT_BUILD_DEBUGS if (shared->debug) { D_ERROR( "Fusion/SHM: Can't join debug enabled pool with pure-release library!\n" ); return DR_UNSUPPORTED; } #endif world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); /* Generate filename. */ snprintf( buf, sizeof(buf), "%s/fusion.%d.%d", shm->shared->tmpfs, fusion_world_index( shm->world ), shared->pool_id ); /* Join the heap. */ ret = __shmalloc_join_heap( shm, buf, shared->addr_base, shared->max_size, &fd ); if (ret) return ret; /* Initialize local data. */ pool->attached = true; pool->shm = shm; pool->shared = shared; pool->pool_id = shared->pool_id; pool->fd = fd; pool->filename = D_STRDUP( buf ); D_MAGIC_SET( pool, FusionSHMPool ); return DR_OK; } static void leave_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ) { FusionWorld *world; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p )\n", __FUNCTION__, shm, pool, shared ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( pool, FusionSHMPool ); D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); if (munmap( shared->addr_base, shared->max_size )) D_PERROR( "Fusion/SHM: Could not munmap shared memory file '%s'!\n", pool->filename ); if (pool->fd != -1 && close( pool->fd )) D_PERROR( "Fusion/SHM: Could not close shared memory file '%s'!\n", pool->filename ); pool->attached = false; D_FREE( pool->filename ); D_MAGIC_CLEAR( pool ); } static void shutdown_pool( FusionSHM *shm, FusionSHMPool *pool, FusionSHMPoolShared *shared ) { FusionWorld *world; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %p, %p )\n", __FUNCTION__, shm, pool, shared ); D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( pool, FusionSHMPool ); D_MAGIC_ASSERT( shared, FusionSHMPoolShared ); world = shm->world; D_MAGIC_ASSERT( world, FusionWorld ); SHFREE( shared, shared->name ); fusion_dbg_print_memleaks( shared ); if (munmap( shared->addr_base, shared->max_size )) D_PERROR( "Fusion/SHM: Could not munmap shared memory file '%s'!\n", pool->filename ); if (pool->fd != -1 && close( pool->fd )) D_PERROR( "Fusion/SHM: Could not close shared memory file '%s'!\n", pool->filename ); if (unlink( pool->filename )) D_PERROR( "Fusion/SHM: Could not unlink shared memory file '%s'!\n", pool->filename ); shared->active = false; pool->attached = false; D_FREE( pool->filename ); D_MAGIC_CLEAR( pool ); fusion_skirmish_destroy( &shared->lock ); D_MAGIC_CLEAR( shared ); } #endif /* FUSION_BUILD_KERNEL */ /**********************************************************************************************************************/ #if FUSION_BUILD_KERNEL void _fusion_shmpool_process( FusionWorld *world, int pool_id, FusionSHMPoolMessage *msg ) { int i; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_DEBUG_AT( Fusion_SHMPool, "%s( %p, %d, %p )\n", __FUNCTION__, world, pool_id, msg ); D_MAGIC_ASSERT( world, FusionWorld ); shm = &world->shm; D_MAGIC_ASSERT( shm, FusionSHM ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return; for (i=0; ipools[i].attached) { D_MAGIC_ASSERT( &shm->pools[i], FusionSHMPool ); if (shm->pools[i].pool_id == pool_id) { switch (msg->type) { case FSMT_REMAP: break; case FSMT_UNMAP: D_UNIMPLEMENTED(); break; } break; } } } fusion_skirmish_dismiss( &shared->lock ); } #endif /* FUSION_BUILD_KERNEL */ DirectFB-1.2.10/lib/fusion/shm/shm.c0000644000175000017500000002276111245562152013744 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /**********************************************************************************************************************/ static int find_tmpfs( char *name, int len ) { int largest = 0; char buffer[1024]; FILE *mounts_handle; mounts_handle = fopen( "/proc/mounts", "r" ); if (!mounts_handle) return 0; while (fgets( buffer, sizeof(buffer), mounts_handle )) { char *mount_point; char *mount_fs; char *pointer = buffer; strsep( &pointer, " " ); mount_point = strsep( &pointer, " " ); mount_fs = strsep( &pointer, " " ); if (mount_fs && mount_point && !access( mount_point, W_OK ) && (!strcmp( mount_fs, "tmpfs" ) || !strcmp( mount_fs, "shmfs" ) || !strcmp( mount_fs, "ramfs" ))) { struct statfs stat; int bytes; if (statfs( mount_point, &stat )) { D_PERROR( "Fusion/SHM: statfs on '%s' failed!\n", mount_point ); continue; } bytes = stat.f_blocks * stat.f_bsize; if (bytes > largest || (bytes == largest && !strcmp(mount_point,"/dev/shm"))) { largest = bytes; direct_snputs( name, mount_point, len ); } } } fclose( mounts_handle ); return largest; } /**********************************************************************************************************************/ DirectResult fusion_shm_init( FusionWorld *world ) { int i; int num; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); shm = &world->shm; shared = &world->shared->shm; /* Initialize local data. */ memset( shm, 0, sizeof(FusionSHM) ); shm->world = world; shm->shared = shared; /* Initialize shared data. */ if (fusion_master( world )) { memset( shared, 0, sizeof(FusionSHMShared) ); if (fusion_config->tmpfs) { snprintf( shared->tmpfs, FUSION_SHM_TMPFS_PATH_NAME_LEN, fusion_config->tmpfs ); } else if (!find_tmpfs( shared->tmpfs, FUSION_SHM_TMPFS_PATH_NAME_LEN )) { D_ERROR( "Fusion/SHM: Could not find tmpfs mount point, falling back to /dev/shm!\n" ); snprintf( shared->tmpfs, FUSION_SHM_TMPFS_PATH_NAME_LEN, "/dev/shm" ); } shared->world = world->shared; /* Initialize shared lock. */ ret = fusion_skirmish_init( &shared->lock, "Fusion SHM", world ); if (ret) { D_DERROR( ret, "Fusion/SHM: Failed to create skirmish!\n" ); return ret; } /* Initialize static pool array. */ for (i=0; ipools[i].index = i; D_MAGIC_SET( shm, FusionSHM ); D_MAGIC_SET( shared, FusionSHMShared ); } else { D_MAGIC_ASSERT( shared, FusionSHMShared ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return ret; D_MAGIC_SET( shm, FusionSHM ); for (i=0, num=0; ipools[i].active) { D_MAGIC_ASSERT( &shared->pools[i], FusionSHMPoolShared ); ret = fusion_shm_pool_attach( shm, &shared->pools[i] ); if (ret) { for (--i; i>=0; i--) { if (shared->pools[i].active) fusion_shm_pool_detach( shm, &shared->pools[i] ); } fusion_skirmish_dismiss( &shared->lock ); D_MAGIC_CLEAR( shm ); return ret; } num++; } } D_ASSERT( num == shared->num_pools ); fusion_skirmish_dismiss( &shared->lock ); } return DR_OK; } DirectResult fusion_shm_deinit( FusionWorld *world ) { int i; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); shm = &world->shm; D_MAGIC_ASSERT( shm, FusionSHM ); shared = shm->shared; D_MAGIC_ASSERT( shared, FusionSHMShared ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return ret; /* Deinitialize shared data. */ if (fusion_master( world )) { D_ASSUME( shared->num_pools == 0 ); for (i=0; ipools[i].active) { D_MAGIC_ASSERT( &shared->pools[i], FusionSHMPoolShared ); D_MAGIC_ASSERT( &shm->pools[i], FusionSHMPool ); D_WARN( "destroying remaining '%s'", shared->pools[i].name ); fusion_shm_pool_destroy( world, &shared->pools[i] ); } } /* Destroy shared lock. */ fusion_skirmish_destroy( &shared->lock ); D_MAGIC_CLEAR( shared ); } else { for (i=0; ipools[i].active) { D_MAGIC_ASSERT( &shared->pools[i], FusionSHMPoolShared ); D_MAGIC_ASSERT( &shm->pools[i], FusionSHMPool ); fusion_shm_pool_detach( shm, &shared->pools[i] ); } } fusion_skirmish_dismiss( &shared->lock ); } D_MAGIC_CLEAR( shm ); return DR_OK; } DirectResult fusion_shm_attach_unattached( FusionWorld *world ) { int i; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); shm = &world->shm; shared = &world->shared->shm; D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( shared, FusionSHMShared ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return ret; for (i=0; ipools[i].active) continue; D_MAGIC_ASSERT( &shared->pools[i], FusionSHMPoolShared ); if (!shm->pools[i].attached) { ret = fusion_shm_pool_attach( shm, &shared->pools[i] ); if (ret) D_DERROR( ret, "fusion_shm_pool_attach( '%s' ) failed!\n", shared->pools[i].name ); } else D_MAGIC_ASSERT( &shm->pools[i], FusionSHMPool ); } fusion_skirmish_dismiss( &shared->lock ); return DR_OK; } DirectResult fusion_shm_enum_pools( FusionWorld *world, FusionSHMPoolCallback callback, void *ctx ) { int i; DirectResult ret; FusionSHM *shm; FusionSHMShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); D_MAGIC_ASSERT( world->shared, FusionWorldShared ); D_ASSERT( callback != NULL ); shm = &world->shm; shared = &world->shared->shm; D_MAGIC_ASSERT( shm, FusionSHM ); D_MAGIC_ASSERT( shared, FusionSHMShared ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) return ret; for (i=0; ipools[i].active) continue; if (!shm->pools[i].attached) { D_BUG( "not attached to pool" ); continue; } D_MAGIC_ASSERT( &shm->pools[i], FusionSHMPool ); D_MAGIC_ASSERT( &shared->pools[i], FusionSHMPoolShared ); if (callback( &shm->pools[i], ctx ) == DENUM_CANCEL) break; } fusion_skirmish_dismiss( &shared->lock ); return DR_OK; } DirectFB-1.2.10/lib/fusion/shm/shm_internal.h0000644000175000017500000002021611245562152015636 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__SHM__SHM_INTERNAL_H__ #define __FUSION__SHM__SHM_INTERNAL_H__ #include #include #include #include #define FUSION_SHM_MAX_POOLS 16 #define FUSION_SHM_TMPFS_PATH_NAME_LEN 64 typedef struct __shmalloc_heap shmalloc_heap; /* * Local pool data. */ struct __Fusion_FusionSHMPool { int magic; bool attached; /* Indicates usage of this entry in the static pool array. */ FusionSHM *shm; /* Back pointer to local SHM data. */ FusionSHMPoolShared *shared; /* Pointer to shared pool data. */ int pool_id; /* The pool's ID within the world. */ int fd; /* File descriptor of shared memory file. */ char *filename; /* Name of the shared memory file. */ }; /* * Shared pool data. */ struct __Fusion_FusionSHMPoolShared { int magic; bool debug; /* Debug allocations in this pool? */ int index; /* Index within the static pool array. */ bool active; /* Indicates usage of this entry in the static pool array. */ FusionSHMShared *shm; /* Back pointer to shared SHM data. */ int max_size; /* Maximum possible size of the shared memory. */ int pool_id; /* The pool's ID within the world. */ void *addr_base; /* Virtual starting address of shared memory. */ FusionSkirmish lock; /* Lock for this pool. */ shmalloc_heap *heap; /* The actual heap information ported from libc5. */ char *name; /* Name of the pool (allocated in the pool). */ DirectLink *allocs; /* Used for debugging. */ }; /* * Local SHM data. */ struct __Fusion_FusionSHM { int magic; FusionWorld *world; /* Back pointer to local world data. */ FusionSHMShared *shared; /* Pointer to shared SHM data. */ FusionSHMPool pools[FUSION_SHM_MAX_POOLS]; /* Local data of all pools. */ DirectSignalHandler *signal_handler; }; /* * Shared SHM data. */ struct __Fusion_FusionSHMShared { int magic; FusionWorldShared *world; /* Back pointer to shared world data. */ FusionSkirmish lock; /* Lock for list of pools. */ int num_pools; /* Number of active pools. */ FusionSHMPoolShared pools[FUSION_SHM_MAX_POOLS]; /* Shared data of all pools. */ char tmpfs[FUSION_SHM_TMPFS_PATH_NAME_LEN]; }; /* The allocator divides the heap into blocks of fixed size; large requests receive one or more whole blocks, and small requests receive a fragment of a block. Fragment sizes are powers of two, and all fragments of a block are the same size. When all the fragments in a block have been freed, the block itself is freed. */ #define INT_BIT (CHAR_BIT * sizeof(int)) #define BLOCKLOG (INT_BIT > 16 ? 12 : 9) #define BLOCKSIZE (1 << BLOCKLOG) #define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE) #define BLOCKALIGN(SIZE) (((SIZE) + BLOCKSIZE - 1) & ~(BLOCKSIZE - 1)) /* Number of contiguous free blocks allowed to build up at the end of memory before they will be returned to the system. */ #define FINAL_FREE_BLOCKS 8 /* Address to block number and vice versa. */ #define BLOCK(A) (((char *) (A) - heap->heapbase) / BLOCKSIZE + 1) #define ADDRESS(B) ((void *) (((B) - 1) * BLOCKSIZE + heap->heapbase)) /* Data structure giving per-block information. */ typedef union { /* Heap information for a busy block. */ struct { /* Zero for a large block, or positive giving the logarithm to the base two of the fragment size. */ int type; union { struct { size_t nfree; /* Free fragments in a fragmented block. */ size_t first; /* First free fragment of the block. */ } frag; /* Size (in blocks) of a large cluster. */ size_t size; } info; } busy; /* Heap information for a free block (that may be the first of a free cluster). */ struct { size_t size; /* Size (in blocks) of a free cluster. */ size_t next; /* Index of next free cluster. */ size_t prev; /* Index of previous free cluster. */ } free; } shmalloc_info; /* Doubly linked lists of free fragments. */ struct list { struct list *next; struct list *prev; }; #define SHMEMDESC_FUNC_NAME_LENGTH 48 #define SHMEMDESC_FILE_NAME_LENGTH 24 /* Used for debugging. */ typedef struct { DirectLink link; const void *mem; size_t bytes; char func[SHMEMDESC_FUNC_NAME_LENGTH]; char file[SHMEMDESC_FILE_NAME_LENGTH]; unsigned int line; FusionID fid; } SHMemDesc; struct __shmalloc_heap { int magic; /* Pointer to first block of the heap. */ char *heapbase; /* Block information table indexed by block number giving per-block information. */ shmalloc_info *heapinfo; /* Number of info entries. */ size_t heapsize; /* Current search index for the heap table. */ size_t heapindex; /* Limit of valid info table indices. */ size_t heaplimit; #if 1 /* Adapted from Mike */ /* Count of large blocks allocated for each fragment size. */ int fragblocks[BLOCKLOG]; #endif /* Free list headers for each fragment size. */ struct list fraghead[BLOCKLOG]; /* Instrumentation. */ size_t chunks_used; size_t bytes_used; size_t chunks_free; size_t bytes_free; /* Total size of heap in bytes. */ int size; /* Back pointer to shared memory pool. */ FusionSHMPoolShared *pool; }; void *_fusion_shmalloc (shmalloc_heap *heap, size_t __size); void *_fusion_shrealloc (shmalloc_heap *heap, void *__ptr, size_t __size); void _fusion_shfree (shmalloc_heap *heap, void *__ptr); DirectResult __shmalloc_init_heap( FusionSHM *shm, const char *filename, void *addr_base, int space, int *ret_fd, int *ret_size ); DirectResult __shmalloc_join_heap( FusionSHM *shm, const char *filename, void *addr_base, int size, int *ret_fd ); void *__shmalloc_brk ( shmalloc_heap *heap, int increment ); #endif DirectFB-1.2.10/lib/fusion/shm/pool.h0000644000175000017500000000563411245562152014133 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__SHM__POOL_H__ #define __FUSION__SHM__POOL_H__ #include DirectResult fusion_shm_pool_create ( FusionWorld *world, const char *name, unsigned int max_size, bool debug, FusionSHMPoolShared **ret_pool ); DirectResult fusion_shm_pool_destroy ( FusionWorld *world, FusionSHMPoolShared *pool ); DirectResult fusion_shm_pool_attach ( FusionSHM *shm, FusionSHMPoolShared *pool ); DirectResult fusion_shm_pool_detach ( FusionSHM *shm, FusionSHMPoolShared *pool ); DirectResult fusion_shm_pool_allocate ( FusionSHMPoolShared *pool, int size, bool clear, bool lock, void **ret_data ); DirectResult fusion_shm_pool_reallocate( FusionSHMPoolShared *pool, void *data, int size, bool lock, void **ret_data ); DirectResult fusion_shm_pool_deallocate( FusionSHMPoolShared *pool, void *data, bool lock ); #endif DirectFB-1.2.10/lib/fusion/hash.h0000644000175000017500000001146711245562152013317 00000000000000/* GLIB - Library of useful routines for C programming Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä , Claudio Ciccani and Michael Emmel . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with * GLib at ftp://ftp.gtk.org/pub/gtk/. */ #ifndef __FUSION_HASH_H__ #define __FUSION_HASH_H__ #include #include #include #define FUSION_HASH_MIN_SIZE 11 #define FUSION_HASH_MAX_SIZE 13845163 #define HASH_STR(h,p) \ {\ h = *p;\ if (h)\ for (p += 1; *p != '\0'; p++)\ h = (h << 5) - h + *p;\ }\ typedef enum { HASH_PTR, HASH_STRING, HASH_INT } FusionHashType; typedef struct _FusionHashNode FusionHashNode; struct _FusionHashNode { void *key; void *value; FusionHashNode *next; }; struct __Fusion_FusionHash { int magic; bool local; FusionHashType key_type; FusionHashType value_type; int size; int nnodes; FusionHashNode **nodes; FusionSHMPoolShared *pool; bool free_keys; bool free_values; }; typedef bool (*FusionHashIteratorFunc)( FusionHash *hash, void *key, void *value, void *ctx ); DirectResult fusion_hash_resize (FusionHash *hash); DirectResult fusion_hash_create (FusionSHMPoolShared *pool, FusionHashType key_type, FusionHashType value_type, int size, FusionHash **ret_hash ); DirectResult fusion_hash_create_local (FusionHashType key_type, FusionHashType value_type, int size, FusionHash **ret_hash ); DirectResult fusion_hash_remove (FusionHash *hash, const void * key, void **old_key, void **old_value); DirectResult fusion_hash_insert( FusionHash *hash, void *key, void *value ); DirectResult fusion_hash_replace (FusionHash *hash, void * key, void * value, void **old_key, void **old_value); void fusion_hash_destroy( FusionHash *hash ); void fusion_hash_set_autofree( FusionHash *hash, bool free_keys, bool free_values ); void * fusion_hash_lookup (FusionHash *hash, const void * key); void fusion_hash_iterate( FusionHash *hash, FusionHashIteratorFunc func, void *ctx ); unsigned int fusion_hash_size (FusionHash *hash); bool fusion_hash_should_resize ( FusionHash *hash); static inline FusionHashNode** fusion_hash_lookup_node (FusionHash *hash, const void * key) { FusionHashNode **node; /*TODO We could also optimize pointer hashing*/ if (hash->key_type == HASH_STRING ) { unsigned int h; const signed char *p = key; HASH_STR(h,p) node = &hash->nodes[h % hash->size]; } else node = &hash->nodes[((unsigned long)key) % hash->size]; /* Hash table lookup needs to be fast. * We therefore remove the extra conditional of testing * whether to call the key_equal_func or not from * the inner loop. */ if (hash->key_type == HASH_STRING ) { while(*node && strcmp((const char *)(*node)->key,(const char*)key)) node = &(*node)->next; } else while (*node && (*node)->key != key) node = &(*node)->next; return node; } #endif /*__FUSION_HASH_H__*/ DirectFB-1.2.10/lib/fusion/ref.h0000644000175000017500000000774311245562152013152 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__REF_H__ #define __FUSION__REF_H__ #include #include #include #include typedef union { /* multi app */ struct { int id; const FusionWorldShared *shared; FusionID creator; /* builtin impl */ struct { int local; int global; FusionSkirmish lock; FusionCall *call; int call_arg; } builtin; } multi; /* single app */ struct { int refs; pthread_cond_t cond; pthread_mutex_t lock; bool destroyed; int locked; FusionCall *call; int call_arg; } single; } FusionRef; /* * Initialize. */ DirectResult fusion_ref_init (FusionRef *ref, const char *name, const FusionWorld *world); DirectResult fusion_ref_set_name (FusionRef *ref, const char *name); /* * Lock, increase, unlock. */ DirectResult fusion_ref_up (FusionRef *ref, bool global); /* * Lock, decrease, unlock. */ DirectResult fusion_ref_down (FusionRef *ref, bool global); /* * Get the current reference count. Meant for debugging only. * This value is not reliable, because no locking will be performed * and the value may change after or even while returning it. */ DirectResult fusion_ref_stat (FusionRef *ref, int *refs); /* * Wait for zero and lock. */ DirectResult fusion_ref_zero_lock (FusionRef *ref); /* * Check for zero and lock if true. */ DirectResult fusion_ref_zero_trylock (FusionRef *ref); /* * Unlock the counter. * Only to be called after successful zero_lock or zero_trylock. */ DirectResult fusion_ref_unlock (FusionRef *ref); /* * Have the call executed when reference counter reaches zero. */ DirectResult fusion_ref_watch (FusionRef *ref, FusionCall *call, int call_arg); /* * Inherit local reference count from another reference. * * The local count of the other reference (and its inherited references) is added to this reference. */ DirectResult fusion_ref_inherit (FusionRef *ref, FusionRef *from); /* * Deinitialize. * Can be called after successful zero_lock or zero_trylock * so that waiting fusion_ref_up calls return with DR_DESTROYED. */ DirectResult fusion_ref_destroy (FusionRef *ref); #endif DirectFB-1.2.10/lib/fusion/reactor.h0000644000175000017500000001654011245562152014030 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__REACTOR_H__ #define __FUSION__REACTOR_H__ #include #include #include #include typedef enum { RS_OK, RS_REMOVE, RS_DROP } ReactionResult; typedef ReactionResult (*ReactionFunc)( const void *msg_data, void *ctx ); typedef struct { DirectLink link; ReactionFunc func; void *ctx; void *node_link; } Reaction; typedef struct { DirectLink link; int index; void *ctx; bool attached; } GlobalReaction; /* * Create a new reactor configured for the specified message data size. */ FusionReactor *fusion_reactor_new ( int msg_size, const char *name, const FusionWorld *world ); /* * Destroy the reactor. */ DirectResult fusion_reactor_destroy ( FusionReactor *reactor ); /* * Free the reactor. */ DirectResult fusion_reactor_free ( FusionReactor *reactor ); /* * Makes the reactor use the specified lock for managing global reactions. * * After creating the reactor a global default lock is set which is created * by Fusion once during initialization. * * To avoid dead locks caused by alternating lock orders of the global reaction * lock and another lock, the default lock is replaced by the other lock. */ DirectResult fusion_reactor_set_lock ( FusionReactor *reactor, FusionSkirmish *skirmish ); DirectResult fusion_reactor_set_lock_only( FusionReactor *reactor, FusionSkirmish *lock ); /* * Attach a local reaction to the reactor (channel 0). */ DirectResult fusion_reactor_attach ( FusionReactor *reactor, ReactionFunc func, void *ctx, Reaction *reaction ); /* * Attach a local reaction to a specific reactor channel (0-1023). */ DirectResult fusion_reactor_attach_channel( FusionReactor *reactor, int channel, ReactionFunc func, void *ctx, Reaction *reaction ); /* * Detach an attached local reaction from the reactor. */ DirectResult fusion_reactor_detach ( FusionReactor *reactor, Reaction *reaction ); /* * Attach a global reaction to the reactor. * * It's always called directly, no matter which Fusionee calls fusion_reactor_dispatch(). * Any data referenced by the reaction function has to be in shared memory, unless it uses a * mechanism to lookup a local counter part or representative, based on shared information. * * A global reaction is not defined directly as a function pointer, because that's always a * local address. Instead, it's specified by an index into a built in function table that * must be passed to fusion_reactor_dispatch() each time it is called. */ DirectResult fusion_reactor_attach_global( FusionReactor *reactor, int index, void *ctx, GlobalReaction *reaction ); /* * Detach an attached global reaction from the reactor. */ DirectResult fusion_reactor_detach_global( FusionReactor *reactor, GlobalReaction *reaction ); /* * Dispatch a message to any attached reaction (channel 0). * * Setting 'self' to false excludes the caller's local reactions. */ DirectResult fusion_reactor_dispatch ( FusionReactor *reactor, const void *msg_data, bool self, const ReactionFunc *globals ); /* * Dispatch a message to any attached reaction with a given size. Instead of * using the size defined by the reactor, the caller can specify the size of * the data. * * Setting 'self' to false excludes the caller's local reactions. */ DirectResult fusion_reactor_sized_dispatch( FusionReactor *reactor, const void *msg_data, int msg_size, bool self, const ReactionFunc *globals ); /* * Dispatch a message via a specific channel (0-1023). * * Setting 'self' to false excludes the caller's local reactions. */ DirectResult fusion_reactor_dispatch_channel( FusionReactor *reactor, int channel, const void *msg_data, int msg_size, bool self, const ReactionFunc *globals ); /* * Have the call executed when a dispatched message has been processed by all recipients. */ DirectResult fusion_reactor_set_dispatch_callback( FusionReactor *reactor, FusionCall *call, void *call_ptr ); /* * Change the name of the reactor (debug). */ DirectResult fusion_reactor_set_name ( FusionReactor *reactor, const char *name ); /* * Specify whether local message handlers (reactions) should be called directly. */ DirectResult fusion_reactor_direct ( FusionReactor *reactor, bool direct ); #endif DirectFB-1.2.10/lib/fusion/object.c0000644000175000017500000004337011245562152013633 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" D_DEBUG_DOMAIN( Fusion_Object, "Fusion/Object", "Fusion Objects and Pools" ); struct __Fusion_FusionObjectPool { int magic; FusionWorldShared *shared; FusionSkirmish lock; DirectLink *objects; FusionObjectID id_pool; char *name; int object_size; int message_size; FusionObjectDestructor destructor; void *ctx; FusionCall call; }; static FusionCallHandlerResult object_reference_watcher( int caller, int call_arg, void *call_ptr, void *ctx, unsigned int serial, int *ret_val ) { FusionObject *object; FusionObjectPool *pool = ctx; D_DEBUG_AT( Fusion_Object, "%s( %d, %d, %p, %p, %u, %p )\n", __FUNCTION__, caller, call_arg, call_ptr, ctx, serial, ret_val ); #if FUSION_BUILD_KERNEL if (caller) { D_BUG( "Call not from Fusion/Kernel (caller %d)", caller ); return FCHR_RETURN; } #endif D_MAGIC_ASSERT( pool, FusionObjectPool ); /* Lock the pool. */ if (fusion_skirmish_prevail( &pool->lock )) return FCHR_RETURN; /* Lookup the object. */ direct_list_foreach (object, pool->objects) { if (object->id != call_arg) continue; D_MAGIC_ASSERT( object, FusionObject ); switch (fusion_ref_zero_trylock( &object->ref )) { case DR_OK: break; case DR_DESTROYED: D_BUG( "already destroyed %p [%ld] in '%s'", object, object->id, pool->name ); direct_list_remove( &pool->objects, &object->link ); fusion_skirmish_dismiss( &pool->lock ); return FCHR_RETURN; default: D_ERROR( "Fusion/ObjectPool: Error locking ref of %p [%ld] in '%s'\n", object, object->id, pool->name ); /* fall through */ case DR_BUSY: fusion_skirmish_dismiss( &pool->lock ); return FCHR_RETURN; } D_DEBUG_AT( Fusion_Object, "== %s ==\n", pool->name ); D_DEBUG_AT( Fusion_Object, " -> dead object %p [%ld]\n", object, object->id ); if (object->state == FOS_INIT) { D_BUG( "== %s == incomplete object: %d (%p)", pool->name, call_arg, object ); D_WARN( "won't destroy incomplete object, leaking some memory" ); direct_list_remove( &pool->objects, &object->link ); fusion_skirmish_dismiss( &pool->lock ); return FCHR_RETURN; } /* Set "deinitializing" state. */ object->state = FOS_DEINIT; /* Remove the object from the pool. */ object->pool = NULL; direct_list_remove( &pool->objects, &object->link ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); D_DEBUG_AT( Fusion_Object, " -> calling destructor...\n" ); /* Call the destructor. */ pool->destructor( object, false, pool->ctx ); D_DEBUG_AT( Fusion_Object, " -> destructor done.\n" ); return FCHR_RETURN; } D_BUG( "unknown object [%d] in '%s'", call_arg, pool->name ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return FCHR_RETURN; } FusionObjectPool * fusion_object_pool_create( const char *name, int object_size, int message_size, FusionObjectDestructor destructor, void *ctx, const FusionWorld *world ) { FusionObjectPool *pool; FusionWorldShared *shared; D_ASSERT( name != NULL ); D_ASSERT( object_size >= sizeof(FusionObject) ); D_ASSERT( message_size > 0 ); D_ASSERT( destructor != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Allocate shared memory for the pool. */ pool = SHCALLOC( shared->main_pool, 1, sizeof(FusionObjectPool) ); if (!pool) { D_OOSHM(); return NULL; } /* Initialize the pool lock. */ fusion_skirmish_init( &pool->lock, name, world ); /* Fill information. */ pool->shared = shared; pool->name = SHSTRDUP( shared->main_pool, name ); pool->object_size = object_size; pool->message_size = message_size; pool->destructor = destructor; pool->ctx = ctx; /* Destruction call from Fusion. */ fusion_call_init( &pool->call, object_reference_watcher, pool, world ); D_MAGIC_SET( pool, FusionObjectPool ); return pool; } DirectResult fusion_object_pool_destroy( FusionObjectPool *pool, const FusionWorld *world ) { DirectResult ret; DirectLink *n; FusionObject *object; FusionWorldShared *shared; D_ASSERT( pool != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_ASSERT( shared == pool->shared ); D_DEBUG_AT( Fusion_Object, "== %s ==\n", pool->name ); D_DEBUG_AT( Fusion_Object, " -> destroying pool...\n" ); D_DEBUG_AT( Fusion_Object, " -> syncing...\n" ); /* Wait for processing of pending messages. */ if (pool->objects) fusion_sync( world ); D_DEBUG_AT( Fusion_Object, " -> locking...\n" ); /* Lock the pool. */ ret = fusion_skirmish_prevail( &pool->lock ); if (ret) return ret; /* Destroy the call. */ fusion_call_destroy( &pool->call ); if (pool->objects) D_WARN( "still objects in '%s'", pool->name ); /* Destroy zombies */ direct_list_foreach_safe (object, n, pool->objects) { int refs; fusion_ref_stat( &object->ref, &refs ); D_DEBUG_AT( Fusion_Object, "== %s ==\n", pool->name ); D_DEBUG_AT( Fusion_Object, " -> zombie %p [%ld], refs %d\n", object, object->id, refs ); /* Set "deinitializing" state. */ object->state = FOS_DEINIT; /* Remove the object from the pool. */ //direct_list_remove( &pool->objects, &object->link ); //object->pool = NULL; D_DEBUG_AT( Fusion_Object, " -> calling destructor...\n" ); /* Call the destructor. */ pool->destructor( object, refs > 0, pool->ctx ); D_DEBUG_AT( Fusion_Object, " -> destructor done.\n" ); D_ASSERT( ! direct_list_contains_element_EXPENSIVE( pool->objects, (DirectLink*) object ) ); } pool->objects = NULL; /* Destroy the pool lock. */ fusion_skirmish_destroy( &pool->lock ); D_DEBUG_AT( Fusion_Object, " -> pool destroyed (%s)\n", pool->name ); D_MAGIC_CLEAR( pool ); /* Deallocate shared memory. */ SHFREE( shared->main_pool, pool->name ); SHFREE( shared->main_pool, pool ); return DR_OK; } DirectResult fusion_object_pool_enum( FusionObjectPool *pool, FusionObjectCallback callback, void *ctx ) { FusionObject *object; D_MAGIC_ASSERT( pool, FusionObjectPool ); D_ASSERT( callback != NULL ); /* Lock the pool. */ if (fusion_skirmish_prevail( &pool->lock )) return DR_FUSION; direct_list_foreach (object, pool->objects) { D_MAGIC_ASSERT( object, FusionObject ); if (!callback( pool, object, ctx )) break; } /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return DR_OK; } FusionObject * fusion_object_create( FusionObjectPool *pool, const FusionWorld *world ) { FusionObject *object; FusionWorldShared *shared; D_MAGIC_ASSERT( pool, FusionObjectPool ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_ASSERT( shared == pool->shared ); /* Lock the pool. */ if (fusion_skirmish_prevail( &pool->lock )) return NULL; /* Allocate shared memory for the object. */ object = SHCALLOC( shared->main_pool, 1, pool->object_size ); if (!object) { D_OOSHM(); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Set "initializing" state. */ object->state = FOS_INIT; /* Set object id. */ object->id = ++pool->id_pool; /* Initialize the reference counter. */ if (fusion_ref_init( &object->ref, pool->name, world )) { SHFREE( shared->main_pool, object ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Increase the object's reference counter. */ fusion_ref_up( &object->ref, false ); /* Install handler for automatic destruction. */ if (fusion_ref_watch( &object->ref, &pool->call, object->id )) { fusion_ref_destroy( &object->ref ); SHFREE( shared->main_pool, object ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } /* Create a reactor for message dispatching. */ object->reactor = fusion_reactor_new( pool->message_size, pool->name, world ); if (!object->reactor) { fusion_ref_destroy( &object->ref ); SHFREE( shared->main_pool, object ); fusion_skirmish_dismiss( &pool->lock ); return NULL; } fusion_reactor_set_lock( object->reactor, &pool->lock ); /* Set pool/world back pointer. */ object->pool = pool; object->shared = shared; /* Add the object to the pool. */ direct_list_prepend( &pool->objects, &object->link ); D_DEBUG_AT( Fusion_Object, "== %s ==\n", pool->name ); #if FUSION_BUILD_MULTI D_DEBUG_AT( Fusion_Object, " -> added %p with ref [0x%x]\n", object, object->ref.multi.id ); #else D_DEBUG_AT( Fusion_Object, " -> added %p\n", object ); #endif D_MAGIC_SET( object, FusionObject ); /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return object; } DirectResult fusion_object_get( FusionObjectPool *pool, FusionObjectID object_id, FusionObject **ret_object ) { DirectResult ret = DR_IDNOTFOUND; FusionObject *object; D_MAGIC_ASSERT( pool, FusionObjectPool ); D_ASSERT( ret_object != NULL ); /* Lock the pool. */ if (fusion_skirmish_prevail( &pool->lock )) return DR_FUSION; direct_list_foreach (object, pool->objects) { D_MAGIC_ASSERT( object, FusionObject ); if (object->id == object_id) { ret = fusion_object_ref( object ); break; } } if (ret == DR_OK) *ret_object = object; /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); return ret; } DirectResult fusion_object_set_lock( FusionObject *object, FusionSkirmish *lock ) { D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( lock != NULL ); D_ASSUME( object->state == FOS_INIT ); return fusion_reactor_set_lock_only( object->reactor, lock ); } DirectResult fusion_object_activate( FusionObject *object ) { D_MAGIC_ASSERT( object, FusionObject ); /* Set "active" state. */ object->state = FOS_ACTIVE; return DR_OK; } DirectResult fusion_object_destroy( FusionObject *object ) { FusionObjectPool *pool; FusionWorldShared *shared; D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( object->state != FOS_ACTIVE ); shared = object->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); pool = object->pool; // D_ASSUME( pool != NULL ); /* Set "deinitializing" state. */ object->state = FOS_DEINIT; /* Remove the object from the pool. */ if (pool) { D_MAGIC_ASSERT( pool, FusionObjectPool ); /* Lock the pool. */ if (fusion_skirmish_prevail( &pool->lock )) return DR_FAILURE; D_MAGIC_ASSERT( pool, FusionObjectPool ); D_ASSUME( object->pool != NULL ); /* Remove the object from the pool. */ if (object->pool) { D_ASSERT( object->pool == pool ); object->pool = NULL; direct_list_remove( &pool->objects, &object->link ); } /* Unlock the pool. */ fusion_skirmish_dismiss( &pool->lock ); } fusion_ref_destroy( &object->ref ); fusion_reactor_free( object->reactor ); if ( object->properties ) fusion_hash_destroy(object->properties); D_MAGIC_CLEAR( object ); SHFREE( shared->main_pool, object ); return DR_OK; } /* * Sets a value for a key. * If the key currently has a value the old value is returned * in old_value. * If old_value is null the object is freed with SHFREE. * If this is not the correct semantics for your data, if for example * its reference counted you must pass in a old_value. */ DirectResult fusion_object_set_property( FusionObject *object, const char *key, void *value, void **old_value ) { DirectResult ret; char *sharedkey; D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( object->shared != NULL ); D_ASSERT( key != NULL ); D_ASSERT( value != NULL ); /* Create property hash on demand. */ if (!object->properties) { ret = fusion_hash_create( object->shared->main_pool, HASH_STRING, HASH_PTR, FUSION_HASH_MIN_SIZE, &object->properties ); if (ret) return ret; } /* Create a shared copy of the key. */ sharedkey = SHSTRDUP( object->shared->main_pool, key ); if (!sharedkey) return D_OOSHM(); /* Put it into the hash. */ ret = fusion_hash_replace( object->properties, sharedkey, value, NULL, old_value ); if (ret) SHFREE( object->shared->main_pool, sharedkey ); return ret; } /* * Helper function for int values */ DirectResult fusion_object_set_int_property( FusionObject *object, const char *key, int value ) { DirectResult ret; int *iptr; D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( key != NULL ); iptr = SHMALLOC( object->shared->main_pool, sizeof(int) ); if (!iptr) return D_OOSHM(); *iptr = value; ret = fusion_object_set_property( object, key, iptr, NULL ); if (ret) SHFREE( object->shared->main_pool, iptr ); return ret; } /* * Helper function for char* values use if the string * is not in shared memory * Assumes that the old value was a string and frees it. */ DirectResult fusion_object_set_string_property( FusionObject *object, const char *key, char *value ) { DirectResult ret; char *copy; D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( key != NULL ); D_ASSERT( value != NULL ); copy = SHSTRDUP( object->shared->main_pool, value ); if (!copy) return D_OOSHM(); ret = fusion_object_set_property( object, key, copy, NULL ); if (ret) SHFREE( object->shared->main_pool, copy ); return ret; } void * fusion_object_get_property( FusionObject *object, const char *key ) { D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( key != NULL ); if (!object->properties) return NULL; return fusion_hash_lookup( object->properties, key ); } void fusion_object_remove_property( FusionObject *object, const char *key, void **old_value) { D_MAGIC_ASSERT( object, FusionObject ); D_ASSERT( key != NULL ); if (!object->properties) return; fusion_hash_remove( object->properties, key, NULL, old_value ); if (fusion_hash_should_resize( object->properties )) fusion_hash_resize( object->properties ); } DirectFB-1.2.10/lib/fusion/fusion_internal.h0000644000175000017500000001310611245562152015563 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__FUSION_INTERNAL_H__ #define __FUSION__FUSION_INTERNAL_H__ #include #include #include #include #include #include #include #include #include #if FUSION_BUILD_MULTI # if FUSION_BUILD_KERNEL # include # include # else # include # endif #endif #define FUSION_MAX_WORLDS 8 /*************************************** * Fusion internal type declarations * ***************************************/ struct __Fusion_FusionWorldShared { int magic; int refs; /* Increased by the master on fork(). */ int world_index; int world_abi; struct timeval start_time; DirectLink *arenas; FusionSkirmish arenas_lock; FusionSkirmish reactor_globals; FusionSHMShared shm; FusionSHMPoolShared *main_pool; DirectLink *fusionees; /* Connected fusionees. */ FusionSkirmish fusionees_lock; unsigned int call_ids; /* Generates call ids. */ unsigned int lock_ids; /* Generates locks ids. */ unsigned int ref_ids; /* Generates refs ids. */ unsigned int reactor_ids; /* Generates reactors ids. */ unsigned int pool_ids; /* Generates pools ids. */ void *pool_base; /* SHM pool allocation base. */ void *pool_max; /* SHM pool max address. */ }; struct __Fusion_FusionWorld { int magic; int refs; FusionWorldShared *shared; int fusion_fd; FusionID fusion_id; DirectThread *dispatch_loop; bool dispatch_stop; /* * List of reactors with at least one local reaction attached. */ DirectLink *reactor_nodes; pthread_mutex_t reactor_nodes_lock; FusionSHM shm; FusionForkAction fork_action; FusionForkCallback fork_callback; void *fusionee; }; /******************************************* * Fusion internal function declarations * *******************************************/ int _fusion_fd( const FusionWorldShared *shared ); FusionID _fusion_id( const FusionWorldShared *shared ); FusionWorld *_fusion_world( const FusionWorldShared *shared ); /* * from reactor.c */ void _fusion_reactor_free_all ( FusionWorld *world ); void _fusion_reactor_process_message( FusionWorld *world, int reactor_id, int channel, const void *msg_data ); #if FUSION_BUILD_MULTI /* * from call.c */ void _fusion_call_process( FusionWorld *world, int call_id, FusionCallMessage *call ); #if FUSION_BUILD_KERNEL /* * from shm.c */ void _fusion_shmpool_process( FusionWorld *world, int pool_id, FusionSHMPoolMessage *msg ); #else /* * form fusion.c */ void _fusion_add_local( FusionWorld *world, FusionRef *ref, int add ); void _fusion_check_locals( FusionWorld *world, FusionRef *ref ); void _fusion_remove_all_locals( FusionWorld *world, const FusionRef *ref ); DirectResult _fusion_send_message( int fd, const void *msg, size_t msg_size, struct sockaddr_un *addr ); DirectResult _fusion_recv_message( int fd, void *msg, size_t msg_size, struct sockaddr_un *addr ); /* * from ref.c */ DirectResult _fusion_ref_change( FusionRef *ref, int add, bool global ); #endif /* FUSION_BUILD_KERNEL */ #endif /* FUSION_BUILD_MULTI */ #endif DirectFB-1.2.10/lib/fusion/call.h0000644000175000017500000000560411245562152013303 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__CALL_H__ #define __FUSION__CALL_H__ #include typedef enum { FCHR_RETURN, FCHR_RETAIN } FusionCallHandlerResult; typedef FusionCallHandlerResult (*FusionCallHandler) (int caller, /* fusion id of the caller */ int call_arg, /* optional call parameter */ void *call_ptr, /* optional call parameter */ void *ctx, /* optional handler context */ unsigned int serial, int *ret_val ); typedef struct { FusionWorldShared *shared; int call_id; FusionID fusion_id; FusionCallHandler handler; void *ctx; } FusionCall; DirectResult fusion_call_init ( FusionCall *call, FusionCallHandler handler, void *ctx, const FusionWorld *world ); DirectResult fusion_call_execute( FusionCall *call, FusionCallExecFlags flags, int call_arg, void *call_ptr, int *ret_val ); DirectResult fusion_call_return ( FusionCall *call, unsigned int serial, int val ); DirectResult fusion_call_destroy( FusionCall *call ); #endif DirectFB-1.2.10/lib/fusion/property.h0000644000175000017500000000660411245562152014255 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__PROPERTY_H__ #define __FUSION__PROPERTY_H__ #include #include typedef enum { FUSION_PROPERTY_AVAILABLE, FUSION_PROPERTY_LEASED, FUSION_PROPERTY_PURCHASED } FusionPropertyState; typedef union { /* multi app */ struct { int id; const FusionWorldShared *shared; /* builtin impl */ struct { FusionPropertyState state; pid_t owner; bool requested; bool destroyed; } builtin; } multi; /* single app */ struct { pthread_mutex_t lock; pthread_cond_t cond; FusionPropertyState state; } single; } FusionProperty; /* * Initializes the property */ DirectResult fusion_property_init (FusionProperty *property, const FusionWorld *world); /* * Lease the property causing others to wait before leasing or purchasing. * * Waits as long as property is leased by another party. * Returns DR_BUSY if property is/gets purchased by another party. * * Succeeds if property is available, * puts the property into 'leased' state. */ DirectResult fusion_property_lease (FusionProperty *property); /* * Purchase the property disallowing others to lease or purchase it. * * Waits as long as property is leased by another party. * Returns DR_BUSY if property is/gets purchased by another party. * * Succeeds if property is available, * puts the property into 'purchased' state and wakes up any waiting party. */ DirectResult fusion_property_purchase (FusionProperty *property); /* * Cede the property allowing others to lease or purchase it. * * Puts the property into 'available' state and wakes up one waiting party. */ DirectResult fusion_property_cede (FusionProperty *property); /* * Kills the owner of the property. * * Tries to make a purchased property available again by killing * the process that purchased it. */ DirectResult fusion_property_holdup (FusionProperty *property); /* * Destroys the property */ DirectResult fusion_property_destroy (FusionProperty *property); #endif DirectFB-1.2.10/lib/fusion/shmalloc.h0000644000175000017500000001050611245562152014167 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . Fusion shmalloc is based on GNU malloc. Please see below. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__SHMALLOC_H__ #define __FUSION__SHMALLOC_H__ #include #include #include #include #include #if FUSION_BUILD_MULTI && DIRECT_BUILD_TEXT #define D_OOSHM() (direct_messages_warn( __FUNCTION__, __FILE__, __LINE__, \ "out of shared memory" ), DR_NOSHAREDMEMORY) #else #define D_OOSHM() D_OOM() #endif void fusion_dbg_print_memleaks( FusionSHMPoolShared *pool ); void *fusion_dbg_shmalloc ( FusionSHMPoolShared *pool, const char *file, int line, const char *func, size_t __size ); void *fusion_dbg_shcalloc ( FusionSHMPoolShared *pool, const char *file, int line, const char *func, size_t __nmemb, size_t __size); void *fusion_dbg_shrealloc( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *what, void *__ptr, size_t __size ); void fusion_dbg_shfree ( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *what, void *__ptr ); char *fusion_dbg_shstrdup ( FusionSHMPoolShared *pool, const char *file, int line, const char *func, const char *string ); /* Allocate SIZE bytes of memory. */ void *fusion_shmalloc (FusionSHMPoolShared *pool, size_t __size); /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ void *fusion_shcalloc (FusionSHMPoolShared *pool, size_t __nmemb, size_t __size); /* Re-allocate the previously allocated block in __ptr, making the new block SIZE bytes long. */ void *fusion_shrealloc (FusionSHMPoolShared *pool, void *__ptr, size_t __size); /* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */ void fusion_shfree (FusionSHMPoolShared *pool, void *__ptr); /* Duplicate string in shared memory. */ char *fusion_shstrdup (FusionSHMPoolShared *pool, const char *string); #if DIRECT_BUILD_DEBUGS || DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #if !DIRECT_BUILD_DEBUGS #warning Building with debug, but library headers suggest that debug is not supported. #endif #define SHMALLOC(pool,bytes) fusion_dbg_shmalloc( pool, __FILE__, __LINE__, __FUNCTION__, bytes ) #define SHCALLOC(pool,count,bytes) fusion_dbg_shcalloc( pool, __FILE__, __LINE__, __FUNCTION__, count, bytes ) #define SHREALLOC(pool,mem,bytes) fusion_dbg_shrealloc( pool, __FILE__, __LINE__, __FUNCTION__, #mem, mem, bytes ) #define SHFREE(pool,mem) fusion_dbg_shfree( pool, __FILE__, __LINE__, __FUNCTION__, #mem,mem ) #define SHSTRDUP(pool,string) fusion_dbg_shstrdup( pool, __FILE__, __LINE__, __FUNCTION__, string ) #else #define SHMALLOC fusion_shmalloc #define SHCALLOC fusion_shcalloc #define SHREALLOC fusion_shrealloc #define SHFREE fusion_shfree #define SHSTRDUP fusion_shstrdup #endif #endif DirectFB-1.2.10/lib/fusion/hash.c0000644000175000017500000003674411245562152013317 00000000000000/* GLIB - Library of useful routines for C programming Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä , Claudio Ciccani and Michael Emmel . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Modified by the GLib Team and others 1997-2000. See the AUTHORS * file for a list of people on the GLib Team. See the ChangeLog * files for a list of changes. These files are distributed with * GLib at ftp://ftp.gtk.org/pub/gtk/. */ #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Fusion_Hash, "Fusion/Hash", "Hash table implementation" ); static const unsigned int primes[] = { 11, 19, 37, 73, 109, 163, 251, 367, 557, 823, 1237, 1861, 2777, 4177, 6247, 9371, 14057, 21089, 31627, 47431, 71143, 106721, 160073, 240101, 360163, 540217, 810343, 1215497, 1823231, 2734867, 4102283, 6153409, 9230113, 13845163, }; static const unsigned int nprimes = D_ARRAY_SIZE( primes ); static DirectResult fusion_hash_create_internal(bool type,FusionSHMPoolShared *pool, FusionHashType key_type, FusionHashType value_type, int size, FusionHash **ret_hash ); static void fusion_hash_node_destroy (FusionHash *hash,FusionHashNode *node, void **old_key,void **old_value); static unsigned int spaced_primes_closest (unsigned int num) { int i; for (i = 0; i < nprimes; i++) if (primes[i] > num) return primes[i]; return primes[nprimes - 1]; } /** * fusion_hash_create_local: * @key_type: Type of hash key the hash is optimized for strings ints and pointers * @value_type: Type of hash data optimized for strings ints and pointers * @size: Inital size of the hash table * @ret_hash:the new hash table * Creates a new #FusionHash that uses local memory * * Return value: a new #FusionHash. **/ DirectResult fusion_hash_create_local (FusionHashType key_type, FusionHashType value_type, int size, FusionHash **ret_hash ) { return fusion_hash_create_internal(true,NULL,key_type,value_type, size,ret_hash ); } /** * fusion_hash_create: * @key_type: Type of hash key the hash is optimized for strings ints and pointers * @value_type: Type of hash data optimized for strings ints and pointers * @size: Inital size of the hash table * @ret_hash:the new hash table * Creates a new #FusionHash with a reference count of 1. * * Return value: a new #FusionHash. **/ DirectResult fusion_hash_create (FusionSHMPoolShared *pool, FusionHashType key_type, FusionHashType value_type, int size, FusionHash **ret_hash ) { return fusion_hash_create_internal(false,pool,key_type,value_type, size,ret_hash ); } static DirectResult fusion_hash_create_internal (bool local,FusionSHMPoolShared *pool, FusionHashType key_type, FusionHashType value_type, int size, FusionHash **ret_hash ) { FusionHash *hash; if (!ret_hash) return DR_BUG; if (!local && !pool) return DR_BUG; if (size < FUSION_HASH_MIN_SIZE) size = FUSION_HASH_MIN_SIZE; if (local) hash = D_CALLOC(1, sizeof (FusionHash) ); else hash = SHCALLOC(pool, 1, sizeof (FusionHash) ); if (!hash) return local ?DR_NOLOCALMEMORY:DR_NOSHAREDMEMORY; hash->local = local; hash->pool = pool; hash->key_type = key_type; hash->value_type = value_type; hash->size = size; hash->nnodes = 0; if (local) hash->nodes = D_CALLOC(size,sizeof (FusionHashNode*) ); else hash->nodes = SHCALLOC(pool, size, sizeof(FusionHashNode*) ); if (!hash->nodes) { if (local) D_FREE(hash ); else SHFREE(pool, hash ); return local?DR_NOLOCALMEMORY:DR_NOSHAREDMEMORY; } D_MAGIC_SET(hash, FusionHash ); *ret_hash = hash; return DR_OK; } void fusion_hash_destroy( FusionHash *hash ) { int i; FusionHashNode *node, *next; D_MAGIC_ASSERT( hash, FusionHash ); for (i = 0; i < hash->size; i++) { for (node = hash->nodes[i]; node; node = next) { next = node->next; fusion_hash_node_destroy(hash, node, NULL, NULL); } } if (hash->local) D_FREE(hash->nodes); else SHFREE( hash->pool, hash->nodes ); D_MAGIC_CLEAR( hash ); if (hash->local) D_FREE(hash); else SHFREE( hash->pool, hash ); } void fusion_hash_set_autofree( FusionHash *hash, bool free_keys, bool free_values ) { D_MAGIC_ASSERT( hash, FusionHash ); hash->free_keys = free_keys; hash->free_values = free_values; } /** * fusion_hash_lookup: * @hash: a #FusionHash. * @key: the key to look up. * * Looks up a key in a #FusionHash. Note that this function cannot * distinguish between a key that is not present and one which is present * and has the value %NULL. If you need this distinction, use * hash_lookup_extended(). * * Return value: the associated value, or %NULL if the key is not found. **/ void * fusion_hash_lookup (FusionHash *hash, const void * key) { FusionHashNode *node; D_MAGIC_ASSERT( hash, FusionHash ); node = *fusion_hash_lookup_node (hash, key); return node ? node->value : NULL; } /** * 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 DR_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 DR_BUG; } else { if (hash->local) (*node) = D_CALLOC(1,sizeof(FusionHashNode)); else (*node) = SHCALLOC(hash->pool, 1, sizeof(FusionHashNode)); if ( !(*node) ) return hash->local?DR_NOLOCALMEMORY:DR_NOSHAREDMEMORY; (*node)->key = key; (*node)->value = value; hash->nnodes++; if ( fusion_hash_should_resize(hash) ) fusion_hash_resize(hash); } return DR_OK; } /** * hash_replace: * @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 similar to * hash_insert(). The difference is that if the key already exists * in the #FusionHash, it gets replaced by the new key. * If you supplied a oldkey pointer or oldkey value they are returned * otherwise free is called the key if table type is not type HASH_INT * and free is called on the old value if not supplied **/ DirectResult fusion_hash_replace (FusionHash *hash, void * key, void * value, void **old_key, void **old_value) { FusionHashNode **node; D_MAGIC_ASSERT( hash, FusionHash ); node = fusion_hash_lookup_node (hash, key); if (*node) { if ( old_key) *old_key = (*node)->key; else if ( hash->key_type != HASH_INT ) { if (hash->free_keys) { if (hash->local) D_FREE((*node)->key); else SHFREE(hash->pool, (*node)->key ); } } if ( old_value) *old_value = (*node)->value; else if ( hash->value_type != HASH_INT ) { if (hash->free_values) { if (hash->local) D_FREE((*node)->value); else SHFREE(hash->pool, (*node)->value ); } } } else { if (hash->local) *node = D_CALLOC(1, sizeof(FusionHashNode)); else *node = SHCALLOC(hash->pool, 1, sizeof(FusionHashNode)); if ( !(*node) ) return hash->local?DR_NOLOCALMEMORY:DR_NOSHAREDMEMORY; hash->nnodes++; } (*node)->key = (void*)key; (*node)->value = (void*)value; return DR_OK; } /** * fusion_hash_remove: * @hash: a #FusionHash. * @key: the key to remove. * @old_key: returned old_key * @old_value: returned old_value * Removes a key and its associated value from a #FusionHash. * * If the #FusionHash was created using hash_new_full(), the * key and value are freed using the supplied destroy functions, otherwise * you have to make sure that any dynamically allocated values are freed * yourself. * If you supplied a oldkey pointer or oldkey value they are returned * otherwise free is called the key if table type is not type HASH_INT * and free is called on the old value if not supplied * **/ DirectResult fusion_hash_remove (FusionHash *hash, const void * key, void **old_key, void **old_value) { FusionHashNode **node, *dest; D_MAGIC_ASSERT( hash, FusionHash ); node = fusion_hash_lookup_node (hash, key); if (*node) { dest = *node; (*node) = dest->next; fusion_hash_node_destroy(hash, dest, old_key, old_value); hash->nnodes--; return DR_OK; } return DR_OK; } /** * hash_foreach: * @hash: a #FusionHash. * @func: the function to call for each key/value pair. * @user_data: user data to pass to the function. * * Calls the given function for each of the key/value pairs in the * #FusionHash. The function is passed the key and value of each * pair, and the given @user_data parameter. The hash table may not * be modified while iterating over it (you can't add/remove * items). To remove all items matching a predicate, use * hash_foreach_remove(). **/ void fusion_hash_iterate( FusionHash *hash, FusionHashIteratorFunc func, void *ctx ) { int i; FusionHashNode *node; FusionHashNode *next; D_MAGIC_ASSERT( hash, FusionHash ); for (i = 0; i < hash->size; i++) { for (node = hash->nodes[i]; node; node = next) { next = node->next; if ( func(hash, node->key, node->value, ctx)) return; } } } /** * hash_size: * @hash: a #FusionHash. * * Returns the number of elements contained in the #FusionHash. * * Return value: the number of key/value pairs in the #FusionHash. **/ unsigned int fusion_hash_size (FusionHash *hash) { D_MAGIC_ASSERT( hash, FusionHash ); return hash->nnodes; } /** * fusion_hash_should_resize: * Call the function after adding or removing several * values it has a decent heurisitc to determine if * the hash has grown to large */ bool fusion_hash_should_resize ( FusionHash *hash) { D_MAGIC_ASSERT( hash, FusionHash ); if ((hash->size >= 3 * hash->nnodes && hash->size > FUSION_HASH_MIN_SIZE) || (3 * hash->size <= hash->nnodes && hash->size < FUSION_HASH_MAX_SIZE)) return true; return false; } /* Hash Functions * Resize the hash to minumim for this number of entries */ DirectResult fusion_hash_resize (FusionHash *hash) { FusionHashNode **new_nodes; FusionHashNode *node; FusionHashNode *next; unsigned int hash_val; int new_size; int i; D_MAGIC_ASSERT( hash, FusionHash ); new_size = spaced_primes_closest (hash->nnodes); if (new_size > FUSION_HASH_MAX_SIZE ) new_size = FUSION_HASH_MAX_SIZE; if (new_size < FUSION_HASH_MIN_SIZE) new_size = FUSION_HASH_MIN_SIZE; if (hash->local) new_nodes = D_CALLOC (new_size, sizeof(FusionHashNode*)); else new_nodes = SHCALLOC (hash->pool, new_size, sizeof(FusionHashNode*)); if (!new_nodes) return hash->local?DR_NOLOCALMEMORY:DR_NOSHAREDMEMORY; for (i = 0; i < hash->size; i++) for (node = hash->nodes[i]; node; node = next) { next = node->next; /*TODO We could also optimize pointer hashing*/ if (hash->key_type == HASH_STRING ) { unsigned int h; const signed char *p = node->key; HASH_STR(h, p) hash_val = h % new_size; } else hash_val = ((unsigned long)node->key) % new_size; node->next = new_nodes[hash_val]; new_nodes[hash_val] = node; } if (hash->local) D_FREE(hash->nodes); else SHFREE(hash->pool, hash->nodes); hash->nodes = new_nodes; hash->size = new_size; return true; } static void fusion_hash_node_destroy (FusionHash *hash,FusionHashNode *node, void **old_key,void **old_value) { if (!node ) return; if ( old_key) *old_key = node->key; else if ( hash->key_type != HASH_INT ) { if (hash->free_keys) { if ( hash->local) D_FREE(node->key ); else SHFREE(hash->pool,node->key ); } } if ( old_value) *old_value = node->value; else if ( hash->value_type != HASH_INT ) { if (hash->free_values) { if ( hash->local) D_FREE(node->value ); else SHFREE(hash->pool,node->value ); } } if ( hash->local) D_FREE(node); else SHFREE(hash->pool,node); } DirectFB-1.2.10/lib/fusion/fusion.h0000644000175000017500000001017511245562152013672 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__FUSION_H__ #define __FUSION__FUSION_H__ #include #include typedef enum { FER_ANY, FER_MASTER, FER_SLAVE } FusionEnterRole; typedef enum { FFA_CLOSE, FFA_FORK } FusionForkAction; typedef enum { FFS_PREPARE, FFS_PARENT, FFS_CHILD } FusionForkState; typedef void (*FusionForkCallback) ( FusionForkAction action, FusionForkState state ); /* * Enters a fusion world by joining or creating it. * * If world_index is negative, the next free index is used to create a new world. * Otherwise the world with the specified index is joined or created. */ DirectResult fusion_enter( int world_index, int abi_version, FusionEnterRole role, FusionWorld **ret_world ); /* * Exits the fusion world. * * If 'emergency' is true the function won't join but kill the dispatcher thread. */ DirectResult fusion_exit( FusionWorld *world, bool emergency ); DirectResult fusion_stop_dispatcher( FusionWorld *world, bool emergency ); /* * Sets the fork() action of the calling Fusionee within the world. */ void fusion_world_set_fork_action( FusionWorld *world, FusionForkAction action ); /* * Gets the current fork() action. */ FusionForkAction fusion_world_get_fork_action( FusionWorld *world ); /* * Registers a callback called upon fork(). */ void fusion_world_set_fork_callback( FusionWorld *world, FusionForkCallback callback ); /* * Return the index of the specified world. */ int fusion_world_index( const FusionWorld *world ); /* * Return the own Fusion ID within the specified world. */ FusionID fusion_id( const FusionWorld *world ); /* * Return if the world is a multi application world. */ bool fusion_is_multi( const FusionWorld *world ); /* * Return the thread ID of the Fusion Dispatcher within the specified world. */ pid_t fusion_dispatcher_tid( const FusionWorld *world ); /* * Return true if this process is the master. */ bool fusion_master( const FusionWorld *world ); /* * Wait until all pending messages are processed. */ DirectResult fusion_sync( const FusionWorld *world ); /* * Sends a signal to one or more fusionees and optionally waits * for their processes to terminate. * * A fusion_id of zero means all fusionees but the calling one. * A timeout of zero means infinite waiting while a negative value * means no waiting at all. */ DirectResult fusion_kill( FusionWorld *world, FusionID fusion_id, int signal, int timeout_ms ); /* Check if a pointer points to the shared memory. */ bool fusion_is_shared( FusionWorld *world, const void *ptr ); #endif DirectFB-1.2.10/lib/fusion/build.h.in0000644000175000017500000000242511164361026014067 00000000000000/* (c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2002-2004 convergence GmbH. All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann and Ville Syrjl . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__BUILD_H__ #define __FUSION__BUILD_H__ #define FUSION_BUILD_MULTI (@FUSION_BUILD_MULTI@) #define FUSION_BUILD_KERNEL (@FUSION_BUILD_KERNEL@) #define FUSION_MESSAGE_SIZE (@FUSION_MESSAGE_SIZE@) #endif DirectFB-1.2.10/lib/fusion/reactor.c0000644000175000017500000014770611245562152014034 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" #if FUSION_BUILD_MULTI D_DEBUG_DOMAIN( Fusion_Reactor, "Fusion/Reactor", "Fusion's Reactor" ); struct __Fusion_FusionReactor { int magic; int id; /* reactor id */ int msg_size; /* size of each message */ bool direct; bool destroyed; DirectLink *globals; FusionSkirmish *globals_lock; FusionWorldShared *shared; #if !FUSION_BUILD_KERNEL DirectLink *listeners; /* list of attached listeners */ FusionSkirmish listeners_lock; FusionCall *call; #endif }; typedef struct { DirectLink link; int magic; pthread_rwlock_t lock; int reactor_id; FusionReactor *reactor; DirectLink *links; /* reactor listeners attached to node */ } ReactorNode; typedef struct { DirectLink link; int magic; Reaction *reaction; int channel; } NodeLink; /**************************************************************************************************/ static ReactorNode *lock_node ( int reactor_id, bool add_it, bool wlock, FusionReactor *reactor, /* one of reactor and world must not be NULL */ FusionWorld *world ); static void unlock_node ( ReactorNode *node ); static void process_globals( FusionReactor *reactor, const void *msg_data, const ReactionFunc *globals ); /**************************************************************************************************/ #if FUSION_BUILD_KERNEL FusionReactor * fusion_reactor_new( int msg_size, const char *name, const FusionWorld *world ) { FusionEntryInfo info; FusionReactor *reactor; FusionWorldShared *shared; D_ASSERT( msg_size > 0 ); D_ASSERT( name != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_new( '%s', size %d )\n", name ? : "", msg_size ); /* allocate shared reactor data */ reactor = SHCALLOC( shared->main_pool, 1, sizeof (FusionReactor) ); if (!reactor) { D_OOSHM(); return NULL; } /* create a new reactor */ while (ioctl( world->fusion_fd, FUSION_REACTOR_NEW, &reactor->id )) { if (errno == EINTR) continue; D_PERROR( "FUSION_REACTOR_NEW" ); SHFREE( shared->main_pool, reactor ); return NULL; } /* set the static message size, should we make dynamic? (TODO?) */ reactor->msg_size = msg_size; /* Set default lock for global reactions. */ reactor->globals_lock = &shared->reactor_globals; D_DEBUG_AT( Fusion_Reactor, " -> new reactor %p [%d] with lock %p [%d]\n", reactor, reactor->id, reactor->globals_lock, reactor->globals_lock->multi.id ); reactor->shared = shared; reactor->direct = true; D_MAGIC_SET( reactor, FusionReactor ); info.type = FT_REACTOR; info.id = reactor->id; direct_snputs( info.name, name, sizeof(info.name) ); ioctl( world->fusion_fd, FUSION_ENTRY_SET_INFO, &info ); return reactor; } DirectResult fusion_reactor_destroy( FusionReactor *reactor ) { FusionWorldShared *shared; D_MAGIC_ASSERT( reactor, FusionReactor ); shared = reactor->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_destroy( %p [%d] )\n", reactor, reactor->id ); D_ASSUME( !reactor->destroyed ); if (reactor->destroyed) return DR_DESTROYED; while (ioctl( _fusion_fd( shared ), FUSION_REACTOR_DESTROY, &reactor->id )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor\n" ); return DR_DESTROYED; } D_PERROR( "FUSION_REACTOR_DESTROY" ); return DR_FUSION; } reactor->destroyed = true; return DR_OK; } DirectResult fusion_reactor_free( FusionReactor *reactor ) { FusionWorldShared *shared; D_MAGIC_ASSERT( reactor, FusionReactor ); shared = reactor->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_free( %p [%d] )\n", reactor, reactor->id ); D_MAGIC_CLEAR( reactor ); // D_ASSUME( reactor->destroyed ); if (!reactor->destroyed) while (ioctl( _fusion_fd( shared ), FUSION_REACTOR_DESTROY, &reactor->id ) && errno == EINTR); /* free shared reactor data */ SHFREE( shared->main_pool, reactor ); return DR_OK; } DirectResult fusion_reactor_attach_channel( FusionReactor *reactor, int channel, ReactionFunc func, void *ctx, Reaction *reaction ) { ReactorNode *node; NodeLink *link; FusionReactorAttach attach; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( func != NULL ); D_ASSERT( reaction != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_attach( %p [%d], func %p, ctx %p, reaction %p )\n", reactor, reactor->id, func, ctx, reaction ); link = D_CALLOC( 1, sizeof(NodeLink) ); if (!link) return D_OOM(); node = lock_node( reactor->id, true, true, reactor, NULL ); if (!node) { D_FREE( link ); return DR_FUSION; } attach.reactor_id = reactor->id; attach.channel = channel; while (ioctl( _fusion_fd( reactor->shared ), FUSION_REACTOR_ATTACH, &attach )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor\n" ); unlock_node( node ); D_FREE( link ); return DR_DESTROYED; } D_PERROR( "FUSION_REACTOR_ATTACH" ); unlock_node( node ); D_FREE( link ); return DR_FUSION; } /* fill out callback information */ reaction->func = func; reaction->ctx = ctx; reaction->node_link = link; link->reaction = reaction; link->channel = channel; D_MAGIC_SET( link, NodeLink ); /* prepend the reaction to the local reaction list */ direct_list_prepend( &node->links, &link->link ); unlock_node( node ); return DR_OK; } static void remove_node_link( ReactorNode *node, NodeLink *link ) { D_MAGIC_ASSERT( node, ReactorNode ); D_MAGIC_ASSERT( link, NodeLink ); D_ASSUME( link->reaction == NULL ); direct_list_remove( &node->links, &link->link ); D_MAGIC_CLEAR( link ); D_FREE( link ); } DirectResult fusion_reactor_detach( FusionReactor *reactor, Reaction *reaction ) { ReactorNode *node; NodeLink *link; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( reaction != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_detach( %p [%d], reaction %p ) <- func %p, ctx %p\n", reactor, reactor->id, reaction, reaction->func, reaction->ctx ); node = lock_node( reactor->id, false, true, reactor, NULL ); if (!node) { D_BUG( "node not found" ); return DR_BUG; } link = reaction->node_link; D_ASSUME( link != NULL ); if (link) { FusionReactorDetach detach; D_ASSERT( link->reaction == reaction ); detach.reactor_id = reactor->id; detach.channel = link->channel; reaction->node_link = NULL; link->reaction = NULL; remove_node_link( node, link ); while (ioctl( _fusion_fd( reactor->shared ), FUSION_REACTOR_DETACH, &detach )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor\n" ); unlock_node( node ); return DR_DESTROYED; } D_PERROR( "FUSION_REACTOR_DETACH" ); unlock_node( node ); return DR_FUSION; } } unlock_node( node ); return DR_OK; } DirectResult fusion_reactor_dispatch_channel( FusionReactor *reactor, int channel, const void *msg_data, int msg_size, bool self, const ReactionFunc *globals ) { FusionReactorDispatch dispatch; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( msg_data != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_dispatch( %p [%d], msg_data %p, self %s, globals %p)\n", reactor, reactor->id, msg_data, self ? "true" : "false", globals ); /* Handle global reactions first. */ if (reactor->globals) { if (globals) process_globals( reactor, msg_data, globals ); else D_ERROR( "Fusion/Reactor: global reactions exist but no " "globals have been passed to dispatch()\n" ); } /* Handle local reactions. */ if (self && reactor->direct) { _fusion_reactor_process_message( _fusion_world(reactor->shared), reactor->id, channel, msg_data ); self = false; } /* Initialize dispatch data. */ dispatch.reactor_id = reactor->id; dispatch.channel = channel; dispatch.self = self; dispatch.msg_size = msg_size; dispatch.msg_data = msg_data; /* Dispatch the message to handle foreign reactions. */ while (ioctl( _fusion_fd( reactor->shared ), FUSION_REACTOR_DISPATCH, &dispatch )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor\n" ); return DR_DESTROYED; } D_PERROR( "FUSION_REACTOR_DISPATCH" ); return DR_FUSION; } return DR_OK; } DirectResult fusion_reactor_set_dispatch_callback( FusionReactor *reactor, FusionCall *call, void *call_ptr ) { FusionReactorSetCallback callback; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( call != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_set_dispatch_callback( %p [%d], call %p [%d], ptr %p)\n", reactor, reactor->id, call, call->call_id, call_ptr ); /* Fill callback info. */ callback.reactor_id = reactor->id; callback.call_id = call->call_id; callback.call_ptr = call_ptr; /* Set the dispatch callback. */ while (ioctl( _fusion_fd( reactor->shared ), FUSION_REACTOR_SET_DISPATCH_CALLBACK, &callback )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor\n" ); return DR_DESTROYED; } D_PERROR( "FUSION_REACTOR_SET_DISPATCH_CALLBACK" ); return DR_FUSION; } return DR_OK; } DirectResult fusion_reactor_set_name( FusionReactor *reactor, const char *name ) { FusionEntryInfo info; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( name != NULL ); D_DEBUG_AT( Fusion_Reactor, "%s( %p, '%s' )\n", __FUNCTION__, reactor, name ); /* Initialize reactor info. */ info.type = FT_REACTOR; info.id = reactor->id; /* Put reactor name into info. */ direct_snputs( info.name, name, sizeof(info.name) ); /* Set the reactor info. */ while (ioctl( _fusion_fd( reactor->shared ), FUSION_ENTRY_SET_INFO, &info )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor\n" ); return DR_IDNOTFOUND; } D_PERROR( "FUSION_ENTRY_SET_INFO( reactor 0x%08x, '%s' )\n", reactor->id, name ); return DR_FUSION; } return DR_OK; } void _fusion_reactor_process_message( FusionWorld *world, int reactor_id, int channel, const void *msg_data ) { ReactorNode *node; NodeLink *link; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( msg_data != NULL ); D_DEBUG_AT( Fusion_Reactor, " _fusion_reactor_process_message( [%d], msg_data %p )\n", reactor_id, msg_data ); /* Find the local counter part of the reactor. */ node = lock_node( reactor_id, false, false, NULL, world ); if (!node) return; D_DEBUG_AT( Fusion_Reactor, " -> node %p, reactor %p\n", node, node->reactor ); D_ASSUME( node->links != NULL ); if (!node->links) { D_DEBUG_AT( Fusion_Reactor, " -> no local reactions!?!\n" ); unlock_node( node ); return; } direct_list_foreach (link, node->links) { Reaction *reaction; D_MAGIC_ASSERT( link, NodeLink ); if (link->channel != channel) continue; reaction = link->reaction; if (!reaction) continue; if (reaction->func( msg_data, reaction->ctx ) == RS_REMOVE) { FusionReactorDetach detach; detach.reactor_id = reactor_id; detach.channel = channel; D_DEBUG_AT( Fusion_Reactor, " -> removing %p, func %p, ctx %p\n", reaction, reaction->func, reaction->ctx ); link->reaction = NULL; /* We can't remove the link as we only have read lock, to avoid dead locks. */ while (ioctl( world->fusion_fd, FUSION_REACTOR_DETACH, &detach )) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR( "Fusion/Reactor: invalid reactor (DETACH)\n" ); break; default: D_PERROR( "FUSION_REACTOR_DETACH" ); break; } break; } } } unlock_node( node ); } #else /* FUSION_BUILD_KERNEL */ typedef struct { DirectLink link; unsigned int refs; FusionID fusion_id; int channel; } __Listener; FusionReactor * fusion_reactor_new( int msg_size, const char *name, const FusionWorld *world ) { FusionReactor *reactor; FusionWorldShared *shared; D_ASSERT( msg_size > 0 ); D_ASSERT( name != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_new( '%s', size %d )\n", name ? : "", msg_size ); /* allocate shared reactor data */ reactor = SHCALLOC( shared->main_pool, 1, sizeof (FusionReactor) ); if (!reactor) { D_OOSHM(); return NULL; } /* Generate the reactor id */ reactor->id = ++shared->reactor_ids; /* Set the static message size, should we make dynamic? (TODO?) */ reactor->msg_size = msg_size; /* Set default lock for global reactions. */ reactor->globals_lock = &shared->reactor_globals; fusion_skirmish_init( &reactor->listeners_lock, "Reactor Listeners", world ); D_DEBUG_AT( Fusion_Reactor, " -> new reactor %p [%d] with lock %p [%d]\n", reactor, reactor->id, reactor->globals_lock, reactor->globals_lock->multi.id ); reactor->shared = shared; reactor->direct = true; D_MAGIC_SET( reactor, FusionReactor ); return reactor; } DirectResult fusion_reactor_destroy( FusionReactor *reactor ) { FusionWorldShared *shared; D_MAGIC_ASSERT( reactor, FusionReactor ); shared = reactor->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_destroy( %p [%d] )\n", reactor, reactor->id ); D_ASSUME( !reactor->destroyed ); if (reactor->destroyed) return DR_DESTROYED; fusion_skirmish_destroy( &reactor->listeners_lock ); reactor->destroyed = true; return DR_OK; } DirectResult fusion_reactor_free( FusionReactor *reactor ) { FusionWorldShared *shared; __Listener *listener, *temp; D_MAGIC_ASSERT( reactor, FusionReactor ); shared = reactor->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_free( %p [%d] )\n", reactor, reactor->id ); D_MAGIC_CLEAR( reactor ); // D_ASSUME( reactor->destroyed ); direct_list_foreach_safe (listener, temp, reactor->listeners) { direct_list_remove( &reactor->listeners, &listener->link ); SHFREE( shared->main_pool, listener ); } /* free shared reactor data */ SHFREE( shared->main_pool, reactor ); return DR_OK; } DirectResult fusion_reactor_attach_channel( FusionReactor *reactor, int channel, ReactionFunc func, void *ctx, Reaction *reaction ) { FusionWorldShared *shared; ReactorNode *node; NodeLink *link; FusionID fusion_id; __Listener *listener; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( func != NULL ); D_ASSERT( reaction != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_attach( %p [%d], func %p, ctx %p, reaction %p )\n", reactor, reactor->id, func, ctx, reaction ); if (reactor->destroyed) return DR_DESTROYED; shared = reactor->shared; link = D_CALLOC( 1, sizeof(NodeLink) ); if (!link) return D_OOM(); node = lock_node( reactor->id, true, true, reactor, NULL ); if (!node) { D_FREE( link ); return DR_FUSION; } fusion_id = _fusion_id( shared ); fusion_skirmish_prevail( &reactor->listeners_lock ); direct_list_foreach (listener, reactor->listeners) { if (listener->fusion_id == fusion_id && listener->channel == channel) { listener->refs++; break; } } if (!listener) { listener = SHCALLOC( shared->main_pool, 1, sizeof(__Listener) ); if (!listener) { D_OOSHM(); fusion_skirmish_dismiss( &reactor->listeners_lock ); unlock_node( node ); D_FREE( link ); return DR_NOSHAREDMEMORY; } listener->refs = 1; listener->fusion_id = fusion_id; listener->channel = channel; direct_list_append( &reactor->listeners, &listener->link ); } fusion_skirmish_dismiss( &reactor->listeners_lock ); /* fill out callback information */ reaction->func = func; reaction->ctx = ctx; reaction->node_link = link; link->reaction = reaction; link->channel = channel; D_MAGIC_SET( link, NodeLink ); /* prepend the reaction to the local reaction list */ direct_list_prepend( &node->links, &link->link ); unlock_node( node ); return DR_OK; } static void remove_node_link( ReactorNode *node, NodeLink *link ) { D_MAGIC_ASSERT( node, ReactorNode ); D_MAGIC_ASSERT( link, NodeLink ); D_ASSUME( link->reaction == NULL ); direct_list_remove( &node->links, &link->link ); D_MAGIC_CLEAR( link ); D_FREE( link ); } DirectResult fusion_reactor_detach( FusionReactor *reactor, Reaction *reaction ) { FusionWorldShared *shared; ReactorNode *node; NodeLink *link; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( reaction != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_detach( %p [%d], reaction %p ) <- func %p, ctx %p\n", reactor, reactor->id, reaction, reaction->func, reaction->ctx ); if (reactor->destroyed) return DR_DESTROYED; shared = reactor->shared; node = lock_node( reactor->id, false, true, reactor, NULL ); if (!node) { D_BUG( "node not found" ); return DR_BUG; } link = reaction->node_link; D_ASSUME( link != NULL ); if (link) { __Listener *listener; FusionID fusion_id = _fusion_id( shared ); D_ASSERT( link->reaction == reaction ); reaction->node_link = NULL; link->reaction = NULL; remove_node_link( node, link ); fusion_skirmish_prevail( &reactor->listeners_lock ); direct_list_foreach (listener, reactor->listeners) { if (listener->fusion_id == fusion_id && listener->channel == link->channel) { if (--listener->refs == 0) { direct_list_remove( &reactor->listeners, &listener->link ); SHFREE( shared->main_pool, listener ); } break; } } fusion_skirmish_dismiss( &reactor->listeners_lock ); if (!listener) D_ERROR( "Fusion/Reactor: Couldn't detach listener!\n" ); } unlock_node( node ); return DR_OK; } DirectResult fusion_reactor_dispatch_channel( FusionReactor *reactor, int channel, const void *msg_data, int msg_size, bool self, const ReactionFunc *globals ) { FusionWorld *world; __Listener *listener, *temp; FusionRef *ref = NULL; FusionReactorMessage *msg; struct sockaddr_un addr; int len; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( msg_data != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_dispatch( %p [%d], msg_data %p, self %s, globals %p)\n", reactor, reactor->id, msg_data, self ? "true" : "false", globals ); if (reactor->destroyed) return DR_DESTROYED; if (msg_size > FUSION_MESSAGE_SIZE-sizeof(FusionReactorMessage)) { D_ERROR( "Fusion/Reactor: Message too large (%d)!\n", msg_size ); return DR_UNSUPPORTED; } world = _fusion_world( reactor->shared ); if (reactor->call) { ref = SHMALLOC( world->shared->main_pool, sizeof(FusionRef) ); if (!ref) return D_OOSHM(); fusion_ref_init( ref, "Dispatch Ref", world ); fusion_ref_up( ref, true ); fusion_ref_watch( ref, reactor->call, 0 ); } /* Handle global reactions first. */ if (reactor->globals) { if (globals) process_globals( reactor, msg_data, globals ); else D_ERROR( "Fusion/Reactor: global reactions exist but no " "globals have been passed to dispatch()\n" ); } /* Handle local reactions. */ if (self && reactor->direct) { _fusion_reactor_process_message( _fusion_world(reactor->shared), reactor->id, channel, msg_data ); self = false; } msg = alloca( sizeof(FusionReactorMessage) + msg_size ); msg->type = FMT_REACTOR; msg->id = reactor->id; msg->channel = channel; msg->ref = ref; memcpy( (void*)msg + sizeof(FusionReactorMessage), msg_data, msg_size ); addr.sun_family = AF_UNIX; len = snprintf( addr.sun_path, sizeof(addr.sun_path), "/tmp/.fusion-%d/", fusion_world_index( world ) ); fusion_skirmish_prevail( &reactor->listeners_lock ); direct_list_foreach_safe (listener, temp, reactor->listeners) { if (listener->channel == channel) { DirectResult ret; if (!self && listener->fusion_id == world->fusion_id) continue; if (ref) fusion_ref_up( ref, true ); snprintf( addr.sun_path+len, sizeof(addr.sun_path)-len, "%lx", listener->fusion_id ); D_DEBUG_AT( Fusion_Reactor, " -> sending to '%s'\n", addr.sun_path ); ret = _fusion_send_message( world->fusion_fd, msg, sizeof(FusionReactorMessage)+msg_size, &addr ); if (ret == DR_FUSION) { D_DEBUG_AT( Fusion_Reactor, " -> removing dead listener %lu\n", listener->fusion_id ); if (ref) fusion_ref_down( ref, true ); direct_list_remove( &reactor->listeners, &listener->link ); SHFREE( reactor->shared->main_pool, listener ); } } } fusion_skirmish_dismiss( &reactor->listeners_lock ); if (ref) { fusion_ref_down( ref, true ); if (fusion_ref_zero_trylock( ref ) == DR_OK) { fusion_ref_destroy( ref ); SHFREE( world->shared->main_pool, ref ); } } D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_dispatch( %p ) done.\n", reactor ); return DR_OK; } DirectResult fusion_reactor_set_dispatch_callback( FusionReactor *reactor, FusionCall *call, void *call_ptr ) { D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( call != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_set_dispatch_callback( %p [%d], call %p [%d], ptr %p)\n", reactor, reactor->id, call, call->call_id, call_ptr ); if (reactor->destroyed) return DR_DESTROYED; if (call_ptr) return DR_UNIMPLEMENTED; reactor->call = call; return DR_OK; } DirectResult fusion_reactor_set_name( FusionReactor *reactor, const char *name ) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } void _fusion_reactor_process_message( FusionWorld *world, int reactor_id, int channel, const void *msg_data ) { ReactorNode *node; NodeLink *link; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( msg_data != NULL ); D_DEBUG_AT( Fusion_Reactor, " _fusion_reactor_process_message( [%d], msg_data %p )\n", reactor_id, msg_data ); /* Find the local counter part of the reactor. */ node = lock_node( reactor_id, false, false, NULL, world ); if (!node) return; D_DEBUG_AT( Fusion_Reactor, " -> node %p, reactor %p\n", node, node->reactor ); D_ASSUME( node->links != NULL ); if (!node->links) { D_DEBUG_AT( Fusion_Reactor, " -> no local reactions!?!\n" ); unlock_node( node ); return; } direct_list_foreach (link, node->links) { Reaction *reaction; D_MAGIC_ASSERT( link, NodeLink ); if (link->channel != channel) continue; reaction = link->reaction; if (!reaction) continue; if (reaction->func( msg_data, reaction->ctx ) == RS_REMOVE) { FusionReactor *reactor = node->reactor; __Listener *listener; D_DEBUG_AT( Fusion_Reactor, " -> removing %p, func %p, ctx %p\n", reaction, reaction->func, reaction->ctx ); fusion_skirmish_prevail( &reactor->listeners_lock ); direct_list_foreach (listener, reactor->listeners) { if (listener->fusion_id == world->fusion_id && listener->channel == channel) { if (--listener->refs == 0) { direct_list_remove( &reactor->listeners, &listener->link ); SHFREE( world->shared->main_pool, listener ); } break; } } fusion_skirmish_dismiss( &reactor->listeners_lock ); } } unlock_node( node ); } #endif /* FUSION_BUILD_KERNEL */ DirectResult fusion_reactor_set_lock( FusionReactor *reactor, FusionSkirmish *lock ) { DirectResult ret; FusionSkirmish *old; D_MAGIC_ASSERT( reactor, FusionReactor ); old = reactor->globals_lock; D_ASSERT( lock != NULL ); D_ASSERT( old != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_set_lock( %p [%d], lock %p [%d] ) <- old %p [%d]\n", reactor, reactor->id, lock, lock->multi.id, old, old->multi.id ); /* * Acquire the old lock to make sure that changing the lock doesn't * result in mismatching lock/unlock pairs in other functions. */ ret = fusion_skirmish_prevail( old ); if (ret) return ret; D_ASSUME( reactor->globals_lock != lock ); /* Set the lock replacement. */ reactor->globals_lock = lock; /* Release the old lock which is obsolete now. */ fusion_skirmish_dismiss( old ); return DR_OK; } DirectResult fusion_reactor_set_lock_only( FusionReactor *reactor, FusionSkirmish *lock ) { D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( lock != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_set_lock_only( %p [%d], lock %p [%d] ) <- old %p [%d]\n", reactor, reactor->id, lock, lock->multi.id, reactor->globals_lock, reactor->globals_lock->multi.id ); D_ASSUME( reactor->globals_lock != lock ); /* Set the lock replacement. */ reactor->globals_lock = lock; return DR_OK; } DirectResult fusion_reactor_attach (FusionReactor *reactor, ReactionFunc func, void *ctx, Reaction *reaction) { D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( func != NULL ); D_ASSERT( reaction != NULL ); return fusion_reactor_attach_channel( reactor, 0, func, ctx, reaction ); } DirectResult fusion_reactor_attach_global( FusionReactor *reactor, int index, void *ctx, GlobalReaction *reaction ) { DirectResult ret; FusionSkirmish *lock; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( index >= 0 ); D_ASSERT( reaction != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_attach_global( %p [%d], index %d, ctx %p, reaction %p )\n", reactor, reactor->id, index, ctx, reaction ); /* Initialize reaction data. */ reaction->index = index; reaction->ctx = ctx; reaction->attached = true; /* Remember for safety. */ lock = reactor->globals_lock; D_ASSERT( lock != NULL ); /* Lock the list of global reactions. */ ret = fusion_skirmish_prevail( lock ); if (ret) return ret; /* FIXME: Might have changed while waiting for the lock. */ if (lock != reactor->globals_lock) D_WARN( "using old lock once more" ); /* Prepend the reaction to the list. */ direct_list_prepend( &reactor->globals, &reaction->link ); /* Unlock the list of global reactions. */ fusion_skirmish_dismiss( lock ); return DR_OK; } DirectResult fusion_reactor_detach_global( FusionReactor *reactor, GlobalReaction *reaction ) { DirectResult ret; FusionSkirmish *lock; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( reaction != NULL ); D_DEBUG_AT( Fusion_Reactor, "fusion_reactor_detach_global( %p [%d], reaction %p ) <- index %d, ctx %p\n", reactor, reactor->id, reaction, reaction->index, reaction->ctx ); /* Remember for safety. */ lock = reactor->globals_lock; D_ASSERT( lock != NULL ); /* Lock the list of global reactions. */ ret = fusion_skirmish_prevail( lock ); if (ret) return ret; /* FIXME: Might have changed while waiting for the lock. */ if (lock != reactor->globals_lock) D_WARN( "using old lock once more" ); D_ASSUME( reaction->attached ); /* Check against multiple detach. */ if (reaction->attached) { /* Mark as detached. */ reaction->attached = false; /* Remove the reaction from the list. */ direct_list_remove( &reactor->globals, &reaction->link ); } /* Unlock the list of global reactions. */ fusion_skirmish_dismiss( lock ); return DR_OK; } DirectResult fusion_reactor_dispatch( FusionReactor *reactor, const void *msg_data, bool self, const ReactionFunc *globals ) { D_MAGIC_ASSERT( reactor, FusionReactor ); return fusion_reactor_dispatch_channel( reactor, 0, msg_data, reactor->msg_size, self, globals ); } DirectResult fusion_reactor_sized_dispatch( FusionReactor *reactor, const void *msg_data, int msg_size, bool self, const ReactionFunc *globals ) { D_MAGIC_ASSERT( reactor, FusionReactor ); return fusion_reactor_dispatch_channel( reactor, 0, msg_data, msg_size, self, globals ); } DirectResult fusion_reactor_direct( FusionReactor *reactor, bool direct ) { D_MAGIC_ASSERT( reactor, FusionReactor ); reactor->direct = direct; return DR_OK; } void _fusion_reactor_free_all( FusionWorld *world ) { ReactorNode *node, *node_temp; D_MAGIC_ASSERT( world, FusionWorld ); D_DEBUG_AT( Fusion_Reactor, "_fusion_reactor_free_all() <- nodes %p\n", world->reactor_nodes ); pthread_mutex_lock( &world->reactor_nodes_lock ); direct_list_foreach_safe (node, node_temp, world->reactor_nodes) { NodeLink *link, *link_temp; D_MAGIC_ASSERT( node, ReactorNode ); pthread_rwlock_wrlock( &node->lock ); direct_list_foreach_safe (link, link_temp, node->links) { D_MAGIC_ASSERT( link, NodeLink ); D_MAGIC_CLEAR( link ); D_FREE( link ); } pthread_rwlock_unlock( &node->lock ); pthread_rwlock_destroy( &node->lock ); D_MAGIC_CLEAR( node ); D_FREE( node ); } world->reactor_nodes = NULL; pthread_mutex_unlock( &world->reactor_nodes_lock ); } static void process_globals( FusionReactor *reactor, const void *msg_data, const ReactionFunc *globals ) { DirectLink *n; GlobalReaction *global; FusionSkirmish *lock; int max_index = -1; D_MAGIC_ASSERT( reactor, FusionReactor ); D_ASSERT( msg_data != NULL ); D_ASSERT( globals != NULL ); /* D_DEBUG_AT( Fusion_Reactor, " process_globals( %p [%d], msg_data %p, globals %p )\n", reactor, reactor->id, msg_data, globals );*/ /* Find maximum reaction index. */ while (globals[max_index+1]) max_index++; if (max_index < 0) return; /* Remember for safety. */ lock = reactor->globals_lock; D_ASSERT( lock != NULL ); /* Lock the list of global reactions. */ if (fusion_skirmish_prevail( lock )) return; /* FIXME: Might have changed while waiting for the lock. */ if (lock != reactor->globals_lock) D_WARN( "using old lock once more" ); /* Loop through all global reactions. */ direct_list_foreach_safe (global, n, reactor->globals) { int index = global->index; /* Check if the index is valid. */ if (index < 0 || index > max_index) { D_WARN( "index out of bounds (%d/%d)", global->index, max_index ); continue; } /* Call reaction and remove it if requested. */ if (globals[global->index]( msg_data, global->ctx ) == RS_REMOVE) { /*D_DEBUG_AT( Fusion_Reactor, " -> removing %p, index %d, ctx %p\n", global, global->index, global->ctx );*/ direct_list_remove( &reactor->globals, &global->link ); } } /* Unlock the list of global reactions. */ fusion_skirmish_dismiss( lock ); } /***************************** * File internal functions * *****************************/ static ReactorNode * lock_node( int reactor_id, bool add_it, bool wlock, FusionReactor *reactor, FusionWorld *world ) { DirectLink *n; ReactorNode *node; FusionWorldShared *shared; D_DEBUG_AT( Fusion_Reactor, " lock_node( [%d], add %s, reactor %p )\n", reactor_id, add_it ? "true" : "false", reactor ); D_ASSERT( reactor != NULL || (!add_it && world != NULL) ); if (reactor) { D_MAGIC_ASSERT( reactor, FusionReactor ); shared = reactor->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); world = _fusion_world( shared ); D_MAGIC_ASSERT( world, FusionWorld ); } else { D_MAGIC_ASSERT( world, FusionWorld ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); } pthread_mutex_lock( &world->reactor_nodes_lock ); direct_list_foreach_safe (node, n, world->reactor_nodes) { D_MAGIC_ASSERT( node, ReactorNode ); if (node->reactor_id == reactor_id) { if (wlock) { DirectLink *n; NodeLink *link; pthread_rwlock_wrlock( &node->lock ); /* FIXME: don't cleanup asynchronously */ direct_list_foreach_safe (link, n, node->links) { D_MAGIC_ASSERT( link, NodeLink ); if (!link->reaction) { D_DEBUG_AT( Fusion_Reactor, " -> cleaning up %p\n", link ); remove_node_link( node, link ); } else D_ASSERT( link->reaction->node_link == link ); } } else pthread_rwlock_rdlock( &node->lock ); /* FIXME: Don't cleanup asynchronously. */ if (!node->links && !add_it) { // D_DEBUG_AT( Fusion_Reactor, " -> cleaning up mine %p\n", node ); direct_list_remove( &world->reactor_nodes, &node->link ); pthread_rwlock_unlock( &node->lock ); pthread_rwlock_destroy( &node->lock ); D_MAGIC_CLEAR( node ); D_FREE( node ); node = NULL; } else { /* D_DEBUG_AT( Fusion_Reactor, " -> found %p (%d reactions)\n", node, direct_list_count_elements_EXPENSIVE( node->reactions ) );*/ D_ASSERT( node->reactor == reactor || reactor == NULL ); direct_list_move_to_front( &world->reactor_nodes, &node->link ); } pthread_mutex_unlock( &world->reactor_nodes_lock ); return node; } /* FIXME: Don't cleanup asynchronously. */ if (!pthread_rwlock_trywrlock( &node->lock )) { if (!node->links) { // D_DEBUG_AT( Fusion_Reactor, " -> cleaning up other %p\n", node ); direct_list_remove( &world->reactor_nodes, &node->link ); pthread_rwlock_unlock( &node->lock ); pthread_rwlock_destroy( &node->lock ); D_MAGIC_CLEAR( node ); D_FREE( node ); } else { /*D_DEBUG_AT( Fusion_Reactor, " -> keeping other %p (%d reactions)\n", node, direct_list_count_elements_EXPENSIVE( node->reactions ) );*/ pthread_rwlock_unlock( &node->lock ); } } } // D_DEBUG_AT( Fusion_Reactor, " -> not found%s adding\n", add_it ? ", but" : " and not" ); if (add_it) { D_MAGIC_ASSERT( reactor, FusionReactor ); node = D_CALLOC( 1, sizeof(ReactorNode) ); if (!node) { D_OOM(); return NULL; } //direct_util_recursive_pthread_mutex_init( &node->lock ); pthread_rwlock_init( &node->lock, NULL ); if (wlock) pthread_rwlock_wrlock( &node->lock ); else pthread_rwlock_rdlock( &node->lock ); node->reactor_id = reactor_id; node->reactor = reactor; D_MAGIC_SET( node, ReactorNode ); direct_list_prepend( &world->reactor_nodes, &node->link ); pthread_mutex_unlock( &world->reactor_nodes_lock ); return node; } pthread_mutex_unlock( &world->reactor_nodes_lock ); return NULL; } static void unlock_node( ReactorNode *node ) { D_ASSERT( node != NULL ); // D_MAGIC_ASSERT( node->reactor, FusionReactor ); /* D_DEBUG_AT( Fusion_Reactor, " unlock_node( %p, reactor %p [%d] )\n", node, node->reactor, node->reactor->id );*/ pthread_rwlock_unlock( &node->lock ); } #else /* FUSION_BUILD_MULTI */ /*************************** * Internal declarations * ***************************/ /* * */ struct __Fusion_FusionReactor { DirectLink *reactions; /* reactor listeners attached to node */ pthread_mutex_t reactions_lock; DirectLink *globals; /* global reactions attached to node */ pthread_mutex_t globals_lock; bool destroyed; }; static void process_globals( FusionReactor *reactor, const void *msg_data, const ReactionFunc *globals ); /**************** * Public API * ****************/ FusionReactor * fusion_reactor_new( int msg_size, const char *name, const FusionWorld *world ) { FusionReactor *reactor; D_ASSERT( msg_size > 0 ); reactor = D_CALLOC( 1, sizeof(FusionReactor) ); if (!reactor) return NULL; direct_util_recursive_pthread_mutex_init( &reactor->reactions_lock ); direct_util_recursive_pthread_mutex_init( &reactor->globals_lock ); return reactor; } DirectResult fusion_reactor_set_lock( FusionReactor *reactor, FusionSkirmish *lock ) { D_ASSERT( reactor != NULL ); D_ASSERT( lock != NULL ); // D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } DirectResult fusion_reactor_set_lock_only( FusionReactor *reactor, FusionSkirmish *lock ) { D_ASSERT( reactor != NULL ); D_ASSERT( lock != NULL ); return DR_UNIMPLEMENTED; } DirectResult fusion_reactor_attach (FusionReactor *reactor, ReactionFunc func, void *ctx, Reaction *reaction) { D_ASSERT( reactor != NULL ); D_ASSERT( func != NULL ); D_ASSERT( reaction != NULL ); reaction->func = func; reaction->ctx = ctx; pthread_mutex_lock( &reactor->reactions_lock ); direct_list_prepend( &reactor->reactions, &reaction->link ); pthread_mutex_unlock( &reactor->reactions_lock ); return DR_OK; } DirectResult fusion_reactor_detach (FusionReactor *reactor, Reaction *reaction) { D_ASSERT( reactor != NULL ); D_ASSERT( reaction != NULL ); pthread_mutex_lock( &reactor->reactions_lock ); direct_list_remove( &reactor->reactions, &reaction->link ); pthread_mutex_unlock( &reactor->reactions_lock ); return DR_OK; } DirectResult fusion_reactor_attach_global (FusionReactor *reactor, int index, void *ctx, GlobalReaction *reaction) { D_ASSERT( reactor != NULL ); D_ASSERT( index >= 0 ); D_ASSERT( reaction != NULL ); reaction->index = index; reaction->ctx = ctx; pthread_mutex_lock( &reactor->globals_lock ); direct_list_prepend( &reactor->globals, &reaction->link ); pthread_mutex_unlock( &reactor->globals_lock ); return DR_OK; } DirectResult fusion_reactor_detach_global (FusionReactor *reactor, GlobalReaction *reaction) { D_ASSERT( reactor != NULL ); D_ASSERT( reaction != NULL ); pthread_mutex_lock( &reactor->globals_lock ); direct_list_remove( &reactor->globals, &reaction->link ); pthread_mutex_unlock( &reactor->globals_lock ); return DR_OK; } DirectResult fusion_reactor_attach_channel( FusionReactor *reactor, int channel, ReactionFunc func, void *ctx, Reaction *reaction ) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } DirectResult fusion_reactor_dispatch_channel( FusionReactor *reactor, int channel, const void *msg_data, int msg_size, bool self, const ReactionFunc *globals ) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } DirectResult fusion_reactor_set_dispatch_callback( FusionReactor *reactor, FusionCall *call, void *call_ptr ) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } DirectResult fusion_reactor_set_name( FusionReactor *reactor, const char *name ) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } DirectResult fusion_reactor_dispatch (FusionReactor *reactor, const void *msg_data, bool self, const ReactionFunc *globals) { DirectLink *l; D_ASSERT( reactor != NULL ); D_ASSERT( msg_data != NULL ); if (reactor->globals) { if (globals) process_globals( reactor, msg_data, globals ); else D_ERROR( "Fusion/Reactor: global reactions exist but no " "globals have been passed to dispatch()\n" ); } if (!self) return DR_OK; pthread_mutex_lock( &reactor->reactions_lock ); l = reactor->reactions; while (l) { DirectLink *next = l->next; Reaction *reaction = (Reaction*) l; switch (reaction->func( msg_data, reaction->ctx )) { case RS_REMOVE: direct_list_remove( &reactor->reactions, l ); break; case RS_DROP: pthread_mutex_unlock( &reactor->reactions_lock ); return DR_OK; default: break; } l = next; } pthread_mutex_unlock( &reactor->reactions_lock ); return DR_OK; } DirectResult fusion_reactor_direct( FusionReactor *reactor, bool direct ) { D_ASSERT( reactor != NULL ); return DR_OK; } DirectResult fusion_reactor_destroy (FusionReactor *reactor) { D_ASSERT( reactor != NULL ); D_ASSUME( !reactor->destroyed ); reactor->destroyed = true; return DR_OK; } DirectResult fusion_reactor_free (FusionReactor *reactor) { D_ASSERT( reactor != NULL ); // D_ASSUME( reactor->destroyed ); reactor->reactions = NULL; pthread_mutex_destroy( &reactor->reactions_lock ); D_FREE( reactor ); return DR_OK; } /******************************************************************************/ static void process_globals( FusionReactor *reactor, const void *msg_data, const ReactionFunc *globals ) { DirectLink *n; GlobalReaction *global; int max_index = -1; D_ASSERT( reactor != NULL ); D_ASSERT( msg_data != NULL ); D_ASSERT( globals != NULL ); while (globals[max_index+1]) max_index++; if (max_index < 0) return; pthread_mutex_lock( &reactor->globals_lock ); direct_list_foreach_safe (global, n, reactor->globals) { if (global->index < 0 || global->index > max_index) { D_WARN( "global reaction index out of bounds (%d/%d)", global->index, max_index ); } else { if (globals[ global->index ]( msg_data, global->ctx ) == RS_REMOVE) direct_list_remove( &reactor->globals, &global->link ); } } pthread_mutex_unlock( &reactor->globals_lock ); } #endif DirectFB-1.2.10/lib/fusion/fusion.pc.in0000644000175000017500000000034111164361026014441 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Fusion IPC Description: High Level IPC Mechanisms Version: @VERSION@ Requires: direct Libs: -L${libdir} -lfusion Cflags: -I@INCLUDEDIR@ DirectFB-1.2.10/lib/fusion/object.h0000644000175000017500000004052411245562152013636 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__OBJECT_H__ #define __FUSION__OBJECT_H__ #include #include #include #include #include #include typedef void (*FusionObjectDestructor)( FusionObject *object, bool zombie, void *ctx ); typedef bool (*FusionPropIterator)( char *key, void *value, void *ctx); typedef unsigned long FusionObjectID; typedef enum { FOS_INIT, FOS_ACTIVE, FOS_DEINIT } FusionObjectState; struct __Fusion_FusionObject { DirectLink link; FusionObjectPool *pool; int magic; FusionObjectID id; FusionObjectState state; FusionRef ref; FusionReactor *reactor; FusionWorldShared *shared; FusionHash *properties; }; typedef bool (*FusionObjectCallback)( FusionObjectPool *pool, FusionObject *object, void *ctx ); FusionObjectPool *fusion_object_pool_create ( const char *name, int object_size, int message_size, FusionObjectDestructor destructor, void *ctx, const FusionWorld *world ); DirectResult fusion_object_pool_destroy( FusionObjectPool *pool, const FusionWorld *world ); DirectResult fusion_object_pool_enum ( FusionObjectPool *pool, FusionObjectCallback callback, void *ctx ); FusionObject *fusion_object_create ( FusionObjectPool *pool, const FusionWorld *world ); DirectResult fusion_object_get ( FusionObjectPool *pool, FusionObjectID object_id, FusionObject **ret_object ); DirectResult fusion_object_set_lock( FusionObject *object, FusionSkirmish *lock ); DirectResult fusion_object_activate( FusionObject *object ); DirectResult fusion_object_destroy ( FusionObject *object ); DirectResult fusion_object_set_property( FusionObject *object , const char *key, void *value, void **old_value); DirectResult fusion_object_set_int_property( FusionObject *object , const char *key,int value); DirectResult fusion_object_set_string_property( FusionObject *object , const char *key,char *value); void *fusion_object_get_property( FusionObject *object ,const char *key); void fusion_object_remove_property( FusionObject *object ,const char *key,void **ret_val); #define FUSION_OBJECT_METHODS(type, prefix) \ \ static inline DirectResult \ prefix##_attach( type *object, \ ReactionFunc func, \ void *ctx, \ Reaction *ret_reaction ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_attach( ((FusionObject*)object)->reactor, \ func, ctx, ret_reaction ); \ } \ \ static inline DirectResult \ prefix##_attach_channel( type *object, \ int channel, \ ReactionFunc func, \ void *ctx, \ Reaction *ret_reaction ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_attach_channel( ((FusionObject*)object)->reactor, \ channel, func, ctx, ret_reaction ); \ } \ \ static inline DirectResult \ prefix##_detach( type *object, \ Reaction *reaction ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_detach( ((FusionObject*)object)->reactor, \ reaction ); \ } \ \ static inline DirectResult \ prefix##_attach_global( type *object, \ int index, \ void *ctx, \ GlobalReaction *reaction ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_attach_global( ((FusionObject*)object)->reactor, \ index, ctx, reaction ); \ } \ \ static inline DirectResult \ prefix##_detach_global( type *object, \ GlobalReaction *reaction ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_detach_global( ((FusionObject*)object)->reactor, \ reaction ); \ } \ \ static inline DirectResult \ prefix##_dispatch( type *object, \ void *message, \ const ReactionFunc *globals ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_dispatch( ((FusionObject*)object)->reactor, \ message, true, globals ); \ } \ \ static inline DirectResult \ prefix##_dispatch_channel( type *object, \ int channel, \ void *message, \ int size, \ const ReactionFunc *globals ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_reactor_dispatch_channel( ((FusionObject*)object)->reactor, \ channel, message, size, true, globals ); \ } \ \ static inline DirectResult \ prefix##_ref( type *object ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_ref_up( &((FusionObject*)object)->ref, false ); \ } \ \ static inline DirectResult \ prefix##_unref( type *object ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_ref_down( &((FusionObject*)object)->ref, false ); \ } \ \ static inline DirectResult \ prefix##_ref_stat( type *object, int *refs ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ return fusion_ref_stat ( &((FusionObject*)object)->ref, refs ); \ } \ \ static inline DirectResult \ prefix##_link( type **link, \ type *object ) \ { \ DirectResult ret; \ \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ \ ret = fusion_ref_up( &((FusionObject*)object)->ref, true ); \ if (ret) \ return ret; \ \ *link = object; \ \ return DR_OK; \ } \ \ static inline DirectResult \ prefix##_unlink( type **link ) \ { \ type *object = *link; \ \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ \ *link = NULL; \ \ return fusion_ref_down( &((FusionObject*)object)->ref, true ); \ } \ \ static inline DirectResult \ prefix##_inherit( type *object, \ void *from ) \ { \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) from, FusionObject ); \ \ return fusion_ref_inherit( &((FusionObject*)object)->ref, \ &((FusionObject*)from)->ref ); \ } \ \ static inline DirectResult \ prefix##_globalize( type *object ) \ { \ DirectResult ret; \ \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ \ ret = fusion_ref_up( &((FusionObject*)object)->ref, true ); \ if (ret) \ return ret; \ \ ret = fusion_ref_down( &((FusionObject*)object)->ref, false ); \ if (ret) \ fusion_ref_down( &((FusionObject*)object)->ref, true ); \ \ return ret; \ } FUSION_OBJECT_METHODS( void, fusion_object ); #endif DirectFB-1.2.10/lib/fusion/arena.c0000644000175000017500000003565511245562152013462 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" #if FUSION_BUILD_MULTI D_DEBUG_DOMAIN( Fusion_Arena, "Fusion/Arena", "Fusion Arena" ); struct __Fusion_FusionArena { DirectLink link; int magic; FusionWorldShared *shared; FusionSkirmish lock; FusionRef ref; char *name; FusionHash *field_hash; }; /**********************************************************************************************************************/ static FusionArena *lock_arena ( FusionWorld *world, const char *name, bool add ); static void unlock_arena( FusionArena *arena ); /**********************************************************************************************************************/ DirectResult fusion_arena_enter (FusionWorld *world, const char *name, ArenaEnterFunc initialize, ArenaEnterFunc join, void *ctx, FusionArena **ret_arena, int *ret_error) { FusionArena *arena; FusionWorldShared *shared; ArenaEnterFunc func; int error = 0; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( name != NULL ); D_ASSERT( initialize != NULL ); D_ASSERT( join != NULL ); D_ASSERT( ret_arena != NULL ); D_DEBUG_AT( Fusion_Arena, "%s( '%s' )\n", __FUNCTION__, name ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Lookup arena and lock it. If it doesn't exist create it. */ arena = lock_arena( world, name, true ); if (!arena) return DR_FAILURE; /* Check if we are the first. */ if (fusion_ref_zero_trylock( &arena->ref ) == DR_OK) { D_DEBUG ("Fusion/Arena: entering arena '%s' (establishing)\n", name); /* Call 'initialize' later. */ func = initialize; /* Unlock the reference counter. */ fusion_ref_unlock( &arena->ref ); } else { D_DEBUG ("Fusion/Arena: entering arena '%s' (joining)\n", name); fusion_shm_attach_unattached( world ); /* Call 'join' later. */ func = join; } /* Increase reference counter. */ fusion_ref_up (&arena->ref, false); /* Return the arena. */ *ret_arena = arena; /* Call 'initialize' or 'join'. */ error = func (arena, ctx); /* Return the return value of the callback. */ if (ret_error) *ret_error = error; if (error) { fusion_ref_down (&arena->ref, false); if (func == initialize) { /* Destroy fields. */ fusion_hash_destroy( arena->field_hash ); /* Destroy reference counter. */ fusion_ref_destroy( &arena->ref ); /* Destroy the arena lock. This has to happen before locking the list. Otherwise a dead lock with lock_arena() below could occur. */ fusion_skirmish_destroy( &arena->lock ); /* Lock the list and remove the arena. */ fusion_skirmish_prevail( &shared->arenas_lock ); direct_list_remove( &shared->arenas, &arena->link ); fusion_skirmish_dismiss( &shared->arenas_lock ); D_MAGIC_CLEAR( arena ); /* Free allocated memory. */ SHFREE( shared->main_pool, arena->name ); SHFREE( shared->main_pool, arena ); return DR_OK; } } /* Unlock the arena. */ unlock_arena( arena ); return DR_OK; } DirectResult fusion_arena_add_shared_field (FusionArena *arena, const char *name, void *data) { DirectResult ret; FusionWorldShared *shared; char *shname; D_ASSERT( arena != NULL ); D_ASSERT( data != NULL ); D_ASSERT( name != NULL ); D_MAGIC_ASSERT( arena, FusionArena ); D_DEBUG_AT( Fusion_Arena, "%s( '%s', '%s' -> %p )\n", __FUNCTION__, arena->name, name, data ); shared = arena->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Lock the arena. */ ret = fusion_skirmish_prevail( &arena->lock ); if (ret) return ret; /* Give it the requested name. */ shname = SHSTRDUP( shared->main_pool, name ); if (shname) ret = fusion_hash_replace( arena->field_hash, shname, data, NULL, NULL ); else ret = D_OOSHM(); /* Unlock the arena. */ fusion_skirmish_dismiss( &arena->lock ); return ret; } DirectResult fusion_arena_get_shared_field (FusionArena *arena, const char *name, void **data) { void *ptr; D_ASSERT( arena != NULL ); D_ASSERT( name != NULL ); D_ASSERT( data != NULL ); D_MAGIC_ASSERT( arena, FusionArena ); D_DEBUG_AT( Fusion_Arena, "%s( '%s', '%s' )\n", __FUNCTION__, arena->name, name ); /* Lock the arena. */ if (fusion_skirmish_prevail( &arena->lock )) return DR_FAILURE; /* Lookup entry. */ ptr = fusion_hash_lookup( arena->field_hash, name ); D_DEBUG_AT( Fusion_Arena, " -> %p\n", ptr ); /* Unlock the arena. */ fusion_skirmish_dismiss( &arena->lock ); if (!ptr) return DR_ITEMNOTFOUND; *data = ptr; return DR_OK; } DirectResult fusion_arena_exit (FusionArena *arena, ArenaExitFunc shutdown, ArenaExitFunc leave, void *ctx, bool emergency, int *ret_error) { int error = 0; FusionWorldShared *shared; D_MAGIC_ASSERT( arena, FusionArena ); D_DEBUG_AT( Fusion_Arena, "%s( '%s' )\n", __FUNCTION__, arena->name ); D_ASSERT( shutdown != NULL ); shared = arena->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Lock the arena. */ if (fusion_skirmish_prevail( &arena->lock )) return DR_FAILURE; /* Decrease reference counter. */ fusion_ref_down( &arena->ref, false ); /* If we are the last... */ if (fusion_ref_zero_trylock( &arena->ref ) == DR_OK) { /* Deinitialize everything. */ error = shutdown( arena, ctx, emergency ); /* Destroy fields. */ fusion_hash_destroy( arena->field_hash ); /* Destroy reference counter. */ fusion_ref_destroy( &arena->ref ); /* Destroy the arena lock. This has to happen before locking the list. Otherwise a dead lock with lock_arena() below could occur. */ fusion_skirmish_destroy( &arena->lock ); /* Lock the list and remove the arena. */ fusion_skirmish_prevail( &shared->arenas_lock ); direct_list_remove( &shared->arenas, &arena->link ); fusion_skirmish_dismiss( &shared->arenas_lock ); D_MAGIC_CLEAR( arena ); /* Free allocated memory. */ SHFREE( shared->main_pool, arena->name ); SHFREE( shared->main_pool, arena ); } else { if (!leave) { fusion_ref_up( &arena->ref, false ); fusion_skirmish_dismiss( &arena->lock ); return DR_BUSY; } /* Simply leave the arena. */ error = leave( arena, ctx, emergency ); /* Unlock the arena. */ fusion_skirmish_dismiss( &arena->lock ); } /* Return the return value of the callback. */ if (ret_error) *ret_error = error; return DR_OK; } /***************************** * File internal functions * *****************************/ static FusionArena * create_arena( FusionWorld *world, const char *name ) { DirectResult ret; char buf[64]; FusionArena *arena; FusionWorldShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( name != NULL ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); arena = SHCALLOC( shared->main_pool, 1, sizeof(FusionArena) ); if (!arena) { D_OOSHM(); return NULL; } arena->shared = shared; snprintf( buf, sizeof(buf), "Arena '%s'", name ); /* Initialize lock and reference counter. */ ret = fusion_skirmish_init( &arena->lock, buf, world ); if (ret) goto error; ret = fusion_ref_init( &arena->ref, buf, world ); if (ret) goto error_ref; /* Give it the requested name. */ arena->name = SHSTRDUP( shared->main_pool, name ); if (!arena->name) { D_OOSHM(); goto error_prevail; } ret = fusion_hash_create( shared->main_pool, HASH_STRING, HASH_PTR, 7, &arena->field_hash ); if (ret) goto error_hash; fusion_hash_set_autofree( arena->field_hash, true, false ); /* Add it to the list. */ direct_list_prepend( &shared->arenas, &arena->link ); /* Lock the newly created arena. */ ret = fusion_skirmish_prevail( &arena->lock ); if (ret) goto error_prevail; D_MAGIC_SET( arena, FusionArena ); /* Returned locked new arena. */ return arena; error_prevail: fusion_hash_destroy( arena->field_hash ); error_hash: if (arena->name) SHFREE( shared->main_pool, arena->name ); fusion_ref_destroy( &arena->ref ); error_ref: fusion_skirmish_destroy( &arena->lock ); error: SHFREE( shared->main_pool, arena ); return NULL; } static FusionArena * lock_arena( FusionWorld *world, const char *name, bool add ) { FusionArena *arena; FusionWorldShared *shared; D_MAGIC_ASSERT( world, FusionWorld ); D_ASSERT( name != NULL ); shared = world->shared; D_MAGIC_ASSERT( shared, FusionWorldShared ); /* Lock the list. */ if (fusion_skirmish_prevail( &shared->arenas_lock )) return NULL; /* For each exisiting arena... */ direct_list_foreach (arena, shared->arenas) { /* Lock the arena. This would fail if the arena has been destroyed while waiting for the lock. */ if (fusion_skirmish_prevail( &arena->lock )) continue; D_MAGIC_ASSERT( arena, FusionArena ); /* Check if the name matches. */ if (! strcmp( arena->name, name )) { /* Check for an orphaned arena. */ if (fusion_ref_zero_trylock( &arena->ref ) == DR_OK) { D_ERROR( "Fusion/Arena: orphaned arena '%s'!\n", name ); fusion_ref_unlock( &arena->ref ); // arena = NULL; } /* Unlock the list. */ fusion_skirmish_dismiss( &shared->arenas_lock ); /* Return locked arena. */ return arena; } /* Unlock mismatched arena. */ fusion_skirmish_dismiss( &arena->lock ); } /* If no arena name matched, create a new arena before unlocking the list again. */ arena = add ? create_arena( world, name ) : NULL; /* Unlock the list. */ fusion_skirmish_dismiss( &shared->arenas_lock ); return arena; } static void unlock_arena( FusionArena *arena ) { D_ASSERT( arena != NULL ); D_MAGIC_ASSERT( arena, FusionArena ); /* Unlock the arena. */ fusion_skirmish_dismiss( &arena->lock ); } #else DirectResult fusion_arena_enter (FusionWorld *world, const char *name, ArenaEnterFunc initialize, ArenaEnterFunc join, void *ctx, FusionArena **ret_arena, int *ret_error) { int error; D_ASSERT( name != NULL ); D_ASSERT( initialize != NULL ); D_ASSERT( join != NULL ); D_ASSERT( ret_arena != NULL ); /* Always call 'initialize'. */ error = initialize (NULL, ctx); /* Return the return value of the callback. */ if (ret_error) *ret_error = error; return DR_OK; } DirectResult fusion_arena_add_shared_field (FusionArena *arena, const char *name, void *data) { D_ASSERT( data != NULL ); D_ASSERT( name != NULL ); return DR_OK; } DirectResult fusion_arena_get_shared_field (FusionArena *arena, const char *name, void **data) { D_ASSERT( data != NULL ); D_ASSERT( name != NULL ); D_BUG( "should not call this in fake mode" ); /* No field by that name has been found. */ return DR_ITEMNOTFOUND; } DirectResult fusion_arena_exit (FusionArena *arena, ArenaExitFunc shutdown, ArenaExitFunc leave, void *ctx, bool emergency, int *ret_error) { int error = 0; D_ASSERT( shutdown != NULL ); /* Deinitialize everything. */ error = shutdown( arena, ctx, emergency ); /* Return the return value of the callback. */ if (ret_error) *ret_error = error; return DR_OK; } #endif DirectFB-1.2.10/lib/fusion/protocol.h0000644000175000017500000000527111245562152014231 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION_PROTOCOL_H__ #define __FUSION_PROTOCOL_H__ #include #include #include #include typedef enum { FMT_SEND, FMT_ENTER, FMT_LEAVE, FMT_CALL, FMT_CALLRET, FMT_REACTOR } FusionMessageType; /* * Enter world (slave). */ typedef struct { FusionMessageType type; FusionID fusion_id; } FusionEnter; /* * Leave the world (slave). */ typedef struct { FusionMessageType type; FusionID fusion_id; } FusionLeave; /* * Execute a call. */ typedef struct { FusionMessageType type; unsigned int serial; FusionID caller; int call_id; int call_arg; void *call_ptr; void *handler; void *ctx; FusionCallExecFlags flags; } FusionCallMessage, FusionCallExecute; /* * Send call return. */ typedef struct { FusionMessageType type; int val; } FusionCallReturn; /* * Send reactor message. */ typedef struct { FusionMessageType type; int id; int channel; FusionRef *ref; } FusionReactorMessage; typedef union { FusionMessageType type; FusionEnter enter; FusionLeave leave; FusionCallMessage call; FusionCallReturn callret; FusionReactorMessage reactor; } FusionMessage; #endif DirectFB-1.2.10/lib/fusion/ref.c0000644000175000017500000004750111245562152013141 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "fusion_internal.h" #include #if FUSION_BUILD_MULTI D_DEBUG_DOMAIN( Fusion_Ref, "Fusion/Ref", "Fusion's Reference Counter" ); #if FUSION_BUILD_KERNEL DirectResult fusion_ref_init (FusionRef *ref, const char *name, const FusionWorld *world) { FusionEntryInfo info; D_ASSERT( ref != NULL ); D_ASSERT( name != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); D_DEBUG_AT( Fusion_Ref, "fusion_ref_init( %p, '%s' )\n", ref, name ? : "" ); while (ioctl( world->fusion_fd, FUSION_REF_NEW, &ref->multi.id )) { if (errno == EINTR) continue; D_PERROR( "FUSION_REF_NEW" ); return DR_FUSION; } D_DEBUG_AT( Fusion_Ref, " -> new ref %p [%d]\n", ref, ref->multi.id ); info.type = FT_REF; info.id = ref->multi.id; direct_snputs( info.name, name, sizeof(info.name) ); ioctl( world->fusion_fd, FUSION_ENTRY_SET_INFO, &info ); /* Keep back pointer to shared world data. */ ref->multi.shared = world->shared; ref->multi.creator = fusion_id( world ); return DR_OK; } DirectResult fusion_ref_set_name (FusionRef *ref, const char *name) { FusionEntryInfo info; D_ASSERT( ref != NULL ); D_ASSERT( name != NULL ); info.type = FT_REF; info.id = ref->multi.id; direct_snputs( info.name, name, sizeof(info.name) ); while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_ENTRY_SET_INFO, &info)) { switch (errno) { case EINTR: continue; case EAGAIN: return DR_LOCKED; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_ENTRY_SET_NAME"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_up (FusionRef *ref, bool global) { D_ASSERT( ref != NULL ); while (ioctl (_fusion_fd( ref->multi.shared ), global ? FUSION_REF_UP_GLOBAL : FUSION_REF_UP, &ref->multi.id)) { switch (errno) { case EINTR: continue; case EAGAIN: return DR_LOCKED; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } if (global) D_PERROR ("FUSION_REF_UP_GLOBAL"); else D_PERROR ("FUSION_REF_UP"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_down (FusionRef *ref, bool global) { D_ASSERT( ref != NULL ); while (ioctl (_fusion_fd( ref->multi.shared ), global ? FUSION_REF_DOWN_GLOBAL : FUSION_REF_DOWN, &ref->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } if (global) D_PERROR ("FUSION_REF_DOWN_GLOBAL"); else D_PERROR ("FUSION_REF_DOWN"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_stat (FusionRef *ref, int *refs) { int val; D_ASSERT( ref != NULL ); D_ASSERT( refs != NULL ); while ((val = ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_STAT, &ref->multi.id)) < 0) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_STAT"); return DR_FAILURE; } *refs = val; return DR_OK; } DirectResult fusion_ref_zero_lock (FusionRef *ref) { D_ASSERT( ref != NULL ); while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_ZERO_LOCK, &ref->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_ZERO_LOCK"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_zero_trylock (FusionRef *ref) { D_ASSERT( ref != NULL ); while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_ZERO_TRYLOCK, &ref->multi.id)) { switch (errno) { case EINTR: continue; case ETOOMANYREFS: return DR_BUSY; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_ZERO_TRYLOCK"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_unlock (FusionRef *ref) { D_ASSERT( ref != NULL ); while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_UNLOCK, &ref->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_UNLOCK"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_watch (FusionRef *ref, FusionCall *call, int call_arg) { FusionRefWatch watch; D_ASSERT( ref != NULL ); D_ASSERT( call != NULL ); watch.id = ref->multi.id; watch.call_id = call->call_id; watch.call_arg = call_arg; while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_WATCH, &watch)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_WATCH"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_inherit (FusionRef *ref, FusionRef *from) { FusionRefInherit inherit; D_ASSERT( ref != NULL ); D_ASSERT( from != NULL ); inherit.id = ref->multi.id; inherit.from = from->multi.id; while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_INHERIT, &inherit)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_INHERIT"); return DR_FAILURE; } return DR_OK; } DirectResult fusion_ref_destroy (FusionRef *ref) { D_ASSERT( ref != NULL ); D_DEBUG_AT( Fusion_Ref, "fusion_ref_destroy( %p [%d] )\n", ref, ref->multi.id ); while (ioctl (_fusion_fd( ref->multi.shared ), FUSION_REF_DESTROY, &ref->multi.id)) { switch (errno) { case EINTR: continue; case EINVAL: D_ERROR ("Fusion/Reference: invalid reference\n"); return DR_DESTROYED; default: break; } D_PERROR ("FUSION_REF_DESTROY"); return DR_FAILURE; } return DR_OK; } #else /* FUSION_BUILD_KERNEL */ DirectResult fusion_ref_init (FusionRef *ref, const char *name, const FusionWorld *world) { D_ASSERT( ref != NULL ); D_ASSERT( name != NULL ); D_MAGIC_ASSERT( world, FusionWorld ); D_DEBUG_AT( Fusion_Ref, "fusion_ref_init( %p, '%s' )\n", ref, name ? : "" ); ref->multi.id = ++world->shared->ref_ids; ref->multi.builtin.local = 0; ref->multi.builtin.global = 0; fusion_skirmish_init( &ref->multi.builtin.lock, name, world ); ref->multi.builtin.call = NULL; /* Keep back pointer to shared world data. */ ref->multi.shared = world->shared; ref->multi.creator = fusion_id( world ); return DR_OK; } DirectResult fusion_ref_set_name (FusionRef *ref, const char *name) { return DR_OK; } DirectResult _fusion_ref_change (FusionRef *ref, int add, bool global) { DirectResult ret; D_ASSERT( ref != NULL ); D_ASSERT( add != 0 ); ret = fusion_skirmish_prevail( &ref->multi.builtin.lock ); if (ret) return ret; if (global) { if (ref->multi.builtin.global+add < 0) { D_BUG( "ref has no global references" ); fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return DR_BUG; } ref->multi.builtin.global += add; } else { if (ref->multi.builtin.local+add < 0) { D_BUG( "ref has no local references" ); fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return DR_BUG; } ref->multi.builtin.local += add; _fusion_add_local( _fusion_world(ref->multi.shared), ref, add ); } if (ref->multi.builtin.local+ref->multi.builtin.global == 0) { fusion_skirmish_notify( &ref->multi.builtin.lock ); if (ref->multi.builtin.call) { fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return fusion_call_execute( ref->multi.builtin.call, FCEF_ONEWAY, ref->multi.builtin.call_arg, NULL, NULL ); } } fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return DR_OK; } DirectResult fusion_ref_up (FusionRef *ref, bool global) { return _fusion_ref_change( ref, +1, global ); } DirectResult fusion_ref_down (FusionRef *ref, bool global) { return _fusion_ref_change( ref, -1, global ); } DirectResult fusion_ref_stat (FusionRef *ref, int *refs) { D_ASSERT( ref != NULL ); D_ASSERT( refs != NULL ); *refs = ref->multi.builtin.local + ref->multi.builtin.global; return DR_OK; } DirectResult fusion_ref_zero_lock (FusionRef *ref) { DirectResult ret; D_ASSERT( ref != NULL ); ret = fusion_skirmish_prevail( &ref->multi.builtin.lock ); if (ret) return ret; if (ref->multi.builtin.call) { ret = DR_ACCESSDENIED; } else { if (ref->multi.builtin.local) _fusion_check_locals( _fusion_world(ref->multi.shared), ref ); while (ref->multi.builtin.local+ref->multi.builtin.global) { ret = fusion_skirmish_wait( &ref->multi.builtin.lock, 1000 ); /* 1 second */ if (ret && ret != DR_TIMEOUT); return ret; if (ref->multi.builtin.call) { ret = DR_ACCESSDENIED; break; } if (ref->multi.builtin.local) _fusion_check_locals( _fusion_world(ref->multi.shared), ref ); } } if (ret) fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return ret; } DirectResult fusion_ref_zero_trylock (FusionRef *ref) { DirectResult ret; D_ASSERT( ref != NULL ); ret = fusion_skirmish_prevail( &ref->multi.builtin.lock ); if (ret) return ret; if (ref->multi.builtin.local) _fusion_check_locals( _fusion_world(ref->multi.shared), ref ); if (ref->multi.builtin.local+ref->multi.builtin.global) ret = DR_BUSY; if (ret) fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return ret; } DirectResult fusion_ref_unlock (FusionRef *ref) { D_ASSERT( ref != NULL ); fusion_skirmish_dismiss( &ref->multi.builtin.lock ); return DR_OK; } 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; } DirectResult fusion_ref_inherit (FusionRef *ref, FusionRef *from) { D_ASSERT( ref != NULL ); D_ASSERT( from != NULL ); D_UNIMPLEMENTED(); return fusion_ref_up( ref, true ); } DirectResult fusion_ref_destroy (FusionRef *ref) { FusionSkirmish *skirmish; D_ASSERT( ref != NULL ); D_DEBUG_AT( Fusion_Ref, "fusion_ref_destroy( %p )\n", ref ); skirmish = &ref->multi.builtin.lock; if (skirmish->multi.builtin.destroyed) return DR_DESTROYED; _fusion_remove_all_locals( _fusion_world(ref->multi.shared), ref ); fusion_skirmish_destroy( skirmish ); return DR_OK; } #endif /* FUSION_BUILD_KERNEL */ #else /* FUSION_BUILD_MULTI */ DirectResult fusion_ref_init (FusionRef *ref, const char *name, const FusionWorld *world) { D_ASSERT( ref != NULL ); D_ASSERT( name != NULL ); direct_util_recursive_pthread_mutex_init (&ref->single.lock); pthread_cond_init (&ref->single.cond, NULL); ref->single.refs = 0; ref->single.destroyed = false; ref->single.locked = 0; return DR_OK; } DirectResult fusion_ref_set_name (FusionRef *ref, const char *name) { return DR_OK; } DirectResult fusion_ref_up (FusionRef *ref, bool global) { DirectResult ret = DR_OK; D_ASSERT( ref != NULL ); pthread_mutex_lock (&ref->single.lock); if (ref->single.destroyed) ret = DR_DESTROYED; else if (ref->single.locked) ret = DR_LOCKED; else ref->single.refs++; pthread_mutex_unlock (&ref->single.lock); return ret; } DirectResult fusion_ref_down (FusionRef *ref, bool global) { D_ASSERT( ref != NULL ); pthread_mutex_lock (&ref->single.lock); if (!ref->single.refs) { D_BUG( "no more references" ); pthread_mutex_unlock (&ref->single.lock); return DR_BUG; } if (ref->single.destroyed) { pthread_mutex_unlock (&ref->single.lock); return DR_DESTROYED; } if (! --ref->single.refs) { if (ref->single.call) { FusionCall *call = ref->single.call; if (call->handler) { int ret; pthread_mutex_unlock (&ref->single.lock); call->handler( 0, ref->single.call_arg, NULL, call->ctx, 0, &ret ); return DR_OK; } } else pthread_cond_broadcast (&ref->single.cond); } pthread_mutex_unlock (&ref->single.lock); return DR_OK; } DirectResult fusion_ref_stat (FusionRef *ref, int *refs) { D_ASSERT( ref != NULL ); D_ASSERT( refs != NULL ); if (ref->single.destroyed) return DR_DESTROYED; *refs = ref->single.refs; return DR_OK; } DirectResult fusion_ref_zero_lock (FusionRef *ref) { DirectResult ret = DR_OK; D_ASSERT( ref != NULL ); pthread_mutex_lock (&ref->single.lock); do { if (ref->single.destroyed) ret = DR_DESTROYED; else if (ref->single.locked) ret = DR_LOCKED; else if (ref->single.refs) pthread_cond_wait (&ref->single.cond, &ref->single.lock); else { ref->single.locked = direct_gettid(); break; } } while (ret == DR_OK); pthread_mutex_unlock (&ref->single.lock); return ret; } DirectResult fusion_ref_zero_trylock (FusionRef *ref) { DirectResult ret = DR_OK; D_ASSERT( ref != NULL ); pthread_mutex_lock (&ref->single.lock); if (ref->single.destroyed) ret = DR_DESTROYED; else if (ref->single.locked) ret = DR_LOCKED; else if (ref->single.refs) ret = DR_BUSY; else ref->single.locked = direct_gettid(); pthread_mutex_unlock (&ref->single.lock); return ret; } DirectResult fusion_ref_unlock (FusionRef *ref) { DirectResult ret = DR_OK; D_ASSERT( ref != NULL ); pthread_mutex_lock (&ref->single.lock); if (ref->single.locked == direct_gettid()) { ref->single.locked = 0; pthread_cond_broadcast (&ref->single.cond); } else ret = DR_ACCESSDENIED; pthread_mutex_unlock (&ref->single.lock); return ret; } DirectResult fusion_ref_watch (FusionRef *ref, FusionCall *call, int call_arg) { DirectResult ret = DR_OK; D_ASSERT( ref != NULL ); D_ASSERT( call != NULL ); pthread_mutex_lock (&ref->single.lock); if (ref->single.destroyed) ret = DR_DESTROYED; else if (!ref->single.refs) ret = DR_BUG; else if (ref->single.call) ret = DR_BUSY; else { ref->single.call = call; ref->single.call_arg = call_arg; } pthread_mutex_unlock (&ref->single.lock); return ret; } DirectResult fusion_ref_inherit (FusionRef *ref, FusionRef *from) { D_ASSERT( ref != NULL ); D_ASSERT( from != NULL ); D_UNIMPLEMENTED(); /* FIXME */ return fusion_ref_up( ref, true ); } DirectResult fusion_ref_destroy (FusionRef *ref) { D_ASSERT( ref != NULL ); ref->single.destroyed = true; pthread_cond_broadcast (&ref->single.cond); pthread_mutex_destroy (&ref->single.lock); pthread_cond_destroy (&ref->single.cond); return DR_OK; } #endif DirectFB-1.2.10/lib/fusion/vector.h0000644000175000017500000001135211245562152013667 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__VECTOR_H__ #define __FUSION__VECTOR_H__ #include #include #include typedef struct { int magic; void **elements; int count; int capacity; FusionSHMPoolShared *pool; } FusionVector; void fusion_vector_init ( FusionVector *vector, int capacity, FusionSHMPoolShared *pool ); void fusion_vector_destroy ( FusionVector *vector ); DirectResult fusion_vector_add ( FusionVector *vector, void *element ); DirectResult fusion_vector_insert ( FusionVector *vector, void *element, int index ); DirectResult fusion_vector_move ( FusionVector *vector, int from, int to ); DirectResult fusion_vector_remove ( FusionVector *vector, int index ); DirectResult fusion_vector_remove_last( FusionVector *vector ); static inline bool fusion_vector_has_elements( const FusionVector *vector ) { D_MAGIC_ASSERT( vector, FusionVector ); return vector->count > 0; } static inline bool fusion_vector_is_empty( const FusionVector *vector ) { D_MAGIC_ASSERT( vector, FusionVector ); return vector->count == 0; } static inline int fusion_vector_size( const FusionVector *vector ) { D_MAGIC_ASSERT( vector, FusionVector ); return vector->count; } static inline void * fusion_vector_at( const FusionVector *vector, int index ) { D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( index >= 0 ); D_ASSERT( index < vector->count ); return vector->elements[index]; } static inline bool fusion_vector_contains( const FusionVector *vector, const void *element ) { int i; int count; void * const *elements; D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( element != NULL ); count = vector->count; elements = vector->elements; /* Start with more recently added elements. */ for (i=count-1; i>=0; i--) if (elements[i] == element) return true; return false; } static inline int fusion_vector_index_of( const FusionVector *vector, const void *element ) { int i; int count; void * const *elements; D_MAGIC_ASSERT( vector, FusionVector ); D_ASSERT( element != NULL ); count = vector->count; elements = vector->elements; /* Start with more recently added elements. */ for (i=count-1; i>=0; i--) if (elements[i] == element) return i; /* * In case the return value isn't checked * this will most likely generate a bad address. */ return INT_MIN >> 2; } #define fusion_vector_foreach(element, index, vector) \ for ((index) = 0; \ (index) < (vector).count && (element = (vector).elements[index]); \ (index)++) #define fusion_vector_foreach_reverse(element, index, vector) \ for ((index) = (vector).count - 1; \ (index) >= 0 && (element = (vector).elements[index]); \ (index)--) #endif DirectFB-1.2.10/lib/fusion/conf.h0000644000175000017500000000321611245562152013312 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __FUSION__CONF_H__ #define __FUSION__CONF_H__ #include struct __Fusion_FusionConfig { char *tmpfs; /* location of shm file */ bool debugshm; bool madv_remove; bool madv_remove_force; bool force_slave; gid_t shmfile_gid; /* group that owns shm file */ }; extern FusionConfig *fusion_config; extern const char *fusion_config_usage; DirectResult fusion_config_set( const char *name, const char *value ); #endif DirectFB-1.2.10/missing0000755000175000017500000002557710753066007011561 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: DirectFB-1.2.10/COPYING0000644000175000017500000006347411164361026011207 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! DirectFB-1.2.10/Makefile.am0000644000175000017500000000153611164361026012177 00000000000000## Makefile.am for DirectFB ACLOCAL_AMFLAGS = -I m4 if HAVE_LINUX LINUXONLY_DIRS = inputdrivers gfxdrivers endif if BUILD_TOOLS TOOLS_DIR = tools endif if BUILD_TESTS TESTS_DIR = tests endif if ENABLE_VOODOO PROXY_DIR = proxy endif SUBDIRS = \ data \ docs \ include \ lib \ src \ systems \ $(TOOLS_DIR) \ wm \ interfaces \ $(PROXY_DIR) \ $(LINUXONLY_DIRS) \ $(TESTS_DIR) \ patches \ rules bin_SCRIPTS = directfb-config pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = directfb.pc directfb-internal.pc EXTRA_DIST = \ autogen.sh \ fb.modes \ directfb.spec.in \ directfb.spec ## Some special rules that may be useful ... # Generate the HTML API documentation: html: make -C docs/html # Compile the directfb-csource utility: directfb-csource: make -C tools directfb-csource .PHONY: html directfb-csource DirectFB-1.2.10/gfxdrivers/0000777000175000017500000000000011307522571012410 500000000000000DirectFB-1.2.10/gfxdrivers/cle266/0000777000175000017500000000000011307522570013410 500000000000000DirectFB-1.2.10/gfxdrivers/cle266/unichrome.c0000644000175000017500000004145111164361026015464 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ /* EPIA-M benchmarks (df_dok) SW v0.0.1 v0.1.0 v0.2.0 v0.3 Anti-aliased Text 98.97 - - - 280.80 KChars/sec Anti-aliased Text (blend) 28.85 - - - 280.61 KChars/sec Fill Rectangles 25.21 443.46 437.05 432.39 435.60 Mpixel/sec Fill Rectangles (blend) 5.54 - 130.12 128.42 127.82 MPixel/sec Fill Triangles 24.84 173.44 129.76 127.86 128.63 MPixel/sec Fill Triangles (blend) 5.46 - 129.81 127.86 128.67 MPixel/sec Draw Rectangles 11.82 58.98 59.07 52.48 55.10 KRects/sec Draw Rectangles (blend) 1.98 - 32.13 22.76 23.50 KRects/sec Draw Lines 42.67 283.81 292.33 193.87 203.20 KLines/sec Draw Lines (blend) 8.54 - 142.62 101.23 102.80 KLines/sec Blit 21.48 - 117.38 114.26 114.41 MPixel/sec Blit colorkeyed 22.54 - 117.34 114.26 114.41 MPixel/sec Blit w/ format conversion 16.22 - - 103.41 103.00 MPixel/sec Blit from 32bit (blend) 4.19 - - 87.72 87.32 MPixel/sec Blit from 8bit palette 11.02 - - 110.13 113.37 MPixel/sec Blit from 8bit pal. (blend) 3.78 - - 110.20 113.40 MPixel/sec Stretch Blit 23.19 - - 99.53 99.32 MPixel/sec Stretch Blit colorkeyed 25.04 - - 5.00 38.00 MPixel/sec Comparing M9000 and M10000 v0.2.0 M9000 M10000 Anti-aliased Text - - KChars/sec Anti-aliased Text (blend) - - KChars/sec Fill Rectangles 401.82 432.39 Mpixel/sec Fill Rectangles (blend) 129.05 128.42 MPixel/sec Fill Triangles 128.46 127.86 MPixel/sec Fill Triangles (blend) 128.46 127.86 MPixel/sec Draw Rectangles 55.51 52.48 KRects/sec Draw Rectangles (blend) 26.90 22.76 KRects/sec Draw Lines 225.00 193.87 KLines/sec Draw Lines (blend) 121.29 101.23 KLines/sec Blit 112.36 114.26 MPixel/sec Blit colorkeyed 112.28 114.26 MPixel/sec Blit w/ format conversion 103.92 103.41 MPixel/sec Blit from 32bit (blend) 87.89 87.72 MPixel/sec Blit from 8bit palette 110.56 110.13 MPixel/sec Blit from 8bit pal. (blend) 110.56 110.20 MPixel/sec Stretch Blit 108.67 99.53 MPixel/sec Stretch Blit colorkeyed 4.79 5.00 MPixel/sec v0.0.1 and v0.1.0 are tested on an EPIA-M9000, later versions on an EPIA-M10000. */ // DirectFB headers #include #include #include #include #include #include #include #include #include #include #include // System headers #include #include #include #include #include #include #include #include // Driver headers #include "unichrome.h" #include "uc_state.h" #include "uc_accel.h" #include "uc_fifo.h" #include "mmio.h" #ifndef FB_ACCEL_VIA_UNICHROME #define FB_ACCEL_VIA_UNICHROME 77 #endif extern DisplayLayerFuncs ucOverlayFuncs; extern DisplayLayerFuncs ucPrimaryFuncs; extern DisplayLayerFuncs ucOldPrimaryFuncs; extern void *ucOldPrimaryDriverData; DFB_GRAPHICS_DRIVER(cle266) //---------- /** * Dump beginning of virtual queue. * Use it to check that the VQ actually is in use. */ #if 0 static void uc_dump_vq(UcDeviceData *ucdev) { int i; u8* vq; if (!ucdev->vq_start) return; vq = dfb_system_video_memory_virtual(ucdev->vq_start); for (i = 0; i < 128; i++) { printf("%02x ", *(vq+i)); if ((i+1) % 16 == 0) printf("\n"); } } #endif /** Allocate memory for the virtual queue. */ static DFBResult uc_alloc_vq(CoreGraphicsDevice *device, UcDeviceData *ucdev) { if (ucdev->vq_start) return DFB_OK; ucdev->vq_size = 256*1024; // 256kb ucdev->vq_start = dfb_gfxcard_reserve_memory( device, ucdev->vq_size ); if (!ucdev->vq_start) return DFB_INIT; ucdev->vq_end = ucdev->vq_start + ucdev->vq_size - 1; // Debug: clear buffer memset((void *) dfb_system_video_memory_virtual(ucdev->vq_start), 0xcc, ucdev->vq_size); // uc_dump_vq(ucdev); return DFB_OK; } /** * Initialize the hardware. * @param enable enable VQ if true (else disable it.) */ static DFBResult uc_init_2d_engine(CoreGraphicsDevice *device, UcDeviceData *ucdev, UcDriverData *ucdrv, bool enable) { DFBResult result = DFB_OK; volatile u8* hwregs = ucdrv->hwregs; // Init 2D engine registers to reset 2D engine VIA_OUT(hwregs, 0x04, 0x0); VIA_OUT(hwregs, 0x08, 0x0); VIA_OUT(hwregs, 0x0c, 0x0); VIA_OUT(hwregs, 0x10, 0x0); VIA_OUT(hwregs, 0x14, 0x0); VIA_OUT(hwregs, 0x18, 0x0); VIA_OUT(hwregs, 0x1c, 0x0); VIA_OUT(hwregs, 0x20, 0x0); VIA_OUT(hwregs, 0x24, 0x0); VIA_OUT(hwregs, 0x28, 0x0); VIA_OUT(hwregs, 0x2c, 0x0); VIA_OUT(hwregs, 0x30, 0x0); VIA_OUT(hwregs, 0x34, 0x0); VIA_OUT(hwregs, 0x38, 0x0); VIA_OUT(hwregs, 0x3c, 0x0); VIA_OUT(hwregs, 0x40, 0x0); // Init AGP and VQ registers VIA_OUT(hwregs, 0x43c, 0x00100000); VIA_OUT(hwregs, 0x440, 0x00000000); VIA_OUT(hwregs, 0x440, 0x00333004); VIA_OUT(hwregs, 0x440, 0x60000000); VIA_OUT(hwregs, 0x440, 0x61000000); VIA_OUT(hwregs, 0x440, 0x62000000); VIA_OUT(hwregs, 0x440, 0x63000000); VIA_OUT(hwregs, 0x440, 0x64000000); VIA_OUT(hwregs, 0x440, 0x7D000000); VIA_OUT(hwregs, 0x43c, 0xfe020000); VIA_OUT(hwregs, 0x440, 0x00000000); if (enable) { result = uc_alloc_vq(device,ucdev); enable = (result == DFB_OK); } if (enable) { // Enable VQ VIA_OUT(hwregs, 0x43c, 0x00fe0000); VIA_OUT(hwregs, 0x440, 0x080003fe); VIA_OUT(hwregs, 0x440, 0x0a00027c); VIA_OUT(hwregs, 0x440, 0x0b000260); VIA_OUT(hwregs, 0x440, 0x0c000274); VIA_OUT(hwregs, 0x440, 0x0d000264); VIA_OUT(hwregs, 0x440, 0x0e000000); VIA_OUT(hwregs, 0x440, 0x0f000020); VIA_OUT(hwregs, 0x440, 0x1000027e); VIA_OUT(hwregs, 0x440, 0x110002fe); VIA_OUT(hwregs, 0x440, 0x200f0060); VIA_OUT(hwregs, 0x440, 0x00000006); VIA_OUT(hwregs, 0x440, 0x40008c0f); VIA_OUT(hwregs, 0x440, 0x44000000); VIA_OUT(hwregs, 0x440, 0x45080c04); VIA_OUT(hwregs, 0x440, 0x46800408); VIA_OUT(hwregs, 0x440, 0x52000000 | ((ucdev->vq_start & 0xFF000000) >> 24) | ((ucdev->vq_end & 0xFF000000) >> 16)); VIA_OUT(hwregs, 0x440, 0x50000000 | (ucdev->vq_start & 0xFFFFFF)); VIA_OUT(hwregs, 0x440, 0x51000000 | (ucdev->vq_end & 0xFFFFFF)); VIA_OUT(hwregs, 0x440, 0x53000000 | (ucdev->vq_size >> 3)); } else { // Disable VQ VIA_OUT(hwregs, 0x43c, 0x00fe0000); VIA_OUT(hwregs, 0x440, 0x00000004); VIA_OUT(hwregs, 0x440, 0x40008c0f); VIA_OUT(hwregs, 0x440, 0x44000000); VIA_OUT(hwregs, 0x440, 0x45080c04); VIA_OUT(hwregs, 0x440, 0x46800408); } return result; } static void uc_init_3d_engine(volatile u8* hwregs, int hwrev, bool init_all) { u32 i; if (init_all) { // Clear NotTex registers (?) VIA_OUT(hwregs, 0x43C, 0x00010000); for (i = 0; i <= 0x7d; i++) VIA_OUT(hwregs, 0x440, i << 24); // Clear texture unit 0 (?) VIA_OUT(hwregs, 0x43C, 0x00020000); for (i = 0; i <= 0x94; i++) VIA_OUT(hwregs, 0x440, i << 24); VIA_OUT(hwregs, 0x440, 0x82400000); // Clear texture unit 1 (?) VIA_OUT(hwregs, 0x43C, 0x01020000); for (i = 0; i <= 0x94; i++) VIA_OUT(hwregs, 0x440, i << 24); VIA_OUT(hwregs, 0x440, 0x82400000); // Clear general texture settings (?) VIA_OUT(hwregs, 0x43C, 0xfe020000); for (i = 0; i <= 0x03; i++) VIA_OUT(hwregs, 0x440, i << 24); // Clear palette settings (?) VIA_OUT(hwregs, 0x43C, 0x00030000); for (i = 0; i <= 0xff; i++) VIA_OUT(hwregs, 0x440, 0); VIA_OUT(hwregs, 0x43C, 0x00100000); VIA_OUT(hwregs, 0x440, 0x00333004); VIA_OUT(hwregs, 0x440, 0x10000002); VIA_OUT(hwregs, 0x440, 0x60000000); VIA_OUT(hwregs, 0x440, 0x61000000); VIA_OUT(hwregs, 0x440, 0x62000000); VIA_OUT(hwregs, 0x440, 0x63000000); VIA_OUT(hwregs, 0x440, 0x64000000); VIA_OUT(hwregs, 0x43C, 0x00fe0000); if (hwrev >= 3) VIA_OUT(hwregs, 0x440,0x40008c0f); else VIA_OUT(hwregs, 0x440,0x4000800f); VIA_OUT(hwregs, 0x440,0x44000000); VIA_OUT(hwregs, 0x440,0x45080C04); VIA_OUT(hwregs, 0x440,0x46800408); VIA_OUT(hwregs, 0x440,0x50000000); VIA_OUT(hwregs, 0x440,0x51000000); VIA_OUT(hwregs, 0x440,0x52000000); VIA_OUT(hwregs, 0x440,0x53000000); } VIA_OUT(hwregs, 0x43C,0x00fe0000); VIA_OUT(hwregs, 0x440,0x08000001); VIA_OUT(hwregs, 0x440,0x0A000183); VIA_OUT(hwregs, 0x440,0x0B00019F); VIA_OUT(hwregs, 0x440,0x0C00018B); VIA_OUT(hwregs, 0x440,0x0D00019B); VIA_OUT(hwregs, 0x440,0x0E000000); VIA_OUT(hwregs, 0x440,0x0F000000); VIA_OUT(hwregs, 0x440,0x10000000); VIA_OUT(hwregs, 0x440,0x11000000); VIA_OUT(hwregs, 0x440,0x20000000); } /** */ static void uc_after_set_var(void* drv, void* dev) { UcDriverData* ucdrv = (UcDriverData*) drv; VGA_OUT8(ucdrv->hwregs, 0x3c4, 0x1a); // Clear bit 6 in extended VGA register 0x1a to prevent system lockup. VGA_OUT8(ucdrv->hwregs, 0x3c5, VGA_IN8(ucdrv->hwregs, 0x3c5) & 0xbf); // Set bit 2, it might make a difference. VGA_OUT8(ucdrv->hwregs, 0x3c5, VGA_IN8(ucdrv->hwregs, 0x3c5) | 0x4); } /** Wait until the engine is idle. */ static DFBResult uc_engine_sync(void* drv, void* dev) { UcDriverData* ucdrv = (UcDriverData*) drv; UcDeviceData* ucdev = (UcDeviceData*) dev; int loop = 0; /* printf("Entering uc_engine_sync(), status is 0x%08x\n", VIA_IN(ucdrv->hwregs, VIA_REG_STATUS)); */ while ((VIA_IN(ucdrv->hwregs, VIA_REG_STATUS) & 0xfffeffff) != 0x00020000) { if (++loop > MAXLOOP) { D_ERROR("DirectFB/VIA: Timeout waiting for idle engine!\n"); break; } } /* printf("Leaving uc_engine_sync(), status is 0x%08x, " "waiting for %d (0x%x) cycles.\n", VIA_IN(ucdrv->hwregs, VIA_REG_STATUS), loop, loop); */ ucdev->idle_waitcycles += loop; ucdev->must_wait = 0; return DFB_OK; } // DirectFB interfacing functions -------------------------------------------- static int driver_probe(CoreGraphicsDevice *device) { struct stat s; switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_VIA_UNICHROME: return 1; } return stat(UNICHROME_DEVICE, &s) + 1; } static void driver_get_info(CoreGraphicsDevice* device, GraphicsDriverInfo* info) { // Fill in driver info structure. snprintf(info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "VIA UniChrome Driver"); snprintf(info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "-"); snprintf(info->url, DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH, "http://www.directfb.org"); snprintf(info->license, DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH, "LGPL"); info->version.major = 0; info->version.minor = 3; info->driver_data_size = sizeof (UcDriverData); info->device_data_size = sizeof (UcDeviceData); } static DFBResult driver_init_driver(CoreGraphicsDevice* device, GraphicsDeviceFuncs* funcs, void* driver_data, void* device_data, CoreDFB *core) { UcDriverData *ucdrv = (UcDriverData*) driver_data; //printf("Entering %s\n", __PRETTY_FUNCTION__); ucdrv->file = -1; ucdrv->pool = dfb_core_shmpool( core ); ucdrv->hwregs = dfb_gfxcard_map_mmio( device, 0, 0 ); if (!ucdrv->hwregs) { int fd; fd = open(UNICHROME_DEVICE, O_RDWR | O_SYNC, 0); if (fd < 0) { D_ERROR("Could not access %s. " "Is the cle266vgaio module installed?\n", UNICHROME_DEVICE); return DFB_IO; } ucdrv->file = fd; ucdrv->hwregs = mmap(NULL, 0x1000000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (ucdrv->hwregs == MAP_FAILED) return DFB_IO; } /* FIXME: this belongs to device_data! */ ucdrv->fifo = uc_fifo_create(ucdrv->pool, UC_FIFO_SIZE); if (!ucdrv->fifo) return D_OOSHM(); uc_after_set_var(driver_data, device_data); ucdrv->hwrev = 3; // FIXME: Get the real hardware revision number!!! // Driver specific initialization funcs->CheckState = uc_check_state; funcs->SetState = uc_set_state; funcs->EngineSync = uc_engine_sync; funcs->EmitCommands = uc_emit_commands; funcs->FlushTextureCache = uc_flush_texture_cache; funcs->AfterSetVar = uc_after_set_var; funcs->FillRectangle = uc_fill_rectangle; funcs->DrawRectangle = uc_draw_rectangle; funcs->DrawLine = uc_draw_line; funcs->FillTriangle = uc_fill_triangle; funcs->Blit = uc_blit; funcs->StretchBlit = uc_stretch_blit; funcs->TextureTriangles = uc_texture_triangles; /* install primary layer hooks */ if ( getenv("DFB_CLE266_UNDERLAY")) dfb_layers_hook_primary( device, driver_data, &ucPrimaryFuncs, &ucOldPrimaryFuncs, &ucOldPrimaryDriverData ); dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &ucOverlayFuncs ); return DFB_OK; } static DFBResult driver_init_device(CoreGraphicsDevice* device, GraphicsDeviceInfo* device_info, void* driver_data, void* device_data) { UcDriverData *ucdrv = (UcDriverData*) driver_data; UcDeviceData *ucdev = (UcDeviceData*) device_data; //printf("Entering %s\n", __PRETTY_FUNCTION__); snprintf(device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "UniChrome"); snprintf(device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "VIA/S3G"); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = UC_DRAWING_FUNCTIONS_2D | UC_DRAWING_FUNCTIONS_3D | UC_BLITTING_FUNCTIONS_2D | UC_BLITTING_FUNCTIONS_3D; device_info->caps.drawing = UC_DRAWING_FLAGS_2D | UC_DRAWING_FLAGS_3D; device_info->caps.blitting = UC_BLITTING_FLAGS_2D | UC_BLITTING_FLAGS_3D; device_info->limits.surface_byteoffset_alignment = 32; device_info->limits.surface_pixelpitch_alignment = 32; ucdev->pitch = 0; ucdev->draw_rop2d = VIA_ROP_P; ucdev->draw_rop3d = HC_HROP_P; ucdev->color = 0; ucdev->bflags = 0; ucdev->must_wait = 0; ucdev->cmd_waitcycles = 0; ucdev->idle_waitcycles = 0; uc_init_2d_engine(device, ucdev, ucdrv, false); // VQ disabled - can't make it work. uc_init_3d_engine(ucdrv->hwregs, ucdrv->hwrev, 1); return DFB_OK; } static void driver_close_device(CoreGraphicsDevice *device, void *driver_data, void *device_data) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcDeviceData* ucdev = (UcDeviceData*) device_data; // uc_dump_vq(ucdev); uc_engine_sync(driver_data, device_data); uc_init_2d_engine(device, ucdev, ucdrv, false); } static void driver_close_driver(CoreGraphicsDevice* device, void* driver_data) { UcDriverData* ucdrv = (UcDriverData*) driver_data; if (ucdrv->fifo) uc_fifo_destroy( ucdrv->pool, ucdrv->fifo ); if (ucdrv->file != -1) close( ucdrv->file ); } DirectFB-1.2.10/gfxdrivers/cle266/uc_accel.c0000644000175000017500000003332211164361026015227 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include #include "unichrome.h" #include "uc_accel.h" #include "uc_fifo.h" #include "mmio.h" #define UC_ACCEL_BEGIN() \ UcDriverData *ucdrv = (UcDriverData*) drv; \ UcDeviceData *ucdev = (UcDeviceData*) dev; \ struct uc_fifo *fifo = ucdrv->fifo; \ /*printf("entering %s\n", __PRETTY_FUNCTION__)*/ #define UC_ACCEL_END() \ UC_FIFO_CHECK(fifo); \ /*printf("leaving %s\n", __PRETTY_FUNCTION__)*/ // Private functions --------------------------------------------------------- /** Wait until a new command can be set up. */ static inline void uc_waitcmd(UcDriverData* ucdrv, UcDeviceData* ucdev) { int loop = 0; if (!ucdev->must_wait) return; //printf("waitcmd "); while (VIA_IN(ucdrv->hwregs, VIA_REG_STATUS) & VIA_CMD_RGTR_BUSY) { if (++loop > MAXLOOP) { D_ERROR("DirectFB/VIA: Timeout waiting for idle command regulator!\n"); break; } } //printf("waited for %d (0x%x) cycles.\n", loop, loop); ucdev->cmd_waitcycles += loop; ucdev->must_wait = 0; } /** Send commands to 2D/3D engine. */ void uc_emit_commands(void* drv, void* dev) { UC_ACCEL_BEGIN() uc_waitcmd(ucdrv, ucdev); UC_FIFO_FLUSH(fifo); ucdev->must_wait = 1; } void uc_flush_texture_cache(void* drv, void* dev) { UC_ACCEL_BEGIN() (void) ucdev; UC_FIFO_PREPARE(fifo, 4); UC_FIFO_ADD_HDR(fifo, (HC_ParaType_Tex << 16) | (HC_SubType_TexGeneral << 24)); UC_FIFO_ADD_3D(fifo, HC_SubA_HTXSMD, HC_HTXCHCLR_MASK); UC_FIFO_ADD_3D(fifo, HC_SubA_HTXSMD, 0); UC_FIFO_CHECK(fifo); } /** * Draw a horizontal or vertical line. * * @param fifo command FIFO * * @param x start x position * @param y start y position * @param len length * @param hv if zero: draw from left to right * if nonzero: draw from top to bottom. * * @note This is actually a 1-pixel high or wide rectangular color fill. */ static inline void uc_draw_hv_line(struct uc_fifo* fifo, int x, int y, int len, int hv, int rop) { UC_FIFO_ADD_2D(fifo, VIA_REG_DSTPOS, ((RS16(y) << 16) | RS16(x))); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, len << (hv ? 16 : 0)); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | rop | VIA_GEC_CLIP_ENABLE); } // DirectFB interfacing functions -------------------------------------------- // Functions using the 2D engine --- bool uc_fill_rectangle(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() //printf("%s: r = {%d, %d, %d, %d}, c = 0x%08x\n", __PRETTY_FUNCTION__, // r->x, r->y, r->w, r->h, ucdev->color); if (r->w == 0 || r->h == 0) return true; UC_FIFO_PREPARE(fifo, 8); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD_2D(fifo, VIA_REG_DSTPOS, ((RS16(r->y) << 16) | RS16(r->x))); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, (((RS16(r->h - 1)) << 16) | RS16((r->w - 1)))); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | ucdev->draw_rop2d | VIA_GEC_CLIP_ENABLE); UC_ACCEL_END(); return true; } bool uc_draw_rectangle(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() //printf("%s: r = {%d, %d, %d, %d}, c = 0x%08x\n", __PRETTY_FUNCTION__, // r->x, r->y, r->w, r->h, ucdev->color); int rop = ucdev->draw_rop2d; // Draw lines, in this order: top, bottom, left, right UC_FIFO_PREPARE(fifo, 26); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); uc_draw_hv_line(fifo, r->x, r->y, r->w - 1, 0, rop); uc_draw_hv_line(fifo, r->x, r->y + r->h - 1, r->w - 1, 0, rop); uc_draw_hv_line(fifo, r->x, r->y, r->h - 1, 1, rop); uc_draw_hv_line(fifo, r->x + r->w - 1, r->y, r->h - 1, 1, rop); UC_ACCEL_END(); return true; } bool uc_draw_line(void* drv, void* dev, DFBRegion* line) { UC_ACCEL_BEGIN() //printf("%s: l = (%d, %d) - (%d, %d), c = 0x%08x\n", __PRETTY_FUNCTION__, // line->x1, line->y1, line->x2, line->y2, ucdev->color); int cmd; int dx, dy, tmp, error; error = 1; cmd = VIA_GEC_LINE | VIA_GEC_FIXCOLOR_PAT | ucdev->draw_rop2d | VIA_GEC_CLIP_ENABLE; dx = line->x2 - line->x1; if (dx < 0) { dx = -dx; cmd |= VIA_GEC_DECX; // line will be drawn from right error = 0; } dy = line->y2 - line->y1; if (dy < 0) { dy = -dy; cmd |= VIA_GEC_DECY; // line will be drawn from bottom } if (dy > dx) { tmp = dy; dy = dx; dx = tmp; // Swap 'dx' and 'dy' cmd |= VIA_GEC_Y_MAJOR; // Y major line } UC_FIFO_PREPARE(fifo, 12); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD_2D(fifo, VIA_REG_LINE_K1K2, ((((dy << 1) & 0x3fff) << 16)| (((dy - dx) << 1) & 0x3fff))); UC_FIFO_ADD_2D(fifo, VIA_REG_LINE_XY, ((RS16(line->y1) << 16) | RS16(line->x1))); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, dx); UC_FIFO_ADD_2D(fifo, VIA_REG_LINE_ERROR, (((dy << 1) - dx - error) & 0x3fff)); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, cmd); UC_ACCEL_END(); return true; } bool uc_blit(void* drv, void* dev, DFBRectangle* rect, int dx, int dy) { UC_ACCEL_BEGIN() //printf("%s: r = (%d, %d, %d, %d) -> (%d, %d)\n", __PRETTY_FUNCTION__, // rect->x, rect->y, rect->h, rect->w, dx, dy); int cmd = VIA_GEC_BLT | VIA_ROP_S | VIA_GEC_CLIP_ENABLE; int sx = rect->x; int sy = rect->y; int w = rect->w; int h = rect->h; if (!w || !h) return true; (void) ucdev; // Kill 'unused variable' compiler warning. if (sx < dx) { cmd |= VIA_GEC_DECX; sx += w - 1; dx += w - 1; } if (sy < dy) { cmd |= VIA_GEC_DECY; sy += h - 1; dy += h - 1; } UC_FIFO_PREPARE(fifo, 10); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD_2D(fifo, VIA_REG_SRCPOS, (RS16(sy) << 16) | RS16(sx)); UC_FIFO_ADD_2D(fifo, VIA_REG_DSTPOS, (RS16(dy) << 16) | RS16(dx)); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, (RS16(h - 1) << 16) | RS16(w - 1)); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, cmd); UC_ACCEL_END(); return true; } // Functions using the 3D engine --- bool uc_fill_rectangle_3d(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() //printf("%s: r = {%d, %d, %d, %d}, c = 0x%08x\n", __PRETTY_FUNCTION__, // r->x, r->y, r->w, r->h, ucdev->color3d); int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HVCycle_AFP | HC_HVCycle_AA | HC_HVCycle_BB | HC_HVCycle_NewC | HC_HShading_FlatC; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; if (r->w == 0 || r->h == 0) return true; UC_FIFO_PREPARE(fifo, 18); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, r->x, r->y, 0); UC_FIFO_ADD_XYC(fifo, r->x + r->w, r->y + r->h, 0); UC_FIFO_ADD_XYC(fifo, r->x + r->w, r->y, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x, r->y + r->h, ucdev->color3d); UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } bool uc_draw_rectangle_3d(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Line | HC_HVCycle_AFP | HC_HShading_FlatA; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; UC_FIFO_PREPARE(fifo, 20); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, r->x, r->y, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x + r->w - 1, r->y, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x + r->w - 1, r->y + r->h - 1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x, r->y + r->h - 1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x, r->y, ucdev->color3d); UC_FIFO_ADD(fifo, cmdA_End); UC_ACCEL_END(); return true; } bool uc_draw_line_3d(void* drv, void* dev, DFBRegion* line) { UC_ACCEL_BEGIN() int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Line | HC_HVCycle_Full | HC_HShading_FlatA; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; UC_FIFO_PREPARE(fifo, 12); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, line->x1, line->y1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, line->x2, line->y2, 0); UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } bool uc_fill_triangle(void* drv, void* dev, DFBTriangle* tri) { UC_ACCEL_BEGIN() int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HVCycle_Full | HC_HShading_FlatA; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; UC_FIFO_PREPARE(fifo, 14); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, tri->x1, tri->y1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, tri->x2, tri->y2, 0); UC_FIFO_ADD_XYC(fifo, tri->x3, tri->y3, 0); UC_FIFO_ADD(fifo, cmdA_End); UC_ACCEL_END(); return true; } bool uc_blit_3d(void* drv, void* dev, DFBRectangle* rect, int dx, int dy) { // TODO: Write separate blit function to save some overhead. // Hmm, I don't think we can save anything beyond a few CPU cycles. -- dok DFBRectangle dest = {dx, dy, rect->w, rect->h}; return uc_stretch_blit(drv, dev, rect, &dest); } bool uc_stretch_blit(void* drv, void* dev, DFBRectangle* sr, DFBRectangle* dr) { UC_ACCEL_BEGIN() float w = ucdev->hwtex.l2w; float h = ucdev->hwtex.l2h; float dy = dr->y; float s1 = (sr->x ) / w; float t1 = (sr->y ) / h; float s2 = (sr->x + sr->w) / w; float t2 = (sr->y + sr->h) / h; int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_W | HC_HVPMSK_Cd | HC_HVPMSK_S | HC_HVPMSK_T; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HShading_FlatC | HC_HVCycle_AFP | HC_HVCycle_AA | HC_HVCycle_BB | HC_HVCycle_NewC; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; if (ucdev->bflags & DSBLIT_DEINTERLACE) { t1 *= 0.5f; t2 *= 0.5f; if (ucdev->field) dy += 0.5f; else dy -= 0.5f; } UC_FIFO_PREPARE(fifo, 30); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYWCST(fifo, dr->x+dr->w, dy, 1, 0, s2, t1); UC_FIFO_ADD_XYWCST(fifo, dr->x, dy+dr->h, 1, 0, s1, t2); UC_FIFO_ADD_XYWCST(fifo, dr->x, dy, 1, ucdev->color3d, s1, t1); UC_FIFO_ADD_XYWCST(fifo, dr->x+dr->w, dy+dr->h, 1, ucdev->color3d, s2, t2); UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } #define DFBCOLOR_TO_ARGB(c) PIXEL_ARGB( (c).a, (c).r, (c).g, (c).b ) bool uc_texture_triangles( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ) { UC_ACCEL_BEGIN() int i; int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Z | HC_HVPMSK_W | HC_HVPMSK_Cd | HC_HVPMSK_S | HC_HVPMSK_T; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HShading_Gouraud | HC_HVCycle_Full; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; switch (formation) { case DTTF_LIST: cmdA |= HC_HVCycle_NewA | HC_HVCycle_NewB | HC_HVCycle_NewC; break; case DTTF_STRIP: cmdA |= HC_HVCycle_AB | HC_HVCycle_BC | HC_HVCycle_NewC; break; case DTTF_FAN: cmdA |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; break; default: D_ONCE( "unknown triangle formation" ); return false; } UC_FIFO_PREPARE(fifo, 6 + num * 7); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); for (i=0; icolor3d, vertices[i].s, vertices[i].t); } UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } // Blit profiling //struct timeval tv_start, tv_stop; //gettimeofday(&tv_start, NULL); // Run test here //gettimeofday(&tv_stop, NULL); //tv_stop.tv_sec -= tv_start.tv_sec; //tv_stop.tv_usec -= tv_start.tv_usec; //if (tv_stop.tv_usec < 0) { // tv_stop.tv_sec--; // tv_stop.tv_usec += 1000000; //} //printf("elapsed time: %d us\n", tv_stop.tv_usec); DirectFB-1.2.10/gfxdrivers/cle266/unichrome.h0000644000175000017500000001005011164361026015460 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UNICHROME_H__ #define __UNICHROME_H__ #include #include #include #include #include #define UNICHROME_DEVICE "/dev/cle266vgaio" #define UC_FIFO_SIZE 4096 /** If defined - the driver will use the 3D engine. */ #define UC_ENABLE_3D //#undef UC_ENABLE_3D /** Register settings for the current source surface. (3D) */ struct uc_hw_texture { DFBSurfaceBlittingFlags bltflags; u32 l2w; //width, rounded up to nearest 2^m, eg 600 => 1024 u32 l2h; //height, rounded up, e.g 480 => 512 u32 we; //width exponent, i.e m in the number 2^m u32 he; //height exponent u32 format; // HW pixel format // 3d engine texture environment, texture unit 0 // Used for the DSBLIT_BLEND_ALPHACHANNEL, DSBLIT_BLEND_COLORALPHA // and DSBLIT_COLORIZE blitting flags. u32 regHTXnTB; u32 regHTXnMPMD; u32 regHTXnTBLCsat_0; u32 regHTXnTBLCop_0; u32 regHTXnTBLMPfog_0; u32 regHTXnTBLAsat_0; u32 regHTXnTBLRCb_0; u32 regHTXnTBLRAa_0; u32 regHTXnTBLRFog_0; }; /** Hardware source-destination blending registers. */ struct uc_hw_alpha { /* u32 regHABBasL; // Alpha buffer, low 24 bits. u32 regHABBasH; // Alpha buffer, high 8 bits. u32 regHABFM; // Alpha pixel format, memory type and pitch. u32 regHATMD; // Alpha test function and reference value. // Blending function */ u32 regHABLCsat; u32 regHABLCop; u32 regHABLAsat; u32 regHABLAop; u32 regHABLRCa; u32 regHABLRFCa; u32 regHABLRCbias; u32 regHABLRCb; u32 regHABLRFCb; u32 regHABLRAa; u32 regHABLRAb; }; typedef enum { uc_source2d = 0x00000001, uc_source3d = 0x00000002, uc_texenv = 0x00000004, uc_blending_fn = 0x00000008, uc_color2d = 0x00000010, uc_colorkey2d = 0x00000020 } UcStateBits; #define UC_VALIDATE(b) (ucdev->valid |= (b)) #define UC_INVALIDATE(b) (ucdev->valid &= ~(b)) #define UC_IS_VALID(b) (ucdev->valid & (b)) typedef struct _UcDeviceData { /* State validation */ UcStateBits valid; /* Current state settings */ u32 pitch; // combined src/dst pitch (2D) u32 color; // 2D fill color u32 color3d; // color for 3D operations u32 draw_rop2d; // logical drawing ROP (2D) u32 draw_rop3d; // logical drawing ROP (3D) DFBSurfaceBlittingFlags bflags; // blitting flags DFBRegion clip; // clipping region DFBSurfacePixelFormat dst_format; // destination pixel format int dst_offset; // destination buffer byte offset int dst_pitch; // destination buffer byte pitch int field; // source field /* Hardware settings */ struct uc_hw_alpha hwalpha; // alpha blending setting (3D) struct uc_hw_texture hwtex; // hardware settings for blitting (3D) /// Set directly after a 2D/3D engine command is sent. int must_wait; unsigned int cmd_waitcycles; unsigned int idle_waitcycles; u32 vq_start; // VQ related u32 vq_size; u32 vq_end; } UcDeviceData; typedef struct _UcDriverData { int file; // File handle to mmapped IO region. int hwrev; // Hardware revision volatile void* hwregs; // Hardware register base struct uc_fifo* fifo; // Data FIFO. FusionSHMPoolShared *pool; } UcDriverData; #endif // __UNICHROME_H__ DirectFB-1.2.10/gfxdrivers/cle266/Makefile.am0000644000175000017500000000207411245562152015364 00000000000000## Makefile.am for DirectFB/gfxdrivers/cle266 INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src AM_CFLAGS = $(DFB_CFLAGS) cle266_LTLIBRARIES = libdirectfb_cle266.la if BUILD_STATIC cle266_DATA = $(cle266_LTLIBRARIES:.la=.o) endif cle266dir = $(MODULEDIR)/gfxdrivers libdirectfb_cle266_la_SOURCES = \ unichrome.c unichrome.h \ uc_accel.c uc_accel.h \ uc_hw.h \ uc_hwset.c uc_hwmap.c \ uc_state.c uc_state.h \ uc_fifo.c uc_fifo.h \ uc_overlay.c uc_overlay.h \ uc_ovl_hwmap.c uc_ovl_hwset.c \ uc_primary.c \ mmio.h vidregs.h \ regs2d.h regs3d.h libdirectfb_cle266_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_cle266_la_LIBADD = \ -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/cle266/Makefile.in0000644000175000017500000004730711307521477015411 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/cle266 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(cle266dir)" "$(DESTDIR)$(cle266dir)" cle266LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(cle266_LTLIBRARIES) libdirectfb_cle266_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_cle266_la_OBJECTS = unichrome.lo uc_accel.lo \ uc_hwset.lo uc_hwmap.lo uc_state.lo uc_fifo.lo uc_overlay.lo \ uc_ovl_hwmap.lo uc_ovl_hwset.lo uc_primary.lo libdirectfb_cle266_la_OBJECTS = $(am_libdirectfb_cle266_la_OBJECTS) libdirectfb_cle266_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_cle266_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_cle266_la_SOURCES) DIST_SOURCES = $(libdirectfb_cle266_la_SOURCES) cle266DATA_INSTALL = $(INSTALL_DATA) DATA = $(cle266_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src AM_CFLAGS = $(DFB_CFLAGS) cle266_LTLIBRARIES = libdirectfb_cle266.la @BUILD_STATIC_TRUE@cle266_DATA = $(cle266_LTLIBRARIES:.la=.o) cle266dir = $(MODULEDIR)/gfxdrivers libdirectfb_cle266_la_SOURCES = \ unichrome.c unichrome.h \ uc_accel.c uc_accel.h \ uc_hw.h \ uc_hwset.c uc_hwmap.c \ uc_state.c uc_state.h \ uc_fifo.c uc_fifo.h \ uc_overlay.c uc_overlay.h \ uc_ovl_hwmap.c uc_ovl_hwset.c \ uc_primary.c \ mmio.h vidregs.h \ regs2d.h regs3d.h libdirectfb_cle266_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_cle266_la_LIBADD = \ -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/cle266/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/cle266/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-cle266LTLIBRARIES: $(cle266_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(cle266dir)" || $(MKDIR_P) "$(DESTDIR)$(cle266dir)" @list='$(cle266_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cle266LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(cle266dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cle266LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(cle266dir)/$$f"; \ else :; fi; \ done uninstall-cle266LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(cle266_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(cle266dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(cle266dir)/$$p"; \ done clean-cle266LTLIBRARIES: -test -z "$(cle266_LTLIBRARIES)" || rm -f $(cle266_LTLIBRARIES) @list='$(cle266_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_cle266.la: $(libdirectfb_cle266_la_OBJECTS) $(libdirectfb_cle266_la_DEPENDENCIES) $(libdirectfb_cle266_la_LINK) -rpath $(cle266dir) $(libdirectfb_cle266_la_OBJECTS) $(libdirectfb_cle266_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_accel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_fifo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_hwmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_hwset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_ovl_hwmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_ovl_hwset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_primary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_state.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unichrome.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-cle266DATA: $(cle266_DATA) @$(NORMAL_INSTALL) test -z "$(cle266dir)" || $(MKDIR_P) "$(DESTDIR)$(cle266dir)" @list='$(cle266_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(cle266DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(cle266dir)/$$f'"; \ $(cle266DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(cle266dir)/$$f"; \ done uninstall-cle266DATA: @$(NORMAL_UNINSTALL) @list='$(cle266_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(cle266dir)/$$f'"; \ rm -f "$(DESTDIR)$(cle266dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(cle266dir)" "$(DESTDIR)$(cle266dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-cle266LTLIBRARIES clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-cle266DATA install-cle266LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-cle266DATA uninstall-cle266LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-cle266LTLIBRARIES clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-cle266DATA \ install-cle266LTLIBRARIES install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-cle266DATA uninstall-cle266LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/cle266/mmio.h0000644000175000017500000000312611164361026014436 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef _VIA_MMIO_H #define _VIA_MMIO_H #define TRACE_ENTER() printf("Entering %s\n", __PRETTY_FUNCTION__) #define TRACE_LEAVE() printf("Leaving %s\n", __PRETTY_FUNCTION__) #ifdef KERNEL #define VIA_OUT(hwregs, reg, val) *(volatile u32 *)((hwregs) + (reg)) = (val) #define VIA_IN(hwregs, reg) *(volatile u32 *)((hwregs) + (reg)) #define VGA_OUT8(hwregs, reg, val) *(volatile u8 *)((hwregs) + (reg) + 0x8000) = (val) #define VGA_IN8(hwregs, reg) *(volatile u8 *)((hwregs) + (reg) + 0x8000) #define RS16(val) ((u16)((s16)(val))) #define RS12(val) (((u16)((s16)(val))) & 0xfff) #else // !KERNEL #define VIA_OUT(hwregs, reg, val) *(volatile u32 *)((hwregs) + (reg)) = (val) #define VIA_IN(hwregs, reg) *(volatile u32 *)((hwregs) + (reg)) #define VGA_OUT8(hwregs, reg, val) *(volatile u8 *)((hwregs) + (reg) + 0x8000) = (val) #define VGA_IN8(hwregs, reg) *(volatile u8 *)((hwregs) + (reg) + 0x8000) #define RS16(val) ((u16)((s16)(val))) #define RS12(val) (((u16)((s16)(val))) & 0xfff) #endif // KERNEL #define VIDEO_OUT(hwregs, reg, val) VIA_OUT((hwregs)+0x200, reg, val) #define VIDEO_IN(hwregs, reg) VIA_IN((hwregs)+0x200, reg) #define MAXLOOP 0xffffff #endif /* _VIA_MMIO_H */ DirectFB-1.2.10/gfxdrivers/cle266/uc_state.h0000644000175000017500000000370011164361026015302 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_STATE__ #define __UC_STATE__ #include #include #include void uc_set_state(void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel); void uc_check_state(void *drv, void *dev, CardState *state, DFBAccelerationMask accel); /* struct uc_hw_misc { // These control clipping... u32 regHClipTB; u32 regHClipLR; u32 regHFPClipTL; u32 regHFPClipBL; u32 regHFPClipLL; u32 regHFPClipRL; u32 regHFPClipTBH; u32 regHFPClipLRH; // Other functions u32 regHLP; // Line stipple pattern u32 regHLPRF; // Line stipple factor u32 regHSolidCL; // --- Don't know. Unused in DRI. u32 regHPixGC; // Don't know. Is kept cleared in DRI. //u32 regHSPXYOS; // Polygon stipple x and y offsets. Unused here. u32 regHVertexCNT; // --- Don't know. Unused in DRI. u8 ps_xos; // Polygon stipple x-offset. => regHSPXYOS u8 ps_yos; // Polygon stipple y-offset. => regHSPXYOS u32 ps_pat[32]; // Polygon stipple pattern buffer. // These are not registers... }; /// Stencil control. struct uc_hw_stencil { //u32 regHSBBasL; // These aren't in regs3d.h, but they should exist... //u32 regHSBBasH; //u32 regHSBFM; u32 regHSTREF; // Stencil reference value and plane mask u32 regHSTMD; // Stencil test function and fail operation and // zpass/zfail operations. }; */ #endif // __UC_STATE__ DirectFB-1.2.10/gfxdrivers/cle266/uc_fifo.h0000644000175000017500000002041211164361026015104 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_FIFO_H__ #define __UC_FIFO_H__ // Note to self: remove when added to makefile as -DUC_DEBUG. #define UC_DEBUG 1 #include #include "regs2d.h" #include "regs3d.h" #include "mmio.h" /** * uc_fifo - GPU data queue. * * buf: buffer start (userspace address) * head: pointer to first unused entry. * * size: maximum number of entries in the fifo. * prep: number of entries allocated to be used. * used: number of entries currently in use. * * hwregs: GPU register base address * reg_tset: address to GPU TRANSET register * reg_tspace: address to GPU TRANSPACE register * * flush: function pointer to flush function (DMA or CPU) * flush_sys: function pointer to flush_sys (non-DMA) function */ struct uc_fifo { u32* buf; u32* head; unsigned int size; unsigned int prep; unsigned int used; //void (*flush)(struct uc_fifo* fifo, volatile void *hwregs); //void (*flush_sys)(struct uc_fifo* fifo, volatile void *hwregs); }; // Help macros --------------------------------------------------------------- // For the record: Macros suck maintenance- and debugging-wise, // but provide guaranteed inlining of the code. /** * Send the contents of the FIFO buffer to the hardware, and clear * the buffer. The transfer may be performed by the CPU or by DMA. */ //#define UC_FIFO_FLUSH(fifo) (fifo)->flush(fifo,ucdrv->hwregs) /** * Same as UC_FIFO_FLUSH(), but always uses the CPU to transfer data. */ //#define UC_FIFO_FLUSH_SYS(fifo) (fifo)->flush_sys(fifo,ucdrv->hwregs) #define UC_FIFO_FLUSH(fifo) uc_fifo_flush_sys(fifo,ucdrv->hwregs) #define UC_FIFO_FLUSH_SYS(fifo) uc_fifo_flush_sys(fifo,ucdrv->hwregs) /** * Make sure there is room for dwsize double words in the FIFO. * If necessary, the FIFO is flushed first. * * @param fifo the fifo * @param dwsize number of double words to allocate * * @note It is ok to request more space than you will actually * be using. This is useful when you don't know exactly beforehand * how many entries you need. * * @note equivalent DRI code is in via_ioctl.c::viaCheckDma() */ #ifdef UC_DEBUG #define UC_FIFO_PREPARE(fifo, dwsize) \ do { \ if ((fifo)->used + dwsize + 32 > (fifo)->size) { \ D_DEBUG("CLE266: FIFO full - flushing it."); \ UC_FIFO_FLUSH(fifo); \ } \ if (dwsize + (fifo)->prep + 32 > (fifo)->size) { \ D_BUG("CLE266: FIFO too small for allocation."); \ } \ (fifo)->prep += dwsize; \ } while(0) #else #define UC_FIFO_PREPARE(fifo, dwsize) \ do { \ if ((fifo)->used + dwsize + 32 > (fifo)->size) { \ UC_FIFO_FLUSH(fifo); \ } \ (fifo)->prep += dwsize; \ } while(0) #endif // UC_FIFO_DEBUG /** * Add a 32-bit data word to the FIFO. * Takes one entry in the FIFO. */ #define UC_FIFO_ADD(fifo, data) \ do { \ *((fifo)->head) = (data); \ (fifo)->head++; \ (fifo)->used++; \ } while(0) /** * Add a command header. (HC_HEADER2 + parameter selection) * Takes two entries in the fifo. */ #define UC_FIFO_ADD_HDR(fifo, param) \ do { \ UC_FIFO_ADD(fifo, HC_HEADER2); \ UC_FIFO_ADD(fifo, param); \ } while(0); /** * Add a floating point value to the FIFO. * Non-floats (e.g integers) are converted first. * Takes one entry in the FIFO. */ #define UC_FIFO_ADD_FLOAT(fifo, val) \ do { \ union {float f; u32 i;} v; \ v.f = (float) (val); \ UC_FIFO_ADD(fifo, v.i); \ } while(0) /** * Add a vertex on the form (x, y, color) to the FIFO. * Takes three entries in the FIFO. * The color format is 0xAARRGGBB. */ #define UC_FIFO_ADD_XYC(fifo, x, y, color) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD(fifo, color); \ } while(0) /** * Add a vertex on the form (x, y, w, color, s, t) to the FIFO. * Takes six entries in the FIFO. * The color format is 0xAARRGGBB. */ #define UC_FIFO_ADD_XYWCST(fifo, x, y, w, color, s, t) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD_FLOAT(fifo, w); \ UC_FIFO_ADD(fifo, color); \ UC_FIFO_ADD_FLOAT(fifo, s); \ UC_FIFO_ADD_FLOAT(fifo, t); \ } while(0) #define UC_FIFO_ADD_XYZWCST(fifo, x, y, z, w, color, s, t) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD_FLOAT(fifo, z); \ UC_FIFO_ADD_FLOAT(fifo, w); \ UC_FIFO_ADD(fifo, color); \ UC_FIFO_ADD_FLOAT(fifo, s); \ UC_FIFO_ADD_FLOAT(fifo, t); \ } while(0) #define UC_FIFO_ADD_XYCST(fifo, x, y, color, s, t) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD(fifo, color); \ UC_FIFO_ADD_FLOAT(fifo, s); \ UC_FIFO_ADD_FLOAT(fifo, t); \ } while(0) /** * Add data specifically for the 2D controller, to the fifo. * Takes two entries in the FIFO. * * @param reg 2D register index * @param data 32-bit data to add */ #define UC_FIFO_ADD_2D(fifo, reg, data) \ do { \ UC_FIFO_ADD(fifo, ((reg) >> 2) | HALCYON_HEADER1); \ UC_FIFO_ADD(fifo, (data)); \ } while (0) /** * Add data specifically for a 3D controller register, to the fifo. * Takes one entry in the FIFO. * * @param reg 3D register index (8 bit) * @param data 24-bit data to add (make sure bits 24 - 31 are cleared!) */ #define UC_FIFO_ADD_3D(fifo, reg, data) \ UC_FIFO_ADD(fifo, ((reg) << 24) | (data)) /** * Pad the FIFO to an even number of entries. * Takes zero or one entries in the FIFO. */ #define UC_FIFO_PAD_EVEN(fifo) \ if (fifo->used & 1) UC_FIFO_ADD(fifo, HC_DUMMY) /** * Check for buffer overruns. * Can be redefined to nothing in release builds. */ #ifdef UC_DEBUG #define UC_FIFO_CHECK(fifo) \ do { \ if ((fifo)->used > ((fifo)->size) - 32) { \ D_BUG("CLE266: FIFO overrun."); \ } \ if ((fifo)->used > (fifo)->prep) { \ D_BUG("CLE266: FIFO allocation error."); \ } \ } while(0) #else #define UC_FIFO_CHECK(fifo) do { } while(0) #endif // UC_DEBUG // FIFO functions ------------------------------------------------------------ /** Create a FIFO. Returns NULL on failure. */ struct uc_fifo* uc_fifo_create(FusionSHMPoolShared *pool, size_t size); /** Destroy a FIFO */ void uc_fifo_destroy(FusionSHMPoolShared *pool, struct uc_fifo* fifo); void uc_fifo_flush_sys(struct uc_fifo* fifo, volatile void *regs); #endif // __UC_FIFO_H__ DirectFB-1.2.10/gfxdrivers/cle266/uc_state.c0000644000175000017500000001762111164361026015304 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "unichrome.h" #include "uc_state.h" #include "uc_accel.h" #include "uc_hw.h" enum uc_state_type { UC_TYPE_UNSUPPORTED, UC_TYPE_2D, UC_TYPE_3D }; /// GPU selecting functions -------------------------------------------------- static inline bool uc_has_dst_format( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: return true; default: break; } return false; } static inline bool uc_has_src_format_3d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_A8: case DSPF_LUT8: return true; default: break; } return false; } static inline enum uc_state_type uc_select_drawtype( CardState* state, DFBAccelerationMask accel ) { if (!(state->drawingflags & ~UC_DRAWING_FLAGS_2D) && !(accel & DFXL_FILLTRIANGLE)) return UC_TYPE_2D; if (!(state->drawingflags & ~UC_DRAWING_FLAGS_3D)) return UC_TYPE_3D; return UC_TYPE_UNSUPPORTED; } static inline enum uc_state_type uc_select_blittype( CardState* state, DFBAccelerationMask accel ) { if (!(state->blittingflags & ~UC_BLITTING_FLAGS_2D)) { if ((state->source->config.format == state->destination->config.format) && !((state->blittingflags & DSBLIT_SRC_COLORKEY) && (state->blittingflags & DSBLIT_DST_COLORKEY)) && !(accel & (DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES))) return UC_TYPE_2D; } if (!(state->blittingflags & ~UC_BLITTING_FLAGS_3D)) { if (uc_has_src_format_3d( state->source->config.format )) return UC_TYPE_3D; } return UC_TYPE_UNSUPPORTED; } // DirectFB interfacing functions -------------------------------------------- void uc_check_state(void *drv, void *dev, CardState *state, DFBAccelerationMask accel) { /* Check destination format. */ if (!uc_has_dst_format( state->destination->config.format )) return; if (DFB_DRAWING_FUNCTION(accel)) { /* Check drawing parameters. */ switch (uc_select_drawtype(state, accel)) { case UC_TYPE_2D: state->accel |= UC_DRAWING_FUNCTIONS_2D; break; case UC_TYPE_3D: state->accel |= UC_DRAWING_FUNCTIONS_3D; break; default: return; } } else { /* Check blitting parameters. */ switch (uc_select_blittype(state, accel)) { case UC_TYPE_2D: state->accel |= UC_BLITTING_FUNCTIONS_2D; break; case UC_TYPE_3D: state->accel |= UC_BLITTING_FUNCTIONS_3D; break; default: return; } } } void uc_set_state(void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel) { UcDriverData *ucdrv = (UcDriverData*) drv; UcDeviceData *ucdev = (UcDeviceData*) dev; struct uc_fifo *fifo = ucdrv->fifo; u32 rop3d = HC_HROP_P; u32 regEnable = HC_HenCW_MASK | HC_HenAW_MASK; StateModificationFlags modified = state->mod_hw; // Check modified states and update hw if (modified & SMF_SOURCE) UC_INVALIDATE( uc_source2d ); if (modified & (SMF_BLITTING_FLAGS | SMF_SOURCE)) UC_INVALIDATE( uc_source3d | uc_texenv ); if (modified & (SMF_BLITTING_FLAGS | SMF_SRC_COLORKEY | SMF_DST_COLORKEY)) UC_INVALIDATE( uc_colorkey2d ); if (modified & (SMF_COLOR | SMF_DESTINATION | SMF_DRAWING_FLAGS)) UC_INVALIDATE( uc_color2d ); if (modified & (SMF_SRC_BLEND | SMF_DST_BLEND)) UC_INVALIDATE( uc_blending_fn ); if (modified & SMF_COLOR) ucdev->color3d = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); if (modified & SMF_DRAWING_FLAGS) { if (state->drawingflags & DSDRAW_XOR) { ucdev->draw_rop3d = HC_HROP_DPx; ucdev->draw_rop2d = VIA_ROP_DPx; } else { ucdev->draw_rop3d = HC_HROP_P; ucdev->draw_rop2d = VIA_ROP_P; } } ucdev->bflags = state->blittingflags; if (modified & SMF_DESTINATION) uc_set_destination(ucdrv, ucdev, state); if (modified & SMF_CLIP) uc_set_clip(ucdrv, ucdev, state); // Select GPU and check remaining states if (DFB_DRAWING_FUNCTION(accel)) { switch (uc_select_drawtype(state, accel)) { case UC_TYPE_2D: funcs->FillRectangle = uc_fill_rectangle; funcs->DrawRectangle = uc_draw_rectangle; funcs->DrawLine = uc_draw_line; uc_set_color_2d(ucdrv, ucdev, state); state->set = UC_DRAWING_FUNCTIONS_2D; break; case UC_TYPE_3D: funcs->FillRectangle = uc_fill_rectangle_3d; funcs->DrawRectangle = uc_draw_rectangle_3d; funcs->DrawLine = uc_draw_line_3d; if (state->drawingflags & DSDRAW_BLEND) { uc_set_blending_fn(ucdrv, ucdev, state); regEnable |= HC_HenABL_MASK; } rop3d = ucdev->draw_rop3d; state->set = UC_DRAWING_FUNCTIONS_3D; break; case UC_TYPE_UNSUPPORTED: D_BUG("Unsupported drawing function!"); break; } } else { // DFB_BLITTING_FUNCTION(accel) switch (uc_select_blittype(state, accel)) { case UC_TYPE_2D: uc_set_source_2d(ucdrv, ucdev, state); funcs->Blit = uc_blit; uc_set_colorkey_2d(ucdrv, ucdev, state); state->set = UC_BLITTING_FUNCTIONS_2D; break; case UC_TYPE_3D: funcs->Blit = uc_blit_3d; uc_set_source_3d(ucdrv, ucdev, state); uc_set_texenv(ucdrv, ucdev, state); uc_set_blending_fn(ucdrv, ucdev, state); regEnable |= HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK | HC_HenDT_MASK; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) regEnable |= HC_HenABL_MASK; state->set = UC_BLITTING_FUNCTIONS_3D; break; case UC_TYPE_UNSUPPORTED: D_BUG("Unsupported drawing function!"); break; } } #ifdef UC_ENABLE_3D UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); /* Don't know what this does. DRI code always clears it. */ UC_FIFO_ADD_3D ( fifo, HC_SubA_HPixGC, 0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HEnable, regEnable ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HFBBMSKL, 0xffffff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HROP, rop3d | 0xff ); #endif UC_FIFO_CHECK(fifo); state->mod_hw = 0; } DirectFB-1.2.10/gfxdrivers/cle266/regs3d.h0000644000175000017500000020521411164361026014666 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __VIA_REGS_3D_H__ #define __VIA_REGS_3D_H__ #define HC_REG_BASE 0x0400 #define HC_ParaN_MASK 0xffffffff #define HC_Para_MASK 0x00ffffff #define HC_SubA_MASK 0xff000000 #define HC_SubA_SHIFT 24 /* Transmission Setting */ #define HC_REG_TRANS_SET 0x003c #define HC_ParaSubType_MASK 0xff000000 #define HC_ParaType_MASK 0x00ff0000 #define HC_ParaOS_MASK 0x0000ff00 #define HC_ParaAdr_MASK 0x000000ff #define HC_ParaSubType_SHIFT 24 #define HC_ParaType_SHIFT 16 #define HC_ParaOS_SHIFT 8 #define HC_ParaAdr_SHIFT 0 #define HC_ParaType_CmdVdata 0x0000 #define HC_ParaType_NotTex 0x0001 #define HC_ParaType_Tex 0x0002 #define HC_ParaType_Palette 0x0003 #define HC_ParaType_PreCR 0x0010 #define HC_ParaType_Auto 0x00fe /* Transmission Space */ #define HC_REG_Hpara0 0x0040 #define HC_REG_HpataAF 0x02fc /* Read */ #define HC_REG_HREngSt 0x0000 #define HC_REG_HRFIFOempty 0x0004 #define HC_REG_HRFIFOfull 0x0008 #define HC_REG_HRErr 0x000c #define HC_REG_FIFOstatus 0x0010 /* HC_REG_HREngSt 0x0000 */ #define HC_HDASZC_MASK 0x00010000 #define HC_HSGEMI_MASK 0x0000f000 #define HC_HLGEMISt_MASK 0x00000f00 #define HC_HCRSt_MASK 0x00000080 #define HC_HSE0St_MASK 0x00000040 #define HC_HSE1St_MASK 0x00000020 #define HC_HPESt_MASK 0x00000010 #define HC_HXESt_MASK 0x00000008 #define HC_HBESt_MASK 0x00000004 #define HC_HE2St_MASK 0x00000002 #define HC_HE3St_MASK 0x00000001 /* HC_REG_HRFIFOempty 0x0004 */ #define HC_HRZDempty_MASK 0x00000010 #define HC_HRTXAempty_MASK 0x00000008 #define HC_HRTXDempty_MASK 0x00000004 #define HC_HWZDempty_MASK 0x00000002 #define HC_HWCDempty_MASK 0x00000001 /* HC_REG_HRFIFOfull 0x0008 */ #define HC_HRZDfull_MASK 0x00000010 #define HC_HRTXAfull_MASK 0x00000008 #define HC_HRTXDfull_MASK 0x00000004 #define HC_HWZDfull_MASK 0x00000002 #define HC_HWCDfull_MASK 0x00000001 /* HC_REG_HRErr 0x000c */ #define HC_HAGPCMErr_MASK 0x80000000 #define HC_HAGPCMErrC_MASK 0x70000000 /* HC_REG_FIFOstatus 0x0010 */ #define HC_HRFIFOATall_MASK 0x80000000 #define HC_HRFIFOATbusy_MASK 0x40000000 #define HC_HRATFGMDo_MASK 0x00000100 #define HC_HRATFGMDi_MASK 0x00000080 #define HC_HRATFRZD_MASK 0x00000040 #define HC_HRATFRTXA_MASK 0x00000020 #define HC_HRATFRTXD_MASK 0x00000010 #define HC_HRATFWZD_MASK 0x00000008 #define HC_HRATFWCD_MASK 0x00000004 #define HC_HRATTXTAG_MASK 0x00000002 #define HC_HRATTXCH_MASK 0x00000001 /* AGP Command Setting */ #define HC_SubA_HAGPBstL 0x0060 #define HC_SubA_HAGPBendL 0x0061 #define HC_SubA_HAGPCMNT 0x0062 #define HC_SubA_HAGPBpL 0x0063 #define HC_SubA_HAGPBpH 0x0064 /* HC_SubA_HAGPCMNT 0x0062 */ #define HC_HAGPCMNT_MASK 0x00800000 #define HC_HCmdErrClr_MASK 0x00400000 #define HC_HAGPBendH_MASK 0x0000ff00 #define HC_HAGPBstH_MASK 0x000000ff #define HC_HAGPBendH_SHIFT 8 #define HC_HAGPBstH_SHIFT 0 /* HC_SubA_HAGPBpL 0x0063 */ #define HC_HAGPBpL_MASK 0x00fffffc #define HC_HAGPBpID_MASK 0x00000003 #define HC_HAGPBpID_PAUSE 0x00000000 #define HC_HAGPBpID_JUMP 0x00000001 #define HC_HAGPBpID_STOP 0x00000002 /* HC_SubA_HAGPBpH 0x0064 */ #define HC_HAGPBpH_MASK 0x00ffffff /* Miscellaneous Settings */ #define HC_SubA_HClipTB 0x0070 #define HC_SubA_HClipLR 0x0071 #define HC_SubA_HFPClipTL 0x0072 #define HC_SubA_HFPClipBL 0x0073 #define HC_SubA_HFPClipLL 0x0074 #define HC_SubA_HFPClipRL 0x0075 #define HC_SubA_HFPClipTBH 0x0076 #define HC_SubA_HFPClipLRH 0x0077 #define HC_SubA_HLP 0x0078 #define HC_SubA_HLPRF 0x0079 #define HC_SubA_HSolidCL 0x007a #define HC_SubA_HPixGC 0x007b #define HC_SubA_HSPXYOS 0x007c #define HC_SubA_HVertexCNT 0x007d #define HC_HClipT_MASK 0x00fff000 #define HC_HClipT_SHIFT 12 #define HC_HClipB_MASK 0x00000fff #define HC_HClipB_SHIFT 0 #define HC_HClipL_MASK 0x00fff000 #define HC_HClipL_SHIFT 12 #define HC_HClipR_MASK 0x00000fff #define HC_HClipR_SHIFT 0 #define HC_HFPClipBH_MASK 0x0000ff00 #define HC_HFPClipBH_SHIFT 8 #define HC_HFPClipTH_MASK 0x000000ff #define HC_HFPClipTH_SHIFT 0 #define HC_HFPClipRH_MASK 0x0000ff00 #define HC_HFPClipRH_SHIFT 8 #define HC_HFPClipLH_MASK 0x000000ff #define HC_HFPClipLH_SHIFT 0 #define HC_HSolidCH_MASK 0x000000ff #define HC_HPixGC_MASK 0x00800000 #define HC_HSPXOS_MASK 0x00fff000 #define HC_HSPXOS_SHIFT 12 #define HC_HSPYOS_MASK 0x00000fff /* Command * Command A */ #define HC_HCmdHeader_MASK 0xfe000000 /*0xffe00000*/ #define HC_HE3Fire_MASK 0x00100000 #define HC_HPMType_MASK 0x000f0000 #define HC_HEFlag_MASK 0x0000e000 #define HC_HShading_MASK 0x00001c00 #define HC_HPMValidN_MASK 0x00000200 #define HC_HPLEND_MASK 0x00000100 #define HC_HVCycle_MASK 0x000000ff #define HC_HVCycle_Style_MASK 0x000000c0 #define HC_HVCycle_ChgA_MASK 0x00000030 #define HC_HVCycle_ChgB_MASK 0x0000000c #define HC_HVCycle_ChgC_MASK 0x00000003 #define HC_HPMType_Point 0x00000000 #define HC_HPMType_Line 0x00010000 #define HC_HPMType_Tri 0x00020000 #define HC_HPMType_TriWF 0x00040000 #define HC_HEFlag_NoAA 0x00000000 #define HC_HEFlag_ab 0x00008000 #define HC_HEFlag_bc 0x00004000 #define HC_HEFlag_ca 0x00002000 #define HC_HShading_Solid 0x00000000 #define HC_HShading_FlatA 0x00000400 #define HC_HShading_FlatB 0x00000800 #define HC_HShading_FlatC 0x00000c00 #define HC_HShading_Gouraud 0x00001000 #define HC_HVCycle_Full 0x00000000 #define HC_HVCycle_AFP 0x00000040 #define HC_HVCycle_One 0x000000c0 #define HC_HVCycle_NewA 0x00000000 #define HC_HVCycle_AA 0x00000010 #define HC_HVCycle_AB 0x00000020 #define HC_HVCycle_AC 0x00000030 #define HC_HVCycle_NewB 0x00000000 #define HC_HVCycle_BA 0x00000004 #define HC_HVCycle_BB 0x00000008 #define HC_HVCycle_BC 0x0000000c #define HC_HVCycle_NewC 0x00000000 #define HC_HVCycle_CA 0x00000001 #define HC_HVCycle_CB 0x00000002 #define HC_HVCycle_CC 0x00000003 /* Command B */ #define HC_HLPrst_MASK 0x00010000 #define HC_HLLastP_MASK 0x00008000 #define HC_HVPMSK_MASK 0x00007f80 #define HC_HBFace_MASK 0x00000040 #define HC_H2nd1VT_MASK 0x0000003f #define HC_HVPMSK_X 0x00004000 #define HC_HVPMSK_Y 0x00002000 #define HC_HVPMSK_Z 0x00001000 #define HC_HVPMSK_W 0x00000800 #define HC_HVPMSK_Cd 0x00000400 #define HC_HVPMSK_Cs 0x00000200 #define HC_HVPMSK_S 0x00000100 #define HC_HVPMSK_T 0x00000080 /* Enable Setting */ #define HC_SubA_HEnable 0x0000 #define HC_HenTXEnvMap_MASK 0x00200000 /* environment mapping?? */ #define HC_HenVertexCNT_MASK 0x00100000 /* vertex counter?? */ #define HC_HenCPUDAZ_MASK 0x00080000 /* ???? */ #define HC_HenDASZWC_MASK 0x00040000 /* ???? */ #define HC_HenFBCull_MASK 0x00020000 /* culling? */ #define HC_HenCW_MASK 0x00010000 /* color write? */ #define HC_HenAA_MASK 0x00008000 /* anti aliasing??? */ #define HC_HenST_MASK 0x00004000 /* stencil?? */ #define HC_HenZT_MASK 0x00002000 /* z test?? */ #define HC_HenZW_MASK 0x00001000 /* z write?? */ #define HC_HenAT_MASK 0x00000800 /* alpha test?? */ #define HC_HenAW_MASK 0x00000400 /* alpha write?? */ #define HC_HenSP_MASK 0x00000200 /* specular?? */ #define HC_HenLP_MASK 0x00000100 /* ???? */ #define HC_HenTXCH_MASK 0x00000080 /* cache? half speed, right fonts */ #define HC_HenTXMP_MASK 0x00000040 /* texture mapping */ #define HC_HenTXPP_MASK 0x00000020 /* perspective correction?? */ #define HC_HenTXTR_MASK 0x00000010 /* ???? */ #define HC_HenCS_MASK 0x00000008 /* color space?? looks weird */ #define HC_HenFOG_MASK 0x00000004 /* obviously fogging */ #define HC_HenABL_MASK 0x00000002 /* alpha blending */ #define HC_HenDT_MASK 0x00000001 /* dithering */ /* Z Setting */ #define HC_SubA_HZWBBasL 0x0010 #define HC_SubA_HZWBBasH 0x0011 #define HC_SubA_HZWBType 0x0012 #define HC_SubA_HZBiasL 0x0013 #define HC_SubA_HZWBend 0x0014 #define HC_SubA_HZWTMD 0x0015 #define HC_SubA_HZWCDL 0x0016 #define HC_SubA_HZWCTAGnum 0x0017 #define HC_SubA_HZCYNum 0x0018 #define HC_SubA_HZWCFire 0x0019 /* HC_SubA_HZWBType */ #define HC_HZWBType_MASK 0x00800000 #define HC_HZBiasedWB_MASK 0x00400000 #define HC_HZONEasFF_MASK 0x00200000 #define HC_HZOONEasFF_MASK 0x00100000 #define HC_HZWBFM_MASK 0x00030000 #define HC_HZWBLoc_MASK 0x0000c000 #define HC_HZWBPit_MASK 0x00003fff #define HC_HZWBFM_16 0x00000000 #define HC_HZWBFM_32 0x00020000 #define HC_HZWBFM_24 0x00030000 #define HC_HZWBLoc_Local 0x00000000 #define HC_HZWBLoc_SyS 0x00004000 /* HC_SubA_HZWBend */ #define HC_HZWBend_MASK 0x00ffe000 #define HC_HZBiasH_MASK 0x000000ff #define HC_HZWBend_SHIFT 10 /* HC_SubA_HZWTMD */ #define HC_HZWTMD_MASK 0x00070000 #define HC_HEBEBias_MASK 0x00007f00 #define HC_HZNF_MASK 0x000000ff #define HC_HZWTMD_NeverPass 0x00000000 #define HC_HZWTMD_LT 0x00010000 #define HC_HZWTMD_EQ 0x00020000 #define HC_HZWTMD_LE 0x00030000 #define HC_HZWTMD_GT 0x00040000 #define HC_HZWTMD_NE 0x00050000 #define HC_HZWTMD_GE 0x00060000 #define HC_HZWTMD_AllPass 0x00070000 #define HC_HEBEBias_SHIFT 8 /* HC_SubA_HZWCDL 0x0016 */ #define HC_HZWCDL_MASK 0x00ffffff /* HC_SubA_HZWCTAGnum 0x0017 */ #define HC_HZWCTAGnum_MASK 0x00ff0000 #define HC_HZWCTAGnum_SHIFT 16 #define HC_HZWCDH_MASK 0x000000ff #define HC_HZWCDH_SHIFT 0 /* HC_SubA_HZCYNum 0x0018 */ #define HC_HZCYNum_MASK 0x00030000 #define HC_HZCYNum_SHIFT 16 #define HC_HZWCQWnum_MASK 0x00003fff #define HC_HZWCQWnum_SHIFT 0 /* HC_SubA_HZWCFire 0x0019 */ #define HC_ZWCFire_MASK 0x00010000 #define HC_HZWCQWnumLast_MASK 0x00003fff #define HC_HZWCQWnumLast_SHIFT 0 /* Stencil Setting */ #define HC_SubA_HSTREF 0x0023 #define HC_SubA_HSTMD 0x0024 /* HC_SubA_HSBFM */ #define HC_HSBFM_MASK 0x00030000 #define HC_HSBLoc_MASK 0x0000c000 #define HC_HSBPit_MASK 0x00003fff /* HC_SubA_HSTREF */ #define HC_HSTREF_MASK 0x00ff0000 #define HC_HSTOPMSK_MASK 0x0000ff00 #define HC_HSTBMSK_MASK 0x000000ff #define HC_HSTREF_SHIFT 16 #define HC_HSTOPMSK_SHIFT 8 /* HC_SubA_HSTMD */ #define HC_HSTMD_MASK 0x00070000 #define HC_HSTOPSF_MASK 0x000001c0 #define HC_HSTOPSPZF_MASK 0x00000038 #define HC_HSTOPSPZP_MASK 0x00000007 #define HC_HSTMD_NeverPass 0x00000000 #define HC_HSTMD_LT 0x00010000 #define HC_HSTMD_EQ 0x00020000 #define HC_HSTMD_LE 0x00030000 #define HC_HSTMD_GT 0x00040000 #define HC_HSTMD_NE 0x00050000 #define HC_HSTMD_GE 0x00060000 #define HC_HSTMD_AllPass 0x00070000 #define HC_HSTOPSF_KEEP 0x00000000 #define HC_HSTOPSF_ZERO 0x00000040 #define HC_HSTOPSF_REPLACE 0x00000080 #define HC_HSTOPSF_INCRSAT 0x000000c0 #define HC_HSTOPSF_DECRSAT 0x00000100 #define HC_HSTOPSF_INVERT 0x00000140 #define HC_HSTOPSF_INCR 0x00000180 #define HC_HSTOPSF_DECR 0x000001c0 #define HC_HSTOPSPZF_KEEP 0x00000000 #define HC_HSTOPSPZF_ZERO 0x00000008 #define HC_HSTOPSPZF_REPLACE 0x00000010 #define HC_HSTOPSPZF_INCRSAT 0x00000018 #define HC_HSTOPSPZF_DECRSAT 0x00000020 #define HC_HSTOPSPZF_INVERT 0x00000028 #define HC_HSTOPSPZF_INCR 0x00000030 #define HC_HSTOPSPZF_DECR 0x00000038 #define HC_HSTOPSPZP_KEEP 0x00000000 #define HC_HSTOPSPZP_ZERO 0x00000001 #define HC_HSTOPSPZP_REPLACE 0x00000002 #define HC_HSTOPSPZP_INCRSAT 0x00000003 #define HC_HSTOPSPZP_DECRSAT 0x00000004 #define HC_HSTOPSPZP_INVERT 0x00000005 #define HC_HSTOPSPZP_INCR 0x00000006 #define HC_HSTOPSPZP_DECR 0x00000007 /* Alpha Setting */ #define HC_SubA_HABBasL 0x0030 #define HC_SubA_HABBasH 0x0031 #define HC_SubA_HABFM 0x0032 #define HC_SubA_HATMD 0x0033 #define HC_SubA_HABLCsat 0x0034 #define HC_SubA_HABLCop 0x0035 #define HC_SubA_HABLAsat 0x0036 #define HC_SubA_HABLAop 0x0037 #define HC_SubA_HABLRCa 0x0038 #define HC_SubA_HABLRFCa 0x0039 #define HC_SubA_HABLRCbias 0x003a #define HC_SubA_HABLRCb 0x003b #define HC_SubA_HABLRFCb 0x003c #define HC_SubA_HABLRAa 0x003d #define HC_SubA_HABLRAb 0x003e /* HC_SubA_HABFM */ #define HC_HABFM_MASK 0x00030000 #define HC_HABLoc_MASK 0x0000c000 #define HC_HABPit_MASK 0x000007ff /* HC_SubA_HATMD */ #define HC_HATMD_MASK 0x00000700 #define HC_HATREF_MASK 0x000000ff #define HC_HATMD_NeverPass 0x00000000 #define HC_HATMD_LT 0x00000100 #define HC_HATMD_EQ 0x00000200 #define HC_HATMD_LE 0x00000300 #define HC_HATMD_GT 0x00000400 #define HC_HATMD_NE 0x00000500 #define HC_HATMD_GE 0x00000600 #define HC_HATMD_AllPass 0x00000700 /* HC_SubA_HABLCsat */ #define HC_HABLCsat_MASK 0x00010000 #define HC_HABLCa_MASK 0x0000fc00 #define HC_HABLCa_C_MASK 0x0000c000 #define HC_HABLCa_OPC_MASK 0x00003c00 #define HC_HABLFCa_MASK 0x000003f0 #define HC_HABLFCa_C_MASK 0x00000300 #define HC_HABLFCa_OPC_MASK 0x000000f0 #define HC_HABLCbias_MASK 0x0000000f #define HC_HABLCbias_C_MASK 0x00000008 #define HC_HABLCbias_OPC_MASK 0x00000007 /*-- Define the input color. */ #define HC_XC_Csrc 0x00000000 #define HC_XC_Cdst 0x00000001 #define HC_XC_Asrc 0x00000002 #define HC_XC_Adst 0x00000003 #define HC_XC_Fog 0x00000004 #define HC_XC_HABLRC 0x00000005 #define HC_XC_minSrcDst 0x00000006 #define HC_XC_maxSrcDst 0x00000007 #define HC_XC_mimAsrcInvAdst 0x00000008 #define HC_XC_OPC 0x00000000 #define HC_XC_InvOPC 0x00000010 #define HC_XC_OPCp5 0x00000020 /*-- Define the input Alpha */ #define HC_XA_OPA 0x00000000 #define HC_XA_InvOPA 0x00000010 #define HC_XA_OPAp5 0x00000020 #define HC_XA_0 0x00000000 #define HC_XA_Asrc 0x00000001 #define HC_XA_Adst 0x00000002 #define HC_XA_Fog 0x00000003 #define HC_XA_minAsrcFog 0x00000004 #define HC_XA_minAsrcAdst 0x00000005 #define HC_XA_maxAsrcFog 0x00000006 #define HC_XA_maxAsrcAdst 0x00000007 #define HC_XA_HABLRA 0x00000008 #define HC_XA_minAsrcInvAdst 0x00000008 #define HC_XA_HABLFRA 0x00000009 /*-- */ #define HC_HABLCa_OPC (HC_XC_OPC << 10) #define HC_HABLCa_InvOPC (HC_XC_InvOPC << 10) #define HC_HABLCa_OPCp5 (HC_XC_OPCp5 << 10) #define HC_HABLCa_Csrc (HC_XC_Csrc << 10) #define HC_HABLCa_Cdst (HC_XC_Cdst << 10) #define HC_HABLCa_Asrc (HC_XC_Asrc << 10) #define HC_HABLCa_Adst (HC_XC_Adst << 10) #define HC_HABLCa_Fog (HC_XC_Fog << 10) #define HC_HABLCa_HABLRCa (HC_XC_HABLRC << 10) #define HC_HABLCa_minSrcDst (HC_XC_minSrcDst << 10) #define HC_HABLCa_maxSrcDst (HC_XC_maxSrcDst << 10) #define HC_HABLFCa_OPC (HC_XC_OPC << 4) #define HC_HABLFCa_InvOPC (HC_XC_InvOPC << 4) #define HC_HABLFCa_OPCp5 (HC_XC_OPCp5 << 4) #define HC_HABLFCa_Csrc (HC_XC_Csrc << 4) #define HC_HABLFCa_Cdst (HC_XC_Cdst << 4) #define HC_HABLFCa_Asrc (HC_XC_Asrc << 4) #define HC_HABLFCa_Adst (HC_XC_Adst << 4) #define HC_HABLFCa_Fog (HC_XC_Fog << 4) #define HC_HABLFCa_HABLRCa (HC_XC_HABLRC << 4) #define HC_HABLFCa_minSrcDst (HC_XC_minSrcDst << 4) #define HC_HABLFCa_maxSrcDst (HC_XC_maxSrcDst << 4) #define HC_HABLFCa_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 4) #define HC_HABLCbias_HABLRCbias 0x00000000 #define HC_HABLCbias_Asrc 0x00000001 #define HC_HABLCbias_Adst 0x00000002 #define HC_HABLCbias_Fog 0x00000003 #define HC_HABLCbias_Cin 0x00000004 /* HC_SubA_HABLCop 0x0035 */ #define HC_HABLdot_MASK 0x00010000 #define HC_HABLCop_MASK 0x00004000 #define HC_HABLCb_MASK 0x00003f00 #define HC_HABLCb_C_MASK 0x00003000 #define HC_HABLCb_OPC_MASK 0x00000f00 #define HC_HABLFCb_MASK 0x000000fc #define HC_HABLFCb_C_MASK 0x000000c0 #define HC_HABLFCb_OPC_MASK 0x0000003c #define HC_HABLCshift_MASK 0x00000003 #define HC_HABLCb_OPC (HC_XC_OPC << 8) #define HC_HABLCb_InvOPC (HC_XC_InvOPC << 8) #define HC_HABLCb_OPCp5 (HC_XC_OPCp5 << 8) #define HC_HABLCb_Csrc (HC_XC_Csrc << 8) #define HC_HABLCb_Cdst (HC_XC_Cdst << 8) #define HC_HABLCb_Asrc (HC_XC_Asrc << 8) #define HC_HABLCb_Adst (HC_XC_Adst << 8) #define HC_HABLCb_Fog (HC_XC_Fog << 8) #define HC_HABLCb_HABLRCa (HC_XC_HABLRC << 8) #define HC_HABLCb_minSrcDst (HC_XC_minSrcDst << 8) #define HC_HABLCb_maxSrcDst (HC_XC_maxSrcDst << 8) #define HC_HABLFCb_OPC (HC_XC_OPC << 2) #define HC_HABLFCb_InvOPC (HC_XC_InvOPC << 2) #define HC_HABLFCb_OPCp5 (HC_XC_OPCp5 << 2) #define HC_HABLFCb_Csrc (HC_XC_Csrc << 2) #define HC_HABLFCb_Cdst (HC_XC_Cdst << 2) #define HC_HABLFCb_Asrc (HC_XC_Asrc << 2) #define HC_HABLFCb_Adst (HC_XC_Adst << 2) #define HC_HABLFCb_Fog (HC_XC_Fog << 2) #define HC_HABLFCb_HABLRCb (HC_XC_HABLRC << 2) #define HC_HABLFCb_minSrcDst (HC_XC_minSrcDst << 2) #define HC_HABLFCb_maxSrcDst (HC_XC_maxSrcDst << 2) #define HC_HABLFCb_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 2) /* HC_SubA_HABLAsat 0x0036 */ #define HC_HABLAsat_MASK 0x00010000 #define HC_HABLAa_MASK 0x0000fc00 #define HC_HABLAa_A_MASK 0x0000c000 #define HC_HABLAa_OPA_MASK 0x00003c00 #define HC_HABLFAa_MASK 0x000003f0 #define HC_HABLFAa_A_MASK 0x00000300 #define HC_HABLFAa_OPA_MASK 0x000000f0 #define HC_HABLAbias_MASK 0x0000000f #define HC_HABLAbias_A_MASK 0x00000008 #define HC_HABLAbias_OPA_MASK 0x00000007 #define HC_HABLAa_OPA (HC_XA_OPA << 10) #define HC_HABLAa_InvOPA (HC_XA_InvOPA << 10) #define HC_HABLAa_OPAp5 (HC_XA_OPAp5 << 10) #define HC_HABLAa_0 (HC_XA_0 << 10) #define HC_HABLAa_Asrc (HC_XA_Asrc << 10) #define HC_HABLAa_Adst (HC_XA_Adst << 10) #define HC_HABLAa_Fog (HC_XA_Fog << 10) #define HC_HABLAa_minAsrcFog (HC_XA_minAsrcFog << 10) #define HC_HABLAa_minAsrcAdst (HC_XA_minAsrcAdst << 10) #define HC_HABLAa_maxAsrcFog (HC_XA_maxAsrcFog << 10) #define HC_HABLAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 10) #define HC_HABLAa_HABLRA (HC_XA_HABLRA << 10) #define HC_HABLFAa_OPA (HC_XA_OPA << 4) #define HC_HABLFAa_InvOPA (HC_XA_InvOPA << 4) #define HC_HABLFAa_OPAp5 (HC_XA_OPAp5 << 4) #define HC_HABLFAa_0 (HC_XA_0 << 4) #define HC_HABLFAa_Asrc (HC_XA_Asrc << 4) #define HC_HABLFAa_Adst (HC_XA_Adst << 4) #define HC_HABLFAa_Fog (HC_XA_Fog << 4) #define HC_HABLFAa_minAsrcFog (HC_XA_minAsrcFog << 4) #define HC_HABLFAa_minAsrcAdst (HC_XA_minAsrcAdst << 4) #define HC_HABLFAa_maxAsrcFog (HC_XA_maxAsrcFog << 4) #define HC_HABLFAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 4) #define HC_HABLFAa_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 4) #define HC_HABLFAa_HABLFRA (HC_XA_HABLFRA << 4) #define HC_HABLAbias_HABLRAbias 0x00000000 #define HC_HABLAbias_Asrc 0x00000001 #define HC_HABLAbias_Adst 0x00000002 #define HC_HABLAbias_Fog 0x00000003 #define HC_HABLAbias_Aaa 0x00000004 /* HC_SubA_HABLAop 0x0037 */ #define HC_HABLAop_MASK 0x00004000 #define HC_HABLAb_MASK 0x00003f00 #define HC_HABLAb_OPA_MASK 0x00000f00 #define HC_HABLFAb_MASK 0x000000fc #define HC_HABLFAb_OPA_MASK 0x0000003c #define HC_HABLAshift_MASK 0x00000003 #define HC_HABLAb_OPA (HC_XA_OPA << 8) #define HC_HABLAb_InvOPA (HC_XA_InvOPA << 8) #define HC_HABLAb_OPAp5 (HC_XA_OPAp5 << 8) #define HC_HABLAb_0 (HC_XA_0 << 8) #define HC_HABLAb_Asrc (HC_XA_Asrc << 8) #define HC_HABLAb_Adst (HC_XA_Adst << 8) #define HC_HABLAb_Fog (HC_XA_Fog << 8) #define HC_HABLAb_minAsrcFog (HC_XA_minAsrcFog << 8) #define HC_HABLAb_minAsrcAdst (HC_XA_minAsrcAdst << 8) #define HC_HABLAb_maxAsrcFog (HC_XA_maxAsrcFog << 8) #define HC_HABLAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 8) #define HC_HABLAb_HABLRA (HC_XA_HABLRA << 8) #define HC_HABLFAb_OPA (HC_XA_OPA << 2) #define HC_HABLFAb_InvOPA (HC_XA_InvOPA << 2) #define HC_HABLFAb_OPAp5 (HC_XA_OPAp5 << 2) #define HC_HABLFAb_0 (HC_XA_0 << 2) #define HC_HABLFAb_Asrc (HC_XA_Asrc << 2) #define HC_HABLFAb_Adst (HC_XA_Adst << 2) #define HC_HABLFAb_Fog (HC_XA_Fog << 2) #define HC_HABLFAb_minAsrcFog (HC_XA_minAsrcFog << 2) #define HC_HABLFAb_minAsrcAdst (HC_XA_minAsrcAdst << 2) #define HC_HABLFAb_maxAsrcFog (HC_XA_maxAsrcFog << 2) #define HC_HABLFAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 2) #define HC_HABLFAb_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 2) #define HC_HABLFAb_HABLFRA (HC_XA_HABLFRA << 2) /* HC_SubA_HABLRAa 0x003d */ #define HC_HABLRAa_MASK 0x00ff0000 #define HC_HABLRFAa_MASK 0x0000ff00 #define HC_HABLRAbias_MASK 0x000000ff #define HC_HABLRAa_SHIFT 16 #define HC_HABLRFAa_SHIFT 8 /* HC_SubA_HABLRAb 0x003e */ #define HC_HABLRAb_MASK 0x0000ff00 #define HC_HABLRFAb_MASK 0x000000ff #define HC_HABLRAb_SHIFT 8 /* Destination Setting */ #define HC_SubA_HDBBasL 0x0040 #define HC_SubA_HDBBasH 0x0041 #define HC_SubA_HDBFM 0x0042 #define HC_SubA_HFBBMSKL 0x0043 #define HC_SubA_HROP 0x0044 /* HC_SubA_HDBFM 0x0042 */ #define HC_HDBFM_MASK 0x001f0000 #define HC_HDBLoc_MASK 0x0000c000 #define HC_HDBPit_MASK 0x00003fff #define HC_HDBFM_RGB555 0x00000000 #define HC_HDBFM_RGB565 0x00010000 #define HC_HDBFM_ARGB4444 0x00020000 #define HC_HDBFM_ARGB1555 0x00030000 #define HC_HDBFM_BGR555 0x00040000 #define HC_HDBFM_BGR565 0x00050000 #define HC_HDBFM_ABGR4444 0x00060000 #define HC_HDBFM_ABGR1555 0x00070000 #define HC_HDBFM_ARGB0888 0x00080000 #define HC_HDBFM_ARGB8888 0x00090000 #define HC_HDBFM_ABGR0888 0x000a0000 #define HC_HDBFM_ABGR8888 0x000b0000 #define HC_HDBLoc_Local 0x00000000 #define HC_HDBLoc_Sys 0x00004000 /* HC_SubA_HROP 0x0044 */ #define HC_HROP_MASK 0x00000f00 #define HC_HFBBMSKH_MASK 0x000000ff #define HC_HROP_BLACK 0x00000000 #define HC_HROP_DPon 0x00000100 #define HC_HROP_DPna 0x00000200 #define HC_HROP_Pn 0x00000300 #define HC_HROP_PDna 0x00000400 #define HC_HROP_Dn 0x00000500 #define HC_HROP_DPx 0x00000600 #define HC_HROP_DPan 0x00000700 #define HC_HROP_DPa 0x00000800 #define HC_HROP_DPxn 0x00000900 #define HC_HROP_D 0x00000a00 #define HC_HROP_DPno 0x00000b00 #define HC_HROP_P 0x00000c00 #define HC_HROP_PDno 0x00000d00 #define HC_HROP_DPo 0x00000e00 #define HC_HROP_WHITE 0x00000f00 /* Fog Setting */ #define HC_SubA_HFogLF 0x0050 #define HC_SubA_HFogCL 0x0051 #define HC_SubA_HFogCH 0x0052 #define HC_SubA_HFogStL 0x0053 #define HC_SubA_HFogStH 0x0054 #define HC_SubA_HFogOOdMF 0x0055 #define HC_SubA_HFogOOdEF 0x0056 #define HC_SubA_HFogEndL 0x0057 #define HC_SubA_HFogDenst 0x0058 /* HC_SubA_FogLF 0x0050 */ #define HC_FogLF_MASK 0x00000010 #define HC_FogEq_MASK 0x00000008 #define HC_FogMD_MASK 0x00000007 #define HC_FogMD_LocalFog 0x00000000 #define HC_FogMD_LinearFog 0x00000002 #define HC_FogMD_ExponentialFog 0x00000004 #define HC_FogMD_Exponential2Fog 0x00000005 /* #define HC_FogMD_FogTable 0x00000003 */ /* HC_SubA_HFogDenst 0x0058 */ #define HC_FogDenst_MASK 0x001fff00 #define HC_FogEndL_MASK 0x000000ff /* Texture subtype definitions */ #define HC_SubType_Tex0 0x00000000 #define HC_SubType_Tex1 0x00000001 #define HC_SubType_TexGeneral 0x000000fe /* Attribute of texture n */ #define HC_SubA_HTXnL0BasL 0x0000 #define HC_SubA_HTXnL1BasL 0x0001 #define HC_SubA_HTXnL2BasL 0x0002 #define HC_SubA_HTXnL3BasL 0x0003 #define HC_SubA_HTXnL4BasL 0x0004 #define HC_SubA_HTXnL5BasL 0x0005 #define HC_SubA_HTXnL6BasL 0x0006 #define HC_SubA_HTXnL7BasL 0x0007 #define HC_SubA_HTXnL8BasL 0x0008 #define HC_SubA_HTXnL9BasL 0x0009 #define HC_SubA_HTXnLaBasL 0x000a #define HC_SubA_HTXnLbBasL 0x000b #define HC_SubA_HTXnLcBasL 0x000c #define HC_SubA_HTXnLdBasL 0x000d #define HC_SubA_HTXnLeBasL 0x000e #define HC_SubA_HTXnLfBasL 0x000f #define HC_SubA_HTXnL10BasL 0x0010 #define HC_SubA_HTXnL11BasL 0x0011 #define HC_SubA_HTXnL012BasH 0x0020 #define HC_SubA_HTXnL345BasH 0x0021 #define HC_SubA_HTXnL678BasH 0x0022 #define HC_SubA_HTXnL9abBasH 0x0023 #define HC_SubA_HTXnLcdeBasH 0x0024 #define HC_SubA_HTXnLf1011BasH 0x0025 #define HC_SubA_HTXnL0Pit 0x002b #define HC_SubA_HTXnL1Pit 0x002c #define HC_SubA_HTXnL2Pit 0x002d #define HC_SubA_HTXnL3Pit 0x002e #define HC_SubA_HTXnL4Pit 0x002f #define HC_SubA_HTXnL5Pit 0x0030 #define HC_SubA_HTXnL6Pit 0x0031 #define HC_SubA_HTXnL7Pit 0x0032 #define HC_SubA_HTXnL8Pit 0x0033 #define HC_SubA_HTXnL9Pit 0x0034 #define HC_SubA_HTXnLaPit 0x0035 #define HC_SubA_HTXnLbPit 0x0036 #define HC_SubA_HTXnLcPit 0x0037 #define HC_SubA_HTXnLdPit 0x0038 #define HC_SubA_HTXnLePit 0x0039 #define HC_SubA_HTXnLfPit 0x003a #define HC_SubA_HTXnL10Pit 0x003b #define HC_SubA_HTXnL11Pit 0x003c #define HC_SubA_HTXnL0_5WE 0x004b #define HC_SubA_HTXnL6_bWE 0x004c #define HC_SubA_HTXnLc_11WE 0x004d #define HC_SubA_HTXnL0_5HE 0x0051 #define HC_SubA_HTXnL6_bHE 0x0052 #define HC_SubA_HTXnLc_11HE 0x0053 #define HC_SubA_HTXnL0OS 0x0077 #define HC_SubA_HTXnTB 0x0078 #define HC_SubA_HTXnMPMD 0x0079 #define HC_SubA_HTXnCLODu 0x007a #define HC_SubA_HTXnFM 0x007b #define HC_SubA_HTXnTRCH 0x007c #define HC_SubA_HTXnTRCL 0x007d #define HC_SubA_HTXnTBC 0x007e #define HC_SubA_HTXnTRAH 0x007f #define HC_SubA_HTXnTBLCsat 0x0080 #define HC_SubA_HTXnTBLCop 0x0081 #define HC_SubA_HTXnTBLMPfog 0x0082 #define HC_SubA_HTXnTBLAsat 0x0083 #define HC_SubA_HTXnTBLRCa 0x0085 #define HC_SubA_HTXnTBLRCb 0x0086 #define HC_SubA_HTXnTBLRCc 0x0087 #define HC_SubA_HTXnTBLRCbias 0x0088 #define HC_SubA_HTXnTBLRAa 0x0089 #define HC_SubA_HTXnTBLRFog 0x008a #define HC_SubA_HTXnBumpM00 0x0090 #define HC_SubA_HTXnBumpM01 0x0091 #define HC_SubA_HTXnBumpM10 0x0092 #define HC_SubA_HTXnBumpM11 0x0093 #define HC_SubA_HTXnLScale 0x0094 #define HC_SubA_HTXSMD 0x0000 /* HC_SubA_HTXnL012BasH 0x0020 */ #define HC_HTXnL0BasH_MASK 0x000000ff #define HC_HTXnL1BasH_MASK 0x0000ff00 #define HC_HTXnL2BasH_MASK 0x00ff0000 #define HC_HTXnL1BasH_SHIFT 8 #define HC_HTXnL2BasH_SHIFT 16 /* HC_SubA_HTXnL345BasH 0x0021 */ #define HC_HTXnL3BasH_MASK 0x000000ff #define HC_HTXnL4BasH_MASK 0x0000ff00 #define HC_HTXnL5BasH_MASK 0x00ff0000 #define HC_HTXnL4BasH_SHIFT 8 #define HC_HTXnL5BasH_SHIFT 16 /* HC_SubA_HTXnL678BasH 0x0022 */ #define HC_HTXnL6BasH_MASK 0x000000ff #define HC_HTXnL7BasH_MASK 0x0000ff00 #define HC_HTXnL8BasH_MASK 0x00ff0000 #define HC_HTXnL7BasH_SHIFT 8 #define HC_HTXnL8BasH_SHIFT 16 /* HC_SubA_HTXnL9abBasH 0x0023 */ #define HC_HTXnL9BasH_MASK 0x000000ff #define HC_HTXnLaBasH_MASK 0x0000ff00 #define HC_HTXnLbBasH_MASK 0x00ff0000 #define HC_HTXnLaBasH_SHIFT 8 #define HC_HTXnLbBasH_SHIFT 16 /* HC_SubA_HTXnLcdeBasH 0x0024 */ #define HC_HTXnLcBasH_MASK 0x000000ff #define HC_HTXnLdBasH_MASK 0x0000ff00 #define HC_HTXnLeBasH_MASK 0x00ff0000 #define HC_HTXnLdBasH_SHIFT 8 #define HC_HTXnLeBasH_SHIFT 16 /* HC_SubA_HTXnLcdeBasH 0x0025 */ #define HC_HTXnLfBasH_MASK 0x000000ff #define HC_HTXnL10BasH_MASK 0x0000ff00 #define HC_HTXnL11BasH_MASK 0x00ff0000 #define HC_HTXnL10BasH_SHIFT 8 #define HC_HTXnL11BasH_SHIFT 16 /* HC_SubA_HTXnL0Pit 0x002b */ #define HC_HTXnLnPit_MASK 0x00003fff #define HC_HTXnEnPit_MASK 0x00080000 #define HC_HTXnLnPitE_MASK 0x00f00000 #define HC_HTXnLnPitE_SHIFT 20 /* HC_SubA_HTXnL0_5WE 0x004b */ #define HC_HTXnL0WE_MASK 0x0000000f #define HC_HTXnL1WE_MASK 0x000000f0 #define HC_HTXnL2WE_MASK 0x00000f00 #define HC_HTXnL3WE_MASK 0x0000f000 #define HC_HTXnL4WE_MASK 0x000f0000 #define HC_HTXnL5WE_MASK 0x00f00000 #define HC_HTXnL1WE_SHIFT 4 #define HC_HTXnL2WE_SHIFT 8 #define HC_HTXnL3WE_SHIFT 12 #define HC_HTXnL4WE_SHIFT 16 #define HC_HTXnL5WE_SHIFT 20 /* HC_SubA_HTXnL6_bWE 0x004c */ #define HC_HTXnL6WE_MASK 0x0000000f #define HC_HTXnL7WE_MASK 0x000000f0 #define HC_HTXnL8WE_MASK 0x00000f00 #define HC_HTXnL9WE_MASK 0x0000f000 #define HC_HTXnLaWE_MASK 0x000f0000 #define HC_HTXnLbWE_MASK 0x00f00000 #define HC_HTXnL7WE_SHIFT 4 #define HC_HTXnL8WE_SHIFT 8 #define HC_HTXnL9WE_SHIFT 12 #define HC_HTXnLaWE_SHIFT 16 #define HC_HTXnLbWE_SHIFT 20 /* HC_SubA_HTXnLc_11WE 0x004d */ #define HC_HTXnLcWE_MASK 0x0000000f #define HC_HTXnLdWE_MASK 0x000000f0 #define HC_HTXnLeWE_MASK 0x00000f00 #define HC_HTXnLfWE_MASK 0x0000f000 #define HC_HTXnL10WE_MASK 0x000f0000 #define HC_HTXnL11WE_MASK 0x00f00000 #define HC_HTXnLdWE_SHIFT 4 #define HC_HTXnLeWE_SHIFT 8 #define HC_HTXnLfWE_SHIFT 12 #define HC_HTXnL10WE_SHIFT 16 #define HC_HTXnL11WE_SHIFT 20 /* HC_SubA_HTXnL0_5HE 0x0051 */ #define HC_HTXnL0HE_MASK 0x0000000f #define HC_HTXnL1HE_MASK 0x000000f0 #define HC_HTXnL2HE_MASK 0x00000f00 #define HC_HTXnL3HE_MASK 0x0000f000 #define HC_HTXnL4HE_MASK 0x000f0000 #define HC_HTXnL5HE_MASK 0x00f00000 #define HC_HTXnL1HE_SHIFT 4 #define HC_HTXnL2HE_SHIFT 8 #define HC_HTXnL3HE_SHIFT 12 #define HC_HTXnL4HE_SHIFT 16 #define HC_HTXnL5HE_SHIFT 20 /* HC_SubA_HTXnL6_bHE 0x0052 */ #define HC_HTXnL6HE_MASK 0x0000000f #define HC_HTXnL7HE_MASK 0x000000f0 #define HC_HTXnL8HE_MASK 0x00000f00 #define HC_HTXnL9HE_MASK 0x0000f000 #define HC_HTXnLaHE_MASK 0x000f0000 #define HC_HTXnLbHE_MASK 0x00f00000 #define HC_HTXnL7HE_SHIFT 4 #define HC_HTXnL8HE_SHIFT 8 #define HC_HTXnL9HE_SHIFT 12 #define HC_HTXnLaHE_SHIFT 16 #define HC_HTXnLbHE_SHIFT 20 /* HC_SubA_HTXnLc_11HE 0x0053 */ #define HC_HTXnLcHE_MASK 0x0000000f #define HC_HTXnLdHE_MASK 0x000000f0 #define HC_HTXnLeHE_MASK 0x00000f00 #define HC_HTXnLfHE_MASK 0x0000f000 #define HC_HTXnL10HE_MASK 0x000f0000 #define HC_HTXnL11HE_MASK 0x00f00000 #define HC_HTXnLdHE_SHIFT 4 #define HC_HTXnLeHE_SHIFT 8 #define HC_HTXnLfHE_SHIFT 12 #define HC_HTXnL10HE_SHIFT 16 #define HC_HTXnL11HE_SHIFT 20 /* HC_SubA_HTXnL0OS 0x0077 */ #define HC_HTXnL0OS_MASK 0x003ff000 #define HC_HTXnLVmax_MASK 0x00000fc0 #define HC_HTXnLVmin_MASK 0x0000003f #define HC_HTXnL0OS_SHIFT 12 #define HC_HTXnLVmax_SHIFT 6 /* HC_SubA_HTXnTB 0x0078 */ #define HC_HTXnTB_MASK 0x00f00000 #define HC_HTXnFLSe_MASK 0x0000e000 #define HC_HTXnFLSs_MASK 0x00001c00 #define HC_HTXnFLTe_MASK 0x00000380 #define HC_HTXnFLTs_MASK 0x00000070 #define HC_HTXnFLDs_MASK 0x0000000f #define HC_HTXnTB_NoTB 0x00000000 #define HC_HTXnTB_TBC_S 0x00100000 #define HC_HTXnTB_TBC_T 0x00200000 #define HC_HTXnTB_TB_S 0x00400000 #define HC_HTXnTB_TB_T 0x00800000 #define HC_HTXnFLSe_Nearest 0x00000000 #define HC_HTXnFLSe_Linear 0x00002000 #define HC_HTXnFLSe_NonLinear 0x00004000 #define HC_HTXnFLSe_Sharp 0x00008000 #define HC_HTXnFLSe_Flat_Gaussian_Cubic 0x0000c000 #define HC_HTXnFLSs_Nearest 0x00000000 #define HC_HTXnFLSs_Linear 0x00000400 #define HC_HTXnFLSs_NonLinear 0x00000800 #define HC_HTXnFLSs_Flat_Gaussian_Cubic 0x00001800 #define HC_HTXnFLTe_Nearest 0x00000000 #define HC_HTXnFLTe_Linear 0x00000080 #define HC_HTXnFLTe_NonLinear 0x00000100 #define HC_HTXnFLTe_Sharp 0x00000180 #define HC_HTXnFLTe_Flat_Gaussian_Cubic 0x00000300 #define HC_HTXnFLTs_Nearest 0x00000000 #define HC_HTXnFLTs_Linear 0x00000010 #define HC_HTXnFLTs_NonLinear 0x00000020 #define HC_HTXnFLTs_Flat_Gaussian_Cubic 0x00000060 #define HC_HTXnFLDs_Tex0 0x00000000 #define HC_HTXnFLDs_Nearest 0x00000001 #define HC_HTXnFLDs_Linear 0x00000002 #define HC_HTXnFLDs_NonLinear 0x00000003 #define HC_HTXnFLDs_Dither 0x00000004 #define HC_HTXnFLDs_ConstLOD 0x00000005 #define HC_HTXnFLDs_Ani 0x00000006 #define HC_HTXnFLDs_AniDither 0x00000007 /* HC_SubA_HTXnMPMD 0x0079 */ #define HC_HTXnMPMD_SMASK 0x00070000 #define HC_HTXnMPMD_TMASK 0x00380000 #define HC_HTXnLODDTf_MASK 0x00000007 #define HC_HTXnXY2ST_MASK 0x00000008 #define HC_HTXnMPMD_Tsingle 0x00000000 #define HC_HTXnMPMD_Tclamp 0x00080000 #define HC_HTXnMPMD_Trepeat 0x00100000 #define HC_HTXnMPMD_Tmirror 0x00180000 #define HC_HTXnMPMD_Twrap 0x00200000 #define HC_HTXnMPMD_Ssingle 0x00000000 #define HC_HTXnMPMD_Sclamp 0x00010000 #define HC_HTXnMPMD_Srepeat 0x00020000 #define HC_HTXnMPMD_Smirror 0x00030000 #define HC_HTXnMPMD_Swrap 0x00040000 /* HC_SubA_HTXnCLODu 0x007a */ #define HC_HTXnCLODu_MASK 0x000ffc00 #define HC_HTXnCLODd_MASK 0x000003ff #define HC_HTXnCLODu_SHIFT 10 /* HC_SubA_HTXnFM 0x007b */ #define HC_HTXnFM_MASK 0x00ff0000 #define HC_HTXnLoc_MASK 0x00000003 #define HC_HTXnFM_INDEX 0x00000000 #define HC_HTXnFM_Intensity 0x00080000 #define HC_HTXnFM_Lum 0x00100000 #define HC_HTXnFM_Alpha 0x00180000 #define HC_HTXnFM_DX 0x00280000 #define HC_HTXnFM_ARGB16 0x00880000 #define HC_HTXnFM_ARGB32 0x00980000 #define HC_HTXnFM_ABGR16 0x00a80000 #define HC_HTXnFM_ABGR32 0x00b80000 #define HC_HTXnFM_RGBA16 0x00c80000 #define HC_HTXnFM_RGBA32 0x00d80000 #define HC_HTXnFM_BGRA16 0x00e80000 #define HC_HTXnFM_BGRA32 0x00f80000 #define HC_HTXnFM_BUMPMAP 0x00380000 #define HC_HTXnFM_Index1 (HC_HTXnFM_INDEX | 0x00000000) #define HC_HTXnFM_Index2 (HC_HTXnFM_INDEX | 0x00010000) #define HC_HTXnFM_Index4 (HC_HTXnFM_INDEX | 0x00020000) #define HC_HTXnFM_Index8 (HC_HTXnFM_INDEX | 0x00030000) #define HC_HTXnFM_T1 (HC_HTXnFM_Intensity | 0x00000000) #define HC_HTXnFM_T2 (HC_HTXnFM_Intensity | 0x00010000) #define HC_HTXnFM_T4 (HC_HTXnFM_Intensity | 0x00020000) #define HC_HTXnFM_T8 (HC_HTXnFM_Intensity | 0x00030000) #define HC_HTXnFM_L1 (HC_HTXnFM_Lum | 0x00000000) #define HC_HTXnFM_L2 (HC_HTXnFM_Lum | 0x00010000) #define HC_HTXnFM_L4 (HC_HTXnFM_Lum | 0x00020000) #define HC_HTXnFM_L8 (HC_HTXnFM_Lum | 0x00030000) #define HC_HTXnFM_AL44 (HC_HTXnFM_Lum | 0x00040000) #define HC_HTXnFM_AL88 (HC_HTXnFM_Lum | 0x00050000) #define HC_HTXnFM_A1 (HC_HTXnFM_Alpha | 0x00000000) #define HC_HTXnFM_A2 (HC_HTXnFM_Alpha | 0x00010000) #define HC_HTXnFM_A4 (HC_HTXnFM_Alpha | 0x00020000) #define HC_HTXnFM_A8 (HC_HTXnFM_Alpha | 0x00030000) #define HC_HTXnFM_DX1 (HC_HTXnFM_DX | 0x00010000) #define HC_HTXnFM_DX23 (HC_HTXnFM_DX | 0x00020000) #define HC_HTXnFM_DX45 (HC_HTXnFM_DX | 0x00030000) #define HC_HTXnFM_RGB555 (HC_HTXnFM_ARGB16 | 0x00000000) #define HC_HTXnFM_RGB565 (HC_HTXnFM_ARGB16 | 0x00010000) #define HC_HTXnFM_ARGB1555 (HC_HTXnFM_ARGB16 | 0x00020000) #define HC_HTXnFM_ARGB4444 (HC_HTXnFM_ARGB16 | 0x00030000) #define HC_HTXnFM_ARGB0888 (HC_HTXnFM_ARGB32 | 0x00000000) #define HC_HTXnFM_ARGB8888 (HC_HTXnFM_ARGB32 | 0x00010000) #define HC_HTXnFM_BGR555 (HC_HTXnFM_ABGR16 | 0x00000000) #define HC_HTXnFM_BGR565 (HC_HTXnFM_ABGR16 | 0x00010000) #define HC_HTXnFM_ABGR1555 (HC_HTXnFM_ABGR16 | 0x00020000) #define HC_HTXnFM_ABGR4444 (HC_HTXnFM_ABGR16 | 0x00030000) #define HC_HTXnFM_ABGR0888 (HC_HTXnFM_ABGR32 | 0x00000000) #define HC_HTXnFM_ABGR8888 (HC_HTXnFM_ABGR32 | 0x00010000) #define HC_HTXnFM_RGBA5550 (HC_HTXnFM_RGBA16 | 0x00000000) #define HC_HTXnFM_RGBA5551 (HC_HTXnFM_RGBA16 | 0x00020000) #define HC_HTXnFM_RGBA4444 (HC_HTXnFM_RGBA16 | 0x00030000) #define HC_HTXnFM_RGBA8880 (HC_HTXnFM_RGBA32 | 0x00000000) #define HC_HTXnFM_RGBA8888 (HC_HTXnFM_RGBA32 | 0x00010000) #define HC_HTXnFM_BGRA5550 (HC_HTXnFM_BGRA16 | 0x00000000) #define HC_HTXnFM_BGRA5551 (HC_HTXnFM_BGRA16 | 0x00020000) #define HC_HTXnFM_BGRA4444 (HC_HTXnFM_BGRA16 | 0x00030000) #define HC_HTXnFM_BGRA8880 (HC_HTXnFM_BGRA32 | 0x00000000) #define HC_HTXnFM_BGRA8888 (HC_HTXnFM_BGRA32 | 0x00010000) #define HC_HTXnFM_VU88 (HC_HTXnFM_BUMPMAP | 0x00000000) #define HC_HTXnFM_LVU655 (HC_HTXnFM_BUMPMAP | 0x00010000) #define HC_HTXnFM_LVU888 (HC_HTXnFM_BUMPMAP | 0x00020000) #define HC_HTXnLoc_Local 0x00000000 #define HC_HTXnLoc_Sys 0x00000002 #define HC_HTXnLoc_AGP 0x00000003 /* HC_SubA_HTXnTRAH 0x007f */ #define HC_HTXnTRAH_MASK 0x00ff0000 #define HC_HTXnTRAL_MASK 0x0000ff00 #define HC_HTXnTBA_MASK 0x000000ff #define HC_HTXnTRAH_SHIFT 16 #define HC_HTXnTRAL_SHIFT 8 /* HC_SubA_HTXnTBLCsat 0x0080 *-- Define the input texture. */ #define HC_XTC_TOPC 0x00000000 #define HC_XTC_InvTOPC 0x00000010 #define HC_XTC_TOPCp5 0x00000020 #define HC_XTC_Cbias 0x00000000 #define HC_XTC_InvCbias 0x00000010 #define HC_XTC_0 0x00000000 #define HC_XTC_Dif 0x00000001 #define HC_XTC_Spec 0x00000002 #define HC_XTC_Tex 0x00000003 #define HC_XTC_Cur 0x00000004 #define HC_XTC_Adif 0x00000005 #define HC_XTC_Fog 0x00000006 #define HC_XTC_Atex 0x00000007 #define HC_XTC_Acur 0x00000008 #define HC_XTC_HTXnTBLRC 0x00000009 #define HC_XTC_Ctexnext 0x0000000a /*-- */ #define HC_HTXnTBLCsat_MASK 0x00800000 #define HC_HTXnTBLCa_MASK 0x000fc000 #define HC_HTXnTBLCb_MASK 0x00001f80 #define HC_HTXnTBLCc_MASK 0x0000003f #define HC_HTXnTBLCa_TOPC (HC_XTC_TOPC << 14) #define HC_HTXnTBLCa_InvTOPC (HC_XTC_InvTOPC << 14) #define HC_HTXnTBLCa_TOPCp5 (HC_XTC_TOPCp5 << 14) #define HC_HTXnTBLCa_0 (HC_XTC_0 << 14) #define HC_HTXnTBLCa_Dif (HC_XTC_Dif << 14) #define HC_HTXnTBLCa_Spec (HC_XTC_Spec << 14) #define HC_HTXnTBLCa_Tex (HC_XTC_Tex << 14) #define HC_HTXnTBLCa_Cur (HC_XTC_Cur << 14) #define HC_HTXnTBLCa_Adif (HC_XTC_Adif << 14) #define HC_HTXnTBLCa_Fog (HC_XTC_Fog << 14) #define HC_HTXnTBLCa_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCa_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCa_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) #define HC_HTXnTBLCa_Ctexnext (HC_XTC_Ctexnext << 14) #define HC_HTXnTBLCb_TOPC (HC_XTC_TOPC << 7) #define HC_HTXnTBLCb_InvTOPC (HC_XTC_InvTOPC << 7) #define HC_HTXnTBLCb_TOPCp5 (HC_XTC_TOPCp5 << 7) #define HC_HTXnTBLCb_0 (HC_XTC_0 << 7) #define HC_HTXnTBLCb_Dif (HC_XTC_Dif << 7) #define HC_HTXnTBLCb_Spec (HC_XTC_Spec << 7) #define HC_HTXnTBLCb_Tex (HC_XTC_Tex << 7) #define HC_HTXnTBLCb_Cur (HC_XTC_Cur << 7) #define HC_HTXnTBLCb_Adif (HC_XTC_Adif << 7) #define HC_HTXnTBLCb_Fog (HC_XTC_Fog << 7) #define HC_HTXnTBLCb_Atex (HC_XTC_Atex << 7) #define HC_HTXnTBLCb_Acur (HC_XTC_Acur << 7) #define HC_HTXnTBLCb_HTXnTBLRC (HC_XTC_HTXnTBLRC << 7) #define HC_HTXnTBLCb_Ctexnext (HC_XTC_Ctexnext << 7) #define HC_HTXnTBLCc_TOPC (HC_XTC_TOPC << 0) #define HC_HTXnTBLCc_InvTOPC (HC_XTC_InvTOPC << 0) #define HC_HTXnTBLCc_TOPCp5 (HC_XTC_TOPCp5 << 0) #define HC_HTXnTBLCc_0 (HC_XTC_0 << 0) #define HC_HTXnTBLCc_Dif (HC_XTC_Dif << 0) #define HC_HTXnTBLCc_Spec (HC_XTC_Spec << 0) #define HC_HTXnTBLCc_Tex (HC_XTC_Tex << 0) #define HC_HTXnTBLCc_Cur (HC_XTC_Cur << 0) #define HC_HTXnTBLCc_Adif (HC_XTC_Adif << 0) #define HC_HTXnTBLCc_Fog (HC_XTC_Fog << 0) #define HC_HTXnTBLCc_Atex (HC_XTC_Atex << 0) #define HC_HTXnTBLCc_Acur (HC_XTC_Acur << 0) #define HC_HTXnTBLCc_HTXnTBLRC (HC_XTC_HTXnTBLRC << 0) #define HC_HTXnTBLCc_Ctexnext (HC_XTC_Ctexnext << 0) /* HC_SubA_HTXnTBLCop 0x0081 */ #define HC_HTXnTBLdot_MASK 0x00c00000 #define HC_HTXnTBLCop_MASK 0x00380000 #define HC_HTXnTBLCbias_MASK 0x0007c000 #define HC_HTXnTBLCshift_MASK 0x00001800 #define HC_HTXnTBLAop_MASK 0x00000380 #define HC_HTXnTBLAbias_MASK 0x00000078 #define HC_HTXnTBLAshift_MASK 0x00000003 #define HC_HTXnTBLCop_Add 0x00000000 #define HC_HTXnTBLCop_Sub 0x00080000 #define HC_HTXnTBLCop_Min 0x00100000 #define HC_HTXnTBLCop_Max 0x00180000 #define HC_HTXnTBLCop_Mask 0x00200000 #define HC_HTXnTBLCbias_Cbias (HC_XTC_Cbias << 14) #define HC_HTXnTBLCbias_InvCbias (HC_XTC_InvCbias << 14) #define HC_HTXnTBLCbias_0 (HC_XTC_0 << 14) #define HC_HTXnTBLCbias_Dif (HC_XTC_Dif << 14) #define HC_HTXnTBLCbias_Spec (HC_XTC_Spec << 14) #define HC_HTXnTBLCbias_Tex (HC_XTC_Tex << 14) #define HC_HTXnTBLCbias_Cur (HC_XTC_Cur << 14) #define HC_HTXnTBLCbias_Adif (HC_XTC_Adif << 14) #define HC_HTXnTBLCbias_Fog (HC_XTC_Fog << 14) #define HC_HTXnTBLCbias_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCbias_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCbias_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) #define HC_HTXnTBLCshift_1 0x00000000 #define HC_HTXnTBLCshift_2 0x00000800 #define HC_HTXnTBLCshift_No 0x00001000 #define HC_HTXnTBLCshift_DotP 0x00001800 #define HC_HTXnTBLAop_Add 0x00000000 #define HC_HTXnTBLAop_Sub 0x00000080 #define HC_HTXnTBLAop_Min 0x00000100 #define HC_HTXnTBLAop_Max 0x00000180 #define HC_HTXnTBLAop_Mask 0x00000200 #define HC_HTXnTBLAbias_Inv 0x00000040 #define HC_HTXnTBLAbias_Adif 0x00000000 #define HC_HTXnTBLAbias_Fog 0x00000008 #define HC_HTXnTBLAbias_Acur 0x00000010 #define HC_HTXnTBLAbias_HTXnTBLRAbias 0x00000018 #define HC_HTXnTBLAbias_Atex 0x00000020 #define HC_HTXnTBLAshift_1 0x00000000 #define HC_HTXnTBLAshift_2 0x00000001 #define HC_HTXnTBLAshift_No 0x00000002 /* #define HC_HTXnTBLAshift_DotP 0x00000003 */ /* HC_SubA_HTXnTBLMPFog 0x0082 */ #define HC_HTXnTBLMPfog_MASK 0x00e00000 #define HC_HTXnTBLMPfog_0 0x00000000 #define HC_HTXnTBLMPfog_Adif 0x00200000 #define HC_HTXnTBLMPfog_Fog 0x00400000 #define HC_HTXnTBLMPfog_Atex 0x00600000 #define HC_HTXnTBLMPfog_Acur 0x00800000 #define HC_HTXnTBLMPfog_GHTXnTBLRFog 0x00a00000 /* HC_SubA_HTXnTBLAsat 0x0083 *-- Define the texture alpha input. */ #define HC_XTA_TOPA 0x00000000 #define HC_XTA_InvTOPA 0x00000008 #define HC_XTA_TOPAp5 0x00000010 #define HC_XTA_Adif 0x00000000 #define HC_XTA_Fog 0x00000001 #define HC_XTA_Acur 0x00000002 #define HC_XTA_HTXnTBLRA 0x00000003 #define HC_XTA_Atex 0x00000004 #define HC_XTA_Atexnext 0x00000005 /*-- */ #define HC_HTXnTBLAsat_MASK 0x00800000 #define HC_HTXnTBLAMB_MASK 0x00700000 #define HC_HTXnTBLAa_MASK 0x0007c000 #define HC_HTXnTBLAb_MASK 0x00000f80 #define HC_HTXnTBLAc_MASK 0x0000001f #define HC_HTXnTBLAMB_SHIFT 20 #define HC_HTXnTBLAa_TOPA (HC_XTA_TOPA << 14) #define HC_HTXnTBLAa_InvTOPA (HC_XTA_InvTOPA << 14) #define HC_HTXnTBLAa_TOPAp5 (HC_XTA_TOPAp5 << 14) #define HC_HTXnTBLAa_Adif (HC_XTA_Adif << 14) #define HC_HTXnTBLAa_Fog (HC_XTA_Fog << 14) #define HC_HTXnTBLAa_Acur (HC_XTA_Acur << 14) #define HC_HTXnTBLAa_HTXnTBLRA (HC_XTA_HTXnTBLRA << 14) #define HC_HTXnTBLAa_Atex (HC_XTA_Atex << 14) #define HC_HTXnTBLAa_Atexnext (HC_XTA_Atexnext << 14) #define HC_HTXnTBLAb_TOPA (HC_XTA_TOPA << 7) #define HC_HTXnTBLAb_InvTOPA (HC_XTA_InvTOPA << 7) #define HC_HTXnTBLAb_TOPAp5 (HC_XTA_TOPAp5 << 7) #define HC_HTXnTBLAb_Adif (HC_XTA_Adif << 7) #define HC_HTXnTBLAb_Fog (HC_XTA_Fog << 7) #define HC_HTXnTBLAb_Acur (HC_XTA_Acur << 7) #define HC_HTXnTBLAb_HTXnTBLRA (HC_XTA_HTXnTBLRA << 7) #define HC_HTXnTBLAb_Atex (HC_XTA_Atex << 7) #define HC_HTXnTBLAb_Atexnext (HC_XTA_Atexnext << 7) #define HC_HTXnTBLAc_TOPA (HC_XTA_TOPA << 0) #define HC_HTXnTBLAc_InvTOPA (HC_XTA_InvTOPA << 0) #define HC_HTXnTBLAc_TOPAp5 (HC_XTA_TOPAp5 << 0) #define HC_HTXnTBLAc_Adif (HC_XTA_Adif << 0) #define HC_HTXnTBLAc_Fog (HC_XTA_Fog << 0) #define HC_HTXnTBLAc_Acur (HC_XTA_Acur << 0) #define HC_HTXnTBLAc_HTXnTBLRA (HC_XTA_HTXnTBLRA << 0) #define HC_HTXnTBLAc_Atex (HC_XTA_Atex << 0) #define HC_HTXnTBLAc_Atexnext (HC_XTA_Atexnext << 0) /* HC_SubA_HTXnTBLRAa 0x0089 */ #define HC_HTXnTBLRAa_MASK 0x00ff0000 #define HC_HTXnTBLRAb_MASK 0x0000ff00 #define HC_HTXnTBLRAc_MASK 0x000000ff #define HC_HTXnTBLRAa_SHIFT 16 #define HC_HTXnTBLRAb_SHIFT 8 #define HC_HTXnTBLRAc_SHIFT 0 /* HC_SubA_HTXnTBLRFog 0x008a */ #define HC_HTXnTBLRFog_MASK 0x0000ff00 #define HC_HTXnTBLRAbias_MASK 0x000000ff #define HC_HTXnTBLRFog_SHIFT 8 #define HC_HTXnTBLRAbias_SHIFT 0 /* HC_SubA_HTXnLScale 0x0094 */ #define HC_HTXnLScale_MASK 0x0007fc00 #define HC_HTXnLOff_MASK 0x000001ff #define HC_HTXnLScale_SHIFT 10 /* HC_SubA_HTXSMD 0x0000 */ #define HC_HTXSMD_MASK 0x00000080 #define HC_HTXTMD_MASK 0x00000040 #define HC_HTXNum_MASK 0x00000038 #define HC_HTXTRMD_MASK 0x00000006 #define HC_HTXCHCLR_MASK 0x00000001 #define HC_HTXNum_SHIFT 3 /* Texture Palette n */ #define HC_SubType_TexPalette0 0x00000000 #define HC_SubType_TexPalette1 0x00000001 #define HC_SubType_FogTable 0x00000010 #define HC_SubType_Stipple 0x00000014 /* HC_SubA_TexPalette0 0x0000 */ #define HC_HTPnA_MASK 0xff000000 #define HC_HTPnR_MASK 0x00ff0000 #define HC_HTPnG_MASK 0x0000ff00 #define HC_HTPnB_MASK 0x000000ff /* HC_SubA_FogTable 0x0010 */ #define HC_HFPn3_MASK 0xff000000 #define HC_HFPn2_MASK 0x00ff0000 #define HC_HFPn1_MASK 0x0000ff00 #define HC_HFPn_MASK 0x000000ff #define HC_HFPn3_SHIFT 24 #define HC_HFPn2_SHIFT 16 #define HC_HFPn1_SHIFT 8 /* Auto Testing & Security */ #define HC_SubA_HenFIFOAT 0x0000 #define HC_SubA_HFBDrawFirst 0x0004 #define HC_SubA_HFBBasL 0x0005 #define HC_SubA_HFBDst 0x0006 /* HC_SubA_HenFIFOAT 0x0000 */ #define HC_HenFIFOAT_MASK 0x00000020 #define HC_HenGEMILock_MASK 0x00000010 #define HC_HenFBASwap_MASK 0x00000008 #define HC_HenOT_MASK 0x00000004 #define HC_HenCMDQ_MASK 0x00000002 #define HC_HenTXCTSU_MASK 0x00000001 /* HC_SubA_HFBDrawFirst 0x0004 */ #define HC_HFBDrawFirst_MASK 0x00000800 #define HC_HFBQueue_MASK 0x00000400 #define HC_HFBLock_MASK 0x00000200 #define HC_HEOF_MASK 0x00000100 #define HC_HFBBasH_MASK 0x000000ff /* GEMI Setting */ #define HC_SubA_HTArbRCM 0x0008 #define HC_SubA_HTArbRZ 0x000a #define HC_SubA_HTArbWZ 0x000b #define HC_SubA_HTArbRTX 0x000c #define HC_SubA_HTArbRCW 0x000d #define HC_SubA_HTArbE2 0x000e #define HC_SubA_HArbRQCM 0x0010 #define HC_SubA_HArbWQCM 0x0011 #define HC_SubA_HGEMITout 0x0020 #define HC_SubA_HFthRTXD 0x0040 #define HC_SubA_HFthRTXA 0x0044 #define HC_SubA_HCMDQstL 0x0050 #define HC_SubA_HCMDQendL 0x0051 #define HC_SubA_HCMDQLen 0x0052 /* HC_SubA_HTArbRCM 0x0008 */ #define HC_HTArbRCM_MASK 0x0000ffff /* HC_SubA_HTArbRZ 0x000a */ #define HC_HTArbRZ_MASK 0x0000ffff /* HC_SubA_HTArbWZ 0x000b */ #define HC_HTArbWZ_MASK 0x0000ffff /* HC_SubA_HTArbRTX 0x000c */ #define HC_HTArbRTX_MASK 0x0000ffff /* HC_SubA_HTArbRCW 0x000d */ #define HC_HTArbRCW_MASK 0x0000ffff /* HC_SubA_HTArbE2 0x000e */ #define HC_HTArbE2_MASK 0x0000ffff /* HC_SubA_HArbRQCM 0x0010 */ #define HC_HTArbRQCM_MASK 0x0000ffff /* HC_SubA_HArbWQCM 0x0011 */ #define HC_HArbWQCM_MASK 0x0000ffff /* HC_SubA_HGEMITout 0x0020 */ #define HC_HGEMITout_MASK 0x000f0000 #define HC_HNPArbZC_MASK 0x0000ffff #define HC_HGEMITout_SHIFT 16 /* HC_SubA_HFthRTXD 0x0040 */ #define HC_HFthRTXD_MASK 0x00ff0000 #define HC_HFthRZD_MASK 0x0000ff00 #define HC_HFthWZD_MASK 0x000000ff #define HC_HFthRTXD_SHIFT 16 #define HC_HFthRZD_SHIFT 8 /* HC_SubA_HFthRTXA 0x0044 */ #define HC_HFthRTXA_MASK 0x000000ff /****************************************************************************** ** Define the Halcyon Internal register access constants. For simulator only. ******************************************************************************/ #define HC_SIMA_HAGPBstL 0x0000 #define HC_SIMA_HAGPBendL 0x0001 #define HC_SIMA_HAGPCMNT 0x0002 #define HC_SIMA_HAGPBpL 0x0003 #define HC_SIMA_HAGPBpH 0x0004 #define HC_SIMA_HClipTB 0x0005 #define HC_SIMA_HClipLR 0x0006 #define HC_SIMA_HFPClipTL 0x0007 #define HC_SIMA_HFPClipBL 0x0008 #define HC_SIMA_HFPClipLL 0x0009 #define HC_SIMA_HFPClipRL 0x000a #define HC_SIMA_HFPClipTBH 0x000b #define HC_SIMA_HFPClipLRH 0x000c #define HC_SIMA_HLP 0x000d #define HC_SIMA_HLPRF 0x000e #define HC_SIMA_HSolidCL 0x000f #define HC_SIMA_HPixGC 0x0010 #define HC_SIMA_HSPXYOS 0x0011 #define HC_SIMA_HCmdA 0x0012 #define HC_SIMA_HCmdB 0x0013 #define HC_SIMA_HEnable 0x0014 #define HC_SIMA_HZWBBasL 0x0015 #define HC_SIMA_HZWBBasH 0x0016 #define HC_SIMA_HZWBType 0x0017 #define HC_SIMA_HZBiasL 0x0018 #define HC_SIMA_HZWBend 0x0019 #define HC_SIMA_HZWTMD 0x001a #define HC_SIMA_HZWCDL 0x001b #define HC_SIMA_HZWCTAGnum 0x001c #define HC_SIMA_HZCYNum 0x001d #define HC_SIMA_HZWCFire 0x001e /* #define HC_SIMA_HSBBasL 0x001d */ /* #define HC_SIMA_HSBBasH 0x001e */ /* #define HC_SIMA_HSBFM 0x001f */ #define HC_SIMA_HSTREF 0x0020 #define HC_SIMA_HSTMD 0x0021 #define HC_SIMA_HABBasL 0x0022 #define HC_SIMA_HABBasH 0x0023 #define HC_SIMA_HABFM 0x0024 #define HC_SIMA_HATMD 0x0025 #define HC_SIMA_HABLCsat 0x0026 #define HC_SIMA_HABLCop 0x0027 #define HC_SIMA_HABLAsat 0x0028 #define HC_SIMA_HABLAop 0x0029 #define HC_SIMA_HABLRCa 0x002a #define HC_SIMA_HABLRFCa 0x002b #define HC_SIMA_HABLRCbias 0x002c #define HC_SIMA_HABLRCb 0x002d #define HC_SIMA_HABLRFCb 0x002e #define HC_SIMA_HABLRAa 0x002f #define HC_SIMA_HABLRAb 0x0030 #define HC_SIMA_HDBBasL 0x0031 #define HC_SIMA_HDBBasH 0x0032 #define HC_SIMA_HDBFM 0x0033 #define HC_SIMA_HFBBMSKL 0x0034 #define HC_SIMA_HROP 0x0035 #define HC_SIMA_HFogLF 0x0036 #define HC_SIMA_HFogCL 0x0037 #define HC_SIMA_HFogCH 0x0038 #define HC_SIMA_HFogStL 0x0039 #define HC_SIMA_HFogStH 0x003a #define HC_SIMA_HFogOOdMF 0x003b #define HC_SIMA_HFogOOdEF 0x003c #define HC_SIMA_HFogEndL 0x003d #define HC_SIMA_HFogDenst 0x003e /*---- start of texture 0 setting ---- */ #define HC_SIMA_HTX0L0BasL 0x0040 #define HC_SIMA_HTX0L1BasL 0x0041 #define HC_SIMA_HTX0L2BasL 0x0042 #define HC_SIMA_HTX0L3BasL 0x0043 #define HC_SIMA_HTX0L4BasL 0x0044 #define HC_SIMA_HTX0L5BasL 0x0045 #define HC_SIMA_HTX0L6BasL 0x0046 #define HC_SIMA_HTX0L7BasL 0x0047 #define HC_SIMA_HTX0L8BasL 0x0048 #define HC_SIMA_HTX0L9BasL 0x0049 #define HC_SIMA_HTX0LaBasL 0x004a #define HC_SIMA_HTX0LbBasL 0x004b #define HC_SIMA_HTX0LcBasL 0x004c #define HC_SIMA_HTX0LdBasL 0x004d #define HC_SIMA_HTX0LeBasL 0x004e #define HC_SIMA_HTX0LfBasL 0x004f #define HC_SIMA_HTX0L10BasL 0x0050 #define HC_SIMA_HTX0L11BasL 0x0051 #define HC_SIMA_HTX0L012BasH 0x0052 #define HC_SIMA_HTX0L345BasH 0x0053 #define HC_SIMA_HTX0L678BasH 0x0054 #define HC_SIMA_HTX0L9abBasH 0x0055 #define HC_SIMA_HTX0LcdeBasH 0x0056 #define HC_SIMA_HTX0Lf1011BasH 0x0057 #define HC_SIMA_HTX0L0Pit 0x0058 #define HC_SIMA_HTX0L1Pit 0x0059 #define HC_SIMA_HTX0L2Pit 0x005a #define HC_SIMA_HTX0L3Pit 0x005b #define HC_SIMA_HTX0L4Pit 0x005c #define HC_SIMA_HTX0L5Pit 0x005d #define HC_SIMA_HTX0L6Pit 0x005e #define HC_SIMA_HTX0L7Pit 0x005f #define HC_SIMA_HTX0L8Pit 0x0060 #define HC_SIMA_HTX0L9Pit 0x0061 #define HC_SIMA_HTX0LaPit 0x0062 #define HC_SIMA_HTX0LbPit 0x0063 #define HC_SIMA_HTX0LcPit 0x0064 #define HC_SIMA_HTX0LdPit 0x0065 #define HC_SIMA_HTX0LePit 0x0066 #define HC_SIMA_HTX0LfPit 0x0067 #define HC_SIMA_HTX0L10Pit 0x0068 #define HC_SIMA_HTX0L11Pit 0x0069 #define HC_SIMA_HTX0L0_5WE 0x006a #define HC_SIMA_HTX0L6_bWE 0x006b #define HC_SIMA_HTX0Lc_11WE 0x006c #define HC_SIMA_HTX0L0_5HE 0x006d #define HC_SIMA_HTX0L6_bHE 0x006e #define HC_SIMA_HTX0Lc_11HE 0x006f #define HC_SIMA_HTX0L0OS 0x0070 #define HC_SIMA_HTX0TB 0x0071 #define HC_SIMA_HTX0MPMD 0x0072 #define HC_SIMA_HTX0CLODu 0x0073 #define HC_SIMA_HTX0FM 0x0074 #define HC_SIMA_HTX0TRCH 0x0075 #define HC_SIMA_HTX0TRCL 0x0076 #define HC_SIMA_HTX0TBC 0x0077 #define HC_SIMA_HTX0TRAH 0x0078 #define HC_SIMA_HTX0TBLCsat 0x0079 #define HC_SIMA_HTX0TBLCop 0x007a #define HC_SIMA_HTX0TBLMPfog 0x007b #define HC_SIMA_HTX0TBLAsat 0x007c #define HC_SIMA_HTX0TBLRCa 0x007d #define HC_SIMA_HTX0TBLRCb 0x007e #define HC_SIMA_HTX0TBLRCc 0x007f #define HC_SIMA_HTX0TBLRCbias 0x0080 #define HC_SIMA_HTX0TBLRAa 0x0081 #define HC_SIMA_HTX0TBLRFog 0x0082 #define HC_SIMA_HTX0BumpM00 0x0083 #define HC_SIMA_HTX0BumpM01 0x0084 #define HC_SIMA_HTX0BumpM10 0x0085 #define HC_SIMA_HTX0BumpM11 0x0086 #define HC_SIMA_HTX0LScale 0x0087 /*---- end of texture 0 setting ---- 0x008f */ #define HC_SIMA_TX0TX1_OFF 0x0050 /*---- start of texture 1 setting ---- */ #define HC_SIMA_HTX1L0BasL (HC_SIMA_HTX0L0BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L1BasL (HC_SIMA_HTX0L1BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L2BasL (HC_SIMA_HTX0L2BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L3BasL (HC_SIMA_HTX0L3BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L4BasL (HC_SIMA_HTX0L4BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L5BasL (HC_SIMA_HTX0L5BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6BasL (HC_SIMA_HTX0L6BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L7BasL (HC_SIMA_HTX0L7BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L8BasL (HC_SIMA_HTX0L8BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9BasL (HC_SIMA_HTX0L9BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LaBasL (HC_SIMA_HTX0LaBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LbBasL (HC_SIMA_HTX0LbBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcBasL (HC_SIMA_HTX0LcBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LdBasL (HC_SIMA_HTX0LdBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LeBasL (HC_SIMA_HTX0LeBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LfBasL (HC_SIMA_HTX0LfBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L10BasL (HC_SIMA_HTX0L10BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L11BasL (HC_SIMA_HTX0L11BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L012BasH (HC_SIMA_HTX0L012BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L345BasH (HC_SIMA_HTX0L345BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L678BasH (HC_SIMA_HTX0L678BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9abBasH (HC_SIMA_HTX0L9abBasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcdeBasH (HC_SIMA_HTX0LcdeBasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lf1011BasH (HC_SIMA_HTX0Lf1011BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0Pit (HC_SIMA_HTX0L0Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L1Pit (HC_SIMA_HTX0L1Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L2Pit (HC_SIMA_HTX0L2Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L3Pit (HC_SIMA_HTX0L3Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L4Pit (HC_SIMA_HTX0L4Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L5Pit (HC_SIMA_HTX0L5Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6Pit (HC_SIMA_HTX0L6Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L7Pit (HC_SIMA_HTX0L7Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L8Pit (HC_SIMA_HTX0L8Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9Pit (HC_SIMA_HTX0L9Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LaPit (HC_SIMA_HTX0LaPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LbPit (HC_SIMA_HTX0LbPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcPit (HC_SIMA_HTX0LcPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LdPit (HC_SIMA_HTX0LdPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LePit (HC_SIMA_HTX0LePit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LfPit (HC_SIMA_HTX0LfPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L10Pit (HC_SIMA_HTX0L10Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L11Pit (HC_SIMA_HTX0L11Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0_5WE (HC_SIMA_HTX0L0_5WE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6_bWE (HC_SIMA_HTX0L6_bWE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lc_11WE (HC_SIMA_HTX0Lc_11WE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0_5HE (HC_SIMA_HTX0L0_5HE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6_bHE (HC_SIMA_HTX0L6_bHE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lc_11HE (HC_SIMA_HTX0Lc_11HE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0OS (HC_SIMA_HTX0L0OS + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TB (HC_SIMA_HTX0TB + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1MPMD (HC_SIMA_HTX0MPMD + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1CLODu (HC_SIMA_HTX0CLODu + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1FM (HC_SIMA_HTX0FM + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRCH (HC_SIMA_HTX0TRCH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRCL (HC_SIMA_HTX0TRCL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBC (HC_SIMA_HTX0TBC + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRAH (HC_SIMA_HTX0TRAH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LTC (HC_SIMA_HTX0LTC + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LTA (HC_SIMA_HTX0LTA + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLCsat (HC_SIMA_HTX0TBLCsat + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLCop (HC_SIMA_HTX0TBLCop + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLMPfog (HC_SIMA_HTX0TBLMPfog + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLAsat (HC_SIMA_HTX0TBLAsat + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCa (HC_SIMA_HTX0TBLRCa + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCb (HC_SIMA_HTX0TBLRCb + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCc (HC_SIMA_HTX0TBLRCc + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCbias (HC_SIMA_HTX0TBLRCbias + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRAa (HC_SIMA_HTX0TBLRAa + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRFog (HC_SIMA_HTX0TBLRFog + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM00 (HC_SIMA_HTX0BumpM00 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM01 (HC_SIMA_HTX0BumpM01 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM10 (HC_SIMA_HTX0BumpM10 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM11 (HC_SIMA_HTX0BumpM11 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LScale (HC_SIMA_HTX0LScale + HC_SIMA_TX0TX1_OFF) /*---- end of texture 1 setting ---- 0xaf */ #define HC_SIMA_HTXSMD 0x00b0 #define HC_SIMA_HenFIFOAT 0x00b1 #define HC_SIMA_HFBDrawFirst 0x00b2 #define HC_SIMA_HFBBasL 0x00b3 #define HC_SIMA_HTArbRCM 0x00b4 #define HC_SIMA_HTArbRZ 0x00b5 #define HC_SIMA_HTArbWZ 0x00b6 #define HC_SIMA_HTArbRTX 0x00b7 #define HC_SIMA_HTArbRCW 0x00b8 #define HC_SIMA_HTArbE2 0x00b9 #define HC_SIMA_HGEMITout 0x00ba #define HC_SIMA_HFthRTXD 0x00bb #define HC_SIMA_HFthRTXA 0x00bc /* Define the texture palette 0 */ #define HC_SIMA_HTP0 0x0100 #define HC_SIMA_HTP1 0x0200 #define HC_SIMA_FOGTABLE 0x0300 #define HC_SIMA_STIPPLE 0x0400 #define HC_SIMA_HE3Fire 0x0440 #define HC_SIMA_TRANS_SET 0x0441 #define HC_SIMA_HREngSt 0x0442 #define HC_SIMA_HRFIFOempty 0x0443 #define HC_SIMA_HRFIFOfull 0x0444 #define HC_SIMA_HRErr 0x0445 #define HC_SIMA_FIFOstatus 0x0446 /****************************************************************************** ** Define the AGP command header. ******************************************************************************/ #define HC_ACMD_MASK 0xfe000000 #define HC_ACMD_SUB_MASK 0x0c000000 #define HC_ACMD_HCmdA 0xee000000 #define HC_ACMD_HCmdB 0xec000000 #define HC_ACMD_HCmdC 0xea000000 #define HC_ACMD_H1 0xf0000000 #define HC_ACMD_H2 0xf2000000 #define HC_ACMD_H3 0xf4000000 #define HC_ACMD_H4 0xf6000000 #define HC_ACMD_H1IO_MASK 0x000001ff #define HC_ACMD_H2IO1_MASK 0x001ff000 #define HC_ACMD_H2IO2_MASK 0x000001ff #define HC_ACMD_H2IO1_SHIFT 12 #define HC_ACMD_H2IO2_SHIFT 0 #define HC_ACMD_H3IO_MASK 0x000001ff #define HC_ACMD_H3COUNT_MASK 0x01fff000 #define HC_ACMD_H3COUNT_SHIFT 12 #define HC_ACMD_H4ID_MASK 0x000001ff #define HC_ACMD_H4COUNT_MASK 0x01fffe00 #define HC_ACMD_H4COUNT_SHIFT 9 /******************************************************************************** ** Define Header ********************************************************************************/ #define HC_HEADER2 0xF210F110 /******************************************************************************** ** Define Dummy Value ********************************************************************************/ #define HC_DUMMY 0xCCCCCCCC /******************************************************************************** ** Define for DMA use ********************************************************************************/ #define HALCYON_HEADER2 0XF210F110 #define HALCYON_FIRECMD 0XEE100000 #define HALCYON_FIREMASK 0XFFF00000 #define HALCYON_CMDB 0XEC000000 #define HALCYON_CMDBMASK 0XFFFE0000 #define HALCYON_SUB_ADDR0 0X00000000 #define HALCYON_HEADER1MASK 0XFFFFFF00 #define HALCYON_HEADER1 0XF0000000 #define HC_SubA_HAGPBstL 0x0060 #define HC_SubA_HAGPBendL 0x0061 #define HC_SubA_HAGPCMNT 0x0062 #define HC_SubA_HAGPBpL 0x0063 #define HC_SubA_HAGPBpH 0x0064 #define HC_HAGPCMNT_MASK 0x00800000 #define HC_HCmdErrClr_MASK 0x00400000 #define HC_HAGPBendH_MASK 0x0000ff00 #define HC_HAGPBstH_MASK 0x000000ff #define HC_HAGPBendH_SHIFT 8 #define HC_HAGPBstH_SHIFT 0 #define HC_HAGPBpL_MASK 0x00fffffc #define HC_HAGPBpID_MASK 0x00000003 #define HC_HAGPBpID_PAUSE 0x00000000 #define HC_HAGPBpID_JUMP 0x00000001 #define HC_HAGPBpID_STOP 0x00000002 #define HC_HAGPBpH_MASK 0x00ffffff #endif // __VIA_REGS_3D_H__ DirectFB-1.2.10/gfxdrivers/cle266/uc_hw.h0000644000175000017500000000553711164361026014612 00000000000000// Shared header file for uc_hwmap.c and uc_hwset.c. #ifndef __UC_HW_H__ #define __UC_HW_H__ #include #include #include "unichrome.h" #include "uc_fifo.h" // GPU - mapping functions (uc_hwmap.c) /// Map a DirectFB destination surface pixel format to the hw. (3D) static inline int uc_map_dst_format( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: return HC_HDBFM_ARGB1555; case DSPF_RGB16: return HC_HDBFM_RGB565; case DSPF_RGB32: return HC_HDBFM_ARGB0888; case DSPF_ARGB: return HC_HDBFM_ARGB8888; default: D_BUG( "unexpected pixel format" ); } return 0; } /// Map a DirectFB source surface pixel format to the hw. (3D) static inline int uc_map_src_format_3d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: return HC_HTXnFM_ARGB1555; case DSPF_RGB16: return HC_HTXnFM_RGB565; case DSPF_RGB32: return HC_HTXnFM_ARGB0888; case DSPF_ARGB: return HC_HTXnFM_ARGB8888; case DSPF_A8: return HC_HTXnFM_A8; case DSPF_LUT8: return HC_HTXnFM_Index8; default: D_BUG( "unexpected pixel format" ); } return 0; } void uc_map_blending_fn( struct uc_hw_alpha *hwalpha, DFBSurfaceBlendFunction sblend, DFBSurfaceBlendFunction dblend, DFBSurfacePixelFormat dformat ); void uc_map_blitflags ( struct uc_hw_texture *tex, DFBSurfaceBlittingFlags bflags, DFBSurfacePixelFormat sformat ); // GPU - setting functions (uc_hwset.c) void uc_set_blending_fn( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_texenv ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_clip ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_destination( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_source_2d ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_source_3d ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_color_2d ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_colorkey_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); #endif // __UC_HW_H__ DirectFB-1.2.10/gfxdrivers/cle266/uc_overlay.c0000644000175000017500000002207011164361026015637 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" #include #include #include // Forward declaration static DFBResult uc_ovl_remove(CoreLayer *layer, void *driver_data, void *layer_data, void *region_data); static int uc_ovl_datasize( void ) { return sizeof(UcOverlayData); } static DFBResult uc_ovl_init_layer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; // Set layer type, capabilities and name description->caps = UC_OVL_CAPS; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; snprintf(description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "VIA CLE266 Video"); adjustment->flags = DCAF_NONE; // Fill out the default configuration config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; ucovl->v1.win.w = 720; ucovl->v1.win.h = 576; ucovl->v1.win.x = 0; ucovl->v1.win.y = 0; config->width = 720; config->height = 576; config->pixelformat = DSPF_YV12; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; // Reset overlay ucovl->extfifo_on = false; ucovl->hwrev = ucdrv->hwrev; ucovl->scrwidth = ucovl->v1.win.w; ucovl->v1.isenabled = false; ucovl->v1.cfg = *config; ucovl->v1.ox = 0; ucovl->v1.oy = 0; // adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | // DCAF_HUE | DCAF_SATURATION; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; adjustment->hue = 0x8000; ucovl->v1.adj = *adjustment; uc_ovl_remove(layer, driver_data, layer_data, NULL); return DFB_OK; } static DFBResult uc_ovl_set_region( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; /* get new destination rectangle */ DFBRectangle win = config->dest;; // Bounds checking if ((win.x < -8192) || (win.x > 8192) || (win.y < -8192) || (win.y > 8192) || (win.w < 32) || (win.w > 4096) || (win.h < 32) || (win.h > 4096)) { D_DEBUG("Layer size or position is out of bounds."); return DFB_INVAREA; } ucovl->v1.isenabled = true; ucovl->v1.win = win; ucovl->deinterlace = config->options & DLOP_DEINTERLACING; ucovl->surface = surface; ucovl->lock = lock; return uc_ovl_update(ucdrv, ucovl, UC_OVL_CHANGE, surface, lock); } static DFBResult uc_ovl_remove(CoreLayer *layer, void *driver_data, void *layer_data, void *region_data) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; volatile u8* vio = ucdrv->hwregs; ucovl->v1.isenabled = false; uc_ovl_vcmd_wait(vio); VIDEO_OUT(vio, V_FIFO_CONTROL, UC_MAP_V1_FIFO_CONTROL(16,12,8)); // VIDEO_OUT(vio, ALPHA_V3_FIFO_CONTROL, 0x0407181f); if (ucovl->hwrev == 0x10) { VIDEO_OUT(vio, V1_ColorSpaceReg_1, ColorSpaceValue_1_3123C0); VIDEO_OUT(vio, V1_ColorSpaceReg_2, ColorSpaceValue_2_3123C0); } else { VIDEO_OUT(vio, V1_ColorSpaceReg_1, ColorSpaceValue_1); VIDEO_OUT(vio, V1_ColorSpaceReg_2, ColorSpaceValue_2); } VIDEO_OUT(vio, HQV_CONTROL, VIDEO_IN(vio, HQV_CONTROL) & ~HQV_ENABLE); VIDEO_OUT(vio, V1_CONTROL, VIDEO_IN(vio, V1_CONTROL) & ~V1_ENABLE); // VIDEO_OUT(vio, V3_CONTROL, VIDEO_IN(vio, V3_CONTROL) & ~V3_ENABLE); VIDEO_OUT(vio, V_COMPOSE_MODE, VIDEO_IN(vio, V_COMPOSE_MODE) | V1_COMMAND_FIRE); ucovl->surface = NULL; return DFB_OK; } static DFBResult uc_ovl_test_region(CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed) { CoreLayerRegionConfigFlags fail = 0; // Check layer options if (config->options & ~UC_OVL_OPTIONS) fail |= CLRCF_OPTIONS; // Check pixelformats switch (config->format) { case DSPF_YUY2: break; case DSPF_UYVY: fail |= CLRCF_FORMAT; // Nope... doesn't work. break; case DSPF_I420: case DSPF_YV12: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: fail |= CLRCF_FORMAT; } // Check width and height if (config->width > 4096 || config->width < 32) fail |= CLRCF_WIDTH; if (config->height > 4096 || config->height < 32) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult uc_ovl_flip_region( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock) { //printf("Entering %s ... \n", __PRETTY_FUNCTION__); UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; DFBResult ret; if (((flags & DSFLIP_WAITFORSYNC) == DSFLIP_WAITFORSYNC) && !dfb_config->pollvsync_after) dfb_layer_wait_vsync( layer ); dfb_surface_flip(surface, false); ucovl->field = 0; ucovl->lock = lock; ret = uc_ovl_update(ucdrv, ucovl, UC_OVL_FLIP, surface, lock); if (ret) return ret; if ((flags & DSFLIP_WAIT) && (dfb_config->pollvsync_after || !(flags & DSFLIP_ONSYNC))) dfb_layer_wait_vsync(layer); return DFB_OK; } static DFBResult uc_ovl_get_level(CoreLayer *layer, void *driver_data, void *layer_data, int *level) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; *level = ucovl->v1.level; return DFB_OK; } static DFBResult uc_ovl_set_level(CoreLayer *layer, void *driver_data, void *layer_data, int level) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; UcDriverData* ucdrv = (UcDriverData*) driver_data; if (level == 0) return DFB_INVARG; if (level > 0) { // Enable underlay mode. VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(-1)); } else { // Enable overlay mode (default) VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(ucovl->v1.opacity)); } ucovl->v1.level = level; return DFB_OK; } static DFBResult uc_ovl_set_input_field( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; UcDriverData* ucdrv = (UcDriverData*) driver_data; ucovl->field = field; return uc_ovl_update(ucdrv, ucovl, UC_OVL_FIELD, ucovl->surface, ucovl->lock); } DisplayLayerFuncs ucOverlayFuncs = { .LayerDataSize = uc_ovl_datasize, .InitLayer = uc_ovl_init_layer, .SetRegion = uc_ovl_set_region, .RemoveRegion = uc_ovl_remove, .TestRegion = uc_ovl_test_region, .FlipRegion = uc_ovl_flip_region, .GetLevel = uc_ovl_get_level, .SetLevel = uc_ovl_set_level, .SetInputField = uc_ovl_set_input_field, .SetColorAdjustment = uc_ovl_set_adjustment, }; DirectFB-1.2.10/gfxdrivers/cle266/uc_accel.h0000644000175000017500000000756411164361026015245 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_ACCEL_H__ #define __UC_ACCEL_H__ #include "unichrome.h" // 2D accelerator capabilites #define UC_DRAWING_FLAGS_2D (DSDRAW_XOR) #define UC_BLITTING_FLAGS_2D (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY) #define UC_DRAWING_FUNCTIONS_2D (DFXL_DRAWLINE | \ DFXL_DRAWRECTANGLE | \ DFXL_FILLRECTANGLE) #define UC_BLITTING_FUNCTIONS_2D (DFXL_BLIT) // 3D accelerator capabilites #ifdef UC_ENABLE_3D #define UC_DRAWING_FLAGS_3D (DSDRAW_BLEND | DSDRAW_XOR) #define UC_BLITTING_FLAGS_3D (DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | \ DSBLIT_DEINTERLACE) #define UC_DRAWING_FUNCTIONS_3D (DFXL_DRAWLINE | \ DFXL_DRAWRECTANGLE | \ DFXL_FILLRECTANGLE | \ DFXL_FILLTRIANGLE) #define UC_BLITTING_FUNCTIONS_3D (DFXL_BLIT | \ DFXL_STRETCHBLIT | \ DFXL_TEXTRIANGLES) #else #define UC_DRAWING_FLAGS_3D 0 #define UC_BLITTING_FLAGS_3D 0 #define UC_DRAWING_FUNCTIONS_3D 0 #define UC_BLITTING_FUNCTIONS_3D 0 #endif // UC_ENABLE_3D // Functions void uc_emit_commands ( void *drv, void *dev ); void uc_flush_texture_cache( void *drv, void *dev ); bool uc_fill_rectangle ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_rectangle ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_line ( void *drv, void *dev, DFBRegion *line ); bool uc_blit ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); bool uc_fill_rectangle_3d ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_rectangle_3d ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_line_3d ( void *drv, void *dev, DFBRegion *line ); bool uc_fill_triangle ( void *drv, void *dev, DFBTriangle *tri ); bool uc_blit_3d ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); bool uc_stretch_blit ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); bool uc_texture_triangles ( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ); #endif // __UC_ACCEL_H__ DirectFB-1.2.10/gfxdrivers/cle266/regs2d.h0000644000175000017500000001703611164361026014670 00000000000000// Note: This is a modified version of via_regs.h from the XFree86 CVS tree. /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __VIA_REGS_2D_H__ #define __VIA_REGS_2D_H__ /* Selected 2D engine raster operations. * See xc/programs/Xserver/hw/xfree86/xaa/xaarop.h * in the XFree86 project for the full list. */ #define VIA_ROP_DPx (0x5A << 24) #define VIA_ROP_DSx (0x66 << 24) #define VIA_ROP_S (0xCC << 24) #define VIA_ROP_P (0xF0 << 24) /* My own reverse-engineered bit definitions */ // Use the following definitions with VIA_KEY_CONTROL /// When set, red channel is not drawn #define VIA_KEY_MASK_RED 0x40000000 /// When set, green channel is not drawn #define VIA_KEY_MASK_GREEN 0x20000000 /// When set, blue channel is not drawn #define VIA_KEY_MASK_BLUE 0x10000000 /** When set, destination keying is enabled. * Caveat: VIA's destination key is the opposite of DirectFB's: * It draws where there is no match in the destination surface. */ #define VIA_KEY_ENABLE_DSTKEY 0x8000 /** When set, source keying is enabled * It draws the pixels in the source that do not match the color key. */ #define VIA_KEY_ENABLE_SRCKEY 0x4000 /** Inverts the behaviour of the color keys: * Dst key: draw where the destination matches the key * Src key: draw where the source matches the key * Problem: Since this bit affects both keys, you can not do * combined source and destination keying with DirectFB. * The inverted source key is all but useless since it will * only draw the source pixels that match the key! * It must be a design error... */ #define VIA_KEY_INVERT_KEY 0x2000 /* 2D engine registers and bit definitions */ #define VIA_MMIO_REGSIZE 0x9000 #define VIA_MMIO_REGBASE 0x0 #define VIA_MMIO_VGABASE 0x8000 #define VIA_MMIO_BLTBASE 0x200000 #define VIA_MMIO_BLTSIZE 0x10000 #define VIA_VQ_SIZE (256*1024) /* defines for VIA 2D registers */ #define VIA_REG_GECMD 0x000 #define VIA_REG_GEMODE 0x004 #define VIA_REG_GESTATUS 0x004 /* as same as VIA_REG_GEMODE */ #define VIA_REG_SRCPOS 0x008 #define VIA_REG_DSTPOS 0x00C #define VIA_REG_LINE_K1K2 0x008 #define VIA_REG_LINE_XY 0x00C #define VIA_REG_DIMENSION 0x010 /* width and height */ #define VIA_REG_PATADDR 0x014 #define VIA_REG_FGCOLOR 0x018 #define VIA_REG_DSTCOLORKEY 0x018 /* as same as VIA_REG_FG */ #define VIA_REG_BGCOLOR 0x01C #define VIA_REG_SRCCOLORKEY 0x01C /* as same as VIA_REG_BG */ #define VIA_REG_CLIPTL 0x020 /* top and left of clipping */ #define VIA_REG_CLIPBR 0x024 /* bottom and right of clipping */ #define VIA_REG_OFFSET 0x028 #define VIA_REG_LINE_ERROR 0x028 #define VIA_REG_KEYCONTROL 0x02C /* color key control */ #define VIA_REG_SRCBASE 0x030 #define VIA_REG_DSTBASE 0x034 #define VIA_REG_PITCH 0x038 /* pitch of src and dst */ #define VIA_REG_MONOPAT0 0x03C #define VIA_REG_MONOPAT1 0x040 #define VIA_REG_COLORPAT 0x100 /* from 0x100 to 0x1ff */ /* defines for VIA video registers */ #define VIA_REG_INTERRUPT 0x200 #define VIA_REG_CRTCSTART 0x214 /* defines for VIA HW cursor registers */ #define VIA_REG_CURSOR_MODE 0x2D0 #define VIA_REG_CURSOR_POS 0x2D4 #define VIA_REG_CURSOR_ORG 0x2D8 #define VIA_REG_CURSOR_BG 0x2DC #define VIA_REG_CURSOR_FG 0x2E0 /* defines for VIA 3D registers */ #define VIA_REG_STATUS 0x400 #define VIA_REG_TRANSET 0x43C #define VIA_REG_TRANSPACE 0x440 /* VIA_REG_STATUS(0x400): Engine Status */ #define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY 0x00000001 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY 0x00000002 /* 3D Engine is busy */ #define VIA_VR_QUEUE_BUSY 0x00020000 /* Virtual Queue is busy */ /* VIA_REG_GECMD(0x00): 2D Engine Command */ #define VIA_GEC_NOOP 0x00000000 #define VIA_GEC_BLT 0x00000001 #define VIA_GEC_LINE 0x00000005 #define VIA_GEC_SRC_XY 0x00000000 #define VIA_GEC_SRC_LINEAR 0x00000010 #define VIA_GEC_DST_XY 0x00000000 #define VIA_GEC_DST_LINRAT 0x00000020 #define VIA_GEC_SRC_FB 0x00000000 #define VIA_GEC_SRC_SYS 0x00000040 #define VIA_GEC_DST_FB 0x00000000 #define VIA_GEC_DST_SYS 0x00000080 #define VIA_GEC_SRC_MONO 0x00000100 /* source is mono */ #define VIA_GEC_PAT_MONO 0x00000200 /* pattern is mono */ #define VIA_GEC_MSRC_OPAQUE 0x00000000 /* mono src is opaque */ #define VIA_GEC_MSRC_TRANS 0x00000400 /* mono src is transparent */ #define VIA_GEC_PAT_FB 0x00000000 /* pattern is in frame buffer */ #define VIA_GEC_PAT_REG 0x00000800 /* pattern is from reg setting */ #define VIA_GEC_CLIP_DISABLE 0x00000000 #define VIA_GEC_CLIP_ENABLE 0x00001000 #define VIA_GEC_FIXCOLOR_PAT 0x00002000 #define VIA_GEC_INCX 0x00000000 #define VIA_GEC_DECY 0x00004000 #define VIA_GEC_INCY 0x00000000 #define VIA_GEC_DECX 0x00008000 #define VIA_GEC_MPAT_OPAQUE 0x00000000 /* mono pattern is opaque */ #define VIA_GEC_MPAT_TRANS 0x00010000 /* mono pattern is transparent */ #define VIA_GEC_MONO_UNPACK 0x00000000 #define VIA_GEC_MONO_PACK 0x00020000 #define VIA_GEC_MONO_DWORD 0x00000000 #define VIA_GEC_MONO_WORD 0x00040000 #define VIA_GEC_MONO_BYTE 0x00080000 #define VIA_GEC_LASTPIXEL_ON 0x00000000 #define VIA_GEC_LASTPIXEL_OFF 0x00100000 #define VIA_GEC_X_MAJOR 0x00000000 #define VIA_GEC_Y_MAJOR 0x00200000 #define VIA_GEC_QUICK_START 0x00800000 /* VIA_REG_GEMODE(0x04): GE mode */ #define VIA_GEM_8bpp 0x00000000 #define VIA_GEM_16bpp 0x00000100 #define VIA_GEM_32bpp 0x00000300 #define VIA_GEM_640 0x00000000 /* 640*480 */ #define VIA_GEM_800 0x00000400 /* 800*600 */ #define VIA_GEM_1024 0x00000800 /* 1024*768 */ #define VIA_GEM_1280 0x00000C00 /* 1280*1024 */ #define VIA_GEM_1600 0x00001000 /* 1600*1200 */ #define VIA_GEM_2048 0x00001400 /* 2048*1536 */ /* VIA_REG_PITCH(0x38): Pitch Setting */ #define VIA_PITCH_ENABLE 0x80000000 #endif // __VIA_REGS_2D_H__ DirectFB-1.2.10/gfxdrivers/cle266/vidregs.h0000644000175000017500000005547411164361026015155 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __VIDREGS_H__ #define __VIDREGS_H__ /* Video registers */ #define V_FLAGS 0x00 #define V_CAP_STATUS 0x04 #define V_FLIP_STATUS 0x04 #define V_ALPHA_WIN_START 0x08 #define V_ALPHA_WIN_END 0x0C #define V_ALPHA_CONTROL 0x10 #define V_CRT_STARTADDR 0x14 #define V_CRT_STARTADDR_2 0x18 #define V_ALPHA_STRIDE 0x1C #define V_COLOR_KEY 0x20 #define V_ALPHA_STARTADDR 0x24 #define V_CHROMAKEY_LOW 0x28 #define V_CHROMAKEY_HIGH 0x2C #define V1_CONTROL 0x30 #define V12_QWORD_PER_LINE 0x34 #define V1_STARTADDR_1 0x38 #define V1_STARTADDR_Y1 V1_STARTADDR_1 /* added by Kevin 3/30/2002 */ #define V1_STRIDE 0x3C #define V1_WIN_START_Y 0x40 #define V1_WIN_START_X 0x42 #define V1_WIN_END_Y 0x44 #define V1_WIN_END_X 0x46 #define V1_STARTADDR_2 0x48 #define V1_STARTADDR_Y2 V1_STARTADDR_2 /* added by Kevin 3/30/2002 */ #define V1_ZOOM_CONTROL 0x4C #define V1_MINI_CONTROL 0x50 #define V1_STARTADDR_0 0x54 #define V1_STARTADDR_Y0 V1_STARTADDR_0 /* added by Kevin 3/30/2002 */ #define V_FIFO_CONTROL 0x58 #define V1_STARTADDR_3 0x5C #define V1_STARTADDR_Y3 V1_STARTADDR_3 /* added by Kevin 3/30/2002 */ #define HI_CONTROL 0x60 #define SND_COLOR_KEY 0x64 #define ALPHA_V3_PREFIFO_CONTROL 0x68 #define V1_SOURCE_HEIGHT 0x6C #define HI_TRANSPARENT_COLOR 0x70 #define V_DISPLAY_TEMP 0x74 /* No use */ #define ALPHA_V3_FIFO_CONTROL 0x78 #define V3_SOURCE_WIDTH 0x7C #define V3_COLOR_KEY 0x80 #define V1_ColorSpaceReg_1 0x84 #define V1_ColorSpaceReg_2 0x88 #define V1_STARTADDR_CB0 0x8C #define V1_OPAQUE_CONTROL 0x90 /* To be deleted */ #define V3_OPAQUE_CONTROL 0x94 /* To be deleted */ #define V_COMPOSE_MODE 0x98 #define V3_STARTADDR_2 0x9C #define V3_CONTROL 0xA0 #define V3_STARTADDR_0 0xA4 #define V3_STARTADDR_1 0xA8 #define V3_STRIDE 0xAC #define V3_WIN_START_Y 0xB0 #define V3_WIN_START_X 0xB2 #define V3_WIN_END_Y 0xB4 #define V3_WIN_END_X 0xB6 #define V3_ALPHA_QWORD_PER_LINE 0xB8 #define V3_ZOOM_CONTROL 0xBC #define V3_MINI_CONTROL 0xC0 #define V3_ColorSpaceReg_1 0xC4 #define V3_ColorSpaceReg_2 0xC8 #define V3_DISPLAY_TEMP 0xCC /* No use */ #define V1_STARTADDR_CB1 0xE4 #define V1_STARTADDR_CB2 0xE8 #define V1_STARTADDR_CB3 0xEC #define V1_STARTADDR_CR0 0xF0 #define V1_STARTADDR_CR1 0xF4 #define V1_STARTADDR_CR2 0xF8 #define V1_STARTADDR_CR3 0xFC /* Video Capture Engine Registers - port 1 */ #define CAP0_MASKS 0x100 #define CAP1_MASKS 0x104 #define CAP0_CONTROL 0x110 #define CAP0_H_RANGE 0x114 #define CAP0_V_RANGE 0x118 #define CAP0_SCAL_CONTROL 0x11C #define CAP0_VBI_H_RANGE 0x120 #define CAP0_VBI_V_RANGE 0x124 #define CAP0_VBI_STARTADDR 0x128 #define CAP0_VBI_STRIDE 0x12C #define CAP0_ANCIL_COUNT 0x130 #define CAP0_MAXCOUNT 0x134 #define CAP0_VBIMAX_COUNT 0x138 #define CAP0_DATA_COUNT 0x13C #define CAP0_FB_STARTADDR0 0x140 #define CAP0_FB_STARTADDR1 0x144 #define CAP0_FB_STARTADDR2 0x148 #define CAP0_STRIDE 0x150 /* Video Capture Engine Registers - port 2 */ #define CAP1_CONTROL 0x154 #define CAP1_SCAL_CONTROL 0x160 #define CAP1_VBI_H_RANGE 0x164 /*To be deleted*/ #define CAP1_VBI_V_RANGE 0x168 /*To be deleted*/ #define CAP1_VBI_STARTADDR 0x16C /*To be deleted*/ #define CAP1_VBI_STRIDE 0x170 /*To be deleted*/ #define CAP1_ANCIL_COUNT 0x174 /*To be deleted*/ #define CAP1_MAXCOUNT 0x178 #define CAP1_VBIMAX_COUNT 0x17C /*To be deleted*/ #define CAP1_DATA_COUNT 0x180 #define CAP1_FB_STARTADDR0 0x184 #define CAP1_FB_STARTADDR1 0x188 #define CAP1_STRIDE 0x18C /* SUBPICTURE Registers */ #define SUBP_CONTROL_STRIDE 0x1C0 #define SUBP_STARTADDR 0x1C4 #define RAM_TABLE_CONTROL 0x1C8 #define RAM_TABLE_READ 0x1CC /* HQV Registers */ #define HQV_CONTROL 0x1D0 #define HQV_SRC_STARTADDR_Y 0x1D4 #define HQV_SRC_STARTADDR_U 0x1D8 #define HQV_SRC_STARTADDR_V 0x1DC #define HQV_SRC_FETCH_LINE 0x1E0 #define HQV_FILTER_CONTROL 0x1E4 #define HQV_MINIFY_CONTROL 0x1E8 #define HQV_DST_STARTADDR0 0x1EC #define HQV_DST_STARTADDR1 0x1F0 #define HQV_DST_STARTADDR2 0x1FC #define HQV_DST_STRIDE 0x1F4 #define HQV_SRC_STRIDE 0x1F8 /* Video command definitions */ /* #define V_ALPHA_CONTROL - 0x210 */ #define ALPHA_WIN_EXPIRENUMBER_4 0x00040000 #define ALPHA_WIN_CONSTANT_FACTOR_4 0x00004000 #define ALPHA_WIN_CONSTANT_FACTOR_12 0x0000c000 #define ALPHA_WIN_BLENDING_CONSTANT 0x00000000 #define ALPHA_WIN_BLENDING_ALPHA 0x00000001 #define ALPHA_WIN_BLENDING_GRAPHIC 0x00000002 #define ALPHA_WIN_PREFIFO_THRESHOLD_12 0x000c0000 #define ALPHA_WIN_FIFO_THRESHOLD_8 0x000c0000 #define ALPHA_WIN_FIFO_DEPTH_16 0x00100000 /* V_CHROMAKEY_LOW - 0x228 */ #define V_CHROMAKEY_V3 0x80000000 /* V1_CONTROL - 0x230 */ #define V1_ENABLE 0x00000001 #define V1_FULL_SCREEN 0x00000002 #define V1_YUV422 0x00000000 #define V1_RGB32 0x00000004 #define V1_RGB15 0x00000008 #define V1_RGB16 0x0000000C #define V1_YUV420 0x00000010 #define V1_COLORSPACE_SIGN 0x00000080 #define V1_SRC_IS_FRAME_PIC 0x00000200 #define V1_SRC_IS_FIELD_PIC 0x00000000 #define V1_BOB_ENABLE 0x00400000 #define V1_FIELD_BASE 0x00000000 #define V1_FRAME_BASE 0x01000000 #define V1_SWAP_SW 0x00000000 #define V1_SWAP_HW_HQV 0x02000000 #define V1_SWAP_HW_CAPTURE 0x04000000 #define V1_SWAP_HW_MC 0x06000000 /* #define V1_DOUBLE_BUFFERS 0x00000000 */ /* #define V1_QUADRUPLE_BUFFERS 0x18000000 */ #define V1_EXPIRE_NUM 0x00050000 #define V1_EXPIRE_NUM_A 0x000a0000 #define V1_EXPIRE_NUM_F 0x000f0000 /* jason */ #define V1_FIFO_EXTENDED 0x00200000 #define V1_ON_CRT 0x00000000 #define V1_ON_SND_DISPLAY 0x80000000 #define V1_FIFO_32V1_32V2 0x00000000 #define V1_FIFO_48V1_32V2 0x00200000 /* V12_QWORD_PER_LINE - 0x234 */ #define V1_FETCH_COUNT 0x3ff00000 #define V1_FETCHCOUNT_ALIGNMENT 0x0000000f #define V1_FETCHCOUNT_UNIT 0x00000004 /* Doubld QWORD */ /* V1_STRIDE */ #define V1_STRIDE_YMASK 0x00001fff #define V1_STRIDE_UVMASK 0x1ff00000 /* V1_ZOOM_CONTROL - 0x24C */ #define V1_X_ZOOM_ENABLE 0x80000000 #define V1_Y_ZOOM_ENABLE 0x00008000 /* V1_MINI_CONTROL - 0x250 */ #define V1_X_INTERPOLY 0x00000002 /* X interpolation */ #define V1_Y_INTERPOLY 0x00000001 /* Y interpolation */ #define V1_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */ #define V1_X_DIV_2 0x01000000 #define V1_X_DIV_4 0x03000000 #define V1_X_DIV_8 0x05000000 #define V1_X_DIV_16 0x07000000 #define V1_Y_DIV_2 0x00010000 #define V1_Y_DIV_4 0x00030000 #define V1_Y_DIV_8 0x00050000 #define V1_Y_DIV_16 0x00070000 /* V1_STARTADDR0 - 0x254 */ #define SW_FLIP_ODD 0x08000000 /* V_FIFO_CONTROL - 0x258 * IA2 has 32 level FIFO for packet mode video format * 32 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 enable * 16 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 disable * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122 */ #define V1_FIFO_DEPTH12 0x0000000B #define V1_FIFO_DEPTH16 0x0000000F #define V1_FIFO_DEPTH32 0x0000001F #define V1_FIFO_DEPTH48 0x0000002F #define V1_FIFO_DEPTH64 0x0000003F #define V1_FIFO_THRESHOLD6 0x00000600 #define V1_FIFO_THRESHOLD8 0x00000800 #define V1_FIFO_THRESHOLD12 0x00000C00 #define V1_FIFO_THRESHOLD16 0x00001000 #define V1_FIFO_THRESHOLD24 0x00001800 #define V1_FIFO_THRESHOLD32 0x00002000 #define V1_FIFO_THRESHOLD40 0x00002800 #define V1_FIFO_THRESHOLD48 0x00003000 #define V1_FIFO_THRESHOLD56 0x00003800 #define V1_FIFO_THRESHOLD61 0x00003D00 #define V1_FIFO_PRETHRESHOLD10 0x0A000000 #define V1_FIFO_PRETHRESHOLD12 0x0C000000 #define V1_FIFO_PRETHRESHOLD29 0x1d000000 #define V1_FIFO_PRETHRESHOLD40 0x28000000 #define V1_FIFO_PRETHRESHOLD44 0x2c000000 #define V1_FIFO_PRETHRESHOLD56 0x38000000 #define V1_FIFO_PRETHRESHOLD61 0x3D000000 /* ALPHA_V3_FIFO_CONTROL - 0x278 * IA2 has 32 level FIFO for packet mode video format * 32 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 enable * 16 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 disable * 8 level FIFO for ALPHA * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122 */ #define V3_FIFO_DEPTH16 0x0000000F #define V3_FIFO_DEPTH24 0x00000017 #define V3_FIFO_DEPTH32 0x0000001F #define V3_FIFO_DEPTH48 0x0000002F #define V3_FIFO_DEPTH64 0x0000003F #define V3_FIFO_THRESHOLD8 0x00000800 #define V3_FIFO_THRESHOLD12 0x00000C00 #define V3_FIFO_THRESHOLD16 0x00001000 #define V3_FIFO_THRESHOLD24 0x00001800 #define V3_FIFO_THRESHOLD32 0x00002000 #define V3_FIFO_THRESHOLD40 0x00002800 #define V3_FIFO_THRESHOLD48 0x00003000 #define V3_FIFO_THRESHOLD61 0x00003D00 #define V3_FIFO_PRETHRESHOLD10 0x0000000A #define V3_FIFO_PRETHRESHOLD12 0x0000000C #define V3_FIFO_PRETHRESHOLD29 0x0000001d #define V3_FIFO_PRETHRESHOLD40 0x00000028 #define V3_FIFO_PRETHRESHOLD44 0x0000002c #define V3_FIFO_PRETHRESHOLD56 0x00000038 #define V3_FIFO_PRETHRESHOLD61 0x0000003D #define V3_FIFO_MASK 0x0000007F #define ALPHA_FIFO_DEPTH8 0x00070000 #define ALPHA_FIFO_THRESHOLD4 0x04000000 #define ALPHA_FIFO_MASK 0xffff0000 #define ALPHA_FIFO_PRETHRESHOLD4 0x00040000 /* IA2 */ #define ColorSpaceValue_1 0x140020f2 #define ColorSpaceValue_2 0x0a0a2c00 #define ColorSpaceValue_1_3123C0 0x13000DED #define ColorSpaceValue_2_3123C0 0x13171000 /* For TV setting */ #define ColorSpaceValue_1TV 0x140020f2 #define ColorSpaceValue_2TV 0x0a0a2c00 /* V_COMPOSE_MODE - 0x298 */ #define SELECT_VIDEO_IF_COLOR_KEY 0x00000001 /* select video if (color key),otherwise select graphics */ #define SELECT_VIDEO3_IF_COLOR_KEY 0x00000020 /* For 3123C0, select video3 if (color key),otherwise select graphics */ #define SELECT_VIDEO_IF_CHROMA_KEY 0x00000002 /* 0x0000000a //select video if (chroma key ),otherwise select graphics */ #define ALWAYS_SELECT_VIDEO 0x00000000 /* always select video,Chroma key and Color key disable */ #define COMPOSE_V1_V3 0x00000000 /* V1 on top of V3 */ #define COMPOSE_V3_V1 0x00100000 /* V3 on top of V1 */ #define COMPOSE_V1_TOP 0x00000000 #define COMPOSE_V3_TOP 0x00100000 #define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */ #define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */ #define V_COMMAND_LOAD 0x20000000 /* Video register always loaded */ #define V_COMMAND_LOAD_VBI 0x10000000 /* Video register always loaded at vbi without waiting source flip */ #define V3_COMMAND_LOAD 0x08000000 /* CLE_C0 Video3 register always loaded */ #define V3_COMMAND_LOAD_VBI 0x00000100 /* CLE_C0 Video3 register always loaded at vbi without waiting source flip */ #define SECOND_DISPLAY_COLOR_KEY_ENABLE 0x00010000 /* V3_ZOOM_CONTROL - 0x2bc */ #define V3_X_ZOOM_ENABLE 0x80000000 #define V3_Y_ZOOM_ENABLE 0x00008000 /* V3_MINI_CONTROL - 0x2c0 */ #define V3_X_INTERPOLY 0x00000002 /* X interpolation */ #define V3_Y_INTERPOLY 0x00000001 /* Y interpolation */ #define V3_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */ #define V3_X_DIV_2 0x01000000 #define V3_X_DIV_4 0x03000000 #define V3_X_DIV_8 0x05000000 #define V3_X_DIV_16 0x07000000 #define V3_Y_DIV_2 0x00010000 #define V3_Y_DIV_4 0x00030000 #define V3_Y_DIV_8 0x00050000 #define V3_Y_DIV_16 0x00070000 /* SUBP_CONTROL_STRIDE - 0x3c0 */ #define SUBP_HQV_ENABLE 0x00010000 #define SUBP_IA44 0x00020000 #define SUBP_AI44 0x00000000 #define SUBP_STRIDE_MASK 0x00001fff #define SUBP_CONTROL_MASK 0x00070000 /* RAM_TABLE_CONTROL - 0x3c8 */ #define RAM_TABLE_RGB_ENABLE 0x00000007 /* CAPTURE0_CONTROL - 0x310 */ #define C0_ENABLE 0x00000001 #define BUFFER_2_MODE 0x00000000 #define BUFFER_3_MODE 0x00000004 #define BUFFER_4_MODE 0x00000006 #define SWAP_YUYV 0x00000000 #define SWAP_UYVY 0x00000100 #define SWAP_YVYU 0x00000200 #define SWAP_VYUY 0x00000300 #define IN_601_8 0x00000000 #define IN_656_8 0x00000010 #define IN_601_16 0x00000020 #define IN_656_16 0x00000030 #define DEINTER_ODD 0x00000000 #define DEINTER_EVEN 0x00001000 #define DEINTER_ODD_EVEN 0x00002000 #define DEINTER_FRAME 0x00003000 #define VIP_1 0x00000000 #define VIP_2 0x00000400 #define H_FILTER_2 0x00010000 #define H_FILTER_4 0x00020000 #define H_FILTER_8_1331 0x00030000 #define H_FILTER_8_12221 0x00040000 #define VIP_ENABLE 0x00000008 #define EN_FIELD_SIG 0x00000800 #define VREF_INVERT 0x00100000 #define FIELD_INPUT_INVERSE 0x00400000 #define FIELD_INVERSE 0x40000000 #define C1_H_MINI_EN 0x00000800 #define C0_H_MINI_EN 0x00000800 #define C1_V_MINI_EN 0x04000000 #define C0_V_MINI_EN 0x04000000 #define C1_H_MINI_2 0x00000400 /* CAPTURE1_CONTROL - 0x354 */ #define C1_ENABLE 0x00000001 /* V3_CONTROL - 0x2A0 */ #define V3_ENABLE 0x00000001 #define V3_FULL_SCREEN 0x00000002 #define V3_YUV422 0x00000000 #define V3_RGB32 0x00000004 #define V3_RGB15 0x00000008 #define V3_RGB16 0x0000000C #define V3_COLORSPACE_SIGN 0x00000080 #define V3_EXPIRE_NUM 0x00040000 #define V3_EXPIRE_NUM_F 0x000f0000 #define V3_BOB_ENABLE 0x00400000 #define V3_FIELD_BASE 0x00000000 #define V3_FRAME_BASE 0x01000000 #define V3_SWAP_SW 0x00000000 #define V3_SWAP_HW_HQV 0x02000000 #define V3_FLIP_HW_CAPTURE0 0x04000000 #define V3_FLIP_HW_CAPTURE1 0x06000000 /* V3_ALPHA_FETCH_COUNT - 0x2B8 */ #define V3_FETCH_COUNT 0x3ff00000 #define ALPHA_FETCH_COUNT 0x000003ff /* HQV_CONTROL - 0x3D0 */ #define HQV_RGB32 0x00000000 #define HQV_RGB16 0x20000000 #define HQV_RGB15 0x30000000 #define HQV_YUV422 0x80000000 #define HQV_YUV420 0xC0000000 #define HQV_ENABLE 0x08000000 #define HQV_SRC_SW 0x00000000 #define HQV_SRC_MC 0x01000000 #define HQV_SRC_CAPTURE0 0x02000000 #define HQV_SRC_CAPTURE1 0x03000000 #define HQV_FLIP_EVEN 0x00000000 #define HQV_FLIP_ODD 0x00000020 #define HQV_SW_FLIP 0x00000010 /* Write 1 to flip HQV buffer */ #define HQV_DEINTERLACE 0x00010000 /* First line of odd field will be repeated 3 times */ #define HQV_FIELD_2_FRAME 0x00020000 /* Src is field. Display each line 2 times */ #define HQV_FRAME_2_FIELD 0x00040000 /* Src is field. Display field */ #define HQV_FRAME_UV 0x00000000 /* Src is Non-interleaved */ #define HQV_FIELD_UV 0x00100000 /* Src is interleaved */ #define HQV_IDLE 0x00000008 #define HQV_FLIP_STATUS 0x00000001 #define HQV_DOUBLE_BUFF 0x00000000 #define HQV_TRIPLE_BUFF 0x04000000 #define HQV_SUBPIC_FLIP 0x00008000 #define HQV_FIFO_STATUS 0x00001000 /* HQV_FILTER_CONTROL - 0x3E4 */ #define HQV_H_LOWPASS_2TAP 0x00000001 #define HQV_H_LOWPASS_4TAP 0x00000002 #define HQV_H_LOWPASS_8TAP1 0x00000003 /* To be deleted */ #define HQV_H_LOWPASS_8TAP2 0x00000004 /* To be deleted */ #define HQV_H_HIGH_PASS 0x00000008 #define HQV_H_LOW_PASS 0x00000000 #define HQV_V_LOWPASS_2TAP 0x00010000 #define HQV_V_LOWPASS_4TAP 0x00020000 #define HQV_V_LOWPASS_8TAP1 0x00030000 #define HQV_V_LOWPASS_8TAP2 0x00040000 #define HQV_V_HIGH_PASS 0x00080000 #define HQV_V_LOW_PASS 0x00000000 #define HQV_H_HIPASS_F1_DEFAULT 0x00000040 #define HQV_H_HIPASS_F2_DEFAULT 0x00000000 #define HQV_V_HIPASS_F1_DEFAULT 0x00400000 #define HQV_V_HIPASS_F2_DEFAULT 0x00000000 #define HQV_H_HIPASS_F1_2TAP 0x00000050 #define HQV_H_HIPASS_F2_2TAP 0x00000100 #define HQV_V_HIPASS_F1_2TAP 0x00500000 #define HQV_V_HIPASS_F2_2TAP 0x01000000 #define HQV_H_HIPASS_F1_4TAP 0x00000060 #define HQV_H_HIPASS_F2_4TAP 0x00000200 #define HQV_V_HIPASS_F1_4TAP 0x00600000 #define HQV_V_HIPASS_F2_4TAP 0x02000000 #define HQV_H_HIPASS_F1_8TAP 0x00000080 #define HQV_H_HIPASS_F2_8TAP 0x00000400 #define HQV_V_HIPASS_F1_8TAP 0x00800000 #define HQV_V_HIPASS_F2_8TAP 0x04000000 /* IA2 NEW */ #define HQV_V_FILTER2 0x00080000 #define HQV_H_FILTER2 0x00000008 #define HQV_H_TAP2_11 0x00000041 #define HQV_H_TAP4_121 0x00000042 #define HQV_H_TAP4_1111 0x00000401 #define HQV_H_TAP8_1331 0x00000221 #define HQV_H_TAP8_12221 0x00000402 #define HQV_H_TAP16_1991 0x00000159 #define HQV_H_TAP16_141041 0x0000026A #define HQV_H_TAP32 0x0000015A #define HQV_V_TAP2_11 0x00410000 #define HQV_V_TAP4_121 0x00420000 #define HQV_V_TAP4_1111 0x04010000 #define HQV_V_TAP8_1331 0x02210000 #define HQV_V_TAP8_12221 0x04020000 #define HQV_V_TAP16_1991 0x01590000 #define HQV_V_TAP16_141041 0x026A0000 #define HQV_V_TAP32 0x015A0000 #define HQV_V_FILTER_DEFAULT 0x00420000 #define HQV_H_FILTER_DEFAULT 0x00000040 /* HQV_MINI_CONTROL - 0x3E8 */ #define HQV_H_MINIFY_ENABLE 0x00000800 #define HQV_V_MINIFY_ENABLE 0x08000000 #define HQV_VDEBLOCK_FILTER 0x80000000 #define HQV_HDEBLOCK_FILTER 0x00008000 #endif // __VIDREGS_H__ DirectFB-1.2.10/gfxdrivers/cle266/uc_primary.c0000644000175000017500000001305011245562152015642 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" /* primary layer hooks */ #define OSD_OPTIONS (DLOP_ALPHACHANNEL | DLOP_SRC_COLORKEY | DLOP_OPACITY) DisplayLayerFuncs ucOldPrimaryFuncs; void *ucOldPrimaryDriverData; static DFBResult osdInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { DFBResult ret; /* call the original initialization function first */ ret = ucOldPrimaryFuncs.InitLayer( layer, ucOldPrimaryDriverData, layer_data, description, config, adjustment ); if (ret) return ret; /* set name */ snprintf(description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "VIA CLE266 Graphics"); /* add support for options */ config->flags |= DLCONF_OPTIONS; config->pixelformat = dfb_config->mode.format ? dfb_config->mode.format : DSPF_ARGB; config->options = DLOP_ALPHACHANNEL; /* add some capabilities */ description->caps |= DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY | DLCAPS_SRC_COLORKEY; return DFB_OK; } static DFBResult osdTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { DFBResult ret; CoreLayerRegionConfigFlags fail = 0; DFBDisplayLayerOptions options = config->options; /* remove options before calling the original function */ config->options = DLOP_NONE; /* call the original function */ ret = ucOldPrimaryFuncs.TestRegion( layer, ucOldPrimaryDriverData, layer_data, config, &fail ); /* check options if specified */ if (options) { /* any unsupported option wanted? */ if (options & ~OSD_OPTIONS) fail |= CLRCF_OPTIONS; /* opacity and alpha channel cannot be used at once */ if ((options & (DLOP_OPACITY | DLOP_ALPHACHANNEL)) == (DLOP_OPACITY | DLOP_ALPHACHANNEL)) { fail |= CLRCF_OPTIONS; } } /* restore options */ config->options = options; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return ret; } static DFBResult osdSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { DFBResult ret; UcDriverData *ucdrv = (UcDriverData*) driver_data; /* call the original function */ ret = ucOldPrimaryFuncs.SetRegion( layer, ucOldPrimaryDriverData, layer_data, region_data, config, updated, surface, palette, lock ); if (ret) return ret; uc_ovl_vcmd_wait(ucdrv->hwregs); /* select pixel based or global alpha */ if (config->options & DLOP_ALPHACHANNEL) VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(-1)); else if (config->options & DLOP_OPACITY) VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(config->opacity)); else VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(0xff)); VIDEO_OUT(ucdrv->hwregs, V_COMPOSE_MODE, V1_COMMAND_FIRE); return DFB_OK; } DisplayLayerFuncs ucPrimaryFuncs = { .InitLayer = osdInitLayer, .TestRegion = osdTestRegion, .SetRegion = osdSetRegion, }; DirectFB-1.2.10/gfxdrivers/cle266/uc_overlay.h0000644000175000017500000000644611164361026015655 00000000000000#ifndef __UC_OVERLAY_H__ #define __UC_OVERLAY_H__ #define UC_OVL_CAPS (DLCAPS_SURFACE | DLCAPS_OPACITY | DLCAPS_SCREEN_LOCATION \ | DLCAPS_DEINTERLACING | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST \ | DLCAPS_SATURATION | DLCAPS_HUE) #define UC_OVL_OPTIONS (DLOP_DEINTERLACING) #define ALIGN_TO(v, n) (((v) + (n-1)) & ~(n-1)) #define UC_MAP_V1_FIFO_CONTROL(depth, pre_thr, thr) \ (((depth)-1) | ((thr) << 8) | ((pre_thr) << 24)) // Actions for uc_ovl_update() #define UC_OVL_FLIP 1 #define UC_OVL_CHANGE 2 #define UC_OVL_FIELD 4 /** Overlay layer data. */ struct uc_ovl_vinfo { bool isenabled; // True when visible DFBRectangle win; // Layer screen rectangle. DFBDisplayLayerConfig cfg; // Layer configuration int ox, oy; // Top-left visible corner (the offset) // in the source surface u8 opacity; // Layer opacity int level; // Position in the DirectFB layer stack // < 0 = underlay mode, > 0 = overlay mode DFBColorAdjustment adj; // Color adjustment (brightness etc) }; typedef struct _UcOverlayData { // TODO: initialize the variables!!! u8 hwrev; // CLE266 revision int scrwidth; // Current screen width bool extfifo_on; // True when we're using the extended fifo. u8 mclk_save[3]; struct uc_ovl_vinfo v1; // Video overlay V1 bool deinterlace; int field; CoreSurface *surface; CoreSurfaceBufferLock *lock; } UcOverlayData; // Video engine - mapping functions (uc_ovl_hwmap.c) bool uc_ovl_map_vzoom(int sh, int dh, u32* zoom, u32* mini); bool uc_ovl_map_hzoom(int sw, int dw, u32* zoom, u32* mini, u32* falign, u32* dcount); u32 uc_ovl_map_qwpitch(int falign, DFBSurfacePixelFormat format, int sw); u32 uc_ovl_map_format(DFBSurfacePixelFormat format); void uc_ovl_map_window(int scrw, int scrh, DFBRectangle* win, int sw, int sh, u32* win_start, u32* win_end, int* ox, int* oy); void uc_ovl_map_buffer(DFBSurfacePixelFormat format, u32 buf, int x, int y, int w, int h, int pitch, int field, u32* y_start, u32* u_start, u32* v_start); u32 uc_ovl_map_alpha(int opacity); void uc_ovl_map_v1_control(DFBSurfacePixelFormat format, int sw, int hwrev, bool extfifo_on, u32* control, u32* fifo); u32 uc_ovl_map_fifo(u8 depth, u8 pre_thr, u8 thr); void uc_ovl_map_adjustment(DFBColorAdjustment* adj, u32* a1, u32* a2); // Video engine - setting functions (uc_ovl_hwset.c) void uc_ovl_setup_fifo(UcOverlayData* ucovl, int scrwidth); void uc_ovl_vcmd_wait(volatile u8* vio); DFBResult uc_ovl_update(UcDriverData* ucdrv, UcOverlayData* ucovl, int action, CoreSurface* surface, CoreSurfaceBufferLock* lock); DFBResult uc_ovl_set_adjustment(CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj); #endif // __UC_OVERLAY_H__ DirectFB-1.2.10/gfxdrivers/cle266/uc_ovl_hwset.c0000644000175000017500000001711611164361026016175 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" #include #include /** * Set up the extended video FIFO. * @note It will be turned on if ucovl->scrwidth > 1024. */ void uc_ovl_setup_fifo(UcOverlayData* ucovl, int scrwidth) { u8* mclk_save = ucovl->mclk_save; if (!iopl(3)) { if (scrwidth <= 1024) { // Disable if (ucovl->extfifo_on) { dfb_layer_wait_vsync(dfb_layer_at(DLID_PRIMARY)); outb(0x16, 0x3c4); outb(mclk_save[0], 0x3c5); outb(0x17, 0x3c4); outb(mclk_save[1], 0x3c5); outb(0x18, 0x3c4); outb(mclk_save[2], 0x3c5); ucovl->extfifo_on = false; } } else { // Enable if (!ucovl->extfifo_on) { dfb_layer_wait_vsync(dfb_layer_at(DLID_PRIMARY)); // Save current setting outb(0x16, 0x3c4); mclk_save[0] = inb(0x3c5); outb(0x17, 0x3c4); mclk_save[1] = inb(0x3c5); outb(0x18, 0x3c4); mclk_save[2] = inb(0x3c5); // Enable extended FIFO outb(0x17, 0x3c4); outb(0x2f, 0x3c5); outb(0x16, 0x3c4); outb((mclk_save[0] & 0xf0) | 0x14, 0x3c5); outb(0x18, 0x3c4); outb(0x56, 0x3c5); ucovl->extfifo_on = true; } } } else { printf("cle266: could set io perissons\n"); } ucovl->scrwidth = scrwidth; } void uc_ovl_vcmd_wait(volatile u8* vio) { while ((VIDEO_IN(vio, V_COMPOSE_MODE) & (V1_COMMAND_FIRE | V3_COMMAND_FIRE))); } /** * Update the video overlay. * * @param action = UC_OVL_CHANGE: update everything * = UC_OVL_FLIP: only flip to the front surface buffer. * @param surface source surface * * @note: Derived from ddmpeg.c, Upd_Video() */ DFBResult uc_ovl_update(UcDriverData* ucdrv, UcOverlayData* ucovl, int action, CoreSurface* surface, CoreSurfaceBufferLock* lock) { int sw, sh, sp, sfmt; // Source width, height, pitch and format int dx, dy; // Destination position int dw, dh; // Destination width and height VideoMode *videomode; DFBRectangle scr; // Screen size bool write_buffers = false; bool write_settings = false; volatile u8* vio = ucdrv->hwregs; u32 win_start, win_end; // Overlay register settings u32 zoom, mini; u32 dcount, falign, qwpitch; u32 y_start, u_start, v_start; u32 v_ctrl, fifo_ctrl; int offset = lock->offset; if (!ucovl->v1.isenabled) return DFB_OK; qwpitch = 0; // Get screen size videomode = dfb_system_current_mode(); scr.w = videomode ? videomode->xres : 720; scr.h = videomode ? videomode->yres : 576; scr.x = 0; scr.y = 0; if (ucovl->scrwidth != scr.w) { // FIXME: fix uc_ovl_setup_fifo() // uc_ovl_setup_fifo(ucovl, scr.w); action |= UC_OVL_CHANGE; } D_ASSERT(surface); sw = surface->config.size.w; sh = surface->config.size.h; sp = lock->pitch; sfmt = surface->config.format; if (ucovl->deinterlace) { /*if (ucovl->field) offset += sp;*/ sh /= 2; //sp *= 2; } if (action & UC_OVL_CHANGE) { if ((sw > 4096) || (sh > 4096) || (sw < 32) || (sh < 1) || (sp > 0x1fff)) { D_DEBUG("Layer surface size is out of bounds."); return DFB_INVAREA; } dx = ucovl->v1.win.x; dy = ucovl->v1.win.y; dw = ucovl->v1.win.w; dh = ucovl->v1.win.h; // Get image format, FIFO size, etc. uc_ovl_map_v1_control(sfmt, sw, ucovl->hwrev, ucovl->extfifo_on, &v_ctrl, &fifo_ctrl); if (ucovl->deinterlace) { v_ctrl |= /*V1_BOB_ENABLE |*/ V1_FRAME_BASE; } // Get layer window. // The parts that fall outside the screen are clipped. uc_ovl_map_window(scr.w, scr.h, &(ucovl->v1.win), sw, sh, &win_start, &win_end, &ucovl->v1.ox, &ucovl->v1.oy); // Get scaling and data-fetch parameters // Note: the *_map_?zoom() functions return false if the scaling // is out of bounds. We don't act on it for now, because it only // makes the display look strange. zoom = 0; mini = 0; uc_ovl_map_vzoom(sh, dh, &zoom, &mini); uc_ovl_map_hzoom(sw, dw, &zoom, &mini, &falign, &dcount); qwpitch = uc_ovl_map_qwpitch(falign, sfmt, sw); write_settings = true; } if (action & (UC_OVL_FIELD | UC_OVL_FLIP | UC_OVL_CHANGE)) { int field = 0; // Update the buffer pointers if (ucovl->deinterlace) { field = ucovl->field; } uc_ovl_map_buffer(sfmt, offset, ucovl->v1.ox, ucovl->v1.oy, sw, surface->config.size.h, sp, 0/*field*/, &y_start, &u_start, &v_start); if (field) { y_start |= 0x08000000; } write_buffers = true; } // Write to the hardware /* if (write_settings || write_buffers) uc_ovl_vcmd_wait(vio);*/ if (write_settings) { VIDEO_OUT(vio, V1_CONTROL, v_ctrl); VIDEO_OUT(vio, V_FIFO_CONTROL, fifo_ctrl); VIDEO_OUT(vio, V1_WIN_START_Y, win_start); VIDEO_OUT(vio, V1_WIN_END_Y, win_end); VIDEO_OUT(vio, V1_SOURCE_HEIGHT, (sh << 16) | dcount); VIDEO_OUT(vio, V12_QWORD_PER_LINE, qwpitch); VIDEO_OUT(vio, V1_STRIDE, sp | ((sp >> 1) << 16)); VIDEO_OUT(vio, V1_MINI_CONTROL, mini); VIDEO_OUT(vio, V1_ZOOM_CONTROL, zoom); } if (write_buffers) { VIDEO_OUT(vio, V1_STARTADDR_0, y_start); VIDEO_OUT(vio, V1_STARTADDR_CB0, u_start); VIDEO_OUT(vio, V1_STARTADDR_CR0, v_start); } if (write_settings || write_buffers) { VIDEO_OUT(vio, V_COMPOSE_MODE, V1_COMMAND_FIRE); } return DFB_OK; } DFBResult uc_ovl_set_adjustment(CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; UcDriverData* ucdrv = (UcDriverData*) driver_data; DFBColorAdjustment* ucadj; u32 a1, a2; ucadj = &ucovl->v1.adj; if (adj->flags & DCAF_BRIGHTNESS) ucadj->brightness = adj->brightness; if (adj->flags & DCAF_CONTRAST) ucadj->contrast = adj->contrast; if (adj->flags & DCAF_HUE) ucadj->hue = adj->hue; if (adj->flags & DCAF_SATURATION) ucadj->saturation = adj->saturation; uc_ovl_map_adjustment(ucadj, &a1, &a2); VIDEO_OUT(ucdrv->hwregs, V1_ColorSpaceReg_1, a1); VIDEO_OUT(ucdrv->hwregs, V1_ColorSpaceReg_2, a2); return DFB_OK; } DirectFB-1.2.10/gfxdrivers/cle266/uc_fifo.c0000644000175000017500000001146611164361026015110 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include #include #include "uc_fifo.h" //#define UC_FIFO_DUMP_DATA // Private functions --------------------------------------------------------- /** * Pad the FIFO buffer to a 32 byte boundary. Used by uc_flush_agp(). * @note Equivalent DRI code is in via_ioctl::viaFlushPrimsLocked() */ static void uc_fifo_pad(struct uc_fifo* fifo) { switch (fifo->used & 0x7) { case 0: break; case 2: UC_FIFO_ADD(fifo, HALCYON_HEADER2); UC_FIFO_ADD(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); break; case 4: UC_FIFO_ADD(fifo, HALCYON_HEADER2); UC_FIFO_ADD(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); break; case 6: UC_FIFO_ADD(fifo, HALCYON_HEADER2); UC_FIFO_ADD(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); break; default: break; } } /** * Manually write the FIFO buffer to the hardware. * @note Equivalent DRI code is in via_ioctl::flush_sys() */ void uc_fifo_flush_sys(struct uc_fifo* fifo, volatile void *regs) { u32* p; u32* q; volatile u32* hwregs = regs; volatile u32* reg_tset = regs + VIA_REG_TRANSET; volatile u32* reg_tspace = regs + VIA_REG_TRANSPACE; int check2Dcmd; u32 addr; p = fifo->buf; q = fifo->head; check2Dcmd = 0; uc_fifo_pad(fifo); #ifdef UC_FIFO_DUMP_DATA printf("Flushing FIFO ... \n"); #endif while (p != q) { if (*p == HALCYON_HEADER2) { p++; check2Dcmd = !(*p == HALCYON_SUB_ADDR0); #ifdef UC_FIFO_DUMP_DATA printf("tset = 0x%08x\n", *p); #endif *reg_tset = *p; p++; } else if (check2Dcmd && ((*p & HALCYON_HEADER1MASK) == HALCYON_HEADER1)) { addr = (*p) & 0x0000001f; p++; #ifdef UC_FIFO_DUMP_DATA printf("2D (0x%02x) = 0x%x\n", addr << 2, *p); #endif *(hwregs + addr) = *p; p++; } else if ((*p & HALCYON_FIREMASK) == HALCYON_FIRECMD) { #ifdef UC_FIFO_DUMP_DATA printf("tspace = 0x%08x\n", *p); #endif *reg_tspace = *p; p++; if ((p != q) && ((*p & HALCYON_FIREMASK) == HALCYON_FIRECMD)) p++; if ((*p & HALCYON_CMDBMASK) != HC_ACMD_HCmdB) check2Dcmd = 1; } else { #ifdef UC_FIFO_DUMP_DATA printf("tspace = 0x%08x\n", *p); #endif *reg_tspace = *p; p++; } } fifo->head = fifo->buf; fifo->used = 0; fifo->prep = 0; } /** Use an AGP transfer to write the FIFO buffer to the hardware. Not implemented. */ #if 0 static void uc_fifo_flush_agp(struct uc_fifo* fifo) { // TODO - however, there is no point in doing this, because // an AGP transfer can require more register writes than // needed for drawing a single primitive. DirectFB needs to // adopt a begin/end architecture first, like OpenGL has. fifo->head = fifo->buf; fifo->used = 0; fifo->prep = 0; } #endif // Public functions ---------------------------------------------------------- /** Create a FIFO. Returns NULL on failure. */ struct uc_fifo* uc_fifo_create(FusionSHMPoolShared *pool, size_t size) { struct uc_fifo* fifo; size += 32; // Needed for padding. fifo = SHCALLOC(pool, 1, sizeof(struct uc_fifo)); if (!fifo) return NULL; // Note: malloc won't work for DMA buffers... fifo->buf = SHMALLOC(pool, sizeof(u32) * size); if (!(fifo->buf)) { SHFREE(pool, fifo); return NULL; } fifo->head = fifo->buf; fifo->used = 0; fifo->size = (unsigned int) size; fifo->prep = 0; //fifo->flush_sys = uc_fifo_flush_sys; //fifo->flush = uc_fifo_flush_sys; return fifo; } /** Destroy a FIFO */ void uc_fifo_destroy(FusionSHMPoolShared *pool, struct uc_fifo* fifo) { if (fifo) { if (fifo->buf) { SHFREE(pool, fifo->buf); fifo->buf = NULL; } SHFREE(pool, fifo); } } DirectFB-1.2.10/gfxdrivers/cle266/uc_hwset.c0000644000175000017500000003161611164361026015316 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ // Hardware setting functions ------------------------------------------------ #include #include "uc_hw.h" #include #include #include /// Integer 2-logarithm, y = log2(x), where x and y are integers. #define ILOG2(x,y) ILOG2_PORTABLE(x,y) #define ILOG2_PORTABLE(x,y) \ do { \ unsigned int i = 0; \ y = x; \ while (y != 0) { \ i++; \ y = y >> 1; \ } \ y = i-1; \ } while (0) #define ILOG2_X86(x,y) // TODO - use BSR (bit scan reverse) instruction /// Set alpha blending function (3D) void uc_set_blending_fn( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; struct uc_hw_alpha *hwalpha = &ucdev->hwalpha; if (UC_IS_VALID( uc_blending_fn )) return; uc_map_blending_fn( hwalpha, state->src_blend, state->dst_blend, state->destination->config.format ); UC_FIFO_PREPARE( fifo, 14 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLCsat, hwalpha->regHABLCsat ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLCop, hwalpha->regHABLCop ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLAsat, hwalpha->regHABLAsat ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLAop, hwalpha->regHABLAop ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRCa, hwalpha->regHABLRCa ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRFCa, hwalpha->regHABLRFCa ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRCbias, hwalpha->regHABLRCbias ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRCb, hwalpha->regHABLRCb ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRFCb, hwalpha->regHABLRFCb ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRAa, hwalpha->regHABLRAa ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRAb, hwalpha->regHABLRAb ); UC_FIFO_PAD_EVEN( fifo ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_blending_fn ); } /// Set texture environment (3D) void uc_set_texenv( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; struct uc_hw_texture *hwtex = &ucdev->hwtex; if (UC_IS_VALID( uc_texenv )) return; uc_map_blitflags( hwtex, state->blittingflags, state->source->config.format ); // Texture mapping method hwtex->regHTXnTB = HC_HTXnFLSs_Linear | HC_HTXnFLTs_Linear | HC_HTXnFLSe_Linear | HC_HTXnFLTe_Linear; hwtex->regHTXnMPMD = HC_HTXnMPMD_Sclamp | HC_HTXnMPMD_Tclamp; UC_FIFO_PREPARE( fifo, 12 ); UC_FIFO_ADD_HDR( fifo, (HC_ParaType_Tex << 16) | (HC_SubType_Tex0 << 24) ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTB, hwtex->regHTXnTB ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnMPMD, hwtex->regHTXnMPMD ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLCsat, hwtex->regHTXnTBLCsat_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLCop, hwtex->regHTXnTBLCop_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLMPfog, hwtex->regHTXnTBLMPfog_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLAsat, hwtex->regHTXnTBLAsat_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLRCb, hwtex->regHTXnTBLRCb_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLRAa, hwtex->regHTXnTBLRAa_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLRFog, hwtex->regHTXnTBLRFog_0 ); UC_FIFO_PAD_EVEN( fifo ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_texenv ); } /// Set clipping rectangle (2D and 3D) void uc_set_clip( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; if (DFB_REGION_EQUAL( ucdev->clip, state->clip )) return; UC_FIFO_PREPARE( fifo, 8 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); #ifdef UC_ENABLE_3D UC_FIFO_ADD_3D ( fifo, HC_SubA_HClipTB, (RS12(state->clip.y1) << 12) | RS12(state->clip.y2+1) ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HClipLR, (RS12(state->clip.x1) << 12) | RS12(state->clip.x2+1) ); #endif UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPTL, (RS16(state->clip.y1) << 16) | RS16(state->clip.x1) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPBR, (RS16(state->clip.y2) << 16) | RS16(state->clip.x2) ); UC_FIFO_CHECK( fifo ); ucdev->clip = state->clip; } /// Set destination (2D and 3D) void uc_set_destination( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; CoreSurface *destination = state->destination; DFBSurfacePixelFormat dst_format = destination->config.format; int dst_offset = state->dst.offset; int dst_pitch = state->dst.pitch; int dst_bpp = DFB_BYTES_PER_PIXEL( dst_format ); /* Save FIFO space and CPU cycles. */ if (ucdev->dst_format == dst_format && ucdev->dst_offset == dst_offset && ucdev->dst_pitch == dst_pitch) return; // 2D engine setting ucdev->pitch = (ucdev->pitch & 0x7fff) | (((dst_pitch >> 3) & 0x7fff) << 16); UC_FIFO_PREPARE( fifo, 12 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_PITCH, (VIA_PITCH_ENABLE | ucdev->pitch) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_DSTBASE, (dst_offset >> 3) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_GEMODE, (dst_bpp - 1) << 8 ); #ifdef UC_ENABLE_3D // 3D engine setting UC_FIFO_ADD_3D ( fifo, HC_SubA_HDBBasL, dst_offset & 0xffffff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HDBBasH, dst_offset >> 24 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HDBFM, (uc_map_dst_format( dst_format ) | (dst_pitch & HC_HDBPit_MASK) | HC_HDBLoc_Local) ); UC_FIFO_PAD_EVEN(fifo); #endif UC_FIFO_CHECK( fifo ); ucdev->dst_format = dst_format; ucdev->dst_offset = dst_offset; ucdev->dst_pitch = dst_pitch; } /// Set new source (2D) void uc_set_source_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; if (UC_IS_VALID( uc_source2d )) return; ucdev->pitch &= 0x7fff0000; ucdev->pitch |= (state->src.pitch >> 3) & 0x7fff; UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_SRCBASE, state->src.offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_PITCH, VIA_PITCH_ENABLE | ucdev->pitch ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_source2d ); } /// Set new source (3D) void uc_set_source_3d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; struct uc_hw_texture *hwtex = &ucdev->hwtex; CoreSurface *source = state->source; int src_height, src_offset, src_pitch; if (UC_IS_VALID( uc_source3d )) return; src_height = source->config.size.h; src_offset = state->src.offset; src_pitch = state->src.pitch; /* * TODO: Check if we can set the odd/even field as L1/L2 texture and select * between L0/L1/L2 upon blit. Otherwise we depend on SMF_BLITTINGFLAGS ;( */ if (state->blittingflags & DSBLIT_DEINTERLACE) { if (source->field) src_offset += src_pitch; src_height >>= 1; src_pitch <<= 1; } ucdev->field = source->field; // Round texture size up to nearest // value evenly divisible by 2^n ILOG2(source->config.size.w, hwtex->we); hwtex->l2w = 1 << hwtex->we; if (hwtex->l2w < source->config.size.w) { hwtex->we++; hwtex->l2w <<= 1; } ILOG2(src_height, hwtex->he); hwtex->l2h = 1 << hwtex->he; if (hwtex->l2h < src_height) { hwtex->he++; hwtex->l2h <<= 1; } hwtex->format = uc_map_src_format_3d( source->config.format ); UC_FIFO_PREPARE( fifo, 10); UC_FIFO_ADD_HDR( fifo, (HC_ParaType_Tex << 16) | (HC_SubType_Tex0 << 24)); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnFM, HC_HTXnLoc_Local | hwtex->format ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0OS, (0 << HC_HTXnLVmax_SHIFT) ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0_5WE, hwtex->we ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0_5HE, hwtex->he ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL012BasH, (src_offset >> 24) & 0xff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0BasL, (src_offset ) & 0xffffff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0Pit, (HC_HTXnEnPit_MASK | src_pitch) ); UC_FIFO_PAD_EVEN( fifo ); UC_FIFO_CHECK( fifo ); // Upload the palette of a 256 color texture. if (hwtex->format == HC_HTXnFM_Index8) { int i, num; DFBColor *colors; UC_FIFO_PREPARE( fifo, 258 ); UC_FIFO_ADD_HDR( fifo, ((HC_ParaType_Palette << 16) | (HC_SubType_TexPalette0 << 24)) ); colors = source->palette->entries; num = source->palette->num_entries; if (num > 256) num = 256; /* What about the last entry? -- dok */ for (i = 0; i < num; i++) UC_FIFO_ADD( fifo, PIXEL_ARGB(colors[i].a, colors[i].r, colors[i].g, colors[i].b) ); for (; i < 256; i++) UC_FIFO_ADD( fifo, 0 ); UC_FIFO_CHECK( fifo ); } UC_VALIDATE( uc_source3d ); } /// Set either destination color key, or fill color, as needed. (2D) void uc_set_color_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; u32 color = 0; if (UC_IS_VALID( uc_color2d )) return; switch (state->destination->config.format) { case DSPF_ARGB1555: color = PIXEL_ARGB1555( state->color.a, state->color.r, state->color.g, state->color.b ); color |= color << 16; break; case DSPF_RGB16: color = PIXEL_RGB16( state->color.r, state->color.g, state->color.b); color |= color << 16; break; case DSPF_RGB32: case DSPF_ARGB: color = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); break; default: D_BUG( "unexpected pixel format" ); } UC_FIFO_PREPARE( fifo, 8 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); // Opaque line drawing needs this UC_FIFO_ADD_2D( fifo, VIA_REG_MONOPAT0, 0xff ); UC_FIFO_ADD_2D( fifo, VIA_REG_KEYCONTROL, 0 ); UC_FIFO_ADD_2D( fifo, VIA_REG_FGCOLOR, color ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_color2d ); UC_INVALIDATE( uc_colorkey2d ); } void uc_set_colorkey_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; if (UC_IS_VALID( uc_colorkey2d )) return; if (state->blittingflags & DSBLIT_SRC_COLORKEY) { UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_KEYCONTROL, VIA_KEY_ENABLE_SRCKEY ); UC_FIFO_ADD_2D ( fifo, VIA_REG_BGCOLOR, state->src_colorkey ); } else if (state->blittingflags & DSBLIT_DST_COLORKEY) { UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_KEYCONTROL, VIA_KEY_ENABLE_DSTKEY | VIA_KEY_INVERT_KEY ); UC_FIFO_ADD_2D ( fifo, VIA_REG_FGCOLOR, state->dst_colorkey ); } else { UC_FIFO_PREPARE( fifo, 4 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_KEYCONTROL, 0 ); } UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_colorkey2d ); UC_INVALIDATE( uc_color2d ); } DirectFB-1.2.10/gfxdrivers/cle266/uc_hwmap.c0000644000175000017500000003550311164361026015277 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ // Hardware mapping functions ------------------------------------------------ #include #include "uc_hw.h" #include /// Map DirectFB blending functions to hardware void uc_map_blending_fn( struct uc_hw_alpha *hwalpha, DFBSurfaceBlendFunction sblend, DFBSurfaceBlendFunction dblend, DFBSurfacePixelFormat dst_format ) { bool dst_alpha = DFB_PIXELFORMAT_HAS_ALPHA(dst_format); // The HW's blending equation is: // (Ca * FCa + Cbias + Cb * FCb) << Cshift // Set source blending function // Ca -- always from source color. hwalpha->regHABLCsat = HC_HABLCsat_MASK | HC_HABLCa_OPC | HC_HABLCa_Csrc; // Aa -- always from source alpha. hwalpha->regHABLAsat = HC_HABLAsat_MASK | HC_HABLAa_OPA | HC_HABLAa_Asrc; // FCa and FAa depend on the following condition. switch (sblend) { case DSBF_ZERO: // GL_ZERO -- (0, 0, 0, 0) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; break; case DSBF_ONE: // GL_ONE -- (1, 1, 1, 1) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; break; case DSBF_SRCCOLOR: // GL_SRC_COLOR -- (Rs, Gs, Bs, As) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Csrc; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Asrc; break; case DSBF_INVSRCCOLOR: // GL_ONE_MINUS_SRC_COLOR -- (1, 1, 1, 1) - (Rs, Gs, Bs, As) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Csrc; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Asrc; break; case DSBF_SRCALPHA: // GL_SRC_ALPHA -- (As, As, As, As) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Asrc; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Asrc; break; case DSBF_INVSRCALPHA: // GL_ONE_MINUS_SRC_ALPHA -- (1, 1, 1, 1) - (As, As, As, As) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Asrc; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Asrc; break; case DSBF_DESTALPHA: // GL_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } else { // (Ad, Ad, Ad, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Adst; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Adst; } break; case DSBF_INVDESTALPHA: // GL_ONE_MINUS_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) - (1, 1, 1, 1) = (0, 0, 0, 0) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } else { // (1, 1, 1, 1) - (Ad, Ad, Ad, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Adst; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Adst; } break; case DSBF_DESTCOLOR: // GL_DST_COLOR -- (Rd, Gd, Bd, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Cdst; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Adst; break; case DSBF_INVDESTCOLOR: // GL_ONE_MINUS_DST_COLOR -- (1, 1, 1, 1) - (Rd, Gd, Bd, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Cdst; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Adst; break; case DSBF_SRCALPHASAT: // GL_SRC_ALPHA_SATURATE if (!dst_alpha) { // (f, f, f, 1), f = min(As, 1 - Ad) = min(As, 1 - 1) = 0 // So (f, f, f, 1) = (0, 0, 0, 1) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } else { // (f, f, f, 1), f = min(As, 1 - Ad) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_mimAsrcInvAdst; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } break; default: D_BUG("Unsupported blending function!"); break; } // Set destination blending function // Op is add. // bias is 0. hwalpha->regHABLCsat |= HC_HABLCbias_HABLRCbias; hwalpha->regHABLAsat |= HC_HABLAbias_HABLRAbias; // Cb -- always from destination color. hwalpha->regHABLCop = HC_HABLCb_OPC | HC_HABLCb_Cdst; // Ab -- always from destination alpha. hwalpha->regHABLAop = HC_HABLAb_OPA | HC_HABLAb_Adst; // FCb -- depends on the following condition. switch (dblend) { case DSBF_ZERO: // GL_ZERO -- (0, 0, 0, 0) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; break; case DSBF_ONE: // GL_ONE -- (1, 1, 1, 1) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; break; case DSBF_SRCCOLOR: // GL_SRC_COLOR -- (Rs, Gs, Bs, As) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Csrc; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Asrc; break; case DSBF_INVSRCCOLOR: // GL_ONE_MINUS_SRC_COLOR -- (1, 1, 1, 1) - (Rs, Gs, Bs, As) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Csrc; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Asrc; break; case DSBF_SRCALPHA: // GL_SRC_ALPHA -- (As, As, As, As) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Asrc; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Asrc; break; case DSBF_INVSRCALPHA: // GL_ONE_MINUS_SRC_ALPHA -- (1, 1, 1, 1) - (As, As, As, As) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Asrc; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_0; break; case DSBF_DESTALPHA: // GL_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; } else { // (Ad, Ad, Ad, Ad) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Adst; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Adst; } break; case DSBF_INVDESTALPHA: // GL_ONE_MINUS_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) - (1, 1, 1, 1) = (0, 0, 0, 0) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; } else { // (1, 1, 1, 1) - (Ad, Ad, Ad, Ad) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Adst; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Adst; } break; case DSBF_DESTCOLOR: // GL_DST_COLOR -- (Rd, Gd, Bd, Ad) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Cdst; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Adst; break; case DSBF_INVDESTCOLOR: // GL_ONE_MINUS_DST_COLOR -- (1, 1, 1, 1) - (Rd, Gd, Bd, Ad) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Cdst; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Adst; break; case DSBF_SRCALPHASAT: // Unsupported? default: hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; break; } } /// Map DFBSurfaceBlittingFlags to the hardware void uc_map_blitflags( struct uc_hw_texture *tex, DFBSurfaceBlittingFlags bflags, DFBSurfacePixelFormat sformat ) { bool gotalpha = DFB_PIXELFORMAT_HAS_ALPHA(sformat); if (bflags & DSBLIT_COLORIZE) { // Cv0 = Ct*Cf // Hw setting: // Ca = Ct, Cb = Cf, Cop = +, Cc = 0, Cbias = 0, Cshift = No. tex->regHTXnTBLCsat_0 = HC_HTXnTBLCsat_MASK | HC_HTXnTBLCa_TOPC | HC_HTXnTBLCa_Tex | HC_HTXnTBLCb_TOPC | HC_HTXnTBLCb_Dif | HC_HTXnTBLCc_TOPC | HC_HTXnTBLCc_0; tex->regHTXnTBLCop_0 = HC_HTXnTBLCop_Add | HC_HTXnTBLCbias_Cbias | HC_HTXnTBLCbias_0 | HC_HTXnTBLCshift_No; tex->regHTXnTBLMPfog_0 = HC_HTXnTBLMPfog_0; } else { // Cv0 = Ct // Hw setting: // Ca = 0, Cb = 0, Cop = +, Cc = 0, Cbias = Ct, Cshift = No. tex->regHTXnTBLCsat_0 = HC_HTXnTBLCsat_MASK | HC_HTXnTBLCa_TOPC | HC_HTXnTBLCa_0 | HC_HTXnTBLCb_TOPC | HC_HTXnTBLCb_0 | HC_HTXnTBLCc_TOPC | HC_HTXnTBLCc_0; tex->regHTXnTBLCop_0 = HC_HTXnTBLCop_Add | HC_HTXnTBLCbias_Cbias | HC_HTXnTBLCbias_Tex | HC_HTXnTBLCshift_No; tex->regHTXnTBLMPfog_0 = HC_HTXnTBLMPfog_0; } if (bflags & DSBLIT_BLEND_COLORALPHA) { if ((bflags & DSBLIT_BLEND_ALPHACHANNEL) && gotalpha) { // Av0 = At*Af // Hw setting: // Aa = At, Ab = Af, Cop = +, Ac = 0, Abias = 0, Ashift = No. tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_Atex | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_Adif | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_HTXnTBLRAbias | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } else { // (!(bflags & DSBLIT_BLEND_ALPHACHANNEL) && gotalpha) || !gotalpha // Av0 = Af // Hw setting: // Aa = 0, Ab = 0, Cop = +, Ac = 0, Abias = Af, Ashift = No. tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_HTXnTBLRA | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_HTXnTBLRA | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_Adif | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } } else { // !(bflags & DSBLIT_BLEND_COLORALPHA) if ((bflags & DSBLIT_BLEND_ALPHACHANNEL) && gotalpha) { // Av0 = At // Hw setting: // Aa = 0, Ab = 0, Cop = +, Ac = 0, Abias = At, Ashift = No. tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_HTXnTBLRA | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_HTXnTBLRA | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_Atex | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } else { // !gotalpha // Av0 = 1.0 // D_BUG warning: I'm guessing where values should go, // and how big (0xff = 1.0 ?) it should be. // Hw setting: // Aa = 1.0, Ab = 1.0, Cop = -, Ac = 1.0, Abias = 1.0, Ashift = No. // => Av = Aa*(Ab-Ac) + Abias = 1*(1-1)+1 = 1 tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_HTXnTBLRA | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_HTXnTBLRA | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_Inv | HC_HTXnTBLAbias_HTXnTBLRAbias | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } } } DirectFB-1.2.10/gfxdrivers/cle266/uc_ovl_hwmap.c0000644000175000017500000003554111164361026016161 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" #include /** * Map hw settings for vertical scaling. * * @param sh source height * @param dh destination height * @param zoom will hold vertical setting of zoom register. * @param mini will hold vertical setting of mini register. * * @returns true if successful. * false if the zooming factor is too large or small. * * @note Derived from VIA's V4L driver. * See ddover.c, DDOVER_HQVCalcZoomHeight() */ bool uc_ovl_map_vzoom(int sh, int dh, u32* zoom, u32* mini) { u32 sh1, tmp, d; bool zoom_ok = true; if (sh == dh) { // No zoom // Do nothing } else if (sh < dh) { // Zoom in tmp = (sh * 0x0400) / dh; zoom_ok = !(tmp > 0x3ff); *zoom |= (tmp & 0x3ff) | V1_Y_ZOOM_ENABLE; *mini |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; } else { // sw > dh - Zoom out // Find a suitable divider (1 << d) = {2, 4, 8 or 16} sh1 = sh; for (d = 1; d < 5; d++) { sh1 >>= 1; if (sh1 <= dh) break; } if (d == 5) { // Too small. d = 4; zoom_ok = false; } *mini |= ((d<<1)-1) << 16; // <= {1,3,5,7} << 16 // Add scaling if (sh1 < dh) { tmp = (sh1 * 0x400) / dh; *zoom |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); *mini |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; } } return zoom_ok; } /** * Map hw settings for horizontal scaling. * * @param sw source width * @param dw destination width * * @param zoom will hold horizontal setting of zoom register. * @param mini will hold horizontal setting of mini register. * @param falign will hold fetch aligment * @param dcount will hold display count * * @returns true if successful. * false if the zooming factor is too large or small. * * @note Derived from VIA's V4L driver. * See ddover.c, DDOVER_HQVCalcZoomWidth() and DDOver_GetDisplayCount() */ bool uc_ovl_map_hzoom(int sw, int dw, u32* zoom, u32* mini, u32* falign, u32* dcount) { u32 tmp, sw1, d; int md; // Minify-divider bool zoom_ok = true; md = 1; *falign = 0; if (sw == dw) { // No zoom // Do nothing } else if (sw < dw) { // Zoom in tmp = (sw * 0x0800) / dw; zoom_ok = !(tmp > 0x7ff); *zoom |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; *mini |= V1_X_INTERPOLY; } else { // sw > dw - Zoom out // Find a suitable divider (1 << d) = {2, 4, 8 or 16} sw1 = sw; for (d = 1; d < 5; d++) { sw1 >>= 1; if (sw1 <= dw) break; } if (d == 5) { // Too small. d = 4; zoom_ok = false; } md = 1 << d; // <= {2,4,8,16} *falign = ((md<<1)-1) & 0xf; // <= {3,7,15,15} *mini |= V1_X_INTERPOLY; *mini |= ((d<<1)-1) << 24; // <= {1,3,5,7} << 24 // Add scaling if (sw1 < dw) { //CLE bug //tmp = sw1*0x0800 / dw; tmp = (sw1 - 2) * 0x0800 / dw; *zoom |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; } } *dcount = sw - md; return zoom_ok; } /** * @param falign fetch alignment * @param format overlay pixel format * @param sw source width * * @returns qword pitch register setting * * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetFetch() * @note Only call after uc_ovl_map_hzoom() */ u32 uc_ovl_map_qwpitch(int falign, DFBSurfacePixelFormat format, int sw) { int fetch = 0; switch (format) { case DSPF_YV12: fetch = ALIGN_TO(sw, 32) >> 4; break; case DSPF_I420: fetch = (ALIGN_TO(sw, 16) >> 4) + 1; break; case DSPF_UYVY: case DSPF_YUY2: fetch = (ALIGN_TO(sw << 1, 16) >> 4) + 1; break; case DSPF_ARGB1555: case DSPF_RGB16: fetch = (ALIGN_TO(sw << 1, 16) >> 4) + 1; break; case DSPF_RGB32: case DSPF_ARGB: fetch = (ALIGN_TO(sw << 2, 16) >> 4) + 1; break; default: D_BUG("Unexpected pixelformat!"); break; } if (fetch < 4) fetch = 4; // Note: Unsure if alignment is needed or is in the way. fetch = ALIGN_TO(fetch, falign + 1); return fetch << 20; // V12_QWORD_PER_LINE } /** * Map pixel format. * * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetV1Format() */ u32 uc_ovl_map_format(DFBSurfacePixelFormat format) { switch (format) { case DSPF_YV12: case DSPF_I420: return V1_COLORSPACE_SIGN | V1_YUV420; case DSPF_UYVY: case DSPF_YUY2: return V1_COLORSPACE_SIGN | V1_YUV422; case DSPF_ARGB1555: return V1_RGB15; case DSPF_RGB16: return V1_RGB16; case DSPF_RGB32: case DSPF_ARGB: return V1_RGB32; default : D_BUG("Unexpected pixelformat!"); return V1_YUV422; } } /** * Map overlay window. * * @param scrw screen width (eg. 800) * @param scrh screen height (eg. 600) * @param win destination window * @param sw source surface width * @param sh source surface height * * @param win_start will hold window start register setting * @param win_end will hold window end register setting * * @parm ox will hold new leftmost coordinate in source surface * @parm oy will hold new topmost coordinate in source surface */ void uc_ovl_map_window(int scrw, int scrh, DFBRectangle* win, int sw, int sh, u32* win_start, u32* win_end, int* ox, int* oy) { int x1, y1, x2, y2; int x,y,dw,dh; // These help making the code readable... *ox = 0; *oy = 0; *win_start = 0; *win_end = 0; x = win->x; y = win->y; dw = win->w; dh = win->h; // For testing the clipping //scrw -= 100; //scrh -= 100; // Handle invisible case. if ((x > scrw) || (y > scrh) || (x+dw < 0) || (y+dh < 0)) return; // Vertical clipping if ((y >= 0) && (y+dh < scrh)) { // No clipping y1 = y; y2 = y+dh-1; } else if ((y < 0) && (y+dh < scrh)) { // Top clip y1 = 0; y2 = y+dh-1; *oy = (int) (((float) (sh * -y)) / ((float) dh) + 0.5); } else if ((y >= 0) && (y+dh >= scrh)) { // Bottom clip y1 = y; y2 = scrh-1; } else { // if (y < 0) && (y+dh >= scrh) // Top and bottom clip y1 = 0; y2 = scrh-1; *oy = (int) (((float) (sh * -y)) / ((float) dh) + 0.5); } // Horizontal clipping if ((x >= 0) && (x+dw < scrw)) { // No clipping x1 = x; x2 = x+dw-1; } else if ((x < 0) && (x+dw < scrw)) { // Left clip x1 = 0; x2 = x+dw-1; *ox = (int) (((float) (sw * -x)) / ((float) dw) + 0.5); } else if ((x >= 0) && (x+dw >= scrw)) { // Right clip x1 = x; x2 = scrw-1; } else { // if (x < 0) && (x+dw >= scrw) // Left and right clip x1 = 0; x2 = scrw-1; *ox = (int) (((float) (sw * -x)) / ((float) dw) + 0.5); } *win_start = (x1 << 16) | y1; *win_end = (x2 << 16) | y2; // For testing the clipping //*win_start = ((x1+50) << 16) | (y1+50); //*win_end = ((x2+50) << 16) | (y2+50); } /** * Map overlay buffer address. * * @param format pixel format * @param buf Framebuffer address of surface (0 = start of framebuffer) * @param ox leftmost pixel to show (used when clipping, else set to zero) * @param oy topmost pixel to show (used when clipping, else set to zero) * @param w total surface width (does *not* depend on the x parameter) * @param h total surface height (does *not* depend on the y parameter) * @param pitch source surface pitch (bytes per pixel) * * @param y_start will hold start address of Y(UV) or RGB buffer * @param u_start will hold start address of Cb buffer (planar modes only) * @param v_start will hold start address of Cr buffer (planar modes only) * * @note Derived from VIA's V4L driver. See ddover.c, * DDOver_GetSrcStartAddress() and DDOVer_GetYCbCrStartAddress() */ void uc_ovl_map_buffer(DFBSurfacePixelFormat format, u32 buf, int ox, int oy, int sw, int sh, int sp, int field, u32* y_start, u32* u_start, u32* v_start) { int swap_cb_cr = 0; u32 tmp; u32 y_offset, uv_offset = 0; switch (format) { case DSPF_YUY2: case DSPF_UYVY: y_offset = ((oy * sp) + ((ox << 1) & ~15)); break; case DSPF_YV12: swap_cb_cr = 1; case DSPF_I420: y_offset = ((((oy & ~3) * sp) + ox) & ~31) ; if (oy > 0) uv_offset = (((((oy & ~3) >> 1) * sp) + ox) & ~31) >> 1; else uv_offset = y_offset >> 1; break; case DSPF_ARGB1555: case DSPF_RGB16: y_offset = (oy * sp) + ((ox * 16) >> 3); break; case DSPF_RGB32: case DSPF_ARGB: y_offset = (oy * sp) + ((ox * 32) >> 3); break; default: y_offset = 0; uv_offset = 0; D_BUG("Unexpected pixelformat!"); } if (field) { y_offset += sp; uv_offset += sp >> 1; } *y_start = buf + y_offset; if (u_start && v_start) { *u_start = buf + sp * sh + uv_offset; *v_start = buf + sp * sh + sp * (sh >> 2) + uv_offset; if (swap_cb_cr) { tmp = *u_start; *u_start = *v_start; *v_start = tmp; } } } /** * Map alpha mode and opacity. * * @param opacity Alpha opacity: 0 = transparent, 255 = opaque. * -1 = Use alpha from underlying graphics. * * @returns alpha control register setting. * * @note: Unfortunately, if using alpha from underlying graphics, * the video is opaque if alpha = 255 and transparent if = 0. * The inverse would have made more sense ... * * @note: The hardware supports a separate alpha plane as well, * but it is not implemented here. * * @note: Derived from ddmpeg.c, VIAAlphaWin() */ u32 uc_ovl_map_alpha(int opacity) { u32 ctrl = 0x00080000; // Not sure what this number is, supposedly // it is the "expire number divided by 4". if (opacity > 255) opacity = 255; if (opacity < 0) { ctrl |= ALPHA_WIN_BLENDING_GRAPHIC; } else { opacity = opacity >> 4; // Throw away bits 0 - 3 ctrl |= (opacity << 12) | ALPHA_WIN_BLENDING_CONSTANT; } return ctrl; // V_ALPHA_CONTROL } /** * Calculate V1 control and fifo-control register values * @param format pixel format * @param sw source width * @param hwrev CLE266 hardware revision * @param extfifo_on set this true if the extended FIFO is enabled * @param control will hold value for V1_CONTROL * @param fifo will hold value for V1_FIFO_CONTROL */ void uc_ovl_map_v1_control(DFBSurfacePixelFormat format, int sw, int hwrev, bool extfifo_on, u32* control, u32* fifo) { *control = V1_BOB_ENABLE | V1_ENABLE | uc_ovl_map_format(format); if (hwrev == 0x10) { *control |= V1_EXPIRE_NUM_F; } else { if (extfifo_on) { *control |= V1_EXPIRE_NUM_A | V1_FIFO_EXTENDED; } else { *control |= V1_EXPIRE_NUM; } } if ((format == DSPF_YV12) || (format == DSPF_I420)) { //Minified video will be skewed without this workaround. if (sw <= 80) { //Fetch count <= 5 *fifo = UC_MAP_V1_FIFO_CONTROL(16,0,0); } else { if (hwrev == 0x10) *fifo = UC_MAP_V1_FIFO_CONTROL(64,56,56); else *fifo = UC_MAP_V1_FIFO_CONTROL(16,12,8); } } else { if (hwrev == 0x10) { *fifo = UC_MAP_V1_FIFO_CONTROL(64,56,56); // Default rev 0x10 } else { if (extfifo_on) *fifo = UC_MAP_V1_FIFO_CONTROL(48,40,40); else *fifo = UC_MAP_V1_FIFO_CONTROL(32,29,16); // Default } } } /** uc_ovl_map_adjustment() helper - clamp x to [lo, hi] */ static float clamp(float x, float lo, float hi) { return (x < lo) ? lo : ((x > hi) ? hi : x); /* 2 nested if's. */ } /** * uc_ovl_map_adjustment() helper - format x for the hardware. * * @param x The value to format. * @param ndec Number of binary decimals. * @param sbit sign bit position. * =0: use two's complement representation * >0: use a sign bit + positive value. * @param mask Bitmask * @param shift Position in hardware register. */ static int fmt(float x, int ndec, int sbit, u32 mask, int shift) { int y = (x * (1 << ndec)); if (sbit && (y < 0)) y = -y | (1 << sbit); return (((u32) y) & mask) << shift; } /** * Map color adjustment to CLE266 hardware. * * @param adj DirectFB color adjustment. All fields are assumed valid. * @param a1 Will hold value for V1_ColorSpaceReg_1 * @param a2 Will hold value for V1_ColorSpaceReg_2 */ void uc_ovl_map_adjustment(DFBColorAdjustment* adj, u32* a1, u32* a2) { float con, sat, bri, hue; float c, s; float A, B1, C1, D, B2, C2, B3, C3; // Map contrast to [0, 2.0] (preferred: [0, 1.66]), default: 1.0. con = (float) adj->contrast / 32768.0; // Map saturation to [0, 2.0], default: 1.0. sat = (float) adj->saturation / 32768.0; // Map brightness to [-121, 125], (preferred: [-94, 125.1]), default: 3.97. bri = (float) (adj->brightness - 31696) / 270.48; // Map hue to [-pi, pi], default is 0.0. hue = (float) (adj->hue - 32768) / 10430.378; // Note: The limits are estimates that need testing. // Map parameters to hw registers. s = sin(hue) * con * sat; c = cos(hue) * con * sat; A = clamp(1.164*con, 0, 1.9375); B1 = clamp(-1.596*s, -0.75, 0.75); C1 = clamp(1.596*c, 1, 2.875); B2 = clamp( (0.813*s - 0.391*c), 0, -0.875); C2 = clamp(-(0.813*c + 0.391*s), 0, -1.875); B3 = clamp(2.018*c, 0, 3.75); C3 = clamp(2.018*s, -1.25, 1.25); D = clamp(1.164*(bri-16), -128, 127); *a1 = fmt(A, 4, 0, 0x1f, 24) | fmt(B1, 2, 2, 0x07, 18) | fmt(C1, 3, 0, 0x1f, 9) | fmt(D, 0, 0, 0xff, 0); *a2 = fmt(B2, 3, 4, 0x7, 25) | fmt(C2, 3, 4, 0xf, 17) | fmt(B3, 2, 0, 0xf, 10) | fmt(C3, 2, 3, 0xf, 2); } DirectFB-1.2.10/gfxdrivers/sis315/0000777000175000017500000000000011307522571013437 500000000000000DirectFB-1.2.10/gfxdrivers/sis315/Makefile.am0000644000175000017500000000147011245562152015411 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/sis315 INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems sis315_LTLIBRARIES = libdirectfb_sis315.la if BUILD_STATIC sis315_DATA = $(sis315_LTLIBRARIES:.la=.o) endif sis315dir = $(MODULEDIR)/gfxdrivers libdirectfb_sis315_la_SOURCES = \ sis315.c \ sis315.h \ sis315_accel.c \ sis315_accel.h \ sis315_compat.h \ sis315_mmio.c \ sis315_mmio.h \ sis315_regs.h \ sis315_state.c \ sis315_state.h libdirectfb_sis315_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_sis315_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/sis315/Makefile.in0000644000175000017500000004561711307521500015424 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/sis315 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(sis315dir)" "$(DESTDIR)$(sis315dir)" sis315LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(sis315_LTLIBRARIES) libdirectfb_sis315_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_sis315_la_OBJECTS = sis315.lo sis315_accel.lo \ sis315_mmio.lo sis315_state.lo libdirectfb_sis315_la_OBJECTS = $(am_libdirectfb_sis315_la_OBJECTS) libdirectfb_sis315_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_sis315_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_sis315_la_SOURCES) DIST_SOURCES = $(libdirectfb_sis315_la_SOURCES) sis315DATA_INSTALL = $(INSTALL_DATA) DATA = $(sis315_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems sis315_LTLIBRARIES = libdirectfb_sis315.la @BUILD_STATIC_TRUE@sis315_DATA = $(sis315_LTLIBRARIES:.la=.o) sis315dir = $(MODULEDIR)/gfxdrivers libdirectfb_sis315_la_SOURCES = \ sis315.c \ sis315.h \ sis315_accel.c \ sis315_accel.h \ sis315_compat.h \ sis315_mmio.c \ sis315_mmio.h \ sis315_regs.h \ sis315_state.c \ sis315_state.h libdirectfb_sis315_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_sis315_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/sis315/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/sis315/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-sis315LTLIBRARIES: $(sis315_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(sis315dir)" || $(MKDIR_P) "$(DESTDIR)$(sis315dir)" @list='$(sis315_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sis315LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(sis315dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sis315LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(sis315dir)/$$f"; \ else :; fi; \ done uninstall-sis315LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(sis315_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(sis315dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(sis315dir)/$$p"; \ done clean-sis315LTLIBRARIES: -test -z "$(sis315_LTLIBRARIES)" || rm -f $(sis315_LTLIBRARIES) @list='$(sis315_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_sis315.la: $(libdirectfb_sis315_la_OBJECTS) $(libdirectfb_sis315_la_DEPENDENCIES) $(libdirectfb_sis315_la_LINK) -rpath $(sis315dir) $(libdirectfb_sis315_la_OBJECTS) $(libdirectfb_sis315_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sis315.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sis315_accel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sis315_mmio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sis315_state.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-sis315DATA: $(sis315_DATA) @$(NORMAL_INSTALL) test -z "$(sis315dir)" || $(MKDIR_P) "$(DESTDIR)$(sis315dir)" @list='$(sis315_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sis315DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sis315dir)/$$f'"; \ $(sis315DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sis315dir)/$$f"; \ done uninstall-sis315DATA: @$(NORMAL_UNINSTALL) @list='$(sis315_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sis315dir)/$$f'"; \ rm -f "$(DESTDIR)$(sis315dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(sis315dir)" "$(DESTDIR)$(sis315dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-sis315LTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-sis315DATA install-sis315LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sis315DATA uninstall-sis315LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sis315LTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sis315DATA install-sis315LTLIBRARIES install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-sis315DATA \ uninstall-sis315LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/sis315/sis315.h0000644000175000017500000000265611245562152014564 00000000000000/* * $Id: sis315.h,v 1.6 2006-11-28 10:53:42 klan Exp $ * * Copyright (C) 2003 by Andreas Oberritter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #ifndef _SIS315_H #define _SIS315_H #include typedef struct { volatile u8 *mmio_base; bool has_auto_maximize; u32 auto_maximize; /* ioctls */ int get_info; int get_automaximize; int set_automaximize; } SiSDriverData; typedef struct { /* state validation */ int v_blittingflags; int v_color; int v_destination; int v_source; int v_dst_colorkey; int v_src_colorkey; /* stored values */ int blit_cmd; int blit_rop; int cmd_bpp; int color; int src_offset; int src_pitch; int dst_offset; int dst_pitch; } SiSDeviceData; #endif /* _SIS315_H */ DirectFB-1.2.10/gfxdrivers/sis315/sis315_mmio.c0000644000175000017500000000260211245562152015567 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sis315_mmio.h" u32 sis_rl(volatile u8 *mmio, unsigned int offset) { return *(volatile u32 *)(mmio + offset); } void sis_wl(volatile u8 *mmio, unsigned int offset, u32 value) { *(volatile u32 *)(mmio + offset) = value; } DirectFB-1.2.10/gfxdrivers/sis315/sis315_compat.h0000644000175000017500000000537311245562152016126 00000000000000#ifndef _SIS315_COMPAT_H #define _SIS315_COMPAT_H #include #include #ifndef FB_ACCEL_SIS_GLAMOUR_2 #define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */ #endif #ifndef FB_ACCEL_SIS_XABRE #define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */ #endif struct sisfb_info { u32 sisfb_id; /* for identifying sisfb */ #ifndef SISFB_ID #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ #endif u32 chip_id; /* PCI-ID of detected chip */ u32 memory; /* total video memory in KB */ u32 heapstart; /* heap start offset in KB */ u8 fbvidmode; /* current sisfb mode */ u8 sisfb_version; u8 sisfb_revision; u8 sisfb_patchlevel; u8 sisfb_caps; /* sisfb capabilities */ u32 sisfb_tqlen; /* turbo queue length (in KB) */ u32 sisfb_pcibus; /* The card's PCI ID */ u32 sisfb_pcislot; u32 sisfb_pcifunc; u8 sisfb_lcdpdc; /* PanelDelayCompensation */ u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */ u32 sisfb_vbflags; u32 sisfb_currentvbflags; u32 sisfb_scalelcd; u32 sisfb_specialtiming; u8 sisfb_haveemi; u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; u8 sisfb_haveemilcd; u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */ u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ u32 sisfb_heapsize; /* heap size (in KB) */ u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */ u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */ u32 sisfb_curdstn; u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */ u32 sisfb_vbflags2; /* ivideo->vbflags2 */ u8 sisfb_can_post; /* sisfb can POST this card */ u8 sisfb_card_posted; /* card is POSTED */ u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */ u8 reserved[183]; /* for future use */ }; #define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,u32) #define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info) #define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,u32) #define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,u32) #define SISFB_GET_INFO_OLD _IOR('n',0xF8,u32) #define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,u32) #define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,u32) #define SISFB_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif /* _SIS315_COMPAT_H */ DirectFB-1.2.10/gfxdrivers/sis315/sis315_regs.h0000644000175000017500000001377111245562152015604 00000000000000#ifndef _SIS315_REGS_H #define _SIS315_REGS_H #define PAT_REG_SIZE 384 enum sisfb_raster_op_bitblt { SIS315_ROP_CLEAR = 0x00, /* dst = 0, 0 */ SIS315_ROP_AND = 0x88, /* dst = dst & src, DSa */ SIS315_RON_AND_REVERSE = 0x44, /* dst = ~dst & src, SDna */ SIS315_ROP_COPY = 0xCC, /* dst = src, S */ SIS315_ROP_AND_INVERTED = 0x22, /* dst = dst & ~src, DSna */ SIS315_ROP_NOOP = 0xAA, /* dst = dst, D */ SIS315_ROP_XOR = 0x66, /* dst = dst ^ src, DSx */ SIS315_ROP_OR = 0xEE, /* dst = dst | src, DSo */ SIS315_ROP_NOR = 0x11, /* dst = ~(dst | src), DSon */ SIS315_ROP_EQUIV = 0x99, /* dst = dst ^ ~src, DSxn */ SIS315_ROP_INVERT = 0x55, /* dst = ~dst, Dn */ SIS315_ROP_OR_INVERSE = 0xDD, /* dst = ~dst | src, SDno */ SIS315_ROP_COPY_INVERTED = 0x33, /* dst = ~src, Sn */ SIS315_ROP_OR_INVERTED = 0xBB, /* dst = ~src | dst, DSno */ SIS315_ROP_NAND = 0x77, /* dst = ~(dst & src), DSan */ SIS315_ROP_SET = 0xFF, /* dst = 1, 1 */ /* same as above, but with pattern as source */ SIS315_ROP_CLEAR_PAT = 0x00, /* dst = 0, 0 */ SIS315_ROP_AND_PAT = 0xA0, /* dst = dst & src, DSa */ SIS315_RON_AND_REVERSE_PAT = 0x50, /* dst = ~dst & src, SDna */ SIS315_ROP_COPY_PAT = 0xF0, /* dst = src, S */ SIS315_ROP_AND_INVERTED_PAT = 0x0A, /* dst = dst & ~src, DSna */ SIS315_ROP_NOOP_PAT = 0xAA, /* dst = dst, D */ SIS315_ROP_XOR_PAT = 0x5A, /* dst = dst ^ src, DSx */ SIS315_ROP_OR_PAT = 0xFA, /* dst = dst | src, DSo */ SIS315_ROP_NOR_PAT = 0x05, /* dst = ~(dst | src), DSon */ SIS315_ROP_EQUIV_PAT = 0xA5, /* dst = dst ^ ~src, DSxn */ SIS315_ROP_INVERT_PAT = 0x55, /* dst = ~dst, Dn */ SIS315_ROP_OR_REVERSE_PAT = 0xDD, /* dst = ~dst | src, SDno */ SIS315_ROP_COPY_INVERTED_PAT = 0x0F, /* dst = ~src, Sn */ SIS315_ROP_OR_INVERTED_PAT = 0xAF, /* dst = ~src | dst, DSno */ SIS315_ROP_NAND_PAT = 0x5F, /* dst = ~(dst & src), DSan */ SIS315_ROP_SET_PAT = 0xFF, /* dst = 1, 1 */ }; enum sisfb_raster_op_transparent_bitblt { SIS315_ROP_BLACK, SIS315_ROP_NOT_MERGE_PEN, }; enum sis315_2d_registers { SIS315_2D_SRC_ADDR = 0x8200, SIS315_2D_SRC_PITCH = 0x8204, SIS315_2D_AGP_BASE = 0x8206, SIS315_2D_SRC_Y = 0x8208, SIS315_2D_SRC_X = 0x820A, SIS315_2D_DST_Y = 0x820C, SIS315_2D_DST_X = 0x820E, SIS315_2D_DST_ADDR = 0x8210, SIS315_2D_DST_PITCH = 0x8214, SIS315_2D_DST_HEIGHT = 0x8216, SIS315_2D_RECT_WIDTH = 0x8218, SIS315_2D_RECT_HEIGHT = 0x821A, SIS315_2D_PAT_FG_COLOR = 0x821C, SIS315_2D_PAT_BG_COLOR = 0x8220, SIS315_2D_SRC_FG_COLOR = 0x8224, SIS315_2D_SRC_BG_COLOR = 0x8228, SIS315_2D_MONO_MASK = 0x822C, SIS315_2D_LEFT_CLIP = 0x8234, SIS315_2D_TOP_CLIP = 0x8236, SIS315_2D_RIGHT_CLIP = 0x8238, SIS315_2D_BOT_CLIP = 0x823A, SIS315_2D_CMD = 0x823C, SIS315_2D_FIRE_TRIGGER = 0x8240, SIS315_2D_PATTERN_REG = 0x8300 }; enum sis315_2d_registers_drawline { SIS315_2D_LINE_X0 = 0x8208, SIS315_2D_LINE_Y0 = 0x820A, SIS315_2D_LINE_X1 = 0x820C, SIS315_2D_LINE_Y1 = 0x820E, SIS315_2D_LINE_COUNT = 0x8218, SIS315_2D_LINE_STYLE_PERIOD = 0x821A, SIS315_2D_LINE_STYLE_0 = 0x822C, SIS315_2D_LINE_STYLE_1 = 0x8230, SIS315_2D_LINE_Xn = 0x8300, SIS315_2D_LINE_Yn = 0x8302, }; #define SIS315_2D_LINE_X(n) (0x8300 + ((n - 2) << 2)) #define SIS315_2D_LINE_Y(n) (0x8302 + ((n - 2) << 2)) enum sis315_2d_register_transparent_bitblt { SIS315_2D_TRANS_DEST_KEY_HIGH = 0x821C, SIS315_2D_TRANS_DEST_KEY_LOW = 0x8220, SIS315_2D_TRANS_SRC_KEY_HIGH = 0x8224, SIS315_2D_TRANS_SRC_KEY_LOW = 0x8228, }; enum sis315_2d_cmd_type { SIS315_2D_CMD_BITBLT = 0x00, SIS315_2D_CMD_COLOREXP = 0x01, SIS315_2D_CMD_ENCOLOREXP = 0x02, SIS315_2D_CMD_MULTIPLE_SCANLINE = 0x03, SIS315_2D_CMD_LINE_DRAW = 0x04, SIS315_2D_CMD_TRAPEZOID_FILL = 0x05, SIS315_2D_CMD_TRANSPARENT_BITBLT = 0x06, SIS315_2D_CMD_ALPHA_BLENDING = 0x07, SIS315_2D_CMD_3D_FUNCTION = 0x08, SIS315_2D_CMD_CLEAR_Z_BUFFER = 0x09, SIS315_2D_CMD_GRADIENT_FILL = 0x0A, SIS315_2D_CMD_STRETCH_BITBLT = 0x0B }; enum sis315_2d_cmd_control { /* source selection */ SIS315_2D_CMD_SRC_VIDEO = 0x00000000, SIS315_2D_CMD_SRC_SYSTEM = 0x00000010, SIS315_2D_CMD_SRC_AGP = 0x00000020, /* pattern source selection */ SIS315_2D_CMD_PAT_FG_REG = 0x00000000, SIS315_2D_CMD_PAT_PAT_REG = 0x00000040, SIS315_2D_CMD_PAT_MONO_MASK = 0x00000080, /* color format flags */ SIS315_2D_CMD_CFB_8 = 0x00000000, SIS315_2D_CMD_CFB_16 = 0x00010000, SIS315_2D_CMD_CFB_32 = 0x00020000, /* clipping flags */ SIS315_2D_CMD_NOCLIP = 0x00000000, SIS315_2D_CMD_RECT_CLIP_EN = 0x00040000, SIS315_2D_CMD_MERGE_CLIP_DIS = 0x04000000, /* subfunctions for transparent bitblt */ SIS315_2D_CMD_OPAQUE = 0x00000000, SIS315_2D_CMD_TRANSPARENT = 0x00100000, /* subfunctions for alpha blended blit */ SIS315_2D_CMD_CONSTANT_ALPHA = 0x00000000, SIS315_2D_CMD_PER_PIXEL_ALPHA = 0x00080000, SIS315_2D_CMD_NO_DEST_ALPHA = 0x00100000, SIS315_2D_CMD_3D_FULL_SCENE = 0x00180000, /* subfunctions for color expansion */ SIS315_2D_CMD_COLOR_TO_MONO = 0x00100000, SIS315_2D_CMD_AA_TEXT = 0x00200000, /* line flags */ SIS315_2D_CMD_NO_LAST_PIXEL = 0x00200000, SIS315_2D_CMD_NO_RESET_COUNTER = 0x00400000, SIS315_2D_CMD_LINE_STLYE_ENABLE = 0x00800000, /* destination */ SIS315_DST_VIDEO = 0x00000000, SIS315_DST_AGP = 0x02000000, #if 0 SIS315_2D_CMD_DIR_X_INC = 0x00010000, SIS315_2D_CMD_DIR_X_DEC = 0x00000000, SIS315_2D_CMD_DIR_Y_INC = 0x00020000, SIS315_2D_CMD_DIR_Y_DEC = 0x00000000, #endif }; enum sis315_command_queue_registers { SIS315_2D_CMD_QUEUE_BASE_ADDRESS = 0x85C0, SIS315_2D_CMD_QUEUE_WRITE_POINTER = 0x85C4, SIS315_2D_CMD_QUEUE_READ_POINTER = 0x85C8, SIS315_2D_CMD_QUEUE_STATUS = 0x85CC }; #endif /* _SIS315_REGS_H */ DirectFB-1.2.10/gfxdrivers/sis315/sis315_accel.h0000644000175000017500000000240511245562152015703 00000000000000/* * $Id: sis315_accel.h,v 1.2 2006-10-29 23:24:50 dok Exp $ * * Copyright (C) 2003 by Andreas Oberritter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #ifndef _SIS315_ACCEL_H #define _SIS315_ACCEL_H bool sis_fill_rectangle(void *driver_data, void *device_data, DFBRectangle *rect); bool sis_draw_rectangle(void *driver_data, void *device_data, DFBRectangle *rect); bool sis_draw_line(void *driver_data, void *device_data, DFBRegion *line); bool sis_blit(void *driver_data, void *device_data, DFBRectangle *rect, int dx, int dy); #endif /* _SIS315_ACCEL_H */ DirectFB-1.2.10/gfxdrivers/sis315/sis315_accel.c0000644000175000017500000000761411245562152015705 00000000000000/* * $Id: sis315_accel.c,v 1.4 2006-10-29 23:24:50 dok Exp $ * * Copyright (C) 2003 by Andreas Oberritter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #include #include #include #include "sis315.h" #include "sis315_mmio.h" #include "sis315_regs.h" #include "sis315_accel.h" static void sis_idle(SiSDriverData *drv) { while (!(sis_rl(drv->mmio_base, SIS315_2D_CMD_QUEUE_STATUS) & 0x80000000)); } static void sis_cmd(SiSDriverData *drv, SiSDeviceData *dev, u8 pat, u8 src, u8 type, u8 rop) { sis_wl(drv->mmio_base, SIS315_2D_CMD, SIS315_2D_CMD_RECT_CLIP_EN | dev->cmd_bpp | (rop << 8) | pat | src | type); sis_wl(drv->mmio_base, SIS315_2D_FIRE_TRIGGER, 0); sis_idle(drv); } bool sis_fill_rectangle(void *driver_data, void *device_data, DFBRectangle *rect) { SiSDriverData *drv = (SiSDriverData *)driver_data; SiSDeviceData *dev = (SiSDeviceData *)device_data; sis_wl(drv->mmio_base, SIS315_2D_DST_Y, (rect->x << 16) | rect->y); sis_wl(drv->mmio_base, SIS315_2D_RECT_WIDTH, (rect->h << 16) | rect->w); sis_cmd(drv, dev, SIS315_2D_CMD_PAT_FG_REG, SIS315_2D_CMD_SRC_VIDEO, SIS315_2D_CMD_BITBLT, SIS315_ROP_COPY_PAT); return true; } bool sis_draw_rectangle(void *driver_data, void *device_data, DFBRectangle *rect) { SiSDriverData *drv = (SiSDriverData *)driver_data; SiSDeviceData *dev = (SiSDeviceData *)device_data; /* from top left ... */ sis_wl(drv->mmio_base, SIS315_2D_LINE_X0, (rect->y << 16) | rect->x); /* ... to top right ... */ sis_wl(drv->mmio_base, SIS315_2D_LINE_X1, (rect->y << 16) | (rect->x + rect->w - 1)); /* ... to bottom right ... */ sis_wl(drv->mmio_base, SIS315_2D_LINE_X(2), ((rect->y + rect->h - 1) << 16) | (rect->x + rect->w - 1)); /* ... to bottom left ... */ sis_wl(drv->mmio_base, SIS315_2D_LINE_X(3), ((rect->y + rect->h - 1) << 16) | rect->x); /* ... and back to top left */ sis_wl(drv->mmio_base, SIS315_2D_LINE_X(4), ((rect->y + 1) << 16) | rect->x); sis_wl(drv->mmio_base, SIS315_2D_LINE_COUNT, 4); sis_cmd(drv, dev, SIS315_2D_CMD_PAT_FG_REG, SIS315_2D_CMD_SRC_VIDEO, SIS315_2D_CMD_LINE_DRAW, SIS315_ROP_COPY_PAT); return true; } bool sis_draw_line(void *driver_data, void *device_data, DFBRegion *line) { SiSDriverData *drv = (SiSDriverData *)driver_data; SiSDeviceData *dev = (SiSDeviceData *)device_data; sis_wl(drv->mmio_base, SIS315_2D_LINE_X0, (line->y1 << 16) | line->x1); sis_wl(drv->mmio_base, SIS315_2D_LINE_X1, (line->y2 << 16) | line->x2); sis_wl(drv->mmio_base, SIS315_2D_LINE_COUNT, 1); sis_cmd(drv, dev, SIS315_2D_CMD_PAT_FG_REG, SIS315_2D_CMD_SRC_VIDEO, SIS315_2D_CMD_LINE_DRAW, SIS315_ROP_COPY_PAT); return true; } bool sis_blit(void *driver_data, void *device_data, DFBRectangle *rect, int dx, int dy) { SiSDriverData *drv = (SiSDriverData *)driver_data; SiSDeviceData *dev = (SiSDeviceData *)device_data; sis_wl(drv->mmio_base, SIS315_2D_SRC_Y, (rect->x << 16) | rect->y); sis_wl(drv->mmio_base, SIS315_2D_DST_Y, (dx << 16) | dy); sis_wl(drv->mmio_base, SIS315_2D_RECT_WIDTH, (rect->h << 16) | rect->w); sis_cmd(drv, dev, SIS315_2D_CMD_PAT_FG_REG, SIS315_2D_CMD_SRC_VIDEO, dev->blit_cmd, dev->blit_rop); return true; } DirectFB-1.2.10/gfxdrivers/sis315/sis315.c0000644000175000017500000002051311245562152014547 00000000000000/* * $Id: sis315.c,v 1.20 2007-01-29 01:00:45 dok Exp $ * * Copyright (C) 2003 by Andreas Oberritter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #include #include #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include #include #include #include #include #include #include #include #include "sis315.h" #include "sis315_accel.h" #include "sis315_compat.h" #include "sis315_state.h" DFB_GRAPHICS_DRIVER(sis315); #define SIS_SUPPORTED_DRAWING_FUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE) #define SIS_SUPPORTED_DRAWING_FLAGS \ (DSDRAW_NOFX) #define SIS_SUPPORTED_BLITTING_FUNCTIONS \ (DFXL_BLIT) #define SIS_SUPPORTED_BLITTING_FLAGS \ (DSBLIT_SRC_COLORKEY) static DFBResult sis_engine_sync(void *driver_data, void *device_data) { (void)driver_data; (void)device_data; /* * this driver syncs after every command, * so this function can be left empty */ return DFB_OK; } static void sis_check_state(void *driver_data, void *device_data, CardState *state, DFBAccelerationMask accel) { (void)driver_data; (void)device_data; switch (state->destination->config.format) { case DSPF_LUT8: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION(accel)) { if (state->drawingflags & ~SIS_SUPPORTED_DRAWING_FLAGS) return; if (accel & DFXL_FILLTRIANGLE) { /* this is faster. don't know why. */ state->accel = 0; return; } state->accel |= SIS_SUPPORTED_DRAWING_FUNCTIONS; } else { if (state->blittingflags & ~SIS_SUPPORTED_BLITTING_FLAGS) return; switch (state->source->config.format) { case DSPF_LUT8: case DSPF_RGB16: break; default: return; } if (state->source->config.format != state->destination->config.format) return; state->accel |= SIS_SUPPORTED_BLITTING_FUNCTIONS; } } static void sis_set_state(void *driver_data, void *device_data, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel) { SiSDriverData *drv = (SiSDriverData *)driver_data; SiSDeviceData *dev = (SiSDeviceData *)device_data; (void)funcs; if (state->mod_hw) { if (state->mod_hw & SMF_SOURCE) dev->v_source = 0; if (state->mod_hw & SMF_DESTINATION) dev->v_color = dev->v_destination = 0; else if (state->mod_hw & SMF_COLOR) dev->v_color = 0; if (state->mod_hw & SMF_SRC_COLORKEY) dev->v_src_colorkey = 0; if (state->mod_hw & SMF_BLITTING_FLAGS) dev->v_blittingflags = 0; } switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: sis_validate_dst(drv, dev, state); sis_validate_color(drv, dev, state); state->set = SIS_SUPPORTED_DRAWING_FUNCTIONS; break; case DFXL_BLIT: sis_validate_src(drv, dev, state); sis_validate_dst(drv, dev, state); if (state->blittingflags & DSBLIT_DST_COLORKEY) sis_set_dst_colorkey(drv, dev, state); if (state->blittingflags & DSBLIT_SRC_COLORKEY) sis_set_src_colorkey(drv, dev, state); sis_set_blittingflags(dev, state); state->set = SIS_SUPPORTED_BLITTING_FUNCTIONS; break; default: D_BUG("unexpected drawing or blitting function"); break; } if (state->mod_hw & SMF_CLIP) sis_set_clip(drv, &state->clip); state->mod_hw = 0; } static void check_sisfb_version(SiSDriverData *drv, const struct sisfb_info *i) { u32 sisfb_version = SISFB_VERSION(i->sisfb_version, i->sisfb_revision, i->sisfb_patchlevel); if (sisfb_version < SISFB_VERSION(1, 6, 23)) { fprintf(stderr, "*** Warning: sisfb version < 1.6.23 detected, " "please update your driver! ***\n"); drv->has_auto_maximize = false; } else { drv->has_auto_maximize = true; } } /* * exported symbols... */ static int driver_probe(CoreGraphicsDevice *device) { switch (dfb_gfxcard_get_accelerator(device)) { case FB_ACCEL_SIS_GLAMOUR_2: case FB_ACCEL_SIS_XABRE: return 1; default: return 0; } } static void driver_get_info(CoreGraphicsDevice *device, GraphicsDriverInfo *info) { (void)device; snprintf(info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "SiS 315 Driver"); snprintf(info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Andreas Oberritter "); info->version.major = 0; info->version.minor = 1; info->driver_data_size = sizeof(SiSDriverData); info->device_data_size = sizeof(SiSDeviceData); } static DFBResult driver_init_driver(CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core) { SiSDriverData *drv = (SiSDriverData *)driver_data; FBDev *dfb_fbdev; struct sisfb_info *fbinfo; u32 fbinfo_size; u32 zero = 0; (void)device_data; dfb_fbdev = dfb_system_data(); if (!dfb_fbdev) return DFB_IO; if (ioctl(dfb_fbdev->fd, SISFB_GET_INFO_SIZE, &fbinfo_size) == 0) { fbinfo = D_MALLOC(fbinfo_size); drv->get_info = SISFB_GET_INFO | (fbinfo_size << 16); drv->get_automaximize = SISFB_GET_AUTOMAXIMIZE; drv->set_automaximize = SISFB_SET_AUTOMAXIMIZE; } else { fbinfo = D_MALLOC(sizeof(struct sisfb_info)); drv->get_info = SISFB_GET_INFO_OLD; drv->get_automaximize = SISFB_GET_AUTOMAXIMIZE_OLD; drv->set_automaximize = SISFB_SET_AUTOMAXIMIZE_OLD; } if (fbinfo == NULL) return DFB_NOSYSTEMMEMORY; if (ioctl(dfb_fbdev->fd, drv->get_info, fbinfo) == -1) { D_FREE(fbinfo); return DFB_IO; } if (fbinfo->sisfb_id != SISFB_ID) { D_FREE(fbinfo); return DFB_FAILURE; } check_sisfb_version(drv, fbinfo); D_FREE(fbinfo); if (drv->has_auto_maximize) { if (ioctl(dfb_fbdev->fd, drv->get_automaximize, &drv->auto_maximize)) return DFB_IO; if (drv->auto_maximize) if (ioctl(dfb_fbdev->fd, drv->set_automaximize, &zero)) return DFB_IO; } drv->mmio_base = dfb_gfxcard_map_mmio(device, 0, -1); if (!drv->mmio_base) return DFB_IO; /* base functions */ funcs->EngineSync = sis_engine_sync; funcs->CheckState = sis_check_state; funcs->SetState = sis_set_state; /* drawing functions */ funcs->FillRectangle = sis_fill_rectangle; funcs->DrawRectangle = sis_draw_rectangle; funcs->DrawLine = sis_draw_line; /* blitting functions */ funcs->Blit = sis_blit; return DFB_OK; } static DFBResult driver_init_device(CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data) { (void)device; (void)driver_data; (void)device_data; snprintf(device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "315"); snprintf(device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "SiS"); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = SIS_SUPPORTED_DRAWING_FUNCTIONS | SIS_SUPPORTED_BLITTING_FUNCTIONS; device_info->caps.drawing = SIS_SUPPORTED_DRAWING_FLAGS; device_info->caps.blitting = SIS_SUPPORTED_BLITTING_FLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; return DFB_OK; } static void driver_close_device(CoreGraphicsDevice *device, void *driver_data, void *device_data) { (void)device; (void)driver_data; (void)device_data; } static void driver_close_driver(CoreGraphicsDevice *device, void *driver_data) { SiSDriverData *drv = (SiSDriverData *)driver_data; dfb_gfxcard_unmap_mmio(device, drv->mmio_base, -1); if ((drv->has_auto_maximize) && (drv->auto_maximize)) { FBDev *dfb_fbdev = dfb_system_data(); if (!dfb_fbdev) return; ioctl(dfb_fbdev->fd, drv->set_automaximize, &drv->auto_maximize); } } DirectFB-1.2.10/gfxdrivers/sis315/sis315_mmio.h0000644000175000017500000000257511245562152015605 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SIS315_MMIO_H #define _SIS315_MMIO_H #include extern __inline__ u32 sis_rl(volatile u8 *mmio, unsigned int offset); extern __inline__ void sis_wl(volatile u8 *mmio, unsigned int offset, u32 value); #endif DirectFB-1.2.10/gfxdrivers/sis315/sis315_state.h0000644000175000017500000000272411245562152015760 00000000000000/* * $Id: sis315_state.h,v 1.2 2006-10-29 23:24:50 dok Exp $ * * Copyright (C) 2003 by Andreas Oberritter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #ifndef _SIS315_STATE_H #define _SIS315_STATE_H void sis_validate_color(SiSDriverData *drv, SiSDeviceData *dev, CardState *state); void sis_validate_dst(SiSDriverData *drv, SiSDeviceData *dev, CardState *state); void sis_validate_src(SiSDriverData *drv, SiSDeviceData *dev, CardState *state); void sis_set_dst_colorkey(SiSDriverData *drv, SiSDeviceData *dev, CardState *state); void sis_set_src_colorkey(SiSDriverData *drv, SiSDeviceData *dev, CardState *state); void sis_set_blittingflags(SiSDeviceData *dev, CardState *state); void sis_set_clip(SiSDriverData *drv, DFBRegion *clip); #endif /* _SIS315_STATE_H */ DirectFB-1.2.10/gfxdrivers/sis315/sis315_state.c0000644000175000017500000001030211245562152015742 00000000000000/* * $Id: sis315_state.c,v 1.6 2006-10-29 23:24:50 dok Exp $ * * Copyright (C) 2003 by Andreas Oberritter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #include #include #include #include #include #include #include "sis315.h" #include "sis315_mmio.h" #include "sis315_regs.h" #include "sis315_state.h" static u16 dspfToSrcColor(DFBSurfacePixelFormat pf) { switch (DFB_BITS_PER_PIXEL(pf)) { case 16: return 0x8000; case 32: return 0xc000; default: return 0x0000; } } static u32 dspfToCmdBpp(DFBSurfacePixelFormat pf) { switch (DFB_BITS_PER_PIXEL(pf)) { case 16: return SIS315_2D_CMD_CFB_16; case 32: return SIS315_2D_CMD_CFB_32; default: return SIS315_2D_CMD_CFB_8; } } void sis_validate_color(SiSDriverData *drv, SiSDeviceData *dev, CardState *state) { u32 color; if (dev->v_color) return; switch (state->destination->config.format) { case DSPF_LUT8: color = state->color_index; break; case DSPF_ARGB1555: color = PIXEL_ARGB1555(state->color.a, state->color.r, state->color.g, state->color.b); break; case DSPF_RGB16: color = PIXEL_RGB16(state->color.r, state->color.g, state->color.b); break; case DSPF_RGB32: color = PIXEL_RGB32(state->color.r, state->color.g, state->color.b); break; case DSPF_ARGB: color = PIXEL_ARGB(state->color.a, state->color.r, state->color.g, state->color.b); break; default: D_BUG("unexpected pixelformat"); return; } sis_wl(drv->mmio_base, SIS315_2D_PAT_FG_COLOR, color); dev->v_color = 1; } void sis_validate_dst(SiSDriverData *drv, SiSDeviceData *dev, CardState *state) { CoreSurface *dst = state->destination; if (dev->v_destination) return; dev->cmd_bpp = dspfToCmdBpp(dst->config.format); sis_wl(drv->mmio_base, SIS315_2D_DST_ADDR, state->dst.offset); sis_wl(drv->mmio_base, SIS315_2D_DST_PITCH, (0xffff << 16) | state->dst.pitch); dev->v_destination = 1; } void sis_validate_src(SiSDriverData *drv, SiSDeviceData *dev, CardState *state) { CoreSurface *src = state->source; if (dev->v_source) return; sis_wl(drv->mmio_base, SIS315_2D_SRC_ADDR, state->src.offset); sis_wl(drv->mmio_base, SIS315_2D_SRC_PITCH, (dspfToSrcColor(src->config.format) << 16) | state->src.pitch); dev->v_source = 1; } void sis_set_dst_colorkey(SiSDriverData *drv, SiSDeviceData *dev, CardState *state) { if (dev->v_dst_colorkey) return; sis_wl(drv->mmio_base, SIS315_2D_TRANS_DEST_KEY_HIGH, state->dst_colorkey); sis_wl(drv->mmio_base, SIS315_2D_TRANS_DEST_KEY_LOW, state->dst_colorkey); dev->v_dst_colorkey = 1; } void sis_set_src_colorkey(SiSDriverData *drv, SiSDeviceData *dev, CardState *state) { if (dev->v_src_colorkey) return; sis_wl(drv->mmio_base, SIS315_2D_TRANS_SRC_KEY_HIGH, state->src_colorkey); sis_wl(drv->mmio_base, SIS315_2D_TRANS_SRC_KEY_LOW, state->src_colorkey); dev->v_src_colorkey = 1; } void sis_set_blittingflags(SiSDeviceData *dev, CardState *state) { if (dev->v_blittingflags) return; if (state->blittingflags & DSBLIT_SRC_COLORKEY) { dev->blit_cmd = SIS315_2D_CMD_TRANSPARENT_BITBLT; dev->blit_rop = SIS315_ROP_AND_INVERTED_PAT; } else { dev->blit_cmd = SIS315_2D_CMD_BITBLT; dev->blit_rop = SIS315_ROP_COPY; } dev->v_blittingflags = 1; } void sis_set_clip(SiSDriverData *drv, DFBRegion *clip) { sis_wl(drv->mmio_base, SIS315_2D_LEFT_CLIP, (clip->y1 << 16) | clip->x1); sis_wl(drv->mmio_base, SIS315_2D_RIGHT_CLIP, (clip->y2 << 16) | clip->x2); } DirectFB-1.2.10/gfxdrivers/tdfx/0000777000175000017500000000000011307522571013355 500000000000000DirectFB-1.2.10/gfxdrivers/tdfx/tdfx.h0000644000175000017500000001175111245562152014414 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __TDFX_H__ #define __TDFX_H__ #include #define S12_4(val) (((u32)((s32)((val) << 4))) & 0xffff) #define S12_4_(a,b) (((u32)((s32)(((a) << 4) + (b)))) & 0xffff) #define TDFX_LFBMODE_RGB565 0 #define TDFX_LFBMODE_RGB555 1 #define TDFX_LFBMODE_RGB0888 4 #define TDFX_LFBMODE_ARGB8888 5 #define TDFX_LFBMODE_PIXEL_PIPELINE_ENABLE (1 << 8) #define TDFX_CLIP_ENABLE (1 << 31) #define TDFX_ALPHAMODE_BLEND_ENABLE (1 << 4) #define TDFX_FBZCOLORPATH_RGBSELECT_COLOR1 2 #define TDFX_FBZCOLORPATH_ASELECT_COLOR1 (2 << 2) typedef volatile struct { u32 status; u32 intrCtrl; u32 vertexAx; u32 vertexAy; u32 vertexBx; u32 vertexBy; u32 vertexCx; u32 vertexCy; s32 startR; s32 startG; s32 startB; s32 startZ; s32 startA; s32 startS; s32 startT; s32 startW; s32 dRdX; s32 dGdX; s32 dBdX; s32 dZdX; s32 dAdX; s32 dSdX; s32 dTdX; s32 dWdX; s32 dRdY; s32 dGdY; s32 dBdY; s32 dZdY; s32 dAdY; s32 dSdY; s32 dTdY; s32 dWdY; u32 triangleCMD; u32 reserved0; float fvertexAx; float fvertexAy; float fvertexBx; float fvertexBy; float fvertexCx; float fvertexCy; float fstartR; float fstartG; float fstartB; float fstartZ; float fstartA; float fstartS; float fstartT; float fstartW; float fdRdX; float fdGdX; float fdBdX; float fdZdX; float fdAdX; float fdSdX; float fdTdX; float fdWdX; float fdRdY; float fdGdY; float fdBdY; float fdZdY; float fdAdY; float fdSdY; float fdTdY; float fdWdY; u32 ftriangleCMD; u32 fbzColorPath; u32 fogMode; u32 alphaMode; u32 fbzMode; u32 lfbMode; u32 clipLeftRight; u32 clipTopBottom; u32 nopCMD; u32 fastfillCMD; u32 swapbufferCMD; u32 fogColor; u32 zaColor; u32 chromaKey; u32 chromaRange; u32 userIntrCMD; u32 stipple; u32 color0; u32 color1; u32 fbiPixelsIn; u32 fbiChromaFail; u32 fbiZfuncFail; u32 fbiAfuncFail; u32 fbiPixelsOut; u32 fogTable[32]; u32 reserved1[3]; u32 colBufferAddr; u32 colBufferStride; u32 auxBufferAddr; u32 auxBufferStride; u32 reserved2; u32 clipLeftRight1; u32 clipTopBottom1; u32 reserved3[17]; u32 swapPending; u32 leftOverlayBuf; u32 rightOverlayBuf; u32 fbiSwapHistory; u32 fbiTrianglesOut; u32 sSetupMode; float sVx; float sVy; u32 sARGB; float sRed; float sGreen; float sBlue; float sAlpha; float sVz; float sWb; float sWtmu0; float sS_W0; float sT_W0; float sWtmu1; float sS_Wtmu1; float sT_Wtmu1; u32 sDrawTriCMD; u32 sBeginTriCMD; u32 reserved[22]; u32 textureMode; u32 tLOD; u32 tDetail; u32 texBaseAddr; u32 texBaseAddr1; u32 texBaseAddr2; u32 texBaseAddr3_8; u32 texStride; u32 trexInit1; u32 nccTable0[12]; u32 nccTable1[12]; u32 reserved4[31]; } Voodoo3D; typedef volatile struct { u32 status; u32 intCtrl; u32 clip0Min; u32 clip0Max; u32 dstBaseAddr; u32 dstFormat; u32 srcColorkeyMin; u32 srcColorkeyMax; u32 dstColorkeyMin; u32 dstColorkeyMax; u32 bresError0; u32 bresError1; u32 rop; u32 srcBaseAddr; u32 commandExtra; u32 lineStipple; u32 lineStyle; u32 pattern0Alias; u32 pattern1Alias; u32 clip1Min; u32 clip1Max; u32 srcFormat; u32 srcSize; u32 srcXY; u32 colorBack; u32 colorFore; u32 dstSize; u32 dstXY; u32 command; u32 reserved[3]; u32 launchArea[32]; u32 colorPattern[64]; } Voodoo2D; #endif DirectFB-1.2.10/gfxdrivers/tdfx/Makefile.am0000644000175000017500000000121311245562152015322 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/tdfx INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src tdfx_LTLIBRARIES = libdirectfb_tdfx.la if BUILD_STATIC tdfx_DATA = $(tdfx_LTLIBRARIES:.la=.o) endif tdfxdir = $(MODULEDIR)/gfxdrivers libdirectfb_tdfx_la_SOURCES = \ tdfx.c \ tdfx.h libdirectfb_tdfx_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_tdfx_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/tdfx/Makefile.in0000644000175000017500000004450411307521501015335 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/tdfx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(tdfxdir)" "$(DESTDIR)$(tdfxdir)" tdfxLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(tdfx_LTLIBRARIES) libdirectfb_tdfx_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_tdfx_la_OBJECTS = tdfx.lo libdirectfb_tdfx_la_OBJECTS = $(am_libdirectfb_tdfx_la_OBJECTS) libdirectfb_tdfx_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_tdfx_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_tdfx_la_SOURCES) DIST_SOURCES = $(libdirectfb_tdfx_la_SOURCES) tdfxDATA_INSTALL = $(INSTALL_DATA) DATA = $(tdfx_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src tdfx_LTLIBRARIES = libdirectfb_tdfx.la @BUILD_STATIC_TRUE@tdfx_DATA = $(tdfx_LTLIBRARIES:.la=.o) tdfxdir = $(MODULEDIR)/gfxdrivers libdirectfb_tdfx_la_SOURCES = \ tdfx.c \ tdfx.h libdirectfb_tdfx_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_tdfx_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/tdfx/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/tdfx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-tdfxLTLIBRARIES: $(tdfx_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(tdfxdir)" || $(MKDIR_P) "$(DESTDIR)$(tdfxdir)" @list='$(tdfx_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(tdfxLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(tdfxdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(tdfxLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(tdfxdir)/$$f"; \ else :; fi; \ done uninstall-tdfxLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(tdfx_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(tdfxdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(tdfxdir)/$$p"; \ done clean-tdfxLTLIBRARIES: -test -z "$(tdfx_LTLIBRARIES)" || rm -f $(tdfx_LTLIBRARIES) @list='$(tdfx_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_tdfx.la: $(libdirectfb_tdfx_la_OBJECTS) $(libdirectfb_tdfx_la_DEPENDENCIES) $(libdirectfb_tdfx_la_LINK) -rpath $(tdfxdir) $(libdirectfb_tdfx_la_OBJECTS) $(libdirectfb_tdfx_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdfx.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-tdfxDATA: $(tdfx_DATA) @$(NORMAL_INSTALL) test -z "$(tdfxdir)" || $(MKDIR_P) "$(DESTDIR)$(tdfxdir)" @list='$(tdfx_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(tdfxDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(tdfxdir)/$$f'"; \ $(tdfxDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(tdfxdir)/$$f"; \ done uninstall-tdfxDATA: @$(NORMAL_UNINSTALL) @list='$(tdfx_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(tdfxdir)/$$f'"; \ rm -f "$(DESTDIR)$(tdfxdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(tdfxdir)" "$(DESTDIR)$(tdfxdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-tdfxLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-tdfxDATA install-tdfxLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-tdfxDATA uninstall-tdfxLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-tdfxLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-tdfxDATA install-tdfxLTLIBRARIES \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-tdfxDATA \ uninstall-tdfxLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/tdfx/tdfx.c0000644000175000017500000006512711245562152014415 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( tdfx ) #include "tdfx.h" static bool tdfxFillRectangle2D( void *drv, void *dev, DFBRectangle *rect ); static bool tdfxFillRectangle3D( void *drv, void *dev, DFBRectangle *rect ); static bool tdfxFillTriangle2D ( void *drv, void *dev, DFBTriangle *tri ); static bool tdfxFillTriangle3D ( void *drv, void *dev, DFBTriangle *tri ); static bool tdfxDrawLine2D ( void *drv, void *dev, DFBRegion *line ); //static void tdfxDrawLine3D ( void *drv, void *dev, DFBRegion *line ); typedef struct { /* for fifo/performance monitoring */ unsigned int fifo_space; unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; /* state validation */ int v_destination2D; int v_destination3D; int v_color1; int v_colorFore; int v_alphaMode; int v_source2D; int v_srcColorkey; int v_commandExtra; } TDFXDeviceData; typedef struct { volatile u8 *mmio_base; Voodoo2D *voodoo2D; Voodoo3D *voodoo3D; } TDFXDriverData; static inline void tdfx_waitfifo( TDFXDriverData *tdrv, TDFXDeviceData *tdev, unsigned int space ) { int timeout = 1000000; tdev->waitfifo_calls++; tdev->waitfifo_sum += space; if (tdev->fifo_space < space) { while (timeout--) { tdev->fifo_waitcycles++; tdev->fifo_space = (tdrv->voodoo2D->status & 0x3f); if (tdev->fifo_space >= space) break; } } else { tdev->fifo_cache_hits++; } tdev->fifo_space -= space; if (!timeout) D_WARN( "timeout during waitfifo!" ); } static inline void tdfx_waitidle( TDFXDriverData *tdrv, TDFXDeviceData *tdev ) { int i = 0; int timeout = 1000000; // tdfx_waitfifo( tdrv, tdev, 1 ); // voodoo3D->nopCMD = 0; while (timeout--) { tdev->idle_waitcycles++; i = (tdrv->voodoo2D->status & (0xF << 7)) ? 0 : i + 1; if (i == 3) return; } D_BUG( "timeout during waitidle!\n"); } static int blitFormat[] = { 2, /* DSPF_ARGB1555 */ 3, /* DSPF_RGB16 */ 4, /* DSPF_RGB24 */ 5, /* DSPF_RGB32 */ 5, /* DSPF_ARGB */ 0 /* DSPF_A8 */ }; static inline void tdfx_validate_source2D( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { CoreSurface *source = state->source; Voodoo2D *voodoo2D = tdrv->voodoo2D; if (tdev->v_source2D) return; tdfx_waitfifo( tdrv, tdev, 2 ); voodoo2D->srcBaseAddr = state->src.offset & 0xFFFFFF; voodoo2D->srcFormat = (state->src.pitch & 0x3FFF) | (blitFormat[DFB_PIXELFORMAT_INDEX(source->config.format)] << 16); tdev->v_source2D = 1; } static inline void tdfx_validate_destination2D( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { CoreSurface *destination = state->destination; Voodoo2D *voodoo2D = tdrv->voodoo2D; if (tdev->v_destination2D) return; tdfx_waitfifo( tdrv, tdev, 2 ); voodoo2D->dstBaseAddr = state->dst.offset; voodoo2D->dstFormat = (state->dst.pitch & 0x3FFF) | (blitFormat[DFB_PIXELFORMAT_INDEX(destination->config.format)] << 16); tdev->v_destination2D = 1; } static inline void tdfx_validate_destination3D( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { CoreSurface *destination = state->destination; Voodoo3D *voodoo3D = tdrv->voodoo3D; u32 lfbmode = TDFX_LFBMODE_PIXEL_PIPELINE_ENABLE; u32 fbzMode = (1 << 9) | 1; if (tdev->v_destination3D) return; switch (destination->config.format) { case DSPF_ARGB1555: lfbmode |= TDFX_LFBMODE_RGB555; break; case DSPF_RGB16: lfbmode |= TDFX_LFBMODE_RGB565; break; case DSPF_RGB32: lfbmode |= TDFX_LFBMODE_RGB0888; break; case DSPF_ARGB: fbzMode |= (1 << 10); lfbmode |= TDFX_LFBMODE_ARGB8888; break; default: D_BUG( "unexpected pixelformat!" ); break; } tdfx_waitfifo( tdrv, tdev, 4 ); voodoo3D->lfbMode = lfbmode; voodoo3D->fbzMode = fbzMode; voodoo3D->colBufferAddr = state->dst.offset; voodoo3D->colBufferStride = state->dst.pitch; tdev->v_destination3D = 1; } static inline void tdfx_validate_color1( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { if (tdev->v_color1) return; tdfx_waitfifo( tdrv, tdev, 1 ); tdrv->voodoo3D->color1 = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); tdev->v_color1 = 1; } static inline void tdfx_validate_colorFore( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { if (tdev->v_colorFore) return; tdfx_waitfifo( tdrv, tdev, 1 ); switch (state->destination->config.format) { case DSPF_A8: tdrv->voodoo2D->colorFore = state->color.a; break; case DSPF_ARGB1555: tdrv->voodoo2D->colorFore = PIXEL_ARGB1555( state->color.a, state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB16: tdrv->voodoo2D->colorFore = PIXEL_RGB16( state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB24: case DSPF_RGB32: tdrv->voodoo2D->colorFore = PIXEL_RGB32( state->color.r, state->color.g, state->color.b ); break; case DSPF_ARGB: tdrv->voodoo2D->colorFore = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); break; default: D_BUG( "unexpected pixelformat!" ); break; } tdev->v_colorFore = 1; } static inline void tdfx_validate_alphaMode( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { static int tdfxBlendFactor[] = { 0, 0x0, /* DSBF_ZERO */ 0x4, /* DSBF_ONE */ 0x2, /* DSBF_SRCCOLOR */ 0x6, /* DSBF_INVSRCCOLOR */ 0x1, /* DSBF_SRCALPHA */ 0x5, /* DSBF_INVSRCALPHA */ 0x3, /* DSBF_DESTALPHA */ 0x7, /* DSBF_INVDESTALPHA */ 0x2, /* DSBF_DESTCOLOR */ 0x6, /* DSBF_INVDESTCOLOR */ 0xF /* DSBF_SRCALPHASAT */ }; if (tdev->v_alphaMode) return; tdfx_waitfifo( tdrv, tdev, 1 ); tdrv->voodoo3D->alphaMode = TDFX_ALPHAMODE_BLEND_ENABLE | (tdfxBlendFactor[state->src_blend] << 8) | (tdfxBlendFactor[state->src_blend] << 16) | (tdfxBlendFactor[state->dst_blend] << 12) | (tdfxBlendFactor[state->dst_blend] << 20); tdev->v_alphaMode = 1; } static inline void tdfx_validate_srcColorkey( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { Voodoo2D *voodoo2D = tdrv->voodoo2D; if (tdev->v_srcColorkey) return; tdfx_waitfifo( tdrv, tdev, 2 ); voodoo2D->srcColorkeyMin = voodoo2D->srcColorkeyMax = state->src_colorkey; tdev->v_srcColorkey = 1; } static inline void tdfx_validate_commandExtra( TDFXDriverData *tdrv, TDFXDeviceData *tdev, CardState *state ) { if (tdev->v_commandExtra) return; tdfx_waitfifo( tdrv, tdev, 1 ); if (state->blittingflags & DSBLIT_SRC_COLORKEY) tdrv->voodoo2D->commandExtra = 1; else tdrv->voodoo2D->commandExtra = 0; tdev->v_commandExtra = 1; } static inline void tdfx_set_clip( TDFXDriverData *tdrv, TDFXDeviceData *tdev, DFBRegion *clip ) { Voodoo2D *voodoo2D = tdrv->voodoo2D; Voodoo3D *voodoo3D = tdrv->voodoo3D; tdfx_waitfifo( tdrv, tdev, 4 ); voodoo2D->clip0Min = ((clip->y1 & 0xFFF) << 16) | (clip->x1 & 0xFFF); voodoo2D->clip0Max = (((clip->y2+1) & 0xFFF) << 16) | ((clip->x2+1) & 0xFFF); voodoo3D->clipLeftRight = ((clip->x1 & 0xFFF) << 16) | ((clip->x2+1) & 0xFFF); voodoo3D->clipTopBottom = ((clip->y1 & 0xFFF) << 16) | ((clip->y2+1) & 0xFFF); } /* required implementations */ static DFBResult tdfxEngineSync( void *drv, void *dev ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; tdfx_waitidle( tdrv, tdev ); return DFB_OK; } #define TDFX_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #define TDFX_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWLINE | DFXL_FILLTRIANGLE) #define TDFX_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_SRC_COLORKEY) #define TDFX_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT) static void tdfxCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { /* check for the special drawing function that does not support the usually supported drawingflags */ if (accel == DFXL_DRAWLINE && state->drawingflags != DSDRAW_NOFX) return; /* if there are no other drawing flags than the supported */ if (!(state->drawingflags & ~TDFX_SUPPORTED_DRAWINGFLAGS)) state->accel |= TDFX_SUPPORTED_DRAWINGFUNCTIONS; /* if there are no other blitting flags than the supported and the source and destination formats are the same */ if (!(state->blittingflags & ~TDFX_SUPPORTED_BLITTINGFLAGS) && state->source && state->source->config.format != DSPF_RGB24) state->accel |= TDFX_SUPPORTED_BLITTINGFUNCTIONS; } static void tdfxSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; if (state->mod_hw & SMF_DESTINATION) tdev->v_destination2D = tdev->v_destination3D = tdev->v_colorFore = 0; if (state->mod_hw & SMF_SOURCE) tdev->v_source2D = 0; if (state->mod_hw & (SMF_DST_BLEND | SMF_SRC_BLEND)) tdev->v_alphaMode = 0; if (state->mod_hw & SMF_COLOR) tdev->v_color1 = tdev->v_colorFore = 0; if (state->mod_hw & SMF_SRC_COLORKEY) tdev->v_srcColorkey = 0; if (state->mod_hw & SMF_BLITTING_FLAGS) tdev->v_commandExtra = 0; switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWLINE: case DFXL_FILLTRIANGLE: if (state->drawingflags & DSDRAW_BLEND) { tdfx_validate_color1( tdrv, tdev, state ); tdfx_validate_alphaMode( tdrv, tdev, state ); tdfx_validate_destination3D( tdrv, tdev, state ); funcs->FillRectangle = tdfxFillRectangle3D; funcs->FillTriangle = tdfxFillTriangle3D; } else { tdfx_validate_colorFore( tdrv, tdev, state ); tdfx_validate_destination2D( tdrv, tdev, state ); funcs->FillRectangle = tdfxFillRectangle2D; funcs->FillTriangle = tdfxFillTriangle2D; } state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: if (state->blittingflags & DSBLIT_SRC_COLORKEY) tdfx_validate_srcColorkey( tdrv, tdev, state ); tdfx_validate_commandExtra( tdrv, tdev, state ); tdfx_validate_source2D( tdrv, tdev, state ); tdfx_validate_destination2D( tdrv, tdev, state ); state->set |= DFXL_BLIT | DFXL_STRETCHBLIT; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } if (state->mod_hw & SMF_CLIP) tdfx_set_clip( tdrv, tdev, &state->clip ); state->mod_hw = 0; } static bool tdfxFillRectangle2D( void *drv, void *dev, DFBRectangle *rect ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo2D *voodoo2D = tdrv->voodoo2D; tdfx_waitfifo( tdrv, tdev, 3 ); voodoo2D->dstXY = ((rect->y & 0x1FFF) << 16) | (rect->x & 0x1FFF); voodoo2D->dstSize = ((rect->h & 0x1FFF) << 16) | (rect->w & 0x1FFF); voodoo2D->command = 5 | (1 << 8) | (0xCC << 24); return true; } static bool tdfxFillRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo3D *voodoo3D = tdrv->voodoo3D; tdfx_waitfifo( tdrv, tdev, 10 ); voodoo3D->vertexAx = S12_4(rect->x); voodoo3D->vertexAy = S12_4(rect->y); voodoo3D->vertexBx = S12_4(rect->x); voodoo3D->vertexBy = S12_4(rect->y + rect->h); voodoo3D->vertexCx = S12_4(rect->x + rect->w); voodoo3D->vertexCy = S12_4(rect->y + rect->h); voodoo3D->triangleCMD = (1 << 31); voodoo3D->vertexBx = S12_4(rect->x + rect->w); voodoo3D->vertexBy = S12_4(rect->y); voodoo3D->triangleCMD = 0; return true; } static bool tdfxDrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { return false; } static bool tdfxDrawLine2D( void *drv, void *dev, DFBRegion *line ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo2D *voodoo2D = tdrv->voodoo2D; tdfx_waitfifo( tdrv, tdev, 5 ); voodoo2D->srcXY = ((line->y1 & 0x1FFF) << 16) | (line->x1 & 0x1FFF); voodoo2D->dstXY = ((line->y2 & 0x1FFF) << 16) | (line->x2 & 0x1FFF); voodoo2D->command = 6 | (1 << 8) | (0xCC << 24); return true; } /*static bool tdfxDrawLine3D( void *drv, void *dev, DFBRegion *line ) { int xl, xr, yb, yt; if (line->x1 < line->x2) { xl = -8; xr = 8; } else { xl = 8; xr = -8; } if (line->y1 < line->y2) { yt = -8; yb = 8; } else { yt = 8; yb = -8; } tdfx_waitfifo( 10 ); voodoo3D->vertexAx = S12_4_( line->x1, xl ); voodoo3D->vertexAy = S12_4_( line->y1, yt ); voodoo3D->vertexBx = S12_4_( line->x2, xl ); voodoo3D->vertexBy = S12_4_( line->y2, yb ); voodoo3D->vertexCx = S12_4_( line->x2, xr ); voodoo3D->vertexCy = S12_4_( line->y2, yb ); voodoo3D->triangleCMD = (1 << 31); voodoo3D->vertexBx = S12_4_( line->x1, xr ); voodoo3D->vertexBy = S12_4_( line->y1, yt ); voodoo3D->triangleCMD = 0; return true; }*/ static bool tdfxFillTriangle2D( void *drv, void *dev, DFBTriangle *tri ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo2D *voodoo2D = tdrv->voodoo2D; tdfx_waitfifo( tdrv, tdev, 7 ); dfb_sort_triangle( tri ); voodoo2D->srcXY = ((tri->y1 & 0x1FFF) << 16) | (tri->x1 & 0x1FFF); voodoo2D->command = 8 | (1 << 8) | (0xCC << 24); if (tri->x2 < tri->x3) { voodoo2D->launchArea[0] = ((tri->y2 & 0x1FFF) << 16) | (tri->x2 & 0x1FFF); voodoo2D->launchArea[1] = ((tri->y3 & 0x1FFF) << 16) | (tri->x3 & 0x1FFF); voodoo2D->launchArea[2] = ((tri->y2 & 0x1FFF) << 16) | (tri->x2 & 0x1FFF); } else { voodoo2D->launchArea[0] = ((tri->y3 & 0x1FFF) << 16) | (tri->x3 & 0x1FFF); voodoo2D->launchArea[1] = ((tri->y2 & 0x1FFF) << 16) | (tri->x2 & 0x1FFF); voodoo2D->launchArea[2] = ((tri->y3 & 0x1FFF) << 16) | (tri->x3 & 0x1FFF); } return true; } static bool tdfxFillTriangle3D( void *drv, void *dev, DFBTriangle *tri ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo3D *voodoo3D = tdrv->voodoo3D; tdfx_waitfifo( tdrv, tdev, 7 ); dfb_sort_triangle( tri ); voodoo3D->vertexAx = S12_4(tri->x1); voodoo3D->vertexAy = S12_4(tri->y1); voodoo3D->vertexBx = S12_4(tri->x2); voodoo3D->vertexBy = S12_4(tri->y2); voodoo3D->vertexCx = S12_4(tri->x3); voodoo3D->vertexCy = S12_4(tri->y3); voodoo3D->triangleCMD = (1 << 31); voodoo3D->triangleCMD = 0; return true; } static bool tdfxBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo2D *voodoo2D = tdrv->voodoo2D; u32 cmd = 1 | (1 <<8) | (0xCC << 24);//SST_2D_GO | SST_2D_SCRNTOSCRNBLIT | (ROP_COPY << 24); if (rect->x <= dx) { cmd |= (1 << 14);//SST_2D_X_RIGHT_TO_LEFT; rect->x += rect->w-1; dx += rect->w-1; } if (rect->y <= dy) { cmd |= (1 << 15);//SST_2D_Y_BOTTOM_TO_TOP; rect->y += rect->h-1; dy += rect->h-1; } tdfx_waitfifo( tdrv, tdev, 4 ); voodoo2D->srcXY = ((rect->y & 0x1FFF) << 16) | (rect->x & 0x1FFF); voodoo2D->dstXY = ((dy & 0x1FFF) << 16) | (dx & 0x1FFF); voodoo2D->dstSize = ((rect->h & 0x1FFF) << 16) | (rect->w & 0x1FFF); voodoo2D->command = cmd; return true; } static bool tdfxStretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { TDFXDriverData *tdrv = (TDFXDriverData*) drv; TDFXDeviceData *tdev = (TDFXDeviceData*) dev; Voodoo2D *voodoo2D = tdrv->voodoo2D; tdfx_waitfifo( tdrv, tdev, 5 ); voodoo2D->srcXY = ((sr->y & 0x1FFF) << 16) | (sr->x & 0x1FFF); voodoo2D->srcSize = ((sr->h & 0x1FFF) << 16) | (sr->w & 0x1FFF); voodoo2D->dstXY = ((dr->y & 0x1FFF) << 16) | (dr->x & 0x1FFF); voodoo2D->dstSize = ((dr->h & 0x1FFF) << 16) | (dr->w & 0x1FFF); voodoo2D->command = 2 | (1 << 8) | (0xCC << 24); return true; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_3DFX_BANSHEE: /* Banshee/Voodoo3 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "3Dfx Voodoo 3/4/5/Banshee Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); info->version.major = 0; info->version.minor = 1; info->driver_data_size = sizeof (TDFXDriverData); info->device_data_size = sizeof (TDFXDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { TDFXDriverData *tdrv = (TDFXDriverData*) driver_data; tdrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!tdrv->mmio_base) return DFB_IO; tdrv->voodoo2D = (Voodoo2D*)(tdrv->mmio_base + 0x100000); tdrv->voodoo3D = (Voodoo3D*)(tdrv->mmio_base + 0x200000); funcs->CheckState = tdfxCheckState; funcs->SetState = tdfxSetState; funcs->EngineSync = tdfxEngineSync; funcs->DrawRectangle = tdfxDrawRectangle; funcs->DrawLine = tdfxDrawLine2D; funcs->Blit = tdfxBlit; funcs->StretchBlit = tdfxStretchBlit; return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { TDFXDriverData *tdrv = (TDFXDriverData*) driver_data; TDFXDeviceData *tdev = (TDFXDeviceData*) device_data; Voodoo2D *voodoo2D = tdrv->voodoo2D; Voodoo3D *voodoo3D = tdrv->voodoo3D; /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Voodoo 3/4/5/Banshee" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "3Dfx" ); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = TDFX_SUPPORTED_DRAWINGFUNCTIONS | TDFX_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = TDFX_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = TDFX_SUPPORTED_BLITTINGFLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; /* initialize card */ voodoo2D->status = 0; voodoo3D->nopCMD = 3; tdfx_waitfifo( tdrv, tdev, 6 ); voodoo3D->clipLeftRight1 = 0; voodoo3D->clipTopBottom1 = 0; voodoo3D->fbzColorPath = TDFX_FBZCOLORPATH_RGBSELECT_COLOR1 | TDFX_FBZCOLORPATH_ASELECT_COLOR1; voodoo3D->textureMode = 0; voodoo2D->commandExtra = 0; voodoo2D->rop = 0xAAAAAA; tdfx_waitfifo( tdrv, tdev, 1 ); /* VOODOO !!! */ *((volatile u32*)((volatile u8*) tdrv->mmio_base + 0x10c)) = 1 << 4 | 1 << 8 | 5 << 12 | 1 << 18 | 5 << 24; dfb_config->pollvsync_after = 1; return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { TDFXDeviceData *tdev = (TDFXDeviceData*) device_data; TDFXDriverData *tdrv = (TDFXDriverData*) driver_data; (void) tdev; (void) tdrv; D_DEBUG( "DirectFB/TDFX: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFB/TDFX: %9d tdfx_waitfifo calls\n", tdev->waitfifo_calls ); D_DEBUG( "DirectFB/TDFX: %9d register writes (tdfx_waitfifo sum)\n", tdev->waitfifo_sum ); D_DEBUG( "DirectFB/TDFX: %9d FIFO wait cycles (depends on CPU)\n", tdev->fifo_waitcycles ); D_DEBUG( "DirectFB/TDFX: %9d IDLE wait cycles (depends on CPU)\n", tdev->idle_waitcycles ); D_DEBUG( "DirectFB/TDFX: %9d FIFO space cache hits(depends on CPU)\n", tdev->fifo_cache_hits ); D_DEBUG( "DirectFB/TDFX: Conclusion:\n" ); D_DEBUG( "DirectFB/TDFX: Average register writes/tdfx_waitfifo" "call:%.2f\n", tdev->waitfifo_sum/(float)(tdev->waitfifo_calls) ); D_DEBUG( "DirectFB/TDFX: Average wait cycles/tdfx_waitfifo call:" " %.2f\n", tdev->fifo_waitcycles/(float)(tdev->waitfifo_calls) ); D_DEBUG( "DirectFB/TDFX: Average fifo space cache hits: %02d%%\n", (int)(100 * tdev->fifo_cache_hits/ (float)(tdev->waitfifo_calls)) ); D_DEBUG( "DirectFB/TDFX: Pixels Out: %d\n", tdrv->voodoo3D->fbiPixelsOut ); D_DEBUG( "DirectFB/TDFX: Triangles Out: %d\n", tdrv->voodoo3D->fbiTrianglesOut ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { TDFXDriverData *tdrv = (TDFXDriverData*) driver_data; dfb_gfxcard_unmap_mmio( device, tdrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/Makefile.am0000644000175000017500000000300411245562152014355 00000000000000## Makefile.am for DirectFB/gfxdrivers if GFX_ATI128 ATI128_DIR = ati128 else ATI128_DIR = endif if GFX_CLE266 CLE266_DIR = cle266 else CLE266_DIR = endif if GFX_CYBER5K CYBER5K_DIR = cyber5k else CYBER5K_DIR = endif if GFX_DAVINCI DAVINCI_DIR = davinci else DAVINCI_DIR = endif if GFX_I810 I810_DIR = i810 else I810_DIR = endif if GFX_I830 I830_DIR = i830 else I830_DIR = endif if GFX_MACH64 MACH64_DIR = mach64 else MACH64_DIR = endif if GFX_MATROX MATROX_DIR = matrox else MATROX_DIR = endif if GFX_NEOMAGIC NEOMAGIC_DIR = neomagic else NEOMAGIC_DIR = endif if GFX_NSC NSC_DIR = nsc else NSC_DIR = endif if GFX_NVIDIA NVIDIA_DIR = nvidia else NVIDIA_DIR = endif if GFX_OMAP OMAP_DIR = omap else OMAP_DIR = endif if GFX_RADEON RADEON_DIR = radeon else RADEON_DIR = endif if GFX_SAVAGE SAVAGE_DIR = savage else SAVAGE_DIR = endif if GFX_SH772X SH772X_DIR = sh772x else SH772X_DIR = endif if GFX_SIS315 SIS315_DIR = sis315 else SIS315_DIR = endif if GFX_TDFX TDFX_DIR = tdfx else TDFX_DIR = endif if GFX_UNICHROME UNICHROME_DIR = unichrome else UNICHROME_DIR = endif if GFX_VMWARE VMWARE_DIR = vmware else VMWARE_DIR = endif if GFX_EP9X EP9X_DIR = ep9x else EP9X_DIR = endif SUBDIRS = \ $(ATI128_DIR) \ $(CLE266_DIR) \ $(CYBER5K_DIR) \ $(DAVINCI_DIR) \ $(EP9X_DIR) \ $(I810_DIR) \ $(I830_DIR) \ $(MACH64_DIR) \ $(MATROX_DIR) \ $(NEOMAGIC_DIR) \ $(NSC_DIR) \ $(NVIDIA_DIR) \ $(OMAP_DIR) \ $(RADEON_DIR) \ $(SAVAGE_DIR) \ $(SH772X_DIR) \ $(SIS315_DIR) \ $(TDFX_DIR) \ $(UNICHROME_DIR) \ $(VMWARE_DIR) DirectFB-1.2.10/gfxdrivers/i830/0000777000175000017500000000000011307522570013072 500000000000000DirectFB-1.2.10/gfxdrivers/i830/i830_overlay.c0000644000175000017500000005760411164361026015410 00000000000000/* Intel i830 DirectFB graphics driver (c) Copyright 2005 Servision Ltd. http://www.servision.net/ All rights reserved. Based on i810 driver written by Antonino Daplas Video Overlay Support based partly on XFree86's "i830_video.c" This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * i830_video.c: i830/i845 Xv driver. * * Copyright 2002 by Alan Hourihane and David Dawes * * Authors: * Alan Hourihane * David Dawes * * Derived from i830 Xv driver: * * Authors of i830 code: * Jonathan Bian * Offscreen Images: * Matt Sottek */ #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include "i830.h" #include #include #include #include #include #include #include #include #include #include #include #include #define I830_OVERLAY_SUPPORTED_OPTIONS (DLOP_DST_COLORKEY) static void ovl_calc_regs( I830DriverData *idrv, I830DeviceData *idev, I830OverlayLayerData *iovl, CoreLayer *layer, CoreSurface *surface, CoreLayerRegionConfig *config, bool buffers_only, CoreSurfaceBufferLock *lock ); /* * This is more or less the correct way to initalise, update, and shut down * the overlay. Note OVERLAY_OFF should be used only after disabling the * overlay in OCMD and calling OVERLAY_UPDATE. * * XXX Need to make sure that the overlay engine is cleanly shutdown in * all modes of server exit. */ static void update_overlay( I830DriverData *idrv, I830DeviceData *idev ) { I830RingBlock block = { NULL, 0, 0 }; i830_begin_lp_ring( idrv, idev, 6, &block ); i830_out_ring( &block, MI_FLUSH | MI_WRITE_DIRTY_STATE ); i830_out_ring( &block, MI_NOOP ); if (!idev->overlayOn) { idev->overlayOn = true; i830_out_ring( &block, MI_NOOP ); i830_out_ring( &block, MI_NOOP ); i830_out_ring( &block, MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_ON ); } else { i830_out_ring( &block, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP ); i830_out_ring( &block, MI_NOOP ); i830_out_ring( &block, MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_CONTINUE ); } i830_out_ring( &block, idev->ovl_mem.physical | 1 ); i830_advance_lp_ring( idrv, idev, &block ); } static void disable_overlay( I830DriverData *idrv, I830DeviceData *idev ) { I830RingBlock block = { NULL, 0, 0 }; if (!idev->overlayOn) return; i830_begin_lp_ring( idrv, idev, 8, &block ); i830_out_ring( &block, MI_FLUSH | MI_WRITE_DIRTY_STATE ); i830_out_ring( &block, MI_NOOP ); i830_out_ring( &block, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP ); i830_out_ring( &block, MI_NOOP ); i830_out_ring( &block, MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_OFF ); i830_out_ring( &block, idev->ovl_mem.physical | 1 ); i830_out_ring( &block, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP ); i830_out_ring( &block, MI_NOOP ); i830_advance_lp_ring( idrv, idev, &block ); idev->overlayOn = false; } void i830ovlOnOff( I830DriverData *idrv, I830DeviceData *idev, bool on ) { if (on) idrv->oregs->OCMD |= OVERLAY_ENABLE; else idrv->oregs->OCMD &= ~OVERLAY_ENABLE; update_overlay( idrv, idev ); if (!on) disable_overlay( idrv, idev ); } static int ovlLayerDataSize( void ) { return sizeof(I830OverlayLayerData); } static DFBResult ovlInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = idrv->idev; I830OverlayLayerData *iovl = layer_data; idev->iovl = iovl; idrv->oregs = (I830OverlayRegs*) idrv->ovl_base; memset( (void*) idrv->oregs, 0, sizeof(I830OverlayRegs) ); /* set_capabilities */ description->caps = DLCAPS_SURFACE | DLCAPS_SCREEN_LOCATION | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST | DLCAPS_SATURATION | DLCAPS_DST_COLORKEY; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Intel 830/845/855/865 Overlay" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_SATURATION; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; idrv->oregs->OCLRC0 = 64 << 18; idrv->oregs->OCLRC1 = 0x80; return DFB_OK; } static DFBResult ovlTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = CLRCF_NONE; if (config->options & ~I830_OVERLAY_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; switch (config->format) { case DSPF_I420: case DSPF_YV12: case DSPF_YUY2: case DSPF_UYVY: break; default: fail |= CLRCF_FORMAT; } if (config->width > 1440 || config->width < 1) fail |= CLRCF_WIDTH; if (config->height > 1023 || config->height < 1) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ovlSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = idrv->idev; I830OverlayLayerData *iovl = layer_data; iovl->config = *config; ovl_calc_regs ( idrv, idev, iovl, layer, surface, config, false, lock ); i830ovlOnOff( idrv, idev, true ); return DFB_OK; } static DFBResult ovlRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = idrv->idev; /* disable overlay */ i830ovlOnOff( idrv, idev, false ); return DFB_OK; } static DFBResult ovlFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = idrv->idev; I830OverlayLayerData *iovl = layer_data; dfb_surface_flip( surface, false ); ovl_calc_regs ( idrv, idev, iovl, layer, surface, &iovl->config, true, lock ); update_overlay( idrv, idev ); if (flags & DSFLIP_WAIT) dfb_screen_wait_vsync( dfb_screens_at( DSCID_PRIMARY ) ); return DFB_OK; } static DFBResult ovlSetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = idrv->idev; u16 b, c, s; if (adj->flags & DCAF_BRIGHTNESS) b = ((adj->brightness >> 8) - 128) & 0xFF; else b = idrv->oregs->OCLRC0 & 0xFF; if (adj->flags & DCAF_CONTRAST) c = (adj->contrast >> 8) & 0xFF; else c = (idrv->oregs->OCLRC0 >> 18) & 0xFF; if (adj->flags & DCAF_SATURATION) s = (adj->saturation >> 8) & 0xFF; else s = idrv->oregs->OCLRC1 & 0xFF; idrv->oregs->OCLRC0 = b | (c << 18); idrv->oregs->OCLRC1 = s; update_overlay( idrv, idev ); return DFB_OK; } static DFBResult ovlSetInputField( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = idrv->idev; idrv->oregs->OCMD &= ~FIELD_SELECT; idrv->oregs->OCMD |= (field) ? FIELD1 : FIELD0; update_overlay( idrv, idev ); return DFB_OK; } DisplayLayerFuncs i830OverlayFuncs = { .LayerDataSize = ovlLayerDataSize, .InitLayer = ovlInitLayer, .TestRegion = ovlTestRegion, .SetRegion = ovlSetRegion, .RemoveRegion = ovlRemoveRegion, .FlipRegion = ovlFlipRegion, .SetColorAdjustment = ovlSetColorAdjustment, .SetInputField = ovlSetInputField, }; typedef struct { u8 sign; u16 mantissa; u8 exponent; } coeffRec, *coeffPtr; static bool SetCoeffRegs(double *coeff, int mantSize, coeffPtr pCoeff, int pos) { int maxVal, icoeff, res; int sign; double c; sign = 0; maxVal = 1 << mantSize; c = *coeff; if (c < 0.0) { sign = 1; c = -c; } res = 12 - mantSize; if ((icoeff = (int)(c * 4 * maxVal + 0.5)) < maxVal) { pCoeff[pos].exponent = 3; pCoeff[pos].mantissa = icoeff << res; *coeff = (double)icoeff / (double)(4 * maxVal); } else if ((icoeff = (int)(c * 2 * maxVal + 0.5)) < maxVal) { pCoeff[pos].exponent = 2; pCoeff[pos].mantissa = icoeff << res; *coeff = (double)icoeff / (double)(2 * maxVal); } else if ((icoeff = (int)(c * maxVal + 0.5)) < maxVal) { pCoeff[pos].exponent = 1; pCoeff[pos].mantissa = icoeff << res; *coeff = (double)icoeff / (double)(maxVal); } else if ((icoeff = (int)(c * maxVal * 0.5 + 0.5)) < maxVal) { pCoeff[pos].exponent = 0; pCoeff[pos].mantissa = icoeff << res; *coeff = (double)icoeff / (double)(maxVal / 2); } else { /* Coeff out of range */ return false; } pCoeff[pos].sign = sign; if (sign) *coeff = -(*coeff); return true; } static void UpdateCoeff(int taps, double fCutoff, bool isHoriz, bool isY, coeffPtr pCoeff) { int i, j, j1, num, pos, mantSize; double pi = 3.1415926535, val, sinc, window, sum; double rawCoeff[MAX_TAPS * 32], coeffs[N_PHASES][MAX_TAPS]; double diff; int tapAdjust[MAX_TAPS], tap2Fix; bool isVertAndUV; if (isHoriz) mantSize = 7; else mantSize = 6; isVertAndUV = !isHoriz && !isY; num = taps * 16; for (i = 0; i < num * 2; i++) { val = (1.0 / fCutoff) * taps * pi * (i - num) / (2 * num); if (val == 0.0) sinc = 1.0; else sinc = sin(val) / val; /* Hamming window */ window = (0.5 - 0.5 * cos(i * pi / num)); rawCoeff[i] = sinc * window; } for (i = 0; i < N_PHASES; i++) { /* Normalise the coefficients. */ sum = 0.0; for (j = 0; j < taps; j++) { pos = i + j * 32; sum += rawCoeff[pos]; } for (j = 0; j < taps; j++) { pos = i + j * 32; coeffs[i][j] = rawCoeff[pos] / sum; } /* Set the register values. */ for (j = 0; j < taps; j++) { pos = j + i * taps; if ((j == (taps - 1) / 2) && !isVertAndUV) SetCoeffRegs(&coeffs[i][j], mantSize + 2, pCoeff, pos); else SetCoeffRegs(&coeffs[i][j], mantSize, pCoeff, pos); } tapAdjust[0] = (taps - 1) / 2; for (j = 1, j1 = 1; j <= tapAdjust[0]; j++, j1++) { tapAdjust[j1] = tapAdjust[0] - j; tapAdjust[++j1] = tapAdjust[0] + j; } /* Adjust the coefficients. */ sum = 0.0; for (j = 0; j < taps; j++) sum += coeffs[i][j]; if (sum != 1.0) { for (j1 = 0; j1 < taps; j1++) { tap2Fix = tapAdjust[j1]; diff = 1.0 - sum; coeffs[i][tap2Fix] += diff; pos = tap2Fix + i * taps; if ((tap2Fix == (taps - 1) / 2) && !isVertAndUV) SetCoeffRegs(&coeffs[i][tap2Fix], mantSize + 2, pCoeff, pos); else SetCoeffRegs(&coeffs[i][tap2Fix], mantSize, pCoeff, pos); sum = 0.0; for (j = 0; j < taps; j++) sum += coeffs[i][j]; if (sum == 1.0) break; } } } } static void ovl_calc_regs( I830DriverData *idrv, I830DeviceData *idev, I830OverlayLayerData *iovl, CoreLayer *layer, CoreSurface *surface, CoreLayerRegionConfig *config, bool buffers_only, CoreSurfaceBufferLock *lock ) { I830OverlayRegs *regs = idrv->oregs; int width = config->width; int height = config->height; int y_offset, u_offset = 0, v_offset = 0; unsigned int swidth; /* Set buffer pointers */ y_offset = dfb_gfxcard_memory_physical( NULL, lock->offset ); switch (config->format) { case DSPF_I420: u_offset = y_offset + height * lock->pitch; v_offset = u_offset + ((height >> 1) * (lock->pitch >> 1)); break; case DSPF_YV12: v_offset = y_offset + height * lock->pitch; u_offset = v_offset + ((height >> 1) * (lock->pitch >> 1)); break; case DSPF_UYVY: case DSPF_YUY2: break; default: D_BUG( "unexpected format" ); return; } /* buffer locations */ regs->OBUF_0Y = y_offset; regs->OBUF_0U = u_offset; regs->OBUF_0V = v_offset; //D_INFO("Buffers: Y0: 0x%08x, U0: 0x%08x, V0: 0x%08x\n", regs->OBUF_0Y, // regs->OBUF_0U, regs->OBUF_0V); if (buffers_only) return; switch (config->format) { case DSPF_YV12: case DSPF_I420: swidth = (width + 1) & ~1 & 0xfff; regs->SWIDTH = swidth; swidth /= 2; regs->SWIDTH |= (swidth & 0x7ff) << 16; swidth = ((y_offset + width + 0x1f) >> 5) - (y_offset >> 5) - 1; //D_INFO("Y width is %d, swidthsw is %d\n", width, swidth); regs->SWIDTHSW = swidth << 2; swidth = ((u_offset + (width / 2) + 0x1f) >> 5) - (u_offset >> 5) - 1; //D_INFO("UV width is %d, swidthsw is %d\n", width / 2, swidth); regs->SWIDTHSW |= swidth << 18; break; case DSPF_UYVY: case DSPF_YUY2: /* XXX Check for i845 */ swidth = ((width + 31) & ~31) << 1; regs->SWIDTH = swidth; regs->SWIDTHSW = swidth >> 3; break; default: D_BUG( "unexpected format" ); return; } regs->SHEIGHT = height | ((height / 2) << 16); #if NOT_PORTED_YET if (pPriv->oneLineMode) { /* change the coordinates with panel fitting active */ dstBox->y1 = (((dstBox->y1 - 1) * pPriv->scaleRatio) >> 16) + 1; dstBox->y2 = ((dstBox->y2 * pPriv->scaleRatio) >> 16) + 1; /* Now, alter the height, so we scale to the correct size */ drw_h = dstBox->y2 - dstBox->y1; if (drw_h < height) drw_h = height; } #endif regs->DWINPOS = (config->dest.y << 16) | config->dest.x; regs->DWINSZ = (config->dest.h << 16) | config->dest.w; //D_INFO("pos: 0x%08x, size: 0x%08x\n", regs->DWINPOS, regs->DWINSZ); regs->OCMD = OVERLAY_ENABLE; regs->OCONFIG = CC_OUT_8BIT; /* * Calculate horizontal and vertical scaling factors and polyphase * coefficients. */ { bool scaleChanged = false; int xscaleInt, xscaleFract, yscaleInt, yscaleFract; int xscaleIntUV, xscaleFractUV; int yscaleIntUV, yscaleFractUV; /* UV is half the size of Y -- YUV420 */ int uvratio = 2; u32 newval; coeffRec xcoeffY[N_HORIZ_Y_TAPS * N_PHASES]; coeffRec xcoeffUV[N_HORIZ_UV_TAPS * N_PHASES]; int i, j, pos; /* * Y down-scale factor as a multiple of 4096. */ xscaleFract = (config->source.w << 12) / config->dest.w; yscaleFract = (config->source.h << 12) / config->dest.h; /* Calculate the UV scaling factor. */ xscaleFractUV = xscaleFract / uvratio; yscaleFractUV = yscaleFract / uvratio; /* * To keep the relative Y and UV ratios exact, round the Y scales * to a multiple of the Y/UV ratio. */ xscaleFract = xscaleFractUV * uvratio; yscaleFract = yscaleFractUV * uvratio; /* Integer (un-multiplied) values. */ xscaleInt = xscaleFract >> 12; yscaleInt = yscaleFract >> 12; xscaleIntUV = xscaleFractUV >> 12; yscaleIntUV = yscaleFractUV >> 12; //D_INFO("xscale: 0x%x.%03x, yscale: 0x%x.%03x\n", xscaleInt, // xscaleFract & 0xFFF, yscaleInt, yscaleFract & 0xFFF); //D_INFO("UV xscale: 0x%x.%03x, UV yscale: 0x%x.%03x\n", xscaleIntUV, // xscaleFractUV & 0xFFF, yscaleIntUV, yscaleFractUV & 0xFFF); newval = (xscaleInt << 16) | ((xscaleFract & 0xFFF) << 3) | ((yscaleFract & 0xFFF) << 20); if (newval != regs->YRGBSCALE) { scaleChanged = true; regs->YRGBSCALE = newval; } newval = (xscaleIntUV << 16) | ((xscaleFractUV & 0xFFF) << 3) | ((yscaleFractUV & 0xFFF) << 20); if (newval != regs->UVSCALE) { scaleChanged = true; regs->UVSCALE = newval; } newval = yscaleInt << 16 | yscaleIntUV; if (newval != regs->UVSCALEV) { scaleChanged = true; regs->UVSCALEV = newval; } /* Recalculate coefficients if the scaling changed. */ /* * Only Horizontal coefficients so far. */ if (scaleChanged) { double fCutoffY; double fCutoffUV; fCutoffY = xscaleFract / 4096.0; fCutoffUV = xscaleFractUV / 4096.0; /* Limit to between 1.0 and 3.0. */ if (fCutoffY < MIN_CUTOFF_FREQ) fCutoffY = MIN_CUTOFF_FREQ; if (fCutoffY > MAX_CUTOFF_FREQ) fCutoffY = MAX_CUTOFF_FREQ; if (fCutoffUV < MIN_CUTOFF_FREQ) fCutoffUV = MIN_CUTOFF_FREQ; if (fCutoffUV > MAX_CUTOFF_FREQ) fCutoffUV = MAX_CUTOFF_FREQ; UpdateCoeff(N_HORIZ_Y_TAPS, fCutoffY, true, true, xcoeffY); UpdateCoeff(N_HORIZ_UV_TAPS, fCutoffUV, true, false, xcoeffUV); for (i = 0; i < N_PHASES; i++) { for (j = 0; j < N_HORIZ_Y_TAPS; j++) { pos = i * N_HORIZ_Y_TAPS + j; regs->Y_HCOEFS[pos] = xcoeffY[pos].sign << 15 | xcoeffY[pos].exponent << 12 | xcoeffY[pos].mantissa; } } for (i = 0; i < N_PHASES; i++) { for (j = 0; j < N_HORIZ_UV_TAPS; j++) { pos = i * N_HORIZ_UV_TAPS + j; regs->UV_HCOEFS[pos] = xcoeffUV[pos].sign << 15 | xcoeffUV[pos].exponent << 12 | xcoeffUV[pos].mantissa; } } } } switch (config->format) { case DSPF_YV12: case DSPF_I420: //D_INFO("YUV420\n"); #if 0 /* set UV vertical phase to -0.25 */ regs->UV_VPH = 0x30003000; #endif regs->OSTRIDE = lock->pitch | (lock->pitch << 15); regs->OCMD |= YUV_420; break; case DSPF_UYVY: case DSPF_YUY2: //D_INFO("YUV422\n"); regs->OSTRIDE = lock->pitch; regs->OCMD |= YUV_422; if (config->format == DSPF_UYVY) regs->OCMD |= Y_SWAP; break; default: D_BUG( "unexpected format" ); return; } /* * Destination color keying. */ regs->DCLRKV = PIXEL_RGB32 (config->dst_key.r, config->dst_key.g, config->dst_key.b ); switch (DFB_COLOR_BITS_PER_PIXEL( dfb_primary_layer_pixelformat() )) { case 8: regs->DCLRKM = 0xffffff; break; case 15: regs->DCLRKM = 0x070707; break; case 16: regs->DCLRKM = 0x070307; break; default: regs->DCLRKM = 0; break; } if(dfb_config->i8xx_overlay_pipe_b) regs->OCONFIG |= OVERLAY_PIPE_B; if (config->options & DLOP_DST_COLORKEY) regs->DCLRKM |= DEST_KEY_ENABLE; /* * Disable source color keying if not selected */ if (!(config->options & DLOP_SRC_COLORKEY)) { regs -> SCLRKVH = 0; regs -> SCLRKVL = 0; regs -> SCLRKEN = 0; } //D_INFO("OCMD is 0x%08x\n", regs->OCMD); } DirectFB-1.2.10/gfxdrivers/i830/Makefile.am0000644000175000017500000000124011245562152015040 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/i830 INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems i830_LTLIBRARIES = libdirectfb_i830.la if BUILD_STATIC i830_DATA = $(i830_LTLIBRARIES:.la=.o) endif i830dir = $(MODULEDIR)/gfxdrivers libdirectfb_i830_la_SOURCES = \ i830.c \ i830.h \ i830_overlay.c libdirectfb_i830_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_i830_la_LIBADD = -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/i830/Makefile.in0000644000175000017500000004466711307521477015101 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/i830 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(i830dir)" "$(DESTDIR)$(i830dir)" i830LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(i830_LTLIBRARIES) libdirectfb_i830_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_i830_la_OBJECTS = i830.lo i830_overlay.lo libdirectfb_i830_la_OBJECTS = $(am_libdirectfb_i830_la_OBJECTS) libdirectfb_i830_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_i830_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_i830_la_SOURCES) DIST_SOURCES = $(libdirectfb_i830_la_SOURCES) i830DATA_INSTALL = $(INSTALL_DATA) DATA = $(i830_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems i830_LTLIBRARIES = libdirectfb_i830.la @BUILD_STATIC_TRUE@i830_DATA = $(i830_LTLIBRARIES:.la=.o) i830dir = $(MODULEDIR)/gfxdrivers libdirectfb_i830_la_SOURCES = \ i830.c \ i830.h \ i830_overlay.c libdirectfb_i830_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_i830_la_LIBADD = -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/i830/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/i830/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-i830LTLIBRARIES: $(i830_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(i830dir)" || $(MKDIR_P) "$(DESTDIR)$(i830dir)" @list='$(i830_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(i830LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(i830dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(i830LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(i830dir)/$$f"; \ else :; fi; \ done uninstall-i830LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(i830_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(i830dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(i830dir)/$$p"; \ done clean-i830LTLIBRARIES: -test -z "$(i830_LTLIBRARIES)" || rm -f $(i830_LTLIBRARIES) @list='$(i830_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_i830.la: $(libdirectfb_i830_la_OBJECTS) $(libdirectfb_i830_la_DEPENDENCIES) $(libdirectfb_i830_la_LINK) -rpath $(i830dir) $(libdirectfb_i830_la_OBJECTS) $(libdirectfb_i830_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i830.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i830_overlay.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-i830DATA: $(i830_DATA) @$(NORMAL_INSTALL) test -z "$(i830dir)" || $(MKDIR_P) "$(DESTDIR)$(i830dir)" @list='$(i830_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(i830DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(i830dir)/$$f'"; \ $(i830DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(i830dir)/$$f"; \ done uninstall-i830DATA: @$(NORMAL_UNINSTALL) @list='$(i830_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(i830dir)/$$f'"; \ rm -f "$(DESTDIR)$(i830dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(i830dir)" "$(DESTDIR)$(i830dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-i830LTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-i830DATA install-i830LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-i830DATA uninstall-i830LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-i830LTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-i830DATA install-i830LTLIBRARIES \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-i830DATA \ uninstall-i830LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/i830/i830.c0000644000175000017500000005033011164361026013634 00000000000000/* Intel i830 DirectFB graphics driver (c) Copyright 2005 Servision Ltd. http://www.servision.net/ All rights reserved. Based on i810 driver written by Antonino Daplas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include "i830.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* need fb handle to get accel, MMIO programming in the i830 is useless */ #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( i830 ) /**************************************************************************************************/ #define TIMER_LOOP 1000000000 #define BUFFER_PADDING 2 #define MMIO_SIZE 512 * 1024 #define I830_SUPPORTED_DRAWINGFLAGS (DSDRAW_NOFX) #define I830_SUPPORTED_DRAWINGFUNCTIONS (DFXL_NONE) #define I830_SUPPORTED_BLITTINGFLAGS (DSBLIT_NOFX) #define I830_SUPPORTED_BLITTINGFUNCTIONS (DFXL_NONE) /**************************************************************************************************/ static void i830_lring_enable( I830DriverData *idrv, u32 mode ) { u32 tmp; D_DEBUG_AT( I830_Ring, "%s lp ring...\n", mode ? "Enabling" : "Disabling" ); tmp = i830_readl(idrv->mmio_base, LP_RING + RING_LEN); tmp = (!mode) ? tmp & ~1 : tmp | 1; i830_writel( idrv->mmio_base, LP_RING + RING_LEN, tmp ); } static inline void i830_wait_for_blit_idle( I830DriverData *idrv, I830DeviceData *idev ) { u32 count = 0; u32 head , tail; if (idev != NULL) idev->idle_calls++; head = i830_readl(idrv->mmio_base, LP_RING + RING_HEAD) & I830_HEAD_MASK; tail = i830_readl(idrv->mmio_base, LP_RING + RING_TAIL) & I830_TAIL_MASK; while ((head != tail) && (count++ < TIMER_LOOP)) { if (idev != NULL) idev->idle_waitcycles++; head = i830_readl(idrv->mmio_base, LP_RING + RING_HEAD) & I830_HEAD_MASK; tail = i830_readl(idrv->mmio_base, LP_RING + RING_TAIL) & I830_TAIL_MASK; } if (count >= TIMER_LOOP) { if (idev != NULL) idev->idle_timeoutsum++; D_BUG("warning: idle timeout exceeded"); } } static void i830_init_ringbuffer( I830DriverData *idrv, I830DeviceData *idev ) { u32 ring_enabled; D_DEBUG_AT( I830_Ring, "Previous lp ring config: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", i830_readl(idrv->mmio_base, LP_RING), i830_readl(idrv->mmio_base, LP_RING + RING_HEAD), i830_readl(idrv->mmio_base, LP_RING + RING_START), i830_readl(idrv->mmio_base, LP_RING + RING_LEN) ); ring_enabled = i830_readl(idrv->mmio_base, LP_RING + RING_LEN) & 1; if (ring_enabled) i830_wait_for_blit_idle(idrv, idev); i830_lring_enable(idrv, 0); idev->lring1 = i830_readl(idrv->mmio_base, LP_RING); idev->lring2 = i830_readl(idrv->mmio_base, LP_RING + RING_HEAD); idev->lring3 = i830_readl(idrv->mmio_base, LP_RING + RING_START); idev->lring4 = i830_readl(idrv->mmio_base, LP_RING + RING_LEN); D_FLAGS_SET( idrv->flags, I830RES_STATE_SAVE ); i830_writel(idrv->mmio_base, LP_RING + RING_LEN, 0); i830_writel(idrv->mmio_base, LP_RING + RING_HEAD, 0); i830_writel(idrv->mmio_base, LP_RING + RING_TAIL, 0); i830_writel(idrv->mmio_base, LP_RING + RING_START, 0); D_DEBUG_AT( I830_Ring, "INST_DONE: 0x%04x\n", i830_readw(idrv->mmio_base, INST_DONE) ); idev->lp_ring.size = RINGBUFFER_SIZE; idev->lp_ring.tail_mask = idev->lp_ring.size - 1; i830_writel( idrv->mmio_base, LP_RING + RING_START, (idev->lring_bind.pg_start * 4096) & I830_RING_START_MASK ); i830_writel( idrv->mmio_base, LP_RING + RING_LEN, (idev->lp_ring.size - 4096) & I830_RING_NR_PAGES ); i830_lring_enable(idrv, 1); D_DEBUG_AT( I830_Ring, "Wrote lp ring config: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", i830_readl(idrv->mmio_base, LP_RING), i830_readl(idrv->mmio_base, LP_RING + RING_HEAD), i830_readl(idrv->mmio_base, LP_RING + RING_START), i830_readl(idrv->mmio_base, LP_RING + RING_LEN) ); } DFBResult i830_wait_lp_ring( I830DriverData *idrv, I830DeviceData *idev, int space ) { I830RingBuffer *buf = &idev->lp_ring; idev->waitfifo_calls++; idev->waitfifo_sum += space; D_DEBUG_AT( I830_Ring, "Waiting for %d...\n", space ); if (buf->space < space) { int head = 0; int loops = 0; do { idev->fifo_waitcycles++; if (loops++ > 100000000) { D_ERROR( "timeout waiting for ring buffer space\n" ); return DFB_TIMEOUT; } buf->head = i830_readl( idrv->mmio_base, LP_RING + RING_HEAD ) & I830_HEAD_MASK; buf->space = buf->head - (buf->tail + 8); if (buf->space < 0) buf->space += buf->size; //D_DEBUG_AT( I830_Ring, "... have %d space\n", buf->space ); if (buf->head != head) loops = 0; head = buf->head; } while (buf->space < space); } else idev->fifo_cache_hits++; return DFB_OK; } /**************************************************************************************************/ static void i830FlushTextureCache( void *drv, void *dev ) { I830DriverData *idrv = drv; I830DeviceData *idev = dev; I830RingBlock block = { .virt = NULL }; if (i830_begin_lp_ring( idrv, idev, 2, &block )) return; i830_out_ring( &block, MI_FLUSH ); i830_out_ring( &block, MI_NOOP ); i830_advance_lp_ring( idrv, idev, &block ); } static DFBResult i830EngineSync( void *drv, void *dev ) { I830DriverData *idrv = drv; I830DeviceData *idev = dev; i830_wait_for_blit_idle( idrv, idev ); return DFB_OK; } /**************************************************************************************************/ static void i830CheckState(void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { default: return; } if (!(accel & ~I830_SUPPORTED_DRAWINGFUNCTIONS) && !(state->drawingflags & ~I830_SUPPORTED_DRAWINGFLAGS)) state->accel |= I830_SUPPORTED_DRAWINGFUNCTIONS; if (!(accel & ~I830_SUPPORTED_BLITTINGFUNCTIONS) && !(state->blittingflags & ~I830_SUPPORTED_BLITTINGFLAGS)) { if (state->source->config.format == state->destination->config.format) state->accel |= I830_SUPPORTED_BLITTINGFUNCTIONS; } } static void i830SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { switch (accel) { default: D_BUG("unexpected drawing/blitting function"); } state->mod_hw = 0; } /**************************************************************************************************/ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_I830: /* Intel 830 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Intel 830/845G/852GM/855GM/865G Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Denis Oliver Kropp" ); info->version.major = 0; info->version.minor = 1; info->driver_data_size = sizeof (I830DriverData); info->device_data_size = sizeof (I830DeviceData); } static void i830_release_resource( I830DriverData *idrv, I830DeviceData *idev ) { agp_unbind unbind; if (idrv->flags & I830RES_STATE_SAVE) { i830_writel( idrv->mmio_base, LP_RING, idev->lring1 ); i830_writel( idrv->mmio_base, LP_RING + RING_HEAD, idev->lring2 ); i830_writel( idrv->mmio_base, LP_RING + RING_START, idev->lring3 ); i830_writel( idrv->mmio_base, LP_RING + RING_LEN, idev->lring4 ); } if (idrv->flags & I830RES_MMAP) { munmap((void *) idrv->aper_base, idev->info.aper_size * 1024 * 1024); idrv->flags &= ~I830RES_MMAP; } if (idrv->flags & I830RES_LRING_BIND) { unbind.key = idev->lring_bind.key; ioctl(idrv->agpgart, AGPIOC_UNBIND, &unbind); } if (idrv->flags & I830RES_LRING_ACQ) ioctl(idrv->agpgart, AGPIOC_DEALLOCATE, idev->lring_mem.key); if (idrv->flags & I830RES_OVL_BIND) { unbind.key = idev->ovl_bind.key; ioctl(idrv->agpgart, AGPIOC_UNBIND, &unbind); } if (idrv->flags & I830RES_OVL_ACQ) ioctl(idrv->agpgart, AGPIOC_DEALLOCATE, idev->ovl_mem.key); if (idrv->flags & I830RES_GART_ACQ) { ioctl(idrv->agpgart, AGPIOC_RELEASE); idrv->flags &= ~I830RES_GART_ACQ; } if (idrv->flags & I830RES_GART) { close(idrv->agpgart); idrv->flags &= ~I830RES_GART; } } static DFBResult i830_agp_setup( CoreGraphicsDevice *device, I830DriverData *idrv, I830DeviceData *idev ) { idrv->agpgart = open("/dev/agpgart", O_RDWR); if (idrv->agpgart == -1) return DFB_IO; D_FLAGS_SET( idrv->flags, I830RES_GART ); if (ioctl(idrv->agpgart, AGPIOC_ACQUIRE)) { D_PERROR( "I830/AGP: AGPIOC_ACQUIRE failed!\n" ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I830RES_GART_ACQ ); if (!idev->initialized) { agp_setup setup; setup.agp_mode = 0; if (ioctl(idrv->agpgart, AGPIOC_SETUP, &setup)) { D_PERROR( "I830/AGP: AGPIOC_SETUP failed!\n" ); return DFB_IO; } if (ioctl(idrv->agpgart, AGPIOC_INFO, &idev->info)) { D_PERROR( "I830/AGP: AGPIOC_INFO failed!\n" ); return DFB_IO; } } idrv->aper_base = mmap( NULL, idev->info.aper_size * 1024 * 1024, PROT_WRITE, MAP_SHARED, idrv->agpgart, 0 ); if (idrv->aper_base == MAP_FAILED) { D_PERROR( "I830/AGP: mmap() failed!\n" ); i830_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I830RES_MMAP ); if (!idev->initialized) { u32 base; /* We'll attempt to bind at fb_base + fb_len + 1 MB, to be safe */ base = dfb_gfxcard_memory_physical(device, 0) - idev->info.aper_base; base += dfb_gfxcard_memory_length(); base += (1024 * 1024); idev->lring_mem.pg_count = RINGBUFFER_SIZE/4096; idev->lring_mem.type = AGP_NORMAL_MEMORY; if (ioctl(idrv->agpgart, AGPIOC_ALLOCATE, &idev->lring_mem)) { D_PERROR( "I830/AGP: AGPIOC_ALLOCATE failed!\n" ); i830_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I830RES_LRING_ACQ ); idev->lring_bind.key = idev->lring_mem.key; idev->lring_bind.pg_start = base/4096; if (ioctl(idrv->agpgart, AGPIOC_BIND, &idev->lring_bind)) { D_PERROR( "I830/AGP: AGPIOC_BIND failed!\n" ); i830_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I830RES_LRING_BIND ); idev->ovl_mem.pg_count = 1; idev->ovl_mem.type = AGP_PHYSICAL_MEMORY; if (ioctl(idrv->agpgart, AGPIOC_ALLOCATE, &idev->ovl_mem)) { D_PERROR( "I830/AGP: AGPIOC_ALLOCATE failed!\n" ); i830_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I830RES_OVL_ACQ ); idev->ovl_bind.key = idev->ovl_mem.key; idev->ovl_bind.pg_start = (base + RINGBUFFER_SIZE)/4096; if (ioctl(idrv->agpgart, AGPIOC_BIND, &idev->ovl_bind)) { D_PERROR( "I830/AGP: AGPIOC_BIND failed!\n" ); i830_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I830RES_OVL_BIND ); } if (idrv->flags & I830RES_GART_ACQ) { ioctl(idrv->agpgart, AGPIOC_RELEASE); idrv->flags &= ~I830RES_GART_ACQ; } idrv->lring_base = idrv->aper_base + idev->lring_bind.pg_start * 4096; idrv->ovl_base = idrv->aper_base + idev->ovl_bind.pg_start * 4096; idrv->pattern_base = idrv->ovl_base + 1024; if (!idev->initialized) { memset((void *) idrv->lring_base, 0x00, RINGBUFFER_SIZE); memset((void *) idrv->ovl_base, 0xff, 1024); memset((void *) idrv->pattern_base, 0xff, 4096 - 1024); idev->lring1 = 0;//i830_readl(idrv->mmio_base, LP_RING); idev->lring2 = 0;//i830_readl(idrv->mmio_base, LP_RING + RING_HEAD); idev->lring3 = 0;//i830_readl(idrv->mmio_base, LP_RING + RING_START); idev->lring4 = 0;//i830_readl(idrv->mmio_base, LP_RING + RING_LEN); } idev->initialized = true; return DFB_OK; } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { DFBResult ret; I830DriverData *idrv = driver_data; I830DeviceData *idev = device_data; idrv->idev = device_data; idrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!idrv->mmio_base) return DFB_IO; ret = i830_agp_setup( device, idrv, idev ); if (ret) { dfb_gfxcard_unmap_mmio( device, idrv->mmio_base, -1 ); return ret; } idrv->info = idev->info; funcs->CheckState = i830CheckState; funcs->SetState = i830SetState; funcs->EngineSync = i830EngineSync; funcs->FlushTextureCache = i830FlushTextureCache; dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &i830OverlayFuncs ); return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { I830DriverData *idrv = driver_data; I830DeviceData *idev = device_data; // int offset; /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "830/845G/852GM/855GM/865G" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "Intel" ); device_info->caps.flags = 0; device_info->caps.accel = I830_SUPPORTED_DRAWINGFUNCTIONS | I830_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = I830_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = I830_SUPPORTED_BLITTINGFLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; device_info->limits.surface_bytepitch_alignment = 64; dfb_config->pollvsync_after = 1; /* offset = dfb_gfxcard_reserve_memory( device, RINGBUFFER_SIZE ); idrv->lring_mem.physical = dfb_gfxcard_memory_physical( device, offset ); idrv->lring_base = dfb_gfxcard_memory_virtual( device, offset ); offset = dfb_gfxcard_reserve_memory( device, 4096 ); idrv->ovl_mem.physical = dfb_gfxcard_memory_physical( device, offset ); idrv->ovl_base = dfb_gfxcard_memory_virtual( device, offset );*/ /* D_DEBUG_AT( I830_Ring, "lp_ring at 0x%08x (%p)\n", idrv->lring_mem.physical, idrv->lring_base ); D_DEBUG_AT( I830_Ring, "ovl at 0x%08x (%p)\n", idrv->ovl_mem.physical, idrv->ovl_base );*/ i830_init_ringbuffer( idrv, idev ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { I830DeviceData *idev = device_data; I830DriverData *idrv = driver_data; i830ovlOnOff( idrv, idev, false ); i830_wait_for_blit_idle(idrv, idev); i830_lring_enable(idrv, 0); i830_release_resource( idrv, idev ); D_DEBUG( "DirectFB/I830: DMA Buffer Performance Monitoring:\n"); D_DEBUG( "DirectFB/I830: %9d DMA buffer size in KB\n", RINGBUFFER_SIZE/1024 ); D_DEBUG( "DirectFB/I830: %9d i830_wait_for_blit_idle calls\n", idev->idle_calls ); D_DEBUG( "DirectFB/I830: %9d i830_wait_for_space calls\n", idev->waitfifo_calls ); D_DEBUG( "DirectFB/I830: %9d BUFFER transfers (i830_wait_for_space sum)\n", idev->waitfifo_sum ); D_DEBUG( "DirectFB/I830: %9d BUFFER wait cycles (depends on GPU/CPU)\n", idev->fifo_waitcycles ); D_DEBUG( "DirectFB/I830: %9d IDLE wait cycles (depends on GPU/CPU)\n", idev->idle_waitcycles ); D_DEBUG( "DirectFB/I830: %9d BUFFER space cache hits(depends on BUFFER size)\n", idev->fifo_cache_hits ); D_DEBUG( "DirectFB/I830: %9d BUFFER timeout sum (possible hardware crash)\n", idev->fifo_timeoutsum ); D_DEBUG( "DirectFB/I830: %9d IDLE timeout sum (possible hardware crash)\n", idev->idle_timeoutsum ); D_DEBUG( "DirectFB/I830: Conclusion:\n" ); D_DEBUG( "DirectFB/I830: Average buffer transfers per i830_wait_for_space " "call: %.2f\n", idev->waitfifo_sum/(float)(idev->waitfifo_calls) ); D_DEBUG( "DirectFB/I830: Average wait cycles per i830_wait_for_space call:" " %.2f\n", idev->fifo_waitcycles/(float)(idev->waitfifo_calls) ); D_DEBUG( "DirectFB/I830: Average wait cycles per i830_wait_for_blit_idle call:" " %.2f\n", idev->idle_waitcycles/(float)(idev->idle_calls) ); D_DEBUG( "DirectFB/I830: Average buffer space cache hits: %02d%%\n", (int)(100 * idev->fifo_cache_hits/ (float)(idev->waitfifo_calls)) ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { I830DriverData *idrv = (I830DriverData *) driver_data; dfb_gfxcard_unmap_mmio( device, idrv->mmio_base, -1 ); if (idrv->flags & I830RES_MMAP) { munmap((void *) idrv->aper_base, idrv->info.aper_size * 1024 * 1024); idrv->flags &= ~I830RES_MMAP; } if (idrv->flags & I830RES_GART_ACQ) { ioctl(idrv->agpgart, AGPIOC_RELEASE); idrv->flags &= ~I830RES_GART_ACQ; } if (idrv->flags & I830RES_GART) { close(idrv->agpgart); idrv->flags &= ~I830RES_GART; } } DirectFB-1.2.10/gfxdrivers/i830/i830.h0000644000175000017500000002675011164361026013652 00000000000000/* Intel i830 DirectFB graphics driver (c) Copyright 2005 Servision Ltd. http://www.servision.net/ All rights reserved. Based on i810 driver written by Antonino Daplas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __I830_H__ #define __I830_H__ #include #include #include #include #include #define RINGBUFFER_SIZE (128 * 1024) /* Ring buffer registers, p277, overview p19 */ #define LP_RING 0x2030 #define HP_RING 0x2040 #define RING_TAIL 0x00 #define TAIL_ADDR 0x000FFFF8 #define I830_TAIL_MASK 0x001FFFF8 #define RING_HEAD 0x04 #define HEAD_WRAP_COUNT 0xFFE00000 #define HEAD_WRAP_ONE 0x00200000 #define HEAD_ADDR 0x001FFFFC #define I830_HEAD_MASK 0x001FFFFC #define RING_START 0x08 #define START_ADDR 0x00FFFFF8 #define I830_RING_START_MASK 0xFFFFF000 #define RING_LEN 0x0C #define RING_NR_PAGES 0x000FF000 #define I830_RING_NR_PAGES 0x001FF000 #define RING_REPORT_MASK 0x00000006 #define RING_REPORT_64K 0x00000002 #define RING_REPORT_128K 0x00000004 #define RING_NO_REPORT 0x00000000 #define RING_VALID_MASK 0x00000001 #define RING_VALID 0x00000001 #define RING_INVALID 0x00000000 /* Overlay Flip */ #define MI_OVERLAY_FLIP (0x11<<23) #define MI_OVERLAY_FLIP_CONTINUE (0<<21) #define MI_OVERLAY_FLIP_ON (1<<21) #define MI_OVERLAY_FLIP_OFF (2<<21) /* Wait for Events */ #define MI_WAIT_FOR_EVENT (0x03<<23) #define MI_WAIT_FOR_OVERLAY_FLIP (1<<16) /* Flush */ #define MI_FLUSH (0x04<<23) #define MI_WRITE_DIRTY_STATE (1<<4) #define MI_END_SCENE (1<<3) #define MI_INHIBIT_RENDER_CACHE_FLUSH (1<<2) #define MI_INVALIDATE_MAP_CACHE (1<<0) /* Noop */ #define MI_NOOP 0x00 #define MI_NOOP_WRITE_ID (1<<22) #define MI_NOOP_ID_MASK (1<<22 - 1) /* Instruction Parser Mode Register * - p281 * - 2 new bits. */ #define INST_PM 0x20c0 #define AGP_SYNC_PACKET_FLUSH_ENABLE 0x20 /* reserved */ #define SYNC_PACKET_FLUSH_ENABLE 0x10 #define TWO_D_INST_DISABLE 0x08 #define THREE_D_INST_DISABLE 0x04 #define STATE_VAR_UPDATE_DISABLE 0x02 #define PAL_STIP_DISABLE 0x01 #define INST_DONE 0x2090 #define INST_PS 0x20c4 #define MEMMODE 0x20dc #define I830RES_GART 1 #define I830RES_LRING_ACQ 2 #define I830RES_LRING_BIND 4 #define I830RES_OVL_ACQ 8 #define I830RES_OVL_BIND 16 #define I830RES_GART_ACQ 32 #define I830RES_MMAP 64 #define I830RES_STATE_SAVE 128 #ifndef AGP_NORMAL_MEMORY #define AGP_NORMAL_MEMORY 0 #endif #ifndef AGP_PHYSICAL_MEMORY #define AGP_PHYSICAL_MEMORY 2 #endif /* * OCMD - Overlay Command Register */ #define MIRROR_MODE (0x3<<17) #define MIRROR_HORIZONTAL (0x1<<17) #define MIRROR_VERTICAL (0x2<<17) #define MIRROR_BOTH (0x3<<17) #define OV_BYTE_ORDER (0x3<<14) #define UV_SWAP (0x1<<14) #define Y_SWAP (0x2<<14) #define Y_AND_UV_SWAP (0x3<<14) #define SOURCE_FORMAT (0xf<<10) #define RGB_888 (0x1<<10) #define RGB_555 (0x2<<10) #define RGB_565 (0x3<<10) #define YUV_422 (0x8<<10) #define YUV_411 (0x9<<10) #define YUV_420 (0xc<<10) #define YUV_422_PLANAR (0xd<<10) #define YUV_410 (0xe<<10) #define TVSYNC_FLIP_PARITY (0x1<<9) #define TVSYNC_FLIP_ENABLE (0x1<<7) #define BUF_TYPE (0x1<<5) #define BUF_TYPE_FRAME (0x0<<5) #define BUF_TYPE_FIELD (0x1<<5) #define TEST_MODE (0x1<<4) #define BUFFER_SELECT (0x3<<2) #define BUFFER0 (0x0<<2) #define BUFFER1 (0x1<<2) #define FIELD_SELECT (0x1<<1) #define FIELD0 (0x0<<1) #define FIELD1 (0x1<<1) #define OVERLAY_ENABLE 0x1 /* OCONFIG register */ #define CC_OUT_8BIT (0x1<<3) #define OVERLAY_PIPE_MASK (0x1<<18) #define OVERLAY_PIPE_A (0x0<<18) #define OVERLAY_PIPE_B (0x1<<18) /* DCLRKM register */ #define DEST_KEY_ENABLE (0x1<<31) /* Polyphase filter coefficients */ #define N_HORIZ_Y_TAPS 5 #define N_VERT_Y_TAPS 3 #define N_HORIZ_UV_TAPS 3 #define N_VERT_UV_TAPS 3 #define N_PHASES 17 #define MAX_TAPS 5 /* Filter cutoff frequency limits. */ #define MIN_CUTOFF_FREQ 1.0 #define MAX_CUTOFF_FREQ 3.0 typedef volatile struct { u32 OBUF_0Y; u32 OBUF_1Y; u32 OBUF_0U; u32 OBUF_0V; u32 OBUF_1U; u32 OBUF_1V; u32 OSTRIDE; u32 YRGB_VPH; u32 UV_VPH; u32 HORZ_PH; u32 INIT_PHS; u32 DWINPOS; u32 DWINSZ; u32 SWIDTH; u32 SWIDTHSW; u32 SHEIGHT; u32 YRGBSCALE; u32 UVSCALE; u32 OCLRC0; u32 OCLRC1; u32 DCLRKV; u32 DCLRKM; u32 SCLRKVH; u32 SCLRKVL; u32 SCLRKEN; u32 OCONFIG; u32 OCMD; u32 RESERVED1; /* 0x6C */ u32 AWINPOS; u32 AWINSZ; u32 RESERVED2; /* 0x78 */ u32 RESERVED3; /* 0x7C */ u32 RESERVED4; /* 0x80 */ u32 RESERVED5; /* 0x84 */ u32 RESERVED6; /* 0x88 */ u32 RESERVED7; /* 0x8C */ u32 RESERVED8; /* 0x90 */ u32 RESERVED9; /* 0x94 */ u32 RESERVEDA; /* 0x98 */ u32 RESERVEDB; /* 0x9C */ u32 FASTHSCALE; /* 0xA0 */ u32 UVSCALEV; /* 0xA4 */ u32 RESERVEDC[(0x200 - 0xA8) / 4]; /* 0xA8 - 0x1FC */ u16 Y_VCOEFS[N_VERT_Y_TAPS * N_PHASES]; /* 0x200 */ u16 RESERVEDD[0x100 / 2 - N_VERT_Y_TAPS * N_PHASES]; u16 Y_HCOEFS[N_HORIZ_Y_TAPS * N_PHASES]; /* 0x300 */ u16 RESERVEDE[0x200 / 2 - N_HORIZ_Y_TAPS * N_PHASES]; u16 UV_VCOEFS[N_VERT_UV_TAPS * N_PHASES]; /* 0x500 */ u16 RESERVEDF[0x100 / 2 - N_VERT_UV_TAPS * N_PHASES]; u16 UV_HCOEFS[N_HORIZ_UV_TAPS * N_PHASES]; /* 0x600 */ u16 RESERVEDG[0x100 / 2 - N_HORIZ_UV_TAPS * N_PHASES]; } I830OverlayRegs; typedef struct { CoreLayerRegionConfig config; } I830OverlayLayerData; typedef struct { unsigned int tail_mask; int size; int head; int tail; int space; } I830RingBuffer; typedef struct { volatile void *virt; unsigned int tail_mask; unsigned int outring; } I830RingBlock; typedef struct { bool initialized; I830RingBuffer lp_ring; bool overlayOn; I830OverlayLayerData *iovl; agp_info info; agp_allocate lring_mem; agp_allocate ovl_mem; agp_bind lring_bind; agp_bind ovl_bind; u32 pattern; u32 lring1; u32 lring2; u32 lring3; u32 lring4; /* benchmarking */ u32 waitfifo_sum; u32 waitfifo_calls; u32 idle_calls; u32 fifo_waitcycles; u32 idle_waitcycles; u32 fifo_cache_hits; u32 fifo_timeoutsum; u32 idle_timeoutsum; } I830DeviceData; typedef struct { I830DeviceData *idev; I830OverlayRegs *oregs; u32 flags; int agpgart; agp_info info; volatile u8 *aper_base; volatile u8 *lring_base; volatile u8 *ovl_base; volatile u8 *mmio_base; volatile u8 *pattern_base; } I830DriverData; extern DisplayLayerFuncs i830OverlayFuncs; void i830ovlOnOff( I830DriverData *idrv, I830DeviceData *idev, bool on ); #define i830_readb(mmio_base, where) \ *((volatile u8 *) (mmio_base + where)) \ #define i830_readw(mmio_base, where) \ *((volatile u16 *) (mmio_base + where)) \ #define i830_readl(mmio_base, where) \ *((volatile u32 *) (mmio_base + where)) \ #define i830_writeb(mmio_base, where, val) \ *((volatile u8 *) (mmio_base + where)) = (volatile u8) val \ #define i830_writew(mmio_base, where, val) \ *((volatile u16 *) (mmio_base + where)) = (volatile u16) val \ #define i830_writel(mmio_base, where, val) \ *((volatile u32 *) (mmio_base + where)) = (volatile u32) val \ DFBResult i830_wait_lp_ring( I830DriverData *idrv, I830DeviceData *idev, int space ); D_DEBUG_DOMAIN( I830_Ring, "I830/Ring", "I830 Ring Buffer" ); static inline DFBResult i830_begin_lp_ring( I830DriverData *idrv, I830DeviceData *idev, int needed, I830RingBlock *ret_block ) { DFBResult ret; I830RingBuffer *buf = &idev->lp_ring; D_DEBUG_AT( I830_Ring, "begin_lp_ring( %d ) <- head 0x%08x\n", needed, i830_readl( idrv->mmio_base, LP_RING + RING_HEAD ) ); if (needed & 1) D_ERROR( "i830_begin_ring called with odd argument: %d\n", needed); needed *= 4; if (buf->space < needed) { ret = i830_wait_lp_ring( idrv, idev, needed ); if (ret) return ret; } buf->space -= needed; ret_block->virt = idrv->lring_base; ret_block->tail_mask = buf->tail_mask; ret_block->outring = buf->tail; return DFB_OK; } static inline void i830_out_ring( I830RingBlock *block, u32 value ) { D_DEBUG_AT( I830_Ring, "out_ring( 0x%08x, 0x%08x )\n", block->outring, value ); *(volatile u32*)(block->virt + block->outring) = value; block->outring = (block->outring + 4) & block->tail_mask; } static inline void i830_advance_lp_ring( I830DriverData *idrv, I830DeviceData *idev, const I830RingBlock *block ) { D_DEBUG_AT( I830_Ring, "advance_lp_ring( 0x%08x )\n", block->outring ); idev->lp_ring.tail = block->outring; if (block->outring & 0x07) D_ERROR( "i830_advance_lp_ring: " "outring (0x%x) isn't on a QWord boundary", block->outring ); i830_writel( idrv->mmio_base, LP_RING + RING_TAIL, block->outring ); } #endif /* __I830_H__ */ DirectFB-1.2.10/gfxdrivers/Makefile.in0000644000175000017500000004401211307521477014376 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = gfxdrivers DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = ati128 cle266 cyber5k davinci ep9x i810 i830 mach64 \ matrox neomagic nsc nvidia omap radeon savage sh772x sis315 \ tdfx unichrome vmware DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @GFX_ATI128_FALSE@ATI128_DIR = @GFX_ATI128_TRUE@ATI128_DIR = ati128 @GFX_CLE266_FALSE@CLE266_DIR = @GFX_CLE266_TRUE@CLE266_DIR = cle266 @GFX_CYBER5K_FALSE@CYBER5K_DIR = @GFX_CYBER5K_TRUE@CYBER5K_DIR = cyber5k @GFX_DAVINCI_FALSE@DAVINCI_DIR = @GFX_DAVINCI_TRUE@DAVINCI_DIR = davinci @GFX_I810_FALSE@I810_DIR = @GFX_I810_TRUE@I810_DIR = i810 @GFX_I830_FALSE@I830_DIR = @GFX_I830_TRUE@I830_DIR = i830 @GFX_MACH64_FALSE@MACH64_DIR = @GFX_MACH64_TRUE@MACH64_DIR = mach64 @GFX_MATROX_FALSE@MATROX_DIR = @GFX_MATROX_TRUE@MATROX_DIR = matrox @GFX_NEOMAGIC_FALSE@NEOMAGIC_DIR = @GFX_NEOMAGIC_TRUE@NEOMAGIC_DIR = neomagic @GFX_NSC_FALSE@NSC_DIR = @GFX_NSC_TRUE@NSC_DIR = nsc @GFX_NVIDIA_FALSE@NVIDIA_DIR = @GFX_NVIDIA_TRUE@NVIDIA_DIR = nvidia @GFX_OMAP_FALSE@OMAP_DIR = @GFX_OMAP_TRUE@OMAP_DIR = omap @GFX_RADEON_FALSE@RADEON_DIR = @GFX_RADEON_TRUE@RADEON_DIR = radeon @GFX_SAVAGE_FALSE@SAVAGE_DIR = @GFX_SAVAGE_TRUE@SAVAGE_DIR = savage @GFX_SH772X_FALSE@SH772X_DIR = @GFX_SH772X_TRUE@SH772X_DIR = sh772x @GFX_SIS315_FALSE@SIS315_DIR = @GFX_SIS315_TRUE@SIS315_DIR = sis315 @GFX_TDFX_FALSE@TDFX_DIR = @GFX_TDFX_TRUE@TDFX_DIR = tdfx @GFX_UNICHROME_FALSE@UNICHROME_DIR = @GFX_UNICHROME_TRUE@UNICHROME_DIR = unichrome @GFX_VMWARE_FALSE@VMWARE_DIR = @GFX_VMWARE_TRUE@VMWARE_DIR = vmware @GFX_EP9X_FALSE@EP9X_DIR = @GFX_EP9X_TRUE@EP9X_DIR = ep9x SUBDIRS = \ $(ATI128_DIR) \ $(CLE266_DIR) \ $(CYBER5K_DIR) \ $(DAVINCI_DIR) \ $(EP9X_DIR) \ $(I810_DIR) \ $(I830_DIR) \ $(MACH64_DIR) \ $(MATROX_DIR) \ $(NEOMAGIC_DIR) \ $(NSC_DIR) \ $(NVIDIA_DIR) \ $(OMAP_DIR) \ $(RADEON_DIR) \ $(SAVAGE_DIR) \ $(SH772X_DIR) \ $(SIS315_DIR) \ $(TDFX_DIR) \ $(UNICHROME_DIR) \ $(VMWARE_DIR) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/radeon/0000777000175000017500000000000011307522571013660 500000000000000DirectFB-1.2.10/gfxdrivers/radeon/radeon.h0000644000175000017500000001465011164361026015220 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __RADEON_H__ #define __RADEON_H__ #include #include #include #include #include typedef enum { CHIP_UNKNOWN = 0, CHIP_R100, CHIP_RV100, CHIP_RS100, CHIP_RV200, CHIP_RS200, CHIP_RS250, CHIP_R200, CHIP_RV250, CHIP_RV280, CHIP_RS300, CHIP_RS350, CHIP_R300, CHIP_R350, CHIP_RV350, CHIP_RV380, CHIP_R420, CHIP_RV410, CHIP_RS400, } RadeonChipsetFamily; typedef enum { MT_NONE = 0, MT_CRT = 1, MT_DFP = 2, MT_LCD = 3, MT_CTV = 4, MT_STV = 5 } RadeonMonitorType; typedef struct { /* validated flags */ StateModificationFlags set; /* current function */ DFBAccelerationMask accel; /* mask of currently supported drawing functions */ DFBAccelerationMask drawing_mask; /* mask of currently supported blitting functions */ DFBAccelerationMask blitting_mask; unsigned long fb_phys; u32 fb_offset; u32 fb_size; u32 agp_offset; u32 agp_size; DFBSurfacePixelFormat dst_format; u32 dst_offset; u32 dst_offset_cb; u32 dst_offset_cr; u32 dst_pitch; DFBBoolean dst_422; DFBSurfacePixelFormat src_format; u32 src_offset; u32 src_offset_cb; u32 src_offset_cr; u32 src_pitch; u32 src_width; u32 src_height; u32 src_mask; DFBSurfacePixelFormat msk_format; u32 msk_offset; u32 msk_pitch; u32 msk_width; u32 msk_height; DFBRegion clip; float color[4]; u32 y_cop; u32 cb_cop; u32 cr_cop; DFBSurfaceRenderOptions render_options; DFBSurfaceDrawingFlags drawingflags; DFBSurfaceBlittingFlags blittingflags; const s32 *matrix; DFBBoolean affine_matrix; /* chipset identified */ RadeonChipsetFamily chipset; DFBBoolean igp; /* connected monitors */ RadeonMonitorType monitor1; RadeonMonitorType monitor2; /* saved registers */ u32 mc_fb_location; u32 mc_agp_location; u32 crtc_base_addr; u32 crtc2_base_addr; u32 agp_base; u32 agp_cntl; u32 aic_cntl; u32 bus_cntl; u32 fcp_cntl; u32 cap0_trig_cntl; u32 vid_buffer_control; u32 display_test_debug_cntl; u32 surface_cntl; u32 dp_gui_master_cntl; /* recorded registers */ u32 surface_cntl_p; u32 surface_cntl_c; u32 gui_master_cntl; u32 rb3d_cntl; u32 rb3d_blend; /* faked texture for YUV422 drawing functions */ u32 yuv422_buffer; /* vertex buffer */ u32 vb[1024]; u32 vb_size; u32 vb_count; u32 vb_type; /* for fifo/performance monitoring */ unsigned int fifo_space; unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; } RadeonDeviceData; typedef struct { RadeonDeviceData *device_data; u8 *fb_base; volatile u8 *mmio_base; unsigned int mmio_size; } RadeonDriverData; extern void radeon_reset( RadeonDriverData *rdrv, RadeonDeviceData *rdev ); extern ScreenFuncs RadeonCrtc1ScreenFuncs; extern ScreenFuncs OldPrimaryScreenFuncs; extern void *OldPrimaryScreenDriverData; extern DisplayLayerFuncs RadeonCrtc1LayerFuncs; extern DisplayLayerFuncs OldPrimaryLayerFuncs; extern void *OldPrimaryLayerDriverData; extern DisplayLayerFuncs RadeonOverlayFuncs; extern ScreenFuncs RadeonCrtc2ScreenFuncs; extern DisplayLayerFuncs RadeonCrtc2LayerFuncs; /* utility function */ static __inline__ u32 f2d( float f ) { union { float f; u32 d; } tmp; tmp.f = f; return tmp.d; } static __inline__ float d2f( u32 d ) { union { float f; u32 d; } tmp; tmp.d = d; return tmp.f; } #define RADEON_TRANSFORM(x, y, retx, rety, m, affine) \ do { \ float _x, _y, _w; \ if (affine) { \ _x = ((x) * m[0] + (y) * m[1] + m[2]) / 65536.f; \ _y = ((x) * m[3] + (y) * m[4] + m[5]) / 65536.f; \ } \ else { \ _w = ((x) * m[6] + (y) * m[7] + m[8]); \ _x = ((x) * m[0] + (y) * m[1] + m[2]) / _w; \ _y = ((x) * m[3] + (y) * m[4] + m[5]) / _w; \ } \ retx = _x; rety = _y; \ } while(0) #endif /* __RADEON_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/radeon_2d.c0000644000175000017500000003143111164361026015574 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_2d.h" static void radeonDoFillRectangle2D( RadeonDriverData *rdrv, RadeonDeviceData *rdev, DFBRectangle *rect ) { volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_Y_X, (rect->y << 16) | (rect->x & 0x3fff) ); radeon_out32( mmio, DST_HEIGHT_WIDTH, (rect->h << 16) | (rect->w & 0x3fff) ); } bool radeonFillRectangle2D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->dst_422) { rect->x /= 2; rect->w = (rect->w+1) >> 1; } radeonDoFillRectangle2D( rdrv, rdev, rect ); return true; } bool radeonFillRectangle2D_420( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; DFBRegion *clip = &rdev->clip; volatile u8 *mmio = rdrv->mmio_base; /* Fill Luma plane */ radeonDoFillRectangle2D( rdrv, rdev, rect ); /* Scale coordinates */ rect->x /= 2; rect->y /= 2; rect->w = (rect->w+1) >> 1; rect->h = (rect->h+1) >> 1; /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1)/2 << 16) | ((clip->x2+1)/2 & 0xffff) ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->cb_cop ); /* Fill Cb plane */ radeonDoFillRectangle2D( rdrv, rdev, rect ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cr ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->cr_cop ); /* Fill Cr plane */ radeonDoFillRectangle2D( rdrv, rdev, rect ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->y_cop ); return true; } static void radeonDoDrawRectangle2D( RadeonDriverData *rdrv, RadeonDeviceData *rdev, DFBRectangle *rect ) { volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 7 ); /* left line */ radeon_out32( mmio, DST_Y_X, (rect->y << 16) | (rect->x & 0x3fff) ); radeon_out32( mmio, DST_HEIGHT_WIDTH, (rect->h << 16) | 1 ); /* top line */ radeon_out32( mmio, DST_HEIGHT_WIDTH, (1 << 16) | (rect->w & 0xffff) ); /* bottom line */ radeon_out32( mmio, DST_Y_X, ((rect->y+rect->h-1) << 16) | (rect->x & 0x3fff) ); radeon_out32( mmio, DST_HEIGHT_WIDTH, (1 << 16) | (rect->w & 0xffff) ); /* right line */ radeon_out32( mmio, DST_Y_X, (rect->y << 16) | ((rect->x+rect->w-1) & 0x3fff) ); radeon_out32( mmio, DST_HEIGHT_WIDTH, (rect->h << 16) | 1 ); } bool radeonDrawRectangle2D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->dst_422) { rect->x /= 2; rect->w = (rect->w+1) >> 1; } radeonDoDrawRectangle2D( rdrv, rdev, rect ); return true; } bool radeonDrawRectangle2D_420( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; DFBRegion *clip = &rdev->clip; volatile u8 *mmio = rdrv->mmio_base; /* Fill Luma plane */ radeonDoDrawRectangle2D( rdrv, rdev, rect ); /* Scale coordinates */ rect->x /= 2; rect->y /= 2; rect->w >>= 1; rect->h >>= 1; /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1)/2 << 16) | ((clip->x2+1)/2 & 0xffff) ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->cb_cop ); /* Fill Cb plane */ radeonDoDrawRectangle2D( rdrv, rdev, rect ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cr ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->cr_cop ); /* Fill Cr plane */ radeonDoDrawRectangle2D( rdrv, rdev, rect ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->y_cop ); return true; } static void radeonDoDrawLine2D( RadeonDriverData *rdrv, RadeonDeviceData *rdev, DFBRegion *line ) { volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_LINE_START, (line->y1 << 16) | (line->x1 & 0xffff) ); radeon_out32( mmio, DST_LINE_END, (line->y2 << 16) | (line->x2 & 0xffff) ); } bool radeonDrawLine2D( void *drv, void *dev, DFBRegion *line ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->dst_422) { line->x1 /= 2; line->x2 = (line->x2+1) / 2; } radeonDoDrawLine2D( rdrv, rdev, line ); return true; } bool radeonDrawLine2D_420( void *drv, void *dev, DFBRegion *line ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; DFBRegion *clip = &rdev->clip; volatile u8 *mmio = rdrv->mmio_base; line->x1 &= ~1; line->y1 &= ~1; line->x2 &= ~1; line->y2 &= ~1; /* Fill Luma plane */ radeonDoDrawLine2D( rdrv, rdev, line ); /* Scale coordinates */ line->x1 /= 2; line->y1 /= 2; line->x2 /= 2; line->y2 /= 2; /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1)/2 << 16) | ((clip->x2+1)/2 & 0xffff) ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->cb_cop ); /* Fill Cb plane */ radeonDoDrawLine2D( rdrv, rdev, line ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cr ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->cr_cop ); /* Fill Cr plane */ radeonDoDrawLine2D( rdrv, rdev, line ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); radeon_out32( mmio, DP_BRUSH_FRGD_CLR, rdev->y_cop ); return true; } static void radeonDoBlit2D( RadeonDriverData *rdrv, RadeonDeviceData *rdev, int sx, int sy, int dx, int dy, int w, int h ) { volatile u8 *mmio = rdrv->mmio_base; u32 dir = 0; /* check which blitting direction should be used */ if (sx <= dx) { sx += w-1; dx += w-1; } else dir |= DST_X_LEFT_TO_RIGHT; if (sy <= dy) { sy += h-1; dy += h-1; } else dir |= DST_Y_TOP_TO_BOTTOM; radeon_waitfifo( rdrv, rdev, 4 ); radeon_out32( mmio, DP_CNTL, dir ); radeon_out32( mmio, SRC_Y_X, (sy << 16) | (sx & 0x3fff) ); radeon_out32( mmio, DST_Y_X, (dy << 16) | (dx & 0x3fff) ); radeon_out32( mmio, DST_HEIGHT_WIDTH, (h << 16) | (w & 0x3fff) ); } bool radeonBlit2D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->dst_422) { sr->x /= 2; sr->w = (sr->w+1) >> 1; dx /= 2; } radeonDoBlit2D( rdrv, rdev, sr->x, sr->y, dx, dy, sr->w, sr->h ); return true; } bool radeonBlit2D_420( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; DFBRegion *clip = &rdev->clip; volatile u8 *mmio = rdrv->mmio_base; /* Blit Luma plane */ radeonDoBlit2D( rdrv, rdev, sr->x, sr->y, dx, dy, sr->w, sr->h ); /* Scale coordinates */ sr->x /= 2; sr->y /= 2; sr->w = (sr->w+1) >> 1; sr->h = (sr->h+1) >> 1; dx /= 2; dy /= 2; /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 6 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, SRC_OFFSET, rdev->src_offset_cb ); radeon_out32( mmio, SRC_PITCH, rdev->src_pitch/2 ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1/2) << 16) | ((clip->x2+1/2) & 0xffff) ); /* Blit Cb plane */ radeonDoBlit2D( rdrv, rdev, sr->x, sr->y, dx, dy, sr->w, sr->h ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset_cr ); radeon_out32( mmio, SRC_OFFSET, rdev->src_offset_cr ); /* Blit Cr plane */ radeonDoBlit2D( rdrv, rdev, sr->x, sr->y, dx, dy, sr->w, sr->h ); /* Reset */ radeon_waitfifo( rdrv, rdev, 6 ); radeon_out32( mmio, DST_OFFSET, rdev->dst_offset ); radeon_out32( mmio, DST_PITCH, rdev->dst_pitch ); radeon_out32( mmio, SRC_OFFSET, rdev->src_offset ); radeon_out32( mmio, SRC_PITCH, rdev->src_pitch ); radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); return true; } DirectFB-1.2.10/gfxdrivers/radeon/r100_state.c0000644000175000017500000010700111164361026015616 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_state.h" static const u32 r100SrcBlend[] = { SRC_BLEND_GL_ZERO, // DSBF_ZERO SRC_BLEND_GL_ONE, // DSBF_ONE SRC_BLEND_GL_SRC_COLOR, // DSBF_SRCCOLOR SRC_BLEND_GL_ONE_MINUS_SRC_COLOR, // DSBF_INVSRCCOLOR SRC_BLEND_GL_SRC_ALPHA, // DSBF_SRCALPHA SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA, // DSBF_INVSRCALPHA SRC_BLEND_GL_DST_ALPHA, // DSBF_DSTALPHA SRC_BLEND_GL_ONE_MINUS_DST_ALPHA, // DSBF_INVDSTALPHA SRC_BLEND_GL_DST_COLOR, // DSBF_DSTCOLOR SRC_BLEND_GL_ONE_MINUS_DST_COLOR, // DSBF_INVDSTCOLOR SRC_BLEND_GL_SRC_ALPHA_SATURATE // DSBF_SRCALPHASAT }; static const u32 r100DstBlend[] = { DST_BLEND_GL_ZERO, // DSBF_ZERO DST_BLEND_GL_ONE, // DSBF_ONE DST_BLEND_GL_SRC_COLOR, // DSBF_SRCCOLOR DST_BLEND_GL_ONE_MINUS_SRC_COLOR, // DSBF_INVSRCCOLOR DST_BLEND_GL_SRC_ALPHA, // DSBF_SRCALPHA DST_BLEND_GL_ONE_MINUS_SRC_ALPHA, // DSBF_INVSRCALPHA DST_BLEND_GL_DST_ALPHA, // DSBF_DSTALPHA DST_BLEND_GL_ONE_MINUS_DST_ALPHA, // DSBF_INVDSTALPHA DST_BLEND_GL_DST_COLOR, // DSBF_DSTCOLOR DST_BLEND_GL_ONE_MINUS_DST_COLOR, // DSBF_INVDSTCOLOR DST_BLEND_GL_ZERO // DSBF_SRCALPHASAT }; void r100_restore( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 8 ); /* enable caches */ radeon_out32( mmio, RB2D_DSTCACHE_MODE, RB2D_DC_2D_CACHE_AUTOFLUSH | RB2D_DC_3D_CACHE_AUTOFLUSH ); radeon_out32( mmio, RB3D_DSTCACHE_MODE, RB3D_DC_2D_CACHE_AUTOFLUSH | RB3D_DC_3D_CACHE_AUTOFLUSH ); /* restore 3d engine state */ radeon_out32( mmio, SE_COORD_FMT, VTX_XY_PRE_MULT_1_OVER_W0 | TEX1_W_ROUTING_USE_W0 ); radeon_out32( mmio, SE_LINE_WIDTH, 0x10 ); #ifdef WORDS_BIGENDIAN radeon_out32( mmio, SE_CNTL_STATUS, TCL_BYPASS | VC_32BIT_SWAP ); #else radeon_out32( mmio, SE_CNTL_STATUS, TCL_BYPASS ); #endif radeon_out32( mmio, PP_MISC, ALPHA_TEST_PASS ); radeon_out32( mmio, RB3D_ZSTENCILCNTL, Z_TEST_ALWAYS ); radeon_out32( mmio, RB3D_ROPCNTL, ROP_XOR ); } void r100_set_destination( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->destination; CoreSurfaceBuffer *buffer = state->dst.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 offset; u32 pitch; if (RADEON_IS_SET( DESTINATION )) return; D_ASSERT( (state->dst.offset % 32) == 0 ); D_ASSERT( (state->dst.pitch % 32) == 0 ); offset = radeon_buffer_offset( rdev, &state->dst ); pitch = state->dst.pitch; if (rdev->dst_offset != offset || rdev->dst_pitch != pitch || rdev->dst_format != buffer->format) { bool dst_422 = false; switch (buffer->format) { case DSPF_LUT8: case DSPF_ALUT44: case DSPF_A8: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB8; break; case DSPF_RGB332: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB332 | DITHER_ENABLE; break; case DSPF_ARGB2554: rdev->gui_master_cntl = GMC_DST_16BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB565; break; case DSPF_RGB444: case DSPF_ARGB4444: rdev->gui_master_cntl = GMC_DST_16BPP; rdev->rb3d_cntl = COLOR_FORMAT_ARGB4444 | DITHER_ENABLE; break; case DSPF_RGB555: case DSPF_ARGB1555: rdev->gui_master_cntl = GMC_DST_15BPP; rdev->rb3d_cntl = COLOR_FORMAT_ARGB1555 | DITHER_ENABLE; break; case DSPF_RGB16: rdev->gui_master_cntl = GMC_DST_16BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB565 | DITHER_ENABLE; break; case DSPF_RGB32: case DSPF_ARGB: case DSPF_AiRGB: case DSPF_AYUV: rdev->gui_master_cntl = GMC_DST_32BPP; rdev->rb3d_cntl = COLOR_FORMAT_ARGB8888; break; case DSPF_UYVY: rdev->gui_master_cntl = GMC_DST_YVYU; rdev->rb3d_cntl = COLOR_FORMAT_YUV422_YVYU; dst_422 = true; break; case DSPF_YUY2: rdev->gui_master_cntl = GMC_DST_VYUY; rdev->rb3d_cntl = COLOR_FORMAT_YUV422_VYUY; dst_422 = true; break; case DSPF_I420: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB8; rdev->dst_offset_cb = offset + pitch * surface->config.size.h; rdev->dst_offset_cr = rdev->dst_offset_cb + pitch/2 * surface->config.size.h/2; break; case DSPF_YV12: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB8; rdev->dst_offset_cr = offset + pitch * surface->config.size.h; rdev->dst_offset_cb = rdev->dst_offset_cr + pitch/2 * surface->config.size.h/2; break; default: D_BUG( "unexpected pixelformat" ); return; } rdev->gui_master_cntl |= GMC_DP_SRC_SOURCE_MEMORY | GMC_WR_MSK_DIS | GMC_SRC_PITCH_OFFSET_CNTL | GMC_DST_PITCH_OFFSET_CNTL | GMC_DST_CLIPPING; radeon_waitfifo( rdrv, rdev, 4 ); radeon_out32( mmio, DST_OFFSET, offset ); radeon_out32( mmio, DST_PITCH, pitch ); radeon_out32( mmio, RB3D_COLOROFFSET, offset ); radeon_out32( mmio, RB3D_COLORPITCH, pitch / DFB_BYTES_PER_PIXEL(buffer->format) ); if (rdev->dst_format != buffer->format) { if (dst_422 && !rdev->dst_422) { RADEON_UNSET( SOURCE ); RADEON_UNSET( CLIP ); } RADEON_UNSET( COLOR ); RADEON_UNSET( DST_BLEND ); } rdev->dst_format = buffer->format; rdev->dst_offset = offset; rdev->dst_pitch = pitch; rdev->dst_422 = dst_422; } RADEON_SET( DESTINATION ); } void r100_set_source( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->source; CoreSurfaceBuffer *buffer = state->src.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 txformat = TXFORMAT_NON_POWER2; u32 txfilter = MAG_FILTER_LINEAR | MIN_FILTER_LINEAR | CLAMP_S_CLAMP_LAST | CLAMP_T_CLAMP_LAST; if (RADEON_IS_SET( SOURCE )) { if ((state->blittingflags & DSBLIT_DEINTERLACE) == (rdev->blittingflags & DSBLIT_DEINTERLACE)) return; } D_ASSERT( (state->src.offset % 32) == 0 ); D_ASSERT( (state->src.pitch % 32) == 0 ); rdev->src_offset = radeon_buffer_offset( rdev, &state->src ); rdev->src_pitch = state->src.pitch; rdev->src_width = surface->config.size.w; rdev->src_height = surface->config.size.h; switch (buffer->format) { case DSPF_LUT8: txformat |= TXFORMAT_I8; txfilter &= ~(MAG_FILTER_LINEAR | MIN_FILTER_LINEAR); rdev->src_mask = 0x000000ff; break; case DSPF_ALUT44: txformat |= TXFORMAT_I8; txfilter &= ~(MAG_FILTER_LINEAR | MIN_FILTER_LINEAR); rdev->src_mask = 0x0000000f; break; case DSPF_A8: txformat |= TXFORMAT_I8 | TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0; break; case DSPF_RGB332: txformat |= TXFORMAT_RGB332; rdev->src_mask = 0x000000ff; break; case DSPF_ARGB2554: txformat |= TXFORMAT_RGB565; txfilter &= ~(MAG_FILTER_LINEAR | MIN_FILTER_LINEAR); rdev->src_mask = 0x00003fff; break; case DSPF_RGB444: txformat |= TXFORMAT_ARGB4444; rdev->src_mask = 0x00000fff; break; case DSPF_ARGB4444: txformat |= TXFORMAT_ARGB4444 | TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0x00000fff; break; case DSPF_RGB555: txformat |= TXFORMAT_ARGB1555; rdev->src_mask = 0x00007fff; break; case DSPF_ARGB1555: txformat |= TXFORMAT_ARGB1555 | TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0x00007fff; break; case DSPF_RGB16: txformat |= TXFORMAT_RGB565; rdev->src_mask = 0x0000ffff; break; case DSPF_RGB32: txformat |= TXFORMAT_ARGB8888; rdev->src_mask = 0x00ffffff; break; case DSPF_ARGB: case DSPF_AiRGB: case DSPF_AYUV: txformat |= TXFORMAT_ARGB8888 | TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0x00ffffff; break; case DSPF_UYVY: txformat |= TXFORMAT_YVYU422; if (!rdev->dst_422) txfilter |= YUV_TO_RGB; rdev->src_mask = 0xffffffff; break; case DSPF_YUY2: txformat |= TXFORMAT_VYUY422; if (!rdev->dst_422) txfilter |= YUV_TO_RGB; rdev->src_mask = 0xffffffff; break; case DSPF_I420: txformat |= TXFORMAT_I8; rdev->src_offset_cb = rdev->src_offset + rdev->src_pitch * rdev->src_height; rdev->src_offset_cr = rdev->src_offset_cb + rdev->src_pitch/2 * rdev->src_height/2; rdev->src_mask = 0x000000ff; break; case DSPF_YV12: txformat |= TXFORMAT_I8; rdev->src_offset_cr = rdev->src_offset + rdev->src_pitch * rdev->src_height; rdev->src_offset_cb = rdev->src_offset_cr + rdev->src_pitch/2 * rdev->src_height/2; rdev->src_mask = 0x000000ff; break; default: D_BUG( "unexpected pixelformat" ); return; } if (state->blittingflags & DSBLIT_DEINTERLACE) { rdev->src_height /= 2; if (surface->config.caps & DSCAPS_SEPARATED) { if (surface->field) { rdev->src_offset += rdev->src_height * rdev->src_pitch; rdev->src_offset_cr += rdev->src_height * rdev->src_pitch/4; rdev->src_offset_cb += rdev->src_height * rdev->src_pitch/4; } } else { if (surface->field) { rdev->src_offset += rdev->src_pitch; rdev->src_offset_cr += rdev->src_pitch/2; rdev->src_offset_cb += rdev->src_pitch/2; } rdev->src_pitch *= 2; } } radeon_waitfifo( rdrv, rdev, 7 ); radeon_out32( mmio, SRC_OFFSET, rdev->src_offset ); radeon_out32( mmio, SRC_PITCH, rdev->src_pitch ); radeon_out32( mmio, PP_TXFILTER_0, txfilter ); radeon_out32( mmio, PP_TXFORMAT_0, txformat ); radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset ); if (rdev->src_format != buffer->format) RADEON_UNSET( BLITTING_FLAGS ); rdev->src_format = buffer->format; RADEON_SET( SOURCE ); } void r100_set_source_mask( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->source_mask; CoreSurfaceBuffer *buffer = state->src_mask.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 txformat = TXFORMAT_NON_POWER2; u32 txfilter = MAG_FILTER_LINEAR | MIN_FILTER_LINEAR | CLAMP_S_CLAMP_LAST | CLAMP_T_CLAMP_LAST; if (RADEON_IS_SET( SOURCE_MASK )) { if ((state->blittingflags & DSBLIT_DEINTERLACE) == (rdev->blittingflags & DSBLIT_DEINTERLACE)) return; } D_ASSERT( (state->src_mask.offset % 32) == 0 ); D_ASSERT( (state->src_mask.pitch % 32) == 0 ); rdev->msk_format = buffer->format; rdev->msk_offset = radeon_buffer_offset( rdev, &state->src_mask ); rdev->msk_pitch = state->src_mask.pitch; rdev->msk_width = surface->config.size.w; rdev->msk_height = surface->config.size.h; switch (buffer->format) { case DSPF_A8: txformat |= TXFORMAT_I8 | TXFORMAT_ALPHA_IN_MAP; break; case DSPF_RGB332: txformat |= TXFORMAT_RGB332; break; case DSPF_RGB444: txformat |= TXFORMAT_ARGB4444; break; case DSPF_ARGB4444: txformat |= TXFORMAT_ARGB4444 | TXFORMAT_ALPHA_IN_MAP; break; case DSPF_RGB555: txformat |= TXFORMAT_ARGB1555; break; case DSPF_ARGB1555: txformat |= TXFORMAT_ARGB1555 | TXFORMAT_ALPHA_IN_MAP; break; case DSPF_RGB16: txformat |= TXFORMAT_RGB565; break; case DSPF_RGB32: txformat |= TXFORMAT_ARGB8888; break; case DSPF_ARGB: case DSPF_AiRGB: txformat |= TXFORMAT_ARGB8888 | TXFORMAT_ALPHA_IN_MAP; break; default: D_BUG( "unexpected pixelformat" ); return; } if (state->blittingflags & DSBLIT_DEINTERLACE) { rdev->msk_height /= 2; if (surface->config.caps & DSCAPS_SEPARATED) { if (surface->field) rdev->msk_offset += rdev->msk_height * rdev->msk_pitch; } else { if (surface->field) rdev->msk_offset += rdev->msk_pitch; rdev->msk_pitch *= 2; } } radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, PP_TXFILTER_1, txfilter ); radeon_out32( mmio, PP_TXFORMAT_1, txformat ); radeon_out32( mmio, PP_TEX_SIZE_1, ((rdev->msk_height-1) << 16) | ((rdev->msk_width-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_1, rdev->msk_pitch - 32 ); radeon_out32( mmio, PP_TXOFFSET_1, rdev->msk_offset ); RADEON_SET( SOURCE_MASK ); } void r100_set_clip( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBRegion *clip = &state->clip; volatile u8 *mmio = rdrv->mmio_base; if (RADEON_IS_SET( CLIP )) return; /* 2d clip */ radeon_waitfifo( rdrv, rdev, 2 ); if (rdev->dst_422) { radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1)/2 & 0xffff) ); } else { radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); } /* 3d clip */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); rdev->clip = state->clip; RADEON_SET( CLIP ); } #define R100_SET_YUV422_COLOR( rdrv, rdev, y, u, v ) { \ radeon_out32( (rdrv)->fb_base, (rdev)->yuv422_buffer, \ PIXEL_YUY2( y, u, v ) ); \ radeon_in8( (rdrv)->fb_base, (rdev)->yuv422_buffer ); \ radeon_waitfifo( rdrv, rdev, 3 ); \ radeon_out32( (rdrv)->mmio_base, PP_TXFILTER_1, 0 ); \ radeon_out32( (rdrv)->mmio_base, PP_TXFORMAT_1, TXFORMAT_VYUY422 ); \ radeon_out32( (rdrv)->mmio_base, PP_TXOFFSET_1, \ (rdev)->fb_offset + (rdev)->yuv422_buffer ); \ } void r100_set_drawing_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBColor color = state->color; int index = state->color_index; u32 color2d; u32 color3d; int y, u, v; if (RADEON_IS_SET( COLOR ) && RADEON_IS_SET( DRAWING_FLAGS )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = color.r * color.a / 255; color.g = color.g * color.a / 255; color.b = color.b * color.a / 255; } color3d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); switch (rdev->dst_format) { case DSPF_ALUT44: index |= (color.a & 0xf0); case DSPF_LUT8: color2d = index; color3d = PIXEL_RGB32( index, index, index ); break; case DSPF_A8: color2d = color.a; color3d = (color.a << 24) | 0x00ffffff; break; case DSPF_RGB332: color2d = PIXEL_RGB332( color.r, color.g, color.b ); break; case DSPF_ARGB2554: color2d = PIXEL_ARGB2554( color.a, color.r, color.g, color.b ); break; case DSPF_RGB444: case DSPF_ARGB4444: color2d = PIXEL_ARGB4444( color.a, color.r, color.g, color.b ); break; case DSPF_RGB555: case DSPF_ARGB1555: color2d = PIXEL_ARGB1555( color.a, color.r, color.g, color.b ); break; case DSPF_RGB16: color2d = PIXEL_RGB16( color.r, color.g, color.b ); break; case DSPF_RGB32: color2d = PIXEL_RGB32( color.r, color.g, color.b ); break; case DSPF_ARGB: color2d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; case DSPF_AiRGB: color2d = PIXEL_AiRGB( color.a, color.r, color.g, color.b ); break; case DSPF_AYUV: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color3d = color2d = PIXEL_AYUV( color.a, y, u, v ); break; case DSPF_UYVY: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_UYVY( y, u, v ); R100_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); break; case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_YUY2( y, u, v ); R100_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); rdev->y_cop = PIXEL_ARGB( color.a, y, y, y ); rdev->cb_cop = PIXEL_ARGB( color.a, u, u, u ); rdev->cr_cop = PIXEL_ARGB( color.a, v, v, v ); color3d = color2d = rdev->y_cop; break; default: D_BUG( "unexpected pixelformat" ); color2d = 0; break; } radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( rdrv->mmio_base, DP_BRUSH_FRGD_CLR, color2d ); radeon_out32( rdrv->mmio_base, PP_TFACTOR_1, color3d ); RADEON_SET( COLOR ); } void r100_set_blitting_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBColor color = state->color; u32 color3d; int y, u, v; if (RADEON_IS_SET( COLOR ) && RADEON_IS_SET( BLITTING_FLAGS )) return; if (state->blittingflags & DSBLIT_COLORIZE && state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { color.r = ((long) color.r * color.a / 255L); color.g = ((long) color.g * color.a / 255L); color.b = ((long) color.b * color.a / 255L); } switch (rdev->dst_format) { case DSPF_A8: color3d = (color.a << 24) | 0x00ffffff; break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); rdev->y_cop = PIXEL_ARGB( color.a, y, y, y ); rdev->cb_cop = PIXEL_ARGB( color.a, u, u, u ); rdev->cr_cop = PIXEL_ARGB( color.a, v, v, v ); color3d = rdev->y_cop; break; case DSPF_AYUV: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color3d = PIXEL_AYUV( color.a, y, u, v ); break; case DSPF_UYVY: case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); R100_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); default: color3d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; } radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( rdrv->mmio_base, PP_TFACTOR_0, color3d ); RADEON_SET( COLOR ); } void r100_set_src_colorkey( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; if (RADEON_IS_SET( SRC_COLORKEY )) return; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, CLR_CMP_CLR_SRC, state->src_colorkey ); radeon_out32( mmio, CLR_CMP_MASK, rdev->src_mask ); RADEON_SET( SRC_COLORKEY ); } void r100_set_blend_function( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 sblend; u32 dblend; if (RADEON_IS_SET( SRC_BLEND ) && RADEON_IS_SET( DST_BLEND )) return; sblend = r100SrcBlend[state->src_blend-1]; dblend = r100DstBlend[state->dst_blend-1]; if (!DFB_PIXELFORMAT_HAS_ALPHA(rdev->dst_format)) { if (sblend == SRC_BLEND_GL_DST_ALPHA) sblend = SRC_BLEND_GL_ONE; else if (sblend == SRC_BLEND_GL_ONE_MINUS_DST_ALPHA) sblend = SRC_BLEND_GL_ZERO; if (dblend == DST_BLEND_GL_DST_ALPHA) dblend = DST_BLEND_GL_ONE; else if (dblend == DST_BLEND_GL_ONE_MINUS_DST_ALPHA) dblend = DST_BLEND_GL_ZERO; } else if (rdev->dst_format == DSPF_A8) { if (sblend == SRC_BLEND_GL_DST_ALPHA) sblend = SRC_BLEND_GL_DST_COLOR; else if (sblend == SRC_BLEND_GL_ONE_MINUS_DST_ALPHA) sblend = SRC_BLEND_GL_ONE_MINUS_DST_COLOR; if (dblend == DST_BLEND_GL_DST_ALPHA) dblend = DST_BLEND_GL_DST_COLOR; else if (dblend == DST_BLEND_GL_ONE_MINUS_DST_ALPHA) dblend = DST_BLEND_GL_ONE_MINUS_DST_COLOR; } radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, RB3D_BLENDCNTL, sblend | dblend ); RADEON_SET( SRC_BLEND ); RADEON_SET( DST_BLEND ); } void r100_set_render_options( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { if (RADEON_IS_SET( RENDER_OPTIONS )) return; if (state->render_options & DSRO_MATRIX && (!state->affine_matrix || state->matrix[0] != (1<<16) || state->matrix[1] != 0 || state->matrix[2] != 0 || state->matrix[3] != 0 || state->matrix[4] != (1<<16) || state->matrix[5] != 0)) { rdev->matrix = state->matrix; rdev->affine_matrix = state->affine_matrix; } else { rdev->matrix = NULL; } if ((rdev->render_options & DSRO_ANTIALIAS) != (state->render_options & DSRO_ANTIALIAS)) { RADEON_UNSET( DRAWING_FLAGS ); RADEON_UNSET( BLITTING_FLAGS ); } rdev->render_options = state->render_options; RADEON_SET( RENDER_OPTIONS ); } /* NOTES: * - We use texture unit 0 for blitting functions, * texture unit 1 for drawing functions * - Default blend equation is ADD_CLAMP (A * B + C) */ void r100_set_drawingflags( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 master_cntl = rdev->gui_master_cntl | GMC_SRC_DATATYPE_MONO_FG_LA | GMC_BRUSH_SOLID_COLOR | GMC_CLR_CMP_CNTL_DIS; u32 rb3d_cntl = rdev->rb3d_cntl & ~DITHER_ENABLE; u32 pp_cntl = SCISSOR_ENABLE | TEX_BLEND_1_ENABLE; u32 cblend = COLOR_ARG_C_TFACTOR_COLOR; if (RADEON_IS_SET( DRAWING_FLAGS )) return; if (rdev->dst_422) { pp_cntl |= TEX_1_ENABLE; cblend = COLOR_ARG_C_T1_COLOR; } else if (rdev->dst_format == DSPF_A8) { cblend = COLOR_ARG_C_TFACTOR_ALPHA; } if (state->drawingflags & DSDRAW_BLEND) rb3d_cntl |= ALPHA_BLEND_ENABLE; if (state->drawingflags & DSDRAW_XOR) { rb3d_cntl |= ROP_ENABLE; master_cntl |= GMC_ROP3_PATXOR; } else { master_cntl |= GMC_ROP3_PATCOPY; } if (state->render_options & DSRO_ANTIALIAS) pp_cntl |= ANTI_ALIAS_LINE_POLY; radeon_waitfifo( rdrv, rdev, 8 ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, master_cntl ); radeon_out32( mmio, DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM ); radeon_out32( mmio, RB3D_CNTL, rb3d_cntl ); radeon_out32( mmio, SE_CNTL, DIFFUSE_SHADE_FLAT | ALPHA_SHADE_FLAT | BFACE_SOLID | FFACE_SOLID | VTX_PIX_CENTER_OGL | ROUND_MODE_ROUND | ROUND_PREC_4TH_PIX ); radeon_out32( mmio, PP_CNTL, pp_cntl ); radeon_out32( mmio, PP_TXCBLEND_1, cblend ); radeon_out32( mmio, PP_TXABLEND_1, ALPHA_ARG_C_TFACTOR_ALPHA ); radeon_out32( mmio, SE_VTX_FMT, SE_VTX_FMT_XY ); rdev->drawingflags = state->drawingflags; RADEON_SET ( DRAWING_FLAGS ); RADEON_UNSET( BLITTING_FLAGS ); } void r100_set_blittingflags( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 master_cntl = rdev->gui_master_cntl | GMC_BRUSH_NONE | GMC_SRC_DATATYPE_COLOR; u32 cmp_cntl = 0; u32 rb3d_cntl = rdev->rb3d_cntl; u32 se_cntl = BFACE_SOLID | FFACE_SOLID | VTX_PIX_CENTER_OGL | ROUND_MODE_ROUND; u32 pp_cntl = SCISSOR_ENABLE | TEX_0_ENABLE | TEX_BLEND_0_ENABLE; u32 cblend = COLOR_ARG_C_T0_COLOR; u32 ablend = ALPHA_ARG_C_T0_ALPHA; u32 vtx_fmt = SE_VTX_FMT_XY | SE_VTX_FMT_ST0; u32 coord_fmt = VTX_XY_PRE_MULT_1_OVER_W0 | TEX1_W_ROUTING_USE_W0; if (RADEON_IS_SET( BLITTING_FLAGS )) return; if (rdev->accel == DFXL_TEXTRIANGLES) { se_cntl |= DIFFUSE_SHADE_GOURAUD | ALPHA_SHADE_GOURAUD | SPECULAR_SHADE_GOURAUD | FLAT_SHADE_VTX_LAST | ROUND_PREC_8TH_PIX; vtx_fmt |= SE_VTX_FMT_W0 | SE_VTX_FMT_Z; } else { se_cntl |= DIFFUSE_SHADE_FLAT | ALPHA_SHADE_FLAT | ROUND_PREC_4TH_PIX; coord_fmt |= VTX_ST0_NONPARAMETRIC | VTX_ST1_NONPARAMETRIC; } if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL)) { if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) ablend = ALPHA_ARG_A_T0_ALPHA | ALPHA_ARG_B_TFACTOR_ALPHA; else ablend = ALPHA_ARG_C_TFACTOR_ALPHA; } rb3d_cntl |= ALPHA_BLEND_ENABLE; } if (rdev->dst_format != DSPF_A8) { if (state->blittingflags & (DSBLIT_SRC_MASK_ALPHA | DSBLIT_SRC_MASK_COLOR)) { if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA) ablend = ALPHA_ARG_A_T0_ALPHA | ALPHA_ARG_B_T1_ALPHA; if (state->blittingflags & DSBLIT_SRC_MASK_COLOR) cblend = COLOR_ARG_A_T0_COLOR | COLOR_ARG_B_T1_COLOR; pp_cntl |= TEX_1_ENABLE; } else if (state->blittingflags & DSBLIT_COLORIZE) { if (rdev->dst_422) { cblend = (rdev->src_format == DSPF_A8) ? (COLOR_ARG_C_T1_COLOR) : (COLOR_ARG_A_T0_COLOR | COLOR_ARG_B_T1_COLOR); pp_cntl |= TEX_1_ENABLE; } else { cblend = (rdev->src_format == DSPF_A8) ? (COLOR_ARG_C_TFACTOR_COLOR) : (COLOR_ARG_A_T0_COLOR | COLOR_ARG_B_TFACTOR_COLOR); } } else if (state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { cblend = (rdev->src_format == DSPF_A8) ? (COLOR_ARG_C_T0_ALPHA) : (COLOR_ARG_A_T0_COLOR | COLOR_ARG_B_TFACTOR_ALPHA); } else if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) { cblend = (rdev->src_format == DSPF_A8) ? (COLOR_ARG_C_T0_ALPHA) : (COLOR_ARG_A_T0_COLOR | COLOR_ARG_B_T0_ALPHA); } } /* DSPF_A8 */ else { if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA) { ablend = ALPHA_ARG_A_T0_ALPHA | ALPHA_ARG_B_T1_ALPHA; cblend = COLOR_ARG_A_T0_ALPHA | COLOR_ARG_B_T1_ALPHA; pp_cntl |= TEX_1_ENABLE; } else if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) cblend = COLOR_ARG_A_T0_ALPHA | COLOR_ARG_B_TFACTOR_ALPHA; else cblend = COLOR_ARG_C_TFACTOR_ALPHA; } else { cblend = COLOR_ARG_C_T0_ALPHA; } } if (state->blittingflags & DSBLIT_SRC_COLORKEY) cmp_cntl = SRC_CMP_EQ_COLOR | CLR_CMP_SRC_SOURCE; else master_cntl |= GMC_CLR_CMP_CNTL_DIS; if (state->blittingflags & DSBLIT_XOR) { master_cntl |= GMC_ROP3_XOR; rb3d_cntl |= ROP_ENABLE; } else { master_cntl |= GMC_ROP3_SRCCOPY; } if (state->render_options & DSRO_ANTIALIAS) pp_cntl |= ANTI_ALIAS_POLY; radeon_waitfifo( rdrv, rdev, 9 ); radeon_out32( mmio, CLR_CMP_CNTL, cmp_cntl ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, master_cntl ); radeon_out32( mmio, RB3D_CNTL, rb3d_cntl ); radeon_out32( mmio, SE_CNTL, se_cntl ); radeon_out32( mmio, PP_CNTL, pp_cntl ); radeon_out32( mmio, PP_TXCBLEND_0, cblend ); radeon_out32( mmio, PP_TXABLEND_0, ablend ); radeon_out32( mmio, SE_VTX_FMT, vtx_fmt ); radeon_out32( mmio, SE_COORD_FMT, coord_fmt ); rdev->blittingflags = state->blittingflags; RADEON_SET ( BLITTING_FLAGS ); RADEON_UNSET( DRAWING_FLAGS ); } DirectFB-1.2.10/gfxdrivers/radeon/radeon_chipsets.h0000644000175000017500000002074211164361026017121 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __RADEON_CHIPSETS_H__ #define __RADEON_CHIPSETS_H__ static const struct { u16 id; u16 chip; bool igp; const char *name; } dev_table[] = { { 0x5144, CHIP_R100 , false, "Radeon" }, { 0x5145, CHIP_R100 , false, "Radeon" }, { 0x5146, CHIP_R100 , false, "Radeon" }, { 0x5147, CHIP_R100 , false, "Radeon" }, { 0x5159, CHIP_RV100, false, "Radeon VE/7000" }, { 0x515a, CHIP_RV100, false, "Radeon VE/7000" }, { 0x4c59, CHIP_RV100, false, "Radeon Mobility M6" }, { 0x4c5a, CHIP_RV100, false, "Radeon Mobility M6" }, { 0x4c57, CHIP_RV200, false, "Radeon Mobility M7" }, { 0x4c58, CHIP_RV200, false, "FireGL Mobility 7800 M7" }, { 0x5157, CHIP_RV200, false, "Radeon 7500" }, { 0x5158, CHIP_RV200, false, "Radeon 7500" }, { 0x4136, CHIP_RS100, true , "Radeon IGP320" }, { 0x4336, CHIP_RS100, true , "Radeon IGP320M" }, { 0x4137, CHIP_RS200, true , "Radeon IGP330/340/350" }, { 0x4337, CHIP_RS200, true , "Radeon IGP330M/340M/350M" }, { 0x4237, CHIP_RS250, true , "Radeon 7000 IGP" }, { 0x4437, CHIP_RS250, true , "Radeon Mobility 7000 IGP" }, { 0x514c, CHIP_R200 , false, "Radeon 8500" }, { 0x4242, CHIP_R200 , false, "Radeon 8500 AIW" }, { 0x4243, CHIP_R200 , false, "Radeon 8500 AIW" }, { 0x514d, CHIP_R200 , false, "Radeon 9100" }, { 0x5148, CHIP_R200 , false, "FireGL 8700/8800" }, { 0x4966, CHIP_RV250, false, "Radeon 9000 PRO" }, { 0x4967, CHIP_RV250, false, "Radeon 9000" }, { 0x4c66, CHIP_RV250, false, "Radeon Mobility 9000 M9" }, { 0x4c67, CHIP_RV250, false, "Radeon Mobility 9000 M9" }, { 0x4c64, CHIP_RV250, false, "FireGL Mobility 9000 M9" }, { 0x5960, CHIP_RV280, false, "Radeon 9200 PRO" }, { 0x5961, CHIP_RV280, false, "Radeon 9200" }, { 0x5962, CHIP_RV280, false, "Radeon 9200" }, { 0x5964, CHIP_RV280, false, "Radeon 9200 SE" }, { 0x5c61, CHIP_RV280, false, "Radeon Mobility 9200 M9+" }, { 0x5c63, CHIP_RV280, false, "Radeon Mobility 9200 M9+" }, { 0x5834, CHIP_RS300, true , "Radeon 9100 IGP" }, { 0x5835, CHIP_RS300, true , "Radeon Mobility 9100 IGP" }, { 0x7834, CHIP_RS350, true , "Radeon 9100 PRO IGP" }, { 0x7835, CHIP_RS350, true , "Radeon Mobility 9200 IGP" }, { 0x4144, CHIP_R300 , false, "Radeon 9500" }, { 0x4145, CHIP_R300 , false, "Radeon 9500" }, { 0x4146, CHIP_R300 , false, "Radeon 9600 TX" }, { 0x4147, CHIP_R300 , false, "FireGL Z1" }, { 0x4e44, CHIP_R300 , false, "Radeon 9700 PRO" }, { 0x4e45, CHIP_R300 , false, "Radeon 9700/9500PRO" }, { 0x4e46, CHIP_R300 , false, "Radeon 9600 TX" }, { 0x4e47, CHIP_R300 , false, "FireGL X1" }, { 0x4150, CHIP_RV350, false, "Radeon 9600" }, { 0x4151, CHIP_RV350, false, "Radeon 9600 SE" }, { 0x4152, CHIP_RV350, false, "Radeon 9600 XT" }, { 0x4153, CHIP_RV350, false, "Radeon 9600" }, { 0x4154, CHIP_RV350, false, "FireGL T2" }, { 0x4156, CHIP_RV350, false, "FireGL RV360" }, { 0x4e50, CHIP_RV350, false, "Radeon Mobility 9600/9700 M10/M11" }, { 0x4e51, CHIP_RV350, false, "Radeon Mobility 9600 M10" }, { 0x4e52, CHIP_RV350, false, "Radeon Mobility 9600 M11" }, { 0x4e53, CHIP_RV350, false, "Radeon Mobility 9600 M10" }, { 0x4e54, CHIP_RV350, false, "FireGL Mobility T2 M10" }, { 0x4e56, CHIP_RV350, false, "FireGL Mobility T2e M11" }, { 0x4155, CHIP_RV350, false, "Radeon 9650" }, { 0x4148, CHIP_R350 , false, "Radeon 9800 SE" }, { 0x4149, CHIP_R350 , false, "Radeon 9800" }, { 0x414a, CHIP_R350 , false, "Radeon 9800" }, { 0x414b, CHIP_R350 , false, "FireGL X2" }, { 0x4e48, CHIP_R350 , false, "Radeon 9800 PRO" }, { 0x4e49, CHIP_R350 , false, "Radeon 9800" }, { 0x4e4b, CHIP_R350 , false, "FireGL X2" }, { 0x4e4a, CHIP_R350 , false, "Radeon 9800 XT" }, { 0x3e50, CHIP_RV380, false, "Radeon X600" }, { 0x3e54, CHIP_RV380, false, "FireGL V3200" }, { 0x3150, CHIP_RV380, false, "Radeon Mobility X600 M24" }, { 0x3152, CHIP_RV380, false, "Radeon Mobility X300 M24" }, { 0x3154, CHIP_RV380, false, "FireGL M24 GL" }, { 0x5b60, CHIP_RV380, false, "Radeon X300" }, { 0x5b62, CHIP_RV380, false, "Radeon X600" }, { 0x5b63, CHIP_RV380, false, "Radeon X550" }, { 0x5b64, CHIP_RV380, false, "FireGL V3100" }, { 0x5b65, CHIP_RV380, false, "FireMV 2200 PCIE" }, { 0x5460, CHIP_RV380, false, "Radeon Mobility X300 M22" }, { 0x5462, CHIP_RV380, false, "Radeon Mobility X600 SE M24C" }, { 0x5464, CHIP_RV380, false, "FireGL M22 GL" }, { 0x5a41, CHIP_RS400, false, "Radeon XPRESS 200" }, { 0x5a42, CHIP_RS400, false, "Radeon XPRESS 200M" }, { 0x5a61, CHIP_RS400, false, "Radeon XPRESS 200" }, { 0x5a62, CHIP_RS400, false, "Radeon XPRESS 200M" }, { 0x5954, CHIP_RS400, false, "Radeon XPRESS 200" }, { 0x5955, CHIP_RS400, false, "Radeon XPRESS 200M" }, { 0x5974, CHIP_RS400, false, "Radeon XPRESS 200" }, { 0x5975, CHIP_RS400, false, "Radeon XPRESS 200M" }, { 0x5e48, CHIP_RV410, false, "FireGL V5000" }, { 0x564a, CHIP_RV410, false, "Mobility FireGL V5000 M26" }, { 0x564b, CHIP_RV410, false, "Mobility FireGL V5000 M26" }, { 0x564f, CHIP_RV410, false, "Mobility Radeon X700 XL M26" }, { 0x5652, CHIP_RV410, false, "Mobility Radeon X700 M26" }, { 0x5653, CHIP_RV410, false, "Mobility Radeon X700 M26" }, { 0x5e4b, CHIP_RV410, false, "Radeon X700 PRO" }, { 0x5e4a, CHIP_RV410, false, "Radeon X700 XT" }, { 0x5e4d, CHIP_RV410, false, "Radeon X700" }, { 0x5e4c, CHIP_RV410, false, "Radeon X700 SE" }, { 0x5e4f, CHIP_RV410, false, "Radeon X700 SE" }, { 0x4a48, CHIP_R420 , false, "Radeon X800" }, { 0x4a49, CHIP_R420 , false, "Radeon X800 PRO" }, { 0x4a4a, CHIP_R420 , false, "Radeon X800 SE" }, { 0x4a4b, CHIP_R420 , false, "Radeon X800" }, { 0x4a4c, CHIP_R420 , false, "Radeon X800" }, { 0x4a4d, CHIP_R420 , false, "FireGL X3" }, { 0x4a4e, CHIP_R420 , false, "Radeon Mobility 9800 M18" }, { 0x4a50, CHIP_R420 , false, "Radeon X800 XT" }, { 0x4a4f, CHIP_R420 , false, "Radeon X800 SE" }, { 0x4a54, CHIP_R420 , false, "Radeon AIW X800" }, { 0x5548, CHIP_R420 , false, "Radeon X800" }, { 0x5549, CHIP_R420 , false, "Radeon X800 PRO" }, { 0x554a, CHIP_R420 , false, "Radeon X800 LE" }, { 0x554b, CHIP_R420 , false, "Radeon X800 SE" }, { 0x5551, CHIP_R420 , false, "FireGL V5100" }, { 0x5552, CHIP_R420 , false, "FireGL Unknown" }, { 0x5554, CHIP_R420 , false, "FireGL Unknown" }, { 0x5d57, CHIP_R420 , false, "Radeon X800 XT" }, { 0x5550, CHIP_R420 , false, "FireGL V7100" }, { 0x5d49, CHIP_R420 , false, "Mobility FireGL V5100 M28" }, { 0x5d4a, CHIP_R420 , false, "Mobility Radeon X800 M28" }, { 0x5d48, CHIP_R420 , false, "Mobility Radeon X800 XT M28" }, { 0x554f, CHIP_R420 , false, "Radeon X800" }, { 0x554d, CHIP_R420 , false, "Radeon X800 XL" }, { 0x554e, CHIP_R420 , false, "Radeon X800 SE" }, { 0x554c, CHIP_R420 , false, "Radeon X800 XTP" }, { 0x5d4c, CHIP_R420 , false, "Radeon X850" }, { 0x5d50, CHIP_R420 , false, "Radeon Unknown R480" }, { 0x5d4e, CHIP_R420 , false, "Radeon X850 SE" }, { 0x5d4f, CHIP_R420 , false, "Radeon X850 PRO" }, { 0x5d52, CHIP_R420 , false, "Radeon X850 XT" }, { 0x5d4d, CHIP_R420 , false, "Radeon X850 XT PE" }, { 0x4b4b, CHIP_R420 , false, "Radeon X850 PRO" }, { 0x4b4a, CHIP_R420 , false, "Radeon X850 SE" }, { 0x4b49, CHIP_R420 , false, "Radeon X850 XT" }, { 0x4b4c, CHIP_R420 , false, "Radeon X850 XT PE" } }; #endif /* __RADEON_CHIPSETS_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/radeon_2d.h0000644000175000017500000000306211164361026015600 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __RADEON_2D_H__ #define __RADEON_2D_H__ bool radeonFillRectangle2D( void *drv, void *dev, DFBRectangle *rect ); bool radeonFillRectangle2D_420( void *drv, void *dev, DFBRectangle *rect ); bool radeonDrawRectangle2D( void *drv, void *dev, DFBRectangle *rect ); bool radeonDrawRectangle2D_420( void *drv, void *dev, DFBRectangle *rect ); bool radeonDrawLine2D( void *drv, void *dev, DFBRegion *line ); bool radeonDrawLine2D_420( void *drv, void *dev, DFBRegion *line ); bool radeonBlit2D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ); bool radeonBlit2D_420( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ); #endif /* __RADEON_2D_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/Makefile.am0000644000175000017500000000174511245562152015637 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/radeon INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems radeon_LTLIBRARIES = libdirectfb_radeon.la if BUILD_STATIC radeon_DATA = $(radeon_LTLIBRARIES:.la=.o) endif radeondir = $(MODULEDIR)/gfxdrivers libdirectfb_radeon_la_SOURCES = \ radeon.c \ r100_state.c \ r200_state.c \ r300_state.c \ radeon_2d.c \ r100_3d.c \ r200_3d.c \ r300_3d.c \ radeon_overlay.c \ radeon_crtc1.c \ radeon_crtc2.c \ radeon.h \ radeon_chipsets.h \ radeon_regs.h \ r300_program.h \ radeon_mmio.h \ radeon_state.h \ radeon_2d.h \ radeon_3d.h \ vertex_shader.h libdirectfb_radeon_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) -lm libdirectfb_radeon_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/radeon/Makefile.in0000644000175000017500000004724011307521500015637 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/radeon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(radeondir)" "$(DESTDIR)$(radeondir)" radeonLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(radeon_LTLIBRARIES) libdirectfb_radeon_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_radeon_la_OBJECTS = radeon.lo r100_state.lo \ r200_state.lo r300_state.lo radeon_2d.lo r100_3d.lo r200_3d.lo \ r300_3d.lo radeon_overlay.lo radeon_crtc1.lo radeon_crtc2.lo libdirectfb_radeon_la_OBJECTS = $(am_libdirectfb_radeon_la_OBJECTS) libdirectfb_radeon_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_radeon_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_radeon_la_SOURCES) DIST_SOURCES = $(libdirectfb_radeon_la_SOURCES) radeonDATA_INSTALL = $(INSTALL_DATA) DATA = $(radeon_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems radeon_LTLIBRARIES = libdirectfb_radeon.la @BUILD_STATIC_TRUE@radeon_DATA = $(radeon_LTLIBRARIES:.la=.o) radeondir = $(MODULEDIR)/gfxdrivers libdirectfb_radeon_la_SOURCES = \ radeon.c \ r100_state.c \ r200_state.c \ r300_state.c \ radeon_2d.c \ r100_3d.c \ r200_3d.c \ r300_3d.c \ radeon_overlay.c \ radeon_crtc1.c \ radeon_crtc2.c \ radeon.h \ radeon_chipsets.h \ radeon_regs.h \ r300_program.h \ radeon_mmio.h \ radeon_state.h \ radeon_2d.h \ radeon_3d.h \ vertex_shader.h libdirectfb_radeon_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) -lm libdirectfb_radeon_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/radeon/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/radeon/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-radeonLTLIBRARIES: $(radeon_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(radeondir)" || $(MKDIR_P) "$(DESTDIR)$(radeondir)" @list='$(radeon_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(radeonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(radeondir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(radeonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(radeondir)/$$f"; \ else :; fi; \ done uninstall-radeonLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(radeon_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(radeondir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(radeondir)/$$p"; \ done clean-radeonLTLIBRARIES: -test -z "$(radeon_LTLIBRARIES)" || rm -f $(radeon_LTLIBRARIES) @list='$(radeon_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_radeon.la: $(libdirectfb_radeon_la_OBJECTS) $(libdirectfb_radeon_la_DEPENDENCIES) $(libdirectfb_radeon_la_LINK) -rpath $(radeondir) $(libdirectfb_radeon_la_OBJECTS) $(libdirectfb_radeon_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r100_3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r100_state.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r200_3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r200_state.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r300_3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r300_state.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_2d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_crtc1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_crtc2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/radeon_overlay.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-radeonDATA: $(radeon_DATA) @$(NORMAL_INSTALL) test -z "$(radeondir)" || $(MKDIR_P) "$(DESTDIR)$(radeondir)" @list='$(radeon_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(radeonDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(radeondir)/$$f'"; \ $(radeonDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(radeondir)/$$f"; \ done uninstall-radeonDATA: @$(NORMAL_UNINSTALL) @list='$(radeon_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(radeondir)/$$f'"; \ rm -f "$(DESTDIR)$(radeondir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(radeondir)" "$(DESTDIR)$(radeondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-radeonLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-radeonDATA install-radeonLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-radeonDATA uninstall-radeonLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-radeonLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-radeonDATA install-radeonLTLIBRARIES install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-radeonDATA \ uninstall-radeonLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/radeon/r200_state.c0000644000175000017500000011305111164361026015621 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_state.h" static const u32 r200SrcBlend[] = { SRC_BLEND_GL_ZERO, // DSBF_ZERO SRC_BLEND_GL_ONE, // DSBF_ONE SRC_BLEND_GL_SRC_COLOR, // DSBF_SRCCOLOR SRC_BLEND_GL_ONE_MINUS_SRC_COLOR, // DSBF_INVSRCCOLOR SRC_BLEND_GL_SRC_ALPHA, // DSBF_SRCALPHA SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA, // DSBF_INVSRCALPHA SRC_BLEND_GL_DST_ALPHA, // DSBF_DSTALPHA SRC_BLEND_GL_ONE_MINUS_DST_ALPHA, // DSBF_INVDSTALPHA SRC_BLEND_GL_DST_COLOR, // DSBF_DSTCOLOR SRC_BLEND_GL_ONE_MINUS_DST_COLOR, // DSBF_INVDSTCOLOR SRC_BLEND_GL_SRC_ALPHA_SATURATE // DSBF_SRCALPHASAT }; static const u32 r200DstBlend[] = { DST_BLEND_GL_ZERO, // DSBF_ZERO DST_BLEND_GL_ONE, // DSBF_ONE DST_BLEND_GL_SRC_COLOR, // DSBF_SRCCOLOR DST_BLEND_GL_ONE_MINUS_SRC_COLOR, // DSBF_INVSRCCOLOR DST_BLEND_GL_SRC_ALPHA, // DSBF_SRCALPHA DST_BLEND_GL_ONE_MINUS_SRC_ALPHA, // DSBF_INVSRCALPHA DST_BLEND_GL_DST_ALPHA, // DSBF_DSTALPHA DST_BLEND_GL_ONE_MINUS_DST_ALPHA, // DSBF_INVDSTALPHA DST_BLEND_GL_DST_COLOR, // DSBF_DSTCOLOR DST_BLEND_GL_ONE_MINUS_DST_COLOR, // DSBF_INVDSTCOLOR DST_BLEND_GL_ZERO // DSBF_SRCALPHASAT }; void r200_restore( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 15 ); /* enable caches */ radeon_out32( mmio, RB2D_DSTCACHE_MODE, RB2D_DC_2D_CACHE_AUTOFLUSH | RB2D_DC_3D_CACHE_AUTOFLUSH | R200_RB2D_DC_2D_CACHE_AUTOFREE | R200_RB2D_DC_3D_CACHE_AUTOFREE ); radeon_out32( mmio, RB3D_DSTCACHE_MODE, RB3D_DC_2D_CACHE_AUTOFLUSH | RB3D_DC_3D_CACHE_AUTOFLUSH | R200_RB3D_DC_2D_CACHE_AUTOFREE | R200_RB3D_DC_3D_CACHE_AUTOFREE ); /* restore 3d engine state */ radeon_out32( mmio, SE_LINE_WIDTH, 0x10 ); radeon_out32( mmio, RE_POINTSIZE, 0x10 ); radeon_out32( mmio, PP_MISC, ALPHA_TEST_PASS ); radeon_out32( mmio, R200_PP_CNTL_X, 0 ); radeon_out32( mmio, R200_PP_TXMULTI_CTL_0, 0 ); radeon_out32( mmio, R200_RE_CNTL, R200_SCISSOR_ENABLE ); radeon_out32( mmio, R200_SE_VTX_STATE_CNTL, 0 ); radeon_out32( mmio, R200_SE_VAP_CNTL, R200_VAP_VF_MAX_VTX_NUM | R200_VAP_FORCE_W_TO_ONE ); #ifdef WORDS_BIGENDIAN radeon_out32( mmio, R200_SE_VAP_CNTL_STATUS, R200_TCL_BYPASS | R200_VC_32BIT_SWAP ); #else radeon_out32( mmio, R200_SE_VAP_CNTL_STATUS, R200_TCL_BYPASS ); #endif radeon_out32( mmio, RB3D_ZSTENCILCNTL, Z_TEST_ALWAYS ); radeon_out32( mmio, RB3D_ROPCNTL, ROP_XOR ); radeon_out32( mmio, R200_PP_TXFORMAT_X_0, 0 ); radeon_out32( mmio, R200_PP_TXFORMAT_X_1, 0 ); } void r200_set_destination( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->destination; CoreSurfaceBuffer *buffer = state->dst.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 offset; u32 pitch; if (RADEON_IS_SET( DESTINATION )) return; D_ASSERT( (state->dst.offset % 32) == 0 ); D_ASSERT( (state->dst.pitch % 32) == 0 ); offset = radeon_buffer_offset( rdev, &state->dst ); pitch = state->dst.pitch; if (rdev->dst_offset != offset || rdev->dst_pitch != pitch || rdev->dst_format != buffer->format) { bool dst_422 = false; switch (buffer->format) { case DSPF_LUT8: case DSPF_ALUT44: case DSPF_A8: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB8; break; case DSPF_RGB332: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB332 | DITHER_ENABLE; break; case DSPF_ARGB2554: rdev->gui_master_cntl = GMC_DST_16BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB565; break; case DSPF_RGB444: case DSPF_ARGB4444: rdev->gui_master_cntl = GMC_DST_16BPP; rdev->rb3d_cntl = COLOR_FORMAT_ARGB4444 | DITHER_ENABLE; break; case DSPF_RGB555: case DSPF_ARGB1555: rdev->gui_master_cntl = GMC_DST_15BPP; rdev->rb3d_cntl = COLOR_FORMAT_ARGB1555 | DITHER_ENABLE; break; case DSPF_RGB16: rdev->gui_master_cntl = GMC_DST_16BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB565 | DITHER_ENABLE; break; case DSPF_RGB32: case DSPF_ARGB: case DSPF_AiRGB: case DSPF_AYUV: rdev->gui_master_cntl = GMC_DST_32BPP; rdev->rb3d_cntl = COLOR_FORMAT_ARGB8888; break; case DSPF_UYVY: rdev->gui_master_cntl = GMC_DST_YVYU; rdev->rb3d_cntl = COLOR_FORMAT_YUV422_YVYU; dst_422 = true; break; case DSPF_YUY2: rdev->gui_master_cntl = GMC_DST_VYUY; rdev->rb3d_cntl = COLOR_FORMAT_YUV422_VYUY; dst_422 = true; break; case DSPF_I420: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB8; rdev->dst_offset_cb = offset + pitch * surface->config.size.h; rdev->dst_offset_cr = rdev->dst_offset_cb + pitch/2 * surface->config.size.h/2; break; case DSPF_YV12: rdev->gui_master_cntl = GMC_DST_8BPP; rdev->rb3d_cntl = COLOR_FORMAT_RGB8; rdev->dst_offset_cr = offset + pitch * surface->config.size.h; rdev->dst_offset_cb = rdev->dst_offset_cr + pitch/2 * surface->config.size.h/2; break; default: D_BUG( "unexpected pixelformat" ); return; } rdev->gui_master_cntl |= GMC_DP_SRC_SOURCE_MEMORY | GMC_WR_MSK_DIS | GMC_SRC_PITCH_OFFSET_CNTL | GMC_DST_PITCH_OFFSET_CNTL | GMC_DST_CLIPPING; radeon_waitfifo( rdrv, rdev, 4 ); radeon_out32( mmio, DST_OFFSET, offset ); radeon_out32( mmio, DST_PITCH, pitch ); radeon_out32( mmio, RB3D_COLOROFFSET, offset ); radeon_out32( mmio, RB3D_COLORPITCH, pitch / DFB_BYTES_PER_PIXEL(buffer->format) ); if (rdev->dst_format != buffer->format) { if (dst_422 && !rdev->dst_422) { RADEON_UNSET( SOURCE ); RADEON_UNSET( CLIP ); } RADEON_UNSET( COLOR ); RADEON_UNSET( DST_BLEND ); } rdev->dst_format = buffer->format; rdev->dst_offset = offset; rdev->dst_pitch = pitch; rdev->dst_422 = dst_422; } RADEON_SET( DESTINATION ); } void r200_set_source( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->source; CoreSurfaceBuffer *buffer = state->src.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 txformat = R200_TXFORMAT_NON_POWER2; u32 txfilter = R200_MAG_FILTER_LINEAR | R200_MIN_FILTER_LINEAR | R200_CLAMP_S_CLAMP_LAST | R200_CLAMP_T_CLAMP_LAST; if (RADEON_IS_SET( SOURCE )) { if ((state->blittingflags & DSBLIT_DEINTERLACE) == (rdev->blittingflags & DSBLIT_DEINTERLACE)) return; } D_ASSERT( (state->src.offset % 32) == 0 ); D_ASSERT( (state->src.pitch % 32) == 0 ); rdev->src_offset = radeon_buffer_offset( rdev, &state->src ); rdev->src_pitch = state->src.pitch; rdev->src_width = surface->config.size.w; rdev->src_height = surface->config.size.h; switch (buffer->format) { case DSPF_LUT8: txformat |= R200_TXFORMAT_I8; txfilter &= ~(R200_MAG_FILTER_LINEAR | R200_MIN_FILTER_LINEAR); rdev->src_mask = 0x000000ff; break; case DSPF_ALUT44: txformat |= R200_TXFORMAT_I8; txfilter &= ~(R200_MAG_FILTER_LINEAR | R200_MIN_FILTER_LINEAR); rdev->src_mask = 0x0000000f; break; case DSPF_A8: txformat |= R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0; break; case DSPF_RGB332: txformat |= R200_TXFORMAT_RGB332; rdev->src_mask = 0x000000ff; break; case DSPF_ARGB2554: txformat |= R200_TXFORMAT_RGB565; txfilter &= ~(R200_MAG_FILTER_LINEAR | R200_MIN_FILTER_LINEAR); rdev->src_mask = 0x00003fff; break; case DSPF_RGB444: txformat |= R200_TXFORMAT_ARGB4444; rdev->src_mask = 0x00000fff; break; case DSPF_ARGB4444: txformat |= R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0x00000fff; break; case DSPF_RGB555: txformat |= R200_TXFORMAT_ARGB1555; rdev->src_mask = 0x00007fff; break; case DSPF_ARGB1555: txformat |= R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0x00007fff; break; case DSPF_RGB16: txformat |= R200_TXFORMAT_RGB565; rdev->src_mask = 0x0000ffff; break; case DSPF_RGB32: txformat |= R200_TXFORMAT_ARGB8888; rdev->src_mask = 0x00ffffff; break; case DSPF_ARGB: case DSPF_AiRGB: case DSPF_AYUV: txformat |= R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP; rdev->src_mask = 0x00ffffff; break; case DSPF_UYVY: txformat |= R200_TXFORMAT_YVYU422; if (!rdev->dst_422) txfilter |= R200_YUV_TO_RGB; rdev->src_mask = 0xffffffff; break; case DSPF_YUY2: txformat |= R200_TXFORMAT_VYUY422; if (!rdev->dst_422) txfilter |= R200_YUV_TO_RGB; rdev->src_mask = 0xffffffff; break; case DSPF_I420: txformat |= R200_TXFORMAT_I8; rdev->src_offset_cb = rdev->src_offset + rdev->src_pitch * rdev->src_height; rdev->src_offset_cr = rdev->src_offset_cb + rdev->src_pitch/2 * rdev->src_height/2; rdev->src_mask = 0x000000ff; break; case DSPF_YV12: txformat |= R200_TXFORMAT_I8; rdev->src_offset_cr = rdev->src_offset + rdev->src_pitch * rdev->src_height; rdev->src_offset_cb = rdev->src_offset_cr + rdev->src_pitch/2 * rdev->src_height/2; rdev->src_mask = 0x000000ff; break; default: D_BUG( "unexpected pixelformat" ); return; } if (state->blittingflags & DSBLIT_DEINTERLACE) { rdev->src_height /= 2; if (surface->config.caps & DSCAPS_SEPARATED) { if (surface->field) { rdev->src_offset += rdev->src_height * rdev->src_pitch; rdev->src_offset_cr += rdev->src_height * rdev->src_pitch/4; rdev->src_offset_cb += rdev->src_height * rdev->src_pitch/4; } } else { if (surface->field) { rdev->src_offset += rdev->src_pitch; rdev->src_offset_cr += rdev->src_pitch/2; rdev->src_offset_cb += rdev->src_pitch/2; } rdev->src_pitch *= 2; } } radeon_waitfifo( rdrv, rdev, 7 ); radeon_out32( mmio, SRC_OFFSET, rdev->src_offset ); radeon_out32( mmio, SRC_PITCH, rdev->src_pitch ); radeon_out32( mmio, R200_PP_TXFILTER_0, txfilter ); radeon_out32( mmio, R200_PP_TXFORMAT_0, txformat ); radeon_out32( mmio, R200_PP_TXSIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, R200_PP_TXPITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset ); if (rdev->src_format != buffer->format) RADEON_UNSET( BLITTING_FLAGS ); rdev->src_format = buffer->format; RADEON_SET( SOURCE ); } void r200_set_source_mask( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->source_mask; CoreSurfaceBuffer *buffer = state->src_mask.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 txformat = R200_TXFORMAT_NON_POWER2; u32 txfilter = R200_MAG_FILTER_LINEAR | R200_MIN_FILTER_LINEAR | R200_CLAMP_S_CLAMP_LAST | R200_CLAMP_T_CLAMP_LAST; if (RADEON_IS_SET( SOURCE_MASK )) { if ((state->blittingflags & DSBLIT_DEINTERLACE) == (rdev->blittingflags & DSBLIT_DEINTERLACE)) return; } D_ASSERT( (state->src_mask.offset % 32) == 0 ); D_ASSERT( (state->src_mask.pitch % 32) == 0 ); rdev->msk_format = buffer->format; rdev->msk_offset = radeon_buffer_offset( rdev, &state->src_mask ); rdev->msk_pitch = state->src_mask.pitch; rdev->msk_width = surface->config.size.w; rdev->msk_height = surface->config.size.h; switch (buffer->format) { case DSPF_A8: txformat |= R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP; break; case DSPF_RGB332: txformat |= R200_TXFORMAT_RGB332; break; case DSPF_RGB444: txformat |= R200_TXFORMAT_ARGB4444; break; case DSPF_ARGB4444: txformat |= R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP; break; case DSPF_RGB555: txformat |= R200_TXFORMAT_ARGB1555; break; case DSPF_ARGB1555: txformat |= R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP; break; case DSPF_RGB16: txformat |= R200_TXFORMAT_RGB565; break; case DSPF_RGB32: txformat |= R200_TXFORMAT_ARGB8888; break; case DSPF_ARGB: case DSPF_AiRGB: txformat |= R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP; break; default: D_BUG( "unexpected pixelformat" ); return; } if (state->blittingflags & DSBLIT_DEINTERLACE) { rdev->msk_height /= 2; if (surface->config.caps & DSCAPS_SEPARATED) { if (surface->field) rdev->msk_offset += rdev->msk_height * rdev->msk_pitch; } else { if (surface->field) rdev->msk_offset += rdev->msk_pitch; rdev->msk_pitch *= 2; } } radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, R200_PP_TXFILTER_1, txfilter ); radeon_out32( mmio, R200_PP_TXFORMAT_1, txformat ); radeon_out32( mmio, R200_PP_TXSIZE_1, ((rdev->msk_height-1) << 16) | ((rdev->msk_width-1) & 0xffff) ); radeon_out32( mmio, R200_PP_TXPITCH_1, rdev->msk_pitch - 32 ); radeon_out32( mmio, R200_PP_TXOFFSET_1, rdev->msk_offset ); RADEON_SET( SOURCE_MASK ); } void r200_set_clip( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBRegion *clip = &state->clip; volatile u8 *mmio = rdrv->mmio_base; if (RADEON_IS_SET( CLIP )) return; /* 2d clip */ radeon_waitfifo( rdrv, rdev, 2 ); if (rdev->dst_422) { radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1)/2 & 0xffff) ); } else { radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); } /* 3d clip */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); rdev->clip = state->clip; RADEON_SET( CLIP ); } #define R200_SET_YUV422_COLOR( rdrv, rdev, y, u, v ) { \ radeon_out32( (rdrv)->fb_base, (rdev)->yuv422_buffer, \ PIXEL_YUY2( y, u, v ) ); \ radeon_in8( (rdrv)->fb_base, (rdev)->yuv422_buffer ); \ radeon_waitfifo( rdrv, rdev, 3 ); \ radeon_out32( (rdrv)->mmio_base, R200_PP_TXOFFSET_1, \ (rdev)->fb_offset + (rdev)->yuv422_buffer ); \ radeon_out32( (rdrv)->mmio_base, R200_PP_TXFORMAT_1, \ R200_TXFORMAT_VYUY422 ); \ radeon_out32( (rdrv)->mmio_base, R200_PP_TXFILTER_1, 0 ); \ } void r200_set_drawing_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBColor color = state->color; int index = state->color_index; u32 color2d; u32 color3d; int y, u, v; if (RADEON_IS_SET( COLOR ) && RADEON_IS_SET( DRAWING_FLAGS )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = ((long) color.r * color.a / 255L); color.g = ((long) color.g * color.a / 255L); color.b = ((long) color.b * color.a / 255L); } color3d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); switch (rdev->dst_format) { case DSPF_ALUT44: index |= (color.a & 0xf0); case DSPF_LUT8: color2d = index; color3d = PIXEL_RGB32( index, index, index ); break; case DSPF_A8: color2d = color.a; color3d = (color.a << 24) | 0x00ffffff; break; case DSPF_RGB332: color2d = PIXEL_RGB332( color.r, color.g, color.b ); break; case DSPF_ARGB2554: color2d = PIXEL_ARGB2554( color.a, color.r, color.g, color.b ); break; case DSPF_RGB444: case DSPF_ARGB4444: color2d = PIXEL_ARGB4444( color.a, color.r, color.g, color.b ); break; case DSPF_RGB555: case DSPF_ARGB1555: color2d = PIXEL_ARGB1555( color.a, color.r, color.g, color.b ); break; case DSPF_RGB16: color2d = PIXEL_RGB16( color.r, color.g, color.b ); break; case DSPF_RGB32: color2d = PIXEL_RGB32( color.r, color.g, color.b ); break; case DSPF_ARGB: color2d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; case DSPF_AiRGB: color2d = PIXEL_AiRGB( color.a, color.r, color.g, color.b ); break; case DSPF_AYUV: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color3d = color2d = PIXEL_AYUV( color.a, y, u, v ); break; case DSPF_UYVY: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_UYVY( y, u, v ); R200_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); break; case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_YUY2( y, u, v ); R200_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); rdev->y_cop = PIXEL_ARGB( color.a, y, y, y ); rdev->cb_cop = PIXEL_ARGB( color.a, u, u, u ); rdev->cr_cop = PIXEL_ARGB( color.a, v, v, v ); color3d = color2d = rdev->y_cop; break; default: D_BUG( "unexpected pixelformat" ); color2d = 0; break; } radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( rdrv->mmio_base, DP_BRUSH_FRGD_CLR, color2d ); radeon_out32( rdrv->mmio_base, R200_PP_TFACTOR_1, color3d ); RADEON_SET( COLOR ); } void r200_set_blitting_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBColor color = state->color; u32 color3d; int y, u, v; if (RADEON_IS_SET( COLOR ) && RADEON_IS_SET( BLITTING_FLAGS )) return; if (state->blittingflags & DSBLIT_COLORIZE && state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { color.r = color.r * color.a / 255; color.g = color.g * color.a / 255; color.b = color.b * color.a / 255; } switch (rdev->dst_format) { case DSPF_A8: color3d = (color.a << 24) | 0x00ffffff; break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); rdev->y_cop = PIXEL_ARGB( color.a, y, y, y ); rdev->cb_cop = PIXEL_ARGB( color.a, u, u, u ); rdev->cr_cop = PIXEL_ARGB( color.a, v, v, v ); color3d = rdev->y_cop; break; case DSPF_AYUV: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color3d = PIXEL_AYUV( color.a, y, u, v ); break; case DSPF_UYVY: case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); R200_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); default: color3d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; } radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( rdrv->mmio_base, R200_PP_TFACTOR_0, color3d ); RADEON_SET( COLOR ); } void r200_set_src_colorkey( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; if (RADEON_IS_SET( SRC_COLORKEY )) return; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, CLR_CMP_CLR_SRC, state->src_colorkey ); radeon_out32( mmio, CLR_CMP_MASK, rdev->src_mask ); RADEON_SET( SRC_COLORKEY ); } void r200_set_blend_function( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 sblend; u32 dblend; if (RADEON_IS_SET( SRC_BLEND ) && RADEON_IS_SET( DST_BLEND )) return; sblend = r200SrcBlend[state->src_blend-1]; dblend = r200DstBlend[state->dst_blend-1]; if (!DFB_PIXELFORMAT_HAS_ALPHA(rdev->dst_format)) { if (sblend == SRC_BLEND_GL_DST_ALPHA) sblend = SRC_BLEND_GL_ONE; else if (sblend == SRC_BLEND_GL_ONE_MINUS_DST_ALPHA) sblend = SRC_BLEND_GL_ZERO; if (dblend == DST_BLEND_GL_DST_ALPHA) dblend = DST_BLEND_GL_ONE; else if (dblend == DST_BLEND_GL_ONE_MINUS_DST_ALPHA) dblend = DST_BLEND_GL_ZERO; } else if (rdev->dst_format == DSPF_A8) { if (sblend == SRC_BLEND_GL_DST_ALPHA) sblend = SRC_BLEND_GL_DST_COLOR; else if (sblend == SRC_BLEND_GL_ONE_MINUS_DST_ALPHA) sblend = SRC_BLEND_GL_ONE_MINUS_DST_COLOR; if (dblend == DST_BLEND_GL_DST_ALPHA) dblend = DST_BLEND_GL_DST_COLOR; else if (dblend == DST_BLEND_GL_ONE_MINUS_DST_ALPHA) dblend = DST_BLEND_GL_ONE_MINUS_DST_COLOR; } radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, RB3D_BLENDCNTL, sblend | dblend ); RADEON_SET( SRC_BLEND ); RADEON_SET( DST_BLEND ); } void r200_set_render_options( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { if (RADEON_IS_SET( RENDER_OPTIONS )) return; if (state->render_options & DSRO_MATRIX && (!state->affine_matrix || state->matrix[0] != (1<<16) || state->matrix[1] != 0 || state->matrix[2] != 0 || state->matrix[3] != 0 || state->matrix[4] != (1<<16) || state->matrix[5] != 0)) { rdev->matrix = state->matrix; rdev->affine_matrix = state->affine_matrix; } else { rdev->matrix = NULL; } if ((rdev->render_options & DSRO_ANTIALIAS) != (state->render_options & DSRO_ANTIALIAS)) { RADEON_UNSET( DRAWING_FLAGS ); RADEON_UNSET( BLITTING_FLAGS ); } rdev->render_options = state->render_options; RADEON_SET( RENDER_OPTIONS ); } /* NOTES: * - We use texture unit 0 for blitting functions, * texture unit 1 for drawing functions * - Default blend equation is ADD_CLAMP (A * B + C) */ void r200_set_drawingflags( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 master_cntl = rdev->gui_master_cntl | GMC_SRC_DATATYPE_MONO_FG_LA | GMC_BRUSH_SOLID_COLOR | GMC_CLR_CMP_CNTL_DIS; u32 rb3d_cntl = rdev->rb3d_cntl & ~DITHER_ENABLE; u32 pp_cntl = TEX_BLEND_1_ENABLE; u32 cblend = R200_TXC_ARG_C_TFACTOR_COLOR; if (RADEON_IS_SET( DRAWING_FLAGS )) return; if (rdev->dst_422) { pp_cntl |= TEX_1_ENABLE; cblend = R200_TXC_ARG_C_R1_COLOR; } else if (rdev->dst_format == DSPF_A8) { cblend = R200_TXC_ARG_C_TFACTOR_ALPHA; } if (state->drawingflags & DSDRAW_BLEND) rb3d_cntl |= ALPHA_BLEND_ENABLE; if (state->drawingflags & DSDRAW_XOR) { rb3d_cntl |= ROP_ENABLE; master_cntl |= GMC_ROP3_PATXOR; } else { master_cntl |= GMC_ROP3_PATCOPY; } if (state->render_options & DSRO_ANTIALIAS) pp_cntl |= ANTI_ALIAS_LINE_POLY; radeon_waitfifo( rdrv, rdev, 11 ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, master_cntl ); radeon_out32( mmio, DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM ); radeon_out32( mmio, RB3D_CNTL, rb3d_cntl ); radeon_out32( mmio, SE_CNTL, DIFFUSE_SHADE_FLAT | ALPHA_SHADE_FLAT | BFACE_SOLID | FFACE_SOLID | VTX_PIX_CENTER_OGL | ROUND_MODE_ROUND | ROUND_PREC_4TH_PIX ); radeon_out32( mmio, PP_CNTL, pp_cntl ); radeon_out32( mmio, R200_PP_TXCBLEND_1, cblend ); radeon_out32( mmio, R200_PP_TXCBLEND2_1, (1 << R200_TXC_TFACTOR_SEL_SHIFT) | R200_TXC_OUTPUT_REG_R0 | R200_TXC_CLAMP_0_1 ); radeon_out32( mmio, R200_PP_TXABLEND_1, R200_TXA_ARG_C_TFACTOR_ALPHA ); radeon_out32( mmio, R200_PP_TXABLEND2_1, (1 << R200_TXA_TFACTOR_SEL_SHIFT) | R200_TXA_OUTPUT_REG_R0 | R200_TXA_CLAMP_0_1 ); radeon_out32( mmio, R200_SE_VTX_FMT_0, R200_VTX_XY ); radeon_out32( mmio, R200_SE_VTX_FMT_1, 0 ); rdev->drawingflags = state->drawingflags; RADEON_SET ( DRAWING_FLAGS ); RADEON_UNSET( BLITTING_FLAGS ); } void r200_set_blittingflags( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 master_cntl = rdev->gui_master_cntl | GMC_BRUSH_NONE | GMC_SRC_DATATYPE_COLOR; u32 cmp_cntl = 0; u32 rb3d_cntl = rdev->rb3d_cntl; u32 se_cntl = BFACE_SOLID | FFACE_SOLID | VTX_PIX_CENTER_OGL | ROUND_MODE_ROUND; u32 pp_cntl = TEX_0_ENABLE; u32 cblend = R200_TXC_ARG_C_R0_COLOR; u32 ablend = R200_TXA_ARG_C_R0_ALPHA; u32 vtx_fmt = R200_VTX_XY; u32 vte_cntl; if (RADEON_IS_SET( BLITTING_FLAGS )) return; if (rdev->accel == DFXL_TEXTRIANGLES) { se_cntl |= DIFFUSE_SHADE_GOURAUD | ALPHA_SHADE_GOURAUD | SPECULAR_SHADE_GOURAUD | FLAT_SHADE_VTX_LAST | ROUND_PREC_8TH_PIX; vtx_fmt |= R200_VTX_Z0 | R200_VTX_W0; vte_cntl = 0; } else { se_cntl |= DIFFUSE_SHADE_FLAT | ALPHA_SHADE_FLAT | ROUND_PREC_4TH_PIX; vte_cntl = R200_VTX_ST_DENORMALIZED; } if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL)) { if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) ablend = R200_TXA_ARG_A_R0_ALPHA | R200_TXA_ARG_B_TFACTOR_ALPHA; else ablend = R200_TXA_ARG_C_TFACTOR_ALPHA; pp_cntl |= TEX_BLEND_0_ENABLE; } rb3d_cntl |= ALPHA_BLEND_ENABLE; } if (rdev->dst_format != DSPF_A8) { if (state->blittingflags & (DSBLIT_SRC_MASK_ALPHA | DSBLIT_SRC_MASK_COLOR)) { if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA) ablend = R200_TXA_ARG_A_R0_ALPHA | R200_TXA_ARG_B_R1_ALPHA; if (state->blittingflags & DSBLIT_SRC_MASK_COLOR) cblend = R200_TXC_ARG_A_R0_COLOR | R200_TXC_ARG_B_R1_COLOR; pp_cntl |= TEX_1_ENABLE | TEX_BLEND_0_ENABLE; } else if (state->blittingflags & DSBLIT_COLORIZE) { if (rdev->dst_422) { cblend = (rdev->src_format == DSPF_A8) ? (R200_TXC_ARG_C_R1_COLOR) : (R200_TXC_ARG_A_R0_COLOR | R200_TXC_ARG_B_R1_COLOR); pp_cntl |= TEX_1_ENABLE; } else { cblend = (rdev->src_format == DSPF_A8) ? (R200_TXC_ARG_C_TFACTOR_COLOR) : (R200_TXC_ARG_A_R0_COLOR | R200_TXC_ARG_B_TFACTOR_COLOR); } pp_cntl |= TEX_BLEND_0_ENABLE; } else if (state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { cblend = (rdev->src_format == DSPF_A8) ? (R200_TXC_ARG_C_R0_ALPHA) : (R200_TXC_ARG_A_R0_COLOR | R200_TXC_ARG_B_TFACTOR_ALPHA); pp_cntl |= TEX_BLEND_0_ENABLE; } else if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) { cblend = (rdev->src_format == DSPF_A8) ? (R200_TXC_ARG_C_R0_ALPHA) : (R200_TXC_ARG_A_R0_COLOR | R200_TXC_ARG_B_R0_ALPHA); pp_cntl |= TEX_BLEND_0_ENABLE; } } /* DSPF_A8 */ else { if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA) { ablend = R200_TXA_ARG_A_R0_ALPHA | R200_TXA_ARG_B_R1_ALPHA; cblend = R200_TXC_ARG_A_R0_ALPHA | R200_TXC_ARG_B_R1_ALPHA; pp_cntl |= TEX_1_ENABLE; } else if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) cblend = R200_TXC_ARG_A_R0_ALPHA | R200_TXC_ARG_B_TFACTOR_ALPHA; else cblend = R200_TXC_ARG_C_TFACTOR_ALPHA; } else { cblend = R200_TXC_ARG_C_R0_ALPHA; } pp_cntl |= TEX_BLEND_0_ENABLE; } if (state->blittingflags & DSBLIT_SRC_COLORKEY) cmp_cntl = SRC_CMP_EQ_COLOR | CLR_CMP_SRC_SOURCE; else master_cntl |= GMC_CLR_CMP_CNTL_DIS; if (state->blittingflags & DSBLIT_XOR) { master_cntl |= GMC_ROP3_XOR; rb3d_cntl |= ROP_ENABLE; } else { master_cntl |= GMC_ROP3_SRCCOPY; } if (state->render_options & DSRO_ANTIALIAS) pp_cntl |= ANTI_ALIAS_POLY; radeon_waitfifo( rdrv, rdev, 12 ); radeon_out32( mmio, CLR_CMP_CNTL, cmp_cntl ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, master_cntl ); radeon_out32( mmio, RB3D_CNTL, rb3d_cntl ); radeon_out32( mmio, SE_CNTL, se_cntl ); radeon_out32( mmio, PP_CNTL, pp_cntl ); radeon_out32( mmio, R200_PP_TXCBLEND_0, cblend ); radeon_out32( mmio, R200_PP_TXCBLEND2_0, R200_TXC_OUTPUT_REG_R0 | R200_TXC_CLAMP_0_1 ); radeon_out32( mmio, R200_PP_TXABLEND_0, ablend ); radeon_out32( mmio, R200_PP_TXABLEND2_0, R200_TXA_OUTPUT_REG_R0 | R200_TXA_CLAMP_0_1 ); radeon_out32( mmio, R200_SE_VTX_FMT_0, vtx_fmt ); radeon_out32( mmio, R200_SE_VTX_FMT_1, 2 << R200_VTX_TEX0_COMP_CNT_SHIFT ); radeon_out32( mmio, R200_SE_VTE_CNTL, vte_cntl ); rdev->blittingflags = state->blittingflags; RADEON_SET ( BLITTING_FLAGS ); RADEON_UNSET( DRAWING_FLAGS ); } DirectFB-1.2.10/gfxdrivers/radeon/radeon_state.h0000644000175000017500000001654011164361026016420 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __RADEON_STATE_H__ #define __RADEON_STATE_H__ #include /* R100 state funcs */ void r100_restore ( RadeonDriverData *rdrv, RadeonDeviceData *rdev ); void r100_set_destination ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_source ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_source_mask ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_clip ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_drawing_color ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_blitting_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_src_colorkey ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_blend_function( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_render_options( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_drawingflags ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r100_set_blittingflags ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); /* R200 state funcs */ void r200_restore ( RadeonDriverData *rdrv, RadeonDeviceData *rdev ); void r200_set_destination ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_source ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_source_mask ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_clip ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_drawing_color ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_blitting_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_src_colorkey ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_blend_function( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_render_options( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_drawingflags ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r200_set_blittingflags ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); /* R300 state funcs */ void r300_restore ( RadeonDriverData *rdrv, RadeonDeviceData *rdev ); void r300_set_destination ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_source ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_clip3d ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, const DFBRegion *clip ); void r300_set_clip ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_drawing_color ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_blitting_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_src_colorkey ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_blend_function( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_render_options( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_drawingflags ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); void r300_set_blittingflags ( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ); #define RADEON_IS_SET( flag ) \ ((rdev->set & SMF_##flag) == SMF_##flag) #define RADEON_SET( flag ) \ rdev->set |= SMF_##flag #define RADEON_UNSET( flag ) \ rdev->set &= ~(SMF_##flag) static inline u32 radeon_buffer_offset( RadeonDeviceData *rdev, CoreSurfaceBufferLock *lock ) { if (lock->phys - lock->offset == rdev->fb_phys) return lock->offset + rdev->fb_offset; return lock->offset + rdev->agp_offset; } #endif /* __RADEON_STATE_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/radeon_regs.h0000644000175000017500000063051711164361026016246 00000000000000/* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. * * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation on the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /* * Authors: * Kevin E. Martin * Rickard E. Faith * Alan Hourihane * * References: * * !!!! FIXME !!!! * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April * 1999. * * !!!! FIXME !!!! * RAGE 128 Software Development Manual (Technical Reference Manual P/N * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999. * */ /* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */ #ifndef __RADEON_REGS_H__ #define __RADEON_REGS_H__ #ifdef ROP_XOR #undef ROP_XOR #endif #ifdef ROP_COPY #undef ROP_COPY #endif /* Registers for 2D/Video/Overlay */ #define CONFIG_VENDOR_ID 0x0f00 /* PCI */ #define CONFIG_DEVICE_ID 0x0f02 /* PCI */ #define CONFIG_ADAPTER_ID 0x0f2c /* PCI */ #define AGP_BASE 0x0170 #define AGP_CNTL 0x0174 # define AGP_APER_SIZE_256MB (0x00 << 0) # define AGP_APER_SIZE_128MB (0x20 << 0) # define AGP_APER_SIZE_64MB (0x30 << 0) # define AGP_APER_SIZE_32MB (0x38 << 0) # define AGP_APER_SIZE_16MB (0x3c << 0) # define AGP_APER_SIZE_8MB (0x3e << 0) # define AGP_APER_SIZE_4MB (0x3f << 0) # define AGP_APER_SIZE_MASK (0x3f << 0) #define AGP_COMMAND 0x0f60 /* PCI */ #define AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/ # define AGP_ENABLE (1<<8) #define AGP_PLL_CNTL 0x000b /* PLL */ #define AGP_STATUS 0x0f5c /* PCI */ # define AGP_1X_MODE 0x01 # define AGP_2X_MODE 0x02 # define AGP_4X_MODE 0x04 # define AGP_FW_MODE 0x10 # define AGP_MODE_MASK 0x17 #define ATTRDR 0x03c1 /* VGA */ #define ATTRDW 0x03c0 /* VGA */ #define ATTRX 0x03c0 /* VGA */ #define AUX_SC_CNTL 0x1660 # define AUX1_SC_EN (1 << 0) # define AUX1_SC_MODE_OR (0 << 1) # define AUX1_SC_MODE_NAND (1 << 1) # define AUX2_SC_EN (1 << 2) # define AUX2_SC_MODE_OR (0 << 3) # define AUX2_SC_MODE_NAND (1 << 3) # define AUX3_SC_EN (1 << 4) # define AUX3_SC_MODE_OR (0 << 5) # define AUX3_SC_MODE_NAND (1 << 5) #define AUX1_SC_BOTTOM 0x1670 #define AUX1_SC_LEFT 0x1664 #define AUX1_SC_RIGHT 0x1668 #define AUX1_SC_TOP 0x166c #define AUX2_SC_BOTTOM 0x1680 #define AUX2_SC_LEFT 0x1674 #define AUX2_SC_RIGHT 0x1678 #define AUX2_SC_TOP 0x167c #define AUX3_SC_BOTTOM 0x1690 #define AUX3_SC_LEFT 0x1684 #define AUX3_SC_RIGHT 0x1688 #define AUX3_SC_TOP 0x168c #define AUX_WINDOW_HORZ_CNTL 0x02d8 #define AUX_WINDOW_VERT_CNTL 0x02dc #define BASE_CODE 0x0f0b #define BIOS_0_SCRATCH 0x0010 #define BIOS_1_SCRATCH 0x0014 #define BIOS_2_SCRATCH 0x0018 #define BIOS_3_SCRATCH 0x001c #define BIOS_4_SCRATCH 0x0020 #define BIOS_5_SCRATCH 0x0024 #define BIOS_6_SCRATCH 0x0028 #define BIOS_7_SCRATCH 0x002c #define BIOS_ROM 0x0f30 /* PCI */ #define BIST 0x0f0f /* PCI */ #define BRUSH_DATA0 0x1480 #define BRUSH_DATA1 0x1484 #define BRUSH_DATA10 0x14a8 #define BRUSH_DATA11 0x14ac #define BRUSH_DATA12 0x14b0 #define BRUSH_DATA13 0x14b4 #define BRUSH_DATA14 0x14b8 #define BRUSH_DATA15 0x14bc #define BRUSH_DATA16 0x14c0 #define BRUSH_DATA17 0x14c4 #define BRUSH_DATA18 0x14c8 #define BRUSH_DATA19 0x14cc #define BRUSH_DATA2 0x1488 #define BRUSH_DATA20 0x14d0 #define BRUSH_DATA21 0x14d4 #define BRUSH_DATA22 0x14d8 #define BRUSH_DATA23 0x14dc #define BRUSH_DATA24 0x14e0 #define BRUSH_DATA25 0x14e4 #define BRUSH_DATA26 0x14e8 #define BRUSH_DATA27 0x14ec #define BRUSH_DATA28 0x14f0 #define BRUSH_DATA29 0x14f4 #define BRUSH_DATA3 0x148c #define BRUSH_DATA30 0x14f8 #define BRUSH_DATA31 0x14fc #define BRUSH_DATA32 0x1500 #define BRUSH_DATA33 0x1504 #define BRUSH_DATA34 0x1508 #define BRUSH_DATA35 0x150c #define BRUSH_DATA36 0x1510 #define BRUSH_DATA37 0x1514 #define BRUSH_DATA38 0x1518 #define BRUSH_DATA39 0x151c #define BRUSH_DATA4 0x1490 #define BRUSH_DATA40 0x1520 #define BRUSH_DATA41 0x1524 #define BRUSH_DATA42 0x1528 #define BRUSH_DATA43 0x152c #define BRUSH_DATA44 0x1530 #define BRUSH_DATA45 0x1534 #define BRUSH_DATA46 0x1538 #define BRUSH_DATA47 0x153c #define BRUSH_DATA48 0x1540 #define BRUSH_DATA49 0x1544 #define BRUSH_DATA5 0x1494 #define BRUSH_DATA50 0x1548 #define BRUSH_DATA51 0x154c #define BRUSH_DATA52 0x1550 #define BRUSH_DATA53 0x1554 #define BRUSH_DATA54 0x1558 #define BRUSH_DATA55 0x155c #define BRUSH_DATA56 0x1560 #define BRUSH_DATA57 0x1564 #define BRUSH_DATA58 0x1568 #define BRUSH_DATA59 0x156c #define BRUSH_DATA6 0x1498 #define BRUSH_DATA60 0x1570 #define BRUSH_DATA61 0x1574 #define BRUSH_DATA62 0x1578 #define BRUSH_DATA63 0x157c #define BRUSH_DATA7 0x149c #define BRUSH_DATA8 0x14a0 #define BRUSH_DATA9 0x14a4 #define BRUSH_SCALE 0x1470 #define BRUSH_Y_X 0x1474 #define BUS_CNTL 0x0030 # define BUS_MASTER_DIS (1 << 6) # define BUS_RD_DISCARD_EN (1 << 24) # define BUS_RD_ABORT_EN (1 << 25) # define BUS_MSTR_DISCONNECT_EN (1 << 28) # define BUS_WRT_BURST (1 << 29) # define BUS_READ_BURST (1 << 30) #define BUS_CNTL1 0x0034 # define BUS_WAIT_ON_LOCK_EN (1 << 4) #define CACHE_CNTL 0x1724 #define CACHE_LINE 0x0f0c /* PCI */ #define CAP0_TRIG_CNTL 0x0950 /* ? */ #define CAP1_TRIG_CNTL 0x09c0 /* ? */ #define CAPABILITIES_ID 0x0f50 /* PCI */ #define CAPABILITIES_PTR 0x0f34 /* PCI */ #define CLK_PIN_CNTL 0x0001 /* PLL */ # define SCLK_DYN_START_CNTL (1 << 15) #define CLOCK_CNTL_DATA 0x000c #define CLOCK_CNTL_INDEX 0x0008 # define PLL_WR_EN (1 << 7) # define PLL_DIV_SEL (3 << 8) # define PLL2_DIV_SEL_MASK ~(3 << 8) #define CLK_PWRMGT_CNTL 0x0014 # define ENGIN_DYNCLK_MODE (1 << 12) # define ACTIVE_HILO_LAT_MASK (3 << 13) # define ACTIVE_HILO_LAT_SHIFT 13 # define DISP_DYN_STOP_LAT_MASK (1 << 12) # define DYN_STOP_MODE_MASK (7 << 21) #define PLL_PWRMGT_CNTL 0x0015 # define TCL_BYPASS_DISABLE (1 << 20) #define CLR_CMP_CLR_3D 0x1a24 #define CLR_CMP_CLR_DST 0x15c8 #define CLR_CMP_CLR_SRC 0x15c4 #define CLR_CMP_CNTL 0x15c0 # define SRC_CMP_EQ_COLOR (4 << 0) # define SRC_CMP_NEQ_COLOR (5 << 0) # define CLR_CMP_SRC_SOURCE (1 << 24) #define CLR_CMP_MASK 0x15cc # define CLR_CMP_MSK 0xffffffff #define CLR_CMP_MASK_3D 0x1A28 #define COMMAND 0x0f04 /* PCI */ #define COMPOSITE_SHADOW_ID 0x1a0c #define CONFIG_APER_0_BASE 0x0100 #define CONFIG_APER_1_BASE 0x0104 #define CONFIG_APER_SIZE 0x0108 #define CONFIG_BONDS 0x00e8 #define CONFIG_CNTL 0x00e0 # define CFG_ATI_REV_A11 (0 << 16) # define CFG_ATI_REV_A12 (1 << 16) # define CFG_ATI_REV_A13 (2 << 16) # define CFG_ATI_REV_ID_MASK (0xf << 16) #define CONFIG_MEMSIZE 0x00f8 #define CONFIG_MEMSIZE_EMBEDDED 0x0114 #define CONFIG_REG_1_BASE 0x010c #define CONFIG_REG_APER_SIZE 0x0110 #define CONFIG_XSTRAP 0x00e4 #define CONSTANT_COLOR_C 0x1d34 # define CONSTANT_COLOR_MASK 0x00ffffff # define CONSTANT_COLOR_ONE 0x00ffffff # define CONSTANT_COLOR_ZERO 0x00000000 #define CRC_CMDFIFO_ADDR 0x0740 #define CRC_CMDFIFO_DOUT 0x0744 #define GRPH_BUFFER_CNTL 0x02f0 # define GRPH_START_REQ_MASK (0x7f) # define GRPH_START_REQ_SHIFT 0 # define GRPH_STOP_REQ_MASK (0x7f<<8) # define GRPH_STOP_REQ_SHIFT 8 # define GRPH_CRITICAL_POINT_MASK (0x7f<<16) # define GRPH_CRITICAL_POINT_SHIFT 16 # define GRPH_CRITICAL_CNTL (1<<28) # define GRPH_BUFFER_SIZE (1<<29) # define GRPH_CRITICAL_AT_SOF (1<<30) # define GRPH_STOP_CNTL (1<<31) #define GRPH2_BUFFER_CNTL 0x03f0 # define GRPH2_START_REQ_MASK (0x7f) # define GRPH2_START_REQ_SHIFT 0 # define GRPH2_STOP_REQ_MASK (0x7f<<8) # define GRPH2_STOP_REQ_SHIFT 8 # define GRPH2_CRITICAL_POINT_MASK (0x7f<<16) # define GRPH2_CRITICAL_POINT_SHIFT 16 # define GRPH2_CRITICAL_CNTL (1<<28) # define GRPH2_BUFFER_SIZE (1<<29) # define GRPH2_CRITICAL_AT_SOF (1<<30) # define GRPH2_STOP_CNTL (1<<31) #define CRTC_CRNT_FRAME 0x0214 #define CRTC_EXT_CNTL 0x0054 # define CRTC_VGA_XOVERSCAN (1 << 0) # define VGA_ATI_LINEAR (1 << 3) # define XCRT_CNT_EN (1 << 6) # define CRTC_HSYNC_DIS (1 << 8) # define CRTC_VSYNC_DIS (1 << 9) # define CRTC_DISPLAY_DIS (1 << 10) # define CRTC_SYNC_TRISTAT (1 << 11) # define CRTC_CRT_ON (1 << 15) #define CRTC_EXT_CNTL_DPMS_BYTE 0x0055 # define CRTC_HSYNC_DIS_BYTE (1 << 0) # define CRTC_VSYNC_DIS_BYTE (1 << 1) # define CRTC_DISPLAY_DIS_BYTE (1 << 2) #define CRTC_GEN_CNTL 0x0050 # define CRTC_DBL_SCAN_EN (1 << 0) # define CRTC_INTERLACE_EN (1 << 1) # define CRTC_CSYNC_EN (1 << 4) # define CRTC_CUR_EN (1 << 16) # define CRTC_CUR_MODE_MASK (7 << 17) # define CRTC_ICON_EN (1 << 20) # define CRTC_EXT_DISP_EN (1 << 24) # define CRTC_EN (1 << 25) # define CRTC_DISP_REQ_EN_B (1 << 26) #define CRTC2_GEN_CNTL 0x03f8 # define CRTC2_DBL_SCAN_EN (1 << 0) # define CRTC2_INTERLACE_EN (1 << 1) # define CRTC2_SYNC_TRISTAT (1 << 4) # define CRTC2_HSYNC_TRISTAT (1 << 5) # define CRTC2_VSYNC_TRISTAT (1 << 6) # define CRTC2_CRT2_ON (1 << 7) # define CRTC2_ICON_EN (1 << 15) # define CRTC2_CUR_EN (1 << 16) # define CRTC2_CUR_MODE_MASK (7 << 20) # define CRTC2_DISP_DIS (1 << 23) # define CRTC2_EN (1 << 25) # define CRTC2_DISP_REQ_EN_B (1 << 26) # define CRTC2_CSYNC_EN (1 << 27) # define CRTC2_HSYNC_DIS (1 << 28) # define CRTC2_VSYNC_DIS (1 << 29) #define CRTC_MORE_CNTL 0x27c # define CRTC_H_CUTOFF_ACTIVE_EN (1<<4) # define CRTC_V_CUTOFF_ACTIVE_EN (1<<5) #define CRTC_GUI_TRIG_VLINE 0x0218 #define CRTC_H_SYNC_STRT_WID 0x0204 # define CRTC_H_SYNC_STRT_PIX (0x07 << 0) # define CRTC_H_SYNC_STRT_CHAR (0x3ff << 3) # define CRTC_H_SYNC_STRT_CHAR_SHIFT 3 # define CRTC_H_SYNC_WID (0x3f << 16) # define CRTC_H_SYNC_WID_SHIFT 16 # define CRTC_H_SYNC_POL (1 << 23) #define CRTC2_H_SYNC_STRT_WID 0x0304 # define CRTC2_H_SYNC_STRT_PIX (0x07 << 0) # define CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3) # define CRTC2_H_SYNC_STRT_CHAR_SHIFT 3 # define CRTC2_H_SYNC_WID (0x3f << 16) # define CRTC2_H_SYNC_WID_SHIFT 16 # define CRTC2_H_SYNC_POL (1 << 23) #define CRTC_H_TOTAL_DISP 0x0200 # define CRTC_H_TOTAL (0x03ff << 0) # define CRTC_H_TOTAL_SHIFT 0 # define CRTC_H_DISP (0x01ff << 16) # define CRTC_H_DISP_SHIFT 16 #define CRTC2_H_TOTAL_DISP 0x0300 # define CRTC2_H_TOTAL (0x03ff << 0) # define CRTC2_H_TOTAL_SHIFT 0 # define CRTC2_H_DISP (0x01ff << 16) # define CRTC2_H_DISP_SHIFT 16 #define CRTC_OFFSET 0x0224 #define CRTC2_OFFSET 0x0324 #define CRTC_OFFSET_CNTL 0x0228 # define CRTC_TILE_EN (1 << 15) # define CRTC_HSYNC_EN (1 << 16) #define CRTC2_OFFSET_CNTL 0x0328 # define CRTC2_TILE_EN (1 << 15) #define CRTC_PITCH 0x022c #define CRTC2_PITCH 0x032c #define CRTC_STATUS 0x005c # define CRTC_VBLANK_SAVE (1 << 1) # define CRTC_VBLANK_SAVE_CLEAR (1 << 1) #define CRTC2_STATUS 0x03fc # define CRTC2_VBLANK_SAVE (1 << 1) # define CRTC2_VBLANK_SAVE_CLEAR (1 << 1) #define CRTC_V_SYNC_STRT_WID 0x020c # define CRTC_V_SYNC_STRT (0x7ff << 0) # define CRTC_V_SYNC_STRT_SHIFT 0 # define CRTC_V_SYNC_WID (0x1f << 16) # define CRTC_V_SYNC_WID_SHIFT 16 # define CRTC_V_SYNC_POL (1 << 23) #define CRTC2_V_SYNC_STRT_WID 0x030c # define CRTC2_V_SYNC_STRT (0x7ff << 0) # define CRTC2_V_SYNC_STRT_SHIFT 0 # define CRTC2_V_SYNC_WID (0x1f << 16) # define CRTC2_V_SYNC_WID_SHIFT 16 # define CRTC2_V_SYNC_POL (1 << 23) #define CRTC_V_TOTAL_DISP 0x0208 # define CRTC_V_TOTAL (0x07ff << 0) # define CRTC_V_TOTAL_SHIFT 0 # define CRTC_V_DISP (0x07ff << 16) # define CRTC_V_DISP_SHIFT 16 #define CRTC2_V_TOTAL_DISP 0x0308 # define CRTC2_V_TOTAL (0x07ff << 0) # define CRTC2_V_TOTAL_SHIFT 0 # define CRTC2_V_DISP (0x07ff << 16) # define CRTC2_V_DISP_SHIFT 16 #define CRTC_VLINE_CRNT_VLINE 0x0210 # define CRTC_CRNT_VLINE_MASK (0x7ff << 16) #define CRTC2_CRNT_FRAME 0x0314 #define CRTC2_GUI_TRIG_VLINE 0x0318 #define CRTC2_STATUS 0x03fc #define CRTC2_VLINE_CRNT_VLINE 0x0310 #define CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */ #define CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */ #define CUR_CLR0 0x026c #define CUR_CLR1 0x0270 #define CUR_HORZ_VERT_OFF 0x0268 #define CUR_HORZ_VERT_POSN 0x0264 #define CUR_OFFSET 0x0260 # define CUR_LOCK (1 << 31) #define CUR2_CLR0 0x036c #define CUR2_CLR1 0x0370 #define CUR2_HORZ_VERT_OFF 0x0368 #define CUR2_HORZ_VERT_POSN 0x0364 #define CUR2_OFFSET 0x0360 # define CUR2_LOCK (1 << 31) #define DAC_CNTL 0x0058 # define DAC_RANGE_CNTL (3 << 0) # define DAC_RANGE_CNTL_MASK 0x03 # define DAC_BLANKING (1 << 2) # define DAC_CMP_EN (1 << 3) # define DAC_CMP_OUTPUT (1 << 7) # define DAC_8BIT_EN (1 << 8) # define DAC_TVO_EN (1 << 10) # define DAC_VGA_ADR_EN (1 << 13) # define DAC_PDWN (1 << 15) # define DAC_MASK_ALL (0xff << 24) #define DAC_CNTL2 0x007c # define DAC2_DAC_CLK_SEL (1 << 0) # define DAC2_DAC2_CLK_SEL (1 << 1) # define DAC2_PALETTE_ACC_CTL (1 << 5) #define DAC_EXT_CNTL 0x0280 # define DAC_FORCE_BLANK_OFF_EN (1 << 4) # define DAC_FORCE_DATA_EN (1 << 5) # define DAC_FORCE_DATA_SEL_MASK (3 << 6) # define DAC_FORCE_DATA_MASK 0x0003ff00 # define DAC_FORCE_DATA_SHIFT 8 #define DAC_MACRO_CNTL 0x0d04 # define DAC_PDWN_R (1 << 16) # define DAC_PDWN_G (1 << 17) # define DAC_PDWN_B (1 << 18) #define DISP_HW_DEBUG 0x0d14 # define CRT2_DISP1_SEL (1 << 5) #define DISP_OUTPUT_CNTL 0x0d64 # define DISP_DAC_SOURCE_MASK 0x03 # define DISP_DAC2_SOURCE_MASK 0x0c # define DISP_DAC_SOURCE_CRTC2 0x01 # define DISP_DAC2_SOURCE_CRTC2 0x04 # define DISP_TV_SOURCE (1 << 16) # define DISP_TV_MODE_MASK (3 << 17) # define DISP_TV_MODE_888 (0 << 17) # define DISP_TV_MODE_565 (1 << 17) # define DISP_TV_YG_DITH_EN (1 << 19) # define DISP_TV_CBB_CRR_DITH_EN (1 << 20) # define DISP_TV_BIT_WIDTH (1 << 21) # define DISP_TV_SYNC_MODE_MASK (3 << 22) # define DISP_TV_SYNC_COLOR_MASK (3 << 25) #define DAC_CRC_SIG 0x02cc #define DAC_DATA 0x03c9 /* VGA */ #define DAC_MASK 0x03c6 /* VGA */ #define DAC_R_INDEX 0x03c7 /* VGA */ #define DAC_W_INDEX 0x03c8 /* VGA */ #define DDA_CONFIG 0x02e0 #define DDA_ON_OFF 0x02e4 #define DEFAULT_OFFSET 0x16e0 #define DEFAULT_PITCH 0x16e4 #define DEFAULT_SC_BOTTOM_RIGHT 0x16e8 # define DEFAULT_SC_RIGHT_MAX (0x1fff << 0) # define DEFAULT_SC_BOTTOM_MAX (0x1fff << 16) #define DESTINATION_3D_CLR_CMP_VAL 0x1820 #define DESTINATION_3D_CLR_CMP_MSK 0x1824 #define DISP_MISC_CNTL 0x0d00 # define SOFT_RESET_GRPH_PP (1 << 0) #define DISP_MERGE_CNTL 0x0d60 # define DISP_ALPHA_MODE_MASK 0x03 # define DISP_ALPHA_MODE_KEY 0 # define DISP_ALPHA_MODE_PER_PIXEL 1 # define DISP_ALPHA_MODE_GLOBAL 2 # define DISP_RGB_OFFSET_EN (1<<8) # define DISP_GRPH_ALPHA_MASK (0xff << 16) # define DISP_OV0_ALPHA_MASK (0xff << 24) # define DISP_LIN_TRANS_BYPASS (0x01 << 9) #define DISP2_MERGE_CNTL 0x0d68 # define DISP2_RGB_OFFSET_EN (1<<8) #define DISP_LIN_TRANS_GRPH_A 0x0d80 #define DISP_LIN_TRANS_GRPH_B 0x0d84 #define DISP_LIN_TRANS_GRPH_C 0x0d88 #define DISP_LIN_TRANS_GRPH_D 0x0d8c #define DISP_LIN_TRANS_GRPH_E 0x0d90 #define DISP_LIN_TRANS_GRPH_F 0x0d98 #define DP_BRUSH_BKGD_CLR 0x1478 #define DP_BRUSH_FRGD_CLR 0x147c #define DP_CNTL 0x16c0 # define DST_X_LEFT_TO_RIGHT (1 << 0) # define DST_Y_TOP_TO_BOTTOM (1 << 1) #define DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0 # define DST_Y_MAJOR (1 << 2) # define DST_Y_DIR_TOP_TO_BOTTOM (1 << 15) # define DST_X_DIR_LEFT_TO_RIGHT (1 << 31) #define DP_DATATYPE 0x16c4 # define DST_8BPP 0x00000002 # define DST_15BPP 0x00000003 # define DST_16BPP 0x00000004 # define DST_24BPP 0x00000005 # define DST_32BPP 0x00000006 # define DST_8BPP_RGB332 0x00000007 # define DST_8BPP_Y8 0x00000008 # define DST_8BPP_RGB8 0x00000009 # define DST_16BPP_VYUY422 0x0000000b # define DST_16BPP_YVYU422 0x0000000c # define DST_32BPP_AYUV444 0x0000000e # define DST_16BPP_ARGB4444 0x0000000f # define BRUSH_SOLIDCOLOR 0x00000d00 # define SRC_MONO 0x00000000 # define SRC_MONO_LBKGD 0x00010000 # define SRC_DSTCOLOR 0x00030000 # define BYTE_ORDER_MSB_TO_LSB 0x00000000 # define BYTE_ORDER_LSB_TO_MSB 0x40000000 # define DP_CONVERSION_TEMP 0x80000000 # define HOST_BIG_ENDIAN_EN (1 << 29) #define DP_GUI_MASTER_CNTL 0x146c # define GMC_SRC_PITCH_OFFSET_CNTL (1 << 0) # define GMC_DST_PITCH_OFFSET_CNTL (1 << 1) # define GMC_SRC_CLIPPING (1 << 2) # define GMC_DST_CLIPPING (1 << 3) # define GMC_BRUSH_DATATYPE_MASK (0x0f << 4) # define GMC_BRUSH_8X8_MONO_FG_BG (0 << 4) # define GMC_BRUSH_8X8_MONO_FG_LA (1 << 4) # define GMC_BRUSH_1X8_MONO_FG_BG (4 << 4) # define GMC_BRUSH_1X8_MONO_FG_LA (5 << 4) # define GMC_BRUSH_32x1_MONO_FG_BG (6 << 4) # define GMC_BRUSH_32x1_MONO_FG_LA (7 << 4) # define GMC_BRUSH_32x32_MONO_FG_BG (8 << 4) # define GMC_BRUSH_32x32_MONO_FG_LA (9 << 4) # define GMC_BRUSH_8x8_COLOR (10 << 4) # define GMC_BRUSH_1X8_COLOR (12 << 4) # define GMC_BRUSH_SOLID_COLOR (13 << 4) # define GMC_BRUSH_NONE (15 << 4) # define GMC_DST_8BPP (2 << 8) # define GMC_DST_15BPP (3 << 8) # define GMC_DST_16BPP (4 << 8) # define GMC_DST_24BPP (5 << 8) # define GMC_DST_32BPP (6 << 8) # define GMC_DST_8BPP_RGB (7 << 8) # define GMC_DST_Y8 (8 << 8) # define GMC_DST_RGB8 (9 << 8) # define GMC_DST_VYUY (11 << 8) # define GMC_DST_YVYU (12 << 8) # define GMC_DST_AYUV444 (14 << 8) # define GMC_DST_ARGB4444 (15 << 8) # define GMC_DST_DATATYPE_MASK (0x0f << 8) # define GMC_DST_DATATYPE_SHIFT 8 # define GMC_SRC_DATATYPE_MASK (3 << 12) # define GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12) # define GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12) # define GMC_SRC_DATATYPE_COLOR (3 << 12) # define GMC_BYTE_PIX_ORDER (1 << 14) # define GMC_BYTE_MSB_TO_LSB (0 << 14) # define GMC_BYTE_LSB_TO_MSB (1 << 14) # define GMC_CONVERSION_TEMP (1 << 15) # define GMC_CONVERSION_TEMP_6500 (0 << 15) # define GMC_CONVERSION_TEMP_9300 (1 << 15) # define GMC_ROP3_MASK (0xff << 16) # define GMC_ROP3_PATCOPY 0x00f00000 # define GMC_ROP3_SRCCOPY 0x00cc0000 # define GMC_ROP3_PATXOR 0x005a0000 # define GMC_ROP3_XOR 0x00660000 # define GMC_DP_SRC_SOURCE_MASK (7 << 24) # define GMC_DP_SRC_SOURCE_MEMORY (2 << 24) # define GMC_DP_SRC_SOURCE_HOST_DATA (3 << 24) # define GMC_3D_FCN_EN (1 << 27) # define GMC_CLR_CMP_CNTL_DIS (1 << 28) # define GMC_AUX_CLIP_DIS (1 << 29) # define GMC_WR_MSK_DIS (1 << 30) # define GMC_LD_BRUSH_Y_X (1 << 31) #define DP_GUI_MASTER_CNTL_C 0x1c84 #define DP_MIX 0x16c8 #define DP_SRC_BKGD_CLR 0x15dc #define DP_SRC_FRGD_CLR 0x15d8 #define DP_WRITE_MASK 0x16cc #define DST_BRES_DEC 0x1630 #define DST_BRES_ERR 0x1628 #define DST_BRES_INC 0x162c #define DST_BRES_LNTH 0x1634 #define DST_BRES_LNTH_SUB 0x1638 #define DST_HEIGHT 0x1410 #define DST_HEIGHT_WIDTH 0x143c #define DST_HEIGHT_WIDTH_8 0x158c #define DST_HEIGHT_WIDTH_BW 0x15b4 #define DST_HEIGHT_Y 0x15a0 #define DST_LINE_START 0x1600 #define DST_LINE_END 0x1604 #define DST_LINE_PATCOUNT 0x1608 # define BRES_CNTL_SHIFT 8 #define DST_OFFSET 0x1404 #define DST_PITCH 0x1408 #define DST_PITCH_OFFSET 0x142c #define DST_PITCH_OFFSET_C 0x1c80 # define PITCH_SHIFT 21 # define DST_TILE_LINEAR (0 << 30) # define DST_TILE_MACRO (1 << 30) # define DST_TILE_MICRO (2 << 30) # define DST_TILE_BOTH (3 << 30) #define DST_WIDTH 0x140c #define DST_WIDTH_HEIGHT 0x1598 #define DST_WIDTH_X 0x1588 #define DST_WIDTH_X_INCY 0x159c #define DST_X 0x141c #define DST_X_SUB 0x15a4 #define DST_X_Y 0x1594 #define DST_Y 0x1420 #define DST_Y_SUB 0x15a8 #define DST_Y_X 0x1438 #define FCP_CNTL 0x0910 # define FCP0_SRC_PCICLK 0 # define FCP0_SRC_PCLK 1 # define FCP0_SRC_PCLKb 2 # define FCP0_SRC_HREF 3 # define FCP0_SRC_GND 4 # define FCP0_SRC_HREFb 5 #define FLUSH_1 0x1704 #define FLUSH_2 0x1708 #define FLUSH_3 0x170c #define FLUSH_4 0x1710 #define FLUSH_5 0x1714 #define FLUSH_6 0x1718 #define FLUSH_7 0x171c #define FOG_3D_TABLE_START 0x1810 #define FOG_3D_TABLE_END 0x1814 #define FOG_3D_TABLE_DENSITY 0x181c #define FOG_TABLE_INDEX 0x1a14 #define FOG_TABLE_DATA 0x1a18 #define FP_CRTC_H_TOTAL_DISP 0x0250 #define FP_CRTC_V_TOTAL_DISP 0x0254 #define FP_CRTC2_H_TOTAL_DISP 0x0350 #define FP_CRTC2_V_TOTAL_DISP 0x0354 # define FP_CRTC_H_TOTAL_MASK 0x000003ff # define FP_CRTC_H_DISP_MASK 0x01ff0000 # define FP_CRTC_V_TOTAL_MASK 0x00000fff # define FP_CRTC_V_DISP_MASK 0x0fff0000 # define FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8 # define FP_H_SYNC_WID_MASK 0x003f0000 # define FP_V_SYNC_STRT_MASK 0x00000fff # define FP_V_SYNC_WID_MASK 0x001f0000 # define FP_CRTC_H_TOTAL_SHIFT 0x00000000 # define FP_CRTC_H_DISP_SHIFT 0x00000010 # define FP_CRTC_V_TOTAL_SHIFT 0x00000000 # define FP_CRTC_V_DISP_SHIFT 0x00000010 # define FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003 # define FP_H_SYNC_WID_SHIFT 0x00000010 # define FP_V_SYNC_STRT_SHIFT 0x00000000 # define FP_V_SYNC_WID_SHIFT 0x00000010 #define FP_GEN_CNTL 0x0284 # define FP_FPON (1 << 0) # define FP_BLANK_EN (1 << 1) # define FP_TMDS_EN (1 << 2) # define FP_PANEL_FORMAT (1 << 3) # define FP_EN_TMDS (1 << 7) # define FP_DETECT_SENSE (1 << 8) # define R200_FP_SOURCE_SEL_MASK (3 << 10) # define R200_FP_SOURCE_SEL_CRTC1 (0 << 10) # define R200_FP_SOURCE_SEL_CRTC2 (1 << 10) # define R200_FP_SOURCE_SEL_RMX (2 << 10) # define R200_FP_SOURCE_SEL_TRANS (3 << 10) # define FP_SEL_CRTC1 (0 << 13) # define FP_SEL_CRTC2 (1 << 13) # define FP_CRTC_DONT_SHADOW_HPAR (1 << 15) # define FP_CRTC_DONT_SHADOW_VPAR (1 << 16) # define FP_CRTC_DONT_SHADOW_HEND (1 << 17) # define FP_CRTC_USE_SHADOW_VEND (1 << 18) # define FP_RMX_HVSYNC_CONTROL_EN (1 << 20) # define FP_DFP_SYNC_SEL (1 << 21) # define FP_CRTC_LOCK_8DOT (1 << 22) # define FP_CRT_SYNC_SEL (1 << 23) # define FP_USE_SHADOW_EN (1 << 24) # define FP_CRT_SYNC_ALT (1 << 26) #define FP2_GEN_CNTL 0x0288 # define FP2_BLANK_EN (1 << 1) # define FP2_ON (1 << 2) # define FP2_PANEL_FORMAT (1 << 3) # define R200_FP2_SOURCE_SEL_MASK (3 << 10) # define R200_FP2_SOURCE_SEL_CRTC1 (0 << 10) # define R200_FP2_SOURCE_SEL_CRTC2 (1 << 10) # define R200_FP2_SOURCE_SEL_RMX (2 << 10) # define FP2_SRC_SEL_MASK (3 << 13) # define FP2_SRC_SEL_CRTC2 (1 << 13) # define FP2_FP_POL (1 << 16) # define FP2_LP_POL (1 << 17) # define FP2_SCK_POL (1 << 18) # define FP2_LCD_CNTL_MASK (7 << 19) # define FP2_PAD_FLOP_EN (1 << 22) # define FP2_CRC_EN (1 << 23) # define FP2_CRC_READ_EN (1 << 24) # define FP2_DVO_EN (1 << 25) # define FP2_DVO_RATE_SEL_SDR (1 << 26) #define FP_H_SYNC_STRT_WID 0x02c4 #define FP2_H_SYNC_STRT_WID 0x03c4 #define FP_HORZ_STRETCH 0x028c #define FP_HORZ2_STRETCH 0x038c # define HORZ_STRETCH_RATIO_MASK 0xffff # define HORZ_STRETCH_RATIO_MAX 4096 # define HORZ_PANEL_SIZE (0x1ff << 16) # define HORZ_PANEL_SHIFT 16 # define HORZ_STRETCH_PIXREP (0 << 25) # define HORZ_STRETCH_BLEND (1 << 26) # define HORZ_STRETCH_ENABLE (1 << 25) # define HORZ_AUTO_RATIO (1 << 27) # define HORZ_FP_LOOP_STRETCH (0x7 << 28) # define HORZ_AUTO_RATIO_INC (1 << 31) #define FP_V_SYNC_STRT_WID 0x02c8 #define FP_VERT_STRETCH 0x0290 #define FP2_V_SYNC_STRT_WID 0x03c8 #define FP_VERT2_STRETCH 0x0390 # define VERT_PANEL_SIZE (0xfff << 12) # define VERT_PANEL_SHIFT 12 # define VERT_STRETCH_RATIO_MASK 0xfff # define VERT_STRETCH_RATIO_SHIFT 0 # define VERT_STRETCH_RATIO_MAX 4096 # define VERT_STRETCH_ENABLE (1 << 25) # define VERT_STRETCH_LINEREP (0 << 26) # define VERT_STRETCH_BLEND (1 << 26) # define VERT_AUTO_RATIO_EN (1 << 27) # define VERT_STRETCH_RESERVED 0xf1000000 #define GEN_INT_CNTL 0x0040 #define GEN_INT_STATUS 0x0044 # define VSYNC_INT_AK (1 << 2) # define VSYNC_INT (1 << 2) # define VSYNC2_INT_AK (1 << 6) # define VSYNC2_INT (1 << 6) #define GENENB 0x03c3 /* VGA */ #define GENFC_RD 0x03ca /* VGA */ #define GENFC_WT 0x03da /* VGA, 0x03ba */ #define GENMO_RD 0x03cc /* VGA */ #define GENMO_WT 0x03c2 /* VGA */ #define GENS0 0x03c2 /* VGA */ #define GENS1 0x03da /* VGA, 0x03ba */ #define GPIO_MONID 0x0068 /* DDC interface via I2C */ #define GPIO_MONIDB 0x006c #define GPIO_CRT2_DDC 0x006c #define GPIO_DVI_DDC 0x0064 #define GPIO_VGA_DDC 0x0060 # define GPIO_A_0 (1 << 0) # define GPIO_A_1 (1 << 1) # define GPIO_Y_0 (1 << 8) # define GPIO_Y_1 (1 << 9) # define GPIO_Y_SHIFT_0 8 # define GPIO_Y_SHIFT_1 9 # define GPIO_EN_0 (1 << 16) # define GPIO_EN_1 (1 << 17) # define GPIO_MASK_0 (1 << 24) /*??*/ # define GPIO_MASK_1 (1 << 25) /*??*/ #define GRPH8_DATA 0x03cf /* VGA */ #define GRPH8_IDX 0x03ce /* VGA */ #define GUI_SCRATCH_REG0 0x15e0 #define GUI_SCRATCH_REG1 0x15e4 #define GUI_SCRATCH_REG2 0x15e8 #define GUI_SCRATCH_REG3 0x15ec #define GUI_SCRATCH_REG4 0x15f0 #define GUI_SCRATCH_REG5 0x15f4 #define HEADER 0x0f0e /* PCI */ #define HOST_DATA0 0x17c0 #define HOST_DATA1 0x17c4 #define HOST_DATA2 0x17c8 #define HOST_DATA3 0x17cc #define HOST_DATA4 0x17d0 #define HOST_DATA5 0x17d4 #define HOST_DATA6 0x17d8 #define HOST_DATA7 0x17dc #define HOST_DATA_LAST 0x17e0 #define HOST_PATH_CNTL 0x0130 # define HDP_SOFT_RESET (1 << 26) #define HTOTAL_CNTL 0x0009 /* PLL */ #define HTOTAL2_CNTL 0x002e /* PLL */ #define I2C_CNTL_1 0x0094 /* ? */ #define DVI_I2C_CNTL_1 0x02e4 /* ? */ #define INTERRUPT_LINE 0x0f3c /* PCI */ #define INTERRUPT_PIN 0x0f3d /* PCI */ #define IO_BASE 0x0f14 /* PCI */ #define LATENCY 0x0f0d /* PCI */ #define LEAD_BRES_DEC 0x1608 #define LEAD_BRES_LNTH 0x161c #define LEAD_BRES_LNTH_SUB 0x1624 #define LVDS_GEN_CNTL 0x02d0 # define LVDS_ON (1 << 0) # define LVDS_DISPLAY_DIS (1 << 1) # define LVDS_PANEL_TYPE (1 << 2) # define LVDS_PANEL_FORMAT (1 << 3) # define LVDS_EN (1 << 7) # define LVDS_DIGON (1 << 18) # define LVDS_BLON (1 << 19) # define LVDS_SEL_CRTC2 (1 << 23) #define LVDS_PLL_CNTL 0x02d4 # define HSYNC_DELAY_SHIFT 28 # define HSYNC_DELAY_MASK (0xf << 28) #define MAX_LATENCY 0x0f3f /* PCI */ #define MC_AGP_LOCATION 0x014c #define MC_FB_LOCATION 0x0148 #define CRTC_BASE_ADDR 0x023c #define CRTC2_BASE_ADDR 0x033c #define DISPLAY_TEST_DEBUG_CNTL 0x0d10 #define NB_TOM 0x015c #define MCLK_CNTL 0x0012 /* PLL */ # define FORCEON_MCLKA (1 << 16) # define FORCEON_MCLKB (1 << 17) # define FORCEON_YCLKA (1 << 18) # define FORCEON_YCLKB (1 << 19) # define FORCEON_MC (1 << 20) # define FORCEON_AIC (1 << 21) # define R300_DISABLE_MC_MCLKA (1 << 21) # define R300_DISABLE_MC_MCLKB (1 << 21) #define MCLK_MISC 0x001f /* PLL */ # define MC_MCLK_MAX_DYN_STOP_LAT (1<<12) # define IO_MCLK_MAX_DYN_STOP_LAT (1<<13) # define MC_MCLK_DYN_ENABLE (1 << 14) # define IO_MCLK_DYN_ENABLE (1 << 14) #define MDGPIO_A_REG 0x01ac #define MDGPIO_EN_REG 0x01b0 #define MDGPIO_MASK 0x0198 #define MDGPIO_Y_REG 0x01b4 #define MEM_ADDR_CONFIG 0x0148 #define MEM_BASE 0x0f10 /* PCI */ #define MEM_CNTL 0x0140 # define MEM_NUM_CHANNELS_MASK 0x01 # define MEM_USE_B_CH_ONLY (1<<1) # define RV100_HALF_MODE (1<<3) # define R300_MEM_NUM_CHANNELS_MASK 0x03 # define R300_MEM_USE_CD_CH_ONLY (1<<2) #define MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */ #define MEM_INIT_LAT_TIMER 0x0154 #define MEM_INTF_CNTL 0x014c #define MEM_SDRAM_MODE_REG 0x0158 #define MEM_STR_CNTL 0x0150 #define MEM_VGA_RP_SEL 0x003c #define MEM_VGA_WP_SEL 0x0038 #define MIN_GRANT 0x0f3e /* PCI */ #define MM_DATA 0x0004 #define MM_INDEX 0x0000 #define MPLL_CNTL 0x000e /* PLL */ #define MPP_TB_CONFIG 0x01c0 /* ? */ #define MPP_GP_CONFIG 0x01c8 /* ? */ #define R300_MC_IND_INDEX 0x01f8 # define R300_MC_IND_ADDR_MASK 0x3f #define R300_MC_IND_DATA 0x01fc #define R300_MC_READ_CNTL_AB 0x017c # define R300_MEM_RBS_POSITION_A_MASK 0x03 #define R300_MC_READ_CNTL_CD_mcind 0x24 # define R300_MEM_RBS_POSITION_C_MASK 0x03 #define N_VIF_COUNT 0x0248 /* overlay */ #define OV0_Y_X_START 0x0400 #define OV0_Y_X_END 0x0404 #define OV0_PIPELINE_CNTL 0x0408 #define OV0_EXCLUSIVE_HORZ 0x0408 # define EXCL_HORZ_START_MASK 0x000000ff # define EXCL_HORZ_END_MASK 0x0000ff00 # define EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000 # define EXCL_HORZ_EXCLUSIVE_EN 0x80000000 #define OV0_EXCLUSIVE_VERT 0x040C # define EXCL_VERT_START_MASK 0x000003ff # define EXCL_VERT_END_MASK 0x03ff0000 #define OV0_REG_LOAD_CNTL 0x0410 # define REG_LD_CTL_LOCK 0x00000001 # define REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002 # define REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004 # define REG_LD_CTL_LOCK_READBACK 0x00000008 #define OV0_SCALE_CNTL 0x0420 # define SCALER_PIX_EXPAND 0x00000001 # define SCALER_Y2R_TEMP 0x00000002 # define SCALER_HORZ_PICK_NEAREST 0x00000004 # define SCALER_VERT_PICK_NEAREST 0x00000008 # define SCALER_SIGNED_UV 0x00000010 # define SCALER_GAMMA_SEL_MASK 0x00000060 # define SCALER_GAMMA_SEL_BRIGHT 0x00000000 # define SCALER_GAMMA_SEL_G22 0x00000020 # define SCALER_GAMMA_SEL_G18 0x00000040 # define SCALER_GAMMA_SEL_G14 0x00000060 # define SCALER_COMCORE_SHIFT_UP_ONE 0x00000080 # define SCALER_SURFAC_FORMAT 0x00000f00 # define SCALER_SOURCE_UNK0 0x00000000 /* 2 bpp ??? */ # define SCALER_SOURCE_UNK1 0x00000100 /* 4 bpp ??? */ # define SCALER_SOURCE_UNK2 0x00000200 /* 8 bpp ??? */ # define SCALER_SOURCE_15BPP 0x00000300 # define SCALER_SOURCE_16BPP 0x00000400 /*# define SCALER_SOURCE_24BPP 0x00000500*/ # define SCALER_SOURCE_32BPP 0x00000600 # define SCALER_SOURCE_UNK3 0x00000700 /* 8BPP_RGB332 ??? */ # define SCALER_SOURCE_UNK4 0x00000800 /* 8BPP_Y8 ??? */ # define SCALER_SOURCE_YUV9 0x00000900 /* 8BPP_RGB8 */ # define SCALER_SOURCE_YUV12 0x00000A00 # define SCALER_SOURCE_VYUY422 0x00000B00 # define SCALER_SOURCE_YVYU422 0x00000C00 # define SCALER_SOURCE_UNK5 0x00000D00 /* ??? */ # define SCALER_SOURCE_UNK6 0x00000E00 /* 32BPP_AYUV444 */ # define SCALER_SOURCE_UNK7 0x00000F00 /* 16BPP_ARGB4444 */ # define SCALER_ADAPTIVE_DEINT 0x00001000 # define R200_SCALER_TEMPORAL_DEINT 0x00002000 # define SCALER_UNKNOWN_FLAG1 0x00004000 /* ??? */ # define SCALER_SMART_SWITCH 0x00008000 # define SCALER_BURST_PER_PLANE 0x007f0000 # define SCALER_DOUBLE_BUFFER 0x01000000 # define SCALER_UNKNOWN_FLAG3 0x02000000 /* ??? */ # define SCALER_UNKNOWN_FLAG4 0x04000000 /* ??? */ # define SCALER_DIS_LIMIT 0x08000000 # define SCALER_PRG_LOAD_START 0x10000000 # define SCALER_INT_EMU 0x20000000 # define SCALER_ENABLE 0x40000000 # define SCALER_SOFT_RESET 0x80000000 #define OV0_V_INC 0x0424 #define OV0_P1_V_ACCUM_INIT 0x0428 # define OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003 # define OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000 #define OV0_P23_V_ACCUM_INIT 0x042C # define OV0_P23_MAX_LN_IN_PER_LN_OUT 0x00000003 # define OV0_P23_V_ACCUM_INIT_MASK 0x01ff8000 #define OV0_P1_BLANK_LINES_AT_TOP 0x0430 # define P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fff # define P1_ACTIVE_LINES_M1 0x0fff0000 #define OV0_P23_BLANK_LINES_AT_TOP 0x0434 # define P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ff # define P23_ACTIVE_LINES_M1 0x07ff0000 #define OV0_BASE_ADDR 0x043C #define OV0_VID_BUF0_BASE_ADRS 0x0440 # define VIF_BUF0_PITCH_SEL 0x00000001 # define VIF_BUF0_TILE_ADRS 0x00000002 # define VIF_BUF0_BASE_ADRS_MASK 0xfffffff0 # define VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000 #define OV0_VID_BUF1_BASE_ADRS 0x0444 # define VIF_BUF1_PITCH_SEL 0x00000001 # define VIF_BUF1_TILE_ADRS 0x00000002 # define VIF_BUF1_BASE_ADRS_MASK 0xfffffff0 # define VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000 #define OV0_VID_BUF2_BASE_ADRS 0x0448 # define VIF_BUF2_PITCH_SEL 0x00000001 # define VIF_BUF2_TILE_ADRS 0x00000002 # define VIF_BUF2_BASE_ADRS_MASK 0xfffffff0 # define VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000 #define OV0_VID_BUF3_BASE_ADRS 0x044C # define VIF_BUF3_PITCH_SEL 0x00000001 # define VIF_BUF3_TILE_ADRS 0x00000002 # define VIF_BUF3_BASE_ADRS_MASK 0xfffffff0 # define VIF_BUF3_1ST_LINE_LSBS_MASK 0x48000000 #define OV0_VID_BUF4_BASE_ADRS 0x0450 # define VIF_BUF4_PITCH_SEL 0x00000001 # define VIF_BUF4_TILE_ADRS 0x00000002 # define VIF_BUF4_BASE_ADRS_MASK 0xfffffff0 # define VIF_BUF4_1ST_LINE_LSBS_MASK 0x48000000 #define OV0_VID_BUF5_BASE_ADRS 0x0454 # define VIF_BUF5_PITCH_SEL 0x00000001 # define VIF_BUF5_TILE_ADRS 0x00000002 # define VIF_BUF5_BASE_ADRS_MASK 0xfffffff0 # define VIF_BUF5_1ST_LINE_LSBS_MASK 0x48000000 #define OV0_VID_BUF_PITCH0_VALUE 0x0460 #define OV0_VID_BUF_PITCH1_VALUE 0x0464 #define OV0_AUTO_FLIP_CNTL 0x0470 # define OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM 0x00000007 # define OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD 0x00000008 # define OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD 0x00000010 # define OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020 # define OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE 0x00000040 # define OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT 0x00000300 # define OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN 0x00010000 # define OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN 0x00040000 # define OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN 0x00080000 # define OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE 0x00800000 #define OV0_DEINTERLACE_PATTERN 0x0474 #define OV0_SUBMIT_HISTORY 0x0478 #define OV0_H_INC 0x0480 #define OV0_STEP_BY 0x0484 #define OV0_P1_H_ACCUM_INIT 0x0488 #define OV0_P23_H_ACCUM_INIT 0x048C #define OV0_P1_X_START_END 0x0494 #define OV0_P2_X_START_END 0x0498 #define OV0_P3_X_START_END 0x049C #define OV0_FILTER_CNTL 0x04A0 # define FILTER_PROGRAMMABLE_COEF 0x00000000 # define FILTER_HARD_SCALE_HORZ_Y 0x00000001 # define FILTER_HARD_SCALE_HORZ_UV 0x00000002 # define FILTER_HARD_SCALE_VERT_Y 0x00000004 # define FILTER_HARD_SCALE_VERT_UV 0x00000008 # define FILTER_HARDCODED_COEF 0x0000000F # define FILTER_COEF_MASK 0x0000000F #define OV0_FOUR_TAP_COEF_0 0x04B0 # define OV0_FOUR_TAP_PHASE_0_TAP_0 0x0000000F # define OV0_FOUR_TAP_PHASE_0_TAP_1 0x00007F00 # define OV0_FOUR_TAP_PHASE_0_TAP_2 0x007F0000 # define OV0_FOUR_TAP_PHASE_0_TAP_3 0x0F000000 #define OV0_FOUR_TAP_COEF_1 0x04B4 # define OV0_FOUR_TAP_PHASE_1_5_TAP_0 0x0000000F # define OV0_FOUR_TAP_PHASE_1_5_TAP_1 0x00007F00 # define OV0_FOUR_TAP_PHASE_1_5_TAP_2 0x007F0000 # define OV0_FOUR_TAP_PHASE_1_5_TAP_3 0x0F000000 #define OV0_FOUR_TAP_COEF_2 0x04B8 # define OV0_FOUR_TAP_PHASE_2_6_TAP_0 0x0000000F # define OV0_FOUR_TAP_PHASE_2_6_TAP_1 0x00007F00 # define OV0_FOUR_TAP_PHASE_2_6_TAP_2 0x007F0000 # define OV0_FOUR_TAP_PHASE_2_6_TAP_3 0x0F000000 #define OV0_FOUR_TAP_COEF_3 0x04BC # define OV0_FOUR_TAP_PHASE_3_7_TAP_0 0x0000000F # define OV0_FOUR_TAP_PHASE_3_7_TAP_1 0x00007F00 # define OV0_FOUR_TAP_PHASE_3_7_TAP_2 0x007F0000 # define OV0_FOUR_TAP_PHASE_3_7_TAP_3 0x0F000000 #define OV0_FOUR_TAP_COEF_4 0x04C0 # define OV0_FOUR_TAP_PHASE_4_TAP_0 0x0000000F # define OV0_FOUR_TAP_PHASE_4_TAP_1 0x00007F00 # define OV0_FOUR_TAP_PHASE_4_TAP_2 0x007F0000 # define OV0_FOUR_TAP_PHASE_4_TAP_3 0x0F000000 #define OV0_FLAG_CNTL 0x04DC #define OV0_SLICE_CNTL 0x04E0 # define SLICE_CNTL_DISABLE 0x40000000 #define OV0_VID_KEY_CLR_LOW 0x04E4 #define OV0_VID_KEY_CLR_HIGH 0x04E8 #define OV0_GRPH_KEY_CLR_LOW 0x04EC #define OV0_GRPH_KEY_CLR_HIGH 0x04F0 #define OV0_KEY_CNTL 0x04F4 # define VIDEO_KEY_FN_MASK 0x00000003 # define VIDEO_KEY_FN_FALSE 0x00000000 # define VIDEO_KEY_FN_TRUE 0x00000001 # define VIDEO_KEY_FN_EQ 0x00000002 # define VIDEO_KEY_FN_NE 0x00000003 # define GRAPHIC_KEY_FN_MASK 0x00000030 # define GRAPHIC_KEY_FN_FALSE 0x00000000 # define GRAPHIC_KEY_FN_TRUE 0x00000010 # define GRAPHIC_KEY_FN_EQ 0x00000020 # define GRAPHIC_KEY_FN_NE 0x00000030 # define CMP_MIX_MASK 0x00000100 # define CMP_MIX_OR 0x00000000 # define CMP_MIX_AND 0x00000100 #define OV0_TEST 0x04F8 # define OV0_SCALER_Y2R_DISABLE 0x00000001 # define OV0_SUBPIC_ONLY 0x00000008 # define OV0_EXTENSE 0x00000010 # define OV0_SWAP_UV 0x00000020 #define OV0_COL_CONV 0x04FC # define OV0_CB_TO_B 0x0000007F # define OV0_CB_TO_G 0x0000FF00 # define OV0_CR_TO_G 0x00FF0000 # define OV0_CR_TO_R 0x7F000000 # define OV0_NEW_COL_CONV 0x80000000 #define OV1_Y_X_START 0x0600 #define OV1_Y_X_END 0x0604 #define OV0_LIN_TRANS_A 0x0D20 #define OV0_LIN_TRANS_B 0x0D24 #define OV0_LIN_TRANS_C 0x0D28 #define OV0_LIN_TRANS_D 0x0D2C #define OV0_LIN_TRANS_E 0x0D30 #define OV0_LIN_TRANS_F 0x0D34 #define OV0_GAMMA_000_00F 0x0d40 #define OV0_GAMMA_010_01F 0x0d44 #define OV0_GAMMA_020_03F 0x0d48 #define OV0_GAMMA_040_07F 0x0d4c #define OV0_GAMMA_080_0BF 0x0e00 #define OV0_GAMMA_0C0_0FF 0x0e04 #define OV0_GAMMA_100_13F 0x0e08 #define OV0_GAMMA_140_17F 0x0e0c #define OV0_GAMMA_180_1BF 0x0e10 #define OV0_GAMMA_1C0_1FF 0x0e14 #define OV0_GAMMA_200_23F 0x0e18 #define OV0_GAMMA_240_27F 0x0e1c #define OV0_GAMMA_280_2BF 0x0e20 #define OV0_GAMMA_2C0_2FF 0x0e24 #define OV0_GAMMA_300_33F 0x0e28 #define OV0_GAMMA_340_37F 0x0e2c #define OV0_GAMMA_380_3BF 0x0d50 #define OV0_GAMMA_3C0_3FF 0x0d54 #define OVR_CLR 0x0230 #define OVR_WID_LEFT_RIGHT 0x0234 #define OVR_WID_TOP_BOTTOM 0x0238 /* subpicture */ #define SUBPIC_CNTL 0x0540 #define SUBPIC_DEFCOLCON 0x0544 #define SUBPIC_Y_X_START 0x054C #define SUBPIC_Y_X_END 0x0550 #define SUBPIC_V_INC 0x0554 #define SUBPIC_H_INC 0x0558 #define SUBPIC_BUF0_OFFSET 0x055C #define SUBPIC_BUF1_OFFSET 0x0560 #define SUBPIC_LC0_OFFSET 0x0564 #define SUBPIC_LC1_OFFSET 0x0568 #define SUBPIC_PITCH 0x056C #define SUBPIC_BTN_HLI_COLCON 0x0570 #define SUBPIC_BTN_HLI_Y_X_START 0x0574 #define SUBPIC_BTN_HLI_Y_X_END 0x0578 #define SUBPIC_PALETTE_INDEX 0x057C #define SUBPIC_PALETTE_DATA 0x0580 #define SUBPIC_H_ACCUM_INIT 0x0584 #define SUBPIC_V_ACCUM_INIT 0x0588 #define P2PLL_CNTL 0x002a /* P2PLL */ # define P2PLL_RESET (1 << 0) # define P2PLL_SLEEP (1 << 1) # define P2PLL_ATOMIC_UPDATE_EN (1 << 16) # define P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17) # define P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18) #define P2PLL_DIV_0 0x002c # define P2PLL_FB0_DIV_MASK 0x07ff # define P2PLL_POST0_DIV_MASK 0x00070000 #define P2PLL_REF_DIV 0x002B /* PLL */ # define P2PLL_REF_DIV_MASK 0x03ff # define P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ # define P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ # define R300_PPLL_REF_DIV_ACC_MASK (0x3ff << 18) # define R300_PPLL_REF_DIV_ACC_SHIFT 18 #define PALETTE_DATA 0x00b4 #define PALETTE_30_DATA 0x00b8 #define PALETTE_INDEX 0x00b0 #define PCI_GART_PAGE 0x017c #define PIXCLKS_CNTL 0x002d # define PIX2CLK_SRC_SEL_MASK 0x03 # define PIX2CLK_SRC_SEL_CPUCLK 0x00 # define PIX2CLK_SRC_SEL_PSCANCLK 0x01 # define PIX2CLK_SRC_SEL_BYTECLK 0x02 # define PIX2CLK_SRC_SEL_P2PLLCLK 0x03 # define PIX2CLK_ALWAYS_ONb (1<<6) # define PIX2CLK_DAC_ALWAYS_ONb (1<<7) # define PIXCLK_TV_SRC_SEL (1 << 8) # define DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9) # define R300_DVOCLK_ALWAYS_ONb (1 << 10) # define PIXCLK_BLEND_ALWAYS_ONb (1 << 11) # define PIXCLK_GV_ALWAYS_ONb (1 << 12) # define PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13) # define R300_PIXCLK_DVO_ALWAYS_ONb (1 << 13) # define PIXCLK_LVDS_ALWAYS_ONb (1 << 14) # define PIXCLK_TMDS_ALWAYS_ONb (1 << 15) # define R300_PIXCLK_TRANS_ALWAYS_ONb (1 << 16) # define R300_PIXCLK_TVO_ALWAYS_ONb (1 << 17) # define R300_P2G2CLK_ALWAYS_ONb (1 << 18) # define R300_P2G2CLK_DAC_ALWAYS_ONb (1 << 19) # define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23) #define PLANE_3D_MASK_C 0x1d44 #define PLL_TEST_CNTL 0x0013 /* PLL */ #define PMI_CAP_ID 0x0f5c /* PCI */ #define PMI_DATA 0x0f63 /* PCI */ #define PMI_NXT_CAP_PTR 0x0f5d /* PCI */ #define PMI_PMC_REG 0x0f5e /* PCI */ #define PMI_PMCSR_REG 0x0f60 /* PCI */ #define PMI_REGISTER 0x0f5c /* PCI */ #define PPLL_CNTL 0x0002 /* PLL */ # define PPLL_RESET (1 << 0) # define PPLL_SLEEP (1 << 1) # define PPLL_ATOMIC_UPDATE_EN (1 << 16) # define PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17) # define PPLL_ATOMIC_UPDATE_VSYNC (1 << 18) #define PPLL_DIV_0 0x0004 /* PLL */ #define PPLL_DIV_1 0x0005 /* PLL */ #define PPLL_DIV_2 0x0006 /* PLL */ #define PPLL_DIV_3 0x0007 /* PLL */ # define PPLL_FB3_DIV_MASK 0x07ff # define PPLL_POST3_DIV_MASK 0x00070000 #define PPLL_REF_DIV 0x0003 /* PLL */ # define PPLL_REF_DIV_MASK 0x03ff # define PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ # define PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ #define PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */ /* ERT registers */ #define TV_MASTER_CNTL 0x0800 # define TV_MASTER_TVCLK_ALWAYS_ONb (1 << 30) # define TV_MASTER_TV_ON (1 << 31) #define TV_RGB_CNTL 0x0804 # define TV_RGB_CNTL_INI 0x007b0004 #define TV_SYNC_CNTL 0x0808 #define TV_HTOTAL 0x080c #define TV_HDISP 0x0810 #define TV_HSTART 0x0818 #define TV_HCOUNT 0x081c #define TV_VTOTAL 0x0820 #define TV_VDISP 0x0824 #define TV_VCOUNT 0x0828 #define TV_FTOTAL 0x082c #define TV_FCOUNT 0x0830 #define TV_FRESTART 0x0834 #define TV_HRESTART 0x0838 #define TV_VRESTART 0x083c #define TV_HOST_READ_DATA 0x0840 #define TV_HOST_WRITE_DATA 0x0844 #define TV_HOST_RD_WT_CNTL 0x0848 #define TV_VSCALER_CNTL1 0x084c # define TV_VSCALER_RESTART_FIELD (1 << 29) #define TV_TIMING_CNTL 0x0850 #define TV_VSCALER_CNTL2 0x0854 #define TV_Y_FALL_CNTL 0x0858 #define TV_Y_RISE_CNTL 0x085c #define TV_Y_SAWTOOTH_CNTL 0x0860 #define TV_UPSAMP_AND_GAIN_CNTL 0x0864 #define TV_GAIN_LIMIT_SETTINGS 0x0868 #define TV_LINEAR_GAIN_SETTINGS 0x086c #define TV_MODULATOR_CNTL1 0x0870 #define TV_MODULATOR_CNTL2 0x0874 #define TV_PRE_DAC_MUX_CNTL 0x0888 # define TV_PRE_DAC_Y_RED_EN (1 << 0) # define TV_PRE_DAC_C_GRN_EN (1 << 1) # define TV_PRE_DAC_CMP_BLU_EN (1 << 2) # define TV_PRE_DAC_RED_MX_FORCE_DAC_DATA (6 << 4) # define TV_PRE_DAC_GRN_MX_FORCE_DAC_DATA (6 << 8) # define TV_PRE_DAC_BLU_MX_FORCE_DAC_DATA (6 << 12) # define TV_FORCE_DAC_DATA_SHIFT 16 #define TV_DAC_CNTL 0x088c # define TV_DAC_NBLANK (1 << 0) # define TV_DAC_NHOLD (1 << 1) # define TV_DAC_CMPOUT (1 << 5) # define TV_DAC_BGSLEEP (1 << 6) # define TV_DAC_RDACPD (1 << 24) # define TV_DAC_GDACPD (1 << 25) # define TV_DAC_BDACPD (1 << 26) #define TV_CRC_CNTL 0x0890 #define TV_UV_ADR 0x08ac /* ERT PLL registers */ #define TV_PLL_CNTL 0x21 #define TV_PLL_CNTL1 0x22 # define TV_PLL_CNTL1_TVPLL_RESET (1 << 1) # define TV_PLL_CNTL1_TVPLL_SLEEP (1 << 3) # define TV_PLL_CNTL1_TVPDC_SHIFT 14 # define TV_PLL_CNTL1_TVPDC_MASK (3 << 14) # define TV_PLL_CNTL1_TVCLK_SRC_SEL (1 << 30) #define RBBM_GUICNTL 0x172c # define HOST_DATA_SWAP_NONE (0 << 0) # define HOST_DATA_SWAP_16BIT (1 << 0) # define HOST_DATA_SWAP_32BIT (2 << 0) # define HOST_DATA_SWAP_HDW (3 << 0) #define RBBM_SOFT_RESET 0x00f0 # define SOFT_RESET_CP (1 << 0) # define SOFT_RESET_HI (1 << 1) # define SOFT_RESET_SE (1 << 2) # define SOFT_RESET_RE (1 << 3) # define SOFT_RESET_PP (1 << 4) # define SOFT_RESET_E2 (1 << 5) # define SOFT_RESET_RB (1 << 6) # define SOFT_RESET_HDP (1 << 7) #define RBBM_STATUS 0x0e40 # define RBBM_FIFOCNT_MASK 0x007f # define RBBM_ACTIVE (1 << 31) #define RB2D_DSTCACHE_MODE 0x3428 # define RB2D_DC_CACHE_ENABLE (0) # define RB2D_DC_2D_CACHE_DISABLE (1) # define RB2D_DC_3D_CACHE_DISABLE (2) # define RB2D_DC_CACHE_DISABLE (3) # define RB2D_DC_2D_CACHE_LINESIZE_128 (1 << 2) # define RB2D_DC_3D_CACHE_LINESIZE_128 (2 << 2) # define RB2D_DC_2D_CACHE_AUTOFLUSH (1 << 8) # define RB2D_DC_3D_CACHE_AUTOFLUSH (2 << 8) # define R200_RB2D_DC_2D_CACHE_AUTOFREE (1 << 10) # define R200_RB2D_DC_3D_CACHE_AUTOFREE (2 << 10) # define RB2D_DC_FORCE_RMW (1 << 16) # define R300_RB2D_DC_ENABLE (1 << 17) # define RB2D_DC_DISABLE_RI_FILL (1 << 24) # define RB2D_DC_DISABLE_RI_READ (1 << 25) # define RB2D_DC_DISABLE_MASK_CHK (1 << 26) #define RB2D_DSTCACHE_CTLSTAT 0x342c # define RB2D_DC_FLUSH (3 << 0) # define RB2D_DC_FREE (3 << 2) # define RB2D_DC_FLUSH_ALL 0xf # define RB2D_DC_BUSY (1 << 31) #define RB3D_DSTCACHE_MODE 0x3258 # define RB3D_DC_CACHE_ENABLE (0) # define RB3D_DC_2D_CACHE_DISABLE (1) # define RB3D_DC_3D_CACHE_DISABLE (2) # define RB3D_DC_CACHE_DISABLE (3) # define RB3D_DC_2D_CACHE_LINESIZE_128 (1 << 2) # define RB3D_DC_3D_CACHE_LINESIZE_128 (2 << 2) # define RB3D_DC_2D_CACHE_AUTOFLUSH (1 << 8) # define RB3D_DC_3D_CACHE_AUTOFLUSH (2 << 8) # define R200_RB3D_DC_2D_CACHE_AUTOFREE (1 << 10) # define R200_RB3D_DC_3D_CACHE_AUTOFREE (2 << 10) # define RB3D_DC_FORCE_RMW (1 << 16) # define R300_RB3D_DC_ENABLE (1 << 17) # define RB3D_DC_DISABLE_RI_FILL (1 << 24) # define RB3D_DC_DISABLE_RI_READ (1 << 25) # define RB3D_DC_DISABLE_MASK_CHK (1 << 26) #define RB3D_DSTCACHE_CTLSTAT 0x325C # define RB3D_DC_FLUSH (3 << 0) # define RB3D_DC_FREE (3 << 2) # define RB3D_DC_FLUSH_ALL 0xf # define RB3D_DC_BUSY (1 << 31) #define REG_BASE 0x0f18 /* PCI */ #define REGPROG_INF 0x0f09 /* PCI */ #define REVISION_ID 0x0f08 /* PCI */ #define SC_BOTTOM 0x164c #define SC_BOTTOM_RIGHT 0x16f0 #define SC_BOTTOM_RIGHT_C 0x1c8c #define SC_LEFT 0x1640 #define SC_RIGHT 0x1644 #define SC_TOP 0x1648 #define SC_TOP_LEFT 0x16ec #define SC_TOP_LEFT_C 0x1c88 # define SC_SIGN_MASK_LO 0x8000 # define SC_SIGN_MASK_HI 0x80000000 #define SCLK_CNTL 0x000d /* PLL */ # define SCLK_SRC_SEL_MASK 0x0007 # define DYN_STOP_LAT_MASK 0x00007ff8 # define CP_MAX_DYN_STOP_LAT 0x0008 # define SCLK_FORCEON_MASK 0xffff8000 # define SCLK_FORCE_DISP2 (1<<15) # define SCLK_FORCE_CP (1<<16) # define SCLK_FORCE_HDP (1<<17) # define SCLK_FORCE_DISP1 (1<<18) # define SCLK_FORCE_TOP (1<<19) # define SCLK_FORCE_E2 (1<<20) # define SCLK_FORCE_SE (1<<21) # define SCLK_FORCE_IDCT (1<<22) # define SCLK_FORCE_VIP (1<<23) # define SCLK_FORCE_RE (1<<24) # define SCLK_FORCE_PB (1<<25) # define SCLK_FORCE_TAM (1<<26) # define SCLK_FORCE_TDM (1<<27) # define SCLK_FORCE_RB (1<<28) # define SCLK_FORCE_TV_SCLK (1<<29) # define SCLK_FORCE_SUBPIC (1<<30) # define SCLK_FORCE_OV0 (1<<31) # define R300_SCLK_FORCE_VAP (1<<21) # define R300_SCLK_FORCE_SR (1<<25) # define R300_SCLK_FORCE_PX (1<<26) # define R300_SCLK_FORCE_TX (1<<27) # define R300_SCLK_FORCE_US (1<<28) # define R300_SCLK_FORCE_SU (1<<30) #define R300_SCLK_CNTL2 0x1e /* PLL */ # define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10) # define R300_SCLK_GA_MAX_DYN_STOP_LAT (1<<11) # define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12) # define R300_SCLK_FORCE_TCL (1<<13) # define R300_SCLK_FORCE_CBA (1<<14) # define R300_SCLK_FORCE_GA (1<<15) #define SCLK_MORE_CNTL 0x0035 /* PLL */ # define SCLK_MORE_MAX_DYN_STOP_LAT 0x0007 # define SCLK_MORE_FORCEON 0x0700 #define SDRAM_MODE_REG 0x0158 #define SEQ8_DATA 0x03c5 /* VGA */ #define SEQ8_IDX 0x03c4 /* VGA */ #define SNAPSHOT_F_COUNT 0x0244 #define SNAPSHOT_VH_COUNTS 0x0240 #define SNAPSHOT_VIF_COUNT 0x024c #define SRC_OFFSET 0x15ac #define SRC_PITCH 0x15b0 #define SRC_PITCH_OFFSET 0x1428 #define SRC_SC_BOTTOM 0x165c #define SRC_SC_BOTTOM_RIGHT 0x16f4 #define SRC_SC_RIGHT 0x1654 #define SRC_X 0x1414 #define SRC_X_Y 0x1590 #define SRC_Y 0x1418 #define SRC_Y_X 0x1434 #define STATUS 0x0f06 /* PCI */ #define SUB_CLASS 0x0f0a /* PCI */ #define SURFACE_CNTL 0x0b00 # define SURF_TRANSLATION_DIS (1 << 8) # define NONSURF_AP0_SWP_16BPP (1 << 20) # define NONSURF_AP0_SWP_32BPP (1 << 21) # define NONSURF_AP1_SWP_16BPP (1 << 22) # define NONSURF_AP1_SWP_32BPP (1 << 23) #define SURFACE0_INFO 0x0b0c #define SURFACE0_LOWER_BOUND 0x0b04 #define SURFACE0_UPPER_BOUND 0x0b08 #define SURFACE1_INFO 0x0b1c #define SURFACE1_LOWER_BOUND 0x0b14 #define SURFACE1_UPPER_BOUND 0x0b18 #define SURFACE2_INFO 0x0b2c #define SURFACE2_LOWER_BOUND 0x0b24 #define SURFACE2_UPPER_BOUND 0x0b28 #define SURFACE3_INFO 0x0b3c #define SURFACE3_LOWER_BOUND 0x0b34 #define SURFACE3_UPPER_BOUND 0x0b38 #define SURFACE4_INFO 0x0b4c #define SURFACE4_LOWER_BOUND 0x0b44 #define SURFACE4_UPPER_BOUND 0x0b48 #define SURFACE5_INFO 0x0b5c #define SURFACE5_LOWER_BOUND 0x0b54 #define SURFACE5_UPPER_BOUND 0x0b58 #define SURFACE6_INFO 0x0b6c #define SURFACE6_LOWER_BOUND 0x0b64 #define SURFACE6_UPPER_BOUND 0x0b68 #define SURFACE7_INFO 0x0b7c #define SURFACE7_LOWER_BOUND 0x0b74 #define SURFACE7_UPPER_BOUND 0x0b78 #define SW_SEMAPHORE 0x013c #define TEST_DEBUG_CNTL 0x0120 #define TEST_DEBUG_MUX 0x0124 #define TEST_DEBUG_OUT 0x012c #define TMDS_PLL_CNTL 0x02a8 #define TMDS_TRANSMITTER_CNTL 0x02a4 # define TMDS_TRANSMITTER_PLLEN 1 # define TMDS_TRANSMITTER_PLLRST 2 #define TRAIL_BRES_DEC 0x1614 #define TRAIL_BRES_ERR 0x160c #define TRAIL_BRES_INC 0x1610 #define TRAIL_X 0x1618 #define TRAIL_X_SUB 0x1620 #define VCLK_ECP_CNTL 0x0008 /* PLL */ # define VCLK_SRC_SEL_MASK 0x03 # define VCLK_SRC_SEL_CPUCLK 0x00 # define VCLK_SRC_SEL_PSCANCLK 0x01 # define VCLK_SRC_SEL_BYTECLK 0x02 # define VCLK_SRC_SEL_PPLLCLK 0x03 # define PIXCLK_ALWAYS_ONb (1<<6) # define PIXCLK_DAC_ALWAYS_ONb (1<<7) # define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23) #define VGA_DDA_CONFIG 0x02e8 #define VGA_DDA_ON_OFF 0x02ec #define VID_BUFFER_CONTROL 0x0900 #define VIDEOMUX_CNTL 0x0190 #define VIPH_CONTROL 0x0c40 /* ? */ #define WAIT_UNTIL 0x1720 # define WAIT_CRTC_PFLIP (1 << 0) # define R300_WAIT_2D_IDLE (1 << 0) # define R300_WAIT_3D_IDLE (2 << 0) # define R300_WAIT_2D_IDLECLEAN (3 << 0) # define R300_WAIT_3D_IDLECLEAN (4 << 0) # define WAIT_2D_IDLE (1 << 14) # define WAIT_3D_IDLE (1 << 15) # define WAIT_2D_IDLECLEAN (1 << 16) # define WAIT_3D_IDLECLEAN (1 << 17) # define WAIT_HOST_IDLECLEAN (1 << 18) #define ISYNC_CNTL 0x1724 # define ISYNC_ANY2D_IDLE3D (1 << 0) # define ISYNC_ANY3D_IDLE2D (1 << 1) # define ISYNC_TRIG2D_IDLE3D (1 << 2) # define ISYNC_TRIG3D_IDLE2D (1 << 3) # define ISYNC_WAIT_IDLEGUI (1 << 4) # define ISYNC_CPSCRATCH_IDLEGUI (1 << 5) #define X_MPLL_REF_FB_DIV 0x000a /* PLL */ #define XCLK_CNTL 0x000d /* PLL */ #define XDLL_CNTL 0x000c /* PLL */ #define XPLL_CNTL 0x000b /* PLL */ /* Registers for 3D/TCL */ #define PP_BORDER_COLOR_0 0x1d40 #define PP_BORDER_COLOR_1 0x1d44 #define PP_BORDER_COLOR_2 0x1d48 #define PP_CNTL 0x1c38 # define STIPPLE_ENABLE (1 << 0) # define SCISSOR_ENABLE (1 << 1) # define PATTERN_ENABLE (1 << 2) # define SHADOW_ENABLE (1 << 3) # define TEX_ENABLE_MASK (0xf << 4) # define TEX_0_ENABLE (1 << 4) # define TEX_1_ENABLE (1 << 5) # define TEX_2_ENABLE (1 << 6) # define TEX_3_ENABLE (1 << 7) # define TEX_BLEND_ENABLE_MASK (0xf << 12) # define TEX_BLEND_0_ENABLE (1 << 12) # define TEX_BLEND_1_ENABLE (1 << 13) # define TEX_BLEND_2_ENABLE (1 << 14) # define TEX_BLEND_3_ENABLE (1 << 15) # define PLANAR_YUV_ENABLE (1 << 20) # define SPECULAR_ENABLE (1 << 21) # define FOG_ENABLE (1 << 22) # define ALPHA_TEST_ENABLE (1 << 23) # define ANTI_ALIAS_NONE (0 << 24) # define ANTI_ALIAS_LINE (1 << 24) # define ANTI_ALIAS_POLY (2 << 24) # define ANTI_ALIAS_LINE_POLY (3 << 24) # define BUMP_MAP_ENABLE (1 << 26) # define BUMPED_MAP_T0 (0 << 27) # define BUMPED_MAP_T1 (1 << 27) # define BUMPED_MAP_T2 (2 << 27) # define TEX_3D_ENABLE_0 (1 << 29) # define TEX_3D_ENABLE_1 (1 << 30) # define MC_ENABLE (1 << 31) #define PP_FOG_COLOR 0x1c18 # define FOG_COLOR_MASK 0x00ffffff # define FOG_VERTEX (0 << 24) # define FOG_TABLE (1 << 24) # define FOG_USE_DEPTH (0 << 25) # define FOG_USE_DIFFUSE_ALPHA (2 << 25) # define FOG_USE_SPEC_ALPHA (3 << 25) #define PP_LUM_MATRIX 0x1d00 #define PP_MISC 0x1c14 # define REF_ALPHA_MASK 0x000000ff # define ALPHA_TEST_FAIL (0 << 8) # define ALPHA_TEST_LESS (1 << 8) # define ALPHA_TEST_LEQUAL (2 << 8) # define ALPHA_TEST_EQUAL (3 << 8) # define ALPHA_TEST_GEQUAL (4 << 8) # define ALPHA_TEST_GREATER (5 << 8) # define ALPHA_TEST_NEQUAL (6 << 8) # define ALPHA_TEST_PASS (7 << 8) # define ALPHA_TEST_OP_MASK (7 << 8) # define CHROMA_FUNC_FAIL (0 << 16) # define CHROMA_FUNC_PASS (1 << 16) # define CHROMA_FUNC_NEQUAL (2 << 16) # define CHROMA_FUNC_EQUAL (3 << 16) # define CHROMA_KEY_NEAREST (0 << 18) # define CHROMA_KEY_ZERO (1 << 18) # define SHADOW_ID_AUTO_INC (1 << 20) # define SHADOW_FUNC_EQUAL (0 << 21) # define SHADOW_FUNC_NEQUAL (1 << 21) # define SHADOW_PASS_1 (0 << 22) # define SHADOW_PASS_2 (1 << 22) # define RIGHT_HAND_CUBE_D3D (0 << 24) # define RIGHT_HAND_CUBE_OGL (1 << 24) #define PP_ROT_MATRIX_0 0x1d58 #define PP_ROT_MATRIX_1 0x1d5c #define PP_TXFILTER_0 0x1c54 #define PP_TXFILTER_1 0x1c6c #define PP_TXFILTER_2 0x1c84 # define MAG_FILTER_NEAREST (0 << 0) # define MAG_FILTER_LINEAR (1 << 0) # define MAG_FILTER_MASK (1 << 0) # define MIN_FILTER_NEAREST (0 << 1) # define MIN_FILTER_LINEAR (1 << 1) # define MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) # define MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) # define MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) # define MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) # define MIN_FILTER_ANISO_NEAREST (8 << 1) # define MIN_FILTER_ANISO_LINEAR (9 << 1) # define MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) # define MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) # define MIN_FILTER_MASK (15 << 1) # define MAX_ANISO_1_TO_1 (0 << 5) # define MAX_ANISO_2_TO_1 (1 << 5) # define MAX_ANISO_4_TO_1 (2 << 5) # define MAX_ANISO_8_TO_1 (3 << 5) # define MAX_ANISO_16_TO_1 (4 << 5) # define MAX_ANISO_MASK (7 << 5) # define LOD_BIAS_MASK (0xff << 8) # define LOD_BIAS_SHIFT 8 # define MAX_MIP_LEVEL_MASK (0x0f << 16) # define MAX_MIP_LEVEL_SHIFT 16 # define YUV_TO_RGB (1 << 20) # define YUV_TEMPERATURE_COOL (0 << 21) # define YUV_TEMPERATURE_HOT (1 << 21) # define YUV_TEMPERATURE_MASK (1 << 21) # define WRAPEN_S (1 << 22) # define CLAMP_S_WRAP (0 << 23) # define CLAMP_S_MIRROR (1 << 23) # define CLAMP_S_CLAMP_LAST (2 << 23) # define CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) # define CLAMP_S_CLAMP_BORDER (4 << 23) # define CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) # define CLAMP_S_CLAMP_GL (6 << 23) # define CLAMP_S_MIRROR_CLAMP_GL (7 << 23) # define CLAMP_S_MASK (7 << 23) # define WRAPEN_T (1 << 26) # define CLAMP_T_WRAP (0 << 27) # define CLAMP_T_MIRROR (1 << 27) # define CLAMP_T_CLAMP_LAST (2 << 27) # define CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) # define CLAMP_T_CLAMP_BORDER (4 << 27) # define CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) # define CLAMP_T_CLAMP_GL (6 << 27) # define CLAMP_T_MIRROR_CLAMP_GL (7 << 27) # define CLAMP_T_MASK (7 << 27) # define BORDER_MODE_OGL (0 << 31) # define BORDER_MODE_D3D (1 << 31) #define PP_TXFORMAT_0 0x1c58 #define PP_TXFORMAT_1 0x1c70 #define PP_TXFORMAT_2 0x1c88 # define TXFORMAT_I8 (0 << 0) # define TXFORMAT_AI88 (1 << 0) # define TXFORMAT_RGB332 (2 << 0) # define TXFORMAT_ARGB1555 (3 << 0) # define TXFORMAT_RGB565 (4 << 0) # define TXFORMAT_ARGB4444 (5 << 0) # define TXFORMAT_ARGB8888 (6 << 0) # define TXFORMAT_RGBA8888 (7 << 0) # define TXFORMAT_Y8 (8 << 0) # define TXFORMAT_VYUY422 (10 << 0) # define TXFORMAT_YVYU422 (11 << 0) # define TXFORMAT_DXT1 (12 << 0) # define TXFORMAT_DXT23 (14 << 0) # define TXFORMAT_DXT45 (15 << 0) # define TXFORMAT_FORMAT_MASK (31 << 0) # define TXFORMAT_FORMAT_SHIFT 0 # define TXFORMAT_APPLE_YUV_MODE (1 << 5) # define TXFORMAT_ALPHA_IN_MAP (1 << 6) # define TXFORMAT_NON_POWER2 (1 << 7) # define TXFORMAT_WIDTH_MASK (15 << 8) # define TXFORMAT_WIDTH_SHIFT 8 # define TXFORMAT_HEIGHT_MASK (15 << 12) # define TXFORMAT_HEIGHT_SHIFT 12 # define TXFORMAT_F5_WIDTH_MASK (15 << 16) # define TXFORMAT_F5_WIDTH_SHIFT 16 # define TXFORMAT_F5_HEIGHT_MASK (15 << 20) # define TXFORMAT_F5_HEIGHT_SHIFT 20 # define TXFORMAT_ST_ROUTE_STQ0 (0 << 24) # define TXFORMAT_ST_ROUTE_MASK (3 << 24) # define TXFORMAT_ST_ROUTE_STQ1 (1 << 24) # define TXFORMAT_ST_ROUTE_STQ2 (2 << 24) # define TXFORMAT_ENDIAN_NO_SWAP (0 << 26) # define TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26) # define TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26) # define TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26) # define TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) # define TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) # define TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) # define TXFORMAT_PERSPECTIVE_ENABLE (1 << 31) #define PP_CUBIC_FACES_0 0x1d24 #define PP_CUBIC_FACES_1 0x1d28 #define PP_CUBIC_FACES_2 0x1d2c # define FACE_WIDTH_1_SHIFT 0 # define FACE_HEIGHT_1_SHIFT 4 # define FACE_WIDTH_1_MASK (0xf << 0) # define FACE_HEIGHT_1_MASK (0xf << 4) # define FACE_WIDTH_2_SHIFT 8 # define FACE_HEIGHT_2_SHIFT 12 # define FACE_WIDTH_2_MASK (0xf << 8) # define FACE_HEIGHT_2_MASK (0xf << 12) # define FACE_WIDTH_3_SHIFT 16 # define FACE_HEIGHT_3_SHIFT 20 # define FACE_WIDTH_3_MASK (0xf << 16) # define FACE_HEIGHT_3_MASK (0xf << 20) # define FACE_WIDTH_4_SHIFT 24 # define FACE_HEIGHT_4_SHIFT 28 # define FACE_WIDTH_4_MASK (0xf << 24) # define FACE_HEIGHT_4_MASK (0xf << 28) #define PP_TXOFFSET_0 0x1c5c #define PP_TXOFFSET_1 0x1c74 #define PP_TXOFFSET_2 0x1c8c # define TXO_ENDIAN_NO_SWAP (0 << 0) # define TXO_ENDIAN_BYTE_SWAP (1 << 0) # define TXO_ENDIAN_WORD_SWAP (2 << 0) # define TXO_ENDIAN_HALFDW_SWAP (3 << 0) # define TXO_MACRO_LINEAR (0 << 2) # define TXO_MACRO_TILE (1 << 2) # define TXO_MICRO_LINEAR (0 << 3) # define TXO_MICRO_TILE_X2 (1 << 3) # define TXO_MICRO_TILE_OPT (2 << 3) # define TXO_OFFSET_MASK 0xffffffe0 # define TXO_OFFSET_SHIFT 5 #define PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */ #define PP_CUBIC_OFFSET_T0_1 0x1dd4 #define PP_CUBIC_OFFSET_T0_2 0x1dd8 #define PP_CUBIC_OFFSET_T0_3 0x1ddc #define PP_CUBIC_OFFSET_T0_4 0x1de0 #define PP_CUBIC_OFFSET_T1_0 0x1e00 #define PP_CUBIC_OFFSET_T1_1 0x1e04 #define PP_CUBIC_OFFSET_T1_2 0x1e08 #define PP_CUBIC_OFFSET_T1_3 0x1e0c #define PP_CUBIC_OFFSET_T1_4 0x1e10 #define PP_CUBIC_OFFSET_T2_0 0x1e14 #define PP_CUBIC_OFFSET_T2_1 0x1e18 #define PP_CUBIC_OFFSET_T2_2 0x1e1c #define PP_CUBIC_OFFSET_T2_3 0x1e20 #define PP_CUBIC_OFFSET_T2_4 0x1e24 #define PP_TEX_SIZE_0 0x1d04 /* NPOT */ #define PP_TEX_SIZE_1 0x1d0c #define PP_TEX_SIZE_2 0x1d14 # define TEX_USIZE_MASK (0x7ff << 0) # define TEX_USIZE_SHIFT 0 # define TEX_VSIZE_MASK (0x7ff << 16) # define TEX_VSIZE_SHIFT 16 # define SIGNED_RGB_MASK (1 << 30) # define SIGNED_RGB_SHIFT 30 # define SIGNED_ALPHA_MASK (1 << 31) # define SIGNED_ALPHA_SHIFT 31 #define PP_TEX_PITCH_0 0x1d08 /* NPOT */ #define PP_TEX_PITCH_1 0x1d10 /* NPOT */ #define PP_TEX_PITCH_2 0x1d18 /* NPOT */ /* note: bits 13-5: 32 byte aligned stride of texture map */ #define PP_TXCBLEND_0 0x1c60 #define PP_TXCBLEND_1 0x1c78 #define PP_TXCBLEND_2 0x1c90 # define COLOR_ARG_A_SHIFT 0 # define COLOR_ARG_A_MASK (0x1f << 0) # define COLOR_ARG_A_ZERO (0 << 0) # define COLOR_ARG_A_CURRENT_COLOR (2 << 0) # define COLOR_ARG_A_CURRENT_ALPHA (3 << 0) # define COLOR_ARG_A_DIFFUSE_COLOR (4 << 0) # define COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0) # define COLOR_ARG_A_SPECULAR_COLOR (6 << 0) # define COLOR_ARG_A_SPECULAR_ALPHA (7 << 0) # define COLOR_ARG_A_TFACTOR_COLOR (8 << 0) # define COLOR_ARG_A_TFACTOR_ALPHA (9 << 0) # define COLOR_ARG_A_T0_COLOR (10 << 0) # define COLOR_ARG_A_T0_ALPHA (11 << 0) # define COLOR_ARG_A_T1_COLOR (12 << 0) # define COLOR_ARG_A_T1_ALPHA (13 << 0) # define COLOR_ARG_A_T2_COLOR (14 << 0) # define COLOR_ARG_A_T2_ALPHA (15 << 0) # define COLOR_ARG_A_T3_COLOR (16 << 0) # define COLOR_ARG_A_T3_ALPHA (17 << 0) # define COLOR_ARG_B_SHIFT 5 # define COLOR_ARG_B_MASK (0x1f << 5) # define COLOR_ARG_B_ZERO (0 << 5) # define COLOR_ARG_B_CURRENT_COLOR (2 << 5) # define COLOR_ARG_B_CURRENT_ALPHA (3 << 5) # define COLOR_ARG_B_DIFFUSE_COLOR (4 << 5) # define COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5) # define COLOR_ARG_B_SPECULAR_COLOR (6 << 5) # define COLOR_ARG_B_SPECULAR_ALPHA (7 << 5) # define COLOR_ARG_B_TFACTOR_COLOR (8 << 5) # define COLOR_ARG_B_TFACTOR_ALPHA (9 << 5) # define COLOR_ARG_B_T0_COLOR (10 << 5) # define COLOR_ARG_B_T0_ALPHA (11 << 5) # define COLOR_ARG_B_T1_COLOR (12 << 5) # define COLOR_ARG_B_T1_ALPHA (13 << 5) # define COLOR_ARG_B_T2_COLOR (14 << 5) # define COLOR_ARG_B_T2_ALPHA (15 << 5) # define COLOR_ARG_B_T3_COLOR (16 << 5) # define COLOR_ARG_B_T3_ALPHA (17 << 5) # define COLOR_ARG_C_SHIFT 10 # define COLOR_ARG_C_MASK (0x1f << 10) # define COLOR_ARG_C_ZERO (0 << 10) # define COLOR_ARG_C_CURRENT_COLOR (2 << 10) # define COLOR_ARG_C_CURRENT_ALPHA (3 << 10) # define COLOR_ARG_C_DIFFUSE_COLOR (4 << 10) # define COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10) # define COLOR_ARG_C_SPECULAR_COLOR (6 << 10) # define COLOR_ARG_C_SPECULAR_ALPHA (7 << 10) # define COLOR_ARG_C_TFACTOR_COLOR (8 << 10) # define COLOR_ARG_C_TFACTOR_ALPHA (9 << 10) # define COLOR_ARG_C_T0_COLOR (10 << 10) # define COLOR_ARG_C_T0_ALPHA (11 << 10) # define COLOR_ARG_C_T1_COLOR (12 << 10) # define COLOR_ARG_C_T1_ALPHA (13 << 10) # define COLOR_ARG_C_T2_COLOR (14 << 10) # define COLOR_ARG_C_T2_ALPHA (15 << 10) # define COLOR_ARG_C_T3_COLOR (16 << 10) # define COLOR_ARG_C_T3_ALPHA (17 << 10) # define COMP_ARG_A (1 << 15) # define COMP_ARG_A_SHIFT 15 # define COMP_ARG_B (1 << 16) # define COMP_ARG_B_SHIFT 16 # define COMP_ARG_C (1 << 17) # define COMP_ARG_C_SHIFT 17 # define BLEND_CTL_MASK (7 << 18) # define BLEND_CTL_ADD (0 << 18) # define BLEND_CTL_SUBTRACT (1 << 18) # define BLEND_CTL_ADDSIGNED (2 << 18) # define BLEND_CTL_BLEND (3 << 18) # define BLEND_CTL_DOT3 (4 << 18) # define SCALE_SHIFT 21 # define SCALE_MASK (3 << 21) # define SCALE_1X (0 << 21) # define SCALE_2X (1 << 21) # define SCALE_4X (2 << 21) # define CLAMP_TX (1 << 23) # define T0_EQ_TCUR (1 << 24) # define T1_EQ_TCUR (1 << 25) # define T2_EQ_TCUR (1 << 26) # define T3_EQ_TCUR (1 << 27) # define COLOR_ARG_MASK 0x1f # define COMP_ARG_SHIFT 15 #define PP_TXABLEND_0 0x1c64 #define PP_TXABLEND_1 0x1c7c #define PP_TXABLEND_2 0x1c94 # define ALPHA_ARG_A_SHIFT 0 # define ALPHA_ARG_A_MASK (0xf << 0) # define ALPHA_ARG_A_ZERO (0 << 0) # define ALPHA_ARG_A_CURRENT_ALPHA (1 << 0) # define ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0) # define ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0) # define ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0) # define ALPHA_ARG_A_T0_ALPHA (5 << 0) # define ALPHA_ARG_A_T1_ALPHA (6 << 0) # define ALPHA_ARG_A_T2_ALPHA (7 << 0) # define ALPHA_ARG_A_T3_ALPHA (8 << 0) # define ALPHA_ARG_B_SHIFT 4 # define ALPHA_ARG_B_MASK (0xf << 4) # define ALPHA_ARG_B_ZERO (0 << 4) # define ALPHA_ARG_B_CURRENT_ALPHA (1 << 4) # define ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4) # define ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4) # define ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4) # define ALPHA_ARG_B_T0_ALPHA (5 << 4) # define ALPHA_ARG_B_T1_ALPHA (6 << 4) # define ALPHA_ARG_B_T2_ALPHA (7 << 4) # define ALPHA_ARG_B_T3_ALPHA (8 << 4) # define ALPHA_ARG_C_SHIFT 8 # define ALPHA_ARG_C_MASK (0xf << 8) # define ALPHA_ARG_C_ZERO (0 << 8) # define ALPHA_ARG_C_CURRENT_ALPHA (1 << 8) # define ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8) # define ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8) # define ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8) # define ALPHA_ARG_C_T0_ALPHA (5 << 8) # define ALPHA_ARG_C_T1_ALPHA (6 << 8) # define ALPHA_ARG_C_T2_ALPHA (7 << 8) # define ALPHA_ARG_C_T3_ALPHA (8 << 8) # define DOT_ALPHA_DONT_REPLICATE (1 << 9) # define ALPHA_ARG_MASK 0xf #define PP_TFACTOR_0 0x1c68 #define PP_TFACTOR_1 0x1c80 #define PP_TFACTOR_2 0x1c98 #define RB3D_BLENDCNTL 0x1c20 # define COMB_FCN_MASK (3 << 12) # define COMB_FCN_ADD_CLAMP (0 << 12) # define COMB_FCN_ADD_NOCLAMP (1 << 12) # define COMB_FCN_SUB_CLAMP (2 << 12) # define COMB_FCN_SUB_NOCLAMP (3 << 12) # define SRC_BLEND_GL_ZERO (32 << 16) # define SRC_BLEND_GL_ONE (33 << 16) # define SRC_BLEND_GL_SRC_COLOR (34 << 16) # define SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16) # define SRC_BLEND_GL_DST_COLOR (36 << 16) # define SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16) # define SRC_BLEND_GL_SRC_ALPHA (38 << 16) # define SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16) # define SRC_BLEND_GL_DST_ALPHA (40 << 16) # define SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16) # define SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16) # define SRC_BLEND_MASK (63 << 16) # define DST_BLEND_GL_ZERO (32 << 24) # define DST_BLEND_GL_ONE (33 << 24) # define DST_BLEND_GL_SRC_COLOR (34 << 24) # define DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24) # define DST_BLEND_GL_DST_COLOR (36 << 24) # define DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24) # define DST_BLEND_GL_SRC_ALPHA (38 << 24) # define DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24) # define DST_BLEND_GL_DST_ALPHA (40 << 24) # define DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24) # define DST_BLEND_MASK (63 << 24) #define RB3D_CNTL 0x1c3c # define ALPHA_BLEND_ENABLE (1 << 0) # define PLANE_MASK_ENABLE (1 << 1) # define DITHER_ENABLE (1 << 2) # define ROUND_ENABLE (1 << 3) # define SCALE_DITHER_ENABLE (1 << 4) # define DITHER_INIT (1 << 5) # define ROP_ENABLE (1 << 6) # define STENCIL_ENABLE (1 << 7) # define Z_ENABLE (1 << 8) # define DEPTH_XZ_OFFEST_ENABLE (1 << 9) # define COLOR_FORMAT_ARGB1555 (3 << 10) # define COLOR_FORMAT_RGB565 (4 << 10) # define COLOR_FORMAT_ARGB8888 (6 << 10) # define COLOR_FORMAT_RGB332 (7 << 10) # define COLOR_FORMAT_Y8 (8 << 10) # define COLOR_FORMAT_RGB8 (9 << 10) # define COLOR_FORMAT_YUV422_VYUY (11 << 10) # define COLOR_FORMAT_YUV422_YVYU (12 << 10) # define COLOR_FORMAT_AVYU (14 << 10) # define COLOR_FORMAT_ARGB4444 (15 << 10) # define CLRCMP_FLIP_ENABLE (1 << 14) # define SEPARATE_ALPHA_ENABLE (1 << 16) #define RB3D_COLOROFFSET 0x1c40 # define COLOROFFSET_MASK 0xfffffff0 #define RB3D_COLORPITCH 0x1c48 # define COLORPITCH_MASK 0x000001ff8 # define COLOR_TILE_ENABLE (1 << 16) # define COLOR_MICROTILE_ENABLE (1 << 17) # define COLOR_ENDIAN_NO_SWAP (0 << 18) # define COLOR_ENDIAN_WORD_SWAP (1 << 18) # define COLOR_ENDIAN_DWORD_SWAP (2 << 18) #define RB3D_DEPTHOFFSET 0x1c24 #define RB3D_DEPTHPITCH 0x1c28 # define DEPTHPITCH_MASK 0x00001ff8 # define DEPTH_ENDIAN_NO_SWAP (0 << 18) # define DEPTH_ENDIAN_WORD_SWAP (1 << 18) # define DEPTH_ENDIAN_DWORD_SWAP (2 << 18) #define RB3D_PLANEMASK 0x1d84 #define RB3D_ROPCNTL 0x1d80 # define ROP_MASK (15 << 8) # define ROP_CLEAR (0 << 8) # define ROP_NOR (1 << 8) # define ROP_AND_INVERTED (2 << 8) # define ROP_COPY_INVERTED (3 << 8) # define ROP_AND_REVERSE (4 << 8) # define ROP_INVERT (5 << 8) # define ROP_XOR (6 << 8) # define ROP_NAND (7 << 8) # define ROP_AND (8 << 8) # define ROP_EQUIV (9 << 8) # define ROP_NOOP (10 << 8) # define ROP_OR_INVERTED (11 << 8) # define ROP_COPY (12 << 8) # define ROP_OR_REVERSE (13 << 8) # define ROP_OR (14 << 8) # define ROP_SET (15 << 8) #define RB3D_STENCILREFMASK 0x1d7c # define STENCIL_REF_SHIFT 0 # define STENCIL_REF_MASK (0xff << 0) # define STENCIL_MASK_SHIFT 16 # define STENCIL_VALUE_MASK (0xff << 16) # define STENCIL_WRITEMASK_SHIFT 24 # define STENCIL_WRITE_MASK (0xff << 24) #define RB3D_ZSTENCILCNTL 0x1c2c # define DEPTH_FORMAT_MASK (0xf << 0) # define DEPTH_FORMAT_16BIT_INT_Z (0 << 0) # define DEPTH_FORMAT_24BIT_INT_Z (2 << 0) # define DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0) # define DEPTH_FORMAT_32BIT_INT_Z (4 << 0) # define DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0) # define DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0) # define DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0) # define DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0) # define Z_TEST_NEVER (0 << 4) # define Z_TEST_LESS (1 << 4) # define Z_TEST_LEQUAL (2 << 4) # define Z_TEST_EQUAL (3 << 4) # define Z_TEST_GEQUAL (4 << 4) # define Z_TEST_GREATER (5 << 4) # define Z_TEST_NEQUAL (6 << 4) # define Z_TEST_ALWAYS (7 << 4) # define Z_TEST_MASK (7 << 4) # define STENCIL_TEST_NEVER (0 << 12) # define STENCIL_TEST_LESS (1 << 12) # define STENCIL_TEST_LEQUAL (2 << 12) # define STENCIL_TEST_EQUAL (3 << 12) # define STENCIL_TEST_GEQUAL (4 << 12) # define STENCIL_TEST_GREATER (5 << 12) # define STENCIL_TEST_NEQUAL (6 << 12) # define STENCIL_TEST_ALWAYS (7 << 12) # define STENCIL_TEST_MASK (0x7 << 12) # define STENCIL_FAIL_KEEP (0 << 16) # define STENCIL_FAIL_ZERO (1 << 16) # define STENCIL_FAIL_REPLACE (2 << 16) # define STENCIL_FAIL_INC (3 << 16) # define STENCIL_FAIL_DEC (4 << 16) # define STENCIL_FAIL_INVERT (5 << 16) # define STENCIL_FAIL_MASK (0x7 << 16) # define STENCIL_ZPASS_KEEP (0 << 20) # define STENCIL_ZPASS_ZERO (1 << 20) # define STENCIL_ZPASS_REPLACE (2 << 20) # define STENCIL_ZPASS_INC (3 << 20) # define STENCIL_ZPASS_DEC (4 << 20) # define STENCIL_ZPASS_INVERT (5 << 20) # define STENCIL_ZPASS_MASK (0x7 << 20) # define STENCIL_ZFAIL_KEEP (0 << 24) # define STENCIL_ZFAIL_ZERO (1 << 24) # define STENCIL_ZFAIL_REPLACE (2 << 24) # define STENCIL_ZFAIL_INC (3 << 24) # define STENCIL_ZFAIL_DEC (4 << 24) # define STENCIL_ZFAIL_INVERT (5 << 24) # define STENCIL_ZFAIL_MASK (0x7 << 24) # define Z_COMPRESSION_ENABLE (1 << 28) # define FORCE_Z_DIRTY (1 << 29) # define Z_WRITE_ENABLE (1 << 30) #define RE_LINE_PATTERN 0x1cd0 # define LINE_PATTERN_MASK 0x0000ffff # define LINE_REPEAT_COUNT_SHIFT 16 # define LINE_PATTERN_START_SHIFT 24 # define LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) # define LINE_PATTERN_BIG_BIT_ORDER (1 << 28) # define LINE_PATTERN_AUTO_RESET (1 << 29) #define RE_LINE_STATE 0x1cd4 # define LINE_CURRENT_PTR_SHIFT 0 # define LINE_CURRENT_COUNT_SHIFT 8 #define RE_MISC 0x26c4 # define STIPPLE_COORD_MASK 0x1f # define STIPPLE_X_OFFSET_SHIFT 0 # define STIPPLE_X_OFFSET_MASK (0x1f << 0) # define STIPPLE_Y_OFFSET_SHIFT 8 # define STIPPLE_Y_OFFSET_MASK (0x1f << 8) # define STIPPLE_LITTLE_BIT_ORDER (0 << 16) # define STIPPLE_BIG_BIT_ORDER (1 << 16) #define RE_SOLID_COLOR 0x1c1c #define RE_POINTSIZE 0x2648 # define RE_POINTSIZE_SHIFT 0 # define RE_MAXPOINTSIZE_SHIFT 16 #define RE_TOP_LEFT 0x26c0 # define RE_LEFT_SHIFT 0 # define RE_TOP_SHIFT 16 #define RE_BOTTOM_RIGHT 0x1c44 # define RE_RIGHT_SHIFT 0 # define RE_BOTTOM_SHIFT 16 #define SE_CNTL 0x1c4c # define FFACE_CULL_CW (0 << 0) # define FFACE_CULL_CCW (1 << 0) # define FFACE_CULL_DIR_MASK (1 << 0) # define BFACE_CULL (0 << 1) # define BFACE_SOLID (3 << 1) # define FFACE_CULL (0 << 3) # define FFACE_SOLID (3 << 3) # define FFACE_CULL_MASK (3 << 3) # define BADVTX_CULL_DISABLE (1 << 5) # define FLAT_SHADE_VTX_0 (0 << 6) # define FLAT_SHADE_VTX_1 (1 << 6) # define FLAT_SHADE_VTX_2 (2 << 6) # define FLAT_SHADE_VTX_LAST (3 << 6) # define DIFFUSE_SHADE_SOLID (0 << 8) # define DIFFUSE_SHADE_FLAT (1 << 8) # define DIFFUSE_SHADE_GOURAUD (2 << 8) # define DIFFUSE_SHADE_MASK (3 << 8) # define ALPHA_SHADE_SOLID (0 << 10) # define ALPHA_SHADE_FLAT (1 << 10) # define ALPHA_SHADE_GOURAUD (2 << 10) # define ALPHA_SHADE_MASK (3 << 10) # define SPECULAR_SHADE_SOLID (0 << 12) # define SPECULAR_SHADE_FLAT (1 << 12) # define SPECULAR_SHADE_GOURAUD (2 << 12) # define SPECULAR_SHADE_MASK (3 << 12) # define FOG_SHADE_SOLID (0 << 14) # define FOG_SHADE_FLAT (1 << 14) # define FOG_SHADE_GOURAUD (2 << 14) # define FOG_SHADE_MASK (3 << 14) # define ZBIAS_ENABLE_POINT (1 << 16) # define ZBIAS_ENABLE_LINE (1 << 17) # define ZBIAS_ENABLE_TRI (1 << 18) # define WIDELINE_ENABLE (1 << 20) # define VPORT_XY_XFORM_ENABLE (1 << 24) # define VPORT_Z_XFORM_ENABLE (1 << 25) # define VTX_PIX_CENTER_D3D (0 << 27) # define VTX_PIX_CENTER_OGL (1 << 27) # define ROUND_MODE_TRUNC (0 << 28) # define ROUND_MODE_ROUND (1 << 28) # define ROUND_MODE_ROUND_EVEN (2 << 28) # define ROUND_MODE_ROUND_ODD (3 << 28) # define ROUND_PREC_16TH_PIX (0 << 30) # define ROUND_PREC_8TH_PIX (1 << 30) # define ROUND_PREC_4TH_PIX (2 << 30) # define ROUND_PREC_HALF_PIX (3 << 30) #define R200_RE_CNTL 0x1c50 # define R200_STIPPLE_ENABLE 0x1 # define R200_SCISSOR_ENABLE 0x2 # define R200_PATTERN_ENABLE 0x4 # define R200_PERSPECTIVE_ENABLE 0x8 # define R200_POINT_SMOOTH 0x20 # define R200_VTX_STQ0_D3D 0x00010000 # define R200_VTX_STQ1_D3D 0x00040000 # define R200_VTX_STQ2_D3D 0x00100000 # define R200_VTX_STQ3_D3D 0x00400000 # define R200_VTX_STQ4_D3D 0x01000000 # define R200_VTX_STQ5_D3D 0x04000000 #define SE_CNTL_STATUS 0x2140 # define VC_NO_SWAP (0 << 0) # define VC_16BIT_SWAP (1 << 0) # define VC_32BIT_SWAP (2 << 0) # define VC_HALF_DWORD_SWAP (3 << 0) # define TCL_BYPASS (1 << 8) #define SE_COORD_FMT 0x1c50 # define VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0) # define VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1) # define VTX_ST0_NONPARAMETRIC (1 << 8) # define VTX_ST1_NONPARAMETRIC (1 << 9) # define VTX_ST2_NONPARAMETRIC (1 << 10) # define VTX_ST3_NONPARAMETRIC (1 << 11) # define VTX_W0_NORMALIZE (1 << 12) # define VTX_W0_IS_NOT_1_OVER_W0 (1 << 16) # define VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17) # define VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19) # define VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21) # define VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23) # define TEX1_W_ROUTING_USE_W0 (0 << 26) # define TEX1_W_ROUTING_USE_Q1 (1 << 26) #define SE_LINE_WIDTH 0x1db8 #define SE_TCL_LIGHT_MODEL_CTL 0x226c # define LIGHTING_ENABLE (1 << 0) # define LIGHT_IN_MODELSPACE (1 << 1) # define LOCAL_VIEWER (1 << 2) # define NORMALIZE_NORMALS (1 << 3) # define RESCALE_NORMALS (1 << 4) # define SPECULAR_LIGHTS (1 << 5) # define DIFFUSE_SPECULAR_COMBINE (1 << 6) # define LIGHT_ALPHA (1 << 7) # define LOCAL_LIGHT_VEC_GL (1 << 8) # define LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9) # define LM_SOURCE_STATE_PREMULT 0 # define LM_SOURCE_STATE_MULT 1 # define LM_SOURCE_VERTEX_DIFFUSE 2 # define LM_SOURCE_VERTEX_SPECULAR 3 # define EMISSIVE_SOURCE_SHIFT 16 # define AMBIENT_SOURCE_SHIFT 18 # define DIFFUSE_SOURCE_SHIFT 20 # define SPECULAR_SOURCE_SHIFT 22 #define SE_TCL_MATERIAL_AMBIENT_RED 0x2220 #define SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224 #define SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228 #define SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c #define SE_TCL_MATERIAL_DIFFUSE_RED 0x2230 #define SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234 #define SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238 #define SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c #define SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210 #define SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214 #define SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218 #define SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c #define SE_TCL_MATERIAL_SPECULAR_RED 0x2240 #define SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244 #define SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248 #define SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c #define SE_TCL_MATRIX_SELECT_0 0x225c # define MODELVIEW_0_SHIFT 0 # define MODELVIEW_1_SHIFT 4 # define MODELVIEW_2_SHIFT 8 # define MODELVIEW_3_SHIFT 12 # define IT_MODELVIEW_0_SHIFT 16 # define IT_MODELVIEW_1_SHIFT 20 # define IT_MODELVIEW_2_SHIFT 24 # define IT_MODELVIEW_3_SHIFT 28 #define SE_TCL_MATRIX_SELECT_1 0x2260 # define MODELPROJECT_0_SHIFT 0 # define MODELPROJECT_1_SHIFT 4 # define MODELPROJECT_2_SHIFT 8 # define MODELPROJECT_3_SHIFT 12 # define TEXMAT_0_SHIFT 16 # define TEXMAT_1_SHIFT 20 # define TEXMAT_2_SHIFT 24 # define TEXMAT_3_SHIFT 28 #define SE_TCL_OUTPUT_VTX_FMT 0x2254 # define TCL_VTX_W0 (1 << 0) # define TCL_VTX_FP_DIFFUSE (1 << 1) # define TCL_VTX_FP_ALPHA (1 << 2) # define TCL_VTX_PK_DIFFUSE (1 << 3) # define TCL_VTX_FP_SPEC (1 << 4) # define TCL_VTX_FP_FOG (1 << 5) # define TCL_VTX_PK_SPEC (1 << 6) # define TCL_VTX_ST0 (1 << 7) # define TCL_VTX_ST1 (1 << 8) # define TCL_VTX_Q1 (1 << 9) # define TCL_VTX_ST2 (1 << 10) # define TCL_VTX_Q2 (1 << 11) # define TCL_VTX_ST3 (1 << 12) # define TCL_VTX_Q3 (1 << 13) # define TCL_VTX_Q0 (1 << 14) # define TCL_VTX_WEIGHT_COUNT_SHIFT 15 # define TCL_VTX_NORM0 (1 << 18) # define TCL_VTX_XY1 (1 << 27) # define TCL_VTX_Z1 (1 << 28) # define TCL_VTX_W1 (1 << 29) # define TCL_VTX_NORM1 (1 << 30) # define TCL_VTX_Z0 (1 << 31) #define SE_TCL_OUTPUT_VTX_SEL 0x2258 # define TCL_COMPUTE_XYZW (1 << 0) # define TCL_COMPUTE_DIFFUSE (1 << 1) # define TCL_COMPUTE_SPECULAR (1 << 2) # define TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3) # define TCL_FORCE_INORDER_PROC (1 << 4) # define TCL_TEX_INPUT_TEX_0 0 # define TCL_TEX_INPUT_TEX_1 1 # define TCL_TEX_INPUT_TEX_2 2 # define TCL_TEX_INPUT_TEX_3 3 # define TCL_TEX_COMPUTED_TEX_0 8 # define TCL_TEX_COMPUTED_TEX_1 9 # define TCL_TEX_COMPUTED_TEX_2 10 # define TCL_TEX_COMPUTED_TEX_3 11 # define TCL_TEX_0_OUTPUT_SHIFT 16 # define TCL_TEX_1_OUTPUT_SHIFT 20 # define TCL_TEX_2_OUTPUT_SHIFT 24 # define TCL_TEX_3_OUTPUT_SHIFT 28 #define SE_TCL_PER_LIGHT_CTL_0 0x2270 # define LIGHT_0_ENABLE (1 << 0) # define LIGHT_0_ENABLE_AMBIENT (1 << 1) # define LIGHT_0_ENABLE_SPECULAR (1 << 2) # define LIGHT_0_IS_LOCAL (1 << 3) # define LIGHT_0_IS_SPOT (1 << 4) # define LIGHT_0_DUAL_CONE (1 << 5) # define LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6) # define LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7) # define LIGHT_0_SHIFT 0 # define LIGHT_1_ENABLE (1 << 16) # define LIGHT_1_ENABLE_AMBIENT (1 << 17) # define LIGHT_1_ENABLE_SPECULAR (1 << 18) # define LIGHT_1_IS_LOCAL (1 << 19) # define LIGHT_1_IS_SPOT (1 << 20) # define LIGHT_1_DUAL_CONE (1 << 21) # define LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22) # define LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23) # define LIGHT_1_SHIFT 16 #define SE_TCL_PER_LIGHT_CTL_1 0x2274 # define LIGHT_2_SHIFT 0 # define LIGHT_3_SHIFT 16 #define SE_TCL_PER_LIGHT_CTL_2 0x2278 # define LIGHT_4_SHIFT 0 # define LIGHT_5_SHIFT 16 #define SE_TCL_PER_LIGHT_CTL_3 0x227c # define LIGHT_6_SHIFT 0 # define LIGHT_7_SHIFT 16 #define SE_TCL_SHININESS 0x2250 #define SE_TCL_TEXTURE_PROC_CTL 0x2268 # define TEXGEN_TEXMAT_0_ENABLE (1 << 0) # define TEXGEN_TEXMAT_1_ENABLE (1 << 1) # define TEXGEN_TEXMAT_2_ENABLE (1 << 2) # define TEXGEN_TEXMAT_3_ENABLE (1 << 3) # define TEXMAT_0_ENABLE (1 << 4) # define TEXMAT_1_ENABLE (1 << 5) # define TEXMAT_2_ENABLE (1 << 6) # define TEXMAT_3_ENABLE (1 << 7) # define TEXGEN_INPUT_MASK 0xf # define TEXGEN_INPUT_TEXCOORD_0 0 # define TEXGEN_INPUT_TEXCOORD_1 1 # define TEXGEN_INPUT_TEXCOORD_2 2 # define TEXGEN_INPUT_TEXCOORD_3 3 # define TEXGEN_INPUT_OBJ 4 # define TEXGEN_INPUT_EYE 5 # define TEXGEN_INPUT_EYE_NORMAL 6 # define TEXGEN_INPUT_EYE_REFLECT 7 # define TEXGEN_INPUT_EYE_NORMALIZED 8 # define TEXGEN_0_INPUT_SHIFT 16 # define TEXGEN_1_INPUT_SHIFT 20 # define TEXGEN_2_INPUT_SHIFT 24 # define TEXGEN_3_INPUT_SHIFT 28 #define SE_TCL_UCP_VERT_BLEND_CTL 0x2264 # define UCP_IN_CLIP_SPACE (1 << 0) # define UCP_IN_MODEL_SPACE (1 << 1) # define UCP_ENABLE_0 (1 << 2) # define UCP_ENABLE_1 (1 << 3) # define UCP_ENABLE_2 (1 << 4) # define UCP_ENABLE_3 (1 << 5) # define UCP_ENABLE_4 (1 << 6) # define UCP_ENABLE_5 (1 << 7) # define TCL_FOG_MASK (3 << 8) # define TCL_FOG_DISABLE (0 << 8) # define TCL_FOG_EXP (1 << 8) # define TCL_FOG_EXP2 (2 << 8) # define TCL_FOG_LINEAR (3 << 8) # define RNG_BASED_FOG (1 << 10) # define LIGHT_TWOSIDE (1 << 11) # define BLEND_OP_COUNT_MASK (7 << 12) # define BLEND_OP_COUNT_SHIFT 12 # define POSITION_BLEND_OP_ENABLE (1 << 16) # define NORMAL_BLEND_OP_ENABLE (1 << 17) # define VERTEX_BLEND_SRC_0_PRIMARY (1 << 18) # define VERTEX_BLEND_SRC_0_SECONDARY (1 << 18) # define VERTEX_BLEND_SRC_1_PRIMARY (1 << 19) # define VERTEX_BLEND_SRC_1_SECONDARY (1 << 19) # define VERTEX_BLEND_SRC_2_PRIMARY (1 << 20) # define VERTEX_BLEND_SRC_2_SECONDARY (1 << 20) # define VERTEX_BLEND_SRC_3_PRIMARY (1 << 21) # define VERTEX_BLEND_SRC_3_SECONDARY (1 << 21) # define VERTEX_BLEND_WGT_MINUS_ONE (1 << 22) # define CULL_FRONT_IS_CW (0 << 28) # define CULL_FRONT_IS_CCW (1 << 28) # define CULL_FRONT (1 << 29) # define CULL_BACK (1 << 30) # define FORCE_W_TO_ONE (1 << 31) #define SE_VPORT_XSCALE 0x1d98 #define SE_VPORT_XOFFSET 0x1d9c #define SE_VPORT_YSCALE 0x1da0 #define SE_VPORT_YOFFSET 0x1da4 #define SE_VPORT_ZSCALE 0x1da8 #define SE_VPORT_ZOFFSET 0x1dac #define SE_ZBIAS_FACTOR 0x1db0 #define SE_ZBIAS_CONSTANT 0x1db4 #define SE_VTX_FMT 0x2080 # define SE_VTX_FMT_XY 0x00000000 # define SE_VTX_FMT_W0 0x00000001 # define SE_VTX_FMT_FPCOLOR 0x00000002 # define SE_VTX_FMT_FPALPHA 0x00000004 # define SE_VTX_FMT_PKCOLOR 0x00000008 # define SE_VTX_FMT_FPSPEC 0x00000010 # define SE_VTX_FMT_FPFOG 0x00000020 # define SE_VTX_FMT_PKSPEC 0x00000040 # define SE_VTX_FMT_ST0 0x00000080 # define SE_VTX_FMT_ST1 0x00000100 # define SE_VTX_FMT_Q1 0x00000200 # define SE_VTX_FMT_ST2 0x00000400 # define SE_VTX_FMT_Q2 0x00000800 # define SE_VTX_FMT_ST3 0x00001000 # define SE_VTX_FMT_Q3 0x00002000 # define SE_VTX_FMT_Q0 0x00004000 # define SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000 # define SE_VTX_FMT_N0 0x00040000 # define SE_VTX_FMT_XY1 0x08000000 # define SE_VTX_FMT_Z1 0x10000000 # define SE_VTX_FMT_W1 0x20000000 # define SE_VTX_FMT_N1 0x40000000 # define SE_VTX_FMT_Z 0x80000000 #define SE_VF_CNTL 0x2084 # define VF_PRIM_TYPE_POINT_LIST 1 # define VF_PRIM_TYPE_LINE_LIST 2 # define VF_PRIM_TYPE_LINE_STRIP 3 # define VF_PRIM_TYPE_TRIANGLE_LIST 4 # define VF_PRIM_TYPE_TRIANGLE_FAN 5 # define VF_PRIM_TYPE_TRIANGLE_STRIP 6 # define VF_PRIM_TYPE_TRIANGLE_FLAG 7 # define VF_PRIM_TYPE_RECTANGLE_LIST 8 # define VF_PRIM_TYPE_POINT_LIST_3 9 # define VF_PRIM_TYPE_LINE_LIST_3 10 # define VF_PRIM_TYPE_SPIRIT_LIST 11 # define VF_PRIM_TYPE_LINE_LOOP 12 # define VF_PRIM_TYPE_QUAD_LIST 13 # define VF_PRIM_TYPE_QUAD_STRIP 14 # define VF_PRIM_TYPE_POLYGON 15 # define VF_PRIM_WALK_STATE (0<<4) # define VF_PRIM_WALK_INDEX (1<<4) # define VF_PRIM_WALK_LIST (2<<4) # define VF_PRIM_WALK_DATA (3<<4) # define VF_COLOR_ORDER_RGBA (1<<6) # define VF_RADEON_MODE (1<<8) # define VF_TCL_OUTPUT_CTL_ENA (1<<9) # define VF_PROG_STREAM_ENA (1<<10) # define VF_INDEX_SIZE_SHIFT 11 # define VF_NUM_VERTICES_SHIFT 16 #define SE_PORT_DATA0 0x2000 #define R200_SE_VAP_CNTL 0x2080 # define R200_VAP_TCL_ENABLE 0x00000001 # define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010 # define R200_VAP_FORCE_W_TO_ONE 0x00010000 # define R200_VAP_D3D_TEX_DEFAULT 0x00020000 # define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18 # define R200_VAP_VF_MAX_VTX_NUM (9 << 18) # define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000 #define R200_VF_MAX_VTX_INDX 0x210c #define R200_VF_MIN_VTX_INDX 0x2110 #define R200_SE_VTE_CNTL 0x20b0 # define R200_VPORT_X_SCALE_ENA 0x00000001 # define R200_VPORT_X_OFFSET_ENA 0x00000002 # define R200_VPORT_Y_SCALE_ENA 0x00000004 # define R200_VPORT_Y_OFFSET_ENA 0x00000008 # define R200_VPORT_Z_SCALE_ENA 0x00000010 # define R200_VPORT_Z_OFFSET_ENA 0x00000020 # define R200_VTX_XY_FMT 0x00000100 # define R200_VTX_Z_FMT 0x00000200 # define R200_VTX_W0_FMT 0x00000400 # define R200_VTX_W0_NORMALIZE 0x00000800 # define R200_VTX_ST_DENORMALIZED 0x00001000 #define R200_SE_VAP_CNTL_STATUS 0x2140 # define R200_VC_NO_SWAP (0 << 0) # define R200_VC_16BIT_SWAP (1 << 0) # define R200_VC_32BIT_SWAP (2 << 0) # define R200_TCL_BYPASS (1 << 8) #define R200_PP_TXFILTER_0 0x2c00 #define R200_PP_TXFILTER_1 0x2c20 # define R200_MAG_FILTER_NEAREST (0 << 0) # define R200_MAG_FILTER_LINEAR (1 << 0) # define R200_MAG_FILTER_MASK (1 << 0) # define R200_MIN_FILTER_NEAREST (0 << 1) # define R200_MIN_FILTER_LINEAR (1 << 1) # define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) # define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) # define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) # define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) # define R200_MIN_FILTER_ANISO_NEAREST (8 << 1) # define R200_MIN_FILTER_ANISO_LINEAR (9 << 1) # define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) # define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) # define R200_MIN_FILTER_MASK (15 << 1) # define R200_MAX_ANISO_1_TO_1 (0 << 5) # define R200_MAX_ANISO_2_TO_1 (1 << 5) # define R200_MAX_ANISO_4_TO_1 (2 << 5) # define R200_MAX_ANISO_8_TO_1 (3 << 5) # define R200_MAX_ANISO_16_TO_1 (4 << 5) # define R200_MAX_ANISO_MASK (7 << 5) # define R200_MAX_MIP_LEVEL_MASK (0x0f << 16) # define R200_MAX_MIP_LEVEL_SHIFT 16 # define R200_YUV_TO_RGB (1 << 20) # define R200_YUV_TEMPERATURE_COOL (0 << 21) # define R200_YUV_TEMPERATURE_HOT (1 << 21) # define R200_YUV_TEMPERATURE_MASK (1 << 21) # define R200_WRAPEN_S (1 << 22) # define R200_CLAMP_S_WRAP (0 << 23) # define R200_CLAMP_S_MIRROR (1 << 23) # define R200_CLAMP_S_CLAMP_LAST (2 << 23) # define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) # define R200_CLAMP_S_CLAMP_BORDER (4 << 23) # define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) # define R200_CLAMP_S_CLAMP_GL (6 << 23) # define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) # define R200_CLAMP_S_MASK (7 << 23) # define R200_WRAPEN_T (1 << 26) # define R200_CLAMP_T_WRAP (0 << 27) # define R200_CLAMP_T_MIRROR (1 << 27) # define R200_CLAMP_T_CLAMP_LAST (2 << 27) # define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) # define R200_CLAMP_T_CLAMP_BORDER (4 << 27) # define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) # define R200_CLAMP_T_CLAMP_GL (6 << 27) # define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) # define R200_CLAMP_T_MASK (7 << 27) # define R200_KILL_LT_ZERO (1 << 30) # define R200_BORDER_MODE_OGL (0 << 31) # define R200_BORDER_MODE_D3D (1 << 31) #define R200_PP_TXFORMAT_0 0x2c04 #define R200_PP_TXFORMAT_1 0x2c24 # define R200_TXFORMAT_I8 (0 << 0) # define R200_TXFORMAT_AI88 (1 << 0) # define R200_TXFORMAT_RGB332 (2 << 0) # define R200_TXFORMAT_ARGB1555 (3 << 0) # define R200_TXFORMAT_RGB565 (4 << 0) # define R200_TXFORMAT_ARGB4444 (5 << 0) # define R200_TXFORMAT_ARGB8888 (6 << 0) # define R200_TXFORMAT_RGBA8888 (7 << 0) # define R200_TXFORMAT_Y8 (8 << 0) # define R200_TXFORMAT_AVYU (9 << 0) # define R200_TXFORMAT_VYUY422 (10 << 0) # define R200_TXFORMAT_YVYU422 (11 << 0) # define R200_TXFORMAT_DXT1 (12 << 0) # define R200_TXFORMAT_DXT23 (14 << 0) # define R200_TXFORMAT_DXT45 (15 << 0) # define R200_TXFORMAT_FORMAT_MASK (31 << 0) # define R200_TXFORMAT_FORMAT_SHIFT 0 # define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6) # define R200_TXFORMAT_NON_POWER2 (1 << 7) # define R200_TXFORMAT_WIDTH_MASK (15 << 8) # define R200_TXFORMAT_WIDTH_SHIFT 8 # define R200_TXFORMAT_HEIGHT_MASK (15 << 12) # define R200_TXFORMAT_HEIGHT_SHIFT 12 # define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ # define R200_TXFORMAT_F5_WIDTH_SHIFT 16 # define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) # define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 # define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) # define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) # define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) # define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) # define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) # define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) # define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) # define R200_TXFORMAT_ST_ROUTE_SHIFT 24 # define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) # define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) # define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) #define R200_PP_TXFORMAT_X_0 0x2c08 #define R200_PP_TXFORMAT_X_1 0x2c28 #define R200_DEPTH_LOG2_MASK (0xf << 0) #define R200_DEPTH_LOG2_SHIFT 0 #define R200_VOLUME_FILTER_SHIFT 4 #define R200_VOLUME_FILTER_MASK (1 << 4) #define R200_VOLUME_FILTER_NEAREST (0 << 4) #define R200_VOLUME_FILTER_LINEAR (1 << 4) #define R200_WRAPEN_Q (1 << 8) #define R200_CLAMP_Q_WRAP (0 << 9) #define R200_CLAMP_Q_MIRROR (1 << 9) #define R200_CLAMP_Q_CLAMP_LAST (2 << 9) #define R200_CLAMP_Q_MIRROR_CLAMP_LAST (3 << 9) #define R200_CLAMP_Q_CLAMP_BORDER (4 << 9) #define R200_CLAMP_Q_MIRROR_CLAMP_BORDER (5 << 9) #define R200_CLAMP_Q_CLAMP_GL (6 << 9) #define R200_CLAMP_Q_MIRROR_CLAMP_GL (7 << 9) #define R200_CLAMP_Q_MASK (7 << 9) #define R200_MIN_MIP_LEVEL_MASK (0xff << 12) #define R200_MIN_MIP_LEVEL_SHIFT 12 #define R200_TEXCOORD_NONPROJ (0 << 16) #define R200_TEXCOORD_CUBIC_ENV (1 << 16) #define R200_TEXCOORD_VOLUME (2 << 16) #define R200_TEXCOORD_PROJ (3 << 16) #define R200_TEXCOORD_DEPTH (4 << 16) #define R200_TEXCOORD_1D_PROJ (5 << 16) #define R200_TEXCOORD_1D (6 << 16) #define R200_TEXCOORD_ZERO (7 << 16) #define R200_TEXCOORD_MASK (7 << 16) #define R200_LOD_BIAS_MASK (0xfff80000) #define R200_LOD_BIAS_SHIFT 19 #define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ #define R200_PP_TXSIZE_1 0x2c2c #define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ #define R200_PP_TXPITCH_1 0x2c30 #define R200_PP_BORDER_COLOR_0 0x2c14 #define R200_PP_BORDER_COLOR_1 0x2c34 #define R200_PP_TXOFFSET_0 0x2d00 #define R200_PP_TXOFFSET_1 0x2d18 # define R200_TXO_ENDIAN_NO_SWAP (0 << 0) # define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0) # define R200_TXO_ENDIAN_WORD_SWAP (2 << 0) # define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0) # define R200_TXO_OFFSET_MASK 0xffffffe0 # define R200_TXO_OFFSET_SHIFT 5 #define R200_PP_TFACTOR_0 0x2ee0 #define R200_PP_TFACTOR_1 0x2ee4 #define R200_PP_TFACTOR_2 0x2ee8 #define R200_PP_TFACTOR_3 0x2eec #define R200_PP_TFACTOR_4 0x2ef0 #define R200_PP_TFACTOR_5 0x2ef4 #define R200_PP_TXCBLEND_0 0x2f00 #define R200_PP_TXCBLEND_1 0x2f10 # define R200_TXC_ARG_A_ZERO (0) # define R200_TXC_ARG_A_CURRENT_COLOR (2) # define R200_TXC_ARG_A_CURRENT_ALPHA (3) # define R200_TXC_ARG_A_DIFFUSE_COLOR (4) # define R200_TXC_ARG_A_DIFFUSE_ALPHA (5) # define R200_TXC_ARG_A_SPECULAR_COLOR (6) # define R200_TXC_ARG_A_SPECULAR_ALPHA (7) # define R200_TXC_ARG_A_TFACTOR_COLOR (8) # define R200_TXC_ARG_A_TFACTOR_ALPHA (9) # define R200_TXC_ARG_A_R0_COLOR (10) # define R200_TXC_ARG_A_R0_ALPHA (11) # define R200_TXC_ARG_A_R1_COLOR (12) # define R200_TXC_ARG_A_R1_ALPHA (13) # define R200_TXC_ARG_A_R2_COLOR (14) # define R200_TXC_ARG_A_R2_ALPHA (15) # define R200_TXC_ARG_A_R3_COLOR (16) # define R200_TXC_ARG_A_R3_ALPHA (17) # define R200_TXC_ARG_A_R4_COLOR (18) # define R200_TXC_ARG_A_R4_ALPHA (19) # define R200_TXC_ARG_A_R5_COLOR (20) # define R200_TXC_ARG_A_R5_ALPHA (21) # define R200_TXC_ARG_A_TFACTOR1_COLOR (26) # define R200_TXC_ARG_A_TFACTOR1_ALPHA (27) # define R200_TXC_ARG_A_MASK (31 << 0) # define R200_TXC_ARG_A_SHIFT 0 # define R200_TXC_ARG_B_ZERO (0 << 5) # define R200_TXC_ARG_B_CURRENT_COLOR (2 << 5) # define R200_TXC_ARG_B_CURRENT_ALPHA (3 << 5) # define R200_TXC_ARG_B_DIFFUSE_COLOR (4 << 5) # define R200_TXC_ARG_B_DIFFUSE_ALPHA (5 << 5) # define R200_TXC_ARG_B_SPECULAR_COLOR (6 << 5) # define R200_TXC_ARG_B_SPECULAR_ALPHA (7 << 5) # define R200_TXC_ARG_B_TFACTOR_COLOR (8 << 5) # define R200_TXC_ARG_B_TFACTOR_ALPHA (9 << 5) # define R200_TXC_ARG_B_R0_COLOR (10 << 5) # define R200_TXC_ARG_B_R0_ALPHA (11 << 5) # define R200_TXC_ARG_B_R1_COLOR (12 << 5) # define R200_TXC_ARG_B_R1_ALPHA (13 << 5) # define R200_TXC_ARG_B_R2_COLOR (14 << 5) # define R200_TXC_ARG_B_R2_ALPHA (15 << 5) # define R200_TXC_ARG_B_R3_COLOR (16 << 5) # define R200_TXC_ARG_B_R3_ALPHA (17 << 5) # define R200_TXC_ARG_B_R4_COLOR (18 << 5) # define R200_TXC_ARG_B_R4_ALPHA (19 << 5) # define R200_TXC_ARG_B_R5_COLOR (20 << 5) # define R200_TXC_ARG_B_R5_ALPHA (21 << 5) # define R200_TXC_ARG_B_TFACTOR1_COLOR (26 << 5) # define R200_TXC_ARG_B_TFACTOR1_ALPHA (27 << 5) # define R200_TXC_ARG_B_MASK (31 << 5) # define R200_TXC_ARG_B_SHIFT 5 # define R200_TXC_ARG_C_ZERO (0 << 10) # define R200_TXC_ARG_C_CURRENT_COLOR (2 << 10) # define R200_TXC_ARG_C_CURRENT_ALPHA (3 << 10) # define R200_TXC_ARG_C_DIFFUSE_COLOR (4 << 10) # define R200_TXC_ARG_C_DIFFUSE_ALPHA (5 << 10) # define R200_TXC_ARG_C_SPECULAR_COLOR (6 << 10) # define R200_TXC_ARG_C_SPECULAR_ALPHA (7 << 10) # define R200_TXC_ARG_C_TFACTOR_COLOR (8 << 10) # define R200_TXC_ARG_C_TFACTOR_ALPHA (9 << 10) # define R200_TXC_ARG_C_R0_COLOR (10 << 10) # define R200_TXC_ARG_C_R0_ALPHA (11 << 10) # define R200_TXC_ARG_C_R1_COLOR (12 << 10) # define R200_TXC_ARG_C_R1_ALPHA (13 << 10) # define R200_TXC_ARG_C_R2_COLOR (14 << 10) # define R200_TXC_ARG_C_R2_ALPHA (15 << 10) # define R200_TXC_ARG_C_R3_COLOR (16 << 10) # define R200_TXC_ARG_C_R3_ALPHA (17 << 10) # define R200_TXC_ARG_C_R4_COLOR (18 << 10) # define R200_TXC_ARG_C_R4_ALPHA (19 << 10) # define R200_TXC_ARG_C_R5_COLOR (20 << 10) # define R200_TXC_ARG_C_R5_ALPHA (21 << 10) # define R200_TXC_ARG_C_TFACTOR1_COLOR (26 << 10) # define R200_TXC_ARG_C_TFACTOR1_ALPHA (27 << 10) # define R200_TXC_ARG_C_MASK (31 << 10) # define R200_TXC_ARG_C_SHIFT 10 # define R200_TXC_COMP_ARG_A (1 << 16) # define R200_TXC_COMP_ARG_A_SHIFT (16) # define R200_TXC_BIAS_ARG_A (1 << 17) # define R200_TXC_SCALE_ARG_A (1 << 18) # define R200_TXC_NEG_ARG_A (1 << 19) # define R200_TXC_COMP_ARG_B (1 << 20) # define R200_TXC_COMP_ARG_B_SHIFT (20) # define R200_TXC_BIAS_ARG_B (1 << 21) # define R200_TXC_SCALE_ARG_B (1 << 22) # define R200_TXC_NEG_ARG_B (1 << 23) # define R200_TXC_COMP_ARG_C (1 << 24) # define R200_TXC_COMP_ARG_C_SHIFT (24) # define R200_TXC_BIAS_ARG_C (1 << 25) # define R200_TXC_SCALE_ARG_C (1 << 26) # define R200_TXC_NEG_ARG_C (1 << 27) # define R200_TXC_OP_MADD (0 << 28) # define R200_TXC_OP_CND0 (2 << 28) # define R200_TXC_OP_LERP (3 << 28) # define R200_TXC_OP_DOT3 (4 << 28) # define R200_TXC_OP_DOT4 (5 << 28) # define R200_TXC_OP_CONDITIONAL (6 << 28) # define R200_TXC_OP_DOT2_ADD (7 << 28) # define R200_TXC_OP_MASK (7 << 28) #define R200_PP_TXCBLEND2_0 0x2f04 #define R200_PP_TXCBLEND2_1 0x2f14 # define R200_TXC_TFACTOR_SEL_SHIFT 0 # define R200_TXC_TFACTOR_SEL_MASK 0x7 # define R200_TXC_TFACTOR1_SEL_SHIFT 4 # define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4) # define R200_TXC_SCALE_SHIFT 8 # define R200_TXC_SCALE_MASK (7 << 8) # define R200_TXC_SCALE_1X (0 << 8) # define R200_TXC_SCALE_2X (1 << 8) # define R200_TXC_SCALE_4X (2 << 8) # define R200_TXC_SCALE_8X (3 << 8) # define R200_TXC_SCALE_INV2 (5 << 8) # define R200_TXC_SCALE_INV4 (6 << 8) # define R200_TXC_SCALE_INV8 (7 << 8) # define R200_TXC_CLAMP_SHIFT 12 # define R200_TXC_CLAMP_MASK (3 << 12) # define R200_TXC_CLAMP_WRAP (0 << 12) # define R200_TXC_CLAMP_0_1 (1 << 12) # define R200_TXC_CLAMP_8_8 (2 << 12) # define R200_TXC_OUTPUT_REG_MASK (7 << 16) # define R200_TXC_OUTPUT_REG_NONE (0 << 16) # define R200_TXC_OUTPUT_REG_R0 (1 << 16) # define R200_TXC_OUTPUT_REG_R1 (2 << 16) # define R200_TXC_OUTPUT_REG_R2 (3 << 16) # define R200_TXC_OUTPUT_REG_R3 (4 << 16) # define R200_TXC_OUTPUT_REG_R4 (5 << 16) # define R200_TXC_OUTPUT_REG_R5 (6 << 16) # define R200_TXC_OUTPUT_MASK_MASK (7 << 20) # define R200_TXC_OUTPUT_MASK_RGB (0 << 20) # define R200_TXC_OUTPUT_MASK_RG (1 << 20) # define R200_TXC_OUTPUT_MASK_RB (2 << 20) # define R200_TXC_OUTPUT_MASK_R (3 << 20) # define R200_TXC_OUTPUT_MASK_GB (4 << 20) # define R200_TXC_OUTPUT_MASK_G (5 << 20) # define R200_TXC_OUTPUT_MASK_B (6 << 20) # define R200_TXC_OUTPUT_MASK_NONE (7 << 20) # define R200_TXC_REPL_NORMAL 0 # define R200_TXC_REPL_RED 1 # define R200_TXC_REPL_GREEN 2 # define R200_TXC_REPL_BLUE 3 # define R200_TXC_REPL_ARG_A_SHIFT 26 # define R200_TXC_REPL_ARG_A_MASK (3 << 26) # define R200_TXC_REPL_ARG_B_SHIFT 28 # define R200_TXC_REPL_ARG_B_MASK (3 << 28) # define R200_TXC_REPL_ARG_C_SHIFT 30 # define R200_TXC_REPL_ARG_C_MASK (3 << 30) #define R200_PP_TXABLEND_0 0x2f08 #define R200_PP_TXABLEND_1 0x2f18 # define R200_TXA_ARG_A_ZERO (0) # define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */ # define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */ # define R200_TXA_ARG_A_DIFFUSE_ALPHA (4) # define R200_TXA_ARG_A_DIFFUSE_BLUE (5) # define R200_TXA_ARG_A_SPECULAR_ALPHA (6) # define R200_TXA_ARG_A_SPECULAR_BLUE (7) # define R200_TXA_ARG_A_TFACTOR_ALPHA (8) # define R200_TXA_ARG_A_TFACTOR_BLUE (9) # define R200_TXA_ARG_A_R0_ALPHA (10) # define R200_TXA_ARG_A_R0_BLUE (11) # define R200_TXA_ARG_A_R1_ALPHA (12) # define R200_TXA_ARG_A_R1_BLUE (13) # define R200_TXA_ARG_A_R2_ALPHA (14) # define R200_TXA_ARG_A_R2_BLUE (15) # define R200_TXA_ARG_A_R3_ALPHA (16) # define R200_TXA_ARG_A_R3_BLUE (17) # define R200_TXA_ARG_A_R4_ALPHA (18) # define R200_TXA_ARG_A_R4_BLUE (19) # define R200_TXA_ARG_A_R5_ALPHA (20) # define R200_TXA_ARG_A_R5_BLUE (21) # define R200_TXA_ARG_A_TFACTOR1_ALPHA (26) # define R200_TXA_ARG_A_TFACTOR1_BLUE (27) # define R200_TXA_ARG_A_MASK (31 << 0) # define R200_TXA_ARG_A_SHIFT 0 # define R200_TXA_ARG_B_ZERO (0 << 5) # define R200_TXA_ARG_B_CURRENT_ALPHA (2 << 5) /* guess */ # define R200_TXA_ARG_B_CURRENT_BLUE (3 << 5) /* guess */ # define R200_TXA_ARG_B_DIFFUSE_ALPHA (4 << 5) # define R200_TXA_ARG_B_DIFFUSE_BLUE (5 << 5) # define R200_TXA_ARG_B_SPECULAR_ALPHA (6 << 5) # define R200_TXA_ARG_B_SPECULAR_BLUE (7 << 5) # define R200_TXA_ARG_B_TFACTOR_ALPHA (8 << 5) # define R200_TXA_ARG_B_TFACTOR_BLUE (9 << 5) # define R200_TXA_ARG_B_R0_ALPHA (10 << 5) # define R200_TXA_ARG_B_R0_BLUE (11 << 5) # define R200_TXA_ARG_B_R1_ALPHA (12 << 5) # define R200_TXA_ARG_B_R1_BLUE (13 << 5) # define R200_TXA_ARG_B_R2_ALPHA (14 << 5) # define R200_TXA_ARG_B_R2_BLUE (15 << 5) # define R200_TXA_ARG_B_R3_ALPHA (16 << 5) # define R200_TXA_ARG_B_R3_BLUE (17 << 5) # define R200_TXA_ARG_B_R4_ALPHA (18 << 5) # define R200_TXA_ARG_B_R4_BLUE (19 << 5) # define R200_TXA_ARG_B_R5_ALPHA (20 << 5) # define R200_TXA_ARG_B_R5_BLUE (21 << 5) # define R200_TXA_ARG_B_TFACTOR1_ALPHA (26 << 5) # define R200_TXA_ARG_B_TFACTOR1_BLUE (27 << 5) # define R200_TXA_ARG_B_MASK (31 << 5) # define R200_TXA_ARG_B_SHIFT 5 # define R200_TXA_ARG_C_ZERO (0 << 10) # define R200_TXA_ARG_C_CURRENT_ALPHA (2 << 10) /* guess */ # define R200_TXA_ARG_C_CURRENT_BLUE (3 << 10) /* guess */ # define R200_TXA_ARG_C_DIFFUSE_ALPHA (4 << 10) # define R200_TXA_ARG_C_DIFFUSE_BLUE (5 << 10) # define R200_TXA_ARG_C_SPECULAR_ALPHA (6 << 10) # define R200_TXA_ARG_C_SPECULAR_BLUE (7 << 10) # define R200_TXA_ARG_C_TFACTOR_ALPHA (8 << 10) # define R200_TXA_ARG_C_TFACTOR_BLUE (9 << 10) # define R200_TXA_ARG_C_R0_ALPHA (10 << 10) # define R200_TXA_ARG_C_R0_BLUE (11 << 10) # define R200_TXA_ARG_C_R1_ALPHA (12 << 10) # define R200_TXA_ARG_C_R1_BLUE (13 << 10) # define R200_TXA_ARG_C_R2_ALPHA (14 << 10) # define R200_TXA_ARG_C_R2_BLUE (15 << 10) # define R200_TXA_ARG_C_R3_ALPHA (16 << 10) # define R200_TXA_ARG_C_R3_BLUE (17 << 10) # define R200_TXA_ARG_C_R4_ALPHA (18 << 10) # define R200_TXA_ARG_C_R4_BLUE (19 << 10) # define R200_TXA_ARG_C_R5_ALPHA (20 << 10) # define R200_TXA_ARG_C_R5_BLUE (21 << 10) # define R200_TXA_ARG_C_TFACTOR1_ALPHA (26 << 10) # define R200_TXA_ARG_C_TFACTOR1_BLUE (27 << 10) # define R200_TXA_ARG_C_MASK (31 << 10) # define R200_TXA_ARG_C_SHIFT 10 # define R200_TXA_COMP_ARG_A (1 << 16) # define R200_TXA_COMP_ARG_A_SHIFT (16) # define R200_TXA_BIAS_ARG_A (1 << 17) # define R200_TXA_SCALE_ARG_A (1 << 18) # define R200_TXA_NEG_ARG_A (1 << 19) # define R200_TXA_COMP_ARG_B (1 << 20) # define R200_TXA_COMP_ARG_B_SHIFT (20) # define R200_TXA_BIAS_ARG_B (1 << 21) # define R200_TXA_SCALE_ARG_B (1 << 22) # define R200_TXA_NEG_ARG_B (1 << 23) # define R200_TXA_COMP_ARG_C (1 << 24) # define R200_TXA_COMP_ARG_C_SHIFT (24) # define R200_TXA_BIAS_ARG_C (1 << 25) # define R200_TXA_SCALE_ARG_C (1 << 26) # define R200_TXA_NEG_ARG_C (1 << 27) # define R200_TXA_OP_MADD (0 << 28) # define R200_TXA_OP_CND0 (2 << 28) # define R200_TXA_OP_LERP (3 << 28) # define R200_TXA_OP_CONDITIONAL (6 << 28) # define R200_TXA_OP_MASK (7 << 28) #define R200_PP_TXABLEND2_0 0x2f0c #define R200_PP_TXABLEND2_1 0x2f1c # define R200_TXA_TFACTOR_SEL_SHIFT 0 # define R200_TXA_TFACTOR_SEL_MASK 0x7 # define R200_TXA_TFACTOR1_SEL_SHIFT 4 # define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4) # define R200_TXA_SCALE_SHIFT 8 # define R200_TXA_SCALE_MASK (7 << 8) # define R200_TXA_SCALE_1X (0 << 8) # define R200_TXA_SCALE_2X (1 << 8) # define R200_TXA_SCALE_4X (2 << 8) # define R200_TXA_SCALE_8X (3 << 8) # define R200_TXA_SCALE_INV2 (5 << 8) # define R200_TXA_SCALE_INV4 (6 << 8) # define R200_TXA_SCALE_INV8 (7 << 8) # define R200_TXA_CLAMP_SHIFT 12 # define R200_TXA_CLAMP_MASK (3 << 12) # define R200_TXA_CLAMP_WRAP (0 << 12) # define R200_TXA_CLAMP_0_1 (1 << 12) # define R200_TXA_CLAMP_8_8 (2 << 12) # define R200_TXA_OUTPUT_REG_MASK (7 << 16) # define R200_TXA_OUTPUT_REG_NONE (0 << 16) # define R200_TXA_OUTPUT_REG_R0 (1 << 16) # define R200_TXA_OUTPUT_REG_R1 (2 << 16) # define R200_TXA_OUTPUT_REG_R2 (3 << 16) # define R200_TXA_OUTPUT_REG_R3 (4 << 16) # define R200_TXA_OUTPUT_REG_R4 (5 << 16) # define R200_TXA_OUTPUT_REG_R5 (6 << 16) # define R200_TXA_DOT_ALPHA (1 << 20) # define R200_TXA_REPL_NORMAL 0 # define R200_TXA_REPL_RED 1 # define R200_TXA_REPL_GREEN 2 # define R200_TXA_REPL_ARG_A_SHIFT 26 # define R200_TXA_REPL_ARG_A_MASK (3 << 26) # define R200_TXA_REPL_ARG_B_SHIFT 28 # define R200_TXA_REPL_ARG_B_MASK (3 << 28) # define R200_TXA_REPL_ARG_C_SHIFT 30 # define R200_TXA_REPL_ARG_C_MASK (3 << 30) #define R200_RB3D_BLENDCOLOR 0x3218 /* ARGB 8888 */ #define R200_RB3D_ABLENDCNTL 0x321C /* see BLENDCNTL */ #define R200_RB3D_CBLENDCNTL 0x3220 /* see BLENDCNTL */ #define R200_SE_VTX_FMT_0 0x2088 # define R200_VTX_XY 0 /* always have xy */ # define R200_VTX_Z0 (1<<0) # define R200_VTX_W0 (1<<1) # define R200_VTX_WEIGHT_COUNT_SHIFT (2) # define R200_VTX_PV_MATRIX_SEL (1<<5) # define R200_VTX_N0 (1<<6) # define R200_VTX_POINT_SIZE (1<<7) # define R200_VTX_DISCRETE_FOG (1<<8) # define R200_VTX_SHININESS_0 (1<<9) # define R200_VTX_SHININESS_1 (1<<10) # define R200_VTX_COLOR_NOT_PRESENT 0 # define R200_VTX_PK_RGBA 1 # define R200_VTX_FP_RGB 2 # define R200_VTX_FP_RGBA 3 # define R200_VTX_COLOR_MASK 3 # define R200_VTX_COLOR_0_SHIFT 11 # define R200_VTX_COLOR_1_SHIFT 13 # define R200_VTX_COLOR_2_SHIFT 15 # define R200_VTX_COLOR_3_SHIFT 17 # define R200_VTX_COLOR_4_SHIFT 19 # define R200_VTX_COLOR_5_SHIFT 21 # define R200_VTX_COLOR_6_SHIFT 23 # define R200_VTX_COLOR_7_SHIFT 25 # define R200_VTX_XY1 (1<<28) # define R200_VTX_Z1 (1<<29) # define R200_VTX_W1 (1<<30) # define R200_VTX_N1 (1<<31) #define R200_SE_VTX_FMT_1 0x208c # define R200_VTX_TEX0_COMP_CNT_SHIFT 0 # define R200_VTX_TEX1_COMP_CNT_SHIFT 3 # define R200_VTX_TEX2_COMP_CNT_SHIFT 6 # define R200_VTX_TEX3_COMP_CNT_SHIFT 9 # define R200_VTX_TEX4_COMP_CNT_SHIFT 12 # define R200_VTX_TEX5_COMP_CNT_SHIFT 15 #define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 #define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 #define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250 # define R200_OUTPUT_XYZW (1<<0) # define R200_OUTPUT_COLOR_0 (1<<8) # define R200_OUTPUT_COLOR_1 (1<<9) # define R200_OUTPUT_TEX_0 (1<<16) # define R200_OUTPUT_TEX_1 (1<<17) # define R200_OUTPUT_TEX_2 (1<<18) # define R200_OUTPUT_TEX_3 (1<<19) # define R200_OUTPUT_TEX_4 (1<<20) # define R200_OUTPUT_TEX_5 (1<<21) # define R200_OUTPUT_TEX_MASK (0x3f<<16) # define R200_OUTPUT_DISCRETE_FOG (1<<24) # define R200_OUTPUT_PT_SIZE (1<<25) # define R200_FORCE_INORDER_PROC (1<<31) #define R200_PP_CNTL_X 0x2cc4 #define R200_PP_TXMULTI_CTL_0 0x2c1c #define R200_SE_VTX_STATE_CNTL 0x2180 # define R200_UPDATE_USER_COLOR_0_ENA_MASK (1<<16) /* R300 3D registers */ #define R300_MC_INIT_MISC_LAT_TIMER 0x180 # define R300_MC_MISC__MC_CPR_INIT_LAT_SHIFT 0 # define R300_MC_MISC__MC_VF_INIT_LAT_SHIFT 4 # define R300_MC_MISC__MC_DISP0R_INIT_LAT_SHIFT 8 # define R300_MC_MISC__MC_DISP1R_INIT_LAT_SHIFT 12 # define R300_MC_MISC__MC_FIXED_INIT_LAT_SHIFT 16 # define R300_MC_MISC__MC_E2R_INIT_LAT_SHIFT 20 # define R300_MC_MISC__MC_SAME_PAGE_PRIO_SHIFT 24 # define R300_MC_MISC__MC_GLOBW_INIT_LAT_SHIFT 28 #define R300_MC_INIT_GFX_LAT_TIMER 0x154 # define R300_MC_MISC__MC_G3D0R_INIT_LAT_SHIFT 0 # define R300_MC_MISC__MC_G3D1R_INIT_LAT_SHIFT 4 # define R300_MC_MISC__MC_G3D2R_INIT_LAT_SHIFT 8 # define R300_MC_MISC__MC_G3D3R_INIT_LAT_SHIFT 12 # define R300_MC_MISC__MC_TX0R_INIT_LAT_SHIFT 16 # define R300_MC_MISC__MC_TX1R_INIT_LAT_SHIFT 20 # define R300_MC_MISC__MC_GLOBR_INIT_LAT_SHIFT 24 # define R300_MC_MISC__MC_GLOBW_FULL_LAT_SHIFT 28 /* This file contains registers and constants for the R300. They have been found mostly by examining command buffers captured using glxtest, as well as by extrapolating some known registers and constants from the R200. I am fairly certain that they are correct unless stated otherwise in comments. */ #define R300_SE_VPORT_XSCALE 0x1D98 #define R300_SE_VPORT_XOFFSET 0x1D9C #define R300_SE_VPORT_YSCALE 0x1DA0 #define R300_SE_VPORT_YOFFSET 0x1DA4 #define R300_SE_VPORT_ZSCALE 0x1DA8 #define R300_SE_VPORT_ZOFFSET 0x1DAC /* BEGIN: Wild guesses */ #define R300_VAP_OUTPUT_VTX_FMT_0 0x2090 # define R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT (1<<0) # define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT (1<<1) # define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT (1<<2) /* GUESS */ # define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT (1<<3) /* GUESS */ # define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT (1<<4) /* GUESS */ # define R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT (1<<16) /* GUESS */ #define R300_VAP_OUTPUT_VTX_FMT_1 0x2094 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18 # define R300_VAP_OUTPUT_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21 /* END */ #define R300_SE_VTE_CNTL 0x20b0 # define R300_VPORT_X_SCALE_ENA 0x00000001 # define R300_VPORT_X_OFFSET_ENA 0x00000002 # define R300_VPORT_Y_SCALE_ENA 0x00000004 # define R300_VPORT_Y_OFFSET_ENA 0x00000008 # define R300_VPORT_Z_SCALE_ENA 0x00000010 # define R300_VPORT_Z_OFFSET_ENA 0x00000020 # define R300_VTX_XY_FMT 0x00000100 # define R300_VTX_Z_FMT 0x00000200 # define R300_VTX_W0_FMT 0x00000400 # define R300_VTX_W0_NORMALIZE 0x00000800 # define R300_VTX_ST_DENORMALIZED 0x00001000 /* BEGIN: Vertex data assembly - lots of uncertainties */ /* gap */ /* Where do we get our vertex data? // // Vertex data either comes either from immediate mode registers or from // vertex arrays. // There appears to be no mixed mode (though we can force the pitch of // vertex arrays to 0, effectively reusing the same element over and over // again). // // Immediate mode is controlled by the INPUT_CNTL registers. I am not sure // if these registers influence vertex array processing. // // Vertex arrays are controlled via the 3D_LOAD_VBPNTR packet3. // // In both cases, vertex attributes are then passed through INPUT_ROUTE. // Beginning with INPUT_ROUTE_0_0 is a list of WORDs that route vertex data // into the vertex processor's input registers. // The first word routes the first input, the second word the second, etc. // The corresponding input is routed into the register with the given index. // The list is ended by a word with INPUT_ROUTE_END set. // // Always set COMPONENTS_4 in immediate mode. */ #define R300_VAP_INPUT_ROUTE_0_0 0x2150 # define R300_INPUT_ROUTE_COMPONENTS_1 (0 << 0) # define R300_INPUT_ROUTE_COMPONENTS_2 (1 << 0) # define R300_INPUT_ROUTE_COMPONENTS_3 (2 << 0) # define R300_INPUT_ROUTE_COMPONENTS_4 (3 << 0) # define R300_INPUT_ROUTE_COMPONENTS_RGBA (4 << 0) /* GUESS */ # define R300_VAP_INPUT_ROUTE_IDX_SHIFT 8 # define R300_VAP_INPUT_ROUTE_IDX_MASK (31 << 8) /* GUESS */ # define R300_VAP_INPUT_ROUTE_END (1 << 13) # define R300_INPUT_ROUTE_IMMEDIATE_MODE (0 << 14) /* GUESS */ # define R300_INPUT_ROUTE_FLOAT (1 << 14) /* GUESS */ # define R300_INPUT_ROUTE_UNSIGNED_BYTE (2 << 14) /* GUESS */ # define R300_INPUT_ROUTE_FLOAT_COLOR (3 << 14) /* GUESS */ #define R300_VAP_INPUT_ROUTE_0_1 0x2154 #define R300_VAP_INPUT_ROUTE_0_2 0x2158 #define R300_VAP_INPUT_ROUTE_0_3 0x215C #define R300_VAP_INPUT_ROUTE_0_4 0x2160 #define R300_VAP_INPUT_ROUTE_0_5 0x2164 #define R300_VAP_INPUT_ROUTE_0_6 0x2168 #define R300_VAP_INPUT_ROUTE_0_7 0x216C /* gap */ /* Notes: // - always set up to produce at least two attributes: // if vertex program uses only position, fglrx will set normal, too // - INPUT_CNTL_0_COLOR and INPUT_CNTL_COLOR bits are always equal */ #define R300_VAP_INPUT_CNTL_0 0x2180 # define R300_INPUT_CNTL_0_COLOR 0x00000001 #define R300_VAP_INPUT_CNTL_1 0x2184 # define R300_INPUT_CNTL_POS 0x00000001 # define R300_INPUT_CNTL_NORMAL 0x00000002 # define R300_INPUT_CNTL_COLOR 0x00000004 # define R300_INPUT_CNTL_TC0 0x00000400 # define R300_INPUT_CNTL_TC1 0x00000800 # define R300_INPUT_CNTL_TC2 0x00001000 /* GUESS */ # define R300_INPUT_CNTL_TC3 0x00002000 /* GUESS */ # define R300_INPUT_CNTL_TC4 0x00004000 /* GUESS */ # define R300_INPUT_CNTL_TC5 0x00008000 /* GUESS */ # define R300_INPUT_CNTL_TC6 0x00010000 /* GUESS */ # define R300_INPUT_CNTL_TC7 0x00020000 /* GUESS */ /* gap */ /* Words parallel to INPUT_ROUTE_0; All words that are active in INPUT_ROUTE_0 // are set to a swizzling bit pattern, other words are 0. // // In immediate mode, the pattern is always set to xyzw. In vertex array // mode, the swizzling pattern is e.g. used to set zw components in texture // coordinates with only tweo components. */ #define R300_VAP_INPUT_ROUTE_1_0 0x21E0 # define R300_INPUT_ROUTE_SELECT_X 0 # define R300_INPUT_ROUTE_SELECT_Y 1 # define R300_INPUT_ROUTE_SELECT_Z 2 # define R300_INPUT_ROUTE_SELECT_W 3 # define R300_INPUT_ROUTE_SELECT_ZERO 4 # define R300_INPUT_ROUTE_SELECT_ONE 5 # define R300_INPUT_ROUTE_SELECT_MASK 7 # define R300_INPUT_ROUTE_X_SHIFT 0 # define R300_INPUT_ROUTE_Y_SHIFT 3 # define R300_INPUT_ROUTE_Z_SHIFT 6 # define R300_INPUT_ROUTE_W_SHIFT 9 # define R300_INPUT_ROUTE_ENABLE (15 << 12) #define R300_VAP_INPUT_ROUTE_1_1 0x21E4 #define R300_VAP_INPUT_ROUTE_1_2 0x21E8 #define R300_VAP_INPUT_ROUTE_1_3 0x21EC #define R300_VAP_INPUT_ROUTE_1_4 0x21F0 #define R300_VAP_INPUT_ROUTE_1_5 0x21F4 #define R300_VAP_INPUT_ROUTE_1_6 0x21F8 #define R300_VAP_INPUT_ROUTE_1_7 0x21FC /* END */ /* gap */ /* BEGIN: Upload vertex program and data // The programmable vertex shader unit has a memory bank of unknown size // that can be written to in 16 byte units by writing the address into // UPLOAD_ADDRESS, followed by data in UPLOAD_DATA (multiples of 4 DWORDs). // // Pointers into the memory bank are always in multiples of 16 bytes. // // The memory bank is divided into areas with fixed meaning. // // Starting at address UPLOAD_PROGRAM: Vertex program instructions. // Native limits reported by drivers from ATI suggest size 256 (i.e. 4KB), // whereas the difference between known addresses suggests size 512. // // Starting at address UPLOAD_PARAMETERS: Vertex program parameters. // Native reported limits and the VPI layout suggest size 256, whereas // difference between known addresses suggests size 512. // // At address UPLOAD_POINTSIZE is a vector (0, 0, ps, 0), where ps is the // floating point pointsize. The exact purpose of this state is uncertain, // as there is also the R300_RE_POINTSIZE register. // // Multiple vertex programs and parameter sets can be loaded at once, // which could explain the size discrepancy. */ #define R300_VAP_PVS_UPLOAD_ADDRESS 0x2200 # define R300_PVS_UPLOAD_PROGRAM 0x00000000 # define R300_PVS_UPLOAD_PARAMETERS 0x00000200 # define R300_PVS_UPLOAD_POINTSIZE 0x00000406 /* gap */ #define R300_VAP_PVS_UPLOAD_DATA 0x2208 /* END */ /* gap */ /* I do not know the purpose of this register. However, I do know that // it is set to 221C_CLEAR for clear operations and to 221C_NORMAL // for normal rendering. */ #define R300_VAP_UNKNOWN_221C 0x221C # define R300_221C_NORMAL 0x00000000 # define R300_221C_CLEAR 0x0001C000 /* gap */ /* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between // rendering commands and overwriting vertex program parameters. // Therefore, I suspect writing zero to 0x2284 synchronizes the engine and // avoids bugs caused by still running shaders reading bad data from memory. */ #define R300_VAP_PVS_WAITIDLE 0x2284 /* GUESS */ /* Absolutely no clue what this register is about. */ #define R300_VAP_UNKNOWN_2288 0x2288 # define R300_2288_R300 0x00750000 /* -- nh */ # define R300_2288_RV350 0x0000FFFF /* -- Vladimir */ /* gap */ /* Addresses are relative to the vertex program instruction area of the // memory bank. PROGRAM_END points to the last instruction of the active // program // // The meaning of the two UNKNOWN fields is obviously not known. However, // experiments so far have shown that both *must* point to an instruction // inside the vertex program, otherwise the GPU locks up. // fglrx usually sets CNTL_3_UNKNOWN to the end of the program and // CNTL_1_UNKNOWN points to instruction where last write to position takes place. // Most likely this is used to ignore rest of the program in cases where group of verts arent visible. // For some reason this "section" is sometimes accepted other instruction that have // no relationship with position calculations. */ #define R300_VAP_PVS_CNTL_1 0x22D0 # define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0 # define R300_PVS_CNTL_1_POS_END_SHIFT 10 # define R300_PVS_CNTL_1_PROGRAM_END_SHIFT 20 /* Addresses are relative the the vertex program parameters area. */ #define R300_VAP_PVS_CNTL_2 0x22D4 # define R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT 0 # define R300_PVS_CNTL_2_PARAM_COUNT_SHIFT 16 #define R300_VAP_PVS_CNTL_3 0x22D8 # define R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT 10 # define R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT 0 /* The entire range from 0x2300 to 0x2AC inclusive seems to be used for // immediate vertices */ #define R300_VAP_VTX_COLOR_R 0x2464 #define R300_VAP_VTX_COLOR_G 0x2468 #define R300_VAP_VTX_COLOR_B 0x246C #define R300_VAP_VTX_POS_0_X_1 0x2490 /* used for glVertex2*() */ #define R300_VAP_VTX_POS_0_Y_1 0x2494 #define R300_VAP_VTX_COLOR_PKD 0x249C /* RGBA */ #define R300_VAP_VTX_POS_0_X_2 0x24A0 /* used for glVertex3*() */ #define R300_VAP_VTX_POS_0_Y_2 0x24A4 #define R300_VAP_VTX_POS_0_Z_2 0x24A8 #define R300_VAP_VTX_END_OF_PKT 0x24AC /* write 0 to indicate end of packet? */ /* gap */ /* These are values from r300_reg/r300_reg.h - they are known to be correct and are here so we can use one register file instead of several - Vladimir */ #define R300_GB_VAP_RASTER_VTX_FMT_0 0x4000 # define R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT (1<<0) # define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_0_PRESENT (1<<1) # define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_1_PRESENT (1<<2) # define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_2_PRESENT (1<<3) # define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_3_PRESENT (1<<4) # define R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_SPACE (0xf<<5) # define R300_GB_VAP_RASTER_VTX_FMT_0__PT_SIZE_PRESENT (0x1<<16) #define R300_GB_VAP_RASTER_VTX_FMT_1 0x4004 /* each of the following is 3 bits wide, specifies number of components */ # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_0_COMP_CNT_SHIFT 0 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_1_COMP_CNT_SHIFT 3 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_2_COMP_CNT_SHIFT 6 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_3_COMP_CNT_SHIFT 9 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_4_COMP_CNT_SHIFT 12 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_5_COMP_CNT_SHIFT 15 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_6_COMP_CNT_SHIFT 18 # define R300_GB_VAP_RASTER_VTX_FMT_1__TEX_7_COMP_CNT_SHIFT 21 /* UNK30 seems to enables point to quad transformation on textures (or something closely related to that). This bit is rather fatal at the time being due to lackings at pixel shader side */ #define R300_GB_ENABLE 0x4008 # define R300_GB_POINT_STUFF_ENABLE (1<<0) # define R300_GB_LINE_STUFF_ENABLE (1<<1) # define R300_GB_TRIANGLE_STUFF_ENABLE (1<<2) # define R300_GB_STENCIL_AUTO_ENABLE (1<<4) # define R300_GB_UNK30 (1<<30) /* each of the following is 2 bits wide */ #define R300_GB_TEX_REPLICATE 0 #define R300_GB_TEX_ST 1 #define R300_GB_TEX_STR 2 # define R300_GB_TEX0_SOURCE_SHIFT 16 # define R300_GB_TEX1_SOURCE_SHIFT 18 # define R300_GB_TEX2_SOURCE_SHIFT 20 # define R300_GB_TEX3_SOURCE_SHIFT 22 # define R300_GB_TEX4_SOURCE_SHIFT 24 # define R300_GB_TEX5_SOURCE_SHIFT 26 # define R300_GB_TEX6_SOURCE_SHIFT 28 # define R300_GB_TEX7_SOURCE_SHIFT 30 /* MSPOS - positions for multisample antialiasing (?) */ #define R300_GB_MSPOS0 0x4010 /* shifts - each of the fields is 4 bits */ # define R300_GB_MSPOS0__MS_X0_SHIFT 0 # define R300_GB_MSPOS0__MS_Y0_SHIFT 4 # define R300_GB_MSPOS0__MS_X1_SHIFT 8 # define R300_GB_MSPOS0__MS_Y1_SHIFT 12 # define R300_GB_MSPOS0__MS_X2_SHIFT 16 # define R300_GB_MSPOS0__MS_Y2_SHIFT 20 # define R300_GB_MSPOS0__MSBD0_Y 24 # define R300_GB_MSPOS0__MSBD0_X 28 #define R300_GB_MSPOS1 0x4014 # define R300_GB_MSPOS1__MS_X3_SHIFT 0 # define R300_GB_MSPOS1__MS_Y3_SHIFT 4 # define R300_GB_MSPOS1__MS_X4_SHIFT 8 # define R300_GB_MSPOS1__MS_Y4_SHIFT 12 # define R300_GB_MSPOS1__MS_X5_SHIFT 16 # define R300_GB_MSPOS1__MS_Y5_SHIFT 20 # define R300_GB_MSPOS1__MSBD1 24 #define R300_GB_TILE_CONFIG 0x4018 # define R300_GB_TILE_ENABLE (1<<0) # define R300_GB_TILE_PIPE_COUNT_RV300 0 # define R300_GB_TILE_PIPE_COUNT_R300 (3<<1) # define R300_GB_TILE_PIPE_COUNT_R420 (7<<1) # define R300_GB_TILE_SIZE_8 0 # define R300_GB_TILE_SIZE_16 (1<<4) # define R300_GB_TILE_SIZE_32 (2<<4) # define R300_GB_SUPER_SIZE_1 (0<<6) # define R300_GB_SUPER_SIZE_2 (1<<6) # define R300_GB_SUPER_SIZE_4 (2<<6) # define R300_GB_SUPER_SIZE_8 (3<<6) # define R300_GB_SUPER_SIZE_16 (4<<6) # define R300_GB_SUPER_SIZE_32 (5<<6) # define R300_GB_SUPER_SIZE_64 (6<<6) # define R300_GB_SUPER_SIZE_128 (7<<6) # define R300_GB_SUPER_X_SHIFT 9 /* 3 bits wide */ # define R300_GB_SUPER_Y_SHIFT 12 /* 3 bits wide */ # define R300_GB_SUPER_TILE_A 0 # define R300_GB_SUPER_TILE_B (1<<15) # define R300_GB_SUBPIXEL_1_12 0 # define R300_GB_SUBPIXEL_1_16 (1<<16) #define R300_GB_FIFO_SIZE 0x4024 /* each of the following is 2 bits wide */ #define R300_GB_FIFO_SIZE_32 0 #define R300_GB_FIFO_SIZE_64 1 #define R300_GB_FIFO_SIZE_128 2 #define R300_GB_FIFO_SIZE_256 3 # define R300_SC_IFIFO_SIZE_SHIFT 0 # define R300_SC_TZFIFO_SIZE_SHIFT 2 # define R300_SC_BFIFO_SIZE_SHIFT 4 # define R300_US_OFIFO_SIZE_SHIFT 12 # define R300_US_WFIFO_SIZE_SHIFT 14 /* the following use the same constants as above, but meaning is is times 2 (i.e. instead of 32 words it means 64 */ # define R300_RS_TFIFO_SIZE_SHIFT 6 # define R300_RS_CFIFO_SIZE_SHIFT 8 # define R300_US_RAM_SIZE_SHIFT 10 /* watermarks, 3 bits wide */ # define R300_RS_HIGHWATER_COL_SHIFT 16 # define R300_RS_HIGHWATER_TEX_SHIFT 19 # define R300_OFIFO_HIGHWATER_SHIFT 22 /* two bits only */ # define R300_CUBE_FIFO_HIGHWATER_COL_SHIFT 24 #define R300_GB_SELECT 0x401C # define R300_GB_FOG_SELECT_C0A 0 # define R300_GB_FOG_SELECT_C1A 1 # define R300_GB_FOG_SELECT_C2A 2 # define R300_GB_FOG_SELECT_C3A 3 # define R300_GB_FOG_SELECT_1_1_W 4 # define R300_GB_FOG_SELECT_Z 5 # define R300_GB_DEPTH_SELECT_Z 0 # define R300_GB_DEPTH_SELECT_1_1_W (1<<3) # define R300_GB_W_SELECT_1_W 0 # define R300_GB_W_SELECT_1 (1<<4) #define R300_GB_AA_CONFIG 0x4020 # define R300_AA_ENABLE 0x01 # define R300_AA_SUBSAMPLES_2 0 # define R300_AA_SUBSAMPLES_3 (1<<1) # define R300_AA_SUBSAMPLES_4 (2<<1) # define R300_AA_SUBSAMPLES_6 (3<<1) /* END */ /* gap */ /* Zero to flush caches. */ #define R300_TX_CNTL 0x4100 /* The upper enable bits are guessed, based on fglrx reported limits. */ #define R300_TX_ENABLE 0x4104 # define R300_TX_ENABLE_0 (1 << 0) # define R300_TX_ENABLE_1 (1 << 1) # define R300_TX_ENABLE_2 (1 << 2) # define R300_TX_ENABLE_3 (1 << 3) # define R300_TX_ENABLE_4 (1 << 4) # define R300_TX_ENABLE_5 (1 << 5) # define R300_TX_ENABLE_6 (1 << 6) # define R300_TX_ENABLE_7 (1 << 7) # define R300_TX_ENABLE_8 (1 << 8) # define R300_TX_ENABLE_9 (1 << 9) # define R300_TX_ENABLE_10 (1 << 10) # define R300_TX_ENABLE_11 (1 << 11) # define R300_TX_ENABLE_12 (1 << 12) # define R300_TX_ENABLE_13 (1 << 13) # define R300_TX_ENABLE_14 (1 << 14) # define R300_TX_ENABLE_15 (1 << 15) /* The pointsize is given in multiples of 6. The pointsize can be // enormous: Clear() renders a single point that fills the entire // framebuffer. */ #define R300_RE_POINTSIZE 0x421C # define R300_POINTSIZE_Y_SHIFT 0 # define R300_POINTSIZE_Y_MASK (0xFFFF << 0) /* GUESS */ # define R300_POINTSIZE_X_SHIFT 16 # define R300_POINTSIZE_X_MASK (0xFFFF << 16) /* GUESS */ # define R300_POINTSIZE_MAX (R300_POINTSIZE_Y_MASK / 6) /* The line width is given in multiples of 6. In default mode lines are classified as vertical lines. HO: horizontal VE: vertical or horizontal HO & VE: no classification */ #define R300_RE_LINE_CNT 0x4234 # define R300_LINESIZE_SHIFT 0 # define R300_LINESIZE_MASK (0xFFFF << 0) /* GUESS */ # define R300_LINESIZE_MAX (R300_LINESIZE_MASK / 6) # define R300_LINE_CNT_HO (1 << 16) # define R300_LINE_CNT_VE (1 << 17) /* Some sort of scale or clamp value for texcoordless textures. */ #define R300_RE_UNK4238 0x4238 #define R300_RE_SHADE_MODEL 0x4278 # define R300_RE_SHADE_MODEL_SMOOTH 0x3aaaa # define R300_RE_SHADE_MODEL_FLAT 0x39595 /* Dangerous */ #define R300_RE_POLYGON_MODE 0x4288 # define R300_PM_ENABLED (1 << 0) # define R300_PM_FRONT_POINT (0 << 0) # define R300_PM_BACK_POINT (0 << 0) # define R300_PM_FRONT_LINE (1 << 4) # define R300_PM_FRONT_FILL (1 << 5) # define R300_PM_BACK_LINE (1 << 7) # define R300_PM_BACK_FILL (1 << 8) /* Not sure why there are duplicate of factor and constant values. My best guess so far is that there are seperate zbiases for test and write. Ordering might be wrong. Some of the tests indicate that fgl has a fallback implementation of zbias via pixel shaders. */ #define R300_RE_ZBIAS_T_FACTOR 0x42A4 #define R300_RE_ZBIAS_T_CONSTANT 0x42A8 #define R300_RE_ZBIAS_W_FACTOR 0x42AC #define R300_RE_ZBIAS_W_CONSTANT 0x42B0 /* This register needs to be set to (1<<1) for RV350 to correctly perform depth test (see --vb-triangles in r300_demo) Don't know about other chips. - Vladimir This is set to 3 when GL_POLYGON_OFFSET_FILL is on. My guess is that there are two bits for each zbias primitive (FILL, LINE, POINT). One to enable depth test and one for depth write. Yet this doesnt explain why depth writes work ... */ #define R300_RE_OCCLUSION_CNTL 0x42B4 # define R300_OCCLUSION_ON (1<<1) #define R300_RE_CULL_CNTL 0x42B8 # define R300_CULL_FRONT (1 << 0) # define R300_CULL_BACK (1 << 1) # define R300_FRONT_FACE_CCW (0 << 2) # define R300_FRONT_FACE_CW (1 << 2) /* BEGIN: Rasterization / Interpolators - many guesses // 0_UNKNOWN_18 has always been set except for clear operations. // TC_CNT is the number of incoming texture coordinate sets (i.e. it depends // on the vertex program, *not* the fragment program) */ #define R300_RS_CNTL_0 0x4300 # define R300_RS_CNTL_TC_CNT_SHIFT 2 # define R300_RS_CNTL_TC_CNT_MASK (7 << 2) # define R300_RS_CNTL_CI_CNT_SHIFT 7 /* number of color interpolators used */ # define R300_RS_CNTL_0_UNKNOWN_18 (1 << 18) /* Guess: RS_CNTL_1 holds the index of the highest used RS_ROUTE_n register. */ #define R300_RS_CNTL_1 0x4304 /* gap */ /* Only used for texture coordinates. // Use the source field to route texture coordinate input from the vertex program // to the desired interpolator. Note that the source field is relative to the // outputs the vertex program *actually* writes. If a vertex program only writes // texcoord[1], this will be source index 0. // Set INTERP_USED on all interpolators that produce data used by the // fragment program. INTERP_USED looks like a swizzling mask, but // I haven't seen it used that way. // // Note: The _UNKNOWN constants are always set in their respective register. // I don't know if this is necessary. */ #define R300_RS_INTERP_0 0x4310 #define R300_RS_INTERP_1 0x4314 # define R300_RS_INTERP_1_UNKNOWN 0x40 #define R300_RS_INTERP_2 0x4318 # define R300_RS_INTERP_2_UNKNOWN 0x80 #define R300_RS_INTERP_3 0x431C # define R300_RS_INTERP_3_UNKNOWN 0xC0 #define R300_RS_INTERP_4 0x4320 #define R300_RS_INTERP_5 0x4324 #define R300_RS_INTERP_6 0x4328 #define R300_RS_INTERP_7 0x432C # define R300_RS_INTERP_SRC_SHIFT 2 # define R300_RS_INTERP_SRC_MASK (7 << 2) # define R300_RS_INTERP_USED 0x00D10000 /* These DWORDs control how vertex data is routed into fragment program // registers, after interpolators. */ #define R300_RS_ROUTE_0 0x4330 #define R300_RS_ROUTE_1 0x4334 #define R300_RS_ROUTE_2 0x4338 #define R300_RS_ROUTE_3 0x433C /* GUESS */ #define R300_RS_ROUTE_4 0x4340 /* GUESS */ #define R300_RS_ROUTE_5 0x4344 /* GUESS */ #define R300_RS_ROUTE_6 0x4348 /* GUESS */ #define R300_RS_ROUTE_7 0x434C /* GUESS */ # define R300_RS_ROUTE_SOURCE_INTERP_0 0 # define R300_RS_ROUTE_SOURCE_INTERP_1 1 # define R300_RS_ROUTE_SOURCE_INTERP_2 2 # define R300_RS_ROUTE_SOURCE_INTERP_3 3 # define R300_RS_ROUTE_SOURCE_INTERP_4 4 # define R300_RS_ROUTE_SOURCE_INTERP_5 5 /* GUESS */ # define R300_RS_ROUTE_SOURCE_INTERP_6 6 /* GUESS */ # define R300_RS_ROUTE_SOURCE_INTERP_7 7 /* GUESS */ # define R300_RS_ROUTE_ENABLE (1 << 3) /* GUESS */ # define R300_RS_ROUTE_DEST_SHIFT 6 # define R300_RS_ROUTE_DEST_MASK (31 << 6) /* GUESS */ /* Special handling for color: When the fragment program uses color, // the ROUTE_0_COLOR bit is set and ROUTE_0_COLOR_DEST contains the // color register index. */ # define R300_RS_ROUTE_0_COLOR (1 << 14) # define R300_RS_ROUTE_0_COLOR_DEST_SHIFT 17 # define R300_RS_ROUTE_0_COLOR_DEST_MASK (31 << 17) /* GUESS */ /* As above, but for secondary color */ # define R300_RS_ROUTE_1_COLOR1 (1 << 14) # define R300_RS_ROUTE_1_COLOR1_DEST_SHIFT 17 # define R300_RS_ROUTE_1_COLOR1_DEST_MASK (31 << 17) # define R300_RS_ROUTE_1_UNKNOWN11 (1 << 11) /* END */ /* BEGIN: Scissors and cliprects // There are four clipping rectangles. Their corner coordinates are inclusive. // Every pixel is assigned a number from 0 and 15 by setting bits 0-3 depending // on whether the pixel is inside cliprects 0-3, respectively. For example, // if a pixel is inside cliprects 0 and 1, but outside 2 and 3, it is assigned // the number 3 (binary 0011). // Iff the bit corresponding to the pixel's number in RE_CLIPRECT_CNTL is set, // the pixel is rasterized. // // In addition to this, there is a scissors rectangle. Only pixels inside the // scissors rectangle are drawn. (coordinates are inclusive) // // For some reason, the top-left corner of the framebuffer is at (1440, 1440) // for the purpose of clipping and scissors. */ #define R300_RE_CLIPRECT_TL_0 0x43B0 #define R300_RE_CLIPRECT_BR_0 0x43B4 #define R300_RE_CLIPRECT_TL_1 0x43B8 #define R300_RE_CLIPRECT_BR_1 0x43BC #define R300_RE_CLIPRECT_TL_2 0x43C0 #define R300_RE_CLIPRECT_BR_2 0x43C4 #define R300_RE_CLIPRECT_TL_3 0x43C8 #define R300_RE_CLIPRECT_BR_3 0x43CC # define R300_CLIPRECT_OFFSET 1440 # define R300_CLIPRECT_MASK 0x1FFF # define R300_CLIPRECT_X_SHIFT 0 # define R300_CLIPRECT_X_MASK (0x1FFF << 0) # define R300_CLIPRECT_Y_SHIFT 13 # define R300_CLIPRECT_Y_MASK (0x1FFF << 13) #define R300_RE_CLIPRECT_CNTL 0x43D0 # define R300_CLIP_OUT (1 << 0) # define R300_CLIP_0 (1 << 1) # define R300_CLIP_1 (1 << 2) # define R300_CLIP_10 (1 << 3) # define R300_CLIP_2 (1 << 4) # define R300_CLIP_20 (1 << 5) # define R300_CLIP_21 (1 << 6) # define R300_CLIP_210 (1 << 7) # define R300_CLIP_3 (1 << 8) # define R300_CLIP_30 (1 << 9) # define R300_CLIP_31 (1 << 10) # define R300_CLIP_310 (1 << 11) # define R300_CLIP_32 (1 << 12) # define R300_CLIP_320 (1 << 13) # define R300_CLIP_321 (1 << 14) # define R300_CLIP_3210 (1 << 15) /* gap */ #define R300_RE_SCISSORS_TL 0x43E0 #define R300_RE_SCISSORS_BR 0x43E4 # define R300_SCISSORS_OFFSET 1440 # define R300_SCISSORS_X_SHIFT 0 # define R300_SCISSORS_X_MASK (0x1FFF << 0) # define R300_SCISSORS_Y_SHIFT 13 # define R300_SCISSORS_Y_MASK (0x1FFF << 13) /* END */ /* BEGIN: Texture specification // The texture specification dwords are grouped by meaning and not by texture unit. // This means that e.g. the offset for texture image unit N is found in register // TX_OFFSET_0 + (4*N) */ #define R300_TX_FILTER_0 0x4400 #define R300_TX_FILTER_1 0x4404 # define R300_TX_REPEAT 0 # define R300_TX_MIRRORED 1 # define R300_TX_CLAMP 4 # define R300_TX_CLAMP_TO_EDGE 2 # define R300_TX_CLAMP_TO_BORDER 6 # define R300_TX_WRAP_S_SHIFT 0 # define R300_TX_WRAP_S_MASK (7 << 0) # define R300_TX_WRAP_T_SHIFT 3 # define R300_TX_WRAP_T_MASK (7 << 3) # define R300_TX_WRAP_Q_SHIFT 6 # define R300_TX_WRAP_Q_MASK (7 << 6) # define R300_TX_MAG_FILTER_NEAREST (1 << 9) # define R300_TX_MAG_FILTER_LINEAR (2 << 9) # define R300_TX_MAG_FILTER_MASK (3 << 9) # define R300_TX_MIN_FILTER_NEAREST (1 << 11) # define R300_TX_MIN_FILTER_LINEAR (2 << 11) # define R300_TX_MIN_FILTER_NEAREST_MIP_NEAREST (5 << 11) # define R300_TX_MIN_FILTER_NEAREST_MIP_LINEAR (9 << 11) # define R300_TX_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 11) # define R300_TX_MIN_FILTER_LINEAR_MIP_LINEAR (10 << 11) /* NOTE: NEAREST doesnt seem to exist. Im not seting MAG_FILTER_MASK and (3 << 11) on for all anisotropy modes because that would void selected mag filter */ # define R300_TX_MIN_FILTER_ANISO_NEAREST ((0 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/) # define R300_TX_MIN_FILTER_ANISO_LINEAR ((0 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/) # define R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST ((1 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/) # define R300_TX_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR ((2 << 13) /*|R300_TX_MAG_FILTER_MASK|(3<<11)*/) # define R300_TX_MIN_FILTER_MASK ( (15 << 11) | (3 << 13) ) # define R300_TX_MAX_ANISO_1_TO_1 (0 << 21) # define R300_TX_MAX_ANISO_2_TO_1 (2 << 21) # define R300_TX_MAX_ANISO_4_TO_1 (4 << 21) # define R300_TX_MAX_ANISO_8_TO_1 (6 << 21) # define R300_TX_MAX_ANISO_16_TO_1 (8 << 21) # define R300_TX_MAX_ANISO_MASK (14 << 21) #define R300_TX_FILTER1_0 0x4440 #define R300_TX_FILTER1_1 0x4444 # define R300_CHROMA_KEY_MODE_DISABLE 0 # define R300_CHROMA_KEY_FORCE 1 # define R300_CHROMA_KEY_BLEND 2 # define R300_MC_ROUND_NORMAL (0<<2) # define R300_MC_ROUND_MPEG4 (1<<2) # define R300_LOD_BIAS_MASK 0x1fff # define R300_EDGE_ANISO_EDGE_DIAG (0<<13) # define R300_EDGE_ANISO_EDGE_ONLY (1<<13) # define R300_MC_COORD_TRUNCATE_DISABLE (0<<14) # define R300_MC_COORD_TRUNCATE_MPEG (1<<14) # define R300_TX_TRI_PERF_0_8 (0<<15) # define R300_TX_TRI_PERF_1_8 (1<<15) # define R300_TX_TRI_PERF_1_4 (2<<15) # define R300_TX_TRI_PERF_3_8 (3<<15) # define R300_ANISO_THRESHOLD_MASK (7<<17) #define R300_TX_SIZE_0 0x4480 #define R300_TX_SIZE_1 0x4484 # define R300_TX_WIDTH_SHIFT 0 # define R300_TX_WIDTH_MASK (2047 << 0) # define R300_TX_HEIGHT_SHIFT 11 # define R300_TX_HEIGHT_MASK (2047 << 11) # define R300_TX_UNK23 (1 << 23) # define R300_TX_SIZE_SHIFT 26 /* largest of width, height */ # define R300_TX_SIZE_MASK (15 << 26) # define R300_TX_SIZE_PROJECTED (1<<30) # define R300_TX_SIZE_TXPITCH_EN (1<<31) #define R300_TX_FORMAT_0 0x44C0 #define R300_TX_FORMAT_1 0x44C4 /* The interpretation of the format word by Wladimir van der Laan */ /* The X, Y, Z and W refer to the layout of the components. They are given meanings as R, G, B and Alpha by the swizzle specification */ # define R300_TX_FORMAT_X8 0x0 # define R300_TX_FORMAT_X16 0x1 # define R300_TX_FORMAT_Y4X4 0x2 # define R300_TX_FORMAT_Y8X8 0x3 # define R300_TX_FORMAT_Y16X16 0x4 # define R300_TX_FORMAT_Z3Y3X2 0x5 # define R300_TX_FORMAT_Z5Y6X5 0x6 # define R300_TX_FORMAT_Z6Y5X5 0x7 # define R300_TX_FORMAT_Z11Y11X10 0x8 # define R300_TX_FORMAT_Z10Y11X11 0x9 # define R300_TX_FORMAT_W4Z4Y4X4 0xA # define R300_TX_FORMAT_W1Z5Y5X5 0xB # define R300_TX_FORMAT_W8Z8Y8X8 0xC # define R300_TX_FORMAT_W2Z10Y10X10 0xD # define R300_TX_FORMAT_W16Z16Y16X16 0xE # define R300_TX_FORMAT_DXT1 0xF # define R300_TX_FORMAT_DXT3 0x10 # define R300_TX_FORMAT_DXT5 0x11 # define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */ # define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */ # define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */ # define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */ /* 0x16 - some 16 bit green format.. ?? */ # define R300_TX_FORMAT_UNK25 (1 << 25) /* no swizzle */ # define R300_TX_FORMAT_CUBIC_MAP (1 << 26) /* gap */ /* Floating point formats */ /* Note - hardware supports both 16 and 32 bit floating point */ # define R300_TX_FORMAT_FL_I16 0x18 # define R300_TX_FORMAT_FL_I16A16 0x19 # define R300_TX_FORMAT_FL_R16G16B16A16 0x1A # define R300_TX_FORMAT_FL_I32 0x1B # define R300_TX_FORMAT_FL_I32A32 0x1C # define R300_TX_FORMAT_FL_R32G32B32A32 0x1D /* alpha modes, convenience mostly */ /* if you have alpha, pick constant appropriate to the number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */ # define R300_TX_FORMAT_ALPHA_1CH 0x000 # define R300_TX_FORMAT_ALPHA_2CH 0x200 # define R300_TX_FORMAT_ALPHA_4CH 0x600 # define R300_TX_FORMAT_ALPHA_NONE 0xA00 /* Swizzling */ /* constants */ # define R300_TX_FORMAT_X 0 # define R300_TX_FORMAT_Y 1 # define R300_TX_FORMAT_Z 2 # define R300_TX_FORMAT_W 3 # define R300_TX_FORMAT_ZERO 4 # define R300_TX_FORMAT_ONE 5 # define R300_TX_FORMAT_CUT_Z 6 /* 2.0*Z, everything above 1.0 is set to 0.0 */ # define R300_TX_FORMAT_CUT_W 7 /* 2.0*W, everything above 1.0 is set to 0.0 */ # define R300_TX_FORMAT_B_SHIFT 18 # define R300_TX_FORMAT_G_SHIFT 15 # define R300_TX_FORMAT_R_SHIFT 12 # define R300_TX_FORMAT_A_SHIFT 9 /* Convenience macro to take care of layout and swizzling */ # define R300_EASY_TXFORMAT(B, G, R, A, FMT) (\ ((R300_TX_FORMAT_##B)< * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_3d.h" #define EMIT_VERTICES( rdrv, rdev, mmio ) { \ u32 *_v = (rdev)->vb; \ u32 _s = (rdev)->vb_size; \ radeon_waitfifo( rdrv, rdev, 1 ); \ radeon_out32( mmio, SE_VF_CNTL, rdev->vb_type | VF_PRIM_WALK_DATA | VF_RADEON_MODE | \ (rdev->vb_count << VF_NUM_VERTICES_SHIFT) ); \ do { \ u32 _n = MIN(_s, 64); \ _s -= _n; \ radeon_waitfifo( rdrv, rdev, _n ); \ while (_n--) \ radeon_out32( mmio, SE_PORT_DATA0, *_v++ ); \ } while (_s); \ } static void r100_flush_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; EMIT_VERTICES( rdrv, rdev, mmio ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { DFBRegion *clip = &rdev->clip; bool s420 = DFB_PLANAR_PIXELFORMAT(rdev->src_format); int i; if (DFB_BLITTING_FUNCTION(rdev->accel)) { for (i = 0; i < rdev->vb_size; i += 4) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); if (s420) { rdev->vb[i+2] = f2d(d2f(rdev->vb[i+2])*0.5f); rdev->vb[i+3] = f2d(d2f(rdev->vb[i+3])*0.5f); } } } else { for (i = 0; i < rdev->vb_size; i += 2) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); } } /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2/2 << 16) | (clip->x2/2 & 0xffff) ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, PP_TFACTOR_0, rdev->cb_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height/2-1) << 16) | ((rdev->src_width/2-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch/2 - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset_cb ); } } else { radeon_out32( mmio, PP_TFACTOR_1, rdev->cb_cop ); } /* Fill Cb plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cr ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, PP_TFACTOR_0, rdev->cr_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset_cr ); } } else { radeon_out32( mmio, PP_TFACTOR_1, rdev->cr_cop ); } /* Fill Cr plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, PP_TFACTOR_0, rdev->y_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset ); } } else { radeon_out32( mmio, PP_TFACTOR_1, rdev->y_cop ); } } rdev->vb_size = 0; rdev->vb_count = 0; } static inline u32* r100_init_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev, u32 type, u32 count, u32 size ) { u32 *vb; if ((rdev->vb_size && rdev->vb_type != type) || rdev->vb_size+size > D_ARRAY_SIZE(rdev->vb)) r100_flush_vb( rdrv, rdev ); vb = &rdev->vb[rdev->vb_size]; rdev->vb_type = type; rdev->vb_size += size; rdev->vb_count += count; return vb; } bool r100FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; if (rect->w == 1 && rect->h == 1) { x1 = rect->x+1; y1 = rect->y+1; if (rdev->matrix) RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_POINT_LIST, 1, 2 ); *v++ = f2d(x1); *v++ = f2d(y1); return true; } x1 = rect->x; y1 = rect->y; x2 = rect->x+rect->w; y2 = rect->y+rect->h; if (rdev->matrix) { float X1, Y1, X2, Y2, X3, Y3, X4, Y4; RADEON_TRANSFORM( x1, y1, X1, Y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y1, X2, Y2, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, X3, Y3, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x1, y2, X4, Y4, rdev->matrix, rdev->affine_matrix ); v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_TRIANGLE_LIST, 6, 12 ); *v++ = f2d(X1); *v++ = f2d(Y1); *v++ = f2d(X2); *v++ = f2d(Y2); *v++ = f2d(X3); *v++ = f2d(Y3); *v++ = f2d(X1); *v++ = f2d(Y1); *v++ = f2d(X3); *v++ = f2d(Y3); *v++ = f2d(X4); *v++ = f2d(Y4); } else { v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_RECTANGLE_LIST, 3, 6 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y2); } return true; } bool r100FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; float x3, y3; u32 *v; x1 = tri->x1; y1 = tri->y1; x2 = tri->x2; y2 = tri->y2; x3 = tri->x3; y3 = tri->y3; if (rdev->matrix) { RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, x2, y2, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x3, y3, x3, y3, rdev->matrix, rdev->affine_matrix ); } v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_TRIANGLE_LIST, 3, 6 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y2); *v++ = f2d(x3); *v++ = f2d(y3); return true; } bool r100DrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; x1 = rect->x; y1 = rect->y; x2 = rect->x+rect->w; y2 = rect->y+rect->h; if (rdev->matrix) { float x, y; /* XXX: better LINE_STRIP?! */ v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LIST, 8, 16 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); } else { v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_RECTANGLE_LIST, 12, 24 ); /* top line */ *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y1+1); /* right line */ *v++ = f2d(x2-1); *v++ = f2d(y1+1); *v++ = f2d(x2); *v++ = f2d(y1+1); *v++ = f2d(x2); *v++ = f2d(y2-1); /* bottom line */ *v++ = f2d(x1); *v++ = f2d(y2-1); *v++ = f2d(x2); *v++ = f2d(y2-1); *v++ = f2d(x2); *v++ = f2d(y2); /* left line */ *v++ = f2d(x1); *v++ = f2d(y1+1); *v++ = f2d(x1+1); *v++ = f2d(y1+1); *v++ = f2d(x1+1); *v++ = f2d(y2-1); } return true; } bool r100DrawLine3D( void *drv, void *dev, DFBRegion *line ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; x1 = line->x1; y1 = line->y1; x2 = line->x2; y2 = line->y2; if (rdev->matrix) { RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, x2, y2, rdev->matrix, rdev->affine_matrix ); } v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LIST, 2, 4 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y2); return true; } bool r100Blit3D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ) { DFBRectangle dr = { dx, dy, sr->w, sr->h }; return r100StretchBlit( drv, dev, sr, &dr ); } bool r100StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; float s1, t1; float s2, t2; u32 *v; if (rdev->blittingflags & DSBLIT_DEINTERLACE) { sr->y /= 2; sr->h /= 2; } s1 = sr->x; t1 = sr->y; s2 = sr->x+sr->w; t2 = sr->y+sr->h; if (rdev->blittingflags & DSBLIT_ROTATE180) { float tmp; tmp = s2; s2 = s1; s1 = tmp; tmp = t2; t2 = t1; t1 = tmp; } x1 = dr->x; y1 = dr->y; x2 = dr->x+dr->w; y2 = dr->y+dr->h; if (rdev->matrix) { float X1, Y1, X2, Y2, X3, Y3, X4, Y4; RADEON_TRANSFORM( x1, y1, X1, Y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y1, X2, Y2, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, X3, Y3, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x1, y2, X4, Y4, rdev->matrix, rdev->affine_matrix ); v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_TRIANGLE_LIST, 6, 24 ); *v++ = f2d(X1); *v++ = f2d(Y1); *v++ = f2d(s1); *v++ = f2d(t1); *v++ = f2d(X2); *v++ = f2d(Y2); *v++ = f2d(s2); *v++ = f2d(t1); *v++ = f2d(X3); *v++ = f2d(Y3); *v++ = f2d(s2); *v++ = f2d(t2); *v++ = f2d(X1); *v++ = f2d(Y1); *v++ = f2d(s1); *v++ = f2d(t1); *v++ = f2d(X3); *v++ = f2d(Y3); *v++ = f2d(s2); *v++ = f2d(t2); *v++ = f2d(X4); *v++ = f2d(Y4); *v++ = f2d(s1); *v++ = f2d(t2); } else { v = r100_init_vb( rdrv, rdev, VF_PRIM_TYPE_RECTANGLE_LIST, 3, 12 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(s1); *v++ = f2d(t1); *v++ = f2d(x2); *v++ = f2d(y1); *v++ = f2d(s2); *v++ = f2d(t1); *v++ = f2d(x2); *v++ = f2d(y2); *v++ = f2d(s2); *v++ = f2d(t2); } return true; } static void r100DoTextureTriangles( RadeonDriverData *rdrv, RadeonDeviceData *rdev, DFBVertex *ve, int num, u32 primitive ) { volatile u8 *mmio = rdrv->mmio_base; int i; radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, SE_VF_CNTL, primitive | VF_PRIM_WALK_DATA | VF_RADEON_MODE | (num << VF_NUM_VERTICES_SHIFT) ); for (; num >= 10; num -= 10) { radeon_waitfifo( rdrv, rdev, 60 ); for (i = 0; i < 10; i++) { radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].x) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].y) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].z) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].w) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].s) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].t) ); } ve += 10; } if (num > 0) { radeon_waitfifo( rdrv, rdev, num*6 ); for (i = 0; i < num; i++) { radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].x) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].y) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].z) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].w) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].s) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].t) ); } } } bool r100TextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; u32 prim = 0; int i; if (num > 65535) { D_WARN( "R100 supports maximum 65535 vertices" ); return false; } switch (formation) { case DTTF_LIST: prim = VF_PRIM_TYPE_TRIANGLE_LIST; break; case DTTF_STRIP: prim = VF_PRIM_TYPE_TRIANGLE_STRIP; break; case DTTF_FAN: prim = VF_PRIM_TYPE_TRIANGLE_FAN; break; default: D_BUG( "unexpected triangle formation" ); return false; } if (rdev->matrix) { for (i = 0; i < num; i++) RADEON_TRANSFORM( ve[i].x, ve[i].y, ve[i].x, ve[i].y, rdev->matrix, rdev->affine_matrix ); } r100DoTextureTriangles( rdrv, rdev, ve, num, prim ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { DFBRegion *clip = &rdev->clip; volatile u8 *mmio = rdrv->mmio_base; bool s420 = DFB_PLANAR_PIXELFORMAT(rdev->src_format); int i; /* Scale coordinates */ for (i = 0; i < num; i++) { ve[i].x *= 0.5; ve[i].y *= 0.5; } /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, s420 ? 8 : 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch/2 ); if (s420) { radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height/2-1) << 16) | ((rdev->src_width/2-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch/2 - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset_cb ); } radeon_out32( mmio, RE_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2/2 << 16) | (clip->x2/2 & 0xffff) ); radeon_out32( mmio, PP_TFACTOR_0, rdev->cb_cop ); /* Map Cb plane */ r100DoTextureTriangles( rdrv, rdev, ve, num, prim ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, s420 ? 3 : 2 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cr ); if (s420) radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset_cr ); radeon_out32( mmio, PP_TFACTOR_0, rdev->cr_cop ); /* Map Cr plane */ r100DoTextureTriangles( rdrv, rdev, ve, num, prim ); /* Reset */ radeon_waitfifo( rdrv, rdev, s420 ? 8 : 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch ); if (s420) { radeon_out32( mmio, PP_TEX_SIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, PP_TEX_PITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset ); } radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); radeon_out32( mmio, PP_TFACTOR_0, rdev->y_cop ); } return true; } void r100EmitCommands3D( void *drv, void *dev ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->vb_count) r100_flush_vb( rdrv, rdev ); } DirectFB-1.2.10/gfxdrivers/radeon/r300_program.h0000644000175000017500000001224111164361026016155 00000000000000/* Copyright (C) 2004 Nicolai Haehnle. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ /* * Authors: * Nicolai Haehnle */ #ifndef __R300_PROGRAM_H__ #define __R300_PROGRAM_H__ #include "radeon_regs.h" /** * Vertex program helper macros */ /* Produce out dword */ #define VP_OUTCLASS_TMP R300_VPI_OUT_REG_CLASS_TEMPORARY #define VP_OUTCLASS_OUT R300_VPI_OUT_REG_CLASS_RESULT #define VP_OUTMASK_X R300_VPI_OUT_WRITE_X #define VP_OUTMASK_Y R300_VPI_OUT_WRITE_Y #define VP_OUTMASK_Z R300_VPI_OUT_WRITE_Z #define VP_OUTMASK_W R300_VPI_OUT_WRITE_W #define VP_OUTMASK_XY (VP_OUTMASK_X|VP_OUTMASK_Y) #define VP_OUTMASK_XZ (VP_OUTMASK_X|VP_OUTMASK_Z) #define VP_OUTMASK_XW (VP_OUTMASK_X|VP_OUTMASK_W) #define VP_OUTMASK_XYZ (VP_OUTMASK_XY|VP_OUTMASK_Z) #define VP_OUTMASK_XYW (VP_OUTMASK_XY|VP_OUTMASK_W) #define VP_OUTMASK_XZW (VP_OUTMASK_XZ|VP_OUTMASK_W) #define VP_OUTMASK_XYZW (VP_OUTMASK_XYZ|VP_OUTMASK_W) #define VP_OUTMASK_YZ (VP_OUTMASK_Y|VP_OUTMASK_Z) #define VP_OUTMASK_YW (VP_OUTMASK_Y|VP_OUTMASK_W) #define VP_OUTMASK_YZW (VP_OUTMASK_YZ|VP_OUTMASK_W) #define VP_OUTMASK_ZW (VP_OUTMASK_Z|VP_OUTMASK_W) #define VP_OUT(instr,outclass,outidx,outmask) \ (R300_VPI_OUT_OP_##instr | \ ((outidx) << R300_VPI_OUT_REG_INDEX_SHIFT) | \ VP_OUTCLASS_##outclass | \ VP_OUTMASK_##outmask) /* Produce in dword */ #define VP_INCLASS_TMP R300_VPI_IN_REG_CLASS_TEMPORARY #define VP_INCLASS_IN R300_VPI_IN_REG_CLASS_ATTRIBUTE #define VP_INCLASS_CONST R300_VPI_IN_REG_CLASS_PARAMETER #define VP_IN(class,idx) \ (((idx) << R300_VPI_IN_REG_INDEX_SHIFT) | \ VP_INCLASS_##class | \ (R300_VPI_IN_SELECT_X << R300_VPI_IN_X_SHIFT) | \ (R300_VPI_IN_SELECT_Y << R300_VPI_IN_Y_SHIFT) | \ (R300_VPI_IN_SELECT_Z << R300_VPI_IN_Z_SHIFT) | \ (R300_VPI_IN_SELECT_W << R300_VPI_IN_W_SHIFT)) #define VP_ZERO() \ ((R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_X_SHIFT) | \ (R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_Y_SHIFT) | \ (R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_Z_SHIFT) | \ (R300_VPI_IN_SELECT_ZERO << R300_VPI_IN_W_SHIFT)) #define VP_ONE() \ ((R300_VPI_IN_SELECT_ONE << R300_VPI_IN_X_SHIFT) | \ (R300_VPI_IN_SELECT_ONE << R300_VPI_IN_Y_SHIFT) | \ (R300_VPI_IN_SELECT_ONE << R300_VPI_IN_Z_SHIFT) | \ (R300_VPI_IN_SELECT_ONE << R300_VPI_IN_W_SHIFT)) #define VP_NEG(in,comp) ((in) ^ (R300_VPI_IN_NEG_##comp)) #define VP_NEGALL(in,comp) VP_NEG(VP_NEG(VP_NEG(VP_NEG((in),X),Y),Z),W) /** * Fragment program helper macros */ /* Produce unshifted source selectors */ #define FP_TMP(idx) (idx) #define FP_CONST(idx) ((idx) | (1 << 5)) /* Produce source/dest selector dword */ #define FP_SELC_MASK_NO 0 #define FP_SELC_MASK_X 1 #define FP_SELC_MASK_Y 2 #define FP_SELC_MASK_XY 3 #define FP_SELC_MASK_Z 4 #define FP_SELC_MASK_XZ 5 #define FP_SELC_MASK_YZ 6 #define FP_SELC_MASK_XYZ 7 #define FP_SELC(destidx,regmask,outmask,src0,src1,src2) \ (((destidx) << R300_FPI1_DSTC_SHIFT) | \ (FP_SELC_MASK_##regmask << 23) | \ (FP_SELC_MASK_##outmask << 26) | \ ((src0) << R300_FPI1_SRC0C_SHIFT) | \ ((src1) << R300_FPI1_SRC1C_SHIFT) | \ ((src2) << R300_FPI1_SRC2C_SHIFT)) #define FP_SELA_MASK_NO 0 #define FP_SELA_MASK_W 1 #define FP_SELA(destidx,regmask,outmask,src0,src1,src2) \ (((destidx) << R300_FPI3_DSTA_SHIFT) | \ (FP_SELA_MASK_##regmask << 23) | \ (FP_SELA_MASK_##outmask << 24) | \ ((src0) << R300_FPI3_SRC0A_SHIFT) | \ ((src1) << R300_FPI3_SRC1A_SHIFT) | \ ((src2) << R300_FPI3_SRC2A_SHIFT)) /* Produce unshifted argument selectors */ #define FP_ARGC(source) R300_FPI0_ARGC_##source #define FP_ARGA(source) R300_FPI2_ARGA_##source #define FP_ABS(arg) ((arg) | (1 << 6)) #define FP_NEG(arg) ((arg) ^ (1 << 5)) /* Produce instruction dword */ #define FP_INSTRC(opcode,arg0,arg1,arg2) \ (R300_FPI0_OUTC_##opcode | \ ((arg0) << R300_FPI0_ARG0C_SHIFT) | \ ((arg1) << R300_FPI0_ARG1C_SHIFT) | \ ((arg2) << R300_FPI0_ARG2C_SHIFT)) #define FP_INSTRA(opcode,arg0,arg1,arg2) \ (R300_FPI2_OUTA_##opcode | \ ((arg0) << R300_FPI2_ARG0A_SHIFT) | \ ((arg1) << R300_FPI2_ARG1A_SHIFT) | \ ((arg2) << R300_FPI2_ARG2A_SHIFT)) #include "vertex_shader.h" #endif /* __R300_PROGRAM_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/radeon_crtc1.c0000644000175000017500000001245411164361026016307 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" /*************************** CRTC1 Screen functions **************************/ static DFBResult crtc1WaitVSync( CoreScreen *screen, void *driver_data, void *screen_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; volatile u8 *mmio = rdrv->mmio_base; int i; if (dfb_config->pollvsync_none) return DFB_OK; radeon_out32( mmio, GEN_INT_STATUS, (radeon_in32( mmio, GEN_INT_STATUS ) & ~VSYNC_INT) | VSYNC_INT_AK ); for (i = 0; i < 2000000; i++) { struct timespec t = { 0, 10000 }; if (radeon_in32( mmio, GEN_INT_STATUS ) & VSYNC_INT) break; nanosleep( &t, NULL ); } return DFB_OK; } ScreenFuncs RadeonCrtc1ScreenFuncs = { .WaitVSync = crtc1WaitVSync }; ScreenFuncs OldPrimaryScreenFuncs; void *OldPrimaryScreenDriverData; /*************************** CRTC1 Layer functions **************************/ #define CRTC1_SUPPORTED_OPTIONS ( DLOP_ALPHACHANNEL ) static DFBResult crtc1InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { DFBResult ret; ret = OldPrimaryLayerFuncs.InitLayer( layer, OldPrimaryLayerDriverData, layer_data, description, config, adjustment ); description->caps |= DLCAPS_ALPHACHANNEL; return ret; } static DFBResult crtc1TestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfig layer_config; CoreLayerRegionConfigFlags fail = 0; DFBResult ret; layer_config = *config; layer_config.options &= ~CRTC1_SUPPORTED_OPTIONS; ret = OldPrimaryLayerFuncs.TestRegion( layer, OldPrimaryLayerDriverData, layer_data, &layer_config, &fail ); if (config->options & ~CRTC1_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; if (config->options & DLOP_ALPHACHANNEL && config->format != DSPF_ARGB) fail |= CLRCF_OPTIONS; if (failed) *failed = fail; return fail ? DFB_UNSUPPORTED : DFB_OK; } static DFBResult crtc1SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { if (updated & ~CLRCF_OPTIONS) { return OldPrimaryLayerFuncs.SetRegion( layer, OldPrimaryLayerDriverData, layer_data, region_data, config, updated, surface, palette, lock ); } return DFB_OK; } DisplayLayerFuncs RadeonCrtc1LayerFuncs = { .InitLayer = crtc1InitLayer, .TestRegion = crtc1TestRegion, .SetRegion = crtc1SetRegion }; DisplayLayerFuncs OldPrimaryLayerFuncs; void *OldPrimaryLayerDriverData; DirectFB-1.2.10/gfxdrivers/radeon/r300_3d.c0000644000175000017500000004236311164361026015017 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_state.h" #include "radeon_3d.h" #define EMIT_VERTICES( rdrv, rdev, mmio ) { \ u32 *_v = (rdev)->vb; \ u32 _s = (rdev)->vb_size; \ radeon_waitfifo( rdrv, rdev, 1 ); \ radeon_out32( mmio, SE_VF_CNTL, rdev->vb_type | VF_PRIM_WALK_DATA | \ (rdev->vb_count << VF_NUM_VERTICES_SHIFT) ); \ do { \ u32 _n = MIN(_s, 64); \ _s -= _n; \ radeon_waitfifo( rdrv, rdev, _n ); \ while (_n--) \ radeon_out32( mmio, SE_PORT_DATA0, *_v++ ); \ } while (_s); \ radeon_waitfifo( rdrv, rdev, 2 ); \ radeon_out32( mmio, R300_RB3D_DSTCACHE_CTLSTAT, 0xa ); \ radeon_out32( mmio, 0x4f18, 0x3 ); \ } static void r300_flush_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; EMIT_VERTICES( rdrv, rdev, mmio ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { DFBRegion clip; int i; for (i = 0; i < rdev->vb_size; i += 8) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); } clip.x1 = rdev->clip.x1 >> 1; clip.y1 = rdev->clip.y1 >> 1; clip.x2 = rdev->clip.x2 >> 1; clip.y2 = rdev->clip.y2 >> 1; /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, rdev->dst_offset_cb ); radeon_out32( mmio, R300_RB3D_COLORPITCH0, (rdev->dst_pitch>>1) | R300_COLOR_FORMAT_RGB8 ); radeon_out32( mmio, R300_TX_SIZE_0, ((rdev->src_width/2 -1) << R300_TX_WIDTH_SHIFT) | ((rdev->src_height/2-1) << R300_TX_HEIGHT_SHIFT) | R300_TX_SIZE_TXPITCH_EN ); radeon_out32( mmio, R300_TX_PITCH_0, (rdev->src_pitch>>1) - 8 ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset_cb ); r300_set_clip3d( rdrv, rdev, &clip ); /* Fill Cb plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, rdev->dst_offset_cr ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset_cr ); /* Fill Cr plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, rdev->dst_offset ); radeon_out32( mmio, R300_RB3D_COLORPITCH0, rdev->dst_pitch | R300_COLOR_FORMAT_RGB8 ); radeon_out32( mmio, R300_TX_SIZE_0, ((rdev->src_width -1) << R300_TX_WIDTH_SHIFT) | ((rdev->src_height-1) << R300_TX_HEIGHT_SHIFT) | R300_TX_SIZE_TXPITCH_EN ); radeon_out32( mmio, R300_TX_PITCH_0, rdev->src_pitch - 8 ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset ); r300_set_clip3d( rdrv, rdev, &rdev->clip ); } rdev->vb_size = 0; rdev->vb_count = 0; } static inline u32* r300_init_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev, u32 type, u32 count, u32 size ) { u32 *vb; if ((rdev->vb_size && rdev->vb_type != type) || rdev->vb_size+size > D_ARRAY_SIZE(rdev->vb)) r300_flush_vb( rdrv, rdev ); vb = &rdev->vb[rdev->vb_size]; rdev->vb_type = type; rdev->vb_size += size; rdev->vb_count += count; return vb; } #define VTX(v, x, y, c) \ *(v)++ = f2d(x); \ *(v)++ = f2d(y); \ *(v)++ = f2d(0); \ *(v)++ = f2d(1); \ *(v)++ = f2d(c[0]); \ *(v)++ = f2d(c[1]); \ *(v)++ = f2d(c[2]); \ *(v)++ = f2d(c[3]) bool r300FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; if (rect->w == 1 && rect->h == 1) { x1 = rect->x+1; y1 = rect->y+1; if (rdev->matrix) RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_POINT_LIST, 1, 8 ); VTX( v, x1, y1, rdev->color ); return true; } x1 = rect->x; y1 = rect->y; x2 = rect->x+rect->w; y2 = rect->y+rect->h; if (rdev->matrix) { float x, y; v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_QUAD_LIST, 4, 32 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); } else { v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_QUAD_LIST, 4, 32 ); VTX( v, x1, y1, rdev->color ); VTX( v, x2, y1, rdev->color ); VTX( v, x2, y2, rdev->color ); VTX( v, x1, y2, rdev->color ); } return true; } bool r300FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; float x3, y3; u32 *v; x1 = tri->x1; y1 = tri->y1; x2 = tri->x2; y2 = tri->y2; x3 = tri->x3; y3 = tri->y3; if (rdev->matrix) { RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, x2, y2, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x3, y3, x3, y3, rdev->matrix, rdev->affine_matrix ); } v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_TRIANGLE_LIST, 3, 24 ); VTX( v, x1, y1, rdev->color ); VTX( v, x2, y2, rdev->color ); VTX( v, x3, y3, rdev->color ); return true; } bool r300DrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; x1 = rect->x; y1 = rect->y; x2 = rect->x+rect->w; y2 = rect->y+rect->h; if (rdev->matrix) { float x, y; v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LOOP, 4, 32 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, rdev->color ); } else { v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LOOP, 4, 32 ); VTX( v, x1, y1, rdev->color ); VTX( v, x2, y1, rdev->color ); VTX( v, x2, y2, rdev->color ); VTX( v, x1, y2, rdev->color ); } return true; } bool r300DrawLine3D( void *drv, void *dev, DFBRegion *line ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; x1 = line->x1; y1 = line->y1; x2 = line->x2; y2 = line->y2; if (rdev->matrix) { RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, x2, y2, rdev->matrix, rdev->affine_matrix ); } v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LIST, 2, 16 ); VTX( v, x1, y1, rdev->color ); VTX( v, x2, y2, rdev->color ); return true; } #undef VTX #define VTX( v, x, y, s, t ) \ *(v)++ = f2d(x); \ *(v)++ = f2d(y); \ *(v)++ = f2d(0); \ *(v)++ = f2d(1); \ *(v)++ = f2d(s); \ *(v)++ = f2d(t); \ *(v)++ = f2d(0); \ *(v)++ = f2d(1) bool r300Blit3D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ) { DFBRectangle dr = { dx, dy, sr->w, sr->h }; return r300StretchBlit( drv, dev, sr, &dr ); } bool r300StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; float s1, t1; float s2, t2; u32 *v; if (rdev->blittingflags & DSBLIT_DEINTERLACE) { sr->y /= 2; sr->h /= 2; } s1 = (float)sr->x / rdev->src_width; t1 = (float)sr->y / rdev->src_height; s2 = (float)(sr->x+sr->w) / rdev->src_width; t2 = (float)(sr->y+sr->h) / rdev->src_height; if (rdev->blittingflags & DSBLIT_ROTATE180) { float tmp; tmp = s2; s2 = s1; s1 = tmp; tmp = t2; t2 = t1; t1 = tmp; } x1 = dr->x; y1 = dr->y; x2 = dr->x+dr->w; y2 = dr->y+dr->h; if (rdev->matrix) { float x, y; v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_QUAD_LIST, 4, 32 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, s1, t1 ); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, s2, t1 ); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, s2, t2 ); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); VTX( v, x, y, s1, t2 ); } else { v = r300_init_vb( rdrv, rdev, VF_PRIM_TYPE_QUAD_LIST, 4, 32 ); VTX( v, x1, y1, s1, t1 ); VTX( v, x2, y1, s2, t1 ); VTX( v, x2, y2, s2, t2 ); VTX( v, x1, y2, s1, t2 ); } return true; } static void r300DoTextureTriangles( RadeonDriverData *rdrv, RadeonDeviceData *rdev, DFBVertex *ve, int num, u32 primitive ) { volatile u8 *mmio = rdrv->mmio_base; int i; radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, SE_VF_CNTL, primitive | VF_PRIM_WALK_DATA | (num << VF_NUM_VERTICES_SHIFT) ); for (; num >= 8; num -= 8) { radeon_waitfifo( rdrv, rdev, 64 ); for (i = 0; i < 8; i++) { radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].x) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].y) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].z) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(1) ); // FIXME radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].s) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].t) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(0) ); // r radeon_out32( mmio, SE_PORT_DATA0, f2d(1) ); // q } ve += 8; } if (num > 0) { radeon_waitfifo( rdrv, rdev, num*8 ); for (i = 0; i < num; i++) { radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].x) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].y) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].z) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(1) ); // FIXME radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].s) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].t) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(0) ); // r radeon_out32( mmio, SE_PORT_DATA0, f2d(1) ); // q } } radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, R300_RB3D_DSTCACHE_CTLSTAT, 0xa ); radeon_out32( mmio, 0x4f18, 0x3 ); } bool r300TextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; u32 prim = 0; int i; if (num > 65535) { D_WARN( "R300 supports maximum 65535 vertices" ); return false; } switch (formation) { case DTTF_LIST: prim = VF_PRIM_TYPE_TRIANGLE_LIST; break; case DTTF_STRIP: prim = VF_PRIM_TYPE_TRIANGLE_STRIP; break; case DTTF_FAN: prim = VF_PRIM_TYPE_TRIANGLE_FAN; break; default: D_BUG( "unexpected triangle formation" ); return false; } if (rdev->matrix) { for (i = 0; i < num; i++) RADEON_TRANSFORM( ve[i].x, ve[i].y, ve[i].x, ve[i].y, rdev->matrix, rdev->affine_matrix ); } r300DoTextureTriangles( rdrv, rdev, ve, num, prim ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { volatile u8 *mmio = rdrv->mmio_base; DFBRegion clip; int i; /* Scale coordinates */ for (i = 0; i < num; i++) { ve[i].x *= 0.5; ve[i].y *= 0.5; } clip.x1 = rdev->clip.x1 >> 1; clip.y1 = rdev->clip.y1 >> 1; clip.x2 = rdev->clip.x2 >> 1; clip.y2 = rdev->clip.y2 >> 1; /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, rdev->dst_offset_cb ); radeon_out32( mmio, R300_RB3D_COLORPITCH0, (rdev->dst_pitch>>1) | R300_COLOR_FORMAT_RGB8 ); radeon_out32( mmio, R300_TX_SIZE_0, ((rdev->src_width/2 -1) << R300_TX_WIDTH_SHIFT) | ((rdev->src_height/2-1) << R300_TX_HEIGHT_SHIFT) | R300_TX_SIZE_TXPITCH_EN ); radeon_out32( mmio, R300_TX_PITCH_0, (rdev->src_pitch>>1) - 8 ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset_cb ); r300_set_clip3d( rdrv, rdev, &clip ); /* Blit Cb plane */ r300DoTextureTriangles( rdrv, rdev, ve, num, prim ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, rdev->dst_offset_cr ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset_cr ); /* Blit Cr plane */ r300DoTextureTriangles( rdrv, rdev, ve, num, prim ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, rdev->dst_offset ); radeon_out32( mmio, R300_RB3D_COLORPITCH0, rdev->dst_pitch | R300_COLOR_FORMAT_RGB8 ); radeon_out32( mmio, R300_TX_SIZE_0, ((rdev->src_width -1) << R300_TX_WIDTH_SHIFT) | ((rdev->src_height-1) << R300_TX_HEIGHT_SHIFT) | R300_TX_SIZE_TXPITCH_EN ); radeon_out32( mmio, R300_TX_PITCH_0, rdev->src_pitch - 8 ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset ); r300_set_clip3d( rdrv, rdev, &rdev->clip ); } return true; } void r300EmitCommands3D( void *drv, void *dev ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->vb_count) r300_flush_vb( rdrv, rdev ); } DirectFB-1.2.10/gfxdrivers/radeon/radeon_overlay.c0000644000175000017500000010525711164361026016760 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" typedef struct { CoreLayerRegionConfig config; float brightness; float contrast; float saturation; float hue; int field; int level; CoreScreen *screen; int crtc2; CoreSurface *surface; CoreSurfaceBufferLock *lock; /* overlay registers */ struct { u32 H_INC; u32 STEP_BY; u32 Y_X_START; u32 Y_X_END; u32 V_INC; u32 P1_BLANK_LINES_AT_TOP; u32 P23_BLANK_LINES_AT_TOP; u32 VID_BUF_PITCH0_VALUE; u32 VID_BUF_PITCH1_VALUE; u32 P1_X_START_END; u32 P2_X_START_END; u32 P3_X_START_END; u32 BASE_ADDR; u32 VID_BUF0_BASE_ADRS; u32 VID_BUF1_BASE_ADRS; u32 VID_BUF2_BASE_ADRS; u32 VID_BUF3_BASE_ADRS; u32 VID_BUF4_BASE_ADRS; u32 VID_BUF5_BASE_ADRS; u32 P1_V_ACCUM_INIT; u32 P23_V_ACCUM_INIT; u32 P1_H_ACCUM_INIT; u32 P23_H_ACCUM_INIT; u32 VID_KEY_CLR_LOW; u32 VID_KEY_CLR_HIGH; u32 GRPH_KEY_CLR_LOW; u32 GRPH_KEY_CLR_HIGH; u32 KEY_CNTL; u32 MERGE_CNTL; u32 SCALE_CNTL; } regs; } RadeonOverlayLayerData; static void ovl_calc_regs ( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreSurface *surface, CoreLayerRegionConfig *config, CoreSurfaceBufferLock *lock ); static void ovl_set_regs ( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl ); static void ovl_calc_buffers ( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreSurface *surface, CoreLayerRegionConfig *config, CoreSurfaceBufferLock *lock ); static void ovl_set_buffers ( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl ); static void ovl_set_colorkey ( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreLayerRegionConfig *config ); static void ovl_set_adjustment( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, float brightness, float contrast, float saturation, float hue ); #define OVL_SUPPORTED_OPTIONS \ ( DLOP_DST_COLORKEY | DLOP_OPACITY | DLOP_DEINTERLACING ) /**********************/ static int ovlLayerDataSize( void ) { return sizeof(RadeonOverlayLayerData); } static DFBResult ovlInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; volatile u8 *mmio = rdrv->mmio_base; DFBScreenDescription dsc; dfb_screen_get_info( layer->screen, NULL, &dsc ); if (strstr( dsc.name, "CRTC2" )) rovl->crtc2 = 1; rovl->level = 1; /* fill layer description */ description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; description->caps = DLCAPS_SURFACE | DLCAPS_SCREEN_LOCATION | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST | DLCAPS_SATURATION | DLCAPS_HUE | DLCAPS_DST_COLORKEY | DLCAPS_OPACITY | DLCAPS_DEINTERLACING | DLCAPS_LEVELS; snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Radeon CRTC%c's Overlay", rovl->crtc2 ? '2' : '1' ); /* set default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; /* set default color adjustment */ adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_SATURATION | DCAF_HUE; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; adjustment->hue = 0x8000; /* reset overlay */ radeon_out32( mmio, OV0_SCALE_CNTL, SCALER_SOFT_RESET ); radeon_out32( mmio, OV0_AUTO_FLIP_CNTL, 0 ); radeon_out32( mmio, OV0_DEINTERLACE_PATTERN, 0 ); radeon_out32( mmio, OV0_EXCLUSIVE_HORZ, 0 ); radeon_out32( mmio, OV0_FILTER_CNTL, FILTER_HARDCODED_COEF ); radeon_out32( mmio, OV0_TEST, 0 ); /* reset color adjustments */ ovl_set_adjustment( rdrv, rovl, 0, 0, 0, 0 ); return DFB_OK; } static DFBResult ovlTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; CoreLayerRegionConfigFlags fail = 0; /* check for unsupported options */ if (config->options & ~OVL_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; if (rovl->level == -1) { if (config->options & ~DLOP_DEINTERLACING) fail |= CLRCF_OPTIONS; } else { if (config->options & DLOP_OPACITY && config->options & (DLOP_SRC_COLORKEY | DLOP_DST_COLORKEY)) fail |= CLRCF_OPTIONS; } /* check buffermode */ switch (config->buffermode) { case DLBM_FRONTONLY: case DLBM_BACKSYSTEM: case DLBM_BACKVIDEO: case DLBM_TRIPLE: break; default: fail |= CLRCF_BUFFERMODE; break; } /* check pixel format */ switch (config->format) { case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_YUY2: case DSPF_UYVY: case DSPF_I420: case DSPF_YV12: break; default: fail |= CLRCF_FORMAT; break; } /* check width */ if (config->width > 2048 || config->width < 1) fail |= CLRCF_WIDTH; /* check height */ if (config->height > 2048 || config->height < 1) fail |= CLRCF_HEIGHT; /* write back failing fields */ if (failed) *failed = fail; /* return failure if any field failed */ if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ovlAddRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonDeviceData *rdev = rdrv->device_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; if (rovl->crtc2 && !rdev->monitor2) { D_ERROR( "DirectFB/Radeon/Overlay: " "no secondary monitor connected!\n" ); return DFB_IO; } return DFB_OK; } static DFBResult ovlSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; /* save configuration */ rovl->config = *config; rovl->surface = surface; rovl->screen = layer->screen; if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_SOURCE | CLRCF_DEST | CLRCF_OPTIONS | CLRCF_OPACITY)) { ovl_calc_regs( rdrv, rovl, surface, &rovl->config, lock ); ovl_set_regs( rdrv, rovl ); } if (updated & (CLRCF_SRCKEY | CLRCF_DSTKEY)) ovl_set_colorkey( rdrv, rovl, &rovl->config ); rovl->lock = lock; return DFB_OK; } static DFBResult ovlFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; dfb_surface_flip( surface, false ); ovl_calc_buffers( rdrv, rovl, surface, &rovl->config, lock ); ovl_set_buffers( rdrv, rovl ); if (flags & DSFLIP_WAIT) dfb_layer_wait_vsync( layer ); rovl->lock = lock; return DFB_OK; } static DFBResult ovlSetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; if (adj->flags & DCAF_BRIGHTNESS) rovl->brightness = (float)(adj->brightness-0x8000) / 65535.0; if (adj->flags & DCAF_CONTRAST) rovl->contrast = (float)adj->contrast / 32768.0; if (adj->flags & DCAF_SATURATION) rovl->saturation = (float)adj->saturation / 32768.0; if (adj->flags & DCAF_HUE) rovl->hue = (float)(adj->hue-0x8000) * 3.1416 / 65535.0; ovl_set_adjustment( rdrv, rovl, rovl->brightness, rovl->contrast, rovl->saturation, rovl->hue ); return DFB_OK; } static DFBResult ovlSetInputField( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; rovl->field = field; if (rovl->surface) { ovl_calc_buffers( rdrv, rovl, rovl->surface, &rovl->config, rovl->lock ); ovl_set_buffers( rdrv, rovl ); } return DFB_OK; } static DFBResult ovlGetLevel( CoreLayer *layer, void *driver_data, void *layer_data, int *level ) { RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; *level = rovl->level; return DFB_OK; } static DFBResult ovlSetLevel( CoreLayer *layer, void *driver_data, void *layer_data, int level ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonOverlayLayerData *rovl = (RadeonOverlayLayerData*) layer_data; if (!rovl->surface) return DFB_UNSUPPORTED; switch (level) { case -1: case 1: rovl->level = level; ovl_calc_regs( rdrv, rovl, rovl->surface, &rovl->config, rovl->lock ); ovl_set_regs( rdrv, rovl ); break; default: return DFB_UNSUPPORTED; } return DFB_OK; } static DFBResult ovlRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonDeviceData *rdev = rdrv->device_data; /* disable overlay */ radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( rdrv->mmio_base, OV0_SCALE_CNTL, 0 ); return DFB_OK; } DisplayLayerFuncs RadeonOverlayFuncs = { .LayerDataSize = ovlLayerDataSize, .InitLayer = ovlInitLayer, .TestRegion = ovlTestRegion, .AddRegion = ovlAddRegion, .SetRegion = ovlSetRegion, .RemoveRegion = ovlRemoveRegion, .FlipRegion = ovlFlipRegion, .SetColorAdjustment = ovlSetColorAdjustment, .SetInputField = ovlSetInputField, .GetLevel = ovlGetLevel, .SetLevel = ovlSetLevel }; /*** Internal Functions ***/ static void ovl_calc_coordinates( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreSurface *surface, CoreLayerRegionConfig *config ) { RadeonDeviceData *rdev = rdrv->device_data; DFBRectangle source = config->source; DFBRectangle dest = config->dest; u32 ecp_div = 0; u32 h_inc; u32 h_inc2; u32 v_inc; u32 step_by; u32 tmp; int xres; int yres; dfb_screen_get_screen_size( rovl->screen, &xres, &yres ); if (dest.w > (source.w << 4)) dest.w = source.w << 4; if (dest.h > (source.h << 4)) dest.h = source.h << 4; if (dest.x < 0) { source.w += dest.x * source.w / dest.w; dest.w += dest.x; dest.x = 0; } if (dest.y < 0) { source.h += dest.y * source.h / dest.h; dest.h += dest.y; dest.y = 0; } if ((dest.x + dest.w) > xres) { source.w = (xres - dest.x) * source.w / dest.w; dest.w = xres - dest.x; } if ((dest.y + dest.h) > yres) { source.h = (yres - dest.y) * source.h / dest.h; dest.h = yres - dest.y; } if (dest.w < 1 || dest.h < 1 || source.w < 1 || source.h < 1) { config->opacity = 0; return; } if (config->options & DLOP_DEINTERLACING) source.h /= 2; tmp = radeon_in32( rdrv->mmio_base, rovl->crtc2 ? CRTC2_GEN_CNTL : CRTC_GEN_CNTL ); if (tmp & CRTC_DBL_SCAN_EN) { dest.y *= 2; dest.h *= 2; } if (tmp & CRTC_INTERLACE_EN) { dest.y /= 2; dest.h /= 2; } /* FIXME: We need to know the VideoMode of the current screen. */ #if 0 if ((100000000 / mode->pixclock) >= 17500) ecp_div = 1; #endif h_inc = (source.w << (12 + ecp_div)) / dest.w; v_inc = (source.h << 20) / dest.h; for (step_by = 1; h_inc >= (2 << 12);) { step_by++; h_inc >>= 1; } switch (surface->config.format) { case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: h_inc2 = h_inc; break; default: h_inc2 = h_inc >> 1; break; } rovl->regs.V_INC = v_inc; rovl->regs.H_INC = h_inc | (h_inc2 << 16); rovl->regs.STEP_BY = step_by | (step_by << 8); /* compute values for horizontal accumulators */ tmp = 0x00028000 + (h_inc << 3); rovl->regs.P1_H_ACCUM_INIT = ((tmp << 4) & 0x000f8000) | ((tmp << 12) & 0xf0000000); tmp = 0x00028000 + (h_inc2 << 3); rovl->regs.P23_H_ACCUM_INIT = ((tmp << 4) & 0x000f8000) | ((tmp << 12) & 0x70000000); /* compute values for vertical accumulators */ tmp = 0x00018000; rovl->regs.P1_V_ACCUM_INIT = ((tmp << 4) & OV0_P1_V_ACCUM_INIT_MASK) | (OV0_P1_MAX_LN_IN_PER_LN_OUT & 1); tmp = 0x00018000; rovl->regs.P23_V_ACCUM_INIT = ((tmp << 4) & OV0_P23_V_ACCUM_INIT_MASK) | (OV0_P23_MAX_LN_IN_PER_LN_OUT & 1); if (!rovl->crtc2) { if (rdev->chipset < CHIP_R300 && rdev->chipset != CHIP_R200 && rdev->chipset != CHIP_UNKNOWN) dest.x += 8; } /* compute destination coordinates */ rovl->regs.Y_X_START = (dest.x & 0xffff) | (dest.y << 16); rovl->regs.Y_X_END = ((dest.x + dest.w - 1) & 0xffff) | ((dest.y + dest.h - 1) << 16); /* compute source coordinates */ rovl->regs.P1_BLANK_LINES_AT_TOP = P1_BLNK_LN_AT_TOP_M1_MASK | ((source.h - 1) << 16); rovl->regs.P1_X_START_END = (source.w - 1) & 0xffff; if (DFB_PLANAR_PIXELFORMAT( surface->config.format )) { rovl->regs.P23_BLANK_LINES_AT_TOP = P23_BLNK_LN_AT_TOP_M1_MASK | ((source.h/2 - 1) << 16); rovl->regs.P2_X_START_END = (source.w/2 - 1) & 0xffff; rovl->regs.P3_X_START_END = rovl->regs.P2_X_START_END; } else { rovl->regs.P23_BLANK_LINES_AT_TOP = P23_BLNK_LN_AT_TOP_M1_MASK | ((source.h - 1) << 16); rovl->regs.P2_X_START_END = rovl->regs.P1_X_START_END; rovl->regs.P3_X_START_END = rovl->regs.P1_X_START_END; } } static void ovl_calc_buffers( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreSurface *surface, CoreLayerRegionConfig *config, CoreSurfaceBufferLock *lock ) { RadeonDeviceData *rdev = rdrv->device_data; DFBRectangle source = config->source; u32 offsets[3] = { 0, 0, 0 }; u32 pitch = lock->pitch; int even = 0; int cropleft; int croptop; if (config->options & DLOP_DEINTERLACING) { source.y /= 2; source.h /= 2; pitch *= 2; even = rovl->field; } cropleft = source.x; croptop = source.y; if (config->dest.x < 0) cropleft += -config->dest.x * source.w / config->dest.w; if (config->dest.y < 0) croptop += -config->dest.y * source.h / config->dest.h; if (DFB_PLANAR_PIXELFORMAT( surface->config.format )) { cropleft &= ~31; croptop &= ~1; offsets[0] = lock->offset; offsets[1] = offsets[0] + surface->config.size.h * lock->pitch; offsets[2] = offsets[1] + surface->config.size.h/2 * lock->pitch/2; offsets[0] += croptop * pitch + cropleft; offsets[1] += croptop/2 * pitch/2 + cropleft/2; offsets[2] += croptop/2 * pitch/2 + cropleft/2; if (even) { offsets[0] += lock->pitch; offsets[1] += lock->pitch/2; offsets[2] += lock->pitch/2; } if (surface->config.format == DSPF_YV12) { u32 tmp = offsets[1]; offsets[1] = offsets[2]; offsets[2] = tmp; } } else { offsets[0] = lock->offset + croptop * pitch + cropleft * DFB_BYTES_PER_PIXEL( surface->config.format ); if (even) offsets[0] += lock->pitch; offsets[1] = offsets[2] = offsets[0]; } if (lock->phys - lock->offset == rdev->fb_phys) rovl->regs.BASE_ADDR = rdev->fb_offset; else rovl->regs.BASE_ADDR = rdev->agp_offset; rovl->regs.VID_BUF0_BASE_ADRS = (offsets[0] & VIF_BUF0_BASE_ADRS_MASK); rovl->regs.VID_BUF1_BASE_ADRS = (offsets[1] & VIF_BUF1_BASE_ADRS_MASK) | VIF_BUF1_PITCH_SEL; rovl->regs.VID_BUF2_BASE_ADRS = (offsets[2] & VIF_BUF2_BASE_ADRS_MASK) | VIF_BUF2_PITCH_SEL; rovl->regs.VID_BUF3_BASE_ADRS = (offsets[0] & VIF_BUF3_BASE_ADRS_MASK); rovl->regs.VID_BUF4_BASE_ADRS = (offsets[1] & VIF_BUF4_BASE_ADRS_MASK) | VIF_BUF4_PITCH_SEL; rovl->regs.VID_BUF5_BASE_ADRS = (offsets[2] & VIF_BUF5_BASE_ADRS_MASK) | VIF_BUF5_PITCH_SEL; rovl->regs.VID_BUF_PITCH0_VALUE = pitch; rovl->regs.VID_BUF_PITCH1_VALUE = pitch/2; } static void ovl_calc_regs( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreSurface *surface, CoreLayerRegionConfig *config, CoreSurfaceBufferLock *lock ) { rovl->regs.SCALE_CNTL = 0; /* Configure coordinates */ ovl_calc_coordinates( rdrv, rovl, surface, config ); /* Configure buffers */ ovl_calc_buffers( rdrv, rovl, surface, config, lock ); /* Configure scaler */ if (rovl->level == -1) { rovl->regs.KEY_CNTL = GRAPHIC_KEY_FN_FALSE | VIDEO_KEY_FN_FALSE | CMP_MIX_AND; rovl->regs.MERGE_CNTL = DISP_ALPHA_MODE_PER_PIXEL | 0x00ff0000 | /* graphic alpha */ 0xff000000; /* overlay alpha */ } else if (config->options & DLOP_OPACITY) { rovl->regs.KEY_CNTL = GRAPHIC_KEY_FN_TRUE | VIDEO_KEY_FN_TRUE | CMP_MIX_AND; rovl->regs.MERGE_CNTL = DISP_ALPHA_MODE_GLOBAL | 0x00ff0000 | (config->opacity << 24); } else { rovl->regs.KEY_CNTL = CMP_MIX_AND; if (config->options & DLOP_SRC_COLORKEY) rovl->regs.KEY_CNTL |= VIDEO_KEY_FN_NE; else rovl->regs.KEY_CNTL |= VIDEO_KEY_FN_TRUE; if (config->options & DLOP_DST_COLORKEY) rovl->regs.KEY_CNTL |= GRAPHIC_KEY_FN_EQ; else rovl->regs.KEY_CNTL |= GRAPHIC_KEY_FN_TRUE; rovl->regs.MERGE_CNTL = 0xffff0000; } if (config->opacity) { rovl->regs.SCALE_CNTL = SCALER_SMART_SWITCH | SCALER_DOUBLE_BUFFER | SCALER_ADAPTIVE_DEINT | (rovl->crtc2 << 14); if (config->source.w == config->dest.w) rovl->regs.SCALE_CNTL |= SCALER_HORZ_PICK_NEAREST; if (config->source.h == config->dest.h) rovl->regs.SCALE_CNTL |= SCALER_VERT_PICK_NEAREST; switch (surface->config.format) { case DSPF_RGB555: case DSPF_ARGB1555: rovl->regs.SCALE_CNTL |= SCALER_SOURCE_15BPP | SCALER_PRG_LOAD_START; break; case DSPF_RGB16: rovl->regs.SCALE_CNTL |= SCALER_SOURCE_16BPP | SCALER_PRG_LOAD_START; break; case DSPF_RGB32: case DSPF_ARGB: rovl->regs.SCALE_CNTL |= SCALER_SOURCE_32BPP | SCALER_PRG_LOAD_START; break; case DSPF_UYVY: rovl->regs.SCALE_CNTL |= SCALER_SOURCE_YVYU422; break; case DSPF_YUY2: rovl->regs.SCALE_CNTL |= SCALER_SOURCE_VYUY422; break; case DSPF_YV12: case DSPF_I420: rovl->regs.SCALE_CNTL |= SCALER_SOURCE_YUV12; break; default: D_BUG( "unexpected pixelformat" ); config->opacity = 0; return; } rovl->regs.SCALE_CNTL |= SCALER_ENABLE; } } static void ovl_set_regs( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl ) { RadeonDeviceData *rdev = rdrv->device_data; volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, OV0_REG_LOAD_CNTL, REG_LD_CTL_LOCK ); while(!(radeon_in32( mmio, OV0_REG_LOAD_CNTL ) & REG_LD_CTL_LOCK_READBACK)); radeon_waitfifo( rdrv, rdev, 17 ); radeon_out32( mmio, OV0_H_INC, rovl->regs.H_INC ); radeon_out32( mmio, OV0_STEP_BY, rovl->regs.STEP_BY ); if (rovl->crtc2) { radeon_out32( mmio, OV1_Y_X_START, rovl->regs.Y_X_START ); radeon_out32( mmio, OV1_Y_X_END, rovl->regs.Y_X_END ); } else { radeon_out32( mmio, OV0_Y_X_START, rovl->regs.Y_X_START ); radeon_out32( mmio, OV0_Y_X_END, rovl->regs.Y_X_END ); } radeon_out32( mmio, OV0_V_INC, rovl->regs.V_INC ); radeon_out32( mmio, OV0_P1_BLANK_LINES_AT_TOP, rovl->regs.P1_BLANK_LINES_AT_TOP ); radeon_out32( mmio, OV0_P23_BLANK_LINES_AT_TOP, rovl->regs.P23_BLANK_LINES_AT_TOP ); radeon_out32( mmio, OV0_VID_BUF_PITCH0_VALUE, rovl->regs.VID_BUF_PITCH0_VALUE ); radeon_out32( mmio, OV0_VID_BUF_PITCH1_VALUE, rovl->regs.VID_BUF_PITCH1_VALUE ); radeon_out32( mmio, OV0_P1_X_START_END, rovl->regs.P1_X_START_END ); radeon_out32( mmio, OV0_P2_X_START_END, rovl->regs.P2_X_START_END ); radeon_out32( mmio, OV0_P3_X_START_END, rovl->regs.P3_X_START_END ); radeon_out32( mmio, OV0_P1_V_ACCUM_INIT, rovl->regs.P1_V_ACCUM_INIT ); radeon_out32( mmio, OV0_BASE_ADDR, rovl->regs.BASE_ADDR ); radeon_out32( mmio, OV0_VID_BUF0_BASE_ADRS, rovl->regs.VID_BUF0_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF1_BASE_ADRS, rovl->regs.VID_BUF1_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF2_BASE_ADRS, rovl->regs.VID_BUF2_BASE_ADRS ); radeon_waitfifo( rdrv, rdev, 10 ); radeon_out32( mmio, OV0_VID_BUF3_BASE_ADRS, rovl->regs.VID_BUF3_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF4_BASE_ADRS, rovl->regs.VID_BUF4_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF5_BASE_ADRS, rovl->regs.VID_BUF5_BASE_ADRS ); radeon_out32( mmio, OV0_P1_H_ACCUM_INIT, rovl->regs.P1_H_ACCUM_INIT ); radeon_out32( mmio, OV0_P23_V_ACCUM_INIT, rovl->regs.P23_V_ACCUM_INIT ); radeon_out32( mmio, OV0_P23_H_ACCUM_INIT, rovl->regs.P23_H_ACCUM_INIT ); radeon_out32( mmio, DISP_MERGE_CNTL, rovl->regs.MERGE_CNTL ); radeon_out32( mmio, OV0_KEY_CNTL, rovl->regs.KEY_CNTL ); radeon_out32( mmio, OV0_SCALE_CNTL, rovl->regs.SCALE_CNTL ); radeon_out32( mmio, OV0_REG_LOAD_CNTL, 0 ); } static void ovl_set_buffers( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl ) { RadeonDeviceData *rdev = rdrv->device_data; volatile u8 *mmio = rdrv->mmio_base; radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, OV0_REG_LOAD_CNTL, REG_LD_CTL_LOCK ); while(!(radeon_in32( mmio, OV0_REG_LOAD_CNTL ) & REG_LD_CTL_LOCK_READBACK)); radeon_waitfifo( rdrv, rdev, 8 ); radeon_out32( mmio, OV0_BASE_ADDR, rovl->regs.BASE_ADDR ); radeon_out32( mmio, OV0_VID_BUF0_BASE_ADRS, rovl->regs.VID_BUF0_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF1_BASE_ADRS, rovl->regs.VID_BUF1_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF2_BASE_ADRS, rovl->regs.VID_BUF2_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF3_BASE_ADRS, rovl->regs.VID_BUF3_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF4_BASE_ADRS, rovl->regs.VID_BUF4_BASE_ADRS ); radeon_out32( mmio, OV0_VID_BUF5_BASE_ADRS, rovl->regs.VID_BUF5_BASE_ADRS ); radeon_out32( mmio, OV0_REG_LOAD_CNTL, 0 ); } static void ovl_set_colorkey( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, CoreLayerRegionConfig *config ) { volatile u8 *mmio = rdrv->mmio_base; u32 SkeyLow, SkeyHigh; u32 DkeyLow, DkeyHigh; u32 tmp; SkeyLow = PIXEL_RGB32( config->src_key.r, config->src_key.g, config->src_key.b ); SkeyHigh = SkeyLow | 0xff000000; tmp = radeon_in32( mmio, rovl->crtc2 ? CRTC2_GEN_CNTL : CRTC_GEN_CNTL ); switch ((tmp >> 8) & 0xf) { case DST_8BPP: case DST_8BPP_RGB332: DkeyLow = ((MAX( config->dst_key.r - 0x20, 0 ) & 0xe0) << 16) | ((MAX( config->dst_key.g - 0x20, 0 ) & 0xe0) << 8) | ((MAX( config->dst_key.b - 0x40, 0 ) & 0xc0) ); break; case DST_15BPP: DkeyLow = ((MAX( config->dst_key.r - 0x08, 0 ) & 0xf8) << 16) | ((MAX( config->dst_key.g - 0x08, 0 ) & 0xf8) << 8) | ((MAX( config->dst_key.b - 0x08, 0 ) & 0xf8) ); break; case DST_16BPP: DkeyLow = ((MAX( config->dst_key.r - 0x08, 0 ) & 0xf8) << 16) | ((MAX( config->dst_key.g - 0x04, 0 ) & 0xfc) << 8) | ((MAX( config->dst_key.b - 0x08, 0 ) & 0xf8) ); break; default: DkeyLow = PIXEL_RGB32( config->dst_key.r, config->dst_key.g, config->dst_key.b ); break; } DkeyHigh = PIXEL_RGB32( config->dst_key.r, config->dst_key.g, config->dst_key.b ) | 0xff000000; radeon_waitfifo( rdrv, rdrv->device_data, 4 ); radeon_out32( mmio, OV0_VID_KEY_CLR_LOW, SkeyLow ); radeon_out32( mmio, OV0_VID_KEY_CLR_HIGH, SkeyHigh ); radeon_out32( mmio, OV0_GRPH_KEY_CLR_LOW, DkeyLow ); radeon_out32( mmio, OV0_GRPH_KEY_CLR_HIGH, DkeyHigh ); } static void ovl_set_adjustment( RadeonDriverData *rdrv, RadeonOverlayLayerData *rovl, float brightness, float contrast, float saturation, float hue ) { volatile u8 *mmio = rdrv->mmio_base; float HueSin, HueCos; float Luma; float RCb, RCr; float GCb, GCr; float BCb, BCr; float AdjOff, ROff, GOff, BOff; u32 dwLuma, dwROff, dwGOff, dwBOff; u32 dwRCb, dwRCr; u32 dwGCb, dwGCr; u32 dwBCb, dwBCr; HueSin = sin( hue ); HueCos = cos( hue ); Luma = contrast * +1.1678; RCb = saturation * -HueSin * +1.6007; RCr = saturation * HueCos * +1.6007; GCb = saturation * (HueCos * -0.3929 - HueSin * -0.8154); GCr = saturation * (HueCos * -0.3929 + HueCos * -0.8154); BCb = saturation * HueCos * +2.0232; BCr = saturation * HueSin * +2.0232; AdjOff = contrast * 1.1678 * brightness * 1023.0; ROff = AdjOff - Luma * 64.0 - (RCb + RCr) * 512.0; GOff = AdjOff - Luma * 64.0 - (GCb + GCr) * 512.0; BOff = AdjOff - Luma * 64.0 - (BCb + BCr) * 512.0; ROff = CLAMP( ROff, -2048.0, 2047.5 ); GOff = CLAMP( GOff, -2048.0, 2047.5 ); BOff = CLAMP( BOff, -2048.0, 2047.5 ); dwROff = ((u32)(ROff * 2.0)) & 0x1fff; dwGOff = ((u32)(GOff * 2.0)) & 0x1fff; dwBOff = ((u32)(BOff * 2.0)) & 0x1fff; dwLuma = (((u32)(Luma * 256.0)) & 0xfff) << 20; dwRCb = (((u32)(RCb * 256.0)) & 0xfff) << 4; dwRCr = (((u32)(RCr * 256.0)) & 0xfff) << 20; dwGCb = (((u32)(GCb * 256.0)) & 0xfff) << 4; dwGCr = (((u32)(GCr * 256.0)) & 0xfff) << 20; dwBCb = (((u32)(BCb * 256.0)) & 0xfff) << 4; dwBCr = (((u32)(BCr * 256.0)) & 0xfff) << 20; radeon_waitfifo( rdrv, rdrv->device_data, 6 ); radeon_out32( mmio, OV0_LIN_TRANS_A, dwRCb | dwLuma ); radeon_out32( mmio, OV0_LIN_TRANS_B, dwROff | dwRCr ); radeon_out32( mmio, OV0_LIN_TRANS_C, dwGCb | dwLuma ); radeon_out32( mmio, OV0_LIN_TRANS_D, dwGOff | dwGCr ); radeon_out32( mmio, OV0_LIN_TRANS_E, dwBCb | dwLuma ); radeon_out32( mmio, OV0_LIN_TRANS_F, dwBOff | dwBCr ); } DirectFB-1.2.10/gfxdrivers/radeon/radeon.c0000644000175000017500000017741511164361026015224 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( radeon ) #include "radeon.h" #include "radeon_chipsets.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_state.h" #include "radeon_2d.h" #include "radeon_3d.h" /* Enable the following option if you see strange behaviours */ #define RESET_AFTER_SETVAR 0 /* Driver capability flags */ #define RADEON_SUPPORTED_2D_DRAWINGFLAGS \ ( DSDRAW_XOR ) #define RADEON_SUPPORTED_2D_DRAWINGFUNCS \ ( DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE ) #define RADEON_SUPPORTED_2D_BLITTINGFLAGS \ ( DSBLIT_XOR | DSBLIT_SRC_COLORKEY ) #define RADEON_SUPPORTED_2D_BLITTINGFUNCS \ ( DFXL_BLIT ) #define R100_SUPPORTED_DRAWINGFLAGS \ ( RADEON_SUPPORTED_2D_DRAWINGFLAGS | DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY ) #define R100_SUPPORTED_DRAWINGFUNCS \ ( RADEON_SUPPORTED_2D_DRAWINGFUNCS | DFXL_FILLTRIANGLE ) #define R100_SUPPORTED_BLITTINGFLAGS \ ( RADEON_SUPPORTED_2D_BLITTINGFLAGS | \ DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR | \ DSBLIT_DEINTERLACE | DSBLIT_ROTATE180 | \ DSBLIT_SRC_MASK_ALPHA | DSBLIT_SRC_MASK_COLOR | \ DSBLIT_SRC_PREMULTIPLY ) #define R100_SUPPORTED_BLITTINGFUNCS \ ( RADEON_SUPPORTED_2D_BLITTINGFUNCS | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES ) #define R200_SUPPORTED_DRAWINGFLAGS \ ( RADEON_SUPPORTED_2D_DRAWINGFLAGS | DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY ) #define R200_SUPPORTED_DRAWINGFUNCS \ ( RADEON_SUPPORTED_2D_DRAWINGFUNCS | DFXL_FILLTRIANGLE ) #define R200_SUPPORTED_BLITTINGFLAGS \ ( RADEON_SUPPORTED_2D_BLITTINGFLAGS | \ DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR | \ DSBLIT_DEINTERLACE | DSBLIT_ROTATE180 | \ DSBLIT_SRC_MASK_ALPHA | DSBLIT_SRC_MASK_COLOR | \ DSBLIT_SRC_PREMULTIPLY ) #define R200_SUPPORTED_BLITTINGFUNCS \ ( RADEON_SUPPORTED_2D_BLITTINGFUNCS | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES ) #define R300_SUPPORTED_DRAWINGFLAGS \ ( RADEON_SUPPORTED_2D_DRAWINGFLAGS | DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY ) #define R300_SUPPORTED_DRAWINGFUNCS \ ( RADEON_SUPPORTED_2D_DRAWINGFUNCS | DFXL_FILLTRIANGLE ) #define R300_SUPPORTED_BLITTINGFLAGS \ ( RADEON_SUPPORTED_2D_BLITTINGFLAGS | \ DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR | \ DSBLIT_DEINTERLACE | DSBLIT_ROTATE180 ) #define R300_SUPPORTED_BLITTINGFUNCS \ ( RADEON_SUPPORTED_2D_BLITTINGFUNCS | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES ) #define DSBLIT_MODULATE_ALPHA ( DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_BLEND_COLORALPHA ) #define DSBLIT_MODULATE_COLOR ( DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | \ DSBLIT_SRC_PREMULTCOLOR ) #define DSBLIT_MODULATE ( DSBLIT_MODULATE_ALPHA | \ DSBLIT_MODULATE_COLOR | \ DSBLIT_SRC_PREMULTIPLY ) #define DSBLIT_MASK ( DSBLIT_SRC_MASK_ALPHA | \ DSBLIT_SRC_MASK_COLOR ) #define RADEON_DRAW_3D() ( rdev->accel & DFXL_FILLTRIANGLE || \ rdev->drawingflags & ~DSDRAW_XOR || \ rdev->matrix != NULL || \ (rdev->render_options & DSRO_ANTIALIAS && \ rdev->accel & DFXL_DRAWLINE) ) #define RADEON_BLIT_3D() ( rdev->accel & ~DFXL_BLIT ||\ rdev->blittingflags & ~(DSBLIT_XOR | \ DSBLIT_SRC_COLORKEY) || \ rdev->matrix != NULL || \ (rdev->dst_format != rdev->src_format && \ !(DFB_PLANAR_PIXELFORMAT(rdev->dst_format) && \ DFB_PLANAR_PIXELFORMAT(rdev->src_format) ))) #define RADEON_FUNC( f ) DFB_PLANAR_PIXELFORMAT(rdev->dst_format) ? f##_420 : f static inline bool radeon_compatible_format( RadeonDriverData *rdrv, DFBSurfacePixelFormat format ) { #ifdef WORDS_BIGENDIAN u32 tmp, bpp; bpp = DFB_BYTES_PER_PIXEL( format ); tmp = radeon_in32( rdrv->mmio_base, CRTC_GEN_CNTL ); switch ((tmp >> 8) & 0xf) { case DST_8BPP: case DST_24BPP: if (bpp == 2 || bpp == 4) return false; break; case DST_15BPP: case DST_16BPP: if (bpp != 2) return false; break; default: if (bpp != 4) return false; break; } #endif return true; } static void radeon_get_monitors( RadeonDriverData *rdrv, RadeonDeviceData *rdev, RadeonMonitorType *ret_monitor1, RadeonMonitorType *ret_monitor2 ) { RadeonMonitorType dvimon = MT_NONE; RadeonMonitorType vgamon = MT_NONE; #if D_DEBUG_ENABLED const char *name[] = { "NONE", "CRT", "DFP", "LCD", "CTV", "STV" }; #endif u32 tmp; if (rdev->chipset != CHIP_R100) { if (rdev->chipset >= CHIP_R300 || rdev->chipset == CHIP_UNKNOWN) tmp = radeon_in32( rdrv->mmio_base, BIOS_0_SCRATCH ); else tmp = radeon_in32( rdrv->mmio_base, BIOS_4_SCRATCH ); /* DVI/TVO port */ if (tmp & 0x08) dvimon = MT_DFP; else if (tmp & 0x4) dvimon = MT_LCD; else if (tmp & 0x200) dvimon = MT_CRT; else if (tmp & 0x10) dvimon = MT_CTV; else if (tmp & 0x20) dvimon = MT_STV; /* VGA port */ if (tmp & 0x2) vgamon = MT_CRT; else if (tmp & 0x800) vgamon = MT_DFP; else if (tmp & 0x400) vgamon = MT_LCD; else if (tmp & 0x1000) vgamon = MT_CTV; else if (tmp & 0x2000) vgamon = MT_STV; } else { tmp = radeon_in32( rdrv->mmio_base, FP_GEN_CNTL ); if (tmp & FP_EN_TMDS) vgamon = MT_DFP; else vgamon = MT_CRT; } D_DEBUG( "DirectFB/Radeon: " "DVI/TVO Port -> %s, VGA Port -> %s.\n", name[dvimon], name[vgamon] ); if (dvimon) { /* If DVI port is connected, then * DVI port is the primary head and * CRT port is the secondary head. */ if (ret_monitor1) *ret_monitor1 = dvimon; if (ret_monitor2) *ret_monitor2 = vgamon; } else { if (ret_monitor1) *ret_monitor1 = vgamon; if (ret_monitor2) *ret_monitor2 = MT_NONE; } } void radeon_reset( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; u32 clock_cntl_index; u32 mclk_cntl; u32 rbbm_soft_reset; u32 host_path_cntl; clock_cntl_index = radeon_in32( mmio, CLOCK_CNTL_INDEX ); mclk_cntl = radeon_inpll( mmio, MCLK_CNTL ); radeon_outpll( mmio, MCLK_CNTL, mclk_cntl | FORCEON_MCLKA | FORCEON_MCLKB | FORCEON_YCLKA | FORCEON_YCLKB | FORCEON_MC | FORCEON_AIC ); host_path_cntl = radeon_in32( mmio, HOST_PATH_CNTL ); rbbm_soft_reset = radeon_in32( mmio, RBBM_SOFT_RESET ); radeon_out32( mmio, RBBM_SOFT_RESET, rbbm_soft_reset | SOFT_RESET_CP | SOFT_RESET_HI | SOFT_RESET_SE | SOFT_RESET_RE | SOFT_RESET_PP | SOFT_RESET_E2 | SOFT_RESET_RB ); radeon_in32( mmio, RBBM_SOFT_RESET ); radeon_out32( mmio, RBBM_SOFT_RESET, rbbm_soft_reset & ~(SOFT_RESET_CP | SOFT_RESET_HI | SOFT_RESET_SE | SOFT_RESET_RE | SOFT_RESET_PP | SOFT_RESET_E2 | SOFT_RESET_RB) ); radeon_in32( mmio, RBBM_SOFT_RESET ); radeon_out32( mmio, HOST_PATH_CNTL, host_path_cntl | HDP_SOFT_RESET ); radeon_in32( mmio, HOST_PATH_CNTL ); radeon_out32( mmio, HOST_PATH_CNTL, host_path_cntl ); radeon_out32( mmio, RBBM_SOFT_RESET, rbbm_soft_reset ); radeon_out32( mmio, CLOCK_CNTL_INDEX, clock_cntl_index ); radeon_outpll( mmio, MCLK_CNTL, mclk_cntl ); rdev->set = 0; rdev->src_format = DSPF_UNKNOWN; rdev->dst_format = DSPF_UNKNOWN; rdev->fifo_space = 0; } static void radeonAfterSetVar( void *drv, void *dev ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; volatile u8 *mmio = rdrv->mmio_base; rdev->surface_cntl = rdev->surface_cntl_c = rdev->surface_cntl_p = radeon_in32( mmio, SURFACE_CNTL ); radeon_out32( mmio, CRTC_OFFSET_CNTL, (radeon_in32( mmio, CRTC_OFFSET_CNTL ) & ~CRTC_TILE_EN) | CRTC_HSYNC_EN ); #if RESET_AFTER_SETVAR radeon_waitidle( rdrv, rdev ); radeon_reset( rdrv, rdev ); #endif } static void radeonEngineReset( void *drv, void *dev ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; volatile u8 *mmio = rdrv->mmio_base; rdev->fifo_space = 0; radeon_out32( mmio, SURFACE_CNTL, rdev->surface_cntl_c ); radeon_waitfifo( rdrv, rdev, 3 ); #ifdef WORDS_BIGENDIAN radeon_out32( mmio, DP_DATATYPE, radeon_in32( mmio, DP_DATATYPE ) | HOST_BIG_ENDIAN_EN ); #else radeon_out32( mmio, DP_DATATYPE, radeon_in32( mmio, DP_DATATYPE ) & ~HOST_BIG_ENDIAN_EN ); #endif radeon_out32( mmio, DEFAULT_SC_BOTTOM_RIGHT, DEFAULT_SC_RIGHT_MAX | DEFAULT_SC_BOTTOM_MAX ); radeon_out32( mmio, AUX_SC_CNTL, 0 ); if (rdev->chipset >= CHIP_R300) { r300_restore( rdrv, rdev ); } else if (rdev->chipset >= CHIP_R200) { r200_restore( rdrv, rdev ); } else if (rdev->chipset >= CHIP_R100) { r100_restore( rdrv, rdev ); } /* sync 2d and 3d engines */ radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, ISYNC_CNTL, ISYNC_ANY2D_IDLE3D | ISYNC_ANY3D_IDLE2D ); } static DFBResult radeonEngineSync( void *drv, void *dev ) { if (!radeon_waitidle( (RadeonDriverData*)drv, (RadeonDeviceData*)dev )) return DFB_IO; /* DFB_TIMEOUT !? */ return DFB_OK; } static void radeonInvalidateState( void *drv, void *dev ) { RadeonDeviceData *rdev = (RadeonDeviceData*) dev; rdev->set = 0; rdev->dst_format = DSPF_UNKNOWN; rdev->src_format = DSPF_UNKNOWN; rdev->msk_format = DSPF_UNKNOWN; } static void radeonFlushTextureCache( void *drv, void *dev ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; volatile u8 *mmio = rdrv->mmio_base; if (rdev->chipset >= CHIP_R300) { if (rdrv->mmio_size > 0x4000) { radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, R300_TX_CNTL, 0 ); } } else if (rdev->chipset >= CHIP_R200) { radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset ); radeon_out32( mmio, R200_PP_TXOFFSET_1, rdev->msk_offset ); } else if (rdev->chipset >= CHIP_R100) { radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, PP_TXOFFSET_0, rdev->src_offset ); radeon_out32( mmio, PP_TXOFFSET_1, rdev->msk_offset ); } } #ifdef WORDS_BIGENDIAN static void radeonSurfaceEnter( void *drv, void *dev, CoreSurfaceBuffer *buffer, DFBSurfaceLockFlags flags ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; volatile u8 *mmio = rdrv->mmio_base; u32 tmp; if (!(flags & DSLF_WRITE)) return; rdev->surface_cntl_p = radeon_in32( mmio, SURFACE_CNTL ); tmp = rdev->surface_cntl_p & ~SURF_TRANSLATION_DIS; tmp &= ~(NONSURF_AP0_SWP_16BPP | NONSURF_AP1_SWP_16BPP | NONSURF_AP0_SWP_32BPP | NONSURF_AP1_SWP_32BPP); switch (DFB_BITS_PER_PIXEL( buffer->format )) { case 16: tmp |= NONSURF_AP0_SWP_16BPP | NONSURF_AP1_SWP_16BPP; break; case 32: tmp |= NONSURF_AP0_SWP_32BPP | NONSURF_AP1_SWP_32BPP; break; default: break; } radeon_out32( mmio, SURFACE_CNTL, tmp ); rdev->surface_cntl_c = tmp; } static void radeonSurfaceLeave( void *drv, void *dev, CoreSurfaceBuffer *buffer ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; volatile u8 *mmio = rdrv->mmio_base; if (rdev->surface_cntl_p != rdev->surface_cntl_c) { radeon_out32( mmio, SURFACE_CNTL, rdev->surface_cntl_p ); rdev->surface_cntl_c = rdev->surface_cntl_p; } } #endif static void r100CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { RadeonDeviceData *rdev = (RadeonDeviceData*) dev; CoreSurface *destination = state->destination; CoreSurface *source = state->source; int supported_drawingfuncs = R100_SUPPORTED_DRAWINGFUNCS; int supported_drawingflags = R100_SUPPORTED_DRAWINGFLAGS; int supported_blittingfuncs = R100_SUPPORTED_BLITTINGFUNCS; int supported_blittingflags = R100_SUPPORTED_BLITTINGFLAGS; if (!radeon_compatible_format( drv, destination->config.format )) return; switch (destination->config.format) { case DSPF_A8: if (state->src_blend == DSBF_SRCALPHASAT) { supported_drawingflags &= ~DSDRAW_BLEND; supported_blittingflags &= ~DSBLIT_MODULATE_ALPHA; } break; case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_LUT8: case DSPF_ALUT44: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != destination->config.format) return; supported_drawingflags = DSDRAW_NOFX; supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; supported_blittingflags = ~(DSBLIT_MODULATE | DSBLIT_MASK); break; case DSPF_ARGB2554: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != destination->config.format) return; supported_drawingfuncs &= ~DFXL_FILLTRIANGLE; supported_drawingflags = DSDRAW_XOR; supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; supported_blittingflags &= ~(DSBLIT_MODULATE | DSBLIT_MASK); break; case DSPF_AiRGB: supported_drawingflags &= ~DSDRAW_BLEND; supported_blittingflags &= ~DSBLIT_MODULATE_ALPHA; break; case DSPF_I420: case DSPF_YV12: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != DSPF_A8 && source->config.format != DSPF_I420 && source->config.format != DSPF_YV12) return; case DSPF_YUY2: case DSPF_UYVY: if (source && source->config.format != DSPF_A8) supported_blittingflags &= ~(DSBLIT_COLORIZE | DSBLIT_SRC_COLORKEY | DSBLIT_MASK); break; case DSPF_AYUV: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != DSPF_A8) { if (source->config.format != DSPF_AYUV) return; supported_blittingflags &= ~(DSBLIT_COLORIZE | DSBLIT_MASK); } break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { if (state->blittingflags & DSBLIT_MASK || state->blittingflags & DSBLIT_SRC_PREMULTIPLY) { if (state->blittingflags & DSBLIT_MASK && state->blittingflags & DSBLIT_SRC_PREMULTIPLY) return; if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) return; } if (state->blittingflags & DSBLIT_SRC_COLORKEY) { if (destination->config.format != source->config.format) return; supported_blittingfuncs = DFXL_BLIT; supported_blittingflags &= DSBLIT_SRC_COLORKEY | DSBLIT_XOR; } if (state->blittingflags & DSBLIT_ROTATE180) supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; if (accel & ~supported_blittingfuncs || state->blittingflags & ~supported_blittingflags) return; if (source->config.size.w > 2048 || source->config.size.h > 2048) return; if (state->blittingflags & DSBLIT_MODULATE_ALPHA && state->dst_blend == DSBF_SRCALPHASAT) return; if (!radeon_compatible_format( drv, source->config.format )) return; switch (source->config.format) { case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: if (destination->config.format == DSPF_UYVY || destination->config.format == DSPF_YUY2) return; case DSPF_A8: case DSPF_YUY2: case DSPF_UYVY: break; case DSPF_AiRGB: if (destination->config.format != source->config.format && (DFB_PIXELFORMAT_HAS_ALPHA(destination->config.format) || destination->config.format == DSPF_UYVY || destination->config.format == DSPF_YUY2)) return; if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) return; break; case DSPF_LUT8: case DSPF_ALUT44: case DSPF_ARGB2554: case DSPF_AYUV: if (destination->config.format != source->config.format) return; break; case DSPF_I420: case DSPF_YV12: if (source->config.size.w < 2 || source->config.size.h < 2) return; if (destination->config.format != DSPF_I420 && destination->config.format != DSPF_YV12) return; break; default: return; } if (state->blittingflags & DSBLIT_MASK) { CoreSurface *mask = state->source_mask; if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) return; if (state->src_mask_flags & DSMF_STENCIL || state->src_mask_offset.x || state->src_mask_offset.y) return; if (mask->config.size.w > 2048 || mask->config.size.h > 2048) return; if (!radeon_compatible_format( drv, mask->config.format )) return; switch (mask->config.format) { case DSPF_A8: case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_AiRGB: if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA && DFB_PIXELFORMAT_HAS_ALPHA(source->config.format) && source->config.format != DSPF_AiRGB) return; break; default: return; } } state->accel |= supported_blittingfuncs; rdev->blitting_mask = supported_blittingfuncs; } else { if (accel & ~supported_drawingfuncs || state->drawingflags & ~supported_drawingflags) return; if (state->drawingflags & DSDRAW_BLEND && state->dst_blend == DSBF_SRCALPHASAT) return; state->accel |= supported_drawingfuncs; rdev->drawing_mask = supported_drawingfuncs; } } static void r200CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { RadeonDeviceData *rdev = (RadeonDeviceData*) dev; CoreSurface *destination = state->destination; CoreSurface *source = state->source; int supported_drawingfuncs = R200_SUPPORTED_DRAWINGFUNCS; int supported_drawingflags = R200_SUPPORTED_DRAWINGFLAGS; int supported_blittingfuncs = R200_SUPPORTED_BLITTINGFUNCS; int supported_blittingflags = R200_SUPPORTED_BLITTINGFLAGS; if (!radeon_compatible_format( drv, destination->config.format )) return; switch (destination->config.format) { case DSPF_A8: if (state->src_blend == DSBF_SRCALPHASAT) { supported_drawingflags &= ~DSDRAW_BLEND; supported_blittingflags &= ~DSBLIT_MODULATE_ALPHA; } break; case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_LUT8: case DSPF_ALUT44: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != destination->config.format) return; supported_drawingflags = DSDRAW_NOFX; supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; supported_blittingflags &= ~(DSBLIT_MODULATE | DSBLIT_MASK); break; case DSPF_ARGB2554: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != destination->config.format) return; supported_drawingfuncs &= ~DFXL_FILLTRIANGLE; supported_drawingflags = DSDRAW_XOR; supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; supported_blittingflags &= ~(DSBLIT_MODULATE | DSBLIT_MASK); break; case DSPF_AiRGB: supported_drawingflags &= ~DSDRAW_BLEND; supported_blittingflags &= ~DSBLIT_MODULATE_ALPHA; break; case DSPF_I420: case DSPF_YV12: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != DSPF_A8 && source->config.format != DSPF_I420 && source->config.format != DSPF_YV12) return; case DSPF_YUY2: case DSPF_UYVY: if (source && source->config.format != DSPF_A8) supported_blittingflags &= ~(DSBLIT_COLORIZE | DSBLIT_SRC_COLORKEY | DSBLIT_MASK); break; case DSPF_AYUV: if (DFB_BLITTING_FUNCTION( accel ) && source->config.format != DSPF_A8) { if (source->config.format != DSPF_AYUV) return; supported_blittingflags &= ~(DSBLIT_COLORIZE | DSBLIT_MASK); } break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { if (state->blittingflags & DSBLIT_MASK || state->blittingflags & DSBLIT_SRC_PREMULTIPLY) { if (state->blittingflags & DSBLIT_MASK && state->blittingflags & DSBLIT_SRC_PREMULTIPLY) return; if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) return; } if (state->blittingflags & DSBLIT_SRC_COLORKEY) { if (destination->config.format != source->config.format) return; supported_blittingfuncs = DFXL_BLIT; supported_blittingflags &= DSBLIT_SRC_COLORKEY | DSBLIT_XOR; } if (state->blittingflags & DSBLIT_ROTATE180) supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; if (accel & ~supported_blittingfuncs || state->blittingflags & ~supported_blittingflags) return; if (source->config.size.w > 2048 || source->config.size.h > 2048) return; if (state->blittingflags & DSBLIT_MODULATE_ALPHA && state->dst_blend == DSBF_SRCALPHASAT) return; if (!radeon_compatible_format( drv, source->config.format )) return; switch (source->config.format) { case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: if (destination->config.format == DSPF_UYVY || destination->config.format == DSPF_YUY2) return; case DSPF_A8: break; case DSPF_AiRGB: if (destination->config.format != source->config.format && (DFB_PIXELFORMAT_HAS_ALPHA(destination->config.format) || destination->config.format == DSPF_UYVY || destination->config.format == DSPF_YUY2)) return; if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) return; break; case DSPF_LUT8: case DSPF_ALUT44: case DSPF_ARGB2554: case DSPF_AYUV: if (destination->config.format != source->config.format) return; break; case DSPF_YUY2: case DSPF_UYVY: if (rdev->chipset == CHIP_RV250 && destination->config.format != DSPF_YUY2 && destination->config.format != DSPF_UYVY) return; break; case DSPF_I420: case DSPF_YV12: if (source->config.size.w < 2 || source->config.size.h < 2) return; if (destination->config.format != DSPF_I420 && destination->config.format != DSPF_YV12) return; break; default: return; } if (state->blittingflags & DSBLIT_MASK) { CoreSurface *mask = state->source_mask; if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) return; if (state->src_mask_flags & DSMF_STENCIL || state->src_mask_offset.x || state->src_mask_offset.y) return; if (mask->config.size.w > 2048 || mask->config.size.h > 2048) return; if (!radeon_compatible_format( drv, mask->config.format )) return; switch (mask->config.format) { case DSPF_A8: case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_AiRGB: if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA && DFB_PIXELFORMAT_HAS_ALPHA(source->config.format) && source->config.format != DSPF_AiRGB) return; break; default: return; } } state->accel |= supported_blittingfuncs; rdev->blitting_mask = supported_blittingfuncs; } else { if (accel & ~supported_drawingfuncs || state->drawingflags & ~supported_drawingflags) return; if (state->drawingflags & DSDRAW_BLEND && state->dst_blend == DSBF_SRCALPHASAT) return; state->accel |= supported_drawingfuncs; rdev->drawing_mask = supported_drawingfuncs; } } static void r300CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; CoreSurface *destination = state->destination; CoreSurface *source = state->source; bool can_convert = true; int supported_drawingfuncs = R300_SUPPORTED_DRAWINGFUNCS; int supported_drawingflags = R300_SUPPORTED_DRAWINGFLAGS; int supported_blittingfuncs = R300_SUPPORTED_BLITTINGFUNCS; int supported_blittingflags = R300_SUPPORTED_BLITTINGFLAGS; if (rdrv->mmio_size <= 0x4000) { supported_drawingfuncs = RADEON_SUPPORTED_2D_DRAWINGFUNCS; supported_drawingflags = RADEON_SUPPORTED_2D_DRAWINGFLAGS; supported_blittingfuncs = RADEON_SUPPORTED_2D_BLITTINGFUNCS; supported_blittingflags = RADEON_SUPPORTED_2D_BLITTINGFLAGS; can_convert = false; } if (!radeon_compatible_format( drv, destination->config.format )) return; switch (destination->config.format) { case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_LUT8: case DSPF_ALUT44: case DSPF_A8: case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_ARGB2554: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_AiRGB: case DSPF_AYUV: case DSPF_YUY2: case DSPF_UYVY: if (DFB_BLITTING_FUNCTION( accel )) { if (source->config.format != destination->config.format) return; } supported_drawingfuncs &= ~DFXL_FILLTRIANGLE; supported_drawingflags = DSDRAW_NOFX; supported_blittingfuncs = DFXL_BLIT; supported_blittingflags = DSBLIT_NOFX; break; case DSPF_I420: case DSPF_YV12: if (DFB_BLITTING_FUNCTION( accel )) { if (source->config.format != DSPF_I420 && source->config.format != DSPF_YV12) return; } supported_drawingfuncs &= ~DFXL_FILLTRIANGLE; supported_drawingflags = DSDRAW_XOR; supported_blittingflags = DSBLIT_DEINTERLACE; break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { if (state->blittingflags & DSBLIT_XOR) { can_convert = false; supported_blittingfuncs = DFXL_BLIT; supported_blittingflags &= DSBLIT_SRC_COLORKEY | DSBLIT_XOR; } if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) return; if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) { if (state->src_blend != DSBF_ONE) return; } } if (state->blittingflags & DSBLIT_ROTATE180) supported_blittingfuncs &= ~DFXL_TEXTRIANGLES; if (accel & ~supported_blittingfuncs || state->blittingflags & ~supported_blittingflags) return; if (source->config.size.w > 2048 || source->config.size.h > 2048) return; if (state->blittingflags & DSBLIT_MODULATE_ALPHA && state->dst_blend == DSBF_SRCALPHASAT) return; if (!radeon_compatible_format( drv, source->config.format )) return; switch (source->config.format) { case DSPF_A8: case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: if (!can_convert && destination->config.format != source->config.format) return; break; case DSPF_LUT8: case DSPF_ALUT44: if (destination->config.format != source->config.format) return; break; case DSPF_ARGB2554: case DSPF_AiRGB: case DSPF_AYUV: case DSPF_YUY2: case DSPF_UYVY: if (destination->config.format != source->config.format) return; break; case DSPF_I420: case DSPF_YV12: if (source->config.size.w < 2 || source->config.size.h < 2) return; if (destination->config.format != DSPF_I420 && destination->config.format != DSPF_YV12) return; break; default: return; } state->accel |= supported_blittingfuncs; rdev->blitting_mask = supported_blittingfuncs; } else { if (state->drawingflags & DSDRAW_XOR) { supported_drawingfuncs &= ~DFXL_FILLTRIANGLE; supported_drawingflags &= DSDRAW_XOR; } if (accel & ~supported_drawingfuncs || state->drawingflags & ~supported_drawingflags) return; if (state->drawingflags & DSDRAW_BLEND && state->dst_blend == DSBF_SRCALPHASAT) return; state->accel |= supported_drawingfuncs; rdev->drawing_mask = supported_drawingfuncs; } } static void r100SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; rdev->set &= ~state->mod_hw; if (DFB_BLITTING_FUNCTION( accel )) { if ((rdev->accel ^ accel) & DFXL_TEXTRIANGLES) rdev->set &= ~SMF_BLITTING_FLAGS; } rdev->accel = accel; r100_set_destination( rdrv, rdev, state ); r100_set_clip( rdrv, rdev, state ); r100_set_render_options( rdrv, rdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: r100_set_drawing_color( rdrv, rdev, state ); if (state->drawingflags & DSDRAW_BLEND) r100_set_blend_function( rdrv, rdev, state ); r100_set_drawingflags( rdrv, rdev, state ); if (RADEON_DRAW_3D()) { funcs->FillRectangle = r100FillRectangle3D; funcs->FillTriangle = r100FillTriangle; funcs->DrawRectangle = r100DrawRectangle3D; funcs->DrawLine = r100DrawLine3D; funcs->EmitCommands = r100EmitCommands3D; } else { funcs->FillRectangle = RADEON_FUNC(radeonFillRectangle2D); funcs->FillTriangle = NULL; funcs->DrawRectangle = RADEON_FUNC(radeonDrawRectangle2D); funcs->DrawLine = RADEON_FUNC(radeonDrawLine2D); funcs->EmitCommands = NULL; } state->set = rdev->drawing_mask; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: r100_set_source( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MASK) r100_set_source_mask( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MODULATE_ALPHA) r100_set_blend_function( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MODULATE_COLOR) r100_set_blitting_color( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_SRC_COLORKEY) r100_set_src_colorkey( rdrv, rdev, state ); r100_set_blittingflags( rdrv, rdev, state ); if (RADEON_BLIT_3D()) { funcs->Blit = r100Blit3D; funcs->StretchBlit = r100StretchBlit; funcs->TextureTriangles = r100TextureTriangles; funcs->EmitCommands = r100EmitCommands3D; } else { funcs->Blit = RADEON_FUNC(radeonBlit2D); funcs->StretchBlit = NULL; funcs->TextureTriangles = NULL; funcs->EmitCommands = NULL; } state->set = (accel & DFXL_TEXTRIANGLES) ? : (rdev->blitting_mask & ~DFXL_TEXTRIANGLES); break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } static void r200SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; rdev->set &= ~state->mod_hw; if (DFB_BLITTING_FUNCTION( accel )) { if ((rdev->accel ^ accel) & DFXL_TEXTRIANGLES) rdev->set &= ~SMF_BLITTING_FLAGS; } rdev->accel = accel; r200_set_destination( rdrv, rdev, state ); r200_set_clip( rdrv, rdev, state ); r200_set_render_options( rdrv, rdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: r200_set_drawing_color( rdrv, rdev, state ); if (state->drawingflags & DSDRAW_BLEND) r200_set_blend_function( rdrv, rdev, state ); r200_set_drawingflags( rdrv, rdev, state ); if (RADEON_DRAW_3D()) { funcs->FillRectangle = r200FillRectangle3D; funcs->FillTriangle = r200FillTriangle; funcs->DrawRectangle = r200DrawRectangle3D; funcs->DrawLine = r200DrawLine3D; funcs->EmitCommands = r200EmitCommands3D; } else { funcs->FillRectangle = RADEON_FUNC(radeonFillRectangle2D); funcs->FillTriangle = NULL; funcs->DrawRectangle = RADEON_FUNC(radeonDrawRectangle2D); funcs->DrawLine = RADEON_FUNC(radeonDrawLine2D); funcs->EmitCommands = NULL; } state->set = rdev->drawing_mask; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: r200_set_source( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MASK) r200_set_source_mask( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MODULATE_ALPHA) r200_set_blend_function( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MODULATE_COLOR) r200_set_blitting_color( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_SRC_COLORKEY) r200_set_src_colorkey( rdrv, rdev, state ); r200_set_blittingflags( rdrv, rdev, state ); if (RADEON_BLIT_3D()) { funcs->Blit = r200Blit3D; funcs->StretchBlit = r200StretchBlit; funcs->TextureTriangles = r200TextureTriangles; funcs->EmitCommands = r200EmitCommands3D; } else { funcs->Blit = RADEON_FUNC(radeonBlit2D); funcs->StretchBlit = NULL; funcs->TextureTriangles = NULL; funcs->EmitCommands = NULL; } state->set = (accel & DFXL_TEXTRIANGLES) ? : (rdev->blitting_mask & ~DFXL_TEXTRIANGLES); break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } static void r300SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; rdev->set &= ~state->mod_hw; if (DFB_BLITTING_FUNCTION( accel )) { if ((rdev->accel ^ accel) & DFXL_TEXTRIANGLES) rdev->set &= ~SMF_BLITTING_FLAGS; } rdev->accel = accel; r300_set_destination( rdrv, rdev, state ); r300_set_clip( rdrv, rdev, state ); r300_set_render_options( rdrv, rdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: r300_set_drawing_color( rdrv, rdev, state ); if (state->drawingflags & DSDRAW_BLEND) r300_set_blend_function( rdrv, rdev, state ); r300_set_drawingflags( rdrv, rdev, state ); if (RADEON_DRAW_3D()) { funcs->FillRectangle = r300FillRectangle3D; funcs->FillTriangle = r300FillTriangle; funcs->DrawRectangle = r300DrawRectangle3D; funcs->DrawLine = r300DrawLine3D; funcs->EmitCommands = r300EmitCommands3D; } else { funcs->FillRectangle = RADEON_FUNC(radeonFillRectangle2D); funcs->FillTriangle = NULL; funcs->DrawRectangle = RADEON_FUNC(radeonDrawRectangle2D); funcs->DrawLine = RADEON_FUNC(radeonDrawLine2D); funcs->EmitCommands = NULL; } state->set = rdev->drawing_mask; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: r300_set_source( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MODULATE_ALPHA) r300_set_blend_function( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_MODULATE_COLOR) r300_set_blitting_color( rdrv, rdev, state ); if (state->blittingflags & DSBLIT_SRC_COLORKEY) r300_set_src_colorkey( rdrv, rdev, state ); r300_set_blittingflags( rdrv, rdev, state ); if (RADEON_BLIT_3D()) { funcs->Blit = r300Blit3D; funcs->StretchBlit = r300StretchBlit; funcs->TextureTriangles = r300TextureTriangles; funcs->EmitCommands = r300EmitCommands3D; } else { funcs->Blit = RADEON_FUNC(radeonBlit2D); funcs->StretchBlit = NULL; funcs->TextureTriangles = NULL; funcs->EmitCommands = NULL; } state->set = (accel & DFXL_TEXTRIANGLES) ? : (rdev->blitting_mask & ~DFXL_TEXTRIANGLES); break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } /* chipset detection */ static int radeon_find_chipset( RadeonDriverData *rdrv, int *ret_devid, int *ret_index ) { volatile u8 *mmio = rdrv->mmio_base; unsigned int vendor_id; unsigned int device_id; int i; vendor_id = radeon_in16( mmio, CONFIG_VENDOR_ID ); device_id = radeon_in16( mmio, CONFIG_DEVICE_ID ); if (vendor_id != 0x1002 || !device_id) dfb_system_get_deviceid( &vendor_id, &device_id ); if (vendor_id == 0x1002) { if (ret_devid) *ret_devid = device_id; for (i = 0; i < D_ARRAY_SIZE( dev_table ); i++) { if ((unsigned int)dev_table[i].id == device_id) { if (ret_index) *ret_index = i; return 1; } } } return 0; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_ATI_RADEON: return 1; default: break; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "ATI Radeon Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Claudio Ciccani" ); snprintf( info->license, DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH, "LGPL" ); snprintf( info->url, DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH, "http://www.directfb.org" ); info->version.major = 1; info->version.minor = 2; info->driver_data_size = sizeof(RadeonDriverData); info->device_data_size = sizeof(RadeonDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonChipsetFamily chip = CHIP_UNKNOWN; int idx; rdrv->device_data = (RadeonDeviceData*) device_data; /* gain access to memory mapped registers */ rdrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, 0x4000 ); if (!rdrv->mmio_base) return DFB_IO; rdrv->mmio_size = 0x4000; rdrv->fb_base = dfb_gfxcard_memory_virtual( device, 0 ); if (radeon_find_chipset( rdrv, NULL, &idx )) chip = dev_table[idx].chip; if (chip >= CHIP_R300 && !getenv( "R300_DISABLE_3D" )) { volatile void *base; /* increase amount of memory mapped registers */ base = dfb_gfxcard_map_mmio( device, 0, 0x8000 ); if (!base) { D_ERROR( "DirectFB/Radeon: You are running a buggy version of radeonfb!\n" " -> Please, apply the kernel patch named radeonfb-r300fix.\n" ); D_INFO( "DirectFB/Radeon: 3D Acceleration will be disabled.\n" ); } else { rdrv->mmio_base = base; rdrv->mmio_size = 0x8000; } } /* fill function table */ funcs->AfterSetVar = radeonAfterSetVar; funcs->EngineReset = radeonEngineReset; funcs->EngineSync = radeonEngineSync; funcs->InvalidateState = radeonInvalidateState; funcs->FlushTextureCache = radeonFlushTextureCache; #ifdef WORDS_BIGENDIAN funcs->SurfaceEnter = radeonSurfaceEnter; funcs->SurfaceLeave = radeonSurfaceLeave; #endif if (chip >= CHIP_R300) { funcs->CheckState = r300CheckState; funcs->SetState = r300SetState; } else if (chip >= CHIP_R200) { funcs->CheckState = r200CheckState; funcs->SetState = r200SetState; } else if (chip >= CHIP_R100) { funcs->CheckState = r100CheckState; funcs->SetState = r100SetState; } /* primary screen */ dfb_screens_hook_primary( device, driver_data, &RadeonCrtc1ScreenFuncs, &OldPrimaryScreenFuncs, &OldPrimaryScreenDriverData ); /* primary layer */ dfb_layers_hook_primary( device, driver_data, &RadeonCrtc1LayerFuncs, &OldPrimaryLayerFuncs, &OldPrimaryLayerDriverData ); /* overlay support */ dfb_layers_register( dfb_screens_at( DSCID_PRIMARY ), driver_data, &RadeonOverlayFuncs ); if (chip != CHIP_R100) { CoreScreen *screen; /* secondary screen support */ screen = dfb_screens_register( device, driver_data, &RadeonCrtc2ScreenFuncs ); /* secondary underlay support */ dfb_layers_register( screen, driver_data, &RadeonCrtc2LayerFuncs ); /* secondary overlay support */ dfb_layers_register( screen, driver_data, &RadeonOverlayFuncs ); } return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonDeviceData *rdev = (RadeonDeviceData*) device_data; volatile void *mmio = rdrv->mmio_base; int dev = 0; int idx = 0; const char *name = "Unknown"; if (radeon_find_chipset( rdrv, &dev, &idx )) { rdev->chipset = dev_table[idx].chip; rdev->igp = dev_table[idx].igp; name = dev_table[idx].name; } else { if (!dev) { D_ERROR( "DirectFB/Radeon: Could not detect device id!\n" " -> Please, specify the bus location of" " the card by using the 'busid' option.\n" ); } D_INFO( "DirectFB/Radeon: " "Unknown chipset, disabling acceleration!\n" ); } /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "%s (%04x)", name, dev ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "ATI" ); device_info->caps.flags = CCF_CLIPPING | CCF_AUXMEMORY | CCF_RENDEROPTS; if (rdev->chipset >= CHIP_R300) { if (rdrv->mmio_size > 0x4000) { device_info->caps.accel = R300_SUPPORTED_DRAWINGFUNCS | R300_SUPPORTED_BLITTINGFUNCS; device_info->caps.drawing = R300_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = R300_SUPPORTED_BLITTINGFLAGS; } else { device_info->caps.accel = RADEON_SUPPORTED_2D_DRAWINGFUNCS | RADEON_SUPPORTED_2D_BLITTINGFUNCS; device_info->caps.drawing = RADEON_SUPPORTED_2D_DRAWINGFLAGS; device_info->caps.blitting = RADEON_SUPPORTED_2D_BLITTINGFLAGS; } } else if (rdev->chipset >= CHIP_R200) { device_info->caps.accel = R200_SUPPORTED_DRAWINGFUNCS | R200_SUPPORTED_BLITTINGFUNCS; device_info->caps.drawing = R200_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = R200_SUPPORTED_BLITTINGFLAGS; } else if (rdev->chipset >= CHIP_R100) { device_info->caps.accel = R100_SUPPORTED_DRAWINGFUNCS | R100_SUPPORTED_BLITTINGFUNCS; device_info->caps.drawing = R100_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = R100_SUPPORTED_BLITTINGFLAGS; } device_info->limits.surface_byteoffset_alignment = 32; device_info->limits.surface_pixelpitch_alignment = 64; device_info->limits.surface_bytepitch_alignment = 128; dfb_config->pollvsync_after = 1; /* reserve memory for YUV422 color buffer */ rdev->yuv422_buffer = dfb_gfxcard_reserve_memory( device, 128 ); if (rdev->yuv422_buffer == (u32)-1) { D_ERROR( "DirectFB/Radeon: " "couldn't reserve 128 bytes of video memory!\n" ); return DFB_NOVIDEOMEMORY; } rdev->fb_phys = dfb_gfxcard_memory_physical( device, 0 ); radeon_waitidle( rdrv, rdev ); /* get connected monitors */ radeon_get_monitors( rdrv, rdev, &rdev->monitor1, &rdev->monitor2 ); /* save the following regs */ rdev->mc_fb_location = radeon_in32( mmio, MC_FB_LOCATION ); rdev->mc_agp_location = radeon_in32( mmio, MC_AGP_LOCATION ); rdev->crtc_base_addr = radeon_in32( mmio, CRTC_BASE_ADDR ); rdev->crtc2_base_addr = radeon_in32( mmio, CRTC2_BASE_ADDR ); rdev->agp_base = radeon_in32( mmio, AGP_BASE ); rdev->agp_cntl = radeon_in32( mmio, AGP_CNTL ); rdev->aic_cntl = radeon_in32( mmio, AIC_CNTL ); rdev->bus_cntl = radeon_in32( mmio, BUS_CNTL ); rdev->fcp_cntl = radeon_in32( mmio, FCP_CNTL ); rdev->cap0_trig_cntl = radeon_in32( mmio, CAP0_TRIG_CNTL ); rdev->vid_buffer_control = radeon_in32( mmio, VID_BUFFER_CONTROL ); rdev->display_test_debug_cntl = radeon_in32( mmio, DISPLAY_TEST_DEBUG_CNTL ); rdev->surface_cntl = radeon_in32( mmio, SURFACE_CNTL ); rdev->dp_gui_master_cntl = radeon_in32( mmio, DP_GUI_MASTER_CNTL ); rdev->surface_cntl_p = rdev->surface_cntl_c = rdev->surface_cntl; if (rdev->igp) { u32 tom; /* force MC_FB_LOCATION to NB_TOM */ tom = radeon_in32( mmio, NB_TOM ); rdev->fb_offset = tom << 16; rdev->fb_size = ((tom >> 16) - (tom & 0xffff) + 1) << 16; } else { if (rdev->chipset >= CHIP_R300) { rdev->fb_offset = 0; rdev->fb_size = radeon_in32( mmio, CONFIG_MEMSIZE ); } else { rdev->fb_offset = radeon_in32( mmio, CONFIG_APER_0_BASE ); rdev->fb_size = radeon_in32( mmio, CONFIG_APER_SIZE ); } } radeon_out32( mmio, MC_FB_LOCATION, (rdev->fb_offset>>16) | ((rdev->fb_offset + rdev->fb_size - 1) & 0xffff0000) ); D_DEBUG( "DirectFB/Radeon: " "Framebuffer located at 0x%08x:0x%08x.\n", rdev->fb_offset, rdev->fb_offset + rdev->fb_size - 1 ); if (dfb_system_auxram_length()) { rdev->agp_offset = (rdev->fb_offset + rdev->fb_size) & 0xffc00000; rdev->agp_size = dfb_system_auxram_length(); /* enable AGP support */ radeon_out32( mmio, AIC_CNTL, rdev->aic_cntl & ~PCIGART_TRANSLATE_EN ); radeon_out32( mmio, AGP_BASE, dfb_system_aux_memory_physical( 0 ) ); radeon_out32( mmio, AGP_CNTL, rdev->agp_cntl | 0x000e0000 ); radeon_out32( mmio, BUS_CNTL, rdev->bus_cntl & ~BUS_MASTER_DIS ); radeon_out32( mmio, MC_AGP_LOCATION, (rdev->agp_offset>>16) | ((rdev->agp_offset + rdev->agp_size - 1) & 0xffff0000) ); D_DEBUG( "DirectFB/Radeon: " "AGP Aperture located at 0x%08x:0x%08x.\n", rdev->agp_offset, rdev->agp_offset + rdev->agp_size - 1 ); } radeon_out32( mmio, CRTC_BASE_ADDR, rdev->fb_offset ); radeon_out32( mmio, DISP_MERGE_CNTL, 0xffff0000 ); if (rdev->chipset != CHIP_R100) { radeon_out32( mmio, CRTC2_BASE_ADDR, rdev->fb_offset ); radeon_out32( mmio, DISP2_MERGE_CNTL, 0xffff0000 ); } radeon_out32( mmio, FCP_CNTL, FCP0_SRC_GND ); radeon_out32( mmio, CAP0_TRIG_CNTL, 0 ); radeon_out32( mmio, VID_BUFFER_CONTROL, 0x00010001 ); radeon_out32( mmio, DISPLAY_TEST_DEBUG_CNTL, 0 ); radeon_reset( rdrv, rdev ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonDeviceData *rdev = (RadeonDeviceData*) device_data; volatile u8 *mmio = rdrv->mmio_base; D_DEBUG( "DirectFB/Radeon: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFB/Radeon: %9d radeon_waitfifo calls\n", rdev->waitfifo_calls ); D_DEBUG( "DirectFB/Radeon: %9d register writes (radeon_waitfifo sum)\n", rdev->waitfifo_sum ); D_DEBUG( "DirectFB/Radeon: %9d FIFO wait cycles (depends on CPU)\n", rdev->fifo_waitcycles ); D_DEBUG( "DirectFB/Radeon: %9d IDLE wait cycles (depends on CPU)\n", rdev->idle_waitcycles ); D_DEBUG( "DirectFB/Radeon: %9d FIFO space cache hits(depends on CPU)\n", rdev->fifo_cache_hits ); D_DEBUG( "DirectFB/Radeon: Conclusion:\n" ); D_DEBUG( "DirectFB/Radeon: Average register writes/radeon_waitfifo call:%.2f\n", rdev->waitfifo_sum / (float)rdev->waitfifo_calls ); D_DEBUG( "DirectFB/Radeon: Average wait cycles/radeon_waitfifo call: %.2f\n", rdev->fifo_waitcycles / (float)rdev->waitfifo_calls ); D_DEBUG( "DirectFB/Radeon: Average fifo space cache hits: %02d%%\n", (int)(100 * rdev->fifo_cache_hits / (float)rdev->waitfifo_calls) ); radeon_reset( rdrv, rdev ); /* restore previously saved regs */ radeon_out32( mmio, MC_FB_LOCATION, rdev->mc_fb_location ); radeon_out32( mmio, MC_AGP_LOCATION, rdev->mc_agp_location ); radeon_out32( mmio, CRTC_BASE_ADDR, rdev->crtc_base_addr ); radeon_out32( mmio, CRTC2_BASE_ADDR, rdev->crtc2_base_addr ); radeon_out32( mmio, AGP_CNTL, rdev->agp_cntl ); radeon_out32( mmio, AGP_BASE, rdev->agp_base ); radeon_out32( mmio, AIC_CNTL, rdev->aic_cntl ); radeon_out32( mmio, BUS_CNTL, rdev->bus_cntl ); radeon_out32( mmio, FCP_CNTL, rdev->fcp_cntl ); radeon_out32( mmio, CAP0_TRIG_CNTL, rdev->cap0_trig_cntl ); radeon_out32( mmio, VID_BUFFER_CONTROL, rdev->vid_buffer_control ); radeon_out32( mmio, DISPLAY_TEST_DEBUG_CNTL, rdev->display_test_debug_cntl ); radeon_out32( mmio, SURFACE_CNTL, rdev->surface_cntl ); radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, SC_TOP_LEFT, 0 ); radeon_out32( mmio, DEFAULT_SC_BOTTOM_RIGHT, DEFAULT_SC_RIGHT_MAX | DEFAULT_SC_BOTTOM_MAX ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, rdev->dp_gui_master_cntl ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; dfb_gfxcard_unmap_mmio( device, rdrv->mmio_base, rdrv->mmio_size ); } DirectFB-1.2.10/gfxdrivers/radeon/r200_3d.c0000644000175000017500000004471511164361026015021 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_3d.h" #define EMIT_VERTICES( rdrv, rdev, mmio ) { \ u32 *_v = (rdev)->vb; \ u32 _s = (rdev)->vb_size; \ radeon_waitfifo( rdrv, rdev, 1 ); \ radeon_out32( mmio, SE_VF_CNTL, rdev->vb_type | VF_PRIM_WALK_DATA | \ (rdev->vb_count << VF_NUM_VERTICES_SHIFT) ); \ do { \ u32 _n = MIN(_s, 64); \ _s -= _n; \ radeon_waitfifo( rdrv, rdev, _n ); \ while (_n--) \ radeon_out32( mmio, SE_PORT_DATA0, *_v++ ); \ } while (_s); \ } static void r200_flush_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { volatile u8 *mmio = rdrv->mmio_base; EMIT_VERTICES( rdrv, rdev, mmio ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { DFBRegion *clip = &rdev->clip; bool s420 = DFB_PLANAR_PIXELFORMAT(rdev->src_format); int i; if (DFB_BLITTING_FUNCTION(rdev->accel)) { for (i = 0; i < rdev->vb_size; i += 4) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); if (s420) { rdev->vb[i+2] = f2d(d2f(rdev->vb[i+2])*0.5f); rdev->vb[i+3] = f2d(d2f(rdev->vb[i+3])*0.5f); } } } else { for (i = 0; i < rdev->vb_size; i += 2) { rdev->vb[i+0] = f2d(d2f(rdev->vb[i+0])*0.5f); rdev->vb[i+1] = f2d(d2f(rdev->vb[i+1])*0.5f); } } /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch/2 ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2/2 << 16) | (clip->x2/2 & 0xffff) ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, R200_PP_TFACTOR_0, rdev->cb_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, R200_PP_TXSIZE_0, ((rdev->src_height/2-1) << 16) | ((rdev->src_width/2-1) & 0xffff) ); radeon_out32( mmio, R200_PP_TXPITCH_0, rdev->src_pitch/2 - 32 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset_cb ); } } else { radeon_out32( mmio, R200_PP_TFACTOR_1, rdev->cb_cop ); } /* Fill Cb plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cr ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, R200_PP_TFACTOR_0, rdev->cr_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset_cr ); } } else { radeon_out32( mmio, R200_PP_TFACTOR_1, rdev->cr_cop ); } /* Fill Cr plane */ EMIT_VERTICES( rdrv, rdev, mmio ); /* Reset */ radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch ); radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); if (DFB_BLITTING_FUNCTION(rdev->accel)) { radeon_out32( mmio, R200_PP_TFACTOR_0, rdev->y_cop ); if (s420) { radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, R200_PP_TXSIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, R200_PP_TXPITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset ); } } else { radeon_out32( mmio, R200_PP_TFACTOR_1, rdev->y_cop ); } } rdev->vb_size = 0; rdev->vb_count = 0; } static inline u32* r200_init_vb( RadeonDriverData *rdrv, RadeonDeviceData *rdev, u32 type, u32 count, u32 size ) { u32 *vb; if ((rdev->vb_size && rdev->vb_type != type) || rdev->vb_size+size > D_ARRAY_SIZE(rdev->vb)) r200_flush_vb( rdrv, rdev ); vb = &rdev->vb[rdev->vb_size]; rdev->vb_type = type; rdev->vb_size += size; rdev->vb_count += count; return vb; } bool r200FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; if (rect->w == 1 && rect->h == 1) { x1 = rect->x+1; y1 = rect->y+1; if (rdev->matrix) RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_POINT_LIST, 1, 2 ); *v++ = f2d(x1); *v++ = f2d(y1); return true; } x1 = rect->x; y1 = rect->y; x2 = rect->x+rect->w; y2 = rect->y+rect->h; if (rdev->matrix) { float x, y; v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_QUAD_LIST, 4, 8 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); } else { v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_RECTANGLE_LIST, 3, 6 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y2); } return true; } bool r200FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; float x3, y3; u32 *v; x1 = tri->x1; y1 = tri->y1; x2 = tri->x2; y2 = tri->y2; x3 = tri->x3; y3 = tri->y3; if (rdev->matrix) { RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, x2, y2, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x3, y3, x3, y3, rdev->matrix, rdev->affine_matrix ); } v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_TRIANGLE_LIST, 3, 6 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y2); *v++ = f2d(x3); *v++ = f2d(y3); return true; } bool r200DrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; x1 = rect->x; y1 = rect->y; x2 = rect->x+rect->w; y2 = rect->y+rect->h; if (rdev->matrix) { float x, y; v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LOOP, 4, 8 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); } else { v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_RECTANGLE_LIST, 12, 24 ); /* top line */ *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y1+1); /* right line */ *v++ = f2d(x2-1); *v++ = f2d(y1+1); *v++ = f2d(x2); *v++ = f2d(y1+1); *v++ = f2d(x2); *v++ = f2d(y2-1); /* bottom line */ *v++ = f2d(x1); *v++ = f2d(y2-1); *v++ = f2d(x2); *v++ = f2d(y2-1); *v++ = f2d(x2); *v++ = f2d(y2); /* left line */ *v++ = f2d(x1); *v++ = f2d(y1+1); *v++ = f2d(x1+1); *v++ = f2d(y1+1); *v++ = f2d(x1+1); *v++ = f2d(y2-1); } return true; } bool r200DrawLine3D( void *drv, void *dev, DFBRegion *line ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; u32 *v; x1 = line->x1; y1 = line->y1; x2 = line->x2; y2 = line->y2; if (rdev->matrix) { RADEON_TRANSFORM( x1, y1, x1, y1, rdev->matrix, rdev->affine_matrix ); RADEON_TRANSFORM( x2, y2, x2, y2, rdev->matrix, rdev->affine_matrix ); } v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_LINE_LIST, 2, 4 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(x2); *v++ = f2d(y2); return true; } bool r200Blit3D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ) { DFBRectangle dr = { dx, dy, sr->w, sr->h }; return r200StretchBlit( drv, dev, sr, &dr ); } bool r200StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; float x1, y1; float x2, y2; float s1, t1; float s2, t2; u32 *v; if (rdev->blittingflags & DSBLIT_DEINTERLACE) { sr->y /= 2; sr->h /= 2; } s1 = sr->x; t1 = sr->y; s2 = sr->x+sr->w; t2 = sr->y+sr->h; if (rdev->blittingflags & DSBLIT_ROTATE180) { float tmp; tmp = s2; s2 = s1; s1 = tmp; tmp = t2; t2 = t1; t1 = tmp; } x1 = dr->x; y1 = dr->y; x2 = dr->x+dr->w; y2 = dr->y+dr->h; if (rdev->matrix) { float x, y; v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_QUAD_LIST, 4, 16 ); RADEON_TRANSFORM( x1, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(s1); *v++ = f2d(t1); RADEON_TRANSFORM( x2, y1, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(s2); *v++ = f2d(t1); RADEON_TRANSFORM( x2, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(s2); *v++ = f2d(t2); RADEON_TRANSFORM( x1, y2, x, y, rdev->matrix, rdev->affine_matrix ); *v++ = f2d(x); *v++ = f2d(y); *v++ = f2d(s1); *v++ = f2d(t2); } else { v = r200_init_vb( rdrv, rdev, VF_PRIM_TYPE_RECTANGLE_LIST, 3, 12 ); *v++ = f2d(x1); *v++ = f2d(y1); *v++ = f2d(s1); *v++ = f2d(t1); *v++ = f2d(x2); *v++ = f2d(y1); *v++ = f2d(s2); *v++ = f2d(t1); *v++ = f2d(x2); *v++ = f2d(y2); *v++ = f2d(s2); *v++ = f2d(t2); } return true; } static void r200DoTextureTriangles( RadeonDriverData *rdrv, RadeonDeviceData *rdev, DFBVertex *ve, int num, u32 primitive ) { volatile u8 *mmio = rdrv->mmio_base; int i; radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, SE_VF_CNTL, primitive | VF_PRIM_WALK_DATA | (num << VF_NUM_VERTICES_SHIFT) ); for (; num >= 10; num -= 10) { radeon_waitfifo( rdrv, rdev, 60 ); for (i = 0; i < 10; i++) { radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].x) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].y) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].z) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].w) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].s) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].t) ); } ve += 10; } if (num > 0) { radeon_waitfifo( rdrv, rdev, num*6 ); for (i = 0; i < num; i++) { radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].x) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].y) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].z) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].w) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].s) ); radeon_out32( mmio, SE_PORT_DATA0, f2d(ve[i].t) ); } } } bool r200TextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; u32 prim = 0; int i; if (num > 65535) { D_WARN( "R200 supports maximum 65535 vertices" ); return false; } switch (formation) { case DTTF_LIST: prim = VF_PRIM_TYPE_TRIANGLE_LIST; break; case DTTF_STRIP: prim = VF_PRIM_TYPE_TRIANGLE_STRIP; break; case DTTF_FAN: prim = VF_PRIM_TYPE_TRIANGLE_FAN; break; default: D_BUG( "unexpected triangle formation" ); return false; } if (rdev->matrix) { for (i = 0; i < num; i++) RADEON_TRANSFORM( ve[i].x, ve[i].y, ve[i].x, ve[i].y, rdev->matrix, rdev->affine_matrix ); } r200DoTextureTriangles( rdrv, rdev, ve, num, prim ); if (DFB_PLANAR_PIXELFORMAT(rdev->dst_format)) { DFBRegion *clip = &rdev->clip; volatile u8 *mmio = rdrv->mmio_base; bool s420 = DFB_PLANAR_PIXELFORMAT(rdev->src_format); /* Scale coordinates */ for (i = 0; i < num; i++) { ve[i].x *= 0.5; ve[i].y *= 0.5; } /* Prepare Cb plane */ radeon_waitfifo( rdrv, rdev, s420 ? 8 : 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cb ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch/2 ); if (s420) { radeon_out32( mmio, R200_PP_TXSIZE_0, ((rdev->src_height/2-1) << 16) | ((rdev->src_width/2-1) & 0xffff) ); radeon_out32( mmio, R200_PP_TXPITCH_0, rdev->src_pitch/2 - 32 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset_cb ); } radeon_out32( mmio, RE_TOP_LEFT, (clip->y1/2 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2/2 << 16) | (clip->x2/2 & 0xffff) ); radeon_out32( mmio, R200_PP_TFACTOR_0, rdev->cb_cop ); /* Map Cb plane */ r200DoTextureTriangles( rdrv, rdev, ve, num, prim ); /* Prepare Cr plane */ radeon_waitfifo( rdrv, rdev, s420 ? 3 : 2 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset_cr ); if (s420) radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset_cr ); radeon_out32( mmio, R200_PP_TFACTOR_0, rdev->cr_cop ); /* Map Cr plane */ r200DoTextureTriangles( rdrv, rdev, ve, num, prim ); /* Reset */ radeon_waitfifo( rdrv, rdev, s420 ? 8 : 5 ); radeon_out32( mmio, RB3D_COLOROFFSET, rdev->dst_offset ); radeon_out32( mmio, RB3D_COLORPITCH, rdev->dst_pitch ); if (s420) { radeon_out32( mmio, R200_PP_TXSIZE_0, ((rdev->src_height-1) << 16) | ((rdev->src_width-1) & 0xffff) ); radeon_out32( mmio, R200_PP_TXPITCH_0, rdev->src_pitch - 32 ); radeon_out32( mmio, R200_PP_TXOFFSET_0, rdev->src_offset ); } radeon_out32( mmio, RE_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, RE_BOTTOM_RIGHT, (clip->y2 << 16) | (clip->x2 & 0xffff) ); radeon_out32( mmio, R200_PP_TFACTOR_0, rdev->y_cop ); } return true; } void r200EmitCommands3D( void *drv, void *dev ) { RadeonDriverData *rdrv = (RadeonDriverData*) drv; RadeonDeviceData *rdev = (RadeonDeviceData*) dev; if (rdev->vb_count) r200_flush_vb( rdrv, rdev ); } DirectFB-1.2.10/gfxdrivers/radeon/vertex_shader.h0000644000175000017500000000531011164361026016604 00000000000000#ifndef __VERTEX_SHADER_H__ #define __VERTEX_SHADER_H__ #define VSF_FLAG_X 1 #define VSF_FLAG_Y 2 #define VSF_FLAG_Z 4 #define VSF_FLAG_W 8 #define VSF_FLAG_XYZ (VSF_FLAG_X | VSF_FLAG_Y | VSF_FLAG_Z) #define VSF_FLAG_ALL 0xf #define VSF_FLAG_NONE 0 #define VSF_OUT_CLASS_TMP 0 #define VSF_OUT_CLASS_ADDR 1 #define VSF_OUT_CLASS_RESULT 2 /* first CARD32 of an instruction */ /* possible operations: DOT, MUL, ADD, MAD, FRC, MAX, MIN, SGE, SLT, EXP, LOG, LIT, POW, RCP, RSQ, EX2, LG2, MAD_2 */ #define MAKE_VSF_OP(op, out_reg_index, out_reg_fields, class) \ ((op) \ | ((out_reg_index) << R300_VPI_OUT_REG_INDEX_SHIFT) \ | ((out_reg_fields) << 20) \ | ( (class) << 8 ) ) #define EASY_VSF_OP(op, out_reg_index, out_reg_fields, class) \ MAKE_VSF_OP(R300_VPI_OUT_OP_##op, out_reg_index, VSF_FLAG_##out_reg_fields, VSF_OUT_CLASS_##class) \ /* according to Nikolai, the subsequent 3 CARD32 are sources, use same define for each */ #define VSF_IN_CLASS_TMP 0 #define VSF_IN_CLASS_ATTR 1 #define VSF_IN_CLASS_PARAM 2 #define VSF_IN_CLASS_NONE 9 #define VSF_IN_COMPONENT_X 0 #define VSF_IN_COMPONENT_Y 1 #define VSF_IN_COMPONENT_Z 2 #define VSF_IN_COMPONENT_W 3 #define VSF_IN_COMPONENT_ZERO 4 #define VSF_IN_COMPONENT_ONE 5 #define MAKE_VSF_SOURCE(in_reg_index, comp_x, comp_y, comp_z, comp_w, class, negate) \ ( ((in_reg_index)< * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" #include "radeon_state.h" #include "r300_program.h" #define R300_HAS_3DREGS() (rdrv->mmio_size > 0x4000) static const u32 r300SrcBlend[] = { SRC_BLEND_GL_ZERO, // DSBF_ZERO SRC_BLEND_GL_ONE, // DSBF_ONE SRC_BLEND_GL_SRC_COLOR, // DSBF_SRCCOLOR SRC_BLEND_GL_ONE_MINUS_SRC_COLOR, // DSBF_INVSRCCOLOR SRC_BLEND_GL_SRC_ALPHA, // DSBF_SRCALPHA SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA, // DSBF_INVSRCALPHA SRC_BLEND_GL_DST_ALPHA, // DSBF_DSTALPHA SRC_BLEND_GL_ONE_MINUS_DST_ALPHA, // DSBF_INVDSTALPHA SRC_BLEND_GL_DST_COLOR, // DSBF_DSTCOLOR SRC_BLEND_GL_ONE_MINUS_DST_COLOR, // DSBF_INVDSTCOLOR SRC_BLEND_GL_SRC_ALPHA_SATURATE // DSBF_SRCALPHASAT }; static const u32 r300DstBlend[] = { DST_BLEND_GL_ZERO, // DSBF_ZERO DST_BLEND_GL_ONE, // DSBF_ONE DST_BLEND_GL_SRC_COLOR, // DSBF_SRCCOLOR DST_BLEND_GL_ONE_MINUS_SRC_COLOR, // DSBF_INVSRCCOLOR DST_BLEND_GL_SRC_ALPHA, // DSBF_SRCALPHA DST_BLEND_GL_ONE_MINUS_SRC_ALPHA, // DSBF_INVSRCALPHA DST_BLEND_GL_DST_ALPHA, // DSBF_DSTALPHA DST_BLEND_GL_ONE_MINUS_DST_ALPHA, // DSBF_INVDSTALPHA DST_BLEND_GL_DST_COLOR, // DSBF_DSTCOLOR DST_BLEND_GL_ONE_MINUS_DST_COLOR, // DSBF_INVDSTCOLOR DST_BLEND_GL_ZERO // DSBF_SRCALPHASAT }; void r300_restore( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { const u32 rs_magic[8] = { 0x00, 0x44, 0x84, 0xc4, 0x04, 0x04, 0x04, 0x04 }; volatile u8 *mmio = rdrv->mmio_base; int i; /* enable caches */ radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( mmio, RB2D_DSTCACHE_MODE, RB2D_DC_2D_CACHE_AUTOFLUSH | R300_RB2D_DC_ENABLE ); if (!R300_HAS_3DREGS()) return; /* restore 3d engine state */ radeon_waitfifo( rdrv, rdev, 50 ); radeon_out32( mmio, 0x2080, 0x0030045a ); radeon_out32( mmio, R300_SE_VTE_CNTL, R300_VTX_W0_FMT ); radeon_out32( mmio, R300_SE_VTE_CNTL+4, 0x00000008 ); radeon_out32( mmio, 0x2134, 0x00FFFFFF ); radeon_out32( mmio, 0x2138, 0x00000000 ); #ifdef WORDS_BIGENDIAN radeon_out32( mmio, 0x2140, 0x00000002 ); #else radeon_out32( mmio, 0x2140, 0x00000000 ); #endif radeon_out32( mmio, 0x21dc, 0xaaaaaaaa ); radeon_out32( mmio, 0x2220, f2d(1.0) ); radeon_out32( mmio, 0x2224, f2d(1.0) ); radeon_out32( mmio, 0x2228, f2d(1.0) ); radeon_out32( mmio, 0x222c, f2d(1.0) ); if (rdev->chipset >= CHIP_RV350) radeon_out32( mmio, R300_VAP_UNKNOWN_2288, R300_2288_RV350 ); else radeon_out32( mmio, R300_VAP_UNKNOWN_2288, R300_2288_R300 ); radeon_out32( mmio, R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE | R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE ); radeon_out32( mmio, R300_GB_MSPOS0, 0x66666666 ); radeon_out32( mmio, R300_GB_MSPOS1, 0x06666666 ); if (rdev->chipset == CHIP_R300 || rdev->chipset == CHIP_R350 || rdev->chipset == CHIP_RV410) { radeon_out32( mmio, R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_R300 | R300_GB_TILE_SIZE_16 ); } else if (rdev->chipset == CHIP_R420) { radeon_out32( mmio, R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_R420 | R300_GB_TILE_SIZE_16 ); } else { radeon_out32( mmio, R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE | R300_GB_TILE_PIPE_COUNT_RV300 | R300_GB_TILE_SIZE_16 ); } radeon_out32( mmio, R300_GB_SELECT, 0 ); radeon_out32( mmio, R300_GB_AA_CONFIG, 0 ); radeon_out32( mmio, 0x4200, f2d(0.0) ); radeon_out32( mmio, 0x4204, f2d(0.0) ); radeon_out32( mmio, 0x4208, f2d(1.0) ); radeon_out32( mmio, 0x420c, f2d(1.0) ); radeon_out32( mmio, 0x4214, 0x00050005 ); radeon_out32( mmio, R300_RE_POINTSIZE, (6 << R300_POINTSIZE_X_SHIFT) | (6 << R300_POINTSIZE_Y_SHIFT) ); radeon_out32( mmio, 0x4230, 0x18000006 ); radeon_out32( mmio, R300_RE_LINE_CNT, (6 << R300_LINESIZE_SHIFT) | R300_LINE_CNT_VE ); radeon_out32( mmio, R300_RE_UNK4238, f2d(1.0/192.0) ); radeon_out32( mmio, 0x4260, 0x00000000 ); radeon_out32( mmio, 0x4264, f2d(0.0) ); radeon_out32( mmio, 0x4268, f2d(1.0) ); radeon_out32( mmio, 0x4274, 0x00000002 ); radeon_out32( mmio, 0x427c, 0x00000000 ); radeon_out32( mmio, 0x4280, 0x00000000 ); radeon_out32( mmio, R300_RE_POLYGON_MODE, 0 ); radeon_out32( mmio, 0x428c, 0x00000001 ); radeon_out32( mmio, 0x4290, 0x00000000 ); radeon_out32( mmio, 0x4294, 0x00000000 ); radeon_out32( mmio, 0x4298, 0x00000000 ); radeon_out32( mmio, 0x42a0, 0x00000000 ); radeon_out32( mmio, R300_RE_ZBIAS_T_FACTOR, 0 ); radeon_out32( mmio, R300_RE_ZBIAS_T_CONSTANT, 0 ); radeon_out32( mmio, R300_RE_ZBIAS_W_FACTOR, 0 ); radeon_out32( mmio, R300_RE_ZBIAS_W_CONSTANT, 0 ); radeon_out32( mmio, R300_RE_OCCLUSION_CNTL, 0 ); radeon_out32( mmio, R300_RE_CULL_CNTL, 0 ); radeon_out32( mmio, 0x42c0, 0x4b7fffff ); radeon_out32( mmio, 0x42c4, 0x00000000 ); radeon_waitfifo( rdrv, rdev, 16 ); for (i = 0; i < 8; i++) { radeon_out32( mmio, R300_RS_INTERP_0+i*4, R300_RS_INTERP_USED | rs_magic[i] ); //radeon_out32( mmio, R300_RS_ROUTE_0+i*4, 0 ); } radeon_waitfifo( rdrv, rdev, 43 ); radeon_out32( mmio, 0x43a4, 0x0000001c ); radeon_out32( mmio, 0x43a8, 0x2da49525 ); radeon_out32( mmio, 0x43e8, 0x00ffffff ); radeon_out32( mmio, 0x46a4, 0x00001b01 ); radeon_out32( mmio, 0x46a8, 0x00001b0f ); radeon_out32( mmio, 0x46ac, 0x00001b0f ); radeon_out32( mmio, 0x46b0, 0x00001b0f ); radeon_out32( mmio, 0x46b4, 0x00000001 ); radeon_out32( mmio, 0x4bc0, 0x00000000 ); radeon_out32( mmio, 0x4bc8, 0x00000000 ); radeon_out32( mmio, 0x4bcc, 0x00000000 ); radeon_out32( mmio, 0x4bd0, 0x00000000 ); radeon_out32( mmio, R300_PP_ALPHA_TEST, R300_ALPHA_TEST_PASS ); radeon_out32( mmio, 0x4bd8, 0x00000000 ); radeon_out32( mmio, 0x4e00, 0x00000000 ); radeon_out32( mmio, R300_RB3D_COLORMASK, R300_COLORMASK0_B | R300_COLORMASK0_G | R300_COLORMASK0_R | R300_COLORMASK0_A ); radeon_out32( mmio, R300_RB3D_BLENDCOLOR, 0xffffffff ); radeon_out32( mmio, 0x4e14, 0x00000000 ); radeon_out32( mmio, 0x4e18, 0x00000000 ); radeon_out32( mmio, 0x4e50, 0x00000000 ); radeon_out32( mmio, 0x4e54, 0x00000000 ); radeon_out32( mmio, 0x4e58, 0x00000000 ); radeon_out32( mmio, 0x4e5c, 0x00000000 ); radeon_out32( mmio, 0x4e60, 0x00000000 ); radeon_out32( mmio, 0x4e64, 0x00000000 ); radeon_out32( mmio, 0x4e68, 0x00000000 ); radeon_out32( mmio, 0x4e6c, 0x00000000 ); radeon_out32( mmio, 0x4e70, 0x00000000 ); radeon_out32( mmio, 0x4e88, 0x00000000 ); radeon_out32( mmio, 0x4ea0, 0x00000000 ); radeon_out32( mmio, 0x4ea4, 0xffffffff ); radeon_out32( mmio, R300_RB3D_ZSTENCIL_CNTL_0, R300_RB3D_Z_DISABLED_1 ); radeon_out32( mmio, R300_RB3D_ZSTENCIL_CNTL_1, R300_ZS_ALWAYS ); radeon_out32( mmio, R300_RB3D_ZSTENCIL_CNTL_2, 0xffffff00 ); radeon_out32( mmio, R300_RB3D_ZSTENCIL_FORMAT, R300_DEPTH_FORMAT_16BIT_INT_Z ); radeon_out32( mmio, 0x4f14, 0x00000000 ); radeon_out32( mmio, 0x4f18, 0x00000003 ); radeon_out32( mmio, 0x4f1c, 0x00000000 ); radeon_out32( mmio, 0x4f28, 0x00000000 ); radeon_out32( mmio, 0x4f30, 0x00000000 ); radeon_out32( mmio, 0x4f34, 0x00000000 ); radeon_out32( mmio, 0x4f44, 0x00000000 ); radeon_out32( mmio, 0x4f54, 0x00000000 ); /* upload vertex program */ radeon_waitfifo( rdrv, rdev, 50 ); radeon_out32( mmio, R300_VAP_PVS_CNTL_1, (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) | (4 << R300_PVS_CNTL_1_POS_END_SHIFT) | (4 << R300_PVS_CNTL_1_PROGRAM_END_SHIFT) ); radeon_out32( mmio, R300_VAP_PVS_CNTL_2, (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) | (4 << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT) ); radeon_out32( mmio, R300_VAP_PVS_CNTL_3, (4 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) | (4 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT) ); radeon_out32( mmio, R300_VAP_PVS_WAITIDLE, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_ADDRESS, R300_PVS_UPLOAD_POINTSIZE ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, f2d(1.0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_WAITIDLE, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_ADDRESS, R300_PVS_UPLOAD_PROGRAM ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_OP(MAD, 0, ALL, TMP) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_ATTR_X(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_PARAM(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_SOURCE(0, ZERO, ZERO, ZERO, ZERO, PARAM, NONE) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_OP(MAD, 0, ALL, TMP) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_ATTR_Y(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_PARAM(1) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_TMP(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_OP(MAD, 0, ALL, TMP) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_ATTR_Z(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_PARAM(2) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_TMP(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_OP(MAD, 0, ALL, RESULT) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_ATTR_W(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_PARAM(3) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_TMP(0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_OP(ADD, 1, ALL, RESULT) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, VSF_REG(1) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_SOURCE(1, ZERO, ZERO, ZERO, ZERO, ATTR, NONE) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, EASY_VSF_SOURCE(1, ZERO, ZERO, ZERO, ZERO, ATTR, NONE) ); radeon_out32( mmio, R300_VAP_PVS_WAITIDLE, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_ADDRESS, R300_PVS_UPLOAD_PARAMETERS ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, f2d(1.0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, f2d(1.0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, f2d(1.0) ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, 0 ); radeon_out32( mmio, R300_VAP_PVS_UPLOAD_DATA, f2d(1.0) ); #if 0 /* set YUV422 color buffer */ radeon_waitfifo( rdrv, rdev, 4 ); radeon_out32( mmio, R300_TX_FILTER_1, R300_TX_MAG_FILTER_NEAREST | R300_TX_MIN_FILTER_NEAREST ); radeon_out32( mmio, R300_TX_FILTER1_0, 0 ); radeon_out32( mmio, R300_TX_SIZE_1, (1 << R300_TX_WIDTHMASK_SHIFT) | (1 << R300_TX_HEIGHTMASK_SHIFT) ); radeon_out32( mmio, R300_TX_FORMAT_1, R300_TXFORMAT_VYUY422 ); #endif } void r300_set_destination( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->destination; CoreSurfaceBuffer *buffer = state->dst.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 offset; u32 pitch; u32 format = 0; bool dst_422 = false; if (RADEON_IS_SET( DESTINATION )) return; D_ASSERT( (state->dst.offset % 32) == 0 ); D_ASSERT( (state->dst.pitch % 64) == 0 ); offset = radeon_buffer_offset( rdev, &state->dst ); pitch = state->dst.pitch; if (rdev->dst_offset != offset || rdev->dst_pitch != pitch || rdev->dst_format != buffer->format) { switch (buffer->format) { case DSPF_LUT8: case DSPF_ALUT44: case DSPF_A8: case DSPF_RGB332: format = R300_COLOR_FORMAT_RGB8; rdev->gui_master_cntl = GMC_DST_8BPP; break; case DSPF_ARGB2554: rdev->gui_master_cntl = GMC_DST_16BPP; break; case DSPF_RGB444: case DSPF_ARGB4444: rdev->gui_master_cntl = GMC_DST_16BPP; break; case DSPF_RGB555: case DSPF_ARGB1555: rdev->gui_master_cntl = GMC_DST_15BPP; break; case DSPF_RGB16: format = R300_COLOR_FORMAT_RGB565; rdev->gui_master_cntl = GMC_DST_16BPP; break; case DSPF_RGB32: case DSPF_ARGB: case DSPF_AiRGB: case DSPF_AYUV: format = R300_COLOR_FORMAT_ARGB8888; rdev->gui_master_cntl = GMC_DST_32BPP; break; case DSPF_UYVY: rdev->gui_master_cntl = GMC_DST_YVYU; dst_422 = true; break; case DSPF_YUY2: rdev->gui_master_cntl = GMC_DST_VYUY; dst_422 = true; break; case DSPF_I420: format = R300_COLOR_FORMAT_RGB8; rdev->gui_master_cntl = GMC_DST_8BPP; rdev->dst_offset_cb = offset + pitch * surface->config.size.h; rdev->dst_offset_cr = rdev->dst_offset_cb + pitch/2 * surface->config.size.h/2; break; case DSPF_YV12: format = R300_COLOR_FORMAT_RGB8; rdev->gui_master_cntl = GMC_DST_8BPP; rdev->dst_offset_cr = offset + pitch * surface->config.size.h; rdev->dst_offset_cb = rdev->dst_offset_cr + pitch/2 * surface->config.size.h/2; break; default: D_BUG( "unexpected pixelformat" ); break; } rdev->gui_master_cntl |= GMC_DP_SRC_SOURCE_MEMORY | GMC_WR_MSK_DIS | GMC_SRC_PITCH_OFFSET_CNTL | GMC_DST_PITCH_OFFSET_CNTL | GMC_DST_CLIPPING; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DST_OFFSET, offset ); radeon_out32( mmio, DST_PITCH, pitch ); if (R300_HAS_3DREGS() && format) { radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, R300_RB3D_COLOROFFSET0, offset ); radeon_out32( mmio, R300_RB3D_COLORPITCH0, ((pitch / DFB_BYTES_PER_PIXEL(buffer->format)) & R300_COLORPITCH_MASK) | format ); } if (rdev->dst_format != buffer->format) { if (dst_422 && !rdev->dst_422) { RADEON_UNSET( CLIP ); RADEON_UNSET( SOURCE ); rdev->src_format = DSPF_UNKNOWN; } RADEON_UNSET( COLOR ); RADEON_UNSET( DST_BLEND ); } rdev->dst_format = buffer->format; rdev->dst_offset = offset; rdev->dst_pitch = pitch; rdev->dst_422 = dst_422; } RADEON_SET( DESTINATION ); } void r300_set_source( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { CoreSurface *surface = state->source; CoreSurfaceBuffer *buffer = state->src.buffer; volatile u8 *mmio = rdrv->mmio_base; u32 txformat = 0; u32 txfilter = (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_S_SHIFT) | (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_T_SHIFT) | (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_Q_SHIFT) | R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR; if (RADEON_IS_SET( SOURCE )) { if ((state->blittingflags & DSBLIT_DEINTERLACE) == (rdev->blittingflags & DSBLIT_DEINTERLACE)) return; } D_ASSERT( (state->src.offset % 32) == 0 ); D_ASSERT( (state->src.pitch % 64) == 0 ); rdev->src_offset = radeon_buffer_offset( rdev, &state->src ); rdev->src_pitch = state->src.pitch; rdev->src_width = surface->config.size.w; rdev->src_height = surface->config.size.h; switch (buffer->format) { case DSPF_LUT8: txformat = R300_TXFORMAT_I8; txfilter &= ~(R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR); txfilter |= R300_TX_MAG_FILTER_NEAREST | R300_TX_MIN_FILTER_NEAREST; rdev->src_mask = 0x000000ff; break; case DSPF_ALUT44: txformat = R300_TXFORMAT_I8; txfilter &= ~(R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR); txfilter |= R300_TX_MAG_FILTER_NEAREST | R300_TX_MIN_FILTER_NEAREST; rdev->src_mask = 0x0000000f; break; case DSPF_A8: txformat = R300_TXFORMAT_A8; rdev->src_mask = 0; break; case DSPF_RGB332: txformat = R300_TXFORMAT_RGB332; rdev->src_mask = 0x000000ff; break; case DSPF_ARGB2554: txformat = R300_TXFORMAT_RGB565; txfilter &= ~(R300_TX_MAG_FILTER_LINEAR | R300_TX_MIN_FILTER_LINEAR); txfilter |= R300_TX_MAG_FILTER_NEAREST | R300_TX_MIN_FILTER_NEAREST; rdev->src_mask = 0x00003fff; break; case DSPF_RGB444: txformat = R300_TXFORMAT_RGB444; rdev->src_mask = 0x00000fff; break; case DSPF_ARGB4444: txformat = R300_TXFORMAT_ARGB4444; rdev->src_mask = 0x00000fff; break; case DSPF_RGB555: txformat = R300_TXFORMAT_RGB555; rdev->src_mask = 0x00007fff; break; case DSPF_ARGB1555: txformat = R300_TXFORMAT_ARGB1555; rdev->src_mask = 0x00007fff; break; case DSPF_RGB16: txformat = R300_TXFORMAT_RGB565; rdev->src_mask = 0x0000ffff; break; case DSPF_RGB32: txformat = R300_TXFORMAT_XRGB8888; rdev->src_mask = 0x00ffffff; break; case DSPF_ARGB: case DSPF_AiRGB: case DSPF_AYUV: txformat = R300_TXFORMAT_ARGB8888; rdev->src_mask = 0x00ffffff; break; case DSPF_UYVY: txformat = R300_TXFORMAT_YVYU422; rdev->src_mask = 0xffffffff; break; case DSPF_YUY2: txformat = R300_TXFORMAT_VYUY422; rdev->src_mask = 0xffffffff; break; case DSPF_I420: txformat = R300_TXFORMAT_I8; rdev->src_offset_cb = rdev->src_offset + rdev->src_pitch * rdev->src_height; rdev->src_offset_cr = rdev->src_offset_cb + rdev->src_pitch/2 * rdev->src_height/2; rdev->src_mask = 0x000000ff; break; case DSPF_YV12: txformat = R300_TXFORMAT_I8; rdev->src_offset_cr = rdev->src_offset + rdev->src_pitch * rdev->src_height; rdev->src_offset_cb = rdev->src_offset_cr + rdev->src_pitch/2 * rdev->src_height/2; rdev->src_mask = 0x000000ff; break; default: D_BUG( "unexpected pixelformat" ); break; } if (state->blittingflags & DSBLIT_DEINTERLACE) { rdev->src_height /= 2; if (surface->config.caps & DSCAPS_SEPARATED) { if (surface->field) { rdev->src_offset += rdev->src_height * rdev->src_pitch; rdev->src_offset_cr += rdev->src_height * rdev->src_pitch/4; rdev->src_offset_cb += rdev->src_height * rdev->src_pitch/4; } } else { if (surface->field) { rdev->src_offset += rdev->src_pitch; rdev->src_offset_cr += rdev->src_pitch/2; rdev->src_offset_cb += rdev->src_pitch/2; } rdev->src_pitch *= 2; } } radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, SRC_OFFSET, rdev->src_offset ); radeon_out32( mmio, SRC_PITCH, rdev->src_pitch ); if (R300_HAS_3DREGS()) { radeon_waitfifo( rdrv, rdev, 6 ); radeon_out32( mmio, R300_TX_CNTL, 0 ); radeon_out32( mmio, R300_TX_FILTER_0, txfilter ); radeon_out32( mmio, R300_TX_FORMAT_0, txformat ); radeon_out32( mmio, R300_TX_SIZE_0, ((rdev->src_width -1) << R300_TX_WIDTH_SHIFT) | ((rdev->src_height-1) << R300_TX_HEIGHT_SHIFT) | R300_TX_SIZE_TXPITCH_EN ); radeon_out32( mmio, R300_TX_PITCH_0, rdev->src_pitch / DFB_BYTES_PER_PIXEL(buffer->format) - 8 ); radeon_out32( mmio, R300_TX_OFFSET_0, rdev->src_offset ); } if (rdev->src_format != buffer->format) RADEON_UNSET( BLITTING_FLAGS ); rdev->src_format = buffer->format; RADEON_SET( SOURCE ); } void r300_set_clip3d( RadeonDriverData *rdrv, RadeonDeviceData *rdev, const DFBRegion *clip ) { volatile u8 *mmio = rdrv->mmio_base; int x1, y1, x2, y2; x1 = clip->x1 + R300_CLIPRECT_OFFSET; y1 = clip->y1 + R300_CLIPRECT_OFFSET; x2 = clip->x2 + R300_CLIPRECT_OFFSET; y2 = clip->y2 + R300_CLIPRECT_OFFSET; radeon_waitfifo( rdrv, rdev, 5 ); radeon_out32( mmio, R300_RE_CLIPRECT_TL_0, ((y1 << R300_CLIPRECT_Y_SHIFT) & R300_CLIPRECT_Y_MASK) | ((x1 << R300_CLIPRECT_X_SHIFT) & R300_CLIPRECT_X_MASK) ); radeon_out32( mmio, R300_RE_CLIPRECT_BR_0, ((y2 << R300_CLIPRECT_Y_SHIFT) & R300_CLIPRECT_Y_MASK) | ((x2 << R300_CLIPRECT_X_SHIFT) & R300_CLIPRECT_X_MASK) ); radeon_out32( mmio, R300_RE_CLIPRECT_CNTL, 0x0000aaaa ); radeon_out32( mmio, R300_RE_SCISSORS_TL, ((y1 << R300_SCISSORS_Y_SHIFT) & R300_SCISSORS_Y_MASK) | ((x1 << R300_SCISSORS_X_SHIFT) & R300_SCISSORS_X_MASK) ); radeon_out32( mmio, R300_RE_SCISSORS_BR, ((y2 << R300_SCISSORS_Y_SHIFT) & R300_SCISSORS_Y_MASK) | ((x2 << R300_SCISSORS_X_SHIFT) & R300_SCISSORS_X_MASK) ); } void r300_set_clip( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBRegion *clip = &state->clip; volatile u8 *mmio = rdrv->mmio_base; if (RADEON_IS_SET( CLIP )) return; /* 2d clip */ radeon_waitfifo( rdrv, rdev, 2 ); if (rdev->dst_422) { radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1/2 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1)/2 & 0xffff) ); } else { radeon_out32( mmio, SC_TOP_LEFT, (clip->y1 << 16) | (clip->x1 & 0xffff) ); radeon_out32( mmio, SC_BOTTOM_RIGHT, ((clip->y2+1) << 16) | ((clip->x2+1) & 0xffff) ); } /* 3d clip */ if (R300_HAS_3DREGS()) r300_set_clip3d( rdrv, rdev, clip ); rdev->clip = state->clip; RADEON_SET( CLIP ); } #define R300_SET_YUV422_COLOR( rdrv, rdev, y, u, v ) \ if (R300_HAS_3DREGS()) { \ radeon_out32( (rdrv)->fb_base, \ (rdev)->yuv422_buffer, PIXEL_YUY2( y, u, v ) ); \ radeon_in8( (rdrv)->fb_base, (rdev)->yuv422_buffer ); \ radeon_waitfifo( rdrv, rdev, 1 ); \ radeon_out32( (rdrv)->mmio_base, R300_TX_OFFSET_1, \ ((rdev)->fb_offset + (rdev)->yuv422_buffer) ); \ } void r300_set_drawing_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBColor color = state->color; int index = state->color_index; u32 color2d; int y, u, v; if (RADEON_IS_SET( COLOR ) && RADEON_IS_SET( DRAWING_FLAGS )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = ((long) color.r * color.a / 255L); color.g = ((long) color.g * color.a / 255L); color.b = ((long) color.b * color.a / 255L); } switch (rdev->dst_format) { case DSPF_ALUT44: index |= (color.a & 0xf0); case DSPF_LUT8: color2d = index; break; case DSPF_A8: color2d = color.a; break; case DSPF_RGB332: color2d = PIXEL_RGB332( color.r, color.g, color.b ); break; case DSPF_ARGB2554: color2d = PIXEL_ARGB2554( color.a, color.r, color.g, color.b ); break; case DSPF_RGB444: case DSPF_ARGB4444: color2d = PIXEL_ARGB4444( color.a, color.r, color.g, color.b ); break; case DSPF_RGB555: case DSPF_ARGB1555: color2d = PIXEL_ARGB1555( color.a, color.r, color.g, color.b ); break; case DSPF_RGB16: color2d = PIXEL_RGB16( color.r, color.g, color.b ); break; case DSPF_RGB32: color2d = PIXEL_RGB32( color.r, color.g, color.b ); break; case DSPF_ARGB: color2d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; case DSPF_AiRGB: color2d = PIXEL_AiRGB( color.a, color.r, color.g, color.b ); break; case DSPF_AYUV: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_AYUV( color.a, y, u, v ); break; case DSPF_UYVY: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_UYVY( y, u, v ); //R300_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); break; case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color2d = PIXEL_YUY2( y, u, v ); //R300_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); rdev->y_cop = PIXEL_ARGB( color.a, y, y, y ); rdev->cb_cop = PIXEL_ARGB( color.a, u, u, u ); rdev->cr_cop = PIXEL_ARGB( color.a, v, v, v ); color2d = rdev->y_cop; break; default: D_BUG( "unexpected pixelformat" ); color2d = 0; break; } rdev->color[0] = (float)color.r/255.0; rdev->color[1] = (float)color.g/255.0; rdev->color[2] = (float)color.b/255.0; rdev->color[3] = (float)color.a/255.0; radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( rdrv->mmio_base, DP_BRUSH_FRGD_CLR, color2d ); RADEON_SET( COLOR ); } void r300_set_blitting_color( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { DFBColor color = state->color; int y, u, v; if (RADEON_IS_SET( COLOR ) && RADEON_IS_SET( BLITTING_FLAGS )) return; switch (rdev->dst_format) { case DSPF_A8: color.r = color.g = color.b = 0xff; break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); rdev->y_cop = PIXEL_ARGB( color.a, y, y, y ); rdev->cb_cop = PIXEL_ARGB( color.a, u, u, u ); rdev->cr_cop = PIXEL_ARGB( color.a, v, v, v ); break; case DSPF_AYUV: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); color.r = y; color.g = u; color.b = v; break; case DSPF_UYVY: case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); //R300_SET_YUV422_COLOR( rdrv, rdev, y, u, v ); default: break; } /*rdev->color[0] = (float)color.r/255.0; rdev->color[1] = (float)color.g/255.0; rdev->color[2] = (float)color.b/255.0; rdev->color[3] = (float)color.a/255.0;*/ if (R300_HAS_3DREGS()) { u32 argb; argb = (state->blittingflags & DSBLIT_BLEND_COLORALPHA) ? (color.a << 24) : 0xff000000; if (state->blittingflags & DSBLIT_COLORIZE && state->blittingflags & (DSBLIT_SRC_PREMULTCOLOR | DSBLIT_BLEND_COLORALPHA)) { argb |= PIXEL_RGB32( (long)color.r * color.a / 255L, (long)color.g * color.a / 255L, (long)color.b * color.a / 255L ); } else { argb |= (state->blittingflags & DSBLIT_COLORIZE) ? PIXEL_RGB32( color.r, color.g, color.b ) : PIXEL_RGB32( color.a, color.a, color.a ); } radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( rdrv->mmio_base, R300_RB3D_BLENDCOLOR, argb ); } RADEON_SET( COLOR ); } void r300_set_src_colorkey( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 key = state->src_colorkey; if (RADEON_IS_SET( SRC_COLORKEY )) return; switch (rdev->src_format) { case DSPF_ARGB4444: key |= 0xf000; break; case DSPF_ARGB2554: key |= 0xc000; break; case DSPF_ARGB1555: key |= 0x8000; break; case DSPF_ARGB: case DSPF_AYUV: key |= 0xff000000; break; default: break; } radeon_waitfifo( rdrv, rdev, 3 ); radeon_out32( mmio, CLR_CMP_CLR_SRC, key ); /* XXX: R300 seems to ignore CLR_CMP_MASK. */ radeon_out32( mmio, CLR_CMP_MASK, rdev->src_mask ); if (R300_HAS_3DREGS()) radeon_out32( mmio, R300_TX_CHROMA_KEY_0, state->src_colorkey ); RADEON_SET( SRC_COLORKEY ); } void r300_set_blend_function( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { u32 sblend, dblend; if (RADEON_IS_SET( SRC_BLEND ) && RADEON_IS_SET( DST_BLEND )) return; sblend = r300SrcBlend[state->src_blend-1]; dblend = r300DstBlend[state->dst_blend-1]; if (!DFB_PIXELFORMAT_HAS_ALPHA(rdev->dst_format)) { if (sblend == SRC_BLEND_GL_DST_ALPHA) sblend = SRC_BLEND_GL_ONE; else if (sblend == SRC_BLEND_GL_ONE_MINUS_DST_ALPHA) sblend = SRC_BLEND_GL_ZERO; if (dblend == DST_BLEND_GL_DST_ALPHA) dblend = DST_BLEND_GL_ONE; else if (dblend == DST_BLEND_GL_ONE_MINUS_DST_ALPHA) dblend = DST_BLEND_GL_ZERO; } rdev->rb3d_blend = sblend | dblend; RADEON_UNSET( DRAWING_FLAGS ); RADEON_UNSET( BLITTING_FLAGS ); RADEON_SET( SRC_BLEND ); RADEON_SET( DST_BLEND ); } void r300_set_render_options( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { if (RADEON_IS_SET( RENDER_OPTIONS )) return; if (state->render_options & DSRO_MATRIX && (!state->affine_matrix || state->matrix[0] != (1<<16) || state->matrix[1] != 0 || state->matrix[2] != 0 || state->matrix[3] != 0 || state->matrix[4] != (1<<16) || state->matrix[5] != 0)) { rdev->matrix = state->matrix; rdev->affine_matrix = state->affine_matrix; } else { rdev->matrix = NULL; } /* TODO: antialiasing */ #if 0 radeon_waitfifo( rdrv, rdev, 1 ); radeon_out32( rdrv->mmio_base, R300_GB_AA_CONFIG, (state->render_options & DSRO_ANTIALIAS) ? R300_AA_ENABLE : 0 ); #endif rdev->render_options = state->render_options & ~DSRO_ANTIALIAS; RADEON_SET( RENDER_OPTIONS ); } void r300_set_drawingflags( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 master_cntl = rdev->gui_master_cntl | GMC_SRC_DATATYPE_MONO_FG_LA | GMC_BRUSH_SOLID_COLOR | GMC_CLR_CMP_CNTL_DIS; u32 rb3d_blend; if (RADEON_IS_SET( DRAWING_FLAGS )) return; if (state->drawingflags & DSDRAW_BLEND) { rb3d_blend = R300_BLEND_ENABLE | R300_BLEND_UNKNOWN | R300_BLEND_NO_SEPARATE | rdev->rb3d_blend; } else { rb3d_blend = R300_SRC_BLEND_GL_ONE | R300_DST_BLEND_GL_ZERO; } if (state->drawingflags & DSDRAW_XOR) master_cntl |= GMC_ROP3_PATXOR; else master_cntl |= GMC_ROP3_PATCOPY; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, master_cntl ); radeon_out32( mmio, DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM ); if (R300_HAS_3DREGS()) { radeon_waitfifo( rdrv, rdev, 27 ); radeon_out32( mmio, R300_TX_ENABLE, 0 ); radeon_out32( mmio, R300_RE_SHADE_MODEL, R300_RE_SHADE_MODEL_FLAT ); /* fragment program */ radeon_out32( mmio, R300_PFS_CNTL_0, 0 ); radeon_out32( mmio, R300_PFS_CNTL_1, 0 ); radeon_out32( mmio, R300_PFS_CNTL_2, 0 ); radeon_out32( mmio, R300_PFS_NODE_0, 0 ); radeon_out32( mmio, R300_PFS_NODE_1, 0 ); radeon_out32( mmio, R300_PFS_NODE_2, 0 ); radeon_out32( mmio, R300_PFS_NODE_3, R300_PFS_NODE_OUTPUT_COLOR ); radeon_out32( mmio, R300_PFS_INSTR0_0, FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO)) ); radeon_out32( mmio, R300_PFS_INSTR1_0, FP_SELC(0,NO,XYZ,FP_TMP(0),FP_TMP(2),FP_TMP(2)) ); radeon_out32( mmio, R300_PFS_INSTR2_0, FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO)) ); radeon_out32( mmio, R300_PFS_INSTR3_0, FP_SELA(0,NO,W,FP_TMP(0),FP_TMP(2),FP_TMP(2)) ); /* blend functions */ radeon_out32( mmio, R300_RB3D_CBLEND, rb3d_blend ); radeon_out32( mmio, R300_RB3D_ABLEND, rb3d_blend & 0xfffffff0 ); /* routing */ radeon_out32( mmio, R300_RS_CNTL_0, (0 << R300_RS_CNTL_TC_CNT_SHIFT) | (1 << R300_RS_CNTL_CI_CNT_SHIFT) | R300_RS_CNTL_0_UNKNOWN_18 ); radeon_out32( mmio, R300_RS_CNTL_1, 0x000000c0 ); radeon_out32( mmio, R300_RS_ROUTE_0, R300_RS_ROUTE_0_COLOR ); /* input */ radeon_out32( mmio, R300_VAP_INPUT_ROUTE_0_0, 0x21030003 ); radeon_out32( mmio, R300_VAP_INPUT_ROUTE_1_0, 0xf688f688 ); radeon_out32( mmio, R300_VAP_INPUT_CNTL_0, R300_INPUT_CNTL_0_COLOR ); radeon_out32( mmio, R300_VAP_INPUT_CNTL_1, R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR ); /* output */ radeon_out32( mmio, R300_VAP_OUTPUT_VTX_FMT_0, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT ); radeon_out32( mmio, R300_VAP_OUTPUT_VTX_FMT_1, 0 ); radeon_out32( mmio, R300_GB_VAP_RASTER_VTX_FMT_0, R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT | R300_GB_VAP_RASTER_VTX_FMT_0__COLOR_0_PRESENT ); radeon_out32( mmio, R300_GB_VAP_RASTER_VTX_FMT_1, 0 ); radeon_out32( mmio, R300_VAP_UNKNOWN_221C, R300_221C_CLEAR ); } rdev->drawingflags = state->drawingflags; RADEON_SET ( DRAWING_FLAGS ); RADEON_UNSET( BLITTING_FLAGS ); } void r300_set_blittingflags( RadeonDriverData *rdrv, RadeonDeviceData *rdev, CardState *state ) { volatile u8 *mmio = rdrv->mmio_base; u32 master_cntl = rdev->gui_master_cntl | GMC_BRUSH_NONE | GMC_SRC_DATATYPE_COLOR; u32 txfilter1 = R300_TX_TRI_PERF_0_8; u32 cmp_cntl = 0; u32 rb3d_blend; if (RADEON_IS_SET( BLITTING_FLAGS )) return; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) { rb3d_blend = R300_BLEND_ENABLE | R300_BLEND_UNKNOWN | R300_BLEND_NO_SEPARATE; if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) rb3d_blend |= rdev->rb3d_blend; else rb3d_blend |= R300_SRC_BLEND_GL_ONE | R300_DST_BLEND_GL_ZERO; if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { rb3d_blend &= ~(R300_SRC_BLEND_MASK | R300_DST_BLEND_MASK); rb3d_blend |= R300_SRC_BLEND_GL_CONST_ALPHA | R300_DST_BLEND_GL_ONE_MINUS_CONST_ALPHA; } if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) { rb3d_blend &= ~R300_SRC_BLEND_MASK; rb3d_blend |= R300_SRC_BLEND_GL_CONST_COLOR; } } else { rb3d_blend = R300_SRC_BLEND_GL_ONE | R300_DST_BLEND_GL_ZERO; } if (state->blittingflags & DSBLIT_SRC_COLORKEY) { txfilter1 |= R300_CHROMA_KEY_FORCE; cmp_cntl = SRC_CMP_EQ_COLOR | CLR_CMP_SRC_SOURCE; } else { master_cntl |= GMC_CLR_CMP_CNTL_DIS; } if (state->blittingflags & DSBLIT_XOR) master_cntl |= GMC_ROP3_XOR; else master_cntl |= GMC_ROP3_SRCCOPY; radeon_waitfifo( rdrv, rdev, 2 ); radeon_out32( mmio, CLR_CMP_CNTL, cmp_cntl ); radeon_out32( mmio, DP_GUI_MASTER_CNTL, master_cntl ); if (R300_HAS_3DREGS()) { radeon_waitfifo( rdrv, rdev, 29 ); radeon_out32( mmio, R300_TX_FILTER1_0, txfilter1 ); radeon_out32( mmio, R300_TX_ENABLE, R300_TX_ENABLE_0 ); if (rdev->accel == DFXL_TEXTRIANGLES) radeon_out32( mmio, R300_RE_SHADE_MODEL, R300_RE_SHADE_MODEL_SMOOTH ); else radeon_out32( mmio, R300_RE_SHADE_MODEL, R300_RE_SHADE_MODEL_FLAT ); /* fragment program */ radeon_out32( mmio, R300_PFS_CNTL_0, R300_PFS_CNTL_FIRST_NODE_HAS_TEX ); radeon_out32( mmio, R300_PFS_CNTL_1, 0 ); radeon_out32( mmio, R300_PFS_CNTL_2, 0 ); radeon_out32( mmio, R300_PFS_NODE_0, 0 ); radeon_out32( mmio, R300_PFS_NODE_1, 0 ); radeon_out32( mmio, R300_PFS_NODE_2, 0 ); radeon_out32( mmio, R300_PFS_NODE_3, R300_PFS_NODE_OUTPUT_COLOR ); radeon_out32( mmio, R300_PFS_TEXI_0, R300_FPITX_OP_TXP ); radeon_out32( mmio, R300_PFS_INSTR0_0, FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO)) ); radeon_out32( mmio, R300_PFS_INSTR1_0, FP_SELC(0,NO,XYZ,FP_TMP(0),FP_TMP(2),FP_TMP(2)) ); radeon_out32( mmio, R300_PFS_INSTR2_0, FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO)) ); radeon_out32( mmio, R300_PFS_INSTR3_0, FP_SELA(0,NO,W,FP_TMP(0),FP_TMP(2),FP_TMP(2)) ); /* blend functions */ radeon_out32( mmio, R300_RB3D_CBLEND, rb3d_blend ); radeon_out32( mmio, R300_RB3D_ABLEND, rb3d_blend & 0xfffffff0 ); /* routing */ radeon_out32( mmio, R300_RS_CNTL_0, (1 << R300_RS_CNTL_TC_CNT_SHIFT) | (0 << R300_RS_CNTL_CI_CNT_SHIFT) | R300_RS_CNTL_0_UNKNOWN_18 ); radeon_out32( mmio, R300_RS_CNTL_1, 0x000000c0 ); radeon_out32( mmio, R300_RS_ROUTE_0, R300_RS_ROUTE_ENABLE ); /* input routing */ radeon_out32( mmio, R300_VAP_INPUT_ROUTE_0_0, 0x21030003 ); radeon_out32( mmio, R300_VAP_INPUT_ROUTE_1_0, 0xf688f688 ); radeon_out32( mmio, R300_VAP_INPUT_CNTL_0, 0x5555 ); radeon_out32( mmio, R300_VAP_INPUT_CNTL_1, R300_INPUT_CNTL_POS | R300_INPUT_CNTL_TC0 ); /* output routing */ radeon_out32( mmio, R300_VAP_OUTPUT_VTX_FMT_0, R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT ); radeon_out32( mmio, R300_VAP_OUTPUT_VTX_FMT_1, 4 ); radeon_out32( mmio, R300_GB_VAP_RASTER_VTX_FMT_0, R300_GB_VAP_RASTER_VTX_FMT_0__POS_PRESENT ); radeon_out32( mmio, R300_GB_VAP_RASTER_VTX_FMT_1, 4 ); radeon_out32( mmio, R300_VAP_UNKNOWN_221C, R300_221C_CLEAR ); } rdev->blittingflags = state->blittingflags; RADEON_SET ( BLITTING_FLAGS ); RADEON_UNSET( DRAWING_FLAGS ); } DirectFB-1.2.10/gfxdrivers/radeon/radeon_mmio.h0000644000175000017500000001032711164361026016236 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __RADEON_MMIO_H__ #define __RADEON_MMIO_H__ #include #include #include "radeon.h" static __inline__ void radeon_out8( volatile u8 *mmioaddr, u32 reg, u8 value ) { *((volatile u8*)(mmioaddr+reg)) = value; } static __inline__ void radeon_out16( volatile u8 *mmioaddr, u32 reg, u32 value ) { #ifdef __powerpc__ asm volatile( "sthbrx %0,%1,%2;eieio" :: "r" (value), "b"(reg), "r" (mmioaddr) : "memory" ); #else *((volatile u16*)(mmioaddr+reg)) = value; #endif } static __inline__ void radeon_out32( volatile u8 *mmioaddr, u32 reg, u32 value ) { #ifdef __powerpc__ asm volatile( "stwbrx %0,%1,%2;eieio" :: "r" (value), "b"(reg), "r" (mmioaddr) : "memory" ); #else *((volatile u32*)(mmioaddr+reg)) = value; #endif } static __inline__ u8 radeon_in8( volatile u8 *mmioaddr, u32 reg ) { return *((volatile u8*)(mmioaddr+reg)); } static __inline__ u16 radeon_in16( volatile u8 *mmioaddr, u32 reg ) { #ifdef __powerpc__ u32 value; asm volatile( "lhbrx %0,%1,%2;eieio" : "=r" (value) : "b" (reg), "r" (mmioaddr) ); return value; #else return *((volatile u16*)(mmioaddr+reg)); #endif } static __inline__ u32 radeon_in32( volatile u8 *mmioaddr, u32 reg ) { #ifdef __powerpc__ u32 value; asm volatile( "lwbrx %0,%1,%2;eieio" : "=r" (value) : "b" (reg), "r" (mmioaddr) ); return value; #else return *((volatile u32*)(mmioaddr+reg)); #endif } static __inline__ void radeon_outpll( volatile u8 *mmioaddr, u32 addr, u32 value ) { radeon_out8( mmioaddr, CLOCK_CNTL_INDEX, (addr & 0x3f) | PLL_WR_EN ); radeon_out32( mmioaddr, CLOCK_CNTL_DATA, value ); } static __inline__ u32 radeon_inpll( volatile u8 *mmioaddr, u32 addr ) { radeon_out8( mmioaddr, CLOCK_CNTL_INDEX, addr & 0x3f ); return radeon_in32( mmioaddr, CLOCK_CNTL_DATA ); } static inline bool radeon_waitfifo( RadeonDriverData *rdrv, RadeonDeviceData *rdev, unsigned int space ) { int waitcycles = 0; rdev->waitfifo_sum += space; rdev->waitfifo_calls++; if (rdev->fifo_space < space ) { do { rdev->fifo_space = radeon_in32( rdrv->mmio_base, RBBM_STATUS ); rdev->fifo_space &= RBBM_FIFOCNT_MASK; if (++waitcycles > 10000000) { radeon_reset( rdrv, rdev ); D_BREAK( "FIFO timed out" ); return false; } } while (rdev->fifo_space < space); rdev->fifo_waitcycles += waitcycles; } else rdev->fifo_cache_hits++; rdev->fifo_space -= space; return true; } static inline bool radeon_waitidle( RadeonDriverData *rdrv, RadeonDeviceData *rdev ) { int waitcycles = 0; int status; if (!radeon_waitfifo( rdrv, rdev, 64 )) return false; do { status = radeon_in32( rdrv->mmio_base, RBBM_STATUS ); if (++waitcycles > 10000000) { radeon_reset( rdrv, rdev ); D_BREAK( "Engine timed out" ); return false; } } while (status & RBBM_ACTIVE); rdev->fifo_space = status & RBBM_FIFOCNT_MASK; rdev->idle_waitcycles += waitcycles; return true; } #endif /* __RADEON_MMIO_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/radeon_3d.h0000644000175000017500000000570411164361026015606 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __RADEON_3D_H__ #define __RADEON_3D_H__ /* R100 Functions */ bool r100FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool r100FillTriangle( void *drv, void *dev, DFBTriangle *tri ); bool r100DrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool r100DrawLine3D( void *drv, void *dev, DFBRegion *line ); bool r100Blit3D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ); bool r100StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ); bool r100TextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ); void r100EmitCommands3D( void *drv, void *dev ); /* R200 Functions */ bool r200FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool r200FillTriangle( void *drv, void *dev, DFBTriangle *tri ); bool r200DrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool r200DrawLine3D( void *drv, void *dev, DFBRegion *line ); bool r200Blit3D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ); bool r200StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ); bool r200TextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ); void r200EmitCommands3D( void *drv, void *dev ); /* R300 Functions */ bool r300FillRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool r300FillTriangle( void *drv, void *dev, DFBTriangle *tri ); bool r300DrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool r300DrawLine3D( void *drv, void *dev, DFBRegion *line ); bool r300Blit3D( void *drv, void *dev, DFBRectangle *sr, int dx, int dy ); bool r300StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ); bool r300TextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ); void r300EmitCommands3D( void *drv, void *dev ); #endif /* __RADEON_3D_H__ */ DirectFB-1.2.10/gfxdrivers/radeon/radeon_crtc2.c0000644000175000017500000010612311164361026016305 00000000000000/* * Copyright (C) 2006 Claudio Ciccani * * Graphics driver for ATI Radeon cards written by * Claudio Ciccani . * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radeon.h" #include "radeon_regs.h" #include "radeon_mmio.h" typedef struct { CoreLayerRegionConfig config; CorePalette *palette; DFBColorAdjustment adjustment; unsigned int pll_max_freq; unsigned int pll_min_freq; unsigned int pll_ref_div; unsigned int pll_ref_clk; struct { unsigned int size; u8 r[256]; u8 g[256]; u8 b[256]; } lut; struct { u32 rCRTC2_GEN_CNTL; u32 rFP2_GEN_CNTL; u32 rDAC_CNTL2; u32 rTV_DAC_CNTL; u32 rDISP_OUTPUT_CNTL; u32 rDISP_HW_DEBUG; u32 rCRTC2_OFFSET_CNTL; } save; struct { u32 rCRTC2_GEN_CNTL; u32 rDAC_CNTL2; u32 rTV_DAC_CNTL; u32 rDISP_OUTPUT_CNTL; u32 rDISP_HW_DEBUG; u32 rCRTC2_H_TOTAL_DISP; u32 rCRTC2_H_SYNC_STRT_WID; u32 rCRTC2_V_TOTAL_DISP; u32 rCRTC2_V_SYNC_STRT_WID; u32 rCRTC2_BASE_ADDR; u32 rCRTC2_OFFSET; u32 rCRTC2_OFFSET_CNTL; u32 rCRTC2_PITCH; u32 rFP2_GEN_CNTL; u32 rFP2_H_SYNC_STRT_WID; u32 rFP2_V_SYNC_STRT_WID; u32 rP2PLL_REF_DIV; u32 rP2PLL_DIV_0; u32 rHTOTAL2_CNTL; } regs; } RadeonCrtc2LayerData; static VideoMode* crtc2_find_mode ( RadeonDriverData *drv, int xres, int yres ); static bool crtc2_calc_regs ( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void crtc2_set_regs ( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2 ); static void crtc2_calc_palette ( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2, CoreLayerRegionConfig *config, DFBColorAdjustment *adjustment, CorePalette *palette ); static void crtc2_set_palette ( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2 ); /*************************** CRTC2 Screen functions **************************/ static DFBResult crtc2InitScreen( CoreScreen *screen, CoreGraphicsDevice *device, void *driver_data, void *screen_data, DFBScreenDescription *description ) { /* Set the screen capabilities. */ description->caps = DSCCAPS_VSYNC | DSCCAPS_POWER_MANAGEMENT; /* Set the screen name. */ snprintf( description->name, DFB_SCREEN_DESC_NAME_LENGTH, "Radeon CRTC2" ); return DFB_OK; } static DFBResult crtc2SetPowerMode( CoreScreen *screen, void *driver_data, void *screen_data, DFBScreenPowerMode mode ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; volatile u8 *mmio = rdrv->mmio_base; u32 crtc2_gen_cntl; crtc2_gen_cntl = radeon_in32( mmio, CRTC2_GEN_CNTL ); crtc2_gen_cntl &= ~(CRTC2_HSYNC_DIS | CRTC2_VSYNC_DIS | CRTC2_DISP_DIS); switch (mode) { case DSPM_OFF: crtc2_gen_cntl |= CRTC2_HSYNC_DIS | CRTC2_VSYNC_DIS | CRTC2_DISP_DIS; break; case DSPM_SUSPEND: crtc2_gen_cntl |= CRTC2_VSYNC_DIS | CRTC2_DISP_DIS; break; case DSPM_STANDBY: crtc2_gen_cntl |= CRTC2_HSYNC_DIS | CRTC2_DISP_DIS; break; case DSPM_ON: break; default: D_DEBUG( "unknown power mode" ); return DFB_INVARG; } radeon_out32( mmio, CRTC2_GEN_CNTL, crtc2_gen_cntl ); return DFB_OK; } static DFBResult crtc2WaitVSync( CoreScreen *screen, void *driver_data, void *screen_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; volatile u8 *mmio = rdrv->mmio_base; int i; if (dfb_config->pollvsync_none) return DFB_OK; radeon_out32( mmio, GEN_INT_STATUS, (radeon_in32( mmio, GEN_INT_STATUS ) & ~VSYNC2_INT) | VSYNC2_INT_AK ); for (i = 0; i < 2000000; i++) { struct timespec t = { 0, 10000 }; if (radeon_in32( mmio, GEN_INT_STATUS ) & VSYNC2_INT) break; nanosleep( &t, NULL ); } return DFB_OK; } static DFBResult crtc2GetScreenSize( CoreScreen *screen, void *driver_data, void *screen_data, int *ret_width, int *ret_height ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; volatile u8 *mmio = rdrv->mmio_base; unsigned int xres; unsigned int yres; xres = ((radeon_in32( mmio, CRTC2_H_TOTAL_DISP ) >> 16) + 1) * 8; yres = ((radeon_in32( mmio, CRTC2_V_TOTAL_DISP ) >> 16) + 1); D_DEBUG( "DirectFB/Radeon/CRTC2: " "detected screen size %dx%d.\n", xres, yres ); if (xres <= 1 || yres <= 1) { VideoMode *mode = dfb_system_modes(); if (!mode) { D_WARN( "no default video mode" ); return DFB_UNSUPPORTED; } xres = mode->xres; yres = mode->yres; } *ret_width = xres; *ret_height = yres; return DFB_OK; } ScreenFuncs RadeonCrtc2ScreenFuncs = { .InitScreen = crtc2InitScreen, .SetPowerMode = crtc2SetPowerMode, .WaitVSync = crtc2WaitVSync, .GetScreenSize = crtc2GetScreenSize }; /**************************** CRTC2 Layer functions **************************/ #define CRTC2_SUPPORTED_OPTIONS ( DLOP_ALPHACHANNEL ) static int crtc2LayerDataSize( void ) { return sizeof(RadeonCrtc2LayerData); } static DFBResult crtc2InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonCrtc2LayerData *rcrtc2 = (RadeonCrtc2LayerData*) layer_data; volatile u8 *mmio = rdrv->mmio_base; VideoMode *mode; mode = dfb_system_modes(); if (!mode) { D_BUG( "no default video mode" ); return DFB_FAILURE; } /* Fill layer description. */ description->caps = DLCAPS_SURFACE | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST | DLCAPS_SATURATION | DLCAPS_ALPHACHANNEL; description->type = DLTF_GRAPHICS; snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Radeon CRTC2's Underlay" ); /* Set default configuration. */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = mode->xres; config->height = mode->yres; config->pixelformat = DSPF_RGB16; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; /* Set default color adjustment. */ adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_SATURATION; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; /* Set PLL coefficients (should be done by reading the BIOS). */ rcrtc2->pll_max_freq = 35000; rcrtc2->pll_min_freq = 12000; rcrtc2->pll_ref_div = 60; rcrtc2->pll_ref_clk = 2700; /* Save common registers. */ rcrtc2->save.rCRTC2_GEN_CNTL = radeon_in32( mmio, CRTC2_GEN_CNTL ); rcrtc2->save.rFP2_GEN_CNTL = radeon_in32( mmio, FP2_GEN_CNTL ); rcrtc2->save.rDAC_CNTL2 = radeon_in32( mmio, DAC_CNTL2 ); rcrtc2->save.rTV_DAC_CNTL = radeon_in32( mmio, TV_DAC_CNTL ); rcrtc2->save.rDISP_OUTPUT_CNTL = radeon_in32( mmio, DISP_OUTPUT_CNTL ); rcrtc2->save.rDISP_HW_DEBUG = radeon_in32( mmio, DISP_HW_DEBUG ); rcrtc2->save.rCRTC2_OFFSET_CNTL = radeon_in32( mmio, CRTC2_OFFSET_CNTL ); return DFB_OK; } static DFBResult crtc2TestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; CoreLayerRegionConfigFlags fail = 0; /* check for unsupported options */ if (config->options & ~CRTC2_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; if (config->options & DLOP_ALPHACHANNEL && config->format != DSPF_ARGB) fail |= CLRCF_OPTIONS; /* check for unsupported buffermode */ switch (config->buffermode) { case DLBM_FRONTONLY: case DLBM_BACKSYSTEM: case DLBM_BACKVIDEO: case DLBM_TRIPLE: break; default: fail |= CLRCF_BUFFERMODE; break; } /* check for unsupported pixelformat */ switch (config->format) { case DSPF_LUT8: case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: break; default: fail |= CLRCF_FORMAT; break; } /* check for unsupported size */ if (!crtc2_find_mode( rdrv, config->width, config->height )) fail |= CLRCF_WIDTH | CLRCF_HEIGHT; if (failed) *failed = fail; return fail ? DFB_UNSUPPORTED : DFB_OK; } static DFBResult crtc2AddRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonDeviceData *rdev = rdrv->device_data; if (!rdev->monitor2) { D_ERROR( "DirectFB/Radeon/CRTC2: " "no secondary monitor connected!\n" ); return DFB_IO; } return DFB_OK; } static DFBResult crtc2SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonCrtc2LayerData *rcrtc2 = (RadeonCrtc2LayerData*) layer_data; rcrtc2->config = *config; rcrtc2->palette = palette; updated &= CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_SURFACE | CLRCF_PALETTE; if (updated & ~CLRCF_PALETTE) { if (!crtc2_calc_regs( rdrv, rcrtc2, &rcrtc2->config, surface, lock )) return DFB_UNSUPPORTED; crtc2_set_regs( rdrv, rcrtc2 ); } if (updated) { crtc2_calc_palette( rdrv, rcrtc2, &rcrtc2->config, &rcrtc2->adjustment, rcrtc2->palette ); crtc2_set_palette( rdrv, rcrtc2 ); } return DFB_OK; } static DFBResult crtc2RemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonCrtc2LayerData *rcrtc2 = (RadeonCrtc2LayerData*) layer_data; volatile u8 *mmio = rdrv->mmio_base; radeon_waitidle( rdrv, rdrv->device_data ); radeon_out32( mmio, CRTC2_GEN_CNTL, rcrtc2->save.rCRTC2_GEN_CNTL ); radeon_out32( mmio, FP2_GEN_CNTL, rcrtc2->save.rFP2_GEN_CNTL ); radeon_out32( mmio, DAC_CNTL2, rcrtc2->save.rDAC_CNTL2 ); radeon_out32( mmio, TV_DAC_CNTL, rcrtc2->save.rTV_DAC_CNTL ); radeon_out32( mmio, DISP_OUTPUT_CNTL, rcrtc2->save.rDISP_OUTPUT_CNTL ); radeon_out32( mmio, DISP_HW_DEBUG, rcrtc2->save.rDISP_HW_DEBUG ); radeon_out32( mmio, CRTC2_OFFSET_CNTL, rcrtc2->save.rCRTC2_OFFSET_CNTL ); return DFB_OK; } static DFBResult crtc2FlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonDeviceData *rdev = rdrv->device_data; RadeonCrtc2LayerData *rcrtc2 = (RadeonCrtc2LayerData*) layer_data; volatile u8 *mmio = rdrv->mmio_base; if (lock->phys - lock->offset == rdev->fb_phys) rcrtc2->regs.rCRTC2_BASE_ADDR = rdev->fb_offset; else rcrtc2->regs.rCRTC2_BASE_ADDR = rdev->agp_offset; rcrtc2->regs.rCRTC2_OFFSET = lock->offset; radeon_waitidle( rdrv, rdrv->device_data ); radeon_out32( mmio, CRTC2_BASE_ADDR, rcrtc2->regs.rCRTC2_BASE_ADDR ); radeon_out32( mmio, CRTC2_OFFSET, rcrtc2->regs.rCRTC2_OFFSET ); dfb_surface_flip( surface, false ); if (flags & DSFLIP_WAIT) dfb_layer_wait_vsync( layer ); return DFB_OK; } static DFBResult crtc2SetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { RadeonDriverData *rdrv = (RadeonDriverData*) driver_data; RadeonCrtc2LayerData *rcrtc2 = (RadeonCrtc2LayerData*) layer_data; if (adj->flags & DCAF_BRIGHTNESS) { if (adj->brightness == 0x8000) { rcrtc2->adjustment.flags &= ~DCAF_BRIGHTNESS; } else { rcrtc2->adjustment.flags |= DCAF_BRIGHTNESS; rcrtc2->adjustment.brightness = adj->brightness; } } if (adj->flags & DCAF_CONTRAST) { if (adj->contrast == 0x8000) { rcrtc2->adjustment.flags &= ~DCAF_CONTRAST; } else { rcrtc2->adjustment.flags |= DCAF_CONTRAST; rcrtc2->adjustment.contrast = adj->contrast; } } if (adj->flags & DCAF_SATURATION) { if (adj->saturation == 0x8000) { rcrtc2->adjustment.flags &= ~DCAF_SATURATION; } else { rcrtc2->adjustment.flags |= DCAF_SATURATION; rcrtc2->adjustment.saturation = adj->saturation; } } crtc2_calc_palette( rdrv, rcrtc2, &rcrtc2->config, &rcrtc2->adjustment, rcrtc2->palette ); crtc2_set_palette( rdrv, rcrtc2 ); return DFB_OK; } DisplayLayerFuncs RadeonCrtc2LayerFuncs = { .LayerDataSize = crtc2LayerDataSize, .InitLayer = crtc2InitLayer, .TestRegion = crtc2TestRegion, .AddRegion = crtc2AddRegion, .SetRegion = crtc2SetRegion, .RemoveRegion = crtc2RemoveRegion, .FlipRegion = crtc2FlipRegion, .SetColorAdjustment = crtc2SetColorAdjustment }; /************************** CRTC2 internal functions *************************/ static VideoMode* crtc2_find_mode( RadeonDriverData *rdrv, int xres, int yres ) { VideoMode *modes = dfb_system_modes(); VideoMode *mode; for (mode = modes; mode; mode = mode->next) { if (mode->xres == xres && mode->yres == yres) return mode; } return NULL; } static void crtc2_calc_pllregs( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2, unsigned int freq ) { struct { int divider; int bitvalue; } *post_div, post_divs[] = { { 1, 0 }, /* VCLK_SRC */ { 2, 1 }, /* VCLK_SRC/2 */ { 4, 2 }, /* VCLK_SRC/4 */ { 8, 3 }, /* VCLK_SRC/8 */ { 3, 4 }, /* VCLK_SRC/3 */ { 6, 6 }, /* VCLK_SRC/6 */ { 12, 7 }, /* VCLK_SRC/12 */ { 0, 0 } }; u32 pll_output_freq_2 = 0; u32 feedback_div_2; if (freq > rcrtc2->pll_max_freq) freq = rcrtc2->pll_max_freq; if (freq*12 < rcrtc2->pll_min_freq) freq = rcrtc2->pll_min_freq/12; for (post_div = &post_divs[0]; post_div->divider; ++post_div) { pll_output_freq_2 = post_div->divider * freq; if (pll_output_freq_2 >= rcrtc2->pll_min_freq && pll_output_freq_2 <= rcrtc2->pll_max_freq) break; } if (!post_div->divider) { pll_output_freq_2 = freq; post_div = &post_divs[0]; } feedback_div_2 = rcrtc2->pll_ref_div * pll_output_freq_2; feedback_div_2 += rcrtc2->pll_ref_clk/2; feedback_div_2 /= rcrtc2->pll_ref_clk; D_DEBUG( "DirectFB/Radeon/CRTC2: " "DotCLock=%d OutputFreq=%d FeedbackDiv=%d PostDiv=%d.\n", freq, pll_output_freq_2, feedback_div_2, post_div->divider ); rcrtc2->regs.rP2PLL_REF_DIV = rcrtc2->pll_ref_div; rcrtc2->regs.rP2PLL_DIV_0 = feedback_div_2 | (post_div->bitvalue << 16); rcrtc2->regs.rHTOTAL2_CNTL = 0; } static bool crtc2_calc_regs( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { RadeonDeviceData *rdev = rdrv->device_data; VideoMode *mode; u32 format = 0; int h_total, h_sync_start, h_sync_end, h_sync_wid; int v_total, v_sync_start, v_sync_end, v_sync_wid; mode = crtc2_find_mode( rdrv, config->width, config->height ); if (!mode) { D_BUG( "unexpected error while searching video mode" ); return false; } switch (config->format) { case DSPF_LUT8: case DSPF_RGB332: format = DST_8BPP; break; case DSPF_RGB555: case DSPF_ARGB1555: format = DST_15BPP; break; case DSPF_RGB16: format = DST_16BPP; break; case DSPF_RGB24: format = DST_24BPP; break; case DSPF_RGB32: case DSPF_ARGB: format = DST_32BPP; break; default: D_BUG( "unexpected pixelformat" ); return false; } h_sync_start = mode->xres + mode->right_margin; h_sync_end = h_sync_start + mode->hsync_len; h_total = h_sync_end + mode->left_margin; h_sync_wid = (h_sync_end - h_sync_start) / 8; h_sync_wid = CLAMP( h_sync_wid, 1, 0x3f ); h_sync_start = h_sync_start - 8; v_sync_start = mode->yres + mode->lower_margin; v_sync_end = v_sync_start + mode->vsync_len; v_total = v_sync_end + mode->upper_margin; v_sync_wid = v_sync_end - v_sync_start; v_sync_wid = CLAMP( v_sync_wid, 1, 0x1f ); D_DEBUG( "DirectFB/Radeon/CRTC2: \n" "\t\thSyncStart:%d hSyncEnd:%d hTotal:%d hSyncWid:%d\n" "\t\tvSyncStart:%d vSyncEnd:%d vTotal:%d vSyncWid:%d\n", h_sync_start, h_sync_end, h_total, h_sync_wid, v_sync_start, v_sync_end, v_total, v_sync_wid ); rcrtc2->regs.rCRTC2_GEN_CNTL = CRTC2_EN | CRTC2_CRT2_ON | (format << 8); if (mode->laced) rcrtc2->regs.rCRTC2_GEN_CNTL |= CRTC2_INTERLACE_EN; if (mode->doubled) rcrtc2->regs.rCRTC2_GEN_CNTL |= CRTC2_DBL_SCAN_EN; if (mode->sync_on_green) rcrtc2->regs.rCRTC2_GEN_CNTL |= CRTC2_CSYNC_EN; rcrtc2->regs.rDAC_CNTL2 = rcrtc2->save.rDAC_CNTL2 | DAC2_DAC2_CLK_SEL; rcrtc2->regs.rTV_DAC_CNTL = 0x00280203; rcrtc2->regs.rDISP_OUTPUT_CNTL = rcrtc2->save.rDISP_OUTPUT_CNTL; rcrtc2->regs.rDISP_HW_DEBUG = rcrtc2->save.rDISP_HW_DEBUG; if (rdev->chipset == CHIP_UNKNOWN || rdev->chipset == CHIP_R200 || rdev->chipset >= CHIP_R300) { rcrtc2->regs.rDISP_OUTPUT_CNTL &= ~(DISP_DAC_SOURCE_MASK | DISP_DAC2_SOURCE_MASK); /* If primary monitor is a TV monitor, * reverse the DAC source to control it using the CRTC2. */ if (rdev->monitor1 == MT_CTV || rdev->monitor1 == MT_STV) rcrtc2->regs.rDISP_OUTPUT_CNTL |= DISP_DAC2_SOURCE_CRTC2; else rcrtc2->regs.rDISP_OUTPUT_CNTL |= DISP_DAC_SOURCE_CRTC2; } else { if (rdev->monitor1 == MT_CTV || rdev->monitor1 == MT_STV) { rcrtc2->regs.rDISP_HW_DEBUG &= ~CRT2_DISP1_SEL; rcrtc2->regs.rDAC_CNTL2 &= ~DAC2_DAC_CLK_SEL; } else { rcrtc2->regs.rDISP_HW_DEBUG |= CRT2_DISP1_SEL; rcrtc2->regs.rDAC_CNTL2 |= DAC2_DAC_CLK_SEL; } } rcrtc2->regs.rCRTC2_H_TOTAL_DISP = ((h_total/8 - 1) & 0x3ff) | ((mode->xres/8 - 1) << 16); rcrtc2->regs.rCRTC2_H_SYNC_STRT_WID = (h_sync_start & 0x1fff) | ((h_sync_wid & 0x3f) << 16); if (!mode->hsync_high) rcrtc2->regs.rCRTC2_H_SYNC_STRT_WID |= CRTC2_H_SYNC_POL; rcrtc2->regs.rCRTC2_V_TOTAL_DISP = ((v_total - 1) & 0xffff) | ((mode->yres - 1) << 16); rcrtc2->regs.rCRTC2_V_SYNC_STRT_WID = ((v_sync_start - 1) & 0xfff) | ((v_sync_wid & 0x1f) << 16); if (!mode->vsync_high) rcrtc2->regs.rCRTC2_V_SYNC_STRT_WID |= CRTC2_V_SYNC_POL; if (lock->phys - lock->offset == rdev->fb_phys) rcrtc2->regs.rCRTC2_BASE_ADDR = rdev->fb_offset; else rcrtc2->regs.rCRTC2_BASE_ADDR = rdev->agp_offset; rcrtc2->regs.rCRTC2_OFFSET = lock->offset; rcrtc2->regs.rCRTC2_OFFSET_CNTL = rcrtc2->save.rCRTC2_OFFSET_CNTL; rcrtc2->regs.rCRTC2_OFFSET_CNTL &= ~CRTC_TILE_EN; rcrtc2->regs.rCRTC2_OFFSET_CNTL |= CRTC_HSYNC_EN; rcrtc2->regs.rCRTC2_PITCH = (lock->pitch / DFB_BYTES_PER_PIXEL(surface->config.format)) >> 3; rcrtc2->regs.rCRTC2_PITCH |= rcrtc2->regs.rCRTC2_PITCH << 16; if (rdev->monitor2 == MT_DFP) { rcrtc2->regs.rCRTC2_GEN_CNTL &= ~CRTC2_CRT2_ON; rcrtc2->regs.rFP2_GEN_CNTL = rcrtc2->save.rFP2_GEN_CNTL | FP2_ON; if (rdev->chipset == CHIP_UNKNOWN || rdev->chipset == CHIP_R200 || rdev->chipset >= CHIP_R300) { rcrtc2->regs.rFP2_GEN_CNTL &= ~(R200_FP2_SOURCE_SEL_MASK | FP2_DVO_RATE_SEL_SDR); rcrtc2->regs.rFP2_GEN_CNTL |= R200_FP2_SOURCE_SEL_CRTC2 | FP2_DVO_EN; } else { rcrtc2->regs.rFP2_GEN_CNTL &= ~FP2_SRC_SEL_MASK; rcrtc2->regs.rFP2_GEN_CNTL |= FP2_SRC_SEL_CRTC2; } rcrtc2->regs.rFP2_H_SYNC_STRT_WID = rcrtc2->regs.rCRTC2_H_SYNC_STRT_WID; rcrtc2->regs.rFP2_V_SYNC_STRT_WID = rcrtc2->regs.rCRTC2_V_SYNC_STRT_WID; } else { rcrtc2->regs.rFP2_GEN_CNTL = rcrtc2->save.rFP2_GEN_CNTL; rcrtc2->regs.rFP2_H_SYNC_STRT_WID = 0; rcrtc2->regs.rFP2_V_SYNC_STRT_WID = 0; } crtc2_calc_pllregs( rdrv, rcrtc2, 100000000 / mode->pixclock ); return true; } static void crtc2_set_regs ( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2 ) { volatile u8 *mmio = rdrv->mmio_base; u32 tmp; /* Lock the card during mode switching. */ dfb_gfxcard_lock( GDLF_WAIT | GDLF_SYNC ); radeon_out32( mmio, CRTC2_GEN_CNTL, rcrtc2->regs.rCRTC2_GEN_CNTL | CRTC2_DISP_DIS ); radeon_out32( mmio, DAC_CNTL2, rcrtc2->regs.rDAC_CNTL2 ); radeon_out32( mmio, TV_DAC_CNTL, rcrtc2->regs.rTV_DAC_CNTL ); radeon_out32( mmio, DISP_OUTPUT_CNTL, rcrtc2->regs.rDISP_OUTPUT_CNTL ); radeon_out32( mmio, DISP_HW_DEBUG, rcrtc2->regs.rDISP_HW_DEBUG ); radeon_out32( mmio, CRTC2_H_TOTAL_DISP, rcrtc2->regs.rCRTC2_H_TOTAL_DISP ); radeon_out32( mmio, CRTC2_H_SYNC_STRT_WID, rcrtc2->regs.rCRTC2_H_SYNC_STRT_WID ); radeon_out32( mmio, CRTC2_V_TOTAL_DISP, rcrtc2->regs.rCRTC2_V_TOTAL_DISP ); radeon_out32( mmio, CRTC2_V_SYNC_STRT_WID, rcrtc2->regs.rCRTC2_V_SYNC_STRT_WID ); radeon_out32( mmio, CRTC2_BASE_ADDR, rcrtc2->regs.rCRTC2_BASE_ADDR ); radeon_out32( mmio, CRTC2_OFFSET, rcrtc2->regs.rCRTC2_OFFSET ); radeon_out32( mmio, CRTC2_OFFSET_CNTL, rcrtc2->regs.rCRTC2_OFFSET_CNTL ); radeon_out32( mmio, CRTC2_PITCH, rcrtc2->regs.rCRTC2_PITCH ); radeon_out32( mmio, FP2_GEN_CNTL, rcrtc2->regs.rFP2_GEN_CNTL ); radeon_out32( mmio, FP2_H_SYNC_STRT_WID, rcrtc2->regs.rFP2_H_SYNC_STRT_WID ); radeon_out32( mmio, FP2_V_SYNC_STRT_WID, rcrtc2->regs.rFP2_V_SYNC_STRT_WID ); tmp = radeon_inpll( mmio, PIXCLKS_CNTL) & ~PIX2CLK_SRC_SEL_MASK; radeon_outpll( mmio, PIXCLKS_CNTL, tmp | PIX2CLK_SRC_SEL_CPUCLK ); tmp = radeon_inpll( mmio, P2PLL_CNTL ); radeon_outpll( mmio, P2PLL_CNTL, tmp | P2PLL_RESET | P2PLL_ATOMIC_UPDATE_EN | P2PLL_VGA_ATOMIC_UPDATE_EN ); tmp = radeon_inpll( mmio, P2PLL_REF_DIV ) & ~P2PLL_REF_DIV_MASK; radeon_outpll( mmio, P2PLL_REF_DIV, tmp | rcrtc2->regs.rP2PLL_REF_DIV ); tmp = radeon_inpll( mmio, P2PLL_DIV_0 ) & ~P2PLL_FB0_DIV_MASK; radeon_outpll( mmio, P2PLL_DIV_0, tmp | rcrtc2->regs.rP2PLL_DIV_0 ); tmp = radeon_inpll( mmio, P2PLL_DIV_0 ) & ~P2PLL_POST0_DIV_MASK; radeon_outpll( mmio, P2PLL_DIV_0, tmp | rcrtc2->regs.rP2PLL_DIV_0 ); while (radeon_inpll( mmio, P2PLL_REF_DIV ) & P2PLL_ATOMIC_UPDATE_R); radeon_outpll( mmio, P2PLL_REF_DIV, radeon_inpll( mmio, P2PLL_REF_DIV ) | P2PLL_ATOMIC_UPDATE_W ); for (tmp = 0; tmp < 1000; tmp++) { if (!(radeon_inpll( mmio, P2PLL_REF_DIV ) & P2PLL_ATOMIC_UPDATE_R)) break; } radeon_outpll( mmio, HTOTAL2_CNTL, rcrtc2->regs.rHTOTAL2_CNTL ); tmp = radeon_inpll( mmio, P2PLL_CNTL ); radeon_outpll( mmio, P2PLL_CNTL, tmp & ~(P2PLL_RESET | P2PLL_SLEEP | P2PLL_ATOMIC_UPDATE_EN | P2PLL_VGA_ATOMIC_UPDATE_EN) ); usleep( 5000 ); tmp = radeon_inpll( mmio, PIXCLKS_CNTL ) & ~PIX2CLK_SRC_SEL_MASK; radeon_outpll( mmio, PIXCLKS_CNTL, tmp | PIX2CLK_SRC_SEL_P2PLLCLK ); radeon_out32( mmio, CRTC2_GEN_CNTL, rcrtc2->regs.rCRTC2_GEN_CNTL ); dfb_gfxcard_unlock(); } static inline u8 calc_gamma( float n, float d ) { int ret; ret = 255.0 * n / d + 0.5; if (ret > 255) ret = 255; else if (ret < 0) ret = 0; return ret; } static void crtc2_calc_palette( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2, CoreLayerRegionConfig *config, DFBColorAdjustment *adjustment, CorePalette *palette ) { unsigned int i; int r, g, b; switch (config->format) { case DSPF_LUT8: rcrtc2->lut.size = MAX( palette->num_entries, 256 ); for (i = 0; i < rcrtc2->lut.size; i++) { rcrtc2->lut.r[i] = palette->entries[i].r; rcrtc2->lut.g[i] = palette->entries[i].g; rcrtc2->lut.b[i] = palette->entries[i].b; } break; case DSPF_RGB332: rcrtc2->lut.size = 256; for (i = 0, r = 0; r < 8; r++) { for (g = 0; g < 8; g++) { for (b = 0; b < 4; b++) { rcrtc2->lut.r[i] = calc_gamma( r, 7 ); rcrtc2->lut.g[i] = calc_gamma( g, 7 ); rcrtc2->lut.b[i] = calc_gamma( b, 3 ); i++; } } } break; case DSPF_RGB555: case DSPF_ARGB1555: rcrtc2->lut.size = 32; for (i = 0; i < 32; i++) { rcrtc2->lut.r[i] = rcrtc2->lut.g[i] = rcrtc2->lut.b[i] = calc_gamma( i, 31 ); } break; case DSPF_RGB16: rcrtc2->lut.size = 64; for (i = 0; i < 64; i++) { rcrtc2->lut.r[i] = rcrtc2->lut.b[i] = calc_gamma( i/2, 31 ); rcrtc2->lut.g[i] = calc_gamma( i, 63 ); } break; default: rcrtc2->lut.size = 256; for (i = 0; i < 256; i++) { rcrtc2->lut.r[i] = rcrtc2->lut.b[i] = rcrtc2->lut.g[i] = i; } break; } if (adjustment->flags & DCAF_BRIGHTNESS) { int brightness = (adjustment->brightness >> 8) - 128; for (i = 0; i < rcrtc2->lut.size; i++) { r = rcrtc2->lut.r[i] + brightness; g = rcrtc2->lut.g[i] + brightness; b = rcrtc2->lut.b[i] + brightness; rcrtc2->lut.r[i] = CLAMP( r, 0, 255 ); rcrtc2->lut.g[i] = CLAMP( g, 0, 255 ); rcrtc2->lut.b[i] = CLAMP( b, 0, 255 ); } } if (adjustment->flags & DCAF_CONTRAST) { int contrast = adjustment->contrast; for (i = 0; i < rcrtc2->lut.size; i++) { r = rcrtc2->lut.r[i] * contrast / 0x8000; g = rcrtc2->lut.g[i] * contrast / 0x8000; b = rcrtc2->lut.b[i] * contrast / 0x8000; rcrtc2->lut.r[i] = CLAMP( r, 0, 255 ); rcrtc2->lut.g[i] = CLAMP( g, 0, 255 ); rcrtc2->lut.b[i] = CLAMP( b, 0, 255 ); } } if (adjustment->flags & DCAF_SATURATION) { int saturation = adjustment->saturation >> 8; for (i = 0; i < rcrtc2->lut.size; i++) { if (saturation > 128) { float gray = ((float)saturation - 128.0)/128.0; float color = 1.0 - gray; r = (((float)rcrtc2->lut.r[i] - 128.0 * gray)/color); g = (((float)rcrtc2->lut.g[i] - 128.0 * gray)/color); b = (((float)rcrtc2->lut.b[i] - 128.0 * gray)/color); } else { float color = (float)saturation/128.0; float gray = 1.0 - color; r = (((float)rcrtc2->lut.r[i] * color) + (128.0 * gray)); g = (((float)rcrtc2->lut.g[i] * color) + (128.0 * gray)); b = (((float)rcrtc2->lut.b[i] * color) + (128.0 * gray)); } rcrtc2->lut.r[i] = CLAMP( r, 0, 255 ); rcrtc2->lut.g[i] = CLAMP( g, 0, 255 ); rcrtc2->lut.b[i] = CLAMP( b, 0, 255 ); } } } static void crtc2_set_palette( RadeonDriverData *rdrv, RadeonCrtc2LayerData *rcrtc2 ) { volatile u8 *mmio = rdrv->mmio_base; u32 tmp; int i, j; if (!rcrtc2->lut.size) { D_WARN( "palette is empty" ); return; } dfb_gfxcard_lock( GDLF_WAIT | GDLF_SYNC ); tmp = radeon_in32( mmio, DAC_CNTL2 ); radeon_out32( mmio, DAC_CNTL2, tmp | DAC2_PALETTE_ACC_CTL ); j = 256 / rcrtc2->lut.size; for (i = 0; i < rcrtc2->lut.size; i++) { radeon_out32( mmio, PALETTE_INDEX, i*j ); radeon_out32( mmio, PALETTE_DATA, (rcrtc2->lut.b[i] ) | (rcrtc2->lut.g[i] << 8) | (rcrtc2->lut.r[i] << 16) ); } radeon_out32( mmio, DAC_CNTL2, tmp ); dfb_gfxcard_unlock(); } DirectFB-1.2.10/gfxdrivers/ep9x/0000777000175000017500000000000011307522570013274 500000000000000DirectFB-1.2.10/gfxdrivers/ep9x/Makefile.am0000644000175000017500000000140011245562152015240 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/ep9x INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems ep9xdir = $(MODULEDIR)/gfxdrivers ep9x_LTLIBRARIES = libdirectfb_ep9x.la if BUILD_STATIC ep9x_DATA = $(e9x_LTLIBRARIES:.la=.o) endif libdirectfb_ep9x_la_SOURCES = \ ep9x.c \ ep9x.h libdirectfb_ep9x_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_ep9x_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/ep9x/Makefile.in0000644000175000017500000004467111307521477015276 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/ep9x ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(ep9xdir)" "$(DESTDIR)$(ep9xdir)" ep9xLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(ep9x_LTLIBRARIES) libdirectfb_ep9x_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_ep9x_la_OBJECTS = ep9x.lo libdirectfb_ep9x_la_OBJECTS = $(am_libdirectfb_ep9x_la_OBJECTS) libdirectfb_ep9x_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_ep9x_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_ep9x_la_SOURCES) DIST_SOURCES = $(libdirectfb_ep9x_la_SOURCES) ep9xDATA_INSTALL = $(INSTALL_DATA) DATA = $(ep9x_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems ep9xdir = $(MODULEDIR)/gfxdrivers ep9x_LTLIBRARIES = libdirectfb_ep9x.la @BUILD_STATIC_TRUE@ep9x_DATA = $(e9x_LTLIBRARIES:.la=.o) libdirectfb_ep9x_la_SOURCES = \ ep9x.c \ ep9x.h libdirectfb_ep9x_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_ep9x_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/ep9x/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/ep9x/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-ep9xLTLIBRARIES: $(ep9x_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(ep9xdir)" || $(MKDIR_P) "$(DESTDIR)$(ep9xdir)" @list='$(ep9x_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(ep9xLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(ep9xdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(ep9xLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(ep9xdir)/$$f"; \ else :; fi; \ done uninstall-ep9xLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(ep9x_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(ep9xdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(ep9xdir)/$$p"; \ done clean-ep9xLTLIBRARIES: -test -z "$(ep9x_LTLIBRARIES)" || rm -f $(ep9x_LTLIBRARIES) @list='$(ep9x_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_ep9x.la: $(libdirectfb_ep9x_la_OBJECTS) $(libdirectfb_ep9x_la_DEPENDENCIES) $(libdirectfb_ep9x_la_LINK) -rpath $(ep9xdir) $(libdirectfb_ep9x_la_OBJECTS) $(libdirectfb_ep9x_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ep9x.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-ep9xDATA: $(ep9x_DATA) @$(NORMAL_INSTALL) test -z "$(ep9xdir)" || $(MKDIR_P) "$(DESTDIR)$(ep9xdir)" @list='$(ep9x_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(ep9xDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(ep9xdir)/$$f'"; \ $(ep9xDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(ep9xdir)/$$f"; \ done uninstall-ep9xDATA: @$(NORMAL_UNINSTALL) @list='$(ep9x_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(ep9xdir)/$$f'"; \ rm -f "$(DESTDIR)$(ep9xdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(ep9xdir)" "$(DESTDIR)$(ep9xdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-ep9xLTLIBRARIES clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-ep9xDATA install-ep9xLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ep9xDATA uninstall-ep9xLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-ep9xLTLIBRARIES clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-ep9xDATA \ install-ep9xLTLIBRARIES install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-ep9xDATA uninstall-ep9xLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/ep9x/ep9x.h0000644000175000017500000000440011164361026014242 00000000000000/* (c) Copyright 2001-2007 The DirectFB Organization (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by BoLiu This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __EP9X_H__ #define __EP9X_H__ #include #include #include /* * The following are the IOCTLs that can be sent to the EP93xx frame buffer * device. */ #define FBIO_EP9X_GET_CAPS 0x000046c0 #define FBIO_EP9X_CURSOR 0x000046c1 #define FBIO_EP9X_LINE 0x000046c2 #define FBIO_EP9X_FILL 0x000046c3 #define FBIO_EP9X_BLIT 0x000046c4 #define FBIO_EP9X_COPY 0x000046c5 #define FBIO_EP9X_GET_ADDR 0x000046c6 struct ep9x_line { __u32 flags; __s32 x1; __s32 y1; __s32 x2; __s32 y2; __u32 fgcolor; __u32 bgcolor; // Only used if LINE_BACKGROUND is set __u32 pattern; // Only used if LINE_PATTERN is set }; /* * ioctl(fd, FBIO_EP93XX_FILL, ep93xx_fill *) * * Fills from dx to (dx + width - 1), and from dy to (dy + height - 1). */ struct ep9x_fill { __u32 dx; __u32 dy; __u32 width; __u32 height; __u32 color; }; typedef struct { FBDev *dfb_fbdev; } EP9XDriverData; typedef struct { unsigned long fb_addr; u32 fill_color; u32 pixelformat; u8 pixeldepth; bool fb_store; unsigned long srcaddr,destaddr,srcpitch,destpitch; DFBRegion clip; /* state validation */ int smf_source; int smf_destination; int smf_color; int smf_clip; } EP9XDeviceData; #endif /*__EDB93XX_H__*/ DirectFB-1.2.10/gfxdrivers/ep9x/ep9x.c0000644000175000017500000003174311164361026014247 00000000000000/* (c) Copyright 2001-2007 The DirectFB Organization (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Antonino Daplas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( ep9x ) #include "ep9x.h" D_DEBUG_DOMAIN( ep9x, "ep9x", "Cirrus Logic EP9xx" ); #define EP9X_SUPPORTED_DRAWINGFLAGS (DSDRAW_NOFX) #define EP9X_SUPPORTED_DRAWINGFUNCTIONS (DFXL_FILLRECTANGLE | DFXL_DRAWLINE) #define EP9X_SUPPORTED_BLITTINGFLAGS (DSBLIT_NOFX) #define EP9X_SUPPORTED_BLITTINGFUNCTIONS (DFXL_NONE) 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; } static inline void ep9x_set_src(EP9XDriverData *ep9xdrv, EP9XDeviceData *ep9xdev, CardState *state) { if (ep9xdev->smf_source) return; if ( state->src.phys ) { D_DEBUG_AT(ep9x,"%s:video data is stored in fb and offset is %lx\n",__FUNCTION__,state->src.offset); ep9xdev->srcaddr = state->src.offset; ep9xdev->fb_store = true; } else if ( state->src.addr ) { D_DEBUG_AT( ep9x,"%s:video data is stored in system\n",__FUNCTION__); ep9xdev->srcaddr = (unsigned long) state->src.addr; ep9xdev->fb_store = false; } else D_ERROR("NOT vaild addr\n"); ep9xdev->srcpitch = state->src.pitch; ep9xdev->smf_source = 1; } static inline void ep9x_set_color( EP9XDriverData *ep9xdrv, EP9XDeviceData *ep9xdev, CardState *state ) { CoreSurfaceBuffer *buffer = state->dst.buffer; if (ep9xdev->smf_color) return; switch (buffer->format) { case DSPF_RGB16: ep9xdev->fill_color = PIXEL_RGB16( state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB24: case DSPF_RGB32: ep9xdev->fill_color = PIXEL_RGB32( state->color.r, state->color.g, state->color.b ); break; default: D_ERROR( "unexpected pixelformat!" ); } ep9xdev->smf_color = 1; } static inline void ep9x_set_clip( EP9XDriverData *ep9xdrv, EP9XDeviceData *ep9xdev, DFBRegion *clip ) { if (ep9xdev->smf_clip) return; ep9xdev->clip.x1 = clip->x1; ep9xdev->clip.y1 = clip->y1; ep9xdev->clip.x2 = clip->x2 + 1; ep9xdev->clip.y2 = clip->y2 + 1; ep9xdev->smf_clip = 1; } static void ep9xCheckState(void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: break; default: return; } if (!(accel & ~EP9X_SUPPORTED_DRAWINGFUNCTIONS) && !(state->drawingflags & ~EP9X_SUPPORTED_DRAWINGFLAGS)) state->accel |= EP9X_SUPPORTED_DRAWINGFUNCTIONS; if (!(accel & ~EP9X_SUPPORTED_BLITTINGFUNCTIONS) && !(state->blittingflags & ~EP9X_SUPPORTED_BLITTINGFLAGS)) { if (state->source->config.format == state->destination->config.format) state->accel |= EP9X_SUPPORTED_BLITTINGFUNCTIONS; } } static void ep9xSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { EP9XDriverData *ep9xdrv = (EP9XDriverData *) drv; EP9XDeviceData *ep9xdev = (EP9XDeviceData *) dev; if (state->modified & SMF_SOURCE && state->source ) ep9xdev->smf_source = 0; if (state->modified & SMF_DESTINATION) ep9xdev->smf_destination = ep9xdev->smf_color = 0; if (state->modified & SMF_COLOR) ep9xdev->smf_color = 0; if (state->modified & SMF_CLIP) ep9xdev->smf_clip = 0; ep9x_set_destination( ep9xdrv, ep9xdev, state); switch (accel) { case DFXL_FILLRECTANGLE: ep9x_set_color( ep9xdrv, ep9xdev, state ); state->set |= DFXL_FILLRECTANGLE; break; case DFXL_DRAWLINE: ep9x_set_color( ep9xdrv, ep9xdev, state ); state->set |= DFXL_DRAWLINE ; break; case DFXL_BLIT: ep9x_set_src( ep9xdrv, ep9xdev, state ); state->set |= DFXL_BLIT; break; default: D_ERROR( "unexpected drawing/blitting function" ); break; } if (state->modified & SMF_CLIP) ep9x_set_clip( ep9xdrv, ep9xdev, &state->clip); state->modified = 0; } static void ep9xFlushTextureCache(void *drv, void *dev) { EP9XDeviceData *ep9xdev = (EP9XDeviceData *) dev; ep9xdev->srcaddr = ep9xdev->destaddr = 0; ep9xdev->srcpitch = ep9xdev->destpitch = 0; ep9xdev->fb_store = false; } static DFBResult ep9xEngineSync(void *drv, void *dev) { return DFB_OK; } static void ep9xEngineReset(void *drv, void *dev) { memset((void*)dfb_system_video_memory_virtual(0),0,dfb_gfxcard_memory_length()); } static bool ep9xFillRectangle( void *drv, void *dev, DFBRectangle *rect ) { EP9XDriverData *ep9xdrv = (EP9XDriverData *) drv; EP9XDeviceData *ep9xdev = (EP9XDeviceData *) dev; struct ep9x_fill fill; D_DEBUG_AT(ep9x,"%s:enter\n",__FUNCTION__); fill.dx = rect->x; fill.dy = rect->y; fill.width = rect->w; fill.height = rect->h; fill.color = ep9xdev->fill_color; ioctl(ep9xdrv->dfb_fbdev->fd,FBIO_EP9X_FILL, &fill); D_DEBUG_AT(ep9x,"%s:exit\n",__FUNCTION__); return true; } static bool ep9xDrawLine( void *drv, void *dev, DFBRegion *line ) { EP9XDriverData *ep9xdrv = (EP9XDriverData *) drv; EP9XDeviceData *ep9xdev = (EP9XDeviceData *) dev; struct ep9x_line drawline; D_DEBUG_AT(ep9x,"%s:enter\n",__FUNCTION__); drawline.flags = 0; drawline.x1 = line->x1; drawline.x2 = line->x2; drawline.y1 = line->y1; drawline.y2 = line->y2; drawline.fgcolor = ep9xdev->fill_color; drawline.bgcolor = 0; drawline.pattern = 0; ioctl(ep9xdrv->dfb_fbdev->fd,FBIO_EP9X_LINE, &drawline); D_DEBUG_AT(ep9x,"%s:exit\n",__FUNCTION__); return true; } static bool ep9xBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { EP9XDriverData *ep9xdrv = (EP9XDriverData *) drv; EP9XDeviceData *ep9xdev = (EP9XDeviceData *) dev; struct fb_image image; D_DEBUG_AT(ep9x,"%s:enter\n",__FUNCTION__); if (!(ep9xdev->clip.x1 <= dx) || !(ep9xdev->clip.y1 <= dy) || !( ep9xdev->clip.x2 >= (dx + rect->w - 1) ) || !( ep9xdev->clip.y2 >= (dy + rect->h - 1) )) { D_ERROR("the blit region is not vaild\n"); return false; } image.dx = ep9xdev->destaddr + dx; image.dy = dy; image.width = rect->w; image.height = rect->h; image.depth = ep9xdev->pixeldepth; if ( ep9xdev->fb_store == true ) image.data = (void*)ep9xdev->fb_addr + ep9xdev->srcaddr + DFB_BYTES_PER_LINE( ep9xdev->pixelformat,rect->x ) + (rect->y * ep9xdev->srcpitch ); else image.data = (void*)ep9xdev->srcaddr + DFB_BYTES_PER_LINE( ep9xdev->pixelformat, rect->x ) + (rect->y * ep9xdev->srcpitch ); ioctl(ep9xdrv->dfb_fbdev->fd,FBIO_EP9X_BLIT,&image); D_DEBUG_AT(ep9x,"%s:exit\n",__FUNCTION__); return true; } static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_EP9X: /* cirrus ep93xx serials */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "ep9x 07/07A/12/15/15A Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "cirruslogic" ); snprintf( info->url, DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH, "http://arm.cirrus.com" ); snprintf( info->license, DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH, "LGPL" ); info->version.major = 0; info->version.minor = 1; info->driver_data_size = sizeof (EP9XDriverData); info->device_data_size = sizeof (EP9XDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { EP9XDriverData *ep9xdrv = (EP9XDriverData*) driver_data; EP9XDeviceData *ep9xdev = (EP9XDeviceData*) device_data; ep9xdrv->dfb_fbdev = dfb_system_data(); ioctl(ep9xdrv->dfb_fbdev->fd,FBIO_EP9X_GET_ADDR,&(ep9xdev->fb_addr)); funcs->CheckState = ep9xCheckState; funcs->SetState = ep9xSetState; funcs->EngineSync = ep9xEngineSync; funcs->EngineReset = ep9xEngineReset; funcs->FlushTextureCache = ep9xFlushTextureCache; funcs->FillRectangle = ep9xFillRectangle; funcs->DrawLine = ep9xDrawLine; funcs->Blit = ep9xBlit; return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { EP9XDeviceData *ep9xdev = (EP9XDeviceData*) device_data; /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "ep9x" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "cirruslogic" ); device_info->caps.flags = 0; device_info->caps.accel = EP9X_SUPPORTED_DRAWINGFUNCTIONS | EP9X_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = EP9X_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = EP9X_SUPPORTED_BLITTINGFLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; ep9xdev->fb_store = false; return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { EP9XDriverData *ep9xdrv = (EP9XDriverData*) driver_data; ep9xdrv->dfb_fbdev = NULL; } DirectFB-1.2.10/gfxdrivers/neomagic/0000777000175000017500000000000011307522570014171 500000000000000DirectFB-1.2.10/gfxdrivers/neomagic/Makefile.am0000644000175000017500000000126311245562152016144 00000000000000## Makefile.am for DirectFB/gfxdrivers/neomagic INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src neomagic_LTLIBRARIES = libdirectfb_neomagic.la if BUILD_STATIC neomagic_DATA = $(neomagic_LTLIBRARIES:.la=.o) endif neomagicdir = $(MODULEDIR)/gfxdrivers libdirectfb_neomagic_la_SOURCES = \ neomagic.c \ neomagic.h \ neo_overlay.c \ neo2200.c libdirectfb_neomagic_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_neomagic_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/neomagic/Makefile.in0000644000175000017500000004546711307521500016162 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/neomagic ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(neomagicdir)" \ "$(DESTDIR)$(neomagicdir)" neomagicLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(neomagic_LTLIBRARIES) libdirectfb_neomagic_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_neomagic_la_OBJECTS = neomagic.lo neo_overlay.lo \ neo2200.lo libdirectfb_neomagic_la_OBJECTS = \ $(am_libdirectfb_neomagic_la_OBJECTS) libdirectfb_neomagic_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_neomagic_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_neomagic_la_SOURCES) DIST_SOURCES = $(libdirectfb_neomagic_la_SOURCES) neomagicDATA_INSTALL = $(INSTALL_DATA) DATA = $(neomagic_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src neomagic_LTLIBRARIES = libdirectfb_neomagic.la @BUILD_STATIC_TRUE@neomagic_DATA = $(neomagic_LTLIBRARIES:.la=.o) neomagicdir = $(MODULEDIR)/gfxdrivers libdirectfb_neomagic_la_SOURCES = \ neomagic.c \ neomagic.h \ neo_overlay.c \ neo2200.c libdirectfb_neomagic_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_neomagic_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/neomagic/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/neomagic/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-neomagicLTLIBRARIES: $(neomagic_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(neomagicdir)" || $(MKDIR_P) "$(DESTDIR)$(neomagicdir)" @list='$(neomagic_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(neomagicLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(neomagicdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(neomagicLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(neomagicdir)/$$f"; \ else :; fi; \ done uninstall-neomagicLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(neomagic_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(neomagicdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(neomagicdir)/$$p"; \ done clean-neomagicLTLIBRARIES: -test -z "$(neomagic_LTLIBRARIES)" || rm -f $(neomagic_LTLIBRARIES) @list='$(neomagic_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_neomagic.la: $(libdirectfb_neomagic_la_OBJECTS) $(libdirectfb_neomagic_la_DEPENDENCIES) $(libdirectfb_neomagic_la_LINK) -rpath $(neomagicdir) $(libdirectfb_neomagic_la_OBJECTS) $(libdirectfb_neomagic_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/neo2200.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/neo_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/neomagic.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-neomagicDATA: $(neomagic_DATA) @$(NORMAL_INSTALL) test -z "$(neomagicdir)" || $(MKDIR_P) "$(DESTDIR)$(neomagicdir)" @list='$(neomagic_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(neomagicDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(neomagicdir)/$$f'"; \ $(neomagicDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(neomagicdir)/$$f"; \ done uninstall-neomagicDATA: @$(NORMAL_UNINSTALL) @list='$(neomagic_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(neomagicdir)/$$f'"; \ rm -f "$(DESTDIR)$(neomagicdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(neomagicdir)" "$(DESTDIR)$(neomagicdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-neomagicLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-neomagicDATA install-neomagicLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-neomagicDATA uninstall-neomagicLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-neomagicLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-neomagicDATA install-neomagicLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-neomagicDATA \ uninstall-neomagicLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/neomagic/neomagic.h0000644000175000017500000001056411245562152016047 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NEOMAGIC_H__ #define __NEOMAGIC_H__ #include #include #include #include typedef struct { unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; } NeoDeviceData; typedef struct { volatile u8 *mmio_base; } NeoDriverData; extern DisplayLayerFuncs neoOverlayFuncs; void neo2200_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ); DFBResult neo2200_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ); DFBResult neo2200_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ); void neo2200_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ); void neo2200_close_driver( CoreGraphicsDevice *device, void *driver_data ); #define NEO_BS0_BLT_BUSY 0x00000001 #define NEO_BS0_FIFO_AVAIL 0x00000002 #define NEO_BS0_FIFO_PEND 0x00000004 #define NEO_BC0_DST_Y_DEC 0x00000001 #define NEO_BC0_X_DEC 0x00000002 #define NEO_BC0_SRC_TRANS 0x00000004 #define NEO_BC0_SRC_IS_FG 0x00000008 #define NEO_BC0_SRC_Y_DEC 0x00000010 #define NEO_BC0_FILL_PAT 0x00000020 #define NEO_BC0_SRC_MONO 0x00000040 #define NEO_BC0_SYS_TO_VID 0x00000080 #define NEO_BC1_DEPTH8 0x00000100 #define NEO_BC1_DEPTH16 0x00000200 #define NEO_BC1_X_320 0x00000400 #define NEO_BC1_X_640 0x00000800 #define NEO_BC1_X_800 0x00000c00 #define NEO_BC1_X_1024 0x00001000 #define NEO_BC1_X_1152 0x00001400 #define NEO_BC1_X_1280 0x00001800 #define NEO_BC1_X_1600 0x00001c00 #define NEO_BC1_DST_TRANS 0x00002000 #define NEO_BC1_MSTR_BLT 0x00004000 #define NEO_BC1_FILTER_Z 0x00008000 #define NEO_BC2_WR_TR_DST 0x00800000 #define NEO_BC3_SRC_XY_ADDR 0x01000000 #define NEO_BC3_DST_XY_ADDR 0x02000000 #define NEO_BC3_CLIP_ON 0x04000000 #define NEO_BC3_FIFO_EN 0x08000000 #define NEO_BC3_BLT_ON_ADDR 0x10000000 #define NEO_BC3_SKIP_MAPPING 0x80000000 #define NEO_MODE1_DEPTH8 0x0100 #define NEO_MODE1_DEPTH16 0x0200 #define NEO_MODE1_DEPTH24 0x0300 #define NEO_MODE1_X_320 0x0400 #define NEO_MODE1_X_640 0x0800 #define NEO_MODE1_X_800 0x0c00 #define NEO_MODE1_X_1024 0x1000 #define NEO_MODE1_X_1152 0x1400 #define NEO_MODE1_X_1280 0x1800 #define NEO_MODE1_X_1600 0x1c00 #define NEO_MODE1_BLT_ON_ADDR 0x2000 static inline void OUTGR (u8 index, u8 data) { outb (index, 0x3ce); outb (data, 0x3cf); } static inline void OUTSR (u8 index, u8 data) { outb (index, 0x3c4); outb (data, 0x3c5); } static inline void neo_lock( void ) { OUTGR(0x09, 0x00); } static inline void neo_unlock( void ) { OUTGR(0x09, 0x26); } #endif DirectFB-1.2.10/gfxdrivers/neomagic/neomagic.c0000644000175000017500000001553711245562152016047 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( neomagic ) #include "neomagic.h" /* for fifo/performance monitoring */ //unsigned int neo_fifo_space = 0; /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { /* no support for other NeoMagic cards yet */ case 95: /* NM2200 */ case 96: /* NM2230 */ case 97: /* NM2360 */ case 98: /* NM2380 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "NeoMagic Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); info->version.major = 0; info->version.minor = 0; info->driver_data_size = sizeof (NeoDriverData); info->device_data_size = sizeof (NeoDeviceData); switch (dfb_gfxcard_get_accelerator( device )) { /* no support for other NeoMagic cards yet */ case 95: /* NM2200 */ case 96: /* NM2230 */ case 97: /* NM2360 */ case 98: /* NM2380 */ neo2200_get_info( device, info ); break; } } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { NeoDriverData *ndrv = (NeoDriverData*) driver_data; ndrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!ndrv->mmio_base) return DFB_IO; switch (dfb_gfxcard_get_accelerator( device )) { /* no support for other NeoMagic cards yet */ case 95: /* NM2200 */ case 96: /* NM2230 */ case 97: /* NM2360 */ case 98: /* NM2380 */ return neo2200_init_driver( device, funcs, driver_data ); } return DFB_BUG; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { /* use polling for syncing, artefacts occur otherwise */ dfb_config->pollvsync_after = 1; switch (dfb_gfxcard_get_accelerator( device )) { /* no support for other NeoMagic cards yet */ case 95: /* NM2200 */ case 96: /* NM2230 */ case 97: /* NM2360 */ case 98: /* NM2380 */ return neo2200_init_device( device, device_info, driver_data, device_data ); } return DFB_BUG; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { NeoDeviceData *ndev = (NeoDeviceData*) device_data; (void) ndev; switch (dfb_gfxcard_get_accelerator( device )) { /* no support for other NeoMagic cards yet */ case 95: /* NM2200 */ case 96: /* NM2230 */ case 97: /* NM2360 */ case 98: /* NM2380 */ neo2200_close_device( device, driver_data, device_data ); } D_DEBUG( "DirectFB/NEO: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFB/NEO: %9d neo_waitfifo calls\n", ndev->waitfifo_calls ); D_DEBUG( "DirectFB/NEO: %9d register writes (neo_waitfifo sum)\n", ndev->waitfifo_sum ); D_DEBUG( "DirectFB/NEO: %9d FIFO wait cycles (depends on CPU)\n", ndev->fifo_waitcycles ); D_DEBUG( "DirectFB/NEO: %9d IDLE wait cycles (depends on CPU)\n", ndev->idle_waitcycles ); D_DEBUG( "DirectFB/NEO: %9d FIFO space cache hits(depends on CPU)\n", ndev->fifo_cache_hits ); D_DEBUG( "DirectFB/NEO: Conclusion:\n" ); D_DEBUG( "DirectFB/NEO: Average register writes/neo_waitfifo" "call:%.2f\n", ndev->waitfifo_sum/(float)(ndev->waitfifo_calls) ); D_DEBUG( "DirectFB/NEO: Average wait cycles/neo_waitfifo call:" " %.2f\n", ndev->fifo_waitcycles/(float)(ndev->waitfifo_calls) ); D_DEBUG( "DirectFB/NEO: Average fifo space cache hits: %02d%%\n", (int)(100 * ndev->fifo_cache_hits/ (float)(ndev->waitfifo_calls)) ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { NeoDriverData *ndrv = (NeoDriverData*) driver_data; switch (dfb_gfxcard_get_accelerator( device )) { /* no support for other NeoMagic cards yet */ case 95: /* NM2200 */ case 96: /* NM2230 */ case 97: /* NM2360 */ case 98: /* NM2380 */ neo2200_close_driver( device, driver_data ); } dfb_gfxcard_unmap_mmio( device, ndrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/neomagic/neo_overlay.c0000644000175000017500000002412311245562152016576 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "neomagic.h" typedef struct { CoreLayerRegionConfig config; /* overlay registers */ struct { u32 OFFSET; u16 PITCH; u16 X1; u16 X2; u16 Y1; u16 Y2; u16 HSCALE; u16 VSCALE; u8 CONTROL; } regs; } NeoOverlayLayerData; static void ovl_set_regs ( NeoDriverData *ndrv, NeoOverlayLayerData *novl ); static void ovl_calc_regs( NeoDriverData *ndrv, NeoOverlayLayerData *novl, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); #define NEO_OVERLAY_SUPPORTED_OPTIONS (DLOP_NONE) /**********************/ static int ovlLayerDataSize( void ) { return sizeof(NeoOverlayLayerData); } static DFBResult ovlInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *default_config, DFBColorAdjustment *default_adj ) { /* set capabilities and type */ description->caps = DLCAPS_SCREEN_LOCATION | DLCAPS_SURFACE | DLCAPS_BRIGHTNESS; description->type = DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "NeoMagic Overlay" ); /* fill out the default configuration */ default_config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; default_config->width = 640; default_config->height = 480; default_config->pixelformat = DSPF_YUY2; default_config->buffermode = DLBM_FRONTONLY; default_config->options = DLOP_NONE; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ default_adj->flags = DCAF_BRIGHTNESS; default_adj->brightness = 0x8000; /* FIXME: use mmio */ if (iopl(3) < 0) { D_PERROR( "NeoMagic/Overlay: Could not change I/O permission level!\n" ); return DFB_UNSUPPORTED; } neo_unlock(); /* reset overlay */ OUTGR(0xb0, 0x00); /* reset brightness */ OUTGR(0xc4, 0x00); /* disable capture */ OUTGR(0x0a, 0x21); OUTSR(0x08, 0xa0); OUTGR(0x0a, 0x01); neo_lock(); return DFB_OK; } static void ovlOnOff( NeoDriverData *ndrv, NeoOverlayLayerData *novl, int on ) { /* set/clear enable bit */ if (on) novl->regs.CONTROL = 0x01; else novl->regs.CONTROL = 0x00; /* FIXME: use mmio */ if (iopl(3) < 0) { D_PERROR( "NeoMagic/Overlay: Could not change I/O permission level!\n" ); return; } /* write back to card */ neo_unlock(); OUTGR(0xb0, novl->regs.CONTROL); neo_lock(); } static DFBResult ovlTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; /* check for unsupported options */ if (config->options & ~NEO_OVERLAY_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; /* check pixel format */ switch (config->format) { case DSPF_YUY2: break; default: fail |= CLRCF_FORMAT; } /* check width */ if (config->width > 1024 || config->width < 160) fail |= CLRCF_WIDTH; /* check height */ if (config->height > 1024 || config->height < 1) fail |= CLRCF_HEIGHT; /* write back failing fields */ if (failed) *failed = fail; /* return failure if any field failed */ if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ovlSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { NeoDriverData *ndrv = (NeoDriverData*) driver_data; NeoOverlayLayerData *novl = (NeoOverlayLayerData*) layer_data; /* remember configuration */ novl->config = *config; ovl_calc_regs( ndrv, novl, config, surface, lock ); ovl_set_regs( ndrv, novl ); /* enable overlay */ ovlOnOff( ndrv, novl, config->opacity ); return DFB_OK; } static DFBResult ovlRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { NeoDriverData *ndrv = (NeoDriverData*) driver_data; NeoOverlayLayerData *novl = (NeoOverlayLayerData*) layer_data; /* disable overlay */ ovlOnOff( ndrv, novl, 0 ); return DFB_OK; } static DFBResult ovlFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { NeoDriverData *ndrv = (NeoDriverData*) driver_data; NeoOverlayLayerData *novl = (NeoOverlayLayerData*) layer_data; #if 0 bool onsync = (flags & DSFLIP_WAITFORSYNC); if (onsync) dfb_fbdev_wait_vsync(); #endif dfb_surface_flip( surface, false ); ovl_calc_regs( ndrv, novl, &novl->config, surface, lock ); ovl_set_regs( ndrv, novl ); return DFB_OK; } static DFBResult ovlSetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { /* FIXME: use mmio */ if (iopl(3) < 0) { D_PERROR( "NeoMagic/Overlay: Could not change I/O permission level!\n" ); return DFB_UNSUPPORTED; } neo_unlock(); OUTGR(0xc4, (signed char)((adj->brightness >> 8) -128)); neo_lock(); return DFB_OK; } DisplayLayerFuncs neoOverlayFuncs = { .LayerDataSize = ovlLayerDataSize, .InitLayer = ovlInitLayer, .SetRegion = ovlSetRegion, .RemoveRegion = ovlRemoveRegion, .TestRegion = ovlTestRegion, .FlipRegion = ovlFlipRegion, .SetColorAdjustment = ovlSetColorAdjustment, }; /* internal */ static void ovl_set_regs( NeoDriverData *ndrv, NeoOverlayLayerData *novl ) { /* FIXME: use mmio */ if (iopl(3) < 0) { D_PERROR( "NeoMagic/Overlay: Could not change I/O permission level!\n" ); return; } neo_unlock(); OUTGR(0xb1, ((novl->regs.X2 >> 4) & 0xf0) | (novl->regs.X1 >> 8)); OUTGR(0xb2, novl->regs.X1); OUTGR(0xb3, novl->regs.X2); OUTGR(0xb4, ((novl->regs.Y2 >> 4) & 0xf0) | (novl->regs.Y1 >> 8)); OUTGR(0xb5, novl->regs.Y1); OUTGR(0xb6, novl->regs.Y2); OUTGR(0xb7, novl->regs.OFFSET >> 16); OUTGR(0xb8, novl->regs.OFFSET >> 8); OUTGR(0xb9, novl->regs.OFFSET); OUTGR(0xba, novl->regs.PITCH >> 8); OUTGR(0xbb, novl->regs.PITCH); OUTGR(0xbc, 0x2e); /* Neo2160: 0x4f */ OUTGR(0xbd, 0x02); OUTGR(0xbe, 0x00); OUTGR(0xbf, 0x02); OUTGR(0xc0, novl->regs.HSCALE >> 8); OUTGR(0xc1, novl->regs.HSCALE); OUTGR(0xc2, novl->regs.VSCALE >> 8); OUTGR(0xc3, novl->regs.VSCALE); neo_lock(); } static void ovl_calc_regs( NeoDriverData *ndrv, NeoOverlayLayerData *novl, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { /* fill register struct */ novl->regs.X1 = config->dest.x; novl->regs.X2 = config->dest.x + config->dest.w - 1; novl->regs.Y1 = config->dest.y; novl->regs.Y2 = config->dest.y + config->dest.h - 1; novl->regs.OFFSET = lock->offset; novl->regs.PITCH = lock->pitch; novl->regs.HSCALE = (surface->config.size.w << 12) / (config->dest.w + 1); novl->regs.VSCALE = (surface->config.size.h << 12) / (config->dest.h + 1); } DirectFB-1.2.10/gfxdrivers/neomagic/neo2200.c0000644000175000017500000003650611245562152015351 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "neomagic.h" typedef volatile struct { u32 bltStat; u32 bltCntl; u32 xpColor; u32 fgColor; u32 bgColor; u32 pitch; u32 clipLT; u32 clipRB; u32 srcBitOffset; u32 srcStart; u32 reserved0; u32 dstStart; u32 xyExt; u32 reserved1[19]; u32 pageCntl; u32 pageBase; u32 postBase; u32 postPtr; u32 dataPtr; } Neo2200; typedef struct { NeoDeviceData neo; int dstOrg; int dstPitch; int dstPixelWidth; int srcOrg; int srcPitch; int srcPixelWidth; u32 bltCntl; bool src_dst_equal; /* state validation */ int n_bltMode_dst; int n_src; int n_fgColor; int n_xpColor; } Neo2200DeviceData; typedef struct { NeoDriverData neo; Neo2200 *neo2200; } Neo2200DriverData; static inline void neo2200_waitidle( Neo2200DriverData *ndrv, Neo2200DeviceData *ndev ) { while (ndrv->neo2200->bltStat & 1) ndev->neo.idle_waitcycles++; } static inline void neo2200_waitfifo( Neo2200DriverData *ndrv, Neo2200DeviceData *ndev, int requested_fifo_space ) { ndev->neo.waitfifo_calls++; ndev->neo.waitfifo_sum += requested_fifo_space; /* FIXME: does not work if (neo_fifo_space < requested_fifo_space) { neo_fifo_waitcycles++; while (1) { neo_fifo_space = (neo2200->bltStat >> 8); if (neo_fifo_space >= requested_fifo_space) break; } } else { neo_fifo_cache_hits++; } neo_fifo_space -= requested_fifo_space; */ neo2200_waitidle( ndrv, ndev ); } static inline void neo2200_validate_bltMode_dst( Neo2200DriverData *ndrv, Neo2200DeviceData *ndev, CoreSurface *dst, CoreSurfaceBufferLock *lock ) { int bltMode = 0; if (ndev->n_bltMode_dst) return; switch (dst->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_RGB332: bltMode |= NEO_MODE1_DEPTH8; break; case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_YUY2: bltMode |= NEO_MODE1_DEPTH16; break; default: D_BUG( "unexpected pixelformat!" ); break; } ndev->dstOrg = lock->offset; ndev->dstPitch = lock->pitch; ndev->dstPixelWidth = DFB_BYTES_PER_PIXEL(dst->config.format); neo2200_waitfifo( ndrv, ndev, 2 ); ndrv->neo2200->bltStat = bltMode << 16; ndrv->neo2200->pitch = (ndev->dstPitch << 16) | (ndev->srcPitch & 0xffff); ndev->n_bltMode_dst = 1; } static inline void neo2200_validate_src( Neo2200DriverData *ndrv, Neo2200DeviceData *ndev, CoreSurface *src, CoreSurfaceBufferLock *lock ) { if (ndev->n_src) return; ndev->srcOrg = lock->offset; ndev->srcPitch = lock->pitch; ndev->srcPixelWidth = DFB_BYTES_PER_PIXEL(src->config.format); neo2200_waitfifo( ndrv, ndev, 1 ); ndrv->neo2200->pitch = (ndev->dstPitch << 16) | (ndev->srcPitch & 0xffff); ndev->n_src = 1; } static inline void neo2200_validate_fgColor( Neo2200DriverData *ndrv, Neo2200DeviceData *ndev, CardState *state ) { if (ndev->n_fgColor) return; neo2200_waitfifo( ndrv, ndev, 1 ); switch (state->destination->config.format) { case DSPF_A8: ndrv->neo2200->fgColor = state->color.a; break; case DSPF_LUT8: ndrv->neo2200->fgColor = state->color_index; break; case DSPF_RGB332: ndrv->neo2200->fgColor = PIXEL_RGB332( state->color.r, state->color.g, state->color.b ); break; case DSPF_ARGB1555: ndrv->neo2200->fgColor = PIXEL_ARGB1555( state->color.a, state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB16: ndrv->neo2200->fgColor = PIXEL_RGB16( state->color.r, state->color.g, state->color.b ); break; default: D_BUG( "unexpected pixelformat!" ); break; } ndev->n_fgColor = 1; } static inline void neo2200_validate_xpColor( Neo2200DriverData *ndrv, Neo2200DeviceData *ndev, CardState *state ) { if (ndev->n_xpColor) return; neo2200_waitfifo( ndrv, ndev, 1 ); ndrv->neo2200->xpColor = state->src_colorkey; ndev->n_xpColor = 1; } /* required implementations */ static DFBResult neo2200EngineSync( void *drv, void *dev ) { Neo2200DriverData *ndrv = (Neo2200DriverData*) drv; Neo2200DeviceData *ndev = (Neo2200DeviceData*) dev; neo2200_waitidle( ndrv, ndev ); return DFB_OK; } #define NEO_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_NOFX) #define NEO_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE) #define NEO_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_SRC_COLORKEY) #define NEO_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT) static void neo2200CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_RGB332: case DSPF_ARGB1555: case DSPF_RGB16: break; case DSPF_YUY2: if (accel == DFXL_BLIT) break; default: return; } if (DFB_DRAWING_FUNCTION(accel)) { /* if the function is supported and there are no other drawing flags than the supported */ if (!(accel & ~NEO_SUPPORTED_DRAWINGFUNCTIONS) && !(state->drawingflags & ~NEO_SUPPORTED_DRAWINGFLAGS)) state->accel |= accel; } else { /* if the function is supported, there are no other blitting flags than the supported, the source and destination formats are the same and the source and dest. are different due to a blitting bug */ if (!(accel & ~NEO_SUPPORTED_BLITTINGFUNCTIONS) && !(state->blittingflags & ~NEO_SUPPORTED_BLITTINGFLAGS) && state->source->config.format == state->destination->config.format) state->accel |= accel; } } static void neo2200SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { Neo2200DriverData *ndrv = (Neo2200DriverData*) drv; Neo2200DeviceData *ndev = (Neo2200DeviceData*) dev; if (state->mod_hw & SMF_DESTINATION) ndev->n_fgColor = ndev->n_bltMode_dst = 0; else if (state->mod_hw & SMF_COLOR) ndev->n_fgColor = 0; if (state->mod_hw & SMF_SOURCE) ndev->n_src = 0; if (state->mod_hw & SMF_SRC_COLORKEY) ndev->n_xpColor = 0; neo2200_validate_bltMode_dst( ndrv, ndev, state->destination, &state->dst ); switch (accel) { case DFXL_BLIT: neo2200_validate_src( ndrv, ndev, state->source, &state->src ); ndev->src_dst_equal = (state->src.buffer == state->dst.buffer); if (state->blittingflags & DSBLIT_SRC_COLORKEY) { ndev->bltCntl = NEO_BC0_SRC_TRANS; neo2200_validate_xpColor( ndrv, ndev, state ); } else ndev->bltCntl = 0; state->set |= DFXL_BLIT; break; case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: neo2200_validate_fgColor( ndrv, ndev, state ); state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE; break; default: D_BUG( "unexpected drawing/blitting function!" ); break; } state->mod_hw = 0; } static bool neo2200FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { Neo2200DriverData *ndrv = (Neo2200DriverData*) drv; Neo2200DeviceData *ndev = (Neo2200DeviceData*) dev; Neo2200 *neo2200 = ndrv->neo2200; neo2200_waitfifo( ndrv, ndev, 3 ); /* set blt control */ neo2200->bltCntl = NEO_BC3_FIFO_EN | NEO_BC0_SRC_IS_FG | NEO_BC3_SKIP_MAPPING | 0x0c0000; neo2200->dstStart = ndev->dstOrg + (rect->y * ndev->dstPitch) + (rect->x * ndev->dstPixelWidth); neo2200->xyExt = (rect->h << 16) | (rect->w & 0xffff); return true; } static bool neo2200DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { Neo2200DriverData *ndrv = (Neo2200DriverData*) drv; Neo2200DeviceData *ndev = (Neo2200DeviceData*) dev; Neo2200 *neo2200 = ndrv->neo2200; u32 dst = ndev->dstOrg + (rect->y * ndev->dstPitch) + (rect->x * ndev->dstPixelWidth); neo2200_waitfifo( ndrv, ndev, 3 ); /* set blt control */ neo2200->bltCntl = NEO_BC3_FIFO_EN | NEO_BC0_SRC_IS_FG | NEO_BC3_SKIP_MAPPING | 0x0c0000; neo2200->dstStart = dst; neo2200->xyExt = (1 << 16) | (rect->w & 0xffff); dst += (rect->h - 1) * ndev->dstPitch; neo2200_waitfifo( ndrv, ndev, 2 ); neo2200->dstStart = dst; neo2200->xyExt = (1 << 16) | (rect->w & 0xffff); dst -= (rect->h - 2) * ndev->dstPitch; neo2200_waitfifo( ndrv, ndev, 2 ); neo2200->dstStart = dst; neo2200->xyExt = ((rect->h - 2) << 16) | 1; dst += (rect->w - 1) * ndev->dstPixelWidth; neo2200_waitfifo( ndrv, ndev, 2 ); neo2200->dstStart = dst; neo2200->xyExt = ((rect->h - 2) << 16) | 1; return true; } static bool neo2200Blit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Neo2200DriverData *ndrv = (Neo2200DriverData*) drv; Neo2200DeviceData *ndev = (Neo2200DeviceData*) dev; Neo2200 *neo2200 = ndrv->neo2200; u32 src_start, dst_start; u32 bltCntl = ndev->bltCntl; // fprintf(stderr, "blit: %d, %d (%dx%d) -> %d, %d\n", // rect->x, rect->y, rect->w, rect->h, dx, dy); /* if (rect->x < dx) { //rect->x += rect->w - 1; //dx += rect->w - 1; bltCntl |= NEO_BC0_X_DEC; } if (rect->y < dy) { //rect->y += rect->h - 1; //dy += rect->h - 1; bltCntl |= NEO_BC0_DST_Y_DEC | NEO_BC0_SRC_Y_DEC; } */ /* ARGH, the above code for the blitting direction doesn't work. */ if (ndev->src_dst_equal && (rect->x < dx || rect->y < dy)) return false; src_start = rect->y * ndev->srcPitch + rect->x * ndev->srcPixelWidth; dst_start = dy * ndev->dstPitch + dx * ndev->dstPixelWidth; neo2200_waitfifo( ndrv, ndev, 4 ); /* set blt control */ neo2200->bltCntl = bltCntl | NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0c0000; /* set start addresses */ neo2200->srcStart = ndev->srcOrg + src_start; neo2200->dstStart = ndev->dstOrg + dst_start; /* set size */ neo2200->xyExt = (rect->h << 16) | (rect->w & 0xffff); return true; } void neo2200_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { info->version.major = 0; info->version.minor = 3; info->driver_data_size = sizeof (Neo2200DriverData); info->device_data_size = sizeof (Neo2200DeviceData); } DFBResult neo2200_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ) { Neo2200DriverData *ndrv = (Neo2200DriverData*) driver_data; ndrv->neo2200 = (Neo2200*) ndrv->neo.mmio_base; funcs->CheckState = neo2200CheckState; funcs->SetState = neo2200SetState; funcs->EngineSync = neo2200EngineSync; funcs->FillRectangle = neo2200FillRectangle; funcs->DrawRectangle = neo2200DrawRectangle; // funcs->DrawLine = neoDrawLine2D; funcs->Blit = neo2200Blit; // funcs->StretchBlit = neoStretchBlit; /* overlay support */ dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &neoOverlayFuncs ); return DFB_OK; } DFBResult neo2200_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "2200/2230/2360/2380" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "NeoMagic" ); device_info->caps.flags = 0; device_info->caps.accel = NEO_SUPPORTED_DRAWINGFUNCTIONS | NEO_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = NEO_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = NEO_SUPPORTED_BLITTINGFLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; return DFB_OK; } void neo2200_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } void neo2200_close_driver( CoreGraphicsDevice *device, void *driver_data ) { } DirectFB-1.2.10/gfxdrivers/omap/0000777000175000017500000000000011307522571013344 500000000000000DirectFB-1.2.10/gfxdrivers/omap/omap.c0000644000175000017500000000757711245562152014400 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include "omapfb.h" #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( omap ) #include "omap.h" /* */ static DFBResult omapEngineSync( void *drv, void *dev ) { FBDev *dfb_fbdev = dfb_system_data(); /* FIXME needed? */ ioctl( dfb_fbdev->fd, OMAPFB_SYNC_GFX ); return DFB_OK; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { FBDev *dfb_fbdev = dfb_system_data(); struct omapfb_caps caps; if (ioctl( dfb_fbdev->fd, OMAPFB_GET_CAPS, &caps)) return 0; return 1; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *driver_info ) { driver_info->version.major = 0; driver_info->version.minor = 1; direct_snputs( driver_info->name, "TI OMAP Driver", DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH ); direct_snputs( driver_info->vendor, "Ville Syrjala", DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH ); direct_snputs( driver_info->url, "http://www.directfb.org", DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH ); direct_snputs( driver_info->license, "LGPL", DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH ); #if 0 driver_info->driver_data_size = sizeof (OmapDriverData); driver_info->device_data_size = sizeof (OmapDeviceData); #endif } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { funcs->EngineSync = omapEngineSync; dfb_layers_hook_primary( device, driver_data, &omapPrimaryLayerFuncs, NULL, NULL ); return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { direct_snputs( device_info->name, "OMAP", DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH ); direct_snputs( device_info->vendor, "TI", DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { } DirectFB-1.2.10/gfxdrivers/omap/Makefile.am0000644000175000017500000000123511245562152015315 00000000000000## Makefile.am for DirectFB/gfxdrivers/omap INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src omap_LTLIBRARIES = libdirectfb_omap.la if BUILD_STATIC omap_DATA = $(omap_LTLIBRARIES:.la=.o) endif omapdir = $(MODULEDIR)/gfxdrivers libdirectfb_omap_la_SOURCES = \ omap.c \ omap.h \ omapfb.h \ omap_primary.c libdirectfb_omap_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_omap_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/omap/omap_primary.c0000644000175000017500000000555511245562152016135 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "omapfb.h" #include #include #include #include #include #include #include #include "omap.h" /* */ static DFBResult omapUpdateRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, const DFBRegion *update, CoreSurfaceBufferLock *lock ) { FBDev *dfb_fbdev = dfb_system_data(); struct omapfb_update_window window; DFBRectangle rect; dfb_rectangle_from_region( &rect, update ); D_DEBUG_AT( omap, "Update rectangle %d %d %dx%d\n", rect.x, rect.y, rect.w, rect.h ); if (rect.x & 1) rect.w++; if (rect.y & 1) rect.h++; window.x = rect.x & ~1; window.y = rect.y & ~1; window.width = (rect.w + 1) & ~1; window.height = (rect.h + 1) & ~1; window.out_x = window.x; window.out_y = window.y; window.out_width = window.width; window.out_height = window.height; window.format = 0; D_DEBUG_AT( omap, "Update window %d %d %dx%d\n", window.x, window.y, window.width, window.height ); if (ioctl( dfb_fbdev->fd, OMAPFB_UPDATE_WINDOW, &window )) D_DEBUG_AT( omap, "Can't update window -> %s\n", strerror( errno ) ); return DFB_OK; } DisplayLayerFuncs omapPrimaryLayerFuncs = { .UpdateRegion = omapUpdateRegion, }; DirectFB-1.2.10/gfxdrivers/omap/Makefile.in0000644000175000017500000004467511307521500015334 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/omap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(omapdir)" "$(DESTDIR)$(omapdir)" omapLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(omap_LTLIBRARIES) libdirectfb_omap_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_omap_la_OBJECTS = omap.lo omap_primary.lo libdirectfb_omap_la_OBJECTS = $(am_libdirectfb_omap_la_OBJECTS) libdirectfb_omap_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_omap_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_omap_la_SOURCES) DIST_SOURCES = $(libdirectfb_omap_la_SOURCES) omapDATA_INSTALL = $(INSTALL_DATA) DATA = $(omap_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src omap_LTLIBRARIES = libdirectfb_omap.la @BUILD_STATIC_TRUE@omap_DATA = $(omap_LTLIBRARIES:.la=.o) omapdir = $(MODULEDIR)/gfxdrivers libdirectfb_omap_la_SOURCES = \ omap.c \ omap.h \ omapfb.h \ omap_primary.c libdirectfb_omap_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_omap_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/omap/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/omap/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-omapLTLIBRARIES: $(omap_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(omapdir)" || $(MKDIR_P) "$(DESTDIR)$(omapdir)" @list='$(omap_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(omapLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(omapdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(omapLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(omapdir)/$$f"; \ else :; fi; \ done uninstall-omapLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(omap_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(omapdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(omapdir)/$$p"; \ done clean-omapLTLIBRARIES: -test -z "$(omap_LTLIBRARIES)" || rm -f $(omap_LTLIBRARIES) @list='$(omap_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_omap.la: $(libdirectfb_omap_la_OBJECTS) $(libdirectfb_omap_la_DEPENDENCIES) $(libdirectfb_omap_la_LINK) -rpath $(omapdir) $(libdirectfb_omap_la_OBJECTS) $(libdirectfb_omap_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/omap_primary.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-omapDATA: $(omap_DATA) @$(NORMAL_INSTALL) test -z "$(omapdir)" || $(MKDIR_P) "$(DESTDIR)$(omapdir)" @list='$(omap_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(omapDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(omapdir)/$$f'"; \ $(omapDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(omapdir)/$$f"; \ done uninstall-omapDATA: @$(NORMAL_UNINSTALL) @list='$(omap_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(omapdir)/$$f'"; \ rm -f "$(DESTDIR)$(omapdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(omapdir)" "$(DESTDIR)$(omapdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-omapLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-omapDATA install-omapLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-omapDATA uninstall-omapLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-omapLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-omapDATA install-omapLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-omapDATA \ uninstall-omapLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/omap/omapfb.h0000644000175000017500000001040211164361026014667 00000000000000/* * File: include/asm-arm/arch-omap/omapfb.h * * Framebuffer driver for TI OMAP boards * * Copyright (C) 2004 Nokia Corporation * Author: Imre Deak * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __OMAPFB_H #define __OMAPFB_H #include #include /* IOCTL commands. */ #define OMAP_IOW(num, dtype) _IOW('O', num, dtype) #define OMAP_IOR(num, dtype) _IOR('O', num, dtype) #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype) #define OMAP_IO(num) _IO('O', num) #define OMAPFB_MIRROR OMAP_IOW(31, int) #define OMAPFB_SYNC_GFX OMAP_IO(37) #define OMAPFB_VSYNC OMAP_IO(38) #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) #define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps) #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) #define OMAPFB_LCD_TEST OMAP_IOW(45, int) #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old) #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key) #define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key) #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info) #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info) #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window) #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info) #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info) #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 #define OMAPFB_CAPS_PANEL_MASK 0xff000000 #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000 #define OMAPFB_CAPS_TEARSYNC 0x00002000 #define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000 #define OMAPFB_CAPS_PLANE_SCALE 0x00008000 #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000 #define OMAPFB_CAPS_WINDOW_SCALE 0x00020000 #define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000 #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000 /* Values from DSP must map to lower 16-bits */ #define OMAPFB_FORMAT_MASK 0x00ff #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100 #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200 #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400 #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800 #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000 #define OMAPFB_EVENT_READY 1 #define OMAPFB_EVENT_DISABLED 2 #define OMAPFB_MEMTYPE_SDRAM 0 #define OMAPFB_MEMTYPE_SRAM 1 #define OMAPFB_MEMTYPE_MAX 1 enum omapfb_color_format { OMAPFB_COLOR_RGB565 = 0, OMAPFB_COLOR_YUV422, OMAPFB_COLOR_YUV420, OMAPFB_COLOR_CLUT_8BPP, OMAPFB_COLOR_CLUT_4BPP, OMAPFB_COLOR_CLUT_2BPP, OMAPFB_COLOR_CLUT_1BPP, OMAPFB_COLOR_RGB444, OMAPFB_COLOR_YUY422, }; struct omapfb_update_window { u32 x, y; u32 width, height; u32 format; u32 out_x, out_y; u32 out_width, out_height; u32 reserved[8]; }; struct omapfb_update_window_old { u32 x, y; u32 width, height; u32 format; }; enum omapfb_plane { OMAPFB_PLANE_GFX = 0, OMAPFB_PLANE_VID1, OMAPFB_PLANE_VID2, }; enum omapfb_channel_out { OMAPFB_CHANNEL_OUT_LCD = 0, OMAPFB_CHANNEL_OUT_DIGIT, }; struct omapfb_plane_info { u32 pos_x; u32 pos_y; u8 enabled; u8 channel_out; u8 mirror; u8 reserved1; u32 out_width; u32 out_height; u32 reserved2[12]; }; struct omapfb_mem_info { u32 size; u8 type; u8 reserved[3]; }; struct omapfb_caps { u32 ctrl; u32 plane_color; u32 wnd_color; }; enum omapfb_color_key_type { OMAPFB_COLOR_KEY_DISABLED = 0, OMAPFB_COLOR_KEY_GFX_DST, OMAPFB_COLOR_KEY_VID_SRC, }; struct omapfb_color_key { u8 channel_out; u32 background; u32 trans_key; u8 key_type; }; enum omapfb_update_mode { OMAPFB_UPDATE_DISABLED = 0, OMAPFB_AUTO_UPDATE, OMAPFB_MANUAL_UPDATE }; #endif /* __OMAPFB_H */ DirectFB-1.2.10/gfxdrivers/omap/omap.h0000644000175000017500000000265611245562152014376 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef OMAP_H #define OMAP_H #include #include D_DEBUG_DOMAIN( omap, "OMAP", "TI OMAP gfx driver" ); #if 0 typedef struct { } OmapDeviceData; typedef struct { } OmapDriverData; #endif extern DisplayLayerFuncs omapPrimaryLayerFuncs; #endif DirectFB-1.2.10/gfxdrivers/matrox/0000777000175000017500000000000011307522570013721 500000000000000DirectFB-1.2.10/gfxdrivers/matrox/matrox.c0000644000175000017500000030775211245562152015332 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( matrox ) #include "regs.h" #include "mmio.h" #include "matrox.h" #include "matrox_3d.h" #include "matrox_state.h" static bool matroxFillRectangle ( void *drv, void *dev, DFBRectangle *rect ); static bool matroxFillRectangle_2P ( void *drv, void *dev, DFBRectangle *rect ); static bool matroxFillRectangle_3P ( void *drv, void *dev, DFBRectangle *rect ); static bool matroxFillRectangle_422( void *drv, void *dev, DFBRectangle *rect ); static bool matroxBlit2D ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_2P ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_3P ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_422( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_Old( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit3D ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit3D_2P ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit3D_3P ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit3D_422( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxStretchBlit ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxStretchBlit_2P ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxStretchBlit_3P ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxStretchBlit_422( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxBlit2D_F ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_2P_F ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_3P_F ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_422_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit2D_Old_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxBlit3D_F ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool matroxStretchBlit_F ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxStretchBlit_2P_F ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxStretchBlit_3P_F ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool matroxStretchBlit_422_F( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); /* Millennium */ #define MATROX_2064W_DRAWING_FLAGS (DSDRAW_SRC_PREMULTIPLY) #define MATROX_2064W_BLITTING_FLAGS (DSBLIT_NOFX) #define MATROX_2064W_DRAWING_FUNCTIONS (DFXL_FILLRECTANGLE | \ DFXL_DRAWRECTANGLE | \ DFXL_DRAWLINE | \ DFXL_FILLTRIANGLE) #define MATROX_2064W_BLITTING_FUNCTIONS (DFXL_BLIT) /* Old cards (Mystique, Millennium II) */ #define MATROX_OLD_DRAWING_FLAGS (DSDRAW_SRC_PREMULTIPLY) #define MATROX_OLD_BLITTING_FLAGS (DSBLIT_SRC_COLORKEY) #define MATROX_OLD_DRAWING_FUNCTIONS (DFXL_FILLRECTANGLE | \ DFXL_DRAWRECTANGLE | \ DFXL_DRAWLINE | \ DFXL_FILLTRIANGLE) #define MATROX_OLD_BLITTING_FUNCTIONS (DFXL_BLIT) /* G100 */ #define MATROX_G100_DRAWING_FLAGS (DSDRAW_SRC_PREMULTIPLY) #define MATROX_G100_BLITTING_FLAGS (DSBLIT_SRC_COLORKEY | \ /*DSBLIT_BLEND_ALPHACHANNEL |*/ \ /*DSBLIT_BLEND_COLORALPHA |*/ \ DSBLIT_COLORIZE | \ DSBLIT_SRC_PREMULTCOLOR) #define MATROX_G100_DRAWING_FUNCTIONS (DFXL_FILLRECTANGLE | \ DFXL_DRAWRECTANGLE | \ DFXL_DRAWLINE | \ DFXL_FILLTRIANGLE) #define MATROX_G100_BLITTING_FUNCTIONS (DFXL_BLIT | \ DFXL_STRETCHBLIT) /* G200/G400 */ #define MATROX_G200G400_DRAWING_FLAGS (DSDRAW_BLEND | \ DSDRAW_SRC_PREMULTIPLY) #define MATROX_G200G400_BLITTING_FLAGS (DSBLIT_SRC_COLORKEY | \ DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | \ DSBLIT_DEINTERLACE | \ DSBLIT_SRC_PREMULTIPLY | \ DSBLIT_SRC_PREMULTCOLOR) #define MATROX_G200G400_DRAWING_FUNCTIONS (DFXL_FILLRECTANGLE | \ DFXL_DRAWRECTANGLE | \ DFXL_DRAWLINE | \ DFXL_FILLTRIANGLE) #define MATROX_G200G400_BLITTING_FUNCTIONS (DFXL_BLIT | \ DFXL_STRETCHBLIT | \ DFXL_TEXTRIANGLES) #define MATROX_USE_TMU(state, accel) \ ((state)->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | \ DSBLIT_DEINTERLACE | \ DSBLIT_SRC_PREMULTIPLY | \ DSBLIT_SRC_PREMULTCOLOR) || \ ((state)->destination->config.format != (state)->source->config.format && \ (state)->destination->config.format != DSPF_I420 && \ (state)->destination->config.format != DSPF_YV12) || \ (accel) & (DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES)) #define MATROX_USE_3D(state, accel) \ ((DFB_DRAWING_FUNCTION( accel ) && ((state)->drawingflags & DSDRAW_BLEND)) || \ (DFB_BLITTING_FUNCTION( accel ) && MATROX_USE_TMU( state, accel ))) static void matroxEngineReset( void *drv, void *dev ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; mga_waitidle( mdrv, mdev ); mga_waitfifo( mdrv, mdev, 11 ); mga_out32( mmio, 0, TDUALSTAGE0 ); /* multi texture registers */ mga_out32( mmio, 0, TDUALSTAGE1 ); mga_out32( mmio, 0, ALPHAXINC ); /* alpha increments */ mga_out32( mmio, 0, ALPHAYINC ); mga_out32( mmio, 0, DR6 ); /* red increments */ mga_out32( mmio, 0, DR7 ); mga_out32( mmio, 0, DR10 ); /* green increments */ mga_out32( mmio, 0, DR11 ); mga_out32( mmio, 0, DR14 ); /* blue increments */ mga_out32( mmio, 0, DR15 ); mga_out32( mmio, 0, BCOL ); mga_waitfifo( mdrv, mdev, 5 ); mga_out32( mmio, 0, TMR1 ); mga_out32( mmio, 0, TMR2 ); mga_out32( mmio, 0, TMR4 ); mga_out32( mmio, 0, TMR5 ); mga_out32( mmio, 0x100000, TMR8 ); /* * Plane write mask is not supported on G100 with SDRAM. * The chip goes crazy if PLNWT is written. */ if (mdrv->accelerator != FB_ACCEL_MATROX_MGAG100) { mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, 0xFFFFFFFF, PLNWT ); } } static DFBResult matroxEngineSync( void *drv, void *dev ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; mga_waitidle( mdrv, mdev ); return DFB_OK; } static void matroxFlushTextureCache( void *drv, void *dev ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mdrv->mmio_base, 0, TEXORG1 ); } static void matroxFlushReadCache( void *drv, void *dev ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; mga_out8( mdrv->mmio_base, 0, CACHEFLUSH ); } static bool matrox_check_blend( MatroxDeviceData *mdev, CardState *state ) { switch (state->src_blend) { case DSBF_SRCCOLOR: case DSBF_INVSRCCOLOR: return false; case DSBF_SRCALPHASAT: if (!mdev->g550_matrox && state->dst_blend == DSBF_ZERO) return false; default: break; } switch (state->dst_blend) { case DSBF_DESTCOLOR: case DSBF_INVDESTCOLOR: case DSBF_SRCALPHASAT: return false; default: break; } return true; } static void matrox2064WCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { /* FIXME: 24bit support */ switch (state->destination->config.format) { case DSPF_LUT8: if (DFB_BLITTING_FUNCTION( accel )) return; case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_A8: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MATROX_2064W_DRAWING_FLAGS) return; state->accel |= MATROX_2064W_DRAWING_FUNCTIONS; } else { if (state->source->config.format != state->destination->config.format) return; if (state->blittingflags & ~MATROX_2064W_BLITTING_FLAGS) return; state->accel |= MATROX_2064W_BLITTING_FUNCTIONS; } } static void matroxOldCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { /* FIXME: 24bit support */ switch (state->destination->config.format) { case DSPF_LUT8: if (DFB_BLITTING_FUNCTION( accel )) return; case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_A8: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MATROX_OLD_DRAWING_FLAGS) return; state->accel |= MATROX_OLD_DRAWING_FUNCTIONS; } else { if (state->source->config.format != state->destination->config.format) return; if (state->blittingflags & ~MATROX_OLD_BLITTING_FLAGS) return; state->accel |= MATROX_OLD_BLITTING_FUNCTIONS; } } static void matroxG100CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { /* FIXME: 24bit support */ switch (state->destination->config.format) { case DSPF_LUT8: if (DFB_BLITTING_FUNCTION( accel )) return; case DSPF_A8: case DSPF_RGB444: case DSPF_ARGB4444: if (DFB_BLITTING_FUNCTION( accel ) && MATROX_USE_TMU( state, accel )) return; case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MATROX_G100_DRAWING_FLAGS) return; state->accel |= MATROX_G100_DRAWING_FUNCTIONS; } else { if (state->blittingflags & ~MATROX_G100_BLITTING_FLAGS) return; /* using the texture mapping unit? */ if (MATROX_USE_TMU( state, accel )) { int max_width = 2048; /* TMU has no 32bit support */ switch (state->source->config.format) { case DSPF_LUT8: case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: break; default: return; } /* Interleaved source -> pitch must be doubled */ if ((state->source->config.caps & (DSCAPS_INTERLACED | DSCAPS_SEPARATED)) == DSCAPS_INTERLACED && (state->destination->config.caps & DSCAPS_INTERLACED || state->blittingflags & DSBLIT_DEINTERLACE)) max_width = 1024; /* TMU limits */ if (state->source->config.size.w < 8 || state->source->config.size.h < 8 || state->source->config.size.w > max_width || state->source->config.size.h > 2048) return; state->accel |= MATROX_G100_BLITTING_FUNCTIONS; } else { /* source and destination formats equal, no stretching is done */ state->accel |= accel; } } } static void matroxG200CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { MatroxDeviceData *mdev = (MatroxDeviceData*) dev; /* FIXME: 24bit support */ switch (state->destination->config.format) { case DSPF_NV12: case DSPF_NV21: if ((accel & DFXL_FILLRECTANGLE && !state->drawingflags) || (accel & DFXL_BLIT && !state->blittingflags && state->source->config.format == state->destination->config.format)) break; return; case DSPF_YUY2: if ((accel & DFXL_FILLRECTANGLE && !state->drawingflags) || (accel & (DFXL_BLIT | DFXL_STRETCHBLIT) && !(state->blittingflags & ~DSBLIT_DEINTERLACE) && state->source->config.format == state->destination->config.format)) break; return; case DSPF_LUT8: if (DFB_BLITTING_FUNCTION( accel )) return; case DSPF_A8: case DSPF_RGB444: case DSPF_ARGB4444: if (MATROX_USE_3D( state, accel )) return; case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MATROX_G200G400_DRAWING_FLAGS) return; if (state->drawingflags & DSDRAW_BLEND && !matrox_check_blend( mdev, state )) return; state->accel |= MATROX_G200G400_DRAWING_FUNCTIONS; } else { bool use_tmu = MATROX_USE_TMU( state, accel ); switch (state->source->config.format) { case DSPF_NV12: case DSPF_NV21: if (state->destination->config.format != state->source->config.format) return; break; case DSPF_A8: if (use_tmu) return; case DSPF_LUT8: case DSPF_RGB332: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_YUY2: break; default: return; } if (state->blittingflags & ~MATROX_G200G400_BLITTING_FLAGS) return; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { if (!matrox_check_blend( mdev, state )) return; if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY && (state->src_blend != DSBF_ONE || (state->dst_blend != DSBF_INVSRCALPHA && state->dst_blend != DSBF_INVSRCCOLOR))) return; } else { if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) return; } if (use_tmu) { int max_width = 2048; /* Interleaved source -> pitch must be doubled */ if ((state->source->config.caps & (DSCAPS_INTERLACED | DSCAPS_SEPARATED)) == DSCAPS_INTERLACED && (state->destination->config.caps & DSCAPS_INTERLACED || state->blittingflags & DSBLIT_DEINTERLACE) && state->destination->config.format != DSPF_YUY2) max_width = 1024; if (state->source->config.size.w < 8 || state->source->config.size.h < 8 || state->source->config.size.w > max_width || state->source->config.size.h > 2048) return; state->accel |= MATROX_G200G400_BLITTING_FUNCTIONS; } else { /* source and destination formats equal, no stretching is done */ state->accel |= accel; } } } static void matroxG400CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { MatroxDeviceData *mdev = (MatroxDeviceData*) dev; /* FIXME: 24bit support */ switch (state->destination->config.format) { case DSPF_I420: case DSPF_YV12: if ((accel & DFXL_FILLRECTANGLE && !state->drawingflags) || (accel & (DFXL_BLIT | DFXL_STRETCHBLIT) && !(state->blittingflags & ~DSBLIT_DEINTERLACE) && (state->source->config.format == DSPF_I420 || state->source->config.format == DSPF_YV12))) break; return; case DSPF_NV12: case DSPF_NV21: case DSPF_YUY2: case DSPF_UYVY: if ((accel & DFXL_FILLRECTANGLE && !state->drawingflags) || (accel & (DFXL_BLIT | DFXL_STRETCHBLIT) && !(state->blittingflags & ~DSBLIT_DEINTERLACE) && state->source->config.format == state->destination->config.format)) break; return; case DSPF_LUT8: case DSPF_ALUT44: if (DFB_BLITTING_FUNCTION( accel )) return; case DSPF_A8: case DSPF_RGB444: case DSPF_ARGB4444: if (MATROX_USE_3D( state, accel )) return; case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MATROX_G200G400_DRAWING_FLAGS) return; if (state->drawingflags & DSDRAW_BLEND && !matrox_check_blend( mdev, state )) return; state->accel |= MATROX_G200G400_DRAWING_FUNCTIONS; } else { bool use_tmu = MATROX_USE_TMU( state, accel ); switch (state->source->config.format) { case DSPF_I420: case DSPF_YV12: if (state->destination->config.format != DSPF_I420 && state->destination->config.format != DSPF_YV12) return; break; case DSPF_NV12: case DSPF_NV21: if (state->destination->config.format != state->source->config.format) return; break; case DSPF_RGB332: if (use_tmu) return; case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_A8: case DSPF_YUY2: case DSPF_UYVY: break; default: return; } if (state->blittingflags & ~MATROX_G200G400_BLITTING_FLAGS) return; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { if (!matrox_check_blend( mdev, state )) return; if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY && (state->src_blend != DSBF_ONE || (state->dst_blend != DSBF_INVSRCALPHA && state->dst_blend != DSBF_INVSRCCOLOR))) return; } else { if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) return; } if (use_tmu) { int max_width = 2048; /* Interleaved source -> pitch must be doubled */ if ((state->source->config.caps & (DSCAPS_INTERLACED | DSCAPS_SEPARATED)) == DSCAPS_INTERLACED && (state->destination->config.caps & DSCAPS_INTERLACED || state->blittingflags & DSBLIT_DEINTERLACE) && state->destination->config.format != DSPF_YUY2 && state->destination->config.format != DSPF_UYVY) max_width = 1024; if (state->source->config.size.w < 8 || state->source->config.size.h < 8 || state->source->config.size.w > max_width || state->source->config.size.h > 2048) return; state->accel |= MATROX_G200G400_BLITTING_FUNCTIONS; } else { /* source and destination formats equal, no stretching is done */ state->accel |= accel; } } } static void matroxSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; bool prev_blit_fields = mdev->blit_fields; if (state->mod_hw == SMF_ALL) { mdev->valid = 0; /* * Work around TMU bug(?), under some unclear circumstances * the TMU's read address (src & dst) gets corrupted (negative offset * applied to written values) until soft reset occured. */ if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG200) mga_waitidle( mdrv, mdev ); } else if (state->mod_hw) { if (state->mod_hw & SMF_COLOR) MGA_INVALIDATE( m_drawColor | m_blitColor | m_color ); if (state->mod_hw & SMF_CLIP) MGA_INVALIDATE( m_clip ); if (state->mod_hw & SMF_DESTINATION) MGA_INVALIDATE( m_destination | m_clip | m_color | m_Source | m_source ); if (state->mod_hw & SMF_SOURCE) MGA_INVALIDATE( m_Source | m_source | m_SrcKey | m_srckey | m_blitBlend ); else if (state->mod_hw & SMF_SRC_COLORKEY) MGA_INVALIDATE( m_SrcKey | m_srckey ); if (state->mod_hw & SMF_DRAWING_FLAGS) MGA_INVALIDATE( m_drawColor | m_color ); if (state->mod_hw & SMF_BLITTING_FLAGS) MGA_INVALIDATE( m_Source | m_SrcKey | m_blitBlend | m_blitColor ); if (state->mod_hw & (SMF_DST_BLEND | SMF_SRC_BLEND)) MGA_INVALIDATE( m_blitBlend | m_drawBlend ); } switch (accel) { case DFXL_BLIT: mdev->blit_deinterlace = state->blittingflags & DSBLIT_DEINTERLACE; mdev->blit_fields = !mdev->blit_deinterlace && state->source->config.caps & DSCAPS_INTERLACED && state->destination->config.caps & DSCAPS_INTERLACED && (state->source->config.caps & DSCAPS_SEPARATED || state->destination->config.caps & DSCAPS_SEPARATED); break; case DFXL_STRETCHBLIT: mdev->blit_deinterlace = state->blittingflags & DSBLIT_DEINTERLACE; mdev->blit_fields = !mdev->blit_deinterlace && state->source->config.caps & DSCAPS_INTERLACED && state->destination->config.caps & DSCAPS_INTERLACED; break; default: mdev->blit_deinterlace = 0; mdev->blit_fields = 0; } if (prev_blit_fields != mdev->blit_fields) MGA_INVALIDATE( m_destination | m_source | m_Source ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: case DFXL_FILLTRIANGLE: if (state->drawingflags & DSDRAW_BLEND) { mdev->draw_blend = 1; matrox_validate_drawColor( mdrv, mdev, state ); matrox_validate_drawBlend( mdrv, mdev, state ); } else { mdev->draw_blend = 0; matrox_validate_color( mdrv, mdev, state ); } switch (state->destination->config.format) { case DSPF_YUY2: case DSPF_UYVY: funcs->FillRectangle = matroxFillRectangle_422; state->set = DFXL_FILLRECTANGLE; break; case DSPF_I420: case DSPF_YV12: funcs->FillRectangle = matroxFillRectangle_3P; state->set = DFXL_FILLRECTANGLE; break; case DSPF_NV12: case DSPF_NV21: funcs->FillRectangle = matroxFillRectangle_2P; state->set = DFXL_FILLRECTANGLE; break; default: funcs->FillRectangle = matroxFillRectangle; state->set = DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE | DFXL_FILLTRIANGLE; } break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: mdev->blit_src_colorkey = state->blittingflags & DSBLIT_SRC_COLORKEY; if (MATROX_USE_TMU( state, accel )) { if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) matrox_validate_blitColor( mdrv, mdev, state ); switch (state->destination->config.format) { case DSPF_YUY2: case DSPF_UYVY: if (mdev->blit_fields) { funcs->Blit = NULL; funcs->StretchBlit = matroxStretchBlit_422_F; } else { funcs->Blit = matroxBlit3D_422; funcs->StretchBlit = matroxStretchBlit_422; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; break; case DSPF_I420: case DSPF_YV12: if (mdev->blit_fields) { funcs->Blit = NULL; funcs->StretchBlit = matroxStretchBlit_3P_F; } else { funcs->Blit = matroxBlit3D_3P; funcs->StretchBlit = matroxStretchBlit_3P; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; break; case DSPF_NV12: case DSPF_NV21: if (mdev->blit_fields) { funcs->Blit = NULL; funcs->StretchBlit = matroxStretchBlit_2P_F; } else { funcs->Blit = matroxBlit3D_2P; funcs->StretchBlit = matroxStretchBlit_2P; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; break; default: if (mdev->blit_fields) { funcs->Blit = matroxBlit3D_F; funcs->StretchBlit = matroxStretchBlit_F; } else { funcs->Blit = matroxBlit3D; funcs->StretchBlit = matroxStretchBlit; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES; } matrox_validate_blitBlend( mdrv, mdev, state ); matrox_validate_Source( mdrv, mdev, state ); matrox_validate_SrcKey( mdrv, mdev, state ); } else { switch (state->destination->config.format) { case DSPF_YUY2: case DSPF_UYVY: funcs->Blit = mdev->blit_fields ? matroxBlit2D_422_F : matroxBlit2D_422; break; case DSPF_I420: case DSPF_YV12: funcs->Blit = mdev->blit_fields ? matroxBlit2D_3P_F : matroxBlit2D_3P; break; case DSPF_NV12: case DSPF_NV21: funcs->Blit = mdev->blit_fields ? matroxBlit2D_2P_F : matroxBlit2D_2P; break; default: if (mdev->old_matrox) funcs->Blit = mdev->blit_fields ? matroxBlit2D_Old_F : matroxBlit2D_Old; else funcs->Blit = mdev->blit_fields ? matroxBlit2D_F : matroxBlit2D; } matrox_validate_source( mdrv, mdev, state ); if (mdev->blit_src_colorkey) matrox_validate_srckey( mdrv, mdev, state ); state->set = DFXL_BLIT; } break; default: D_BUG( "unexpected drawing/blitting function!" ); break; } matrox_validate_destination( mdrv, mdev, state ); if (!MGA_IS_VALID( m_clip )) { mdev->clip = state->clip; if (state->destination->config.format == DSPF_YUY2 || state->destination->config.format == DSPF_UYVY) { mdev->clip.x1 /= 2; mdev->clip.x2 /= 2; } if (mdev->blit_fields) { mdev->clip.y1 /= 2; mdev->clip.y2 /= 2; } matrox_set_clip( mdrv, mdev, &mdev->clip ); MGA_VALIDATE( m_clip ); } state->mod_hw = 0; } /******************************************************************************/ static void matrox_fill_rectangle( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRectangle *rect ) { volatile u8 *mmio = mdrv->mmio_base; mga_waitfifo( mdrv, mdev, 3 ); if (mdev->draw_blend) mga_out32( mmio, BOP_COPY | SHFTZERO | SGNZERO | ARZERO | ATYPE_I | OP_TRAP, DWGCTL ); else mga_out32( mmio, TRANSC | BOP_COPY | SHFTZERO | SGNZERO | ARZERO | SOLID | mdev->atype_blk_rstr | OP_TRAP, DWGCTL ); mga_out32( mmio, (RS16(rect->x + rect->w) << 16) | RS16(rect->x), FXBNDRY ); mga_out32( mmio, (RS16(rect->y) << 16) | RS16(rect->h), YDSTLEN | EXECUTE ); } static bool matroxFillRectangle( void *drv, void *dev, DFBRectangle *rect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matrox_fill_rectangle( mdrv, mdev, rect ); return true; } static bool matroxFillRectangle_2P( void *drv, void *dev, DFBRectangle *rect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; matrox_fill_rectangle( mdrv, mdev, rect ); rect->x /= 2; rect->y /= 2; rect->w = (rect->w + 1) / 2; rect->h = (rect->h + 1) / 2; /* CbCr plane */ mga_waitfifo( mdrv, mdev, 7 ); mga_out32( mmio, PW16 | NODITHER, MACCESS ); mga_out32( mmio, mdev->color[1], FCOL ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, mdev->dst_offset[0][1], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1 / 4) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2 / 4) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); matrox_fill_rectangle( mdrv, mdev, rect ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, PW8 | BYPASS332 | NODITHER, MACCESS ); mga_out32( mmio, mdev->color[0], FCOL ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); return true; } static bool matroxFillRectangle_3P( void *drv, void *dev, DFBRectangle *rect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; matrox_fill_rectangle( mdrv, mdev, rect ); rect->x /= 2; rect->y /= 2; rect->w = (rect->w + 1) / 2; rect->h = (rect->h + 1) / 2; /* Cb plane */ mga_waitfifo( mdrv, mdev, 6 ); mga_out32( mmio, mdev->color[1], FCOL ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, mdev->dst_offset[0][1], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1 / 4) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2 / 4) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); matrox_fill_rectangle( mdrv, mdev, rect ); /* Cr plane */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->color[2], FCOL ); mga_out32( mmio, mdev->dst_offset[0][2], DSTORG ); matrox_fill_rectangle( mdrv, mdev, rect ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 3 ); mga_out32( mmio, mdev->color[0], FCOL ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); return true; } static bool matroxFillRectangle_422( void *drv, void *dev, DFBRectangle *rect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; rect->x /= 2; rect->w = (rect->w + 1) / 2; matrox_fill_rectangle( mdrv, mdev, rect ); return true; } static bool matroxDrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; mga_waitfifo( mdrv, mdev, 6 ); if (mdev->draw_blend) mga_out32( mmio, BLTMOD_BFCOL | BOP_COPY | ATYPE_I | OP_AUTOLINE_OPEN, DWGCTL ); else mga_out32( mmio, BLTMOD_BFCOL | BOP_COPY | SHFTZERO | SOLID | ATYPE_RSTR | OP_AUTOLINE_OPEN, DWGCTL ); mga_out32(mmio, RS16(rect->x) | (RS16(rect->y) << 16), XYSTRT); mga_out32(mmio, RS16(rect->x + rect->w-1) | (RS16(rect->y) << 16), XYEND | EXECUTE); mga_out32(mmio, RS16(rect->x + rect->w-1) | (RS16(rect->y + rect->h-1) << 16), XYEND | EXECUTE); mga_out32(mmio, RS16(rect->x) | (RS16(rect->y + rect->h-1) << 16), XYEND | EXECUTE); mga_out32(mmio, RS16(rect->x) | (RS16(rect->y) << 16), XYEND | EXECUTE); return true; } static bool matroxDrawLine( void *drv, void *dev, DFBRegion *line ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; mga_waitfifo( mdrv, mdev, 3 ); if (mdev->draw_blend) mga_out32( mmio, BLTMOD_BFCOL | BOP_COPY | ATYPE_I | OP_AUTOLINE_CLOSE, DWGCTL ); else mga_out32( mmio, BLTMOD_BFCOL | BOP_COPY | SHFTZERO | SOLID | ATYPE_RSTR | OP_AUTOLINE_CLOSE, DWGCTL ); mga_out32( mmio, RS16(line->x1) | (RS16(line->y1) << 16), XYSTRT ); mga_out32( mmio, RS16(line->x2) | (RS16(line->y2) << 16), XYEND | EXECUTE ); return true; } /******************************************************************************/ static void matrox_fill_trapezoid( MatroxDriverData *mdrv, MatroxDeviceData *mdev, int Xl, int Xr, int X2l, int X2r, int Y, int dY ) { volatile u8 *mmio = mdrv->mmio_base; int dxl = X2l - Xl; int dxr = ++X2r - ++Xr; int dXl = ABS(dxl); int dXr = ABS(dxr); u32 sgn = 0; mga_waitfifo( mdrv, mdev, 6 ); mga_out32( mmio, dY, AR0 ); mga_out32( mmio, - dXl, AR1 ); mga_out32( mmio, - dXl, AR2 ); mga_out32( mmio, - dXr, AR4 ); mga_out32( mmio, - dXr, AR5 ); mga_out32( mmio, dY, AR6 ); if (dxl < 0) sgn |= SDXL; if (dxr < 0) sgn |= SDXR; mga_waitfifo( mdrv, mdev, 3 ); mga_out32( mmio, sgn, SGN ); mga_out32( mmio, (RS16(Xr) << 16) | RS16(Xl), FXBNDRY ); mga_out32( mmio, (RS16(Y) << 16) | RS16(dY), YDSTLEN | EXECUTE ); } static bool matroxFillTriangle( void *drv, void *dev, DFBTriangle *tri ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; mga_waitfifo( mdrv, mdev, 1 ); if (mdev->draw_blend) mga_out32( mmio, BOP_COPY | SHFTZERO | ATYPE_I | OP_TRAP, DWGCTL ); else mga_out32( mmio, TRANSC | BOP_COPY | SHFTZERO | SOLID | mdev->atype_blk_rstr | OP_TRAP, DWGCTL ); dfb_sort_triangle( tri ); if (tri->y2 == tri->y3) { matrox_fill_trapezoid( mdrv, mdev, tri->x1, tri->x1, MIN( tri->x2, tri->x3 ), MAX( tri->x2, tri->x3 ), tri->y1, tri->y3 - tri->y1 + 1 ); } else if (tri->y1 == tri->y2) { matrox_fill_trapezoid( mdrv, mdev, MIN( tri->x1, tri->x2 ), MAX( tri->x1, tri->x2 ), tri->x3, tri->x3, tri->y1, tri->y3 - tri->y1 + 1 ); } else { int majDx = tri->x3 - tri->x1; int majDy = tri->y3 - tri->y1; int topDx = tri->x2 - tri->x1; int topDy = tri->y2 - tri->y1; int botDy = tri->y3 - tri->y2; int topXperY = (topDx << 20) / topDy; int X2a = tri->x1 + (((topXperY * topDy) + (1<<19)) >> 20); int majXperY = (majDx << 20) / majDy; int majX2 = tri->x1 + (((majXperY * topDy) + (1<<19)) >> 20); int majX2a = majX2 - ((majXperY + (1<<19)) >> 20); matrox_fill_trapezoid( mdrv, mdev, tri->x1, tri->x1, MIN( X2a, majX2a ), MAX( X2a, majX2a ), tri->y1, topDy ); matrox_fill_trapezoid( mdrv, mdev, MIN( tri->x2, majX2 ), MAX( tri->x2, majX2 ), tri->x3, tri->x3, tri->y2, botDy + 1 ); } return true; } /******************************************************************************/ static void matroxDoBlit2D_Old( MatroxDriverData *mdrv, MatroxDeviceData *mdev, int sx, int sy, int dx, int dy, int w, int h, int pitch, int offset ) { volatile u8 *mmio = mdrv->mmio_base; u32 dwgctl = BLTMOD_BFCOL | BOP_COPY | SHFTZERO | ATYPE_RSTR | OP_BITBLT; u32 start, end; u32 sgn = 0; s32 pixelpitch = pitch; if (sx < dx) sgn |= BLIT_LEFT; if (sy < dy) sgn |= BLIT_UP; if (sgn & BLIT_UP) { sy += h - 1; dy += h - 1; } start = sy * pixelpitch + sx + offset; w--; end = w; if (sgn & BLIT_LEFT) { start += w; end = -end; } if (sgn & BLIT_UP) pixelpitch = -pixelpitch; if (mdev->blit_src_colorkey) dwgctl |= TRANSC; mga_waitfifo( mdrv, mdev, 7 ); mga_out32( mmio, dwgctl, DWGCTL ); mga_out32( mmio, pixelpitch & 0x3FFFFF, AR5 ); mga_out32( mmio, start & 0xFFFFFF, AR3 ); mga_out32( mmio, end & 0x3FFFF, AR0 ); mga_out32( mmio, sgn, SGN ); mga_out32( mmio, (RS16(dx+w) << 16) | RS16(dx), FXBNDRY ); mga_out32( mmio, (RS16(dy) << 16) | RS16(h), YDSTLEN | EXECUTE ); } static bool matroxBlit2D_Old( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matroxDoBlit2D_Old( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch, mdev->src_offset[0][0] ); return true; } static bool matroxBlit2D_Old_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; src_field = rect->y & 1; dst_field = dy & 1; /* fisrt field */ mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlit2D_Old( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch, mdev->src_offset[src_field][0] ); /* Second field */ mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlit2D_Old( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch, mdev->src_offset[!src_field][0] ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); return true; } /******************************************************************************/ static void matroxDoBlit2D( MatroxDriverData *mdrv, MatroxDeviceData *mdev, int sx, int sy, int dx, int dy, int w, int h, int pitch ) { volatile u8 *mmio = mdrv->mmio_base; u32 dwgctl = BLTMOD_BFCOL | BOP_COPY | SHFTZERO | ATYPE_RSTR | OP_BITBLT; u32 start, end; u32 sgn = 0; s32 pixelpitch = pitch; if (sx < dx) sgn |= BLIT_LEFT; if (sy < dy) sgn |= BLIT_UP; if (sgn & BLIT_UP) { sy += h - 1; dy += h - 1; } start = end = sy * pixelpitch + sx; w--; if (sgn & BLIT_LEFT) start += w; else end += w; if (sgn & BLIT_UP) pixelpitch = -pixelpitch; if (mdev->blit_src_colorkey) dwgctl |= TRANSC; mga_waitfifo( mdrv, mdev, 7 ); mga_out32( mmio, dwgctl, DWGCTL ); mga_out32( mmio, pixelpitch & 0x3FFFFF, AR5 ); mga_out32( mmio, start & 0xFFFFFF, AR3 ); mga_out32( mmio, end & 0x3FFFFF, AR0 ); mga_out32( mmio, sgn, SGN ); mga_out32( mmio, (RS16(dx+w) << 16) | RS16(dx), FXBNDRY ); mga_out32( mmio, (RS16(dy) << 16) | RS16(h), YDSTLEN | EXECUTE ); } static bool matroxBlit2D( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch ); return true; } static bool matroxBlit2D_2P( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch ); rect->x &= ~1; rect->y /= 2; rect->w = (rect->w + 1) & ~1; rect->h = (rect->h + 1) / 2; dx &= ~1; dy /= 2; /* CbCr plane */ mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, mdev->src_offset[0][1], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][1], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1 / 2) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2 / 2) & 0xFFFFFF, YBOT ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2) & 0xFFFFFF, YBOT ); return true; } static bool matroxBlit2D_3P( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch ); rect->x /= 2; rect->y /= 2; rect->w = (rect->w + 1) / 2; rect->h = (rect->h + 1) / 2; dx /= 2; dy /= 2; /* Cb plane */ mga_waitfifo( mdrv, mdev, 6 ); mga_out32( mmio, mdev->src_offset[0][1], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][1], DSTORG ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1 / 4) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2 / 4) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch/2 ); /* Cr plane */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[0][2], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][2], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch/2 ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 3 ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); mga_out32( mmio, mdev->dst_pitch, PITCH ); matrox_set_clip( mdrv, mdev, &mdev->clip ); return true; } static bool matroxBlit2D_422( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; dx /= 2; rect->x /= 2; rect->w = (rect->w + 1) / 2; matroxDoBlit2D( mdrv, mdev, rect->x, rect->y, dx, dy, rect->w, rect->h, mdev->src_pitch ); return true; } static bool matroxBlit2D_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; src_field = rect->y & 1; dst_field = dy & 1; /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); return true; } static bool matroxBlit2D_2P_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; src_field = rect->y & 1; dst_field = dy & 1; /* Y plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch ); /* Subsampling */ rect->x &= ~1; rect->y /= 2; rect->w = (rect->w + 1) & ~1; rect->h = (rect->h + 1) / 2; dx &= ~1; dy /= 2; mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1/2) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2/2) & 0xFFFFFF, YBOT ); /* CbCr plane */ /* First field */ mga_out32( mmio, mdev->src_offset[src_field][1], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][1], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][1], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][1], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2) & 0xFFFFFF, YBOT ); return true; } static bool matroxBlit2D_3P_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; src_field = rect->y & 1; dst_field = dy & 1; /* Y plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch ); /* Subsampling */ rect->x /= 2; rect->y /= 2; rect->w = (rect->w + 1) / 2; rect->h = (rect->h + 1) / 2; dx /= 2; dy /= 2; mga_waitfifo( mdrv, mdev, 6 ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, (mdev->dst_pitch/2 * mdev->clip.y1/2) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch/2 * mdev->clip.y2/2) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); /* Cb plane */ /* First field */ mga_out32( mmio, mdev->src_offset[src_field][1], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][1], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch/2 ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][1], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][1], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch/2 ); /* Cr plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][2], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][2], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch/2 ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][2], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][2], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch/2 ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 3 ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); return true; } static bool matroxBlit2D_422_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; src_field = rect->y & 1; dst_field = dy & 1; dx /= 2; rect->x /= 2; rect->w = (rect->w + 1) / 2; /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, rect->y/2, dx, dy/2, rect->w, (rect->h+1)/2, mdev->src_pitch ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlit2D( mdrv, mdev, rect->x, (rect->y+1)/2, dx, (dy+1)/2, rect->w, rect->h/2, mdev->src_pitch ); mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); return true; } /******************************************************************************/ static inline void matroxDoBlitTMU( MatroxDriverData *mdrv, MatroxDeviceData *mdev, int sx, int sy, int dx, int dy, int sw, int sh, int dw, int dh, int w2, int h2, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; s32 startx, starty, incx, incy; if (mdev->blit_deinterlace) { sy /= 2; sh /= 2; } incx = (sw << (20 - w2)) / dw; incy = (sh << (20 - h2)) / dh; startx = sx << (20 - w2); starty = sy << (20 - h2); if (mdev->blit_deinterlace && !mdev->field) starty += (0x80000 >> h2); mga_waitfifo( mdrv, mdev, 8); mga_out32( mmio, BOP_COPY | SHFTZERO | SGNZERO | ARZERO | ATYPE_I | OP_TEXTURE_TRAP, DWGCTL ); if (filter) mga_out32( mmio, (0x10<<21) | MAG_BILIN | MIN_BILIN, TEXFILTER ); else mga_out32( mmio, (0x10<<21) | MAG_NRST | MIN_NRST, TEXFILTER ); mga_out32( mmio, incx, TMR0 ); mga_out32( mmio, incy, TMR3 ); mga_out32( mmio, startx, TMR6 ); mga_out32( mmio, starty, TMR7 ); mga_out32( mmio, (RS16(dx+dw) << 16) | RS16(dx), FXBNDRY ); mga_out32( mmio, (RS16(dy) << 16) | RS16(dh), YDSTLEN | EXECUTE ); } static inline void matroxBlitTMU( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y, drect->x, drect->y, srect->w, srect->h, drect->w, drect->h, mdev->w2, mdev->h2, filter ); } static inline void matroxBlitTMU_2P( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; u32 texctl; matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y, drect->x, drect->y, srect->w, srect->h, drect->w, drect->h, mdev->w2, mdev->h2, filter ); srect->x /= 2; srect->y /= 2; srect->w = (srect->w + 1) / 2; srect->h = (srect->h + 1) / 2; drect->x /= 2; drect->y /= 2; drect->w = (drect->w + 1) / 2; drect->h = (drect->h + 1) / 2; texctl = mdev->texctl & ~(TPITCHEXT | TFORMAT); texctl |= (((mdev->src_pitch/2) << 9) & TPITCHEXT) | TW16; /* CbCr plane */ mga_waitfifo( mdrv, mdev, 10 ); mga_out32( mmio, texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 3) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 3) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->src_offset[0][1], TEXORG ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, PW16 | NODITHER, MACCESS ); mga_out32( mmio, mdev->dst_offset[0][1], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1 / 4) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2 / 4) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); /* No filtering since we're not using real RGB16 data */ matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y, drect->x, drect->y, srect->w, srect->h, drect->w, drect->h, mdev->w2-1, mdev->h2-1, false ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 7 ); mga_out32( mmio, mdev->texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 4) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 4) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->src_offset[0][0], TEXORG ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, PW8 | BYPASS332 | NODITHER, MACCESS ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); } static inline void matroxBlitTMU_3P( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; u32 texctl; matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y, drect->x, drect->y, srect->w, srect->h, drect->w, drect->h, mdev->w2, mdev->h2, filter ); srect->x /= 2; srect->y /= 2; srect->w = (srect->w + 1) / 2; srect->h = (srect->h + 1) / 2; drect->x /= 2; drect->y /= 2; drect->w = (drect->w + 1) / 2; drect->h = (drect->h + 1) / 2; texctl = mdev->texctl & ~TPITCHEXT; texctl |= ((mdev->src_pitch/2) << 9) & TPITCHEXT; /* Cb plane */ mga_waitfifo( mdrv, mdev, 9 ); mga_out32( mmio, texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 3) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 3) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->src_offset[0][1], TEXORG ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, mdev->dst_offset[0][1], DSTORG ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y1 / 4) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * mdev->clip.y2 / 4) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y, drect->x, drect->y, srect->w, srect->h, drect->w, drect->h, mdev->w2-1, mdev->h2-1, filter ); /* Cr plane */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[0][2], TEXORG ); mga_out32( mmio, mdev->dst_offset[0][2], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y, drect->x, drect->y, srect->w, srect->h, drect->w, drect->h, mdev->w2-1, mdev->h2-1, filter ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 6 ); mga_out32( mmio, mdev->texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 4) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 4) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->src_offset[0][0], TEXORG ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); } static bool matroxStretchBlit( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matroxBlitTMU( mdrv, mdev, srect, drect, true ); return true; } static bool matroxStretchBlit_2P( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matroxBlitTMU_2P( mdrv, mdev, srect, drect, true ); return true; } static bool matroxStretchBlit_3P( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matroxBlitTMU_3P( mdrv, mdev, srect, drect, true ); return true; } static bool matroxStretchBlit_422( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; srect->x /= 2; srect->w = (srect->w + 1) / 2; drect->x /= 2; drect->w = (drect->w + 1) / 2; matroxBlitTMU( mdrv, mdev, srect, drect, true ); return true; } static bool matroxBlit3D( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; matroxBlitTMU( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool matroxBlit3D_2P( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; matroxBlitTMU_2P( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool matroxBlit3D_3P( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; matroxBlitTMU_3P( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool matroxBlit3D_422( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; DFBRectangle drect= { dx, dy, rect->w, rect->h }; rect->x /= 2; rect->w = (rect->w + 1) / 2; drect.x /= 2; drect.w = (drect.w + 1) / 2; matroxBlitTMU( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static void matroxBlitTMU_F( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; src_field = srect->y & 1; dst_field = drect->y & 1; /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y/2, drect->x, drect->y/2, srect->w, (srect->h+1)/2, drect->w, (drect->h+1)/2, mdev->w2, mdev->h2, filter ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, (srect->y+1)/2, drect->x, (drect->y+1)/2, srect->w, srect->h/2, drect->w, drect->h/2, mdev->w2, mdev->h2, filter ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[0][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); } static bool matroxBlit3D_F( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; matroxBlitTMU_F( mdrv, mdev, rect, &drect, false ); return true; } static bool matroxStretchBlit_F( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; matroxBlitTMU_F( mdrv, mdev, srect, drect, true ); return true; } static bool matroxStretchBlit_422_F( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; srect->x /= 2; srect->w = (srect->w + 1) / 2; drect->x /= 2; drect->w = (drect->w + 1) / 2; matroxBlitTMU_F( mdrv, mdev, srect, drect, true ); return true; } static bool matroxStretchBlit_2P_F( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; u32 texctl; src_field = srect->y & 1; dst_field = drect->y & 1; /* Y plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y/2, drect->x, drect->y/2, srect->w, (srect->h+1)/2, drect->w, (drect->h+1)/2, mdev->w2, mdev->h2, true ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, (srect->y+1)/2, drect->x, (drect->y+1)/2, srect->w, srect->h/2, drect->w, drect->h/2, mdev->w2, mdev->h2, true ); /* Subsampling */ srect->x /= 2; srect->y /= 2; srect->w = (srect->w + 1) / 2; srect->h = (srect->h + 1) / 2; drect->x /= 2; drect->y /= 2; drect->w = (drect->w + 1) / 2; drect->h = (drect->h + 1) / 2; texctl = mdev->texctl & ~(TPITCHEXT | TFORMAT); texctl |= (((mdev->src_pitch/2) << 9) & TPITCHEXT) | TW16; mga_waitfifo( mdrv, mdev, 10 ); mga_out32( mmio, texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 3) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 3) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, PW16 | NODITHER, MACCESS ); mga_out32( mmio, (mdev->dst_pitch/2 * mdev->clip.y1/2) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch/2 * mdev->clip.y2/2) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); /* CbCr plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][1], TEXORG ); mga_out32( mmio, mdev->dst_offset[dst_field][1], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y/2, drect->x, drect->y/2, srect->w, (srect->h+1)/2, drect->w, (drect->h+1)/2, mdev->w2-1, mdev->h2-1, true ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][1], TEXORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][1], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, (srect->y+1)/2, drect->x, (drect->y+1)/2, srect->w, srect->h/2, drect->w, drect->h/2, mdev->w2-1, mdev->h2-1, true ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 7 ); mga_out32( mmio, mdev->texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 4) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 4) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, PW8 | BYPASS332 | NODITHER, MACCESS ); mga_out32( mmio, mdev->src_offset[0][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); return true; } static bool matroxStretchBlit_3P_F( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int src_field, dst_field; u32 texctl; src_field = srect->y & 1; dst_field = drect->y & 1; /* Y plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[dst_field][0], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y/2, drect->x, drect->y/2, srect->w, (srect->h+1)/2, drect->w, (drect->h+1)/2, mdev->w2, mdev->h2, true ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][0], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, (srect->y+1)/2, drect->x, (drect->y+1)/2, srect->w, srect->h/2, drect->w, drect->h/2, mdev->w2, mdev->h2, true ); /* Subsampling */ srect->x /= 2; srect->y /= 2; srect->w = (srect->w + 1) / 2; srect->h = (srect->h + 1) / 2; drect->x /= 2; drect->y /= 2; drect->w = (drect->w + 1) / 2; drect->h = (drect->h + 1) / 2; texctl = mdev->texctl & ~TPITCHEXT; texctl |= ((mdev->src_pitch/2) << 9) & TPITCHEXT; mga_waitfifo( mdrv, mdev, 9 ); mga_out32( mmio, texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 3) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h/2 - 1) & 0x7ff) << 18) | (((u32)(3 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 3) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->dst_pitch/2, PITCH ); mga_out32( mmio, (mdev->dst_pitch/2 * mdev->clip.y1/2) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch/2 * mdev->clip.y2/2) & 0xFFFFFF, YBOT ); mga_out32( mmio, ((mdev->clip.x2/2 & 0x0FFF) << 16) | (mdev->clip.x1/2 & 0x0FFF), CXBNDRY ); /* Cb plane */ /* First field */ mga_out32( mmio, mdev->src_offset[src_field][1], TEXORG ); mga_out32( mmio, mdev->dst_offset[dst_field][1], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y/2, drect->x, drect->y/2, srect->w, (srect->h+1)/2, drect->w, (drect->h+1)/2, mdev->w2-1, mdev->h2-1, true ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][1], TEXORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][1], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, (srect->y+1)/2, drect->x, (drect->y+1)/2, srect->w, srect->h/2, drect->w, drect->h/2, mdev->w2-1, mdev->h2-1, true ); /* Cr plane */ /* First field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[src_field][2], TEXORG ); mga_out32( mmio, mdev->dst_offset[dst_field][2], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, srect->y/2, drect->x, drect->y/2, srect->w, (srect->h+1)/2, drect->w, (drect->h+1)/2, mdev->w2-1, mdev->h2-1, true ); /* Second field */ mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, mdev->src_offset[!src_field][2], TEXORG ); mga_out32( mmio, mdev->dst_offset[!dst_field][2], DSTORG ); matroxDoBlitTMU( mdrv, mdev, srect->x, (srect->y+1)/2, drect->x, (drect->y+1)/2, srect->w, srect->h/2, drect->w, drect->h/2, mdev->w2-1, mdev->h2-1, true ); /* Restore registers */ mga_waitfifo( mdrv, mdev, 6 ); mga_out32( mmio, mdev->texctl, TEXCTL ); mga_out32( mmio, ( (((u32)(mdev->w - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 4) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 4) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->dst_pitch, PITCH ); mga_out32( mmio, mdev->src_offset[0][0], TEXORG ); mga_out32( mmio, mdev->dst_offset[0][0], DSTORG ); matrox_set_clip( mdrv, mdev, &mdev->clip ); return true; } /******************************************************************************/ static u32 pci_config_in32( unsigned int bus, unsigned int slot, unsigned int func, u8 reg ) { char filename[512]; int fd; u32 val; snprintf( filename, 512, "/proc/bus/pci/%02x/%02x.%x", bus, slot, func ); fd = open( filename, O_RDONLY ); if (fd < 0) return 0; if (lseek( fd, reg, SEEK_SET ) != reg) { close( fd ); return 0; } if (read( fd, &val, 4 ) != 4) { close( fd ); return 0; } close( fd ); #ifdef WORDS_BIGENDIAN return ((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24); #else return val; #endif } static DFBResult matrox_find_pci_device( MatroxDeviceData *mdev, unsigned int *bus, unsigned int *slot, unsigned int *func ) { unsigned int vendor, device, devfn; unsigned long addr0, addr1; char line[512]; FILE *file; file = fopen( "/proc/bus/pci/devices", "r" ); if (!file) { D_PERROR( "DirectFB/Matrox: " "Error opening `/proc/bus/pci/devices'!\n" ); return errno2result( errno ); } while (fgets( line, 512, file )) { if (sscanf( line, "%02x%02x\t%04x%04x\t%*x\t%lx\t%lx", bus, &devfn, &vendor, &device, &addr0, &addr1 ) != 6) continue; if (vendor != PCI_VENDOR_ID_MATROX) continue; *slot = (devfn >> 3) & 0x1F; *func = devfn & 0x07; addr0 &= ~0xFUL; addr1 &= ~0xFUL; switch (device) { case PCI_DEVICE_ID_MATROX_G550_AGP: case PCI_DEVICE_ID_MATROX_G400_AGP: if (addr0 == (mdev->fb.physical & ~0x1FFFFFF)) { fclose( file ); return DFB_OK; } break; case PCI_DEVICE_ID_MATROX_G200_PCI: case PCI_DEVICE_ID_MATROX_G200_AGP: case PCI_DEVICE_ID_MATROX_G100_PCI: case PCI_DEVICE_ID_MATROX_G100_AGP: case PCI_DEVICE_ID_MATROX_2164W_PCI: case PCI_DEVICE_ID_MATROX_2164W_AGP: if (addr0 == mdev->fb.physical) { fclose( file ); return DFB_OK; } break; case PCI_DEVICE_ID_MATROX_1064SG_PCI: case PCI_DEVICE_ID_MATROX_1064SG_AGP: if ((pci_config_in32( *bus, *slot, *func, 0x08 ) & 0xFF) > 0x02) { /* Mystique 220 (1164SG) */ if (addr0 == mdev->fb.physical) { fclose( file ); return DFB_OK; } } else { /* Mystique (1064SG) */ if (addr1 == mdev->fb.physical) { fclose( file ); return DFB_OK; } } break; case PCI_DEVICE_ID_MATROX_2064W_PCI: if (addr1 == mdev->fb.physical) { fclose( file ); return DFB_OK; } break; } } D_ERROR( "DirectFB/Matrox: Can't find device in `/proc/bus/pci'!\n" ); fclose( file ); return DFB_INIT; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_MATROX_MGA2064W: /* Matrox 2064W (Millennium) */ case FB_ACCEL_MATROX_MGA1064SG: /* Matrox 1064SG/1164SG (Mystique) */ case FB_ACCEL_MATROX_MGA2164W: /* Matrox 2164W (Millennium II) */ case FB_ACCEL_MATROX_MGA2164W_AGP: /* Matrox 2164W (Millennium II) */ case FB_ACCEL_MATROX_MGAG100: /* Matrox G100 */ case FB_ACCEL_MATROX_MGAG200: /* Matrox G200 */ case FB_ACCEL_MATROX_MGAG400: /* Matrox G400/G450/G550 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Matrox G-Series/Millennium/Mystique" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); info->version.major = 0; info->version.minor = 7; info->driver_data_size = sizeof (MatroxDriverData); info->device_data_size = sizeof (MatroxDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { MatroxDriverData *mdrv = driver_data; mdrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!mdrv->mmio_base) return DFB_IO; mdrv->device_data = device_data; mdrv->maven_fd = -1; mdrv->accelerator = dfb_gfxcard_get_accelerator( device ); switch (mdrv->accelerator) { case FB_ACCEL_MATROX_MGAG400: funcs->CheckState = matroxG400CheckState; break; case FB_ACCEL_MATROX_MGAG200: if (!dfb_config->font_format) dfb_config->font_format = DSPF_ARGB; funcs->CheckState = matroxG200CheckState; break; case FB_ACCEL_MATROX_MGAG100: funcs->CheckState = matroxG100CheckState; break; case FB_ACCEL_MATROX_MGA1064SG: case FB_ACCEL_MATROX_MGA2164W: case FB_ACCEL_MATROX_MGA2164W_AGP: funcs->CheckState = matroxOldCheckState; break; case FB_ACCEL_MATROX_MGA2064W: funcs->CheckState = matrox2064WCheckState; break; } funcs->SetState = matroxSetState; funcs->EngineReset = matroxEngineReset; funcs->EngineSync = matroxEngineSync; funcs->FlushTextureCache = matroxFlushTextureCache; funcs->FlushReadCache = matroxFlushReadCache; funcs->DrawRectangle = matroxDrawRectangle; funcs->DrawLine = matroxDrawLine; funcs->FillTriangle = matroxFillTriangle; funcs->TextureTriangles = matroxTextureTriangles; /* will be set dynamically: funcs->FillRectangle, funcs->Blit, funcs->StretchBlit */ /* Generic CRTC1 support */ mdrv->primary = dfb_screens_at( DSCID_PRIMARY ); /* G200/G400/G450/G550 Backend Scaler Support */ if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG200 || mdrv->accelerator == FB_ACCEL_MATROX_MGAG400) dfb_layers_register( mdrv->primary, driver_data, &matroxBesFuncs ); /* G400/G450/G550 CRTC2 support */ if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG400 && dfb_config->matrox_crtc2) { mdrv->secondary = dfb_screens_register( device, driver_data, &matroxCrtc2ScreenFuncs ); dfb_layers_register( mdrv->secondary, driver_data, &matroxCrtc2Funcs ); dfb_layers_register( mdrv->secondary, driver_data, &matroxSpicFuncs ); } return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxDeviceData *mdev = (MatroxDeviceData*) device_data; volatile u8 *mmio = mdrv->mmio_base; unsigned int bus, slot, func; bool g450, g550, sgram = false; DFBResult ret; mdev->fb.physical = dfb_gfxcard_memory_physical( device, 0 ); switch (mdrv->accelerator) { case FB_ACCEL_MATROX_MGAG400: if ((ret = matrox_find_pci_device( mdev, &bus, &slot, &func ))) return ret; g550 = ((pci_config_in32( bus, slot, func, 0x00 ) >> 16) == PCI_DEVICE_ID_MATROX_G550_AGP); g450 = ((pci_config_in32( bus, slot, func, 0x08 ) & 0xFF) >= 0x80); sgram = ((pci_config_in32( bus, slot, func, 0x40 ) & 0x4000) == 0x4000); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "%s", g550 ? "G550" : g450 ? "G450" : "G400" ); mdev->g450_matrox = g450 || g550; mdev->g550_matrox = g550; mdev->fb.offset = mdev->fb.physical & 0x1FFFFFF; break; case FB_ACCEL_MATROX_MGAG200: if ((ret = matrox_find_pci_device( mdev, &bus, &slot, &func ))) return ret; sgram = ((pci_config_in32( bus, slot, func, 0x40 ) & 0x4000) == 0x4000); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "G200" ); break; case FB_ACCEL_MATROX_MGAG100: mdev->old_matrox = true; sgram = false; /* FIXME: can we detect this? */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "G100" ); break; case FB_ACCEL_MATROX_MGA2064W: mdev->old_matrox = true; sgram = true; snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Millennium (2064W)" ); break; case FB_ACCEL_MATROX_MGA1064SG: if ((ret = matrox_find_pci_device( mdev, &bus, &slot, &func ))) return ret; mdev->old_matrox = true; sgram = ((pci_config_in32( bus, slot, func, 0x40 ) & 0x4000) == 0x4000); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "%s", ((pci_config_in32( bus, slot, func, 0x08 ) & 0xFF) > 0x02) ? "Mystique 220 (1164SG)" : "Mystique (1064SG)" ); break; case FB_ACCEL_MATROX_MGA2164W: case FB_ACCEL_MATROX_MGA2164W_AGP: mdev->old_matrox = true; sgram = true; snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Millennium II (2164W)" ); break; } snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "Matrox" ); /* set hardware capabilities */ device_info->caps.flags = CCF_CLIPPING; switch (mdrv->accelerator) { case FB_ACCEL_MATROX_MGAG400: device_info->caps.accel = MATROX_G200G400_DRAWING_FUNCTIONS | MATROX_G200G400_BLITTING_FUNCTIONS; device_info->caps.drawing = MATROX_G200G400_DRAWING_FLAGS; device_info->caps.blitting = MATROX_G200G400_BLITTING_FLAGS; break; case FB_ACCEL_MATROX_MGAG200: device_info->caps.accel = MATROX_G200G400_DRAWING_FUNCTIONS | MATROX_G200G400_BLITTING_FUNCTIONS; device_info->caps.drawing = MATROX_G200G400_DRAWING_FLAGS; device_info->caps.blitting = MATROX_G200G400_BLITTING_FLAGS; break; case FB_ACCEL_MATROX_MGAG100: device_info->caps.accel = MATROX_G100_DRAWING_FUNCTIONS | MATROX_G100_BLITTING_FUNCTIONS; device_info->caps.drawing = MATROX_G100_DRAWING_FLAGS; device_info->caps.blitting = MATROX_G100_BLITTING_FLAGS; break; case FB_ACCEL_MATROX_MGA1064SG: case FB_ACCEL_MATROX_MGA2164W: case FB_ACCEL_MATROX_MGA2164W_AGP: device_info->caps.accel = MATROX_OLD_DRAWING_FUNCTIONS | MATROX_OLD_BLITTING_FUNCTIONS; device_info->caps.drawing = MATROX_OLD_DRAWING_FLAGS; device_info->caps.blitting = MATROX_OLD_BLITTING_FLAGS; break; case FB_ACCEL_MATROX_MGA2064W: device_info->caps.accel = MATROX_2064W_DRAWING_FUNCTIONS | MATROX_2064W_BLITTING_FUNCTIONS; device_info->caps.drawing = MATROX_2064W_DRAWING_FLAGS; device_info->caps.blitting = MATROX_2064W_BLITTING_FLAGS; break; } /* set hardware limitations */ device_info->limits.surface_byteoffset_alignment = 128; device_info->limits.surface_pixelpitch_alignment = 32; device_info->limits.surface_bytepitch_alignment = 64; /* YUY2 / UYVY is handled as 32bit so pixelpitch alignment must be doubled. */ device_info->limits.surface_pixelpitch_alignment = 64; mdev->atype_blk_rstr = (sgram || dfb_config->matrox_sgram) ? ATYPE_BLK : ATYPE_RSTR; /* * Pitch must be a multiple of 64 bytes for block write to work. * SRCORG/DSTORG must be a multiple of 64. * I420/YV12 subsampling makes the actual requirement 128 bytes. */ if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG400) device_info->limits.surface_bytepitch_alignment = 128; /* soft reset to fix eventually corrupted TMU read offset on G200 */ if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG200) { u32 ien = mga_in32( mmio, IEN ); mga_out32( mmio, 1, RST ); usleep(10); mga_out32( mmio, 0, RST ); mga_out32( mmio, ien, IEN ); } if (mdrv->accelerator == FB_ACCEL_MATROX_MGA2064W) mdev->idle_status = 0; else mdev->idle_status = ENDPRDMASTS; switch (mdrv->accelerator) { case FB_ACCEL_MATROX_MGAG100: case FB_ACCEL_MATROX_MGAG200: if ((ret = dfb_palette_create( NULL, 256, &mdev->rgb332_palette )) != DFB_OK) return ret; dfb_palette_generate_rgb332_map( mdev->rgb332_palette ); mdev->tlut_offset = dfb_gfxcard_reserve_memory( device, 2 * 256 ); } return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxDeviceData *mdev = (MatroxDeviceData*) device_data; if (mdev->rgb332_palette) dfb_palette_unref( mdev->rgb332_palette ); /* reset DSTORG as matroxfb does not */ mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mdrv->mmio_base, 0, DSTORG ); /* make sure BES registers get updated (besvcnt) */ mga_out32( mdrv->mmio_base, 0, BESGLOBCTL ); /* make sure overlay is off */ mga_out32( mdrv->mmio_base, 0, BESCTL ); D_DEBUG( "DirectFB/Matrox: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFB/Matrox: %9d matrox_waitfifo calls\n", mdev->waitfifo_calls ); D_DEBUG( "DirectFB/Matrox: %9d register writes (matrox_waitfifo sum)\n", mdev->waitfifo_sum ); D_DEBUG( "DirectFB/Matrox: %9d FIFO wait cycles (depends on CPU)\n", mdev->fifo_waitcycles ); D_DEBUG( "DirectFB/Matrox: %9d IDLE wait cycles (depends on CPU)\n", mdev->idle_waitcycles ); D_DEBUG( "DirectFB/Matrox: %9d FIFO space cache hits (depends on CPU)\n", mdev->fifo_cache_hits ); D_DEBUG( "DirectFB/Matrox: Conclusion:\n" ); D_DEBUG( "DirectFB/Matrox: Average register writes/matrox_waitfifo call: %.2f\n", mdev->waitfifo_sum/(float)(mdev->waitfifo_calls) ); D_DEBUG( "DirectFB/Matrox: Average wait cycles/matrox_waitfifo call: %.2f\n", mdev->fifo_waitcycles/(float)(mdev->waitfifo_calls) ); D_DEBUG( "DirectFB/Matrox: Average fifo space cache hits: %02d%%\n", (int)(100 * mdev->fifo_cache_hits/(float)(mdev->waitfifo_calls)) ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; dfb_gfxcard_unmap_mmio( device, mdrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/matrox/matrox_maven.c0000644000175000017500000005446211164361026016512 00000000000000/* (c) 1998-2001 Petr Vandrovec This code originally comes from matroxfb. Relicensed under the LGPL with the authors permission. Adapted for CRTC2 ITU-R 656 mode by Ville Syrjala This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "matrox.h" #include "regs.h" #include "mmio.h" #include "matrox_maven.h" #define SYS_CLASS_I2C_DEV "/sys/class/i2c-dev" static void maven_write_byte( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 reg, u8 val ) { MatroxDeviceData *mdev = mdrv->device_data; if (mdev->g450_matrox) { volatile u8 *mmio = mdrv->mmio_base; mga_out_dac( mmio, 0x87, reg ); mga_out_dac( mmio, 0x88, val ); } else { union i2c_smbus_data data; struct i2c_smbus_ioctl_data args; data.byte = val; args.read_write = I2C_SMBUS_WRITE; args.command = reg; args.size = I2C_SMBUS_BYTE_DATA; args.data = &data; ioctl( mdrv->maven_fd, I2C_SMBUS, &args ); } } static void maven_write_word( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 reg, u16 val ) { MatroxDeviceData *mdev = mdrv->device_data; if (mdev->g450_matrox) { volatile u8 *mmio = mdrv->mmio_base; mga_out_dac( mmio, 0x87, reg ); mga_out_dac( mmio, 0x88, val ); mga_out_dac( mmio, 0x87, reg + 1 ); mga_out_dac( mmio, 0x88, val >> 8 ); } else { union i2c_smbus_data data; struct i2c_smbus_ioctl_data args; data.word = val; args.read_write = I2C_SMBUS_WRITE; args.command = reg; args.size = I2C_SMBUS_WORD_DATA; args.data = &data; ioctl( mdrv->maven_fd, I2C_SMBUS, &args ); } } #if 0 /* i2c_smbus_read_byte_data() doesn't work with maven. */ static int i2c_read_byte( int fd, u8 addr, u8 reg ) { int ret; u8 val; struct i2c_msg msgs[] = { { addr, I2C_M_REV_DIR_ADDR, sizeof(reg), ® }, { addr, I2C_M_RD | I2C_M_NOSTART, sizeof(val), &val } }; struct i2c_rdwr_ioctl_data data = { msgs, 2 }; ret = ioctl( fd, I2C_RDWR, &data ); if (ret < 0) return ret; return val; } #endif void maven_disable( MatroxMavenData *mav, MatroxDriverData *mdrv ) { MatroxDeviceData *mdev = mdrv->device_data; maven_write_byte( mav, mdrv, 0x3E, 0x01 ); if (mdev->g450_matrox) { maven_write_byte( mav, mdrv, 0x80, 0x00 ); return; } maven_write_byte( mav, mdrv, 0x82, 0x80 ); maven_write_byte( mav, mdrv, 0x8C, 0x00 ); maven_write_byte( mav, mdrv, 0x94, 0xA2 ); maven_write_word( mav, mdrv, 0x8E, 0x1EFF ); maven_write_byte( mav, mdrv, 0xC6, 0x01 ); } void maven_enable( MatroxMavenData *mav, MatroxDriverData *mdrv ) { MatroxDeviceData *mdev = mdrv->device_data; bool ntsc = dfb_config->matrox_tv_std != DSETV_PAL; if (mdev->g450_matrox) { if (dfb_config->matrox_cable == 1) /* SCART RGB */ maven_write_byte( mav, mdrv, 0x80, ntsc ? 0x43 : 0x41 ); else /* Composite / S-Video */ maven_write_byte( mav, mdrv, 0x80, ntsc ? 0x03 : 0x01 ); } else maven_write_byte( mav, mdrv, 0x82, 0x20 ); maven_write_byte( mav, mdrv, 0x3E, 0x00 ); } void maven_sync( MatroxMavenData *mav, MatroxDriverData *mdrv ) { MatroxDeviceData *mdev = mdrv->device_data; if (mdev->g450_matrox) return; maven_write_byte( mav, mdrv, 0xD4, 0x01 ); maven_write_byte( mav, mdrv, 0xD4, 0x00 ); } #define LR(x) maven_write_byte( mav, mdrv, (x), mav->regs[(x)] ) #define LRP(x) maven_write_word( mav, mdrv, (x), mav->regs[(x)] | (mav->regs[(x)+1] << 8) ) void maven_set_regs( MatroxMavenData *mav, MatroxDriverData *mdrv, CoreLayerRegionConfig *config, DFBColorAdjustment *adj ) { MatroxDeviceData *mdev = mdrv->device_data; bool ntsc = dfb_config->matrox_tv_std != DSETV_PAL; LR(0x00); LR(0x01); LR(0x02); LR(0x03); LR(0x04); LR(0x2C); LR(0x08); LR(0x0A); LR(0x09); LR(0x29); LRP(0x31); LRP(0x17); LR(0x0B); LR(0x0C); LR(0x35); LRP(0x10); LRP(0x0E); LRP(0x1E); LR(0x20); LR(0x22); LR(0x25); LR(0x34); LR(0x33); LR(0x19); LR(0x12); LR(0x3B); LR(0x13); LR(0x39); LR(0x1D); LR(0x3A); LR(0x24); LR(0x14); LR(0x15); LR(0x16); LRP(0x2D); LRP(0x2F); LR(0x1A); LR(0x1B); LR(0x1C); LR(0x23); LR(0x26); LR(0x28); LR(0x27); LR(0x21); LRP(0x2A); LR(0x35); LRP(0x3C); LR(0x37); LR(0x38); if (mdev->g450_matrox) { maven_write_word( mav, mdrv, 0x82, ntsc ? 0x0014 : 0x0017 ); maven_write_word( mav, mdrv, 0x84, 0x0001 ); } else { maven_write_byte( mav, mdrv, 0xB3, 0x01 ); maven_write_byte( mav, mdrv, 0x82, 0xA0 ); maven_write_byte( mav, mdrv, 0xD3, 0x01 ); maven_write_byte( mav, mdrv, 0x8C, 0x10 ); maven_write_byte( mav, mdrv, 0x94, 0xA2 ); maven_write_byte( mav, mdrv, 0x8D, 0x03 ); maven_write_byte( mav, mdrv, 0xB9, 0x78 ); maven_write_byte( mav, mdrv, 0xBF, 0x02 ); /* * Deflicker: 0x00, 0xB1, 0xA2 * Doesn't work due to: * - ITU-R BT.656 mode? * - scaler is not used? * - something else? */ maven_write_byte( mav, mdrv, 0x93, 0x00 ); } maven_set_saturation( mav, mdrv, adj->saturation >> 8 ); maven_set_hue( mav, mdrv, adj->hue >> 8 ); maven_set_bwlevel( mav, mdrv, adj->brightness >> 8, adj->contrast >> 8 ); if (!mdev->g450_matrox) { LR(0x83); LR(0x84); LR(0x85); LR(0x86); LR(0x87); LR(0x88); LR(0x89); LR(0x8A); LR(0x8B); switch (dfb_config->matrox_cable) { case 1: /* SCART RGB */ maven_write_byte( mav, mdrv, 0xB0, 0x85 ); break; case 2: /* SCART Composite */ maven_write_byte( mav, mdrv, 0xB0, 0x81 ); break; default: /* Composite / S-Video */ maven_write_byte( mav, mdrv, 0xB0, 0x80 ); break; } } } void maven_set_hue( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 hue ) { maven_write_byte( mav, mdrv, 0x25, hue ); } void maven_set_saturation( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 saturation ) { maven_write_byte( mav, mdrv, 0x20, saturation ); maven_write_byte( mav, mdrv, 0x22, saturation ); } void maven_set_bwlevel( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 brightness, u8 contrast ) { MatroxDeviceData *mdev = mdrv->device_data; int b, c, bl, wl, wlmax, blmin, range; bool ntsc = dfb_config->matrox_tv_std == DSETV_NTSC; if (mdev->g450_matrox) { wlmax = ntsc ? 936 : 938; blmin = ntsc ? 267 : 281; } else { wlmax = 786; blmin = ntsc ? 242 : 255; } range = wlmax - blmin - 128; b = brightness * range / 255 + blmin; c = contrast * range / 2 / 255 + 64; bl = MAX( b - c, blmin ); wl = MIN( b + c, wlmax ); blmin = ((blmin << 8) & 0x0300) | ((blmin >> 2) & 0x00FF); bl = ((bl << 8) & 0x0300) | ((bl >> 2) & 0x00FF); wl = ((wl << 8) & 0x0300) | ((wl >> 2) & 0x00FF); maven_write_word( mav, mdrv, 0x10, blmin ); maven_write_word( mav, mdrv, 0x0E, bl ); maven_write_word( mav, mdrv, 0x1E, wl ); } DFBResult maven_open( MatroxMavenData *mav, MatroxDriverData *mdrv ) { MatroxDeviceData *mdev = mdrv->device_data; if (mdev->g450_matrox) return DFB_OK; if (mdrv->maven_fd != -1) D_BUG( "DirectFB/Matrox/Maven: Device already open!\n" ); if ((mdrv->maven_fd = open( mav->dev, O_RDWR )) < 0) { D_PERROR( "DirectFB/Matrox/Maven: Error opening `%s'!\n", mav->dev ); mdrv->maven_fd = -1; return errno2result( errno ); } if (ioctl( mdrv->maven_fd, I2C_SLAVE, mav->address ) < 0) { D_PERROR( "DirectFB/Matrox/Maven: Error controlling `%s'!\n", mav->dev ); close( mdrv->maven_fd ); mdrv->maven_fd = -1; return errno2result( errno ); } return DFB_OK; } void maven_close( MatroxMavenData *mav, MatroxDriverData *mdrv ) { MatroxDeviceData *mdev = mdrv->device_data; if (mdev->g450_matrox) return; if (mdrv->maven_fd == -1) D_BUG( "DirectFB/Matrox/Maven: Device not open!\n" ); close( mdrv->maven_fd ); mdrv->maven_fd = -1; } DFBResult maven_init( MatroxMavenData *mav, MatroxDriverData *mdrv ) { MatroxDeviceData *mdev = mdrv->device_data; char line[512]; int fd; FILE *file; bool found = false; DIR *dir; /* Locate G400 maven /dev/i2c file */ /* Try sysfs */ if (!mdev->g450_matrox && (dir = opendir( SYS_CLASS_I2C_DEV )) != NULL) { char path[PATH_MAX]; struct dirent *ent; while ((ent = readdir( dir )) != NULL) { FILE *fp; if (!strcmp( ent->d_name, "." )) continue; if (!strcmp( ent->d_name, ".." )) continue; snprintf( path, sizeof(path), "%s/%s/name", SYS_CLASS_I2C_DEV, ent->d_name ); fp = fopen( path, "r" ); if (!fp) { D_PERROR( "DirectFB/Matrox/Maven: Error opening `%s'!\n", path ); continue; } memset( line, 0, 6 ); fread( line, 1, 5, fp ); if (ferror( fp )) { D_PERROR( "DirectFB/Matrox/Maven: Error reading `%s'!\n", path ); fclose( fp ); continue; } fclose( fp ); if (strcmp( line, "MAVEN" )) continue; snprintf( mav->dev, sizeof(mav->dev), "/dev/%s", ent->d_name ); found = true; break; } if (!ent && errno) D_PERROR( "DirectFB/Matrox/Maven: Error reading `%s'!\n", SYS_CLASS_I2C_DEV ); closedir( dir ); } /* Try /proc/bus/i2c */ if (!mdev->g450_matrox && !found) { file = fopen( "/proc/bus/i2c", "r" ); if (!file) { D_PERROR( "DirectFB/Matrox/Maven: " "Error opening `/proc/bus/i2c'!\n" ); return errno2result( errno ); } while (fgets( line, 512, file )) { if (strstr( line, "MAVEN" )) { char *p = line; while (!isspace( *p )) p++; *p = '\0'; direct_snputs( mav->dev, "/dev/", 6 ); strncat( mav->dev, line, 250 ); found = true; break; } } fclose( file ); } if (!mdev->g450_matrox) { if (!found) { D_ERROR( "DirectFB/Matrox/Maven: " "Can't find MAVEN i2c device file!\n" ); return DFB_UNSUPPORTED; } /* Try to use it */ if ((fd = open( mav->dev, O_RDWR )) < 0) { D_PERROR( "DirectFB/Matrox/Maven: Error opening `%s'!\n", mav->dev ); return errno2result( errno ); } #if 0 /* FIXME: This fails for some people */ /* Check if maven is at address 0x1B (DH board) or 0x1A (DH add-on) */ if (i2c_read_byte( fd, 0x1B, 0xB2 ) < 0) { if (i2c_read_byte( fd, 0x1A, 0xB2 ) < 0) { D_ERROR( "DirectFB/Matrox/Maven: Error reading from maven chip!\n" ); close( fd ); return errno2result( errno ); } else mav->address = 0x1A; } else mav->address = 0x1B; #else mav->address = 0x1B; #endif close( fd ); } /* Maven registers */ { static const u8 ntscregs[2][0x40] = { /* G400 */ { 0x21, 0xF0, 0x7C, 0x1F, /* 00-03 */ 0x00, /* 04 */ 0x00, 0x00, 0x00, 0x7E, /* 08 */ 0x43, /* 09 */ 0x7E, /* 0A */ 0x3D, /* 0B */ 0x00, /* 0C */ 0x00, 0x46, 0x03, /* 0E-0F */ 0x3C, 0x02, /* 10-11 */ 0x17, /* 12 */ 0x21, /* 13 */ 0x1B, /* 14 */ 0x1B, /* 15 */ 0x24, /* 16 */ 0x83, 0x01, /* 17-18 */ 0x00, /* 19 */ 0x0F, /* 1A */ 0x0F, /* 1B */ 0x60, /* 1C */ 0x05, /* 1D */ 0xC4, 0x02, /* 1E-1F */ 0x8E, /* 20 */ 0x04, /* 21 */ 0x8E, /* 22 */ 0x01, /* 23 */ 0x02, /* 24 */ 0x00, /* 25 */ 0x0A, /* 26 */ 0x05, /* 27 */ 0x00, /* 28 */ 0x10, /* 29 */ 0xFF, 0x03, /* 2A-2B */ 0x18, /* 2C */ 0x0F, 0x78, /* 2D-2E */ 0x00, 0x00, /* 2F-30 */ 0xB4, 0x00, /* 31-32 */ 0x14, /* 33 */ 0x02, /* 34 */ 0x1C, /* 35 */ 0x00, 0xA3, /* 37 */ 0xC8, /* 38 */ 0x15, /* 39 */ 0x05, /* 3A */ 0x15, /* 3B */ 0x3C, 0x00, /* 3C-3D */ 0x00, /* 3E */ 0x00 }, /* G450 / G550 */ { 0x21, 0xF0, 0x7C, 0x1F, /* 00-03 */ 0x00, /* 04 */ 0x00, 0x00, 0x00, 0x7E, /* 08 */ 0x44, /* 09 */ 0x76, /* 0A */ 0x49, /* 0B */ 0x00, /* 0C */ 0x00, 0x4E, 0x03, /* 0E-0F */ 0x42, 0x03, /* 10-11 */ 0x17, /* 12 */ 0x21, /* 13 */ 0x1B, /* 14 */ 0x1B, /* 15 */ 0x24, /* 16 */ 0x83, 0x01, /* 17-18 */ 0x00, /* 19 */ 0x0F, /* 1A */ 0x0F, /* 1B */ 0x60, /* 1C */ 0x05, /* 1D */ 0xEA, 0x00, /* 1E-1F */ 0xAE, /* 20 */ 0x04, /* 21 */ 0xAE, /* 22 */ 0x01, /* 23 */ 0x02, /* 24 */ 0x00, /* 25 */ 0x0A, /* 26 */ 0x05, /* 27 */ 0x00, /* 28 */ 0x11, /* 29 */ 0xFF, 0x03, /* 2A-2B */ 0x20, /* 2C */ 0x0F, 0x78, /* 2D-2E */ 0x00, 0x00, /* 2F-30 */ 0xB4, 0x00, /* 31-32 */ 0x14, /* 33 */ 0x02, /* 34 */ 0x00, /* 35 */ 0x00, 0xBD, /* 37 */ 0xDA, /* 38 */ 0x15, /* 39 */ 0x05, /* 3A */ 0x15, /* 3B */ 0x42, 0x03, /* 3C-3D */ 0x00, /* 3E */ 0x00 } }; static const u8 palregs[2][0x40] = { /* G400 */ { 0x2A, 0x09, 0x8A, 0xCB, /* 00-03 */ 0x00, /* 04 */ 0x00, 0x00, 0x00, 0x7E, /* 08 */ 0x3C, /* 09 */ 0x82, /* 0A */ 0x2E, /* 0B */ 0x21, /* 0C */ 0x00, 0x3F, 0x03, /* 0E-0F */ 0x3F, 0x03, /* 10-11 */ 0x1A, /* 12 */ 0x2A, /* 13 */ 0x1C, /* 14 */ 0x3D, /* 15 */ 0x14, /* 16 */ 0x9C, 0x01, /* 17-18 */ 0x00, /* 19 */ 0xFE, /* 1A */ 0x7E, /* 1B */ 0x60, /* 1C */ 0x05, /* 1D */ 0xC4, 0x01, /* 1E-1F */ 0x95, /* 20 */ 0x07, /* 21 */ 0x95, /* 22 */ 0x00, /* 23 */ 0x00, /* 24 */ 0x00, /* 25 */ 0x08, /* 26 */ 0x04, /* 27 */ 0x00, /* 28 */ 0x1A, /* 29 */ 0x55, 0x01, /* 2A-2B */ 0x20, /* 2C */ 0x07, 0x7E, /* 2D-2E */ 0x02, 0x54, /* 2F-30 */ 0xB4, 0x00, /* 31-32 */ 0x14, /* 33 */ 0x49, /* 34 */ 0x1D, /* 35 */ 0x00, 0xA3, /* 37 */ 0xC8, /* 38 */ 0x22, /* 39 */ 0x02, /* 3A */ 0x22, /* 3B */ 0x3F, 0x03, /* 3C-3D */ 0x00, /* 3E */ 0x00, }, /* G450 / G550 */ { 0x2A, 0x09, 0x8A, 0xCB, /* 00-03 */ 0x00, /* 04 */ 0x00, 0x00, 0x00, 0x7E, /* 08 */ 0x3A, /* 09 */ 0x8A, /* 0A */ 0x38, /* 0B */ 0x28, /* 0C */ 0x00, 0x46, 0x01, /* 0E-0F */ 0x46, 0x01, /* 10-11 */ 0x1A, /* 12 */ 0x2A, /* 13 */ 0x1C, /* 14 */ 0x3D, /* 15 */ 0x14, /* 16 */ 0x9C, 0x01, /* 17-18 */ 0x00, /* 19 */ 0xFE, /* 1A */ 0x7E, /* 1B */ 0x60, /* 1C */ 0x05, /* 1D */ 0xEA, 0x00, /* 1E-1F */ 0xBB, /* 20 */ 0x07, /* 21 */ 0xBB, /* 22 */ 0x00, /* 23 */ 0x00, /* 24 */ 0x00, /* 25 */ 0x08, /* 26 */ 0x04, /* 27 */ 0x00, /* 28 */ 0x1A, /* 29 */ 0x55, 0x01, /* 2A-2B */ 0x18, /* 2C */ 0x07, 0x7E, /* 2D-2E */ 0x02, 0x54, /* 2F-30 */ 0xB4, 0x00, /* 31-32 */ 0x16, /* 33 */ 0x49, /* 34 */ 0x00, /* 35 */ 0x00, 0xB9, /* 37 */ 0xDD, /* 38 */ 0x22, /* 39 */ 0x02, /* 3A */ 0x22, /* 3B */ 0x46, 0x00, /* 3C-3D */ 0x00, /* 3E */ 0x00, } }; if (dfb_config->matrox_tv_std != DSETV_PAL) direct_memcpy( mav->regs, ntscregs[mdev->g450_matrox], 64 ); else direct_memcpy( mav->regs, palregs[mdev->g450_matrox], 64 ); if (dfb_config->matrox_tv_std == DSETV_PAL_60) { mav->regs[0x00] = palregs[mdev->g450_matrox][0x00]; mav->regs[0x01] = palregs[mdev->g450_matrox][0x01]; mav->regs[0x02] = palregs[mdev->g450_matrox][0x02]; mav->regs[0x03] = palregs[mdev->g450_matrox][0x03]; mav->regs[0x0B] = palregs[mdev->g450_matrox][0x0B]; mav->regs[0x0C] = palregs[mdev->g450_matrox][0x0C]; mav->regs[0x0E] = palregs[mdev->g450_matrox][0x0E]; mav->regs[0x0F] = palregs[mdev->g450_matrox][0x0F]; mav->regs[0x10] = palregs[mdev->g450_matrox][0x10]; mav->regs[0x11] = palregs[mdev->g450_matrox][0x11]; mav->regs[0x1E] = palregs[mdev->g450_matrox][0x1E]; mav->regs[0x1F] = palregs[mdev->g450_matrox][0x1F]; mav->regs[0x20] = palregs[mdev->g450_matrox][0x20]; mav->regs[0x22] = palregs[mdev->g450_matrox][0x22]; mav->regs[0x25] = palregs[mdev->g450_matrox][0x25]; mav->regs[0x34] = palregs[mdev->g450_matrox][0x34]; } if (!mdev->g450_matrox) { /* gamma */ mav->regs[0x83] = 0x00; mav->regs[0x84] = 0x00; mav->regs[0x85] = 0x00; mav->regs[0x86] = 0x1F; mav->regs[0x87] = 0x10; mav->regs[0x88] = 0x10; mav->regs[0x89] = 0x10; mav->regs[0x8A] = 0x64; mav->regs[0x8B] = 0xC8; } } return DFB_OK; } DirectFB-1.2.10/gfxdrivers/matrox/matrox_3d.h0000644000175000017500000000257611245562152015721 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MATROX_3D_H__ #define ___MATROX_3D_H__ bool matroxTextureTriangles( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ); #endif DirectFB-1.2.10/gfxdrivers/matrox/matrox_3d.c0000644000175000017500000005160111245562152015705 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "matrox.h" #include "matrox_3d.h" #ifdef ARCH_X86 #define RINT(x) my_rint(x) #define CEIL(x) my_ceil(x) #define FLOOR(x) my_floor(x) #else #define RINT(x) ((s32)(x)) #define CEIL(x) ((s32)ceil(x)) #define FLOOR(x) ((s32)floor(x)) #endif #ifdef ARCH_X86 static inline long my_rint(const float x) { register float arg = x; long result; __asm__ ("fistl %0" : "=m" (result) : "t" (arg)); return result; } static inline long my_ceil(const float x) { register float arg = x; volatile long value; volatile short cw, cwtmp; __asm__ volatile ("fnstcw %0" : "=m" (cw) : ); cwtmp = (cw & 0xf3ff) | 0x0800; /* rounding up */ __asm__ volatile ("fldcw %1\n" "fistl %0\n" "fldcw %2" : "=m" (value) : "m" (cwtmp), "m" (cw), "t" (arg)); return value; } static inline long my_floor(const float x) { register float arg = x; volatile long value; volatile short cw, cwtmp; __asm__ volatile ("fnstcw %0" : "=m" (cw) : ); cwtmp = (cw & 0xf3ff) | 0x0400; __asm__ volatile ("fldcw %1\n" "fistl %0\n" "fldcw %2" : "=m" (value) : "m" (cwtmp), "m" (cw), "t" (arg)); return value; } #endif #define F2COL(x) (RINT(x) & 0x00ffffff) #define mgaF1800(x) (((s32) (x)) & 0x0003ffff) #define mgaF2400(x) (((s32) (x)) & 0x00ffffff) #define mgaF2200(x) (((s32) (x)) & 0x003fffff) #define OUTREG(r,d) do { mga_out32( mmio, d, r ); } while (0) #define MGA_S(start,xinc,yinc) \ do { \ mga_out32( mmio, start, TMR6 ); \ mga_out32( mmio, xinc, TMR0 ); \ mga_out32( mmio, yinc, TMR1 ); \ } while (0) #define MGA_T(start,xinc,yinc) \ do { \ mga_out32( mmio, start, TMR7 ); \ mga_out32( mmio, xinc, TMR2 ); \ mga_out32( mmio, yinc, TMR3 ); \ } while (0) #define MGA_Q(start,xinc,yinc) \ do { \ mga_out32( mmio, start, TMR8 ); \ mga_out32( mmio, xinc, TMR4 ); \ mga_out32( mmio, yinc, TMR5 ); \ } while (0) #define MGA_LSLOPE(dx,dy,sgn,err) \ do { \ mga_out32( mmio, mgaF1800(dy), AR0 ); \ if ((dx) >= 0) { \ mga_out32( mmio, mgaF2400(-(dx)+(err)), AR1 ); \ mga_out32( mmio, mgaF1800(-(dx)), AR2 ); \ sgn &= ~SDXL; \ } \ else { \ mga_out32( mmio, mgaF2400((dx)+(dy)-(err)-1), AR1 ); \ mga_out32( mmio, mgaF1800(dx), AR2 ); \ sgn |= SDXL; \ } \ } while(0) #define MGA_G400_LSLOPE(dx,dy,sgn,err) \ do { \ mga_out32( mmio, mgaF2200(dy), AR0 ); \ if ((dx) >= 0) { \ mga_out32( mmio, mgaF2400(-(dx)+(err)), AR1 ); \ mga_out32( mmio, mgaF2200(-(dx)), AR2); \ sgn &= ~SDXL; \ } \ else { \ mga_out32( mmio, mgaF2400((dx)+(dy)-(err)-1), AR1 ); \ mga_out32( mmio, mgaF2200(dx), AR2 ); \ sgn |= SDXL; \ } \ } while(0) #define MGA_RSLOPE(dx,dy,sgn,err) \ do { \ mga_out32( mmio, mgaF1800(dy), AR6); \ if ((dx) >= 0) { \ mga_out32( mmio, mgaF1800(-(dx)+(err)), AR4 ); \ mga_out32( mmio, mgaF1800(-(dx)), AR5 ); \ sgn &= ~SDXR; \ } \ else { \ mga_out32( mmio, mgaF1800((dx)+(dy)-(err)-1), AR4 ); \ mga_out32( mmio, mgaF1800(dx), AR5 ); \ sgn |= SDXR; \ } \ } while(0) #define MGA_G400_RSLOPE(dx,dy,sgn,err) \ do { \ mga_out32( mmio, mgaF2200(dy), AR6 ); \ if ((dx) >= 0) { \ mga_out32( mmio, mgaF2200(-(dx)+(err)), AR4 ); \ mga_out32( mmio, mgaF2200(-(dx)), AR5 ); \ sgn &= ~SDXR; \ } \ else { \ mga_out32( mmio, mgaF2200((dx)+(dy)-(err)-1), AR4 ); \ mga_out32( mmio, mgaF2200(dx), AR5); \ sgn |= SDXR; \ } \ } while(0) typedef struct { DFBVertex *v0, *v1; /* Y(v0) < Y(v1) */ float dx; /* X(v1) - X(v0) */ float dy; /* Y(v1) - Y(v0) */ float dxOOA; /* dx * oneOverArea */ float dyOOA; /* dy * oneOverArea */ float adjx,adjy; /* subpixel offset after rounding to integer */ int err; /* error term ready for hardware */ int idx,idy; /* delta-x & delta-y ready for hardware */ int sx,sy; /* first sample point x,y coord */ int lines; /* number of lines to be sampled on this edge */ } EdgeT; static void texture_triangle( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBVertex *v0, DFBVertex *v1, DFBVertex *v2 ) { EdgeT eMaj, eTop, eBot; float oneOverArea; DFBVertex *vMin, *vMid, *vMax; /* Y(vMin)<=Y(vMid)<=Y(vMax) */ int Shape; /* 1 = Top half, 2 = bottom half, 3 = top+bottom */ // float bf = mga_bf_sign; volatile u8 *mmio = mdrv->mmio_base; /* find the order of the 3 vertices along the Y axis */ { float y0 = v0->y; float y1 = v1->y; float y2 = v2->y; if (y0<=y1) { if (y1<=y2) { vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */ } else if (y2<=y0) { vMin = v2; vMid = v0; vMax = v1; /* y2<=y0<=y1 */ } else { vMin = v0; vMid = v2; vMax = v1; /*bf = -bf;*/ /* y0<=y2<=y1 */ } } else { if (y0<=y2) { vMin = v1; vMid = v0; vMax = v2; /*bf = -bf;*/ /* y1<=y0<=y2 */ } else if (y2<=y1) { vMin = v2; vMid = v1; vMax = v0; /*bf = -bf;*/ /* y2<=y1<=y0 */ } else { vMin = v1; vMid = v2; vMax = v0; /* y1<=y2<=y0 */ } } } /* vertex/edge relationship */ eMaj.v0 = vMin; eMaj.v1 = vMax; eTop.v0 = vMin; eTop.v1 = vMid; eBot.v0 = vMid; eBot.v1 = vMax; /* compute deltas for each edge: vertex[v1] - vertex[v0] */ eMaj.dx = vMax->x - vMin->x; eMaj.dy = vMax->y - vMin->y; eTop.dx = vMid->x - vMin->x; eTop.dy = vMid->y - vMin->y; eBot.dx = vMax->x - vMid->x; eBot.dy = vMax->y - vMid->y; /* compute oneOverArea */ { float area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy; /* Do backface culling */ //if ( area * bf < 0 || area == 0 ) //return; oneOverArea = 1.0F / area; } /* Edge setup. For a triangle strip these could be reused... */ { #define DELTASCALE 16 /* Scaling factor for idx and idy. Note that idx and idy are 18 bits signed, so don't choose too big value. */ int ivMax_y; float temp; ivMax_y = CEIL(vMax->y); eTop.sy = eMaj.sy = CEIL(vMin->y); eBot.sy = CEIL(vMid->y); eMaj.lines = ivMax_y - eMaj.sy; if (eMaj.lines > 0) { float dxdy = eMaj.dx / eMaj.dy; eMaj.adjy = (float) eMaj.sy - vMin->y; temp = vMin->x + eMaj.adjy*dxdy; eMaj.sx = CEIL(temp); eMaj.adjx = (float) eMaj.sx - vMin->x; if (eMaj.lines == 1) { eMaj.idy = 1; eMaj.idx = 0; eMaj.err = 0; } else { eMaj.idy = RINT(eMaj.dy * DELTASCALE); eMaj.idx = FLOOR(eMaj.idy * dxdy); eMaj.err = RINT(((float) eMaj.sx - temp) * (float)eMaj.idy); } } else { return; /* CULLED */ } Shape = 3; eBot.lines = ivMax_y - eBot.sy; if (eBot.lines > 0) { float dxdy = eBot.dx / eBot.dy; eBot.adjy = (float) eBot.sy - vMid->y; temp = vMid->x + eBot.adjy*dxdy; eBot.sx = CEIL(temp); eBot.adjx = (float) eBot.sx - vMid->x; if (eBot.lines == 1) { eBot.idy = 1; eBot.idx = 0; eBot.err = 0; } else { eBot.idy = RINT(eBot.dy * DELTASCALE); eBot.idx = FLOOR(eBot.idy * dxdy); eBot.err = RINT(((float) eBot.sx - temp) * (float)eBot.idy); } } else { Shape = 1; } eTop.lines = eBot.sy - eTop.sy; if (eTop.lines > 0) { float dxdy = eTop.dx / eTop.dy; eTop.adjy = eMaj.adjy; temp = vMin->x + eTop.adjy*dxdy; eTop.sx = CEIL(temp); eTop.adjx = (float) eTop.sx - vMin->x; if (eTop.lines == 1) { eTop.idy = 1; if (eBot.lines > 0) { eTop.idx = eBot.sx - eTop.sx; /* needed for bottom half */ } else { eTop.idx = 0; } eTop.err = 0; } else { eTop.idy = RINT(eTop.dy * DELTASCALE); eTop.idx = FLOOR(eTop.idy * dxdy); eTop.err = RINT(((float) eTop.sx - temp) * (float)eTop.idy); } } else { Shape = 2; } } { int ltor; /* true if scanning left-to-right */ EdgeT *eLeft, *eRight; int lines; DFBVertex *vTL; /* Top left vertex */ float adjx, adjy; /* * Execute user-supplied setup code */ #ifdef SETUP_CODE SETUP_CODE #endif ltor = (oneOverArea > 0.0F); if (Shape == 2) { /* bottom half triangle */ if (ltor) { eLeft = &eMaj; eRight = &eBot; } else { eLeft = &eBot; eRight = &eMaj; } lines = eBot.lines; } else { /* top half triangle */ if (ltor) { eLeft = &eMaj; eRight = &eTop; } else { eLeft = &eTop; eRight = &eMaj; } lines = eTop.lines; } vTL = eLeft->v0; adjx = eLeft->adjx; adjy = eLeft->adjy; /* setup derivatives */ /* compute d?/dx and d?/dy derivatives */ eBot.dxOOA = eBot.dx * oneOverArea; eBot.dyOOA = eBot.dy * oneOverArea; eMaj.dxOOA = eMaj.dx * oneOverArea; eMaj.dyOOA = eMaj.dy * oneOverArea; #define DERIV( DZ, COMP) \ { \ float eMaj_DZ, eBot_DZ; \ eMaj_DZ = vMax->COMP - vMin->COMP; \ eBot_DZ = vMax->COMP - vMid->COMP; \ DZ ## dx = eMaj_DZ * eBot.dyOOA - eMaj.dyOOA * eBot_DZ; \ DZ ## dy = eMaj.dxOOA * eBot_DZ - eMaj_DZ * eBot.dxOOA; \ } if (mdev->depth_buffer) { float Zstart; float dzdx, dzdy; DERIV(dz, z); if (dzdx>65535.0f*(1<<15) || dzdx<-65535.0f*(1<<15)) { /* probably a sliver triangle */ dzdx = 0.0; dzdy = 0.0; } Zstart = vTL->z + dzdx*adjx + dzdy*adjy; /* FIXME: 16 bit assumed */ if (Zstart > 65535.0f*(1 << 15)) { Zstart = 65535.0f*(1 << 15); dzdx = 0.0F; dzdy = 0.0F; } mga_waitfifo( mdrv, mdev, 3 ); mga_out32( mmio, RINT(Zstart), DR0 ); mga_out32( mmio, RINT(dzdx), DR2 ); mga_out32( mmio, RINT(dzdy), DR3 ); } { float dsdx, dsdy; float dtdx, dtdy; float dvdx, dvdy; mga_waitfifo( mdrv, mdev, 9 ); DERIV(ds,s); MGA_S(RINT( (vTL->s+dsdx*adjx+dsdy*adjy) ), RINT( dsdx ), RINT( dsdy )); DERIV(dt,t); MGA_T(RINT( (vTL->t+dtdx*adjx+dtdy*adjy) ), RINT( dtdx ), RINT( dtdy )); DERIV(dv,w); { int sq = RINT( (vTL->w+dvdx*adjx+dvdy*adjy) ); MGA_Q((sq == 0) ? 1 : sq,RINT(dvdx),RINT(dvdy)); } } { u32 sgn = 0; mga_waitfifo( mdrv, mdev, 9 ); /* Draw part #1 */ if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG400) { MGA_G400_LSLOPE(eLeft->idx,eLeft->idy,sgn,eLeft->err); MGA_G400_RSLOPE(eRight->idx,eRight->idy,sgn,eRight->err); } else { MGA_LSLOPE(eLeft->idx,eLeft->idy,sgn,eLeft->err); MGA_RSLOPE(eRight->idx,eRight->idy,sgn,eRight->err); } mga_out32( mmio, sgn, SGN ); mga_out32( mmio, ((u32)(eLeft->sx) & 0xFFFF) | ((u32)(eRight->sx) << 16), FXBNDRY ); mga_out32( mmio, lines | ((u32)(eLeft->sy) << 16), YDSTLEN | EXECUTE ); if (Shape != 3) { /* has only one half? */ return; } mga_waitfifo( mdrv, mdev, 6 ); /* Draw part #2 */ if (ltor) { if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG400) MGA_G400_RSLOPE(eBot.idx,eBot.idy,sgn,eBot.err); else MGA_RSLOPE(eBot.idx,eBot.idy,sgn,eBot.err); mga_out32( mmio, eBot.sx, FXRIGHT ); } else { sgn |= SGN_BRKLEFT; mga_out32( mmio, eBot.sx, FXLEFT ); if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG400) MGA_G400_LSLOPE(eBot.idx,eBot.idy,sgn,eBot.err); else MGA_LSLOPE(eBot.idx,eBot.idy,sgn,eBot.err); } mga_out32( mmio, sgn, SGN ); mga_out32( mmio, eBot.lines, LEN | EXECUTE ); } } } #define INVWMAX 128.0F bool matroxTextureTriangles( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ) { int i; MatroxDriverData *mdrv = (MatroxDriverData*) drv; MatroxDeviceData *mdev = (MatroxDeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; u32 dwgctl; float wScale; #if 0 float InvWScale = 1.0f; float nearVal = 1.0f; if (nearVal > 0) { /* limit InvWScale/wMin in (0,INVWMAX] to avoid over- and underflow. InvWScale is used by texture setup in mga_tritemp.h */ int exp2; if (frexp(INVWMAX * nearVal,&exp2) != 0) { if (exp2 >= 2) { InvWScale = 1 << (exp2-1); } else if (exp2 <= 0) { InvWScale = 1.0 / (1 << (-exp2+1)); } } } #else #define InvWScale 128.0f #endif wScale = InvWScale * (float) (1 << 20); for (i=0; ix -= 0.5f; v->y -= 0.5f; v->z *= (float) (1 << 15) * 65535.0f; v->w *= wScale; v->s *= v->w * (float) mdev->w / (float) (1 << mdev->w2); v->t *= v->w * (float) mdev->h / (float) (1 << mdev->h2); } if (mdev->depth_buffer) dwgctl = ATYPE_ZI | ZMODE_ZLTE; else dwgctl = ATYPE_I | ZMODE_NOZCMP; mga_waitfifo( mdrv, mdev, 2 ); mga_out32( mmio, dwgctl | BOP_COPY | SHFTZERO | OP_TEXTURE_TRAP, DWGCTL ); mga_out32( mmio, (0x10<<21) | MAG_BILIN | MIN_ANISO | FILTER_ALPHA, TEXFILTER ); switch (formation) { case DTTF_LIST: for (i=0; i This code originally comes from matroxfb. Relicensed under the LGPL with the authors permission. Adapted for CRTC2 ITU-R 656 mode by Ville Syrjala This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __MATROX_MAVEN_H__ #define __MATROX_MAVEN_H__ typedef struct { char dev[256]; u8 regs[256]; u8 address; } MatroxMavenData; DFBResult maven_init( MatroxMavenData *mav, MatroxDriverData *mdrv ); DFBResult maven_open( MatroxMavenData *mav, MatroxDriverData *mdrv ); void maven_close( MatroxMavenData *mav, MatroxDriverData *mdrv ); void maven_enable( MatroxMavenData *mav, MatroxDriverData *mdrv ); void maven_disable( MatroxMavenData *mav, MatroxDriverData *mdrv ); void maven_sync( MatroxMavenData *mav, MatroxDriverData *mdrv ); void maven_set_regs( MatroxMavenData *mav, MatroxDriverData *mdrv, CoreLayerRegionConfig *config, DFBColorAdjustment *adj ); void maven_set_hue( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 hue ); void maven_set_saturation( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 saturation ); void maven_set_bwlevel( MatroxMavenData *mav, MatroxDriverData *mdrv, u8 brightness, u8 contrast ); #endif DirectFB-1.2.10/gfxdrivers/matrox/Makefile.am0000644000175000017500000000164211245562152015675 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/matrox INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems matrox_LTLIBRARIES = libdirectfb_matrox.la if BUILD_STATIC matrox_DATA = $(matrox_LTLIBRARIES:.la=.o) endif matroxdir = $(MODULEDIR)/gfxdrivers libdirectfb_matrox_la_SOURCES = \ matrox.c \ matrox.h \ matrox_3d.c \ matrox_3d.h \ matrox_bes.c \ matrox_crtc2.c \ matrox_maven.c \ matrox_maven.h \ matrox_screen_crtc2.c \ matrox_spic.c \ matrox_state.c \ matrox_state.h \ regs.h \ mmio.h libdirectfb_matrox_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_matrox_la_LIBADD = -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/matrox/Makefile.in0000644000175000017500000004664011307521500015704 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/matrox ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(matroxdir)" "$(DESTDIR)$(matroxdir)" matroxLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(matrox_LTLIBRARIES) libdirectfb_matrox_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_matrox_la_OBJECTS = matrox.lo matrox_3d.lo \ matrox_bes.lo matrox_crtc2.lo matrox_maven.lo \ matrox_screen_crtc2.lo matrox_spic.lo matrox_state.lo libdirectfb_matrox_la_OBJECTS = $(am_libdirectfb_matrox_la_OBJECTS) libdirectfb_matrox_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_matrox_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_matrox_la_SOURCES) DIST_SOURCES = $(libdirectfb_matrox_la_SOURCES) matroxDATA_INSTALL = $(INSTALL_DATA) DATA = $(matrox_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems matrox_LTLIBRARIES = libdirectfb_matrox.la @BUILD_STATIC_TRUE@matrox_DATA = $(matrox_LTLIBRARIES:.la=.o) matroxdir = $(MODULEDIR)/gfxdrivers libdirectfb_matrox_la_SOURCES = \ matrox.c \ matrox.h \ matrox_3d.c \ matrox_3d.h \ matrox_bes.c \ matrox_crtc2.c \ matrox_maven.c \ matrox_maven.h \ matrox_screen_crtc2.c \ matrox_spic.c \ matrox_state.c \ matrox_state.h \ regs.h \ mmio.h libdirectfb_matrox_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_matrox_la_LIBADD = -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/matrox/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/matrox/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-matroxLTLIBRARIES: $(matrox_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(matroxdir)" || $(MKDIR_P) "$(DESTDIR)$(matroxdir)" @list='$(matrox_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(matroxLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(matroxdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(matroxLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(matroxdir)/$$f"; \ else :; fi; \ done uninstall-matroxLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(matrox_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(matroxdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(matroxdir)/$$p"; \ done clean-matroxLTLIBRARIES: -test -z "$(matrox_LTLIBRARIES)" || rm -f $(matrox_LTLIBRARIES) @list='$(matrox_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_matrox.la: $(libdirectfb_matrox_la_OBJECTS) $(libdirectfb_matrox_la_DEPENDENCIES) $(libdirectfb_matrox_la_LINK) -rpath $(matroxdir) $(libdirectfb_matrox_la_OBJECTS) $(libdirectfb_matrox_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_bes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_crtc2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_maven.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_screen_crtc2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_spic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrox_state.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-matroxDATA: $(matrox_DATA) @$(NORMAL_INSTALL) test -z "$(matroxdir)" || $(MKDIR_P) "$(DESTDIR)$(matroxdir)" @list='$(matrox_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(matroxDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(matroxdir)/$$f'"; \ $(matroxDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(matroxdir)/$$f"; \ done uninstall-matroxDATA: @$(NORMAL_UNINSTALL) @list='$(matrox_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(matroxdir)/$$f'"; \ rm -f "$(DESTDIR)$(matroxdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(matroxdir)" "$(DESTDIR)$(matroxdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-matroxLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-matroxDATA install-matroxLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-matroxDATA uninstall-matroxLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-matroxLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-matroxDATA install-matroxLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-matroxDATA \ uninstall-matroxLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/matrox/matrox.h0000644000175000017500000001000711245562152015317 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MATROX_H__ #define ___MATROX_H__ #include #include #include #define PCI_VENDOR_ID_MATROX 0x102B #define PCI_DEVICE_ID_MATROX_2064W_PCI 0x0519 #define PCI_DEVICE_ID_MATROX_1064SG_PCI 0x051A #define PCI_DEVICE_ID_MATROX_2164W_PCI 0x051B #define PCI_DEVICE_ID_MATROX_1064SG_AGP 0x051E #define PCI_DEVICE_ID_MATROX_2164W_AGP 0x051F #define PCI_DEVICE_ID_MATROX_G100_PCI 0x1000 #define PCI_DEVICE_ID_MATROX_G100_AGP 0x1001 #define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520 #define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521 #define PCI_DEVICE_ID_MATROX_G400_AGP 0x0525 #define PCI_DEVICE_ID_MATROX_G550_AGP 0x2527 typedef enum { m_Source = 0x0001, m_source = 0x0002, m_drawColor = 0x0010, m_blitColor = 0x0020, m_color = 0x0040, m_SrcKey = 0x0100, m_srckey = 0x0200, m_drawBlend = 0x1000, m_blitBlend = 0x2000, m_destination = 0x4000, m_clip = 0x8000, } MatroxStateBits; #define MGA_VALIDATE(b) (mdev->valid |= (b)) #define MGA_INVALIDATE(b) (mdev->valid &= ~(b)) #define MGA_IS_VALID(b) (mdev->valid & (b)) typedef struct { /* Old cards are older than G200/G400, e.g. Mystique or Millennium */ bool old_matrox; /* G450/G550 */ bool g450_matrox; /* G550 */ bool g550_matrox; /* FIFO Monitoring */ unsigned int fifo_space; unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; /* ATYPE_BLK or ATYPE_RSTR, depending on SGRAM setting */ u32 atype_blk_rstr; /* State handling */ MatroxStateBits valid; /* Stored values */ int dst_pitch; int dst_offset[2][3]; int src_pitch; int src_offset[2][3]; int w, h, w2, h2; u32 color[3]; bool draw_blend; bool blit_src_colorkey; bool blit_deinterlace; bool blit_fields; int field; bool depth_buffer; u32 texctl; u32 idle_status; DFBRegion clip; struct { unsigned long offset; unsigned long physical; } fb; unsigned int tlut_offset; CorePalette *rgb332_palette; bool crtc2_separated; } MatroxDeviceData; typedef struct { int accelerator; int maven_fd; volatile u8 *mmio_base; CoreScreen *primary; CoreScreen *secondary; MatroxDeviceData *device_data; } MatroxDriverData; extern DisplayLayerFuncs matroxBesFuncs; extern DisplayLayerFuncs matroxCrtc2Funcs; extern DisplayLayerFuncs matroxSpicFuncs; extern ScreenFuncs matroxCrtc2ScreenFuncs; static inline int mga_log2( int val ) { register int ret = 0; while (val >> ++ret); if ((1 << --ret) < val) ret++; return ret; } #endif DirectFB-1.2.10/gfxdrivers/matrox/mmio.h0000644000175000017500000000626311245562152014757 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __MATROX_MMIO_H__ #define __MATROX_MMIO_H__ #include #include "matrox.h" static inline void mga_out8(volatile u8 *mmioaddr, u8 value, u32 reg) { *((volatile u8*)(mmioaddr+reg)) = value; } static inline void mga_out32(volatile u8 *mmioaddr, u32 value, u32 reg) { #ifdef __powerpc__ asm volatile("stwbrx %0,%1,%2;eieio" : : "r"(value), "b"(reg), "r"(mmioaddr) : "memory"); #else *((volatile u32*)(mmioaddr+reg)) = value; #endif } static inline u8 mga_in8(volatile u8 *mmioaddr, u32 reg) { return *((volatile u8*)(mmioaddr+reg)); } static inline u32 mga_in32(volatile u8 *mmioaddr, u32 reg) { #ifdef __powerpc__ u32 value; asm volatile("lwbrx %0,%1,%2;eieio" : "=r"(value) : "b"(reg), "r"(mmioaddr)); return value; #else return *((volatile u32*)(mmioaddr+reg)); #endif } /* Wait for idle accelerator and DMA */ static inline void mga_waitidle(MatroxDriverData *mdrv, MatroxDeviceData *mdev) { while ((mga_in32(mdrv->mmio_base, STATUS) & (DWGENGSTS | ENDPRDMASTS)) != mdev->idle_status) { mdev->idle_waitcycles++; } } /* Wait for fifo space */ static inline void mga_waitfifo(MatroxDriverData *mdrv, MatroxDeviceData *mdev, unsigned int space) { mdev->waitfifo_sum += space; mdev->waitfifo_calls++; if (mdev->fifo_space < space) { do { /* not needed on a G400, hardware does retries on writing if FIFO is full, but results in DMA problems */ mdev->fifo_space = mga_in32(mdrv->mmio_base, FIFOSTATUS) & 0xff; mdev->fifo_waitcycles++; } while (mdev->fifo_space < space); } else { mdev->fifo_cache_hits++; } mdev->fifo_space -= space; } static inline void mga_out_dac( volatile u8 *mmioaddr, u8 reg, u8 val ) { mga_out8( mmioaddr, reg, DAC_INDEX ); mga_out8( mmioaddr, val, DAC_DATA ); } static inline u8 mga_in_dac( volatile u8 *mmioaddr, u8 reg ) { mga_out8( mmioaddr, reg, DAC_INDEX ); return mga_in8( mmioaddr, DAC_DATA ); } #endif DirectFB-1.2.10/gfxdrivers/matrox/regs.h0000644000175000017500000003277111245562152014761 00000000000000#ifndef __MATROX__REGS_H__ #define __MATROX__REGS_H__ #define U8_TO_F0915(x) (((u32) ((x+1) << 15)) & 0x00FFFFFF) #define RS16(val) ( (u16)((s16)(val))) #define RS18(val) (((u32)((s32)(val)))&0x003ffff) #define RS24(val) (((u32)((s32)(val)))&0x0ffffff) #define RS27(val) (((u32)((s32)(val)))&0x7ffffff) #define DWGSYNC 0x2C4C #define SYNC_DMA_BUSY 0x8325340 /* just a random number */ #define RST 0x1E40 #define OPMODE 0x1E54 #define CACHEFLUSH 0x1FFF /* CRTC2 registers */ #define C2CTL 0x3C10 # define C2EN 0x00000001 # define C2PIXCLKSEL_PCICLK 0x00000000 # define C2PIXCLKSEL_VDOCLK 0x00000002 # define C2PIXCLKSEL_PIXPLL 0x00000004 # define C2PIXCLKSEL_VIDPLL 0x00000006 /* SYSPLL on G400 */ # define C2PIXCLKSEL_VDCLK 0x00004000 /* G450/G550 only */ # define C2PIXCLKSEL_CRISTAL 0x00004002 /* G450/G550 only */ # define C2PIXCLKSEL_SYSPLL 0x00004004 /* G450/G550 only */ # define C2PIXCLKDIS 0x00000008 # define CRTCDACSEL 0x00100000 # define C2DEPTH_15BPP 0x00200000 # define C2DEPTH_16BPP 0x00400000 # define C2DEPTH_32BPP 0x00800000 # define C2DEPTH_YCBCR422 0x00A00000 # define C2DEPTH_YCBCR420 0x00E00000 # define C2VCBCRSINGLE 0x01000000 # define C2INTERLACE 0x02000000 # define C2FIELDLENGTH 0x04000000 # define C2FIELDPOL 0x08000000 # define C2VIDRSTMOD_FALLING 0x00000000 # define C2VIDRSTMOD_RISING 0x10000000 # define C2VIDRSTMOD_BOTH 0x20000000 # define C2HPLOADEN 0x40000000 # define C2VPLOADEN 0x80000000 #define C2HPARAM 0x3C14 #define C2HSYNC 0x3C18 #define C2VPARAM 0x3C1C #define C2VSYNC 0x3C20 #define C2PRELOAD 0x3C24 #define C2STARTADD0 0x3C28 #define C2STARTADD1 0x3C2C #define C2PL2STARTADD0 0x3C30 #define C2PL2STARTADD1 0x3C34 #define C2PL3STARTADD0 0x3C38 #define C2PL3STARTADD1 0x3C3C #define C2OFFSET 0x3C40 #define C2MISC 0x3C44 # define C2HSYNCPOL 0x00000100 # define C2VSYNCPOL 0x00000200 #define C2VCOUNT 0x3C48 # define C2FIELD 0x01000000 #define C2DATACTL 0x3C4C # define C2DITHEN 0x00000001 # define C2YFILTEN 0x00000002 # define C2CBCRFILTEN 0x00000004 # define C2SUBPICEN 0x00000008 # define C2NTSCEN 0x00000010 # define C2STATICKEYEN 0x00000020 # define C2OFFSETDIVEN 0x00000040 # define C2UYVYFMT 0x00000080 # define C2STATICKEY 0x1F000000 #define C2SUBPICLUT 0x3C50 #define C2SPICSTARTADD0 0x3C54 #define C2SPICSTARTADD1 0x3C58 /* Backend scaler registers */ #define BESA1ORG 0x3D00 #define BESA2ORG 0x3D04 #define BESA1CORG 0x3D10 #define BESA2CORG 0x3D14 #define BESA1C3ORG 0x3D60 #define BESA2C3ORG 0x3D64 #define BESCTL 0x3D20 # define BESEN 0x00000001 # define BESV1SRCSTP 0x00000040 # define BESV2SRCSTP 0x00000080 # define BESHFEN 0x00000400 # define BESVFEN 0x00000800 # define BESCUPS 0x00010000 # define BES420PL 0x00020000 #define BESGLOBCTL 0x3DC0 # define BESCORDER 0x00000008 # define BES3PLANE 0x00000020 # define BESUYVYFMT 0x00000040 # define BESPROCAMP 0x00000080 # define BESRGB15 0x00000100 # define BESRGB16 0x00000200 # define BESRGB32 0x00000300 #define BESHCOORD 0x3D28 #define BESHISCAL 0x3D30 #define BESHSRCEND 0x3D3C #define BESHSRCLST 0x3D50 #define BESHSRCST 0x3D38 #define BESLUMACTL 0x3D40 #define BESPITCH 0x3D24 #define BESSTATUS 0x3DC4 #define BESV1SRCLST 0x3D54 #define BESV2SRCLST 0x3D58 #define BESV1WGHT 0x3D48 #define BESV2WGHT 0x3D4C #define BESVCOORD 0x3D2C #define BESVISCAL 0x3D34 /* DAC Registers */ #define DAC_INDEX 0x3C00 #define DAC_DATA 0x3C0A #define MGAREG_VCOUNT 0x1e20 /* Alpha registers */ #define ALPHASTART 0x2C70 #define ALPHAXINC 0x2C74 #define ALPHAYINC 0x2C78 #define ALPHACTRL 0x2C7C #define SRC_ZERO 0x00000000 #define SRC_ONE 0x00000001 #define SRC_DST_COLOR 0x00000002 #define SRC_ONE_MINUS_DST_COLOR 0x00000003 #define SRC_ALPHA 0x00000004 #define SRC_ONE_MINUS_SRC_ALPHA 0x00000005 #define SRC_DST_ALPHA 0x00000006 #define SRC_ONE_MINUS_DST_ALPHA 0x00000007 #define SRC_SRC_ALPHA_SATURATE 0x00000008 #define DST_ZERO 0x00000000 #define DST_ONE 0x00000010 #define DST_SRC_COLOR 0x00000020 #define DST_ONE_MINUS_SRC_COLOR 0x00000030 #define DST_SRC_ALPHA 0x00000040 #define DST_ONE_MINUS_SRC_ALPHA 0x00000050 #define DST_DST_ALPHA 0x00000060 #define DST_ONE_MINUS_DST_ALPHA 0x00000070 #define ALPHACHANNEL 0x00000100 #define VIDEOALPHA 0x00000200 #define DIFFUSEDALPHA 0x01000000 #define MODULATEDALPHA 0x02000000 /* Texture registers */ #define TEXCTL 0x2C30 #define TEXCTL2 0x2C3C #define TEXFILTER 0x2C58 #define TEXWIDTH 0x2C28 #define TEXHEIGHT 0x2C2C #define TEXORG 0x2C24 #define TEXORG1 0x2CA4 #define TEXORG2 0x2CA8 #define TEXORG3 0x2CAC #define TEXORG4 0x2CB0 #define TEXTRANS 0x2C34 #define TEXTRANSHIGH 0x2C38 #define TDUALSTAGE0 0x2CF8 #define TDUALSTAGE1 0x2CFC #define TMR0 0x2C00 #define TMR1 0x2C04 #define TMR2 0x2C08 #define TMR3 0x2C0C #define TMR4 0x2C10 #define TMR5 0x2C14 #define TMR6 0x2C18 #define TMR7 0x2C1C #define TMR8 0x2C20 #define CUR_XWINDOWS 0x03 /* TEXCTL */ #define TW4 0x00000000 #define TW8 0x00000001 #define TW15 0x00000002 #define TW16 0x00000003 #define TW12 0x00000004 #define TW32 0x00000006 #define TW8A 0x00000007 #define TW8AL 0x00000008 #define TW422 0x0000000A #define TW422UYVY 0x0000000B #define TFORMAT 0x0000000F #define TPITCHLIN 0x00000100 #define TPITCHEXT 0x000FFE00 #define NOPERSPECTIVE 0x00200000 #define TAKEY 0x02000000 #define TAMASK 0x04000000 #define CLAMPUV 0x18000000 #define DECALCKEY 0x01000000 #define TMODULATE 0x20000000 #define STRANS 0x40000000 /* TEXTCTL2 */ #define IDECAL 0x00000002 #define DECALDIS 0x00000004 #define CKSTRANSDIS 0x00000010 /* TEXFILTER */ #define MIN_NRST 0x00000000 #define MIN_BILIN 0x00000002 #define MIN_ANISO 0x0000000D #define MAG_NRST 0x00000000 #define MAG_BILIN 0x00000020 #define FILTER_ALPHA 0x00100000 /* SGN */ #define SGN_BRKLEFT 0x00000100 #define DSTORG 0x2cb8 #define SRCORG 0x2cb4 #define MACCESS 0x1C04 # define PW8 0x00000000 # define PW16 0x00000001 # define PW32 0x00000002 # define PW24 0x00000003 # define ZW16 0x00000000 # define ZW32 0x00000008 # define ZW15 0x00000010 # define ZW24 0x00000018 # define BYPASS332 0x10000000 # define TLUTLOAD 0x20000000 # define NODITHER 0x40000000 # define DIT555 0x80000000 #define EXECUTE 0x100 /* or with register to execute a programmed accel command */ #define DWGCTL 0x1C00 /* Drawing control */ /* opcod - Operation code */ # define OP_LINE_OPEN 0x00 # define OP_AUTOLINE_OPEN 0x01 # define OP_LINE_CLOSE 0x02 # define OP_AUTOLINE_CLOSE 0x03 # define OP_TRAP 0x04 # define OP_TRAP_ILOAD 0x05 # define OP_TEXTURE_TRAP 0x06 # define OP_ILOAD_HIQH 0x07 # define OP_BITBLT 0x08 # define OP_ILOAD 0x09 # define OP_IDUMP 0x0A # define OP_FBITBLT 0x0C # define OP_ILOAD_SCALE 0x0D # define OP_ILOAD_HIQHV 0x0E # define OP_ILOAD_FILTER 0x0F /* atype - Access type */ # define ATYPE_RPL 0x00 # define ATYPE_RSTR 0x10 # define ATYPE_ZI 0x30 # define ATYPE_BLK 0x40 # define ATYPE_I 0x70 /* Flag */ # define LINEAR 0x80 # define NOCLIP (1<<31) # define TRANSC (1<<30) /* zmode - Z drawing mode */ # define ZMODE_NOZCMP 0x000 # define ZMODE_ZE 0x200 # define ZMODE_ZNE 0x300 # define ZMODE_ZLT 0x400 # define ZMODE_ZLTE 0x500 # define ZMODE_ZGT 0x600 # define ZMODE_ZGTE 0x700 /* Flags */ # define SOLID 0x0800 # define ARZERO 0x1000 # define SGNZERO 0x2000 # define SHFTZERO 0x4000 /* bop - Boolean operation */ # define BOP_CLEAR 0x00000 # define BOP_NOR 0x10000 # define BOP_COPYINV 0x30000 # define BOP_INVERT 0x50000 # define BOP_XOR 0x60000 # define BOP_NAND 0x70000 # define BOP_AND 0x80000 # define BOP_EQUIV 0x90000 # define BOP_NOOP 0xA0000 # define BOP_IMP 0xB0000 # define BOP_COPY 0xC0000 # define BOP_OR 0xE0000 # define BOP_SET 0xF0000 /* bltmod - Blit mode selection */ # define BLTMOD_BMONOLEF 0x00000000 # define BLTMOD_BMONOWF 0x08000000 # define BLTMOD_BPLAN 0x02000000 # define BLTMOD_BFCOL 0x04000000 # define BLTMOD_BUYUV 0x1C000000 # define BLTMOD_BU32BGR 0x06000000 # define BLTMOD_BU32RGB 0x0E000000 # define BLTMOD_BU24BGR 0x16000000 # define BLTMOD_BU24RGB 0x1E000000 #define ZORG 0x1C0C #define PAT0 0x1C10 #define PAT1 0x1C14 #define PLNWT 0x1C1C #define BCOL 0x1C20 #define FCOL 0x1C24 #define SRC0 0x1C30 #define SRC1 0x1C34 #define SRC2 0x1C38 #define SRC3 0x1C3C #define XYSTRT 0x1C40 #define XYEND 0x1C44 #define SHIFT 0x1C50 #define DMAPAD 0x1C54 #define SGN 0x1C58 #define LEN 0x1C5C #define AR0 0x1C60 #define AR1 0x1C64 #define AR2 0x1C68 #define AR3 0x1C6C #define AR4 0x1C70 #define AR5 0x1C74 #define AR6 0x1C78 #define CXBNDRY 0x1C80 #define FXBNDRY 0x1C84 #define YDSTLEN 0x1C88 #define PITCH 0x1C8C #define YDST 0x1C90 #define YDSTORG 0x1C94 #define YTOP 0x1C98 #define YBOT 0x1C9C #define CXLEFT 0x1CA0 #define CXRIGHT 0x1CA4 #define FXLEFT 0x1CA8 #define FXRIGHT 0x1CAC #define XDST 0x1CB0 #define DR0 0x1CC0 #define DR2 0x1CC8 #define DR3 0x1CCC #define DR4 0x1CD0 #define DR6 0x1CD8 #define DR7 0x1CDC #define DR8 0x1CE0 #define WO 0x1CE4 #define DR10 0x1CE8 #define DR11 0x1CEC #define DR12 0x1CF0 #define DR14 0x1CF8 #define DR15 0x1CFC #define FIFOSTATUS 0x1E10 #define STATUS 0x1E14 # define DWGENGSTS 0x10000 # define ENDPRDMASTS 0x20000 #define IEN 0x1E1C #define BLIT_LEFT 1 #define BLIT_UP 4 #define SDXL 0x0002 #define SDXR 0x0020 /* DAC registers */ #define XMISCCTRL 0x1E # define DACPDN 0x01 # define MFCSEL_MAFC 0x02 # define MFCSEL_PANELLINK 0x04 # define MFCSEL_DIS 0x06 # define MFCSEL_MASK 0x06 # define VGA8DAC 0x08 # define RAMCS 0x10 # define VDOUTSEL_MAFC12 0x00 # define VDOUTSEL_BYPASS656 0x40 # define VDOUTSEL_CRTC2RGB 0x80 # define VDOUTSEL_CRTC2656 0xC0 # define VDOUTSEL_MASK 0xE0 #define XGENIOCTRL 0x2A #define XGENIODATA 0x2B #define XKEYOPMODE 0x51 #define XCOLMSK0RED 0x52 #define XCOLMSK0GREEN 0x53 #define XCOLMSK0BLUE 0x54 #define XCOLKEY0RED 0x55 #define XCOLKEY0GREEN 0x56 #define XCOLKEY0BLUE 0x57 #define XDISPCTRL 0x8A # define DAC1OUTSEL_DIS 0x00 # define DAC1OUTSEL_EN 0x01 # define DAC1OUTSEL_MASK 0x01 # define DAC2OUTSEL_DIS 0x00 # define DAC2OUTSEL_CRTC1 0x04 # define DAC2OUTSEL_CRTC2 0x08 # define DAC2OUTSEL_TVE 0x0C # define DAC2OUTSEL_MASK 0x0C # define PANOUTSEL_DIS 0x00 # define PANOUTSEL_CRTC1 0x20 # define PANOUTSEL_CRTC2RGB 0x40 # define PANOUTSEL_CRTC2656 0x60 # define PANOUTSEL_MASK 0x60 #define XSYNCCTRL 0x8B # define DAC1HSOFF 0x01 # define DAC1VSOFF 0x02 # define DAC1HSPOL 0x04 # define DAC1VSPOL 0x08 # define DAC2HSOFF 0x10 # define DAC2VSOFF 0x20 # define DAC2HSPOL 0x40 # define DAC2VSPOL 0x80 #define XPWRCTRL 0xA0 # define DAC2PDN 0x01 # define VIDPLLPDN 0x02 # define PANPDN 0x04 # define RFIFOPDN 0x08 # define CFIFOPDN 0x10 #endif DirectFB-1.2.10/gfxdrivers/matrox/matrox_bes.c0000644000175000017500000005402711245562152016155 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "matrox.h" typedef struct { CoreLayerRegionConfig config; /* Stored registers */ struct { /* BES */ u32 besGLOBCTL; u32 besA1ORG; u32 besA2ORG; u32 besA1CORG; u32 besA2CORG; u32 besA1C3ORG; u32 besA2C3ORG; u32 besCTL; u32 besCTL_field; u32 besHCOORD; u32 besVCOORD; u32 besHSRCST; u32 besHSRCEND; u32 besHSRCLST; u32 besPITCH; u32 besV1WGHT; u32 besV2WGHT; u32 besV1SRCLST; u32 besV2SRCLST; u32 besVISCAL; u32 besHISCAL; u8 xKEYOPMODE; } regs; } MatroxBesLayerData; static void bes_set_regs( MatroxDriverData *mdrv, MatroxBesLayerData *mbes, bool onsync ); static void bes_calc_regs( MatroxDriverData *mdrv, MatroxBesLayerData *mbes, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); #define BES_SUPPORTED_OPTIONS (DLOP_DEINTERLACING | DLOP_DST_COLORKEY) /**********************/ static int besLayerDataSize( void ) { return sizeof(MatroxBesLayerData); } static DFBResult besInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; volatile u8 *mmio = mdrv->mmio_base; /* set capabilities and type */ description->caps = DLCAPS_SCREEN_LOCATION | DLCAPS_SURFACE | DLCAPS_DEINTERLACING | DLCAPS_DST_COLORKEY; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Matrox Backend Scaler" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; adjustment->flags = DCAF_NONE; if (mdrv->accelerator != FB_ACCEL_MATROX_MGAG200) { description->caps |= DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ adjustment->flags |= DCAF_BRIGHTNESS | DCAF_CONTRAST; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; mga_out32( mmio, 0x80, BESLUMACTL ); } /* make sure BES registers get updated (besvcnt) */ mga_out32( mmio, 0, BESGLOBCTL ); /* disable backend scaler */ mga_out32( mmio, 0, BESCTL ); /* set defaults */ mga_out_dac( mmio, XKEYOPMODE, 0x00 ); /* keying off */ mga_out_dac( mmio, XCOLMSK0RED, 0xFF ); /* full mask */ mga_out_dac( mmio, XCOLMSK0GREEN, 0xFF ); mga_out_dac( mmio, XCOLMSK0BLUE, 0xFF ); mga_out_dac( mmio, XCOLKEY0RED, 0x00 ); /* default to black */ mga_out_dac( mmio, XCOLKEY0GREEN, 0x00 ); mga_out_dac( mmio, XCOLKEY0BLUE, 0x00 ); return DFB_OK; } static DFBResult besTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxDeviceData *mdev = mdrv->device_data; int max_width = mdev->g450_matrox ? 2048 : 1024; int max_height = 1024; CoreLayerRegionConfigFlags fail = 0; if (config->options & ~BES_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; if (config->surface_caps & ~(DSCAPS_INTERLACED | DSCAPS_SEPARATED)) fail |= CLRCF_SURFACE_CAPS; if (config->options & DLOP_DEINTERLACING) { /* make sure BESPITCH < 4096 */ if (mdev->g450_matrox && !(config->surface_caps & DSCAPS_SEPARATED)) max_width = 2048 - 128; max_height = 2048; } else { if (config->surface_caps & DSCAPS_SEPARATED) fail |= CLRCF_SURFACE_CAPS; } switch (config->format) { case DSPF_YUY2: case DSPF_NV12: case DSPF_NV21: break; case DSPF_ARGB: case DSPF_RGB32: if (!mdev->g450_matrox) max_width = 512; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_UYVY: case DSPF_I420: case DSPF_YV12: /* these formats are not supported by G200 */ if (mdrv->accelerator != FB_ACCEL_MATROX_MGAG200) break; default: fail |= CLRCF_FORMAT; } switch (config->format) { case DSPF_I420: case DSPF_YV12: case DSPF_NV12: case DSPF_NV21: if (config->height & 1) fail |= CLRCF_HEIGHT; case DSPF_YUY2: case DSPF_UYVY: if (config->width & 1) fail |= CLRCF_WIDTH; default: break; } if (config->width > max_width || config->width < 1) fail |= CLRCF_WIDTH; if (config->height > max_height || config->height < 1) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult besSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxBesLayerData *mbes = (MatroxBesLayerData*) layer_data; volatile u8 *mmio = mdrv->mmio_base; /* remember configuration */ mbes->config = *config; /* set main configuration */ if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_OPTIONS | CLRCF_DEST | CLRCF_OPACITY | CLRCF_SOURCE)) { bes_calc_regs( mdrv, mbes, config, surface, lock ); bes_set_regs( mdrv, mbes, true ); } /* set color key */ if (updated & CLRCF_DSTKEY) { DFBColorKey key = config->dst_key; switch (dfb_primary_layer_pixelformat()) { case DSPF_RGB555: case DSPF_ARGB1555: key.r >>= 3; key.g >>= 3; key.b >>= 3; break; case DSPF_RGB16: key.r >>= 3; key.g >>= 2; key.b >>= 3; break; default: ; } mga_out_dac( mmio, XCOLKEY0RED, key.r ); mga_out_dac( mmio, XCOLKEY0GREEN, key.g ); mga_out_dac( mmio, XCOLKEY0BLUE, key.b ); } return DFB_OK; } static DFBResult besRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; volatile u8 *mmio = mdrv->mmio_base; /* make sure BES registers get updated (besvcnt) */ mga_out32( mmio, 0, BESGLOBCTL ); /* disable backend scaler */ mga_out32( mmio, 0, BESCTL ); return DFB_OK; } static DFBResult besFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxBesLayerData *mbes = (MatroxBesLayerData*) layer_data; bes_calc_regs( mdrv, mbes, &mbes->config, surface, lock ); bes_set_regs( mdrv, mbes, flags & DSFLIP_ONSYNC ); dfb_surface_flip( surface, false ); if (flags & DSFLIP_WAIT) dfb_screen_wait_vsync( mdrv->primary ); return DFB_OK; } static DFBResult besSetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; volatile u8 *mmio = mdrv->mmio_base; if (mdrv->accelerator == FB_ACCEL_MATROX_MGAG200) return DFB_UNSUPPORTED; mga_out32( mmio, (adj->contrast >> 8) | ((u8)(((int)adj->brightness >> 8) - 128)) << 16, BESLUMACTL ); return DFB_OK; } static DFBResult besSetInputField( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxBesLayerData *mbes = (MatroxBesLayerData*) layer_data; mbes->regs.besCTL_field = field ? 0x2000000 : 0; mga_out32( mdrv->mmio_base, mbes->regs.besCTL | mbes->regs.besCTL_field, BESCTL ); return DFB_OK; } DisplayLayerFuncs matroxBesFuncs = { .LayerDataSize = besLayerDataSize, .InitLayer = besInitLayer, .TestRegion = besTestRegion, .SetRegion = besSetRegion, .RemoveRegion = besRemoveRegion, .FlipRegion = besFlipRegion, .SetColorAdjustment = besSetColorAdjustment, .SetInputField = besSetInputField, }; /* internal */ static void bes_set_regs( MatroxDriverData *mdrv, MatroxBesLayerData *mbes, bool onsync ) { int line = 0; volatile u8 *mmio = mdrv->mmio_base; VideoMode *mode = dfb_system_current_mode(); if (!mode) { mode = dfb_system_modes(); if (!mode) return; } line = onsync ? mode->yres : (mga_in32( mmio, MGAREG_VCOUNT ) + 48); if (line > mode->yres) line = mode->yres; mga_out32( mmio, mbes->regs.besGLOBCTL | (line << 16), BESGLOBCTL); mga_out32( mmio, mbes->regs.besA1ORG, BESA1ORG ); mga_out32( mmio, mbes->regs.besA2ORG, BESA2ORG ); mga_out32( mmio, mbes->regs.besA1CORG, BESA1CORG ); mga_out32( mmio, mbes->regs.besA2CORG, BESA2CORG ); if (mdrv->accelerator != FB_ACCEL_MATROX_MGAG200) { mga_out32( mmio, mbes->regs.besA1C3ORG, BESA1C3ORG ); mga_out32( mmio, mbes->regs.besA2C3ORG, BESA2C3ORG ); } mga_out32( mmio, mbes->regs.besCTL | mbes->regs.besCTL_field, BESCTL ); mga_out32( mmio, mbes->regs.besHCOORD, BESHCOORD ); mga_out32( mmio, mbes->regs.besVCOORD, BESVCOORD ); mga_out32( mmio, mbes->regs.besHSRCST, BESHSRCST ); mga_out32( mmio, mbes->regs.besHSRCEND, BESHSRCEND ); mga_out32( mmio, mbes->regs.besHSRCLST, BESHSRCLST ); mga_out32( mmio, mbes->regs.besPITCH, BESPITCH ); mga_out32( mmio, mbes->regs.besV1WGHT, BESV1WGHT ); mga_out32( mmio, mbes->regs.besV2WGHT, BESV2WGHT ); mga_out32( mmio, mbes->regs.besV1SRCLST, BESV1SRCLST ); mga_out32( mmio, mbes->regs.besV2SRCLST, BESV2SRCLST ); mga_out32( mmio, mbes->regs.besVISCAL, BESVISCAL ); mga_out32( mmio, mbes->regs.besHISCAL, BESHISCAL ); mga_out_dac( mmio, XKEYOPMODE, mbes->regs.xKEYOPMODE ); } static void bes_calc_regs( MatroxDriverData *mdrv, MatroxBesLayerData *mbes, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { MatroxDeviceData *mdev = mdrv->device_data; int cropleft, cropright, croptop, cropbot, croptop_uv; int pitch, tmp, hzoom, intrep, field_height, field_offset; DFBRectangle source, dest; DFBRegion dst; bool visible; VideoMode *mode = dfb_system_current_mode(); if (!mode) { mode = dfb_system_modes(); if (!mode) { D_BUG( "No current and no default mode" ); return; } } source = config->source; dest = config->dest; if (!mdev->g450_matrox && (surface->config.format == DSPF_RGB32 || surface->config.format == DSPF_ARGB)) dest.w = source.w; pitch = lock->pitch; field_height = surface->config.size.h; if (config->options & DLOP_DEINTERLACING) { field_height /= 2; source.y /= 2; source.h /= 2; if (!(surface->config.caps & DSCAPS_SEPARATED)) pitch *= 2; } else mbes->regs.besCTL_field = 0; /* destination region */ dst.x1 = dest.x; dst.y1 = dest.y; dst.x2 = dest.x + dest.w - 1; dst.y2 = dest.y + dest.h - 1; visible = dfb_region_intersect( &dst, 0, 0, mode->xres - 1, mode->yres - 1 ); /* calculate destination cropping */ cropleft = -dest.x; croptop = -dest.y; cropright = dest.x + dest.w - mode->xres; cropbot = dest.y + dest.h - mode->yres; cropleft = cropleft > 0 ? cropleft : 0; croptop = croptop > 0 ? croptop : 0; cropright = cropright > 0 ? cropright : 0; cropbot = cropbot > 0 ? cropbot : 0; croptop_uv = croptop; /* scale crop values to source dimensions */ if (cropleft) cropleft = ((u64) (source.w << 16) * cropleft / dest.w) & ~0x3; if (croptop) croptop = ((u64) (source.h << 16) * croptop / dest.h) & ~0x3; if (cropright) cropright = ((u64) (source.w << 16) * cropright / dest.w) & ~0x3; if (cropbot) cropbot = ((u64) (source.h << 16) * cropbot / dest.h) & ~0x3; if (croptop_uv) croptop_uv = ((u64) ((source.h/2) << 16) * croptop_uv / dest.h) & ~0x3; /* should horizontal zoom be used? */ if (mdev->g450_matrox) hzoom = (1000000/mode->pixclock >= 234) ? 1 : 0; else hzoom = (1000000/mode->pixclock >= 135) ? 1 : 0; /* initialize */ mbes->regs.besGLOBCTL = 0; /* enable/disable depending on opacity */ mbes->regs.besCTL = (config->opacity && visible) ? BESEN : 0; /* pixel format settings */ switch (surface->config.format) { case DSPF_YV12: mbes->regs.besGLOBCTL |= BESCORDER; /* fall through */ case DSPF_I420: mbes->regs.besGLOBCTL |= BESPROCAMP | BES3PLANE; mbes->regs.besCTL |= BESHFEN | BESVFEN | BESCUPS | BES420PL; break; case DSPF_NV21: mbes->regs.besGLOBCTL |= BESCORDER; /* fall through */ case DSPF_NV12: mbes->regs.besGLOBCTL |= BESPROCAMP; mbes->regs.besCTL |= BESHFEN | BESVFEN | BESCUPS | BES420PL; break; case DSPF_UYVY: mbes->regs.besGLOBCTL |= BESUYVYFMT; /* fall through */ case DSPF_YUY2: mbes->regs.besGLOBCTL |= BESPROCAMP; mbes->regs.besCTL |= BESHFEN | BESVFEN | BESCUPS; break; case DSPF_RGB555: case DSPF_ARGB1555: mbes->regs.besGLOBCTL |= BESRGB15; break; case DSPF_RGB16: mbes->regs.besGLOBCTL |= BESRGB16; break; case DSPF_ARGB: case DSPF_RGB32: mbes->regs.besGLOBCTL |= BESRGB32; break; default: D_BUG( "unexpected pixelformat" ); return; } if (surface->config.size.w > 1024) mbes->regs.besCTL &= ~BESVFEN; mbes->regs.besGLOBCTL |= 3*hzoom | (mode->yres & 0xFFF) << 16; mbes->regs.besPITCH = pitch / DFB_BYTES_PER_PIXEL(surface->config.format); /* buffer offsets */ field_offset = lock->pitch; if (surface->config.caps & DSCAPS_SEPARATED) field_offset *= surface->config.size.h / 2; mbes->regs.besA1ORG = lock->offset + pitch * (source.y + (croptop >> 16)); mbes->regs.besA2ORG = mbes->regs.besA1ORG + field_offset; switch (surface->config.format) { case DSPF_NV12: case DSPF_NV21: field_offset = lock->pitch; if (surface->config.caps & DSCAPS_SEPARATED) field_offset *= surface->config.size.h / 4; mbes->regs.besA1CORG = lock->offset + surface->config.size.h * lock->pitch + pitch * (source.y/2 + (croptop_uv >> 16)); mbes->regs.besA2CORG = mbes->regs.besA1CORG + field_offset; break; case DSPF_I420: case DSPF_YV12: field_offset = lock->pitch / 2; if (surface->config.caps & DSCAPS_SEPARATED) field_offset *= surface->config.size.h / 4; mbes->regs.besA1CORG = lock->offset + surface->config.size.h * lock->pitch + pitch/2 * (source.y/2 + (croptop_uv >> 16)); mbes->regs.besA2CORG = mbes->regs.besA1CORG + field_offset; mbes->regs.besA1C3ORG = mbes->regs.besA1CORG + surface->config.size.h/2 * lock->pitch/2; mbes->regs.besA2C3ORG = mbes->regs.besA1C3ORG + field_offset; break; default: ; } mbes->regs.besHCOORD = (dst.x1 << 16) | dst.x2; mbes->regs.besVCOORD = (dst.y1 << 16) | dst.y2; mbes->regs.besHSRCST = (source.x << 16) + cropleft; mbes->regs.besHSRCEND = ((source.x + source.w - 1) << 16) - cropright; mbes->regs.besHSRCLST = (surface->config.size.w - 1) << 16; /* vertical starting weights */ tmp = croptop & 0xfffc; mbes->regs.besV1WGHT = tmp; if (tmp >= 0x8000) { tmp = tmp - 0x8000; /* fields start on the same line */ if ((source.y + (croptop >> 16)) & 1) mbes->regs.besCTL |= BESV1SRCSTP | BESV2SRCSTP; } else { tmp = 0x10000 | (0x8000 - tmp); /* fields start on alternate lines */ if ((source.y + (croptop >> 16)) & 1) mbes->regs.besCTL |= BESV1SRCSTP; else mbes->regs.besCTL |= BESV2SRCSTP; } mbes->regs.besV2WGHT = tmp; mbes->regs.besV1SRCLST = mbes->regs.besV2SRCLST = field_height - 1 - source.y - (croptop >> 16); /* horizontal scaling */ if (!mdev->g450_matrox && (surface->config.format == DSPF_RGB32 || surface->config.format == DSPF_ARGB)) { mbes->regs.besHISCAL = 0x20000 << hzoom; mbes->regs.besHSRCST *= 2; mbes->regs.besHSRCEND *= 2; mbes->regs.besHSRCLST *= 2; mbes->regs.besPITCH *= 2; } else { intrep = ((mbes->regs.besCTL & BESHFEN) || (source.w > dest.w)) ? 1 : 0; if ((dest.w == source.w) || (dest.w < 2)) intrep = 0; tmp = (((source.w - intrep) << 16) / (dest.w - intrep)) << hzoom; if (tmp >= (32 << 16)) tmp = (32 << 16) - 1; mbes->regs.besHISCAL = tmp & 0x001ffffc; } /* vertical scaling */ intrep = ((mbes->regs.besCTL & BESVFEN) || (source.h > dest.h)) ? 1 : 0; if ((dest.h == source.h) || (dest.h < 2)) intrep = 0; tmp = ((source.h - intrep) << 16) / (dest.h - intrep); if(tmp >= (32 << 16)) tmp = (32 << 16) - 1; mbes->regs.besVISCAL = tmp & 0x001ffffc; /* enable color keying? */ mbes->regs.xKEYOPMODE = (config->options & DLOP_DST_COLORKEY) ? 1 : 0; } DirectFB-1.2.10/gfxdrivers/matrox/matrox_spic.c0000644000175000017500000002355711245562152016346 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "matrox.h" typedef struct { CoreLayerRegionConfig config; /* Stored registers */ struct { /* CRTC2 sub picture */ u32 c2DATACTL; u32 c2SPICSTARTADD0; u32 c2SPICSTARTADD1; u32 c2SUBPICLUT; } regs; } MatroxSpicLayerData; static void spic_calc_buffer( MatroxDriverData *mdrv, MatroxSpicLayerData *mspic, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void spic_set_buffer( MatroxDriverData *mdrv, MatroxSpicLayerData *mspic ); #define SPIC_SUPPORTED_OPTIONS (DLOP_ALPHACHANNEL | DLOP_OPACITY) /**********************/ static int spicLayerDataSize( void ) { return sizeof(MatroxSpicLayerData); } static DFBResult spicInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Matrox CRTC2 Sub-Picture" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS | DLCONF_SURFACE_CAPS; config->width = 720; config->height = (dfb_config->matrox_tv_std != DSETV_PAL) ? 480 : 576; config->pixelformat = DSPF_ALUT44; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; config->surface_caps = DSCAPS_INTERLACED; return DFB_OK; } static DFBResult spicTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; if (config->options & ~SPIC_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; /* Can't have both at the same time */ if (config->options & DLOP_ALPHACHANNEL && config->options & DLOP_OPACITY) fail |= CLRCF_OPTIONS; switch (config->opacity) { case 0x00: case 0xFF: break; default: if (!(config->options & DLOP_OPACITY)) fail |= CLRCF_OPACITY; } if (config->surface_caps & ~(DSCAPS_INTERLACED | DSCAPS_SEPARATED)) fail |= CLRCF_SURFACE_CAPS; if (config->format != DSPF_ALUT44) fail |= CLRCF_FORMAT; if (config->width != 720) fail |= CLRCF_WIDTH; if (config->surface_caps & DSCAPS_INTERLACED) { if (config->height != ((dfb_config->matrox_tv_std != DSETV_PAL) ? 480 : 576)) fail |= CLRCF_HEIGHT; } else { if (config->height != ((dfb_config->matrox_tv_std != DSETV_PAL) ? 240 : 288)) fail |= CLRCF_HEIGHT; } if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult spicAddRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config ) { return DFB_OK; } static DFBResult spicSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxSpicLayerData *mspic = (MatroxSpicLayerData*) layer_data; MatroxDeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; /* remember configuration */ mspic->config = *config; if (updated & CLRCF_PALETTE) { u8 y, cb, cr; int i; for (i = 0; i < 16; i++) { RGB_TO_YCBCR( palette->entries[i].r, palette->entries[i].g, palette->entries[i].b, y, cb, cr ); mspic->regs.c2SUBPICLUT = (cr << 24) | (cb << 16) | (y << 8) | i; mga_out32( mmio, mspic->regs.c2SUBPICLUT, C2SUBPICLUT ); } } if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_SURFACE_CAPS | CLRCF_OPTIONS | CLRCF_OPACITY | CLRCF_SURFACE)) { spic_calc_buffer( mdrv, mspic, surface, lock ); spic_set_buffer( mdrv, mspic ); mspic->regs.c2DATACTL = mga_in32( mmio, C2DATACTL ); if (surface->config.caps & DSCAPS_INTERLACED || mdev->crtc2_separated) mspic->regs.c2DATACTL &= ~C2OFFSETDIVEN; else mspic->regs.c2DATACTL |= C2OFFSETDIVEN; if (config->opacity) mspic->regs.c2DATACTL |= C2SUBPICEN; else mspic->regs.c2DATACTL &= ~C2SUBPICEN; if (config->options & DLOP_ALPHACHANNEL) mspic->regs.c2DATACTL &= ~C2STATICKEYEN; else mspic->regs.c2DATACTL |= C2STATICKEYEN; mspic->regs.c2DATACTL &= ~C2STATICKEY; mspic->regs.c2DATACTL |= ((config->opacity + 1) << 20) & C2STATICKEY; mga_out32( mmio, mspic->regs.c2DATACTL, C2DATACTL); } return DFB_OK; } static DFBResult spicRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxSpicLayerData *mspic = (MatroxSpicLayerData*) layer_data; volatile u8 *mmio = mdrv->mmio_base; mspic->regs.c2DATACTL = mga_in32( mmio, C2DATACTL ); mspic->regs.c2DATACTL &= ~C2SUBPICEN; mga_out32( mmio, mspic->regs.c2DATACTL, C2DATACTL ); return DFB_OK; } static DFBResult spicFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxSpicLayerData *mspic = (MatroxSpicLayerData*) layer_data; spic_calc_buffer( mdrv, mspic, surface, lock ); spic_set_buffer( mdrv, mspic ); dfb_surface_flip( surface, false ); return DFB_OK; } DisplayLayerFuncs matroxSpicFuncs = { .LayerDataSize = spicLayerDataSize, .InitLayer = spicInitLayer, .TestRegion = spicTestRegion, .AddRegion = spicAddRegion, .SetRegion = spicSetRegion, .RemoveRegion = spicRemoveRegion, .FlipRegion = spicFlipRegion, }; /* internal */ static void spic_calc_buffer( MatroxDriverData *mdrv, MatroxSpicLayerData *mspic, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { unsigned int field_offset = lock->pitch; mspic->regs.c2SPICSTARTADD1 = lock->offset; mspic->regs.c2SPICSTARTADD0 = lock->offset; if (surface->config.caps & DSCAPS_SEPARATED) field_offset *= surface->config.size.h / 2; if (surface->config.caps & DSCAPS_INTERLACED) mspic->regs.c2SPICSTARTADD0 += field_offset; } static void spic_set_buffer( MatroxDriverData *mdrv, MatroxSpicLayerData *mspic ) { volatile u8 *mmio = mdrv->mmio_base; mga_out32( mmio, mspic->regs.c2SPICSTARTADD0, C2SPICSTARTADD0 ); mga_out32( mmio, mspic->regs.c2SPICSTARTADD1, C2SPICSTARTADD1 ); } DirectFB-1.2.10/gfxdrivers/matrox/matrox_crtc2.c0000644000175000017500000005702011245562152016415 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "matrox.h" #include "matrox_maven.h" typedef struct { CoreLayerRegionConfig config; DFBColorAdjustment adj; int field; /* Stored registers */ struct { /* CRTC2 */ u32 c2CTL; u32 c2DATACTL; u32 c2MISC; u32 c2OFFSET; u32 c2HPARAM; u32 c2VPARAM; u32 c2STARTADD0; u32 c2STARTADD1; u32 c2PL2STARTADD0; u32 c2PL2STARTADD1; u32 c2PL3STARTADD0; u32 c2PL3STARTADD1; } regs; MatroxMavenData mav; } MatroxCrtc2LayerData; static void crtc2_set_regs ( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ); static void crtc2_calc_regs ( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void crtc2_calc_buffer ( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void crtc2_set_buffer ( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ); static DFBResult crtc2_disable_output( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ); static DFBResult crtc2_enable_output ( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ); #define CRTC2_SUPPORTED_OPTIONS (DLOP_FIELD_PARITY) /**********************/ static int crtc2LayerDataSize( void ) { return sizeof(MatroxCrtc2LayerData); } static const DFBColorAdjustment adjustments[2][2] = { /* G400 */ { /* PAL / PAL-60 */ { .flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_HUE | DCAF_SATURATION, .brightness = 0xA800, .saturation = 0x9500, .contrast = 0xFF00, .hue = 0x0000, }, /* NTSC */ { .flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_HUE | DCAF_SATURATION, .brightness = 0xB500, .saturation = 0x8E00, .contrast = 0xEA00, .hue = 0x0000, } }, /* G450 / G550 */ { /* PAL / PAL-60 */ { .flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_HUE | DCAF_SATURATION, .brightness = 0x9E00, .saturation = 0xBB00, .contrast = 0xFF00, .hue = 0x0000, }, /* NTSC */ { .flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_HUE | DCAF_SATURATION, .brightness = 0xAA00, .saturation = 0xAE00, .contrast = 0xEA00, .hue = 0x0000, } } }; static DFBResult crtc2InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxCrtc2LayerData *mcrtc2 = (MatroxCrtc2LayerData*) layer_data; MatroxDeviceData *mdev = mdrv->device_data; MatroxMavenData *mav = &mcrtc2->mav; DFBResult res; if ((res = maven_init( mav, mdrv )) != DFB_OK) return res; /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_FIELD_PARITY | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST | DLCAPS_HUE | DLCAPS_SATURATION | DLCAPS_ALPHA_RAMP; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Matrox CRTC2 Layer" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS | DLCONF_SURFACE_CAPS; config->width = 720; config->height = (dfb_config->matrox_tv_std != DSETV_PAL) ? 480 : 576; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; config->surface_caps = DSCAPS_INTERLACED; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ *adjustment = adjustments[mdev->g450_matrox][dfb_config->matrox_tv_std == DSETV_NTSC]; /* remember color adjustment */ mcrtc2->adj = *adjustment; return DFB_OK; } static DFBResult crtc2TestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; if (config->options & ~CRTC2_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; if (config->surface_caps & ~(DSCAPS_INTERLACED | DSCAPS_SEPARATED)) fail |= CLRCF_SURFACE_CAPS; switch (config->format) { case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_YUY2: case DSPF_UYVY: case DSPF_I420: case DSPF_YV12: break; default: fail |= CLRCF_FORMAT; } if (config->width != 720) fail |= CLRCF_WIDTH; if (config->height != ((dfb_config->matrox_tv_std != DSETV_PAL) ? 480 : 576)) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult crtc2AddRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config ) { return DFB_OK; } static DFBResult crtc2SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { DFBResult ret; MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxCrtc2LayerData *mcrtc2 = (MatroxCrtc2LayerData*) layer_data; MatroxDeviceData *mdev = mdrv->device_data; /* remember configuration */ mcrtc2->config = *config; if (updated & CLRCF_PARITY) mcrtc2->field = !config->parity; if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_SURFACE_CAPS | CLRCF_ALPHA_RAMP | CLRCF_SURFACE)) { crtc2_calc_regs( mdrv, mcrtc2, config, surface, lock ); crtc2_calc_buffer( mdrv, mcrtc2, surface, lock ); ret = crtc2_enable_output( mdrv, mcrtc2 ); if (ret) return ret; mdev->crtc2_separated = !!(surface->config.caps & DSCAPS_SEPARATED); } return DFB_OK; } static DFBResult crtc2RemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxCrtc2LayerData *mcrtc2 = (MatroxCrtc2LayerData*) layer_data; crtc2_disable_output( mdrv, mcrtc2 ); return DFB_OK; } static DFBResult crtc2FlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxCrtc2LayerData *mcrtc2 = (MatroxCrtc2LayerData*) layer_data; volatile u8 *mmio = mdrv->mmio_base; crtc2_calc_buffer( mdrv, mcrtc2, surface, lock ); if (mcrtc2->config.options & DLOP_FIELD_PARITY) { int field = (mga_in32( mmio, C2VCOUNT ) & C2FIELD) ? 1 : 0; while (field == mcrtc2->field) { dfb_screen_wait_vsync( mdrv->secondary ); field = (mga_in32( mmio, C2VCOUNT ) & C2FIELD) ? 1 : 0; } } crtc2_set_buffer( mdrv, mcrtc2 ); dfb_surface_flip( surface, false ); if (flags & DSFLIP_WAIT) dfb_screen_wait_vsync( mdrv->secondary ); return DFB_OK; } static DFBResult crtc2SetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxCrtc2LayerData *mcrtc2 = (MatroxCrtc2LayerData*) layer_data; MatroxMavenData *mav = &mcrtc2->mav; DFBResult res; if ((res = maven_open( mav, mdrv )) != DFB_OK) return res; if (adj->flags & DCAF_HUE) maven_set_hue( mav, mdrv, adj->hue >> 8 ); if (adj->flags & DCAF_SATURATION) maven_set_saturation( mav, mdrv, adj->saturation >> 8 ); if (adj->flags & DCAF_BRIGHTNESS || adj->flags & DCAF_CONTRAST) maven_set_bwlevel( mav, mdrv, adj->brightness >> 8, adj->contrast >> 8 ); maven_close( mav, mdrv ); /* remember color adjustment */ mcrtc2->adj = *adj; return DFB_OK; } static DFBResult crtc2GetCurrentOutputField( CoreLayer *layer, void *driver_data, void *layer_data, int *field ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; if (!field) return DFB_INVARG; *field = (mga_in32( mdrv->mmio_base, C2VCOUNT ) & C2FIELD) ? 1 : 0; return DFB_OK; } DisplayLayerFuncs matroxCrtc2Funcs = { .LayerDataSize = crtc2LayerDataSize, .InitLayer = crtc2InitLayer, .TestRegion = crtc2TestRegion, .AddRegion = crtc2AddRegion, .SetRegion = crtc2SetRegion, .RemoveRegion = crtc2RemoveRegion, .FlipRegion = crtc2FlipRegion, .SetColorAdjustment = crtc2SetColorAdjustment, .GetCurrentOutputField = crtc2GetCurrentOutputField, }; /* internal */ static void crtc2_set_regs( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ) { volatile u8 *mmio = mdrv->mmio_base; mga_out32( mmio, mcrtc2->regs.c2CTL, C2CTL ); mga_out32( mmio, mcrtc2->regs.c2DATACTL, C2DATACTL ); mga_out32( mmio, mcrtc2->regs.c2HPARAM, C2HPARAM ); mga_out32( mmio, 0, C2HSYNC ); mga_out32( mmio, mcrtc2->regs.c2VPARAM, C2VPARAM ); mga_out32( mmio, 0, C2VSYNC ); mga_out32( mmio, mcrtc2->regs.c2OFFSET, C2OFFSET ); mga_out32( mmio, mcrtc2->regs.c2MISC, C2MISC ); mga_out32( mmio, 0, C2PRELOAD ); } static void crtc2_calc_regs( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { MatroxDeviceData *mdev = mdrv->device_data; mcrtc2->regs.c2CTL = 0; /* Don't touch sub-picture bits. */ mcrtc2->regs.c2DATACTL = mga_in32( mdrv->mmio_base, C2DATACTL ); mcrtc2->regs.c2DATACTL &= C2STATICKEY | C2OFFSETDIVEN | C2STATICKEYEN | C2SUBPICEN; if (mdev->g450_matrox) mcrtc2->regs.c2CTL |= C2PIXCLKSEL_CRISTAL; else mcrtc2->regs.c2CTL |= C2PIXCLKSEL_VDOCLK; /* * High priority request level. * According to G400 specs these values should * be fixed when CRTC2 is in YUV mode. */ /* c2hiprilvl */ mcrtc2->regs.c2CTL |= 2 << 4; /* c2maxhipri */ mcrtc2->regs.c2CTL |= 1 << 8; switch (surface->config.format) { case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: mcrtc2->regs.c2DATACTL |= C2DITHEN | C2YFILTEN | C2CBCRFILTEN; break; default: break; } if (dfb_config->matrox_tv_std != DSETV_PAL) mcrtc2->regs.c2DATACTL |= C2NTSCEN; /* pixel format settings */ switch (surface->config.format) { case DSPF_I420: case DSPF_YV12: mcrtc2->regs.c2CTL |= C2DEPTH_YCBCR420; break; case DSPF_UYVY: mcrtc2->regs.c2DATACTL |= C2UYVYFMT; /* fall through */ case DSPF_YUY2: mcrtc2->regs.c2CTL |= C2DEPTH_YCBCR422; break; case DSPF_RGB555: case DSPF_ARGB1555: mcrtc2->regs.c2CTL |= C2DEPTH_15BPP; break; case DSPF_RGB16: mcrtc2->regs.c2CTL |= C2DEPTH_16BPP; break; case DSPF_RGB32: case DSPF_ARGB: mcrtc2->regs.c2CTL |= C2DEPTH_32BPP; break; default: D_BUG( "unexpected pixelformat" ); return; } if (!(surface->config.caps & DSCAPS_INTERLACED)) mcrtc2->regs.c2CTL |= C2VCBCRSINGLE; mcrtc2->regs.c2OFFSET = lock->pitch; if (!(surface->config.caps & DSCAPS_SEPARATED)) mcrtc2->regs.c2OFFSET *= 2; { int hdisplay, htotal, vdisplay, vtotal; if (dfb_config->matrox_tv_std != DSETV_PAL) { hdisplay = 720; htotal = 858; vdisplay = 480 / 2; vtotal = 525 / 2; } else { hdisplay = 720; htotal = 864; vdisplay = 576 / 2; vtotal = 625 / 2; } mcrtc2->regs.c2HPARAM = ((hdisplay - 8) << 16) | (htotal - 8); mcrtc2->regs.c2VPARAM = ((vdisplay - 1) << 16) | (vtotal - 1); mcrtc2->regs.c2MISC = 0; /* c2vlinecomp */ mcrtc2->regs.c2MISC |= (vdisplay + 1) << 16; } /* c2bpp15halpha */ mcrtc2->regs.c2DATACTL |= config->alpha_ramp[3] << 8; /* c2bpp15lalpha */ mcrtc2->regs.c2DATACTL |= config->alpha_ramp[0] << 16; } static void crtc2_calc_buffer( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { unsigned int field_offset = lock->pitch; if (surface->config.caps & DSCAPS_SEPARATED) field_offset *= surface->config.size.h / 2; mcrtc2->regs.c2STARTADD1 = lock->offset; mcrtc2->regs.c2STARTADD0 = mcrtc2->regs.c2STARTADD1 + field_offset; if (surface->config.caps & DSCAPS_INTERLACED) field_offset = lock->pitch / 2; else field_offset = 0; if (surface->config.caps & DSCAPS_SEPARATED) field_offset *= surface->config.size.h / 4; switch (surface->config.format) { case DSPF_I420: mcrtc2->regs.c2PL2STARTADD1 = mcrtc2->regs.c2STARTADD1 + surface->config.size.h * lock->pitch; mcrtc2->regs.c2PL2STARTADD0 = mcrtc2->regs.c2PL2STARTADD1 + field_offset; mcrtc2->regs.c2PL3STARTADD1 = mcrtc2->regs.c2PL2STARTADD1 + surface->config.size.h/2 * lock->pitch/2; mcrtc2->regs.c2PL3STARTADD0 = mcrtc2->regs.c2PL3STARTADD1 + field_offset; break; case DSPF_YV12: mcrtc2->regs.c2PL3STARTADD1 = mcrtc2->regs.c2STARTADD1 + surface->config.size.h * lock->pitch; mcrtc2->regs.c2PL3STARTADD0 = mcrtc2->regs.c2PL3STARTADD1 + field_offset; mcrtc2->regs.c2PL2STARTADD1 = mcrtc2->regs.c2PL3STARTADD1 + surface->config.size.h/2 * lock->pitch/2; mcrtc2->regs.c2PL2STARTADD0 = mcrtc2->regs.c2PL2STARTADD1 + field_offset; break; default: break; } } static void crtc2_set_buffer( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ) { volatile u8 *mmio = mdrv->mmio_base; mga_out32( mmio, mcrtc2->regs.c2STARTADD0, C2STARTADD0 ); mga_out32( mmio, mcrtc2->regs.c2STARTADD1, C2STARTADD1 ); mga_out32( mmio, mcrtc2->regs.c2PL2STARTADD0, C2PL2STARTADD0 ); mga_out32( mmio, mcrtc2->regs.c2PL2STARTADD1, C2PL2STARTADD1 ); mga_out32( mmio, mcrtc2->regs.c2PL3STARTADD0, C2PL3STARTADD0 ); mga_out32( mmio, mcrtc2->regs.c2PL3STARTADD1, C2PL3STARTADD1 ); } static void crtc2OnOff( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2, int on ) { volatile u8 *mmio = mdrv->mmio_base; if (on) mcrtc2->regs.c2CTL |= C2EN; else mcrtc2->regs.c2CTL &= ~C2EN; mga_out32( mmio, mcrtc2->regs.c2CTL, C2CTL ); if (on) mcrtc2->regs.c2CTL &= ~C2PIXCLKDIS; else mcrtc2->regs.c2CTL |= C2PIXCLKDIS; mga_out32( mmio, mcrtc2->regs.c2CTL, C2CTL ); if (!on) { mcrtc2->regs.c2CTL &= ~C2INTERLACE; mga_out32( mmio, mcrtc2->regs.c2CTL, C2CTL ); } } static void crtc2_set_mafc( MatroxDriverData *mdrv, int on ) { volatile u8 *mmio = mdrv->mmio_base; u8 val; val = mga_in_dac( mmio, XMISCCTRL ); if (on) { val &= ~(MFCSEL_MASK | VDOUTSEL_MASK); val |= MFCSEL_MAFC | VDOUTSEL_CRTC2656; } else { val &= ~MFCSEL_MASK; val |= MFCSEL_DIS; } mga_out_dac( mmio, XMISCCTRL, val ); } static DFBResult crtc2_disable_output( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ) { MatroxDeviceData *mdev = mdrv->device_data; MatroxMavenData *mav = &mcrtc2->mav; DFBResult res; if ((res = maven_open( mav, mdrv )) != DFB_OK) return res; maven_disable( mav, mdrv ); if (!mdev->g450_matrox) crtc2_set_mafc( mdrv, 0 ); crtc2OnOff( mdrv, mcrtc2, 0 ); maven_close( mav, mdrv ); if (mdev->g450_matrox) { volatile u8 *mmio = mdrv->mmio_base; u8 val; /* Set Rset to 0.7 V */ val = mga_in_dac( mmio, XGENIOCTRL ); val &= ~0x40; mga_out_dac( mmio, XGENIOCTRL, val ); val = mga_in_dac( mmio, XGENIODATA ); val &= ~0x40; mga_out_dac( mmio, XGENIODATA, val ); val = mga_in_dac( mmio, XPWRCTRL ); val &= ~(DAC2PDN | CFIFOPDN); mga_out_dac( mmio, XPWRCTRL, val ); val = mga_in_dac( mmio, XDISPCTRL ); val &= ~DAC2OUTSEL_MASK; val |= DAC2OUTSEL_DIS; mga_out_dac( mmio, XDISPCTRL, val ); } return DFB_OK; } static DFBResult crtc2_enable_output( MatroxDriverData *mdrv, MatroxCrtc2LayerData *mcrtc2 ) { MatroxDeviceData *mdev = mdrv->device_data; MatroxMavenData *mav = &mcrtc2->mav; volatile u8 *mmio = mdrv->mmio_base; DFBResult res; if ((res = maven_open( mav, mdrv )) != DFB_OK) return res; if (mdev->g450_matrox) { volatile u8 *mmio = mdrv->mmio_base; u8 val; /* Set Rset to 1.0 V */ val = mga_in_dac( mmio, XGENIOCTRL ); val |= 0x40; mga_out_dac( mmio, XGENIOCTRL, val ); val = mga_in_dac( mmio, XGENIODATA ); val &= ~0x40; mga_out_dac( mmio, XGENIODATA, val ); val = mga_in_dac( mmio, XPWRCTRL ); val |= DAC2PDN | CFIFOPDN; mga_out_dac( mmio, XPWRCTRL, val ); val = mga_in_dac( mmio, XDISPCTRL ); val &= ~DAC2OUTSEL_MASK; val |= DAC2OUTSEL_TVE; mga_out_dac( mmio, XDISPCTRL, val ); if (dfb_config->matrox_cable == 1) { val = mga_in_dac( mmio, XSYNCCTRL ); val &= ~(DAC2HSOFF | DAC2VSOFF | DAC2HSPOL | DAC2VSPOL); mga_out_dac( mmio, XSYNCCTRL, val ); } } maven_disable( mav, mdrv ); if (!mdev->g450_matrox) crtc2_set_mafc( mdrv, 0 ); crtc2OnOff( mdrv, mcrtc2, 0 ); crtc2_set_regs( mdrv, mcrtc2 ); crtc2_set_buffer( mdrv, mcrtc2 ); if (!mdev->g450_matrox) crtc2_set_mafc( mdrv, 1 ); crtc2OnOff( mdrv, mcrtc2, 1 ); maven_set_regs( mav, mdrv, &mcrtc2->config, &mcrtc2->adj ); mcrtc2->regs.c2CTL |= C2INTERLACE; if (mdev->g450_matrox) mcrtc2->regs.c2CTL |= 0x1000; /* Undocumented bit */ while ((mga_in32( mmio, C2VCOUNT ) & 0x00000FFF) != 1) ; while ((mga_in32( mmio, C2VCOUNT ) & 0x00000FFF) != 0) ; mga_out32( mmio, mcrtc2->regs.c2CTL, C2CTL ); maven_enable( mav, mdrv ); if (!mdev->g450_matrox) { while ((mga_in32( mmio, C2VCOUNT ) & 0x00000FFF) != 1) ; while ((mga_in32( mmio, C2VCOUNT ) & 0x00000FFF) != 0) ; maven_sync( mav, mdrv ); } maven_close( mav, mdrv ); return DFB_OK; } DirectFB-1.2.10/gfxdrivers/matrox/matrox_screen_crtc2.c0000644000175000017500000002171511245562152017756 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "matrox.h" typedef struct { DFBScreenPowerMode power_mode; } MatroxCrtc2ScreenData; static void crtc2_wait_vsync( MatroxDriverData *mdrv ); /**************************************************************************************************/ static int crtc2ScreenDataSize( void ) { return sizeof(MatroxCrtc2ScreenData); } static DFBResult crtc2InitScreen( CoreScreen *screen, CoreGraphicsDevice *device, void *driver_data, void *screen_data, DFBScreenDescription *description ) { /* Set the screen capabilities. */ description->caps = DSCCAPS_VSYNC | DSCCAPS_ENCODERS | DSCCAPS_OUTPUTS; /* Set the screen name. */ snprintf( description->name, DFB_SCREEN_DESC_NAME_LENGTH, "Matrox CRTC2 Screen" ); /* Set number of encoders and outputs. */ description->encoders = 1; description->outputs = 1; return DFB_OK; } /**************************************************************************************************/ static DFBResult crtc2InitEncoder( CoreScreen *screen, void *driver_data, void *screen_data, int encoder, DFBScreenEncoderDescription *description, DFBScreenEncoderConfig *config ) { /* Set the encoder capabilities & type. */ description->caps = DSECAPS_TV_STANDARDS; description->type = DSET_TV; /* Set supported TV standards. */ description->tv_standards = DSETV_PAL | DSETV_NTSC | DSETV_PAL_60; /* Set default configuration. */ config->flags = DSECONF_TV_STANDARD; config->tv_standard = dfb_config->matrox_tv_std; return DFB_OK; } static DFBResult crtc2InitOutput( CoreScreen *screen, void *driver_data, void *screen_data, int output, DFBScreenOutputDescription *description, DFBScreenOutputConfig *config ) { /* Set the output capabilities. */ description->caps = DSOCAPS_CONNECTORS | DSOCAPS_SIGNAL_SEL | DSOCAPS_CONNECTOR_SEL; /* Set supported output connectors and signals. */ description->all_connectors = DSOC_CVBS | DSOC_YC | DSOC_SCART; description->all_signals = DSOS_CVBS | DSOS_YC | DSOS_RGB; /* Set default configuration. */ config->flags = DSOCONF_SIGNALS | DSOCONF_CONNECTORS; switch (dfb_config->matrox_cable) { case 1: /* SCART RGB */ config->out_signals = DSOS_RGB; config->out_connectors = DSOC_SCART; break; case 2: /* SCART Composite */ config->out_signals = DSOS_CVBS; config->out_connectors = DSOC_SCART; break; default: /* Composite / S-Video */ config->out_signals = DSOS_CVBS | DSOS_YC; config->out_connectors = DSOC_CVBS | DSOC_YC; break; } return DFB_OK; } /**************************************************************************************************/ static DFBResult crtc2SetPowerMode( CoreScreen *screen, void *driver_data, void *screen_data, DFBScreenPowerMode mode ) { MatroxCrtc2ScreenData *msc2 = (MatroxCrtc2ScreenData*) screen_data; msc2->power_mode = mode; return DFB_OK; } static DFBResult crtc2WaitVSync( CoreScreen *screen, void *driver_data, void *screen_data ) { MatroxDriverData *mdrv = (MatroxDriverData*) driver_data; MatroxCrtc2ScreenData *msc2 = (MatroxCrtc2ScreenData*) screen_data; if (msc2->power_mode == DSPM_ON) crtc2_wait_vsync( mdrv ); return DFB_OK; } /**************************************************************************************************/ static DFBResult crtc2TestEncoderConfig( CoreScreen *screen, void *driver_data, void *screen_data, int encoder, const DFBScreenEncoderConfig *config, DFBScreenEncoderConfigFlags *failed ) { D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult crtc2SetEncoderConfig( CoreScreen *screen, void *driver_data, void *screen_data, int encoder, const DFBScreenEncoderConfig *config ) { // D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult crtc2TestOutputConfig( CoreScreen *screen, void *driver_data, void *screen_data, int output, const DFBScreenOutputConfig *config, DFBScreenOutputConfigFlags *failed ) { D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult crtc2SetOutputConfig( CoreScreen *screen, void *driver_data, void *screen_data, int output, const DFBScreenOutputConfig *config ) { // D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult crtc2GetScreenSize( CoreScreen *screen, void *driver_data, void *screen_data, int *ret_width, int *ret_height ) { *ret_width = 720; *ret_height = (dfb_config->matrox_tv_std != DSETV_PAL) ? 480 : 576; return DFB_OK; } ScreenFuncs matroxCrtc2ScreenFuncs = { .ScreenDataSize = crtc2ScreenDataSize, .InitScreen = crtc2InitScreen, .InitEncoder = crtc2InitEncoder, .InitOutput = crtc2InitOutput, .SetPowerMode = crtc2SetPowerMode, .WaitVSync = crtc2WaitVSync, .TestEncoderConfig = crtc2TestEncoderConfig, .SetEncoderConfig = crtc2SetEncoderConfig, .TestOutputConfig = crtc2TestOutputConfig, .SetOutputConfig = crtc2SetOutputConfig, .GetScreenSize = crtc2GetScreenSize, }; /**************************************************************************************************/ static void crtc2_wait_vsync( MatroxDriverData *mdrv ) { int vdisplay = ((dfb_config->matrox_tv_std != DSETV_PAL) ? 480/2 : 576/2) + 1; #ifdef FBIO_WAITFORVSYNC static const int one = 1; FBDev *dfb_fbdev = dfb_system_data(); if (ioctl( dfb_fbdev->fd, FBIO_WAITFORVSYNC, &one )) #endif while ((int)(mga_in32( mdrv->mmio_base, C2VCOUNT ) & 0x00000FFF) != vdisplay) ; } DirectFB-1.2.10/gfxdrivers/matrox/matrox_state.c0000644000175000017500000006505511245562152016527 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "matrox.h" #include "matrox_state.h" #define MGA_KEYMASK(format) ((1 << DFB_COLOR_BITS_PER_PIXEL(format)) - 1) static void matrox_calc_offsets( MatroxDeviceData *mdev, CoreSurface *surface, CoreSurfaceBufferLock *lock, bool unit_pixel, int offset[2][3] ) { int bytes_per_pixel = DFB_BYTES_PER_PIXEL( surface->config.format ); int pitch; if (unit_pixel) { offset[0][0] = lock->offset / bytes_per_pixel; pitch = lock->pitch / bytes_per_pixel; } else { offset[0][0] = mdev->fb.offset + lock->offset; pitch = lock->pitch; } switch (surface->config.format) { case DSPF_NV12: case DSPF_NV21: offset[0][1] = offset[0][0] + surface->config.size.h * pitch; offset[0][2] = 0; break; case DSPF_I420: offset[0][1] = offset[0][0] + surface->config.size.h * pitch; offset[0][2] = offset[0][1] + surface->config.size.h/2 * pitch/2; break; case DSPF_YV12: offset[0][2] = offset[0][0] + surface->config.size.h * pitch; offset[0][1] = offset[0][2] + surface->config.size.h/2 * pitch/2; break; default: offset[0][1] = 0; offset[0][2] = 0; } D_ASSERT( offset[0][0] % 64 == 0 ); D_ASSERT( offset[0][1] % 64 == 0 ); D_ASSERT( offset[0][2] % 64 == 0 ); if (mdev->blit_fields || mdev->blit_deinterlace) { if (surface->config.caps & DSCAPS_SEPARATED) { offset[1][0] = offset[0][0] + surface->config.size.h/2 * pitch; switch (surface->config.format) { case DSPF_NV12: case DSPF_NV21: offset[1][1] = offset[0][1] + surface->config.size.h/4 * pitch; offset[1][2] = 0; break; case DSPF_I420: case DSPF_YV12: offset[1][1] = offset[0][1] + surface->config.size.h/4 * pitch/2; offset[1][2] = offset[0][2] + surface->config.size.h/4 * pitch/2; break; default: offset[1][1] = 0; offset[1][2] = 0; } } else { offset[1][0] = offset[0][0] + pitch; switch (surface->config.format) { case DSPF_NV12: case DSPF_NV21: offset[1][1] = offset[0][1] + pitch; offset[1][2] = 0; break; case DSPF_I420: case DSPF_YV12: offset[1][1] = offset[0][1] + pitch/2; offset[1][2] = offset[0][2] + pitch/2; break; default: offset[1][1] = 0; offset[1][2] = 0; } } D_ASSERT( offset[1][0] % 64 == 0 ); D_ASSERT( offset[1][1] % 64 == 0 ); D_ASSERT( offset[1][2] % 64 == 0 ); } } void matrox_validate_destination( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *destination = state->destination; CoreSurfaceBuffer *depth_buffer = NULL;//destination->depth_buffer; int bytes_per_pixel = DFB_BYTES_PER_PIXEL( destination->config.format ); if (MGA_IS_VALID( m_destination )) return; mdev->dst_pitch = state->dst.pitch / bytes_per_pixel; mdev->depth_buffer = depth_buffer != NULL; if (destination->config.format == DSPF_YUY2 || destination->config.format == DSPF_UYVY) mdev->dst_pitch /= 2; if (mdev->blit_fields && !(destination->config.caps & DSCAPS_SEPARATED)) mdev->dst_pitch *= 2; D_ASSERT( mdev->dst_pitch % 32 == 0 ); matrox_calc_offsets( mdev, destination, &state->dst, mdev->old_matrox, mdev->dst_offset ); mga_waitfifo( mdrv, mdev, depth_buffer ? 4 : 3 ); mga_out32( mmio, mdev->dst_offset[0][0], mdev->old_matrox ? YDSTORG : DSTORG ); mga_out32( mmio, mdev->dst_pitch, PITCH ); #if 0 if (depth_buffer) mga_out32( mmio, depth_buffer->video.offset, ZORG ); #endif switch (destination->config.format) { case DSPF_A8: case DSPF_ALUT44: case DSPF_LUT8: case DSPF_RGB332: mga_out32( mmio, PW8, MACCESS ); break; case DSPF_RGB555: case DSPF_ARGB1555: mga_out32( mmio, PW16 | DIT555, MACCESS ); break; case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB16: mga_out32( mmio, PW16, MACCESS ); break; case DSPF_RGB24: mga_out32( mmio, PW24, MACCESS ); break; case DSPF_RGB32: case DSPF_ARGB: mga_out32( mmio, PW32, MACCESS ); break; case DSPF_I420: case DSPF_YV12: case DSPF_NV12: case DSPF_NV21: mga_out32( mmio, PW8 | BYPASS332 | NODITHER, MACCESS ); break; case DSPF_YUY2: case DSPF_UYVY: mga_out32( mmio, PW32 | NODITHER, MACCESS ); break; default: D_BUG( "unexpected pixelformat!" ); break; } MGA_VALIDATE( m_destination ); } void matrox_set_clip( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRegion *clip ) { volatile u8 *mmio = mdrv->mmio_base; mga_waitfifo( mdrv, mdev, 3 ); if (mdev->old_matrox) { mga_out32( mmio, (mdev->dst_offset[0][0] + mdev->dst_pitch * clip->y1) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_offset[0][0] + mdev->dst_pitch * clip->y2) & 0xFFFFFF, YBOT ); } else { mga_out32( mmio, (mdev->dst_pitch * clip->y1) & 0xFFFFFF, YTOP ); mga_out32( mmio, (mdev->dst_pitch * clip->y2) & 0xFFFFFF, YBOT ); } mga_out32( mmio, ((clip->x2 & 0x0FFF) << 16) | (clip->x1 & 0x0FFF), CXBNDRY ); } void matrox_validate_drawColor( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { DFBColor color = state->color; volatile u8 *mmio = mdrv->mmio_base; if (MGA_IS_VALID( m_drawColor )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = (color.r * (color.a + 1)) >> 8; color.g = (color.g * (color.a + 1)) >> 8; color.b = (color.b * (color.a + 1)) >> 8; } mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, U8_TO_F0915(color.a), ALPHASTART ); mga_out32( mmio, U8_TO_F0915(color.r), DR4 ); mga_out32( mmio, U8_TO_F0915(color.g), DR8 ); mga_out32( mmio, U8_TO_F0915(color.b), DR12 ); MGA_VALIDATE( m_drawColor ); MGA_INVALIDATE( m_blitColor ); MGA_INVALIDATE( m_blitBlend ); } void matrox_validate_blitColor( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { DFBColor color = state->color; volatile u8 *mmio = mdrv->mmio_base; if (MGA_IS_VALID( m_blitColor )) return; if (state->blittingflags & DSBLIT_COLORIZE) { if (state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { color.r = (color.r * (color.a + 1)) >> 8; color.g = (color.g * (color.a + 1)) >> 8; color.b = (color.b * (color.a + 1)) >> 8; } } else { if (state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) color.r = color.g = color.b = color.a; else color.r = color.g = color.b = 0xff; } mga_waitfifo( mdrv, mdev, 4 ); mga_out32( mmio, U8_TO_F0915(color.a), ALPHASTART ); mga_out32( mmio, U8_TO_F0915(color.r), DR4 ); mga_out32( mmio, U8_TO_F0915(color.g), DR8 ); mga_out32( mmio, U8_TO_F0915(color.b), DR12 ); MGA_VALIDATE( m_blitColor ); MGA_INVALIDATE( m_drawColor ); MGA_INVALIDATE( m_blitBlend ); } void matrox_validate_color( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { DFBColor color = state->color; volatile u8 *mmio = mdrv->mmio_base; u32 fcol; u8 cb, cr; if (MGA_IS_VALID( m_color )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = (color.r * (color.a + 1)) >> 8; color.g = (color.g * (color.a + 1)) >> 8; color.b = (color.b * (color.a + 1)) >> 8; } switch (state->destination->config.format) { case DSPF_ALUT44: fcol = (color.a & 0xF0) | state->color_index; fcol |= fcol << 8; fcol |= fcol << 16; break; case DSPF_LUT8: fcol = state->color_index; fcol |= fcol << 8; fcol |= fcol << 16; break; case DSPF_RGB332: fcol = PIXEL_RGB332( color.r, color.g, color.b ); fcol |= fcol << 8; fcol |= fcol << 16; break; case DSPF_RGB444: fcol = PIXEL_RGB444( color.r, color.g, color.b ); fcol |= fcol << 16; break; case DSPF_ARGB4444: fcol = PIXEL_ARGB4444( color.a, color.r, color.g, color.b ); fcol |= fcol << 16; break; case DSPF_RGB555: fcol = PIXEL_RGB555( color.r, color.g, color.b ); fcol |= fcol << 16; break; case DSPF_ARGB1555: fcol = PIXEL_ARGB1555( color.a, color.r, color.g, color.b ); fcol |= fcol << 16; break; case DSPF_RGB16: fcol = PIXEL_RGB16( color.r, color.g, color.b ); fcol |= fcol << 16; break; case DSPF_RGB24: fcol = PIXEL_RGB32( color.r, color.g, color.b ); fcol |= fcol << 24; break; case DSPF_RGB32: fcol = PIXEL_RGB32( color.r, color.g, color.b ); break; case DSPF_ARGB: fcol = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; case DSPF_A8: fcol = color.a; fcol |= fcol << 8; fcol |= fcol << 16; break; case DSPF_I420: case DSPF_YV12: RGB_TO_YCBCR( color.r, color.g, color.b, fcol, cb, cr ); fcol |= fcol << 8; fcol |= fcol << 16; mdev->color[0] = fcol; mdev->color[1] = (cb << 24) | (cb << 16) | (cb << 8) | cb; mdev->color[2] = (cr << 24) | (cr << 16) | (cr << 8) | cr; break; case DSPF_NV12: RGB_TO_YCBCR( color.r, color.g, color.b, fcol, cb, cr ); fcol |= fcol << 8; fcol |= fcol << 16; mdev->color[0] = fcol; mdev->color[1] = (cr << 24) | (cb << 16) | (cr << 8) | cb; break; case DSPF_NV21: RGB_TO_YCBCR( color.r, color.g, color.b, fcol, cb, cr ); fcol |= fcol << 8; fcol |= fcol << 16; mdev->color[0] = fcol; mdev->color[1] = (cb << 24) | (cr << 16) | (cb << 8) | cr; break; case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, fcol, cb, cr ); fcol = PIXEL_YUY2( fcol, cb, cr ); break; case DSPF_UYVY: RGB_TO_YCBCR( color.r, color.g, color.b, fcol, cb, cr ); fcol = PIXEL_UYVY( fcol, cb, cr ); break; default: D_BUG( "unexpected pixelformat!" ); return; } mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, fcol, FCOL ); MGA_VALIDATE( m_color ); MGA_INVALIDATE( m_srckey ); } static u32 matroxSourceBlend[] = { SRC_ZERO, /* DSBF_ZERO */ SRC_ONE, /* DSBF_ONE */ 0, /* DSBF_SRCCOLOR */ 0, /* DSBF_INVSRCCOLOR */ SRC_ALPHA, /* DSBF_SRCALPHA */ SRC_ONE_MINUS_SRC_ALPHA, /* DSBF_INVSRCALPHA */ SRC_DST_ALPHA, /* DSBF_DESTALPHA */ SRC_ONE_MINUS_DST_ALPHA, /* DSBF_INVDESTALPHA */ SRC_DST_COLOR, /* DSBF_DESTCOLOR */ SRC_ONE_MINUS_DST_COLOR, /* DSBF_INVDESTCOLOR */ SRC_SRC_ALPHA_SATURATE /* DSBF_SRCALPHASAT */ }; static u32 matroxDestBlend[] = { DST_ZERO, /* DSBF_ZERO */ DST_ONE, /* DSBF_ONE */ DST_SRC_COLOR, /* DSBF_SRCCOLOR */ DST_ONE_MINUS_SRC_COLOR, /* DSBF_INVSRCCOLOR */ DST_SRC_ALPHA, /* DSBF_SRCALPHA */ DST_ONE_MINUS_SRC_ALPHA, /* DSBF_INVSRCALPHA */ DST_DST_ALPHA, /* DSBF_DESTALPHA */ DST_ONE_MINUS_DST_ALPHA, /* DSBF_INVDESTALPHA */ 0, /* DSBF_DESTCOLOR */ 0, /* DSBF_INVDESTCOLOR */ 0 /* DSBF_SRCALPHASAT */ }; void matrox_validate_drawBlend( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; u32 alphactrl; if (MGA_IS_VALID( m_drawBlend )) return; alphactrl = matroxSourceBlend[state->src_blend - 1] | matroxDestBlend [state->dst_blend - 1] | ALPHACHANNEL | DIFFUSEDALPHA; mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, alphactrl, ALPHACTRL ); MGA_VALIDATE( m_drawBlend ); MGA_INVALIDATE( m_blitBlend ); } static u32 matroxAlphaSelect[] = { 0, 0, DIFFUSEDALPHA, MODULATEDALPHA }; void matrox_validate_blitBlend( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; u32 alphactrl; if (MGA_IS_VALID( m_blitBlend )) return; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) /* src_blend == ONE and dst_blend == INVSRCALPHA/INVSRCCOLOR */ alphactrl = matroxSourceBlend[DSBF_SRCALPHA - 1] | matroxDestBlend [state->dst_blend - 1] | VIDEOALPHA; else alphactrl = matroxSourceBlend[state->src_blend - 1] | matroxDestBlend [state->dst_blend - 1] | ALPHACHANNEL; if (state->source->config.format == DSPF_RGB32) { alphactrl |= DIFFUSEDALPHA; if (! (state->blittingflags & DSBLIT_BLEND_COLORALPHA)) { mga_out32( mmio, U8_TO_F0915(0xff), ALPHASTART ); MGA_INVALIDATE( m_drawColor | m_blitColor ); } } else alphactrl |= matroxAlphaSelect [state->blittingflags & 3]; } else { alphactrl = SRC_ONE | DST_ZERO | ALPHACHANNEL; if (state->source->config.format == DSPF_RGB32) { alphactrl |= DIFFUSEDALPHA; mga_out32( mmio, U8_TO_F0915(0xff), ALPHASTART ); MGA_INVALIDATE( m_drawColor | m_blitColor ); } } mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, alphactrl, ALPHACTRL ); MGA_VALIDATE( m_blitBlend ); MGA_INVALIDATE( m_drawBlend ); } static void matrox_tlutload( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CorePalette *palette ) { volatile u8 *mmio = mdrv->mmio_base; volatile u16 *dst = dfb_gfxcard_memory_virtual( NULL, mdev->tlut_offset ); unsigned int i; for (i = 0; i < palette->num_entries; i++) *dst++ = PIXEL_RGB16( palette->entries[i].r, palette->entries[i].g, palette->entries[i].b ); mga_waitfifo( mdrv, mdev, mdev->old_matrox ? 8 : 9 ); mga_out32( mmio, BLTMOD_BU32RGB | BOP_COPY | SHFTZERO | SGNZERO | LINEAR | ATYPE_RSTR | OP_BITBLT, DWGCTL ); mga_out32( mmio, 1024, PITCH ); if (mdev->old_matrox) { mga_out32( mmio, mdev->tlut_offset / 2, AR3 ); mga_out32( mmio, palette->num_entries, AR0 ); mga_out32( mmio, 0, YDSTORG ); } else { mga_out32( mmio, 0, AR3 ); mga_out32( mmio, palette->num_entries, AR0 ); mga_out32( mmio, mdev->fb.offset + mdev->tlut_offset, SRCORG ); mga_out32( mmio, 0, DSTORG ); MGA_INVALIDATE( m_source ); } mga_out32( mmio, 0, FXBNDRY ); mga_out32( mmio, PW16 | TLUTLOAD, MACCESS ); mga_out32( mmio, palette->num_entries, YDSTLEN | EXECUTE ); MGA_INVALIDATE( m_destination ); } void matrox_validate_Source( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *surface = state->source; int bytes_per_pixel = DFB_BYTES_PER_PIXEL(surface->config.format); u32 texctl = 0, texctl2 = 0; if (MGA_IS_VALID( m_Source )) return; mdev->src_pitch = state->src.pitch / bytes_per_pixel; mdev->field = surface->field; mdev->w = surface->config.size.w; mdev->h = surface->config.size.h; if (state->destination->config.format == DSPF_YUY2 || state->destination->config.format == DSPF_UYVY) { mdev->w /= 2; mdev->src_pitch /= 2; } if (mdev->blit_deinterlace || mdev->blit_fields) { mdev->h /= 2; if (!(surface->config.caps & DSCAPS_SEPARATED)) mdev->src_pitch *= 2; } D_ASSERT( mdev->src_pitch % 32 == 0 ); matrox_calc_offsets( mdev, surface, &state->src, false, mdev->src_offset ); if (mdev->blit_deinterlace && mdev->field) { mdev->src_offset[0][0] = mdev->src_offset[1][0]; mdev->src_offset[0][1] = mdev->src_offset[1][1]; mdev->src_offset[0][2] = mdev->src_offset[1][2]; } mdev->w2 = mga_log2( mdev->w ); mdev->h2 = mga_log2( mdev->h ); if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) texctl = TAMASK; else texctl = TAKEY; switch (surface->config.format) { case DSPF_YUY2: texctl |= (state->destination->config.format == DSPF_YUY2) ? TW32 : TW422; break; case DSPF_UYVY: texctl |= (state->destination->config.format == DSPF_UYVY) ? TW32 : TW422UYVY; break; case DSPF_I420: case DSPF_YV12: case DSPF_NV12: case DSPF_NV21: case DSPF_A8: texctl |= TW8A; break; case DSPF_RGB444: case DSPF_ARGB4444: texctl |= TW12; break; case DSPF_RGB555: case DSPF_ARGB1555: texctl |= TW15; break; case DSPF_RGB16: texctl |= TW16; break; case DSPF_RGB32: case DSPF_ARGB: texctl |= TW32; break; case DSPF_LUT8: matrox_tlutload( mdrv, mdev, surface->palette ); texctl |= TW8; break; case DSPF_RGB332: matrox_tlutload( mdrv, mdev, mdev->rgb332_palette ); texctl |= TW8; break; default: D_BUG( "unexpected pixelformat!" ); break; } texctl |= ((mdev->src_pitch << 9) & TPITCHEXT) | TPITCHLIN; if (1 << mdev->w2 != mdev->w || 1 << mdev->h2 != mdev->h) texctl |= CLAMPUV; if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) texctl |= TMODULATE; else texctl2 |= DECALDIS; if (state->blittingflags & DSBLIT_SRC_COLORKEY) texctl |= DECALCKEY | STRANS; else texctl2 |= CKSTRANSDIS; if (surface->config.format == DSPF_A8) texctl2 |= IDECAL | DECALDIS; mdev->texctl = texctl; mga_waitfifo( mdrv, mdev, 5 ); mga_out32( mmio, texctl, TEXCTL ); mga_out32( mmio, texctl2, TEXCTL2 ); mga_out32( mmio, ( (((u32)(mdev->w - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->w2) & 0x3f) << 9) | (((u32)(mdev->w2 + 4) & 0x3f) ) ), TEXWIDTH ); mga_out32( mmio, ( (((u32)(mdev->h - 1) & 0x7ff) << 18) | (((u32)(4 - mdev->h2) & 0x3f) << 9) | (((u32)(mdev->h2 + 4) & 0x3f) ) ), TEXHEIGHT ); mga_out32( mmio, mdev->src_offset[0][0], TEXORG ); MGA_VALIDATE( m_Source ); } void matrox_validate_source( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *surface = state->source; int bytes_per_pixel = DFB_BYTES_PER_PIXEL(surface->config.format); if (MGA_IS_VALID( m_source )) return; mdev->src_pitch = state->src.pitch / bytes_per_pixel; if (state->destination->config.format == DSPF_YUY2 || state->destination->config.format == DSPF_UYVY) mdev->src_pitch /= 2; if (mdev->blit_fields && !(surface->config.caps & DSCAPS_SEPARATED)) mdev->src_pitch *= 2; D_ASSERT( mdev->src_pitch % 32 == 0 ); matrox_calc_offsets( mdev, surface, &state->src, mdev->old_matrox, mdev->src_offset ); if (!mdev->old_matrox) { mga_waitfifo( mdrv, mdev, 1 ); mga_out32( mmio, mdev->src_offset[0][0], SRCORG ); } MGA_VALIDATE( m_source ); } void matrox_validate_SrcKey( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *surface = state->source; u32 key; u32 mask; if (MGA_IS_VALID( m_SrcKey )) return; if (state->blittingflags & DSBLIT_SRC_COLORKEY) { mask = MGA_KEYMASK(surface->config.format); key = state->src_colorkey & mask; } else { mask = 0; key = 0xFFFF; } mga_waitfifo( mdrv, mdev, 2); mga_out32( mmio, ((mask & 0xFFFF) << 16) | (key & 0xFFFF), TEXTRANS ); mga_out32( mmio, (mask & 0xFFFF0000) | (key >> 16), TEXTRANSHIGH ); MGA_VALIDATE( m_SrcKey ); } void matrox_validate_srckey( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *surface = state->source; u32 key; u32 mask; if (MGA_IS_VALID( m_srckey )) return; mask = MGA_KEYMASK(surface->config.format); key = state->src_colorkey & mask; switch (DFB_BYTES_PER_PIXEL(state->source->config.format)) { case 1: mask |= mask << 8; key |= key << 8; case 2: mask |= mask << 16; key |= key << 16; } mga_waitfifo( mdrv, mdev, 2); mga_out32( mmio, mask, BCOL ); mga_out32( mmio, key, FCOL ); MGA_VALIDATE( m_srckey ); MGA_INVALIDATE( m_color ); } DirectFB-1.2.10/gfxdrivers/matrox/matrox_state.h0000644000175000017500000000575311245562152016533 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MATROX_STATE_H__ #define ___MATROX_STATE_H__ void matrox_validate_destination( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_set_clip( MatroxDriverData *mdrv, MatroxDeviceData *mdev, DFBRegion *clip ); void matrox_validate_drawColor( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_blitColor( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_color( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_drawBlend( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_blitBlend( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_Source( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_source( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_SrcKey( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); void matrox_validate_srckey( MatroxDriverData *mdrv, MatroxDeviceData *mdev, CardState *state ); #endif DirectFB-1.2.10/gfxdrivers/i810/0000777000175000017500000000000011307522570013070 500000000000000DirectFB-1.2.10/gfxdrivers/i810/Makefile.am0000644000175000017500000000123411245562152015041 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/i810 INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems i810_LTLIBRARIES = libdirectfb_i810.la if BUILD_STATIC i810_DATA = $(i810_LTLIBRARIES:.la=.o) endif i810dir = $(MODULEDIR)/gfxdrivers libdirectfb_i810_la_SOURCES = \ i810.c \ i810.h \ i810_overlay.c libdirectfb_i810_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_i810_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/i810/Makefile.in0000644000175000017500000004466311307521477015073 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/i810 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(i810dir)" "$(DESTDIR)$(i810dir)" i810LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(i810_LTLIBRARIES) libdirectfb_i810_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_i810_la_OBJECTS = i810.lo i810_overlay.lo libdirectfb_i810_la_OBJECTS = $(am_libdirectfb_i810_la_OBJECTS) libdirectfb_i810_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_i810_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_i810_la_SOURCES) DIST_SOURCES = $(libdirectfb_i810_la_SOURCES) i810DATA_INSTALL = $(INSTALL_DATA) DATA = $(i810_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems i810_LTLIBRARIES = libdirectfb_i810.la @BUILD_STATIC_TRUE@i810_DATA = $(i810_LTLIBRARIES:.la=.o) i810dir = $(MODULEDIR)/gfxdrivers libdirectfb_i810_la_SOURCES = \ i810.c \ i810.h \ i810_overlay.c libdirectfb_i810_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_i810_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/i810/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/i810/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-i810LTLIBRARIES: $(i810_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(i810dir)" || $(MKDIR_P) "$(DESTDIR)$(i810dir)" @list='$(i810_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(i810LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(i810dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(i810LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(i810dir)/$$f"; \ else :; fi; \ done uninstall-i810LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(i810_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(i810dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(i810dir)/$$p"; \ done clean-i810LTLIBRARIES: -test -z "$(i810_LTLIBRARIES)" || rm -f $(i810_LTLIBRARIES) @list='$(i810_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_i810.la: $(libdirectfb_i810_la_OBJECTS) $(libdirectfb_i810_la_DEPENDENCIES) $(libdirectfb_i810_la_LINK) -rpath $(i810dir) $(libdirectfb_i810_la_OBJECTS) $(libdirectfb_i810_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i810.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i810_overlay.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-i810DATA: $(i810_DATA) @$(NORMAL_INSTALL) test -z "$(i810dir)" || $(MKDIR_P) "$(DESTDIR)$(i810dir)" @list='$(i810_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(i810DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(i810dir)/$$f'"; \ $(i810DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(i810dir)/$$f"; \ done uninstall-i810DATA: @$(NORMAL_UNINSTALL) @list='$(i810_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(i810dir)/$$f'"; \ rm -f "$(DESTDIR)$(i810dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(i810dir)" "$(DESTDIR)$(i810dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-i810LTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-i810DATA install-i810LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-i810DATA uninstall-i810LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-i810LTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-i810DATA install-i810LTLIBRARIES \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-i810DATA \ uninstall-i810LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/i810/i810.h0000644000175000017500000007051211245562152013644 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Antonino Daplas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* * Intel 810 Chipset Family PRM 15 3.1 * GC Register Memory Address Map * * Based on: * Intel (R) 810 Chipset Family * Programmer s Reference Manual * November 1999 * Revision 1.0 * Order Number: 298026-001 R * * All GC registers are memory-mapped. In addition, the VGA and extended VGA registers * are I/O mapped. */ #ifndef __I810_H__ #define __I810_H__ #include #include #include #include #include #define LP_RING 0x2030 #define HP_RING 0x2040 #define RING_TAIL 0x00 #define RING_HEAD 0x04 #define RING_START 0x08 #define RING_LEN 0x0C /* Instruction and Interrupt Control Registers (01000h 02FFFh) */ #define FENCE 0x02000 #define PGTBL_CTL 0x02020 #define PGTBL_ER 0x02024 #define RINGBUFFER 0x02030 #define LRING 0x02030 #define IRING 0x02040 #define HWS_PGA 0x02080 #define IPEIR 0x02088 #define IPEHR 0x0208C #define INSTDONE 0x02090 #define NOPID 0x02094 #define HWSTAM 0x02098 #define IER 0x020A0 #define IIR 0x020A4 #define IMR 0x020A8 #define ISR 0x020AC #define EIR 0x020B0 #define EMR 0x020B4 #define ESR 0x020B8 #define INSTPM 0x020C0 #define INSTPS 0x020C4 #define BBP_PTR 0x020C8 #define ABB_SRT 0x020CC #define ABB_END 0x020D0 #define DMA_FADD 0x020D4 #define FW_BLC 0x020D8 #define MEM_MODE 0x020DC /* Memory Control Registers (03000h 03FFFh) */ #define DRT 0x03000 #define DRAMCL 0x03001 #define DRAMCH 0x03002 /* Span Cursor Registers (04000h 04FFFh) */ #define UI_SC_CTL 0x04008 /* I/O Control Registers (05000h 05FFFh) */ #define HVSYNC 0x05000 #define GPIOA 0x05010 #define GPIOB 0x05014 /* Clock Control and Power Management Registers (06000h 06FFFh) */ #define DCLK_0D 0x06000 #define DCLK_1D 0x06004 #define DCLK_2D 0x06008 #define LCD_CLKD 0x0600C #define DCLK_0DS 0x06010 #define PWR_CLKC 0x06014 /* Graphics Translation Table Range Definition (10000h 1FFFFh) */ #define GTT 0x10000 /* Overlay Registers (30000h 03FFFFh) */ #define OV0ADDR 0x30000 #define DOV0STA 0x30008 #define GAMMA 0x30010 #define OBUF_0Y 0x30100 #define OBUF_1Y 0x30104 #define OBUF_0U 0x30108 #define OBUF_0V 0x3010C #define OBUF_1U 0x30110 #define OBUF_1V 0x30114 #define OV0STRIDE 0x30118 #define YRGB_VPH 0x3011C #define UV_VPH 0x30120 #define HORZ_PH 0x30124 #define INIT_PH 0x30128 #define DWINPOS 0x3012C #define DWINSZ 0x30130 #define SWID 0x30134 #define SWIDQW 0x30138 #define SHEIGHT 0x3013C #define YRGBSCALE 0x30140 #define UVSCALE 0x30144 #define OV0CLRCO 0x30148 #define OV0CLRC1 0x3014C #define DCLRKV 0x30150 #define DLCRKM 0x30154 #define SCLRKVH 0x30158 #define SCLRKVL 0x3015C #define SCLRKM 0x30160 #define OV0CONF 0x30164 #define OV0CMD 0x30168 #define AWINPOS 0x30170 #define AWINZ 0x30174 /* BLT Engine Status (40000h 4FFFFh) (Software Debug) */ #define BR00 0x40000 #define BRO1 0x40004 #define BR02 0x40008 #define BR03 0x4000C #define BR04 0x40010 #define BR05 0x40014 #define BR06 0x40018 #define BR07 0x4001C #define BR08 0x40020 #define BR09 0x40024 #define BR10 0x40028 #define BR11 0x4002C #define BR12 0x40030 #define BR13 0x40034 #define BR14 0x40038 #define BR15 0x4003C #define BR16 0x40040 #define BR17 0x40044 #define BR18 0x40048 #define BR19 0x4004C #define SSLADD 0x40074 #define DSLH 0x40078 #define DSLRADD 0x4007C /* LCD/TV-Out and HW DVD Registers (60000h 6FFFFh) */ /* LCD/TV-Out */ #define HTOTAL 0x60000 #define HBLANK 0x60004 #define HSYNC 0x60008 #define VTOTAL 0x6000C #define VBLANK 0x60010 #define VSYNC 0x60014 #define LCDTV_C 0x60018 #define OVRACT 0x6001C #define BCLRPAT 0x60020 /* Display and Cursor Control Registers (70000h 7FFFFh) */ #define DISP_SL 0x70000 #define DISP_SLC 0x70004 #define PIXCONF 0x70008 #define PIXCONF1 0x70009 #define BLTCNTL 0x7000C #define SWF 0x70014 #define DPLYBASE 0x70020 #define DPLYSTAS 0x70024 #define CURCNTR 0x70080 #define CURBASE 0x70084 #define CURPOS 0x70088 /* VGA Registers */ /* SMRAM Registers */ #define SMRAM 0x10 /* Graphics Control Registers */ #define GR_INDEX 0x3CE #define GR_DATA 0x3CF #define GR10 0x10 #define GR11 0x11 /* CRT Controller Registers */ #define CR_INDEX_MDA 0x3B4 #define CR_INDEX_CGA 0x3D4 #define CR_DATA_MDA 0x3B5 #define CR_DATA_CGA 0x3D5 #define CR30 0x30 #define CR31 0x31 #define CR32 0x32 #define CR33 0x33 #define CR35 0x35 #define CR39 0x39 #define CR40 0x40 #define CR41 0x41 #define CR42 0x42 #define CR70 0x70 #define CR80 0x80 #define CR81 0x82 /* Extended VGA Registers */ /* General Control and Status Registers */ #define ST00 0x3C2 #define ST01_MDA 0x3BA #define ST01_CGA 0x3DA #define FRC_READ 0x3CA #define FRC_WRITE_MDA 0x3BA #define FRC_WRITE_CGA 0x3DA #define MSR_READ 0x3CC #define MSR_WRITE 0x3C2 /* Sequencer Registers */ #define SR_INDEX 0x3C4 #define SR_DATA 0x3C5 #define SR01 0x01 #define SR02 0x02 #define SR03 0x03 #define SR04 0x04 #define SR07 0x07 /* Graphics Controller Registers */ #define GR00 0x00 #define GR01 0x01 #define GR02 0x02 #define GR03 0x03 #define GR04 0x04 #define GR05 0x05 #define GR06 0x06 #define GR07 0x07 #define GR08 0x08 /* Attribute Controller Registers */ #define ATTR_WRITE 0x3C0 #define ATTR_READ 0x3C1 /* VGA Color Palette Registers */ /* CLUT */ #define CLUT_DATA 0x3C9 /* DACDATA */ #define CLUT_INDEX_READ 0x3C7 /* DACRX */ #define CLUT_INDEX_WRITE 0x3C8 /* DACWX */ #define DACMASK 0x3C6 /* CRT Controller Registers */ #define CR00 0x00 #define CR01 0x01 #define CR02 0x02 #define CR03 0x03 #define CR04 0x04 #define CR05 0x05 #define CR06 0x06 #define CR07 0x07 #define CR08 0x08 #define CR09 0x09 #define CR0A 0x0A #define CR0B 0x0B #define CR0C 0x0C #define CR0D 0x0D #define CR0E 0x0E #define CR0F 0x0F #define CR10 0x10 #define CR11 0x11 #define CR12 0x12 #define CR13 0x13 #define CR14 0x14 #define CR15 0x15 #define CR16 0x16 #define CR17 0x17 #define CR18 0x18 /* Raster ops */ #define COLOR_COPY_ROP 0xF0 #define PAT_COPY_ROP 0xCC #define CLEAR_ROP 0x00 #define WHITE_ROP 0xFF #define INVERT_ROP 0x55 /* 2D Engine definitions */ #define SOLIDPATTERN 0x80000000 #define NONSOLID 0x00000000 #define BPP8 0x00000000 #define BPP16 0x01 << 24 #define BPP24 0x02 << 24 #define DYN_COLOR_EN 0x00400000 #define DYN_COLOR_DIS 0x00000000 #define INCREMENT 0x00000000 #define DECREMENT 0x01 << 30 #define ARB_ON 0x00000001 #define ARB_OFF 0x00000000 #define SYNC_FLIP 0x00000000 #define ASYNC_FLIP 0x00000040 #define OPTYPE_MASK 0xE0000000 #define PARSER_MASK 0x001F8000 #define D2_MASK 0x001FC000 /* 2D mask */ /* Instruction type */ /* There are more but pertains to 3D */ #define PARSER 0x00000000 #define BLIT 0x02 << 29 #define RENDER 0x03 << 29 /* Parser */ #define NOP 0x00 /* No operation, padding */ #define BP_INT 0x01 << 23 /* Breakpoint interrupt */ #define USR_INT 0x02 << 23 /* User interrupt */ #define WAIT_FOR_EVNT 0x03 << 23 /* Wait for event */ #define FLUSH 0x04 << 23 #define CONTEXT_SEL 0x05 << 23 #define REPORT_HEAD 0x07 << 23 #define ARB_ON_OFF 0x08 << 23 #define OVERLAY_FLIP 0x11 << 23 #define LOAD_SCAN_INC 0x12 << 23 #define LOAD_SCAN_EX 0x13 << 23 #define FRONT_BUFFER 0x14 << 23 #define DEST_BUFFER 0x15 << 23 #define Z_BUFFER 0x16 << 23 /* we won't need this */ #define STORE_DWORD_IMM 0x20 << 23 #define STORE_DWORD_IDX 0x21 << 23 #define BATCH_BUFFER 0x30 << 23 /* Blit */ #define SETUP_BLIT 0x00 #define SETUP_MONO_PATTERN_SL_BLT 0x10 << 22 #define PIXEL_BLT 0x20 << 22 #define SCANLINE_BLT 0x21 << 22 #define TEXT_BLT 0x22 << 22 #define TEXT_IMM_BLT 0x30 << 22 #define COLOR_BLT 0x40 << 22 #define MONO_PAT_BLIT 0x42 << 22 #define SOURCE_COPY_BLIT 0x43 << 22 #define FULL_BLIT 0x45 << 22 /* Primitive */ #define TRILIST 0 #define TRISTRIP 1 << 18 #define TRISTRIP_REV 2 << 18 #define TRIFAN 3 << 18 #define POLYGON 4 << 18 #define LINELIST 5 << 18 #define LINESTRIP 6 << 18 #define RECTANGLE 7 << 18 #define V0_ENABLE 1 #define V1_ENABLE 2 #define V2_ENABLE 4 /* Vertex Flags */ #define COORD_1 0 #define COORD_2 1 << 8 #define COORD_3 2 << 8 #define FOG_ENABLE 1 << 7 #define ARGB_ENABLE 1 << 6 #define Z_OFFSET_PRESENT 1 << 5 #define XYZ 0x01 << 1 #define XYZW 0x02 << 1 #define XY 0x03 << 1 #define XYW 0x04 << 1 /* Antialiasing */ #define AA_UPDATE_EDGEFLAG (1<<13) #define AA_ENABLE_EDGEFLAG (1<<12) #define AA_UPDATE_POLYWIDTH (1<<11) #define AA_POLYWIDTH_05 (1<<9) #define AA_POLYWIDTH_10 (2<<9) #define AA_POLYWIDTH_20 (3<<9) #define AA_POLYWIDTH_40 (4<<9) #define AA_UPDATE_LINEWIDTH (1<<8) #define AA_LINEWIDTH_05 (1<<6) #define AA_LINEWIDTH_10 (2<<6) #define AA_LINEWIDTH_20 (3<<6) #define AA_LINEWIDTH_40 (4<<6) #define AA_UPDATE_BB_EXPANSION (1<<5) #define AA_BB_EXPANSION_SHIFT 2 #define AA_UPDATE_AA_ENABLE (1<<1) #define AA_ENABLE (1<<0) /* Pixelization Rule */ #define PVK_SMALL_TRI_UPDATE 1 << 12 #define PVK_SMALL_TRI 1 << 11 #define PVK_PIX_RULE_UPDATE 1 << 10 #define PVK_PIX_RULE 1 << 9 #define PVK_LINE_UPDATE 1 << 8 #define PVK_LINE_V0 0 #define PVK_LINE_V1 1 << 6 #define PVK_TRIFAN_UPDATE 1 << 5 #define PVK_TRIFAN_V0 0 #define PVK_TRIFAN_V1 1 << 3 #define PVK_TRIFAN_V2 2 << 3 #define PVK_TRISTRIP_UPDATE 1 << 2 #define PVK_TRISTRIP_V0 0 #define PVK_TRISTRIP_V1 1 #define PVK_TRISTRIP_V2 2 /* Boolean Enable 1 */ #define B1_ALPHA_SETUP_ENABLE_UPDATE 1 << 17 #define B1_ALPHA_SETUP_ENABLE 1 << 16 #define B1_FOG_ENABLE_UPDATE 1 << 7 #define B1_FOG_ENABLE 1 << 6 #define B1_ALPHA_STATE_ENABLE_UPDATE 1 << 5 #define B1_ALPHA_STATE_ENABLE 1 << 4 #define B1_BLEND_ENABLE_UPDATE 1 << 3 #define B1_BLEND_ENABLE 1 << 2 #define B1_Z_ENABLE_UPDATE 1 << 1 #define B1_Z_ENABLE 1 /* Boolean Enable 2 */ #define B2_MCE_UPDATE 1 << 17 #define B2_MCE 1 << 16 #define B2_ALPHA_DITHER_UPDATE 1 << 15 #define B2_ALPHA_DITHER 1 << 14 #define B2_FOG_DITHER_UPDATE 1 << 13 #define B2_FOG_DITHER 1 << 12 #define B2_SPEC_DITHER_UPDATE 1 << 11 #define B2_SPEC_DITHER 1 << 10 #define B2_COLOR_DITHER_UPDATE 1 << 9 #define B2_COLOR_DITHER 1 << 8 #define B2_FB_WRITE_UPDATE 1 << 3 #define B2_FB_WRITE 1 << 2 #define B2_ZB_WRITE_UPDATE 1 << 1 #define B2_ZB_WRITE 1 /* Cull Shade Mode */ #define CULL_Z_UPDATE 1 << 20 #define CULL_Z_ALWAYS 0 #define CULL_Z_NEVER 1 << 16 #define CULL_Z_LESS 2 << 16 #define CULL_Z_EQUAL 3 << 16 #define CULL_Z_LEQUAL 4 << 16 #define CULL_Z_GREATER 5 << 16 #define CULL_Z_NOTEQUAL 6 << 16 #define CULL_Z_GEQUAL 7 << 16 #define CULL_LINE_WIDTH_UPDATE 1 << 15 #define CULL_LINE_WIDTH_MASK 7 << 12 #define CULL_ALPHA_SHADE_UPDATE 1 << 11 #define CULL_ALPHA_SHADE 1 << 10 #define CULL_FOG_SHADE_UPDATE 1 << 9 #define CULL_FOG_SHADE 1 << 8 #define CULL_SPEC_SHADE_UPDATE 1 << 7 #define CULL_SPEC_SHADE 1 << 6 #define CULL_COLOR_SHADE_UPDATE 1 << 5 #define CULL_COLOR_SHADE 1 << 4 #define CULL_MODE_UPDATE 1 << 3 #define CULL_NONE 1 << 2 #define CULL_CW 2 << 2 #define CULL_CCW 3 << 2 #define CULL_BOTH 4 << 2 /* texel map */ #define UPDATE_TEXEL1 1 << 15 #define UPDATE_TEXEL0 1 << 7 #define ENABLE_TEXEL1 1 << 14 #define ENABLE_TEXEL0 1 << 6 #define TEXEL1_COORD_IDX 1 << 11 #define TEXEL0_COORD_IDX 1 << 3 #define TEXEL1_MAP_IDX 1 << 8 #define TEXEL0_MAP_IDX 1 /* color blend stage */ #define COLOR_STAGE0 0 #define COLOR_STAGE1 1 << 20 #define COLOR_STAGE2 2 << 20 #define UPDATE_COLOR_SELECT_MASK 1 << 19 #define SELECT_COLOR_ACC 1 << 18 #define SELECT_COLOR_CURRENT 0 #define UPDATE_COLOR_ARG1 1 << 17 #define ARG1_COLOR_FACTOR 1 << 14 #define ARG1_COLOR_ACC 2 << 14 #define ARG1_COLOR_ITERATED 3 << 14 #define ARG1_COLOR_SPEC 4 << 14 #define ARG1_COLOR_CURRENT 5 << 14 #define ARG1_COLOR_TEXEL0 6 << 14 #define ARG1_COLOR_TEXEL1 7 << 14 #define ARG1_REPLICATE_ALPHA_TO_COLOR 1 << 13 #define ARG1_COLOR_INVERT 1 << 12 #define UPDATE_COLOR_ARG2 1 << 11 #define ARG2_COLOR_FACTOR 1 << 8 #define ARG2_COLOR_ACC 2 << 8 #define ARG2_COLOR_ITERATED 3 << 8 #define ARG2_COLOR_SPEC 4 << 8 #define ARG2_COLOR_CURRENT 5 << 8 #define ARG2_COLOR_TEXEL0 6 << 8 #define ARG2_COLOR_TEXEL1 7 << 8 #define ARG2_REPLICATE_ALPHA_TO_COLOR 1 << 7 #define ARG2_COLORINVERT 1 << 6 #define UPDATE_COLOR_OP 1 << 5 #define DISABLE_COLOR_OP 0 #define SELECT_COLOR_ARG1_OP 1 #define SELECT_COLOR_ARG2_OP 2 #define MODULATE_COLOR_OP 3 #define MODULATE2X_COLOR_OP 4 #define MODULATE4X_COLOR_OP 5 #define ADD_COLOR_OP 6 #define ADD_SIGNED_COLOR_OP 7 #define LINEAR_ALPHA_ITER_OP 8 #define LINEAR_ALPHA_FACTOR_OP 0x0a #define LINEAR_TEXEL0_ALPHA_OP 0x10 #define LINEAR_TEXEL1_ALPHA_OP 0x11 #define LINEAR_TEXEL0_COLOR_OP 0x12 #define LINEAR_TEXEL1_COLOR_OP 0x13 #define SUBTRACT_COLOR_OP 0x14 /* alpha blend stage */ #define ALPHA_STAGE0 0 #define ALPHA_STAGE1 1 << 20 #define ALPHA_STAGE2 2 << 20 #define UPDATE_ALPHA_SELECT_MASK 1 << 19 #define UPDATE_ALPHA_ARG1 1 << 18 #define ARG1_ALPHA_FACTOR 1 << 15 #define ARG1_ALPHA_ITERATED 3 << 15 #define ARG1_ALPHA_CURRENT 5 << 15 #define ARG1_ALPHA_TEXEL0 6 << 15 #define ARG1_ALPHA_TEXEL1 7 << 15 #define ARG1_ALPHA_INVERT 1 << 13 #define UPDATE_ALPHA_ARG2 1 << 12 #define ARG2_ALPHA_FACTOR 1 << 8 #define ARG2_ALPHA_ITERATED 3 << 8 #define ARG2_ALPHA_CURRENT 5 << 8 #define ARG2_ALPHA_TEXEL0 6 << 8 #define ARG2_ALPHA_TEXEL1 7 << 8 #define ARG2_ALPHAINVERT 1 << 6 #define UPDATE_ALPHA_OP 1 << 5 #define DISABLE_ALPHA_OP 0 #define SELECT_ALPHA_ARG1_OP 1 #define SELECT_ALPHA_ARG2_OP 2 #define MODULATE_ALPHA_OP 3 #define MODULATE2X_ALPHA_OP 4 #define MODULATE4X_ALPHA_OP 5 #define ADD_ALPHA_OP 6 #define ADD_SIGNED_ALPHA_OP 7 #define LINEAR_ALPHA_ITER_OP 8 #define LINEAR_ALPHA_FACTOR_OP 0x0a #define LINEAR_TEXEL0_ALPHA_OP 0x10 #define LINEAR_TEXEL1_ALPHA_OP 0x11 /* Source-Dest Blend Mono */ #define UPDATE_MONO 1 << 13 #define ENABLE_MONO 1 << 12 #define DISABLE_MONO 0 #define UPDATE_SRC_MONO_BLEND 1 << 11 #define UPDATE_DEST_MONO_BLEND 1 << 5 #define SRC_ZERO 1 >>6 #define SRC_ONE 2 << 6 #define SRC_SRC_COLOR 3 << 6 #define SRC_INV_SRC_COLOR 4 << 6 #define SRC_SRC_ALPHA 5 << 6 #define SRC_INV_SRC_ALPHA 6 << 6 #define SRC_DST_COLOR 9 << 6 #define SRC_INV_DST_COLOR 0x0a << 6 #define SRC_BOTH_SRC_ALPHA 0x0c << 6 #define SRC_BOTH_INV_SRC_ALPHA 0x0d << 6 #define DEST_ZERO 1 #define DEST_ONE 2 #define DEST_SRC_COLOR 3 #define DEST_INV_SRC_COLOR 4 #define DEST_SRC_ALPHA 5 #define DEST_INV_SRC_ALPHA 6 #define DEST_DST_COLOR 9 #define DEST_INV_DST_COLOR 0x0a #define DEST_BOTH_SRC_ALPHA 0x0c #define DEST_BOTH_INV_SRC_ALPHA 0x0d /* Destination Render Buffer */ #define RENDER_RGB8 0 #define RENDER_RGB15 1 << 8 #define RENDER_RGB16 2 << 8 #define YUV_YSWAP 4 << 8 #define YUV_NORMAL 5 << 8 #define YUV_UVSWAP 6 << 8 #define YUV_YUVSWAP 7 << 8 #define ORG_XBIASMASK 0x0F << 20 #define ORG_YBIASMASK 0x0F << 16 #define VSTRIDE 2 #define VSTRIDE_OFFSET 1 /* Alpha Z-bias */ #define UPDATE_ZBIAS 1 << 22 #define UPDATE_ALPHA_FX 1 << 13 #define UPDATE_ALPHA_REFERENCE 1 << 8 #define ALPHAFX_NEVER 1 << 9 #define ALPHAFX_LESS 2 << 9 #define ALPHAFX_EQUAL 3 << 9 #define ALPHAFX_LEQUAL 4 << 9 #define ALPHAFX_GREATER 5 << 9 #define ALPHAFX_NOTEQUAL 6 << 9 #define ALPHAFX_GEQUAL 7 << 9 #define ALPHAFX_ALWAYS 8 << 9 /* Scissor */ #define SCISSOR_ENABLE_UPDATE 1 << 1 #define SCISSOR_ENABLE 1 /* Stipple */ #define STIPPLE_ENABLE 1 << 16 /* Rendering Packets */ /* state pipelined */ #define COLOR_BLEND_STAGE RENDER | 0x00 << 24 #define ALPHA_BLEND_STAGE RENDER | 0x01 << 24 #define LINE_WIDTH_CULL_SHADE RENDER | 0x02 << 24 #define BOOL_ENABLE_1 RENDER | 0x03 << 24 #define BOOL_ENABLE_2 RENDER | 0x04 << 24 #define VERTEX_FORMAT RENDER | 0x05 << 24 #define ANTIALIAS RENDER | 0x06 << 24 #define PVK_PIXEL_RULE RENDER | 0x07 << 24 #define SRC_DEST_BLEND_MONO RENDER | 0x08 << 24 #define MAP_TEXEL RENDER | 0x1C << 24 #define PRIMITIVE RENDER | 0x1F << 24 /* multiple dwords */ #define COLOR_FACTOR RENDER | 0x1D << 24 | 0x01 << 16 | 0 #define COLOR_CHROMA_KEY RENDER | 0x1D << 24 | 0x02 << 16 | 1 #define DRAWING_RECT_INFO RENDER | 0x1D << 24 | 0x80 << 16 | 3 #define RENDER_BUF_DEST RENDER | 0x1D << 24 | 0x85 << 16 | 0 #define SCISSOR_INFO RENDER | 0x1D << 24 | 0x81 << 16 | 1 #define STIPPLE RENDER | 0x1D << 24 | 0x83 << 16 | 0 /* non-pipelined */ #define ALPHA_Z_BIAS RENDER | 0x14 << 24 #define FOG_COLOR RENDER | 0x15 << 24 #define SCISSOR RENDER | 0x1C << 24 | 0x10 << 19 #define RBUFFER_START_MASK 0xFFFFF000 #define RBUFFER_SIZE_MASK 0x001FF000 #define RBUFFER_HEAD_MASK 0x001FFFFC #define RBUFFER_TAIL_MASK 0x001FFFF8 #define RINGBUFFER_SIZE (128 * 1024) #define RING_SIZE_MASK (RINGBUFFER_SIZE - 1) #define I810RES_GART 1 #define I810RES_LRING_ACQ 2 #define I810RES_LRING_BIND 4 #define I810RES_OVL_ACQ 8 #define I810RES_OVL_BIND 16 #define I810RES_GART_ACQ 32 #define I810RES_MMAP 64 #define I810RES_STATE_SAVE 128 #ifndef AGP_NORMAL_MEMORY #define AGP_NORMAL_MEMORY 0 #endif #ifndef AGP_PHYSICAL_MEMORY #define AGP_PHYSICAL_MEMORY 2 #endif struct i810_ovl_regs { u32 obuf_0y; u32 obuf_1y; u32 obuf_0u; u32 obuf_0v; u32 obuf_1u; u32 obuf_1v; u32 ov0stride; u32 yrgb_vph; u32 uv_vph; u32 horz_ph; u32 init_ph; u32 dwinpos; u32 dwinsz; u32 swid; u32 swidqw; u32 sheight; u32 yrgbscale; u32 uvscale; u32 ov0clrc0; u32 ov0clrc1; u32 dclrkv; u32 dclrkm; u32 sclrkvh; u32 sclrkvl; u32 sclrkm; u32 ov0conf; u32 ov0cmd; u32 reserved; u32 awinpos; u32 awinsz; }; typedef struct { CoreLayerRegionConfig config; int planar_bug; } I810OverlayLayerData; typedef struct { unsigned int tail_mask; int size; int head; int tail; int space; } I810RingBuffer; typedef struct { volatile void *virt; unsigned int tail_mask; unsigned int outring; } I810RingBlock; typedef struct { bool initialized; I810RingBuffer lp_ring; bool overlayOn; I810OverlayLayerData *iovl; agp_info info; agp_allocate lring_mem; agp_allocate ovl_mem; agp_bind lring_bind; agp_bind ovl_bind; u32 pattern; u32 lring1; u32 lring2; u32 lring3; u32 lring4; u32 i810fb_version; u32 cur_tail; int srcaddr, destaddr, srcpitch, destpitch; int color_value, color_value3d, pixeldepth, blit_color; int colorkey_bit, colorkey, render_color; int clip_x1, clip_x2, clip_y1, clip_y2; /* state validation */ int i_src; int i_dst; int i_color; int i_colorkey; int i_clip; /* benchmarking */ u32 waitfifo_sum; u32 waitfifo_calls; u32 idle_calls; u32 fifo_waitcycles; u32 idle_waitcycles; u32 fifo_cache_hits; u32 fifo_timeoutsum; u32 idle_timeoutsum; } I810DeviceData; typedef struct { I810DeviceData *idev; volatile struct i810_ovl_regs *oregs; u32 flags; int agpgart; agp_info info; volatile u8 *aper_base; volatile u8 *lring_base; volatile u8 *ovl_base; volatile u8 *mmio_base; volatile u8 *pattern_base; } I810DriverData; extern DisplayLayerFuncs i810OverlayFuncs; void i810ovlOnOff( I810DriverData *idrv, I810DeviceData *idev, bool on ); #define i810_readb(mmio_base, where) \ *((volatile u8 *) (mmio_base + where)) \ #define i810_readw(mmio_base, where) \ *((volatile u16 *) (mmio_base + where)) \ #define i810_readl(mmio_base, where) \ *((volatile u32 *) (mmio_base + where)) \ #define i810_writeb(mmio_base, where, val) \ *((volatile u8 *) (mmio_base + where)) = (volatile u8) val \ #define i810_writew(mmio_base, where, val) \ *((volatile u16 *) (mmio_base + where)) = (volatile u16) val \ #define i810_writel(mmio_base, where, val) \ *((volatile u32 *) (mmio_base + where)) = (volatile u32) val \ #define PUT_LRING(val) { \ i810_writel(i810drv->lring_base, i810dev->cur_tail, val); \ i810dev->cur_tail += 4; \ i810dev->cur_tail &= RING_SIZE_MASK; \ } #define BEGIN_LRING i810_wait_for_space #define END_LRING(i810drv) i810_writel(LRING, i810drv->mmio_base, i810dev->cur_tail) #endif /* __I810_H__ */ DirectFB-1.2.10/gfxdrivers/i810/i810.c0000644000175000017500000007173111245562152013643 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Antonino Daplas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* need fb handle to get accel, MMIO programming in the i810 is useless */ #include #include #include #include #include DFB_GRAPHICS_DRIVER( i810 ) #include "i810.h" #define TIMER_LOOP 1000000000 #define BUFFER_PADDING 2 #define MMIO_SIZE 512 * 1024 #define I810_SUPPORTED_DRAWINGFLAGS (DSDRAW_NOFX) #define I810_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_FILLTRIANGLE) #define I810_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY) #define I810_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT) static void i810_lring_enable(I810DriverData *i810drv, u32 mode) { u32 tmp; tmp = i810_readl(i810drv->mmio_base, LRING + 12); tmp = (!mode) ? tmp & ~1 : tmp | 1; i810_writel(i810drv->mmio_base, LRING + 12, tmp); } static inline void i810_wait_for_blit_idle(I810DriverData *i810drv, I810DeviceData *i810dev ) { u32 count = 0; if (i810dev != NULL) i810dev->idle_calls++; while ((i810_readw(i810drv->mmio_base, INSTDONE) & 0x7b) != 0x7b && count++ < TIMER_LOOP) { if (i810dev != NULL) i810dev->idle_waitcycles++; } if (count >= TIMER_LOOP) { if (i810dev != NULL) i810dev->idle_timeoutsum++; D_BUG("warning: idle timeout exceeded"); } } static void i810_init_ringbuffer(I810DriverData *i810drv, I810DeviceData *i810dev ) { u32 tmp1, tmp2; i810_wait_for_blit_idle(i810drv, i810dev); i810_lring_enable(i810drv, 0); i810_writel(i810drv->mmio_base, LRING, 0); i810_writel(i810drv->mmio_base, LRING + 4, 0); i810dev->cur_tail = 0; tmp2 = i810_readl(i810drv->mmio_base, LRING + 8) & ~RBUFFER_START_MASK; tmp1 = i810dev->lring_bind.pg_start * 4096; i810_writel(i810drv->mmio_base, LRING + 8, tmp2 | tmp1); tmp1 = i810_readl(i810drv->mmio_base, LRING + 12); tmp1 &= ~RBUFFER_SIZE_MASK; tmp2 = (RINGBUFFER_SIZE - 4096) & RBUFFER_SIZE_MASK; i810_writel(i810drv->mmio_base, LRING + 12, tmp1 | tmp2); i810_lring_enable(i810drv, 1); } 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; } static void i810FlushTextureCache(void *drv, void *dev) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; if (BEGIN_LRING(i810drv, i810dev, 2)) return; PUT_LRING(PARSER | FLUSH); PUT_LRING(NOP); END_LRING(i810drv); } static DFBResult i810EngineSync(void *drv, void *dev) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; i810_wait_for_blit_idle(i810drv, i810dev); return DFB_OK; } /* * Set State routines */ static inline void i810_set_src(I810DriverData *i810drv, I810DeviceData *i810dev, CardState *state) { if (i810dev->i_src) return; i810dev->srcaddr = dfb_gfxcard_memory_physical((CoreGraphicsDevice *) i810dev, state->src.offset); i810dev->srcpitch = state->src.pitch; i810dev->i_src = 1; } 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; } static inline void i810_set_colorkey(I810DriverData *i810drv, I810DeviceData *i810dev, CardState *state) { if (i810dev->i_colorkey) return; i810dev->colorkey_bit = 0; if (state->blittingflags & DSBLIT_SRC_COLORKEY) { i810dev->colorkey_bit = 1 << 8; i810dev->colorkey = state->src_colorkey; } else { i810dev->colorkey_bit = 7 << 8; i810dev->colorkey = state->dst_colorkey; } i810dev->i_colorkey = 1; } 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; } static inline void i810_set_clip(I810DriverData *i810drv, I810DeviceData *i810dev, DFBRegion *clip ) { if (i810dev->i_clip) return; i810dev->clip_x1 = clip->x1; i810dev->clip_x2 = clip->x2 + 1; i810dev->clip_y1 = clip->y1; i810dev->clip_y2 = clip->y2 + 1; i810dev->i_clip = 1; } static void i810CheckState(void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { case DSPF_LUT8: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB24: break; default: return; } if (!(accel & ~I810_SUPPORTED_DRAWINGFUNCTIONS) && !(state->drawingflags & ~I810_SUPPORTED_DRAWINGFLAGS)) state->accel |= I810_SUPPORTED_DRAWINGFUNCTIONS; if (!(accel & ~I810_SUPPORTED_BLITTINGFUNCTIONS) && !(state->blittingflags & ~I810_SUPPORTED_BLITTINGFLAGS)) { if (state->source->config.format == state->destination->config.format) state->accel |= I810_SUPPORTED_BLITTINGFUNCTIONS; } } static void i810SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; if (state->mod_hw) { if ((state->mod_hw & SMF_SOURCE) && state->source) i810dev->i_src = 0; if (state->mod_hw & SMF_DESTINATION) i810dev->i_dst = 0; if (state->mod_hw & SMF_COLOR) i810dev->i_color = 0; if (state->mod_hw & SMF_CLIP) i810dev->i_clip = 0; if (state->mod_hw & SMF_SRC_COLORKEY || state->mod_hw & SMF_DST_COLORKEY) { i810dev->i_colorkey = 0; } } switch (accel) { case DFXL_DRAWRECTANGLE: case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: i810_set_dest(i810drv, i810dev, state); i810_set_color(i810drv, i810dev, state); i810_set_clip(i810drv, i810dev, &state->clip); state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE; break; case DFXL_BLIT: i810_set_src( i810drv, i810dev, state); i810_set_dest(i810drv, i810dev, state); i810_set_color(i810drv, i810dev, state); i810_set_clip(i810drv, i810dev, &state->clip); if (state->blittingflags & DSBLIT_SRC_COLORKEY || state->blittingflags & DSBLIT_DST_COLORKEY) i810_set_colorkey(i810drv, i810dev, state); state->set |= DFXL_BLIT; break; default: D_BUG("unexpected drawing/blitting function"); } state->mod_hw = 0; } static bool i810FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; u32 dest; if (rect->x < i810dev->clip_x1) rect->x = i810dev->clip_x1; if (i810dev->clip_x2 < rect->x + rect->w) rect->w = i810dev->clip_x2 - rect->x; if (rect->y < i810dev->clip_y1) rect->y = i810dev->clip_y1; if (i810dev->clip_y2 < rect->y + rect->h) rect->h = i810dev->clip_y2 - rect->y; rect->x *= i810dev->pixeldepth; rect->w *= i810dev->pixeldepth; dest = i810dev->destaddr + rect->x + (rect->y * i810dev->destpitch); if (BEGIN_LRING(i810drv, i810dev, 6)) return false; PUT_LRING(BLIT | COLOR_BLT | 3); PUT_LRING(COLOR_COPY_ROP << 16 | i810dev->destpitch | SOLIDPATTERN | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING(rect->h << 16 | rect->w); PUT_LRING(dest); PUT_LRING(i810dev->color_value); PUT_LRING(NOP); END_LRING(i810drv); return true; } static bool i810DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; u32 dest; if (rect->x < i810dev->clip_x1) rect->x = i810dev->clip_x1; if (i810dev->clip_x2 < rect->x + rect->w) rect->w = i810dev->clip_x2 - rect->x; if (rect->y < i810dev->clip_y1) rect->y = i810dev->clip_y1; if (i810dev->clip_y2 < rect->y + rect->h) rect->h = i810dev->clip_y2 - rect->y; rect->x *= i810dev->pixeldepth; rect->w *= i810dev->pixeldepth; if (BEGIN_LRING(i810drv, i810dev, 20)) return false; /* horizontal line 1 */ dest = i810dev->destaddr + rect->x + (rect->y * i810dev->destpitch); PUT_LRING(BLIT | COLOR_BLT | 3); PUT_LRING(COLOR_COPY_ROP << 16 | i810dev->destpitch | SOLIDPATTERN | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING(1 << 16 | rect->w); PUT_LRING(dest); PUT_LRING(i810dev->color_value); /* vertical line 1 */ PUT_LRING(BLIT | COLOR_BLT | 3); PUT_LRING(COLOR_COPY_ROP << 16 | i810dev->destpitch | SOLIDPATTERN | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING(rect->h << 16 | i810dev->pixeldepth); PUT_LRING(dest); PUT_LRING(i810dev->color_value); /* vertical line 2 */ dest += rect->w; PUT_LRING(BLIT | COLOR_BLT | 3); PUT_LRING(COLOR_COPY_ROP << 16 | i810dev->destpitch | SOLIDPATTERN | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING(rect->h << 16 | i810dev->pixeldepth); PUT_LRING(dest); PUT_LRING(i810dev->color_value); /* horizontal line 2 */ dest -= rect->w; dest += rect->h * i810dev->destpitch; PUT_LRING(BLIT | COLOR_BLT | 3); PUT_LRING(COLOR_COPY_ROP << 16 | i810dev->destpitch | SOLIDPATTERN | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING(1 << 16 | rect->w); PUT_LRING(dest); PUT_LRING(i810dev->color_value); END_LRING(i810drv); return true; } static bool i810Blit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; int xdir = INCREMENT, spitch = 0, dpitch = 0, src, dest; if (dx < i810dev->clip_x1) { rect->w = MIN((i810dev->clip_x2 - i810dev->clip_x1), (dx + rect->w) - i810dev->clip_x1); rect->x += i810dev->clip_x1 - dx; dx = i810dev->clip_x1; } if (i810dev->clip_x2 < dx + rect->w) rect->w = i810dev->clip_x2 - dx; if (dy < i810dev->clip_y1) { rect->h = MIN((i810dev->clip_y2 - i810dev->clip_y1), (dy + rect->h) - i810dev->clip_y1); rect->y += i810dev->clip_y1 - dy; dy = i810dev->clip_y1; } if (i810dev->clip_y2 < dy + rect->h) rect->h = i810dev->clip_y2 - dy; rect->x *= i810dev->pixeldepth; dx *= i810dev->pixeldepth; rect->w *= i810dev->pixeldepth; spitch = i810dev->srcpitch; dpitch = i810dev->destpitch; if (i810dev->srcaddr == i810dev->destaddr) { if (dx > rect->x && dx < rect->x + rect->w) { xdir = DECREMENT; rect->x += rect->w - 1; dx += rect->w - 1; } if (dy > rect->y && dy < rect->y + rect->h) { i810dev->srcpitch = (-(i810dev->srcpitch)) & 0xFFFF; i810dev->destpitch = (-(i810dev->destpitch)) & 0xFFFF; rect->y += rect->h - 1; dy += rect->h - 1; } } src = i810dev->srcaddr + rect->x + (rect->y * spitch); dest = i810dev->destaddr + dx + (dy * dpitch); BEGIN_LRING(i810drv, i810dev, 8); PUT_LRING(BLIT | FULL_BLIT | 0x6 | i810dev->colorkey_bit); PUT_LRING(xdir | PAT_COPY_ROP << 16 | i810dev->destpitch | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING((rect->h << 16) | rect->w); PUT_LRING(dest); PUT_LRING(i810dev->srcpitch); PUT_LRING(src); PUT_LRING(i810dev->colorkey); PUT_LRING((u32)(unsigned long) i810drv->pattern_base); END_LRING(i810drv); return true; } /* * The software rasterizer when rendering non-axis aligned * edges uses line spanning. In our case, it will use * FillRect to render a 1 pixel-high rectangle. However, * this would be slow in the i810 since for each rectangle, * an ioctl has to be done which is very slow. As a temporary * replacement, I'll include a SpanLine function that will * not do an ioctl for every line. This should be * significantly faster. */ /* borrowed heavily and shamelessly from gfxcard.c */ typedef struct { int xi; int xf; int mi; int mf; int _2dy; } DDA; #define SETUP_DDA(xs,ys,xe,ye,dda) \ do { \ int dx = xe - xs; \ int dy = ye - ys; \ dda.xi = xs; \ if (dy != 0) { \ dda.mi = dx / dy; \ dda.mf = 2*(dx % dy); \ dda.xf = -dy; \ dda._2dy = 2*dy; \ if (dda.mf < 0) { \ dda.mf += ABS(dy)*2; \ dda.mi--; \ } \ } \ else { \ dda.mi = 0; \ dda.mf = 0; \ dda.xf = 0; \ dda._2dy = 0; \ } \ } while (0) #define INC_DDA(dda) \ do { \ dda.xi += dda.mi; \ dda.xf += dda.mf; \ if (dda.xf > 0) { \ dda.xi++; \ dda.xf -= dda._2dy; \ } \ } while (0) /* * The i810fill_tri function takes advantage of the buffer. * It will fill up the buffer until it's done rendering the * triangle. */ static inline bool i810fill_tri( DFBTriangle *tri, I810DriverData *i810drv, I810DeviceData *i810dev ) { int y, yend; DDA dda1, dda2; u32 total, dest = 0; y = tri->y1; yend = tri->y3; if (y < i810dev->clip_y1) y = i810dev->clip_y1; if (yend > i810dev->clip_y2) yend = i810dev->clip_y2; SETUP_DDA(tri->x1, tri->y1, tri->x3, tri->y3, dda1); SETUP_DDA(tri->x1, tri->y1, tri->x2, tri->y2, dda2); total = (yend - y) * 5; if (total + BUFFER_PADDING > RINGBUFFER_SIZE/4) { D_BUG("fill_triangle: buffer size is too small\n"); return false; } BEGIN_LRING(i810drv, i810dev, total); while (y < yend) { DFBRectangle rect; if (y == tri->y2) { if (tri->y2 == tri->y3) return true; SETUP_DDA(tri->x2, tri->y2, tri->x3, tri->y3, dda2); } rect.w = ABS(dda1.xi - dda2.xi); rect.x = MIN(dda1.xi, dda2.xi); if (rect.w > 0) { rect.y = y; dest = i810dev->destaddr + (y * i810dev->destpitch) + (rect.x * i810dev->pixeldepth); PUT_LRING(BLIT | COLOR_BLT | 3); PUT_LRING(COLOR_COPY_ROP << 16 | i810dev->destpitch | SOLIDPATTERN | DYN_COLOR_EN | i810dev->blit_color); PUT_LRING(1 << 16 | rect.w * i810dev->pixeldepth); PUT_LRING(dest); PUT_LRING(i810dev->color_value); } INC_DDA(dda1); INC_DDA(dda2); y++; } END_LRING(i810drv); return true; } static bool i810FillTriangle( void *drv, void *dev, DFBTriangle *tri) { I810DriverData *i810drv = (I810DriverData *) drv; I810DeviceData *i810dev = (I810DeviceData *) dev; bool err = true; dfb_sort_triangle(tri); if (tri->y3 - tri->y1 > 0) err = i810fill_tri(tri, i810drv, i810dev); return err; } static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_I810: /* Intel 810 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Intel 810/810E/810-DC100/815 Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Tony Daplas" ); snprintf( info->url, DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH, "http://i810fb.sourceforge.net" ); snprintf( info->license, DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH, "LGPL" ); info->version.major = 0; info->version.minor = 5; info->driver_data_size = sizeof (I810DriverData); info->device_data_size = sizeof (I810DeviceData); } static void i810_release_resource( I810DriverData *idrv, I810DeviceData *idev ) { agp_unbind unbind; if (idrv->flags & I810RES_STATE_SAVE) { i810_writel( idrv->mmio_base, LP_RING, idev->lring1 ); i810_writel( idrv->mmio_base, LP_RING + RING_HEAD, idev->lring2 ); i810_writel( idrv->mmio_base, LP_RING + RING_START, idev->lring3 ); i810_writel( idrv->mmio_base, LP_RING + RING_LEN, idev->lring4 ); } if (idrv->flags & I810RES_MMAP) { munmap((void *) idrv->aper_base, idev->info.aper_size * 1024 * 1024); idrv->flags &= ~I810RES_MMAP; } if (idrv->flags & I810RES_LRING_BIND) { unbind.key = idev->lring_bind.key; ioctl(idrv->agpgart, AGPIOC_UNBIND, &unbind); } if (idrv->flags & I810RES_LRING_ACQ) ioctl(idrv->agpgart, AGPIOC_DEALLOCATE, idev->lring_mem.key); if (idrv->flags & I810RES_OVL_BIND) { unbind.key = idev->ovl_bind.key; ioctl(idrv->agpgart, AGPIOC_UNBIND, &unbind); } if (idrv->flags & I810RES_OVL_ACQ) ioctl(idrv->agpgart, AGPIOC_DEALLOCATE, idev->ovl_mem.key); if (idrv->flags & I810RES_GART_ACQ) { ioctl(idrv->agpgart, AGPIOC_RELEASE); idrv->flags &= ~I810RES_GART_ACQ; } if (idrv->flags & I810RES_GART) { close(idrv->agpgart); idrv->flags &= ~I810RES_GART; } } static DFBResult i810_agp_setup( CoreGraphicsDevice *device, I810DriverData *idrv, I810DeviceData *idev ) { idrv->agpgart = open("/dev/agpgart", O_RDWR); if (idrv->agpgart == -1) return DFB_IO; D_FLAGS_SET( idrv->flags, I810RES_GART ); if (ioctl(idrv->agpgart, AGPIOC_ACQUIRE)) { D_PERROR( "I810/AGP: AGPIOC_ACQUIRE failed!\n" ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I810RES_GART_ACQ ); if (!idev->initialized) { agp_setup setup; setup.agp_mode = 0; if (ioctl(idrv->agpgart, AGPIOC_SETUP, &setup)) { D_PERROR( "I810/AGP: AGPIOC_SETUP failed!\n" ); return DFB_IO; } if (ioctl(idrv->agpgart, AGPIOC_INFO, &idev->info)) { D_PERROR( "I810/AGP: AGPIOC_INFO failed!\n" ); return DFB_IO; } } idrv->aper_base = mmap( NULL, idev->info.aper_size * 1024 * 1024, PROT_WRITE, MAP_SHARED, idrv->agpgart, 0 ); if (idrv->aper_base == MAP_FAILED) { D_PERROR( "I810/AGP: mmap() failed!\n" ); i810_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I810RES_MMAP ); if (!idev->initialized) { u32 base; /* We'll attempt to bind at fb_base + fb_len + 1 MB, to be safe */ base = dfb_gfxcard_memory_physical(device, 0) - idev->info.aper_base; base += dfb_gfxcard_memory_length(); base += (1024 * 1024); idev->lring_mem.pg_count = RINGBUFFER_SIZE/4096; idev->lring_mem.type = AGP_NORMAL_MEMORY; if (ioctl(idrv->agpgart, AGPIOC_ALLOCATE, &idev->lring_mem)) { D_PERROR( "I810/AGP: AGPIOC_ALLOCATE failed!\n" ); i810_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I810RES_LRING_ACQ ); idev->lring_bind.key = idev->lring_mem.key; idev->lring_bind.pg_start = base/4096; if (ioctl(idrv->agpgart, AGPIOC_BIND, &idev->lring_bind)) { D_PERROR( "I810/AGP: AGPIOC_BIND failed!\n" ); i810_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I810RES_LRING_BIND ); idev->ovl_mem.pg_count = 1; idev->ovl_mem.type = AGP_PHYSICAL_MEMORY; if (ioctl(idrv->agpgart, AGPIOC_ALLOCATE, &idev->ovl_mem)) { D_PERROR( "I810/AGP: AGPIOC_ALLOCATE failed!\n" ); i810_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I810RES_OVL_ACQ ); idev->ovl_bind.key = idev->ovl_mem.key; idev->ovl_bind.pg_start = (base + RINGBUFFER_SIZE)/4096; if (ioctl(idrv->agpgart, AGPIOC_BIND, &idev->ovl_bind)) { D_PERROR( "I810/AGP: AGPIOC_BIND failed!\n" ); i810_release_resource( idrv, idev ); return DFB_IO; } D_FLAGS_SET( idrv->flags, I810RES_OVL_BIND ); } if (idrv->flags & I810RES_GART_ACQ) { ioctl(idrv->agpgart, AGPIOC_RELEASE); idrv->flags &= ~I810RES_GART_ACQ; } idrv->lring_base = idrv->aper_base + idev->lring_bind.pg_start * 4096; idrv->ovl_base = idrv->aper_base + idev->ovl_bind.pg_start * 4096; idrv->pattern_base = idrv->ovl_base + 1024; if (!idev->initialized) { memset((void *) idrv->ovl_base, 0xff, 1024); memset((void *) idrv->pattern_base, 0xff, 4096 - 1024); idev->lring1 = 0;//i810_readl(idrv->mmio_base, LP_RING); idev->lring2 = 0;//i810_readl(idrv->mmio_base, LP_RING + RING_HEAD); idev->lring3 = 0;//i810_readl(idrv->mmio_base, LP_RING + RING_START); idev->lring4 = 0;//i810_readl(idrv->mmio_base, LP_RING + RING_LEN); D_FLAGS_SET( idrv->flags, I810RES_STATE_SAVE ); } idev->initialized = true; return DFB_OK; } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { DFBResult ret; I810DriverData *idrv = driver_data; I810DeviceData *idev = device_data; idrv->idev = device_data; idrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!idrv->mmio_base) return DFB_IO; ret = i810_agp_setup( device, idrv, idev ); if (ret) { dfb_gfxcard_unmap_mmio( device, idrv->mmio_base, -1 ); return ret; } idrv->info = idev->info; funcs->CheckState = i810CheckState; funcs->SetState = i810SetState; funcs->EngineSync = i810EngineSync; funcs->FlushTextureCache = i810FlushTextureCache; funcs->FillRectangle = i810FillRectangle; funcs->DrawRectangle = i810DrawRectangle; funcs->Blit = i810Blit; funcs->FillTriangle = i810FillTriangle; dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &i810OverlayFuncs ); return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { I810DriverData *idrv = driver_data; I810DeviceData *idev = device_data; /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "810/810E/810-DC100/815" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "Intel" ); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = I810_SUPPORTED_DRAWINGFUNCTIONS | I810_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = I810_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = I810_SUPPORTED_BLITTINGFLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; dfb_config->pollvsync_after = 1; i810_init_ringbuffer( idrv, idev ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { I810DeviceData *i810dev = (I810DeviceData *) device_data; I810DriverData *i810drv = (I810DriverData *) driver_data; i810ovlOnOff( i810drv, i810dev, false ); i810_wait_for_blit_idle( i810drv, i810dev ); i810_lring_enable( i810drv, 0 ); i810_release_resource( i810drv, i810dev ); D_DEBUG( "DirectFB/I810: DMA Buffer Performance Monitoring:\n"); D_DEBUG( "DirectFB/I810: %9d DMA buffer size in KB\n", RINGBUFFER_SIZE/1024 ); D_DEBUG( "DirectFB/I810: %9d i810_wait_for_blit_idle calls\n", i810dev->idle_calls ); D_DEBUG( "DirectFB/I810: %9d i810_wait_for_space calls\n", i810dev->waitfifo_calls ); D_DEBUG( "DirectFB/I810: %9d BUFFER transfers (i810_wait_for_space sum)\n", i810dev->waitfifo_sum ); D_DEBUG( "DirectFB/I810: %9d BUFFER wait cycles (depends on GPU/CPU)\n", i810dev->fifo_waitcycles ); D_DEBUG( "DirectFB/I810: %9d IDLE wait cycles (depends on GPU/CPU)\n", i810dev->idle_waitcycles ); D_DEBUG( "DirectFB/I810: %9d BUFFER space cache hits(depends on BUFFER size)\n", i810dev->fifo_cache_hits ); D_DEBUG( "DirectFB/I810: %9d BUFFER timeout sum (possible hardware crash)\n", i810dev->fifo_timeoutsum ); D_DEBUG( "DirectFB/I810: %9d IDLE timeout sum (possible hardware crash)\n", i810dev->idle_timeoutsum ); D_DEBUG( "DirectFB/I810: Conclusion:\n" ); D_DEBUG( "DirectFB/I810: Average buffer transfers per i810_wait_for_space " "call: %.2f\n", i810dev->waitfifo_sum/(float)(i810dev->waitfifo_calls) ); D_DEBUG( "DirectFB/I810: Average wait cycles per i810_wait_for_space call:" " %.2f\n", i810dev->fifo_waitcycles/(float)(i810dev->waitfifo_calls) ); D_DEBUG( "DirectFB/I810: Average wait cycles per i810_wait_for_blit_idle call:" " %.2f\n", i810dev->idle_waitcycles/(float)(i810dev->idle_calls) ); D_DEBUG( "DirectFB/I810: Average buffer space cache hits: %02d%%\n", (int)(100 * i810dev->fifo_cache_hits/ (float)(i810dev->waitfifo_calls)) ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { I810DriverData *idrv = (I810DriverData *) driver_data; dfb_gfxcard_unmap_mmio( device, idrv->mmio_base, -1); if (idrv->flags & I810RES_MMAP) { munmap((void *) idrv->aper_base, idrv->info.aper_size * 1024 * 1024); idrv->flags &= ~I810RES_MMAP; } if (idrv->flags & I810RES_GART_ACQ) { ioctl(idrv->agpgart, AGPIOC_RELEASE); idrv->flags &= ~I810RES_GART_ACQ; } if (idrv->flags & I810RES_GART) { close(idrv->agpgart); idrv->flags &= ~I810RES_GART; } } DirectFB-1.2.10/gfxdrivers/i810/i810_overlay.c0000644000175000017500000004303411245562152015377 00000000000000/* i810_overlay.c -- Video Overlay Support (based partly from XFree86 i810_video.c) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Antonino Daplas This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include #include #include #include #include #include #include #include #include "i810.h" /* * OV0CMD - Overlay Command Register */ #define VERTICAL_CHROMINANCE_FILTER 0x70000000 #define VC_SCALING_OFF 0x00000000 #define VC_LINE_REPLICATION 0x10000000 #define VC_UP_INTERPOLATION 0x20000000 #define VC_PIXEL_DROPPING 0x50000000 #define VC_DOWN_INTERPOLATION 0x60000000 #define VERTICAL_LUMINANCE_FILTER 0x0E000000 #define VL_SCALING_OFF 0x00000000 #define VL_LINE_REPLICATION 0x02000000 #define VL_UP_INTERPOLATION 0x04000000 #define VL_PIXEL_DROPPING 0x0A000000 #define VL_DOWN_INTERPOLATION 0x0C000000 #define HORIZONTAL_CHROMINANCE_FILTER 0x01C00000 #define HC_SCALING_OFF 0x00000000 #define HC_LINE_REPLICATION 0x00400000 #define HC_UP_INTERPOLATION 0x00800000 #define HC_PIXEL_DROPPING 0x01400000 #define HC_DOWN_INTERPOLATION 0x01800000 #define HORIZONTAL_LUMINANCE_FILTER 0x00380000 #define HL_SCALING_OFF 0x00000000 #define HL_LINE_REPLICATION 0x00080000 #define HL_UP_INTERPOLATION 0x00100000 #define HL_PIXEL_DROPPING 0x00280000 #define HL_DOWN_INTERPOLATION 0x00300000 #define Y_ADJUST 0x00010000 #define OV_BYTE_ORDER 0x0000C000 #define UV_SWAP 0x00004000 #define Y_SWAP 0x00008000 #define Y_AND_UV_SWAP 0x0000C000 #define SOURCE_FORMAT 0x00003C00 #define RGB_555 0x00000800 #define RGB_565 0x00000C00 #define YUV_422 0x00002000 #define YUV_411 0x00002400 #define YUV_420 0x00003000 #define YUV_410 0x00003800 #define FIELD_MODE 0x00000020 #define FRAME_MODE 0x00000000 #define BUFFER_AND_FIELD 0x00000006 #define BUFFER0_FIELD0 0x00000000 #define BUFFER1_FIELD0 0x00000004 #define OVERLAY_ENABLE 0x00000001 #define UV_VERT_BUF1 0x02 #define UV_VERT_BUF0 0x04 #define SRC_CONSTANT_ALPHA_BLEND 1 << 31 #define MINUV_SCALE 0x1 #define I810FB_IOC_UPDATEOVERLAY _IOW ('F', 0xF7, struct i810_ovl_regs) #define I810FB_IOC_UPDATEOVERLAYCMD _IOW ('F', 0xF6, int) extern u32 i810_wait_for_space(I810DriverData *i810drv, I810DeviceData *i810dev, u32 space ); #define I810_OVERLAY_SUPPORTED_OPTIONS (DLOP_DST_COLORKEY | DLOP_DEINTERLACING) static void ovl_calc_regs (I810DriverData *i810drv, I810OverlayLayerData *i810ovl, CoreLayer *layer, CoreSurface *surface, CoreLayerRegionConfig *config, CoreSurfaceBufferLock *lock ); static void update_overlay(I810DriverData *i810drv, I810DeviceData *i810dev) { i810_writel(i810drv->mmio_base, OV0ADDR, i810dev->ovl_mem.physical); } void i810ovlOnOff( I810DriverData *idrv, I810DeviceData *idev, bool on ) { if (on) idrv->oregs->ov0cmd |= 1; else idrv->oregs->ov0cmd &= ~1; update_overlay( idrv, idev ); } static int ovlLayerDataSize( void ) { return sizeof(I810OverlayLayerData); } static DFBResult ovlInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { I810OverlayLayerData *i810ovl = (I810OverlayLayerData *) layer_data; I810DriverData *idrv = driver_data; I810DeviceData *idev = idrv->idev; idev->iovl = i810ovl; idrv->oregs = (volatile struct i810_ovl_regs*) idrv->ovl_base; memset( (void*) idrv->oregs, 0, sizeof(struct i810_ovl_regs) ); /* set_capabilities */ description->caps = DLCAPS_SURFACE | DLCAPS_SCREEN_LOCATION | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST | DLCAPS_SATURATION | DLCAPS_DST_COLORKEY | DLCAPS_OPACITY | DLCAPS_DEINTERLACING; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Intel 810/815 Overlay" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_SATURATION; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; idrv->oregs->yrgb_vph = 0; idrv->oregs->uv_vph = 0; idrv->oregs->horz_ph = 0; idrv->oregs->init_ph = 0; idrv->oregs->dwinpos = 0; idrv->oregs->dwinsz = (640 << 16) | 480; idrv->oregs->swid = 640 | (640 << 15); idrv->oregs->swidqw = (640 >> 3) | (640 << 12); idrv->oregs->sheight = 480 | (480 << 15); idrv->oregs->yrgbscale = 0x80004000; /* scale factor 1 */ idrv->oregs->uvscale = 0x80004000; /* scale factor 1 */ idrv->oregs->ov0clrc0 = 0x4000; /* brightness: 0 contrast: 1.0 */ idrv->oregs->ov0clrc1 = 0x80; /* saturation: bypass */ idrv->oregs->sclrkvh = 0; idrv->oregs->sclrkvl = 0; idrv->oregs->sclrkm = 0; /* source color key disable */ idrv->oregs->ov0conf = 0; /* two 720 pixel line buffers */ idrv->oregs->ov0cmd = VC_UP_INTERPOLATION | HC_UP_INTERPOLATION | Y_ADJUST | YUV_420; update_overlay( idrv, idev ); /* * FIXME: If the fence registers are enabled, then the buffer pointers * require specific alignment. This is a problem with planar formats * which have separate pointers for each of the U and V planes. Packed * formats should not be a problem. */ i810ovl->planar_bug = 0; if (i810_readl(idrv->mmio_base, FENCE) & 1) i810ovl->planar_bug = 1; return DFB_OK; } static DFBResult ovlTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { DFBDisplayLayerConfigFlags fail = 0; I810OverlayLayerData *i810ovl = (I810OverlayLayerData *) layer_data; if (config->options & ~I810_OVERLAY_SUPPORTED_OPTIONS) fail |= DLCONF_OPTIONS; switch (config->format) { case DSPF_I420: case DSPF_YV12: case DSPF_YUY2: case DSPF_UYVY: break; default: fail |= DLCONF_PIXELFORMAT; } if (i810ovl->planar_bug && (config->format == DSPF_I420 || config->format == DSPF_YV12 )) { D_DEBUG("Sorry, planar formats will not work when memory tiling " "is enabled\n"); fail |= DLCONF_PIXELFORMAT; } if (config->width > 1440 || config->width < 1) fail |= DLCONF_WIDTH; if (config->height > 1023 || config->height < 1) fail |= DLCONF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ovlSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock) { I810DriverData *i810drv = (I810DriverData *) driver_data; I810OverlayLayerData *i810ovl = (I810OverlayLayerData *) layer_data; i810ovl->config = *config; ovl_calc_regs (i810drv, i810ovl, layer, surface, config, lock); update_overlay(i810drv, i810drv->idev); i810ovlOnOff(i810drv, i810drv->idev, 1); return DFB_OK; } static DFBResult ovlRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { I810DriverData *i810drv = (I810DriverData *) driver_data; /* disable overlay */ i810ovlOnOff( i810drv, i810drv->idev, 0 ); return DFB_OK; } static DFBResult ovlFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { I810DriverData *i810drv = (I810DriverData *) driver_data; I810OverlayLayerData *i810ovl = (I810OverlayLayerData *) layer_data; u32 current_buffer; dfb_surface_flip( surface, false ); /* select buffer */ current_buffer = (i810drv->oregs->ov0cmd & 4) >> 2; if (current_buffer) { i810drv->oregs->ov0cmd &= ~4; } else { i810drv->oregs->ov0cmd |= 4; } ovl_calc_regs (i810drv, i810ovl, layer, surface, &i810ovl->config, lock); update_overlay(i810drv, i810drv->idev); if (flags & DSFLIP_WAIT) dfb_screen_wait_vsync( dfb_screens_at( DSCID_PRIMARY ) ); return DFB_OK; } static DFBResult ovlSetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { I810DriverData *i810drv = (I810DriverData*) driver_data; i810drv->oregs->ov0clrc0 = (((adj->brightness >> 8) - 128) & 0xFF) | ((adj->contrast >> 9) << 8); i810drv->oregs->ov0clrc1 = (adj->saturation >> 8) & 0xFF; update_overlay(i810drv, i810drv->idev); return DFB_OK; } static DFBResult ovlSetInputField( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { I810DriverData *i810drv = (I810DriverData*) driver_data; i810drv->oregs->ov0cmd &= ~2; i810drv->oregs->ov0cmd |= (field) ? 2 : 0; update_overlay(i810drv, i810drv->idev); return DFB_OK; } DisplayLayerFuncs i810OverlayFuncs = { .LayerDataSize = ovlLayerDataSize, .InitLayer = ovlInitLayer, .TestRegion = ovlTestRegion, .SetRegion = ovlSetRegion, .RemoveRegion = ovlRemoveRegion, .FlipRegion = ovlFlipRegion, .SetColorAdjustment = ovlSetColorAdjustment, .SetInputField = ovlSetInputField, }; static void ovl_calc_regs (I810DriverData *i810drv, I810OverlayLayerData *i810ovl, CoreLayer *layer, CoreSurface *surface, CoreLayerRegionConfig *config, CoreSurfaceBufferLock *lock ) { u32 swidth = 0, y_offset, v_offset = 0, u_offset = 0; u32 drw_w, src_w, drw_h, src_h, xscaleInt, xscaleFract, yscaleInt; u32 xscaleFractUV = 0, xscaleIntUV, yscaleIntUV = 0, yscaleFract, yscaleFractUV = 0; DFBSurfacePixelFormat primary_format; drw_w = config->dest.w; drw_h = config->dest.h; src_w = surface->config.size.w; src_h = surface->config.size.h; if (config->options & DLOP_DEINTERLACING) src_h >>= 1; /* reset command register except the enable bit and buffer select bits */ i810drv->oregs->ov0cmd &= 7; /* Set source dimension in bytes */ switch (surface->config.format) { case DSPF_I420: case DSPF_YV12: swidth = (src_w + 7) & ~7; i810drv->oregs->swid = (swidth << 15) | swidth; i810drv->oregs->swidqw = (swidth << 12) | (swidth >> 3); break; case DSPF_UYVY: case DSPF_YUY2: swidth = ((src_w + 3) & ~3) << 1; i810drv->oregs->swid = swidth; i810drv->oregs->swidqw = swidth >> 3; break; default: break; } i810drv->oregs->sheight = src_h | (src_h << 15); /* select buffer size */ if (swidth > 720) i810drv->oregs->ov0conf = 1; else i810drv->oregs->ov0conf = 0; /* set dest window position and dimension */ i810drv->oregs->dwinpos = (config->dest.y << 16) | config->dest.x; i810drv->oregs->dwinsz = (drw_h << 16) | drw_w; /* Set buffer pointers */ y_offset = (dfb_gfxcard_memory_physical(NULL, lock->offset)); switch (surface->config.format) { case DSPF_I420: u_offset = y_offset + surface->config.size.h * lock->pitch; v_offset = u_offset + ((surface->config.size.h >> 1) * (lock->pitch >> 1)); break; case DSPF_YV12: v_offset = y_offset + surface->config.size.h * lock->pitch; u_offset = v_offset + ((surface->config.size.h >> 1) * (lock->pitch >> 1)); break; default: break; } if (i810drv->oregs->ov0cmd & 4) { i810drv->oregs->obuf_1y = y_offset; i810drv->oregs->obuf_1v = v_offset; i810drv->oregs->obuf_1u = u_offset; } else { i810drv->oregs->obuf_0y = y_offset; i810drv->oregs->obuf_0v = v_offset; i810drv->oregs->obuf_0u = u_offset; } /* set scaling */ i810drv->oregs->yrgbscale = 0x80004000; i810drv->oregs->uvscale = 0x80004000; i810drv->oregs->ov0cmd |= VC_UP_INTERPOLATION | HC_UP_INTERPOLATION | Y_ADJUST | FRAME_MODE; if (config->options & DLOP_DEINTERLACING) i810drv->oregs->ov0cmd |= FIELD_MODE; if ((drw_w != src_w) || (drw_h != src_h)) { xscaleInt = (src_w / drw_w) & 0x3; xscaleFract = (src_w << 12) / drw_w; yscaleInt = (src_h / drw_h) & 0x3; yscaleFract = (src_h << 12) / drw_h; i810drv->oregs->yrgbscale = (xscaleInt << 15) | ((xscaleFract & 0xFFF) << 3) | (yscaleInt) | ((yscaleFract & 0xFFF) << 20); if (drw_w > src_w) { i810drv->oregs->ov0cmd &= ~HORIZONTAL_CHROMINANCE_FILTER; i810drv->oregs->ov0cmd &= ~HORIZONTAL_LUMINANCE_FILTER; i810drv->oregs->ov0cmd |= (HC_UP_INTERPOLATION | HL_UP_INTERPOLATION); } if (drw_h > src_h) { i810drv->oregs->ov0cmd &= ~VERTICAL_CHROMINANCE_FILTER; i810drv->oregs->ov0cmd &= ~VERTICAL_LUMINANCE_FILTER; i810drv->oregs->ov0cmd |= (VC_UP_INTERPOLATION | VL_UP_INTERPOLATION); } if (drw_w < src_w) { i810drv->oregs->ov0cmd &= ~HORIZONTAL_CHROMINANCE_FILTER; i810drv->oregs->ov0cmd &= ~HORIZONTAL_LUMINANCE_FILTER; i810drv->oregs->ov0cmd |= (HC_DOWN_INTERPOLATION | HL_DOWN_INTERPOLATION); } if (drw_h < src_h) { i810drv->oregs->ov0cmd &= ~VERTICAL_CHROMINANCE_FILTER; i810drv->oregs->ov0cmd &= ~VERTICAL_LUMINANCE_FILTER; i810drv->oregs->ov0cmd |= (VC_DOWN_INTERPOLATION | VL_DOWN_INTERPOLATION); } if (xscaleFract) { xscaleFractUV = xscaleFract >> MINUV_SCALE; i810drv->oregs->ov0cmd &= ~HC_DOWN_INTERPOLATION; i810drv->oregs->ov0cmd |= HC_UP_INTERPOLATION; } if (xscaleInt) { xscaleIntUV = xscaleInt >> MINUV_SCALE; if (xscaleIntUV) { i810drv->oregs->ov0cmd &= ~HC_UP_INTERPOLATION; } } if (yscaleFract) { yscaleFractUV = yscaleFract >> MINUV_SCALE; i810drv->oregs->ov0cmd &= ~VC_DOWN_INTERPOLATION; i810drv->oregs->ov0cmd |= VC_UP_INTERPOLATION; } if (yscaleInt) { yscaleIntUV = yscaleInt >> MINUV_SCALE; if (yscaleIntUV) { i810drv->oregs->ov0cmd &= ~VC_UP_INTERPOLATION; i810drv->oregs->ov0cmd |= VC_DOWN_INTERPOLATION; } } i810drv->oregs->uvscale = yscaleIntUV | ((xscaleFractUV & 0xFFF) << 3) | ((yscaleFractUV & 0xFFF) << 20); } switch(surface->config.format) { case DSPF_YV12: case DSPF_I420: /* set UV vertical phase to -0.25 */ i810drv->oregs->uv_vph = 0x30003000; i810drv->oregs->init_ph = UV_VERT_BUF0 | UV_VERT_BUF1; i810drv->oregs->ov0stride = (lock->pitch) | (lock->pitch << 15); i810drv->oregs->ov0cmd &= ~SOURCE_FORMAT; i810drv->oregs->ov0cmd |= YUV_420; break; case DSPF_UYVY: case DSPF_YUY2: i810drv->oregs->uv_vph = 0; i810drv->oregs->init_ph = 0; i810drv->oregs->ov0stride = lock->pitch; i810drv->oregs->ov0cmd &= ~SOURCE_FORMAT; i810drv->oregs->ov0cmd |= YUV_422; i810drv->oregs->ov0cmd &= ~OV_BYTE_ORDER; if (surface->config.format == DSPF_UYVY) i810drv->oregs->ov0cmd |= Y_SWAP; break; default: D_BUG("unexpected pixelformat"); break; } /* Set alpha window */ i810drv->oregs->awinpos = i810drv->oregs->dwinpos; i810drv->oregs->awinsz = i810drv->oregs->dwinsz; /* * Destination color keying. */ primary_format = dfb_primary_layer_pixelformat(); i810drv->oregs->dclrkv = dfb_color_to_pixel( primary_format, config->dst_key.r, config->dst_key.g, config->dst_key.b ); i810drv->oregs->dclrkm = (1 << DFB_COLOR_BITS_PER_PIXEL( primary_format )) - 1; if (config->options & DLOP_DST_COLORKEY) i810drv->oregs->dclrkm |= 0x80000000; } DirectFB-1.2.10/gfxdrivers/davinci/0000777000175000017500000000000011307522570014024 500000000000000DirectFB-1.2.10/gfxdrivers/davinci/davinci_gfxdriver.c0000644000175000017500000002337511245562152017614 00000000000000/* TI Davinci driver - Graphics Driver (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "davincifb.h" #include "davinci_2d.h" #include "davinci_gfxdriver.h" #include "davinci_osd.h" #include "davinci_osd_pool.h" #include "davinci_screen.h" #include "davinci_video.h" #include "davinci_video_pool.h" #include DFB_GRAPHICS_DRIVER( davinci ) /**********************************************************************************************************************/ static DFBResult open_fb( DavinciDriverData *ddrv, DavinciDeviceData *ddev, unsigned int fbnum ) { int ret; char buf1[16]; char buf2[16]; DavinciFB *fb; struct fb_var_screeninfo var; D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); D_ASSERT( fbnum < D_ARRAY_SIZE(ddrv->fb) ); D_ASSERT( fbnum < D_ARRAY_SIZE(ddev->fix) ); fb = &ddrv->fb[fbnum]; fb->num = fbnum; snprintf( buf1, sizeof(buf1), "/dev/fb%u", fbnum ); snprintf( buf2, sizeof(buf2), "/dev/fb/%u", fbnum ); fb->fd = direct_try_open( buf1, buf2, O_RDWR, true ); if (fb->fd < 0) return DFB_INIT; ret = ioctl( fb->fd, FBIOGET_VSCREENINFO, &var ); if (ret) { D_PERROR( "Davinci/Driver: FBIOGET_VSCREENINFO (fb%d) failed!\n", fbnum ); close( fb->fd ); return DFB_INIT; } ret = ioctl( fb->fd, FBIOGET_FSCREENINFO, &ddev->fix[fbnum] ); if (ret) { D_PERROR( "Davinci/Driver: FBIOGET_FSCREENINFO (fb%d) failed!\n", fbnum ); close( fb->fd ); return DFB_INIT; } fb->size = ddev->fix[fbnum].smem_len; fb->mem = mmap( NULL, fb->size, PROT_READ | PROT_WRITE, MAP_SHARED, fb->fd, 0 ); if (fb->mem == MAP_FAILED) { D_PERROR( "Davinci/Driver: mmap (fb%d, length %d) failed!\n", fbnum, fb->size ); close( fb->fd ); return DFB_INIT; } D_INFO( "Davinci/Driver: Mapped fb%d with length %u at %p to %p\n", fbnum, fb->size, (void*)ddev->fix[fbnum].smem_start, fb->mem ); return DFB_OK; } static void close_fb( DavinciFB *fb ) { munmap( fb->mem, fb->size ); close( fb->fd ); } /**********************************************************************************************************************/ static int driver_probe( CoreGraphicsDevice *device ) { int ret; int fd; vpbe_fb_videomode_t videomode; switch (dfb_system_type()) { case CORE_DEVMEM: case CORE_TI_CMEM: if (dfb_config->accelerator == 6400) return 1; break; default: return 0; } fd = direct_try_open( "/dev/fb0", "/dev/fb/0", O_RDWR, true ); if (fd < 0) return 0; ret = ioctl( fd, FBIO_GET_TIMING, &videomode); close( fd ); if (ret) { D_PERROR( "Davinci/Driver: FBIO_GET_TIMING failed!\n" ); return 0; } if (videomode.xres > 768 || videomode.yres > 576 || videomode.fps > 60) { D_ERROR( "Davinci/Driver: Invalid mode %dx%d @%d!\n", videomode.xres, videomode.yres, videomode.fps ); return 0; } if (strncmp( (char*)videomode.name, "PAL", 3 ) && strncmp( (char*)videomode.name, "NTSC", 4 )) { D_ERROR( "Davinci/Driver: Unknown mode name '%s'!\n", videomode.name ); return 0; } return 1; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "TI Davinci Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Telio AG" ); info->version.major = 0; info->version.minor = 4; info->driver_data_size = sizeof(DavinciDriverData); info->device_data_size = sizeof(DavinciDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { DFBResult ret; DavinciDriverData *ddrv = driver_data; DavinciDeviceData *ddev = device_data; bool master = dfb_core_is_master( core ); ddrv->ddev = ddev; ddrv->core = core; ret = open_fb( ddrv, ddev, OSD0 ); if (ret) return ret; ret = open_fb( ddrv, ddev, VID0 ); if (ret) goto error_fb1; ret = open_fb( ddrv, ddev, OSD1 ); if (ret) goto error_fb2; ret = open_fb( ddrv, ddev, VID1 ); if (ret) goto error_fb3; ret = davinci_c64x_open( &ddrv->c64x ); if (ret) D_WARN( "running without DSP acceleration" ); else { ret = davinci_c64x_tasks_init( &ddrv->tasks, 2048 ); if (ret) { D_DERROR( ret, "Davinci/Driver: Error initializing local task buffer!\n" ); return ret; } ddrv->c64x_present = true; /* initialize function pointers */ funcs->EngineSync = davinciEngineSync; funcs->EngineReset = davinciEngineReset; funcs->EmitCommands = davinciEmitCommands; funcs->FlushTextureCache = davinciFlushTextureCache; funcs->CheckState = davinciCheckState; funcs->SetState = davinciSetState; funcs->StretchBlit = davinciStretchBlit32; } ddrv->screen = dfb_screens_register( device, driver_data, &davinciScreenFuncs ); ddrv->osd = dfb_layers_register( ddrv->screen, driver_data, &davinciOSDLayerFuncs ); ddrv->video = dfb_layers_register( ddrv->screen, driver_data, &davinciVideoLayerFuncs ); if (!master) { dfb_surface_pool_join( core, ddev->osd_pool, &davinciOSDSurfacePoolFuncs ); // dfb_surface_pool_join( core, ddev->video_pool, &davinciVideoSurfacePoolFuncs ); } if (!dfb_config->software_only && funcs->CheckState) { dfb_config->font_format = DSPF_ARGB; dfb_config->font_premult = true; } return DFB_OK; error_fb3: close_fb( &ddrv->fb[OSD1] ); error_fb2: close_fb( &ddrv->fb[VID0] ); error_fb1: close_fb( &ddrv->fb[OSD0] ); return DFB_INIT; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { DavinciDriverData *ddrv = driver_data; DavinciDeviceData *ddev = device_data; /* fill device info */ snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "Texas Instruments" ); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Davinci" ); /* device limitations */ device_info->limits.surface_byteoffset_alignment = 64; device_info->limits.surface_bytepitch_alignment = 32; if (ddrv->c64x_present) { device_info->caps.flags = 0; device_info->caps.accel = DAVINCI_SUPPORTED_DRAWINGFUNCTIONS | DAVINCI_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = DAVINCI_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = DAVINCI_SUPPORTED_BLITTINGFLAGS; device_info->caps.clip = DFXL_STRETCHBLIT; } dfb_surface_pool_initialize( ddrv->core, &davinciOSDSurfacePoolFuncs, &ddev->osd_pool ); // dfb_surface_pool_initialize( ddrv->core, &davinciVideoSurfacePoolFuncs, &ddev->video_pool ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { DavinciDriverData *ddrv = driver_data; if (ddrv->c64x_present) { davinci_c64x_tasks_destroy( &ddrv->tasks ); davinci_c64x_close( &ddrv->c64x ); } close_fb( &ddrv->fb[VID1] ); close_fb( &ddrv->fb[OSD1] ); close_fb( &ddrv->fb[VID0] ); close_fb( &ddrv->fb[OSD0] ); } DirectFB-1.2.10/gfxdrivers/davinci/davinci_video_pool.c0000644000175000017500000002704111245562152017745 00000000000000/* TI Davinci driver - VID1 FB Memory for direct UYVY mode (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include "davincifb.h" #include "davinci_gfxdriver.h" D_DEBUG_DOMAIN( Video_Surfaces, "Video/Surfaces", "Video Framebuffer Surface Pool" ); D_DEBUG_DOMAIN( Video_SurfLock, "Video/SurfLock", "Video Framebuffer Surface Pool Locks" ); /**********************************************************************************************************************/ typedef struct { int magic; } VideoPoolData; typedef struct { int magic; CoreDFB *core; void *mem; unsigned long phys; } VideoPoolLocalData; typedef struct { int magic; int offset; int pitch; int size; } VideoAllocationData; /**********************************************************************************************************************/ static int videoPoolDataSize( void ) { return sizeof(VideoPoolData); } static int videoPoolLocalDataSize( void ) { return sizeof(VideoPoolLocalData); } static int videoAllocationDataSize( void ) { return sizeof(VideoAllocationData); } static DFBResult videoInitPool( CoreDFB *core, CoreSurfacePool *pool, void *pool_data, void *pool_local, void *system_data, CoreSurfacePoolDescription *ret_desc ) { VideoPoolData *data = pool_data; VideoPoolLocalData *local = pool_local; DavinciDriverData *ddrv = dfb_gfxcard_get_driver_data(); DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_DEBUG_AT( Video_Surfaces, "%s()\n", __FUNCTION__ ); D_ASSERT( core != NULL ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_ASSERT( data != NULL ); D_ASSERT( local != NULL ); D_ASSERT( ret_desc != NULL ); ret_desc->caps = CSPCAPS_NONE; ret_desc->access = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE | CSAF_SHARED; ret_desc->types = CSTF_LAYER | CSTF_SHARED | CSTF_EXTERNAL; ret_desc->priority = CSPP_DEFAULT; snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "Video Pool" ); local->core = core; local->mem = ddrv->fb[VID1].mem; local->phys = ddev->fix[VID1].smem_start; D_MAGIC_SET( data, VideoPoolData ); D_MAGIC_SET( local, VideoPoolLocalData ); return DFB_OK; } static DFBResult videoJoinPool( CoreDFB *core, CoreSurfacePool *pool, void *pool_data, void *pool_local, void *system_data ) { VideoPoolData *data = pool_data; VideoPoolLocalData *local = pool_local; DavinciDriverData *ddrv = dfb_gfxcard_get_driver_data(); DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_DEBUG_AT( Video_Surfaces, "%s()\n", __FUNCTION__ ); D_ASSERT( core != NULL ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, VideoPoolData ); D_ASSERT( local != NULL ); (void) data; local->core = core; local->mem = ddrv->fb[VID1].mem; local->phys = ddev->fix[VID1].smem_start; D_MAGIC_SET( local, VideoPoolLocalData ); return DFB_OK; } static DFBResult videoDestroyPool( CoreSurfacePool *pool, void *pool_data, void *pool_local ) { VideoPoolData *data = pool_data; VideoPoolLocalData *local = pool_local; D_DEBUG_AT( Video_Surfaces, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, VideoPoolData ); D_MAGIC_ASSERT( local, VideoPoolLocalData ); D_MAGIC_CLEAR( data ); D_MAGIC_CLEAR( local ); return DFB_OK; } static DFBResult videoLeavePool( CoreSurfacePool *pool, void *pool_data, void *pool_local ) { VideoPoolData *data = pool_data; VideoPoolLocalData *local = pool_local; D_DEBUG_AT( Video_Surfaces, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, VideoPoolData ); D_MAGIC_ASSERT( local, VideoPoolLocalData ); (void) data; D_MAGIC_CLEAR( local ); return DFB_OK; } static DFBResult videoTestConfig( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceBuffer *buffer, const CoreSurfaceConfig *config ) { CoreSurface *surface; VideoPoolData *data = pool_data; VideoPoolLocalData *local = pool_local; D_DEBUG_AT( Video_Surfaces, "%s( %p )\n", __FUNCTION__, buffer ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, VideoPoolData ); D_MAGIC_ASSERT( local, VideoPoolLocalData ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); (void) data; (void) local; surface = buffer->surface; D_MAGIC_ASSERT( surface, CoreSurface ); if ((surface->type & CSTF_LAYER) && surface->resource_id == 1) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult videoAllocateBuffer( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceBuffer *buffer, CoreSurfaceAllocation *allocation, void *alloc_data ) { CoreSurface *surface; VideoPoolData *data = pool_data; VideoPoolLocalData *local = pool_local; VideoAllocationData *alloc = alloc_data; DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_DEBUG_AT( Video_Surfaces, "%s( %p )\n", __FUNCTION__, buffer ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, VideoPoolData ); D_MAGIC_ASSERT( local, VideoPoolLocalData ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); (void) data; (void) local; surface = buffer->surface; D_MAGIC_ASSERT( surface, CoreSurface ); if ((surface->type & CSTF_LAYER) && surface->resource_id == 1) { int index = dfb_surface_buffer_index( buffer ); alloc->pitch = ddev->fix[VID1].line_length; alloc->size = surface->config.size.h * alloc->pitch; alloc->offset = index * alloc->size; D_DEBUG_AT( Video_Surfaces, " -> offset %d, pitch %d, size %d\n", alloc->offset, alloc->pitch, alloc->size ); allocation->size = alloc->size; allocation->offset = alloc->offset; D_MAGIC_SET( alloc, VideoAllocationData ); return DFB_OK; } return DFB_BUG; } static DFBResult videoDeallocateBuffer( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceBuffer *buffer, CoreSurfaceAllocation *allocation, void *alloc_data ) { VideoPoolData *data = pool_data; VideoAllocationData *alloc = alloc_data; D_DEBUG_AT( Video_Surfaces, "%s( %p )\n", __FUNCTION__, buffer ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, VideoPoolData ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); D_MAGIC_ASSERT( alloc, VideoAllocationData ); (void) data; D_MAGIC_CLEAR( alloc ); return DFB_OK; } static DFBResult videoLock( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceAllocation *allocation, void *alloc_data, CoreSurfaceBufferLock *lock ) { VideoPoolLocalData *local = pool_local; VideoAllocationData *alloc = alloc_data; DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation ); D_MAGIC_ASSERT( alloc, VideoAllocationData ); D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); D_DEBUG_AT( Video_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer ); int index = alloc->offset / alloc->size; int height = alloc->size / alloc->pitch; alloc->pitch = ddev->fix[VID1].line_length; alloc->size = height * alloc->pitch; alloc->offset = index * alloc->size; allocation->size = alloc->size; allocation->offset = alloc->offset; lock->pitch = alloc->pitch; lock->offset = alloc->offset; lock->addr = local->mem + alloc->offset; lock->phys = local->phys + alloc->offset; D_DEBUG_AT( Video_SurfLock, " -> offset %lu, pitch %d, addr %p, phys 0x%08lx\n", lock->offset, lock->pitch, lock->addr, lock->phys ); return DFB_OK; } static DFBResult videoUnlock( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceAllocation *allocation, void *alloc_data, CoreSurfaceBufferLock *lock ) { VideoAllocationData *alloc = alloc_data; D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation ); D_MAGIC_ASSERT( alloc, VideoAllocationData ); D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); D_DEBUG_AT( Video_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer ); (void) alloc; return DFB_OK; } const SurfacePoolFuncs davinciVideoSurfacePoolFuncs = { .PoolDataSize = videoPoolDataSize, .PoolLocalDataSize = videoPoolLocalDataSize, .AllocationDataSize = videoAllocationDataSize, .InitPool = videoInitPool, .JoinPool = videoJoinPool, .DestroyPool = videoDestroyPool, .LeavePool = videoLeavePool, .TestConfig = videoTestConfig, .AllocateBuffer = videoAllocateBuffer, .DeallocateBuffer = videoDeallocateBuffer, .Lock = videoLock, .Unlock = videoUnlock, }; DirectFB-1.2.10/gfxdrivers/davinci/davinci_2d.c0000644000175000017500000011266311245562152016120 00000000000000/* TI Davinci driver - 2D Acceleration (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include #include "davinci_2d.h" #include "davinci_gfxdriver.h" D_DEBUG_DOMAIN( Davinci_2D, "Davinci/2D", "Davinci 2D Acceleration" ); /* * State validation flags. * * There's no prefix because of the macros below. */ enum { DESTINATION = 0x00000001, FILLCOLOR = 0x00000002, SOURCE = 0x00000010, SOURCE_MULT = 0x00000020, BLIT_BLEND_SUB = 0x00010000, DRAW_BLEND_SUB = 0x00020000, ALL = 0x00030033 }; /* * State handling macros. */ #define DAVINCI_VALIDATE(flags) do { ddev->v_flags |= (flags); } while (0) #define DAVINCI_INVALIDATE(flags) do { ddev->v_flags &= ~(flags); } while (0) #define DAVINCI_CHECK_VALIDATE(flag) do { \ if (! (ddev->v_flags & flag)) \ davinci_validate_##flag( ddev, state ); \ } while (0) /**************************************************************************************************/ static bool davinciFillRectangle16( void *drv, void *dev, DFBRectangle *rect ); static bool davinciFillRectangle32( void *drv, void *dev, DFBRectangle *rect ); static bool davinciFillRectangleBlend32( void *drv, void *dev, DFBRectangle *rect ); static bool davinciBlit16 ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); static bool davinciBlit32to16 ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); static bool davinciBlit32 ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); static bool davinciBlitKeyed16 ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); static bool davinciBlitKeyed32 ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); static bool davinciBlitBlend32 ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); /**************************************************************************************************/ static inline int get_blit_blend_sub_function( const CardState *state ) { DFBSurfaceBlittingFlags flags = state->blittingflags & ~DSBLIT_COLORIZE; if (state->dst_blend == DSBF_INVSRCALPHA) { switch (state->src_blend) { case DSBF_SRCALPHA: if (flags == DSBLIT_BLEND_ALPHACHANNEL) return C64X_BLEND_SRC_INVSRC; break; case DSBF_ONE: switch (flags) { case DSBLIT_BLEND_ALPHACHANNEL: return C64X_BLEND_ONE_INVSRC; case DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_SRC_PREMULTIPLY: return C64X_BLEND_ONE_INVSRC_PREMULT_SRC; case DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA | DSBLIT_SRC_PREMULTCOLOR: return C64X_BLEND_ONE_INVSRC_PREMULT_ALPHA; default: break; } break; default: break; } } return -1; } static inline int get_draw_blend_sub_function( const CardState *state ) { DFBSurfaceDrawingFlags flags = state->drawingflags; if (state->dst_blend == DSBF_INVSRCALPHA) { switch (state->src_blend) { case DSBF_SRCALPHA: if (flags == DSDRAW_BLEND) return C64X_BLEND_SRC_INVSRC; break; case DSBF_ONE: switch (flags) { case DSDRAW_BLEND: return C64X_BLEND_ONE_INVSRC; case DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY: return C64X_BLEND_ONE_INVSRC_PREMULT_SRC; default: break; } break; default: break; } } return -1; } /**************************************************************************************************/ /* * Called by davinciSetState() to ensure that the destination registers are properly set * for execution of rendering functions. */ static inline void davinci_validate_DESTINATION( DavinciDeviceData *ddev, CardState *state ) { /* Remember destination parameters for usage in rendering functions. */ ddev->dst_addr = state->dst.addr; ddev->dst_phys = state->dst.phys; ddev->dst_size = state->dst.allocation->size; ddev->dst_pitch = state->dst.pitch; ddev->dst_format = state->dst.buffer->format; ddev->dst_bpp = DFB_BYTES_PER_PIXEL( ddev->dst_format ); D_DEBUG_AT( Davinci_2D, " => DESTINATION: 0x%08lx\n", ddev->dst_phys ); /* Set the flag. */ DAVINCI_VALIDATE( DESTINATION ); } /* * Called by davinciSetState() to ensure that the color register is properly set * for execution of rendering functions. */ static inline void davinci_validate_FILLCOLOR( DavinciDeviceData *ddev, CardState *state ) { switch (ddev->dst_format) { case DSPF_ARGB: case DSPF_RGB32: ddev->fillcolor = ddev->color_argb; break; case DSPF_RGB16: ddev->fillcolor = PIXEL_RGB16( state->color.r, state->color.g, state->color.b ); ddev->fillcolor |= ddev->fillcolor << 16; break; case DSPF_UYVY: { int y, u, v; RGB_TO_YCBCR( state->color.r, state->color.g, state->color.b, y, u, v ); ddev->fillcolor = PIXEL_UYVY( y, u, v ); break; } default: D_BUG( "unexpected format %s", dfb_pixelformat_name(ddev->dst_format) ); return; } D_DEBUG_AT( Davinci_2D, " => FILLCOLOR: 0x%08lx\n", ddev->fillcolor ); /* Set the flag. */ DAVINCI_VALIDATE( FILLCOLOR ); } /* * Called by davinciSetState() to ensure that the source registers are properly set * for execution of blitting functions. */ static inline void davinci_validate_SOURCE( DavinciDeviceData *ddev, CardState *state ) { /* Remember source parameters for usage in rendering functions. */ ddev->src_addr = state->src.addr; ddev->src_phys = state->src.phys; ddev->src_pitch = state->src.pitch; ddev->src_format = state->src.buffer->format; ddev->src_bpp = DFB_BYTES_PER_PIXEL( ddev->src_format ); D_DEBUG_AT( Davinci_2D, " => SOURCE: 0x%08lx\n", ddev->src_phys ); /* Set the flag. */ DAVINCI_VALIDATE( SOURCE ); } /* * Called by davinciSetState() to ensure that the source ARGB modulation is properly set * for execution of blitting functions. */ static inline void davinci_validate_SOURCE_MULT( DavinciDeviceData *ddev, CardState *state ) { switch (ddev->dst_format) { case DSPF_ARGB: if (state->blittingflags & DSBLIT_COLORIZE) ddev->source_mult = 0xff000000 | ddev->color_argb; else ddev->source_mult = 0xffffffff; break; default: D_BUG( "unexpected format %s", dfb_pixelformat_name(ddev->dst_format) ); return; } D_DEBUG_AT( Davinci_2D, " => SOURCE_MULT: 0x%08lx\n", ddev->source_mult ); /* Set the flag. */ DAVINCI_VALIDATE( SOURCE_MULT ); } /* * Called by davinciSetState() to ensure that the blend sub function index is valid * for execution of blitting functions. */ static inline void davinci_validate_BLIT_BLEND_SUB( DavinciDeviceData *ddev, CardState *state ) { int index = get_blit_blend_sub_function( state ); if (index < 0) { D_BUG( "unexpected state" ); return; } /* Set blend sub function index. */ ddev->blit_blend_sub_function = index; D_DEBUG_AT( Davinci_2D, " => BLIT_BLEND_SUB: %d\n", index ); /* Set the flag. */ DAVINCI_VALIDATE( BLIT_BLEND_SUB ); } /* * Called by davinciSetState() to ensure that the blend sub function index is valid * for execution of drawing functions. */ static inline void davinci_validate_DRAW_BLEND_SUB( DavinciDeviceData *ddev, CardState *state ) { int index = get_draw_blend_sub_function( state ); if (index < 0) { D_BUG( "unexpected state" ); return; } /* Set blend sub function index. */ ddev->draw_blend_sub_function = index; D_DEBUG_AT( Davinci_2D, " => DRAW_BLEND_SUB: %d\n", index ); /* Set the flag. */ DAVINCI_VALIDATE( DRAW_BLEND_SUB ); } /**************************************************************************************************/ /* * Wait for the blitter to be idle. * * This function is called before memory that has been written to by the hardware is about to be * accessed by the CPU (software driver) or another hardware entity like video encoder (by Flip()). * It can also be called by applications explicitly, e.g. at the end of a benchmark loop to include * execution time of queued commands in the measurement. */ DFBResult davinciEngineSync( void *drv, void *dev ) { DFBResult ret; DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s()\n", __FUNCTION__ ); if (!ddev->synced) { D_DEBUG_AT( Davinci_2D, " -> syncing...\n" ); ret = davinci_c64x_wait_low( &ddrv->c64x ); if (ret) { D_DEBUG_AT( Davinci_2D, " -> ERROR (%s)\n", DirectFBErrorString(ret) ); return ret; } D_DEBUG_AT( Davinci_2D, " => syncing done.\n" ); ddev->synced = true; } else D_DEBUG_AT( Davinci_2D, " => already synced!\n" ); return DFB_OK; } /* * Reset the graphics engine. */ void davinciEngineReset( void *drv, void *dev ) { D_DEBUG_AT( Davinci_2D, "%s()\n", __FUNCTION__ ); } /* * Start processing of queued commands if required. * * This function is called before returning from the graphics core to the application. * Usually that's after each rendering function. The only functions causing multiple commands * to be queued with a single emition at the end are DrawString(), TileBlit(), BatchBlit(), * DrawLines() and possibly FillTriangle() which is emulated using multiple FillRectangle() calls. */ void davinciEmitCommands( void *drv, void *dev ) { DFBResult ret; DavinciDeviceData *ddev = dev; DavinciDriverData *ddrv = drv; D_DEBUG_AT( Davinci_2D, "%s()\n", __FUNCTION__ ); ret = davinci_c64x_emit_tasks( &ddrv->c64x, &ddrv->tasks, C64X_TEF_RESET ); if (ret) D_DERROR( ret, "Davinci/Driver: Error emitting local task buffer!\n" ); ddev->synced = false; } /* * Invalidate the DSP's read cache. */ void davinciFlushTextureCache( void *drv, void *dev ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s()\n", __FUNCTION__ ); /* Bad workaround */ davinci_c64x_blit_32( &ddrv->c64x, dfb_config->video_phys, 1024, dfb_config->video_phys, 1024, 256, 64 ); /* These don't work */ // davinci_c64x_wb_inv_range( &ddrv->c64x, dfb_config->video_phys, // dfb_config->video_length, 2 ); // davinci_c64x_wb_inv_range( &ddrv->c64x, ddev->fix[OSD0].smem_start, // ddev->fix[OSD0].smem_len, 2 ); } /* * Check for acceleration of 'accel' using the given 'state'. */ void davinciCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { D_DEBUG_AT( Davinci_2D, "%s( state %p, accel 0x%08x ) <- dest %p\n", __FUNCTION__, state, accel, state->destination ); /* Return if the desired function is not supported at all. */ if (accel & ~(DAVINCI_SUPPORTED_DRAWINGFUNCTIONS | DAVINCI_SUPPORTED_BLITTINGFUNCTIONS)) return; /* Return if the destination format is not supported. */ switch (state->destination->config.format) { case DSPF_UYVY: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } /* Check if drawing or blitting is requested. */ if (DFB_DRAWING_FUNCTION( accel )) { /* Return if unsupported drawing flags are set. */ if (state->drawingflags & ~DAVINCI_SUPPORTED_DRAWINGFLAGS) return; /* Limited blending support. */ if (state->drawingflags & (DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY)) { if (state->destination->config.format != DSPF_ARGB) return; if (get_draw_blend_sub_function( state ) < 0) return; } } else { /* Return if unsupported blitting flags are set. */ if (state->blittingflags & ~DAVINCI_SUPPORTED_BLITTINGFLAGS) return; /* No other flags supported when color keying is used. */ if ((state->blittingflags & DSBLIT_SRC_COLORKEY) && state->blittingflags != DSBLIT_SRC_COLORKEY) return; /* Return if the source format is not supported. */ switch (state->source->config.format) { case DSPF_UYVY: case DSPF_RGB16: /* Only color keying for these formats. */ if (state->blittingflags & ~DSBLIT_SRC_COLORKEY) return; /* No format conversion supported. */ if (state->source->config.format != state->destination->config.format) return; break; case DSPF_RGB32: /* Only color keying for these formats. */ if (state->blittingflags & ~DSBLIT_SRC_COLORKEY) return; /* fall through */ case DSPF_ARGB: /* Only few blending combinations are valid. */ if ((state->blittingflags & ~DSBLIT_SRC_COLORKEY) && get_blit_blend_sub_function( state ) < 0) return; /* Only ARGB/RGB32 -> RGB16 conversion (without any flag). */ if (state->source->config.format != state->destination->config.format && (state->destination->config.format != DSPF_RGB16 || state->blittingflags)) return; break; default: return; } /* Checks per function. */ switch (accel) { case DFXL_STRETCHBLIT: /* No flags supported with StretchBlit(). */ if (state->blittingflags) return; /* Only (A)RGB at 32 bit supported. */ if (state->source->config.format != DSPF_ARGB && state->source->config.format != DSPF_RGB32) return; break; default: break; } } /* Enable acceleration of the function. */ state->accel |= accel; D_DEBUG_AT( Davinci_2D, " => accel 0x%08x\n", state->accel ); } /* * Make sure that the hardware is programmed for execution of 'accel' according to the 'state'. */ void davinciSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { DavinciDeviceData *ddev = dev; StateModificationFlags modified = state->mod_hw; D_DEBUG_AT( Davinci_2D, "%s( state %p, accel 0x%08x ) <- dest %p, modified 0x%08x\n", __FUNCTION__, state, accel, state->destination, modified ); /* * 1) Invalidate hardware states * * Each modification to the hw independent state invalidates one or more hardware states. */ /* Simply invalidate all? */ if (modified == SMF_ALL) { D_DEBUG_AT( Davinci_2D, " <- ALL\n" ); DAVINCI_INVALIDATE( ALL ); } else if (modified) { /* Invalidate destination settings. */ if (modified & SMF_DESTINATION) { D_DEBUG_AT( Davinci_2D, " <- DESTINATION | FILLCOLOR\n" ); DAVINCI_INVALIDATE( DESTINATION | FILLCOLOR ); } else if (modified & SMF_COLOR) { D_DEBUG_AT( Davinci_2D, " <- FILLCOLOR\n" ); DAVINCI_INVALIDATE( FILLCOLOR ); } /* Invalidate source settings. */ if (modified & SMF_SOURCE) { D_DEBUG_AT( Davinci_2D, " <- SOURCE\n" ); DAVINCI_INVALIDATE( SOURCE ); } /* Invalidate source color(ize) settings. */ if (modified & (SMF_BLITTING_FLAGS | SMF_COLOR)) { D_DEBUG_AT( Davinci_2D, " <- SOURCE_MULT\n" ); DAVINCI_INVALIDATE( SOURCE_MULT ); } /* Invalidate blend function for blitting. */ if (modified & (SMF_BLITTING_FLAGS | SMF_SRC_BLEND | SMF_DST_BLEND)) { D_DEBUG_AT( Davinci_2D, " <- BLIT_BLEND_SUB\n" ); DAVINCI_INVALIDATE( BLIT_BLEND_SUB ); } /* Invalidate blend function for drawing. */ if (modified & (SMF_DRAWING_FLAGS | SMF_SRC_BLEND | SMF_DST_BLEND)) { D_DEBUG_AT( Davinci_2D, " <- DRAW_BLEND_SUB\n" ); DAVINCI_INVALIDATE( DRAW_BLEND_SUB ); } } /* * Just keep these values, no computations needed here. * Values used by state validation or rendering functions. */ ddev->blitting_flags = state->blittingflags; ddev->clip = state->clip; ddev->color = state->color; ddev->colorkey = state->src_colorkey; ddev->color_argb = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); /* * 2) Validate hardware states * * Each function has its own set of states that need to be validated. */ /* Always requiring valid destination... */ DAVINCI_CHECK_VALIDATE( DESTINATION ); /* Depending on the function... */ switch (accel) { case DFXL_FILLRECTANGLE: D_DEBUG_AT( Davinci_2D, " -> FILLRECTANGLE\n" ); /* Validate blend sub function index for drawing... */ if (state->drawingflags & (DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY)) DAVINCI_CHECK_VALIDATE( DRAW_BLEND_SUB ); else /* ...or just validate fill color. */ DAVINCI_CHECK_VALIDATE( FILLCOLOR ); /* Choose function. */ switch (DFB_BYTES_PER_PIXEL( state->destination->config.format )) { case 2: funcs->FillRectangle = davinciFillRectangle16; break; case 4: if (state->drawingflags & (DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY)) funcs->FillRectangle = davinciFillRectangleBlend32; else funcs->FillRectangle = davinciFillRectangle32; break; default: D_BUG( "unexpected destination bpp %d", DFB_BYTES_PER_PIXEL( state->destination->config.format ) ); break; } /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set |= DAVINCI_SUPPORTED_DRAWINGFUNCTIONS; break; case DFXL_BLIT: D_DEBUG_AT( Davinci_2D, " -> BLIT\n" ); /* ...require valid source. */ DAVINCI_CHECK_VALIDATE( SOURCE ); /* Validate blend sub function index for blitting. */ if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { DAVINCI_CHECK_VALIDATE( BLIT_BLEND_SUB ); /* Validate ARGB source modulator. */ DAVINCI_CHECK_VALIDATE( SOURCE_MULT ); } /* Choose function. */ switch (DFB_BYTES_PER_PIXEL( state->destination->config.format )) { case 2: if (state->blittingflags & DSBLIT_SRC_COLORKEY) funcs->Blit = davinciBlitKeyed16; else if (state->source->config.format == DSPF_ARGB || state->source->config.format == DSPF_RGB32) funcs->Blit = davinciBlit32to16; else funcs->Blit = davinciBlit16; break; case 4: if (state->blittingflags & DSBLIT_SRC_COLORKEY) funcs->Blit = davinciBlitKeyed32; else if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) funcs->Blit = davinciBlitBlend32; else funcs->Blit = davinciBlit32; break; default: D_BUG( "unexpected destination bpp %d", DFB_BYTES_PER_PIXEL( state->destination->config.format ) ); break; } /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set |= DFXL_BLIT; break; case DFXL_STRETCHBLIT: D_DEBUG_AT( Davinci_2D, " -> STRETCHBLIT\n" ); /* ...require valid source. */ DAVINCI_CHECK_VALIDATE( SOURCE ); /* Choose function. */ #if 0 // only 32bit, statically set in driver_init_driver() switch (state->destination->config.format) { case DSPF_ARGB: case DSPF_RGB32: funcs->StretchBlit = davinciStretchBlit32; break; default: D_BUG( "unexpected destination format %s", dfb_pixelformat_name( state->destination->config.format ) ); break; } #endif /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set |= DFXL_STRETCHBLIT; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } /* * 4) Clear modification flags * * All flags have been evaluated in 1) and remembered for further validation. * If the hw independent state is not modified, this function won't get called * for subsequent rendering functions, unless they aren't defined by 3). */ state->mod_hw = 0; } /**********************************************************************************************************************/ /**********************************************************************************************************************/ /* * Render a filled rectangle using the current hardware state. */ static bool davinciFillRectangle16( void *drv, void *dev, DFBRectangle *rect ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d )\n", __FUNCTION__, DFB_RECTANGLE_VALS(rect) ); /* FIXME: Optimize in DSP. */ if ((rect->x | rect->w) & 1) davinci_c64x_fill_16__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * rect->y + ddev->dst_bpp * rect->x, ddev->dst_pitch, rect->w, rect->h, ddev->fillcolor ); else davinci_c64x_fill_32__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * rect->y + ddev->dst_bpp * rect->x, ddev->dst_pitch, rect->w/2, rect->h, ddev->fillcolor ); return true; } static bool davinciFillRectangle32( void *drv, void *dev, DFBRectangle *rect ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d )\n", __FUNCTION__, DFB_RECTANGLE_VALS(rect) ); if (ddev->dst_format == DSPF_ARGB && ddev->color.a == 0xff) davinci_c64x_blit_blend_32__L( &ddrv->tasks, C64X_BLEND_ONE_INVSRC, ddev->dst_phys + ddev->dst_pitch * rect->y + ddev->dst_bpp * rect->x, ddev->dst_pitch, 0, 0, rect->w, rect->h, ddev->color_argb, 0xff ); else davinci_c64x_fill_32__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * rect->y + ddev->dst_bpp * rect->x, ddev->dst_pitch, rect->w, rect->h, ddev->fillcolor ); return true; } /**********************************************************************************************************************/ static bool davinciFillRectangleBlend32( void *drv, void *dev, DFBRectangle *rect ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d )\n", __FUNCTION__, DFB_RECTANGLE_VALS(rect) ); davinci_c64x_blit_blend_32__L( &ddrv->tasks, ddev->draw_blend_sub_function, ddev->dst_phys + ddev->dst_pitch * rect->y + ddev->dst_bpp * rect->x, ddev->dst_pitch, 0, 0, rect->w, rect->h, ddev->color_argb, 0xff ); return true; } /**********************************************************************************************************************/ /**********************************************************************************************************************/ /* * Blit a rectangle using the current hardware state. */ static bool davinciBlit16( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d )\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y ); /* FIXME: Optimize in DSP. */ if ((dx | rect->x | rect->w) & 1) davinci_c64x_blit_16__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w, rect->h ); else davinci_c64x_blit_32__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w/2, rect->h ); return true; } static bool davinciBlit32( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d )\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y ); davinci_c64x_blit_32__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w, rect->h ); return true; } /**********************************************************************************************************************/ static bool davinciBlit32to16( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d )\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y ); davinci_c64x_dither_argb__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, DAVINCI_C64X_MEM, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w, rect->h ); return true; } /**********************************************************************************************************************/ static bool davinciBlitKeyed16( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d ) <- key 0x%04lx\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y, ddev->colorkey ); davinci_c64x_blit_keyed_16__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w, rect->h, ddev->colorkey, (1 << DFB_COLOR_BITS_PER_PIXEL( ddev->dst_format )) - 1 ); return true; } static bool davinciBlitKeyed32( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d ) <- key 0x%08lx\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y, ddev->colorkey ); davinci_c64x_blit_keyed_32__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w, rect->h, ddev->colorkey, (1 << DFB_COLOR_BITS_PER_PIXEL( ddev->dst_format )) - 1 ); return true; } /**********************************************************************************************************************/ static bool davinciBlitBlend32( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d )\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y ); davinci_c64x_blit_blend_32__L( &ddrv->tasks, ddev->blit_blend_sub_function, ddev->dst_phys + ddev->dst_pitch * dy + ddev->dst_bpp * dx, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * rect->y + ddev->src_bpp * rect->x, ddev->src_pitch, rect->w, rect->h, ddev->source_mult, ddev->color.a ); return true; } /**********************************************************************************************************************/ /**********************************************************************************************************************/ bool davinciStretchBlit32( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { DavinciDriverData *ddrv = drv; DavinciDeviceData *ddev = dev; DFBRegion clip = DFB_REGION_INIT_FROM_RECTANGLE( drect ); D_DEBUG_AT( Davinci_2D, "%s( %4d,%4d-%4dx%4d <- %4d,%4d-%4dx%4d )\n", __FUNCTION__, DFB_RECTANGLE_VALS(drect), DFB_RECTANGLE_VALS(srect) ); if (!dfb_region_region_intersect( &clip, &ddev->clip )) return true; dfb_region_translate( &clip, -drect->x, -drect->y ); davinci_c64x_stretch_32__L( &ddrv->tasks, ddev->dst_phys + ddev->dst_pitch * drect->y + ddev->dst_bpp * drect->x, ddev->dst_pitch, ddev->src_phys + ddev->src_pitch * srect->y + ddev->src_bpp * srect->x, ddev->src_pitch, drect->w, drect->h, srect->w, srect->h, &clip ); return true; } DirectFB-1.2.10/gfxdrivers/davinci/davinci_2d.h0000644000175000017500000000634411245562152016123 00000000000000/* TI Davinci driver - 2D Acceleration (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_2D_H__ #define __DAVINCI_2D_H__ #define DAVINCI_SUPPORTED_DRAWINGFLAGS (DSDRAW_BLEND |\ DSDRAW_SRC_PREMULTIPLY) #define DAVINCI_SUPPORTED_DRAWINGFUNCTIONS (DFXL_FILLRECTANGLE) #define DAVINCI_SUPPORTED_BLITTINGFLAGS (DSBLIT_BLEND_ALPHACHANNEL |\ DSBLIT_BLEND_COLORALPHA |\ DSBLIT_COLORIZE |\ DSBLIT_SRC_COLORKEY |\ DSBLIT_SRC_PREMULTIPLY |\ DSBLIT_SRC_PREMULTCOLOR) #define DAVINCI_SUPPORTED_BLITTINGFUNCTIONS (DFXL_BLIT | DFXL_STRETCHBLIT) DFBResult davinciEngineSync ( void *drv, void *dev ); void davinciEngineReset ( void *drv, void *dev ); void davinciEmitCommands ( void *drv, void *dev ); void davinciFlushTextureCache( void *drv, void *dev ); void davinciCheckState ( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ); void davinciSetState ( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ); bool davinciStretchBlit32 ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); #endif DirectFB-1.2.10/gfxdrivers/davinci/davinci_video.c0000644000175000017500000005637411245562152016727 00000000000000/* TI Davinci driver - Video Layer (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include #include #include #include #include "davincifb.h" #include "davinci_gfxdriver.h" #include "davinci_video.h" #define D_VIDERROR(x...) do {} while (0) D_DEBUG_DOMAIN( Davinci_Video, "Davinci/Video", "TI Davinci Video" ); /**********************************************************************************************************************/ static DFBResult ShowBuffer( DavinciDriverData *ddrv, DavinciVideoLayerData *dvid, CoreSurfaceBufferLock *lock, const DFBRectangle *area, DFBSurfaceFlipFlags flags ); static void SetupResizerParams( vpfe_resizer_params_t *params, int srcWidth, int srcHeight, int outWidth, int outHeight, int *ret_outWidth, int *ret_outHeight ); /**********************************************************************************************************************/ static int videoLayerDataSize( void ) { return sizeof(DavinciVideoLayerData); } static DFBResult videoInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { int ret; DavinciDriverData *ddrv = driver_data; DavinciVideoLayerData *dvid = layer_data; D_DEBUG_AT( Davinci_Video, "%s()\n", __FUNCTION__ ); /* Initialize with configuration from VID0 to start with a fullscreen (unscaled) layer */ ret = ioctl( ddrv->fb[VID0].fd, FBIOGET_VSCREENINFO, &dvid->var ); if (ret) { D_PERROR( "Davinci/Video: FBIOGET_VSCREENINFO (fb%d) failed!\n", VID0 ); return DFB_INIT; } /* Disable VID0 (unused) */ ret = ioctl( ddrv->fb[VID0].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", VID0, 0 ); /* Disable VID1 (our layer) */ ret = ioctl( ddrv->fb[VID1].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", VID1, 0 ); /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_SCREEN_LOCATION; description->type = DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "TI Davinci Video" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = dvid->var.xres; config->height = dvid->var.yres; config->pixelformat = DSPF_UYVY; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; return DFB_OK; } static DFBResult videoTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; D_DEBUG_AT( Davinci_Video, "%s()\n", __FUNCTION__ ); DFB_CORE_LAYER_REGION_CONFIG_DEBUG_AT( Davinci_Video, config ); if (config->options & ~DAVINCI_VIDEO_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; switch (config->format) { case DSPF_UYVY: break; default: fail |= CLRCF_FORMAT; } if (config->width < 8 || config->width > 1920) fail |= CLRCF_WIDTH; if (config->height < 8 || config->height > 1080) fail |= CLRCF_HEIGHT; if (config->dest.x < 0 || config->dest.y < 0) fail |= CLRCF_DEST; if (config->dest.x + config->dest.w > 1920) fail |= CLRCF_DEST; if (config->dest.y + config->dest.h > 1080) fail |= CLRCF_DEST; if (failed) *failed = fail; if (fail) { D_DEBUG_AT( Davinci_Video, " -> FAILED (0x%08x)\n", fail ); return DFB_UNSUPPORTED; } D_DEBUG_AT( Davinci_Video, " -> OK\n" ); return DFB_OK; } static DFBResult videoSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { int ret; DavinciDriverData *ddrv = driver_data; DavinciDeviceData *ddev = ddrv->ddev; DavinciVideoLayerData *dvid = layer_data; CoreLayerRegionConfig *old = &dvid->config; D_DEBUG_AT( Davinci_Video, "%s( updated 0x%08x, surface %p )\n", __FUNCTION__, updated, surface ); DFB_CORE_LAYER_REGION_CONFIG_DEBUG_AT( Davinci_Video, config ); D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); D_ASSERT( dvid != NULL ); /* Update output size? */ if ((updated & CLRCF_DEST) && (config->dest.w != old->dest.w || config->dest.h != old->dest.h)) { vpbe_window_position_t win_pos; D_DEBUG_AT( Davinci_Video, " => dest %4dx%4d\n", config->dest.w, config->dest.h ); ret = ioctl( ddrv->fb[VID1].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", VID1, 0 ); dvid->enabled = false; /*********************************** Start workaround ***********************************/ win_pos.xpos = 0; win_pos.ypos = 0; ret = ioctl( ddrv->fb[VID1].fd, FBIO_SETPOS, &win_pos ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_SETPOS (fb%d - %d,%d) failed!\n", VID1, win_pos.xpos, win_pos.ypos ); dvid->var.yoffset = 0; /*********************************** End workaround ***********************************/ /* Set output width and height. */ dvid->var.xres = config->dest.w; dvid->var.yres = config->dest.h; dvid->var.yres_virtual = ddrv->fb[VID1].size / lock->pitch; ret = ioctl( ddrv->fb[VID1].fd, FBIOPUT_VSCREENINFO, &dvid->var ); if (ret) D_PERROR( "Davinci/Video: FBIOPUT_VSCREENINFO (fb%d) failed!\n", VID1 ); /* Read back new pitch etc. */ ret = ioctl( ddrv->fb[VID1].fd, FBIOGET_FSCREENINFO, &ddev->fix[VID1] ); if (ret) D_PERROR( "Davinci/Video: FBIOGET_FSCREENINFO (fb%d) failed!\n", VID1 ); } /* Update output position? */ if (updated & CLRCF_DEST) { vpbe_window_position_t win_pos; D_DEBUG_AT( Davinci_Video, " => dest %4d,%4d\n", config->dest.x, config->dest.y ); if (dvid->enabled) ioctl( ddrv->fb[VID1].fd, FBIO_WAITFORVSYNC ); /* Set horizontal and vertical offset. */ win_pos.xpos = config->dest.x; win_pos.ypos = config->dest.y; ret = ioctl( ddrv->fb[VID1].fd, FBIO_SETPOS, &win_pos ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_SETPOS (fb%d - %d,%d) failed!\n", VID1, config->dest.x, config->dest.y ); } /* Update format? */ if (updated & CLRCF_FORMAT) { vpbe_video_config_params_t params; params.cb_cr_order = (config->format == DSPF_YUY2) ? 1 : 0; params.exp_info.horizontal = VPBE_DISABLE; params.exp_info.vertical = VPBE_DISABLE; ret = ioctl( ddrv->fb[VID1].fd, FBIO_SET_VIDEO_CONFIG_PARAMS, ¶ms ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_SET_VIDEO_CONFIG_PARAMS (fb%d - %s) failed!\n", VID1, params.cb_cr_order ? "CrCb" : "CbCr" ); } /* Update scaling parameters? */ if ((updated & (CLRCF_SOURCE | CLRCF_DEST)) && (config->source.w != old->source.w || config->source.h != old->source.h || config->dest.w != old->dest.w || config->dest.h != old->dest.h) && (config->dest.w != config->source.w || config->dest.h != config->source.h)) { D_DEBUG_AT( Davinci_Video, " => scaling %4dx%4d -> %4dx%4d\n", config->source.w, config->source.h, config->dest.w, config->dest.h ); SetupResizerParams( &dvid->resizer, config->source.w, config->source.h, config->dest.w, config->dest.h, &dvid->resized.w, &dvid->resized.h ); dvid->offset.x = (config->dest.w - dvid->resized.w) / 2; dvid->offset.y = (config->dest.h - dvid->resized.h) / 2; D_DEBUG_AT( Davinci_Video, " => resized %4dx%4d, centered %d,%d\n", dvid->resized.w, dvid->resized.h, dvid->offset.x, dvid->offset.y ); dvid->offset.x += dvid->offset.x & 1; /* Round up to multiple of two */ D_DEBUG_AT( Davinci_Video, " => offset %4d,%4d\n", dvid->offset.x, dvid->offset.y ); davincifb_pan_display( &ddrv->fb[VID1], &dvid->var, NULL, DSFLIP_NONE, 0, 0 ); } dvid->enable = true; dvid->config = *config; return DFB_OK; } static DFBResult videoRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { int ret; DavinciDriverData *ddrv = driver_data; DavinciVideoLayerData *dvid = layer_data; D_DEBUG_AT( Davinci_Video, "%s()\n", __FUNCTION__ ); D_ASSERT( ddrv != NULL ); ret = ioctl( ddrv->fb[VID1].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", VID1, 0 ); dvid->enabled = false; dvid->enable = false; return DFB_OK; } static DFBResult videoFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { DFBResult ret; DavinciDriverData *ddrv = driver_data; DavinciVideoLayerData *dvid = layer_data; D_ASSERT( surface != NULL ); D_ASSERT( lock != NULL ); D_ASSERT( ddrv != NULL ); D_ASSERT( dvid != NULL ); D_DEBUG_AT( Davinci_Video, "%s( 0x%08lx [%d] 0x%04x [%4dx%4d] )\n", __FUNCTION__, lock->phys, lock->pitch, flags, dvid->config.width, dvid->config.height ); ret = ShowBuffer( ddrv, dvid, lock, NULL, flags ); if (ret) return ret; dfb_surface_flip( surface, false ); return DFB_OK; } static DFBResult videoUpdateRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, const DFBRegion *update, CoreSurfaceBufferLock *lock ) { DavinciDriverData *ddrv = driver_data; DavinciVideoLayerData *dvid = layer_data; D_ASSERT( surface != NULL ); D_ASSERT( lock != NULL ); D_ASSERT( ddrv != NULL ); D_ASSERT( dvid != NULL ); if (update) { DFBRectangle area = DFB_RECTANGLE_INIT_FROM_REGION( update ); D_DEBUG_AT( Davinci_Video, "%s( 0x%08lx [%d], %4d,%4d-%4dx%4d )\n", __FUNCTION__, lock->phys, lock->pitch, DFB_RECTANGLE_VALS( &area ) ); if (!dfb_rectangle_intersect( &area, &dvid->config.source )) { D_DEBUG_AT( Davinci_Video, " -> NO INTERSECTION with %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS( &dvid->config.source ) ); return DFB_OK; } if (!DFB_RECTANGLE_EQUAL( area, dvid->config.source )) return ShowBuffer( ddrv, dvid, lock, &area, DSFLIP_NONE ); } else D_DEBUG_AT( Davinci_Video, "%s( 0x%08lx [%d], %4dx%4d )\n", __FUNCTION__, lock->phys, lock->pitch, dvid->config.width, dvid->config.height ); return ShowBuffer( ddrv, dvid, lock, NULL, DSFLIP_NONE ); } const DisplayLayerFuncs davinciVideoLayerFuncs = { .LayerDataSize = videoLayerDataSize, .InitLayer = videoInitLayer, .TestRegion = videoTestRegion, .SetRegion = videoSetRegion, .RemoveRegion = videoRemoveRegion, .FlipRegion = videoFlipRegion, .UpdateRegion = videoUpdateRegion, }; /*********************************************************************************************************************** ** Frame Output */ static void enable_video( DavinciDriverData *ddrv, DavinciVideoLayerData *dvid ) { if (dvid->enable && !dvid->enabled) { ioctl( ddrv->fb[VID1].fd, FBIO_WAITFORVSYNC ); if (ioctl( ddrv->fb[VID1].fd, FBIO_ENABLE_DISABLE_WIN, 1 )) D_VIDERROR( "Davinci/Video: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", VID1, 1 ); dvid->enabled = true; } } static DFBResult ShowBuffer( DavinciDriverData *ddrv, DavinciVideoLayerData *dvid, CoreSurfaceBufferLock *lock, const DFBRectangle *area, DFBSurfaceFlipFlags flags ) { const CoreLayerRegionConfig *config = &dvid->config; if (area) D_DEBUG_AT( Davinci_Video, "%s( 0x%08lx [%d], %4d,%4d-%4dx%4d )\n", __FUNCTION__, lock->phys, lock->pitch, DFB_RECTANGLE_VALS( area ) ); else D_DEBUG_AT( Davinci_Video, "%s( 0x%08lx [%d] )\n", __FUNCTION__, lock->phys, lock->pitch ); if (config->dest.w == config->source.w && config->dest.h == config->source.h) { /* * Unscaled video, buffer displayed directly */ D_DEBUG_AT( Davinci_Video, " -> unscaled %4dx%4d <- %4d,%4d [%4dx%4d]\n", config->source.w, config->source.h, config->source.x, config->source.y, config->width, config->height ); /* Partial update, assuming proper buffer is shown, saving system calls */ if (area && dvid->enabled) return DFB_OK; davincifb_pan_display( &ddrv->fb[VID1], &dvid->var, lock, flags, config->source.x, config->source.y ); } else { int ret; DavinciDeviceData *ddev = ddrv->ddev; CoreSurfaceBuffer *buffer = lock->buffer; vpfe_resizer_params_t *params = &dvid->resizer; /* * Scaled video, buffer scaled to output buffer by resizer */ D_DEBUG_AT( Davinci_Video, " -> scaled %4dx%4d -> %4dx%4d <- %4d,%4d [%4dx%4d]\n", config->source.w, config->source.h, config->dest.w, config->dest.h, config->source.x, config->source.y, config->width, config->height ); /* FIXME: Implement scaled partial updates! */ if (area) D_UNIMPLEMENTED(); params->sdr_inoff = lock->pitch; params->sdr_inadd = lock->phys + DFB_BYTES_PER_LINE( buffer->format, config->source.x ) + config->source.y * params->sdr_inoff; params->sdr_outoff = ddev->fix[VID1].line_length; params->sdr_outadd = ddev->fix[VID1].smem_start + dvid->offset.x * 2 + dvid->offset.y * params->sdr_outoff; params->in_start = (params->sdr_outadd & 0x1f) / 2; params->sdr_outadd &= ~0x1f; D_DEBUG_AT( Davinci_Video, " -> FBIO_RESIZER running...\n" ); ret = ioctl( ddrv->fb[VID1].fd, FBIO_RESIZER, params ); if (ret) D_VIDERROR( "Davinci/Video: FBIO_RESIZER (fb%d)!\n", VID1 ); D_DEBUG_AT( Davinci_Video, " => FBIO_RESIZER returned %d\n", ret ); } enable_video( ddrv, dvid ); return DFB_OK; } /*********************************************************************************************************************** ** Scaling Setup */ static int limitInput(int rsz,int inSize,int outSize,int* pInSize) { int phases; int phaseShift; int taps; int phaseMask; int coarseShift; int halfCoarse; int tmp; do { if (rsz<=512) { //1/2x to 4x resize uses 8 phase, 4 taps phaseShift = 3; taps = 4; } else { //4-phase, 7 taps phaseShift = 2; taps = 7; } phases = 1<>8) + taps; if (tmp <= inSize) break; rsz--; } while (1); *pInSize = tmp; return rsz; } static void SetupCoef(unsigned int* pCoef,int rsz) { int startCoef; int highCoef; int c; int phases; int taps; if (rsz<=512) { //1/2x to 4x resize uses 8 phase, 4 taps highCoef = 0x100; c=1; phases=8; taps=4; } else { //4-phase, 7 taps if (rsz<=(256*3)) { highCoef = 0x100/2; c=2; } else { highCoef = 0x100/4; c=1; } phases=4; taps=7; } startCoef = highCoef>>1; while (phases) { int prev = startCoef; int tapNum=0; int rem=256 - startCoef; while ( tapNum < (c-1)) { *pCoef++ = 0; tapNum+=2; } if (c&1) { *pCoef++ = prev<<16; tapNum+=2; } else { tapNum++; } while ( tapNum < taps) { int min = (rem (highCoef>>3)) startCoef -= (highCoef>>3); else { startCoef = highCoef; c++; } phases--; } } #define SDRAM_SRC (1<<28) #define BILINEAR (1<<29) static void SetupResizerParams( vpfe_resizer_params_t *params, int srcWidth, int srcHeight, int outWidth, int outHeight, int *ret_outWidth, int *ret_outHeight ) { int rsz; int hrsz; int vrsz; int tmp; D_DEBUG_AT( Davinci_Video, "%s( %4dx%4d->%4dx%4d )\n", __FUNCTION__, srcWidth, srcHeight, outWidth, outHeight ); params->sdr_inadd = 0; params->sdr_inoff = 0; params->sdr_outadd = 0; params->sdr_outoff = 0; params->in_start = (0<<16)|(0); params->yenh = 0; params->rsz_cnt = SDRAM_SRC; //find scale factor rsz = (srcWidth<<8)/outWidth; if (rsz<64) { //too much upscaling, reduce destination size rsz = 64; } else if (rsz>1024) { //too much down scaling, reduce source size rsz=1024; srcWidth = (outWidth * rsz)>>8; } tmp = ((srcWidth<<8)+255)/rsz; if (tmp > outWidth) tmp = outWidth; tmp &= ~1; //force even if (rsz>256) { //upsize in vertical direction requires a multiple of 16 bytes (8 pixels) tmp &= ~0x7; } do { int t; hrsz = limitInput(rsz,srcWidth,tmp,&t); if (hrsz>=64) { srcWidth = t; break; } tmp-=2; } while (1); outWidth = tmp; if (srcWidth==outWidth) { int i=0; params->rsz_cnt |= ((256-1)<<0); //1 to 1 params->in_size = (srcWidth+3); //4 taps while (i<16) { params->hfilt[i] = i? 0 : 0x100; //2 coefficient written at a time i++; } } else { SetupCoef(¶ms->hfilt[0],hrsz); params->rsz_cnt |= ((hrsz-1)<<0) | ((hrsz<256)? BILINEAR : 0); params->in_size = (srcWidth); } //find scale factor rsz = (srcHeight<<8)/outHeight; if (rsz<64) { //too much upscaling, reduce destination size rsz = 64; } else if (rsz>1024) { //too much down scaling, reduce source size rsz=1024; srcHeight = (outHeight * rsz)>>8; } tmp = ((srcHeight<<8)+255)/rsz; if (tmp > outHeight) tmp = outHeight; do { int t; vrsz = limitInput(rsz,srcHeight,tmp,&t); if (vrsz>=64) { srcHeight = t; break; } tmp--; } while (1); outHeight = tmp; if (srcHeight==outHeight) { int i=0; params->rsz_cnt |= ((256-1)<<10); //1 to 1 params->in_size |= ((srcHeight+3)<<16); //4 taps while (i<16) { params->vfilt[i] = i? 0 : 0x100; //2 coefficient written at a time i++; } } else { SetupCoef(¶ms->vfilt[0],vrsz); params->rsz_cnt |= ((vrsz-1)<<10); params->in_size |= (srcHeight<<16); } params->out_size = (outHeight<<16)|(outWidth); D_DEBUG_AT( Davinci_Video, " => %4dx%4d->%4dx%4d\n", srcWidth, srcHeight, outWidth, outHeight ); if (ret_outWidth) *ret_outWidth = outWidth; if (ret_outHeight) *ret_outHeight = outHeight; } DirectFB-1.2.10/gfxdrivers/davinci/davinci_gfxdriver.h0000644000175000017500000001137411245562152017615 00000000000000/* TI Davinci driver - Graphics Driver (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_GFXDRIVER_H__ #define __DAVINCI_GFXDRIVER_H__ #include #include #include #include "davincifb.h" #include "davinci_c64x.h" typedef struct { /* validation flags */ int v_flags; /* cached/computed values */ void *dst_addr; unsigned long dst_phys; unsigned int dst_size; unsigned long dst_pitch; DFBSurfacePixelFormat dst_format; unsigned long dst_bpp; void *src_addr; unsigned long src_phys; unsigned long src_pitch; DFBSurfacePixelFormat src_format; unsigned long src_bpp; unsigned long source_mult; unsigned long fillcolor; int blit_blend_sub_function; int draw_blend_sub_function; DFBColor color; unsigned long color_argb; unsigned long colorkey; DFBSurfaceBlittingFlags blitting_flags; DFBRegion clip; /** Add shared data here... **/ struct fb_fix_screeninfo fix[4]; CoreSurfacePool *osd_pool; CoreSurfacePool *video_pool; bool synced; } DavinciDeviceData; typedef struct { int num; int fd; void *mem; int size; } DavinciFB; typedef struct { DavinciDeviceData *ddev; CoreDFB *core; CoreScreen *screen; CoreLayer *osd; CoreLayer *video; DavinciFB fb[4]; DavinciC64x c64x; bool c64x_present; DavinciC64xTasks tasks; } DavinciDriverData; static inline DFBResult davincifb_pan_display( const DavinciFB *fb, struct fb_var_screeninfo *var, const CoreSurfaceBufferLock *lock, DFBSurfaceFlipFlags flags, int x, int y ) { int ret; if (lock) { #ifdef FBIO_SET_START CoreSurfaceBuffer *buffer = lock->buffer; struct fb_set_start set_start; /* physical mode */ set_start.offset = -1; set_start.sync = (flags & DSFLIP_ONSYNC) ? 1 : 0; /* life's so easy */ set_start.physical = lock->phys + DFB_BYTES_PER_LINE( buffer->format, x ) + y * lock->pitch; ret = ioctl( fb->fd, FBIO_SET_START, &set_start ); if (ret < 0) D_DEBUG( "FBIO_SET_START (0x%08lx, sync %llu) failed!\n", set_start.physical, set_start.sync ); if (ret == 0) { if (flags & DSFLIP_WAIT) ioctl( fb->fd, FBIO_WAITFORVSYNC ); return DFB_OK; } /* fallback */ #endif var->xoffset = x; /* poor version */ var->yoffset = y + lock->offset / lock->pitch; } else { var->xoffset = x; var->yoffset = y; } var->activate = /*(flags & DSFLIP_ONSYNC) ? FB_ACTIVATE_VBL :*/ FB_ACTIVATE_NOW; ret = ioctl( fb->fd, FBIOPAN_DISPLAY, var ); if (ret) D_PERROR( "Davinci/FB: FBIOPAN_DISPLAY (fb%d - %d,%d) failed!\n", fb->num, var->xoffset, var->yoffset ); if (flags & DSFLIP_WAIT) ioctl( fb->fd, FBIO_WAITFORVSYNC ); return DFB_OK; } #endif DirectFB-1.2.10/gfxdrivers/davinci/davinci_screen.c0000644000175000017500000000655711245562152017076 00000000000000/* TI Davinci driver - Primary Screen (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include #include "davincifb.h" #include "davinci_gfxdriver.h" #include "davinci_screen.h" D_DEBUG_DOMAIN( Davinci_Screen, "Davinci/Screen", "TI Davinci Screen" ); /**********************************************************************************************************************/ static DFBResult davinciInitScreen( CoreScreen *screen, CoreGraphicsDevice *device, void *driver_data, void *screen_data, DFBScreenDescription *description ) { D_DEBUG_AT( Davinci_Screen, "%s()\n", __FUNCTION__ ); /* Set the screen capabilities. */ description->caps = DSCCAPS_VSYNC; /* Set the screen name. */ snprintf( description->name, DFB_SCREEN_DESC_NAME_LENGTH, "TI Davinci Screen" ); return DFB_OK; } static DFBResult davinciGetScreenSize( CoreScreen *screen, void *driver_data, void *screen_data, int *ret_width, int *ret_height ) { int ret; vpbe_fb_videomode_t mode; DavinciDriverData *ddrv = driver_data; D_DEBUG_AT( Davinci_Screen, "%s()\n", __FUNCTION__ ); D_ASSERT( ret_width != NULL ); D_ASSERT( ret_height != NULL ); ret = ioctl( ddrv->fb[OSD0].fd, FBIO_GET_TIMING, &mode ); if (ret) { D_PERROR( "%s: FBIO_GET_TIMING (fb%d, OSD0) failed!\n", __func__, OSD0 ); return DFB_INIT; } *ret_width = mode.xres; *ret_height = mode.yres; return DFB_OK; } static DFBResult davinciWaitVSync( CoreScreen *screen, void *driver_data, void *screen_data ) { DavinciDriverData *ddrv = driver_data; D_DEBUG_AT( Davinci_Screen, "%s()\n", __FUNCTION__ ); ioctl( ddrv->fb[OSD0].fd, FBIO_WAITFORVSYNC ); return DFB_OK; } ScreenFuncs davinciScreenFuncs = { .InitScreen = davinciInitScreen, .GetScreenSize = davinciGetScreenSize, .WaitVSync = davinciWaitVSync, }; DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/0000777000175000017500000000000011307522570016567 500000000000000DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/c64x/0000777000175000017500000000000011307522570017353 500000000000000DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/c64x/Makefile0000644000175000017500000000004611164361026020725 00000000000000obj-$(CONFIG_DAVINCI_C64X) += c64x.o DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/c64x/c64x.c0000644000175000017500000003224111164361026020217 00000000000000/* TI Davinci driver - C64X+ DSP Kernel Module (c) Copyright 2007 Telio AG Written by Olaf Dreesen . All rights reserved. This module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define C64X_IRQ MODULE_LICENSE("GPL v2"); //MODULE_LICENSE("Propietary"); MODULE_AUTHOR("Olaf Dreesen "); MODULE_DESCRIPTION("A little c64+ handling module."); #define C_MOD_MAJOR 400 #define C_MOD_NUM_DEV 1 #define C_MOD_NAME "c64x" #define F_NAME "c64x_drv.bin" #define CODE_BASE 0x00800000 /* DDR2: * * transfer buffer */ #define R_BASE DAVINCI_C64X_MEM #define R_LEN 0x02000000 /* L2RAM: * * 0x00800000 - 0x0080FFFF C64x+ * 0x11800000 - 0x1180FFFF ARM */ #define D_BASE 0x11800000 #define D_LEN 0x00010000 /* L1DRAM: * * 0x00F04000 - 0x00F0FFFF C64x+ * 0x11F04000 - 0x11F0FFFF ARM * * Queue controls @ 0x00F04000 (4096 Bytes) */ #define Q_BASE 0x11F04000 #define Q_LEN 0x00001000 #define HQueueDSP (l1dram[0x00>>2]) #define HQueueARM (l1dram[0x04>>2]) #define LQueueDSP (l1dram[0x08>>2]) #define LQueueARM (l1dram[0x0C>>2]) #define DSPidle (l1dram[0x10>>2]) /* IO Register needed: * * 0x01C40008 DSPBOOTADDR DSP Boot Address * 0x01C40010 INTGEN Interrupt Generator * 0x01C40038 CHP_SHRTSW DSP Power * 0x01C4169C MDCFG39 DSP Module config * 0x01C41A9C MDCTL39 DSP Module control */ #define IO_BASE 0x01c40000 #define IO_LEN 0x00010000 #define DSPBOOTADDR (mmr[0x0008>>2]) #define INTGEN (mmr[0x0010>>2]) #define CHP_SHRTSW (mmr[0x0038>>2]) #define MDCFG39 (mmr[0x169C>>2]) #define MDCTL39 (mmr[0x1A9C>>2]) MODULE_FIRMWARE(F_NAME); static dev_t dev_major; static struct cdev*dev_cdev; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) static struct class*dev_class; #else static struct class_simple*dev_class; #endif static volatile unsigned int*mmr=0; static unsigned char*l2ram=0; static volatile unsigned int*l1dram=0; static volatile void*dram=0; static volatile c64xTaskControl*c64xctl=0; static volatile c64xTask*queue_l=0; #ifdef C64X_IRQ static int dev_irq=46; static DECLARE_WAIT_QUEUE_HEAD( wait_irq ); /* IRQ */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 21) static irqreturn_t dev_irq_handler(int irq,void*dev_id) { #else static irqreturn_t dev_irq_handler(int irq,void*dev_id,struct pt_regs*regs) { #endif wake_up_all( &wait_irq ); return IRQ_HANDLED; } #endif static u32 opencnt=0; /* char-dev */ static int dev_open(struct inode*inode,struct file*filp) { if (opencnt++==0) { DSPidle=0; MDCTL39=0x00000103; /* Go! Go, go Go! */ while(DSPidle==0); } return 0; } static int dev_release(struct inode*inode,struct file*filp) { if (--opencnt==0) { MDCTL39=0x00000000; /* local reset */ } return 0; } static ssize_t dev_write(struct file*filp,const char __user*buffer,size_t len,loff_t*off) { long ret=0; unsigned long offset=*off; if (offset=D_LEN) { len=D_LEN-offset; } // printk(KERN_INFO "c64x+ : read got offset %08lx %08lx\n",offset,(long)len); ret=len; *off+=len; } return ret; } static ssize_t dev_read(struct file*filp,char __user*buffer,size_t len,loff_t*off) { long ret=0; unsigned long offset=*off; if (offset=D_LEN) { len=D_LEN-offset; } // printk(KERN_INFO "c64x+ : read got offset %08lx %08lx\n",offset,(long)len); ret=len; ret-=copy_to_user(buffer,(l2ram+offset),len); *off+=len; } return ret; } static int dev_mmap(struct file * file, struct vm_area_struct * vma) { size_t size=vma->vm_end-vma->vm_start; if (vma->vm_pgoff) { if (size!=R_LEN) return -EINVAL; #if defined(pgprot_writecombine) vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); #else vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); #endif if (remap_pfn_range(vma, vma->vm_start, R_BASE>>PAGE_SHIFT, size, vma->vm_page_prot)) return -EAGAIN; } else { if (size!=Q_LEN) return -EINVAL; vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); if (remap_pfn_range(vma, vma->vm_start, Q_BASE>>PAGE_SHIFT, size, vma->vm_page_prot)) return -EAGAIN; } return 0; } static void c64x_dump( const char *condition ) { static const char *state_names[] = { "DONE", "ERROR", "TODO", "RUNNING" }; uint32_t ql_dsp = c64xctl->QL_dsp; uint32_t ql_arm = c64xctl->QL_arm; uint32_t tl_dsp = queue_l[ql_dsp & C64X_QUEUE_MASK].c64x_function; uint32_t tl_arm = queue_l[ql_arm & C64X_QUEUE_MASK].c64x_function; int dl; dl = ql_arm - ql_dsp; if (dl < 0) dl += C64X_QUEUE_LENGTH; printk( "C64X+ Queue: %s\n" " [DSP %d / %d (%s), ARM %d / %d (%s)] <- %d pending\n", condition, ql_dsp, (tl_dsp >> 2) & 0x3fff, state_names[tl_dsp & 3], ql_arm, (tl_arm >> 2) & 0x3fff, state_names[tl_arm & 3], dl ); } static int c64x_wait_low( void ) { int ret; int num = 0; /* Keep reference values for comparison. */ u32 idle = c64xctl->idlecounter; u32 dsp = c64xctl->QL_dsp; /* Wait for equal pointers... */ while (dsp != c64xctl->QL_arm) { /* ...each time for a 1/50 second... */ ret = wait_event_interruptible_timeout( wait_irq, c64xctl->QL_dsp == c64xctl->QL_arm, HZ/50 ); if (ret < 0) return ret; /* ...if after that 1/50 second still the same command is running... */ if (!ret && c64xctl->QL_dsp == dsp) { /* ...and almost one second elapsed in total, or the DSP felt idle... */ if (++num > 42 || c64xctl->idlecounter != idle) { /* ...timeout! */ printk( KERN_ERR "c64x+ : timeout waiting for idle queue\n" ); c64x_dump( "TIMEOUT!!!" ); return -ETIMEDOUT; } } else { /* Different command running, reset total elapsed time. */ num = 0; } /* Update reference values. */ idle = c64xctl->idlecounter; dsp = c64xctl->QL_dsp; } return 0; } static int dev_ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned long arg) { switch (cmd) { case C64X_IOCTL_RESET: MDCTL39=0x00000000; /* local reset */ mdelay(10); DSPidle=0; MDCTL39=0x00000103; break; case C64X_IOCTL_WAIT_LOW: return c64x_wait_low(); default: printk(KERN_INFO "c64x+ : unknown ioctl : cmd=%08x\n",cmd); return -EAGAIN; break; } return 0; } static struct file_operations dev_file_ops={ .owner = THIS_MODULE, .open = dev_open, .release = dev_release, .read = dev_read, .write = dev_write, .mmap = dev_mmap, .ioctl = dev_ioctl, }; /* INIT */ static __initdata struct device dev_device = { .bus_id = "c64x0", }; static int __init dev_init(void) { int ret=-EIO; u8 *at; const struct firmware*fw = NULL; printk(KERN_INFO "c64x+ : module load\n"); if ((dram=ioremap(R_BASE,R_LEN))==0) { printk(KERN_ERR "c64x+ : module couldn't get memory\n"); goto err0; } printk(KERN_INFO "c64x+ : module got memory @ %p\n",dram); queue_l = dram + 0x01e00000; /* get the 'device' memory */ if ((mmr=ioremap(IO_BASE,IO_LEN))==0) { printk(KERN_ERR "c64x+ : module couldn't get IO-MMR\n"); goto err0; } printk(KERN_INFO "c64x+ : DSP bootaddr: %08x\n",DSPBOOTADDR); printk(KERN_INFO "c64x+ : got mmr %p %08x %08x\n",mmr,MDCTL39,MDCFG39); printk(KERN_INFO "c64x+ : switch state: %08x\n",CHP_SHRTSW); MDCTL39=0x00000000; /* local reset */ mdelay(10); DSPBOOTADDR=CODE_BASE; /* set DSP base address */ // printk(KERN_INFO "c64x+ : check0: %p %08x %08x\n",mmr,MDCTL39,MDCFG39); /* get the 'device' memory */ if ((l1dram=ioremap(Q_BASE,Q_LEN))==0) { printk(KERN_ERR "c64x+ : module couldn't get L1 dsp-memory\n"); goto err1; } printk(KERN_INFO "c64x+ : module got L1D @ %p\n",l1dram); c64xctl = (volatile void*)l1dram; if ((l2ram=ioremap(D_BASE,D_LEN))==0) { printk(KERN_ERR "c64x+ : module couldn't get L2 dsp-memory\n"); goto err2; } printk(KERN_INFO "c64x+ : module got L2 @ %p\n",l2ram); /* request firmware */ device_initialize(&dev_device); ret=device_add(&dev_device); if (ret) { printk(KERN_ERR "c64x+ : device_add failed\n"); goto err3; } printk(KERN_INFO "c64x+ : module requesting firmware '%s'\n",F_NAME); ret=request_firmware(&fw,F_NAME,&dev_device); printk(KERN_INFO "c64x+ : module got fw %p\n",fw); if (ret) { printk(KERN_ERR "c64x+ : no firmware upload (timeout or file not found?)\n"); device_del(&dev_device); goto err3; } printk(KERN_INFO "c64x+ : firmware upload %p %zd\n",fw->data,fw->size); if (fw->size>32767) { printk(KERN_ERR "c64x+ : firmware too big! 32767 is maximum (for now)\n"); release_firmware(fw); device_del(&dev_device); goto err3; } if (memcmp(fw->data+8,"C64x+DV",8)) { printk(KERN_ERR "c64x+ : firmware signature missing\n"); release_firmware(fw); device_del(&dev_device); goto err3; } at = fw->data + fw->size; while ((ulong)--at > (ulong)fw->data) { if (*at == '@') break; } if (at == fw->data) { printk(KERN_ERR "c64x+ : firmware tag missing\n"); release_firmware(fw); device_del(&dev_device); goto err3; } printk(KERN_NOTICE "c64x+ : got firmware of length %d at %p with tag '%*s' of length %d at %p+1\n", fw->size, fw->data, (int)((ulong)(fw->data + fw->size) - (ulong)at - 1), at + 1, (int)((ulong)(fw->data + fw->size) - (ulong)at - 1), at ); /* move firmware into the hardware buffer here. */ memcpy(l2ram,fw->data,fw->size); release_firmware(fw); device_del(&dev_device); #if 0 /* release DSP */ printk(KERN_INFO "c64x+ : check1: %p %08x %08x\n",mmr,MDCTL39,MDCFG39); MDCTL39=0x00000103; /* Hopefully run... */ printk(KERN_INFO "c64x+ : check2: %p %08x %08x\n",mmr,MDCTL39,MDCFG39); printk(KERN_INFO "c64x+ : check3: %08x\n",DSPBOOTADDR); #endif /* register char-dev */ dev_major=MKDEV(C_MOD_MAJOR,0); ret=register_chrdev_region(dev_major,C_MOD_NUM_DEV,C_MOD_NAME); if (ret) { printk(KERN_ERR "c64x+ : can't get chrdev %d\n",C_MOD_MAJOR); goto err3; } /* allocate cdev */ dev_cdev=cdev_alloc(); dev_cdev->ops=&dev_file_ops; /* cdev_init(&dev_data.cdev,&dev_file_ops); */ ret=cdev_add(dev_cdev,dev_major,1); if (ret) { printk(KERN_ERR "c64x+ : can't allocate cdev\n"); goto err4; } #ifdef C64X_IRQ /* allocate interrupt slot */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 21) ret=request_irq(dev_irq,dev_irq_handler,IRQF_DISABLED,C_MOD_NAME,NULL); #else ret=request_irq(dev_irq,dev_irq_handler,SA_INTERRUPT ,C_MOD_NAME,NULL); #endif if (ret) { printk(KERN_ERR "c64x+ : can't get IRQ %d\n",dev_irq); goto err5; } #endif /* tell sysfs/udev */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) dev_class=class_create(THIS_MODULE,C_MOD_NAME); #else dev_class=class_simple_create(THIS_MODULE,C_MOD_NAME); #endif if (IS_ERR(dev_class)) { ret=PTR_ERR(dev_class); printk(KERN_ERR "c64x+ : can't allocate class\n"); goto err6; } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) class_device_create(dev_class,NULL,dev_major,NULL,C_MOD_NAME"%d",0); #else class_simple_device_add(dev_class,dev_major,NULL,C_MOD_NAME"%d",0); #endif printk(KERN_INFO "c64x+ : module load finished\n"); return 0; /* error out */ err6: #ifdef C64X_IRQ free_irq(dev_irq,0); err5: #endif cdev_del(dev_cdev); err4: unregister_chrdev_region(dev_major,1); err3: iounmap(l2ram); err2: iounmap((void*)l1dram); err1: iounmap((void*)mmr); err0: if (dram) iounmap((void*)dram); return ret; } module_init(dev_init); /* EXIT */ static void __exit dev_exit(void) { /* Put the DSP into Reset */ MDCTL39=0x00000000; /* release the DSP memory */ iounmap((void*)mmr); iounmap((void*)l1dram); iounmap(l2ram); /* release all the other resources */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) class_device_destroy(dev_class,dev_major); class_destroy(dev_class); #else class_simple_device_remove(dev_major); class_simple_destroy(dev_class); #endif #ifdef C64X_IRQ free_irq(dev_irq,0); #endif cdev_del(dev_cdev); unregister_chrdev_region(dev_major,C_MOD_NUM_DEV); } module_exit(dev_exit); DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/Makefile0000644000175000017500000000167711164361026020154 00000000000000KERNEL_VERSION = $(shell uname -r) KERNEL_MODLIB = /lib/modules/$(KERNEL_VERSION) KERNEL_BUILD = $(KERNEL_MODLIB)/build KERNEL_SOURCE = $(KERNEL_MODLIB)/source SUB=c64x export CONFIG_DAVINCI_C64X=m ifeq ($(shell test -e $(KERNEL_BUILD)/include/linux/autoconf.h && echo yes),yes) AUTOCONF_H = -include $(KERNEL_BUILD)/include/linux/autoconf.h endif ifeq ($(shell test -e $(KERNEL_BUILD)/include/linux/config.h && echo yes),yes) CPPFLAGS += -DHAVE_LINUX_CONFIG_H endif CPPFLAGS += -DMODULE .PHONY: all install clean it all: $(MAKE) -C $(KERNEL_BUILD) \ KCPPFLAGS="$(CPPFLAGS) -I$(shell pwd)/include -I$(KERNEL_BUILD)/include" \ SUBDIRS=$(shell pwd)/$(SUB) ARCH=arm CROSS_COMPILE=arm-v4t-linux-gnueabi- modules install: all clean: $(RM) -r $(SUB)/.tmp_versions $(SUB)/Module.symvers find $(SUB) -name *.o -o -name *.ko -o -name .*.cmd -o -name *.mod.* | xargs rm -f so: it find $(SUB) -name "*.ko" | xargs strip -x -R .comment -R .note DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/include/0000777000175000017500000000000011307522570020212 500000000000000DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/include/linux/0000777000175000017500000000000011307522570021351 500000000000000DirectFB-1.2.10/gfxdrivers/davinci/kernel-module/include/linux/c64x.h0000644000175000017500000002143311164361026022223 00000000000000/* TI Davinci driver - C64X+ DSP Firmware Interface (c) Copyright 2008 directfb.org (c) Copyright 2007 Telio AG Written by Olaf Dreesen and Denis Oliver Kropp . All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __C64X_H__ #define __C64X_H__ #ifndef __KERNEL__ #include #endif #ifndef DAVINCI_C64X_MEM #define DAVINCI_C64X_MEM 0x8e000000 #endif typedef volatile struct { uint32_t c64x_function; uint32_t c64x_arg[7]; } c64xTask; #define c64x_return c64x_arg[0] #define c64x_errno c64x_arg[1] #define c64x_flags c64x_function typedef enum { C64X_STATE_DONE = 0, C64X_STATE_ERROR = 1, C64X_STATE_TODO = 2, C64X_STATE_RUNNING = 3 } C64XTaskState; typedef enum { C64X_FLAG_RUN = 1, C64X_FLAG_TODO = 2, C64X_FLAG_INTERRUPT = 0x80000000 } C64XTaskFlags; #define C64X_TASK_STATE(task) ((task)->c64x_flags & 3) typedef volatile struct { uint32_t QH_dsp; uint32_t QH_arm; uint32_t QL_dsp; uint32_t QL_arm; uint32_t idlecounter; } c64xTaskControl; #define C64X_QUEUE_LENGTH 0x4000 #define C64X_QUEUE_MASK 0x3fff typedef enum { C64X_BLEND_SRC_INVSRC = 2, /* old school fader on all channels including alpha on itself */ C64X_BLEND_ONE_INVSRC = 1, /* SrcOver using premultiplied alpha channel */ C64X_BLEND_ONE_INVSRC_PREMULT_SRC = 0, /* SrcOver doing premultiplication of source S[rgb] with S[a] */ C64X_BLEND_ONE_INVSRC_PREMULT_ALPHA = 3, /* SrcOver with Alpha using premultiplied alpha channel, but doing premultiplication of S[rgb] with Alpha */ } C64XBlendSubFunction; typedef enum { C64X_FLUSH_WRITE_BACK, C64X_FLUSH_WB_INVALIDATE, C64X_FLUSH_INVALIDATE } C64XFlushFunction; #define C64X_IOCTL_RESET _IO( 'c', 0 ) #define C64X_IOCTL_WAIT_LOW _IO( 'c', 1 ) /* function macro */ #define _C64XFUNC(val) (((val)&0x3fff)<<2) #define C64X_NOP _C64XFUNC(0) /* void c64x_dither_argb(u32*dst_rgb, u8*dst_alpha, u32 dst_pitch, u32*src, u32 src_pitch, u32 width, u32 height); */ #define C64X_DITHER_ARGB _C64XFUNC(1) /* void c64x_fill_16(u16*dst, u32 pitch, u32 width, u32 height, u16 val); void c64x_fill_32(u32*dst, u32 pitch, u32 width, u32 height, u32 val); */ #define C64X_FILL_16 _C64XFUNC(2) #define C64X_FILL_32 _C64XFUNC(3) /* void c64x_copy_16(u16*dst, u32 dst_pitch, u16*src, u32 src_pitch, u32 width, u32 height); void c64x_copy_32(u32*dst, u32 dst_pitch, u32*src, u32 src_pitch, u32 width, u32 height); */ #define C64X_COPY_16 _C64XFUNC(4) #define C64X_COPY_32 _C64XFUNC(5) /* void c64x_blend_32(u32*dst, u32 dst_pitch, u32*src, u32 src_pitch, u32 width, u32 height, u8 alpha); */ //#define C64X_BLEND_16 _C64XFUNC(6) #define C64X_BLEND_32 _C64XFUNC(7) /* void c64x_copy_keyed_16(u16*dst, u32 pitches, u16*src, u32 width, u32 height, u16 key, u16 mask); void c64x_copy_keyed_32(u32*dst, u32 pitches, u32*src, u32 width, u32 height, u32 key, u32 mask); */ #define C64X_COPY_KEYED_16 _C64XFUNC(8) #define C64X_COPY_KEYED_32 _C64XFUNC(9) /* void c64x_stretch_32(u32 *dst, u32 *src, u32 pitches, u32 dsize, u32 ssize, u32 clip2, u32 clip1); */ #define C64X_STRETCH_32_up _C64XFUNC(10) #define C64X_STRETCH_32_down _C64XFUNC(11) /* void c64x_wb_inv_range(u32 *start, u32 len, C64XFlushFunction func); */ #define C64X_WB_INV_RANGE _C64XFUNC(14) /* void c64x_write_back_all(void); */ #define C64X_WRITE_BACK_ALL _C64XFUNC(15) /* void c64x_load_block(s32*blockwords, u32 num_words, u32 cbp); */ #define C64X_LOAD_BLOCK _C64XFUNC(48) /* void c64x_put_idct_uyvy_16x16(u16*dst, u32 pitch, u32 flags); */ #define C64X_PUT_IDCT_UYVY_16x16 _C64XFUNC(49) /* void c64x_put_mc_uyvy_16x16(u16*dst, u32 pitch, u32 flags); */ #define C64X_PUT_MC_UYVY_16x16 _C64XFUNC(50) /* void c64x_put_sum_uyvy_16x16(u16*dst, u32 pitch, u32 flags); */ #define C64X_PUT_SUM_UYVY_16x16 _C64XFUNC(51) /* void c64x_dva_begin_frame(u32 pitch, u16 *current, u16 *past, u16 *future, u32 flags); */ #define C64X_DVA_BEGIN_FRAME _C64XFUNC(52) /* void c64x_dva_motion(DVAMacroBlock *macroblock); */ #define C64X_DVA_MOTION_BLOCK _C64XFUNC(53) /* void c64x_dva_idct(u16* dst, u32 pitch, u16* src); */ #define C64X_DVA_IDCT _C64XFUNC(59) /* * INTERNAL - for testing */ #define C64X_FETCH_BUFFER_PITCH 32 #define C64X_TEMP_BUFFER_PITCH 32 #define C64X_MC_BUFFER_PITCH 16 #define C64X_IDCT_BUFFER_PITCH 32 #define C64X_FETCH_BUFFER_Y(n) (0xf05840 + ((n) << 10)) #define C64X_FETCH_BUFFER_U(n) (C64X_FETCH_BUFFER_Y(n) + 18*C64X_FETCH_BUFFER_PITCH) #define C64X_FETCH_BUFFER_V(n) (C64X_FETCH_BUFFER_U(n) + 16) #define C64X_FETCH_BUFFER0_Y C64X_FETCH_BUFFER_Y(0) #define C64X_FETCH_BUFFER0_U C64X_FETCH_BUFFER_U(0) #define C64X_FETCH_BUFFER0_V C64X_FETCH_BUFFER_V(0) #define C64X_FETCH_BUFFER1_Y C64X_FETCH_BUFFER_Y(1) #define C64X_FETCH_BUFFER1_U C64X_FETCH_BUFFER_U(1) #define C64X_FETCH_BUFFER1_V C64X_FETCH_BUFFER_V(1) #define C64X_TEMP_BUFFER_Y 0xf06040 #define C64X_TEMP_BUFFER_U (C64X_TEMP_BUFFER_Y + 16*C64X_TEMP_BUFFER_PITCH) #define C64X_TEMP_BUFFER_V (C64X_TEMP_BUFFER_U + 8) #define C64X_MC_BUFFER_Y 0xf06440 #define C64X_MC_BUFFER_U (C64X_MC_BUFFER_Y + 16*C64X_MC_BUFFER_PITCH) #define C64X_MC_BUFFER_V (C64X_MC_BUFFER_U + 8) #define C64X_MC_BUFFER_Y_ (C64X_MC_BUFFER_Y + C64X_MC_BUFFER_PITCH) #define C64X_MC_BUFFER_U_ (C64X_MC_BUFFER_U + C64X_MC_BUFFER_PITCH) #define C64X_MC_BUFFER_V_ (C64X_MC_BUFFER_V + C64X_MC_BUFFER_PITCH) #define C64X_IDCT_BUFFER_Y 0xf06a40 #define C64X_IDCT_BUFFER_U (C64X_IDCT_BUFFER_Y + 16*C64X_IDCT_BUFFER_PITCH) #define C64X_IDCT_BUFFER_V (C64X_IDCT_BUFFER_U + 8) /* OBSOLETE void c64x_dezigzag(u16*dst, u16*src); */ #define C64X_DEZIGZAG _C64XFUNC(16) /* OBSOLETE void c64x_dealternate(u16*dst, u16*src); */ #define C64X_DEALTERNATE _C64XFUNC(17) /* void c64x_put_uyvy_16x16(u16*dst, u32 pitch, u8*src, u32 flags); */ #define C64X_PUT_UYVY_16x16 _C64XFUNC(18) /* void c64x_fetch_uyvy(u8 *dst, u8 *src, u32 spitch, u32 height); */ #define C64X_FETCH_UYVY _C64XFUNC(19) /* void mc_put_o_8 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); void mc_put_x_8 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); void mc_put_y_8 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); void mc_put_xy_8 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); */ #define C64X_MC_PUT_8(avgX,avgY) _C64XFUNC(32+(avgX)+(avgY)+(avgY)) /* void mc_put_o_16 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); void mc_put_x_16 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); void mc_put_y_16 (u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); void mc_put_xy_16(u8*dst, u32 dstride, u8*ref_src, u8*ignored, u32 rstride, u32 height); */ #define C64X_MC_PUT_16(avgX,avgY) _C64XFUNC(36+(avgX)+(avgY)+(avgY)) /* void mc_avg_o_8 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); void mc_avg_x_8 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); void mc_avg_y_8 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); void mc_avg_xy_8 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); */ #define C64X_MC_AVG_8(avgX,avgY) _C64XFUNC(40+(avgX)+(avgY)+(avgY)) /* void mc_avg_o_16 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); void mc_avg_x_16 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); void mc_avg_y_16 (u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); void mc_avg_xy_16(u8*dst, u32 dstride, u8*ref_src, u8*ref_dst, u32 rstride, u32 height); */ #define C64X_MC_AVG_16(avgX,avgY) _C64XFUNC(44+(avgX)+(avgY)+(avgY)) #endif DirectFB-1.2.10/gfxdrivers/davinci/Makefile.am0000644000175000017500000000325011245562152015775 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/davinci EXTRA_DIST = \ directfbrc \ Makefile.kernel \ kernel-module/c64x/Makefile \ kernel-module/c64x/c64x.c \ kernel-module/Makefile \ kernel-module/include/linux/c64x.h \ patches/ti-davinci-2.6.10-mvl401-fbio_set_start.patch INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems \ -I$(srcdir)/kernel-module/include bin_PROGRAMS = c64xdump lib_LTLIBRARIES = libdavinci_c64x.la davinci_LTLIBRARIES = libdirectfb_davinci.la if BUILD_STATIC davinci_DATA = $(davinci_LTLIBRARIES:.la=.o) endif davincidir = $(MODULEDIR)/gfxdrivers includedir = @INCLUDEDIR@ includelinuxdir = @INCLUDEDIR@/linux include_HEADERS = \ davincifb.h \ davinci_c64x.h \ davinci_gfxdriver.h includelinux_HEADERS = \ kernel-module/include/linux/c64x.h libdavinci_c64x_la_SOURCES = \ davinci_c64x.c libdavinci_c64x_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la libdirectfb_davinci_la_SOURCES = \ davinci_2d.c \ davinci_2d.h \ davinci_gfxdriver.c \ davinci_osd.c \ davinci_osd.h \ davinci_osd_pool.c \ davinci_osd_pool.h \ davinci_screen.c \ davinci_screen.h \ davinci_video.c \ davinci_video.h \ davinci_video_pool.c \ davinci_video_pool.h libdirectfb_davinci_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_davinci_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(builddir)/libdavinci_c64x.la c64xdump_SOURCES = c64xdump.c c64xdump_LDADD = $(top_builddir)/lib/direct/libdirect.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/davinci/Makefile.in0000644000175000017500000006322211307521477016017 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = c64xdump$(EXEEXT) DIST_COMMON = $(include_HEADERS) $(includelinux_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/davinci ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(davincidir)" "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(davincidir)" \ "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includelinuxdir)" davinciLTLIBRARIES_INSTALL = $(INSTALL) libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(davinci_LTLIBRARIES) $(lib_LTLIBRARIES) libdavinci_c64x_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la am_libdavinci_c64x_la_OBJECTS = davinci_c64x.lo libdavinci_c64x_la_OBJECTS = $(am_libdavinci_c64x_la_OBJECTS) libdirectfb_davinci_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(builddir)/libdavinci_c64x.la am_libdirectfb_davinci_la_OBJECTS = davinci_2d.lo davinci_gfxdriver.lo \ davinci_osd.lo davinci_osd_pool.lo davinci_screen.lo \ davinci_video.lo davinci_video_pool.lo libdirectfb_davinci_la_OBJECTS = $(am_libdirectfb_davinci_la_OBJECTS) libdirectfb_davinci_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_davinci_la_LDFLAGS) $(LDFLAGS) -o $@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_c64xdump_OBJECTS = c64xdump.$(OBJEXT) c64xdump_OBJECTS = $(am_c64xdump_OBJECTS) c64xdump_DEPENDENCIES = $(top_builddir)/lib/direct/libdirect.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdavinci_c64x_la_SOURCES) \ $(libdirectfb_davinci_la_SOURCES) $(c64xdump_SOURCES) DIST_SOURCES = $(libdavinci_c64x_la_SOURCES) \ $(libdirectfb_davinci_la_SOURCES) $(c64xdump_SOURCES) davinciDATA_INSTALL = $(INSTALL_DATA) DATA = $(davinci_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) includelinuxHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) $(includelinux_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @INCLUDEDIR@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ directfbrc \ Makefile.kernel \ kernel-module/c64x/Makefile \ kernel-module/c64x/c64x.c \ kernel-module/Makefile \ kernel-module/include/linux/c64x.h \ patches/ti-davinci-2.6.10-mvl401-fbio_set_start.patch INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems \ -I$(srcdir)/kernel-module/include lib_LTLIBRARIES = libdavinci_c64x.la davinci_LTLIBRARIES = libdirectfb_davinci.la @BUILD_STATIC_TRUE@davinci_DATA = $(davinci_LTLIBRARIES:.la=.o) davincidir = $(MODULEDIR)/gfxdrivers includelinuxdir = @INCLUDEDIR@/linux include_HEADERS = \ davincifb.h \ davinci_c64x.h \ davinci_gfxdriver.h includelinux_HEADERS = \ kernel-module/include/linux/c64x.h libdavinci_c64x_la_SOURCES = \ davinci_c64x.c libdavinci_c64x_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la libdirectfb_davinci_la_SOURCES = \ davinci_2d.c \ davinci_2d.h \ davinci_gfxdriver.c \ davinci_osd.c \ davinci_osd.h \ davinci_osd_pool.c \ davinci_osd_pool.h \ davinci_screen.c \ davinci_screen.h \ davinci_video.c \ davinci_video.h \ davinci_video_pool.c \ davinci_video_pool.h libdirectfb_davinci_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_davinci_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la \ $(builddir)/libdavinci_c64x.la c64xdump_SOURCES = c64xdump.c c64xdump_LDADD = $(top_builddir)/lib/direct/libdirect.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/davinci/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/davinci/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-davinciLTLIBRARIES: $(davinci_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(davincidir)" || $(MKDIR_P) "$(DESTDIR)$(davincidir)" @list='$(davinci_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(davinciLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(davincidir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(davinciLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(davincidir)/$$f"; \ else :; fi; \ done uninstall-davinciLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(davinci_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(davincidir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(davincidir)/$$p"; \ done clean-davinciLTLIBRARIES: -test -z "$(davinci_LTLIBRARIES)" || rm -f $(davinci_LTLIBRARIES) @list='$(davinci_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdavinci_c64x.la: $(libdavinci_c64x_la_OBJECTS) $(libdavinci_c64x_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libdavinci_c64x_la_OBJECTS) $(libdavinci_c64x_la_LIBADD) $(LIBS) libdirectfb_davinci.la: $(libdirectfb_davinci_la_OBJECTS) $(libdirectfb_davinci_la_DEPENDENCIES) $(libdirectfb_davinci_la_LINK) -rpath $(davincidir) $(libdirectfb_davinci_la_OBJECTS) $(libdirectfb_davinci_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done c64xdump$(EXEEXT): $(c64xdump_OBJECTS) $(c64xdump_DEPENDENCIES) @rm -f c64xdump$(EXEEXT) $(LINK) $(c64xdump_OBJECTS) $(c64xdump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c64xdump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_2d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_c64x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_gfxdriver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_osd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_osd_pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_screen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/davinci_video_pool.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-davinciDATA: $(davinci_DATA) @$(NORMAL_INSTALL) test -z "$(davincidir)" || $(MKDIR_P) "$(DESTDIR)$(davincidir)" @list='$(davinci_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(davinciDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(davincidir)/$$f'"; \ $(davinciDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(davincidir)/$$f"; \ done uninstall-davinciDATA: @$(NORMAL_UNINSTALL) @list='$(davinci_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(davincidir)/$$f'"; \ rm -f "$(DESTDIR)$(davincidir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done install-includelinuxHEADERS: $(includelinux_HEADERS) @$(NORMAL_INSTALL) test -z "$(includelinuxdir)" || $(MKDIR_P) "$(DESTDIR)$(includelinuxdir)" @list='$(includelinux_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includelinuxHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includelinuxdir)/$$f'"; \ $(includelinuxHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includelinuxdir)/$$f"; \ done uninstall-includelinuxHEADERS: @$(NORMAL_UNINSTALL) @list='$(includelinux_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includelinuxdir)/$$f'"; \ rm -f "$(DESTDIR)$(includelinuxdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(davincidir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(davincidir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includelinuxdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-davinciLTLIBRARIES clean-generic \ clean-libLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-davinciDATA install-davinciLTLIBRARIES \ install-includeHEADERS install-includelinuxHEADERS install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-davinciDATA \ uninstall-davinciLTLIBRARIES uninstall-includeHEADERS \ uninstall-includelinuxHEADERS uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-davinciLTLIBRARIES clean-generic clean-libLTLIBRARIES \ clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-davinciDATA install-davinciLTLIBRARIES install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS \ install-includelinuxHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-davinciDATA uninstall-davinciLTLIBRARIES \ uninstall-includeHEADERS uninstall-includelinuxHEADERS \ uninstall-libLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/davinci/davinci_osd_pool.c0000644000175000017500000002666611245562152017440 00000000000000/* TI Davinci driver - OSD0 FB Memory for direct RGB16 mode (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include "davincifb.h" #include "davinci_gfxdriver.h" D_DEBUG_DOMAIN( OSD_Surfaces, "OSD/Surfaces", "OSD Framebuffer Surface Pool" ); D_DEBUG_DOMAIN( OSD_SurfLock, "OSD/SurfLock", "OSD Framebuffer Surface Pool Locks" ); /**********************************************************************************************************************/ typedef struct { int magic; } OSDPoolData; typedef struct { int magic; CoreDFB *core; void *mem; unsigned long phys; } OSDPoolLocalData; typedef struct { int magic; int offset; int pitch; int size; } OSDAllocationData; /**********************************************************************************************************************/ static int osdPoolDataSize( void ) { return sizeof(OSDPoolData); } static int osdPoolLocalDataSize( void ) { return sizeof(OSDPoolLocalData); } static int osdAllocationDataSize( void ) { return sizeof(OSDAllocationData); } static DFBResult osdInitPool( CoreDFB *core, CoreSurfacePool *pool, void *pool_data, void *pool_local, void *system_data, CoreSurfacePoolDescription *ret_desc ) { OSDPoolData *data = pool_data; OSDPoolLocalData *local = pool_local; DavinciDriverData *ddrv = dfb_gfxcard_get_driver_data(); DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_DEBUG_AT( OSD_Surfaces, "%s()\n", __FUNCTION__ ); D_ASSERT( core != NULL ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_ASSERT( data != NULL ); D_ASSERT( local != NULL ); D_ASSERT( ret_desc != NULL ); ret_desc->caps = CSPCAPS_NONE; ret_desc->access = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE | CSAF_SHARED; ret_desc->types = CSTF_LAYER | CSTF_SHARED | CSTF_EXTERNAL; ret_desc->priority = CSPP_PREFERED; snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "OSD Pool" ); local->core = core; local->mem = ddrv->fb[OSD0].mem; local->phys = ddev->fix[OSD0].smem_start; D_MAGIC_SET( data, OSDPoolData ); D_MAGIC_SET( local, OSDPoolLocalData ); return DFB_OK; } static DFBResult osdJoinPool( CoreDFB *core, CoreSurfacePool *pool, void *pool_data, void *pool_local, void *system_data ) { OSDPoolData *data = pool_data; OSDPoolLocalData *local = pool_local; DavinciDriverData *ddrv = dfb_gfxcard_get_driver_data(); DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_DEBUG_AT( OSD_Surfaces, "%s()\n", __FUNCTION__ ); D_ASSERT( core != NULL ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, OSDPoolData ); D_ASSERT( local != NULL ); (void) data; local->core = core; local->mem = ddrv->fb[OSD0].mem; local->phys = ddev->fix[OSD0].smem_start; D_MAGIC_SET( local, OSDPoolLocalData ); return DFB_OK; } static DFBResult osdDestroyPool( CoreSurfacePool *pool, void *pool_data, void *pool_local ) { OSDPoolData *data = pool_data; OSDPoolLocalData *local = pool_local; D_DEBUG_AT( OSD_Surfaces, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, OSDPoolData ); D_MAGIC_ASSERT( local, OSDPoolLocalData ); D_MAGIC_CLEAR( data ); D_MAGIC_CLEAR( local ); return DFB_OK; } static DFBResult osdLeavePool( CoreSurfacePool *pool, void *pool_data, void *pool_local ) { OSDPoolData *data = pool_data; OSDPoolLocalData *local = pool_local; D_DEBUG_AT( OSD_Surfaces, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, OSDPoolData ); D_MAGIC_ASSERT( local, OSDPoolLocalData ); (void) data; D_MAGIC_CLEAR( local ); return DFB_OK; } static DFBResult osdTestConfig( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceBuffer *buffer, const CoreSurfaceConfig *config ) { CoreSurface *surface; OSDPoolData *data = pool_data; OSDPoolLocalData *local = pool_local; D_DEBUG_AT( OSD_Surfaces, "%s( %p )\n", __FUNCTION__, buffer ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, OSDPoolData ); D_MAGIC_ASSERT( local, OSDPoolLocalData ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); (void) data; (void) local; surface = buffer->surface; D_MAGIC_ASSERT( surface, CoreSurface ); if ((surface->type & CSTF_LAYER) && surface->resource_id == DLID_PRIMARY && surface->config.format == DSPF_RGB16) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult osdAllocateBuffer( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceBuffer *buffer, CoreSurfaceAllocation *allocation, void *alloc_data ) { CoreSurface *surface; OSDPoolData *data = pool_data; OSDPoolLocalData *local = pool_local; OSDAllocationData *alloc = alloc_data; DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_DEBUG_AT( OSD_Surfaces, "%s( %p )\n", __FUNCTION__, buffer ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, OSDPoolData ); D_MAGIC_ASSERT( local, OSDPoolLocalData ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); (void) data; (void) local; surface = buffer->surface; D_MAGIC_ASSERT( surface, CoreSurface ); if ((surface->type & CSTF_LAYER) && surface->resource_id == DLID_PRIMARY && surface->config.format == DSPF_RGB16) { int index = dfb_surface_buffer_index( buffer ); alloc->pitch = ddev->fix[OSD0].line_length; alloc->size = surface->config.size.h * alloc->pitch; alloc->offset = index * alloc->size; D_DEBUG_AT( OSD_Surfaces, " -> index %d, offset %d, pitch %d, size %d\n", index, alloc->offset, alloc->pitch, alloc->size ); allocation->size = alloc->size; allocation->offset = alloc->offset; D_MAGIC_SET( alloc, OSDAllocationData ); return DFB_OK; } return DFB_BUG; } static DFBResult osdDeallocateBuffer( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceBuffer *buffer, CoreSurfaceAllocation *allocation, void *alloc_data ) { OSDPoolData *data = pool_data; OSDAllocationData *alloc = alloc_data; D_DEBUG_AT( OSD_Surfaces, "%s( %p )\n", __FUNCTION__, buffer ); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( data, OSDPoolData ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); D_MAGIC_ASSERT( alloc, OSDAllocationData ); (void) data; D_MAGIC_CLEAR( alloc ); return DFB_OK; } static DFBResult osdLock( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceAllocation *allocation, void *alloc_data, CoreSurfaceBufferLock *lock ) { OSDPoolLocalData *local = pool_local; OSDAllocationData *alloc = alloc_data; DavinciDeviceData *ddev = dfb_gfxcard_get_device_data(); D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation ); D_MAGIC_ASSERT( alloc, OSDAllocationData ); D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); D_DEBUG_AT( OSD_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer ); int index = alloc->offset / alloc->size; int height = alloc->size / alloc->pitch; alloc->pitch = ddev->fix[OSD0].line_length; alloc->size = height * alloc->pitch; alloc->offset = index * alloc->size; allocation->size = alloc->size; allocation->offset = alloc->offset; lock->pitch = alloc->pitch; lock->offset = alloc->offset; lock->addr = local->mem + alloc->offset; lock->phys = local->phys + alloc->offset; D_DEBUG_AT( OSD_SurfLock, " -> offset %lu, pitch %d, addr %p, phys 0x%08lx\n", lock->offset, lock->pitch, lock->addr, lock->phys ); return DFB_OK; } static DFBResult osdUnlock( CoreSurfacePool *pool, void *pool_data, void *pool_local, CoreSurfaceAllocation *allocation, void *alloc_data, CoreSurfaceBufferLock *lock ) { OSDAllocationData *alloc = alloc_data; D_MAGIC_ASSERT( pool, CoreSurfacePool ); D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation ); D_MAGIC_ASSERT( alloc, OSDAllocationData ); D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); D_DEBUG_AT( OSD_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer ); (void) alloc; return DFB_OK; } const SurfacePoolFuncs davinciOSDSurfacePoolFuncs = { .PoolDataSize = osdPoolDataSize, .PoolLocalDataSize = osdPoolLocalDataSize, .AllocationDataSize = osdAllocationDataSize, .InitPool = osdInitPool, .JoinPool = osdJoinPool, .DestroyPool = osdDestroyPool, .LeavePool = osdLeavePool, .TestConfig = osdTestConfig, .AllocateBuffer = osdAllocateBuffer, .DeallocateBuffer = osdDeallocateBuffer, .Lock = osdLock, .Unlock = osdUnlock, }; DirectFB-1.2.10/gfxdrivers/davinci/davinci_video.h0000644000175000017500000000312411245562152016715 00000000000000/* TI Davinci driver - Video Layer (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_VIDEO_H__ #define __DAVINCI_VIDEO_H__ #include #include #define DAVINCI_VIDEO_SUPPORTED_OPTIONS (DLOP_NONE) typedef struct { struct fb_var_screeninfo var; bool enable; bool enabled; CoreLayerRegionConfig config; vpfe_resizer_params_t resizer; DFBDimension resized; DFBPoint offset; } DavinciVideoLayerData; extern const DisplayLayerFuncs davinciVideoLayerFuncs; #endif DirectFB-1.2.10/gfxdrivers/davinci/davinci_osd_pool.h0000644000175000017500000000236511245562152017433 00000000000000/* TI Davinci driver - OSD0 FB Memory for direct RGB16 mode (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_OSD_POOL_H__ #define __DAVINCI_OSD_POOL_H__ #include extern const SurfacePoolFuncs davinciOSDSurfacePoolFuncs; #endif DirectFB-1.2.10/gfxdrivers/davinci/davinci_c64x.c0000644000175000017500000014735711164361026016404 00000000000000/* TI Davinci driver - C64X+ DSP Library (c) Copyright 2008 directfb.org (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp and Olaf Dreesen . All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "davinci_c64x.h" /**********************************************************************************************************************/ #define C64X_DEVICE "/dev/c64x" #define C64X_DEVICE0 "/dev/c64x0" #define C64X_QLEN direct_page_align( sizeof(c64xTaskControl) ) #define C64X_MLEN direct_page_align( 0x2000000 ) __attribute__((noinline)) static void davinci_c64x_queue_error( DavinciC64x *c64x, const char *msg ) { c64xTaskControl *ctl = c64x->ctl; uint32_t dsp = ctl->QL_dsp; uint32_t arm = ctl->QL_arm; uint32_t armp = (arm-1) & C64X_QUEUE_MASK; c64xTask *dsp_task = &c64x->QueueL[dsp]; c64xTask *arm_task = &c64x->QueueL[arm]; c64xTask *armp_task = &c64x->QueueL[armp]; D_PERROR( "Davinci/C64X+: %s [DSP %d / %d (%s), ARM %d / %d (%s) <- %d / %d (%s)]\n", msg, dsp, (dsp_task->c64x_function >> 2) & 0x3fff, state_names[dsp_task->c64x_function & 3], arm, (arm_task->c64x_function >> 2) & 0x3fff, state_names[arm_task->c64x_function & 3], armp, (armp_task->c64x_function >> 2) & 0x3fff, state_names[armp_task->c64x_function & 3] ); } /* 1. Idle Case ARM ARM DSP DSP | . . . . . . . . | | . . . . . . . . | free = length-1 2. Busy Case (ARM after) ARM ARM DSP DSP | o . . . . . . . | | . o o . . . . . | free = length-1 - arm + dsp 3. Busy Case (ARM before) ARM ARM DSP DSP | . . . . . o o o | | o o . . . . . o | free = dsp - arm - 1 4. Full Case (ARM after) ARM DSP | o o o o o o o . | free = 0 5. Full Case (ARM before) ARM ARM DSP DSP | o o o o o . o o | | . o o o o o o o | free = 0 */ DFBResult davinci_c64x_emit_tasks( DavinciC64x *c64x, DavinciC64xTasks *tasks, DavinciC64xEmitFlags flags ) { c64xTaskControl *ctl = c64x->ctl; uint32_t arm = ctl->QL_arm; unsigned int emitted = 0; unsigned int timeout = 23; D_MAGIC_ASSERT( tasks, DavinciC64xTasks ); while (emitted < tasks->num_tasks) { uint32_t dsp = ctl->QL_dsp; int free; if (arm == dsp) free = C64X_QUEUE_LENGTH - 1; else if (arm > dsp) free = C64X_QUEUE_LENGTH - 1 - arm + dsp; else free = dsp - arm - 1; if (free) { int emit = MIN( free, tasks->num_tasks - emitted ); int copy = MIN( emit, C64X_QUEUE_LENGTH - arm ); memcpy( (void*) &c64x->QueueL[arm], (void*) &tasks->tasks[emitted], sizeof(c64xTask) * copy ); if (copy < emit) { memcpy( (void*) &c64x->QueueL[0], (void*) &tasks->tasks[emitted+copy], sizeof(c64xTask) * (emit - copy) ); arm = (emit - copy); } else arm = (arm + copy) & C64X_QUEUE_MASK; mb(); ctl->QL_arm = arm; mb(); emitted += emit; timeout = 23; } else { if (!timeout--) { davinci_c64x_queue_error( c64x, "Emit Timeout!" ); return DFB_TIMEOUT; } usleep( 7000 ); } } if (flags & C64X_TEF_RESET) tasks->num_tasks = 0; return DFB_OK; } DFBResult davinci_c64x_tasks_init( DavinciC64xTasks *tasks, unsigned int size ) { tasks->tasks = D_MALLOC( sizeof(c64xTask) * size ); if (!tasks->tasks) return D_OOM(); tasks->max_tasks = size; tasks->num_tasks = 0; D_MAGIC_SET( tasks, DavinciC64xTasks ); return DFB_OK; } DFBResult davinci_c64x_tasks_destroy( DavinciC64xTasks *tasks ) { D_MAGIC_ASSERT( tasks, DavinciC64xTasks ); D_ASSERT( tasks->tasks != NULL ); D_FREE( (void*) tasks->tasks ); tasks->tasks = NULL; D_MAGIC_CLEAR( tasks ); return DFB_OK; } DFBResult davinci_c64x_wait_low( DavinciC64x *c64x ) { DFBResult ret; c64xTaskControl *ctl = c64x->ctl; while (ctl->QL_dsp != ctl->QL_arm) { c64xTask *task = c64x_get_task( c64x ); task->c64x_function = C64X_FLAG_TODO | C64X_FLAG_INTERRUPT; c64x_submit_task( c64x, task ); if (ioctl( c64x->fd, C64X_IOCTL_WAIT_LOW )) { c64xTask *dsp_task = &c64x->QueueL[ctl->QL_dsp]; ret = errno2result( errno ); D_PERROR( "Davinci/C64X+: C64X_IOCTL_WAIT_LOW failed! [DSP %d / %d (%s), ARM %d / %d (%s)]\n", ctl->QL_dsp, (dsp_task->c64x_function >> 2) & 0x3fff, state_names[dsp_task->c64x_function & 3], ctl->QL_arm, (task->c64x_function >> 2) & 0x3fff, state_names[task->c64x_function & 3] ); return ret; } } return DFB_OK; } /**********************************************************************************************************************/ /* Benchmarking or Testing */ /**********************************************************************************************************************/ #if 1 #define BRINTF(x...) do { direct_log_printf( NULL, x ); } while (0) #else #define BRINTF(x...) printf( x ) #endif static void bench_mem( const char *name, void *ptr, int length, bool copy, bool from ) { int i, num; long long t1, t2, dt, total; char buf[0x100]; if (length > sizeof(buf)) length = sizeof(buf); num = 0x2000000 / length; t1 = direct_clock_get_abs_micros(); if (copy) { if (from) for (i=0; imem + 0x01000000; int *src = c64x->mem + 0x01100000; #if 0 src[num++] = DVA_BLOCK_WORD( 100, 0, 1 ); src[num++] = DVA_BLOCK_WORD( 200, 0, 0 ); src[num++] = DVA_BLOCK_WORD( 210, 1, 0 ); src[num++] = DVA_BLOCK_WORD( 220, 2, 1 ); src[num++] = DVA_BLOCK_WORD( 300, 0, 1 ); src[num++] = DVA_BLOCK_WORD( 400, 0, 0 ); src[num++] = DVA_BLOCK_WORD( 410, 1, 1 ); src[num++] = DVA_BLOCK_WORD( 500, 0, 0 ); src[num++] = DVA_BLOCK_WORD( 510, 63, 1 ); src[num++] = DVA_BLOCK_WORD( 600, 63, 1 ); #else src[num++] = DVA_BLOCK_WORD(136, 0, 0); src[num++] = DVA_BLOCK_WORD(-12, 8, 0); src[num++] = DVA_BLOCK_WORD(7, 16, 0); src[num++] = DVA_BLOCK_WORD(-2, 24, 1); src[num++] = DVA_BLOCK_WORD(136, 0, 0); src[num++] = DVA_BLOCK_WORD(-12, 8, 0); src[num++] = DVA_BLOCK_WORD(7, 16, 0); src[num++] = DVA_BLOCK_WORD(-2, 24, 1); src[num++] = DVA_BLOCK_WORD(1076, 0, 0); src[num++] = DVA_BLOCK_WORD(-204, 8, 0); src[num++] = DVA_BLOCK_WORD(-168, 16, 0); src[num++] = DVA_BLOCK_WORD(-129, 24, 0); src[num++] = DVA_BLOCK_WORD(-100, 32, 0); src[num++] = DVA_BLOCK_WORD(-40, 40, 0); src[num++] = DVA_BLOCK_WORD(-14, 48, 1); #if 1 src[num++] = DVA_BLOCK_WORD(1068, 0, 0); src[num++] = DVA_BLOCK_WORD(2, 1, 0); src[num++] = DVA_BLOCK_WORD(-202, 8, 0); src[num++] = DVA_BLOCK_WORD(-168, 16, 0); src[num++] = DVA_BLOCK_WORD(-2, 9, 0); src[num++] = DVA_BLOCK_WORD(-129, 24, 0); src[num++] = DVA_BLOCK_WORD(-97, 32, 0); src[num++] = DVA_BLOCK_WORD(-40, 40, 0); src[num++] = DVA_BLOCK_WORD(-13, 48, 1); #else src[num++] = DVA_BLOCK_WORD(1068, 0, 0); // src[num++] = DVA_BLOCK_WORD(2, 1, 0); src[num++] = DVA_BLOCK_WORD(-202, 8, 0); src[num++] = DVA_BLOCK_WORD(-1, 16, 0); // src[num++] = DVA_BLOCK_WORD(-2, 9, 0); src[num++] = DVA_BLOCK_WORD(-1, 24, 0); src[num++] = DVA_BLOCK_WORD(-97, 32, 1); // src[num++] = DVA_BLOCK_WORD(-40, 40, 0); // src[num++] = DVA_BLOCK_WORD(-13, 48, 1); #endif src[num++] = DVA_BLOCK_WORD(1048, 0, 0); src[num++] = DVA_BLOCK_WORD(-26, 8, 0); src[num++] = DVA_BLOCK_WORD(4, 16, 0); src[num++] = DVA_BLOCK_WORD(5, 24, 0); src[num++] = DVA_BLOCK_WORD(-4, 32, 1); src[num++] = DVA_BLOCK_WORD(996, 0, 0); src[num++] = DVA_BLOCK_WORD(24, 8, 0); src[num++] = DVA_BLOCK_WORD(-2, 24, 0); src[num++] = DVA_BLOCK_WORD(3, 32, 0); src[num++] = DVA_BLOCK_WORD(-4, 48, 1); #endif BRINTF("\n"); BRINTF("\n\n.======================== Testing load_block (dct_type_interlaced: %s) ========================.\n", dct_type_interlaced ? "yes" : "no"); BRINTF("\n"); BRINTF( "SOURCE (DVABlockWords)\n" ); BRINTF("\n"); for (i=0; i> 16, (src[i] >> 1) & 0x3f, src[i] & 1); BRINTF("\n\n"); memset( dst, 0x55, 0x100000 ); // test routine davinci_c64x_load_block( c64x, DAVINCI_C64X_MEM+0x01100000, 10, dct_type_interlaced ? 0x7f : 0x3f ); // copy idct buffer to memory where we can read it davinci_c64x_blit_16( c64x, DAVINCI_C64X_MEM+0x01000000, 0, 0xf065c0, 0, 16 * 24, 1 ); davinci_c64x_write_back_all( c64x ); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); BRINTF( "-> IDCT BUFFER (16x16 + [ 8x8 8x8 ] shorts)\n" ); BRINTF("\n"); for (i=0; i<16*24; i++) { BRINTF("%5d ", dst[i] ); if ((i&15)==15) { BRINTF("\n"); } if ((i&255)==255) { BRINTF("\n"); } } BRINTF("\n\n"); #if 1 s16 *blocks = c64x->mem + 0x01200000; int offset = 0; memset( blocks, 0, 1024 ); for (i=0; i> 1) & 0x3f)] = src[i] >> 16; if (src[i] & 1) offset += 64; } memset( dst, 0x55, 0x100000 ); // test routine for (i=0; i<6; i++) davinci_c64x_dva_idct( c64x, DAVINCI_C64X_MEM+0x01000000 + i*128, 16, DAVINCI_C64X_MEM+0x01200000 + i*128 ); davinci_c64x_write_back_all( c64x ); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); BRINTF( "-> SINGLE IDCT (59) BLOCKS (6x 8x8 shorts)\n" ); BRINTF("\n"); for (i=0; i<6*64; i++) { BRINTF("%5d ", dst[i] ); if ((i&7)==7) { BRINTF("\n"); } if ((i&63)==63) { BRINTF("\n"); } } BRINTF("\n\n"); #endif #if 0 // s16 blocks[384]; // int offset = 0; offset = 0; memset( blocks, 0, 1024 ); for (i=0; i> 1) & 0x3f)] = src[i] >> 16; if (src[i] & 1) { int n; for (n = 0; n < 8; n++) idct_row (blocks + offset + 8 * n); for (n = 0; n < 8; n++) idct_col (blocks + offset + n); offset += 64; } } BRINTF( "-> REFERENCE IDCT BLOCKS (6x 8x8 shorts)\n" ); BRINTF("\n"); for (i=0; i<6*64; i++) { BRINTF("%5d ", blocks[i] ); if ((i&7)==7) { BRINTF("\n"); } if ((i&63)==63) { BRINTF("\n"); } } BRINTF("\n\n"); #endif } static inline void bench_dezigzag( DavinciC64x *c64x ) { int i, num; long long t1, t2, dt, total; //int length = 0x10000; num = 0x200000;// / length; short *p = c64x->mem + 0x1000000; for (i=0; i<64; i++) { p[i] = i; BRINTF("%3d ", p[i]); if (i%8==7) { BRINTF("\n"); } } t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_DEZIGZAG | C64X_FLAG_TODO; task->c64x_arg[0] = (DAVINCI_C64X_MEM+0x01000000)+0x200000; task->c64x_arg[1] = (DAVINCI_C64X_MEM+0x01000000)+0x000000; //task->c64x_arg[2] = length/4; c64x_submit_task( c64x, task ); } davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); p = c64x->mem + 0x1200000; for (i=0; i<64; i++) { BRINTF("%3d ", p[i]); if (i%8==7) { BRINTF("\n"); } } dt = t2 - t1; total = num;// * length; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "de_zigzag()", total * 1000000ULL / dt ); } #define DUMP_PIXELS 1 static inline void bench_blend_argb( DavinciC64x *c64x, int sub ) { int i, num; long long t1, t2, dt, total; num = 1;//0x20000; u32 *src = c64x->mem + 0x1000000; u32 *dst = c64x->mem + 0x1200000; BRINTF( "\nTESTING BLEND_32 SUB %d\n", sub ); BRINTF( "\nSOURCE " ); for (i=0; i> 24, (src[i] >> 16) & 0xff, (src[i] >> 8) & 0xff, src[i] & 0xff); if (i%8==7) { BRINTF("\n"); } } BRINTF( "\nDESTINATION " ); for (i=0; i> 24, (dst[i] >> 16) & 0xff, (dst[i] >> 8) & 0xff, dst[i] & 0xff); if (i%8==7) { BRINTF("\n"); } } t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_BLEND_32 | C64X_FLAG_TODO | (sub << 16); task->c64x_arg[0] = (DAVINCI_C64X_MEM+0x01000000)+0x200000; task->c64x_arg[1] = 32; task->c64x_arg[2] = (DAVINCI_C64X_MEM+0x01000000)+0x000000; task->c64x_arg[3] = 32; task->c64x_arg[4] = 8; task->c64x_arg[5] = 8; task->c64x_arg[6] = 0x80; c64x_submit_task( c64x, task ); } davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF( "\n\nDESTINATION (AFTER) " ); for (i=0; i> 24, (dst[i] >> 16) & 0xff, (dst[i] >> 8) & 0xff, dst[i] & 0xff); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "blend_32(8x8)", total * 1000000ULL / dt ); } static inline void bench_fetch_uyvy( DavinciC64x *c64x, bool interleave, int xoff, int yoff ) { int i, x, y, num=1; long long t1, t2, dt, total; u8 *yuv = c64x->mem + 0x1000000; u8 *src = c64x->mem + 0x1200000; BRINTF("\n\n\n.======================== Testing fetch_uyvy (inter %d, xoff %d, yoff %d) ========================.\n\n", interleave, xoff, yoff); for (y=0; y<20; y++) { for (x=0; x<40; x++) { int val = (y*40)+x; src[y*1440 + x] = val; BRINTF("%02x ", val&0xff); } BRINTF("\n"); } BRINTF("\n"); memset( yuv, 0xAA, 0x100000 ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_arg[0] = (DAVINCI_C64X_MEM+0x01000000)+0x000000; task->c64x_arg[1] = (DAVINCI_C64X_MEM+0x01000000)+0x200000 + yoff*1440 + xoff * 2; task->c64x_arg[2] = 1440; task->c64x_function = (21 << 2) | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } davinci_c64x_write_back_all( c64x ); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF( "\n\nDESTINATION\n\nY:\n" ); for (y=0;y<27;y++) { if (y==18) BRINTF("\nUV:\n"); for (x=0;x<32;x++) { BRINTF("%02x ",yuv[y*32+x]); } BRINTF("\n"); } dt = t2 - t1; total = num; D_INFO("\n\nDavinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "blend_fetch_uyvy(16x16)", total * 1000000ULL / dt ); } #if 0 static inline void bench_fetch_uyvy( DavinciC64x *c64x, bool interleave, int xoff, int yoff ) { int i, x, y, num; long long t1, t2, dt, total; num = 1;//0x20000; u8 *yuv = c64x->mem + 0x1000000; u8 *src = c64x->mem + 0x1200000; BRINTF("\n"); BRINTF("\n\n.======================== Testing fetch_uyvy (inter %d, xoff %d, yoff %d) ========================.\n", interleave, xoff, yoff); BRINTF("\n"); BRINTF( "SOURCE (20x20)\n" ); for (y=0; y<20; y++) { for (x=0; x<40; x++) { int val = (x & 1) ? (x * 4 + y*0x10) : (x/4 + 0x40 + (x&2) * 0x10 + y*0x08); src[y*1440 + x] = val; BRINTF("%02x ", val&0xff); } BRINTF("\n"); } BRINTF("\n"); memset( yuv, 0x55, 0x100000 ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = (19 << 2) | C64X_FLAG_TODO; task->c64x_arg[0] = (DAVINCI_C64X_MEM+0x01000000)+0x000000; task->c64x_arg[1] = (DAVINCI_C64X_MEM+0x01000000)+0x200000 + yoff*1440 + xoff * 2; task->c64x_arg[2] = 1440; task->c64x_arg[3] = 16; task->c64x_arg[4] = interleave ? 1 : 0; c64x_submit_task( c64x, task ); } davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF( "\n\nDESTINATION (17x18 / [9x9 9x9])\n" ); for (y=0; y<18; y++) { for (x=0; x<17; x++) { BRINTF("%02x ", yuv[y*32 + x]); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<9; y++) { for (x=0; x<9; x++) { BRINTF("%02x ", yuv[y*32 + x + 32*18]); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<9; y++) { for (x=0; x<9; x++) { BRINTF("%02x ", yuv[y*32 + x + 32*18+16]); } BRINTF("\n"); } BRINTF("\n"); BRINTF("\n\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "blend_fetch_uyvy(16x16)", total * 1000000ULL / dt ); } #endif #if 0 static inline void bench_put_idct( DavinciC64x *c64x, int dct_type ) { int i, num; long long t1, t2, dt, total; //int length = 0x10000; num = 0x10000;// / length; u8 *dst = c64x->mem + 0x01000000; int *src = c64x->mem + 0x01200000; src[0] = DVA_BLOCK_WORD( 100, 0, 1 ); src[1] = DVA_BLOCK_WORD( 200, 0, 0 ); src[2] = DVA_BLOCK_WORD( 210, 1, 0 ); src[3] = DVA_BLOCK_WORD( 220, 2, 1 ); src[4] = DVA_BLOCK_WORD( 300, 0, 1 ); src[5] = DVA_BLOCK_WORD( 400, 0, 0 ); src[6] = DVA_BLOCK_WORD( 410, 1, 1 ); src[7] = DVA_BLOCK_WORD( 500, 0, 0 ); src[8] = DVA_BLOCK_WORD( 510, 63, 1 ); src[9] = DVA_BLOCK_WORD( 600, 63, 1 ); BRINTF("\n"); BRINTF("\n\n.======================== Testing put_idct (%d) ========================.\n", dct_type); BRINTF("\n"); memset( dst, 0x55, 0x100000 ); for (i=0; i<10; i++) { BRINTF("0x%08x (%d, %d, %d)\n", (u32)src[i], src[i] >> 16, (src[i] >> 1) & 0x3f, src[i] & 1); } BRINTF("\n"); t1 = direct_clock_get_abs_micros(); { c64xTask *task = c64x_get_task( c64x ); task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM+0x1200000; task->c64x_arg[1] = 10; task->c64x_arg[2] = 0x3f; c64x_submit_task( c64x, task ); } davinci_c64x_blit_16( c64x, (DAVINCI_C64X_MEM+0x01000000), 0, 0xf06180, 0, 384, 1 ); davinci_c64x_blit_16( c64x, (DAVINCI_C64X_MEM+0x01100000), 0, 0xf06480, 0, 384/2, 1 ); davinci_c64x_put_uyvy_16x16( c64x, (DAVINCI_C64X_MEM+0x01300000), 32, 0xf06180, 0 ); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); for (i=0; i<384; i++) { BRINTF("%5d ", dst[i] ); if (i%8==7) { BRINTF("\n"); } if (i%64==63) { BRINTF("\n"); } } BRINTF("\n\n"); for (i=0; i<384; i++) { BRINTF("%3d ", duv[i] ); if (i%8==7) { BRINTF("\n"); } if (i%64==63) { BRINTF("\n"); } } BRINTF("\n\n"); for (i=0; i<16*16*2; i++) { BRINTF("%02x ", duy[i]); if (i%32==31) { BRINTF("\n"); } } BRINTF("\n"); dt = t2 - t1; total = num;// * length; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "block_load()", total * 1000000ULL / dt ); } #endif static inline void bench_put_mc( DavinciC64x *c64x, bool interleave ) { int x, y, i, num; long long t1, t2, dt, total; num = 1;//720/16*576/16; u8 *dst = c64x->mem + 0x1000000; u8 *src = c64x->mem + 0x1200000; BRINTF("\n"); BRINTF("\n\n.======================== Testing put_mc (%d) ========================.\n", interleave); BRINTF("\n"); BRINTF("SOURCE (16x16 / [8x8 8x8]\n"); for (y=0; y<16; y++) { for (x=0; x<16; x++) { u8 val = (x << 4) + y; src[y*16 + x] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) { u8 val = (x << 4) + y*2; src[y*16 + x + 16*16] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) { u8 val = (x << 4) + y*2; src[y*16 + x + 16*16 + 8] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); memset( dst, 0x55, 0x100000 ); davinci_c64x_blit_32( c64x, C64X_MC_BUFFER_Y, 16, DAVINCI_C64X_MEM+0x1200000, 16, 4, 24 ); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM+0x1000000; task->c64x_arg[1] = 1440; task->c64x_arg[2] = interleave ? 1 : 0; c64x_submit_task( c64x, task ); } davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF("\n"); BRINTF("DESTINATION (16x16 UYVY)\n"); for (y=0; y<16; y++) { for (x=0; x<32; x++) BRINTF("%02x ", dst[y*1440 + x]); BRINTF("\n"); } BRINTF("\n\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "put_mc_16x16()", total * 1000000ULL / dt ); } static inline void bench_put_sum( DavinciC64x *c64x, bool interleave ) { int x, y, i, num; long long t1, t2, dt, total; num = 1;//720/16*576/16; u8 *dst = c64x->mem + 0x1000000; u8 *src = c64x->mem + 0x1200000; u32 *words = c64x->mem + 0x1100000; BRINTF("\n"); BRINTF("\n\n.======================== Testing put_sum (%d) ========================.\n", interleave); BRINTF("\n"); BRINTF("WORDS (6x IDCT with one value)\n"); words[0] = DVA_BLOCK_WORD( 0, 0, 1 ); words[1] = DVA_BLOCK_WORD( 50, 0, 1 ); words[2] = DVA_BLOCK_WORD( 100, 0, 1 ); words[3] = DVA_BLOCK_WORD( 150, 0, 1 ); words[4] = DVA_BLOCK_WORD( 200, 0, 1 ); words[5] = DVA_BLOCK_WORD( 250, 0, 1 ); BRINTF("\n"); BRINTF("\n"); memset( dst, 0x55, 0x100000 ); for (i=0; i<6; i++) { BRINTF("0x%08x (%d, %d, %d)\n", (u32)words[i], words[i] >> 16, (words[i] >> 1) & 0x3f, words[i] & 1); } { c64xTask *task = c64x_get_task( c64x ); task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM+0x1100000; task->c64x_arg[1] = 6; task->c64x_arg[2] = 0x3f; c64x_submit_task( c64x, task ); } BRINTF("\n"); BRINTF("SOURCE (16x16 / [8x8 8x8]\n"); for (y=0; y<16; y++) { for (x=0; x<16; x++) { u8 val = (x << 4) + y; src[y*16 + x] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) { u8 val = (x << 4) + y*2; src[y*16 + x + 16*16] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) { u8 val = (x << 4) + y*2; src[y*16 + x + 16*16 + 8] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); memset( dst, 0x55, 0x100000 ); davinci_c64x_blit_32( c64x, C64X_MC_BUFFER_Y, 16, DAVINCI_C64X_MEM+0x1200000, 16, 4, 24 ); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM+0x1000000; task->c64x_arg[1] = 1440; task->c64x_arg[2] = interleave ? 1 : 0; c64x_submit_task( c64x, task ); } davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF("\n"); BRINTF("DESTINATION (16x16 UYVY)\n"); for (y=0; y<16; y++) { for (x=0; x<32; x++) BRINTF("%02x ", dst[y*1440 + x]); BRINTF("\n"); } BRINTF("\n\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "put_sum_16x16()", total * 1000000ULL / dt ); } static inline void bench_sat_mc( DavinciC64x *c64x ) { int x, y, i, num; long long t1, t2, dt, total; num = 1;//720/16*576/16; u8 *dst = c64x->mem + 0x1000000; u8 *src = c64x->mem + 0x1200000; BRINTF("\n\n.======================== Testing sat_mc ========================.\n"); BRINTF("\n"); BRINTF("SOURCE (16x16 / [8x8 8x8]\n"); for (y=0; y<16; y++) { for (x=0; x<16; x++) { u8 val = (x << 4) + y; src[y*16 + x] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) { u8 val = (x << 4) + y*2; src[y*16 + x + 16*16] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) { u8 val = (x << 4) + y*2; src[y*16 + x + 16*16 + 8] = val; BRINTF("%02x ", val); } BRINTF("\n"); } BRINTF("\n"); memset( dst, 0x55, 0x100000 ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = (57 << 2) | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM+0x1000000; task->c64x_arg[1] = DAVINCI_C64X_MEM+0x1200000; task->c64x_arg[2] = 16; c64x_submit_task( c64x, task ); } davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF("\n"); BRINTF("DESTINATION (16x16 / [8x8 8x8]\n"); for (y=0; y<16; y++) { for (x=0; x<16; x++) BRINTF("%02x ", dst[y*16 + x]); BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) BRINTF("%02x ", dst[y*16 + x + 16*16]); BRINTF("\n"); } BRINTF("\n"); for (y=0; y<8; y++) { for (x=0; x<8; x++) BRINTF("%02x ", dst[y*16 + x + 16*16 + 8]); BRINTF("\n"); } BRINTF("\n\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "sat_mc_16x16()", total * 1000000ULL / dt ); } static inline void bench_uyvy_1( DavinciC64x *c64x, bool progressive ) { c64xTask *task; int i, num; long long t1, t2, dt, total; num = 720/16*576/16; u8 *u = c64x->mem + 0x1200000; u8 *p = c64x->mem + 0x1000000; BRINTF("\n\n\n.======================== Testing put_uyvy (%s) ========================.\n\n", progressive ? "progressive" : "interlaced"); for (i=0; i<256; i++) { p[i] = i - 128; BRINTF("Y%-3d ", p[i]); if (i%8==7) { BRINTF("\n"); } } for (i=0; i<64; i++) { p[256+i] = i-32; BRINTF("U%-3d ", p[256+i]); if (i%8==7) { BRINTF("\n"); } } for (i=0; i<64; i++) { p[320+i] = i-32; BRINTF("V%-3d ", p[320+i]); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n"); for (i=0; i<384; i++) { BRINTF("%4d ", p[i]); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n"); memset( u, 0x55, 720*576*2 ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO; task->c64x_arg[0] = (DAVINCI_C64X_MEM+0x01000000)+0x200000+i*16*16*2; task->c64x_arg[1] = 720 * 2; task->c64x_arg[2] = (DAVINCI_C64X_MEM+0x01000000); task->c64x_arg[3] = 0; c64x_submit_task( c64x, task ); } BRINTF("\n"); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); for (i=0; i<16*16*2; i++) { BRINTF("%02x ", u[i/32*720*2 + i%32]); if (i%32==31) { BRINTF("\n"); } } BRINTF("\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "put_uyvy_16x16()", total * 1000000ULL / dt ); } static inline void bench_uyvy_2( DavinciC64x *c64x, bool progressive ) { c64xTask *task; int i, num; long long t1, t2, dt, total; num = 1;//720/16*576/16; u8 *u = c64x->mem + 0x0200000; u8 *p = c64x->mem + 0x0000000; BRINTF("\n\n\n.======================== Testing put_uyvy (%s) ========================.\n\n", progressive ? "progressive" : "interlaced"); for (i=0; i<256; i++) { p[i] = i/8; BRINTF("Y%-3d ", p[i]); if (i%8==7) { BRINTF("\n"); } } for (i=0; i<64; i++) { p[256+i] = i/8 + 128; BRINTF("U%-3d ", p[256+i]); if (i%8==7) { BRINTF("\n"); } } for (i=0; i<64; i++) { p[320+i] = i/8 + 240; BRINTF("V%-3d ", p[320+i]); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n"); for (i=0; i<384; i++) { BRINTF("%4d ", p[i]); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n"); memset( u, 0x55, 720*576*2 ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM+0x200000+i*16*16*2; task->c64x_arg[1] = 720 * 2; task->c64x_arg[2] = DAVINCI_C64X_MEM; task->c64x_arg[3] = 0; c64x_submit_task( c64x, task ); } BRINTF("\n"); davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); for (i=0; i<16*16*2; i++) { BRINTF("%02x ", u[i/32*720*2 + i%32]); if (i%32==31) { BRINTF("\n"); } } BRINTF("\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "put_uyvy_16x16()", total * 1000000ULL / dt ); } static inline void bench_uyvy_3( DavinciC64x *c64x, bool progressive ) { c64xTask *task; int i, num; long long t1, t2, dt, total; num = 1;//720/16*576/16; u8 *u = c64x->mem + 0x1200000; u8 *p = c64x->mem + 0x1000000; BRINTF("\n\n\n.======================== Testing put_uyvy (%s) ========================.\n\n", progressive ? "progressive" : "interlaced"); for (i=0; i<256; i++) { p[i] = i%8; BRINTF("Y%-3d ", p[i]); if (i%8==7) { BRINTF("\n"); } } for (i=0; i<64; i++) { p[256+i] = i%8 + 128; BRINTF("U%-3d ", p[256+i]); if (i%8==7) { BRINTF("\n"); } } for (i=0; i<64; i++) { p[320+i] = i%8 + 240; BRINTF("V%-3d ", p[320+i]); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n"); for (i=0; i<384; i++) { BRINTF("%4d ", p[i]); if (i%8==7) { BRINTF("\n"); } } BRINTF("\n"); memset( u, 0x55, 720*576*2 ); t1 = direct_clock_get_abs_micros(); for (i=0; ic64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO; task->c64x_arg[0] = (DAVINCI_C64X_MEM+0x01000000)+0x200000+i*16*16*2; task->c64x_arg[1] = 720 * 2; task->c64x_arg[2] = (DAVINCI_C64X_MEM+0x01000000); task->c64x_arg[3] = 0; c64x_submit_task( c64x, task ); } BRINTF("\n"); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); for (i=0; i<16*16*2; i++) { BRINTF("%02x ", u[i/32*720*2 + i%32]); if (i%32==31) { BRINTF("\n"); } } BRINTF("\n"); dt = t2 - t1; total = num; D_INFO( "Davinci/C64X: BENCHMARK on DSP - %-15s %lld Calls/sec\n", "put_uyvy_16x16()", total * 1000000ULL / dt ); } static inline void bench_mc( DavinciC64x *c64x, int func, int w, int h, bool avg, const char *name ) { int i, x, y, num; long long t1, t2, dt, total; num = 0x1;//0000; u8 *dst = c64x->mem + 0x1200000; u8 *dsr = c64x->mem + 0x1100000; u8 *src = c64x->mem + 0x1000000; BRINTF("\n\n.============ Testing %s ============.\n", name); BRINTF("\n"); BRINTF("SRC REF\n"); for (y=0; yc64x_function = (func << 2) | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM + 0x01200000; task->c64x_arg[1] = 32; task->c64x_arg[2] = DAVINCI_C64X_MEM + 0x01000000; task->c64x_arg[3] = DAVINCI_C64X_MEM + 0x01100000; task->c64x_arg[4] = 32; task->c64x_arg[5] = h; c64x_submit_task( c64x, task ); } davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF("-> DST\n"); for (y=0; yc64x_function = (63 << 2) | C64X_FLAG_TODO; task->c64x_arg[0] = nom; task->c64x_arg[1] = den; c64x_submit_task( c64x, task ); davinci_c64x_wait_low( c64x ); BRINTF("%x / %x = %x\n\n\n", nom, den, task->c64x_return); } static inline void bench_dither_argb( DavinciC64x *c64x ) { int i, x, y, num, w = 8, h = 17; long long t1, t2, dt, total; num = 0x10000; u16 *dr = c64x->mem + 0x1200000; u8 *da = c64x->mem + 0x1100000; u32 *src = c64x->mem + 0x1000000; BRINTF("\n\n.======================== Testing dither_argb ========================.\n"); BRINTF("\n"); BRINTF("SOURCE ARGB\n"); for (y=0; yc64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM + 0x01200000; task->c64x_arg[1] = DAVINCI_C64X_MEM + 0x01100000; task->c64x_arg[2] = 64; task->c64x_arg[3] = DAVINCI_C64X_MEM + 0x01000000; task->c64x_arg[4] = 128; task->c64x_arg[5] = w; task->c64x_arg[6] = h; c64x_submit_task( c64x, task ); } davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF("-> DST RGB\n"); for (y=0; y DST ALPHA\n"); for (y=0; y> 4); } BRINTF("\n"); } BRINTF("\n"); dt = t2 - t1; total = num; BRINTF( "BENCHMARK on DSP - %-15s %lld Calls/sec\n", "dither_argb", total * 1000000ULL / dt ); } /**********************************************************************************************************************/ /*** 32 bit scaler ****************************************************************************************************/ /**********************************************************************************************************************/ typedef struct { DFBRegion clip; const void *colors; ulong protect; ulong key; } StretchCtx; typedef void (*StretchHVx)( void *dst, int dpitch, const void *src, int spitch, int width, int height, int dst_width, int dst_height, const StretchCtx *ctx ); #define STRETCH_NONE 0 #define STRETCH_SRCKEY 1 #define STRETCH_PROTECT 2 #define STRETCH_SRCKEY_PROTECT 3 #define STRETCH_NUM 4 typedef struct { struct { StretchHVx up[STRETCH_NUM]; StretchHVx down[STRETCH_NUM]; } f[DFB_NUM_PIXELFORMATS]; } StretchFunctionTable; #define DST_FORMAT DSPF_ARGB #define TABLE_NAME stretch_32 #define FUNC_NAME(UPDOWN,K,P,F) stretch_32_ ## UPDOWN ## _ ## K ## P ## _ ## F #define SHIFT_R8 8 #define SHIFT_L8 8 #define X_00FF00FF 0x00ff00ff #define X_FF00FF00 0xff00ff00 #define MASK_RGB 0x00ffffff #define HAS_ALPHA #include #undef DST_FORMAT #undef TABLE_NAME #undef FUNC_NAME #undef SHIFT_R8 #undef SHIFT_L8 #undef X_00FF00FF #undef X_FF00FF00 #undef MASK_RGB #undef HAS_ALPHA static inline void bench_stretch_32( DavinciC64x *c64x, int sw, int sh, int dw, int dh ) { int i, x, y, num; long long t1, t2, dt, total; bool down = (dw < sw) && (dh < sh); #if 0 int SW = (sw + 5) & ~3; int SH = (sh + 5) & ~3; int DW = (dw + 5) & ~3; int DH = (dh + 5) & ~3; #else int SW = sw; int SH = sh; int DW = dw; int DH = dh; #endif num = 1;//0x10000; u32 cpu[DW * DH]; u32 *dst = c64x->mem + 0x1200000; u32 *src = c64x->mem + 0x1000000; memset( src, 0x55, 0x100000 ); for (y=0; y %dx%d ) ========================.\n", sw, sh, dw, dh); BRINTF("\n"); BRINTF("SOURCE IMAGE (%dx%d) [%dx%d]\n", sw, sh, SW, SH); for (y=0; yc64x_function = (down ? C64X_STRETCH_32_down : C64X_STRETCH_32_up ) | C64X_FLAG_TODO; task->c64x_arg[0] = DAVINCI_C64X_MEM + 0x1200000; task->c64x_arg[1] = DAVINCI_C64X_MEM + 0x1000000; task->c64x_arg[2] = (DW * 4) | ((SW * 4) << 16); task->c64x_arg[3] = dh | (dw << 16); task->c64x_arg[4] = sh | (sw << 16); task->c64x_arg[5] = (dw - 1) | ((dh - 1) << 16); task->c64x_arg[6] = 0 | (0 << 16); c64x_submit_task( c64x, task ); } davinci_c64x_write_back_all( c64x ); davinci_c64x_wait_low( c64x ); t2 = direct_clock_get_abs_micros(); BRINTF("-> DSP RESULT (%dx%d) [%dx%d]\n", dw, dh, DW, DH); for (y=0; y CPU RESULT (%dx%d) [%dx%d]\n", dw, dh, DW, DH); for (y=0; yfd = fd; c64x->ctl = map_q; c64x->mem = map_m; c64x->QueueL = map_m + 0x01e00000; D_INFO( "Davinci/C64X: Low ARM %d / DSP %d, High ARM %d / DSP %d\n", c64x->ctl->QL_arm, c64x->ctl->QL_dsp, c64x->ctl->QH_arm, c64x->ctl->QH_dsp ); D_MAGIC_SET( c64x, DavinciC64x ); if (getenv("C64X_TEST")) { // test_load_block( c64x, false ); // test_load_block( c64x, true ); // bench_dither_argb( c64x ); #if 0 bench_uyvy_1( c64x, true ); bench_uyvy_1( c64x, false ); bench_uyvy_2( c64x, true ); bench_uyvy_2( c64x, false ); bench_uyvy_3( c64x, true ); bench_uyvy_3( c64x, false ); #endif #if 0 bench_blend_argb( c64x, 0 ); bench_blend_argb( c64x, 1 ); bench_blend_argb( c64x, 2 ); bench_blend_argb( c64x, 3 ); #endif #if 0 bench_stretch_32( c64x, 2, 1, 16, 1 ); bench_stretch_32( c64x, 2, 2, 16, 2 ); bench_stretch_32( c64x, 2, 1, 3, 1 ); bench_stretch_32( c64x, 4, 1, 6, 1 ); bench_stretch_32( c64x, 3, 1, 2, 1 ); bench_stretch_32( c64x, 6, 1, 4, 1 ); #endif #if 1 bench_fetch_uyvy( c64x, false, 0, 0 ); bench_fetch_uyvy( c64x, false, 1, 0 ); bench_fetch_uyvy( c64x, false, 0, 1 ); bench_fetch_uyvy( c64x, false, 1, 1 ); bench_fetch_uyvy( c64x, true, 0, 0 ); bench_fetch_uyvy( c64x, true, 1, 0 ); bench_fetch_uyvy( c64x, true, 0, 1 ); bench_fetch_uyvy( c64x, true, 1, 1 ); #endif #if 0 bench_put_mc( c64x, false ); bench_put_mc( c64x, true ); bench_put_sum( c64x, false ); bench_put_sum( c64x, true ); bench_sat_mc( c64x ); #endif #if 0 bench_mc( c64x, 32, 8, 8, false, "mc_put_o_8" ); bench_mc( c64x, 33, 8, 8, false, "mc_put_x_8" ); bench_mc( c64x, 34, 8, 8, false, "mc_put_y_8" ); bench_mc( c64x, 35, 8, 8, false, "mc_put_xy_8" ); bench_mc( c64x, 36, 16, 16, false, "mc_put_o_16" ); bench_mc( c64x, 37, 16, 16, false, "mc_put_x_16" ); bench_mc( c64x, 38, 16, 16, false, "mc_put_y_16" ); bench_mc( c64x, 39, 16, 16, false, "mc_put_xy_16" ); #endif #if 0 bench_mc( c64x, 40, 8, 8, true, "mc_avg_o_8" ); bench_mc( c64x, 41, 8, 8, true, "mc_avg_x_8" ); bench_mc( c64x, 42, 8, 8, true, "mc_avg_y_8" ); bench_mc( c64x, 43, 8, 8, true, "mc_avg_xy_8" ); bench_mc( c64x, 44, 16, 16, true, "mc_avg_o_16" ); bench_mc( c64x, 45, 16, 16, true, "mc_avg_x_16" ); bench_mc( c64x, 46, 16, 16, true, "mc_avg_y_16" ); bench_mc( c64x, 47, 16, 16, true, "mc_avg_xy_16" ); #endif #if 0 bench_div( c64x, 1, 3 ); bench_div( c64x, 1000, 333 ); bench_div( c64x, 1000, 334 ); bench_div( c64x, 6666, 2222 ); bench_div( c64x, 1234, 1234 ); bench_div( c64x, 4000, 0 ); bench_div( c64x, 5000, 0 ); bench_div( c64x, 10000, 3 ); bench_div( c64x, 14, 3 ); bench_div( c64x, 0x10000, 0x1000 ); bench_div( c64x, 0x1000, 0x100 ); bench_div( c64x, 0x100000, 2 ); #endif } return DFB_OK; error: if (map_q) munmap( map_q, C64X_QLEN ); close( fd ); return ret; } DFBResult davinci_c64x_close( DavinciC64x *c64x ) { D_MAGIC_ASSERT( c64x, DavinciC64x ); munmap( (void*) c64x->mem, C64X_MLEN ); munmap( (void*) c64x->ctl, C64X_QLEN ); close( c64x->fd ); D_MAGIC_CLEAR( c64x ); return DFB_OK; } DirectFB-1.2.10/gfxdrivers/davinci/Makefile.kernel0000644000175000017500000000033411164361026016655 00000000000000CROSS_COMPILE = arm-v4t-linux-gnueabi- KERNEL_SOURCE = $(shell pwd)/../../../linux-davinci-2.6 KERNEL_BUILD = $(KERNEL_SOURCE) all: $(MAKE) -C kernel-module KERNEL_SOURCE=$(KERNEL_SOURCE) KERNEL_BUILD=$(KERNEL_BUILD) DirectFB-1.2.10/gfxdrivers/davinci/davinci_video_pool.h0000644000175000017500000000237211245562152017752 00000000000000/* TI Davinci driver - VID1 FB Memory for direct UYVY mode (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_VIDEO_POOL_H__ #define __DAVINCI_VIDEO_POOL_H__ #include extern const SurfacePoolFuncs davinciVideoSurfacePoolFuncs; #endif DirectFB-1.2.10/gfxdrivers/davinci/davinci_c64x.h0000644000175000017500000007072611164361026016404 00000000000000/* TI Davinci driver - C64X+ DSP Library (c) Copyright 2008 directfb.org (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp and Olaf Dreesen . All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_C64X_H__ #define __DAVINCI_C64X_H__ #include #include #include #include #include #define mb() __asm__ __volatile__ ("" : : : "memory") /**********************************************************************************************************************/ typedef struct { int magic; int fd; c64xTaskControl *ctl; void *mem; c64xTask *QueueL; } DavinciC64x; typedef struct { int magic; unsigned int max_tasks; unsigned int num_tasks; c64xTask *tasks; } DavinciC64xTasks; typedef enum { C64X_TEF_NONE = 0x0000, C64X_TEF_RESET = 0x0001 } DavinciC64xEmitFlags; /**********************************************************************************************************************/ DFBResult davinci_c64x_open ( DavinciC64x *c64x ); DFBResult davinci_c64x_close ( DavinciC64x *c64x ); DFBResult davinci_c64x_wait_low( DavinciC64x *c64x ); /**********************************************************************************************************************/ DFBResult davinci_c64x_tasks_init ( DavinciC64xTasks *tasks, unsigned int size ); DFBResult davinci_c64x_tasks_destroy( DavinciC64xTasks *tasks ); /**********************************************************************************************************************/ DFBResult davinci_c64x_emit_tasks( DavinciC64x *c64x, DavinciC64xTasks *tasks, DavinciC64xEmitFlags flags ); /**********************************************************************************************************************/ static const char *state_names[] = { "DONE", "ERROR", "TODO", "RUNNING" }; static inline c64xTask * c64x_get_task( DavinciC64x *c64x ) { c64xTaskControl *ctl = c64x->ctl; uint32_t idx = ctl->QL_arm; uint32_t next = (idx + 1) & C64X_QUEUE_MASK; c64xTask *task = &c64x->QueueL[idx]; int loops = 0; uint32_t idle = 0; /* Wait for the entry (and next) to be processed by the DSP (rare case). */ while (task->c64x_flags & C64X_FLAG_TODO || ctl->QL_dsp == next) { if (loops > 666 || (idle && ctl->idlecounter - idle > 666)) { c64xTask *dsp_task = &c64x->QueueL[ctl->QL_dsp]; D_PERROR( "Davinci/C64X+: Blocked! [DSP %d / %d (%s), ARM %d / %d (%s)]\n", ctl->QL_dsp, (dsp_task->c64x_function >> 2) & 0x3fff, state_names[dsp_task->c64x_function & 3], ctl->QL_arm, (task->c64x_function >> 2) & 0x3fff, state_names[task->c64x_function & 3] ); break; } idle = ctl->idlecounter; /* Queue is full, waiting 10-20ms should not be too bad. */ if (loops++ > 10) usleep( 5000 ); } return task; } static inline void c64x_submit_task( DavinciC64x *c64x, c64xTask *task ) { c64xTaskControl *ctl = c64x->ctl; uint32_t idx = ctl->QL_arm; uint32_t next = (idx + 1) & C64X_QUEUE_MASK; mb(); ctl->QL_arm = next; mb(); } /**********************************************************************************************************************/ static inline void davinci_c64x_wb_inv_range( DavinciC64x *c64x, unsigned long start, u32 length, u32 func ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = start; task->c64x_arg[1] = length; task->c64x_arg[2] = func; task->c64x_function = C64X_WB_INV_RANGE | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_write_back_all( DavinciC64x *c64x ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_function = C64X_WRITE_BACK_ALL | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } /**********************************************************************************************************************/ static inline void davinci_c64x_load_block__L( DavinciC64xTasks *tasks, unsigned long words, u32 num, u32 flags ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = words; task->c64x_arg[1] = num; task->c64x_arg[2] = flags; task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_load_block( DavinciC64x *c64x, unsigned long words, u32 num, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = words; task->c64x_arg[1] = num; task->c64x_arg[2] = flags; task->c64x_function = C64X_LOAD_BLOCK | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_fetch_uyvy( DavinciC64x *c64x, unsigned long dest, unsigned long source, u32 pitch, u32 height, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = source; task->c64x_arg[2] = pitch; task->c64x_arg[3] = height; task->c64x_arg[4] = flags; task->c64x_function = C64X_FETCH_UYVY | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_mc( DavinciC64x *c64x, unsigned long dest, u32 dpitch, unsigned long source0, unsigned long source1, u32 spitch, u32 height, int func ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = source0; task->c64x_arg[3] = source1; task->c64x_arg[4] = spitch; task->c64x_arg[5] = height; task->c64x_function = func | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_put_idct_uyvy_16x16__L( DavinciC64xTasks *tasks, unsigned long dest, u32 pitch, u32 flags ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = flags; task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_put_idct_uyvy_16x16( DavinciC64x *c64x, unsigned long dest, u32 pitch, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = flags; task->c64x_function = C64X_PUT_IDCT_UYVY_16x16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_put_mc_uyvy_16x16__L( DavinciC64xTasks *tasks, unsigned long dest, u32 pitch, u32 flags ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = flags; task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_put_mc_uyvy_16x16( DavinciC64x *c64x, unsigned long dest, u32 pitch, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = flags; task->c64x_function = C64X_PUT_MC_UYVY_16x16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_put_sum_uyvy_16x16__L( DavinciC64xTasks *tasks, unsigned long dest, u32 pitch, u32 flags ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = flags; task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_put_sum_uyvy_16x16( DavinciC64x *c64x, unsigned long dest, u32 pitch, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = flags; task->c64x_function = C64X_PUT_SUM_UYVY_16x16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_dva_begin_frame__L( DavinciC64xTasks *tasks, u32 pitch, unsigned long current, unsigned long past, unsigned long future, u32 flags ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = pitch; task->c64x_arg[1] = current; task->c64x_arg[2] = past; task->c64x_arg[3] = future; task->c64x_arg[4] = flags; task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_dva_begin_frame( DavinciC64x *c64x, u32 pitch, unsigned long current, unsigned long past, unsigned long future, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = pitch; task->c64x_arg[1] = current; task->c64x_arg[2] = past; task->c64x_arg[3] = future; task->c64x_arg[4] = flags; task->c64x_function = C64X_DVA_BEGIN_FRAME | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_dva_motion_block__L( DavinciC64xTasks *tasks, unsigned long macroblock ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = macroblock; task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_dva_motion_block( DavinciC64x *c64x, unsigned long macroblock ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = macroblock; task->c64x_function = C64X_DVA_MOTION_BLOCK | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } /**********************************************************************************************************************/ static inline void davinci_c64x_dva_idct( DavinciC64x *c64x, unsigned long dest, u32 pitch, unsigned long source ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = source; task->c64x_function = C64X_DVA_IDCT | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } /**********************************************************************************************************************/ static inline void davinci_c64x_put_uyvy_16x16( DavinciC64x *c64x, unsigned long dest, u32 pitch, unsigned long source, u32 flags ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = source; task->c64x_arg[3] = flags; task->c64x_function = C64X_PUT_UYVY_16x16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_dither_argb__L( DavinciC64xTasks *tasks, unsigned long dst_rgb, unsigned long dst_alpha, u32 dst_pitch, unsigned long source, u32 src_pitch, u32 width, u32 height ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dst_rgb; task->c64x_arg[1] = dst_alpha; task->c64x_arg[2] = dst_pitch; task->c64x_arg[3] = source; task->c64x_arg[4] = src_pitch; task->c64x_arg[5] = width; task->c64x_arg[6] = height; task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_dither_argb( DavinciC64x *c64x, unsigned long dst_rgb, unsigned long dst_alpha, u32 dst_pitch, unsigned long source, u32 src_pitch, u32 width, u32 height ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dst_rgb; task->c64x_arg[1] = dst_alpha; task->c64x_arg[2] = dst_pitch; task->c64x_arg[3] = source; task->c64x_arg[4] = src_pitch; task->c64x_arg[5] = width; task->c64x_arg[6] = height; task->c64x_function = C64X_DITHER_ARGB | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_fill_16__L( DavinciC64xTasks *tasks, unsigned long dest, u32 pitch, u32 width, u32 height, u32 value ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = width; task->c64x_arg[3] = height; task->c64x_arg[4] = value; task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_fill_16( DavinciC64x *c64x, unsigned long dest, u32 pitch, u32 width, u32 height, u32 value ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = width; task->c64x_arg[3] = height; task->c64x_arg[4] = value; task->c64x_function = C64X_FILL_16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_fill_32__L( DavinciC64xTasks *tasks, unsigned long dest, u32 pitch, u32 width, u32 height, u32 value ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = width; task->c64x_arg[3] = height; task->c64x_arg[4] = value; task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_fill_32( DavinciC64x *c64x, unsigned long dest, u32 pitch, u32 width, u32 height, u32 value ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = pitch; task->c64x_arg[2] = width; task->c64x_arg[3] = height; task->c64x_arg[4] = value; task->c64x_function = C64X_FILL_32 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_blit_16__L( DavinciC64xTasks *tasks, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = src; task->c64x_arg[3] = spitch; task->c64x_arg[4] = width; task->c64x_arg[5] = height; task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_blit_16( DavinciC64x *c64x, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = src; task->c64x_arg[3] = spitch; task->c64x_arg[4] = width; task->c64x_arg[5] = height; task->c64x_function = C64X_COPY_16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_blit_32__L( DavinciC64xTasks *tasks, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = src; task->c64x_arg[3] = spitch; task->c64x_arg[4] = width; task->c64x_arg[5] = height; task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_blit_32( DavinciC64x *c64x, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = src; task->c64x_arg[3] = spitch; task->c64x_arg[4] = width; task->c64x_arg[5] = height; task->c64x_function = C64X_COPY_32 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_stretch_32__L( DavinciC64xTasks *tasks, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 dw, u32 dh, u32 sw, u32 sh, const DFBRegion *clip ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = src; task->c64x_arg[2] = dpitch | (spitch << 16); task->c64x_arg[3] = dh | (dw << 16); task->c64x_arg[4] = sh | (sw << 16); task->c64x_arg[5] = clip->x2 | (clip->y2 << 16); task->c64x_arg[6] = clip->x1 | (clip->y1 << 16); if (sw > dw && sh > dh) task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO; else task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_stretch_32( DavinciC64x *c64x, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 dw, u32 dh, u32 sw, u32 sh, const DFBRegion *clip ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = src; task->c64x_arg[2] = dpitch | (spitch << 16); task->c64x_arg[3] = dh | (dw << 16); task->c64x_arg[4] = sh | (sw << 16); task->c64x_arg[5] = clip->x2 | (clip->y2 << 16); task->c64x_arg[6] = clip->x1 | (clip->y1 << 16); if (sw > dw && sh > dh) task->c64x_function = C64X_STRETCH_32_down | C64X_FLAG_TODO; else task->c64x_function = C64X_STRETCH_32_up | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_blit_blend_32__L( DavinciC64xTasks *tasks, u32 sub_func, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height, u32 argb, u8 alpha ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = src; task->c64x_arg[3] = spitch; task->c64x_arg[4] = width | (height << 16); task->c64x_arg[5] = argb; task->c64x_arg[6] = alpha; task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_blit_blend_32( DavinciC64x *c64x, u32 sub_func, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height, u32 argb, u8 alpha ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = dpitch; task->c64x_arg[2] = src; task->c64x_arg[3] = spitch; task->c64x_arg[4] = width | (height << 16); task->c64x_arg[5] = argb; task->c64x_arg[6] = alpha; task->c64x_function = (sub_func << 16) | C64X_BLEND_32 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_blit_keyed_16__L( DavinciC64xTasks *tasks, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height, u32 key, u32 mask ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff); task->c64x_arg[2] = src; task->c64x_arg[3] = width; task->c64x_arg[4] = height; task->c64x_arg[5] = key; task->c64x_arg[6] = mask; task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_blit_keyed_16( DavinciC64x *c64x, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height, u32 key, u32 mask ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff); task->c64x_arg[2] = src; task->c64x_arg[3] = width; task->c64x_arg[4] = height; task->c64x_arg[5] = key; task->c64x_arg[6] = mask; task->c64x_function = C64X_COPY_KEYED_16 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } static inline void davinci_c64x_blit_keyed_32__L( DavinciC64xTasks *tasks, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height, u32 key, u32 mask ) { c64xTask *task = &tasks->tasks[tasks->num_tasks]; D_ASSERT( tasks->num_tasks < tasks->max_tasks ); task->c64x_arg[0] = dest; task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff); task->c64x_arg[2] = src; task->c64x_arg[3] = width; task->c64x_arg[4] = height; task->c64x_arg[5] = key; task->c64x_arg[6] = mask; task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO; tasks->num_tasks++; } static inline void davinci_c64x_blit_keyed_32( DavinciC64x *c64x, unsigned long dest, u32 dpitch, unsigned long src, u32 spitch, u32 width, u32 height, u32 key, u32 mask ) { c64xTask *task = c64x_get_task( c64x ); task->c64x_arg[0] = dest; task->c64x_arg[1] = (dpitch << 16) | (spitch & 0xffff); task->c64x_arg[2] = src; task->c64x_arg[3] = width; task->c64x_arg[4] = height; task->c64x_arg[5] = key; task->c64x_arg[6] = mask; task->c64x_function = C64X_COPY_KEYED_32 | C64X_FLAG_TODO; c64x_submit_task( c64x, task ); } #endif DirectFB-1.2.10/gfxdrivers/davinci/davinci_screen.h0000644000175000017500000000230311245562152017064 00000000000000/* TI Davinci driver - Primary Screen (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_SCREEN_H__ #define __DAVINCI_SCREEN_H__ #include extern ScreenFuncs davinciScreenFuncs; #endif DirectFB-1.2.10/gfxdrivers/davinci/patches/0000777000175000017500000000000011307522570015453 500000000000000DirectFB-1.2.10/gfxdrivers/davinci/patches/ti-davinci-2.6.10-mvl401-fbio_set_start.patch0000644000175000017500000000602011164361026025203 00000000000000Index: include/video/davincifb.h =================================================================== --- include/video/davincifb.h (revision 765) +++ include/video/davincifb.h (working copy) @@ -40,6 +40,21 @@ u_int32_t zoom_v; } zoom_params_t; + +typedef struct fb_set_start { + int offset; /* offset from smem_start */ + unsigned long physical; /* absolute physical address when offset < 0 */ + + u_int64_t sync; /* input: target sync counter for change or 0 for no sync at all, + output: sync counter of actual change or 0 if still pending */ +} fb_set_start_t; + + +#ifdef _IOC_TYPECHECK +#undef _IOC_TYPECHECK +#define _IOC_TYPECHECK(x) (sizeof(x)) +#endif + #define RAM_CLUT_SIZE 256*3 #define FBIO_ENABLE_DISABLE_WIN \ _IOW('F', 0x30, unsigned char) @@ -83,6 +98,8 @@ _IOW('F', 0x49, u_int32_t) #define FBIO_SET_CURSOR \ _IOW('F', 0x50, struct fb_cursor) +#define FBIO_SET_START \ + _IOW('F', 0x66, struct fb_set_start) /* * Defines and Constants Index: drivers/video/davincifb.c =================================================================== --- drivers/video/davincifb.c (revision 765) +++ drivers/video/davincifb.c (working copy) @@ -1095,6 +1095,58 @@ return 0; } +static int +davincifb_set_start( struct fb_set_start *set, struct fb_info *info ) +{ + struct vpbe_dm_win_info *win = (struct vpbe_dm_win_info *) info->par; + unsigned long start = 0; + + /* Physical mode (absolute address)? */ + if (set->offset < 0) { + start = set->physical; + + /* FIXME: address checks */ + } + else { + /* Offset mode (from frame buffer device base). */ + if (set->offset + info->var.yres * info->fix.line_length >= win->fb_size) + return -EFAULT; + + start = win->fb_base_phys + set->offset; + } + + /* Set on explicit sync count? */ + if (set->sync > 1) { + if (set->sync <= dm->vsync_cnt) { + set_sdram_params( info->fix.id, start, info->fix.line_length ); + win->sdram_address = start; + + set->sync = dm->vsync_cnt; + } + else { + /* FIXME: No queue yet. */ + win->sdram_address = start; + + set->sync = 0; + } + } + /* Set on next sync? */ + else if (set->sync) { + win->sdram_address = start; + + set->sync = 0; + } + /* Set now! */ + else { + set_sdram_params( info->fix.id, start, info->fix.line_length ); + win->sdram_address = start; + + set->sync = dm->vsync_cnt; + } + + return 0; +} + /* * davincifb_ioctl - handler for private ioctls. */ @@ -1105,6 +1157,7 @@ struct vpbe_dm_win_info *w = (struct vpbe_dm_win_info *)info->par; void __user *argp = (void __user *)arg; struct fb_fillrect rect; + struct fb_set_start set_start; zoom_params_t zoom; int retval = 0; long std = 0; @@ -1414,6 +1467,16 @@ return -EINVAL; break; + case FBIO_SET_START: + if (copy_from_user(&set_start, argp, sizeof(set_start))) + return -EFAULT; + retval = davincifb_set_start( &set_start, &w->info ); + if (retval) + return retval; + if (copy_to_user(argp, &set_start, sizeof(set_start))) + return -EFAULT; + break; + default: retval = -EINVAL; break; DirectFB-1.2.10/gfxdrivers/davinci/directfbrc0000644000175000017500000000166111164361026015774 00000000000000# # WM/System wm = sawman system = devmem video-phys = 87000000 video-length = 16777216 # # Use 640x480 by default (all visible) mode = 640x480 # # Shared Memory Mount Point tmpfs = /tmp # # Disable Cursor no-cursor # # Disable Layer Initialization no-init-layer = 0 # # Graphics Layer #init-layer = 0 #layer-size = 720x576 #layer-format = RGB16 #layer-stacking = middle,upper #layer-bg-color = 000000 #layer-src-key = 000000 #layer-buffer-mode = backvideo # # Video Layer #init-layer = 1 #layer-size = 720x576 #layer-format = UYVY #layer-stacking = lower #layer-bg-color = 0000ff #layer-buffer-mode = frontonly #layer-bg-image = /usr/local/share/images/bg_flower.jpg # # Scaling smooth-upscale smooth-downscale # # Debug domains #debug = Davinci/OSD #debug = LiTE/Window #debug = SaWMan/Auto #debug = Core/GraphicsOps #debug = Core/Layers #debug = Core/Surface DirectFB-1.2.10/gfxdrivers/davinci/davinci_osd.c0000644000175000017500000005625611245562152016405 00000000000000/* TI Davinci driver - Graphics Layer (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include #include #include #include #include "davincifb.h" #include "davinci_gfxdriver.h" #include "davinci_osd.h" #define D_OSDERROR(x...) do {} while (0) D_DEBUG_DOMAIN( Davinci_OSD, "Davinci/OSD", "TI Davinci OSD" ); /**********************************************************************************************************************/ static int osdLayerDataSize( void ) { return sizeof(DavinciOSDLayerData); } static DFBResult osdInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { int ret; DavinciDriverData *ddrv = driver_data; DavinciOSDLayerData *dosd = layer_data; D_DEBUG_AT( Davinci_OSD, "%s()\n", __FUNCTION__ ); ret = ioctl( ddrv->fb[OSD0].fd, FBIOGET_VSCREENINFO, &dosd->var0 ); if (ret) { D_PERROR( "Davinci/OSD: FBIOGET_VSCREENINFO (fb%d) failed!\n", OSD0 ); return DFB_INIT; } ret = ioctl( ddrv->fb[OSD1].fd, FBIOGET_VSCREENINFO, &dosd->var1 ); if (ret) { D_PERROR( "Davinci/OSD: FBIOGET_VSCREENINFO (fb%d) failed!\n", OSD1 ); return DFB_INIT; } ret = ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD0, 0 ); ret = ioctl( ddrv->fb[OSD1].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD1, 0 ); /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY | DLCAPS_SCREEN_POSITION | DLCAPS_SRC_COLORKEY; description->type = DLTF_GRAPHICS; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "TI Davinci OSD" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_RGB16; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_ALPHACHANNEL; return DFB_OK; } static DFBResult osdTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; D_DEBUG_AT( Davinci_OSD, "%s()\n", __FUNCTION__ ); if (config->options & ~DAVINCI_OSD_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; switch (config->format) { case DSPF_RGB444: case DSPF_RGB555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB4444: case DSPF_ARGB1555: case DSPF_ARGB: break; default: fail |= CLRCF_FORMAT; } if (config->width < 8 || config->width > 1920) fail |= CLRCF_WIDTH; if (config->height < 8 || config->height > 1080) fail |= CLRCF_HEIGHT; if (config->dest.x < 0 || config->dest.y < 0) fail |= CLRCF_DEST; if (config->dest.x + config->dest.w > 1920) fail |= CLRCF_DEST; if (config->dest.y + config->dest.h > 1080) fail |= CLRCF_DEST; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult osdSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { int ret; DavinciDriverData *ddrv = driver_data; DavinciDeviceData *ddev = ddrv->ddev; DavinciOSDLayerData *dosd = layer_data; D_DEBUG_AT( Davinci_OSD, "%s()\n", __FUNCTION__ ); D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); D_ASSERT( dosd != NULL ); ret = ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD0, 0 ); ret = ioctl( ddrv->fb[OSD1].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD1, 0 ); ioctl( ddrv->fb[OSD0].fd, FBIO_WAITFORVSYNC ); /* Update blend parameters? */ if (updated & (CLRCF_OPTIONS | CLRCF_OPACITY | CLRCF_SRCKEY | CLRCF_FORMAT)) { vpbe_blink_option_t blink = {0}; vpbe_bitmap_blend_params_t blend = {0}; D_DEBUG_AT( Davinci_OSD, " -> %s\n", dfb_pixelformat_name( config->format ) ); if (config->options & DLOP_SRC_COLORKEY) { blend.enable_colorkeying = 1; blend.colorkey = dfb_color_to_pixel( DSPF_RGB16, config->src_key.r, config->src_key.g, config->src_key.b ); D_DEBUG_AT( Davinci_OSD, " -> color key 0x%02x (%02x %02x %02x)\n", blend.colorkey, config->src_key.r, config->src_key.g, config->src_key.b ); } else if (config->options & DLOP_OPACITY) { blend.bf = config->opacity >> 5; D_DEBUG_AT( Davinci_OSD, " -> opacity %d/7\n", blend.bf ); } else blend.bf = 7; ret = ioctl( ddrv->fb[OSD0].fd, FBIO_SET_BITMAP_BLEND_FACTOR, &blend ); if (ret) D_PERROR( "Davinci/OSD: FBIO_SET_BITMAP_BLEND_FACTOR (fb%d)!\n", OSD0 ); if (config->options & DLOP_ALPHACHANNEL) dosd->alpha = DFB_PIXELFORMAT_HAS_ALPHA( config->format ); else dosd->alpha = 0; D_DEBUG_AT( Davinci_OSD, " -> %salpha channel\n", dosd->alpha ? "" : "no " ); if (dosd->alpha) { if (ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN, dosd->alpha )) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN (fb%d - %d)!\n", OSD0, dosd->alpha ); } if (ioctl( ddrv->fb[OSD1].fd, FBIO_SET_BLINK_INTERVAL, &blink )) D_OSDERROR( "Davinci/OSD: FBIO_SET_BLINK_INTERVAL (fb%d - disable)!\n", OSD1 ); } /* Update size? */ if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_BUFFERMODE)) { vpbe_window_position_t win_pos; D_DEBUG_AT( Davinci_OSD, " -> %dx%d\n", config->width, config->height ); /*********************************** Start workaround ***********************************/ win_pos.xpos = 0; win_pos.ypos = 0; ret = ioctl( ddrv->fb[OSD0].fd, FBIO_SETPOS, &win_pos ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_SETPOS (fb%d - %d,%d) failed!\n", OSD0, win_pos.xpos, win_pos.ypos ); ret = ioctl( ddrv->fb[OSD1].fd, FBIO_SETPOS, &win_pos ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_SETPOS (fb%d - %d,%d) failed!\n", OSD1, win_pos.xpos, win_pos.ypos ); updated |= CLRCF_DEST; dosd->var0.yoffset = dosd->var1.yoffset = 0; /*********************************** End workaround ***********************************/ /* Set width and height. */ dosd->var0.xres = config->width; dosd->var0.yres = config->height; dosd->var1.xres = config->width; dosd->var1.yres = config->height; dosd->var0.yres_virtual = ddrv->fb[OSD0].size / ddev->fix[OSD0].line_length; ret = ioctl( ddrv->fb[OSD0].fd, FBIOPUT_VSCREENINFO, &dosd->var0 ); if (ret) D_PERROR( "Davinci/OSD: FBIOPUT_VSCREENINFO (fb%d) failed!\n", OSD0 ); ret = ioctl( ddrv->fb[OSD1].fd, FBIOPUT_VSCREENINFO, &dosd->var1 ); if (ret) D_PERROR( "Davinci/OSD: FBIOPUT_VSCREENINFO (fb%d) failed!\n", OSD1 ); } /* Update position? */ if (updated & CLRCF_DEST) { vpbe_window_position_t win_pos; D_DEBUG_AT( Davinci_OSD, " -> %d, %d\n", config->dest.x, config->dest.y ); /* Set horizontal and vertical offset. */ win_pos.xpos = config->dest.x; win_pos.ypos = config->dest.y; ret = ioctl( ddrv->fb[OSD0].fd, FBIO_SETPOS, &win_pos ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_SETPOS (fb%d - %d,%d) failed!\n", OSD0, config->dest.x, config->dest.y ); ret = ioctl( ddrv->fb[OSD1].fd, FBIO_SETPOS, &win_pos ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_SETPOS (fb%d - %d,%d) failed!\n", OSD1, config->dest.x, config->dest.y ); } davincifb_pan_display( &ddrv->fb[OSD0], &dosd->var0, (config->format == DSPF_RGB16) ? lock : NULL, DSFLIP_NONE, 0, 0 ); ret = ioctl( ddrv->fb[OSD0].fd, FBIOGET_FSCREENINFO, &ddev->fix[OSD0] ); if (ret) D_PERROR( "Davinci/OSD: FBIOGET_FSCREENINFO (fb%d) failed!\n", OSD0 ); ret = ioctl( ddrv->fb[OSD1].fd, FBIOGET_FSCREENINFO, &ddev->fix[OSD1] ); if (ret) D_PERROR( "Davinci/OSD: FBIOGET_FSCREENINFO (fb%d) failed!\n", OSD1 ); dosd->enable = true; if (ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN, 0 )) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN (fb%d - %d)!\n", OSD0, 0 ); return DFB_OK; } static DFBResult osdRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { int ret; DavinciDriverData *ddrv = driver_data; DavinciOSDLayerData *dosd = layer_data; D_DEBUG_AT( Davinci_OSD, "%s()\n", __FUNCTION__ ); D_ASSERT( ddrv != NULL ); ret = ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD0, 0 ); ret = ioctl( ddrv->fb[OSD1].fd, FBIO_ENABLE_DISABLE_WIN, 0 ); if (ret) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD1, 0 ); dosd->enable = false; return DFB_OK; } static void update_buffers( DavinciDriverData *ddrv, DavinciDeviceData *ddev, CoreSurface *surface, CoreSurfaceBufferLock *lock, const DFBRegion *update ) { DFBRectangle rect; CoreSurfaceBuffer *buffer; D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); D_ASSERT( surface != NULL ); D_ASSERT( lock != NULL ); DFB_REGION_ASSERT_IF( update ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); if (update) { rect = DFB_RECTANGLE_INIT_FROM_REGION( update ); if (rect.x & 1) { rect.x &= ~1; rect.w++; } if (rect.w & 1) rect.w++; } else { rect.x = 0; rect.y = 0; rect.w = surface->config.size.w; rect.h = surface->config.size.h; } /* Can we use the DSP? */ if (ddrv->c64x_present) { int i; int lines = ddev->fix[OSD0].line_length == ddev->fix[OSD1].line_length ? rect.h : 1; unsigned long rgb = ddev->fix[OSD0].smem_start + rect.x * 2 + rect.y * ddev->fix[OSD0].line_length; unsigned long alpha = ddev->fix[OSD1].smem_start + rect.x / 2 + rect.y * ddev->fix[OSD1].line_length; unsigned long src = lock->phys + rect.x * 4 + rect.y * lock->pitch; //D_ASSUME( ddev->fix[OSD0].line_length == ddev->fix[OSD1].line_length ); dfb_gfxcard_lock( GDLF_NONE ); /* Dither ARGB to RGB16+A3 using the DSP. */ for (i=0; i rect.h - i) lines = rect.h - i; davinci_c64x_dither_argb__L( &ddrv->tasks, rgb, alpha, ddev->fix[OSD0].line_length, src, lock->pitch, rect.w, lines ); if (ddev->fix[OSD0].line_length != ddev->fix[OSD1].line_length && lines > 1) { davinci_c64x_blit_32__L( &ddrv->tasks, alpha + ddev->fix[OSD1].line_length, ddev->fix[OSD1].line_length, alpha + ddev->fix[OSD0].line_length, ddev->fix[OSD0].line_length, rect.w/2, lines - 1 ); } rgb += lines * ddev->fix[OSD0].line_length; alpha += lines * ddev->fix[OSD1].line_length; src += lines * lock->pitch; } /* Flush the write cache. */ davinci_c64x_write_back_all( &ddrv->c64x ); davinci_c64x_emit_tasks( &ddrv->c64x, &ddrv->tasks, C64X_TEF_RESET ); dfb_gfxcard_unlock(); } else { u32 *src32 = lock->addr + rect.y * lock->pitch + DFB_BYTES_PER_LINE( buffer->format, rect.x ); int sp4 = lock->pitch / 4; u32 *dst32 = ddrv->fb[OSD0].mem + rect.y * ddev->fix[OSD0].line_length + rect.x * 2; int dp4 = ddev->fix[OSD0].line_length / 4; u8 *dst8 = ddrv->fb[OSD1].mem + rect.y * ddev->fix[OSD1].line_length + rect.x / 2; int dp = ddev->fix[OSD1].line_length; int w2 = rect.w / 2; u32 z = 0; switch (buffer->format) { case DSPF_ARGB4444: while (rect.h--) { int x; for (x=0; x> 1) | ((src32[x] & 0x000f000f) << 1) | ((src32[x] & 0x00080008) >> 3); dst8[x] = ((src32[x] & 0xe0000000) >> 29) | ((src32[x] & 0x0000e000) >> 9); } src32 += sp4; dst32 += dp4; dst8 += dp; } break; case DSPF_ARGB1555: while (rect.h--) { int x; for (x=0; x> 8) | ((s0 & 0x0000fc00) >> 5) | ((s0 & 0x000000f8) >> 3) | ((s1 & 0x00f80000) << 8) | ((s1 & 0x0000fc00) << 11) | ((s1 & 0x000000f8) << 13) ; #ifndef DAVINCI_NO_DITHER if ((s0 & s1) >> 24 == 0xff) dst8[x] = 0x77; else { register int pt, da; z ^= ((z << 13) | (z >> 19)); z += 0x87654321; pt = s0 - ((s0 & 0xf8000000) >> 3); da = (((pt >> 29) & 0x07) + ( ((z&0x1f) - ((pt >> 24) & 0x1f))>>31 )) << 4; z ^= ((z << 13) | (z >> 19)); z += 0x87654321; pt = s1 - ((s1 & 0xf8000000) >> 3); da |= (((pt >> 29) & 0x07) + ( ((z&0x1f) - ((pt >> 24) & 0x1f))>>31 )); dst8[x] = da; } #else dst8[x] = ((s0 & 0xe0000000) >> 25) | ((s1 & 0xe0000000) >> 29) ; #endif } src32 += sp4; dst32 += dp4; dst8 += dp; } break; default: D_ONCE( "unsupported format" ); } } } static void update_rgb( DavinciDriverData *ddrv, DavinciDeviceData *ddev, CoreSurface *surface, CoreSurfaceBufferLock *lock, const DFBRegion *update ) { DFBRectangle rect; CoreSurfaceBuffer *buffer; D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); D_ASSERT( surface != NULL ); D_ASSERT( lock != NULL ); DFB_REGION_ASSERT_IF( update ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); if (update) rect = DFB_RECTANGLE_INIT_FROM_REGION( update ); else { rect.x = 0; rect.y = 0; rect.w = surface->config.size.w; rect.h = surface->config.size.h; } dfb_convert_to_rgb16( buffer->format, lock->addr + rect.y * lock->pitch + DFB_BYTES_PER_LINE( buffer->format, rect.x ), lock->pitch, surface->config.size.h, ddrv->fb[OSD0].mem + rect.y * ddev->fix[OSD0].line_length + rect.x * 2, ddev->fix[OSD0].line_length, rect.w, rect.h ); } static void enable_osd( DavinciDriverData *ddrv, DavinciOSDLayerData *dosd ) { if (!dosd->enable) return; ioctl( ddrv->fb[OSD0].fd, FBIO_WAITFORVSYNC ); if (ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN, dosd->alpha )) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN (fb%d - %d)!\n", OSD0, dosd->alpha ); if (ioctl( ddrv->fb[OSD0].fd, FBIO_ENABLE_DISABLE_WIN, 1 )) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD0, 1 ); if (ioctl( ddrv->fb[OSD1].fd, FBIO_ENABLE_DISABLE_WIN, dosd->alpha )) D_OSDERROR( "Davinci/OSD: FBIO_ENABLE_DISABLE_WIN (fb%d - %d)!\n", OSD1, dosd->alpha ); dosd->enable = false; } static DFBResult osdFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { CoreSurfaceBuffer *buffer; DavinciDriverData *ddrv = driver_data; DavinciDeviceData *ddev = ddrv->ddev; DavinciOSDLayerData *dosd = layer_data; D_DEBUG_AT( Davinci_OSD, "%s()\n", __FUNCTION__ ); D_ASSERT( surface != NULL ); D_ASSERT( lock != NULL ); D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); if (buffer->format != DSPF_RGB16) { if (DFB_PIXELFORMAT_HAS_ALPHA( buffer->format )) update_buffers( ddrv, ddev, surface, lock, NULL ); else update_rgb( ddrv, ddev, surface, lock, NULL ); } else davincifb_pan_display( &ddrv->fb[OSD0], &dosd->var0, lock, flags, 0, 0 ); dfb_surface_flip( surface, false ); enable_osd( ddrv, dosd ); return DFB_OK; } static DFBResult osdUpdateRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, const DFBRegion *update, CoreSurfaceBufferLock *lock ) { CoreSurfaceBuffer *buffer; DavinciDriverData *ddrv = driver_data; DavinciDeviceData *ddev = ddrv->ddev; DavinciOSDLayerData *dosd = layer_data; D_DEBUG_AT( Davinci_OSD, "%s()\n", __FUNCTION__ ); D_ASSERT( surface != NULL ); D_ASSERT( lock != NULL ); D_ASSERT( ddrv != NULL ); D_ASSERT( ddev != NULL ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); if (buffer->format != DSPF_RGB16) { if (DFB_PIXELFORMAT_HAS_ALPHA( buffer->format )) update_buffers( ddrv, ddev, surface, lock, update ); else update_rgb( ddrv, ddev, surface, lock, update ); } enable_osd( ddrv, dosd ); return DFB_OK; } const DisplayLayerFuncs davinciOSDLayerFuncs = { .LayerDataSize = osdLayerDataSize, .InitLayer = osdInitLayer, .TestRegion = osdTestRegion, .SetRegion = osdSetRegion, .RemoveRegion = osdRemoveRegion, .FlipRegion = osdFlipRegion, .UpdateRegion = osdUpdateRegion, }; DirectFB-1.2.10/gfxdrivers/davinci/c64xdump.c0000644000175000017500000000654411164361026015565 00000000000000#include #include #include #include #include #include #include #include #include #define C64X_DEVICE "/dev/c64x" #define C64X_DEVICE0 "/dev/c64x0" #define C64X_QLEN direct_page_align( sizeof(c64xTaskControl) ) #define C64X_MLEN direct_page_align( 0x2000000 ) static const char *state_names[] = { "DONE", "ERROR", "TODO", "RUNNING" }; // manual (examples) //#define DAVINCI_C64X_IDLE_MAX (567087584/10) //#define DAVINCI_C64X_IDLE_MAX (59457217) // auto #ifndef DAVINCI_C64X_IDLE_MAX #define DAVINCI_C64X_IDLE_MAX (0) #endif int main (int argc, char *argv[]) { int fd; void *mem; c64xTaskControl *ctl; c64xTask *queue; int idle_max = DAVINCI_C64X_IDLE_MAX; uint32_t idle_last = 0; long long stamp_last = 0; fd = direct_try_open( C64X_DEVICE, C64X_DEVICE0, O_RDONLY, true ); if (fd < 0) return -1; ctl = mmap( NULL, C64X_QLEN, PROT_READ, MAP_SHARED, fd, 0 ); if (ctl == MAP_FAILED) { D_PERROR( "C64XDump: Mapping %lu bytes at %lu via '%s' failed!\n", C64X_QLEN, 0UL, C64X_DEVICE ); close( fd ); return -2; } mem = mmap( NULL, C64X_MLEN, PROT_READ, MAP_SHARED, fd, C64X_QLEN ); if (mem == MAP_FAILED) { D_PERROR( "C64XDump: Mapping %lu bytes at %lu via '%s' failed!\n", C64X_MLEN, C64X_QLEN, C64X_DEVICE ); munmap( (void*)ctl, C64X_QLEN ); close( fd ); return -2; } queue = mem + (0x8fe00000 - 0x8e000000); while (1) { usleep( 250000 ); int loadx = 1000; uint32_t counter = ctl->idlecounter; long long stamp = direct_clock_get_abs_micros(); uint32_t ql_dsp = ctl->QL_dsp; uint32_t ql_arm = ctl->QL_arm; uint32_t qh_dsp = ctl->QH_dsp; uint32_t qh_arm = ctl->QH_arm; uint32_t task = queue[ql_dsp & C64X_QUEUE_MASK].c64x_function; int dl, dh; dl = ql_arm - ql_dsp; if (dl < 0) dl += C64X_QUEUE_LENGTH; dh = qh_arm - qh_dsp; if (dh < 0) dh += C64X_QUEUE_LENGTH; printf( "\e[H\e[J" ); printf( "High Q: arm %5d - dsp %5d = %d\n", qh_arm, qh_dsp, dh ); printf( "Low Q: arm %5d - dsp %5d = %d\n", ql_arm, ql_dsp, dl ); printf( " (%08x: func %d - %s)\n", task, (task >> 2) & 0x3fff, state_names[task & 3] ); printf( "Counter: %u\n", counter ); if (counter >= idle_last && idle_last) { long long int cdiff = counter - idle_last; long long int tdiff = stamp - stamp_last; long long int diff = cdiff * 1200000 / tdiff; #if !DAVINCI_C64X_IDLE_MAX if (diff > idle_max) idle_max = diff; #endif loadx = (idle_max - diff) * 1000 / idle_max; } if (idle_max) printf( "Load: %d.%d%% (idle_max %d)\n", loadx / 10, loadx % 10, idle_max ); idle_last = counter; stamp_last = stamp; } munmap( (void*)mem, C64X_MLEN ); munmap( (void*)ctl, C64X_QLEN ); close( fd ); return 0; } DirectFB-1.2.10/gfxdrivers/davinci/davincifb.h0000644000175000017500000004330011164361026016034 00000000000000/* * Copyright (C) 2006 Texas Instruments Inc * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option)any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * File: davincifb.h */ #ifndef DAVINVI_VPBE_H #define DAVINVI_VPBE_H /* include Linux files */ #include /* define the custom FBIO_WAITFORVSYNC ioctl */ #define FBIO_WAITFORVSYNC _IOW('F', 0x20, u_int32_t) #define FBIO_SETATTRIBUTE _IOW('F', 0x21, struct fb_fillrect) /* Backported IOCTLS. */ #define FBIO_SETPOSX _IOW('F', 0x22, u_int32_t) #define FBIO_SETPOSY _IOW('F', 0x23, u_int32_t) #define FBIO_SETZOOM _IOW('F', 0x24, struct zoom_params) #define FBIO_GETSTD _IOR('F', 0x25, u_int32_t) #define FBIO_RESIZER _IOW('F', 0x26, struct vpfe_resizer_params) #define FBIO_SYNC _IOW('F', 0x27, u_int32_t) typedef struct zoom_params { u_int32_t window_id; u_int32_t zoom_h; u_int32_t zoom_v; } zoom_params_t; typedef struct vpfe_resizer_params { u_int32_t rsz_cnt; //busy-lock u_int32_t out_size; //busy-lock u_int32_t in_start; //busy-lock u_int32_t in_size; //busy-lock u_int32_t sdr_inadd; //shadowed u_int32_t sdr_inoff; //shadowed u_int32_t sdr_outadd; //shadowed u_int32_t sdr_outoff; //shadowed u_int32_t hfilt[16]; //busy-lock u_int32_t vfilt[16]; //busy-lock u_int32_t yenh; //busy-lock } vpfe_resizer_params_t; typedef struct fb_set_start { int offset; /* offset from smem_start */ unsigned long physical; /* absolute physical address when offset < 0 */ u_int64_t sync; /* input: target sync counter for change or 0 for no sync at all, output: sync counter of actual change or 0 if still pending */ } fb_set_start_t; #ifdef _IOC_TYPECHECK #undef _IOC_TYPECHECK #define _IOC_TYPECHECK(x) (sizeof(x)) #endif #define RAM_CLUT_SIZE 256*3 #define FBIO_ENABLE_DISABLE_WIN \ _IOW('F', 0x30, unsigned char) #define FBIO_SET_BITMAP_BLEND_FACTOR \ _IOW('F', 0x31, vpbe_bitmap_blend_params_t) #define FBIO_SET_BITMAP_WIN_RAM_CLUT \ _IOW('F', 0x32, unsigned char)*RAM_CLUT_SIZE) #define FBIO_ENABLE_DISABLE_ATTRIBUTE_WIN \ _IOW('F', 0x33, unsigned int) #define FBIO_GET_BLINK_INTERVAL \ _IOR('F', 0x34, vpbe_blink_option_t) #define FBIO_SET_BLINK_INTERVAL \ _IOW('F', 0x35, vpbe_blink_option_t) #define FBIO_GET_VIDEO_CONFIG_PARAMS \ _IOR('F', 0x36, vpbe_video_config_params_t) #define FBIO_SET_VIDEO_CONFIG_PARAMS \ _IOW('F', 0x37, vpbe_video_config_params_t) #define FBIO_GET_BITMAP_CONFIG_PARAMS \ _IOR('F', 0x38, vpbe_bitmap_config_params_t) #define FBIO_SET_BITMAP_CONFIG_PARAMS \ _IOW('F', 0x39, vpbe_bitmap_config_params_t) #define FBIO_SET_DCLK \ _IOW('F', 0x40, vpbe_dclk_t) #define FBIO_SET_INTERFACE \ _IOW('F', 0x41, unsigned char) #define FBIO_GET_INTERFACE \ _IOR('F', 0x42, unsigned char) #define FBIO_QUERY_TIMING \ _IOWR('F', 0x43, struct vpbe_mode_info) #define FBIO_SET_TIMING \ _IOW('F', 0x44, struct vpbe_fb_videomode) #define FBIO_GET_TIMING \ _IOR('F', 0x45, struct vpbe_fb_videomode) #define FBIO_SET_VENC_CLK_SOURCE \ _IOW('F', 0x46, unsigned char) #define FBIO_SET_BACKG_COLOR \ _IOW('F', 0x47, vpbe_backg_color_t) #define FBIO_ENABLE_DISPLAY \ _IOW('F', 0x48, unsigned char) #define FBIO_SETPOS \ _IOW('F', 0x49, u_int32_t) #define FBIO_SET_CURSOR \ _IOW('F', 0x50, struct fb_cursor) #define FBIO_SET_START \ _IOW('F', 0x66, struct fb_set_start) /* * Defines and Constants */ #ifdef __KERNEL__ #define DAVINCIFB_DEVICE "davincifb" #define DAVINCIFB_DRIVER "davincifb" #define MULTIPLE_BUFFERING 1 #ifdef MULTIPLE_BUFFERING #define DOUBLE_BUF 2 #define TRIPLE_BUF 3 #else #define DOUBLE_BUF 1 #define TRIPLE_BUF 1 #endif /* usage: if (is_win(info->fix.id, OSD0)) ... */ #define is_win(name, x) ((strcmp(name, x ## _FBNAME) == 0) ? 1 : 0) /* * display controller register I/O routines */ u32 dispc_reg_in(u32 offset); u32 dispc_reg_out(u32 offset, u32 val); u32 dispc_reg_merge(u32 offset, u32 val, u32 mask); #endif /*__KERNEL__*/ /* Error return codes */ #define VPBE_INVALID_PARA_VALUE 700 #define VPBE_WRONG_WINDOW_ID 701 #define VPBE_CURRENTLY_IN_REQUIRED_MODE 702 #define VPBE_INSUFFICIENT_CLUT_VALUES 703 #define VPBE_CLUT_WRITE_TIMEOUT 704 #define VPBE_VID0_BUF_ADR_NULL 705 #define VPBE_WINDOW_NOT_DISABLED 706 #define VPBE_WINDOW_NOT_ENABLED 707 #ifndef __KERNEL__ /* Window ID definations */ #define OSD0 0 #define VID0 1 #define OSD1 2 #define VID1 3 #endif /* There are 4 framebuffers, each represented by an fb_info and * a dm_win_info structure */ #define OSD0_FBNAME "dm_osd0_fb" #define OSD1_FBNAME "dm_osd1_fb" #define VID0_FBNAME "dm_vid0_fb" #define VID1_FBNAME "dm_vid1_fb" /* FIXME: Digital LCD RGB matrix coefficients */ #define DLCD_DGY_VAL 0 #define DLCD_DRV_VAL 0 #define DLCD_DGU_VAL 0 #define DLCD_DBU_VAL 0 /* Defines for bitmap format */ #define VPBE_BITMAP_BIT_1 1 #define VPBE_BITMAP_BIT_2 2 #define VPBE_BITMAP_BIT_4 4 #define VPBE_BITMAP_BIT_8 8 #define VPBE_BITMAP_RGB565 16 #define VPBE_VIDEO_YUV422 16 #define VPBE_VIDEO_RGB888 24 /* Defines foe cursor parameter validation*/ #define MAX_CURSOR_WIDTH 0x3FF #define MAX_CURSOR_HEIGHT 0x1FF #define MAX_CURSOR_LINEWIDTH 7 #define BASEX 0x80 #define BASEY 0x12 #define BASEX_DLCD 0x59 #define BASEY_DLCD 0x22 /* * Enumerations */ /* Enum for blending factor */ typedef enum vpbe_blend_factor { OSD_CONTRIBUTION_ZERO = 0, OSD_CONTRIBUTION_1_BY_8 = 1, OSD_CONTRIBUTION_2_BY_8 = 2, OSD_CONTRIBUTION_3_BY_8 = 3, OSD_CONTRIBUTION_4_BY_8 = 4, OSD_CONTRIBUTION_5_BY_8 = 5, OSD_CONTRIBUTION_6_BY_8 = 6, OSD_CONTRIBUTION_ONE = 7 } vpbe_blend_factor_t; /* Enum for Boolean variables */ typedef enum { SET_0 = 0, SET_1 = 1 } CB_CR_ORDER, ATTRIBUTE, ROM_RAM_CLUT; /* Defines for Display Interface */ #define PRGB 0 #define COMPOSITE 1 #define SVIDEO 2 #define COMPONENT 3 #define RGB 4 #define YCC16 5 #define YCC8 6 #define SRGB 7 #define EPSON 8 #define CASIO1G 9 #define UDISP 10 #define STN 11 #define VPBE_MAX_INTERFACES 12 /* Defines for Display Mode */ #define LCD 0 #define NTSC 1 #define PAL 2 #define P525 3 #define P625 4 #define DEFAULT_MODE 0 #define P480 0 #define P400 1 #define P350 2 #define NON_EXISTING_MODE 255 /* Enable/Disable enum */ typedef enum { VPBE_DISABLE = 0, VPBE_ENABLE = 1 } ATTENUATION, TRANSPARENCY, EXPANSION, BLINKING; typedef enum clk_source { CLK_SOURCE_CLK27 = 0, CLK_SOURCE_CLK54 = 1, CLK_SOURCE_VPBECLK = 2 } CLK_SOURCE; /* * Structures and Union Definitions */ /* Structure for transparency and the blending factor for the bitmap window */ typedef struct vpbe_bitmap_blend_params { unsigned int colorkey; /* color key to be blend */ unsigned int enable_colorkeying; /* enable color keying */ unsigned int bf; /* valid range from 0 to 7 only. */ } vpbe_bitmap_blend_params_t; /* Structure for window expansion */ typedef struct vpbe_win_expansion { EXPANSION horizontal; EXPANSION vertical; /* 1: Enable 0:disable */ } vpbe_win_expansion_t; /* Structure for OSD window blinking options */ typedef struct vpbe_blink_option { BLINKING blinking; /* 1: Enable blinking 0: Disable */ unsigned int interval; /* Valid only if blinking is 1 */ } vpbe_blink_option_t; /* Structure for DCLK parameters */ typedef struct vpbe_dclk { unsigned char dclk_pattern_width; unsigned int dclk_pattern0; unsigned int dclk_pattern1; unsigned int dclk_pattern2; unsigned int dclk_pattern3; } vpbe_dclk_t; /* Structure for display format */ typedef struct vpbe_display_format { unsigned char interface; /* Output interface type */ unsigned char mode; /* output mode */ } vpbe_display_format_t; /* Structure for background color */ typedef struct vpbe_backg_color { unsigned char clut_select; /* 2: RAM CLUT 1:ROM1 CLUT 0:ROM0 CLUT */ unsigned char color_offset; /* index of color */ } vpbe_backg_color_t; /* Structure for Video window configurable parameters */ typedef struct vpbe_video_config_params { CB_CR_ORDER cb_cr_order; /*Cb/Cr order in input data for a pixel. */ /* 0: cb cr 1: cr cb */ vpbe_win_expansion_t exp_info; /* HZ/VT Expansion enable disable */ } vpbe_video_config_params_t; /*Union of structures giving the CLUT index for the 1, 2, 4 bit bitmap values.*/ typedef union vpbe_clut_idx { struct _for_4bit_bimap { unsigned char bitmap_val_0; unsigned char bitmap_val_1; unsigned char bitmap_val_2; unsigned char bitmap_val_3; unsigned char bitmap_val_4; unsigned char bitmap_val_5; unsigned char bitmap_val_6; unsigned char bitmap_val_7; unsigned char bitmap_val_8; unsigned char bitmap_val_9; unsigned char bitmap_val_10; unsigned char bitmap_val_11; unsigned char bitmap_val_12; unsigned char bitmap_val_13; unsigned char bitmap_val_14; unsigned char bitmap_val_15; } for_4bit_bimap; struct _for_2bit_bimap { unsigned char bitmap_val_0; unsigned char dummy0[4]; unsigned char bitmap_val_1; unsigned char dummy1[4]; unsigned char bitmap_val_2; unsigned char dummy2[4]; unsigned char bitmap_val_3; } for_2bit_bimap; struct _for_1bit_bimap { unsigned char bitmap_val_0; unsigned char dummy0[14]; unsigned char bitmap_val_1; } for_1bit_bimap; } vpbe_clut_idx_t; /* Structure for bitmap window configurable parameters */ typedef struct vpbe_bitmap_config_params { /* Only for bitmap width = 1,2,4 bits */ vpbe_clut_idx_t clut_idx; /* Attenuation value for YUV o/p for bitmap window */ unsigned char attenuation_enable; /* 0: ROM DM270, 1:ROM DM320, 2:RAM CLUT */ unsigned char clut_select; } vpbe_bitmap_config_params_t; /* Unioun for video/OSD configuration parameters */ typedef union vpbe_conf_params { struct vpbe_video_params { CB_CR_ORDER cb_cr_order; /* HZ/VT Expansion enable disable */ vpbe_win_expansion_t exp_info; } video_params; struct vpbe_bitmap_params { /* Attenuation value for YUV o/p */ ATTENUATION attenuation_enable; /* 0: ROM DM270, 1: ROM DM320, 2:RAM CLUT */ unsigned char clut_select; /* Only for bitmap width = 1,2,4 bits */ vpbe_clut_idx_t clut_idx; /* 0: OSD window is bitmap window */ /* 1: OSD window is attribute window */ ATTRIBUTE enable_attribute; /* To hold bps value. Used to switch back from attribute to bitmap. */ unsigned int stored_bits_per_pixel; /* Blending information */ vpbe_bitmap_blend_params_t blend_info; /* OSD Blinking information */ vpbe_blink_option_t blink_info; } bitmap_params; } vpbe_conf_params_t; typedef struct vpbe_video_params vpbe_video_params_t; typedef struct vpbe_bitmap_params vpbe_bitmap_params_t; /* Structure to hold window position */ typedef struct vpbe_window_position { unsigned int xpos; /* X position of the window */ unsigned int ypos; /* Y position of the window */ } vpbe_window_position_t; #ifdef __KERNEL__ /* Structure for each window */ typedef struct vpbe_dm_win_info { struct fb_info info; vpbe_window_position_t win_pos; /* X,Y position of window */ /* Size of window is already there in var_info structure. */ dma_addr_t fb_base_phys; /*framebuffer area */ unsigned int fb_base; /*window memory pointer */ unsigned int fb_size; /*memory size */ unsigned int pseudo_palette[17]; int alloc_fb_mem; /*flag to identify if framebuffer area is fixed or not */ unsigned long sdram_address; struct vpbe_dm_info *dm; unsigned char window_enable; /*Additions for all windows */ zoom_params_t zoom; /*Zooming parameters */ unsigned char field_frame_select; /*To select Field or frame */ unsigned char numbufs; /*Number of buffers valid 2 or 3 */ vpbe_conf_params_t conf_params; /*window configuration parameter union pointer */ } vpbe_dm_win_info_t; #endif /*__KERNEL__*/ /* * Videmode structure for display interface and mode settings */ typedef struct vpbe_fb_videomode { unsigned char name[10]; /* Mode name ( NTSC , PAL) */ unsigned int vmode; /* FB_MODE_INTERLACED or FB_MODE_NON_INTERLACED */ unsigned int xres; /* X Resolution of the display */ unsigned int yres; /* Y Resolution of the display */ unsigned int fps; /* frames per second */ /* Timing Parameters applicable for std = 0 only */ unsigned int left_margin; unsigned int right_margin; unsigned int upper_margin; unsigned int lower_margin; unsigned int hsync_len; unsigned int vsync_len; unsigned int sync; /* 0: hsync -ve/vsync -ve */ /*1: hsync -ve/vsync +ve */ /*2: hsync +ve/vsync -ve */ /*3: hsync +ve/vsync +ve */ unsigned int basepx; /* Display x,y start position */ unsigned int basepy; /* 1= Mode s available in modelist 0=Mode is not available in modelist */ unsigned int std; } vpbe_fb_videomode_t; /* Structure to interface videomode to application*/ typedef struct vpbe_mode_info { vpbe_fb_videomode_t vid_mode; unsigned char interface; unsigned char mode_idx; } vpbe_mode_info_t; #ifdef __KERNEL__ /* * Structure for the driver holding information of windows, * memory base addresses etc. */ typedef struct vpbe_dm_info { vpbe_dm_win_info_t *osd0; vpbe_dm_win_info_t *osd1; vpbe_dm_win_info_t *vid0; vpbe_dm_win_info_t *vid1; /* to map the registers */ dma_addr_t mmio_base_phys; unsigned int mmio_base; unsigned int mmio_size; wait_queue_head_t vsync_wait; unsigned int vsync_cnt; int timeout; /* this is the function that configures the output device (NTSC/PAL/LCD) * for the required output format (composite/s-video/component/rgb) */ void (*output_device_config) (void); struct device *dev; vpbe_backg_color_t backg; /* background color */ vpbe_dclk_t dclk; /*DCLK parameters */ vpbe_display_format_t display; /*Display interface and mode */ vpbe_fb_videomode_t videomode; /*Cuurent videomode */ char ram_clut[256][3]; /*RAM CLUT array */ struct fb_cursor cursor; /* cursor config params from fb.h */ /*Flag that indicates whether any of the display is enabled or not*/ int display_enable; } vpbe_dm_info_t; /* * Functions Definitions for 'davincifb' module */ int vpbe_mem_alloc_window_buf(vpbe_dm_win_info_t *); int vpbe_mem_release_window_buf(vpbe_dm_win_info_t *); void init_display_function(vpbe_display_format_t *); int vpbe_mem_alloc_struct(vpbe_dm_win_info_t **); void set_vid0_default_conf(void); void set_vid1_default_conf(void); void set_osd0_default_conf(void); void set_osd1_default_conf(void); void set_cursor_default_conf(void); void set_dm_default_conf(void); void set_win_enable(char *, unsigned int); int within_vid0_limits(u32, u32, u32, u32); void vpbe_set_display_default(void); #ifdef __KERNEL__ void set_win_position(char *, u32, u32, u32, u32); void change_win_param(int); void set_interlaced(char *, unsigned int); #endif /* __KERNEL__ */ /* * Function definations for 'osd' module */ int vpbe_enable_window(vpbe_dm_win_info_t *); int vpbe_disable_window(vpbe_dm_win_info_t *); int vpbe_vid_osd_select_field_frame(u8 *, u8); int vpbe_bitmap_set_blend_factor(u8 *, vpbe_bitmap_blend_params_t *); int vpbe_bitmap_set_ram_clut(void); int vpbe_enable_disable_attribute_window(u32); int vpbe_get_blinking(u8 *, vpbe_blink_option_t *); int vpbe_set_blinking(u8 *, vpbe_blink_option_t *); int vpbe_set_vid_params(u8 *, vpbe_video_config_params_t *); int vpbe_get_vid_params(u8 *, vpbe_video_config_params_t *); int vpbe_bitmap_get_params(u8 *, vpbe_bitmap_config_params_t *); int vpbe_bitmap_set_params(u8 *, vpbe_bitmap_config_params_t *); int vpbe_set_cursor_params(struct fb_cursor *); int vpbe_set_vid_expansion(vpbe_win_expansion_t *); int vpbe_set_dclk(vpbe_dclk_t *); int vpbe_set_display_format(vpbe_display_format_t *); int vpbe_set_backg_color(vpbe_backg_color_t *); int vpbe_set_interface(u8); int vpbe_query_mode(vpbe_mode_info_t *); int vpbe_set_mode(struct vpbe_fb_videomode *); int vpbe_set_venc_clk_source(u8); void set_vid0_default_conf(void); void set_osd0_default_conf(void); void set_vid1_default_conf(void); void set_osd1_default_conf(void); void set_cursor_default_conf(void); void set_dm_default_conf(void); /* * Function definations for 'venc' module */ void davincifb_ntsc_composite_config(void); void davincifb_ntsc_svideo_config(void); void davincifb_ntsc_component_config(void); void davincifb_pal_composite_config(void); void davincifb_pal_svideo_config(void); void davincifb_pal_component_config(void); void vpbe_davincifb_ntsc_rgb_config(void); void vpbe_davincifb_pal_rgb_config(void); void vpbe_davincifb_525p_component_config(void); void vpbe_davincifb_625p_component_config(void); void vpbe_enable_venc(int); void vpbe_enable_dacs(int); /* * Function definations for 'dlcd' module */ void vpbe_davincifb_480p_prgb_config(void); void vpbe_davincifb_400p_prgb_config(void); void vpbe_davincifb_350p_prgb_config(void); void vpbe_set_display_timing(struct vpbe_fb_videomode *); void vpbe_enable_lcd(int); /* * Following functions are not implemented */ void vpbe_davincifb_default_ycc16_config(void); void vpbe_davincifb_default_ycc8_config(void); void vpbe_davincifb_default_srgb_config(void); void vpbe_davincifb_default_epson_config(void); void vpbe_davincifb_default_casio_config(void); void vpbe_davincifb_default_UDISP_config(void); void vpbe_davincifb_default_STN_config(void); #endif /*__KERNEL__*/ #endif /* End of #ifndef DAVINCI_VPBE_H */ DirectFB-1.2.10/gfxdrivers/davinci/davinci_osd.h0000644000175000017500000000277711245562152016411 00000000000000/* TI Davinci driver - Graphics Layer (c) Copyright 2007 Telio AG Written by Denis Oliver Kropp Code is derived from VMWare driver. (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DAVINCI_OSD_H__ #define __DAVINCI_OSD_H__ #include #include #define DAVINCI_OSD_SUPPORTED_OPTIONS (DLOP_ALPHACHANNEL | DLOP_OPACITY | DLOP_SRC_COLORKEY) typedef struct { struct fb_var_screeninfo var0; struct fb_var_screeninfo var1; bool alpha; bool enable; } DavinciOSDLayerData; extern const DisplayLayerFuncs davinciOSDLayerFuncs; #endif DirectFB-1.2.10/gfxdrivers/cyber5k/0000777000175000017500000000000011307522570013753 500000000000000DirectFB-1.2.10/gfxdrivers/cyber5k/Makefile.am0000644000175000017500000000143711245562152015731 00000000000000## Makefile.am for DirectFB/gfxdrivers/cyber5k INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src cyber5k_LTLIBRARIES = libdirectfb_cyber5k.la if BUILD_STATIC cyber5k_DATA = $(cyber5k_LTLIBRARIES:.la=.o) endif cyber5kdir = $(MODULEDIR)/gfxdrivers libdirectfb_cyber5k_la_SOURCES = \ cyber5k.c \ cyber5k.h \ cyber5k_overlay.h \ cyber5k_overlay.c \ cyber5k_underlay.c \ cyber5k_alpha.c \ cyber5k_alpha.h \ regs.h \ mmio.h libdirectfb_cyber5k_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_cyber5k_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/cyber5k/Makefile.in0000644000175000017500000004572611307521477015757 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/cyber5k ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(cyber5kdir)" "$(DESTDIR)$(cyber5kdir)" cyber5kLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(cyber5k_LTLIBRARIES) libdirectfb_cyber5k_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_cyber5k_la_OBJECTS = cyber5k.lo cyber5k_overlay.lo \ cyber5k_underlay.lo cyber5k_alpha.lo libdirectfb_cyber5k_la_OBJECTS = $(am_libdirectfb_cyber5k_la_OBJECTS) libdirectfb_cyber5k_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_cyber5k_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_cyber5k_la_SOURCES) DIST_SOURCES = $(libdirectfb_cyber5k_la_SOURCES) cyber5kDATA_INSTALL = $(INSTALL_DATA) DATA = $(cyber5k_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src cyber5k_LTLIBRARIES = libdirectfb_cyber5k.la @BUILD_STATIC_TRUE@cyber5k_DATA = $(cyber5k_LTLIBRARIES:.la=.o) cyber5kdir = $(MODULEDIR)/gfxdrivers libdirectfb_cyber5k_la_SOURCES = \ cyber5k.c \ cyber5k.h \ cyber5k_overlay.h \ cyber5k_overlay.c \ cyber5k_underlay.c \ cyber5k_alpha.c \ cyber5k_alpha.h \ regs.h \ mmio.h libdirectfb_cyber5k_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_cyber5k_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/cyber5k/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/cyber5k/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-cyber5kLTLIBRARIES: $(cyber5k_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(cyber5kdir)" || $(MKDIR_P) "$(DESTDIR)$(cyber5kdir)" @list='$(cyber5k_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cyber5kLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(cyber5kdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(cyber5kLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(cyber5kdir)/$$f"; \ else :; fi; \ done uninstall-cyber5kLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(cyber5k_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(cyber5kdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(cyber5kdir)/$$p"; \ done clean-cyber5kLTLIBRARIES: -test -z "$(cyber5k_LTLIBRARIES)" || rm -f $(cyber5k_LTLIBRARIES) @list='$(cyber5k_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_cyber5k.la: $(libdirectfb_cyber5k_la_OBJECTS) $(libdirectfb_cyber5k_la_DEPENDENCIES) $(libdirectfb_cyber5k_la_LINK) -rpath $(cyber5kdir) $(libdirectfb_cyber5k_la_OBJECTS) $(libdirectfb_cyber5k_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cyber5k.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cyber5k_alpha.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cyber5k_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cyber5k_underlay.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-cyber5kDATA: $(cyber5k_DATA) @$(NORMAL_INSTALL) test -z "$(cyber5kdir)" || $(MKDIR_P) "$(DESTDIR)$(cyber5kdir)" @list='$(cyber5k_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(cyber5kDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(cyber5kdir)/$$f'"; \ $(cyber5kDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(cyber5kdir)/$$f"; \ done uninstall-cyber5kDATA: @$(NORMAL_UNINSTALL) @list='$(cyber5k_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(cyber5kdir)/$$f'"; \ rm -f "$(DESTDIR)$(cyber5kdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(cyber5kdir)" "$(DESTDIR)$(cyber5kdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-cyber5kLTLIBRARIES clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-cyber5kDATA install-cyber5kLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-cyber5kDATA uninstall-cyber5kLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-cyber5kLTLIBRARIES clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-cyber5kDATA \ install-cyber5kLTLIBRARIES install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-cyber5kDATA \ uninstall-cyber5kLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/cyber5k/mmio.h0000644000175000017500000000653711245562152015015 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __CYBER5K_MMIO__ #define __CYBER5K_MMIO__ #include #include "cyber5k.h" #include "regs.h" static inline void cyber_out8(volatile u8 *mmioaddr, u32 reg, u8 value) { *((volatile u8*)(mmioaddr+reg)) = value; } static inline void cyber_out16(volatile u8 *mmioaddr, u32 reg, u16 value) { *((volatile u16*)(mmioaddr+reg)) = value; } static inline void cyber_out32(volatile u8 *mmioaddr, u32 reg, u32 value) { *((volatile u32*)(mmioaddr+reg)) = value; } static inline u8 cyber_in8(volatile u8 *mmioaddr, u32 reg) { return *((volatile u8*)(mmioaddr+reg)); } static inline u16 cyber_in16(volatile u8 *mmioaddr, u32 reg) { return *((volatile u16*)(mmioaddr+reg)); } static inline u32 cyber_in32(volatile u8 *mmioaddr, u32 reg) { return *((volatile u32*)(mmioaddr+reg)); } /* Wait for idle accelerator */ static inline void cyber_waitidle( CyberDriverData *cdrv, CyberDeviceData *cdev ) { /* while (cyber_in8(mmioaddr, COP_STAT) & (CMDFF_FULL | HOSTFF_NOTEMPTY)) { grodis = 0; }*/ while ( cyber_in8(cdrv->mmio_base, COP_STAT) & (COP_BUSY|CMDFF_FULL|HOSTFF_NOTEMPTY) ); } /* ------------------------------------------------------------------------ */ static inline void cyber_crtcw(int reg, int val) { cyber_out8( cyber_mmio, CRTINDEX, reg ); cyber_out8( cyber_mmio, CRTDATA, val ); } static inline void cyber_grphw(int reg, int val) { cyber_out8( cyber_mmio, GRAINDEX, reg ); cyber_out8( cyber_mmio, GRADATA, val ); } static inline unsigned int cyber_grphr(int reg) { cyber_out8( cyber_mmio, GRAINDEX, reg ); return cyber_in8( cyber_mmio, GRADATA ); } static inline void cyber_attrw(int reg, int val) { cyber_in8( cyber_mmio, ATTRRESET ); cyber_out8( cyber_mmio, ATTRINDEX, reg ); cyber_in8( cyber_mmio, ATTRDATAR ); cyber_out8( cyber_mmio, ATTRDATAW, val ); } static inline void cyber_seqw(int reg, int val) { cyber_out8( cyber_mmio, SEQINDEX, reg ); cyber_out8( cyber_mmio, SEQDATA, val ); } static inline void cyber_tvw(int reg, int val) { cyber_out8( cyber_mmio, 0xb0000 + reg, val ); } static inline unsigned int cyber_tvr(int reg) { return cyber_in8( cyber_mmio, 0xb0000 + reg ); } #endif DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k_underlay.c0000644000175000017500000002252711245562152017313 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "cyber5k.h" #include "cyber5k_alpha.h" #include "cyber5k_overlay.h" typedef struct { CoreLayerRegionConfig config; } CyberUnderlayLayerData; static void udl_set_all ( CyberDriverData *cdrv, CyberUnderlayLayerData *cudl, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void udl_set_location( CyberDriverData *cdrv, CyberUnderlayLayerData *cudl, CoreLayerRegionConfig *config, CoreSurface *surface ); #define CYBER_UNDERLAY_SUPPORTED_OPTIONS (DLOP_NONE) /**********************/ static int udlLayerDataSize( void ) { return sizeof(CyberUnderlayLayerData); } static DFBResult udlInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *default_config, DFBColorAdjustment *default_adj ) { /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY | DLCAPS_SRC_COLORKEY | DLCAPS_SCREEN_LOCATION; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE | DLTF_BACKGROUND; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "CyberPro Underlay" ); /* fill out the default configuration */ default_config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; default_config->width = 768; default_config->height = 576; default_config->pixelformat = DSPF_RGB16; default_config->buffermode = DLBM_FRONTONLY; default_config->options = DLOP_NONE; /* initialize registers */ cyber_init_overlay(); /* workaround */ cyber_change_overlay_fifo(); cyber_cleanup_overlay(); cyber_init_overlay(); return DFB_OK; } static DFBResult udlTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; /* check for unsupported options */ if (config->options & ~CYBER_UNDERLAY_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; /* check pixel format */ switch (config->format) { case DSPF_RGB332: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: case DSPF_YUY2: break; default: fail |= CLRCF_FORMAT; } /* check width */ if (config->width > 1024 || config->width < 4) fail |= CLRCF_WIDTH; /* check height */ if (config->height > 1024 || config->height < 1) fail |= CLRCF_HEIGHT; /* write back failing fields */ if (failed) *failed = fail; /* return failure if any field failed */ if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult udlSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { CyberDriverData *cdrv = (CyberDriverData*) driver_data; CyberUnderlayLayerData *cudl = (CyberUnderlayLayerData*) layer_data; /* remember configuration */ cudl->config = *config; /* set up layer */ udl_set_all( cdrv, cudl, config, surface, lock ); return DFB_OK; } static DFBResult udlRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { /* disable and clean up */ cyber_enable_overlay(0); cyber_cleanup_alpha(); cyber_cleanup_overlay(); return DFB_OK; } static DFBResult udlFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { CyberDriverData *cdrv = (CyberDriverData*) driver_data; CyberUnderlayLayerData *cudl = (CyberUnderlayLayerData*) layer_data; dfb_surface_flip( surface, false ); udl_set_all( cdrv, cudl, &cudl->config, surface, lock ); return DFB_OK; } DisplayLayerFuncs cyberUnderlayFuncs = { .LayerDataSize = udlLayerDataSize, .InitLayer = udlInitLayer, .TestRegion = udlTestRegion, .SetRegion = udlSetRegion, .RemoveRegion = udlRemoveRegion, .FlipRegion = udlFlipRegion, }; /* internal */ static void udl_set_all( CyberDriverData *cdrv, CyberUnderlayLayerData *cudl, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { /* set the pixel format */ switch (surface->config.format) { case DSPF_RGB332: cyber_set_overlay_format (OVERLAY_RGB8); break; case DSPF_ARGB1555: cyber_set_overlay_format (OVERLAY_RGB555); break; case DSPF_RGB16: cyber_set_overlay_format (OVERLAY_RGB565); break; case DSPF_RGB24: cyber_set_overlay_format (OVERLAY_RGB888); break; case DSPF_ARGB: case DSPF_RGB32: cyber_set_overlay_format (OVERLAY_RGB8888); break; case DSPF_YUY2: cyber_set_overlay_format (OVERLAY_YUV422); break; default: D_BUG("unexpected pixelformat"); break; } cyber_set_overlay_mode( OVERLAY_WINDOWKEY ); /* set address */ cyber_set_overlay_srcaddr( lock->offset, 0, 0, surface->config.size.w, lock->pitch ); /* set location and scaling */ udl_set_location( cdrv, cudl, config, surface ); /* tune fifo */ cyber_change_overlay_fifo(); /* set up alpha blending */ cyber_enable_alpha( 1 ); cyber_enable_fullscreen_alpha( 1 ); cyber_select_blend_src1( SRC1_GRAPHICS ); cyber_select_blend_src2( SRC2_OVERLAY1 ); /* FIXME: find out why the opacity can't be set outside of this function */ cyber_set_alpha_reg( 0xcc, 0xcc, 0xcc ); /* turn it on */ cyber_enable_overlay(1); } static void udl_set_location( CyberDriverData *cdrv, CyberUnderlayLayerData *cudl, CoreLayerRegionConfig *config, CoreSurface *surface ) { /* set location */ cyber_set_overlay_window( config->dest.x, config->dest.y, config->dest.x + config->dest.w - 1, config->dest.y + config->dest.h - 1 ); /* set scaling */ cyber_set_overlay_scale( surface->config.size.h == 576 ? /* HACK: support interlaced video */ OVERLAY_BOBMODE : OVERLAY_WEAVEMODE, surface->config.size.w, config->dest.w, surface->config.size.h, config->dest.h ); } DirectFB-1.2.10/gfxdrivers/cyber5k/regs.h0000644000175000017500000003162211164361026015002 00000000000000#ifndef REGS_H #define REGS_H /* * COP MMIO definition * */ #define OPAQUE 0 #define TRANSPARENT 1 #define TRANSPARENT_SRC 1 #define TRANSPARENT_DST 2 #define SRC_FROM_SYS 4 #define PAT_IS_MONO 8 #define R2_ZERO 0x00 #define R2_S_AND_D 0x01 #define R2_S_AND_ND 0x02 #define R2_S 0x03 #define R2_NS_AND_D 0x04 #define R2_D 0x05 #define R2_S_XOR_D 0x06 #define R2_S_OR_D 0x07 #define R2_NS_AND_ND 0x08 #define R2_S_XOR_ND 0x09 #define R2_ND 0x0A #define R2_S_OR_ND 0x0B #define R2_NS 0x0C #define R2_NS_OR_D 0x0D #define R2_NS_OR_ND 0x0E #define R2_ONE 0x0F #define R3_S 0xF0 #define R3_P 0xCC #define COP_BASE 0xBF000 #define COP_STAT 0x11 + COP_BASE #define HBLTW_NOTREADY 0x01 #define HOSTFF_NOTEMPTY 0x02 #define CMDFF_FULL 0x04 #define SUSPEND_COP 0x08 #define COP_STOPPED 0x10 #define TERMINATE_COP 0x20 #define HBLT_NOTACKZ 0x40 #define COP_BUSY 0x80 #define SRC1WIDTH 0x18 + COP_BASE #define COPFMT 0x1C + COP_BASE #define ERRORTERM 0x20 + COP_BASE #define K1 0x24 + COP_BASE #define K2 0x28 + COP_BASE #define FMIX 0x48 + COP_BASE #define BMIX 0x49 + COP_BASE #define FCOLOR 0x58 + COP_BASE #define BCOLOR 0x5C + COP_BASE #define HEIGHTWIDTH 0x60 + COP_BASE #define DIMW 0x60 + COP_BASE #define DIMH 0x62 + COP_BASE #define SRC1BASE 0x70 + COP_BASE #define DSTXROT 0x78 + COP_BASE #define DSTYROT 0x7A + COP_BASE #define PATYROT 0x7A + COP_BASE #define PIXOP 0x7C + COP_BASE #define PIXOP_LO 0x7C + COP_BASE #define PIXOP_HI 0x7E + COP_BASE /* Direction */ #define YMAJOR 0x1 #define DEC_Y 0x2 #define DY_NEG 0x2 #define DEC_X 0x4 #define DX_NEG 0x4 #define ERRORTERM_POS 0x8 /* Draw mode */ #define DRAW_1ST_PIXEL_NULL 0x10 #define DRAW_LAST_PIXEL_NULL 0x20 #define DRAW_AREA_BOUND 0x30 /* transparent mode */ #define TRANS_IS_SRC1 0x0000 #define TRANS_IS_SRC2 0x0100 #define TRANS_IS_DST 0x0200 #define TRANS_INVERT 0x0400 #define TRANS_ENABLE 0x0800 /* Cop Operation */ #define PAT_OPAQUE_TEXTOUT 0x1000 #define PAT_OPAQUE_TILE 0x2000 #define PAT_OPAQUE_LINE 0x3000 #define PAT_TRANS_TEXTOUT 0x5000 #define PAT_TRANS_TILE 0x6000 #define PAT_TRANS_LINE 0x7000 #define PAT_FIXFGD 0x8000 #define PAT_COLOR_TILE 0x9000 /* Host-Mem Direction */ #define HOST_READ_SRC1 0x10000 #define HOST_WRITE_SRC1 0x20000 #define HOST_WRITE_SRC2 0x30000 /* Source2 Select */ #define SRC2_IS_COLOR 0x000000 #define SRC2_IS_OPAQUE_MONO 0x100000 #define SRC2_IS_FGDCOLOR 0x200000 #define SRC2_IS_TRANS_MONO 0x500000 /* Cop Command */ #define COP_STEP_DRAW 0x4000000 #define COP_LINE_DRAW 0x5000000 #define COP_PXBLT 0x8000000 #define COP_INVERT_PXBLT 0x9000000 #define COP_PXBLT256 0xB000000 /* Fore&Back */ #define FGD_IS_SRC1 0x20000000 #define FGD_IS_COLOR 0x00000000 #define BGD_IS_SRC1 0x80000000 #define BGD_IS_COLOR 0x00000000 #define SRC2WIDTH 0x118 + COP_BASE #define COPFLAGS 0x130 + COP_BASE #define FMONO_ENABLE 0x10 #define FMONO_DISABLE 0xEF #define COP_1WS 0x4 #define FASTMONOSIZE 0x13C + COP_BASE #define PATXROT 0x150 + COP_BASE #define SRC1PTR 0x170 + COP_BASE #define SRC2PTR 0x174 + COP_BASE #define DSTPTR 0x178 + COP_BASE #define DSTWIDTH 0x218 + COP_BASE /* ---------------------------------------------------------------------- */ #define PORT46E8 0x46E8 /* R */ #define PORT102 0x102 /* R/W */ #define MISCREAD 0x3CC /* R */ #define MISCWRITE 0x3C2 /* W */ #define SEQINDEX 0x3C4 /* R/W */ #define SEQDATA 0x3C5 /* R/W */ #define CRTINDEX 0x3D4 /* R/W */ #define CRTDATA 0x3D5 /* R/W */ #define ATTRRESET 0x3DA /* R/W */ #define ATTRINDEX 0x3C0 /* R/W */ #define ATTRDATAW 0x3C0 /* W, Attrib write data port */ #define ATTRDATAR 0x3C1 /* R, Attrib read data port */ #define GRAINDEX 0x3CE /* R/W */ #define GRADATA 0x3CF /* R/W */ #define RAMDACMASK 0x3C6 /* R/W, Mask register */ #define RAMDACINDEXR 0x3C7 /* R/W, RAM read index port */ #define RAMDACINDEXW 0x3C8 /* R/W, RAM write index port */ #define RAMDACDATA 0x3C9 /* R/W, RAM Date port */ #define IGS3CEINDEX 0x3CE /* R/W */ #define IGS3CFDATA 0x3CF /* R/W */ #define IGS3D4INDEX 0x3D4 /* R/W */ #define IGS3D5DATA 0x3D5 /* R/W */ #define IGS3C4INDEX 0x3C4 /* R/W */ #define IGS3C5DATA 0x3C5 /* R/W */ #define SEQCOUNT 0x05 #define MISCCOUNT 0x01 #define CRTCOUNT 0x19 #define ATTRCOUNT 0x15 #define GRACOUNT 0x09 #define EXTPARTIALCOUNT 8 /* define 8 extended regs for color depth change */ #define SREGCOUNT SEQCOUNT+MISCCOUNT+CRTCOUNT+ATTRCOUNT+GRACOUNT #define EREGCOUNT EXTPARTIALCOUNT * 2 + 1 #define PIXFORMAT_8BPP 0 #define PIXFORMAT_16BPP 1 #define PIXFORMAT_24BPP 2 #define VISUALID_256 1 #define VISUALID_64K 2 #define VISUALID_16M 4 #define VISUALID_32K 6 #define FUNC_CTL 0x3c #define FUNC_CTL_EXTREGENBL 0x80 /* enable access to 0xbcxxx */ #define BIU_BM_CONTROL 0x3e #define BIU_BM_CONTROL_ENABLE 0x01 /* enable bus-master */ #define BIU_BM_CONTROL_BURST 0x02 /* enable burst */ #define BIU_BM_CONTROL_BACK2BACK 0x04 /* enable back to back */ #define X_V2_VID_MEM_START 0x40 #define X_V2_VID_SRC_WIDTH 0x43 #define X_V2_X_START 0x45 #define X_V2_X_END 0x47 #define X_V2_Y_START 0x49 #define X_V2_Y_END 0x4b #define X_V2_VID_SRC_WIN_WIDTH 0x4d #define Y_V2_DDA_X_INC 0x43 #define Y_V2_DDA_Y_INC 0x47 #define Y_V2_VID_FIFO_CTL 0x49 #define Y_V2_VID_FMT 0x4b #define Y_V2_VID_DISP_CTL1 0x4c #define Y_V2_VID_FIFO_CTL1 0x4d #define J_X2_VID_MEM_START 0x40 #define J_X2_VID_SRC_WIDTH 0x43 #define J_X2_X_START 0x47 #define J_X2_X_END 0x49 #define J_X2_Y_START 0x4b #define J_X2_Y_END 0x4d #define J_X2_VID_SRC_WIN_WIDTH 0x4f #define K_X2_DDA_X_INIT 0x40 #define K_X2_DDA_X_INC 0x42 #define K_X2_DDA_Y_INIT 0x44 #define K_X2_DDA_Y_INC 0x46 #define K_X2_VID_FMT 0x48 #define K_X2_VID_DISP_CTL1 0x49 #define K_CAP_X2_CTL1 0x49 #define CAP_X_START 0x60 #define CAP_X_END 0x62 #define CAP_Y_START 0x64 #define CAP_Y_END 0x66 #define CAP_DDA_X_INIT 0x68 #define CAP_DDA_X_INC 0x6a #define CAP_DDA_Y_INIT 0x6c #define CAP_DDA_Y_INC 0x6e #define MEM_CTL2 0x72 #define MEM_CTL2_SIZE_2MB 0x01 #define MEM_CTL2_SIZE_4MB 0x02 #define MEM_CTL2_SIZE_MASK 0x03 #define MEM_CTL2_64BIT 0x04 #define EXT_FIFO_CTL 0x74 #define CAP_PIP_X_START 0x80 #define CAP_PIP_X_END 0x82 #define CAP_PIP_Y_START 0x84 #define CAP_PIP_Y_END 0x86 #define CAP_NEW_CTL1 0x88 #define CAP_NEW_CTL2 0x89 #define BM_CTRL0 0x9c #define BM_CTRL1 0x9d #define CAP_MODE1 0xa4 #define CAP_MODE1_8BIT 0x01 /* enable 8bit capture mode */ #define CAP_MODE1_CCIR656 0x02 /* CCIR656 mode */ #define CAP_MODE1_IGNOREVGT 0x04 /* ignore VGT */ #define CAP_MODE1_ALTFIFO 0x10 /* use alternate FIFO for capture */ #define CAP_MODE1_SWAPUV 0x20 /* swap UV bytes */ #define CAP_MODE1_MIRRORY 0x40 /* mirror vertically */ #define CAP_MODE1_MIRRORX 0x80 /* mirror horizontally */ #define CAP_MODE2 0xa5 #define Y_TV_CTL 0xae #define EXT_MEM_START 0xc0 /* ext start address 21 bits */ #define HOR_PHASE_SHIFT 0xc2 /* high 3 bits */ #define EXT_SRC_WIDTH 0xc3 /* ext offset phase 10 bits */ #define EXT_SRC_HEIGHT 0xc4 /* high 6 bits */ #define EXT_X_START 0xc5 /* ext->screen, 16 bits */ #define EXT_X_END 0xc7 /* ext->screen, 16 bits */ #define EXT_Y_START 0xc9 /* ext->screen, 16 bits */ #define EXT_Y_END 0xcb /* ext->screen, 16 bits */ #define EXT_SRC_WIN_WIDTH 0xcd /* 8 bits */ #define EXT_COLOUR_COMPARE 0xce /* 24 bits */ #define EXT_DDA_X_INIT 0xd1 /* ext->screen 16 bits */ #define EXT_DDA_X_INC 0xd3 /* ext->screen 16 bits */ #define EXT_DDA_Y_INIT 0xd5 /* ext->screen 16 bits */ #define EXT_DDA_Y_INC 0xd7 /* ext->screen 16 bits */ #define EXT_VID_FIFO_CTL 0xd9 #define EXT_VID_FMT 0xdb #define EXT_VID_FMT_YUV422 0x00 /* formats - does this cause conversion? */ #define EXT_VID_FMT_RGB555 0x01 #define EXT_VID_FMT_RGB565 0x02 #define EXT_VID_FMT_RGB888_24 0x03 #define EXT_VID_FMT_RGB888_32 0x04 #define EXT_VID_FMT_DUP_PIX_ZOON 0x08 /* duplicate pixel zoom */ #define EXT_VID_FMT_MOD_3RD_PIX 0x20 /* modify 3rd duplicated pixel */ #define EXT_VID_FMT_DBL_H_PIX 0x40 /* double horiz pixels */ #define EXT_VID_FMT_UV128 0x80 /* UV data offset by 128 */ #define EXT_VID_DISP_CTL1 0xdc #define EXT_VID_DISP_CTL1_INTRAM 0x01 /* video pixels go to internal RAM */ #define EXT_VID_DISP_CTL1_IGNORE_CCOMP 0x02 /* ignore colour compare registers */ #define EXT_VID_DISP_CTL1_NOCLIP 0x04 /* do not clip to 16235,16240 */ #define EXT_VID_DISP_CTL1_UV_AVG 0x08 /* U/V data is averaged */ #define EXT_VID_DISP_CTL1_Y128 0x10 /* Y data offset by 128 */ #define EXT_VID_DISP_CTL1_VINTERPOL_OFF 0x20 /* vertical interpolation off */ #define EXT_VID_DISP_CTL1_FULL_WIN 0x40 /* video out window full */ #define EXT_VID_DISP_CTL1_ENABLE_WINDOW 0x80 /* enable video window */ #define EXT_VID_FIFO_CTL1 0xdd #define VFAC_CTL1 0xe8 #define VFAC_CTL1_CAPTURE 0x01 /* capture enable */ #define VFAC_CTL1_VFAC_ENABLE 0x02 /* vfac enable */ #define VFAC_CTL1_FREEZE_CAPTURE 0x04 /* freeze capture */ #define VFAC_CTL1_FREEZE_CAPTURE_SYNC 0x08 /* sync freeze capture */ #define VFAC_CTL1_VALIDFRAME_SRC 0x10 /* select valid frame source */ #define VFAC_CTL1_PHILIPS 0x40 /* select Philips mode */ #define VFAC_CTL1_MODVINTERPOLCLK 0x80 /* modify vertical interpolation clocl */ #define VFAC_CTL2 0xe9 #define VFAC_CTL2_INVERT_VIDDATAVALID 0x01 /* invert video data valid */ #define VFAC_CTL2_INVERT_GRAPHREADY 0x02 /* invert graphic ready output sig */ #define VFAC_CTL2_INVERT_DATACLK 0x04 /* invert data clock signal */ #define VFAC_CTL2_INVERT_HSYNC 0x08 /* invert hsync input */ #define VFAC_CTL2_INVERT_VSYNC 0x10 /* invert vsync input */ #define VFAC_CTL2_INVERT_FRAME 0x20 /* invert frame odd/even input */ #define VFAC_CTL2_INVERT_BLANK 0x40 /* invert blank output */ #define VFAC_CTL2_INVERT_OVSYNC 0x80 /* invert other vsync input */ #define VFAC_CTL3 0xea #define VFAC_CTL3_CAP_IRQ 0x40 /* enable capture interrupt */ #define CAP_MEM_START 0xeb /* 18 bits */ #define CAP_MAP_WIDTH 0xed /* high 6 bits */ #define CAP_PITCH 0xee /* 8 bits */ #define CAP_CTL_MISC 0xef #define CAP_CTL_MISC_HDIV 0x01 #define CAP_CTL_MISC_HDIV4 0x02 #define CAP_CTL_MISC_ODDEVEN 0x04 #define CAP_CTL_MISC_HSYNCDIV2 0x08 #define CAP_CTL_MISC_SYNCTZHIGH 0x10 #define CAP_CTL_MISC_SYNCTZOR 0x20 #define CAP_CTL_MISC_DISPUSED 0x80 #define REG_BANK 0xfa #define REG_BANK_X 0x00 #define REG_BANK_Y 0x01 #define REG_BANK_W 0x02 #define REG_BANK_T 0x03 #define REG_BANK_J 0x04 #define REG_BANK_K 0x05 /* * Bus-master */ #define BM_VID_ADDR_LOW 0xbc040 #define BM_VID_ADDR_HIGH 0xbc044 #define BM_ADDRESS_LOW 0xbc080 #define BM_ADDRESS_HIGH 0xbc084 #define BM_LENGTH 0xbc088 #define BM_CONTROL 0xbc08c #define BM_CONTROL_ENABLE 0x01 /* enable transfer */ #define BM_CONTROL_IRQEN 0x02 /* enable IRQ at end of transfer */ #define BM_CONTROL_INIT 0x04 /* initialise status & count */ #define BM_COUNT 0xbc090 /* read-only */ /* * Graphics Co-processor */ #define CO_CMD_L_PATTERN_FGCOL 0x8000 #define CO_CMD_L_INC_LEFT 0x0004 #define CO_CMD_L_INC_UP 0x0002 #define CO_CMD_H_SRC_PIXMAP 0x2000 #define CO_CMD_H_BLITTER 0x0800 #define CO_REG_CONTROL 0xbf011 #define CO_REG_SRC_WIDTH 0xbf018 #define CO_REG_PIX_FORMAT 0xbf01c #define CO_REG_FORE_MIX 0xbf048 #define CO_REG_FOREGROUND 0xbf058 #define CO_REG_WIDTH 0xbf060 #define CO_REG_HEIGHT 0xbf062 #define CO_REG_X_PHASE 0xbf078 #define CO_REG_CMD_L 0xbf07c #define CO_REG_CMD_H 0xbf07e #define CO_REG_SRC_PTR 0xbf170 #define CO_REG_DEST_PTR 0xbf178 #define CO_REG_DEST_WIDTH 0xbf218 #endif DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k.c0000644000175000017500000006105411245562152015406 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( cyber5k ) #include "regs.h" #include "mmio.h" #include "cyber5k.h" #include "cyber5k_alpha.h" /* HACK */ volatile u8 *cyber_mmio = NULL; /* FIXME: support for destination color keying */ #define CYBER5K_DRAWING_FLAGS \ (DSDRAW_NOFX) #define CYBER5K_DRAWING_FUNCTIONS \ (DFXL_DRAWLINE | DFXL_DRAWRECTANGLE | DFXL_FILLRECTANGLE) #define CYBER5K_BLITTING_FLAGS \ (DSBLIT_SRC_COLORKEY) #define CYBER5K_BLITTING_FUNCTIONS \ (DFXL_BLIT) static bool cyber5kFillRectangle( void *drv, void *dev, DFBRectangle *rect ); static bool cyber5kFillRectangle24( void *drv, void *dev, DFBRectangle *rect ); static bool cyber5kDrawRectangle( void *drv, void *dev, DFBRectangle *rect ); static bool cyber5kDrawRectangle24( void *drv, void *dev, DFBRectangle *rect ); static bool cyber5kBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool cyber5kBlit24( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static DFBResult cyber5kEngineSync( void *drv, void *dev ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; cyber_waitidle( cdrv, cdev ); return DFB_OK; } static void cyber5kCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { /* check destination format first */ switch (state->destination->config.format) { case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { /* if there are no other drawing flags than the supported */ if (state->drawingflags & ~CYBER5K_DRAWING_FLAGS) return; state->accel |= CYBER5K_DRAWING_FUNCTIONS; /* no line drawing in 24bit mode */ if (state->destination->config.format == DSPF_RGB24) state->accel &= ~DFXL_DRAWLINE; } else { /* if there are no other blitting flags than the supported and the source and destination formats are the same */ if (state->blittingflags & ~CYBER5K_BLITTING_FLAGS) return; if (state->source->config.format != state->destination->config.format) return; state->accel |= CYBER5K_BLITTING_FUNCTIONS; } } static inline void cyber5k_validate_dst( CyberDriverData *cdrv, CyberDeviceData *cdev, CardState *state, GraphicsDeviceFuncs *funcs ) { CoreSurface *dest = state->destination; if (cdev->v_dst) return; cdev->dst_pixeloffset = state->dst.offset / DFB_BYTES_PER_PIXEL(dest->config.format); cdev->dst_pixelpitch = state->dst.pitch / DFB_BYTES_PER_PIXEL(dest->config.format); switch (dest->config.format) { case DSPF_RGB16: funcs->FillRectangle = cyber5kFillRectangle; funcs->DrawRectangle = cyber5kDrawRectangle; funcs->Blit = cyber5kBlit; cyber_out16( cdrv->mmio_base, DSTWIDTH, cdev->dst_pixelpitch - 1 ); cyber_out8( cdrv->mmio_base, COPFMT, 1 ); break; case DSPF_RGB24: funcs->FillRectangle = cyber5kFillRectangle24; funcs->DrawRectangle = cyber5kDrawRectangle24; funcs->Blit = cyber5kBlit24; cyber_out16( cdrv->mmio_base, DSTWIDTH, cdev->dst_pixelpitch*3 -1); cyber_out8( cdrv->mmio_base, COPFMT, 2 ); break; case DSPF_RGB32: case DSPF_ARGB: funcs->FillRectangle = cyber5kFillRectangle; funcs->DrawRectangle = cyber5kDrawRectangle; funcs->Blit = cyber5kBlit; cyber_out16( cdrv->mmio_base, DSTWIDTH, cdev->dst_pixelpitch - 1 ); cyber_out8( cdrv->mmio_base, COPFMT, 3 ); break; default: D_BUG( "unexpected pixelformat!" ); break; } cdev->v_dst = 1; } static inline void cyber5k_validate_src( CyberDriverData *cdrv, CyberDeviceData *cdev, CardState *state ) { CoreSurface *source = state->source; if (cdev->v_src) return; cdev->src_pixeloffset = state->src.offset / DFB_BYTES_PER_PIXEL(source->config.format); cdev->src_pixelpitch = state->src.pitch / DFB_BYTES_PER_PIXEL(source->config.format); cyber_out16( cdrv->mmio_base, SRC1WIDTH, state->src.pitch /DFB_BYTES_PER_PIXEL(source->config.format) - 1); cdev->v_src = 1; } static inline void cyber5k_validate_color( CyberDriverData *cdrv, CyberDeviceData *cdev, CardState *state ) { u32 fill_color = 0; if (cdev->v_color) return; switch (state->destination->config.format) { case DSPF_RGB16: fill_color = PIXEL_RGB16( state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB24: case DSPF_RGB32: fill_color = PIXEL_RGB32( state->color.r, state->color.g, state->color.b ); break; case DSPF_ARGB: fill_color = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); break; default: D_BUG( "unexpected pixelformat!" ); break; } cyber_out32( cdrv->mmio_base, FCOLOR, fill_color ); cdev->v_src_colorkey = 0; cdev->v_color = 1; } static inline void cyber5k_validate_src_colorkey( CyberDriverData *cdrv, CyberDeviceData *cdev, CardState *state ) { if (cdev->v_src_colorkey) return; cyber_out32( cdrv->mmio_base, FCOLOR, state->src_colorkey ); cyber_out32( cdrv->mmio_base, BCOLOR, state->src_colorkey ); cdev->v_color = 0; cdev->v_src_colorkey = 1; } static inline void cyber5k_validate_blitting_cmd( CyberDriverData *cdrv, CyberDeviceData *cdev, CardState *state ) { if (cdev->v_blitting_cmd) return; cdev->blitting_cmd = COP_PXBLT | PAT_FIXFGD | FGD_IS_SRC1; if (state->blittingflags & DSBLIT_SRC_COLORKEY) cdev->blitting_cmd |= TRANS_ENABLE | TRANS_IS_SRC1 | TRANS_INVERT; cdev->v_blitting_cmd = 1; } static void cyber5kSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; if (state->mod_hw) { if (state->mod_hw & SMF_DESTINATION) cdev->v_dst = cdev->v_color = 0; else if (state->mod_hw & SMF_COLOR) cdev->v_color = 0; if (state->mod_hw & SMF_SOURCE) cdev->v_src = cdev->v_src_colorkey = 0; else if (state->mod_hw & SMF_SRC_COLORKEY) cdev->v_src_colorkey = 0; if (state->mod_hw & SMF_BLITTING_FLAGS) cdev->v_blitting_cmd = 0; } cyber5k_validate_dst( cdrv, cdev, state, funcs ); switch (accel) { case DFXL_DRAWLINE: case DFXL_DRAWRECTANGLE: case DFXL_FILLRECTANGLE: cyber5k_validate_color( cdrv, cdev, state ); state->set = CYBER5K_DRAWING_FUNCTIONS; break; case DFXL_BLIT: cyber5k_validate_src( cdrv, cdev, state ); cyber5k_validate_blitting_cmd( cdrv, cdev, state ); if (state->blittingflags & DSBLIT_SRC_COLORKEY) cyber5k_validate_src_colorkey( cdrv, cdev, state ); state->set = CYBER5K_BLITTING_FUNCTIONS; break; default: D_BUG( "unexpected drawing/blitting function!" ); break; } state->mod_hw = 0; } static bool cyber5kFillRectangle( void *drv, void *dev, DFBRectangle *rect ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, cdev->dst_pixeloffset + rect->y * cdev->dst_pixelpitch + rect->x ); cyber_out32( mmio, HEIGHTWIDTH, ((rect->h-1) << 16) | (rect->w-1) ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); return true; } static bool cyber5kFillRectangle24( void *drv, void *dev, DFBRectangle *rect ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, (cdev->dst_pixeloffset + rect->y * cdev->dst_pixelpitch + rect->x) * 3 ); cyber_out8( mmio, DSTXROT, rect->x & 7 ); cyber_out32( mmio, HEIGHTWIDTH, ((rect->h-1) << 16) | (rect->w-1) ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); return true; } static bool cyber5kDrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; u32 dst = cdev->dst_pixeloffset + rect->y * cdev->dst_pixelpitch + rect->x; cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, dst ); cyber_out32( mmio, DIMW, 0 ); cyber_out32( mmio, DIMH, rect->h - 1 ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, dst + rect->w - 1); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, dst ); cyber_out32( mmio, DIMW, rect->w - 1 ); cyber_out32( mmio, DIMH, 0 ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, dst + cdev->dst_pixelpitch * (rect->h - 1) ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); return true; } static bool cyber5kDrawRectangle24( void *drv, void *dev, DFBRectangle *rect ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; u32 dst = cdev->dst_pixeloffset + (rect->y * cdev->dst_pixelpitch + rect->x) * 3; cyber_waitidle( cdrv, cdev ); cyber_out8( mmio, DSTXROT, rect->x & 7 ); cyber_out32( mmio, DSTPTR, dst ); cyber_out32( mmio, DIMW, rect->w - 1 ); cyber_out32( mmio, DIMH, 0 ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, dst + cdev->dst_pixelpitch * (rect->h-1) * 3 ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, dst ); cyber_out32( mmio, DIMW, 0 ); cyber_out32( mmio, DIMH, rect->h - 1 ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); cyber_waitidle( cdrv, cdev ); cyber_out8( mmio, DSTXROT, (rect->x + rect->w - 1) & 7 ); cyber_out32( mmio, DSTPTR, dst + (rect->w-1) * 3 ); cyber_out32( mmio, PIXOP, COP_PXBLT | PAT_FIXFGD ); return true; } static bool cyber5kDrawLine( void *drv, void *dev, DFBRegion *line ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; u32 cmd = COP_LINE_DRAW | PAT_FIXFGD; int dx; int dy; dx = line->x2 - line->x1; dy = line->y2 - line->y1; if (dx < 0) { dx = -dx; cmd |= DX_NEG; } if (dy < 0) { dy = -dy; cmd |= DY_NEG; } if (dx < dy) { int tmp; cmd |= YMAJOR; tmp = dx; dx = dy; dy = tmp; } cyber_waitidle( cdrv, cdev ); cyber_out32( mmio, DSTPTR, cdev->dst_pixeloffset + line->y1 * cdev->dst_pixelpitch + line->x1); cyber_out16( mmio, DIMW , dx); cyber_out16( mmio, K1 , 2*dy); cyber_out16( mmio, ERRORTERM, 2*dy-dx); cyber_out32( mmio, K2 ,2*(dy-dx)); cyber_out32( mmio, PIXOP , cmd); return true; } static bool cyber5kBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; u32 cmd = cdev->blitting_cmd; cyber_waitidle( cdrv, cdev ); if (rect->x < dx) { cmd |= DEC_X; rect->x += rect->w - 1; dx += rect->w - 1; } if (rect->y < dy) { cmd |= DEC_Y; rect->y += rect->h - 1; dy += rect->h - 1; } cyber_out32( mmio, DSTPTR, cdev->dst_pixeloffset + dy * cdev->dst_pixelpitch + dx ); cyber_out32( mmio, SRC1PTR, cdev->src_pixeloffset + rect->y * cdev->src_pixelpitch + rect->x ); cyber_out32( mmio, HEIGHTWIDTH, ((rect->h-1) << 16) | (rect->w-1) ); cyber_out32( mmio, PIXOP , cmd); return true; } static bool cyber5kBlit24( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { CyberDriverData *cdrv = (CyberDriverData*) drv; CyberDeviceData *cdev = (CyberDeviceData*) dev; volatile u8 *mmio = cdrv->mmio_base; u32 cmd = cdev->blitting_cmd; u32 src = 0; u32 dst = 0; cyber_waitidle( cdrv, cdev ); if (rect->x < dx) { cmd |= DEC_X; rect->x += rect->w - 1; dx += rect->w - 1; src += 2; dst += 2; } if (rect->y < dy) { cmd |= DEC_Y; rect->y += rect->h - 1; dy += rect->h - 1; } src += cdev->src_pixeloffset + rect->y * cdev->dst_pixelpitch + rect->x; dst += cdev->dst_pixeloffset + dy * cdev->dst_pixelpitch + dx; cyber_out32( mmio, DSTPTR , src ); cyber_out32( mmio, SRC1PTR , dst ); cyber_out32( mmio, HEIGHTWIDTH, ((rect->h-1) << 16) | (rect->w-1) ); cyber_out32( mmio, PIXOP , cmd ); return true; } /* primary layer hooks */ #define OSD_OPTIONS (DLOP_ALPHACHANNEL | DLOP_SRC_COLORKEY | DLOP_OPACITY) DisplayLayerFuncs oldPrimaryFuncs; void *oldPrimaryDriverData; static DFBResult osdInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { DFBResult ret; /* call the original initialization function first */ ret = oldPrimaryFuncs.InitLayer( layer, oldPrimaryDriverData, layer_data, description, config, adjustment ); if (ret) return ret; /* set name */ snprintf(description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "CyberPro OSD"); /* add support for options */ config->flags |= DLCONF_OPTIONS; /* add some capabilities */ description->caps |= DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY | DLCAPS_SRC_COLORKEY; return DFB_OK; } static DFBResult osdTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { DFBResult ret; CoreLayerRegionConfigFlags fail = 0; DFBDisplayLayerOptions options = config->options; /* remove options before calling the original function */ config->options = DLOP_NONE; /* call the original function */ ret = oldPrimaryFuncs.TestRegion( layer, oldPrimaryDriverData, layer_data, config, &fail ); /* check options if specified */ if (options) { /* any unsupported option wanted? */ if (options & ~OSD_OPTIONS) fail |= CLRCF_OPTIONS; /* opacity and alpha channel cannot be used at once */ if ((options & (DLOP_OPACITY | DLOP_ALPHACHANNEL)) == (DLOP_OPACITY | DLOP_ALPHACHANNEL)) { fail |= CLRCF_OPTIONS; } } /* restore options */ config->options = options; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return ret; } static DFBResult osdSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { DFBResult ret; /* call the original function */ ret = oldPrimaryFuncs.SetRegion( layer, oldPrimaryDriverData, layer_data, region_data, config, updated, surface, palette, lock ); if (ret) return ret; /* select pixel based or global alpha */ if (config->options & DLOP_ALPHACHANNEL) cyber_select_alpha_src( ALPHA_GRAPHICS ); else cyber_select_alpha_src( ALPHA_REGISTER ); cyber_set_alpha_reg( config->opacity, config->opacity, config->opacity ); /* source color keying */ cyber_select_RAM_addr( RAM_CPU ); cyber_set_alpha_RAM_reg( 0, 0x00, 0x00, 0x00 ); cyber_select_magic_alpha_src( ALPHA_LOOKUP ); cyber_enable_magic_alpha_blend( config->options & DLOP_SRC_COLORKEY ); /* FIXME: hardcoded black color key */ cyber_set_magic_match_reg( 0, 0, 0 ); return DFB_OK; } DisplayLayerFuncs newPrimaryFuncs = { .InitLayer = osdInitLayer, .TestRegion = osdTestRegion, .SetRegion = osdSetRegion, }; /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_IGS_CYBER2000: case FB_ACCEL_IGS_CYBER2010: case FB_ACCEL_IGS_CYBER5000: #ifdef FB_ACCEL_IGS_CYBER5K case FB_ACCEL_IGS_CYBER5K: /* CyberPro 5xxx */ #endif return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Cyber Pro Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); info->version.major = 0; info->version.minor = 4; info->driver_data_size = sizeof (CyberDriverData); info->device_data_size = sizeof (CyberDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { CyberDriverData *cdrv = (CyberDriverData*) driver_data; /* gain access to memory mapped registers */ cdrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!cdrv->mmio_base) return DFB_IO; /* HACK */ cyber_mmio = cdrv->mmio_base; /* fill acceleration function table */ funcs->EngineSync = cyber5kEngineSync; funcs->CheckState = cyber5kCheckState; funcs->SetState = cyber5kSetState; funcs->FillRectangle = cyber5kFillRectangle; funcs->DrawRectangle = cyber5kDrawRectangle; funcs->DrawLine = cyber5kDrawLine; funcs->Blit = cyber5kBlit; /* install primary layer hooks */ dfb_layers_hook_primary( device, driver_data, &newPrimaryFuncs, &oldPrimaryFuncs, &oldPrimaryDriverData ); /* add the video underlay */ switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_IGS_CYBER5000: #ifdef FB_ACCEL_IGS_CYBER5K case FB_ACCEL_IGS_CYBER5K: /* CyberPro 5xxx */ #endif dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &cyberUnderlayFuncs ); } return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { CyberDriverData *cdrv = (CyberDriverData*) driver_data; volatile u8 *mmio = cdrv->mmio_base; /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Cyber Pro" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "TVIA" ); device_info->caps.flags = 0; device_info->caps.accel = CYBER5K_DRAWING_FUNCTIONS | CYBER5K_BLITTING_FUNCTIONS; device_info->caps.drawing = CYBER5K_DRAWING_FLAGS; device_info->caps.blitting = CYBER5K_BLITTING_FLAGS; device_info->limits.surface_byteoffset_alignment = 16; device_info->limits.surface_pixelpitch_alignment = 4; /* set fifo policy at startup */ cyber_grphw(0x74, 0x1b); cyber_grphw(0x75, 0x1e); cyber_grphw(0xD9, 0x0f); cyber_grphw(0xDA, 0x1b); cyber_grphw(0xDD, 0x00); cyber_seqw(0xD9, 0x0f); cyber_seqw(0xDA, 0x1b); cyber_seqw(0xDD, 0x00); cyber_out8 (mmio, COPFLAGS, 1); cyber_out8 (mmio, FMIX , 0x03); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { CyberDriverData *cdrv = (CyberDriverData*) driver_data; dfb_gfxcard_unmap_mmio( device, cdrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k_overlay.h0000644000175000017500000000611211245562152017146 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef CYBER5KFB_OVERLAY_H #define CYBER5KFB_OVERLAY_H #include "regs.h" #define OVERLAY_YUV422 0 /*captured data is YUV 422 format*/ #define OVERLAY_RGB555 1 #define OVERLAY_RGB565 2 #define OVERLAY_RGB888 3 #define OVERLAY_RGB8888 4 #define OVERLAY_RGB8 5 #define OVERLAY_RGB4444 6 #define OVERLAY_RGB8T 7 #define OVERLAY_COLORKEY 0 /*Overlayed window is of color keying*/ #define OVERLAY_WINDOWKEY 1 /*Overlayed window is of window keying*/ #define OVERLAY_WEAVEMODE 0 #define OVERLAY_BOBMODE 1 #define MEMORY_START_L 0xC0 #define MEMORY_START_M 0xC1 #define MEMORY_START_H 0xC2 #define MEMORY_PITCH_L 0xC3 #define MEMORY_PITCH_H 0xC4 #define DEST_RECT_LEFT_L 0xC5 #define DEST_RECT_LEFT_H 0xC6 #define DEST_RECT_RIGHT_L 0xC7 #define DEST_RECT_RIGHT_H 0xC8 #define DEST_RECT_TOP_L 0xC9 #define DEST_RECT_TOP_H 0xCA #define DEST_RECT_BOTTOM_L 0xCB #define DEST_RECT_BOTTOM_H 0xCC #define MEMORY_OFFSET_PHASE 0xCD #define COLOR_CMP_RED 0xCE #define COLOR_CMP_GREEN 0xCF #define COLOR_CMP_BLUE 0xD0 #define DDA_X_INIT_L 0xD1 #define DDA_X_INIT_H 0xD2 #define DDA_X_INC_L 0xD3 #define DDA_X_INC_H 0xD4 #define DDA_Y_INIT_L 0xD5 #define DDA_Y_INIT_H 0xD6 #define DDA_Y_INC_L 0xD7 #define DDA_Y_INC_H 0xD8 #define FIFO_TIMING_CTL_L 0xD9 #define FIFO_TIMING_CTL_H 0xDA #define VIDEO_FORMAT 0xDB #define DISP_CTL_I 0xDC #define FIFO_CTL_I 0xDD #define MISC_CTL_I 0xDE void cyber_cleanup_overlay(void); void cyber_init_overlay(void); void cyber_enable_overlay(int enable); void cyber_change_overlay_fifo(void); void cyber_set_overlay_format(int format); void cyber_set_overlay_mode(int mode); void cyber_set_overlay_srcaddr(int addr, int x, int y, int width, int pitch); void cyber_set_overlay_window(int left, int top, int right, int bottom); void cyber_set_overlay_scale( unsigned char bEnableBob, int wSrcXExt, int wDstXExt, int wSrcYExt, int wDstYExt ); #endif /* CYBER5KFB_OVERLAY_H */ DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k_alpha.c0000644000175000017500000001776711245562152016567 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "cyber5k.h" #include "cyber5k_alpha.h" #include "regs.h" void cyber_cleanup_alpha(void) { int i; cyber_grphw(0xfa, 0); for (i=0; i<16; i++) { if (i == 0x0A) {/*Don't clean up SyncLock video path if there is one*/ cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0x08); } else { cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, 0x00); } } cyber_grphw(0xfa, 8); for (i=0; i<16; i++) { if(i==0x0F) {/*Just in case there is a SyncLock video*/ cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, 0x00); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0xC0); } else { cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, 0x00); } } cyber_grphw(0xfa, 0x10); for (i=0; i<16; i++) { cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, 0x00); } cyber_grphw(0xfa, 0x18); for (i=0; i<16; i++) { cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, 0x00); } cyber_grphw(0xfa, 0x20); for (i=0; i<16; i++) { cyber_out8(cyber_mmio, SEQINDEX, 0x40 + i); cyber_out8(cyber_mmio, SEQDATA, 0x00); } cyber_out8(cyber_mmio, SEQINDEX, 0xA6); /*for video capture*/ cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0xF0); #if 0 /*for 8-bit Index mode*/ if(bEnabled8Bit) /*if we are in 8-bit alpha-blending mode, remember to disable it*/ EnablePaletteMode(0); #endif cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0x80); cyber_out8(cyber_mmio, GRAINDEX, 0xe0); cyber_out8(cyber_mmio, GRADATA, cyber_in8(cyber_mmio, 0x03cf) | 0x04); cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0x00); } void cyber_enable_alpha(int enable) { cyber_grphw(0xfa, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x4b); if (enable) cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) | 0x80)); else cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & 0x7F)); } void cyber_enable_fullscreen_alpha(int enable) { cyber_grphw(0xfa, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x4b); if (enable) cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) | 0x40)); else cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & 0xBF)); } void cyber_select_blend_src1(int src) { cyber_grphw(0xfa, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x49); cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x03) | src); } void cyber_select_blend_src2(int src) { cyber_grphw(0xfa, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x4d); cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x30) | (src << 4)); if(src == SRC2_OVERLAY1) { /*if source is Overlay one only, disable Overlay 2*/ cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0x08); cyber_out8(cyber_mmio, SEQINDEX, 0x4f); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0x08); cyber_out8(cyber_mmio, GRADATA, 0x00); } } void cyber_select_alpha_src(int src) { cyber_grphw(0xfa, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x49); cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x60) | (src << 5)); /*if alpha source comes form Overlay2, we need to disable Overlay2 color key function*/ if(src == ALPHA_OVERLAY2) { /*Disable Overlay 2 in Source B path*/ cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0x08); cyber_out8(cyber_mmio, SEQINDEX, 0x4f); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0x08); /*Disable V2 generally */ cyber_out8(cyber_mmio, GRADATA, 0x20); cyber_out8(cyber_mmio, SEQINDEX, 0x47); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) | 0x02); cyber_out8(cyber_mmio, GRADATA, 0x00); } } void cyber_set_alpha_reg(unsigned char r, unsigned char g, unsigned char b) { cyber_grphw(0xfa, 0); cyber_seqw(0x46, r); cyber_seqw(0x47, g); cyber_seqw(0x48, b); } void cyber_set_magic_match_reg( unsigned char bR, unsigned char bG, unsigned char bB ) { cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 8); /*Disable range feature first*/ cyber_out8(cyber_mmio, SEQINDEX, 0x46); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0x7F); cyber_out8(cyber_mmio, SEQINDEX, 0x40); cyber_out8(cyber_mmio, SEQDATA, bR); cyber_out8(cyber_mmio, SEQINDEX, 0x41); cyber_out8(cyber_mmio, SEQDATA, bG); cyber_out8(cyber_mmio, SEQINDEX, 0x42); cyber_out8(cyber_mmio, SEQDATA, bB); } void cyber_set_alpha_RAM_reg( unsigned char bIndex, unsigned char bR, unsigned char bG, unsigned char bB) { unsigned char bData; cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x49); bData = cyber_in8(cyber_mmio, SEQDATA); cyber_out8(cyber_mmio, SEQDATA, 0x18); /*select CPU to write*/ cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*enable index of alpha RAM R*/ cyber_out8(cyber_mmio, SEQDATA, 0x20+bIndex); cyber_out8(cyber_mmio, SEQINDEX, 0x4f); /*RAM data port*/ cyber_out8(cyber_mmio, SEQDATA, bR); cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*enable index of alpha RAM G*/ cyber_out8(cyber_mmio, SEQDATA, 0x40+bIndex); cyber_out8(cyber_mmio, SEQINDEX, 0x4f); /*RAM data port*/ cyber_out8(cyber_mmio, SEQDATA, bG); cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*enable index of alpha RAM B*/ cyber_out8(cyber_mmio, SEQDATA, 0x80+bIndex); cyber_out8(cyber_mmio, SEQINDEX, 0x4f); /*RAM data port*/ cyber_out8(cyber_mmio, SEQDATA, bB); cyber_out8(cyber_mmio, SEQINDEX, 0x49); cyber_out8(cyber_mmio, SEQDATA, bData); cyber_out8(cyber_mmio, SEQINDEX, 0x4e); /*Set index of alpha RAM */ cyber_out8(cyber_mmio, SEQDATA, bIndex); } void cyber_select_RAM_addr( unsigned char bRAMAddrSel ) { cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0); cyber_out8(cyber_mmio, SEQINDEX, 0x49); cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x18) | (bRAMAddrSel << 3)); } void cyber_enable_magic_alpha_blend( unsigned char enable ) { cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 8); cyber_out8(cyber_mmio, SEQINDEX, 0x46); if (enable) cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) | 0x01)); else cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & 0xFE)); cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 0x20); cyber_out8(cyber_mmio, SEQINDEX, 0x47); cyber_out8(cyber_mmio, SEQDATA, cyber_in8(cyber_mmio, SEQDATA) & 0x7F); cyber_out8(cyber_mmio, GRADATA, 0x00); } void cyber_select_magic_alpha_src( unsigned char bAlphaSrc ) { cyber_out8(cyber_mmio, GRAINDEX, 0xfa); cyber_out8(cyber_mmio, GRADATA, 8); cyber_out8(cyber_mmio, SEQINDEX, 0x46); cyber_out8(cyber_mmio, SEQDATA, (cyber_in8(cyber_mmio, SEQDATA) & ~0x0C) | (bAlphaSrc << 2)); } DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k_alpha.h0000644000175000017500000000432611245562152016557 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef CYBER5KFB_ALPHA_H #define CYBER5KFB_ALPHA_H #include "mmio.h" #define SRC1_GRAPHICS 0 #define SRC1_OVERLAY1 1 #define SRC1_OVERLAY2 2 #define SRC2_OVERLAY1 0 #define SRC2_OVERLAY2 1 #define SRC2_GRAPHICS 2 #define ALPHA_GRAPHICS 0 #define ALPHA_OVERLAY2 1 #define ALPHA_LOOKUP 2 #define ALPHA_REGISTER 3 #define RAM_CPU 3 void cyber_cleanup_alpha(void); void cyber_enable_alpha(int enable); void cyber_enable_fullscreen_alpha(int enable); void cyber_cleanup_alpha(void); void cyber_select_blend_src1(int src); void cyber_select_blend_src2(int src); void cyber_select_alpha_src(int src); void cyber_set_alpha_reg(unsigned char r, unsigned char g, unsigned char b); void cyber_select_RAM_addr( unsigned char bRAMAddrSel ); void cyber_set_alpha_RAM_reg( unsigned char bIndex, unsigned char bR, unsigned char bG, unsigned char bB); void cyber_select_magic_alpha_src( unsigned char bAlphaSrc ); void cyber_enable_magic_alpha_blend( unsigned char enable ); void cyber_set_magic_match_reg( unsigned char bR, unsigned char bG, unsigned char bB ); #endif /* CYBER5KFB_ALPHA_H */ DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k.h0000644000175000017500000000333011245562152015404 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___CYBER5K_H__ #define ___CYBER5K_H__ #include #include /* HACK */ extern volatile u8 *cyber_mmio; typedef struct { volatile u8 *mmio_base; } CyberDriverData; typedef struct { /* state validation */ int v_dst; int v_src; int v_color; int v_src_colorkey; int v_blitting_cmd; /* stored values */ u32 dst_pixeloffset; u32 dst_pixelpitch; u32 src_pixeloffset; u32 src_pixelpitch; u32 blitting_cmd; } CyberDeviceData; extern DisplayLayerFuncs cyberUnderlayFuncs; #endif DirectFB-1.2.10/gfxdrivers/cyber5k/cyber5k_overlay.c0000644000175000017500000002764611245562152017160 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include "cyber5k.h" #include "cyber5k_overlay.h" #include "regs.h" #include "mmio.h" static int overlay_byte_per_pixel = 2; static int overlay_init = 0; static unsigned char savedReg74, savedReg75; /*FIFO control registers for 2D Graphics*/ static unsigned char savedRegD9[2], savedRegDA[2], savedRegDD[2]; /*FIFO control registers for Overlay*/ /*Following is our FIFO policy number, should be programmed to 0x3CE/0x74, 0x3CE/0x75, 0x3CE(0x3C4)/0xD9, 0x3CE(0x3C4)/0xDA, 0x3CE(0x3c4)/0xDD respectively in order to get a best memory bandwidth. Current value is a group of experence value based on 70MHZ EDO/SG RAM.*/ static unsigned char bFIFOPolicyNum[5] = {0x10, 0x10, 0x1C, 0x1C, 0x06}; static void cyber_videoreg_mask( unsigned char index, unsigned char value, unsigned char mask ) { unsigned char tmp; cyber_out8( cyber_mmio, GRAINDEX, index ); tmp = cyber_in8( cyber_mmio, GRADATA ); tmp &= mask; tmp |= value; cyber_out8( cyber_mmio, GRADATA, tmp ); } static void cyber_seqreg_mask( unsigned char index, unsigned char value, unsigned char mask ) { unsigned char tmp; cyber_out8( cyber_mmio, SEQINDEX, index ); tmp = cyber_in8( cyber_mmio, SEQDATA ); tmp &= mask; tmp |= value; cyber_out8( cyber_mmio, SEQDATA, tmp ); } static void cyber_overlayreg_mask( unsigned char index, unsigned char value, unsigned char mask ) { unsigned char tmp; cyber_out8( cyber_mmio, GRAINDEX, index ); tmp = cyber_in8( cyber_mmio, GRADATA ); tmp &= mask; tmp |= value; cyber_out8(cyber_mmio, GRADATA, tmp); } void cyber_cleanup_overlay(void) { /*restore FIFO control regs*/ cyber_seqreg_mask(0xA7, 0x0, ~0x5); if (!overlay_init) return; overlay_init = 0; cyber_grphw(0x74, savedReg74); cyber_grphw(0x75, savedReg75); cyber_grphw(0xD9, savedRegD9[0]); cyber_grphw(0xDA, savedRegDA[0]); cyber_grphw(0xDD, savedRegDD[0]); cyber_seqw(0xD9, savedRegD9[1]); cyber_seqw(0xDA, savedRegDA[1]); cyber_seqw(0xDD, savedRegDD[1]); } void cyber_init_overlay(void) { /*Clear Overlay path first*/ cyber_grphw(DISP_CTL_I, 0x00); /* Video Display Vertical Starting Line (may not need initiate here)*/ cyber_grphw(DEST_RECT_TOP_L, 0x00); cyber_grphw(DEST_RECT_TOP_H, 0x00); /* Overlay Vertical DDA Increment Value*/ cyber_grphw(DDA_Y_INC_L, 0x00); cyber_grphw(DDA_Y_INC_H, 0x10); /* Video Memory Starting Address*/ cyber_grphw(MEMORY_START_L, 0x00); cyber_grphw(MEMORY_START_M, 0x0f); cyber_grphw(MEMORY_START_H, 0x03); /* Temporary fixed to 0x30f00 = 0xc3c00 >> 2*/ /* 0x3c00 = 0x300*0x14 = 768*20*/ /* Video Display Horizontal Starting Pixel -- may not need init here*/ cyber_grphw(DEST_RECT_LEFT_L, 0x20); cyber_grphw(DEST_RECT_LEFT_H, 0x00); /* Video Display Horizontal Ending Pixel -- may not need init here*/ cyber_grphw(DEST_RECT_RIGHT_L, 0x60); cyber_grphw(DEST_RECT_RIGHT_H, 0x01); /* Video Display Vertical Ending Line -- may not need init here*/ cyber_grphw(DEST_RECT_BOTTOM_L, 0xe0); cyber_grphw(DEST_RECT_BOTTOM_H, 0x00); /* Video Color Compare Register*/ cyber_grphw(COLOR_CMP_RED, 0x00); cyber_grphw(COLOR_CMP_GREEN,0x00); cyber_grphw(COLOR_CMP_BLUE, 0x00); /* Video Horizontal DDA Increment Value*/ cyber_grphw(DDA_X_INC_L, 0x00); cyber_grphw(DDA_X_INC_H, 0x10); /* Video Format Control*/ cyber_grphw(VIDEO_FORMAT, 0x00); /* Video Misc Control*/ cyber_grphw(MISC_CTL_I, 0x00); cyber_grphw(MISC_CTL_I, 0x01); /* Video Misc Control*/ /*default to colorkey*/ cyber_grphw(DISP_CTL_I, 0x04 ); #ifdef NTSCTVOUT /*if your TV output mode is NTSC*/ cyber_seqreg_mask(0xA6, 0x20, ~0x30); #else /*if your TV output mode is PAL*/ cyber_seqreg_mask(0xA6, 0x30, ~0x30); #endif if (overlay_init) return; overlay_init = 1; /* the following code is commented out, since saved values are not clean if */ /* DirectFB crashed while underlay was enabled, hardcoded bootup */ /* values instead (see below) */ /* cyber_out8(cyber_mmio, GRAINDEX, 0x74); savedReg74 = cyber_in8(cyber_mmio, GRADATA); cyber_out8(cyber_mmio, GRAINDEX, 0x75); savedReg75 = cyber_in8(cyber_mmio, GRADATA); cyber_out8(cyber_mmio, GRAINDEX, 0xD9); savedRegD9[0] = cyber_in8(cyber_mmio, GRADATA); cyber_out8(cyber_mmio, GRAINDEX, 0xDA); savedRegDA[0] = cyber_in8(cyber_mmio, GRADATA); cyber_out8(cyber_mmio, GRAINDEX, 0xDD); savedRegDD[0] = cyber_in8(cyber_mmio, GRADATA); cyber_out8(cyber_mmio, SEQINDEX, 0xD9); savedRegD9[1] = cyber_in8(cyber_mmio, SEQDATA); cyber_out8(cyber_mmio, SEQINDEX, 0xDA); savedRegDA[1] = cyber_in8(cyber_mmio, SEQDATA); cyber_out8(cyber_mmio, SEQINDEX, 0xDD); savedRegDD[1] = cyber_in8(cyber_mmio, SEQDATA); */ savedReg74 = 0x1b; savedReg74 = 0x1e; savedRegD9[0] = 0x0f; savedRegDA[0] = 0x1b; savedRegDD[0] = 0x00; savedRegD9[1] = 0x0f; savedRegDA[1] = 0x1b; savedRegDD[1] = 0x00; } void cyber_change_overlay_fifo(void) { cyber_grphw(0x74, bFIFOPolicyNum[0]); cyber_grphw(0x75, bFIFOPolicyNum[1]); cyber_grphw(0xD9, bFIFOPolicyNum[2]); cyber_grphw(0xDA, bFIFOPolicyNum[3]); cyber_videoreg_mask(0xA6, 0x08, ~0x08); cyber_videoreg_mask(0xF1, 0x40, (unsigned char)(~0xC0)); cyber_overlayreg_mask(FIFO_CTL_I, bFIFOPolicyNum[4] & 0x05, ~0x05); cyber_overlayreg_mask(FIFO_CTL_I, 0x2, ~0x02); } void cyber_set_overlay_format(int format) { switch (format) { case OVERLAY_YUV422: cyber_overlayreg_mask( VIDEO_FORMAT, 0x00, 0xF8 ); overlay_byte_per_pixel = 2; break; case OVERLAY_RGB555: cyber_overlayreg_mask( VIDEO_FORMAT, 0x01, 0xF8 ); overlay_byte_per_pixel = 2; break; case OVERLAY_RGB565: cyber_overlayreg_mask( VIDEO_FORMAT, 0x02, 0xF8 ); overlay_byte_per_pixel = 2; break; case OVERLAY_RGB888: cyber_overlayreg_mask( VIDEO_FORMAT, 0x03, 0xF8 ); overlay_byte_per_pixel = 3; break; case OVERLAY_RGB8888: cyber_overlayreg_mask( VIDEO_FORMAT, 0x04, 0xF8 ); overlay_byte_per_pixel = 4; break; case OVERLAY_RGB8: cyber_overlayreg_mask( VIDEO_FORMAT, 0x05, 0xF8 ); overlay_byte_per_pixel = 1; break; case OVERLAY_RGB4444: cyber_overlayreg_mask( VIDEO_FORMAT, 0x06, 0xF8 ); overlay_byte_per_pixel = 2; break; case OVERLAY_RGB8T: cyber_overlayreg_mask( VIDEO_FORMAT, 0x07, 0xF8 ); overlay_byte_per_pixel = 1; break; } } void cyber_set_overlay_mode(int mode) { switch (mode) { case OVERLAY_COLORKEY: cyber_overlayreg_mask( DISP_CTL_I, 0x00, 0xFD ); break; case OVERLAY_WINDOWKEY: default: cyber_overlayreg_mask( DISP_CTL_I, 0x02, 0xFD ); break; } } void cyber_set_overlay_srcaddr(int addr, int x, int y, int width, int pitch) { unsigned char bHigh; int wByteFetch; addr += y * pitch + x * overlay_byte_per_pixel; addr >>= 2; /*playback start addr*/ cyber_grphw( MEMORY_START_L, (unsigned char)( addr & 0x0000FF) ); cyber_grphw( MEMORY_START_M, (unsigned char)((addr & 0x00FF00) >> 8) ); cyber_grphw( MEMORY_START_H, (unsigned char)((addr & 0xFF0000) >> 16) ); /* pitch is a multiple of 64 bits*/ pitch >>= 3; /* 64 bit address field*/ wByteFetch = (width * overlay_byte_per_pixel + 7) >> 3; bHigh = (unsigned char)(pitch >> 8) & 0x0F; bHigh = bHigh | (((unsigned char)(wByteFetch >> 8)) << 4 ); cyber_grphw( MEMORY_PITCH_L, (unsigned char)(pitch) ); cyber_grphw( MEMORY_PITCH_H, bHigh ); cyber_grphw( MEMORY_OFFSET_PHASE, (unsigned char)(wByteFetch) ); if (width > 720) /*Turn off interpolation*/ cyber_overlayreg_mask( DISP_CTL_I, 0x20, 0xDF ); else { /*Turn off interpolation*/ if (width > 360) { /* Y Only*/ cyber_seqreg_mask(0xA6, 0x40, ~0x40); } else { cyber_seqreg_mask(0xA6, 0x00, ~0x40); } cyber_overlayreg_mask( DISP_CTL_I, 0x00, 0xDF ); } } void cyber_set_overlay_window(int left, int top, int right, int bottom) { cyber_grphw( DEST_RECT_LEFT_L, (unsigned char)(left ) ); cyber_grphw( DEST_RECT_LEFT_H, (unsigned char)(left >> 8) ); cyber_grphw( DEST_RECT_RIGHT_L, (unsigned char)(right ) ); cyber_grphw( DEST_RECT_RIGHT_H, (unsigned char)(right >> 8) ); cyber_grphw( DEST_RECT_TOP_L, (unsigned char)(top ) ); cyber_grphw( DEST_RECT_TOP_H, (unsigned char)(top >> 8) ); cyber_grphw( DEST_RECT_BOTTOM_L, (unsigned char)(bottom ) ); cyber_grphw( DEST_RECT_BOTTOM_H, (unsigned char)(bottom >> 8) ); } void cyber_set_overlay_scale( unsigned char bEnableBob, int wSrcXExt, int wDstXExt, int wSrcYExt, int wDstYExt ) { int dwScale; cyber_grphw( DDA_X_INIT_L, 0x0 ); /* set to 0x800;*/ cyber_grphw( DDA_X_INIT_H, 0x8 ); if ( wSrcXExt == wDstXExt ) dwScale = 0x1000; else dwScale = ( wSrcXExt * 0x1000 ) / wDstXExt; cyber_grphw( DDA_X_INC_L, (unsigned char)( dwScale & 0x00FF) ); cyber_grphw( DDA_X_INC_H, (unsigned char)((dwScale & 0xFF00) >> 8) ); cyber_grphw( DDA_Y_INIT_L, 0x0 ); /* set to 0x800;*/ cyber_grphw( DDA_Y_INIT_H, 0x8 ); if ( wSrcYExt == wDstYExt ) dwScale = 0x1000; else dwScale = ( wSrcYExt * 0x1000 ) / wDstYExt; if (bEnableBob == 0) {/*Disable Bob mode*/ cyber_seqreg_mask(0xA7, 0x0, ~0x5); /*Bob/Weave disable*/ } else {/*Enable Bob mode*/ wSrcYExt = wSrcYExt / 2; if (wSrcYExt == wDstYExt) dwScale = 0x1000; else dwScale = ( wSrcYExt * 0x1000 ) / wDstYExt; if (dwScale <= 0x815 && dwScale >= 0x7eb) { cyber_seqreg_mask(0xA7, 0x5, ~0x5); /*Bob/Weave enable*/ } else { cyber_seqreg_mask(0xA7, 0x4, ~0x5); /*Bob/Weave enable*/ } } cyber_grphw( DDA_Y_INC_L, (unsigned char)( dwScale & 0x00FF) ); cyber_grphw( DDA_Y_INC_H, (unsigned char)((dwScale & 0xFF00) >> 8) ); } void cyber_enable_overlay(int enable) { if (enable) cyber_overlayreg_mask( DISP_CTL_I, 0x84, (unsigned char)(~0x84) ); else cyber_overlayreg_mask( DISP_CTL_I, 0x00, 0x7F ); /* Disable Vafc !!!*/ } DirectFB-1.2.10/gfxdrivers/vmware/0000777000175000017500000000000011307522571013711 500000000000000DirectFB-1.2.10/gfxdrivers/vmware/vmware_gfxdriver.h0000644000175000017500000000320611245562152017360 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VMWARE_GFXDRIVER_H__ #define __VMWARE_GFXDRIVER_H__ #ifndef FB_ACCEL_VMWARE_BLITTER #define FB_ACCEL_VMWARE_BLITTER 51 #endif typedef struct { /* validation flags */ int v_flags; /* cached/computed values */ void *dst_addr; unsigned long dst_pitch; DFBSurfacePixelFormat dst_format; unsigned long dst_bpp; void *src_addr; unsigned long src_pitch; DFBSurfacePixelFormat src_format; unsigned long src_bpp; unsigned long color_pixel; /** Add shared data here... **/ } VMWareDeviceData; typedef struct { /** Add local data here... **/ } VMWareDriverData; #endif DirectFB-1.2.10/gfxdrivers/vmware/Makefile.am0000644000175000017500000000133111245562152015657 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/vmware INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems vmware_LTLIBRARIES = libdirectfb_vmware.la if BUILD_STATIC vmware_DATA = $(vmware_LTLIBRARIES:.la=.o) endif vmwaredir = $(MODULEDIR)/gfxdrivers libdirectfb_vmware_la_SOURCES = \ vmware_2d.c \ vmware_2d.h \ vmware_gfxdriver.c \ vmware_gfxdriver.h libdirectfb_vmware_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) -lm libdirectfb_vmware_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/vmware/Makefile.in0000644000175000017500000004520311307521501015666 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/vmware ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(vmwaredir)" "$(DESTDIR)$(vmwaredir)" vmwareLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(vmware_LTLIBRARIES) libdirectfb_vmware_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_vmware_la_OBJECTS = vmware_2d.lo vmware_gfxdriver.lo libdirectfb_vmware_la_OBJECTS = $(am_libdirectfb_vmware_la_OBJECTS) libdirectfb_vmware_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_vmware_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_vmware_la_SOURCES) DIST_SOURCES = $(libdirectfb_vmware_la_SOURCES) vmwareDATA_INSTALL = $(INSTALL_DATA) DATA = $(vmware_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems vmware_LTLIBRARIES = libdirectfb_vmware.la @BUILD_STATIC_TRUE@vmware_DATA = $(vmware_LTLIBRARIES:.la=.o) vmwaredir = $(MODULEDIR)/gfxdrivers libdirectfb_vmware_la_SOURCES = \ vmware_2d.c \ vmware_2d.h \ vmware_gfxdriver.c \ vmware_gfxdriver.h libdirectfb_vmware_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) -lm libdirectfb_vmware_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/vmware/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/vmware/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-vmwareLTLIBRARIES: $(vmware_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(vmwaredir)" || $(MKDIR_P) "$(DESTDIR)$(vmwaredir)" @list='$(vmware_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(vmwareLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(vmwaredir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(vmwareLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(vmwaredir)/$$f"; \ else :; fi; \ done uninstall-vmwareLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(vmware_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(vmwaredir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(vmwaredir)/$$p"; \ done clean-vmwareLTLIBRARIES: -test -z "$(vmware_LTLIBRARIES)" || rm -f $(vmware_LTLIBRARIES) @list='$(vmware_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_vmware.la: $(libdirectfb_vmware_la_OBJECTS) $(libdirectfb_vmware_la_DEPENDENCIES) $(libdirectfb_vmware_la_LINK) -rpath $(vmwaredir) $(libdirectfb_vmware_la_OBJECTS) $(libdirectfb_vmware_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware_2d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware_gfxdriver.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-vmwareDATA: $(vmware_DATA) @$(NORMAL_INSTALL) test -z "$(vmwaredir)" || $(MKDIR_P) "$(DESTDIR)$(vmwaredir)" @list='$(vmware_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(vmwareDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(vmwaredir)/$$f'"; \ $(vmwareDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(vmwaredir)/$$f"; \ done uninstall-vmwareDATA: @$(NORMAL_UNINSTALL) @list='$(vmware_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(vmwaredir)/$$f'"; \ rm -f "$(DESTDIR)$(vmwaredir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(vmwaredir)" "$(DESTDIR)$(vmwaredir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-vmwareLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-vmwareDATA install-vmwareLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-vmwareDATA uninstall-vmwareLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-vmwareLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-vmwareDATA install-vmwareLTLIBRARIES \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-vmwareDATA \ uninstall-vmwareLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/vmware/vmware_2d.c0000644000175000017500000003053311245562152015663 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //#define DIRECT_ENABLE_DEBUG #include #include #include #include #include #include #include #include #include "vmware_2d.h" #include "vmware_gfxdriver.h" D_DEBUG_DOMAIN( VMWare_2D, "VMWare/2D", "VMWare 2D Acceleration" ); /* * State validation flags. * * There's no prefix because of the macros below. */ enum { DESTINATION = 0x00000001, COLOR = 0x00000002, SOURCE = 0x00000010, ALL = 0x00000013 }; /* * State handling macros. */ #define VMWARE_VALIDATE(flags) do { vdev->v_flags |= (flags); } while (0) #define VMWARE_INVALIDATE(flags) do { vdev->v_flags &= ~(flags); } while (0) #define VMWARE_CHECK_VALIDATE(flag) do { \ if (! (vdev->v_flags & flag)) \ vmware_validate_##flag( vdev, state ); \ } while (0) /**************************************************************************************************/ /* * Called by vmwareSetState() to ensure that the destination registers are properly set * for execution of rendering functions. */ static inline void vmware_validate_DESTINATION( VMWareDeviceData *vdev, CardState *state ) { /* Remember destination parameters for usage in rendering functions. */ vdev->dst_addr = state->dst.addr; vdev->dst_pitch = state->dst.pitch; vdev->dst_format = state->dst.buffer->format; vdev->dst_bpp = DFB_BYTES_PER_PIXEL( vdev->dst_format ); /* Set the flag. */ VMWARE_VALIDATE( DESTINATION ); } /* * 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 ); } /* * Called by vmwareSetState() to ensure that the source registers are properly set * for execution of blitting functions. */ static inline void vmware_validate_SOURCE( VMWareDeviceData *vdev, CardState *state ) { /* Remember source parameters for usage in rendering functions. */ vdev->src_addr = state->src.addr; vdev->src_pitch = state->src.pitch; vdev->src_format = state->src.buffer->format; vdev->src_bpp = DFB_BYTES_PER_PIXEL( vdev->src_format ); /* Set the flag. */ VMWARE_VALIDATE( SOURCE ); } /**************************************************************************************************/ /* * Wait for the blitter to be idle. * * This function is called before memory that has been written to by the hardware is about to be * accessed by the CPU (software driver) or another hardware entity like video encoder (by Flip()). * It can also be called by applications explicitly, e.g. at the end of a benchmark loop to include * execution time of queued commands in the measurement. */ DFBResult vmwareEngineSync( void *drv, void *dev ) { return DFB_OK; } /* * Reset the graphics engine. */ void vmwareEngineReset( void *drv, void *dev ) { } /* * Start processing of queued commands if required. * * This function is called before returning from the graphics core to the application. * Usually that's after each rendering function. The only functions causing multiple commands * to be queued with a single emition at the end are DrawString(), TileBlit(), BatchBlit(), * DrawLines() and possibly FillTriangle() which is emulated using multiple FillRectangle() calls. */ void vmwareEmitCommands( void *drv, void *dev ) { } /* * Check for acceleration of 'accel' using the given 'state'. */ void vmwareCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { D_DEBUG_AT( VMWare_2D, "vmwareCheckState (state %p, accel 0x%08x) <- dest %p\n", state, accel, state->destination ); /* Return if the desired function is not supported at all. */ if (accel & ~(VMWARE_SUPPORTED_DRAWINGFUNCTIONS | VMWARE_SUPPORTED_BLITTINGFUNCTIONS)) return; /* Return if the destination format is not supported. */ switch (state->destination->config.format) { case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB16: break; default: return; } /* Check if drawing or blitting is requested. */ if (DFB_DRAWING_FUNCTION( accel )) { /* Return if unsupported drawing flags are set. */ if (state->drawingflags & ~VMWARE_SUPPORTED_DRAWINGFLAGS) return; } else { /* Return if the source format is not supported. */ switch (state->source->config.format) { case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB16: /* FIXME: Currently only copying blits supported. */ if (state->source->config.format == state->destination->config.format) break; default: return; } /* Return if unsupported blitting flags are set. */ if (state->blittingflags & ~VMWARE_SUPPORTED_BLITTINGFLAGS) return; } /* Enable acceleration of the function. */ state->accel |= accel; } /* * Make sure that the hardware is programmed for execution of 'accel' according to the 'state'. */ void vmwareSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { VMWareDeviceData *vdev = (VMWareDeviceData*) dev; StateModificationFlags modified = state->mod_hw; D_DEBUG_AT( VMWare_2D, "vmwareSetState (state %p, accel 0x%08x) <- dest %p, modified 0x%08x\n", state, accel, state->destination, modified ); /* * 1) Invalidate hardware states * * Each modification to the hw independent state invalidates one or more hardware states. */ /* Simply invalidate all? */ if (modified == SMF_ALL) { VMWARE_INVALIDATE( ALL ); } else if (modified) { /* Invalidate destination registers. */ if (modified & SMF_DESTINATION) VMWARE_INVALIDATE( DESTINATION | COLOR ); else if (modified & SMF_COLOR) VMWARE_INVALIDATE( COLOR ); if (modified & SMF_SOURCE) VMWARE_INVALIDATE( SOURCE ); } /* * 2) Validate hardware states * * Each function has its own set of states that need to be validated. */ /* Always requiring valid destination... */ VMWARE_CHECK_VALIDATE( DESTINATION ); /* Depending on the function... */ switch (accel) { case DFXL_FILLRECTANGLE: /* ...require valid drawing color. */ VMWARE_CHECK_VALIDATE( COLOR ); /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set = VMWARE_SUPPORTED_DRAWINGFUNCTIONS; break; case DFXL_BLIT: /* ...require valid source. */ VMWARE_CHECK_VALIDATE( SOURCE ); /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set = VMWARE_SUPPORTED_BLITTINGFUNCTIONS; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } /* * 4) Clear modification flags * * All flags have been evaluated in 1) and remembered for further validation. * If the hw independent state is not modified, this function won't get called * for subsequent rendering functions, unless they aren't defined by 3). */ state->mod_hw = 0; } /* * Render a filled rectangle using the current hardware state. */ bool vmwareFillRectangle( void *drv, void *dev, DFBRectangle *rect ) { VMWareDeviceData *vdev = (VMWareDeviceData*) dev; void *addr = vdev->dst_addr + rect->y * vdev->dst_pitch + DFB_BYTES_PER_LINE(vdev->dst_format, rect->x); D_DEBUG_AT( VMWare_2D, "%s( %d,%d-%dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); switch (vdev->dst_bpp) { case 4: while (rect->h--) { int w = rect->w; u32 *dst = addr; while (w--) *dst++ = vdev->color_pixel; addr += vdev->dst_pitch; } break; case 2: while (rect->h--) { int w = rect->w; u16 *dst = addr; while (w--) *dst++ = vdev->color_pixel; addr += vdev->dst_pitch; } break; case 1: while (rect->h--) { int w = rect->w; u8 *dst = addr; while (w--) *dst++ = vdev->color_pixel; addr += vdev->dst_pitch; } break; } return true; } /* * Render a filled rectangle using the current hardware state. */ bool vmwareBlit( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ) { VMWareDeviceData *vdev = (VMWareDeviceData*) dev; void *dst = vdev->dst_addr + dy * vdev->dst_pitch + DFB_BYTES_PER_LINE(vdev->dst_format, dx); void *src = vdev->src_addr + srect->y * vdev->src_pitch + DFB_BYTES_PER_LINE(vdev->src_format, srect->x); D_DEBUG_AT( VMWare_2D, "%s( %d,%d-%dx%d -> %d, %d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( srect ), dx, dy ); while (srect->h--) { direct_memcpy( dst, src, srect->w * vdev->dst_bpp ); dst += vdev->dst_pitch; src += vdev->src_pitch; } return true; } DirectFB-1.2.10/gfxdrivers/vmware/vmware_2d.h0000644000175000017500000000477711245562152015703 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __VMWARE_2D_H__ #define __VMWARE_2D_H__ #define VMWARE_SUPPORTED_DRAWINGFLAGS (DSDRAW_NOFX) #define VMWARE_SUPPORTED_DRAWINGFUNCTIONS (DFXL_FILLRECTANGLE) #define VMWARE_SUPPORTED_BLITTINGFLAGS (DSBLIT_NOFX) #define VMWARE_SUPPORTED_BLITTINGFUNCTIONS (DFXL_BLIT) DFBResult vmwareEngineSync ( void *drv, void *dev ); void vmwareEngineReset ( void *drv, void *dev ); void vmwareEmitCommands ( void *drv, void *dev ); void vmwareCheckState ( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ); void vmwareSetState ( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ); bool vmwareFillRectangle( void *drv, void *dev, DFBRectangle *rect ); bool vmwareBlit ( void *drv, void *dev, DFBRectangle *srect, int dx, int dy ); #endif DirectFB-1.2.10/gfxdrivers/vmware/vmware_gfxdriver.c0000644000175000017500000000752011245562152017356 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "vmware_2d.h" #include "vmware_gfxdriver.h" #include DFB_GRAPHICS_DRIVER( vmware ) /**********************************************************************************************************************/ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_VMWARE_BLITTER: return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "VMWare Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Denis Oliver Kropp" ); info->version.major = 0; info->version.minor = 0; info->driver_data_size = sizeof(VMWareDriverData); info->device_data_size = sizeof(VMWareDeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { /* initialize function pointers */ funcs->EngineSync = vmwareEngineSync; funcs->EngineReset = vmwareEngineReset; funcs->EmitCommands = vmwareEmitCommands; funcs->CheckState = vmwareCheckState; funcs->SetState = vmwareSetState; funcs->FillRectangle = vmwareFillRectangle; funcs->Blit = vmwareBlit; return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { /* fill device info */ snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "VMWare" ); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "(fake) Blitter" ); /* device limitations */ device_info->limits.surface_byteoffset_alignment = 8; device_info->limits.surface_bytepitch_alignment = 8; device_info->caps.flags = 0; device_info->caps.accel = VMWARE_SUPPORTED_DRAWINGFUNCTIONS | VMWARE_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = VMWARE_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = VMWARE_SUPPORTED_BLITTINGFLAGS; return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { } DirectFB-1.2.10/gfxdrivers/unichrome/0000777000175000017500000000000011307522571014401 500000000000000DirectFB-1.2.10/gfxdrivers/unichrome/unichrome.c0000644000175000017500000004235411164361026016457 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ // DirectFB headers #include #include #include #include #include #include #include #include #include #include #include #include #include // System headers #include #include #include #include #include #include #include // Driver headers #include "unichrome.h" #include "uc_state.h" #include "uc_accel.h" #include "uc_fifo.h" #include "uc_ioctl.h" #include "mmio.h" #include "uc_probe.h" extern DisplayLayerFuncs ucOverlayFuncs; extern DisplayLayerFuncs ucPrimaryFuncs; extern DisplayLayerFuncs ucSubpictureFuncs; extern DisplayLayerFuncs ucOldPrimaryFuncs; extern void *ucOldPrimaryDriverData; DFB_GRAPHICS_DRIVER(unichrome) //---------- /* PCI probing code is derived from gfxdrivers/matrox/matrox.c */ /** Read PCI configuration register 'reg' for device at {bus,slot,func}. */ static int pci_config_in8( unsigned int bus, unsigned int slot, unsigned int func, u8 reg ) { char filename[512]; int fd; int val; val = 0; snprintf( filename, 512, "/proc/bus/pci/%02x/%02x.%x", bus, slot, func ); fd = open( filename, O_RDONLY ); if (fd < 0) { D_PERROR( "DirectFB/Unichrome: Error opening `%s'!\n", filename ); return -1; } if (lseek( fd, reg, SEEK_SET ) == reg) { if (read( fd, &val, 1 ) == 1) { close( fd ); return val; } } close( fd ); return -1; } /* Probe for a Unichrome device. * @returns DFB_OK if successful, with ucdrv->hwid, ucdrv->hwrev, * and ucdrv->name filled in. */ static DFBResult uc_probe_pci( UcDriverData *ucdrv ) { unsigned int bus, devfn, vendor, device; char line[512]; FILE *file; int i; const char* filename = "/proc/bus/pci/devices"; file = fopen( filename, "r" ); if (!file) { D_PERROR( "DirectFB/Unichrome: Error opening `%s'!\n", filename ); return errno2result( errno ); } while (fgets( line, 512, file )) { if (sscanf( line, "%02x%02x\t%04x%04x", &bus, &devfn, &vendor, &device ) != 4) continue; if (vendor != PCI_VENDOR_ID_VIA) continue; for (i = 0; uc_via_devices[i].id != 0; i++) { if (device == uc_via_devices[i].id) { // Found a Unichrome device. ucdrv->hwid = device; ucdrv->name = uc_via_devices[i].name; // Read its revision number from the host bridge. ucdrv->hwrev = pci_config_in8(0, 0, 0, 0xf6); if (ucdrv->hwrev == -1 && dfb_config->unichrome_revision == -1) { ucdrv->hwrev = 0x11; // a fairly arbitrary default D_ERROR( "DirectFB/Unichrome: Failed to determine hardware revision, assuming %d.\n", ucdrv->hwrev ); } // Because we can only auto-detect if we're superuser, // allow an override if (dfb_config->unichrome_revision != -1) ucdrv->hwrev = dfb_config->unichrome_revision; fclose( file ); return DFB_OK; } } } D_ERROR( "DirectFB/Unichrome: Can't find a Unichrome device in `%s'!\n", filename ); fclose( file ); return DFB_INIT; } /** * Dump beginning of virtual queue. * Use it to check that the VQ actually is in use. */ #if 0 static void uc_dump_vq(UcDeviceData *ucdev) { int i; u8* vq; if (!ucdev->vq_start) return; vq = dfb_system_video_memory_virtual(ucdev->vq_start); for (i = 0; i < 128; i++) { printf("%02x ", *(vq+i)); if ((i+1) % 16 == 0) printf("\n"); } } #endif /** Allocate memory for the virtual queue. */ static DFBResult uc_alloc_vq(CoreGraphicsDevice *device, UcDeviceData *ucdev) { if (ucdev->vq_start) return DFB_OK; ucdev->vq_size = 256*1024; // 256kb ucdev->vq_start = dfb_gfxcard_reserve_memory( device, ucdev->vq_size ); if (!ucdev->vq_start) return DFB_INIT; ucdev->vq_end = ucdev->vq_start + ucdev->vq_size - 1; // Debug: clear buffer memset((void *) dfb_system_video_memory_virtual(ucdev->vq_start), 0xcc, ucdev->vq_size); // uc_dump_vq(ucdev); return DFB_OK; } /** * Initialize the hardware. * @param enable enable VQ if true (else disable it.) */ static DFBResult uc_init_2d_engine(CoreGraphicsDevice *device, UcDeviceData *ucdev, UcDriverData *ucdrv, bool enable) { DFBResult result = DFB_OK; volatile u8* hwregs = ucdrv->hwregs; int i; // Init 2D engine registers to reset 2D engine for ( i = 0x04; i <= 0x40; i += 4 ) VIA_OUT(hwregs, i, 0x0); // Init AGP and VQ registers VIA_OUT(hwregs, 0x43c, 0x00100000); VIA_OUT(hwregs, 0x440, 0x00000000); VIA_OUT(hwregs, 0x440, 0x00333004); VIA_OUT(hwregs, 0x440, 0x60000000); VIA_OUT(hwregs, 0x440, 0x61000000); VIA_OUT(hwregs, 0x440, 0x62000000); VIA_OUT(hwregs, 0x440, 0x63000000); VIA_OUT(hwregs, 0x440, 0x64000000); VIA_OUT(hwregs, 0x440, 0x7D000000); VIA_OUT(hwregs, 0x43c, 0xfe020000); VIA_OUT(hwregs, 0x440, 0x00000000); if (enable) { result = uc_alloc_vq(device,ucdev); enable = (result == DFB_OK); } if (enable) { // Enable VQ VIA_OUT(hwregs, 0x43c, 0x00fe0000); VIA_OUT(hwregs, 0x440, 0x080003fe); VIA_OUT(hwregs, 0x440, 0x0a00027c); VIA_OUT(hwregs, 0x440, 0x0b000260); VIA_OUT(hwregs, 0x440, 0x0c000274); VIA_OUT(hwregs, 0x440, 0x0d000264); VIA_OUT(hwregs, 0x440, 0x0e000000); VIA_OUT(hwregs, 0x440, 0x0f000020); VIA_OUT(hwregs, 0x440, 0x1000027e); VIA_OUT(hwregs, 0x440, 0x110002fe); VIA_OUT(hwregs, 0x440, 0x200f0060); VIA_OUT(hwregs, 0x440, 0x00000006); VIA_OUT(hwregs, 0x440, 0x40008c0f); VIA_OUT(hwregs, 0x440, 0x44000000); VIA_OUT(hwregs, 0x440, 0x45080c04); VIA_OUT(hwregs, 0x440, 0x46800408); VIA_OUT(hwregs, 0x440, 0x52000000 | ((ucdev->vq_start & 0xFF000000) >> 24) | ((ucdev->vq_end & 0xFF000000) >> 16)); VIA_OUT(hwregs, 0x440, 0x50000000 | (ucdev->vq_start & 0xFFFFFF)); VIA_OUT(hwregs, 0x440, 0x51000000 | (ucdev->vq_end & 0xFFFFFF)); VIA_OUT(hwregs, 0x440, 0x53000000 | (ucdev->vq_size >> 3)); } else { // Disable VQ VIA_OUT(hwregs, 0x43c, 0x00fe0000); VIA_OUT(hwregs, 0x440, 0x00000004); VIA_OUT(hwregs, 0x440, 0x40008c0f); VIA_OUT(hwregs, 0x440, 0x44000000); VIA_OUT(hwregs, 0x440, 0x45080c04); VIA_OUT(hwregs, 0x440, 0x46800408); } return result; } static void uc_init_3d_engine(volatile u8* hwregs, int hwrev, bool init_all) { u32 i; if (init_all) { // Clear NotTex registers VIA_OUT(hwregs, 0x43C, 0x00010000); for (i = 0; i <= 0x7d; i++) VIA_OUT(hwregs, 0x440, i << 24); // Clear texture unit 0 VIA_OUT(hwregs, 0x43C, 0x00020000); for (i = 0; i <= 0x94; i++) VIA_OUT(hwregs, 0x440, i << 24); VIA_OUT(hwregs, 0x440, 0x82400000); // Clear texture unit 1 VIA_OUT(hwregs, 0x43C, 0x01020000); for (i = 0; i <= 0x94; i++) VIA_OUT(hwregs, 0x440, i << 24); VIA_OUT(hwregs, 0x440, 0x82400000); // Clear general texture settings VIA_OUT(hwregs, 0x43C, 0xfe020000); for (i = 0; i <= 0x03; i++) VIA_OUT(hwregs, 0x440, i << 24); // Clear palette settings VIA_OUT(hwregs, 0x43C, 0x00030000); for (i = 0; i <= 0xff; i++) VIA_OUT(hwregs, 0x440, 0); VIA_OUT(hwregs, 0x43C, 0x00100000); VIA_OUT(hwregs, 0x440, 0x00333004); VIA_OUT(hwregs, 0x440, 0x10000002); VIA_OUT(hwregs, 0x440, 0x60000000); VIA_OUT(hwregs, 0x440, 0x61000000); VIA_OUT(hwregs, 0x440, 0x62000000); VIA_OUT(hwregs, 0x440, 0x63000000); VIA_OUT(hwregs, 0x440, 0x64000000); VIA_OUT(hwregs, 0x43C, 0x00fe0000); if (hwrev >= 3) VIA_OUT(hwregs, 0x440,0x40008c0f); else VIA_OUT(hwregs, 0x440,0x4000800f); VIA_OUT(hwregs, 0x440,0x44000000); VIA_OUT(hwregs, 0x440,0x45080C04); VIA_OUT(hwregs, 0x440,0x46800408); VIA_OUT(hwregs, 0x440,0x50000000); VIA_OUT(hwregs, 0x440,0x51000000); VIA_OUT(hwregs, 0x440,0x52000000); VIA_OUT(hwregs, 0x440,0x53000000); } VIA_OUT(hwregs, 0x43C,0x00fe0000); VIA_OUT(hwregs, 0x440,0x08000001); VIA_OUT(hwregs, 0x440,0x0A000183); VIA_OUT(hwregs, 0x440,0x0B00019F); VIA_OUT(hwregs, 0x440,0x0C00018B); VIA_OUT(hwregs, 0x440,0x0D00019B); VIA_OUT(hwregs, 0x440,0x0E000000); VIA_OUT(hwregs, 0x440,0x0F000000); VIA_OUT(hwregs, 0x440,0x10000000); VIA_OUT(hwregs, 0x440,0x11000000); VIA_OUT(hwregs, 0x440,0x20000000); } /** */ static void uc_after_set_var(void* drv, void* dev) { UcDriverData* ucdrv = (UcDriverData*) drv; VGA_OUT8(ucdrv->hwregs, 0x3c4, 0x1a); // Clear bit 6 in extended VGA register 0x1a to prevent system lockup. VGA_OUT8(ucdrv->hwregs, 0x3c5, VGA_IN8(ucdrv->hwregs, 0x3c5) & 0xbf); // Set bit 2, it might make a difference. VGA_OUT8(ucdrv->hwregs, 0x3c5, VGA_IN8(ucdrv->hwregs, 0x3c5) | 0x4); VIA_OUT(ucdrv->hwregs, VIA_REG_CURSOR_MODE, VIA_IN(ucdrv->hwregs, VIA_REG_CURSOR_MODE) & 0xFFFFFFFE); } /** Wait until the engine is idle. */ static DFBResult uc_engine_sync(void* drv, void* dev) { UcDriverData* ucdrv = (UcDriverData*) drv; UcDeviceData* ucdev = (UcDeviceData*) dev; int loop = 0; /* printf("Entering uc_engine_sync(), status is 0x%08x\n", VIA_IN(ucdrv->hwregs, VIA_REG_STATUS)); */ while ((VIA_IN(ucdrv->hwregs, VIA_REG_STATUS) & 0xfffeffff) != 0x00020000) { if (++loop > MAXLOOP) { D_ERROR("DirectFB/Unichrome: Timeout waiting for idle engine!\n"); break; /* FIXME: return DFB_TIMEOUT and implement EngineReset! */ } } /* printf("Leaving uc_engine_sync(), status is 0x%08x, " "waiting for %d (0x%x) cycles.\n", VIA_IN(ucdrv->hwregs, VIA_REG_STATUS), loop, loop); */ ucdev->idle_waitcycles += loop; ucdev->must_wait = 0; return DFB_OK; } // DirectFB interfacing functions -------------------------------------------- static int driver_probe(CoreGraphicsDevice *device) { struct stat s; switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_VIA_UNICHROME: return 1; } return stat(UNICHROME_DEVICE, &s) + 1; } static void driver_get_info(CoreGraphicsDevice* device, GraphicsDriverInfo* info) { // Fill in driver info structure. snprintf(info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "VIA UniChrome Driver"); snprintf(info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "-"); snprintf(info->url, DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH, "http://www.directfb.org"); snprintf(info->license, DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH, "LGPL"); info->version.major = 0; info->version.minor = 4; info->driver_data_size = sizeof (UcDriverData); info->device_data_size = sizeof (UcDeviceData); } static void uc_probe_fbdev(UcDriverData *ucdrv) { struct fb_flip flip; FBDev *dfb_fbdev = dfb_system_data(); flip.device = VIAFB_FLIP_NOP; if (ioctl(dfb_fbdev->fd, FBIO_FLIPONVSYNC, &flip) == 0) ucdrv->canfliponvsync = true; else ucdrv->canfliponvsync = false; } static DFBResult driver_init_driver(CoreGraphicsDevice* device, GraphicsDeviceFuncs* funcs, void* driver_data, void* device_data, CoreDFB *core) { UcDriverData *ucdrv = (UcDriverData*) driver_data; //printf("Entering %s\n", __PRETTY_FUNCTION__); ucdrv->file = -1; ucdrv->pool = dfb_core_shmpool( core ); ucdrv->hwregs = dfb_gfxcard_map_mmio( device, 0, 0 ); if (!ucdrv->hwregs) { int fd; fd = open(UNICHROME_DEVICE, O_RDWR | O_SYNC, 0); if (fd < 0) { D_ERROR("DirectFB/Unichrome: Could not access %s. " "Is the ucio module installed?\n", UNICHROME_DEVICE); return DFB_IO; } ucdrv->file = fd; ucdrv->hwregs = mmap(NULL, 0x1000000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (ucdrv->hwregs == MAP_FAILED) return DFB_IO; } // Get hardware id and revision. uc_probe_pci(ucdrv); // Check framebuffer device capabilities uc_probe_fbdev(ucdrv); /* FIXME: this belongs to device_data! */ ucdrv->fifo = uc_fifo_create(ucdrv->pool, UC_FIFO_SIZE); if (!ucdrv->fifo) return D_OOSHM(); uc_after_set_var(driver_data, device_data); // Driver specific initialization funcs->CheckState = uc_check_state; funcs->SetState = uc_set_state; funcs->EngineSync = uc_engine_sync; funcs->EmitCommands = uc_emit_commands; funcs->FlushTextureCache = uc_flush_texture_cache; funcs->AfterSetVar = uc_after_set_var; funcs->FillRectangle = uc_fill_rectangle; funcs->DrawRectangle = uc_draw_rectangle; funcs->DrawLine = uc_draw_line; funcs->FillTriangle = uc_fill_triangle; funcs->Blit = uc_blit; funcs->StretchBlit = uc_stretch_blit; funcs->TextureTriangles = uc_texture_triangles; ucdrv->ovl = NULL; /* install primary layer hooks */ dfb_layers_hook_primary( device, driver_data, &ucPrimaryFuncs, &ucOldPrimaryFuncs, &ucOldPrimaryDriverData ); dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &ucOverlayFuncs ); dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &ucSubpictureFuncs ); return DFB_OK; } static DFBResult driver_init_device(CoreGraphicsDevice* device, GraphicsDeviceInfo* device_info, void* driver_data, void* device_data) { UcDriverData *ucdrv = (UcDriverData*) driver_data; UcDeviceData *ucdev = (UcDeviceData*) device_data; //printf("Entering %s\n", __PRETTY_FUNCTION__); if (ucdrv->name != NULL) { snprintf(device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "%s", ucdrv->name); } else { snprintf(device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "UniChrome"); } snprintf(device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "VIA/S3G"); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = UC_DRAWING_FUNCTIONS_2D | UC_DRAWING_FUNCTIONS_3D | UC_BLITTING_FUNCTIONS_2D | UC_BLITTING_FUNCTIONS_3D; device_info->caps.drawing = UC_DRAWING_FLAGS_2D | UC_DRAWING_FLAGS_3D; device_info->caps.blitting = UC_BLITTING_FLAGS_2D | UC_BLITTING_FLAGS_3D; device_info->limits.surface_byteoffset_alignment = 32; device_info->limits.surface_pixelpitch_alignment = 32; ucdev->pitch = 0; ucdev->draw_rop2d = VIA_ROP_P; ucdev->draw_rop3d = HC_HROP_P; ucdev->color = 0; ucdev->bflags = 0; ucdev->must_wait = 0; ucdev->cmd_waitcycles = 0; ucdev->idle_waitcycles = 0; uc_init_2d_engine(device, ucdev, ucdrv, false); // VQ disabled - can't make it work. uc_init_3d_engine(ucdrv->hwregs, ucdrv->hwrev, 1); return DFB_OK; } static void driver_close_device(CoreGraphicsDevice *device, void *driver_data, void *device_data) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcDeviceData* ucdev = (UcDeviceData*) device_data; // uc_dump_vq(ucdev); uc_engine_sync(driver_data, device_data); uc_init_2d_engine(device, ucdev, ucdrv, false); } static void driver_close_driver(CoreGraphicsDevice* device, void* driver_data) { UcDriverData* ucdrv = (UcDriverData*) driver_data; if (ucdrv->fifo) uc_fifo_destroy( ucdrv->pool, ucdrv->fifo ); if (ucdrv->file != -1) close( ucdrv->file ); } DirectFB-1.2.10/gfxdrivers/unichrome/uc_accel.c0000644000175000017500000004056511245562152016231 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include #include "unichrome.h" #include "uc_accel.h" #include "uc_fifo.h" #include "mmio.h" #define UC_ACCEL_BEGIN() \ UcDriverData *ucdrv = (UcDriverData*) drv; \ UcDeviceData *ucdev = (UcDeviceData*) dev; \ struct uc_fifo *fifo = ucdrv->fifo; \ /*printf("entering %s\n", __PRETTY_FUNCTION__)*/ #define UC_ACCEL_END() \ UC_FIFO_CHECK(fifo); \ /*printf("leaving %s\n", __PRETTY_FUNCTION__)*/ // Private functions --------------------------------------------------------- /** Wait until a new command can be set up. */ static inline void uc_waitcmd(UcDriverData* ucdrv, UcDeviceData* ucdev) { int loop = 0; if (!ucdev->must_wait) return; //printf("waitcmd "); while (VIA_IN(ucdrv->hwregs, VIA_REG_STATUS) & VIA_CMD_RGTR_BUSY) { if (++loop > MAXLOOP) { D_ERROR("DirectFB/Unichrome: Timeout waiting for idle command regulator!\n"); break; } } //printf("waited for %d (0x%x) cycles.\n", loop, loop); ucdev->cmd_waitcycles += loop; ucdev->must_wait = 0; } /** Send commands to 2D/3D engine. */ void uc_emit_commands(void* drv, void* dev) { UC_ACCEL_BEGIN() uc_waitcmd(ucdrv, ucdev); UC_FIFO_FLUSH(fifo); ucdev->must_wait = 1; } void uc_flush_texture_cache(void* drv, void* dev) { UC_ACCEL_BEGIN() (void) ucdev; UC_FIFO_PREPARE(fifo, 4); UC_FIFO_ADD_HDR(fifo, (HC_ParaType_Tex << 16) | (HC_SubType_TexGeneral << 24)); UC_FIFO_ADD_3D(fifo, HC_SubA_HTXSMD, HC_HTXCHCLR_MASK); UC_FIFO_ADD_3D(fifo, HC_SubA_HTXSMD, 0); UC_FIFO_CHECK(fifo); } /** * Draw a horizontal or vertical line. * * @param fifo command FIFO * * @param x start x position * @param y start y position * @param len length * @param hv if zero: draw from left to right * if nonzero: draw from top to bottom. * * @note This is actually a 1-pixel high or wide rectangular color fill. */ static inline void uc_draw_hv_line(struct uc_fifo* fifo, int x, int y, int len, int hv, int rop) { UC_FIFO_ADD_2D(fifo, VIA_REG_DSTPOS, ((RS16(y) << 16) | RS16(x))); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, len << (hv ? 16 : 0)); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | rop | VIA_GEC_CLIP_ENABLE); } // DirectFB interfacing functions -------------------------------------------- // Functions using the 2D engine --- bool uc_fill_rectangle(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() //printf("%s: r = {%d, %d, %d, %d}, c = 0x%08x\n", __PRETTY_FUNCTION__, // r->x, r->y, r->w, r->h, ucdev->color); if (r->w == 0 || r->h == 0) return true; UC_FIFO_PREPARE(fifo, 8); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD_2D(fifo, VIA_REG_DSTPOS, ((RS16(r->y) << 16) | RS16(r->x))); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, (((RS16(r->h - 1)) << 16) | RS16((r->w - 1)))); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, VIA_GEC_BLT | VIA_GEC_FIXCOLOR_PAT | ucdev->draw_rop2d | VIA_GEC_CLIP_ENABLE); UC_ACCEL_END(); return true; } bool uc_draw_rectangle(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() //printf("%s: r = {%d, %d, %d, %d}, c = 0x%08x\n", __PRETTY_FUNCTION__, // r->x, r->y, r->w, r->h, ucdev->color); int rop = ucdev->draw_rop2d; // Draw lines, in this order: top, bottom, left, right UC_FIFO_PREPARE(fifo, 26); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); uc_draw_hv_line(fifo, r->x, r->y, r->w - 1, 0, rop); uc_draw_hv_line(fifo, r->x, r->y + r->h - 1, r->w - 1, 0, rop); uc_draw_hv_line(fifo, r->x, r->y, r->h - 1, 1, rop); uc_draw_hv_line(fifo, r->x + r->w - 1, r->y, r->h - 1, 1, rop); UC_ACCEL_END(); return true; } bool uc_draw_line(void* drv, void* dev, DFBRegion* line) { UC_ACCEL_BEGIN() //printf("%s: l = (%d, %d) - (%d, %d), c = 0x%08x\n", __PRETTY_FUNCTION__, // line->x1, line->y1, line->x2, line->y2, ucdev->color); int cmd; int dx, dy, tmp, error; error = 1; cmd = VIA_GEC_LINE | VIA_GEC_FIXCOLOR_PAT | ucdev->draw_rop2d | VIA_GEC_CLIP_ENABLE; dx = line->x2 - line->x1; if (dx < 0) { dx = -dx; cmd |= VIA_GEC_DECX; // line will be drawn from right error = 0; } dy = line->y2 - line->y1; if (dy < 0) { dy = -dy; cmd |= VIA_GEC_DECY; // line will be drawn from bottom } if (dy > dx) { tmp = dy; dy = dx; dx = tmp; // Swap 'dx' and 'dy' cmd |= VIA_GEC_Y_MAJOR; // Y major line } UC_FIFO_PREPARE(fifo, 12); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD_2D(fifo, VIA_REG_LINE_K1K2, ((((dy << 1) & 0x3fff) << 16)| (((dy - dx) << 1) & 0x3fff))); UC_FIFO_ADD_2D(fifo, VIA_REG_LINE_XY, ((RS16(line->y1) << 16) | RS16(line->x1))); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, dx); UC_FIFO_ADD_2D(fifo, VIA_REG_LINE_ERROR, (((dy << 1) - dx - error) & 0x3fff)); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, cmd); UC_ACCEL_END(); return true; } static bool uc_blit_one_plane(void* drv, void* dev, DFBRectangle* rect, int dx, int dy) { UC_ACCEL_BEGIN() //printf("%s: r = (%d, %d, %d, %d) -> (%d, %d)\n", __PRETTY_FUNCTION__, // rect->x, rect->y, rect->h, rect->w, dx, dy); int cmd = VIA_GEC_BLT | VIA_ROP_S | VIA_GEC_CLIP_ENABLE; int sx = rect->x; int sy = rect->y; int w = rect->w; int h = rect->h; if (!w || !h) return true; (void) ucdev; // Kill 'unused variable' compiler warning. if (sx < dx) { cmd |= VIA_GEC_DECX; sx += w - 1; dx += w - 1; } if (sy < dy) { cmd |= VIA_GEC_DECY; sy += h - 1; dy += h - 1; } UC_FIFO_PREPARE(fifo, 10); UC_FIFO_ADD_HDR(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD_2D(fifo, VIA_REG_SRCPOS, (RS16(sy) << 16) | RS16(sx)); UC_FIFO_ADD_2D(fifo, VIA_REG_DSTPOS, (RS16(dy) << 16) | RS16(dx)); UC_FIFO_ADD_2D(fifo, VIA_REG_DIMENSION, (RS16(h - 1) << 16) | RS16(w - 1)); UC_FIFO_ADD_2D(fifo, VIA_REG_GECMD, cmd); UC_ACCEL_END(); return true; } static bool uc_blit_planar(void* drv, void* dev, DFBRectangle* rect, int dx, int dy) { UC_ACCEL_BEGIN() int uv_dst_offset = ucdev->dst_offset + (ucdev->dst_pitch * ucdev->dst_height); int uv_src_offset = ucdev->src_offset + (ucdev->src_pitch * ucdev->src_height); int uv_dst_pitch = ucdev->dst_pitch / 2; int uv_src_pitch = ucdev->src_pitch / 2; int uv_pitch = ((uv_src_pitch >> 3) & 0x7fff) | (((uv_dst_pitch >> 3) & 0x7fff) << 16); DFBRectangle rect2 = *rect; rect2.h /= 2; rect2.w /= 2; rect2.x /= 2; rect2.y /= 2; // first blit the Y plane uc_blit_one_plane(drv, dev, rect, dx, dy); // now modify the offsets and clip region for the first chrominance plane UC_FIFO_PREPARE ( fifo, 12 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_PITCH, VIA_PITCH_ENABLE | uv_pitch ); UC_FIFO_ADD_2D ( fifo, VIA_REG_SRCBASE, uv_src_offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_DSTBASE, uv_dst_offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPTL, (RS16(ucdev->clip.y1/2) << 16) | RS16(ucdev->clip.x1/2) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPBR, (RS16(ucdev->clip.y2/2) << 16) | RS16(ucdev->clip.x2/2) ); UC_FIFO_CHECK ( fifo ); uc_blit_one_plane(drv, dev, &rect2, dx/2, dy/2); // now for the second chrominance plane uv_src_offset += uv_src_pitch * ucdev->src_height/2; uv_dst_offset += uv_dst_pitch * ucdev->dst_height/2; UC_FIFO_PREPARE ( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_SRCBASE, uv_src_offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_DSTBASE, uv_dst_offset >> 3 ); UC_FIFO_CHECK ( fifo ); uc_blit_one_plane(drv, dev, &rect2, dx/2, dy/2); // restore the card state to how we found it UC_FIFO_PREPARE ( fifo, 12 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_PITCH, VIA_PITCH_ENABLE | ucdev->pitch ); UC_FIFO_ADD_2D ( fifo, VIA_REG_SRCBASE, ucdev->src_offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_DSTBASE, ucdev->dst_offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPTL, (RS16(ucdev->clip.y1) << 16) | RS16(ucdev->clip.x1) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPBR, (RS16(ucdev->clip.y2) << 16) | RS16(ucdev->clip.x2) ); UC_FIFO_CHECK ( fifo ); UC_ACCEL_END(); return true; } bool uc_blit(void* drv, void* dev, DFBRectangle* rect, int dx, int dy) { DFBSurfacePixelFormat format = ((UcDeviceData *)dev)->dst_format; if (format == DSPF_YV12 || format == DSPF_I420) return uc_blit_planar(drv, dev, rect, dx, dy); else return uc_blit_one_plane(drv, dev, rect, dx, dy); } // Functions using the 3D engine --- bool uc_fill_rectangle_3d(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() //printf("%s: r = {%d, %d, %d, %d}, c = 0x%08x\n", __PRETTY_FUNCTION__, // r->x, r->y, r->w, r->h, ucdev->color3d); int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HVCycle_AFP | HC_HVCycle_AA | HC_HVCycle_BB | HC_HVCycle_NewC | HC_HShading_FlatC; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; if (r->w == 0 || r->h == 0) return true; UC_FIFO_PREPARE(fifo, 18); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, r->x, r->y, 0); UC_FIFO_ADD_XYC(fifo, r->x + r->w, r->y + r->h, 0); UC_FIFO_ADD_XYC(fifo, r->x + r->w, r->y, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x, r->y + r->h, ucdev->color3d); UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } bool uc_draw_rectangle_3d(void* drv, void* dev, DFBRectangle* r) { UC_ACCEL_BEGIN() int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Line | HC_HVCycle_AFP | HC_HShading_FlatA; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; UC_FIFO_PREPARE(fifo, 20); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, r->x, r->y, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x + r->w - 1, r->y, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x + r->w - 1, r->y + r->h - 1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x, r->y + r->h - 1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, r->x, r->y, ucdev->color3d); UC_FIFO_ADD(fifo, cmdA_End); UC_ACCEL_END(); return true; } bool uc_draw_line_3d(void* drv, void* dev, DFBRegion* line) { UC_ACCEL_BEGIN() int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Line | HC_HVCycle_Full | HC_HShading_FlatA; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; UC_FIFO_PREPARE(fifo, 12); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, line->x1, line->y1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, line->x2, line->y2, 0); UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } bool uc_fill_triangle(void* drv, void* dev, DFBTriangle* tri) { UC_ACCEL_BEGIN() int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Cd; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HVCycle_Full | HC_HShading_FlatA; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; UC_FIFO_PREPARE(fifo, 14); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYC(fifo, tri->x1, tri->y1, ucdev->color3d); UC_FIFO_ADD_XYC(fifo, tri->x2, tri->y2, 0); UC_FIFO_ADD_XYC(fifo, tri->x3, tri->y3, 0); UC_FIFO_ADD(fifo, cmdA_End); UC_ACCEL_END(); return true; } bool uc_blit_3d(void* drv, void* dev, DFBRectangle* rect, int dx, int dy) { DFBRectangle dest = {dx, dy, rect->w, rect->h}; return uc_stretch_blit(drv, dev, rect, &dest); } bool uc_stretch_blit(void* drv, void* dev, DFBRectangle* sr, DFBRectangle* dr) { UC_ACCEL_BEGIN() float w = ucdev->hwtex.l2w; float h = ucdev->hwtex.l2h; float dy = dr->y; float s1 = (sr->x ) / w; float t1 = (sr->y ) / h; float s2 = (sr->x + sr->w) / w; float t2 = (sr->y + sr->h) / h; int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_W | HC_HVPMSK_Cd | HC_HVPMSK_S | HC_HVPMSK_T; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HShading_FlatC | HC_HVCycle_AFP | HC_HVCycle_AA | HC_HVCycle_BB | HC_HVCycle_NewC; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; if (ucdev->bflags & DSBLIT_DEINTERLACE) { t1 *= 0.5f; t2 *= 0.5f; if (ucdev->field) dy += 0.5f; else dy -= 0.5f; } UC_FIFO_PREPARE(fifo, 30); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); UC_FIFO_ADD_XYWCST(fifo, dr->x+dr->w, dy, 1, 0, s2, t1); UC_FIFO_ADD_XYWCST(fifo, dr->x, dy+dr->h, 1, 0, s1, t2); UC_FIFO_ADD_XYWCST(fifo, dr->x, dy, 1, ucdev->color3d, s1, t1); UC_FIFO_ADD_XYWCST(fifo, dr->x+dr->w, dy+dr->h, 1, ucdev->color3d, s2, t2); UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } #define DFBCOLOR_TO_ARGB(c) PIXEL_ARGB( (c).a, (c).r, (c).g, (c).b ) bool uc_texture_triangles( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ) { UC_ACCEL_BEGIN() int i; int cmdB = HC_ACMD_HCmdB | HC_HVPMSK_X | HC_HVPMSK_Y | HC_HVPMSK_Z | HC_HVPMSK_W | HC_HVPMSK_Cd | HC_HVPMSK_S | HC_HVPMSK_T; int cmdA = HC_ACMD_HCmdA | HC_HPMType_Tri | HC_HShading_Gouraud | HC_HVCycle_Full; int cmdA_End = cmdA | HC_HPLEND_MASK | HC_HPMValidN_MASK | HC_HE3Fire_MASK; switch (formation) { case DTTF_LIST: cmdA |= HC_HVCycle_NewA | HC_HVCycle_NewB | HC_HVCycle_NewC; break; case DTTF_STRIP: cmdA |= HC_HVCycle_AB | HC_HVCycle_BC | HC_HVCycle_NewC; break; case DTTF_FAN: cmdA |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC; break; default: D_ONCE( "unknown triangle formation" ); return false; } UC_FIFO_PREPARE(fifo, 6 + num * 7); UC_FIFO_ADD_HDR(fifo, HC_ParaType_CmdVdata << 16); UC_FIFO_ADD(fifo, cmdB); UC_FIFO_ADD(fifo, cmdA); for (i=0; icolor3d, vertices[i].s, vertices[i].t); } UC_FIFO_ADD(fifo, cmdA_End); UC_FIFO_PAD_EVEN(fifo); UC_ACCEL_END(); return true; } // Blit profiling //struct timeval tv_start, tv_stop; //gettimeofday(&tv_start, NULL); // Run test here //gettimeofday(&tv_stop, NULL); //tv_stop.tv_sec -= tv_start.tv_sec; //tv_stop.tv_usec -= tv_start.tv_usec; //if (tv_stop.tv_usec < 0) { // tv_stop.tv_sec--; // tv_stop.tv_usec += 1000000; //} //printf("elapsed time: %d us\n", tv_stop.tv_usec); DirectFB-1.2.10/gfxdrivers/unichrome/unichrome.h0000644000175000017500000001115711164361026016461 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UNICHROME_H__ #define __UNICHROME_H__ #include #include #include #include #include #define UNICHROME_DEVICE "/dev/ucio" #define UC_FIFO_SIZE 4096 /** If defined - the driver will use the 3D engine. */ #define UC_ENABLE_3D //#undef UC_ENABLE_3D /** Register settings for the current source surface. (3D) */ struct uc_hw_texture { DFBSurfaceBlittingFlags bltflags; u32 l2w; //width, rounded up to nearest 2^m, eg 600 => 1024 u32 l2h; //height, rounded up, e.g 480 => 512 u32 we; //width exponent, i.e m in the number 2^m u32 he; //height exponent u32 format; // HW pixel format // 3d engine texture environment, texture unit 0 // Used for the DSBLIT_BLEND_ALPHACHANNEL, DSBLIT_BLEND_COLORALPHA // and DSBLIT_COLORIZE blitting flags. u32 regHTXnTB; u32 regHTXnMPMD; u32 regHTXnTBLCsat_0; u32 regHTXnTBLCop_0; u32 regHTXnTBLMPfog_0; u32 regHTXnTBLAsat_0; u32 regHTXnTBLRCb_0; u32 regHTXnTBLRAa_0; u32 regHTXnTBLRFog_0; }; /** Hardware source-destination blending registers. */ struct uc_hw_alpha { /* u32 regHABBasL; // Alpha buffer, low 24 bits. u32 regHABBasH; // Alpha buffer, high 8 bits. u32 regHABFM; // Alpha pixel format, memory type and pitch. u32 regHATMD; // Alpha test function and reference value. // Blending function */ u32 regHABLCsat; u32 regHABLCop; u32 regHABLAsat; u32 regHABLAop; u32 regHABLRCa; u32 regHABLRFCa; u32 regHABLRCbias; u32 regHABLRCb; u32 regHABLRFCb; u32 regHABLRAa; u32 regHABLRAb; }; typedef enum { uc_source2d = 0x00000001, uc_source3d = 0x00000002, uc_texenv = 0x00000004, uc_blending_fn = 0x00000008, uc_color2d = 0x00000010, uc_colorkey2d = 0x00000020 } UcStateBits; #define UC_VALIDATE(b) (ucdev->valid |= (b)) #define UC_INVALIDATE(b) (ucdev->valid &= ~(b)) #define UC_IS_VALID(b) (ucdev->valid & (b)) typedef struct _UcDeviceData { /* State validation */ UcStateBits valid; /* Current state settings */ u32 pitch; // combined src/dst pitch (2D) u32 color; // 2D fill color u32 color3d; // color for 3D operations u32 draw_rop2d; // logical drawing ROP (2D) u32 draw_rop3d; // logical drawing ROP (3D) DFBSurfaceBlittingFlags bflags; // blitting flags DFBRegion clip; // clipping region DFBSurfacePixelFormat dst_format; // destination pixel format int dst_offset; // destination buffer byte offset int dst_pitch; // destination buffer byte pitch int dst_height; // destination surface height int src_offset; // source buffer byte offset int src_pitch; // source buffer byte pitch int src_height; // source surface height int field; // source field /* Hardware settings */ struct uc_hw_alpha hwalpha; // alpha blending setting (3D) struct uc_hw_texture hwtex; // hardware settings for blitting (3D) /// Set directly after a 2D/3D engine command is sent. int must_wait; unsigned int cmd_waitcycles; unsigned int idle_waitcycles; u32 vq_start; // VQ related u32 vq_size; u32 vq_end; } UcDeviceData; typedef struct _UcDriverData { int file; // File handle to mmapped IO region. int hwid; // Graphics device PCI id. char hwrev; // Hardware revision char* name; // Graphics device name, eg CLE266/UniChrome volatile void* hwregs; // Hardware register base bool canfliponvsync; // Kernel-assisted flip on vsync available struct uc_fifo* fifo; // Data FIFO. FusionSHMPoolShared *pool; struct _UcOverlayData *ovl; // Current overlay settings (initially NULL) } UcDriverData; #endif // __UNICHROME_H__ DirectFB-1.2.10/gfxdrivers/unichrome/Makefile.am0000644000175000017500000000232411245562152016352 00000000000000## Makefile.am for DirectFB/gfxdrivers/unichrome INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems AM_CFLAGS = $(DFB_CFLAGS) unichrome_LTLIBRARIES = libdirectfb_unichrome.la if BUILD_STATIC unichrome_DATA = $(unichrome_LTLIBRARIES:.la=.o) endif unichromedir = $(MODULEDIR)/gfxdrivers libdirectfb_unichrome_la_SOURCES = \ unichrome.c unichrome.h \ uc_probe.h \ uc_accel.c uc_accel.h \ uc_hw.h \ uc_hwset.c uc_hwmap.c \ uc_state.c uc_state.h \ uc_fifo.c uc_fifo.h \ uc_overlay.c uc_overlay.h \ uc_ovl_hwmap.c uc_ovl_hwset.c \ uc_primary.c \ uc_spic.c \ uc_ioctl.h \ mmio.h vidregs.h \ regs2d.h regs3d.h libdirectfb_unichrome_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_unichrome_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la \ -lm include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/unichrome/Makefile.in0000644000175000017500000005020211307521501016351 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/unichrome ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(unichromedir)" \ "$(DESTDIR)$(unichromedir)" unichromeLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(unichrome_LTLIBRARIES) libdirectfb_unichrome_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_unichrome_la_OBJECTS = unichrome.lo uc_accel.lo \ uc_hwset.lo uc_hwmap.lo uc_state.lo uc_fifo.lo uc_overlay.lo \ uc_ovl_hwmap.lo uc_ovl_hwset.lo uc_primary.lo uc_spic.lo libdirectfb_unichrome_la_OBJECTS = \ $(am_libdirectfb_unichrome_la_OBJECTS) libdirectfb_unichrome_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_unichrome_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_unichrome_la_SOURCES) DIST_SOURCES = $(libdirectfb_unichrome_la_SOURCES) unichromeDATA_INSTALL = $(INSTALL_DATA) DATA = $(unichrome_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems AM_CFLAGS = $(DFB_CFLAGS) unichrome_LTLIBRARIES = libdirectfb_unichrome.la @BUILD_STATIC_TRUE@unichrome_DATA = $(unichrome_LTLIBRARIES:.la=.o) unichromedir = $(MODULEDIR)/gfxdrivers libdirectfb_unichrome_la_SOURCES = \ unichrome.c unichrome.h \ uc_probe.h \ uc_accel.c uc_accel.h \ uc_hw.h \ uc_hwset.c uc_hwmap.c \ uc_state.c uc_state.h \ uc_fifo.c uc_fifo.h \ uc_overlay.c uc_overlay.h \ uc_ovl_hwmap.c uc_ovl_hwset.c \ uc_primary.c \ uc_spic.c \ uc_ioctl.h \ mmio.h vidregs.h \ regs2d.h regs3d.h libdirectfb_unichrome_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_unichrome_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la \ -lm all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/unichrome/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/unichrome/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-unichromeLTLIBRARIES: $(unichrome_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(unichromedir)" || $(MKDIR_P) "$(DESTDIR)$(unichromedir)" @list='$(unichrome_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(unichromeLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(unichromedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(unichromeLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(unichromedir)/$$f"; \ else :; fi; \ done uninstall-unichromeLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(unichrome_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(unichromedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(unichromedir)/$$p"; \ done clean-unichromeLTLIBRARIES: -test -z "$(unichrome_LTLIBRARIES)" || rm -f $(unichrome_LTLIBRARIES) @list='$(unichrome_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_unichrome.la: $(libdirectfb_unichrome_la_OBJECTS) $(libdirectfb_unichrome_la_DEPENDENCIES) $(libdirectfb_unichrome_la_LINK) -rpath $(unichromedir) $(libdirectfb_unichrome_la_OBJECTS) $(libdirectfb_unichrome_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_accel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_fifo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_hwmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_hwset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_ovl_hwmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_ovl_hwset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_primary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_spic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uc_state.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unichrome.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-unichromeDATA: $(unichrome_DATA) @$(NORMAL_INSTALL) test -z "$(unichromedir)" || $(MKDIR_P) "$(DESTDIR)$(unichromedir)" @list='$(unichrome_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(unichromeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(unichromedir)/$$f'"; \ $(unichromeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(unichromedir)/$$f"; \ done uninstall-unichromeDATA: @$(NORMAL_UNINSTALL) @list='$(unichrome_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(unichromedir)/$$f'"; \ rm -f "$(DESTDIR)$(unichromedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(unichromedir)" "$(DESTDIR)$(unichromedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-unichromeLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-unichromeDATA install-unichromeLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-unichromeDATA uninstall-unichromeLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-unichromeLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-unichromeDATA \ install-unichromeLTLIBRARIES installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-unichromeDATA \ uninstall-unichromeLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/unichrome/mmio.h0000644000175000017500000000312611164361026015426 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef _VIA_MMIO_H #define _VIA_MMIO_H #define TRACE_ENTER() printf("Entering %s\n", __PRETTY_FUNCTION__) #define TRACE_LEAVE() printf("Leaving %s\n", __PRETTY_FUNCTION__) #ifdef KERNEL #define VIA_OUT(hwregs, reg, val) *(volatile u32 *)((hwregs) + (reg)) = (val) #define VIA_IN(hwregs, reg) *(volatile u32 *)((hwregs) + (reg)) #define VGA_OUT8(hwregs, reg, val) *(volatile u8 *)((hwregs) + (reg) + 0x8000) = (val) #define VGA_IN8(hwregs, reg) *(volatile u8 *)((hwregs) + (reg) + 0x8000) #define RS16(val) ((u16)((s16)(val))) #define RS12(val) (((u16)((s16)(val))) & 0xfff) #else // !KERNEL #define VIA_OUT(hwregs, reg, val) *(volatile u32 *)((hwregs) + (reg)) = (val) #define VIA_IN(hwregs, reg) *(volatile u32 *)((hwregs) + (reg)) #define VGA_OUT8(hwregs, reg, val) *(volatile u8 *)((hwregs) + (reg) + 0x8000) = (val) #define VGA_IN8(hwregs, reg) *(volatile u8 *)((hwregs) + (reg) + 0x8000) #define RS16(val) ((u16)((s16)(val))) #define RS12(val) (((u16)((s16)(val))) & 0xfff) #endif // KERNEL #define VIDEO_OUT(hwregs, reg, val) VIA_OUT((hwregs)+0x200, reg, val) #define VIDEO_IN(hwregs, reg) VIA_IN((hwregs)+0x200, reg) #define MAXLOOP 0xffffff #endif /* _VIA_MMIO_H */ DirectFB-1.2.10/gfxdrivers/unichrome/uc_state.h0000644000175000017500000000370011164361026016272 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_STATE__ #define __UC_STATE__ #include #include #include void uc_set_state(void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel); void uc_check_state(void *drv, void *dev, CardState *state, DFBAccelerationMask accel); /* struct uc_hw_misc { // These control clipping... u32 regHClipTB; u32 regHClipLR; u32 regHFPClipTL; u32 regHFPClipBL; u32 regHFPClipLL; u32 regHFPClipRL; u32 regHFPClipTBH; u32 regHFPClipLRH; // Other functions u32 regHLP; // Line stipple pattern u32 regHLPRF; // Line stipple factor u32 regHSolidCL; // --- Don't know. Unused in DRI. u32 regHPixGC; // Don't know. Is kept cleared in DRI. //u32 regHSPXYOS; // Polygon stipple x and y offsets. Unused here. u32 regHVertexCNT; // --- Don't know. Unused in DRI. u8 ps_xos; // Polygon stipple x-offset. => regHSPXYOS u8 ps_yos; // Polygon stipple y-offset. => regHSPXYOS u32 ps_pat[32]; // Polygon stipple pattern buffer. // These are not registers... }; /// Stencil control. struct uc_hw_stencil { //u32 regHSBBasL; // These aren't in regs3d.h, but they should exist... //u32 regHSBBasH; //u32 regHSBFM; u32 regHSTREF; // Stencil reference value and plane mask u32 regHSTMD; // Stencil test function and fail operation and // zpass/zfail operations. }; */ #endif // __UC_STATE__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_ioctl.h0000644000175000017500000000135611164361026016271 00000000000000// Definitions of framebuffer ioctls #ifndef __UC_IOCTL_H__ #define __UC_IOCTL_H__ #include #include #include // Parameters for FBIO_FLIPONVSYNC ioctl struct fb_flip { u32 device; u32 field; u32 count; u32 offset[6]; }; #define VIAFB_FLIP_GRAPHICS 0 #define VIAFB_FLIP_V1 1 #define VIAFB_FLIP_V3 2 #define VIAFB_FLIP_SPIC 3 #define VIAFB_FLIP_NOP 255 #ifndef FBIO_FLIPONVSYNC #define FBIO_FLIPONVSYNC _IOWR('F', 0x21, struct fb_flip) #endif // Parameters for FBIO_WAITFORVSYNC ioctl #define VIAFB_WAIT_ANY 0 #define VIAFB_WAIT_TOPFIELD 1 #define VIAFB_WAIT_BOTTOMFIELD 2 #define VIAFB_WAIT_FLIP 3 #endif // __UC_IOCTL_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_fifo.h0000644000175000017500000002054011164361026016076 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_FIFO_H__ #define __UC_FIFO_H__ // Note to self: remove when added to makefile as -DUC_DEBUG. #define UC_DEBUG 1 #include #include "regs2d.h" #include "regs3d.h" #include "mmio.h" /** * uc_fifo - GPU data queue. * * buf: buffer start (userspace address) * head: pointer to first unused entry. * * size: maximum number of entries in the fifo. * prep: number of entries allocated to be used. * used: number of entries currently in use. * * hwregs: GPU register base address * reg_tset: address to GPU TRANSET register * reg_tspace: address to GPU TRANSPACE register * * flush: function pointer to flush function (DMA or CPU) * flush_sys: function pointer to flush_sys (non-DMA) function */ struct uc_fifo { u32* buf; u32* head; unsigned int size; unsigned int prep; unsigned int used; //void (*flush)(struct uc_fifo* fifo, volatile void *hwregs); //void (*flush_sys)(struct uc_fifo* fifo, volatile void *hwregs); }; // Help macros --------------------------------------------------------------- // For the record: Macros suck maintenance- and debugging-wise, // but provide guaranteed inlining of the code. /** * Send the contents of the FIFO buffer to the hardware, and clear * the buffer. The transfer may be performed by the CPU or by DMA. */ //#define UC_FIFO_FLUSH(fifo) (fifo)->flush(fifo,ucdrv->hwregs) /** * Same as UC_FIFO_FLUSH(), but always uses the CPU to transfer data. */ //#define UC_FIFO_FLUSH_SYS(fifo) (fifo)->flush_sys(fifo,ucdrv->hwregs) #define UC_FIFO_FLUSH(fifo) uc_fifo_flush_sys(fifo,ucdrv->hwregs) #define UC_FIFO_FLUSH_SYS(fifo) uc_fifo_flush_sys(fifo,ucdrv->hwregs) /** * Make sure there is room for dwsize double words in the FIFO. * If necessary, the FIFO is flushed first. * * @param fifo the fifo * @param dwsize number of double words to allocate * * @note It is ok to request more space than you will actually * be using. This is useful when you don't know exactly beforehand * how many entries you need. * * @note equivalent DRI code is in via_ioctl.c::viaCheckDma() */ #ifdef UC_DEBUG #define UC_FIFO_PREPARE(fifo, dwsize) \ do { \ if ((fifo)->used + dwsize + 32 > (fifo)->size) { \ D_DEBUG("Unichrome: FIFO full - flushing it."); \ UC_FIFO_FLUSH(fifo); \ } \ if (dwsize + (fifo)->prep + 32 > (fifo)->size) { \ D_BUG("Unichrome: FIFO too small for allocation."); \ } \ (fifo)->prep += dwsize; \ } while(0) #else #define UC_FIFO_PREPARE(fifo, dwsize) \ do { \ if ((fifo)->used + dwsize + 32 > (fifo)->size) { \ UC_FIFO_FLUSH(fifo); \ } \ (fifo)->prep += dwsize; \ } while(0) #endif // UC_FIFO_DEBUG /** * Add a 32-bit data word to the FIFO. * Takes one entry in the FIFO. */ #define UC_FIFO_ADD(fifo, data) \ do { \ *((fifo)->head) = (data); \ (fifo)->head++; \ (fifo)->used++; \ } while(0) /** * Add a command header. (HC_HEADER2 + parameter selection) * Takes two entries in the fifo. */ #define UC_FIFO_ADD_HDR(fifo, param) \ do { \ UC_FIFO_ADD(fifo, HC_HEADER2); \ UC_FIFO_ADD(fifo, param); \ } while(0); /** * Add a floating point value to the FIFO. * Non-floats (e.g integers) are converted first. * Takes one entry in the FIFO. */ #define UC_FIFO_ADD_FLOAT(fifo, val) \ do { \ union {float f; u32 i;} v; \ v.f = (float) (val); \ UC_FIFO_ADD(fifo, v.i); \ } while(0) /** * Add a vertex on the form (x, y, color) to the FIFO. * Takes three entries in the FIFO. * The color format is 0xAARRGGBB. */ #define UC_FIFO_ADD_XYC(fifo, x, y, color) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD(fifo, color); \ } while(0) /** * Add a vertex on the form (x, y, w, color, s, t) to the FIFO. * Takes six entries in the FIFO. * The color format is 0xAARRGGBB. */ #define UC_FIFO_ADD_XYWCST(fifo, x, y, w, color, s, t) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD_FLOAT(fifo, w); \ UC_FIFO_ADD(fifo, color); \ UC_FIFO_ADD_FLOAT(fifo, s); \ UC_FIFO_ADD_FLOAT(fifo, t); \ } while(0) #define UC_FIFO_ADD_XYZWCST(fifo, x, y, z, w, color, s, t) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD_FLOAT(fifo, z); \ UC_FIFO_ADD_FLOAT(fifo, w); \ UC_FIFO_ADD(fifo, color); \ UC_FIFO_ADD_FLOAT(fifo, s); \ UC_FIFO_ADD_FLOAT(fifo, t); \ } while(0) #define UC_FIFO_ADD_XYCST(fifo, x, y, color, s, t) \ do { \ UC_FIFO_ADD_FLOAT(fifo, x); \ UC_FIFO_ADD_FLOAT(fifo, y); \ UC_FIFO_ADD(fifo, color); \ UC_FIFO_ADD_FLOAT(fifo, s); \ UC_FIFO_ADD_FLOAT(fifo, t); \ } while(0) /** * Add data specifically for the 2D controller, to the fifo. * Takes two entries in the FIFO. * * @param reg 2D register index * @param data 32-bit data to add */ #define UC_FIFO_ADD_2D(fifo, reg, data) \ do { \ UC_FIFO_ADD(fifo, ((reg) >> 2) | HALCYON_HEADER1); \ UC_FIFO_ADD(fifo, (data)); \ } while (0) /** * Add data specifically for a 3D controller register, to the fifo. * Takes one entry in the FIFO. * * @param reg 3D register index (8 bit) * @param data 24-bit data to add (make sure bits 24 - 31 are cleared!) */ #define UC_FIFO_ADD_3D(fifo, reg, data) \ UC_FIFO_ADD(fifo, ((reg) << 24) | (data)) /** * Pad the FIFO to an even number of entries. * Takes zero or one entries in the FIFO. */ #define UC_FIFO_PAD_EVEN(fifo) \ if (fifo->used & 1) UC_FIFO_ADD(fifo, HC_DUMMY) /** * Check for buffer overruns. * Can be redefined to nothing in release builds. */ #ifdef UC_DEBUG #define UC_FIFO_CHECK(fifo) \ do { \ if ((fifo)->used > ((fifo)->size) - 32) { \ D_BUG("Unichrome: FIFO overrun."); \ } \ if ((fifo)->used > (fifo)->prep) { \ D_BUG("Unichrome: FIFO allocation error."); \ } \ } while(0) #else #define UC_FIFO_CHECK(fifo) do { } while(0) #endif // UC_DEBUG // FIFO functions ------------------------------------------------------------ /** Create a FIFO. Returns NULL on failure. */ struct uc_fifo* uc_fifo_create( FusionSHMPoolShared *pool, size_t size); /** Destroy a FIFO */ void uc_fifo_destroy(FusionSHMPoolShared *pool, struct uc_fifo* fifo); void uc_fifo_flush_sys(struct uc_fifo* fifo, volatile void *regs); #endif // __UC_FIFO_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_state.c0000644000175000017500000002405011245562152016271 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "unichrome.h" #include "uc_state.h" #include "uc_accel.h" #include "uc_hw.h" enum uc_state_type { UC_TYPE_UNSUPPORTED, UC_TYPE_2D, UC_TYPE_3D }; /// GPU selecting functions -------------------------------------------------- static inline bool uc_has_dst_format( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: case DSPF_ARGB4444: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: return true; default: break; } return false; } static inline bool uc_additional_draw_2d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_AiRGB: return true; default: break; } return false; } static inline bool uc_additional_blit_2d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_YV12: case DSPF_I420: case DSPF_YUY2: case DSPF_AiRGB: return true; default: break; } return false; } static inline bool uc_has_src_format_3d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: case DSPF_ARGB4444: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_A8: case DSPF_LUT8: return true; default: break; } return false; } static inline bool uc_has_inv_src_format_3d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_AiRGB: return true; default: break; } return false; } static inline bool uc_has_inv_dst_format_3d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_AiRGB: return true; default: break; } return false; } static inline enum uc_state_type uc_select_drawtype( CardState* state, DFBAccelerationMask accel ) { if (!(state->drawingflags & ~UC_DRAWING_FLAGS_2D) && !(accel & DFXL_FILLTRIANGLE)) return UC_TYPE_2D; if (!(state->drawingflags & ~UC_DRAWING_FLAGS_3D)) return UC_TYPE_3D; return UC_TYPE_UNSUPPORTED; } static inline enum uc_state_type uc_select_blittype( CardState* state, DFBAccelerationMask accel ) { if (!(state->blittingflags & ~UC_BLITTING_FLAGS_2D)) { if ((state->source->config.format == state->destination->config.format) && !((state->blittingflags & DSBLIT_SRC_COLORKEY) && (state->blittingflags & DSBLIT_DST_COLORKEY)) && !(accel & (DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES))) return UC_TYPE_2D; } if (!(state->blittingflags & ~UC_BLITTING_FLAGS_3D)) { if (uc_has_src_format_3d( state->source->config.format )) return UC_TYPE_3D; } if (!(state->blittingflags & ~UC_BLITTING_FLAGS_3D_INV)) { if (uc_has_inv_src_format_3d( state->source->config.format )) return UC_TYPE_3D; } /* Special case for an inverted destination alpha channel. This * can only be done if no blending is requested at the same time. */ if (state->blittingflags == DSBLIT_NOFX) { if (DFB_PIXELFORMAT_INV_ALPHA(state->destination->config.format) && !DFB_PIXELFORMAT_INV_ALPHA(state->source->config.format)) return UC_TYPE_3D; } return UC_TYPE_UNSUPPORTED; } // DirectFB interfacing functions -------------------------------------------- void uc_check_state(void *drv, void *dev, CardState *state, DFBAccelerationMask accel) { if (DFB_DRAWING_FUNCTION(accel)) { /* Check drawing parameters. */ switch (uc_select_drawtype(state, accel)) { case UC_TYPE_2D: if (uc_has_dst_format( state->destination->config.format ) || uc_additional_draw_2d( state->destination->config.format )) state->accel |= UC_DRAWING_FUNCTIONS_2D; break; case UC_TYPE_3D: if (uc_has_dst_format( state->destination->config.format )) state->accel |= UC_DRAWING_FUNCTIONS_3D; break; default: return; } } else { /* Check blitting parameters. */ switch (uc_select_blittype(state, accel)) { case UC_TYPE_2D: if (uc_has_dst_format( state->destination->config.format ) || uc_additional_blit_2d( state->destination->config.format )) state->accel |= UC_BLITTING_FUNCTIONS_2D; break; case UC_TYPE_3D: if (uc_has_dst_format( state->destination->config.format ) || uc_has_inv_dst_format_3d( state->destination->config.format )) state->accel |= UC_BLITTING_FUNCTIONS_3D; break; default: return; } } } void uc_set_state(void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel) { UcDriverData *ucdrv = (UcDriverData*) drv; UcDeviceData *ucdev = (UcDeviceData*) dev; struct uc_fifo *fifo = ucdrv->fifo; u32 rop3d = HC_HROP_P; u32 regEnable = HC_HenCW_MASK | HC_HenAW_MASK; StateModificationFlags modified = state->mod_hw; // Check modified states and update hw if (modified & SMF_SOURCE) UC_INVALIDATE( uc_source2d ); if (modified & (SMF_BLITTING_FLAGS | SMF_SOURCE)) UC_INVALIDATE( uc_source3d ); if (modified & (SMF_BLITTING_FLAGS | SMF_SOURCE | SMF_DESTINATION)) UC_INVALIDATE( uc_texenv ); if (modified & (SMF_BLITTING_FLAGS | SMF_SRC_COLORKEY | SMF_DST_COLORKEY)) UC_INVALIDATE( uc_colorkey2d ); if (modified & (SMF_COLOR | SMF_DESTINATION | SMF_DRAWING_FLAGS)) UC_INVALIDATE( uc_color2d ); if (modified & (SMF_SRC_BLEND | SMF_DST_BLEND)) UC_INVALIDATE( uc_blending_fn ); if (modified & SMF_COLOR) ucdev->color3d = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); if (modified & SMF_DRAWING_FLAGS) { if (state->drawingflags & DSDRAW_XOR) { ucdev->draw_rop3d = HC_HROP_DPx; ucdev->draw_rop2d = VIA_ROP_DPx; } else { ucdev->draw_rop3d = HC_HROP_P; ucdev->draw_rop2d = VIA_ROP_P; } } ucdev->bflags = state->blittingflags; if (modified & SMF_DESTINATION) uc_set_destination(ucdrv, ucdev, state); if (modified & SMF_CLIP) uc_set_clip(ucdrv, ucdev, state); // Select GPU and check remaining states if (DFB_DRAWING_FUNCTION(accel)) { switch (uc_select_drawtype(state, accel)) { case UC_TYPE_2D: funcs->FillRectangle = uc_fill_rectangle; funcs->DrawRectangle = uc_draw_rectangle; funcs->DrawLine = uc_draw_line; uc_set_color_2d(ucdrv, ucdev, state); state->set = UC_DRAWING_FUNCTIONS_2D; break; case UC_TYPE_3D: funcs->FillRectangle = uc_fill_rectangle_3d; funcs->DrawRectangle = uc_draw_rectangle_3d; funcs->DrawLine = uc_draw_line_3d; if (state->drawingflags & DSDRAW_BLEND) { uc_set_blending_fn(ucdrv, ucdev, state); regEnable |= HC_HenABL_MASK; } rop3d = ucdev->draw_rop3d; state->set = UC_DRAWING_FUNCTIONS_3D; break; case UC_TYPE_UNSUPPORTED: D_BUG("Unsupported drawing function!"); break; } } else { // DFB_BLITTING_FUNCTION(accel) switch (uc_select_blittype(state, accel)) { case UC_TYPE_2D: uc_set_source_2d(ucdrv, ucdev, state); funcs->Blit = uc_blit; uc_set_colorkey_2d(ucdrv, ucdev, state); state->set = UC_BLITTING_FUNCTIONS_2D; break; case UC_TYPE_3D: funcs->Blit = uc_blit_3d; uc_set_source_3d(ucdrv, ucdev, state); uc_set_texenv(ucdrv, ucdev, state); uc_set_blending_fn(ucdrv, ucdev, state); regEnable |= HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK | HC_HenDT_MASK; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) regEnable |= HC_HenABL_MASK; state->set = UC_BLITTING_FUNCTIONS_3D; break; case UC_TYPE_UNSUPPORTED: D_BUG("Unsupported blitting function!"); break; } } #ifdef UC_ENABLE_3D UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); /* Don't know what this does. DRI code always clears it. */ UC_FIFO_ADD_3D ( fifo, HC_SubA_HPixGC, 0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HEnable, regEnable ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HFBBMSKL, 0xffffff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HROP, rop3d | 0xff ); #endif UC_FIFO_CHECK(fifo); state->mod_hw = 0; } DirectFB-1.2.10/gfxdrivers/unichrome/regs3d.h0000644000175000017500000020521411245562152015661 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __VIA_REGS_3D_H__ #define __VIA_REGS_3D_H__ #define HC_REG_BASE 0x0400 #define HC_ParaN_MASK 0xffffffff #define HC_Para_MASK 0x00ffffff #define HC_SubA_MASK 0xff000000 #define HC_SubA_SHIFT 24 /* Transmission Setting */ #define HC_REG_TRANS_SET 0x003c #define HC_ParaSubType_MASK 0xff000000 #define HC_ParaType_MASK 0x00ff0000 #define HC_ParaOS_MASK 0x0000ff00 #define HC_ParaAdr_MASK 0x000000ff #define HC_ParaSubType_SHIFT 24 #define HC_ParaType_SHIFT 16 #define HC_ParaOS_SHIFT 8 #define HC_ParaAdr_SHIFT 0 #define HC_ParaType_CmdVdata 0x0000 #define HC_ParaType_NotTex 0x0001 #define HC_ParaType_Tex 0x0002 #define HC_ParaType_Palette 0x0003 #define HC_ParaType_PreCR 0x0010 #define HC_ParaType_Auto 0x00fe /* Transmission Space */ #define HC_REG_Hpara0 0x0040 #define HC_REG_HpataAF 0x02fc /* Read */ #define HC_REG_HREngSt 0x0000 #define HC_REG_HRFIFOempty 0x0004 #define HC_REG_HRFIFOfull 0x0008 #define HC_REG_HRErr 0x000c #define HC_REG_FIFOstatus 0x0010 /* HC_REG_HREngSt 0x0000 */ #define HC_HDASZC_MASK 0x00010000 #define HC_HSGEMI_MASK 0x0000f000 #define HC_HLGEMISt_MASK 0x00000f00 #define HC_HCRSt_MASK 0x00000080 #define HC_HSE0St_MASK 0x00000040 #define HC_HSE1St_MASK 0x00000020 #define HC_HPESt_MASK 0x00000010 #define HC_HXESt_MASK 0x00000008 #define HC_HBESt_MASK 0x00000004 #define HC_HE2St_MASK 0x00000002 #define HC_HE3St_MASK 0x00000001 /* HC_REG_HRFIFOempty 0x0004 */ #define HC_HRZDempty_MASK 0x00000010 #define HC_HRTXAempty_MASK 0x00000008 #define HC_HRTXDempty_MASK 0x00000004 #define HC_HWZDempty_MASK 0x00000002 #define HC_HWCDempty_MASK 0x00000001 /* HC_REG_HRFIFOfull 0x0008 */ #define HC_HRZDfull_MASK 0x00000010 #define HC_HRTXAfull_MASK 0x00000008 #define HC_HRTXDfull_MASK 0x00000004 #define HC_HWZDfull_MASK 0x00000002 #define HC_HWCDfull_MASK 0x00000001 /* HC_REG_HRErr 0x000c */ #define HC_HAGPCMErr_MASK 0x80000000 #define HC_HAGPCMErrC_MASK 0x70000000 /* HC_REG_FIFOstatus 0x0010 */ #define HC_HRFIFOATall_MASK 0x80000000 #define HC_HRFIFOATbusy_MASK 0x40000000 #define HC_HRATFGMDo_MASK 0x00000100 #define HC_HRATFGMDi_MASK 0x00000080 #define HC_HRATFRZD_MASK 0x00000040 #define HC_HRATFRTXA_MASK 0x00000020 #define HC_HRATFRTXD_MASK 0x00000010 #define HC_HRATFWZD_MASK 0x00000008 #define HC_HRATFWCD_MASK 0x00000004 #define HC_HRATTXTAG_MASK 0x00000002 #define HC_HRATTXCH_MASK 0x00000001 /* AGP Command Setting */ #define HC_SubA_HAGPBstL 0x0060 #define HC_SubA_HAGPBendL 0x0061 #define HC_SubA_HAGPCMNT 0x0062 #define HC_SubA_HAGPBpL 0x0063 #define HC_SubA_HAGPBpH 0x0064 /* HC_SubA_HAGPCMNT 0x0062 */ #define HC_HAGPCMNT_MASK 0x00800000 #define HC_HCmdErrClr_MASK 0x00400000 #define HC_HAGPBendH_MASK 0x0000ff00 #define HC_HAGPBstH_MASK 0x000000ff #define HC_HAGPBendH_SHIFT 8 #define HC_HAGPBstH_SHIFT 0 /* HC_SubA_HAGPBpL 0x0063 */ #define HC_HAGPBpL_MASK 0x00fffffc #define HC_HAGPBpID_MASK 0x00000003 #define HC_HAGPBpID_PAUSE 0x00000000 #define HC_HAGPBpID_JUMP 0x00000001 #define HC_HAGPBpID_STOP 0x00000002 /* HC_SubA_HAGPBpH 0x0064 */ #define HC_HAGPBpH_MASK 0x00ffffff /* Miscellaneous Settings */ #define HC_SubA_HClipTB 0x0070 #define HC_SubA_HClipLR 0x0071 #define HC_SubA_HFPClipTL 0x0072 #define HC_SubA_HFPClipBL 0x0073 #define HC_SubA_HFPClipLL 0x0074 #define HC_SubA_HFPClipRL 0x0075 #define HC_SubA_HFPClipTBH 0x0076 #define HC_SubA_HFPClipLRH 0x0077 #define HC_SubA_HLP 0x0078 #define HC_SubA_HLPRF 0x0079 #define HC_SubA_HSolidCL 0x007a #define HC_SubA_HPixGC 0x007b #define HC_SubA_HSPXYOS 0x007c #define HC_SubA_HVertexCNT 0x007d #define HC_HClipT_MASK 0x00fff000 #define HC_HClipT_SHIFT 12 #define HC_HClipB_MASK 0x00000fff #define HC_HClipB_SHIFT 0 #define HC_HClipL_MASK 0x00fff000 #define HC_HClipL_SHIFT 12 #define HC_HClipR_MASK 0x00000fff #define HC_HClipR_SHIFT 0 #define HC_HFPClipBH_MASK 0x0000ff00 #define HC_HFPClipBH_SHIFT 8 #define HC_HFPClipTH_MASK 0x000000ff #define HC_HFPClipTH_SHIFT 0 #define HC_HFPClipRH_MASK 0x0000ff00 #define HC_HFPClipRH_SHIFT 8 #define HC_HFPClipLH_MASK 0x000000ff #define HC_HFPClipLH_SHIFT 0 #define HC_HSolidCH_MASK 0x000000ff #define HC_HPixGC_MASK 0x00800000 #define HC_HSPXOS_MASK 0x00fff000 #define HC_HSPXOS_SHIFT 12 #define HC_HSPYOS_MASK 0x00000fff /* Command * Command A */ #define HC_HCmdHeader_MASK 0xfe000000 /*0xffe00000*/ #define HC_HE3Fire_MASK 0x00100000 #define HC_HPMType_MASK 0x000f0000 #define HC_HEFlag_MASK 0x0000e000 #define HC_HShading_MASK 0x00001c00 #define HC_HPMValidN_MASK 0x00000200 #define HC_HPLEND_MASK 0x00000100 #define HC_HVCycle_MASK 0x000000ff #define HC_HVCycle_Style_MASK 0x000000c0 #define HC_HVCycle_ChgA_MASK 0x00000030 #define HC_HVCycle_ChgB_MASK 0x0000000c #define HC_HVCycle_ChgC_MASK 0x00000003 #define HC_HPMType_Point 0x00000000 #define HC_HPMType_Line 0x00010000 #define HC_HPMType_Tri 0x00020000 #define HC_HPMType_TriWF 0x00040000 #define HC_HEFlag_NoAA 0x00000000 #define HC_HEFlag_ab 0x00008000 #define HC_HEFlag_bc 0x00004000 #define HC_HEFlag_ca 0x00002000 #define HC_HShading_Solid 0x00000000 #define HC_HShading_FlatA 0x00000400 #define HC_HShading_FlatB 0x00000800 #define HC_HShading_FlatC 0x00000c00 #define HC_HShading_Gouraud 0x00001000 #define HC_HVCycle_Full 0x00000000 #define HC_HVCycle_AFP 0x00000040 #define HC_HVCycle_One 0x000000c0 #define HC_HVCycle_NewA 0x00000000 #define HC_HVCycle_AA 0x00000010 #define HC_HVCycle_AB 0x00000020 #define HC_HVCycle_AC 0x00000030 #define HC_HVCycle_NewB 0x00000000 #define HC_HVCycle_BA 0x00000004 #define HC_HVCycle_BB 0x00000008 #define HC_HVCycle_BC 0x0000000c #define HC_HVCycle_NewC 0x00000000 #define HC_HVCycle_CA 0x00000001 #define HC_HVCycle_CB 0x00000002 #define HC_HVCycle_CC 0x00000003 /* Command B */ #define HC_HLPrst_MASK 0x00010000 #define HC_HLLastP_MASK 0x00008000 #define HC_HVPMSK_MASK 0x00007f80 #define HC_HBFace_MASK 0x00000040 #define HC_H2nd1VT_MASK 0x0000003f #define HC_HVPMSK_X 0x00004000 #define HC_HVPMSK_Y 0x00002000 #define HC_HVPMSK_Z 0x00001000 #define HC_HVPMSK_W 0x00000800 #define HC_HVPMSK_Cd 0x00000400 #define HC_HVPMSK_Cs 0x00000200 #define HC_HVPMSK_S 0x00000100 #define HC_HVPMSK_T 0x00000080 /* Enable Setting */ #define HC_SubA_HEnable 0x0000 #define HC_HenTXEnvMap_MASK 0x00200000 /* environment mapping?? */ #define HC_HenVertexCNT_MASK 0x00100000 /* vertex counter?? */ #define HC_HenCPUDAZ_MASK 0x00080000 /* ???? */ #define HC_HenDASZWC_MASK 0x00040000 /* ???? */ #define HC_HenFBCull_MASK 0x00020000 /* culling? */ #define HC_HenCW_MASK 0x00010000 /* color write? */ #define HC_HenAA_MASK 0x00008000 /* anti aliasing??? */ #define HC_HenST_MASK 0x00004000 /* stencil?? */ #define HC_HenZT_MASK 0x00002000 /* z test?? */ #define HC_HenZW_MASK 0x00001000 /* z write?? */ #define HC_HenAT_MASK 0x00000800 /* alpha test?? */ #define HC_HenAW_MASK 0x00000400 /* alpha write?? */ #define HC_HenSP_MASK 0x00000200 /* specular?? */ #define HC_HenLP_MASK 0x00000100 /* ???? */ #define HC_HenTXCH_MASK 0x00000080 /* cache? half speed, right fonts */ #define HC_HenTXMP_MASK 0x00000040 /* texture mapping */ #define HC_HenTXPP_MASK 0x00000020 /* perspective correction?? */ #define HC_HenTXTR_MASK 0x00000010 /* ???? */ #define HC_HenCS_MASK 0x00000008 /* color space?? looks weird */ #define HC_HenFOG_MASK 0x00000004 /* obviously fogging */ #define HC_HenABL_MASK 0x00000002 /* alpha blending */ #define HC_HenDT_MASK 0x00000001 /* dithering */ /* Z Setting */ #define HC_SubA_HZWBBasL 0x0010 #define HC_SubA_HZWBBasH 0x0011 #define HC_SubA_HZWBType 0x0012 #define HC_SubA_HZBiasL 0x0013 #define HC_SubA_HZWBend 0x0014 #define HC_SubA_HZWTMD 0x0015 #define HC_SubA_HZWCDL 0x0016 #define HC_SubA_HZWCTAGnum 0x0017 #define HC_SubA_HZCYNum 0x0018 #define HC_SubA_HZWCFire 0x0019 /* HC_SubA_HZWBType */ #define HC_HZWBType_MASK 0x00800000 #define HC_HZBiasedWB_MASK 0x00400000 #define HC_HZONEasFF_MASK 0x00200000 #define HC_HZOONEasFF_MASK 0x00100000 #define HC_HZWBFM_MASK 0x00030000 #define HC_HZWBLoc_MASK 0x0000c000 #define HC_HZWBPit_MASK 0x00003fff #define HC_HZWBFM_16 0x00000000 #define HC_HZWBFM_32 0x00020000 #define HC_HZWBFM_24 0x00030000 #define HC_HZWBLoc_Local 0x00000000 #define HC_HZWBLoc_SyS 0x00004000 /* HC_SubA_HZWBend */ #define HC_HZWBend_MASK 0x00ffe000 #define HC_HZBiasH_MASK 0x000000ff #define HC_HZWBend_SHIFT 10 /* HC_SubA_HZWTMD */ #define HC_HZWTMD_MASK 0x00070000 #define HC_HEBEBias_MASK 0x00007f00 #define HC_HZNF_MASK 0x000000ff #define HC_HZWTMD_NeverPass 0x00000000 #define HC_HZWTMD_LT 0x00010000 #define HC_HZWTMD_EQ 0x00020000 #define HC_HZWTMD_LE 0x00030000 #define HC_HZWTMD_GT 0x00040000 #define HC_HZWTMD_NE 0x00050000 #define HC_HZWTMD_GE 0x00060000 #define HC_HZWTMD_AllPass 0x00070000 #define HC_HEBEBias_SHIFT 8 /* HC_SubA_HZWCDL 0x0016 */ #define HC_HZWCDL_MASK 0x00ffffff /* HC_SubA_HZWCTAGnum 0x0017 */ #define HC_HZWCTAGnum_MASK 0x00ff0000 #define HC_HZWCTAGnum_SHIFT 16 #define HC_HZWCDH_MASK 0x000000ff #define HC_HZWCDH_SHIFT 0 /* HC_SubA_HZCYNum 0x0018 */ #define HC_HZCYNum_MASK 0x00030000 #define HC_HZCYNum_SHIFT 16 #define HC_HZWCQWnum_MASK 0x00003fff #define HC_HZWCQWnum_SHIFT 0 /* HC_SubA_HZWCFire 0x0019 */ #define HC_ZWCFire_MASK 0x00010000 #define HC_HZWCQWnumLast_MASK 0x00003fff #define HC_HZWCQWnumLast_SHIFT 0 /* Stencil Setting */ #define HC_SubA_HSTREF 0x0023 #define HC_SubA_HSTMD 0x0024 /* HC_SubA_HSBFM */ #define HC_HSBFM_MASK 0x00030000 #define HC_HSBLoc_MASK 0x0000c000 #define HC_HSBPit_MASK 0x00003fff /* HC_SubA_HSTREF */ #define HC_HSTREF_MASK 0x00ff0000 #define HC_HSTOPMSK_MASK 0x0000ff00 #define HC_HSTBMSK_MASK 0x000000ff #define HC_HSTREF_SHIFT 16 #define HC_HSTOPMSK_SHIFT 8 /* HC_SubA_HSTMD */ #define HC_HSTMD_MASK 0x00070000 #define HC_HSTOPSF_MASK 0x000001c0 #define HC_HSTOPSPZF_MASK 0x00000038 #define HC_HSTOPSPZP_MASK 0x00000007 #define HC_HSTMD_NeverPass 0x00000000 #define HC_HSTMD_LT 0x00010000 #define HC_HSTMD_EQ 0x00020000 #define HC_HSTMD_LE 0x00030000 #define HC_HSTMD_GT 0x00040000 #define HC_HSTMD_NE 0x00050000 #define HC_HSTMD_GE 0x00060000 #define HC_HSTMD_AllPass 0x00070000 #define HC_HSTOPSF_KEEP 0x00000000 #define HC_HSTOPSF_ZERO 0x00000040 #define HC_HSTOPSF_REPLACE 0x00000080 #define HC_HSTOPSF_INCRSAT 0x000000c0 #define HC_HSTOPSF_DECRSAT 0x00000100 #define HC_HSTOPSF_INVERT 0x00000140 #define HC_HSTOPSF_INCR 0x00000180 #define HC_HSTOPSF_DECR 0x000001c0 #define HC_HSTOPSPZF_KEEP 0x00000000 #define HC_HSTOPSPZF_ZERO 0x00000008 #define HC_HSTOPSPZF_REPLACE 0x00000010 #define HC_HSTOPSPZF_INCRSAT 0x00000018 #define HC_HSTOPSPZF_DECRSAT 0x00000020 #define HC_HSTOPSPZF_INVERT 0x00000028 #define HC_HSTOPSPZF_INCR 0x00000030 #define HC_HSTOPSPZF_DECR 0x00000038 #define HC_HSTOPSPZP_KEEP 0x00000000 #define HC_HSTOPSPZP_ZERO 0x00000001 #define HC_HSTOPSPZP_REPLACE 0x00000002 #define HC_HSTOPSPZP_INCRSAT 0x00000003 #define HC_HSTOPSPZP_DECRSAT 0x00000004 #define HC_HSTOPSPZP_INVERT 0x00000005 #define HC_HSTOPSPZP_INCR 0x00000006 #define HC_HSTOPSPZP_DECR 0x00000007 /* Alpha Setting */ #define HC_SubA_HABBasL 0x0030 #define HC_SubA_HABBasH 0x0031 #define HC_SubA_HABFM 0x0032 #define HC_SubA_HATMD 0x0033 #define HC_SubA_HABLCsat 0x0034 #define HC_SubA_HABLCop 0x0035 #define HC_SubA_HABLAsat 0x0036 #define HC_SubA_HABLAop 0x0037 #define HC_SubA_HABLRCa 0x0038 #define HC_SubA_HABLRFCa 0x0039 #define HC_SubA_HABLRCbias 0x003a #define HC_SubA_HABLRCb 0x003b #define HC_SubA_HABLRFCb 0x003c #define HC_SubA_HABLRAa 0x003d #define HC_SubA_HABLRAb 0x003e /* HC_SubA_HABFM */ #define HC_HABFM_MASK 0x00030000 #define HC_HABLoc_MASK 0x0000c000 #define HC_HABPit_MASK 0x000007ff /* HC_SubA_HATMD */ #define HC_HATMD_MASK 0x00000700 #define HC_HATREF_MASK 0x000000ff #define HC_HATMD_NeverPass 0x00000000 #define HC_HATMD_LT 0x00000100 #define HC_HATMD_EQ 0x00000200 #define HC_HATMD_LE 0x00000300 #define HC_HATMD_GT 0x00000400 #define HC_HATMD_NE 0x00000500 #define HC_HATMD_GE 0x00000600 #define HC_HATMD_AllPass 0x00000700 /* HC_SubA_HABLCsat */ #define HC_HABLCsat_MASK 0x00010000 #define HC_HABLCa_MASK 0x0000fc00 #define HC_HABLCa_C_MASK 0x0000c000 #define HC_HABLCa_OPC_MASK 0x00003c00 #define HC_HABLFCa_MASK 0x000003f0 #define HC_HABLFCa_C_MASK 0x00000300 #define HC_HABLFCa_OPC_MASK 0x000000f0 #define HC_HABLCbias_MASK 0x0000000f #define HC_HABLCbias_C_MASK 0x00000008 #define HC_HABLCbias_OPC_MASK 0x00000007 /*-- Define the input color. */ #define HC_XC_Csrc 0x00000000 #define HC_XC_Cdst 0x00000001 #define HC_XC_Asrc 0x00000002 #define HC_XC_Adst 0x00000003 #define HC_XC_Fog 0x00000004 #define HC_XC_HABLRC 0x00000005 #define HC_XC_minSrcDst 0x00000006 #define HC_XC_maxSrcDst 0x00000007 #define HC_XC_mimAsrcInvAdst 0x00000008 #define HC_XC_OPC 0x00000000 #define HC_XC_InvOPC 0x00000010 #define HC_XC_OPCp5 0x00000020 /*-- Define the input Alpha */ #define HC_XA_OPA 0x00000000 #define HC_XA_InvOPA 0x00000010 #define HC_XA_OPAp5 0x00000020 #define HC_XA_0 0x00000000 #define HC_XA_Asrc 0x00000001 #define HC_XA_Adst 0x00000002 #define HC_XA_Fog 0x00000003 #define HC_XA_minAsrcFog 0x00000004 #define HC_XA_minAsrcAdst 0x00000005 #define HC_XA_maxAsrcFog 0x00000006 #define HC_XA_maxAsrcAdst 0x00000007 #define HC_XA_HABLRA 0x00000008 #define HC_XA_minAsrcInvAdst 0x00000008 #define HC_XA_HABLFRA 0x00000009 /*-- */ #define HC_HABLCa_OPC (HC_XC_OPC << 10) #define HC_HABLCa_InvOPC (HC_XC_InvOPC << 10) #define HC_HABLCa_OPCp5 (HC_XC_OPCp5 << 10) #define HC_HABLCa_Csrc (HC_XC_Csrc << 10) #define HC_HABLCa_Cdst (HC_XC_Cdst << 10) #define HC_HABLCa_Asrc (HC_XC_Asrc << 10) #define HC_HABLCa_Adst (HC_XC_Adst << 10) #define HC_HABLCa_Fog (HC_XC_Fog << 10) #define HC_HABLCa_HABLRCa (HC_XC_HABLRC << 10) #define HC_HABLCa_minSrcDst (HC_XC_minSrcDst << 10) #define HC_HABLCa_maxSrcDst (HC_XC_maxSrcDst << 10) #define HC_HABLFCa_OPC (HC_XC_OPC << 4) #define HC_HABLFCa_InvOPC (HC_XC_InvOPC << 4) #define HC_HABLFCa_OPCp5 (HC_XC_OPCp5 << 4) #define HC_HABLFCa_Csrc (HC_XC_Csrc << 4) #define HC_HABLFCa_Cdst (HC_XC_Cdst << 4) #define HC_HABLFCa_Asrc (HC_XC_Asrc << 4) #define HC_HABLFCa_Adst (HC_XC_Adst << 4) #define HC_HABLFCa_Fog (HC_XC_Fog << 4) #define HC_HABLFCa_HABLRCa (HC_XC_HABLRC << 4) #define HC_HABLFCa_minSrcDst (HC_XC_minSrcDst << 4) #define HC_HABLFCa_maxSrcDst (HC_XC_maxSrcDst << 4) #define HC_HABLFCa_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 4) #define HC_HABLCbias_HABLRCbias 0x00000000 #define HC_HABLCbias_Asrc 0x00000001 #define HC_HABLCbias_Adst 0x00000002 #define HC_HABLCbias_Fog 0x00000003 #define HC_HABLCbias_Cin 0x00000004 /* HC_SubA_HABLCop 0x0035 */ #define HC_HABLdot_MASK 0x00010000 #define HC_HABLCop_MASK 0x00004000 #define HC_HABLCb_MASK 0x00003f00 #define HC_HABLCb_C_MASK 0x00003000 #define HC_HABLCb_OPC_MASK 0x00000f00 #define HC_HABLFCb_MASK 0x000000fc #define HC_HABLFCb_C_MASK 0x000000c0 #define HC_HABLFCb_OPC_MASK 0x0000003c #define HC_HABLCshift_MASK 0x00000003 #define HC_HABLCb_OPC (HC_XC_OPC << 8) #define HC_HABLCb_InvOPC (HC_XC_InvOPC << 8) #define HC_HABLCb_OPCp5 (HC_XC_OPCp5 << 8) #define HC_HABLCb_Csrc (HC_XC_Csrc << 8) #define HC_HABLCb_Cdst (HC_XC_Cdst << 8) #define HC_HABLCb_Asrc (HC_XC_Asrc << 8) #define HC_HABLCb_Adst (HC_XC_Adst << 8) #define HC_HABLCb_Fog (HC_XC_Fog << 8) #define HC_HABLCb_HABLRCa (HC_XC_HABLRC << 8) #define HC_HABLCb_minSrcDst (HC_XC_minSrcDst << 8) #define HC_HABLCb_maxSrcDst (HC_XC_maxSrcDst << 8) #define HC_HABLFCb_OPC (HC_XC_OPC << 2) #define HC_HABLFCb_InvOPC (HC_XC_InvOPC << 2) #define HC_HABLFCb_OPCp5 (HC_XC_OPCp5 << 2) #define HC_HABLFCb_Csrc (HC_XC_Csrc << 2) #define HC_HABLFCb_Cdst (HC_XC_Cdst << 2) #define HC_HABLFCb_Asrc (HC_XC_Asrc << 2) #define HC_HABLFCb_Adst (HC_XC_Adst << 2) #define HC_HABLFCb_Fog (HC_XC_Fog << 2) #define HC_HABLFCb_HABLRCb (HC_XC_HABLRC << 2) #define HC_HABLFCb_minSrcDst (HC_XC_minSrcDst << 2) #define HC_HABLFCb_maxSrcDst (HC_XC_maxSrcDst << 2) #define HC_HABLFCb_mimAsrcInvAdst (HC_XC_mimAsrcInvAdst << 2) /* HC_SubA_HABLAsat 0x0036 */ #define HC_HABLAsat_MASK 0x00010000 #define HC_HABLAa_MASK 0x0000fc00 #define HC_HABLAa_A_MASK 0x0000c000 #define HC_HABLAa_OPA_MASK 0x00003c00 #define HC_HABLFAa_MASK 0x000003f0 #define HC_HABLFAa_A_MASK 0x00000300 #define HC_HABLFAa_OPA_MASK 0x000000f0 #define HC_HABLAbias_MASK 0x0000000f #define HC_HABLAbias_A_MASK 0x00000008 #define HC_HABLAbias_OPA_MASK 0x00000007 #define HC_HABLAa_OPA (HC_XA_OPA << 10) #define HC_HABLAa_InvOPA (HC_XA_InvOPA << 10) #define HC_HABLAa_OPAp5 (HC_XA_OPAp5 << 10) #define HC_HABLAa_0 (HC_XA_0 << 10) #define HC_HABLAa_Asrc (HC_XA_Asrc << 10) #define HC_HABLAa_Adst (HC_XA_Adst << 10) #define HC_HABLAa_Fog (HC_XA_Fog << 10) #define HC_HABLAa_minAsrcFog (HC_XA_minAsrcFog << 10) #define HC_HABLAa_minAsrcAdst (HC_XA_minAsrcAdst << 10) #define HC_HABLAa_maxAsrcFog (HC_XA_maxAsrcFog << 10) #define HC_HABLAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 10) #define HC_HABLAa_HABLRA (HC_XA_HABLRA << 10) #define HC_HABLFAa_OPA (HC_XA_OPA << 4) #define HC_HABLFAa_InvOPA (HC_XA_InvOPA << 4) #define HC_HABLFAa_OPAp5 (HC_XA_OPAp5 << 4) #define HC_HABLFAa_0 (HC_XA_0 << 4) #define HC_HABLFAa_Asrc (HC_XA_Asrc << 4) #define HC_HABLFAa_Adst (HC_XA_Adst << 4) #define HC_HABLFAa_Fog (HC_XA_Fog << 4) #define HC_HABLFAa_minAsrcFog (HC_XA_minAsrcFog << 4) #define HC_HABLFAa_minAsrcAdst (HC_XA_minAsrcAdst << 4) #define HC_HABLFAa_maxAsrcFog (HC_XA_maxAsrcFog << 4) #define HC_HABLFAa_maxAsrcAdst (HC_XA_maxAsrcAdst << 4) #define HC_HABLFAa_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 4) #define HC_HABLFAa_HABLFRA (HC_XA_HABLFRA << 4) #define HC_HABLAbias_HABLRAbias 0x00000000 #define HC_HABLAbias_Asrc 0x00000001 #define HC_HABLAbias_Adst 0x00000002 #define HC_HABLAbias_Fog 0x00000003 #define HC_HABLAbias_Aaa 0x00000004 /* HC_SubA_HABLAop 0x0037 */ #define HC_HABLAop_MASK 0x00004000 #define HC_HABLAb_MASK 0x00003f00 #define HC_HABLAb_OPA_MASK 0x00000f00 #define HC_HABLFAb_MASK 0x000000fc #define HC_HABLFAb_OPA_MASK 0x0000003c #define HC_HABLAshift_MASK 0x00000003 #define HC_HABLAb_OPA (HC_XA_OPA << 8) #define HC_HABLAb_InvOPA (HC_XA_InvOPA << 8) #define HC_HABLAb_OPAp5 (HC_XA_OPAp5 << 8) #define HC_HABLAb_0 (HC_XA_0 << 8) #define HC_HABLAb_Asrc (HC_XA_Asrc << 8) #define HC_HABLAb_Adst (HC_XA_Adst << 8) #define HC_HABLAb_Fog (HC_XA_Fog << 8) #define HC_HABLAb_minAsrcFog (HC_XA_minAsrcFog << 8) #define HC_HABLAb_minAsrcAdst (HC_XA_minAsrcAdst << 8) #define HC_HABLAb_maxAsrcFog (HC_XA_maxAsrcFog << 8) #define HC_HABLAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 8) #define HC_HABLAb_HABLRA (HC_XA_HABLRA << 8) #define HC_HABLFAb_OPA (HC_XA_OPA << 2) #define HC_HABLFAb_InvOPA (HC_XA_InvOPA << 2) #define HC_HABLFAb_OPAp5 (HC_XA_OPAp5 << 2) #define HC_HABLFAb_0 (HC_XA_0 << 2) #define HC_HABLFAb_Asrc (HC_XA_Asrc << 2) #define HC_HABLFAb_Adst (HC_XA_Adst << 2) #define HC_HABLFAb_Fog (HC_XA_Fog << 2) #define HC_HABLFAb_minAsrcFog (HC_XA_minAsrcFog << 2) #define HC_HABLFAb_minAsrcAdst (HC_XA_minAsrcAdst << 2) #define HC_HABLFAb_maxAsrcFog (HC_XA_maxAsrcFog << 2) #define HC_HABLFAb_maxAsrcAdst (HC_XA_maxAsrcAdst << 2) #define HC_HABLFAb_minAsrcInvAdst (HC_XA_minAsrcInvAdst << 2) #define HC_HABLFAb_HABLFRA (HC_XA_HABLFRA << 2) /* HC_SubA_HABLRAa 0x003d */ #define HC_HABLRAa_MASK 0x00ff0000 #define HC_HABLRFAa_MASK 0x0000ff00 #define HC_HABLRAbias_MASK 0x000000ff #define HC_HABLRAa_SHIFT 16 #define HC_HABLRFAa_SHIFT 8 /* HC_SubA_HABLRAb 0x003e */ #define HC_HABLRAb_MASK 0x0000ff00 #define HC_HABLRFAb_MASK 0x000000ff #define HC_HABLRAb_SHIFT 8 /* Destination Setting */ #define HC_SubA_HDBBasL 0x0040 #define HC_SubA_HDBBasH 0x0041 #define HC_SubA_HDBFM 0x0042 #define HC_SubA_HFBBMSKL 0x0043 #define HC_SubA_HROP 0x0044 /* HC_SubA_HDBFM 0x0042 */ #define HC_HDBFM_MASK 0x001f0000 #define HC_HDBLoc_MASK 0x0000c000 #define HC_HDBPit_MASK 0x00003fff #define HC_HDBFM_RGB555 0x00000000 #define HC_HDBFM_RGB565 0x00010000 #define HC_HDBFM_ARGB4444 0x00020000 #define HC_HDBFM_ARGB1555 0x00030000 #define HC_HDBFM_BGR555 0x00040000 #define HC_HDBFM_BGR565 0x00050000 #define HC_HDBFM_ABGR4444 0x00060000 #define HC_HDBFM_ABGR1555 0x00070000 #define HC_HDBFM_ARGB0888 0x00080000 #define HC_HDBFM_ARGB8888 0x00090000 #define HC_HDBFM_ABGR0888 0x000a0000 #define HC_HDBFM_ABGR8888 0x000b0000 #define HC_HDBLoc_Local 0x00000000 #define HC_HDBLoc_Sys 0x00004000 /* HC_SubA_HROP 0x0044 */ #define HC_HROP_MASK 0x00000f00 #define HC_HFBBMSKH_MASK 0x000000ff #define HC_HROP_BLACK 0x00000000 #define HC_HROP_DPon 0x00000100 #define HC_HROP_DPna 0x00000200 #define HC_HROP_Pn 0x00000300 #define HC_HROP_PDna 0x00000400 #define HC_HROP_Dn 0x00000500 #define HC_HROP_DPx 0x00000600 #define HC_HROP_DPan 0x00000700 #define HC_HROP_DPa 0x00000800 #define HC_HROP_DPxn 0x00000900 #define HC_HROP_D 0x00000a00 #define HC_HROP_DPno 0x00000b00 #define HC_HROP_P 0x00000c00 #define HC_HROP_PDno 0x00000d00 #define HC_HROP_DPo 0x00000e00 #define HC_HROP_WHITE 0x00000f00 /* Fog Setting */ #define HC_SubA_HFogLF 0x0050 #define HC_SubA_HFogCL 0x0051 #define HC_SubA_HFogCH 0x0052 #define HC_SubA_HFogStL 0x0053 #define HC_SubA_HFogStH 0x0054 #define HC_SubA_HFogOOdMF 0x0055 #define HC_SubA_HFogOOdEF 0x0056 #define HC_SubA_HFogEndL 0x0057 #define HC_SubA_HFogDenst 0x0058 /* HC_SubA_FogLF 0x0050 */ #define HC_FogLF_MASK 0x00000010 #define HC_FogEq_MASK 0x00000008 #define HC_FogMD_MASK 0x00000007 #define HC_FogMD_LocalFog 0x00000000 #define HC_FogMD_LinearFog 0x00000002 #define HC_FogMD_ExponentialFog 0x00000004 #define HC_FogMD_Exponential2Fog 0x00000005 /* #define HC_FogMD_FogTable 0x00000003 */ /* HC_SubA_HFogDenst 0x0058 */ #define HC_FogDenst_MASK 0x001fff00 #define HC_FogEndL_MASK 0x000000ff /* Texture subtype definitions */ #define HC_SubType_Tex0 0x00000000 #define HC_SubType_Tex1 0x00000001 #define HC_SubType_TexGeneral 0x000000fe /* Attribute of texture n */ #define HC_SubA_HTXnL0BasL 0x0000 #define HC_SubA_HTXnL1BasL 0x0001 #define HC_SubA_HTXnL2BasL 0x0002 #define HC_SubA_HTXnL3BasL 0x0003 #define HC_SubA_HTXnL4BasL 0x0004 #define HC_SubA_HTXnL5BasL 0x0005 #define HC_SubA_HTXnL6BasL 0x0006 #define HC_SubA_HTXnL7BasL 0x0007 #define HC_SubA_HTXnL8BasL 0x0008 #define HC_SubA_HTXnL9BasL 0x0009 #define HC_SubA_HTXnLaBasL 0x000a #define HC_SubA_HTXnLbBasL 0x000b #define HC_SubA_HTXnLcBasL 0x000c #define HC_SubA_HTXnLdBasL 0x000d #define HC_SubA_HTXnLeBasL 0x000e #define HC_SubA_HTXnLfBasL 0x000f #define HC_SubA_HTXnL10BasL 0x0010 #define HC_SubA_HTXnL11BasL 0x0011 #define HC_SubA_HTXnL012BasH 0x0020 #define HC_SubA_HTXnL345BasH 0x0021 #define HC_SubA_HTXnL678BasH 0x0022 #define HC_SubA_HTXnL9abBasH 0x0023 #define HC_SubA_HTXnLcdeBasH 0x0024 #define HC_SubA_HTXnLf1011BasH 0x0025 #define HC_SubA_HTXnL0Pit 0x002b #define HC_SubA_HTXnL1Pit 0x002c #define HC_SubA_HTXnL2Pit 0x002d #define HC_SubA_HTXnL3Pit 0x002e #define HC_SubA_HTXnL4Pit 0x002f #define HC_SubA_HTXnL5Pit 0x0030 #define HC_SubA_HTXnL6Pit 0x0031 #define HC_SubA_HTXnL7Pit 0x0032 #define HC_SubA_HTXnL8Pit 0x0033 #define HC_SubA_HTXnL9Pit 0x0034 #define HC_SubA_HTXnLaPit 0x0035 #define HC_SubA_HTXnLbPit 0x0036 #define HC_SubA_HTXnLcPit 0x0037 #define HC_SubA_HTXnLdPit 0x0038 #define HC_SubA_HTXnLePit 0x0039 #define HC_SubA_HTXnLfPit 0x003a #define HC_SubA_HTXnL10Pit 0x003b #define HC_SubA_HTXnL11Pit 0x003c #define HC_SubA_HTXnL0_5WE 0x004b #define HC_SubA_HTXnL6_bWE 0x004c #define HC_SubA_HTXnLc_11WE 0x004d #define HC_SubA_HTXnL0_5HE 0x0051 #define HC_SubA_HTXnL6_bHE 0x0052 #define HC_SubA_HTXnLc_11HE 0x0053 #define HC_SubA_HTXnL0OS 0x0077 #define HC_SubA_HTXnTB 0x0078 #define HC_SubA_HTXnMPMD 0x0079 #define HC_SubA_HTXnCLODu 0x007a #define HC_SubA_HTXnFM 0x007b #define HC_SubA_HTXnTRCH 0x007c #define HC_SubA_HTXnTRCL 0x007d #define HC_SubA_HTXnTBC 0x007e #define HC_SubA_HTXnTRAH 0x007f #define HC_SubA_HTXnTBLCsat 0x0080 #define HC_SubA_HTXnTBLCop 0x0081 #define HC_SubA_HTXnTBLMPfog 0x0082 #define HC_SubA_HTXnTBLAsat 0x0083 #define HC_SubA_HTXnTBLRCa 0x0085 #define HC_SubA_HTXnTBLRCb 0x0086 #define HC_SubA_HTXnTBLRCc 0x0087 #define HC_SubA_HTXnTBLRCbias 0x0088 #define HC_SubA_HTXnTBLRAa 0x0089 #define HC_SubA_HTXnTBLRFog 0x008a #define HC_SubA_HTXnBumpM00 0x0090 #define HC_SubA_HTXnBumpM01 0x0091 #define HC_SubA_HTXnBumpM10 0x0092 #define HC_SubA_HTXnBumpM11 0x0093 #define HC_SubA_HTXnLScale 0x0094 #define HC_SubA_HTXSMD 0x0000 /* HC_SubA_HTXnL012BasH 0x0020 */ #define HC_HTXnL0BasH_MASK 0x000000ff #define HC_HTXnL1BasH_MASK 0x0000ff00 #define HC_HTXnL2BasH_MASK 0x00ff0000 #define HC_HTXnL1BasH_SHIFT 8 #define HC_HTXnL2BasH_SHIFT 16 /* HC_SubA_HTXnL345BasH 0x0021 */ #define HC_HTXnL3BasH_MASK 0x000000ff #define HC_HTXnL4BasH_MASK 0x0000ff00 #define HC_HTXnL5BasH_MASK 0x00ff0000 #define HC_HTXnL4BasH_SHIFT 8 #define HC_HTXnL5BasH_SHIFT 16 /* HC_SubA_HTXnL678BasH 0x0022 */ #define HC_HTXnL6BasH_MASK 0x000000ff #define HC_HTXnL7BasH_MASK 0x0000ff00 #define HC_HTXnL8BasH_MASK 0x00ff0000 #define HC_HTXnL7BasH_SHIFT 8 #define HC_HTXnL8BasH_SHIFT 16 /* HC_SubA_HTXnL9abBasH 0x0023 */ #define HC_HTXnL9BasH_MASK 0x000000ff #define HC_HTXnLaBasH_MASK 0x0000ff00 #define HC_HTXnLbBasH_MASK 0x00ff0000 #define HC_HTXnLaBasH_SHIFT 8 #define HC_HTXnLbBasH_SHIFT 16 /* HC_SubA_HTXnLcdeBasH 0x0024 */ #define HC_HTXnLcBasH_MASK 0x000000ff #define HC_HTXnLdBasH_MASK 0x0000ff00 #define HC_HTXnLeBasH_MASK 0x00ff0000 #define HC_HTXnLdBasH_SHIFT 8 #define HC_HTXnLeBasH_SHIFT 16 /* HC_SubA_HTXnLcdeBasH 0x0025 */ #define HC_HTXnLfBasH_MASK 0x000000ff #define HC_HTXnL10BasH_MASK 0x0000ff00 #define HC_HTXnL11BasH_MASK 0x00ff0000 #define HC_HTXnL10BasH_SHIFT 8 #define HC_HTXnL11BasH_SHIFT 16 /* HC_SubA_HTXnL0Pit 0x002b */ #define HC_HTXnLnPit_MASK 0x00003fff #define HC_HTXnEnPit_MASK 0x00080000 #define HC_HTXnLnPitE_MASK 0x00f00000 #define HC_HTXnLnPitE_SHIFT 20 /* HC_SubA_HTXnL0_5WE 0x004b */ #define HC_HTXnL0WE_MASK 0x0000000f #define HC_HTXnL1WE_MASK 0x000000f0 #define HC_HTXnL2WE_MASK 0x00000f00 #define HC_HTXnL3WE_MASK 0x0000f000 #define HC_HTXnL4WE_MASK 0x000f0000 #define HC_HTXnL5WE_MASK 0x00f00000 #define HC_HTXnL1WE_SHIFT 4 #define HC_HTXnL2WE_SHIFT 8 #define HC_HTXnL3WE_SHIFT 12 #define HC_HTXnL4WE_SHIFT 16 #define HC_HTXnL5WE_SHIFT 20 /* HC_SubA_HTXnL6_bWE 0x004c */ #define HC_HTXnL6WE_MASK 0x0000000f #define HC_HTXnL7WE_MASK 0x000000f0 #define HC_HTXnL8WE_MASK 0x00000f00 #define HC_HTXnL9WE_MASK 0x0000f000 #define HC_HTXnLaWE_MASK 0x000f0000 #define HC_HTXnLbWE_MASK 0x00f00000 #define HC_HTXnL7WE_SHIFT 4 #define HC_HTXnL8WE_SHIFT 8 #define HC_HTXnL9WE_SHIFT 12 #define HC_HTXnLaWE_SHIFT 16 #define HC_HTXnLbWE_SHIFT 20 /* HC_SubA_HTXnLc_11WE 0x004d */ #define HC_HTXnLcWE_MASK 0x0000000f #define HC_HTXnLdWE_MASK 0x000000f0 #define HC_HTXnLeWE_MASK 0x00000f00 #define HC_HTXnLfWE_MASK 0x0000f000 #define HC_HTXnL10WE_MASK 0x000f0000 #define HC_HTXnL11WE_MASK 0x00f00000 #define HC_HTXnLdWE_SHIFT 4 #define HC_HTXnLeWE_SHIFT 8 #define HC_HTXnLfWE_SHIFT 12 #define HC_HTXnL10WE_SHIFT 16 #define HC_HTXnL11WE_SHIFT 20 /* HC_SubA_HTXnL0_5HE 0x0051 */ #define HC_HTXnL0HE_MASK 0x0000000f #define HC_HTXnL1HE_MASK 0x000000f0 #define HC_HTXnL2HE_MASK 0x00000f00 #define HC_HTXnL3HE_MASK 0x0000f000 #define HC_HTXnL4HE_MASK 0x000f0000 #define HC_HTXnL5HE_MASK 0x00f00000 #define HC_HTXnL1HE_SHIFT 4 #define HC_HTXnL2HE_SHIFT 8 #define HC_HTXnL3HE_SHIFT 12 #define HC_HTXnL4HE_SHIFT 16 #define HC_HTXnL5HE_SHIFT 20 /* HC_SubA_HTXnL6_bHE 0x0052 */ #define HC_HTXnL6HE_MASK 0x0000000f #define HC_HTXnL7HE_MASK 0x000000f0 #define HC_HTXnL8HE_MASK 0x00000f00 #define HC_HTXnL9HE_MASK 0x0000f000 #define HC_HTXnLaHE_MASK 0x000f0000 #define HC_HTXnLbHE_MASK 0x00f00000 #define HC_HTXnL7HE_SHIFT 4 #define HC_HTXnL8HE_SHIFT 8 #define HC_HTXnL9HE_SHIFT 12 #define HC_HTXnLaHE_SHIFT 16 #define HC_HTXnLbHE_SHIFT 20 /* HC_SubA_HTXnLc_11HE 0x0053 */ #define HC_HTXnLcHE_MASK 0x0000000f #define HC_HTXnLdHE_MASK 0x000000f0 #define HC_HTXnLeHE_MASK 0x00000f00 #define HC_HTXnLfHE_MASK 0x0000f000 #define HC_HTXnL10HE_MASK 0x000f0000 #define HC_HTXnL11HE_MASK 0x00f00000 #define HC_HTXnLdHE_SHIFT 4 #define HC_HTXnLeHE_SHIFT 8 #define HC_HTXnLfHE_SHIFT 12 #define HC_HTXnL10HE_SHIFT 16 #define HC_HTXnL11HE_SHIFT 20 /* HC_SubA_HTXnL0OS 0x0077 */ #define HC_HTXnL0OS_MASK 0x003ff000 #define HC_HTXnLVmax_MASK 0x00000fc0 #define HC_HTXnLVmin_MASK 0x0000003f #define HC_HTXnL0OS_SHIFT 12 #define HC_HTXnLVmax_SHIFT 6 /* HC_SubA_HTXnTB 0x0078 */ #define HC_HTXnTB_MASK 0x00f00000 #define HC_HTXnFLSe_MASK 0x0000e000 #define HC_HTXnFLSs_MASK 0x00001c00 #define HC_HTXnFLTe_MASK 0x00000380 #define HC_HTXnFLTs_MASK 0x00000070 #define HC_HTXnFLDs_MASK 0x0000000f #define HC_HTXnTB_NoTB 0x00000000 #define HC_HTXnTB_TBC_S 0x00100000 #define HC_HTXnTB_TBC_T 0x00200000 #define HC_HTXnTB_TB_S 0x00400000 #define HC_HTXnTB_TB_T 0x00800000 #define HC_HTXnFLSe_Nearest 0x00000000 #define HC_HTXnFLSe_Linear 0x00002000 #define HC_HTXnFLSe_NonLinear 0x00004000 #define HC_HTXnFLSe_Sharp 0x00008000 #define HC_HTXnFLSe_Flat_Gaussian_Cubic 0x0000c000 #define HC_HTXnFLSs_Nearest 0x00000000 #define HC_HTXnFLSs_Linear 0x00000400 #define HC_HTXnFLSs_NonLinear 0x00000800 #define HC_HTXnFLSs_Flat_Gaussian_Cubic 0x00001800 #define HC_HTXnFLTe_Nearest 0x00000000 #define HC_HTXnFLTe_Linear 0x00000080 #define HC_HTXnFLTe_NonLinear 0x00000100 #define HC_HTXnFLTe_Sharp 0x00000180 #define HC_HTXnFLTe_Flat_Gaussian_Cubic 0x00000300 #define HC_HTXnFLTs_Nearest 0x00000000 #define HC_HTXnFLTs_Linear 0x00000010 #define HC_HTXnFLTs_NonLinear 0x00000020 #define HC_HTXnFLTs_Flat_Gaussian_Cubic 0x00000060 #define HC_HTXnFLDs_Tex0 0x00000000 #define HC_HTXnFLDs_Nearest 0x00000001 #define HC_HTXnFLDs_Linear 0x00000002 #define HC_HTXnFLDs_NonLinear 0x00000003 #define HC_HTXnFLDs_Dither 0x00000004 #define HC_HTXnFLDs_ConstLOD 0x00000005 #define HC_HTXnFLDs_Ani 0x00000006 #define HC_HTXnFLDs_AniDither 0x00000007 /* HC_SubA_HTXnMPMD 0x0079 */ #define HC_HTXnMPMD_SMASK 0x00070000 #define HC_HTXnMPMD_TMASK 0x00380000 #define HC_HTXnLODDTf_MASK 0x00000007 #define HC_HTXnXY2ST_MASK 0x00000008 #define HC_HTXnMPMD_Tsingle 0x00000000 #define HC_HTXnMPMD_Tclamp 0x00080000 #define HC_HTXnMPMD_Trepeat 0x00100000 #define HC_HTXnMPMD_Tmirror 0x00180000 #define HC_HTXnMPMD_Twrap 0x00200000 #define HC_HTXnMPMD_Ssingle 0x00000000 #define HC_HTXnMPMD_Sclamp 0x00010000 #define HC_HTXnMPMD_Srepeat 0x00020000 #define HC_HTXnMPMD_Smirror 0x00030000 #define HC_HTXnMPMD_Swrap 0x00040000 /* HC_SubA_HTXnCLODu 0x007a */ #define HC_HTXnCLODu_MASK 0x000ffc00 #define HC_HTXnCLODd_MASK 0x000003ff #define HC_HTXnCLODu_SHIFT 10 /* HC_SubA_HTXnFM 0x007b */ #define HC_HTXnFM_MASK 0x00ff0000 #define HC_HTXnLoc_MASK 0x00000003 #define HC_HTXnFM_INDEX 0x00000000 #define HC_HTXnFM_Intensity 0x00080000 #define HC_HTXnFM_Lum 0x00100000 #define HC_HTXnFM_Alpha 0x00180000 #define HC_HTXnFM_DX 0x00280000 #define HC_HTXnFM_ARGB16 0x00880000 #define HC_HTXnFM_ARGB32 0x00980000 #define HC_HTXnFM_ABGR16 0x00a80000 #define HC_HTXnFM_ABGR32 0x00b80000 #define HC_HTXnFM_RGBA16 0x00c80000 #define HC_HTXnFM_RGBA32 0x00d80000 #define HC_HTXnFM_BGRA16 0x00e80000 #define HC_HTXnFM_BGRA32 0x00f80000 #define HC_HTXnFM_BUMPMAP 0x00380000 #define HC_HTXnFM_Index1 (HC_HTXnFM_INDEX | 0x00000000) #define HC_HTXnFM_Index2 (HC_HTXnFM_INDEX | 0x00010000) #define HC_HTXnFM_Index4 (HC_HTXnFM_INDEX | 0x00020000) #define HC_HTXnFM_Index8 (HC_HTXnFM_INDEX | 0x00030000) #define HC_HTXnFM_T1 (HC_HTXnFM_Intensity | 0x00000000) #define HC_HTXnFM_T2 (HC_HTXnFM_Intensity | 0x00010000) #define HC_HTXnFM_T4 (HC_HTXnFM_Intensity | 0x00020000) #define HC_HTXnFM_T8 (HC_HTXnFM_Intensity | 0x00030000) #define HC_HTXnFM_L1 (HC_HTXnFM_Lum | 0x00000000) #define HC_HTXnFM_L2 (HC_HTXnFM_Lum | 0x00010000) #define HC_HTXnFM_L4 (HC_HTXnFM_Lum | 0x00020000) #define HC_HTXnFM_L8 (HC_HTXnFM_Lum | 0x00030000) #define HC_HTXnFM_AL44 (HC_HTXnFM_Lum | 0x00040000) #define HC_HTXnFM_AL88 (HC_HTXnFM_Lum | 0x00050000) #define HC_HTXnFM_A1 (HC_HTXnFM_Alpha | 0x00000000) #define HC_HTXnFM_A2 (HC_HTXnFM_Alpha | 0x00010000) #define HC_HTXnFM_A4 (HC_HTXnFM_Alpha | 0x00020000) #define HC_HTXnFM_A8 (HC_HTXnFM_Alpha | 0x00030000) #define HC_HTXnFM_DX1 (HC_HTXnFM_DX | 0x00010000) #define HC_HTXnFM_DX23 (HC_HTXnFM_DX | 0x00020000) #define HC_HTXnFM_DX45 (HC_HTXnFM_DX | 0x00030000) #define HC_HTXnFM_RGB555 (HC_HTXnFM_ARGB16 | 0x00000000) #define HC_HTXnFM_RGB565 (HC_HTXnFM_ARGB16 | 0x00010000) #define HC_HTXnFM_ARGB1555 (HC_HTXnFM_ARGB16 | 0x00020000) #define HC_HTXnFM_ARGB4444 (HC_HTXnFM_ARGB16 | 0x00030000) #define HC_HTXnFM_ARGB0888 (HC_HTXnFM_ARGB32 | 0x00000000) #define HC_HTXnFM_ARGB8888 (HC_HTXnFM_ARGB32 | 0x00010000) #define HC_HTXnFM_BGR555 (HC_HTXnFM_ABGR16 | 0x00000000) #define HC_HTXnFM_BGR565 (HC_HTXnFM_ABGR16 | 0x00010000) #define HC_HTXnFM_ABGR1555 (HC_HTXnFM_ABGR16 | 0x00020000) #define HC_HTXnFM_ABGR4444 (HC_HTXnFM_ABGR16 | 0x00030000) #define HC_HTXnFM_ABGR0888 (HC_HTXnFM_ABGR32 | 0x00000000) #define HC_HTXnFM_ABGR8888 (HC_HTXnFM_ABGR32 | 0x00010000) #define HC_HTXnFM_RGBA5550 (HC_HTXnFM_RGBA16 | 0x00000000) #define HC_HTXnFM_RGBA5551 (HC_HTXnFM_RGBA16 | 0x00020000) #define HC_HTXnFM_RGBA4444 (HC_HTXnFM_RGBA16 | 0x00030000) #define HC_HTXnFM_RGBA8880 (HC_HTXnFM_RGBA32 | 0x00000000) #define HC_HTXnFM_RGBA8888 (HC_HTXnFM_RGBA32 | 0x00010000) #define HC_HTXnFM_BGRA5550 (HC_HTXnFM_BGRA16 | 0x00000000) #define HC_HTXnFM_BGRA5551 (HC_HTXnFM_BGRA16 | 0x00020000) #define HC_HTXnFM_BGRA4444 (HC_HTXnFM_BGRA16 | 0x00030000) #define HC_HTXnFM_BGRA8880 (HC_HTXnFM_BGRA32 | 0x00000000) #define HC_HTXnFM_BGRA8888 (HC_HTXnFM_BGRA32 | 0x00010000) #define HC_HTXnFM_VU88 (HC_HTXnFM_BUMPMAP | 0x00000000) #define HC_HTXnFM_LVU655 (HC_HTXnFM_BUMPMAP | 0x00010000) #define HC_HTXnFM_LVU888 (HC_HTXnFM_BUMPMAP | 0x00020000) #define HC_HTXnLoc_Local 0x00000000 #define HC_HTXnLoc_Sys 0x00000002 #define HC_HTXnLoc_AGP 0x00000003 /* HC_SubA_HTXnTRAH 0x007f */ #define HC_HTXnTRAH_MASK 0x00ff0000 #define HC_HTXnTRAL_MASK 0x0000ff00 #define HC_HTXnTBA_MASK 0x000000ff #define HC_HTXnTRAH_SHIFT 16 #define HC_HTXnTRAL_SHIFT 8 /* HC_SubA_HTXnTBLCsat 0x0080 *-- Define the input texture. */ #define HC_XTC_TOPC 0x00000000 #define HC_XTC_InvTOPC 0x00000010 #define HC_XTC_TOPCp5 0x00000020 #define HC_XTC_Cbias 0x00000000 #define HC_XTC_InvCbias 0x00000010 #define HC_XTC_0 0x00000000 #define HC_XTC_Dif 0x00000001 #define HC_XTC_Spec 0x00000002 #define HC_XTC_Tex 0x00000003 #define HC_XTC_Cur 0x00000004 #define HC_XTC_Adif 0x00000005 #define HC_XTC_Fog 0x00000006 #define HC_XTC_Atex 0x00000007 #define HC_XTC_Acur 0x00000008 #define HC_XTC_HTXnTBLRC 0x00000009 #define HC_XTC_Ctexnext 0x0000000a /*-- */ #define HC_HTXnTBLCsat_MASK 0x00800000 #define HC_HTXnTBLCa_MASK 0x000fc000 #define HC_HTXnTBLCb_MASK 0x00001f80 #define HC_HTXnTBLCc_MASK 0x0000003f #define HC_HTXnTBLCa_TOPC (HC_XTC_TOPC << 14) #define HC_HTXnTBLCa_InvTOPC (HC_XTC_InvTOPC << 14) #define HC_HTXnTBLCa_TOPCp5 (HC_XTC_TOPCp5 << 14) #define HC_HTXnTBLCa_0 (HC_XTC_0 << 14) #define HC_HTXnTBLCa_Dif (HC_XTC_Dif << 14) #define HC_HTXnTBLCa_Spec (HC_XTC_Spec << 14) #define HC_HTXnTBLCa_Tex (HC_XTC_Tex << 14) #define HC_HTXnTBLCa_Cur (HC_XTC_Cur << 14) #define HC_HTXnTBLCa_Adif (HC_XTC_Adif << 14) #define HC_HTXnTBLCa_Fog (HC_XTC_Fog << 14) #define HC_HTXnTBLCa_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCa_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCa_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) #define HC_HTXnTBLCa_Ctexnext (HC_XTC_Ctexnext << 14) #define HC_HTXnTBLCb_TOPC (HC_XTC_TOPC << 7) #define HC_HTXnTBLCb_InvTOPC (HC_XTC_InvTOPC << 7) #define HC_HTXnTBLCb_TOPCp5 (HC_XTC_TOPCp5 << 7) #define HC_HTXnTBLCb_0 (HC_XTC_0 << 7) #define HC_HTXnTBLCb_Dif (HC_XTC_Dif << 7) #define HC_HTXnTBLCb_Spec (HC_XTC_Spec << 7) #define HC_HTXnTBLCb_Tex (HC_XTC_Tex << 7) #define HC_HTXnTBLCb_Cur (HC_XTC_Cur << 7) #define HC_HTXnTBLCb_Adif (HC_XTC_Adif << 7) #define HC_HTXnTBLCb_Fog (HC_XTC_Fog << 7) #define HC_HTXnTBLCb_Atex (HC_XTC_Atex << 7) #define HC_HTXnTBLCb_Acur (HC_XTC_Acur << 7) #define HC_HTXnTBLCb_HTXnTBLRC (HC_XTC_HTXnTBLRC << 7) #define HC_HTXnTBLCb_Ctexnext (HC_XTC_Ctexnext << 7) #define HC_HTXnTBLCc_TOPC (HC_XTC_TOPC << 0) #define HC_HTXnTBLCc_InvTOPC (HC_XTC_InvTOPC << 0) #define HC_HTXnTBLCc_TOPCp5 (HC_XTC_TOPCp5 << 0) #define HC_HTXnTBLCc_0 (HC_XTC_0 << 0) #define HC_HTXnTBLCc_Dif (HC_XTC_Dif << 0) #define HC_HTXnTBLCc_Spec (HC_XTC_Spec << 0) #define HC_HTXnTBLCc_Tex (HC_XTC_Tex << 0) #define HC_HTXnTBLCc_Cur (HC_XTC_Cur << 0) #define HC_HTXnTBLCc_Adif (HC_XTC_Adif << 0) #define HC_HTXnTBLCc_Fog (HC_XTC_Fog << 0) #define HC_HTXnTBLCc_Atex (HC_XTC_Atex << 0) #define HC_HTXnTBLCc_Acur (HC_XTC_Acur << 0) #define HC_HTXnTBLCc_HTXnTBLRC (HC_XTC_HTXnTBLRC << 0) #define HC_HTXnTBLCc_Ctexnext (HC_XTC_Ctexnext << 0) /* HC_SubA_HTXnTBLCop 0x0081 */ #define HC_HTXnTBLdot_MASK 0x00c00000 #define HC_HTXnTBLCop_MASK 0x00380000 #define HC_HTXnTBLCbias_MASK 0x0007c000 #define HC_HTXnTBLCshift_MASK 0x00001800 #define HC_HTXnTBLAop_MASK 0x00000380 #define HC_HTXnTBLAbias_MASK 0x00000078 #define HC_HTXnTBLAshift_MASK 0x00000003 #define HC_HTXnTBLCop_Add 0x00000000 #define HC_HTXnTBLCop_Sub 0x00080000 #define HC_HTXnTBLCop_Min 0x00100000 #define HC_HTXnTBLCop_Max 0x00180000 #define HC_HTXnTBLCop_Mask 0x00200000 #define HC_HTXnTBLCbias_Cbias (HC_XTC_Cbias << 14) #define HC_HTXnTBLCbias_InvCbias (HC_XTC_InvCbias << 14) #define HC_HTXnTBLCbias_0 (HC_XTC_0 << 14) #define HC_HTXnTBLCbias_Dif (HC_XTC_Dif << 14) #define HC_HTXnTBLCbias_Spec (HC_XTC_Spec << 14) #define HC_HTXnTBLCbias_Tex (HC_XTC_Tex << 14) #define HC_HTXnTBLCbias_Cur (HC_XTC_Cur << 14) #define HC_HTXnTBLCbias_Adif (HC_XTC_Adif << 14) #define HC_HTXnTBLCbias_Fog (HC_XTC_Fog << 14) #define HC_HTXnTBLCbias_Atex (HC_XTC_Atex << 14) #define HC_HTXnTBLCbias_Acur (HC_XTC_Acur << 14) #define HC_HTXnTBLCbias_HTXnTBLRC (HC_XTC_HTXnTBLRC << 14) #define HC_HTXnTBLCshift_1 0x00000000 #define HC_HTXnTBLCshift_2 0x00000800 #define HC_HTXnTBLCshift_No 0x00001000 #define HC_HTXnTBLCshift_DotP 0x00001800 #define HC_HTXnTBLAop_Add 0x00000000 #define HC_HTXnTBLAop_Sub 0x00000080 #define HC_HTXnTBLAop_Min 0x00000100 #define HC_HTXnTBLAop_Max 0x00000180 #define HC_HTXnTBLAop_Mask 0x00000200 #define HC_HTXnTBLAbias_Inv 0x00000040 #define HC_HTXnTBLAbias_Adif 0x00000000 #define HC_HTXnTBLAbias_Fog 0x00000008 #define HC_HTXnTBLAbias_Acur 0x00000010 #define HC_HTXnTBLAbias_HTXnTBLRAbias 0x00000018 #define HC_HTXnTBLAbias_Atex 0x00000020 #define HC_HTXnTBLAshift_1 0x00000000 #define HC_HTXnTBLAshift_2 0x00000001 #define HC_HTXnTBLAshift_No 0x00000002 /* #define HC_HTXnTBLAshift_DotP 0x00000003 */ /* HC_SubA_HTXnTBLMPFog 0x0082 */ #define HC_HTXnTBLMPfog_MASK 0x00e00000 #define HC_HTXnTBLMPfog_0 0x00000000 #define HC_HTXnTBLMPfog_Adif 0x00200000 #define HC_HTXnTBLMPfog_Fog 0x00400000 #define HC_HTXnTBLMPfog_Atex 0x00600000 #define HC_HTXnTBLMPfog_Acur 0x00800000 #define HC_HTXnTBLMPfog_GHTXnTBLRFog 0x00a00000 /* HC_SubA_HTXnTBLAsat 0x0083 *-- Define the texture alpha input. */ #define HC_XTA_TOPA 0x00000000 #define HC_XTA_InvTOPA 0x00000008 #define HC_XTA_TOPAp5 0x00000010 #define HC_XTA_Adif 0x00000000 #define HC_XTA_Fog 0x00000001 #define HC_XTA_Acur 0x00000002 #define HC_XTA_HTXnTBLRA 0x00000003 #define HC_XTA_Atex 0x00000004 #define HC_XTA_Atexnext 0x00000005 /*-- */ #define HC_HTXnTBLAsat_MASK 0x00800000 #define HC_HTXnTBLAMB_MASK 0x00700000 #define HC_HTXnTBLAa_MASK 0x0007c000 #define HC_HTXnTBLAb_MASK 0x00000f80 #define HC_HTXnTBLAc_MASK 0x0000001f #define HC_HTXnTBLAMB_SHIFT 20 #define HC_HTXnTBLAa_TOPA (HC_XTA_TOPA << 14) #define HC_HTXnTBLAa_InvTOPA (HC_XTA_InvTOPA << 14) #define HC_HTXnTBLAa_TOPAp5 (HC_XTA_TOPAp5 << 14) #define HC_HTXnTBLAa_Adif (HC_XTA_Adif << 14) #define HC_HTXnTBLAa_Fog (HC_XTA_Fog << 14) #define HC_HTXnTBLAa_Acur (HC_XTA_Acur << 14) #define HC_HTXnTBLAa_HTXnTBLRA (HC_XTA_HTXnTBLRA << 14) #define HC_HTXnTBLAa_Atex (HC_XTA_Atex << 14) #define HC_HTXnTBLAa_Atexnext (HC_XTA_Atexnext << 14) #define HC_HTXnTBLAb_TOPA (HC_XTA_TOPA << 7) #define HC_HTXnTBLAb_InvTOPA (HC_XTA_InvTOPA << 7) #define HC_HTXnTBLAb_TOPAp5 (HC_XTA_TOPAp5 << 7) #define HC_HTXnTBLAb_Adif (HC_XTA_Adif << 7) #define HC_HTXnTBLAb_Fog (HC_XTA_Fog << 7) #define HC_HTXnTBLAb_Acur (HC_XTA_Acur << 7) #define HC_HTXnTBLAb_HTXnTBLRA (HC_XTA_HTXnTBLRA << 7) #define HC_HTXnTBLAb_Atex (HC_XTA_Atex << 7) #define HC_HTXnTBLAb_Atexnext (HC_XTA_Atexnext << 7) #define HC_HTXnTBLAc_TOPA (HC_XTA_TOPA << 0) #define HC_HTXnTBLAc_InvTOPA (HC_XTA_InvTOPA << 0) #define HC_HTXnTBLAc_TOPAp5 (HC_XTA_TOPAp5 << 0) #define HC_HTXnTBLAc_Adif (HC_XTA_Adif << 0) #define HC_HTXnTBLAc_Fog (HC_XTA_Fog << 0) #define HC_HTXnTBLAc_Acur (HC_XTA_Acur << 0) #define HC_HTXnTBLAc_HTXnTBLRA (HC_XTA_HTXnTBLRA << 0) #define HC_HTXnTBLAc_Atex (HC_XTA_Atex << 0) #define HC_HTXnTBLAc_Atexnext (HC_XTA_Atexnext << 0) /* HC_SubA_HTXnTBLRAa 0x0089 */ #define HC_HTXnTBLRAa_MASK 0x00ff0000 #define HC_HTXnTBLRAb_MASK 0x0000ff00 #define HC_HTXnTBLRAc_MASK 0x000000ff #define HC_HTXnTBLRAa_SHIFT 16 #define HC_HTXnTBLRAb_SHIFT 8 #define HC_HTXnTBLRAc_SHIFT 0 /* HC_SubA_HTXnTBLRFog 0x008a */ #define HC_HTXnTBLRFog_MASK 0x0000ff00 #define HC_HTXnTBLRAbias_MASK 0x000000ff #define HC_HTXnTBLRFog_SHIFT 8 #define HC_HTXnTBLRAbias_SHIFT 0 /* HC_SubA_HTXnLScale 0x0094 */ #define HC_HTXnLScale_MASK 0x0007fc00 #define HC_HTXnLOff_MASK 0x000001ff #define HC_HTXnLScale_SHIFT 10 /* HC_SubA_HTXSMD 0x0000 */ #define HC_HTXSMD_MASK 0x00000080 #define HC_HTXTMD_MASK 0x00000040 #define HC_HTXNum_MASK 0x00000038 #define HC_HTXTRMD_MASK 0x00000006 #define HC_HTXCHCLR_MASK 0x00000001 #define HC_HTXNum_SHIFT 3 /* Texture Palette n */ #define HC_SubType_TexPalette0 0x00000000 #define HC_SubType_TexPalette1 0x00000001 #define HC_SubType_FogTable 0x00000010 #define HC_SubType_Stipple 0x00000014 /* HC_SubA_TexPalette0 0x0000 */ #define HC_HTPnA_MASK 0xff000000 #define HC_HTPnR_MASK 0x00ff0000 #define HC_HTPnG_MASK 0x0000ff00 #define HC_HTPnB_MASK 0x000000ff /* HC_SubA_FogTable 0x0010 */ #define HC_HFPn3_MASK 0xff000000 #define HC_HFPn2_MASK 0x00ff0000 #define HC_HFPn1_MASK 0x0000ff00 #define HC_HFPn_MASK 0x000000ff #define HC_HFPn3_SHIFT 24 #define HC_HFPn2_SHIFT 16 #define HC_HFPn1_SHIFT 8 /* Auto Testing & Security */ #define HC_SubA_HenFIFOAT 0x0000 #define HC_SubA_HFBDrawFirst 0x0004 #define HC_SubA_HFBBasL 0x0005 #define HC_SubA_HFBDst 0x0006 /* HC_SubA_HenFIFOAT 0x0000 */ #define HC_HenFIFOAT_MASK 0x00000020 #define HC_HenGEMILock_MASK 0x00000010 #define HC_HenFBASwap_MASK 0x00000008 #define HC_HenOT_MASK 0x00000004 #define HC_HenCMDQ_MASK 0x00000002 #define HC_HenTXCTSU_MASK 0x00000001 /* HC_SubA_HFBDrawFirst 0x0004 */ #define HC_HFBDrawFirst_MASK 0x00000800 #define HC_HFBQueue_MASK 0x00000400 #define HC_HFBLock_MASK 0x00000200 #define HC_HEOF_MASK 0x00000100 #define HC_HFBBasH_MASK 0x000000ff /* GEMI Setting */ #define HC_SubA_HTArbRCM 0x0008 #define HC_SubA_HTArbRZ 0x000a #define HC_SubA_HTArbWZ 0x000b #define HC_SubA_HTArbRTX 0x000c #define HC_SubA_HTArbRCW 0x000d #define HC_SubA_HTArbE2 0x000e #define HC_SubA_HArbRQCM 0x0010 #define HC_SubA_HArbWQCM 0x0011 #define HC_SubA_HGEMITout 0x0020 #define HC_SubA_HFthRTXD 0x0040 #define HC_SubA_HFthRTXA 0x0044 #define HC_SubA_HCMDQstL 0x0050 #define HC_SubA_HCMDQendL 0x0051 #define HC_SubA_HCMDQLen 0x0052 /* HC_SubA_HTArbRCM 0x0008 */ #define HC_HTArbRCM_MASK 0x0000ffff /* HC_SubA_HTArbRZ 0x000a */ #define HC_HTArbRZ_MASK 0x0000ffff /* HC_SubA_HTArbWZ 0x000b */ #define HC_HTArbWZ_MASK 0x0000ffff /* HC_SubA_HTArbRTX 0x000c */ #define HC_HTArbRTX_MASK 0x0000ffff /* HC_SubA_HTArbRCW 0x000d */ #define HC_HTArbRCW_MASK 0x0000ffff /* HC_SubA_HTArbE2 0x000e */ #define HC_HTArbE2_MASK 0x0000ffff /* HC_SubA_HArbRQCM 0x0010 */ #define HC_HTArbRQCM_MASK 0x0000ffff /* HC_SubA_HArbWQCM 0x0011 */ #define HC_HArbWQCM_MASK 0x0000ffff /* HC_SubA_HGEMITout 0x0020 */ #define HC_HGEMITout_MASK 0x000f0000 #define HC_HNPArbZC_MASK 0x0000ffff #define HC_HGEMITout_SHIFT 16 /* HC_SubA_HFthRTXD 0x0040 */ #define HC_HFthRTXD_MASK 0x00ff0000 #define HC_HFthRZD_MASK 0x0000ff00 #define HC_HFthWZD_MASK 0x000000ff #define HC_HFthRTXD_SHIFT 16 #define HC_HFthRZD_SHIFT 8 /* HC_SubA_HFthRTXA 0x0044 */ #define HC_HFthRTXA_MASK 0x000000ff /****************************************************************************** ** Define the Halcyon Internal register access constants. For simulator only. ******************************************************************************/ #define HC_SIMA_HAGPBstL 0x0000 #define HC_SIMA_HAGPBendL 0x0001 #define HC_SIMA_HAGPCMNT 0x0002 #define HC_SIMA_HAGPBpL 0x0003 #define HC_SIMA_HAGPBpH 0x0004 #define HC_SIMA_HClipTB 0x0005 #define HC_SIMA_HClipLR 0x0006 #define HC_SIMA_HFPClipTL 0x0007 #define HC_SIMA_HFPClipBL 0x0008 #define HC_SIMA_HFPClipLL 0x0009 #define HC_SIMA_HFPClipRL 0x000a #define HC_SIMA_HFPClipTBH 0x000b #define HC_SIMA_HFPClipLRH 0x000c #define HC_SIMA_HLP 0x000d #define HC_SIMA_HLPRF 0x000e #define HC_SIMA_HSolidCL 0x000f #define HC_SIMA_HPixGC 0x0010 #define HC_SIMA_HSPXYOS 0x0011 #define HC_SIMA_HCmdA 0x0012 #define HC_SIMA_HCmdB 0x0013 #define HC_SIMA_HEnable 0x0014 #define HC_SIMA_HZWBBasL 0x0015 #define HC_SIMA_HZWBBasH 0x0016 #define HC_SIMA_HZWBType 0x0017 #define HC_SIMA_HZBiasL 0x0018 #define HC_SIMA_HZWBend 0x0019 #define HC_SIMA_HZWTMD 0x001a #define HC_SIMA_HZWCDL 0x001b #define HC_SIMA_HZWCTAGnum 0x001c #define HC_SIMA_HZCYNum 0x001d #define HC_SIMA_HZWCFire 0x001e /* #define HC_SIMA_HSBBasL 0x001d */ /* #define HC_SIMA_HSBBasH 0x001e */ /* #define HC_SIMA_HSBFM 0x001f */ #define HC_SIMA_HSTREF 0x0020 #define HC_SIMA_HSTMD 0x0021 #define HC_SIMA_HABBasL 0x0022 #define HC_SIMA_HABBasH 0x0023 #define HC_SIMA_HABFM 0x0024 #define HC_SIMA_HATMD 0x0025 #define HC_SIMA_HABLCsat 0x0026 #define HC_SIMA_HABLCop 0x0027 #define HC_SIMA_HABLAsat 0x0028 #define HC_SIMA_HABLAop 0x0029 #define HC_SIMA_HABLRCa 0x002a #define HC_SIMA_HABLRFCa 0x002b #define HC_SIMA_HABLRCbias 0x002c #define HC_SIMA_HABLRCb 0x002d #define HC_SIMA_HABLRFCb 0x002e #define HC_SIMA_HABLRAa 0x002f #define HC_SIMA_HABLRAb 0x0030 #define HC_SIMA_HDBBasL 0x0031 #define HC_SIMA_HDBBasH 0x0032 #define HC_SIMA_HDBFM 0x0033 #define HC_SIMA_HFBBMSKL 0x0034 #define HC_SIMA_HROP 0x0035 #define HC_SIMA_HFogLF 0x0036 #define HC_SIMA_HFogCL 0x0037 #define HC_SIMA_HFogCH 0x0038 #define HC_SIMA_HFogStL 0x0039 #define HC_SIMA_HFogStH 0x003a #define HC_SIMA_HFogOOdMF 0x003b #define HC_SIMA_HFogOOdEF 0x003c #define HC_SIMA_HFogEndL 0x003d #define HC_SIMA_HFogDenst 0x003e /*---- start of texture 0 setting ---- */ #define HC_SIMA_HTX0L0BasL 0x0040 #define HC_SIMA_HTX0L1BasL 0x0041 #define HC_SIMA_HTX0L2BasL 0x0042 #define HC_SIMA_HTX0L3BasL 0x0043 #define HC_SIMA_HTX0L4BasL 0x0044 #define HC_SIMA_HTX0L5BasL 0x0045 #define HC_SIMA_HTX0L6BasL 0x0046 #define HC_SIMA_HTX0L7BasL 0x0047 #define HC_SIMA_HTX0L8BasL 0x0048 #define HC_SIMA_HTX0L9BasL 0x0049 #define HC_SIMA_HTX0LaBasL 0x004a #define HC_SIMA_HTX0LbBasL 0x004b #define HC_SIMA_HTX0LcBasL 0x004c #define HC_SIMA_HTX0LdBasL 0x004d #define HC_SIMA_HTX0LeBasL 0x004e #define HC_SIMA_HTX0LfBasL 0x004f #define HC_SIMA_HTX0L10BasL 0x0050 #define HC_SIMA_HTX0L11BasL 0x0051 #define HC_SIMA_HTX0L012BasH 0x0052 #define HC_SIMA_HTX0L345BasH 0x0053 #define HC_SIMA_HTX0L678BasH 0x0054 #define HC_SIMA_HTX0L9abBasH 0x0055 #define HC_SIMA_HTX0LcdeBasH 0x0056 #define HC_SIMA_HTX0Lf1011BasH 0x0057 #define HC_SIMA_HTX0L0Pit 0x0058 #define HC_SIMA_HTX0L1Pit 0x0059 #define HC_SIMA_HTX0L2Pit 0x005a #define HC_SIMA_HTX0L3Pit 0x005b #define HC_SIMA_HTX0L4Pit 0x005c #define HC_SIMA_HTX0L5Pit 0x005d #define HC_SIMA_HTX0L6Pit 0x005e #define HC_SIMA_HTX0L7Pit 0x005f #define HC_SIMA_HTX0L8Pit 0x0060 #define HC_SIMA_HTX0L9Pit 0x0061 #define HC_SIMA_HTX0LaPit 0x0062 #define HC_SIMA_HTX0LbPit 0x0063 #define HC_SIMA_HTX0LcPit 0x0064 #define HC_SIMA_HTX0LdPit 0x0065 #define HC_SIMA_HTX0LePit 0x0066 #define HC_SIMA_HTX0LfPit 0x0067 #define HC_SIMA_HTX0L10Pit 0x0068 #define HC_SIMA_HTX0L11Pit 0x0069 #define HC_SIMA_HTX0L0_5WE 0x006a #define HC_SIMA_HTX0L6_bWE 0x006b #define HC_SIMA_HTX0Lc_11WE 0x006c #define HC_SIMA_HTX0L0_5HE 0x006d #define HC_SIMA_HTX0L6_bHE 0x006e #define HC_SIMA_HTX0Lc_11HE 0x006f #define HC_SIMA_HTX0L0OS 0x0070 #define HC_SIMA_HTX0TB 0x0071 #define HC_SIMA_HTX0MPMD 0x0072 #define HC_SIMA_HTX0CLODu 0x0073 #define HC_SIMA_HTX0FM 0x0074 #define HC_SIMA_HTX0TRCH 0x0075 #define HC_SIMA_HTX0TRCL 0x0076 #define HC_SIMA_HTX0TBC 0x0077 #define HC_SIMA_HTX0TRAH 0x0078 #define HC_SIMA_HTX0TBLCsat 0x0079 #define HC_SIMA_HTX0TBLCop 0x007a #define HC_SIMA_HTX0TBLMPfog 0x007b #define HC_SIMA_HTX0TBLAsat 0x007c #define HC_SIMA_HTX0TBLRCa 0x007d #define HC_SIMA_HTX0TBLRCb 0x007e #define HC_SIMA_HTX0TBLRCc 0x007f #define HC_SIMA_HTX0TBLRCbias 0x0080 #define HC_SIMA_HTX0TBLRAa 0x0081 #define HC_SIMA_HTX0TBLRFog 0x0082 #define HC_SIMA_HTX0BumpM00 0x0083 #define HC_SIMA_HTX0BumpM01 0x0084 #define HC_SIMA_HTX0BumpM10 0x0085 #define HC_SIMA_HTX0BumpM11 0x0086 #define HC_SIMA_HTX0LScale 0x0087 /*---- end of texture 0 setting ---- 0x008f */ #define HC_SIMA_TX0TX1_OFF 0x0050 /*---- start of texture 1 setting ---- */ #define HC_SIMA_HTX1L0BasL (HC_SIMA_HTX0L0BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L1BasL (HC_SIMA_HTX0L1BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L2BasL (HC_SIMA_HTX0L2BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L3BasL (HC_SIMA_HTX0L3BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L4BasL (HC_SIMA_HTX0L4BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L5BasL (HC_SIMA_HTX0L5BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6BasL (HC_SIMA_HTX0L6BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L7BasL (HC_SIMA_HTX0L7BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L8BasL (HC_SIMA_HTX0L8BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9BasL (HC_SIMA_HTX0L9BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LaBasL (HC_SIMA_HTX0LaBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LbBasL (HC_SIMA_HTX0LbBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcBasL (HC_SIMA_HTX0LcBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LdBasL (HC_SIMA_HTX0LdBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LeBasL (HC_SIMA_HTX0LeBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LfBasL (HC_SIMA_HTX0LfBasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L10BasL (HC_SIMA_HTX0L10BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L11BasL (HC_SIMA_HTX0L11BasL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L012BasH (HC_SIMA_HTX0L012BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L345BasH (HC_SIMA_HTX0L345BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L678BasH (HC_SIMA_HTX0L678BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9abBasH (HC_SIMA_HTX0L9abBasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcdeBasH (HC_SIMA_HTX0LcdeBasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lf1011BasH (HC_SIMA_HTX0Lf1011BasH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0Pit (HC_SIMA_HTX0L0Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L1Pit (HC_SIMA_HTX0L1Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L2Pit (HC_SIMA_HTX0L2Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L3Pit (HC_SIMA_HTX0L3Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L4Pit (HC_SIMA_HTX0L4Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L5Pit (HC_SIMA_HTX0L5Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6Pit (HC_SIMA_HTX0L6Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L7Pit (HC_SIMA_HTX0L7Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L8Pit (HC_SIMA_HTX0L8Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L9Pit (HC_SIMA_HTX0L9Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LaPit (HC_SIMA_HTX0LaPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LbPit (HC_SIMA_HTX0LbPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LcPit (HC_SIMA_HTX0LcPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LdPit (HC_SIMA_HTX0LdPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LePit (HC_SIMA_HTX0LePit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LfPit (HC_SIMA_HTX0LfPit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L10Pit (HC_SIMA_HTX0L10Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L11Pit (HC_SIMA_HTX0L11Pit + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0_5WE (HC_SIMA_HTX0L0_5WE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6_bWE (HC_SIMA_HTX0L6_bWE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lc_11WE (HC_SIMA_HTX0Lc_11WE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0_5HE (HC_SIMA_HTX0L0_5HE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L6_bHE (HC_SIMA_HTX0L6_bHE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1Lc_11HE (HC_SIMA_HTX0Lc_11HE + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1L0OS (HC_SIMA_HTX0L0OS + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TB (HC_SIMA_HTX0TB + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1MPMD (HC_SIMA_HTX0MPMD + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1CLODu (HC_SIMA_HTX0CLODu + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1FM (HC_SIMA_HTX0FM + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRCH (HC_SIMA_HTX0TRCH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRCL (HC_SIMA_HTX0TRCL + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBC (HC_SIMA_HTX0TBC + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TRAH (HC_SIMA_HTX0TRAH + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LTC (HC_SIMA_HTX0LTC + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LTA (HC_SIMA_HTX0LTA + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLCsat (HC_SIMA_HTX0TBLCsat + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLCop (HC_SIMA_HTX0TBLCop + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLMPfog (HC_SIMA_HTX0TBLMPfog + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLAsat (HC_SIMA_HTX0TBLAsat + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCa (HC_SIMA_HTX0TBLRCa + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCb (HC_SIMA_HTX0TBLRCb + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCc (HC_SIMA_HTX0TBLRCc + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRCbias (HC_SIMA_HTX0TBLRCbias + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRAa (HC_SIMA_HTX0TBLRAa + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1TBLRFog (HC_SIMA_HTX0TBLRFog + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM00 (HC_SIMA_HTX0BumpM00 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM01 (HC_SIMA_HTX0BumpM01 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM10 (HC_SIMA_HTX0BumpM10 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1BumpM11 (HC_SIMA_HTX0BumpM11 + HC_SIMA_TX0TX1_OFF) #define HC_SIMA_HTX1LScale (HC_SIMA_HTX0LScale + HC_SIMA_TX0TX1_OFF) /*---- end of texture 1 setting ---- 0xaf */ #define HC_SIMA_HTXSMD 0x00b0 #define HC_SIMA_HenFIFOAT 0x00b1 #define HC_SIMA_HFBDrawFirst 0x00b2 #define HC_SIMA_HFBBasL 0x00b3 #define HC_SIMA_HTArbRCM 0x00b4 #define HC_SIMA_HTArbRZ 0x00b5 #define HC_SIMA_HTArbWZ 0x00b6 #define HC_SIMA_HTArbRTX 0x00b7 #define HC_SIMA_HTArbRCW 0x00b8 #define HC_SIMA_HTArbE2 0x00b9 #define HC_SIMA_HGEMITout 0x00ba #define HC_SIMA_HFthRTXD 0x00bb #define HC_SIMA_HFthRTXA 0x00bc /* Define the texture palette 0 */ #define HC_SIMA_HTP0 0x0100 #define HC_SIMA_HTP1 0x0200 #define HC_SIMA_FOGTABLE 0x0300 #define HC_SIMA_STIPPLE 0x0400 #define HC_SIMA_HE3Fire 0x0440 #define HC_SIMA_TRANS_SET 0x0441 #define HC_SIMA_HREngSt 0x0442 #define HC_SIMA_HRFIFOempty 0x0443 #define HC_SIMA_HRFIFOfull 0x0444 #define HC_SIMA_HRErr 0x0445 #define HC_SIMA_FIFOstatus 0x0446 /****************************************************************************** ** Define the AGP command header. ******************************************************************************/ #define HC_ACMD_MASK 0xfe000000 #define HC_ACMD_SUB_MASK 0x0c000000 #define HC_ACMD_HCmdA 0xee000000 #define HC_ACMD_HCmdB 0xec000000 #define HC_ACMD_HCmdC 0xea000000 #define HC_ACMD_H1 0xf0000000 #define HC_ACMD_H2 0xf2000000 #define HC_ACMD_H3 0xf4000000 #define HC_ACMD_H4 0xf6000000 #define HC_ACMD_H1IO_MASK 0x000001ff #define HC_ACMD_H2IO1_MASK 0x001ff000 #define HC_ACMD_H2IO2_MASK 0x000001ff #define HC_ACMD_H2IO1_SHIFT 12 #define HC_ACMD_H2IO2_SHIFT 0 #define HC_ACMD_H3IO_MASK 0x000001ff #define HC_ACMD_H3COUNT_MASK 0x01fff000 #define HC_ACMD_H3COUNT_SHIFT 12 #define HC_ACMD_H4ID_MASK 0x000001ff #define HC_ACMD_H4COUNT_MASK 0x01fffe00 #define HC_ACMD_H4COUNT_SHIFT 9 /******************************************************************************** ** Define Header ********************************************************************************/ #define HC_HEADER2 0xF210F110 /******************************************************************************** ** Define Dummy Value ********************************************************************************/ #define HC_DUMMY 0xCCCCCCCC /******************************************************************************** ** Define for DMA use ********************************************************************************/ #define HALCYON_HEADER2 0XF210F110 #define HALCYON_FIRECMD 0XEE100000 #define HALCYON_FIREMASK 0XFFF00000 #define HALCYON_CMDB 0XEC000000 #define HALCYON_CMDBMASK 0XFFFE0000 #define HALCYON_SUB_ADDR0 0X00000000 #define HALCYON_HEADER1MASK 0XFFFFFF00 #define HALCYON_HEADER1 0XF0000000 #define HC_SubA_HAGPBstL 0x0060 #define HC_SubA_HAGPBendL 0x0061 #define HC_SubA_HAGPCMNT 0x0062 #define HC_SubA_HAGPBpL 0x0063 #define HC_SubA_HAGPBpH 0x0064 #define HC_HAGPCMNT_MASK 0x00800000 #define HC_HCmdErrClr_MASK 0x00400000 #define HC_HAGPBendH_MASK 0x0000ff00 #define HC_HAGPBstH_MASK 0x000000ff #define HC_HAGPBendH_SHIFT 8 #define HC_HAGPBstH_SHIFT 0 #define HC_HAGPBpL_MASK 0x00fffffc #define HC_HAGPBpID_MASK 0x00000003 #define HC_HAGPBpID_PAUSE 0x00000000 #define HC_HAGPBpID_JUMP 0x00000001 #define HC_HAGPBpID_STOP 0x00000002 #define HC_HAGPBpH_MASK 0x00ffffff #endif // __VIA_REGS_3D_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_hw.h0000644000175000017500000000651311245562152015600 00000000000000// Shared header file for uc_hwmap.c and uc_hwset.c. #ifndef __UC_HW_H__ #define __UC_HW_H__ #include #include #include "unichrome.h" #include "uc_fifo.h" // GPU - mapping functions (uc_hwmap.c) /// Map a DirectFB destination surface pixel format to the hw. (3D) static inline int uc_map_dst_format( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: return HC_HDBFM_ARGB1555; case DSPF_ARGB4444: return HC_HDBFM_ARGB4444; case DSPF_RGB16: return HC_HDBFM_RGB565; case DSPF_RGB32: return HC_HDBFM_ARGB0888; case DSPF_ARGB: return HC_HDBFM_ARGB8888; case DSPF_AiRGB: return HC_HDBFM_ARGB8888; // limited support case DSPF_YUY2: case DSPF_YV12: case DSPF_I420: // not supported for 3D but don't report an error return 0; default: D_BUG( "unexpected pixel format" ); } return 0; } /// Map a DirectFB source surface pixel format to the hw. (3D) static inline int uc_map_src_format_3d( DFBSurfacePixelFormat format ) { switch (format) { case DSPF_ARGB1555: return HC_HTXnFM_ARGB1555; case DSPF_ARGB4444: return HC_HTXnFM_ARGB4444; case DSPF_RGB16: return HC_HTXnFM_RGB565; case DSPF_RGB32: return HC_HTXnFM_ARGB0888; case DSPF_ARGB: return HC_HTXnFM_ARGB8888; case DSPF_AiRGB: return HC_HTXnFM_ARGB8888; // limited support case DSPF_A8: return HC_HTXnFM_A8; case DSPF_LUT8: return HC_HTXnFM_Index8; default: D_BUG( "unexpected pixel format" ); } return 0; } void uc_map_blending_fn( struct uc_hw_alpha *hwalpha, DFBSurfaceBlendFunction sblend, DFBSurfaceBlendFunction dblend, DFBSurfacePixelFormat dformat ); void uc_map_blitflags ( struct uc_hw_texture *tex, DFBSurfaceBlittingFlags bflags, DFBSurfacePixelFormat sformat, DFBSurfacePixelFormat dformat ); // GPU - setting functions (uc_hwset.c) void uc_set_blending_fn( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_texenv ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_clip ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_destination( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_source_2d ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_source_3d ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_color_2d ( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); void uc_set_colorkey_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ); #endif // __UC_HW_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_overlay.c0000644000175000017500000002736611164361026016644 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "unichrome.h" #include "uc_overlay.h" #include "uc_ioctl.h" #include "vidregs.h" #include "mmio.h" #include #include #include #include #include // Forward declaration static DFBResult uc_ovl_remove(CoreLayer *layer, void *driver_data, void *layer_data, void *region_data); static int uc_ovl_datasize( void ) { return sizeof(UcOverlayData); } static DFBResult uc_ovl_init_layer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; // Save a pointer to the layer data for access by the primary // This is needed to properly support levels and the primary alpha channel ucdrv->ovl = ucovl; // Set layer type, capabilities and name description->caps = UC_OVL_CAPS; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; snprintf(description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "VIA Unichrome Video"); adjustment->flags = DCAF_NONE; // Fill out the default configuration config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; ucovl->v1.win.w = 720; ucovl->v1.win.h = 576; ucovl->v1.win.x = 0; ucovl->v1.win.y = 0; config->width = 720; config->height = 576; config->pixelformat = DSPF_YV12; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; // Reset overlay ucovl->extfifo_on = false; ucovl->hwrev = ucdrv->hwrev; ucovl->scrwidth = ucovl->v1.win.w; ucovl->v1.isenabled = false; ucovl->v1.cfg = *config; ucovl->v1.ox = 0; ucovl->v1.oy = 0; ucovl->v1.dst_key.index = 0; ucovl->v1.dst_key.r = 0; ucovl->v1.dst_key.g = 0; ucovl->v1.dst_key.b = 0; ucovl->v1.dstkey_enabled = false; ucovl->v1.opacity = 0xff; ucovl->v1.level = 1; // adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | // DCAF_HUE | DCAF_SATURATION; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; adjustment->hue = 0x8000; ucovl->v1.adj = *adjustment; uc_ovl_remove(layer, driver_data, layer_data, NULL); return DFB_OK; } static DFBResult uc_ovl_set_region( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; DFBRectangle win; /* remember configuration */ ucovl->config = *config; /* get new destination rectangle */ win = config->dest; // Bounds checking if ((win.x < -8192) || (win.x > 8192) || (win.y < -8192) || (win.y > 8192) || (win.w < 32) || (win.w > 4096) || (win.h < 32) || (win.h > 4096)) { D_DEBUG("Layer size or position is out of bounds."); return DFB_INVAREA; } ucovl->v1.isenabled = true; ucovl->v1.win = win; ucovl->v1.dst_key = config->dst_key; ucovl->v1.dstkey_enabled = config->options & DLOP_DST_COLORKEY; if (config->options & DLOP_OPACITY) ucovl->v1.opacity = config->opacity; else ucovl->v1.opacity = 0xff; // printf("uc_overlay: color-keying is %s\n", // ucovl->v1.dstkey_enabled ? "enabled" : "disabled"); ucovl->deinterlace = config->options & DLOP_DEINTERLACING; ucovl->surface = surface; ucovl->lock = lock; if (ucdrv->canfliponvsync) { FBDev *dfb_fbdev = dfb_system_data(); int field_option = VIAFB_WAIT_FLIP; // wait for any pending flip ioctl(dfb_fbdev->fd, FBIO_WAITFORVSYNC, &field_option); } return uc_ovl_update(ucdrv, ucovl, UC_OVL_CHANGE, surface, lock); } static DFBResult uc_ovl_remove(CoreLayer *layer, void *driver_data, void *layer_data, void *region_data) { UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; volatile u8* vio = ucdrv->hwregs; ucovl->v1.isenabled = false; uc_ovl_vcmd_wait(vio); VIDEO_OUT(vio, V_FIFO_CONTROL, UC_MAP_V1_FIFO_CONTROL(16,12,8)); // VIDEO_OUT(vio, ALPHA_V3_FIFO_CONTROL, 0x0407181f); if (ucovl->hwrev >= 0x10) { VIDEO_OUT(vio, V1_ColorSpaceReg_1, ColorSpaceValue_1_3123C0); VIDEO_OUT(vio, V1_ColorSpaceReg_2, ColorSpaceValue_2_3123C0); } else { VIDEO_OUT(vio, V1_ColorSpaceReg_1, ColorSpaceValue_1); VIDEO_OUT(vio, V1_ColorSpaceReg_2, ColorSpaceValue_2); } VIDEO_OUT(vio, HQV_CONTROL, VIDEO_IN(vio, HQV_CONTROL) & ~HQV_ENABLE); VIDEO_OUT(vio, V1_CONTROL, VIDEO_IN(vio, V1_CONTROL) & ~V1_ENABLE); // VIDEO_OUT(vio, V3_CONTROL, VIDEO_IN(vio, V3_CONTROL) & ~V3_ENABLE); VIDEO_OUT(vio, V_COMPOSE_MODE, (VIDEO_IN(vio, V_COMPOSE_MODE) & ~ENABLE_COLOR_KEYING) | V1_COMMAND_FIRE); ucovl->surface = NULL; return DFB_OK; } static DFBResult uc_ovl_test_region(CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed) { CoreLayerRegionConfigFlags fail = 0; // Check layer options if (config->options & ~UC_OVL_OPTIONS) fail |= CLRCF_OPTIONS; // Check pixelformats switch (config->format) { case DSPF_YUY2: break; case DSPF_UYVY: fail |= CLRCF_FORMAT; // Nope... doesn't work. break; case DSPF_I420: case DSPF_YV12: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: fail |= CLRCF_FORMAT; } // Check width and height if (config->width > 4096 || config->width < 32) fail |= CLRCF_WIDTH; if (config->height > 4096 || config->height < 32) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult uc_ovl_flip_region( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { //printf("Entering %s ... \n", __PRETTY_FUNCTION__); UcDriverData* ucdrv = (UcDriverData*) driver_data; UcOverlayData* ucovl = (UcOverlayData*) layer_data; DFBResult ret; FBDev *dfb_fbdev = dfb_system_data(); dfb_surface_flip(surface, false); ucovl->field = 0; ucovl->lock = lock; if (ucdrv->canfliponvsync) { if (ucovl->config.options & DLOP_FIELD_PARITY) { struct fb_flip flip; int field_option; field_option = VIAFB_WAIT_FLIP; // ensure last pending flip complete ioctl(dfb_fbdev->fd, FBIO_WAITFORVSYNC, &field_option); flip.device = VIAFB_FLIP_V1; flip.field = ucovl->config.parity; flip.count = 0; // until we implement this uc_ovl_map_buffer(surface->config.format, lock->offset, ucovl->v1.ox, ucovl->v1.oy, surface->config.size.w, surface->config.size.h, lock->pitch, 0, &flip.offset[0], &flip.offset[1], &flip.offset[2]); ioctl(dfb_fbdev->fd, FBIO_FLIPONVSYNC, &flip); } else { ret = uc_ovl_update(ucdrv, ucovl, UC_OVL_FLIP, surface, lock); if (ret) return ret; } } else { if (ucovl->config.options & DLOP_FIELD_PARITY) { int field_option; if (ucovl->config.parity == 0) // top field first? field_option = VIAFB_WAIT_BOTTOMFIELD; else field_option = VIAFB_WAIT_TOPFIELD; ioctl(dfb_fbdev->fd, FBIO_WAITFORVSYNC, &field_option); // that actually waits for VBLANK so we need a further delay // to be sure the field has started and that the flip will // take effect on the next field usleep(2500); } ret = uc_ovl_update(ucdrv, ucovl, UC_OVL_FLIP, surface, lock); if (ret) return ret; } if (flags & DSFLIP_WAIT) dfb_layer_wait_vsync(layer); return DFB_OK; } static DFBResult uc_ovl_get_level(CoreLayer *layer, void *driver_data, void *layer_data, int *level) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; *level = ucovl->v1.level; return DFB_OK; } static DFBResult uc_ovl_set_level(CoreLayer *layer, void *driver_data, void *layer_data, int level) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; UcDriverData* ucdrv = (UcDriverData*) driver_data; if (level == 0) return DFB_INVARG; if (level < 0) { // Enable underlay mode. VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(ucovl->opacity_primary)); } else { // Enable overlay mode (default) VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(ucovl->v1.opacity)); } VIDEO_OUT(ucdrv->hwregs, V_COMPOSE_MODE, V1_COMMAND_FIRE | (ucovl->v1.dstkey_enabled ? ENABLE_COLOR_KEYING : 0)); ucovl->v1.level = level; return DFB_OK; } static DFBResult uc_ovl_set_input_field( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; UcDriverData* ucdrv = (UcDriverData*) driver_data; ucovl->field = field; return uc_ovl_update(ucdrv, ucovl, UC_OVL_FIELD, ucovl->surface, ucovl->lock); } DisplayLayerFuncs ucOverlayFuncs = { .LayerDataSize = uc_ovl_datasize, .InitLayer = uc_ovl_init_layer, .SetRegion = uc_ovl_set_region, .RemoveRegion = uc_ovl_remove, .TestRegion = uc_ovl_test_region, .FlipRegion = uc_ovl_flip_region, .GetLevel = uc_ovl_get_level, .SetLevel = uc_ovl_set_level, .SetInputField = uc_ovl_set_input_field, // .SetColorAdjustment = uc_ovl_set_adjustment, }; DirectFB-1.2.10/gfxdrivers/unichrome/uc_accel.h0000644000175000017500000001006111164361026016217 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_ACCEL_H__ #define __UC_ACCEL_H__ #include "unichrome.h" // 2D accelerator capabilites #define UC_DRAWING_FLAGS_2D (DSDRAW_XOR) #define UC_BLITTING_FLAGS_2D (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY) #define UC_DRAWING_FUNCTIONS_2D (DFXL_DRAWLINE | \ DFXL_DRAWRECTANGLE | \ DFXL_FILLRECTANGLE) #define UC_BLITTING_FUNCTIONS_2D (DFXL_BLIT) // 3D accelerator capabilites #ifdef UC_ENABLE_3D #define UC_DRAWING_FLAGS_3D (DSDRAW_BLEND | DSDRAW_XOR) #define UC_BLITTING_FLAGS_3D (DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_BLEND_COLORALPHA | \ DSBLIT_COLORIZE | \ DSBLIT_DEINTERLACE) #define UC_BLITTING_FLAGS_3D_INV (DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_COLORIZE | \ DSBLIT_DEINTERLACE) #define UC_DRAWING_FUNCTIONS_3D (DFXL_DRAWLINE | \ DFXL_DRAWRECTANGLE | \ DFXL_FILLRECTANGLE | \ DFXL_FILLTRIANGLE) #define UC_BLITTING_FUNCTIONS_3D (DFXL_BLIT | \ DFXL_STRETCHBLIT | \ DFXL_TEXTRIANGLES) #else #define UC_DRAWING_FLAGS_3D 0 #define UC_BLITTING_FLAGS_3D 0 #define UC_DRAWING_FUNCTIONS_3D 0 #define UC_BLITTING_FUNCTIONS_3D 0 #endif // UC_ENABLE_3D // Functions void uc_emit_commands ( void *drv, void *dev ); void uc_flush_texture_cache( void *drv, void *dev ); bool uc_fill_rectangle ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_rectangle ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_line ( void *drv, void *dev, DFBRegion *line ); bool uc_blit ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); bool uc_fill_rectangle_3d ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_rectangle_3d ( void *drv, void *dev, DFBRectangle *rect ); bool uc_draw_line_3d ( void *drv, void *dev, DFBRegion *line ); bool uc_fill_triangle ( void *drv, void *dev, DFBTriangle *tri ); bool uc_blit_3d ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); bool uc_stretch_blit ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); bool uc_texture_triangles ( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ); #endif // __UC_ACCEL_H__ DirectFB-1.2.10/gfxdrivers/unichrome/regs2d.h0000644000175000017500000001707511164361026015663 00000000000000// Note: This is a modified version of via_regs.h from the XFree86 CVS tree. /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __VIA_REGS_2D_H__ #define __VIA_REGS_2D_H__ /* Selected 2D engine raster operations. * See xc/programs/Xserver/hw/xfree86/xaa/xaarop.h * in the XFree86 project for the full list. */ #define VIA_ROP_DPx (0x5A << 24) #define VIA_ROP_DSx (0x66 << 24) #define VIA_ROP_S (0xCC << 24) #define VIA_ROP_P (0xF0 << 24) /* My own reverse-engineered bit definitions */ // Use the following definitions with VIA_KEY_CONTROL /// When set, red channel is not drawn #define VIA_KEY_MASK_RED 0x40000000 /// When set, green channel is not drawn #define VIA_KEY_MASK_GREEN 0x20000000 /// When set, blue channel is not drawn #define VIA_KEY_MASK_BLUE 0x10000000 /** When set, destination keying is enabled. * Caveat: VIA's destination key is the opposite of DirectFB's: * It draws where there is no match in the destination surface. */ #define VIA_KEY_ENABLE_DSTKEY 0x8000 /** When set, source keying is enabled * It draws the pixels in the source that do not match the color key. */ #define VIA_KEY_ENABLE_SRCKEY 0x4000 /** Inverts the behaviour of the color keys: * Dst key: draw where the destination matches the key * Src key: draw where the source matches the key * Problem: Since this bit affects both keys, you can not do * combined source and destination keying with DirectFB. * The inverted source key is all but useless since it will * only draw the source pixels that match the key! * It must be a design error... */ #define VIA_KEY_INVERT_KEY 0x2000 /* 2D engine registers and bit definitions */ #define VIA_MMIO_REGSIZE 0x9000 #define VIA_MMIO_REGBASE 0x0 #define VIA_MMIO_VGABASE 0x8000 #define VIA_MMIO_BLTBASE 0x200000 #define VIA_MMIO_BLTSIZE 0x10000 #define VIA_VQ_SIZE (256*1024) /* defines for VIA 2D registers */ #define VIA_REG_GECMD 0x000 #define VIA_REG_GEMODE 0x004 #define VIA_REG_GESTATUS 0x004 /* as same as VIA_REG_GEMODE */ #define VIA_REG_SRCPOS 0x008 #define VIA_REG_DSTPOS 0x00C #define VIA_REG_LINE_K1K2 0x008 #define VIA_REG_LINE_XY 0x00C #define VIA_REG_DIMENSION 0x010 /* width and height */ #define VIA_REG_PATADDR 0x014 #define VIA_REG_FGCOLOR 0x018 #define VIA_REG_DSTCOLORKEY 0x018 /* as same as VIA_REG_FG */ #define VIA_REG_BGCOLOR 0x01C #define VIA_REG_SRCCOLORKEY 0x01C /* as same as VIA_REG_BG */ #define VIA_REG_CLIPTL 0x020 /* top and left of clipping */ #define VIA_REG_CLIPBR 0x024 /* bottom and right of clipping */ #define VIA_REG_OFFSET 0x028 #define VIA_REG_LINE_ERROR 0x028 #define VIA_REG_KEYCONTROL 0x02C /* color key control */ #define VIA_REG_SRCBASE 0x030 #define VIA_REG_DSTBASE 0x034 #define VIA_REG_PITCH 0x038 /* pitch of src and dst */ #define VIA_REG_MONOPAT0 0x03C #define VIA_REG_MONOPAT1 0x040 #define VIA_REG_COLORPAT 0x100 /* from 0x100 to 0x1ff */ /* defines for VIA video registers */ #define VIA_REG_INTERRUPT 0x200 #define VIA_REG_CRTCSTART 0x214 /* defines for VIA HW cursor registers */ #define VIA_REG_CURSOR_MODE 0x2D0 #define VIA_REG_CURSOR_POS 0x2D4 #define VIA_REG_CURSOR_ORG 0x2D8 #define VIA_REG_CURSOR_BG 0x2DC #define VIA_REG_CURSOR_FG 0x2E0 /* defines for VIA 3D registers */ #define VIA_REG_STATUS 0x400 #define VIA_REG_TRANSET 0x43C #define VIA_REG_TRANSPACE 0x440 /* VIA_REG_STATUS(0x400): Engine Status */ #define VIA_CMD_RGTR_BUSY 0x00000080 /* Command Regulator is busy */ #define VIA_2D_ENG_BUSY 0x00000001 /* 2D Engine is busy */ #define VIA_3D_ENG_BUSY 0x00000002 /* 3D Engine is busy */ #define VIA_VR_QUEUE_BUSY 0x00020000 /* Virtual Queue is busy */ /* VIA_REG_GECMD(0x00): 2D Engine Command */ #define VIA_GEC_NOOP 0x00000000 #define VIA_GEC_BLT 0x00000001 #define VIA_GEC_LINE 0x00000005 #define VIA_GEC_SRC_XY 0x00000000 #define VIA_GEC_SRC_LINEAR 0x00000010 #define VIA_GEC_DST_XY 0x00000000 #define VIA_GEC_DST_LINRAT 0x00000020 #define VIA_GEC_SRC_FB 0x00000000 #define VIA_GEC_SRC_SYS 0x00000040 #define VIA_GEC_DST_FB 0x00000000 #define VIA_GEC_DST_SYS 0x00000080 #define VIA_GEC_SRC_MONO 0x00000100 /* source is mono */ #define VIA_GEC_PAT_MONO 0x00000200 /* pattern is mono */ #define VIA_GEC_MSRC_OPAQUE 0x00000000 /* mono src is opaque */ #define VIA_GEC_MSRC_TRANS 0x00000400 /* mono src is transparent */ #define VIA_GEC_PAT_FB 0x00000000 /* pattern is in frame buffer */ #define VIA_GEC_PAT_REG 0x00000800 /* pattern is from reg setting */ #define VIA_GEC_CLIP_DISABLE 0x00000000 #define VIA_GEC_CLIP_ENABLE 0x00001000 #define VIA_GEC_FIXCOLOR_PAT 0x00002000 #define VIA_GEC_INCX 0x00000000 #define VIA_GEC_DECY 0x00004000 #define VIA_GEC_INCY 0x00000000 #define VIA_GEC_DECX 0x00008000 #define VIA_GEC_MPAT_OPAQUE 0x00000000 /* mono pattern is opaque */ #define VIA_GEC_MPAT_TRANS 0x00010000 /* mono pattern is transparent */ #define VIA_GEC_MONO_UNPACK 0x00000000 #define VIA_GEC_MONO_PACK 0x00020000 #define VIA_GEC_MONO_DWORD 0x00000000 #define VIA_GEC_MONO_WORD 0x00040000 #define VIA_GEC_MONO_BYTE 0x00080000 #define VIA_GEC_LASTPIXEL_ON 0x00000000 #define VIA_GEC_LASTPIXEL_OFF 0x00100000 #define VIA_GEC_X_MAJOR 0x00000000 #define VIA_GEC_Y_MAJOR 0x00200000 #define VIA_GEC_QUICK_START 0x00800000 /* VIA_REG_GEMODE(0x04): GE mode */ #define VIA_GEM_8bpp 0x00000000 #define VIA_GEM_16bpp 0x00000100 #define VIA_GEM_32bpp 0x00000300 #define VIA_GEM_640 0x00000000 /* 640*480 */ #define VIA_GEM_800 0x00000400 /* 800*600 */ #define VIA_GEM_1024 0x00000800 /* 1024*768 */ #define VIA_GEM_1280 0x00000C00 /* 1280*1024 */ #define VIA_GEM_1600 0x00001000 /* 1600*1200 */ #define VIA_GEM_2048 0x00001400 /* 2048*1536 */ /* VIA_REG_PITCH(0x38): Pitch Setting */ #define VIA_PITCH_ENABLE 0x80000000 #endif // __VIA_REGS_2D_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_spic.c0000644000175000017500000001307311164361026016107 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include "unichrome.h" #include "vidregs.h" #include "mmio.h" #include #include #define UC_SPIC_OPTIONS DLOP_OPACITY typedef struct _UcSubpictureData { } UcSubpictureData; static int uc_spic_datasize( void ) { return sizeof(UcSubpictureData); } static void uc_spic_set_palette( volatile u8* hwregs, CorePalette *palette ) { int i; if (palette) { for (i = 0; i < 16; i++) { /* TODO: Check r-g-b order. */ VIDEO_OUT(hwregs, RAM_TABLE_CONTROL, (palette->entries[i].r << 24) | (palette->entries[i].g << 16) | (palette->entries[i].b << 8) | (i << 4) | RAM_TABLE_RGB_ENABLE); } } } static void uc_spic_enable( volatile u8 *hwregs, bool enable ) { VIDEO_OUT(hwregs, SUBP_CONTROL_STRIDE, (VIDEO_IN(hwregs, SUBP_CONTROL_STRIDE) & ~SUBP_HQV_ENABLE) | (enable ? SUBP_HQV_ENABLE : 0)); } static void uc_spic_set_buffer( volatile u8 *hwregs, CoreSurfaceBufferLock *lock ) { if (lock) { VIDEO_OUT(hwregs, SUBP_STARTADDR, lock->offset); VIDEO_OUT(hwregs, SUBP_CONTROL_STRIDE, (VIDEO_IN(hwregs, SUBP_CONTROL_STRIDE) & ~SUBP_STRIDE_MASK) | (lock->pitch & SUBP_STRIDE_MASK) | SUBP_AI44 ); } } static DFBResult uc_spic_init_layer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { /* Set layer type, capabilities and name */ description->caps = DLCAPS_SURFACE | DLCAPS_OPACITY; description->type = DLTF_GRAPHICS | DLTF_VIDEO | DLTF_STILL_PICTURE; snprintf(description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "VIA Unichrome DVD Subpicture"); adjustment->flags = DCAF_NONE; /* Fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 720; config->height = 576; config->pixelformat = DSPF_ALUT44; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; return DFB_OK; } static DFBResult uc_spic_test_region( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed) { CoreLayerRegionConfigFlags fail = 0; /* Check layer options */ if (config->options & ~UC_SPIC_OPTIONS) fail |= CLRCF_OPTIONS; /* Check pixelformats */ switch (config->format) { case DSPF_ALUT44: break; //case DSPF_LUTA44: // IA44 does not exist in DirectFB, but hw supports it. default: fail |= CLRCF_FORMAT; } /* Check width and height */ if (config->width > 8195 || config->width < 1) fail |= CLRCF_WIDTH; if (config->height > 4096 || config->height < 1) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult uc_spic_set_region( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; uc_spic_set_palette(ucdrv->hwregs, palette); uc_spic_set_buffer(ucdrv->hwregs, lock); uc_spic_enable(ucdrv->hwregs, (config->opacity > 0)); return DFB_OK; } static DFBResult uc_spic_remove( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; uc_spic_enable(ucdrv->hwregs, false); return DFB_OK; } static DFBResult uc_spic_flip_region( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { UcDriverData* ucdrv = (UcDriverData*) driver_data; dfb_surface_flip(surface, false); uc_spic_set_buffer(ucdrv->hwregs, lock); return DFB_OK; } DisplayLayerFuncs ucSubpictureFuncs = { .LayerDataSize = uc_spic_datasize, .InitLayer = uc_spic_init_layer, .SetRegion = uc_spic_set_region, .RemoveRegion = uc_spic_remove, .TestRegion = uc_spic_test_region, .FlipRegion = uc_spic_flip_region, }; DirectFB-1.2.10/gfxdrivers/unichrome/vidregs.h0000644000175000017500000005561311164361026016140 00000000000000/* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sub license, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef __VIDREGS_H__ #define __VIDREGS_H__ /* Video registers */ #define V_FLAGS 0x00 #define V_CAP_STATUS 0x04 #define V_FLIP_STATUS 0x04 #define V_ALPHA_WIN_START 0x08 #define V_ALPHA_WIN_END 0x0C #define V_ALPHA_CONTROL 0x10 #define V_CRT_STARTADDR 0x14 #define V_CRT_STARTADDR_2 0x18 #define V_ALPHA_STRIDE 0x1C #define V_COLOR_KEY 0x20 #define V_ALPHA_STARTADDR 0x24 #define V_CHROMAKEY_LOW 0x28 #define V_CHROMAKEY_HIGH 0x2C #define V1_CONTROL 0x30 #define V12_QWORD_PER_LINE 0x34 #define V1_STARTADDR_1 0x38 #define V1_STARTADDR_Y1 V1_STARTADDR_1 /* added by Kevin 3/30/2002 */ #define V1_STRIDE 0x3C #define V1_WIN_START_Y 0x40 #define V1_WIN_START_X 0x42 #define V1_WIN_END_Y 0x44 #define V1_WIN_END_X 0x46 #define V1_STARTADDR_2 0x48 #define V1_STARTADDR_Y2 V1_STARTADDR_2 /* added by Kevin 3/30/2002 */ #define V1_ZOOM_CONTROL 0x4C #define V1_MINI_CONTROL 0x50 #define V1_STARTADDR_0 0x54 #define V1_STARTADDR_Y0 V1_STARTADDR_0 /* added by Kevin 3/30/2002 */ #define V_FIFO_CONTROL 0x58 #define V1_STARTADDR_3 0x5C #define V1_STARTADDR_Y3 V1_STARTADDR_3 /* added by Kevin 3/30/2002 */ #define HI_CONTROL 0x60 #define SND_COLOR_KEY 0x64 #define ALPHA_V3_PREFIFO_CONTROL 0x68 #define V1_SOURCE_HEIGHT 0x6C #define HI_TRANSPARENT_COLOR 0x70 #define V_DISPLAY_TEMP 0x74 /* No use */ #define ALPHA_V3_FIFO_CONTROL 0x78 #define V3_SOURCE_WIDTH 0x7C #define V3_COLOR_KEY 0x80 #define V1_ColorSpaceReg_1 0x84 #define V1_ColorSpaceReg_2 0x88 #define V1_STARTADDR_CB0 0x8C #define V1_OPAQUE_CONTROL 0x90 /* To be deleted */ #define V3_OPAQUE_CONTROL 0x94 /* To be deleted */ #define V_COMPOSE_MODE 0x98 #define V3_STARTADDR_2 0x9C #define V3_CONTROL 0xA0 #define V3_STARTADDR_0 0xA4 #define V3_STARTADDR_1 0xA8 #define V3_STRIDE 0xAC #define V3_WIN_START_Y 0xB0 #define V3_WIN_START_X 0xB2 #define V3_WIN_END_Y 0xB4 #define V3_WIN_END_X 0xB6 #define V3_ALPHA_QWORD_PER_LINE 0xB8 #define V3_ZOOM_CONTROL 0xBC #define V3_MINI_CONTROL 0xC0 #define V3_ColorSpaceReg_1 0xC4 #define V3_ColorSpaceReg_2 0xC8 #define V3_DISPLAY_TEMP 0xCC /* No use */ #define V1_STARTADDR_CB1 0xE4 #define V1_STARTADDR_CB2 0xE8 #define V1_STARTADDR_CB3 0xEC #define V1_STARTADDR_CR0 0xF0 #define V1_STARTADDR_CR1 0xF4 #define V1_STARTADDR_CR2 0xF8 #define V1_STARTADDR_CR3 0xFC /* Video Capture Engine Registers - port 1 */ #define CAP0_MASKS 0x100 #define CAP1_MASKS 0x104 #define CAP0_CONTROL 0x110 #define CAP0_H_RANGE 0x114 #define CAP0_V_RANGE 0x118 #define CAP0_SCAL_CONTROL 0x11C #define CAP0_VBI_H_RANGE 0x120 #define CAP0_VBI_V_RANGE 0x124 #define CAP0_VBI_STARTADDR 0x128 #define CAP0_VBI_STRIDE 0x12C #define CAP0_ANCIL_COUNT 0x130 #define CAP0_MAXCOUNT 0x134 #define CAP0_VBIMAX_COUNT 0x138 #define CAP0_DATA_COUNT 0x13C #define CAP0_FB_STARTADDR0 0x140 #define CAP0_FB_STARTADDR1 0x144 #define CAP0_FB_STARTADDR2 0x148 #define CAP0_STRIDE 0x150 /* Video Capture Engine Registers - port 2 */ #define CAP1_CONTROL 0x154 #define CAP1_SCAL_CONTROL 0x160 #define CAP1_VBI_H_RANGE 0x164 /*To be deleted*/ #define CAP1_VBI_V_RANGE 0x168 /*To be deleted*/ #define CAP1_VBI_STARTADDR 0x16C /*To be deleted*/ #define CAP1_VBI_STRIDE 0x170 /*To be deleted*/ #define CAP1_ANCIL_COUNT 0x174 /*To be deleted*/ #define CAP1_MAXCOUNT 0x178 #define CAP1_VBIMAX_COUNT 0x17C /*To be deleted*/ #define CAP1_DATA_COUNT 0x180 #define CAP1_FB_STARTADDR0 0x184 #define CAP1_FB_STARTADDR1 0x188 #define CAP1_STRIDE 0x18C /* SUBPICTURE Registers */ #define SUBP_CONTROL_STRIDE 0x1C0 #define SUBP_STARTADDR 0x1C4 #define RAM_TABLE_CONTROL 0x1C8 #define RAM_TABLE_READ 0x1CC /* HQV Registers */ #define HQV_CONTROL 0x1D0 #define HQV_SRC_STARTADDR_Y 0x1D4 #define HQV_SRC_STARTADDR_U 0x1D8 #define HQV_SRC_STARTADDR_V 0x1DC #define HQV_SRC_FETCH_LINE 0x1E0 #define HQV_FILTER_CONTROL 0x1E4 #define HQV_MINIFY_CONTROL 0x1E8 #define HQV_DST_STARTADDR0 0x1EC #define HQV_DST_STARTADDR1 0x1F0 #define HQV_DST_STARTADDR2 0x1FC #define HQV_DST_STRIDE 0x1F4 #define HQV_SRC_STRIDE 0x1F8 /* Video command definitions */ /* #define V_ALPHA_CONTROL - 0x210 */ #define ALPHA_WIN_EXPIRENUMBER_4 0x00040000 #define ALPHA_WIN_CONSTANT_FACTOR_4 0x00004000 #define ALPHA_WIN_CONSTANT_FACTOR_12 0x0000c000 #define ALPHA_WIN_BLENDING_CONSTANT 0x00000000 #define ALPHA_WIN_BLENDING_ALPHA 0x00000001 #define ALPHA_WIN_BLENDING_GRAPHIC 0x00000002 #define ALPHA_WIN_PREFIFO_THRESHOLD_12 0x000c0000 #define ALPHA_WIN_FIFO_THRESHOLD_8 0x000c0000 #define ALPHA_WIN_FIFO_DEPTH_16 0x00100000 /* V_CHROMAKEY_LOW - 0x228 */ #define V_CHROMAKEY_V3 0x80000000 /* V1_CONTROL - 0x230 */ #define V1_ENABLE 0x00000001 #define V1_FULL_SCREEN 0x00000002 #define V1_YUV422 0x00000000 #define V1_RGB32 0x00000004 #define V1_RGB15 0x00000008 #define V1_RGB16 0x0000000C #define V1_YUV420 0x00000010 #define V1_COLORSPACE_SIGN 0x00000080 #define V1_SRC_IS_FRAME_PIC 0x00000200 #define V1_SRC_IS_FIELD_PIC 0x00000000 #define V1_BOB_ENABLE 0x00400000 #define V1_FIELD_BASE 0x00000000 #define V1_FRAME_BASE 0x01000000 #define V1_SWAP_SW 0x00000000 #define V1_SWAP_HW_HQV 0x02000000 #define V1_SWAP_HW_CAPTURE 0x04000000 #define V1_SWAP_HW_MC 0x06000000 /* #define V1_DOUBLE_BUFFERS 0x00000000 */ /* #define V1_QUADRUPLE_BUFFERS 0x18000000 */ #define V1_EXPIRE_NUM 0x00050000 #define V1_EXPIRE_NUM_A 0x000a0000 #define V1_EXPIRE_NUM_F 0x000f0000 /* jason */ #define V1_FIFO_EXTENDED 0x00200000 #define V1_ON_CRT 0x00000000 #define V1_ON_SND_DISPLAY 0x80000000 #define V1_FIFO_32V1_32V2 0x00000000 #define V1_FIFO_48V1_32V2 0x00200000 /* V12_QWORD_PER_LINE - 0x234 */ #define V1_FETCH_COUNT 0x3ff00000 #define V1_FETCHCOUNT_ALIGNMENT 0x0000000f #define V1_FETCHCOUNT_UNIT 0x00000004 /* Doubld QWORD */ /* V1_STRIDE */ #define V1_STRIDE_YMASK 0x00001fff #define V1_STRIDE_UVMASK 0x1ff00000 /* V1_ZOOM_CONTROL - 0x24C */ #define V1_X_ZOOM_ENABLE 0x80000000 #define V1_Y_ZOOM_ENABLE 0x00008000 /* V1_MINI_CONTROL - 0x250 */ #define V1_X_INTERPOLY 0x00000002 /* X interpolation */ #define V1_Y_INTERPOLY 0x00000001 /* Y interpolation */ #define V1_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */ #define V1_X_DIV_2 0x01000000 #define V1_X_DIV_4 0x03000000 #define V1_X_DIV_8 0x05000000 #define V1_X_DIV_16 0x07000000 #define V1_Y_DIV_2 0x00010000 #define V1_Y_DIV_4 0x00030000 #define V1_Y_DIV_8 0x00050000 #define V1_Y_DIV_16 0x00070000 /* V1_STARTADDR0 - 0x254 */ #define SW_FLIP_ODD 0x08000000 /* V_FIFO_CONTROL - 0x258 * IA2 has 32 level FIFO for packet mode video format * 32 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 enable * 16 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 disable * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122 */ #define V1_FIFO_DEPTH12 0x0000000B #define V1_FIFO_DEPTH16 0x0000000F #define V1_FIFO_DEPTH32 0x0000001F #define V1_FIFO_DEPTH48 0x0000002F #define V1_FIFO_DEPTH64 0x0000003F #define V1_FIFO_THRESHOLD6 0x00000600 #define V1_FIFO_THRESHOLD8 0x00000800 #define V1_FIFO_THRESHOLD12 0x00000C00 #define V1_FIFO_THRESHOLD16 0x00001000 #define V1_FIFO_THRESHOLD24 0x00001800 #define V1_FIFO_THRESHOLD32 0x00002000 #define V1_FIFO_THRESHOLD40 0x00002800 #define V1_FIFO_THRESHOLD48 0x00003000 #define V1_FIFO_THRESHOLD56 0x00003800 #define V1_FIFO_THRESHOLD61 0x00003D00 #define V1_FIFO_PRETHRESHOLD10 0x0A000000 #define V1_FIFO_PRETHRESHOLD12 0x0C000000 #define V1_FIFO_PRETHRESHOLD29 0x1d000000 #define V1_FIFO_PRETHRESHOLD40 0x28000000 #define V1_FIFO_PRETHRESHOLD44 0x2c000000 #define V1_FIFO_PRETHRESHOLD56 0x38000000 #define V1_FIFO_PRETHRESHOLD61 0x3D000000 /* ALPHA_V3_FIFO_CONTROL - 0x278 * IA2 has 32 level FIFO for packet mode video format * 32 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 enable * 16 level FIFO for planar mode video YV12. * with extension reg 230 bit 21 disable * 8 level FIFO for ALPHA * BCos of 128 bits. 1 level in IA2 = 2 level in VT3122 */ #define V3_FIFO_DEPTH16 0x0000000F #define V3_FIFO_DEPTH24 0x00000017 #define V3_FIFO_DEPTH32 0x0000001F #define V3_FIFO_DEPTH48 0x0000002F #define V3_FIFO_DEPTH64 0x0000003F #define V3_FIFO_THRESHOLD8 0x00000800 #define V3_FIFO_THRESHOLD12 0x00000C00 #define V3_FIFO_THRESHOLD16 0x00001000 #define V3_FIFO_THRESHOLD24 0x00001800 #define V3_FIFO_THRESHOLD32 0x00002000 #define V3_FIFO_THRESHOLD40 0x00002800 #define V3_FIFO_THRESHOLD48 0x00003000 #define V3_FIFO_THRESHOLD61 0x00003D00 #define V3_FIFO_PRETHRESHOLD10 0x0000000A #define V3_FIFO_PRETHRESHOLD12 0x0000000C #define V3_FIFO_PRETHRESHOLD29 0x0000001d #define V3_FIFO_PRETHRESHOLD40 0x00000028 #define V3_FIFO_PRETHRESHOLD44 0x0000002c #define V3_FIFO_PRETHRESHOLD56 0x00000038 #define V3_FIFO_PRETHRESHOLD61 0x0000003D #define V3_FIFO_MASK 0x0000007F #define ALPHA_FIFO_DEPTH8 0x00070000 #define ALPHA_FIFO_THRESHOLD4 0x04000000 #define ALPHA_FIFO_MASK 0xffff0000 #define ALPHA_FIFO_PRETHRESHOLD4 0x00040000 /* IA2 */ #define ColorSpaceValue_1 0x140020f2 #define ColorSpaceValue_2 0x0a0a2c00 #define ColorSpaceValue_1_3123C0 0x13000DED #define ColorSpaceValue_2_3123C0 0x13171000 /* For TV setting */ #define ColorSpaceValue_1TV 0x140020f2 #define ColorSpaceValue_2TV 0x0a0a2c00 /* V_COMPOSE_MODE - 0x298 */ /* ENABLE_COLOR_KEYING - renamed from SELECT_VIDEO_IF_COLOR_KEY for DirectFB*/ #define ENABLE_COLOR_KEYING 0x00000001 /* select video if (color key),otherwise select graphics */ #define SELECT_VIDEO3_IF_COLOR_KEY 0x00000020 /* For 3123C0, select video3 if (color key),otherwise select graphics */ #define SELECT_VIDEO_IF_CHROMA_KEY 0x00000002 /* 0x0000000a //select video if (chroma key ),otherwise select graphics */ #define ALWAYS_SELECT_VIDEO 0x00000000 /* always select video,Chroma key and Color key disable */ #define COMPOSE_V1_V3 0x00000000 /* V1 on top of V3 */ #define COMPOSE_V3_V1 0x00100000 /* V3 on top of V1 */ #define COMPOSE_V1_TOP 0x00000000 #define COMPOSE_V3_TOP 0x00100000 #define V1_COMMAND_FIRE 0x80000000 /* V1 commands fire */ #define V3_COMMAND_FIRE 0x40000000 /* V3 commands fire */ #define V_COMMAND_LOAD 0x20000000 /* Video register always loaded */ #define V_COMMAND_LOAD_VBI 0x10000000 /* Video register always loaded at vbi without waiting source flip */ #define V3_COMMAND_LOAD 0x08000000 /* CLE_C0 Video3 register always loaded */ #define V3_COMMAND_LOAD_VBI 0x00000100 /* CLE_C0 Video3 register always loaded at vbi without waiting source flip */ #define SECOND_DISPLAY_COLOR_KEY_ENABLE 0x00010000 /* V3_ZOOM_CONTROL - 0x2bc */ #define V3_X_ZOOM_ENABLE 0x80000000 #define V3_Y_ZOOM_ENABLE 0x00008000 /* V3_MINI_CONTROL - 0x2c0 */ #define V3_X_INTERPOLY 0x00000002 /* X interpolation */ #define V3_Y_INTERPOLY 0x00000001 /* Y interpolation */ #define V3_YCBCR_INTERPOLY 0x00000004 /* Y, Cb, Cr all interpolation */ #define V3_X_DIV_2 0x01000000 #define V3_X_DIV_4 0x03000000 #define V3_X_DIV_8 0x05000000 #define V3_X_DIV_16 0x07000000 #define V3_Y_DIV_2 0x00010000 #define V3_Y_DIV_4 0x00030000 #define V3_Y_DIV_8 0x00050000 #define V3_Y_DIV_16 0x00070000 /* SUBP_CONTROL_STRIDE - 0x3c0 */ #define SUBP_HQV_ENABLE 0x00010000 #define SUBP_IA44 0x00020000 #define SUBP_AI44 0x00000000 #define SUBP_STRIDE_MASK 0x00001fff #define SUBP_CONTROL_MASK 0x00070000 /* RAM_TABLE_CONTROL - 0x3c8 */ #define RAM_TABLE_RGB_ENABLE 0x00000007 /* CAPTURE0_CONTROL - 0x310 */ #define C0_ENABLE 0x00000001 #define BUFFER_2_MODE 0x00000000 #define BUFFER_3_MODE 0x00000004 #define BUFFER_4_MODE 0x00000006 #define SWAP_YUYV 0x00000000 #define SWAP_UYVY 0x00000100 #define SWAP_YVYU 0x00000200 #define SWAP_VYUY 0x00000300 #define IN_601_8 0x00000000 #define IN_656_8 0x00000010 #define IN_601_16 0x00000020 #define IN_656_16 0x00000030 #define DEINTER_ODD 0x00000000 #define DEINTER_EVEN 0x00001000 #define DEINTER_ODD_EVEN 0x00002000 #define DEINTER_FRAME 0x00003000 #define VIP_1 0x00000000 #define VIP_2 0x00000400 #define H_FILTER_2 0x00010000 #define H_FILTER_4 0x00020000 #define H_FILTER_8_1331 0x00030000 #define H_FILTER_8_12221 0x00040000 #define VIP_ENABLE 0x00000008 #define EN_FIELD_SIG 0x00000800 #define VREF_INVERT 0x00100000 #define FIELD_INPUT_INVERSE 0x00400000 #define FIELD_INVERSE 0x40000000 #define C1_H_MINI_EN 0x00000800 #define C0_H_MINI_EN 0x00000800 #define C1_V_MINI_EN 0x04000000 #define C0_V_MINI_EN 0x04000000 #define C1_H_MINI_2 0x00000400 /* CAPTURE1_CONTROL - 0x354 */ #define C1_ENABLE 0x00000001 /* V3_CONTROL - 0x2A0 */ #define V3_ENABLE 0x00000001 #define V3_FULL_SCREEN 0x00000002 #define V3_YUV422 0x00000000 #define V3_RGB32 0x00000004 #define V3_RGB15 0x00000008 #define V3_RGB16 0x0000000C #define V3_COLORSPACE_SIGN 0x00000080 #define V3_EXPIRE_NUM 0x00040000 #define V3_EXPIRE_NUM_F 0x000f0000 #define V3_BOB_ENABLE 0x00400000 #define V3_FIELD_BASE 0x00000000 #define V3_FRAME_BASE 0x01000000 #define V3_SWAP_SW 0x00000000 #define V3_SWAP_HW_HQV 0x02000000 #define V3_FLIP_HW_CAPTURE0 0x04000000 #define V3_FLIP_HW_CAPTURE1 0x06000000 /* V3_ALPHA_FETCH_COUNT - 0x2B8 */ #define V3_FETCH_COUNT 0x3ff00000 #define ALPHA_FETCH_COUNT 0x000003ff /* HQV_CONTROL - 0x3D0 */ #define HQV_RGB32 0x00000000 #define HQV_RGB16 0x20000000 #define HQV_RGB15 0x30000000 #define HQV_YUV422 0x80000000 #define HQV_YUV420 0xC0000000 #define HQV_ENABLE 0x08000000 #define HQV_SRC_SW 0x00000000 #define HQV_SRC_MC 0x01000000 #define HQV_SRC_CAPTURE0 0x02000000 #define HQV_SRC_CAPTURE1 0x03000000 #define HQV_FLIP_EVEN 0x00000000 #define HQV_FLIP_ODD 0x00000020 #define HQV_SW_FLIP 0x00000010 /* Write 1 to flip HQV buffer */ #define HQV_DEINTERLACE 0x00010000 /* First line of odd field will be repeated 3 times */ #define HQV_FIELD_2_FRAME 0x00020000 /* Src is field. Display each line 2 times */ #define HQV_FRAME_2_FIELD 0x00040000 /* Src is field. Display field */ #define HQV_FRAME_UV 0x00000000 /* Src is Non-interleaved */ #define HQV_FIELD_UV 0x00100000 /* Src is interleaved */ #define HQV_IDLE 0x00000008 #define HQV_FLIP_STATUS 0x00000001 #define HQV_DOUBLE_BUFF 0x00000000 #define HQV_TRIPLE_BUFF 0x04000000 #define HQV_SUBPIC_FLIP 0x00008000 #define HQV_FIFO_STATUS 0x00001000 /* HQV_FILTER_CONTROL - 0x3E4 */ #define HQV_H_LOWPASS_2TAP 0x00000001 #define HQV_H_LOWPASS_4TAP 0x00000002 #define HQV_H_LOWPASS_8TAP1 0x00000003 /* To be deleted */ #define HQV_H_LOWPASS_8TAP2 0x00000004 /* To be deleted */ #define HQV_H_HIGH_PASS 0x00000008 #define HQV_H_LOW_PASS 0x00000000 #define HQV_V_LOWPASS_2TAP 0x00010000 #define HQV_V_LOWPASS_4TAP 0x00020000 #define HQV_V_LOWPASS_8TAP1 0x00030000 #define HQV_V_LOWPASS_8TAP2 0x00040000 #define HQV_V_HIGH_PASS 0x00080000 #define HQV_V_LOW_PASS 0x00000000 #define HQV_H_HIPASS_F1_DEFAULT 0x00000040 #define HQV_H_HIPASS_F2_DEFAULT 0x00000000 #define HQV_V_HIPASS_F1_DEFAULT 0x00400000 #define HQV_V_HIPASS_F2_DEFAULT 0x00000000 #define HQV_H_HIPASS_F1_2TAP 0x00000050 #define HQV_H_HIPASS_F2_2TAP 0x00000100 #define HQV_V_HIPASS_F1_2TAP 0x00500000 #define HQV_V_HIPASS_F2_2TAP 0x01000000 #define HQV_H_HIPASS_F1_4TAP 0x00000060 #define HQV_H_HIPASS_F2_4TAP 0x00000200 #define HQV_V_HIPASS_F1_4TAP 0x00600000 #define HQV_V_HIPASS_F2_4TAP 0x02000000 #define HQV_H_HIPASS_F1_8TAP 0x00000080 #define HQV_H_HIPASS_F2_8TAP 0x00000400 #define HQV_V_HIPASS_F1_8TAP 0x00800000 #define HQV_V_HIPASS_F2_8TAP 0x04000000 /* IA2 NEW */ #define HQV_V_FILTER2 0x00080000 #define HQV_H_FILTER2 0x00000008 #define HQV_H_TAP2_11 0x00000041 #define HQV_H_TAP4_121 0x00000042 #define HQV_H_TAP4_1111 0x00000401 #define HQV_H_TAP8_1331 0x00000221 #define HQV_H_TAP8_12221 0x00000402 #define HQV_H_TAP16_1991 0x00000159 #define HQV_H_TAP16_141041 0x0000026A #define HQV_H_TAP32 0x0000015A #define HQV_V_TAP2_11 0x00410000 #define HQV_V_TAP4_121 0x00420000 #define HQV_V_TAP4_1111 0x04010000 #define HQV_V_TAP8_1331 0x02210000 #define HQV_V_TAP8_12221 0x04020000 #define HQV_V_TAP16_1991 0x01590000 #define HQV_V_TAP16_141041 0x026A0000 #define HQV_V_TAP32 0x015A0000 #define HQV_V_FILTER_DEFAULT 0x00420000 #define HQV_H_FILTER_DEFAULT 0x00000040 /* HQV_MINI_CONTROL - 0x3E8 */ #define HQV_H_MINIFY_ENABLE 0x00000800 #define HQV_V_MINIFY_ENABLE 0x08000000 #define HQV_VDEBLOCK_FILTER 0x80000000 #define HQV_HDEBLOCK_FILTER 0x00008000 #endif // __VIDREGS_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_primary.c0000644000175000017500000001343611245562152016642 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" /* primary layer hooks */ #define OSD_OPTIONS (DLOP_ALPHACHANNEL | DLOP_SRC_COLORKEY | DLOP_OPACITY) DisplayLayerFuncs ucOldPrimaryFuncs; void *ucOldPrimaryDriverData; static DFBResult osdInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { DFBResult ret; /* call the original initialization function first */ ret = ucOldPrimaryFuncs.InitLayer( layer, ucOldPrimaryDriverData, layer_data, description, config, adjustment ); if (ret) return ret; /* set name */ snprintf(description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "VIA CLE266 Graphics"); /* add some capabilities */ description->caps |= DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY | DLCAPS_SRC_COLORKEY; return DFB_OK; } static DFBResult osdTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { DFBResult ret; CoreLayerRegionConfigFlags fail = 0; DFBDisplayLayerOptions options = config->options; /* remove options before calling the original function */ config->options = DLOP_NONE; /* call the original function */ ret = ucOldPrimaryFuncs.TestRegion( layer, ucOldPrimaryDriverData, layer_data, config, &fail ); /* check options if specified */ if (options) { /* any unsupported option wanted? */ if (options & ~OSD_OPTIONS) fail |= CLRCF_OPTIONS; /* opacity and alpha channel cannot be used at once */ if ((options & (DLOP_OPACITY | DLOP_ALPHACHANNEL)) == (DLOP_OPACITY | DLOP_ALPHACHANNEL)) { fail |= CLRCF_OPTIONS; } if ((options & DLOP_ALPHACHANNEL) && config->format != DSPF_AiRGB) fail |= CLRCF_OPTIONS; } /* restore options */ config->options = options; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return ret; } static DFBResult osdSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { DFBResult ret; UcDriverData *ucdrv = (UcDriverData*) driver_data; /* call the original function */ ret = ucOldPrimaryFuncs.SetRegion( layer, ucOldPrimaryDriverData, layer_data, region_data, config, updated, surface, palette, lock ); if (ret) return ret; uc_ovl_vcmd_wait(ucdrv->hwregs); /* select pixel based or global alpha */ if (!ucdrv->ovl) // overlay not present return DFB_OK; if (config->options & DLOP_ALPHACHANNEL) ucdrv->ovl->opacity_primary = -1; // use primary alpha for overlay else if (config->options & DLOP_OPACITY) ucdrv->ovl->opacity_primary = config->opacity ^ 0xff; // use inverse for overlay else ucdrv->ovl->opacity_primary = 0x00; // primary opaque == overlay transparent if (ucdrv->ovl->v1.level < 0) // primary on top? { VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL, uc_ovl_map_alpha(ucdrv->ovl->opacity_primary)); VIDEO_OUT(ucdrv->hwregs, V_COMPOSE_MODE, VIDEO_IN(ucdrv->hwregs, V_COMPOSE_MODE) | V1_COMMAND_FIRE); } return DFB_OK; } DisplayLayerFuncs ucPrimaryFuncs = { .InitLayer = osdInitLayer, .TestRegion = osdTestRegion, .SetRegion = osdSetRegion, }; DirectFB-1.2.10/gfxdrivers/unichrome/uc_overlay.h0000644000175000017500000000754311164361026016644 00000000000000#ifndef __UC_OVERLAY_H__ #define __UC_OVERLAY_H__ #define UC_OVL_CAPS (DLCAPS_SURFACE | DLCAPS_OPACITY | DLCAPS_SCREEN_LOCATION \ | DLCAPS_DEINTERLACING | DLCAPS_DST_COLORKEY | DLCAPS_LEVELS \ | DLCAPS_FIELD_PARITY ) /* | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST \ | DLCAPS_SATURATION | DLCAPS_HUE) */ #define UC_OVL_OPTIONS (DLOP_DEINTERLACING | DLOP_DST_COLORKEY \ | DLOP_FIELD_PARITY | DLOP_OPACITY ) #define ALIGN_TO(v, n) (((v) + (n-1)) & ~(n-1)) #define UC_MAP_V1_FIFO_CONTROL(depth, pre_thr, thr) \ (((depth)-1) | ((thr) << 8) | ((pre_thr) << 24)) // Actions for uc_ovl_update() #define UC_OVL_FLIP 1 #define UC_OVL_CHANGE 2 #define UC_OVL_FIELD 4 /** Overlay layer data. */ struct uc_ovl_vinfo { bool isenabled; // True when visible DFBRectangle win; // Layer screen rectangle. DFBDisplayLayerConfig cfg; // Layer configuration int ox, oy; // Top-left visible corner (the offset) // in the source surface u8 opacity; // Layer opacity int level; // Position in the DirectFB layer stack // < 0 = underlay mode, > 0 = overlay mode DFBColorAdjustment adj; // Color adjustment (brightness etc) DFBColorKey dst_key; // Destination color key bool dstkey_enabled; // Destination color key is enabled }; typedef struct _UcOverlayData { // TODO: initialize the variables!!! u8 hwrev; // Unichrome revision int scrwidth; // Current screen width bool extfifo_on; // True when we're using the extended fifo. u8 mclk_save[3]; struct uc_ovl_vinfo v1; // Video overlay V1 CoreLayerRegionConfig config; bool deinterlace; int field; CoreSurface *surface; CoreSurfaceBufferLock *lock; int opacity_primary; // overlay opacity if primary is logically // above or -1 if primary has alpha channel } UcOverlayData; // Video engine - mapping functions (uc_ovl_hwmap.c) bool uc_ovl_map_vzoom(int sh, int dh, u32* zoom, u32* mini); bool uc_ovl_map_hzoom(int sw, int dw, u32* zoom, u32* mini, u32* falign, u32* dcount); u32 uc_ovl_map_qwfetch(int falign, DFBSurfacePixelFormat format, int pfetch); u32 uc_ovl_map_format(DFBSurfacePixelFormat format); void uc_ovl_map_window(int scrw, int scrh, DFBRectangle* win, int sw, int sh, u32* win_start, u32* win_end, int* ox, int* oy, int *pfetch); void uc_ovl_map_buffer(DFBSurfacePixelFormat format, u32 buf, int x, int y, int w, int h, int pitch, int field, u32* y_start, u32* u_start, u32* v_start); u32 uc_ovl_map_alpha(int opacity); void uc_ovl_map_v1_control(DFBSurfacePixelFormat format, int sw, int hwrev, bool extfifo_on, u32* control, u32* fifo); u32 uc_ovl_map_fifo(u8 depth, u8 pre_thr, u8 thr); void uc_ovl_map_adjustment(DFBColorAdjustment* adj, u32* a1, u32* a2); u32 uc_ovl_map_colorkey(DFBColorKey* c); // Video engine - setting functions (uc_ovl_hwset.c) void uc_ovl_setup_fifo(UcOverlayData* ucovl, int scrwidth); void uc_ovl_vcmd_wait(volatile u8* vio); DFBResult uc_ovl_update(UcDriverData* ucdrv, UcOverlayData* ucovl, int action, CoreSurface* surface, CoreSurfaceBufferLock* lock); DFBResult uc_ovl_set_adjustment(CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj); #endif // __UC_OVERLAY_H__ DirectFB-1.2.10/gfxdrivers/unichrome/uc_ovl_hwset.c0000644000175000017500000002042311164361026017160 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" #include #include /** * Set up the extended video FIFO. * @note It will be turned on if ucovl->scrwidth > 1024. */ void uc_ovl_setup_fifo(UcOverlayData* ucovl, int scrwidth) { u8* mclk_save = ucovl->mclk_save; if (!iopl(3)) { if (scrwidth <= 1024) { // Disable if (ucovl->extfifo_on) { dfb_layer_wait_vsync(dfb_layer_at(DLID_PRIMARY)); outb(0x16, 0x3c4); outb(mclk_save[0], 0x3c5); outb(0x17, 0x3c4); outb(mclk_save[1], 0x3c5); outb(0x18, 0x3c4); outb(mclk_save[2], 0x3c5); ucovl->extfifo_on = false; } } else { // Enable if (!ucovl->extfifo_on) { dfb_layer_wait_vsync(dfb_layer_at(DLID_PRIMARY)); // Save current setting outb(0x16, 0x3c4); mclk_save[0] = inb(0x3c5); outb(0x17, 0x3c4); mclk_save[1] = inb(0x3c5); outb(0x18, 0x3c4); mclk_save[2] = inb(0x3c5); // Enable extended FIFO outb(0x17, 0x3c4); outb(0x2f, 0x3c5); outb(0x16, 0x3c4); outb((mclk_save[0] & 0xf0) | 0x14, 0x3c5); outb(0x18, 0x3c4); outb(0x56, 0x3c5); ucovl->extfifo_on = true; } } } else { D_BUG( "Unichrome: could set io perissons\n" ); } ucovl->scrwidth = scrwidth; } void uc_ovl_vcmd_wait(volatile u8* vio) { while ((VIDEO_IN(vio, V_COMPOSE_MODE) & (V1_COMMAND_FIRE | V3_COMMAND_FIRE))); } /** * Update the video overlay. * * @param action = UC_OVL_CHANGE: update everything * = UC_OVL_FLIP: only flip to the front surface buffer. * @param surface source surface * * @note: Derived from ddmpeg.c, Upd_Video() */ DFBResult uc_ovl_update(UcDriverData* ucdrv, UcOverlayData* ucovl, int action, CoreSurface* surface, CoreSurfaceBufferLock* lock) { int sw, sh, sp, sfmt; // Source width, height, pitch and format int dx, dy; // Destination position int dw, dh; // Destination width and height int pfetch; // Source pixels required for one line VideoMode *videomode; DFBRectangle scr; // Screen size u32 dst_key = 0; // Destination color key (hw format) bool write_buffers = false; bool write_settings = false; volatile u8* vio = ucdrv->hwregs; u32 win_start, win_end; // Overlay register settings u32 zoom, mini; u32 dcount, falign, qwfetch; u32 y_start, u_start, v_start; u32 v_ctrl, fifo_ctrl; u32 alpha = 0; int offset = lock->offset; if (!ucovl->v1.isenabled) return DFB_OK; qwfetch = 0; // Get screen size videomode = dfb_system_current_mode(); scr.w = videomode ? videomode->xres : 720; scr.h = videomode ? videomode->yres : 576; scr.x = 0; scr.y = 0; if (ucovl->scrwidth != scr.w) { // FIXME: fix uc_ovl_setup_fifo() // uc_ovl_setup_fifo(ucovl, scr.w); action |= UC_OVL_CHANGE; } D_ASSERT(surface); sw = surface->config.size.w; sh = surface->config.size.h; sp = lock->pitch; sfmt = surface->config.format; if (ucovl->deinterlace) { /*if (ucovl->field) offset += sp;*/ sh /= 2; //sp *= 2; } if (action & UC_OVL_CHANGE) { if ((sw > 4096) || (sh > 4096) || (sw < 32) || (sh < 1) || (sp > 0x1fff)) { D_DEBUG("Layer surface size is out of bounds."); return DFB_INVAREA; } dx = ucovl->v1.win.x; dy = ucovl->v1.win.y; dw = ucovl->v1.win.w; dh = ucovl->v1.win.h; // Get image format, FIFO size, etc. uc_ovl_map_v1_control(sfmt, sw, ucovl->hwrev, ucovl->extfifo_on, &v_ctrl, &fifo_ctrl); if (ucovl->deinterlace) { v_ctrl |= /*V1_BOB_ENABLE |*/ V1_FRAME_BASE; } // Get layer window. // The parts that fall outside the screen are clipped. uc_ovl_map_window(scr.w, scr.h, &(ucovl->v1.win), sw, sh, &win_start, &win_end, &ucovl->v1.ox, &ucovl->v1.oy, &pfetch); // Get scaling and data-fetch parameters // Note: the *_map_?zoom() functions return false if the scaling // is out of bounds. We don't act on it for now, because it only // makes the display look strange. zoom = 0; mini = 0; uc_ovl_map_vzoom(sh, dh, &zoom, &mini); uc_ovl_map_hzoom(sw, dw, &zoom, &mini, &falign, &dcount); qwfetch = uc_ovl_map_qwfetch(falign, sfmt, pfetch); // Prepare destination color key dst_key = uc_ovl_map_colorkey(&(ucovl->v1.dst_key)); // prepare opacity if (ucovl->v1.level > 0) // overlay alpha = uc_ovl_map_alpha(ucovl->v1.opacity); else alpha = uc_ovl_map_alpha(ucovl->opacity_primary); write_settings = true; } if (action & (UC_OVL_FIELD | UC_OVL_FLIP | UC_OVL_CHANGE)) { int field = 0; // Update the buffer pointers if (ucovl->deinterlace) { field = ucovl->field; } uc_ovl_map_buffer(sfmt, offset, ucovl->v1.ox, ucovl->v1.oy, sw, surface->config.size.h, sp, 0/*field*/, &y_start, &u_start, &v_start); if (field) { y_start |= 0x08000000; } write_buffers = true; } // Write to the hardware /* if (write_settings || write_buffers) uc_ovl_vcmd_wait(vio);*/ if (write_settings) { VIDEO_OUT(vio, V1_CONTROL, v_ctrl); VIDEO_OUT(vio, V_FIFO_CONTROL, fifo_ctrl); VIDEO_OUT(vio, V1_WIN_START_Y, win_start); VIDEO_OUT(vio, V1_WIN_END_Y, win_end); VIDEO_OUT(vio, V1_SOURCE_HEIGHT, (sh << 16) | dcount); VIDEO_OUT(vio, V12_QWORD_PER_LINE, qwfetch); VIDEO_OUT(vio, V1_STRIDE, sp | ((sp >> 1) << 16)); VIDEO_OUT(vio, V1_MINI_CONTROL, mini); VIDEO_OUT(vio, V1_ZOOM_CONTROL, zoom); VIDEO_OUT(vio, V_COLOR_KEY, dst_key); VIDEO_OUT(vio, V_ALPHA_CONTROL, alpha); } if (write_buffers) { VIDEO_OUT(vio, V1_STARTADDR_0, y_start); VIDEO_OUT(vio, V1_STARTADDR_CB0, u_start); VIDEO_OUT(vio, V1_STARTADDR_CR0, v_start); } if (write_settings || write_buffers) { VIDEO_OUT(vio, V_COMPOSE_MODE, V1_COMMAND_FIRE | (ucovl->v1.dstkey_enabled ? ENABLE_COLOR_KEYING : 0)); } return DFB_OK; } DFBResult uc_ovl_set_adjustment(CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj) { UcOverlayData* ucovl = (UcOverlayData*) layer_data; UcDriverData* ucdrv = (UcDriverData*) driver_data; DFBColorAdjustment* ucadj; u32 a1, a2; ucadj = &ucovl->v1.adj; if (adj->flags & DCAF_BRIGHTNESS) ucadj->brightness = adj->brightness; if (adj->flags & DCAF_CONTRAST) ucadj->contrast = adj->contrast; if (adj->flags & DCAF_HUE) ucadj->hue = adj->hue; if (adj->flags & DCAF_SATURATION) ucadj->saturation = adj->saturation; uc_ovl_map_adjustment(ucadj, &a1, &a2); VIDEO_OUT(ucdrv->hwregs, V1_ColorSpaceReg_1, a1); VIDEO_OUT(ucdrv->hwregs, V1_ColorSpaceReg_2, a2); return DFB_OK; } DirectFB-1.2.10/gfxdrivers/unichrome/uc_fifo.c0000644000175000017500000001146611164361026016100 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include #include #include "uc_fifo.h" //#define UC_FIFO_DUMP_DATA // Private functions --------------------------------------------------------- /** * Pad the FIFO buffer to a 32 byte boundary. Used by uc_flush_agp(). * @note Equivalent DRI code is in via_ioctl::viaFlushPrimsLocked() */ static void uc_fifo_pad(struct uc_fifo* fifo) { switch (fifo->used & 0x7) { case 0: break; case 2: UC_FIFO_ADD(fifo, HALCYON_HEADER2); UC_FIFO_ADD(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); break; case 4: UC_FIFO_ADD(fifo, HALCYON_HEADER2); UC_FIFO_ADD(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); break; case 6: UC_FIFO_ADD(fifo, HALCYON_HEADER2); UC_FIFO_ADD(fifo, HC_ParaType_NotTex << 16); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); UC_FIFO_ADD(fifo, HC_DUMMY); break; default: break; } } /** * Manually write the FIFO buffer to the hardware. * @note Equivalent DRI code is in via_ioctl::flush_sys() */ void uc_fifo_flush_sys(struct uc_fifo* fifo, volatile void *regs) { u32* p; u32* q; volatile u32* hwregs = regs; volatile u32* reg_tset = regs + VIA_REG_TRANSET; volatile u32* reg_tspace = regs + VIA_REG_TRANSPACE; int check2Dcmd; u32 addr; p = fifo->buf; q = fifo->head; check2Dcmd = 0; uc_fifo_pad(fifo); #ifdef UC_FIFO_DUMP_DATA printf("Flushing FIFO ... \n"); #endif while (p != q) { if (*p == HALCYON_HEADER2) { p++; check2Dcmd = !(*p == HALCYON_SUB_ADDR0); #ifdef UC_FIFO_DUMP_DATA printf("tset = 0x%08x\n", *p); #endif *reg_tset = *p; p++; } else if (check2Dcmd && ((*p & HALCYON_HEADER1MASK) == HALCYON_HEADER1)) { addr = (*p) & 0x0000001f; p++; #ifdef UC_FIFO_DUMP_DATA printf("2D (0x%02x) = 0x%x\n", addr << 2, *p); #endif *(hwregs + addr) = *p; p++; } else if ((*p & HALCYON_FIREMASK) == HALCYON_FIRECMD) { #ifdef UC_FIFO_DUMP_DATA printf("tspace = 0x%08x\n", *p); #endif *reg_tspace = *p; p++; if ((p != q) && ((*p & HALCYON_FIREMASK) == HALCYON_FIRECMD)) p++; if ((*p & HALCYON_CMDBMASK) != HC_ACMD_HCmdB) check2Dcmd = 1; } else { #ifdef UC_FIFO_DUMP_DATA printf("tspace = 0x%08x\n", *p); #endif *reg_tspace = *p; p++; } } fifo->head = fifo->buf; fifo->used = 0; fifo->prep = 0; } /** Use an AGP transfer to write the FIFO buffer to the hardware. Not implemented. */ #if 0 static void uc_fifo_flush_agp(struct uc_fifo* fifo) { // TODO - however, there is no point in doing this, because // an AGP transfer can require more register writes than // needed for drawing a single primitive. DirectFB needs to // adopt a begin/end architecture first, like OpenGL has. fifo->head = fifo->buf; fifo->used = 0; fifo->prep = 0; } #endif // Public functions ---------------------------------------------------------- /** Create a FIFO. Returns NULL on failure. */ struct uc_fifo* uc_fifo_create(FusionSHMPoolShared *pool, size_t size) { struct uc_fifo* fifo; size += 32; // Needed for padding. fifo = SHCALLOC(pool, 1, sizeof(struct uc_fifo)); if (!fifo) return NULL; // Note: malloc won't work for DMA buffers... fifo->buf = SHMALLOC(pool, sizeof(u32) * size); if (!(fifo->buf)) { SHFREE(pool, fifo); return NULL; } fifo->head = fifo->buf; fifo->used = 0; fifo->size = (unsigned int) size; fifo->prep = 0; //fifo->flush_sys = uc_fifo_flush_sys; //fifo->flush = uc_fifo_flush_sys; return fifo; } /** Destroy a FIFO */ void uc_fifo_destroy(FusionSHMPoolShared *pool, struct uc_fifo* fifo) { if (fifo) { if (fifo->buf) { SHFREE(pool, fifo->buf); fifo->buf = NULL; } SHFREE(pool, fifo); } } DirectFB-1.2.10/gfxdrivers/unichrome/uc_hwset.c0000644000175000017500000003363111164361026016305 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ // Hardware setting functions ------------------------------------------------ #include #include "uc_hw.h" #include #include #include /// Integer 2-logarithm, y = log2(x), where x and y are integers. #define ILOG2(x,y) ILOG2_PORTABLE(x,y) #define ILOG2_PORTABLE(x,y) \ do { \ unsigned int i = 0; \ y = x; \ while (y != 0) { \ i++; \ y = y >> 1; \ } \ y = i-1; \ } while (0) #define ILOG2_X86(x,y) // TODO - use BSR (bit scan reverse) instruction /// Set alpha blending function (3D) void uc_set_blending_fn( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; struct uc_hw_alpha *hwalpha = &ucdev->hwalpha; if (UC_IS_VALID( uc_blending_fn )) return; uc_map_blending_fn( hwalpha, state->src_blend, state->dst_blend, state->destination->config.format ); UC_FIFO_PREPARE( fifo, 14 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLCsat, hwalpha->regHABLCsat ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLCop, hwalpha->regHABLCop ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLAsat, hwalpha->regHABLAsat ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLAop, hwalpha->regHABLAop ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRCa, hwalpha->regHABLRCa ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRFCa, hwalpha->regHABLRFCa ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRCbias, hwalpha->regHABLRCbias ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRCb, hwalpha->regHABLRCb ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRFCb, hwalpha->regHABLRFCb ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRAa, hwalpha->regHABLRAa ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HABLRAb, hwalpha->regHABLRAb ); UC_FIFO_PAD_EVEN( fifo ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_blending_fn ); } /// Set texture environment (3D) void uc_set_texenv( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; struct uc_hw_texture *hwtex = &ucdev->hwtex; if (UC_IS_VALID( uc_texenv )) return; uc_map_blitflags( hwtex, state->blittingflags, state->source->config.format, state->destination->config.format ); // Texture mapping method hwtex->regHTXnTB = HC_HTXnFLSs_Linear | HC_HTXnFLTs_Linear | HC_HTXnFLSe_Linear | HC_HTXnFLTe_Linear; hwtex->regHTXnMPMD = HC_HTXnMPMD_Sclamp | HC_HTXnMPMD_Tclamp; UC_FIFO_PREPARE( fifo, 12 ); UC_FIFO_ADD_HDR( fifo, (HC_ParaType_Tex << 16) | (HC_SubType_Tex0 << 24) ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTB, hwtex->regHTXnTB ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnMPMD, hwtex->regHTXnMPMD ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLCsat, hwtex->regHTXnTBLCsat_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLCop, hwtex->regHTXnTBLCop_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLMPfog, hwtex->regHTXnTBLMPfog_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLAsat, hwtex->regHTXnTBLAsat_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLRCb, hwtex->regHTXnTBLRCb_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLRAa, hwtex->regHTXnTBLRAa_0 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnTBLRFog, hwtex->regHTXnTBLRFog_0 ); UC_FIFO_PAD_EVEN( fifo ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_texenv ); } /// Set clipping rectangle (2D and 3D) void uc_set_clip( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; if (DFB_REGION_EQUAL( ucdev->clip, state->clip )) return; UC_FIFO_PREPARE( fifo, 8 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); #ifdef UC_ENABLE_3D UC_FIFO_ADD_3D ( fifo, HC_SubA_HClipTB, (RS12(state->clip.y1) << 12) | RS12(state->clip.y2+1) ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HClipLR, (RS12(state->clip.x1) << 12) | RS12(state->clip.x2+1) ); #endif UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPTL, (RS16(state->clip.y1) << 16) | RS16(state->clip.x1) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_CLIPBR, (RS16(state->clip.y2) << 16) | RS16(state->clip.x2) ); UC_FIFO_CHECK( fifo ); ucdev->clip = state->clip; } /// Set destination (2D and 3D) void uc_set_destination( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; CoreSurface *destination = state->destination; DFBSurfacePixelFormat dst_format = destination->config.format; int dst_offset = state->dst.offset; int dst_pitch = state->dst.pitch; int dst_height = destination->config.size.h; int dst_bpp = DFB_BYTES_PER_PIXEL( dst_format ); /* Save FIFO space and CPU cycles. */ if (ucdev->dst_format == dst_format && ucdev->dst_offset == dst_offset && ucdev->dst_pitch == dst_pitch && ucdev->dst_height == dst_height) return; // 2D engine setting ucdev->pitch = (ucdev->pitch & 0x7fff) | (((dst_pitch >> 3) & 0x7fff) << 16); UC_FIFO_PREPARE( fifo, 12 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_PITCH, (VIA_PITCH_ENABLE | ucdev->pitch) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_DSTBASE, (dst_offset >> 3) ); UC_FIFO_ADD_2D ( fifo, VIA_REG_GEMODE, (dst_bpp - 1) << 8 ); #ifdef UC_ENABLE_3D // 3D engine setting UC_FIFO_ADD_3D ( fifo, HC_SubA_HDBBasL, dst_offset & 0xffffff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HDBBasH, dst_offset >> 24 ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HDBFM, (uc_map_dst_format( dst_format ) | (dst_pitch & HC_HDBPit_MASK) | HC_HDBLoc_Local) ); UC_FIFO_PAD_EVEN(fifo); #endif UC_FIFO_CHECK( fifo ); ucdev->dst_format = dst_format; ucdev->dst_offset = dst_offset; ucdev->dst_pitch = dst_pitch; ucdev->dst_height = dst_height; } /// Set new source (2D) void uc_set_source_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; if (UC_IS_VALID( uc_source2d )) return; ucdev->pitch &= 0x7fff0000; ucdev->pitch |= (state->src.pitch >> 3) & 0x7fff; UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_SRCBASE, state->src.offset >> 3 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_PITCH, VIA_PITCH_ENABLE | ucdev->pitch ); UC_FIFO_CHECK( fifo ); ucdev->src_offset = state->src.offset; ucdev->src_pitch = state->src.pitch; ucdev->src_height = state->source->config.size.h; UC_VALIDATE( uc_source2d ); } /// Set new source (3D) void uc_set_source_3d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; struct uc_hw_texture *hwtex = &ucdev->hwtex; CoreSurface *source = state->source; int src_height, src_offset, src_pitch; if (UC_IS_VALID( uc_source3d )) return; src_height = source->config.size.h; src_offset = state->src.offset; src_pitch = state->src.pitch; /* * TODO: Check if we can set the odd/even field as L1/L2 texture and select * between L0/L1/L2 upon blit. Otherwise we depend on SMF_BLITTINGFLAGS ;( */ if (state->blittingflags & DSBLIT_DEINTERLACE) { if (source->field) src_offset += src_pitch; src_height >>= 1; src_pitch <<= 1; } ucdev->field = source->field; // Round texture size up to nearest // value evenly divisible by 2^n ILOG2(source->config.size.w, hwtex->we); hwtex->l2w = 1 << hwtex->we; if (hwtex->l2w < source->config.size.w) { hwtex->we++; hwtex->l2w <<= 1; } ILOG2(src_height, hwtex->he); hwtex->l2h = 1 << hwtex->he; if (hwtex->l2h < src_height) { hwtex->he++; hwtex->l2h <<= 1; } hwtex->format = uc_map_src_format_3d( source->config.format ); UC_FIFO_PREPARE( fifo, 10); UC_FIFO_ADD_HDR( fifo, (HC_ParaType_Tex << 16) | (HC_SubType_Tex0 << 24)); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnFM, HC_HTXnLoc_Local | hwtex->format ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0OS, (0 << HC_HTXnLVmax_SHIFT) ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0_5WE, hwtex->we ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0_5HE, hwtex->he ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL012BasH, (src_offset >> 24) & 0xff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0BasL, (src_offset ) & 0xffffff ); UC_FIFO_ADD_3D ( fifo, HC_SubA_HTXnL0Pit, (HC_HTXnEnPit_MASK | src_pitch) ); UC_FIFO_PAD_EVEN( fifo ); UC_FIFO_CHECK( fifo ); // Upload the palette of a 256 color texture. if (hwtex->format == HC_HTXnFM_Index8) { int i, num; DFBColor *colors; UC_FIFO_PREPARE( fifo, 258 ); UC_FIFO_ADD_HDR( fifo, ((HC_ParaType_Palette << 16) | (HC_SubType_TexPalette0 << 24)) ); colors = source->palette->entries; num = source->palette->num_entries; if (num > 256) num = 256; /* What about the last entry? -- dok */ for (i = 0; i < num; i++) UC_FIFO_ADD( fifo, PIXEL_ARGB(colors[i].a, colors[i].r, colors[i].g, colors[i].b) ); for (; i < 256; i++) UC_FIFO_ADD( fifo, 0 ); UC_FIFO_CHECK( fifo ); } ucdev->src_offset = src_offset; ucdev->src_pitch = src_pitch; ucdev->src_height = src_height; UC_VALIDATE( uc_source3d ); } /// Set either destination color key, or fill color, as needed. (2D) void uc_set_color_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; u32 color = 0; if (UC_IS_VALID( uc_color2d )) return; switch (state->destination->config.format) { case DSPF_ARGB1555: color = PIXEL_ARGB1555( state->color.a, state->color.r, state->color.g, state->color.b ); color |= color << 16; break; case DSPF_ARGB4444: color = PIXEL_ARGB4444( state->color.a, state->color.r, state->color.g, state->color.b ); color |= color << 16; break; case DSPF_RGB16: color = PIXEL_RGB16( state->color.r, state->color.g, state->color.b); color |= color << 16; break; case DSPF_RGB32: case DSPF_ARGB: color = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); break; case DSPF_AiRGB: color = PIXEL_AiRGB( state->color.a, state->color.r, state->color.g, state->color.b ); break; default: D_BUG( "unexpected pixel format" ); } UC_FIFO_PREPARE( fifo, 8 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); // Opaque line drawing needs this UC_FIFO_ADD_2D( fifo, VIA_REG_MONOPAT0, 0xff ); UC_FIFO_ADD_2D( fifo, VIA_REG_KEYCONTROL, 0 ); UC_FIFO_ADD_2D( fifo, VIA_REG_FGCOLOR, color ); UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_color2d ); UC_INVALIDATE( uc_colorkey2d ); } void uc_set_colorkey_2d( UcDriverData *ucdrv, UcDeviceData *ucdev, CardState *state ) { struct uc_fifo *fifo = ucdrv->fifo; if (UC_IS_VALID( uc_colorkey2d )) return; if (state->blittingflags & DSBLIT_SRC_COLORKEY) { UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_KEYCONTROL, VIA_KEY_ENABLE_SRCKEY ); UC_FIFO_ADD_2D ( fifo, VIA_REG_BGCOLOR, state->src_colorkey ); } else if (state->blittingflags & DSBLIT_DST_COLORKEY) { UC_FIFO_PREPARE( fifo, 6 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_KEYCONTROL, VIA_KEY_ENABLE_DSTKEY | VIA_KEY_INVERT_KEY ); UC_FIFO_ADD_2D ( fifo, VIA_REG_FGCOLOR, state->dst_colorkey ); } else { UC_FIFO_PREPARE( fifo, 4 ); UC_FIFO_ADD_HDR( fifo, HC_ParaType_NotTex << 16 ); UC_FIFO_ADD_2D ( fifo, VIA_REG_KEYCONTROL, 0 ); } UC_FIFO_CHECK( fifo ); UC_VALIDATE( uc_colorkey2d ); UC_INVALIDATE( uc_color2d ); } DirectFB-1.2.10/gfxdrivers/unichrome/uc_hwmap.c0000644000175000017500000003607611164361026016275 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ // Hardware mapping functions ------------------------------------------------ #include #include "uc_hw.h" #include /// Map DirectFB blending functions to hardware void uc_map_blending_fn( struct uc_hw_alpha *hwalpha, DFBSurfaceBlendFunction sblend, DFBSurfaceBlendFunction dblend, DFBSurfacePixelFormat dst_format ) { bool dst_alpha = DFB_PIXELFORMAT_HAS_ALPHA(dst_format); // The HW's blending equation is: // (Ca * FCa + Cbias + Cb * FCb) << Cshift // Set source blending function // Ca -- always from source color. hwalpha->regHABLCsat = HC_HABLCsat_MASK | HC_HABLCa_OPC | HC_HABLCa_Csrc; // Aa -- always from source alpha. hwalpha->regHABLAsat = HC_HABLAsat_MASK | HC_HABLAa_OPA | HC_HABLAa_Asrc; // FCa and FAa depend on the following condition. switch (sblend) { case DSBF_ZERO: // GL_ZERO -- (0, 0, 0, 0) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; break; case DSBF_ONE: // GL_ONE -- (1, 1, 1, 1) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; break; case DSBF_SRCCOLOR: // GL_SRC_COLOR -- (Rs, Gs, Bs, As) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Csrc; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Asrc; break; case DSBF_INVSRCCOLOR: // GL_ONE_MINUS_SRC_COLOR -- (1, 1, 1, 1) - (Rs, Gs, Bs, As) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Csrc; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Asrc; break; case DSBF_SRCALPHA: // GL_SRC_ALPHA -- (As, As, As, As) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Asrc; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Asrc; break; case DSBF_INVSRCALPHA: // GL_ONE_MINUS_SRC_ALPHA -- (1, 1, 1, 1) - (As, As, As, As) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Asrc; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Asrc; break; case DSBF_DESTALPHA: // GL_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } else { // (Ad, Ad, Ad, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Adst; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Adst; } break; case DSBF_INVDESTALPHA: // GL_ONE_MINUS_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) - (1, 1, 1, 1) = (0, 0, 0, 0) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } else { // (1, 1, 1, 1) - (Ad, Ad, Ad, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Adst; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Adst; } break; case DSBF_DESTCOLOR: // GL_DST_COLOR -- (Rd, Gd, Bd, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_Cdst; hwalpha->regHABLAsat |= HC_HABLFAa_OPA | HC_HABLFAa_Adst; break; case DSBF_INVDESTCOLOR: // GL_ONE_MINUS_DST_COLOR -- (1, 1, 1, 1) - (Rd, Gd, Bd, Ad) hwalpha->regHABLCsat |= HC_HABLFCa_InvOPC | HC_HABLFCa_Cdst; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_Adst; break; case DSBF_SRCALPHASAT: // GL_SRC_ALPHA_SATURATE if (!dst_alpha) { // (f, f, f, 1), f = min(As, 1 - Ad) = min(As, 1 - 1) = 0 // So (f, f, f, 1) = (0, 0, 0, 1) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_HABLRCa; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } else { // (f, f, f, 1), f = min(As, 1 - Ad) hwalpha->regHABLCsat |= HC_HABLFCa_OPC | HC_HABLFCa_mimAsrcInvAdst; hwalpha->regHABLAsat |= HC_HABLFAa_InvOPA | HC_HABLFAa_HABLFRA; hwalpha->regHABLRFCa = 0x0; hwalpha->regHABLRAa = 0x0; } break; default: break; } // Set destination blending function // Op is add. // bias is 0. hwalpha->regHABLCsat |= HC_HABLCbias_HABLRCbias; hwalpha->regHABLAsat |= HC_HABLAbias_HABLRAbias; // Cb -- always from destination color. hwalpha->regHABLCop = HC_HABLCb_OPC | HC_HABLCb_Cdst; // Ab -- always from destination alpha. hwalpha->regHABLAop = HC_HABLAb_OPA | HC_HABLAb_Adst; // FCb -- depends on the following condition. switch (dblend) { case DSBF_ZERO: // GL_ZERO -- (0, 0, 0, 0) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; break; case DSBF_ONE: // GL_ONE -- (1, 1, 1, 1) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; break; case DSBF_SRCCOLOR: // GL_SRC_COLOR -- (Rs, Gs, Bs, As) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Csrc; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Asrc; break; case DSBF_INVSRCCOLOR: // GL_ONE_MINUS_SRC_COLOR -- (1, 1, 1, 1) - (Rs, Gs, Bs, As) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Csrc; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Asrc; break; case DSBF_SRCALPHA: // GL_SRC_ALPHA -- (As, As, As, As) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Asrc; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Asrc; break; case DSBF_INVSRCALPHA: // GL_ONE_MINUS_SRC_ALPHA -- (1, 1, 1, 1) - (As, As, As, As) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Asrc; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_0; break; case DSBF_DESTALPHA: // GL_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; } else { // (Ad, Ad, Ad, Ad) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Adst; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Adst; } break; case DSBF_INVDESTALPHA: // GL_ONE_MINUS_DST_ALPHA if (!dst_alpha) { // (1, 1, 1, 1) - (1, 1, 1, 1) = (0, 0, 0, 0) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; } else { // (1, 1, 1, 1) - (Ad, Ad, Ad, Ad) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Adst; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Adst; } break; case DSBF_DESTCOLOR: // GL_DST_COLOR -- (Rd, Gd, Bd, Ad) hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_Cdst; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_Adst; break; case DSBF_INVDESTCOLOR: // GL_ONE_MINUS_DST_COLOR -- (1, 1, 1, 1) - (Rd, Gd, Bd, Ad) hwalpha->regHABLCop |= HC_HABLFCb_InvOPC | HC_HABLFCb_Cdst; hwalpha->regHABLAop |= HC_HABLFAb_InvOPA | HC_HABLFAb_Adst; break; case DSBF_SRCALPHASAT: // Unsupported? default: hwalpha->regHABLCop |= HC_HABLFCb_OPC | HC_HABLFCb_HABLRCb; hwalpha->regHABLAop |= HC_HABLFAb_OPA | HC_HABLFAb_HABLFRA; hwalpha->regHABLRFCb = 0x0; hwalpha->regHABLRAb = 0x0; break; } } /// Map DFBSurfaceBlittingFlags to the hardware void uc_map_blitflags( struct uc_hw_texture *tex, DFBSurfaceBlittingFlags bflags, DFBSurfacePixelFormat sformat, DFBSurfacePixelFormat dformat ) { bool gotalpha = DFB_PIXELFORMAT_HAS_ALPHA(sformat); bool invalpha = DFB_PIXELFORMAT_INV_ALPHA(sformat) || (!DFB_PIXELFORMAT_INV_ALPHA(sformat) && DFB_PIXELFORMAT_INV_ALPHA(dformat)); if (bflags & DSBLIT_COLORIZE) { // Cv0 = Ct*Cf // Hw setting: // Ca = Ct, Cb = Cf, Cop = +, Cc = 0, Cbias = 0, Cshift = No. tex->regHTXnTBLCsat_0 = HC_HTXnTBLCsat_MASK | HC_HTXnTBLCa_TOPC | HC_HTXnTBLCa_Tex | HC_HTXnTBLCb_TOPC | HC_HTXnTBLCb_Dif | HC_HTXnTBLCc_TOPC | HC_HTXnTBLCc_0; tex->regHTXnTBLCop_0 = HC_HTXnTBLCop_Add | HC_HTXnTBLCbias_Cbias | HC_HTXnTBLCbias_0 | HC_HTXnTBLCshift_No; tex->regHTXnTBLMPfog_0 = HC_HTXnTBLMPfog_0; } else { // Cv0 = Ct // Hw setting: // Ca = 0, Cb = 0, Cop = +, Cc = 0, Cbias = Ct, Cshift = No. tex->regHTXnTBLCsat_0 = HC_HTXnTBLCsat_MASK | HC_HTXnTBLCa_TOPC | HC_HTXnTBLCa_0 | HC_HTXnTBLCb_TOPC | HC_HTXnTBLCb_0 | HC_HTXnTBLCc_TOPC | HC_HTXnTBLCc_0; tex->regHTXnTBLCop_0 = HC_HTXnTBLCop_Add | HC_HTXnTBLCbias_Cbias | HC_HTXnTBLCbias_Tex | HC_HTXnTBLCshift_No; tex->regHTXnTBLMPfog_0 = HC_HTXnTBLMPfog_0; } if (bflags & DSBLIT_BLEND_COLORALPHA) { if ((bflags & DSBLIT_BLEND_ALPHACHANNEL) && gotalpha) { // Av0 = At*Af // Hw setting: // Aa = At, Ab = Af, Cop = +, Ac = 0, Abias = 0, Ashift = No. tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_Atex | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_Adif | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_HTXnTBLRAbias | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } else { // (!(bflags & DSBLIT_BLEND_ALPHACHANNEL) && gotalpha) || !gotalpha // Av0 = Af // Hw setting: // Aa = 0, Ab = 0, Cop = +, Ac = 0, Abias = Af, Ashift = No. tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_HTXnTBLRA | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_HTXnTBLRA | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_Adif | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } } else { // !(bflags & DSBLIT_BLEND_COLORALPHA) if (gotalpha && ((bflags & DSBLIT_BLEND_ALPHACHANNEL) || invalpha)) { // Av0 = At // Hw setting: // Aa = 0, Ab = 0, Cop = +, Ac = 0, Abias = At, Ashift = No. tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_HTXnTBLRA | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_HTXnTBLRA | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_Atex | HC_HTXnTBLAshift_No; if (invalpha) tex->regHTXnTBLCop_0 |= HC_HTXnTBLAbias_Inv; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } else { // !gotalpha // Av0 = 1.0 // D_BUG warning: I'm guessing where values should go, // and how big (0xff = 1.0 ?) it should be. // Hw setting: // Aa = 1.0, Ab = 1.0, Cop = -, Ac = 1.0, Abias = 1.0, Ashift = No. // => Av = Aa*(Ab-Ac) + Abias = 1*(1-1)+1 = 1 tex->regHTXnTBLAsat_0 = HC_HTXnTBLAsat_MASK | HC_HTXnTBLAa_TOPA | HC_HTXnTBLAa_HTXnTBLRA | HC_HTXnTBLAb_TOPA | HC_HTXnTBLAb_HTXnTBLRA | HC_HTXnTBLAc_TOPA | HC_HTXnTBLAc_HTXnTBLRA; tex->regHTXnTBLCop_0 |= HC_HTXnTBLAop_Add | HC_HTXnTBLAbias_Inv | HC_HTXnTBLAbias_HTXnTBLRAbias | HC_HTXnTBLAshift_No; tex->regHTXnTBLRAa_0 = 0x0; tex->regHTXnTBLRFog_0 = 0x0; } } } DirectFB-1.2.10/gfxdrivers/unichrome/uc_ovl_hwmap.c0000644000175000017500000004002711164361026017144 00000000000000/* Copyright (c) 2003 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include #include "unichrome.h" #include "uc_overlay.h" #include "vidregs.h" #include "mmio.h" #include /** * Map hw settings for vertical scaling. * * @param sh source height * @param dh destination height * @param zoom will hold vertical setting of zoom register. * @param mini will hold vertical setting of mini register. * * @returns true if successful. * false if the zooming factor is too large or small. * * @note Derived from VIA's V4L driver. * See ddover.c, DDOVER_HQVCalcZoomHeight() */ bool uc_ovl_map_vzoom(int sh, int dh, u32* zoom, u32* mini) { u32 sh1, tmp, d; bool zoom_ok = true; if (sh == dh) { // No zoom // Do nothing } else if (sh < dh) { // Zoom in tmp = (sh * 0x0400) / dh; zoom_ok = !(tmp > 0x3ff); *zoom |= (tmp & 0x3ff) | V1_Y_ZOOM_ENABLE; *mini |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; } else { // sw > dh - Zoom out // Find a suitable divider (1 << d) = {2, 4, 8 or 16} sh1 = sh; for (d = 1; d < 5; d++) { sh1 >>= 1; if (sh1 <= dh) break; } if (d == 5) { // Too small. d = 4; zoom_ok = false; } *mini |= ((d<<1)-1) << 16; // <= {1,3,5,7} << 16 // Add scaling if (sh1 < dh) { tmp = (sh1 * 0x400) / dh; *zoom |= ((tmp & 0x3ff) | V1_Y_ZOOM_ENABLE); *mini |= V1_Y_INTERPOLY | V1_YCBCR_INTERPOLY; } } return zoom_ok; } /** * Map hw settings for horizontal scaling. * * @param sw source width * @param dw destination width * * @param zoom will hold horizontal setting of zoom register. * @param mini will hold horizontal setting of mini register. * @param falign will hold fetch aligment * @param dcount will hold display count * * @returns true if successful. * false if the zooming factor is too large or small. * * @note Derived from VIA's V4L driver. * See ddover.c, DDOVER_HQVCalcZoomWidth() and DDOver_GetDisplayCount() */ bool uc_ovl_map_hzoom(int sw, int dw, u32* zoom, u32* mini, u32* falign, u32* dcount) { u32 tmp, sw1, d; int md; // Minify-divider bool zoom_ok = true; md = 1; *falign = 0; if (sw == dw) { // No zoom // Do nothing } else if (sw < dw) { // Zoom in tmp = (sw * 0x0800) / dw; zoom_ok = !(tmp > 0x7ff); *zoom |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; *mini |= V1_X_INTERPOLY; } else { // sw > dw - Zoom out // Find a suitable divider (1 << d) = {2, 4, 8 or 16} sw1 = sw; for (d = 1; d < 5; d++) { sw1 >>= 1; if (sw1 <= dw) break; } if (d == 5) { // Too small. d = 4; zoom_ok = false; } md = 1 << d; // <= {2,4,8,16} *falign = ((md<<1)-1) & 0xf; // <= {3,7,15,15} *mini |= V1_X_INTERPOLY; *mini |= ((d<<1)-1) << 24; // <= {1,3,5,7} << 24 // Add scaling if (sw1 < dw) { //CLE bug //tmp = sw1*0x0800 / dw; tmp = (sw1 - 2) * 0x0800 / dw; *zoom |= ((tmp & 0x7ff) << 16) | V1_X_ZOOM_ENABLE; } } *dcount = sw - md; return zoom_ok; } /** * @param falign fetch alignment * @param format overlay pixel format * @param pfetch source pixels per line * * @returns qword fetch register setting * * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetFetch() * @note Only call after uc_ovl_map_hzoom() */ u32 uc_ovl_map_qwfetch(int falign, DFBSurfacePixelFormat format, int pfetch) { int fetch = 0; switch (format) { case DSPF_YV12: fetch = ALIGN_TO(pfetch, 32) >> 4; break; case DSPF_I420: fetch = (ALIGN_TO(pfetch, 16) >> 4) + 1; break; case DSPF_UYVY: case DSPF_YUY2: fetch = (ALIGN_TO(pfetch << 1, 16) >> 4) + 1; break; case DSPF_ARGB1555: case DSPF_RGB16: fetch = (ALIGN_TO(pfetch << 1, 16) >> 4) + 1; break; case DSPF_RGB32: case DSPF_ARGB: fetch = (ALIGN_TO(pfetch << 2, 16) >> 4) + 1; break; default: D_BUG("Unexpected pixelformat!"); break; } if (fetch < 4) fetch = 4; // Note: Unsure if alignment is needed or is in the way. fetch = ALIGN_TO(fetch, falign + 1); return fetch << 20; // V12_QWORD_PER_LINE } /** * Map pixel format. * * @note Derived from VIA's V4L driver. See ddover.c, DDOver_GetV1Format() */ u32 uc_ovl_map_format(DFBSurfacePixelFormat format) { switch (format) { case DSPF_YV12: case DSPF_I420: return V1_COLORSPACE_SIGN | V1_YUV420; case DSPF_UYVY: case DSPF_YUY2: return V1_COLORSPACE_SIGN | V1_YUV422; case DSPF_ARGB1555: return V1_RGB15; case DSPF_RGB16: return V1_RGB16; case DSPF_RGB32: case DSPF_ARGB: return V1_RGB32; default : D_BUG("Unexpected pixelformat!"); return V1_YUV422; } } /** * Map overlay window. * * @param scrw screen width (eg. 800) * @param scrh screen height (eg. 600) * @param win destination window * @param sw source surface width * @param sh source surface height * * @param win_start will hold window start register setting * @param win_end will hold window end register setting * * @parm ox will hold new leftmost coordinate in source surface * @parm oy will hold new topmost coordinate in source surface * @parm pfetch will hold number of required source pixels per line */ void uc_ovl_map_window(int scrw, int scrh, DFBRectangle* win, int sw, int sh, u32* win_start, u32* win_end, int* ox, int* oy, int *pfetch) { int x1, y1, x2, y2; int x,y,dw,dh; // These help making the code readable... *ox = 0; *oy = 0; *win_start = 0; *win_end = 0; x = win->x; y = win->y; dw = win->w; dh = win->h; // For testing the clipping //scrw -= 100; //scrh -= 100; // Handle invisible case. if ((x > scrw) || (y > scrh) || (x+dw < 0) || (y+dh < 0)) return; // Vertical clipping if ((y >= 0) && (y+dh < scrh)) { // No clipping y1 = y; y2 = y+dh-1; } else if ((y < 0) && (y+dh < scrh)) { // Top clip y2 = y+dh-1; *oy = (int) (((float) (sh * -y)) / ((float) dh) + 0.5); y1 = ((4-*oy)&3)*dh/sh; *oy = (*oy + 3) & ~3; } else if ((y >= 0) && (y+dh >= scrh)) { // Bottom clip y1 = y; y2 = scrh-1; } else { // if (y < 0) && (y+dh >= scrh) // Top and bottom clip y2 = scrh-1; *oy = (int) (((float) (sh * -y)) / ((float) dh) + 0.5); y1 = ((4-*oy)&3)*dh/sh; *oy = (*oy + 3) & ~3; } // Horizontal clipping if ((x >= 0) && (x+dw < scrw)) { // No clipping x1 = x; x2 = x+dw-1; *pfetch = sw; } else if ((x < 0) && (x+dw < scrw)) { // Left clip x2 = x+dw-1; *ox = (int) (((float) (sw * -x)) / ((float) dw) + 0.5); x1 = ((32-*ox)&31)*dw/sw; *ox = (*ox + 31) & ~31; *pfetch = sw - *ox; } else if ((x >= 0) && (x+dw >= scrw)) { // Right clip x1 = x; x2 = scrw-1; *pfetch = sw - (x+dw-scrw)*sw/dw; } else { // if (x < 0) && (x+dw >= scrw) // Left and right clip x2 = scrw-1; *ox = (int) (((float) (sw * -x)) / ((float) dw) + 0.5); x1 = ((32-*ox)&31)*dw/sw; *ox = (*ox + 31) & ~31; *pfetch = sw - *ox - (x+dw-scrw)*sw/dw; } if (*pfetch < 0) *pfetch = 0; *win_start = (x1 << 16) | y1; *win_end = (x2 << 16) | y2; // For testing the clipping //*win_start = ((x1+50) << 16) | (y1+50); //*win_end = ((x2+50) << 16) | (y2+50); } /** * Map overlay buffer address. * * @param format pixel format * @param buf Framebuffer address of surface (0 = start of framebuffer) * @param ox leftmost pixel to show (used when clipping, else set to zero) * @param oy topmost pixel to show (used when clipping, else set to zero) * @param w total surface width (does *not* depend on the x parameter) * @param h total surface height (does *not* depend on the y parameter) * @param pitch source surface pitch (bytes per pixel) * * @param y_start will hold start address of Y(UV) or RGB buffer * @param u_start will hold start address of Cb buffer (planar modes only) * @param v_start will hold start address of Cr buffer (planar modes only) * * @note Derived from VIA's V4L driver. See ddover.c, * DDOver_GetSrcStartAddress() and DDOVer_GetYCbCrStartAddress() */ void uc_ovl_map_buffer(DFBSurfacePixelFormat format, u32 buf, int ox, int oy, int sw, int sh, int sp, int field, u32* y_start, u32* u_start, u32* v_start) { int swap_cb_cr = 0; u32 tmp; u32 y_offset, uv_offset = 0; switch (format) { case DSPF_YUY2: case DSPF_UYVY: y_offset = ((oy * sp) + ((ox << 1) & ~15)); break; case DSPF_YV12: swap_cb_cr = 1; case DSPF_I420: y_offset = ((((oy & ~3) * sp) + ox + 16) & ~31) ; if (oy > 0) uv_offset = (((((oy & ~3) >> 1) * sp) + ox + 16) & ~31) >> 1; else uv_offset = y_offset >> 1; break; case DSPF_ARGB1555: case DSPF_RGB16: y_offset = (oy * sp) + ((ox * 16) >> 3); break; case DSPF_RGB32: case DSPF_ARGB: y_offset = (oy * sp) + ((ox * 32) >> 3); break; default: y_offset = 0; uv_offset = 0; D_BUG("Unexpected pixelformat!"); } if (field) { y_offset += sp; uv_offset += sp >> 1; } *y_start = buf + y_offset; if (u_start && v_start) { *u_start = buf + sp * sh + uv_offset; *v_start = buf + sp * sh + sp * (sh >> 2) + uv_offset; if (swap_cb_cr) { tmp = *u_start; *u_start = *v_start; *v_start = tmp; } } } /** * Map alpha mode and opacity. * * @param opacity Alpha opacity: 0 = transparent, 255 = opaque. * -1 = Use alpha from underlying graphics. * * @returns alpha control register setting. * * @note: Unfortunately, if using alpha from underlying graphics, * the video is opaque if alpha = 255 and transparent if = 0. * The inverse would have made more sense ... * * @note: The hardware supports a separate alpha plane as well, * but it is not implemented here. * * @note: Derived from ddmpeg.c, VIAAlphaWin() */ u32 uc_ovl_map_alpha(int opacity) { u32 ctrl = 0x00080000; // Not sure what this number is, supposedly // it is the "expire number divided by 4". if (opacity > 255) opacity = 255; if (opacity < 0) { ctrl |= ALPHA_WIN_BLENDING_GRAPHIC; } else { opacity = opacity >> 4; // Throw away bits 0 - 3 ctrl |= (opacity << 12) | ALPHA_WIN_BLENDING_CONSTANT; } return ctrl; // V_ALPHA_CONTROL } /** * Calculate V1 control and fifo-control register values * @param format pixel format * @param sw source width * @param hwrev Unichrome hardware revision * @param extfifo_on set this true if the extended FIFO is enabled * @param control will hold value for V1_CONTROL * @param fifo will hold value for V1_FIFO_CONTROL */ void uc_ovl_map_v1_control(DFBSurfacePixelFormat format, int sw, int hwrev, bool extfifo_on, u32* control, u32* fifo) { *control = V1_BOB_ENABLE | V1_ENABLE | uc_ovl_map_format(format); if (hwrev >= 0x10) { *control |= V1_EXPIRE_NUM_F; } else { if (extfifo_on) { *control |= V1_EXPIRE_NUM_A | V1_FIFO_EXTENDED; } else { *control |= V1_EXPIRE_NUM; } } if ((format == DSPF_YV12) || (format == DSPF_I420)) { //Minified video will be skewed without this workaround. if (sw <= 80) { //Fetch count <= 5 *fifo = UC_MAP_V1_FIFO_CONTROL(16,0,0); } else { if (hwrev == 0x10) *fifo = UC_MAP_V1_FIFO_CONTROL(64,56,56); else *fifo = UC_MAP_V1_FIFO_CONTROL(16,12,8); } } else { if (hwrev >= 0x10) { *fifo = UC_MAP_V1_FIFO_CONTROL(64,56,56); // Default rev 0x10 } else { if (extfifo_on) *fifo = UC_MAP_V1_FIFO_CONTROL(48,40,40); else *fifo = UC_MAP_V1_FIFO_CONTROL(32,29,16); // Default } } } /** uc_ovl_map_adjustment() helper - clamp x to [lo, hi] */ static float clamp(float x, float lo, float hi) { return (x < lo) ? lo : ((x > hi) ? hi : x); /* 2 nested if's. */ } /** * uc_ovl_map_adjustment() helper - format x for the hardware. * * @param x The value to format. * @param ndec Number of binary decimals. * @param sbit sign bit position. * =0: use two's complement representation * >0: use a sign bit + positive value. * @param mask Bitmask * @param shift Position in hardware register. */ static int fmt(float x, int ndec, int sbit, u32 mask, int shift) { int y = (x * (1 << ndec)); if (sbit && (y < 0)) y = -y | (1 << sbit); return (((u32) y) & mask) << shift; } /** * Map color adjustment to Unichrome hardware. * * @param adj DirectFB color adjustment. All fields are assumed valid. * @param a1 Will hold value for V1_ColorSpaceReg_1 * @param a2 Will hold value for V1_ColorSpaceReg_2 */ void uc_ovl_map_adjustment(DFBColorAdjustment* adj, u32* a1, u32* a2) { float con, sat, bri, hue; float c, s; float A, B1, C1, D, B2, C2, B3, C3; // Map contrast to [0, 2.0] (preferred: [0, 1.66]), default: 1.0. con = (float) adj->contrast / 32768.0; // Map saturation to [0, 2.0], default: 1.0. sat = (float) adj->saturation / 32768.0; // Map brightness to [-121, 125], (preferred: [-94, 125.1]), default: 3.97. bri = (float) (adj->brightness - 31696) / 270.48; // Map hue to [-pi, pi], default is 0.0. hue = (float) (adj->hue - 32768) / 10430.378; // Note: The limits are estimates that need testing. // Map parameters to hw registers. s = sin(hue) * con * sat; c = cos(hue) * con * sat; A = clamp(1.164*con, 0, 1.9375); B1 = clamp(-1.596*s, -0.75, 0.75); C1 = clamp(1.596*c, 1, 2.875); B2 = clamp( (0.813*s - 0.391*c), 0, -0.875); C2 = clamp(-(0.813*c + 0.391*s), 0, -1.875); B3 = clamp(2.018*c, 0, 3.75); C3 = clamp(2.018*s, -1.25, 1.25); D = clamp(1.164*(bri-16), -128, 127); *a1 = fmt(A, 4, 0, 0x1f, 24) | fmt(B1, 2, 2, 0x07, 18) | fmt(C1, 3, 0, 0x1f, 9) | fmt(D, 0, 0, 0xff, 0); *a2 = fmt(B2, 3, 4, 0x7, 25) | fmt(C2, 3, 4, 0xf, 17) | fmt(B3, 2, 0, 0xf, 10) | fmt(C3, 2, 3, 0xf, 2); } u32 uc_ovl_map_colorkey(DFBColorKey* c) { u32 color; DFBSurfacePixelFormat fmt; color = 0; fmt = dfb_primary_layer_pixelformat(); switch (fmt) { case DSPF_ARGB1555: color = PIXEL_ARGB1555(0, c->r, c->g, c->b); break; case DSPF_RGB16: color = PIXEL_RGB16(c->r, c->g, c->b); break; case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: color = PIXEL_ARGB(0, c->r, c->g, c->b); break; case DSPF_AiRGB: color = PIXEL_AiRGB(0, c->r, c->g, c->b); break; default: D_BUG( "unexpected pixel format" ); } return color; } DirectFB-1.2.10/gfxdrivers/unichrome/uc_probe.h0000644000175000017500000000215611245562152016270 00000000000000/* Copyright (c) 2004 Andreas Robinson, All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef __UC_PROBE_H__ #define __UC_PROBE_H__ #ifndef PCI_VENDOR_ID_VIA #define PCI_VENDOR_ID_VIA 0x1106 #endif #ifndef FB_ACCEL_VIA_UNICHROME #define FB_ACCEL_VIA_UNICHROME 77 #endif struct uc_via_chipinfo { #ifdef KERNEL u16 id; // PCI id #else u16 id; #endif char* name; // Human readable name, e.g CLE266/UniChrome }; static struct uc_via_chipinfo uc_via_devices[] = { {0x3122, "CLE266/UniChrome"}, // aka VT3122 {0x7205, "KM400/UniChrome"}, // aka VT3205, P4M800 {0x7204, "K8M800/UniChrome Pro"}, // aka VT3204, Unichrome Pro B {0x3118, "CN400/UniChrome Pro"}, // aka VT3259, PM8?0, Unichrome Pro A {0x3344, "CN700/Unichrome Pro"}, // aka VT3314, P4M800Pro, VN800, CN900 {0, ""} }; #endif /* __UC_PROBE_H__ */ DirectFB-1.2.10/gfxdrivers/savage/0000777000175000017500000000000011307522571013656 500000000000000DirectFB-1.2.10/gfxdrivers/savage/savage_bci.h0000644000175000017500000001751411245562152016036 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _S3BCI_H_ #define _S3BCI_H_ #define REVERSE_BYTE_ORDER32(dword) {\ unsigned int temp; \ dword = (temp & 0xFF) << 24; \ dword |= (temp & 0xFF00) << 8; \ dword |= (temp & 0xFF0000) >> 8; \ dword |= (temp & 0xFF000000) >> 24; } #define BCI_SIZE 0x4000 #define BCI_SEND(dw) { \ if (sdev->s.bci_ptr == BCI_SIZE) sdev->s.bci_ptr = 0; \ sdrv->s.bci_base[sdev->s.bci_ptr++] = (u32)(dw); \ } #define BCI_SENDF(dw) { \ if (sdev->s.bci_ptr == BCI_SIZE) sdev->s.bci_ptr = 0; \ ((float*)sdrv->s.bci_base)[sdev->s.bci_ptr++] = (float)(dw); \ } #define BCI_CMD_NOP 0x40000000 //#define BCI_CMD_SETREG 0x96000000 /* 8}CMD | 8}count | 16}index */ #define BCI_CMD_RECT 0x48000000 #define BCI_CMD_RECT_XP 0x01000000 #define BCI_CMD_RECT_YP 0x02000000 #define BCI_CMD_SCANLINE 0x50000000 #define BCI_CMD_LINE 0x5C000000 #define BCI_CMD_LINE_LAST_PIXEL 0x58000000 #define BCI_CMD_BYTE_TEXT 0x63000000 #define BCI_CMD_NT_BYTE_TEXT 0x67000000 #define BCI_CMD_BIT_TEXT 0x6C000000 #define BCI_CMD_GET_ROP(cmd) (((cmd) >> 16) & 0xFF) #define BCI_CMD_SET_ROP(cmd, rop) ((cmd) |= ((rop & 0xFF) << 16)) #define BCI_CMD_SEND_COLOR 0x00008000 #define BCI_CMD_CLIP_NONE 0x00000000 #define BCI_CMD_CLIP_CURRENT 0x00002000 #define BCI_CMD_CLIP_LR 0x00004000 #define BCI_CMD_CLIP_NEW 0x00006000 #define BCI_CMD_DEST_GBD 0x00000000 #define BCI_CMD_DEST_PBD 0x00000800 #define BCI_CMD_DEST_PBD_NEW 0x00000C00 #define BCI_CMD_DEST_SBD 0x00001000 #define BCI_CMD_DEST_SBD_NEW 0x00001400 #define BCI_CMD_SRC_TRANSPARENT 0x00000200 #define BCI_CMD_SRC_SOLID 0x00000000 #define BCI_CMD_SRC_GBD 0x00000020 #define BCI_CMD_SRC_COLOR 0x00000040 #define BCI_CMD_SRC_MONO 0x00000060 #define BCI_CMD_SRC_PBD_COLOR 0x00000080 #define BCI_CMD_SRC_PBD_MONO 0x000000A0 #define BCI_CMD_SRC_PBD_COLOR_NEW 0x000000C0 #define BCI_CMD_SRC_PBD_MONO_NEW 0x000000E0 #define BCI_CMD_SRC_SBD_COLOR 0x00000100 #define BCI_CMD_SRC_SBD_MONO 0x00000120 #define BCI_CMD_SRC_SBD_COLOR_NEW 0x00000140 #define BCI_CMD_SRC_SBD_MONO_NEW 0x00000160 #define BCI_CMD_PAT_TRANSPARENT 0x00000010 #define BCI_CMD_PAT_NONE 0x00000000 #define BCI_CMD_PAT_COLOR 0x00000002 #define BCI_CMD_PAT_MONO 0x00000003 #define BCI_CMD_PAT_PBD_COLOR 0x00000004 #define BCI_CMD_PAT_PBD_MONO 0x00000005 #define BCI_CMD_PAT_PBD_COLOR_NEW 0x00000006 #define BCI_CMD_PAT_PBD_MONO_NEW 0x00000007 #define BCI_CMD_PAT_SBD_COLOR 0x00000008 #define BCI_CMD_PAT_SBD_MONO 0x00000009 #define BCI_CMD_PAT_SBD_COLOR_NEW 0x0000000A #define BCI_CMD_PAT_SBD_MONO_NEW 0x0000000B #define BCI_BD_BW_DISABLE 0x10000000 #define BCI_BD_TILE_MASK 0x03000000 #define BCI_BD_TILE_NONE 0x00000000 #define BCI_BD_TILE_16 0x02000000 #define BCI_BD_TILE_32 0x04000000 #define BCI_BD_GET_BPP(bd) (((bd) >> 16) & 0xFF) #define BCI_BD_SET_BPP(bd, bpp) ((bd) |= (((bpp) & 0xFF) << 16)) #define BCI_BD_GET_STRIDE(bd) ((bd) & 0xFFFF) #define BCI_BD_SET_STRIDE(bd, st) ((bd) |= ((st) & 0xFFFF)) #define BCI_W_H(w, h) (((h) << 16) | ((w) & 0xFFF)) #define BCI_X_Y(x, y) (((y) << 16) | ((x) & 0xFFF)) #define BCI_X_W(x, y) (((w) << 16) | ((x) & 0xFFF)) #define BCI_CLIP_LR(l, r) (((r) << 16) | ((l) & 0xFFF)) #define BCI_CLIP_TL(t, l) (((t) << 16) | ((l) & 0xFFF)) #define BCI_CLIP_BR(b, r) (((b) << 16) | ((r) & 0xFFF)) #define BCI_LINE_X_Y(x, y) (((y) << 16) | ((x) & 0xFFFF)) #define BCI_LINE_STEPS(diag, axi) (((axi) << 16) | ((diag) & 0xFFFF)) #define BCI_LINE_MISC(maj, ym, xp, yp, err) \ (((maj) & 0xFFF) | (((ym) & 1) << 13) | \ (((xp) & 1) << 14) | (((yp) & 1) << 15) | \ ((err) << 16)) /* definition of BCI register indices */ #define BCI_VERTEX0 0x00 #define BCI_VERTEX1 0x08 #define BCI_VERTEX2 0x10 #define BCI_TEXPALADDR 0x18 #define BCI_COLORKEY 0x19 #define BCI_TEXADDR 0x1A #define BCI_TEXDESC 0x1B #define BCI_TEXCTRL 0x1C #define BCI_FOGTABLE 0x20 #define BCI_FOGCTRL 0x30 #define BCI_DRAWCTRL 0x31 #define BCI_ZBCTRL 0x32 #define BCI_ZBADDR 0x33 #define BCI_DESTCTRL 0x34 #define BCI_SCSTART 0x35 #define BCI_SCEND 0x36 #define BCI_ZWATER 0x37 #define BCI_DWATER 0x38 // 8}CMD|8}count|16}skipflags #define BCI_CMD_TRILIST 0x80000000L #define BCI_CMD_TRISTRIP 0x82000000L #define BCI_CMD_TRIFAN 0x84000000L #define BCI_CMD_QUADLIST 0x86000000L // or this one with previous commands if this vertex list // is continuation of previous one #define BCI_CMD_CONTINUE 0x01000000L // set any register that has bci index 8}CMD|8}count|16}index #define BCI_CMD_SETREG 0x96000000L // update shadow status 8}CMD|24}tag #define BCI_CMD_UPDSHADOW 0x98000000L #define BCI_CMD_WAIT 0xC0000000L #define BCI_WAIT_3D_IDLE 0x00010000L #define BCI_WAIT_2D_IDLE 0x00020000L #define BCI_WAIT_PAGEFLIP 0x01000000L #define BCI_WAIT_SCANLINE 0x02000000L #define BCI_SKIP_Z 0x01 #define BCI_SKIP_W 0x02 #define BCI_SKIP_DIFFUSE 0x04 #define BCI_SKIP_SPECULAR 0x08 #define BCI_SKIP_U 0x10 #define BCI_SKIP_V 0x20 /* definition of BCI register indices */ #define BCI_VERTEX0 0x00 #define BCI_VERTEX1 0x08 #define BCI_VERTEX2 0x10 #define BCI_TEXPALADDR 0x18 #define BCI_COLORKEY 0x19 #define BCI_TEXADDR 0x1A #define BCI_TEXDESC 0x1B #define BCI_TEXCTRL 0x1C #define BCI_FOGTABLE 0x20 #define BCI_FOGCTRL 0x30 #define BCI_DRAWCTRL 0x31 #define BCI_ZBCTRL 0x32 #define BCI_ZBADDR 0x33 #define BCI_DESTCTRL 0x34 #define BCI_SCSTART 0x35 #define BCI_SCEND 0x36 #define BCI_ZWATER 0x37 #define BCI_DWATER 0x38 /* 2D regs */ #define BCI_GBD1 0xE0 #define BCI_GBD2 0xE1 #define BCI_PBD1 0xE2 #define BCI_PBD2 0xE3 #define BCI_SBD1 0xE4 #define BCI_SBD2 0xE5 #endif /* _S3BCI_H_ */ DirectFB-1.2.10/gfxdrivers/savage/savage.c0000644000175000017500000002635111245562152015213 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä , Claudio Ciccani and Alex Song . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( savage ) #include "savage.h" #include "savage3d.h" #include "savage4.h" #include "savage2000.h" #include "savage_bci.h" /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_SAVAGE3D: /* Savage3D series */ case FB_ACCEL_SAVAGE3D_MV: case FB_ACCEL_SAVAGE_MX_MV: case FB_ACCEL_SAVAGE_MX: case FB_ACCEL_SAVAGE_IX_MV: case FB_ACCEL_SAVAGE_IX: return 1; case FB_ACCEL_SAVAGE4: /* Savage4 series */ case FB_ACCEL_PROSAVAGE_PM: case FB_ACCEL_PROSAVAGE_KM: case FB_ACCEL_S3TWISTER_P: case FB_ACCEL_S3TWISTER_K: return 1; case FB_ACCEL_SAVAGE2000: /* Savage 2000 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Savage Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); /* some defaults, each driver has it's own version */ info->version.major = 0; info->version.minor = 3; info->driver_data_size = sizeof (SavageDriverData); info->device_data_size = sizeof (SavageDeviceData); switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_SAVAGE3D: /* Savage3D series */ case FB_ACCEL_SAVAGE3D_MV: case FB_ACCEL_SAVAGE_MX_MV: case FB_ACCEL_SAVAGE_MX: case FB_ACCEL_SAVAGE_IX_MV: case FB_ACCEL_SAVAGE_IX: savage3d_get_info( device, info ); break; case FB_ACCEL_SAVAGE4: /* Savage4 series */ case FB_ACCEL_PROSAVAGE_PM: case FB_ACCEL_PROSAVAGE_KM: case FB_ACCEL_S3TWISTER_P: case FB_ACCEL_S3TWISTER_K: savage4_get_info( device, info ); break; case FB_ACCEL_SAVAGE2000: /* Savage 2000 */ savage2000_get_info( device, info ); break; } } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { SavageDriverData *sdrv = (SavageDriverData*) driver_data; sdrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!sdrv->mmio_base) return DFB_IO; sdrv->bci_base = (volatile u32*)(sdrv->mmio_base + BCI_BUFFER_OFFSET); switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_SAVAGE3D: /* Savage3D series */ case FB_ACCEL_SAVAGE3D_MV: case FB_ACCEL_SAVAGE_MX_MV: case FB_ACCEL_SAVAGE_MX: case FB_ACCEL_SAVAGE_IX_MV: case FB_ACCEL_SAVAGE_IX: return savage3d_init_driver( device, funcs, driver_data ); case FB_ACCEL_SAVAGE4: /* Savage4 series */ case FB_ACCEL_PROSAVAGE_PM: case FB_ACCEL_PROSAVAGE_KM: case FB_ACCEL_S3TWISTER_P: case FB_ACCEL_S3TWISTER_K: return savage4_init_driver( device, funcs, driver_data ); case FB_ACCEL_SAVAGE2000: /* Savage 2000 */ return savage2000_init_driver( device, funcs, driver_data ); } return DFB_BUG; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { SavageDriverData *sdrv = (SavageDriverData*) driver_data; SavageDeviceData *sdev = (SavageDeviceData*) device_data; volatile u8 *mmio = sdrv->mmio_base; /* use polling for syncing, artefacts occur otherwise */ dfb_config->pollvsync_after = 1; sdev->accel_id = dfb_gfxcard_get_accelerator( device ); switch (sdev->accel_id) { case FB_ACCEL_SAVAGE3D: /* Savage3D series */ case FB_ACCEL_SAVAGE3D_MV: case FB_ACCEL_SAVAGE_MX_MV: case FB_ACCEL_SAVAGE_MX: case FB_ACCEL_SAVAGE_IX_MV: case FB_ACCEL_SAVAGE_IX: savage3d_init_device( device, device_info, driver_data, device_data ); break; case FB_ACCEL_SAVAGE4: /* Savage4 series */ case FB_ACCEL_PROSAVAGE_PM: case FB_ACCEL_PROSAVAGE_KM: case FB_ACCEL_S3TWISTER_P: case FB_ACCEL_S3TWISTER_K: savage4_init_device( device, device_info, driver_data, device_data ); break; case FB_ACCEL_SAVAGE2000: /* Savage 2000 */ savage2000_init_device( device, device_info, driver_data, device_data ); break; default: D_BUG("unexpected accelerator id"); return DFB_BUG; } /* Turn on 16-bit register access. */ vga_out8( mmio, 0x3d4, 0x31); vga_out8( mmio, 0x3d5, 0x0c); /* Set stride to use GBD. */ vga_out8( mmio, 0x3d4, 0x50); vga_out8( mmio, 0x3d5, vga_in8( mmio, 0x3d5 ) | 0xC1); /* Enable 2D engine. */ vga_out8( mmio, 0x3d4, 0x40 ); vga_out8( mmio, 0x3d5, 0x01 ); savage_out32( mmio, MONO_PAT_0, ~0 ); savage_out32( mmio, MONO_PAT_1, ~0 ); /* Setup plane masks */ savage_out32( mmio, 0x8128, ~0 ); /* enable all write planes */ savage_out32( mmio, 0x812C, ~0 ); /* enable all read planes */ savage_out16( mmio, 0x8134, 0x27 ); savage_out16( mmio, 0x8136, 0x07 ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { SavageDeviceData *sdev = (SavageDeviceData*) device_data; (void) sdev; switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_SAVAGE3D: /* Savage3D series */ case FB_ACCEL_SAVAGE3D_MV: case FB_ACCEL_SAVAGE_MX_MV: case FB_ACCEL_SAVAGE_MX: case FB_ACCEL_SAVAGE_IX_MV: case FB_ACCEL_SAVAGE_IX: savage3d_close_device( device, driver_data, device_data ); break; case FB_ACCEL_SAVAGE4: /* Savage4 series */ case FB_ACCEL_PROSAVAGE_PM: case FB_ACCEL_PROSAVAGE_KM: case FB_ACCEL_S3TWISTER_P: case FB_ACCEL_S3TWISTER_K: savage4_close_device( device, driver_data, device_data ); break; case FB_ACCEL_SAVAGE2000: /* Savage 2000 */ savage2000_close_device( device, driver_data, device_data ); break; } D_DEBUG( "DirectFBSavage: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFBSavage: %9d savage_waitfifo calls\n", sdev->waitfifo_calls ); D_DEBUG( "DirectFBSavage: %9d savage_waitidle calls\n", sdev->waitidle_calls ); D_DEBUG( "DirectFBSavage: %9d register writes (savage_waitfifo sum)\n", sdev->waitfifo_sum ); D_DEBUG( "DirectFBSavage: %9d FIFO wait cycles (depends on CPU)\n", sdev->fifo_waitcycles ); D_DEBUG( "DirectFBSavage: %9d IDLE wait cycles (depends on CPU)\n", sdev->idle_waitcycles ); D_DEBUG( "DirectFBSavage: %9d FIFO space cache hits(depends on CPU)\n", sdev->fifo_cache_hits ); D_DEBUG( "DirectFBSavage: Conclusion:\n" ); D_DEBUG( "DirectFBSavage: Average register writes/savage_waitfifo " "call: %.2f\n", sdev->waitfifo_sum/(float)(sdev->waitfifo_calls) ); D_DEBUG( "DirectFBSavage: Average wait cycles/savage_waitfifo call:" " %.2f\n", sdev->fifo_waitcycles/(float)(sdev->waitfifo_calls) ); D_DEBUG( "DirectFBSavage: Average wait cycles/savage_waitidle call:" " %.2f\n", sdev->idle_waitcycles/(float)(sdev->waitidle_calls) ); D_DEBUG( "DirectFBSavage: Average fifo space cache hits: %02d%%\n", (int)(100 * sdev->fifo_cache_hits/ (float)(sdev->waitfifo_calls)) ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { SavageDriverData *sdrv = (SavageDriverData*) driver_data; switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_SAVAGE3D: /* Savage3D series */ case FB_ACCEL_SAVAGE3D_MV: case FB_ACCEL_SAVAGE_MX_MV: case FB_ACCEL_SAVAGE_MX: case FB_ACCEL_SAVAGE_IX_MV: case FB_ACCEL_SAVAGE_IX: savage3d_close_driver( device, driver_data ); break; case FB_ACCEL_SAVAGE4: /* Savage4 series */ case FB_ACCEL_PROSAVAGE_PM: case FB_ACCEL_PROSAVAGE_KM: case FB_ACCEL_S3TWISTER_P: case FB_ACCEL_S3TWISTER_K: savage4_close_driver( device, driver_data ); break; case FB_ACCEL_SAVAGE2000: /* Savage 2000 */ savage2000_close_driver( device, driver_data ); break; } dfb_gfxcard_unmap_mmio( device, sdrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/savage/savage.h0000644000175000017500000001267211245562152015221 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SAVAGE_H__ #define __SAVAGE_H__ #include #define SRC_BASE 0xa4d4 #define DEST_BASE 0xa4d8 #define CLIP_L_R 0xa4dc #define CLIP_T_B 0xa4e0 #define DEST_SRC_STR 0xa4e4 #define MONO_PAT_0 0xa4e8 #define MONO_PAT_1 0xa4ec #define BCI_BUFFER_OFFSET 0x10000 #define MAXFIFO 0x7f00 typedef struct { unsigned int accel_id; unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int waitidle_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; unsigned int fifo_space; unsigned int bci_ptr; } SavageDeviceData; typedef struct { volatile u8 *mmio_base; volatile u32 *bci_base; } SavageDriverData; #if 0 typedef struct S3SAVDRAWCTRLtag { hwUI32 uED:1; // Enable Dithering hwUI32 uUVO:1; // UV Offset Enable (add 0.5 to u and v hwUI32 uBCM:2; // Backface Cull Mode // 00 - reserved // 01 - disable culling // 10 - cull clockwise // 11 - cull counterclockwise hwUI32 uTVC:1; // vertex counter reset 1 - reset it hwUI32 uSM:1; // Shade Mode 0 - gouraud, 1 - flat (color at vertex 0) hwUI32 uESS:1; // Enable Specular hwUI32 uDABM:3; // Destination Alpha Blend Mode look below hwUI32 uSABM:3; // Source Alpha Blend Mode look below hwUI32 uReserved1:1; hwUI32 uATC:3; // Alpha Test Compare look below hwUI32 uEAT:1; // Enable Alpha Test hwUI32 uAlphaRef:8; // Alpha Reference Value hwUI32 uTBC:3; // Texture Blending Control (look below) hwUI32 uFDW:1; // Flush Destination Writes hwUI32 uFZW:1; // Flush Z Writes hwUI32 uIM:1; // Interpolaton Mode 1 - linear color and fog interpolation } S3SAVDRAWCTRL, *PS3SAVDRAWCTRL; #endif #define DRAWCTRL_ENABLE_DITHERING 0x00000001 #define DRAWCTRL_ENABLE_UV_OFFSET 0x00000002 #define DRAWCTRL_CULL_REVERSED 0x00000000 #define DRAWCTRL_CULL_NONE 0x00000004 #define DRAWCTRL_CULL_CLOCKWISE 0x00000008 #define DRAWCTRL_CULL_COUNTERCLOCKWISE 0x0000000C #define DRAWCTRL_VERTEX_COUNTER_RESET 0x00000010 #define DRAWCTRL_SHADE_GOURAUD 0x00000000 #define DRAWCTRL_SHADE_FLAT 0x00000020 #define DRAWCTRL_ENABLE_SPECULAR 0x00000040 #define DRAWCTRL_ENABLE_ALPHA_TEST 0x00020000 #define DRAWCTRL_FLUSH_DESTINATION_WRITES 0x20000000 #define DRAWCTRL_FLUSH_Z_WRITES 0x40000000 #define DRAWCTRL_COLOR_AND_FOG_INTERPOLATION 0x80000000 #define DRAWCTRL_DABM_ZERO (0 << 7) #define DRAWCTRL_DABM_ONE (1 << 7) #define DRAWCTRL_DABM_SOURCE_COLOR (2 << 7) #define DRAWCTRL_DABM_ONE_MINUS_SOURCE_COLOR (3 << 7) #define DRAWCTRL_DABM_SOURCE_ALPHA (4 << 7) #define DRAWCTRL_DABM_ONE_MINUS_SOURCE_ALPHA (5 << 7) #define DRAWCTRL_DABM_6 (6 << 7) #define DRAWCTRL_DABM_7 (7 << 7) #define DRAWCTRL_SABM_ZERO (0 << 10) #define DRAWCTRL_SABM_ONE (1 << 10) #define DRAWCTRL_SABM_DEST_COLOR (2 << 10) #define DRAWCTRL_SABM_ONE_MINUS_DEST_COLOR (3 << 10) #define DRAWCTRL_SABM_SOURCE_ALPHA (4 << 10) #define DRAWCTRL_SABM_ONE_MINUS_SOURCE_ALPHA (5 << 10) #define DRAWCTRL_SABM_6 (6 << 10) #define DRAWCTRL_SABM_7 (7 << 10) #define DRAWCTRL_ATC_NEVER (0 << 14) #define DRAWCTRL_ATC_LESS (1 << 14) #define DRAWCTRL_ATC_EQUAL (2 << 14) #define DRAWCTRL_ATC_LEQUAL (3 << 14) #define DRAWCTRL_ATC_GREATER (4 << 14) #define DRAWCTRL_ATC_NOTEQUAL (5 << 14) #define DRAWCTRL_ATC_GEQUAL (6 << 14) #define DRAWCTRL_ATC_ALWAYS (7 << 14) #define DRAWCTRL_TBC_DECAL (0 << 26) #define DRAWCTRL_TBC_MODULATE (1 << 26) #define DRAWCTRL_TBC_DECALALPHA (2 << 26) #define DRAWCTRL_TBC_MODULATEALPHA (3 << 26) #define DRAWCTRL_TBC_4 (4 << 26) #define DRAWCTRL_TBC_5 (5 << 26) #define DRAWCTRL_TBC_COPY (6 << 26) #define DRAWCTRL_TBC_7 (7 << 26) #endif DirectFB-1.2.10/gfxdrivers/savage/savage4.c0000644000175000017500000004310511245562152015273 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "savage.h" #include "savage4.h" #include "mmio.h" #include "savage_bci.h" /* * (comment stolen from xfree86 savage driver). * There are two different streams engines used in the Savage line. * The old engine is in the 3D, 4, Pro, and Twister. * The new engine is in the 2000, MX, IX, and Super. */ #include "savage_streams_old.h" /* #define SAVAGE_DEBUG */ #ifdef SAVAGE_DEBUG #define SVGDBG(x...) fprintf(stderr, "savage4:" x) #else #define SVGDBG(x...) #endif /* required implementations */ static DFBResult savage4EngineSync( void *drv, void *dev ) { Savage4DriverData *sdrv = (Savage4DriverData*) drv; Savage4DeviceData *sdev = (Savage4DeviceData*) dev; SVGDBG("savage4enginesync\n"); savage4_waitidle( sdrv, sdev ); return DFB_OK; } #define SAVAGE4_DRAWING_FLAGS \ (DSDRAW_NOFX) #define SAVAGE4_DRAWING_FUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE) #define SAVAGE4_BLITTING_FLAGS \ (DSBLIT_SRC_COLORKEY) #define SAVAGE4_BLITTING_FUNCTIONS \ (DFXL_BLIT) static inline void savage4_validate_gbd( Savage4DriverData *sdrv, Savage4DeviceData *sdev, CardState *state ) { u32 BitmapDescriptor; CoreSurface *destination; int bpp; if (sdev->v_gbd) return; destination = state->destination; bpp = DFB_BYTES_PER_PIXEL(destination->config.format); BitmapDescriptor = BCI_BD_BW_DISABLE | 8 | 1; BCI_BD_SET_BPP( BitmapDescriptor, bpp * 8 ); BCI_BD_SET_STRIDE( BitmapDescriptor, state->dst.pitch / bpp ); /* strange effects if we don't wait here for the Savage4 being idle */ savage4_waitidle( sdrv, sdev ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_GBD1 ); BCI_SEND( state->dst.offset ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_GBD2 ); BCI_SEND( BitmapDescriptor ); sdev->v_gbd = 1; } static inline void savage4_validate_pbd( Savage4DriverData *sdrv, Savage4DeviceData *sdev, CardState *state ) { u32 BitmapDescriptor; CoreSurface *source; int bpp; if (sdev->v_pbd) return; source = state->source; bpp = DFB_BYTES_PER_PIXEL(source->config.format); BitmapDescriptor = BCI_BD_BW_DISABLE; BCI_BD_SET_BPP( BitmapDescriptor, bpp * 8 ); BCI_BD_SET_STRIDE( BitmapDescriptor, state->src.pitch / bpp ); savage4_waitidle( sdrv, sdev ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_PBD1 ); BCI_SEND( state->src.offset ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_PBD2 ); BCI_SEND( BitmapDescriptor ); sdev->v_pbd = 1; } static inline void savage4_validate_color( Savage4DeviceData *sdev, CardState *state ) { if (sdev->v_color) return; switch (state->destination->config.format) { case DSPF_A8: sdev->Fill_Color = state->color.a; break; case DSPF_ARGB1555: sdev->Fill_Color = PIXEL_ARGB1555(state->color.a, state->color.r, state->color.g, state->color.b); break; case DSPF_RGB16: sdev->Fill_Color = PIXEL_RGB16(state->color.r, state->color.g, state->color.b); break; case DSPF_RGB32: sdev->Fill_Color = PIXEL_RGB32(state->color.r, state->color.g, state->color.b); break; case DSPF_ARGB: sdev->Fill_Color = PIXEL_ARGB(state->color.a, state->color.r, state->color.g, state->color.b); break; case DSPF_RGB332: sdev->Fill_Color = PIXEL_RGB332(state->color.r, state->color.g, state->color.b); break; default: D_BUG( "unexpected destination format" ); break; } sdev->v_color = 1; } static inline void savage4_set_clip( Savage4DriverData *sdrv, Savage4DeviceData *sdev, DFBRegion *clip ) { SVGDBG("savage4_set_clip x1:%i y1:%i x2:%i y2:%i\n", clip->x1, clip->y1, clip->x2, clip->y2); savage4_waitfifo( sdrv, sdev, 3 ); BCI_SEND( BCI_CMD_NOP | BCI_CMD_CLIP_NEW ); BCI_SEND( BCI_CLIP_TL( clip->y1, clip->x1 ) ); BCI_SEND( BCI_CLIP_BR( clip->y2, clip->x2 ) ); } static void savage4CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { SVGDBG("savage4checkstate\n"); switch (state->destination->config.format) { case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_RGB332: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~SAVAGE4_DRAWING_FLAGS) return; state->accel |= SAVAGE4_DRAWING_FUNCTIONS; } else { if (state->source->config.format != state->destination->config.format) return; if (state->blittingflags & ~SAVAGE4_BLITTING_FLAGS) return; state->accel |= SAVAGE4_BLITTING_FUNCTIONS; } } static void savage4SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { Savage4DriverData *sdrv = (Savage4DriverData*) drv; Savage4DeviceData *sdev = (Savage4DeviceData*) dev; SVGDBG("savage4setstate\n"); if (state->mod_hw) { if (state->mod_hw & SMF_DESTINATION) sdev->v_gbd = sdev->v_color = 0; else if (state->mod_hw & SMF_COLOR) sdev->v_color = 0; if (state->mod_hw & SMF_SOURCE) sdev->v_pbd = 0; } savage4_validate_gbd( sdrv, sdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: case DFXL_FILLTRIANGLE: savage4_validate_color( sdev, state ); state->set |= SAVAGE4_DRAWING_FUNCTIONS; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: savage4_validate_pbd( sdrv, sdev, state ); state->set |= SAVAGE4_BLITTING_FUNCTIONS; break; default: D_BUG( "unexpected drawing/blitting function!" ); return; } if (state->mod_hw & SMF_BLITTING_FLAGS) { if (state->blittingflags & DSBLIT_SRC_COLORKEY) sdev->Cmd_Src_Transparent = BCI_CMD_SRC_TRANSPARENT | BCI_CMD_SEND_COLOR; else sdev->Cmd_Src_Transparent = 0; } if (state->mod_hw & SMF_CLIP) savage4_set_clip( sdrv, sdev, &state->clip ); if (state->mod_hw & SMF_SRC_COLORKEY) sdev->src_colorkey = state->src_colorkey; state->mod_hw = 0; } static bool savage4FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { Savage4DriverData *sdrv = (Savage4DriverData*) drv; Savage4DeviceData *sdev = (Savage4DeviceData*) dev; savage4_waitfifo( sdrv, sdev, 4 ); BCI_SEND( BCI_CMD_RECT | BCI_CMD_SEND_COLOR | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_CLIP_CURRENT | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( sdev->Fill_Color ); BCI_SEND( BCI_X_Y(rect->x, rect->y) ); BCI_SEND( BCI_W_H(rect->w, rect->h) ); return true; } static bool savage4DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { Savage4DriverData *sdrv = (Savage4DriverData*) drv; Savage4DeviceData *sdev = (Savage4DeviceData*) dev; savage4_waitfifo( sdrv, sdev, 13 ); /* first line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_SEND_COLOR | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( sdev->Fill_Color ); BCI_SEND( BCI_X_Y( rect->x, rect->y) ); BCI_SEND( BCI_W_H( 1 , rect->h) ); /* second line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x, rect->y) ); BCI_SEND( BCI_W_H( rect->w , 1 ) ); /* third line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x, rect->y+rect->h-1 ) ); BCI_SEND( BCI_W_H( rect->w , 1 ) ); /* fourth line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x+rect->w-1, rect->y ) ); BCI_SEND( BCI_W_H( 1 , rect->h ) ); return true; } static bool savage4DrawLine( void *drv, void *dev, DFBRegion *line ) { Savage4DriverData *sdrv = (Savage4DriverData*) drv; Savage4DeviceData *sdev = (Savage4DeviceData*) dev; int dx, dy; int min, max, xp, yp, ym; dx = line->x2 - line->x1; dy = line->y2 - line->y1; xp = (dx >= 0); if (!xp) dx = -dx; yp = (dy >= 0); if (!yp) dy = -dy; ym = (dy > dx); if (ym) { max = dy + 1; min = dx; } else { max = dx + 1; min = dy; } savage4_waitfifo( sdrv, sdev, 5 ); BCI_SEND( BCI_CMD_LINE_LAST_PIXEL | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_SEND_COLOR | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( sdev->Fill_Color ); BCI_SEND( BCI_LINE_X_Y( line->x1, line->y1 ) ); BCI_SEND( BCI_LINE_STEPS( 2 * (min - max), 2 * min ) ); BCI_SEND( BCI_LINE_MISC( max, ym, xp, yp, 2 * min - max ) ); return true; } static bool savage4FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { return false; } static bool savage4Blit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Savage4DriverData *sdrv = (Savage4DriverData*) drv; Savage4DeviceData *sdev = (Savage4DeviceData*) dev; u32 cmd = ( BCI_CMD_RECT | sdev->Cmd_Src_Transparent | BCI_CMD_CLIP_CURRENT | BCI_CMD_DEST_GBD | BCI_CMD_SRC_PBD_COLOR | (0xcc << 16) ); SVGDBG("savage4Blit x:%i y:%i w:%i h:%i dx:%i dy:%i\n", rect->x, rect->y, rect->w, rect->h, dx, dy); if (dx < rect->x && dx >= 0) { cmd |= BCI_CMD_RECT_XP; /* left to right */ } else { dx += rect->w - 1; rect->x += rect->w - 1; } if (dy < rect->y && dy >= 0) { cmd |= BCI_CMD_RECT_YP; /* top to bottom */ } else { dy += rect->h - 1; rect->y += rect->h - 1; } savage4_waitfifo( sdrv, sdev, sdev->Cmd_Src_Transparent ? 5 : 4 ); BCI_SEND( cmd ); /* we always have to send the colorkey, but at least it does not clobber the fill color */ if (sdev->Cmd_Src_Transparent) BCI_SEND( sdev->src_colorkey ); BCI_SEND( BCI_X_Y( rect->x, rect->y ) ); BCI_SEND( BCI_X_Y( dx, dy ) ); BCI_SEND( BCI_W_H( rect->w, rect->h ) ); return true; } static bool savage4StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { return false; } static void savage4AfterSetVar( void *drv, void *dev ) { SVGDBG("savage4aftersetvar\n"); } /* exported symbols */ void savage4_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { SVGDBG("savage4getinfo\n"); info->version.major = 0; info->version.minor = 3; info->driver_data_size = sizeof (Savage4DriverData); info->device_data_size = sizeof (Savage4DeviceData); } DFBResult savage4_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ) { SVGDBG("savage4initdriver\n"); funcs->CheckState = savage4CheckState; funcs->SetState = savage4SetState; funcs->EngineSync = savage4EngineSync; funcs->AfterSetVar = savage4AfterSetVar; funcs->FillRectangle = savage4FillRectangle; funcs->DrawRectangle = savage4DrawRectangle; funcs->DrawLine = savage4DrawLine; funcs->FillTriangle = savage4FillTriangle; funcs->Blit = savage4Blit; funcs->StretchBlit = savage4StretchBlit; /* setup primary layer functions */ // dfb_layers_hook_primary(device, driver_data, &savagePrimaryFuncs, // &savage_pfuncs, &savage_pdriver_data); /* setup secondary layer functions */ // dfb_layers_register(device, driver_data, &savageSecondaryFuncs); return DFB_OK; } DFBResult savage4_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { SavageDriverData *sdrv = (SavageDriverData*) driver_data; volatile u8 *mmio = sdrv->mmio_base; SVGDBG("savage4initdevice\n"); /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Savage4 Series" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "S3" ); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = SAVAGE4_DRAWING_FUNCTIONS | SAVAGE4_BLITTING_FUNCTIONS; device_info->caps.drawing = SAVAGE4_DRAWING_FLAGS; device_info->caps.blitting = SAVAGE4_BLITTING_FLAGS; device_info->limits.surface_byteoffset_alignment = 2048; device_info->limits.surface_pixelpitch_alignment = 32; vga_out8( mmio, 0x3d4, CR_SYSCONF ); vga_out8( mmio, 0x3d5, CR_SYSCONF_ENABLE_2D_ENGINE_IO_ACCESS ); vga_out8( mmio, 0x3d4, CR_MEMCONF ); vga_out8( mmio, 0x3d5, CR_MEMCONF_ENABLE_VGA_16BIT_IO_ACCESS | CR_MEMCONF_ENHANCED_MODE_MEMORY_MAPPING ); /* Setup plane masks */ savage_out32( mmio, SAVAGE_2D_WRITE_MASK, ~0 ); savage_out32( mmio, SAVAGE_2D_READ_MASK, ~0 ); savage_out16( mmio, SAVAGE_2D_BACKGROUND_MIX, 0x03 ); savage_out16( mmio, SAVAGE_2D_FOREGROUND_MIX, 0x27 ); /* Disable BCI */ savage_out32( mmio, SAVAGE_COMMAND_OVERFLOW_BUFFER_POINTERS, (savage_in32( mmio, 0x48C18)) & 0x3FF0); /* Program shadow status update */ savage_out32( mmio, 0x48C10, 0x00700040); savage_out32( mmio, 0x48C0C, 0); /* Enable BCI without the COB */ savage_out32( mmio, SAVAGE_COMMAND_OVERFLOW_BUFFER_POINTERS, (savage_in32( mmio, 0x48C18)) | 0x08); return DFB_OK; } void savage4_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { SVGDBG("savage4closedevice\n"); } void savage4_close_driver( CoreGraphicsDevice *device, void *driver_data ) { SVGDBG("savage4closedriver\n"); } /* end of code */ DirectFB-1.2.10/gfxdrivers/savage/savage2000.c0000644000175000017500000001245011245562152015510 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "savage.h" #include "savage2000.h" #include "mmio.h" /* state validation */ /* required implementations */ static DFBResult savage2000EngineSync( void *drv, void *dev ) { Savage2000DriverData *sdrv = (Savage2000DriverData*) drv; Savage2000DeviceData *sdev = (Savage2000DeviceData*) dev; savage2000_waitidle( sdrv, sdev ); return DFB_OK; } #define SAVAGE2000_DRAWING_FLAGS \ (DSDRAW_NOFX) #define SAVAGE2000_DRAWING_FUNCTIONS \ (DFXL_NONE) #define SAVAGE2000_BLITTING_FLAGS \ (DSBLIT_NOFX) #define SAVAGE2000_BLITTING_FUNCTIONS \ (DFXL_NONE) static void savage2000CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { } static void savage2000SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { } static bool savage2000FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { return false; } static bool savage2000DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { return false; } static bool savage2000DrawLine( void *drv, void *dev, DFBRegion *line ) { return false; } static bool savage2000FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { return false; } static bool savage2000Blit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { return false; } static bool savage2000StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { return false; } /* exported symbols */ void savage2000_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { info->version.major = 0; info->version.minor = 0; info->driver_data_size = sizeof (Savage2000DriverData); info->device_data_size = sizeof (Savage2000DeviceData); } DFBResult savage2000_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ) { funcs->CheckState = savage2000CheckState; funcs->SetState = savage2000SetState; funcs->EngineSync = savage2000EngineSync; funcs->FillRectangle = savage2000FillRectangle; funcs->DrawRectangle = savage2000DrawRectangle; funcs->DrawLine = savage2000DrawLine; funcs->FillTriangle = savage2000FillTriangle; funcs->Blit = savage2000Blit; funcs->StretchBlit = savage2000StretchBlit; return DFB_OK; } DFBResult savage2000_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Savage2000 Series" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "S3" ); device_info->caps.flags = 0; device_info->caps.accel = SAVAGE2000_DRAWING_FUNCTIONS | SAVAGE2000_BLITTING_FUNCTIONS; device_info->caps.drawing = SAVAGE2000_DRAWING_FLAGS; device_info->caps.blitting = SAVAGE2000_BLITTING_FLAGS; device_info->limits.surface_byteoffset_alignment = 2048; device_info->limits.surface_pixelpitch_alignment = 32; return DFB_OK; } void savage2000_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } void savage2000_close_driver( CoreGraphicsDevice *device, void *driver_data ) { } DirectFB-1.2.10/gfxdrivers/savage/Makefile.am0000644000175000017500000000146611245562152015635 00000000000000## Makefile.am for DirectFB-internal/gfxdrivers/savage INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src savage_LTLIBRARIES = libdirectfb_savage.la if BUILD_STATIC savage_DATA = $(savage_LTLIBRARIES:.la=.o) endif savagedir = $(MODULEDIR)/gfxdrivers libdirectfb_savage_la_SOURCES = \ mmio.h \ savage.c \ savage.h \ savage3d.c \ savage3d.h \ savage4.c \ savage4.h \ savage2000.c \ savage2000.h \ savage_bci.h \ savage_streams_old.h libdirectfb_savage_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_savage_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/savage/Makefile.in0000644000175000017500000004556711307521500015647 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/savage ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(savagedir)" "$(DESTDIR)$(savagedir)" savageLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(savage_LTLIBRARIES) libdirectfb_savage_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_savage_la_OBJECTS = savage.lo savage3d.lo savage4.lo \ savage2000.lo libdirectfb_savage_la_OBJECTS = $(am_libdirectfb_savage_la_OBJECTS) libdirectfb_savage_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_savage_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_savage_la_SOURCES) DIST_SOURCES = $(libdirectfb_savage_la_SOURCES) savageDATA_INSTALL = $(INSTALL_DATA) DATA = $(savage_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src savage_LTLIBRARIES = libdirectfb_savage.la @BUILD_STATIC_TRUE@savage_DATA = $(savage_LTLIBRARIES:.la=.o) savagedir = $(MODULEDIR)/gfxdrivers libdirectfb_savage_la_SOURCES = \ mmio.h \ savage.c \ savage.h \ savage3d.c \ savage3d.h \ savage4.c \ savage4.h \ savage2000.c \ savage2000.h \ savage_bci.h \ savage_streams_old.h libdirectfb_savage_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_savage_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/savage/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/savage/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-savageLTLIBRARIES: $(savage_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(savagedir)" || $(MKDIR_P) "$(DESTDIR)$(savagedir)" @list='$(savage_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(savageLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(savagedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(savageLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(savagedir)/$$f"; \ else :; fi; \ done uninstall-savageLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(savage_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(savagedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(savagedir)/$$p"; \ done clean-savageLTLIBRARIES: -test -z "$(savage_LTLIBRARIES)" || rm -f $(savage_LTLIBRARIES) @list='$(savage_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_savage.la: $(libdirectfb_savage_la_OBJECTS) $(libdirectfb_savage_la_DEPENDENCIES) $(libdirectfb_savage_la_LINK) -rpath $(savagedir) $(libdirectfb_savage_la_OBJECTS) $(libdirectfb_savage_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savage2000.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savage3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savage4.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-savageDATA: $(savage_DATA) @$(NORMAL_INSTALL) test -z "$(savagedir)" || $(MKDIR_P) "$(DESTDIR)$(savagedir)" @list='$(savage_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(savageDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(savagedir)/$$f'"; \ $(savageDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(savagedir)/$$f"; \ done uninstall-savageDATA: @$(NORMAL_UNINSTALL) @list='$(savage_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(savagedir)/$$f'"; \ rm -f "$(DESTDIR)$(savagedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(savagedir)" "$(DESTDIR)$(savagedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-savageLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-savageDATA install-savageLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-savageDATA uninstall-savageLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-savageLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-savageDATA install-savageLTLIBRARIES install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-savageDATA \ uninstall-savageLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/savage/mmio.h0000644000175000017500000000533311245562152014710 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SAVAGE__MMIO_H__ #define __SAVAGE__MMIO_H__ #include typedef u8 uint8; typedef u16 uint16; typedef u32 uint32; typedef s8 sint8; typedef s16 sint16; typedef s32 sint32; #if 0 static inline void savage_out32(volatile uint8 *mmioaddr, uint32 reg, uint32 value) { *((uint32*)(mmioaddr+reg)) = value; } static inline volatile uint32 savage_in32(volatile uint8 *mmioaddr, uint32 reg) { return *((uint32*)(mmioaddr+reg)); } static inline void savage_out16(volatile uint8 *mmioaddr, uint32 reg, uint16 value) { *((uint16*)(mmioaddr+reg)) = value; } #else #define savage_out32(mmio, reg, value) (*((volatile uint32 *) ((mmio)+(reg))) = (uint32)(value)) #define savage_in32(mmio, reg) (*((volatile uint32 *) ((mmio)+(reg)))) #define savage_out16(mmio, reg, value) (*((volatile uint16 *) ((mmio)+(reg))) = (uint16)(value)) #endif #if 0 static inline void vga_out8(volatile uint8 *mmioaddr, uint16 reg, uint8 value) { *((uint8*)(mmioaddr+0x8000+reg)) = value; } static inline void vga_out16(volatile uint8 *mmioaddr, uint16 reg, uint16 value) { *((uint8*)(mmioaddr+0x8000+reg)) = value; } static inline volatile uint8 vga_in8(volatile uint8 *mmioaddr, uint16 reg) { return *((uint8*)(mmioaddr+0x8000+reg)); } #else #define vga_out8(mmio, reg, value) (*((volatile uint8 *) ((mmio)+0x8000+(reg))) = (uint8)(value)) #define vga_out16(mmio, reg, value) (*((volatile uint16 *) ((mmio)+0x8000+(reg))) = (uint16)(value)) #define vga_in8(mmio, reg) (*((volatile uint8 *) ((mmio)+0x8000+(reg)))) #endif #endif /* __SAVAGE__MMIO_H__ */ DirectFB-1.2.10/gfxdrivers/savage/savage4.h0000644000175000017500000001120511245562152015274 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SAVAGE4_H__ #define __SAVAGE4_H__ #include #include "mmio.h" typedef struct { SavageDeviceData s; /* state validation */ int v_gbd; /* destination */ int v_pbd; /* source */ int v_color; /* opaque fill color */ /* saved values */ u32 Cmd_Src_Transparent; u32 Fill_Color; u32 src_colorkey; } Savage4DeviceData; typedef struct { SavageDriverData s; } Savage4DriverData; void savage4_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ); DFBResult savage4_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ); DFBResult savage4_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ); void savage4_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ); void savage4_close_driver( CoreGraphicsDevice *device, void *driver_data ); #define CR_MEMCONF 0x31 #define CR_MEMCONF_ENABLE_VGA_16BIT_IO_ACCESS 0x04 #define CR_MEMCONF_ENHANCED_MODE_MEMORY_MAPPING 0x08 #define CR_SYSCONF 0x40 #define CR_SYSCONF_ENABLE_2D_ENGINE_IO_ACCESS 0x01 #define SAVAGE_2D_WRITE_MASK 0x8128 #define SAVAGE_2D_READ_MASK 0x812C #define SAVAGE_2D_BACKGROUND_MIX 0x8134 #define SAVAGE_2D_FOREGROUND_MIX 0x8136 /* Configuration/Status Registers */ #define SAVAGE_STATUS_WORD0 0x48C00 #define SAVAGE_STATUS_WORD1 0x48C04 #define SAVAGE_STATUS_WORD2 0x48C08 #define SAVAGE_SHADOW_STATUS_ADDRESS 0x48C0C #define SAVAGE_COMMAND_BUFFER_THRESHOLDS 0x48C10 #define SAVAGE_COMMAND_OVERFLOW_BUFFER 0x48C14 #define SAVAGE_COMMAND_OVERFLOW_BUFFER_POINTERS 0x48C18 #define SAVAGE_VERTEX_BUFFER_ADDRESS 0x48C20 #define SAVAGE_BCI_POWER_MANAGEMENT 0x48C24 #define SAVAGE_TILED_SURFACE0 0x48C40 #define SAVAGE_TILED_SURFACE1 0x48C44 #define SAVAGE_TILED_SURFACE2 0x48C48 #define SAVAGE_TILED_SURFACE3 0x48C4C #define SAVAGE_TILED_SURFACE4 0x48C50 #define SAVAGE_ALTERNATE_STATUS_WORD0 0x48C60 #define SAVAGE_ALTERNATE_STATUS_WORD1 0x48C64 /* Wait for fifo space */ static inline void savage4_waitfifo(Savage4DriverData *sdrv, Savage4DeviceData *sdev, int space) { uint32 slots = MAXFIFO - space; volatile u8 *mmio = sdrv->s.mmio_base; sdev->s.waitfifo_sum += space; sdev->s.waitfifo_calls++; if ((savage_in32(mmio, SAVAGE_ALTERNATE_STATUS_WORD0) & 0x001fffff) > slots) { do { sdev->s.fifo_waitcycles++; } while ((savage_in32(mmio, SAVAGE_ALTERNATE_STATUS_WORD0) & 0x001fffff) > slots); } else { sdev->s.fifo_cache_hits++; } } /* Wait for idle accelerator */ static inline void savage4_waitidle(Savage4DriverData *sdrv, Savage4DeviceData *sdev) { sdev->s.waitidle_calls++; while ((savage_in32(sdrv->s.mmio_base, SAVAGE_ALTERNATE_STATUS_WORD0) & 0x00a00000) != 0x00a00000) { sdev->s.idle_waitcycles++; } } #endif DirectFB-1.2.10/gfxdrivers/savage/savage3d.c0000644000175000017500000003774311245562152015451 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "savage.h" #include "savage_bci.h" #include "savage3d.h" #include "mmio.h" #include "savage_streams_old.h" /* required implementations */ static DFBResult savage3DEngineSync( void *drv, void *dev ) { Savage3DDriverData *sdrv = (Savage3DDriverData*) drv; Savage3DDeviceData *sdev = (Savage3DDeviceData*) dev; savage3D_waitidle( sdrv, sdev ); return DFB_OK; } #define SAVAGE3D_DRAWING_FLAGS \ (DSDRAW_NOFX) #define SAVAGE3D_DRAWING_FUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE) #define SAVAGE3D_BLITTING_FLAGS \ (DSBLIT_SRC_COLORKEY) #define SAVAGE3D_BLITTING_FUNCTIONS \ (DFXL_BLIT) static inline void savage3D_validate_gbd( Savage3DDriverData *sdrv, Savage3DDeviceData *sdev, CardState *state ) { u32 BitmapDescriptor; CoreSurface *destination; int bpp; if (sdev->v_gbd) return; destination = state->destination; bpp = DFB_BYTES_PER_PIXEL(destination->config.format); BitmapDescriptor = BCI_BD_BW_DISABLE | 8 | 1; BCI_BD_SET_BPP( BitmapDescriptor, bpp * 8 ); BCI_BD_SET_STRIDE( BitmapDescriptor, state->dst.pitch / bpp ); /* strange effects if we don't wait here for the Savage3D being idle */ savage3D_waitidle( sdrv, sdev ); savage3D_waitfifo( sdrv, sdev, 4 ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_GBD1 ); BCI_SEND( state->dst.offset ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_GBD2 ); BCI_SEND( BitmapDescriptor ); sdev->v_gbd = 1; } static inline void savage3D_validate_pbd( Savage3DDriverData *sdrv, Savage3DDeviceData *sdev, CardState *state ) { u32 BitmapDescriptor; CoreSurface *source; int bpp; if (sdev->v_pbd) return; source = state->source; bpp = DFB_BYTES_PER_PIXEL(source->config.format); BitmapDescriptor = BCI_BD_BW_DISABLE; BCI_BD_SET_BPP( BitmapDescriptor, bpp * 8 ); BCI_BD_SET_STRIDE( BitmapDescriptor, state->src.pitch / bpp ); savage3D_waitfifo( sdrv, sdev, 4 ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_PBD1 ); BCI_SEND( state->src.offset ); BCI_SEND( BCI_CMD_SETREG | (1 << 16) | BCI_PBD2 ); BCI_SEND( BitmapDescriptor ); sdev->v_pbd = 1; } static inline void savage3D_validate_color( Savage3DDriverData *sdrv, Savage3DDeviceData *sdev, CardState *state ) { if (sdev->v_color) return; savage3D_waitfifo( sdrv, sdev, 2 ); BCI_SEND( BCI_CMD_NOP | BCI_CMD_SEND_COLOR ); switch (state->destination->config.format) { case DSPF_A8: BCI_SEND( state->color.a ); break; case DSPF_ARGB1555: BCI_SEND( PIXEL_ARGB1555(state->color.a, state->color.r, state->color.g, state->color.b) ); break; case DSPF_RGB16: BCI_SEND( PIXEL_RGB16(state->color.r, state->color.g, state->color.b) ); break; case DSPF_RGB32: BCI_SEND( PIXEL_RGB32(state->color.r, state->color.g, state->color.b) ); break; case DSPF_ARGB: BCI_SEND( PIXEL_ARGB(state->color.a, state->color.r, state->color.g, state->color.b) ); break; default: D_ONCE( "unsupported destination format" ); break; } sdev->v_color = 1; } static inline void savage3D_set_clip( Savage3DDriverData *sdrv, Savage3DDeviceData *sdev, DFBRegion *clip ) { savage3D_waitfifo( sdrv, sdev, 3 ); BCI_SEND( BCI_CMD_NOP | BCI_CMD_CLIP_NEW ); BCI_SEND( BCI_CLIP_TL( clip->y1, clip->x1 ) ); BCI_SEND( BCI_CLIP_BR( clip->y2, clip->x2 ) ); } static void savage3DCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~SAVAGE3D_DRAWING_FLAGS) return; state->accel |= SAVAGE3D_DRAWING_FUNCTIONS; } else { if (state->source->config.format != state->destination->config.format) return; if (state->blittingflags & ~SAVAGE3D_BLITTING_FLAGS) return; state->accel |= SAVAGE3D_BLITTING_FUNCTIONS; } } static void savage3DSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { Savage3DDriverData *sdrv = (Savage3DDriverData*) drv; Savage3DDeviceData *sdev = (Savage3DDeviceData*) dev; if (state->mod_hw) { if (state->mod_hw & SMF_DESTINATION) sdev->v_gbd = sdev->v_color = 0; else if (state->mod_hw & SMF_COLOR) sdev->v_color = 0; if (state->mod_hw & SMF_SOURCE) sdev->v_pbd = 0; } savage3D_validate_gbd( sdrv, sdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: case DFXL_FILLTRIANGLE: savage3D_validate_color( sdrv, sdev, state ); state->set |= SAVAGE3D_DRAWING_FUNCTIONS; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: savage3D_validate_pbd( sdrv, sdev, state ); state->set |= SAVAGE3D_BLITTING_FUNCTIONS; break; default: D_BUG( "unexpected drawing/blitting function!" ); return; } if (state->mod_hw & SMF_BLITTING_FLAGS) { if (state->blittingflags & DSBLIT_SRC_COLORKEY) sdev->Cmd_Src_Transparent = BCI_CMD_SRC_TRANSPARENT | BCI_CMD_SEND_COLOR; else sdev->Cmd_Src_Transparent = 0; } if (state->mod_hw & SMF_CLIP) savage3D_set_clip( sdrv, sdev, &state->clip ); if (state->mod_hw & SMF_SRC_COLORKEY) sdev->src_colorkey = state->src_colorkey; state->mod_hw = 0; } static bool savage3DFillRectangle( void *drv, void *dev, DFBRectangle *rect ) { Savage3DDriverData *sdrv = (Savage3DDriverData*) drv; Savage3DDeviceData *sdev = (Savage3DDeviceData*) dev; savage3D_waitfifo( sdrv, sdev, 3 ); BCI_SEND( BCI_CMD_RECT | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y(rect->x, rect->y) ); BCI_SEND( BCI_W_H(rect->w, rect->h) ); return true; } static bool savage3DDrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { Savage3DDriverData *sdrv = (Savage3DDriverData*) drv; Savage3DDeviceData *sdev = (Savage3DDeviceData*) dev; savage3D_waitfifo( sdrv, sdev, 12 ); /* first line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x, rect->y) ); BCI_SEND( BCI_W_H( 1 , rect->h) ); /* second line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x, rect->y) ); BCI_SEND( BCI_W_H( rect->w , 1 ) ); /* third line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x, rect->y+rect->h-1 ) ); BCI_SEND( BCI_W_H( rect->w , 1 ) ); /* fourth line */ BCI_SEND( BCI_CMD_RECT | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_X_Y( rect->x+rect->w-1, rect->y ) ); BCI_SEND( BCI_W_H( 1 , rect->h ) ); return true; } static bool savage3DDrawLine( void *drv, void *dev, DFBRegion *line ) { Savage3DDriverData *sdrv = (Savage3DDriverData*) drv; Savage3DDeviceData *sdev = (Savage3DDeviceData*) dev; int dx, dy; int min, max, xp, yp, ym; dx = line->x2 - line->x1; dy = line->y2 - line->y1; xp = (dx >= 0); if (!xp) dx = -dx; yp = (dy >= 0); if (!yp) dy = -dy; ym = (dy > dx); if (ym) { max = dy + 1; min = dx; } else { max = dx + 1; min = dy; } savage3D_waitfifo( sdrv, sdev, 4 ); BCI_SEND( BCI_CMD_LINE_LAST_PIXEL | BCI_CMD_CLIP_CURRENT | BCI_CMD_RECT_XP | BCI_CMD_RECT_YP | BCI_CMD_DEST_GBD | BCI_CMD_SRC_SOLID | (0xcc << 16) ); BCI_SEND( BCI_LINE_X_Y( line->x1, line->y1 ) ); BCI_SEND( BCI_LINE_STEPS( 2 * (min - max), 2 * min ) ); BCI_SEND( BCI_LINE_MISC( max, ym, xp, yp, 2 * min - max ) ); return true; } static bool savage3DFillTriangle( void *drv, void *dev, DFBTriangle *tri ) { return false; } static bool savage3DBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Savage3DDriverData *sdrv = (Savage3DDriverData*) drv; Savage3DDeviceData *sdev = (Savage3DDeviceData*) dev; u32 cmd = ( BCI_CMD_RECT | sdev->Cmd_Src_Transparent | BCI_CMD_CLIP_CURRENT | BCI_CMD_DEST_GBD | BCI_CMD_SRC_PBD_COLOR | (0xcc << 16) ); if (dx < rect->x) { cmd |= BCI_CMD_RECT_XP; } else { dx += rect->w - 1; rect->x += rect->w - 1; } if (dy < rect->y) { cmd |= BCI_CMD_RECT_YP; } else { dy += rect->h - 1; rect->y += rect->h - 1; } savage3D_waitfifo( sdrv, sdev, sdev->Cmd_Src_Transparent ? 5 : 4 ); BCI_SEND( cmd ); /* we always have to send the colorkey, but at least it does not clobber the fill color */ if (sdev->Cmd_Src_Transparent) BCI_SEND( sdev->src_colorkey ); BCI_SEND( BCI_X_Y( rect->x, rect->y ) ); BCI_SEND( BCI_X_Y( dx, dy ) ); BCI_SEND( BCI_W_H( rect->w, rect->h ) ); return true; } static bool savage3DStretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { return false; } static void savage3DAfterSetVar( void *drv, void *dev ) { } /* exported symbols */ void savage3d_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { info->version.major = 0; info->version.minor = 3; info->driver_data_size = sizeof (Savage3DDriverData); info->device_data_size = sizeof (Savage3DDeviceData); } DFBResult savage3d_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ) { funcs->CheckState = savage3DCheckState; funcs->SetState = savage3DSetState; funcs->EngineSync = savage3DEngineSync; funcs->AfterSetVar = savage3DAfterSetVar; funcs->FillRectangle = savage3DFillRectangle; funcs->DrawRectangle = savage3DDrawRectangle; funcs->DrawLine = savage3DDrawLine; funcs->FillTriangle = savage3DFillTriangle; funcs->Blit = savage3DBlit; funcs->StretchBlit = savage3DStretchBlit; return DFB_OK; } DFBResult savage3d_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { SavageDriverData *sdrv = (SavageDriverData*) driver_data; volatile u8 *mmio = sdrv->mmio_base; unsigned long cobIndex; /* size index */ unsigned long cobSize; /* size in bytes */ unsigned long cobOffset; /* offset in frame buffer */ /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Savage3D Series" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "S3" ); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = SAVAGE3D_DRAWING_FUNCTIONS | SAVAGE3D_BLITTING_FUNCTIONS; device_info->caps.drawing = SAVAGE3D_DRAWING_FLAGS; device_info->caps.blitting = SAVAGE3D_BLITTING_FLAGS; device_info->limits.surface_byteoffset_alignment = 2048; device_info->limits.surface_pixelpitch_alignment = 32; cobIndex = 7; cobSize = 0x400 << cobIndex; cobOffset = dfb_gfxcard_reserve_memory( device, cobSize ); /* savage_out32( 0x8504, 0x00008000 ); */ /* Disable BCI */ savage_out32( mmio, 0x48C18, savage_in32( mmio, 0x48C18 ) & 0x3FF0); /* Setup BCI command overflow buffer */ savage_out32( mmio, 0x48C14, (cobOffset >> 11) | (cobIndex << 29)); /* Program shadow status update. */ savage_out32( mmio, 0x48C10, 0x78207220); savage_out32( mmio, 0x48C0C, 0); /* Enable BCI and command overflow buffer */ savage_out32( mmio, 0x48C18, savage_in32( mmio, 0x48C18 ) | 0x0C); return DFB_OK; } void savage3d_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { } void savage3d_close_driver( CoreGraphicsDevice *device, void *driver_data ) { } DirectFB-1.2.10/gfxdrivers/savage/savage2000.h0000644000175000017500000000610611245562152015516 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SAVAGE2000_H__ #define __SAVAGE2000_H__ #include #include "savage.h" #include "mmio.h" typedef struct { SavageDeviceData s; } Savage2000DeviceData; typedef struct { SavageDriverData s; } Savage2000DriverData; void savage2000_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ); DFBResult savage2000_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ); DFBResult savage2000_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ); void savage2000_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ); void savage2000_close_driver( CoreGraphicsDevice *device, void *driver_data ); #undef FIFOSTATUS #define FIFOSTATUS 0x48C60 /* Wait for fifo space */ static inline void savage2000_waitfifo(Savage2000DriverData *sdrv, Savage2000DeviceData *sdev, int space) { uint32 slots = MAXFIFO - space; volatile u8 *mmio = sdrv->s.mmio_base; sdev->s.waitfifo_sum += space; sdev->s.waitfifo_calls++; if ((savage_in32(mmio, FIFOSTATUS) & 0x000fffff) > slots) { do { sdev->s.fifo_waitcycles++; } while (savage_in32(mmio, FIFOSTATUS) > slots); } else { sdev->s.fifo_cache_hits++; } } /* Wait for idle accelerator */ static inline void savage2000_waitidle(Savage2000DriverData *sdrv, Savage2000DeviceData *sdev) { sdev->s.waitidle_calls++; while (savage_in32(sdrv->s.mmio_base, FIFOSTATUS) & 0x009fffff) { sdev->s.idle_waitcycles++; } } #endif DirectFB-1.2.10/gfxdrivers/savage/savage_streams_old.h0000644000175000017500000001363611245562152017616 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SAVAGE_STREAMS_OLD_H__ #define __SAVAGE_STREAMS_OLD_H__ #include "savage.h" #include extern DisplayLayerFuncs savageSecondaryFuncs; extern DisplayLayerFuncs savagePrimaryFuncs; extern DisplayLayerFuncs savage_pfuncs; extern void *savage_pdriver_data; /* Streams Processor Registers */ #define SAVAGE_PRIMARY_STREAM_CONTROL 0x8180 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSIDF_CLUT 0x00000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSIDF_ARGB 0x01000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSIDF_KRGB16 0x03000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSIDF_RGB16 0x05000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSIDF_RGB24 0x06000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSIDF_RGB32 0x07000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSFC_NOT_FILTERED 0x00000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSFC_REP_BOTH 0x10000000 #define SAVAGE_PRIMARY_STREAM_CONTROL_PSFC_HOR_INTERPOLATE 0x20000000 #define SAVAGE_CHROMA_KEY_CONTROL 0x8184 #define SAVAGE_GENLOCK_CONTROL 0x8188 #define SAVAGE_SECONDARY_STREAM_CONTROL 0x8190 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_CbYCrY422 0x00000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_YCbCr422 0x01000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_YUV422 0x02000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_KRGB16 0x03000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_YCbCr420 0x04000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_RGB16 0x05000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_RGB24 0x06000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_SSIDF_RGB32 0x07000000 #define SAVAGE_SECONDARY_STREAM_CONTROL_H_DOWNSCALE4 0x00020000 #define SAVAGE_SECONDARY_STREAM_CONTROL_H_DOWNSCALE8 0x00030000 #define SAVAGE_SECONDARY_STREAM_CONTROL_H_DOWNSCALE16 0x00040000 #define SAVAGE_SECONDARY_STREAM_CONTROL_H_DOWNSCALE32 0x00050000 #define SAVAGE_SECONDARY_STREAM_CONTROL_H_DOWNSCALE64 0x00060000 #define SAVAGE_SECONDARY_STREAM_CONTROL_LUMA_ONLY_INTERPOL 0x80000000 #define SAVAGE_CHROMA_KEY_UPPER_BOUND 0x8194 #define SAVAGE_SECONDARY_STREAM_HORIZONTAL_SCALING 0x8198 #define SAVAGE_COLOR_ADJUSTMENT 0x819C #define SAVAGE_BLEND_CONTROL 0x81a0 #define SAVAGE_BLEND_CONTROL_COMP_SSTREAM 0x00000000 #define SAVAGE_BLEND_CONTROL_COMP_PSTREAM 0x01000000 #define SAVAGE_BLEND_CONTROL_COMP_DISSOLVE 0x02000000 #define SAVAGE_BLEND_CONTROL_COMP_FADE 0x03000000 #define SAVAGE_BLEND_CONTROL_COMP_ALPHA 0x04000000 #define SAVAGE_BLEND_CONTROL_COMP_PCOLORKEY 0x05000000 #define SAVAGE_BLEND_CONTROL_COMP_SCOLORKEY 0x06000000 #define KP_KS(kp,ks) ((kp<<10)|(ks<<2)) #define SAVAGE_PRIMARY_STREAM_FRAME_BUFFER_ADDRESS0 0x81c0 #define SAVAGE_PRIMARY_STREAM_FRAME_BUFFER_ADDRESS1 0x81c4 #define SAVAGE_PRIMARY_STREAM_STRIDE 0x81c8 #define SAVAGE_SECONDARY_STREAM_MULTIPLE_BUFFER_SUPPORT 0x81cc #define SAVAGE_SECONDARY_STREAM_FRAME_BUFFER_ADDRESS0 0x81d0 #define SAVAGE_SECONDARY_STREAM_FRAME_BUFFER_ADDRESS1 0x81d4 #define SAVAGE_SECONDARY_STREAM_STRIDE 0x81d8 #define SAVAGE_SECONDARY_STREAM_VERTICAL_SCALING 0x81e0 #define SAVAGE_SECONDARY_STREAM_VERTICAL_INITIAL_VALUE 0x81e4 #define SAVAGE_SECONDARY_STREAM_SOURCE_LINE_COUNT 0x81e8 #define SAVAGE_STREAMS_FIFO 0x81ec #define SAVAGE_PRIMARY_STREAM_WINDOW_START 0x81f0 #define SAVAGE_PRIMARY_STREAM_WINDOW_SIZE 0x81f4 #define SAVAGE_SECONDARY_STREAM_WINDOW_START 0x81f8 #define SAVAGE_SECONDARY_STREAM_WINDOW_SIZE 0x81fc #define SAVAGE_PRIMARY_STREAM_FIFO_MONITOR0 0x8200 #define SAVAGE_SECONDARY_STREAM_FIFO_MONITOR0 0x8204 #define SAVAGE_SECONDARY_STREAM_FB_CB_ADDRESS 0x8208 #define SAVAGE_SECONDARY_STREAM_FB_CR_ADDRESS 0x820C #define SAVAGE_PRIMARY_STREAM_FIFO_MONITOR1 0x8210 #define SAVAGE_SECONDARY_STREAM_FIFO_MONITOR1 0x8214 #define SAVAGE_SECONDARY_STREAM_CBCR_STRIDE 0x8218 #define SAVAGE_PRIMARY_STREAM_FRAME_BUFFER_SIZE 0x8300 #define SAVAGE_SECONDARY_STREAM_FRAME_BUFFER_SIZE 0x8304 #define SAVAGE_SECONDARY_STREAM_FRAME_BUFFER_ADDRESS2 0x8308 /* macros */ #define OS_XY(x,y) (((x+1)<<16)|(y+1)) #define OS_WH(x,y) (((x-1)<<16)|(y)) #endif /* __SAVAGE_STREAMS_OLD_H__ */ DirectFB-1.2.10/gfxdrivers/savage/savage3d.h0000644000175000017500000000665211245562152015451 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SAVAGE3D_H__ #define __SAVAGE3D_H__ #include #include "savage.h" #include "mmio.h" typedef struct { SavageDeviceData s; /* state validation */ int v_gbd; /* destination */ int v_pbd; /* source */ int v_color; /* opaque fill color */ /* saved values */ u32 Cmd_Src_Transparent; u32 src_colorkey; } Savage3DDeviceData; typedef struct { SavageDriverData s; } Savage3DDriverData; void savage3d_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ); DFBResult savage3d_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data ); DFBResult savage3d_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ); void savage3d_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ); void savage3d_close_driver( CoreGraphicsDevice *device, void *driver_data ); #define FIFOSTATUS 0x48C00 #define TILEDAPERTURE0 0x48C40 #define TILEDAPERTURE1 0x48C44 #define TILEDAPERTURE2 0x48C48 #define TILEDAPERTURE3 0x48C4C #define TILEDAPERTURE4 0x48C50 #define TILEDAPERTURE5 0x48C54 /* Wait for fifo space */ static inline void savage3D_waitfifo(Savage3DDriverData *sdrv, Savage3DDeviceData *sdev, int space) { uint32 slots = MAXFIFO - space; volatile u8 *mmio = sdrv->s.mmio_base; sdev->s.waitfifo_sum += space; sdev->s.waitfifo_calls++; if ((savage_in32(mmio, FIFOSTATUS) & 0x0000ffff) > slots) { do { sdev->s.fifo_waitcycles++; } while ((savage_in32(mmio, FIFOSTATUS) & 0x0000ffff) > slots); } else { sdev->s.fifo_cache_hits++; } } /* Wait for idle accelerator */ static inline void savage3D_waitidle(Savage3DDriverData *sdrv, Savage3DDeviceData *sdev) { sdev->s.waitidle_calls++; while ((savage_in32(sdrv->s.mmio_base, FIFOSTATUS) & 0x0008ffff) != 0x80000) { sdev->s.idle_waitcycles++; } } #endif DirectFB-1.2.10/gfxdrivers/nsc/0000777000175000017500000000000011307522570013172 500000000000000DirectFB-1.2.10/gfxdrivers/nsc/Makefile.am0000644000175000017500000000147111245562152015146 00000000000000## Makefile.am for DirectFB/gfxdrivers/nsc SUBDIRS = include INCLUDES = \ -I/usr/src/linux/drivers/video/nsc \ -I/usr/src/linux/drivers/video/nsc/gfx \ -I/usr/src/linux/drivers/video/nsc/panel \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/gfxdrivers/nsc/include nsc_LTLIBRARIES = libdirectfb_nsc.la if BUILD_STATIC nsc_DATA = $(nsc_LTLIBRARIES:.la=.o) endif nscdir = $(MODULEDIR)/gfxdrivers libdirectfb_nsc_la_SOURCES = \ nsc.c \ nsc_galfns.c libdirectfb_nsc_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_nsc_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/nsc/Makefile.in0000644000175000017500000005463211307521500015155 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/nsc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(nscdir)" "$(DESTDIR)$(nscdir)" nscLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(nsc_LTLIBRARIES) libdirectfb_nsc_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_nsc_la_OBJECTS = nsc.lo nsc_galfns.lo libdirectfb_nsc_la_OBJECTS = $(am_libdirectfb_nsc_la_OBJECTS) libdirectfb_nsc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_nsc_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_nsc_la_SOURCES) DIST_SOURCES = $(libdirectfb_nsc_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive nscDATA_INSTALL = $(INSTALL_DATA) DATA = $(nsc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include INCLUDES = \ -I/usr/src/linux/drivers/video/nsc \ -I/usr/src/linux/drivers/video/nsc/gfx \ -I/usr/src/linux/drivers/video/nsc/panel \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/gfxdrivers/nsc/include nsc_LTLIBRARIES = libdirectfb_nsc.la @BUILD_STATIC_TRUE@nsc_DATA = $(nsc_LTLIBRARIES:.la=.o) nscdir = $(MODULEDIR)/gfxdrivers libdirectfb_nsc_la_SOURCES = \ nsc.c \ nsc_galfns.c libdirectfb_nsc_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_nsc_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/nsc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/nsc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-nscLTLIBRARIES: $(nsc_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(nscdir)" || $(MKDIR_P) "$(DESTDIR)$(nscdir)" @list='$(nsc_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(nscLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nscdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(nscLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nscdir)/$$f"; \ else :; fi; \ done uninstall-nscLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(nsc_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(nscdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(nscdir)/$$p"; \ done clean-nscLTLIBRARIES: -test -z "$(nsc_LTLIBRARIES)" || rm -f $(nsc_LTLIBRARIES) @list='$(nsc_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_nsc.la: $(libdirectfb_nsc_la_OBJECTS) $(libdirectfb_nsc_la_DEPENDENCIES) $(libdirectfb_nsc_la_LINK) -rpath $(nscdir) $(libdirectfb_nsc_la_OBJECTS) $(libdirectfb_nsc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsc_galfns.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nscDATA: $(nsc_DATA) @$(NORMAL_INSTALL) test -z "$(nscdir)" || $(MKDIR_P) "$(DESTDIR)$(nscdir)" @list='$(nsc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(nscDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(nscdir)/$$f'"; \ $(nscDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(nscdir)/$$f"; \ done uninstall-nscDATA: @$(NORMAL_UNINSTALL) @list='$(nsc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(nscdir)/$$f'"; \ rm -f "$(DESTDIR)$(nscdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(nscdir)" "$(DESTDIR)$(nscdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-nscLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-nscDATA install-nscLTLIBRARIES install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-nscDATA uninstall-nscLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-nscLTLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-nscDATA install-nscLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-nscDATA uninstall-nscLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/nsc/nsc_galfns.c0000644000175000017500000044476611164361026015412 00000000000000/* * $Workfile: nsc_galfns.c $ * $Revision: 1.13 $ * $Author: dok $ * * File Contents: This file contains the main functions of the Geode * frame buffer device drivers GAL function definitions. * * Project: Geode Frame buffer device driver * */ /* NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * National Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * National Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * National Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ #include #ifndef XFree86LOADER #include #include #include #include #include #include #include #include #include #include #endif #include /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ #include static FBDev *dfb_fbdev = NULL; #include "nsc_galproto.h" /* * Compile time constants */ #define FBDEV_NAME "/dev/nscgal" /* * Cool Macros to access the structures */ #define INIT_GAL(x) \ (x)->dwSignature = FBGAL_SIGNATURE;\ (x)->dwSize = sizeof(*x);\ (x)->dwVersion = FBGAL_VERSION; #if 0 /*------------------------------------------------------------------------ * create_devicenode * * Description: This function creates nscgal device node in the device * directory. * parameters : none * * return: '0' was return on creating the galdevice node. *----------------------------------------------------------------------*/ static int create_devicenode(void) { #if 1 FILE *pfdevices; char line[200], devname[200]; int majdev; /* remove fails if device is open */ remove("/dev/nscgal"); if ((pfdevices = fopen("/proc/devices", "r"))) { while (fgets(line, sizeof(line), pfdevices)) { if (sscanf(line, "%d%*[ \t]%s", &majdev, devname) == 2) { if (strstr(devname, "nscgal")) mknod("/dev/nscgal", S_IFCHR | S_IRUSR | S_IWUSR, makedev(majdev, 0)); } } fclose(pfdevices); } return 1; #endif } #endif /*------------------------------------------------------------------------ * Gal_initialize_interface * * Description: This function intializes the nscgal device . * parameters : none * * return: '1' was returned on intialization of the galdevice * otherwise '0' was returned on failure. *----------------------------------------------------------------------*/ BOOLEAN Gal_initialize_interface(void) { /* create_devicenode(); */ dfb_fbdev = dfb_system_data(); return 1; } /*------------------------------------------------------------------------ * Gal_cleanup_interface * * Description: This function closes the nscgal device . * parameters : none * * return: '1' was returned on closing the galdevice. *----------------------------------------------------------------------*/ BOOLEAN Gal_cleanup_interface(void) { return 1; } /*--------------------------------------------------------------------------- * Gal_write_register * * Description: This function writes the data to the hardware register * of the nscgal device . * parameters: * type: It specifies the hardware access type. * offset: It specifies the offset address the register to be accessed. * value: It specifies the data value to be written into the register. * size: It specifies the size of the data to be written. * * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_write_register(int type, unsigned long offset, unsigned long value, int size) { GAL_HWACCESS hwAccess; INIT_GAL(&hwAccess); hwAccess.dwSubfunction = GALFN_WRITEREG; hwAccess.dwType = type; hwAccess.dwOffset = offset; hwAccess.dwValue = value; hwAccess.dwByteCount = size; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &hwAccess)) return 0; else { return 1; } } /*--------------------------------------------------------------------------- * Gal_read_register * * Description: This function reads the data from the hardware register * of the nscgal device . * parameters: * type: It specifies the hardware access type. * offset: It specifies the offset address of the register to be accessed. * value: It specifies the pointer to hold the data to be read from * the gal hardware register. * size: It specifies the size of the data to be read * * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_read_register(int type, unsigned long offset, unsigned long *value, int size) { GAL_HWACCESS hwAccess; INIT_GAL(&hwAccess); hwAccess.dwSubfunction = GALFN_READREG; hwAccess.dwType = type; hwAccess.dwOffset = offset; hwAccess.dwByteCount = size; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &hwAccess)) return 0; else { *value = hwAccess.dwValue; return 1; } } /*--------------------------------------------------------------------------- * Gal_get_adapter_info * * Description: This function gets the adapter information of the * nscgal device . * parameters: *pAdapterInfo: It specifies the adapter information structure. * * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_adapter_info(PGAL_ADAPTERINFO pAdapterInfo) { INIT_GAL(pAdapterInfo); pAdapterInfo->dwSubfunction = GALFN_GETADAPTERINFO; if (!dfb_fbdev || ioctl(dfb_fbdev->fd, FBIOGAL_API, pAdapterInfo)) return 0; else { return 1; } } /*--------------------------------------------------------------------------- * Gal_set_softvga_state * * Description: This function sets the softvga state of the platform device . * parameters: * bEnable: It specifies the softvga state enable state. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_softvga_state(BOOLEAN bEnable) { GAL_SOFTVGASTATE sSoftVgaState; INIT_GAL(&sSoftVgaState); sSoftVgaState.dwSubfunction = GALFN_SETSOFTVGASTATE; sSoftVgaState.bSoftVgaEnable = bEnable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSoftVgaState)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_softvga_state * * Description: This function gets the softvga state of the platform device . * parameters: * bEnable: get the softvga state. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_softvga_state(int *bState) { GAL_SOFTVGASTATE sSoftVgaState; INIT_GAL(&sSoftVgaState); sSoftVgaState.dwSubfunction = GALFN_GETSOFTVGASTATE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSoftVgaState)) return 0; else { *bState = sSoftVgaState.bSoftVgaEnable; return 1; } } /*--------------------------------------------------------------------------- * Gal_vga_test_pci * * Description: This function tests the vga pci. * parameters: * softvga: It is pointer to the softvga state. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_vga_test_pci(int *softvga) { GAL_VGATESTPCI sVgatestpci; INIT_GAL(&sVgatestpci); sVgatestpci.dwSubfunction = GALFN_GETSOFTVGASTATE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgatestpci)) return 0; else { *softvga = sVgatestpci.softvga; return 1; } } /*--------------------------------------------------------------------------- * Gal_vga_get_pci_command * * Description: This function gets the vga pci command. * parameters: * value: It is pointer to pci command value. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_vga_get_pci_command(unsigned char *value) { GAL_VGAGETPCICOMMAND sVgagetpcicommand; INIT_GAL(&sVgagetpcicommand); sVgagetpcicommand.dwSubfunction = GALFN_VGAGETPCICOMMAND; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgagetpcicommand)) return 0; else { *value = sVgagetpcicommand.value; return 1; } } /*--------------------------------------------------------------------------- * Gal_vga_seq_reset * * Description: This function resets the vga seq. * parameters: * reset: It gives the reset value. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_vga_seq_reset(int reset) { GAL_VGASEQRESET sVgaseqreset; INIT_GAL(&sVgaseqreset); sVgaseqreset.dwSubfunction = GALFN_VGASEQRESET; sVgaseqreset.reset = reset; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgaseqreset)) return 0; else { return 1; } } /*--------------------------------------------------------------------------- * Gal_vga_set_graphics_bits * * Description: This function resets the vga seq. * parameters: None. * * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_vga_set_graphics_bits(void) { GAL_VGASETGRAPHICSBITS sVgasetgraphics; INIT_GAL(&sVgasetgraphics); sVgasetgraphics.dwSubfunction = GALFN_VGASETGRAPHICSBITS; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgasetgraphics)) return 0; else { return 1; } } /*--------------------------------------------------------------------------- * Gal_set_crt_enable * * Description: This function sets the crt state of the device . * parameters: * crtState: It specifies the crt state of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_crt_enable(int crtEnable) { GAL_CRTENABLE sCrtEnable; INIT_GAL(&sCrtEnable); sCrtEnable.dwSubfunction = GALFN_SETCRTENABLE; sCrtEnable.wCrtEnable = crtEnable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCrtEnable)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_is_display_mode_supported * * Description: This function checks the display mode is supported or not. * parameters: * xres: It specifies x co-ordinate resolution. * Yres: It specifies y co-ordinate resolution. * bpp: It specifies the bits per pixel (8/16 bits). * hz: It specifies the frequency of the display mode. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_is_display_mode_supported(int xres, int yres, int bpp, int hz, int *supported) { GAL_DISPLAYMODE sDisplayMode; *supported = 0; INIT_GAL(&sDisplayMode); sDisplayMode.dwSubfunction = GALFN_ISDISPLAYMODESUPPORTED; sDisplayMode.wXres = xres; sDisplayMode.wYres = yres; sDisplayMode.wBpp = bpp; sDisplayMode.wRefresh = hz; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayMode)) return 0; else { *supported = sDisplayMode.dwSupported; return 1; } } /*--------------------------------------------------------------------------- * Gal_set_display_mode * * Description: This function sets the display mode of the galdevice. * parameters: * xres: It specifies x co-ordinate resolution. * Yres: It specifies y co-ordinate resolution. * bpp: It specifies the bits per pixel (8/16 bits). * hz: It specifies the frequency of the display mode. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_mode(int xres, int yres, int bpp, int hz) { GAL_DISPLAYMODE sDisplayMode; INIT_GAL(&sDisplayMode); sDisplayMode.dwSubfunction = GALFN_SETDISPLAYMODE; sDisplayMode.wXres = xres; sDisplayMode.wYres = yres; sDisplayMode.wBpp = bpp; sDisplayMode.wRefresh = hz; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayMode)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_display_mode * * Description: This function gets the display mode of the galdevice. * parameters: * xres: It specifies x co-ordinate resolution. * Yres: It specifies y co-ordinate resolution. * bpp: It specifies the bits per pixel (8/16 bits). * hz: It specifies the frequency of the display mode. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_mode(int *xres, int *yres, int *bpp, int *hz) { GAL_DISPLAYMODE sDisplayMode; INIT_GAL(&sDisplayMode); sDisplayMode.dwSubfunction = GALFN_GETDISPLAYMODE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayMode)) return 0; else { *xres = sDisplayMode.wXres; *yres = sDisplayMode.wYres; *bpp = sDisplayMode.wBpp; *hz = sDisplayMode.wRefresh; return 1; } } /*--------------------------------------------------------------------------- * Gal_set_display_bpp * * Description: This function sets the number bits per pixel in the display * mode of the galdevice. * parameters: * bpp: It specifies the bits per pixel (8/16 bits). * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_bpp(unsigned short bpp) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_SETDISPLAYBPP; sDisplayParams.wBpp = bpp; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_set_bpp * * Description: This function sets the number bits per pixel in the display * mode of the galdevice. * parameters: * bpp: It specifies the bits per pixel (8/16 bits). * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_bpp(unsigned short bpp) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_SETBPP; sDisplayParams.wBpp = bpp; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_display_bpp * * Description: This function gets the number bits per pixel in the display * mode of the galdevice. * parameters: * bpp: It specifies the bits per pixel (8/16 bits). * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_bpp(unsigned short *bpp) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_GETDISPLAYBPP; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else { *bpp = sDisplayParams.wBpp; return 1; } } /*--------------------------------------------------------------------------- * Gal_set_display_pitch * * Description: This function sets the display pitch of the galdevice. * parameters: * pitch: It specifies pitch of the display mode. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_pitch(unsigned short pitch) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_SETDISPLAYPITCH; sDisplayParams.wPitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_display_pitch * * Description: This function gets the display pitch of the galdevice. * parameters: * pitch: It specifies pitch of the display mode. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_pitch(unsigned short *pitch) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_GETDISPLAYPITCH; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else { *pitch = sDisplayParams.wPitch; return 1; } } /*--------------------------------------------------------------------------- * Gal_set_display_offset * * Description: This function sets the offset of display parameters. * parameters: * offset: It specifies the offset address of display parameters. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_offset(unsigned long offset) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_SETDISPLAYOFFSET; sDisplayParams.dwOffset = offset; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_display_offset * * Description: This function gets the offset of display parameters. * parameters: * offset: It specifies the offset address of display parameters. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_offset(unsigned long *offset) { GAL_DISPLAYPARAMS sDisplayParams; INIT_GAL(&sDisplayParams); sDisplayParams.dwSubfunction = GALFN_GETDISPLAYOFFSET; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) return 0; else { *offset = sDisplayParams.dwOffset; return 1; } } /*--------------------------------------------------------------------------- * Gal_get_refreshrate_from_dotclock * * Description: This function gets the refreshrate from dotclock. * parameters: * xres: It specifies x co-ordinate resolution. * Yres: It specifies y co-ordinate resolution. * bpp: It specifies the bits per pixel (8/16 bits). * hz: It is a pointer which holds the refresh rate of the display. * frequency: It spcifies the frequency of the dotclock. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_refreshrate_from_dotclock(int xres, int yres, int bpp, int *hz, unsigned long frequency) { GAL_DOTCLKTOREFRESH sDclkToRefresh; INIT_GAL(&sDclkToRefresh); sDclkToRefresh.dwSubfunction = GALFN_DOTCLKTOREFRESH; sDclkToRefresh.wXres = xres; sDclkToRefresh.wYres = yres; sDclkToRefresh.wBpp = bpp; sDclkToRefresh.dwDotClock = frequency; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDclkToRefresh)) return 0; else { *hz = sDclkToRefresh.wRefreshRate; return 1; } } /*--------------------------------------------------------------------------- * Gal_get_display_timing * * Description: This function gets the display timing from galdevice. * parameters: * pDisplayTiming: It specifies the display timing of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_timing(PGAL_DISPLAYTIMING pDisplayTiming) { INIT_GAL(pDisplayTiming); pDisplayTiming->dwSubfunction = GALFN_GETDISPLAYTIMINGS; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pDisplayTiming)) return 0; else { return 1; } } /*--------------------------------------------------------------------------- * Gal_set_display_timing * * Description: This function sets the display timing of the galdevice. * parameters: * pDisplayTiming: It specifies the display timing of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_timing(PGAL_DISPLAYTIMING pDisplayTiming) { INIT_GAL(pDisplayTiming); pDisplayTiming->dwSubfunction = GALFN_SETDISPLAYTIMINGS; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pDisplayTiming)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_set_fixed_timings * * Description: This function sets the fixed display timings of the * galdevice. * parameters: * pnlXres: It specifies the panel X resolution. * pnlYres: It specifies the panel Y resolution. * totXres: It specifies the total X resolution. * totYres: It specifies the total Y resolution. * bpp: It specifies the bits per pixel (8/16 bits). * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_fixed_timings(int pnlXres, int pnlYres, int totXres, int totYres, int bpp) { GAL_DISPLAYTIMING DisplayTiming; INIT_GAL(&DisplayTiming); DisplayTiming.dwSubfunction = GALFN_SETFIXEDTIMINGS; DisplayTiming.wHActive = pnlXres; /* panel Xres */ DisplayTiming.wVActive = pnlYres; /* panel Yres */ DisplayTiming.wHTotal = totXres; /* Total Xres */ DisplayTiming.wVTotal = totYres; /* Total Yres */ DisplayTiming.wBpp = bpp; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &DisplayTiming)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_set_display_palette_entry * * Description: This function sets the display palette entry of the * galdevice. * parameters: * index: It specifies the palette index, * palette: It specifies the palette of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_palette_entry(unsigned long index, unsigned long palette) { GAL_PALETTE_ENTRY sPalette; INIT_GAL(&sPalette); sPalette.dwSubfunction = GALFN_SETPALETTE_ENTRY; sPalette.dwIndex = index; sPalette.dwPalette = palette; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPalette)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_display_palette_entry * * Description: This function gets the display palette entry of the * galdevice. * parameters: * index: It specifies the palette index, * palette: It is a pointer to the palette of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_palette_entry(unsigned long index, unsigned long *palette) { GAL_PALETTE_ENTRY sPalette; INIT_GAL(&sPalette); sPalette.dwSubfunction = GALFN_GETPALETTE_ENTRY; sPalette.dwIndex = index; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPalette)) return 0; else { *palette = sPalette.dwPalette; return 1; } } /*--------------------------------------------------------------------------- * Gal_set_display_palette_entry * * Description: This function sets the display palette entry of the * galdevice. * parameters: * pPalette: It specifies the palette structure of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_display_palette(PGAL_PALETTE pPalette) { INIT_GAL(pPalette); pPalette->dwSubfunction = GALFN_SETPALETTE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pPalette)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_get_display_palette_entry * * Description: This function gets the display palette entry of the * galdevice. * parameters: * pPalette: It specifies the palette structure of the galdevice. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_display_palette(PGAL_PALETTE pPalette) { INIT_GAL(pPalette); pPalette->dwSubfunction = GALFN_GETPALETTE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pPalette)) return 0; else { return 1; } } /*--------------------------------------------------------------------------- * Gal_wait_until_idle * * Description: This function waits until the graphics engine is idle. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_wait_until_idle(void) { GAL_WAITUNTILIDLE sWaitIdle; INIT_GAL(&sWaitIdle); sWaitIdle.dwSubfunction = GALFN_WAITUNTILIDLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sWaitIdle)) return 0; else return 1; } /*--------------------------------------------------------------------------- * Gal_wait_vertical_blank * * Description: This function wait until start of vertical blank. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_wait_vertical_blank(void) { GAL_WAITVERTICALBLANK sWaitVerticalBlank; INIT_GAL(&sWaitVerticalBlank); sWaitVerticalBlank.dwSubfunction = GALFN_WAITVERTICALBLANK; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sWaitVerticalBlank)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_cursor_enable * * Description: This function enable or disable the hardware cursor. * parameters: * enable: This specifies the enable value of the cursor. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_cursor_enable(int enable) { GAL_CURSORENABLE sCursorEnable; INIT_GAL(&sCursorEnable); sCursorEnable.dwSubfunction = GALFN_SETCURSORENABLE; sCursorEnable.bCursorEnable = enable ? 1 : 0; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorEnable)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_cursor_position * * Description: This function sets the position of the cursor. * parameters: * memoffset: It specifies the memory offset of the cursor position. * xpos: It specifies the X co-ordinate position of the cursor. * ypos: It specifies the Y co-ordinate position of the cursor. * xhotspot: It specifies the X hotspot location for current cursor shape. * yhotspot: It specifies the Y hotspot location for current cursor shape. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot) { GAL_CURSORPOSITION sCursorPos; INIT_GAL(&sCursorPos); sCursorPos.dwSubfunction = GALFN_SETCURSORPOSITION; sCursorPos.dwMemOffset = memoffset; sCursorPos.wXPos = xpos; sCursorPos.wYPos = ypos; sCursorPos.wXHot = xhotspot; sCursorPos.wYHot = yhotspot; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorPos)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_cursor_position * * Description: This function gets the cursor position. * parameters: * memoffset: It points the memory offset of the cursor position. * xpos: It points the X co-ordinate position of the cursor. * ypos: It points the Y co-ordinate position of the cursor. * xhotspot: It points the X hotspot location for current cursor shape. * yhotspot: It points the Y hotspot location for current cursor shape. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_cursor_position(unsigned long *memoffset, unsigned short *xpos, unsigned short *ypos, unsigned short *xhotspot, unsigned short *yhotspot) { GAL_CURSORPOSITION sCursorPos; INIT_GAL(&sCursorPos); sCursorPos.dwSubfunction = GALFN_GETCURSORPOSITION; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorPos)) return 0; else { *memoffset = sCursorPos.dwMemOffset; *xpos = sCursorPos.wXPos; *ypos = sCursorPos.wYPos; *xhotspot = sCursorPos.wXHot; *yhotspot = sCursorPos.wYHot; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_cursor_shape32 * * Description: This function loads 32x32 cursor pattern. * parameters: * memoffset: It specifies the graphics memory offset for cursor shape. * andmask: It is a pointer to 32 DWORD of AND data. * xormask: It is a pointer to 32 DWORD of XOR data. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) { GAL_SETCURSORSHAPE sCursorShape; INIT_GAL(&sCursorShape); sCursorShape.dwSubfunction = GALFN_SETCURSORSHAPE; sCursorShape.dwMemOffset = memoffset; direct_memcpy(sCursorShape.dwAndMask, andmask, sizeof(sCursorShape.dwAndMask)); direct_memcpy(sCursorShape.dwXorMask, xormask, sizeof(sCursorShape.dwXorMask)); if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorShape)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_cursor_shape64 * * Description: This function loads 64x64 cursor pattern. * parameters: * memoffset: It specifies the graphics memory offset for cursor shape. * andmask: It is a pointer to 64 DWORD of AND data. * xormask: It is a pointer to 64 DWORD of XOR data. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) { GAL_SETCURSORSHAPE sCursorShape; INIT_GAL(&sCursorShape); sCursorShape.dwSubfunction = GALFN_SETCURSORSHAPE_RCLD; sCursorShape.dwMemOffset = memoffset; direct_memcpy(sCursorShape.dwAndMask, andmask, sizeof(sCursorShape.dwAndMask)); direct_memcpy(sCursorShape.dwXorMask, xormask, sizeof(sCursorShape.dwXorMask)); if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorShape)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_cursor_colors * * Description: This function sets the colors of the hardware cursor. * parameters: * bkcolor:It specifies the RGB value for the background color. * fgcolor:It specifies the RGB value for the foreground color. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) { GAL_CURSORCOLORS sCursorColor; INIT_GAL(&sCursorColor); sCursorColor.dwSubfunction = GALFN_SETCURSORCOLORS; sCursorColor.dwBgColor = bkcolor; sCursorColor.dwFgColor = fgcolor; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorColor)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_cursor_colors * * Description: This function gets the colors of the hardware cursor. * parameters: * bkcolor:It points the RGB value for the background color. * fgcolor:It points the RGB value for the foreground color. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_get_cursor_colors(unsigned long *bkcolor, unsigned long *fgcolor) { GAL_CURSORCOLORS sCursorColor; INIT_GAL(&sCursorColor); sCursorColor.dwSubfunction = GALFN_GETCURSORCOLORS; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorColor)) return 0; else { *bkcolor = sCursorColor.dwBgColor; *fgcolor = sCursorColor.dwFgColor; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_solid_pattern * * Description: This function sets a solid pattern color for future rendering. * parameters: * color: It specifies the pattern color in proper format for current * display mode. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_solid_pattern(unsigned long color) { GAL_SETSOLIDPATTERN sSetSoildPat; INIT_GAL(&sSetSoildPat); sSetSoildPat.dwSubfunction = GALFN_SETSOLIDPATTERN; sSetSoildPat.dwColor = color; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetSoildPat)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_solid_source * * Description: This function specifies a constant source data value for * raster operations that use both pattern * and source data. * parameters: * color: It specifies the source color. * return: '1' was returned on success otherwise '0' was returned. *-------------------------------------------------------------------------*/ BOOLEAN Gal_set_solid_source(unsigned long color) { GAL_SETSOLIDSOURCE sSetSolidSrc; INIT_GAL(&sSetSolidSrc); sSetSolidSrc.dwSubfunction = GALFN_SETSOLIDSOURCE; sSetSolidSrc.dwColor = color; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetSolidSrc)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_mono_source * * Description: * parameters: * bkcolor: It specifies the background color. * fgcolor: It specifies the foreground color. *transparency: It specifies the transparency flag. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned char transparency) { GAL_SETMONOSOURCE sSetMonoSrc; INIT_GAL(&sSetMonoSrc); sSetMonoSrc.dwSubfunction = GALFN_SETMONOSOURCE; sSetMonoSrc.dwFgColor = fgcolor; sSetMonoSrc.dwBgColor = bgcolor; sSetMonoSrc.cTransparency = transparency; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetMonoSrc)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_mono_pattern * * Description: This function specifies an 8x8 monochrome pattern * used in future rendering operations. * parameters: * bkcolor: It specifies the background color. * fgcolor: It specifies the foreground color. * data0: It specifies the bits of 8x8 monochrome pattern. * data1: It specifies the bits of 8x8 monochrome pattern. *transparency: It specifies the transparency flag. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparency) { GAL_SETMONOPATTERN sSetMonoPat; INIT_GAL(&sSetMonoPat); sSetMonoPat.dwSubfunction = GALFN_SETMONOPATTERN; sSetMonoPat.dwFgColor = fgcolor; sSetMonoPat.dwBgColor = bgcolor; sSetMonoPat.dwData0 = data0; sSetMonoPat.dwData1 = data1; sSetMonoPat.cTransparency = transparency; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetMonoPat)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_raster_operation * * Description: This function specifies the raster operation for * future rendering. * parameters: * rop: It specifies the ternary raster operation * (pattern/source/destination). * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_raster_operation(unsigned char rop) { GAL_RASTEROPERATION sSetRop; INIT_GAL(&sSetRop); sSetRop.dwSubfunction = GALFN_SETRASTEROPERATION; sSetRop.cRop = rop; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetRop)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_pattern_fill * * Description: This function renders pattern data to a rectangular * region. * parameters: * x: It specifies the screen X position, in pixels. * y: It specifies the screen Y position, in pixels. * width: It specifies the width of rectangle, in pixels. * height: It specifies the height of rectangle, in pixels. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height) { GAL_PATTERNFILL sPatternFill; INIT_GAL(&sPatternFill); sPatternFill.dwSubfunction = GALFN_PATTERNFILL; sPatternFill.wXPos = x; sPatternFill.wYPos = y; sPatternFill.wWidth = width; sPatternFill.wHeight = height; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPatternFill)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_screen_to_screen_blt * * Description: This function is used to perform a screen to screen * BLT operation. * parameters: * srcx: It specifies the source X position. * srcy: It specifies the source Y position. * dstx: It specifies the destination X position. * dsty: It specifies the destination Y position. * width: It specifies the width of BLT, in pixels. * height: It specifies the height of BLT, in pixels. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height) { GAL_SCREENTOSCREENBLT sScreenBlt; INIT_GAL(&sScreenBlt); sScreenBlt.dwSubfunction = GALFN_SCREENTOSCREENBLT; sScreenBlt.wXStart = srcx; sScreenBlt.wYStart = srcy; sScreenBlt.wXEnd = dstx; sScreenBlt.wYEnd = dsty; sScreenBlt.wWidth = width; sScreenBlt.wHeight = height; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sScreenBlt)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_screen_to_screen_xblt * * Description: This function is used to perform a screen to screen * BLT operation using a transparency color. * parameters: * srcx: It specifies the source X position. * srcy: It specifies the source Y position. * dstx: It specifies the destination X position. * dsty: It specifies the destination Y position. * width: It specifies the width of BLT, in pixels. * height: It specifies the height of BLT, in pixels. * color: It specifies the transparency color. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color) { GAL_SCREENTOSCREENXBLT sScreenXBlt; INIT_GAL(&sScreenXBlt); sScreenXBlt.dwSubfunction = GALFN_SCREENTOSCREENXBLT; sScreenXBlt.wXStart = srcx; sScreenXBlt.wYStart = srcy; sScreenXBlt.wXEnd = dstx; sScreenXBlt.wYEnd = dsty; sScreenXBlt.wWidth = width; sScreenXBlt.wHeight = height; sScreenXBlt.dwColor = color; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sScreenXBlt)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_bresenham_line * * Description: This function is used to draw a single pixel line * using the specified Bresenham parameters. * parameters: * x: It specifies the starting X position. * y: It specifies the starting Y position. * length: It specifies the length of the vector, in pixels. * initerr: It specifies the Bresenham initial error term. * axialerr: It specifies the Bresenham axial error term * (moving in major direction only). * diagerr: It specifies Bresenham diagonal error term * (moving in major and minor direction. * flags: It specifies the flag. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) { GAL_BRESENHAMLINE sBresenhamLine; INIT_GAL(&sBresenhamLine); sBresenhamLine.dwSubfunction = GALFN_BRESENHAMLINE; sBresenhamLine.wX1 = x; sBresenhamLine.wY1 = y; sBresenhamLine.wLength = length; sBresenhamLine.wErr = initerr; sBresenhamLine.wE1 = axialerr; sBresenhamLine.wE2 = diagerr; sBresenhamLine.wFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBresenhamLine)) return 0; else return 1; } BOOLEAN Gal_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long pattern) { GAL_COLOR_PATTERNFILL sColorPat; INIT_GAL(&sColorPat); sColorPat.dwSubfunction = GALFN_COLOR_PATTERNFILL; sColorPat.wDstx = x; sColorPat.wDsty = y; sColorPat.wWidth = width; sColorPat.wHeight = height; sColorPat.dwPattern = pattern; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sColorPat)) return 0; else return 1; } BOOLEAN Gal_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data, long pitch) { GAL_COLOR_BITMAP_TO_SCREEN_BLT sBmp2Scr; INIT_GAL(&sBmp2Scr); sBmp2Scr.dwSubfunction = GALFN_COLOR_BITMAP_TO_SCREEN_BLT; sBmp2Scr.wSrcx = srcx; sBmp2Scr.wSrcy = srcy; sBmp2Scr.wDstx = dstx; sBmp2Scr.wDsty = dsty; sBmp2Scr.wWidth = width; sBmp2Scr.wHeight = height; sBmp2Scr.dwData = data; sBmp2Scr.wPitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBmp2Scr)) return 0; else return 1; } BOOLEAN Gal_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data, long pitch, unsigned long color) { GAL_COLOR_BITMAP_TO_SCREEN_XBLT sBmp2Scr; INIT_GAL(&sBmp2Scr); sBmp2Scr.dwSubfunction = GALFN_COLOR_BITMAP_TO_SCREEN_XBLT; sBmp2Scr.wSrcx = srcx; sBmp2Scr.wSrcy = srcy; sBmp2Scr.wDstx = dstx; sBmp2Scr.wDsty = dsty; sBmp2Scr.wWidth = width; sBmp2Scr.wHeight = height; sBmp2Scr.dwData = data; sBmp2Scr.wPitch = pitch; sBmp2Scr.dwColor = color; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBmp2Scr)) return 0; else return 1; } BOOLEAN Gal_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data, short pitch) { GAL_MONO_BITMAP_TO_SCREEN_BLT sBmp2Scr; INIT_GAL(&sBmp2Scr); sBmp2Scr.dwSubfunction = GALFN_MONO_BITMAP_TO_SCREEN_BLT; sBmp2Scr.wSrcx = srcx; sBmp2Scr.wSrcy = srcy; sBmp2Scr.wDstx = dstx; sBmp2Scr.wDsty = dsty; sBmp2Scr.wWidth = width; sBmp2Scr.wHeight = height; sBmp2Scr.dwData = data; sBmp2Scr.wPitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBmp2Scr)) return 0; else return 1; } BOOLEAN Gal_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data) { GAL_TEXT_BLT sTextBlt; INIT_GAL(&sTextBlt); sTextBlt.dwSubfunction = GALFN_TEXT_BLT; sTextBlt.wDstx = dstx; sTextBlt.wDsty = dsty; sTextBlt.wWidth = width; sTextBlt.wHeight = height; sTextBlt.dwData = data; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTextBlt)) return 0; else return 1; } /*------------------------------------------------------------------------ * Gal_set_compression_enable * * Description: This function enables or disables display * compression. * parameters: * bCompressionState: It specifies the display compression state. * return: '1' was returned on success otherwise * '0' was returned. *----------------------------------------------------------------------*/ BOOLEAN Gal_set_compression_enable(BOOLEAN bCompressionState) { GAL_COMPRESSIONSTATE sCompState; INIT_GAL(&sCompState); sCompState.dwSubfunction = GALFN_SETCOMPRESSIONSTATE; sCompState.bCompressionState = bCompressionState; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompState)) return 0; else return 1; } /*------------------------------------------------------------------------ * Gal_get_compression_enable * * Description: This function gets the compression state. * * parameters: * bCompressionState: gets the display compression state. * return: '1' was returned on success otherwise * '0' was returned. *----------------------------------------------------------------------*/ BOOLEAN Gal_get_compression_enable(int *bCompressionState) { GAL_COMPRESSIONSTATE sCompState; INIT_GAL(&sCompState); sCompState.dwSubfunction = GALFN_GETCOMPRESSIONSTATE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompState)) return 0; else { *bCompressionState = sCompState.bCompressionState; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_compression_parameters * * Description: This function sets the compression parameters of the * frame buffer device. * parameters: * flags: It specifies the flag. * offset: It specifies the base offset in graphics memory for the * compression buffer. * pitch: It specifies the pitch of compression buffer, in bytes. * size: It specifies the maximum line size of the compression buffer * in bytes. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_compression_parameters(unsigned long flags, unsigned long offset, unsigned short pitch, unsigned short size) { GAL_COMPRESSIONPARAMS sCompParams; INIT_GAL(&sCompParams); sCompParams.dwSubfunction = GALFN_SETCOMPRESSIONPARAMS; sCompParams.dwFlags = flags; sCompParams.dwCompOffset = offset; sCompParams.dwCompPitch = pitch; sCompParams.dwCompSize = size; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompParams)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_compression_parameters * * Description: This function gets the compression parameters of the * frame buffer device. * parameters: * flags: It specifies the flag. * offset: gets the base offset in graphics memory for the * compression buffer. * pitch: gets the pitch of compression buffer, in bytes. * size: gets the maximum line size of the compression buffer * in bytes. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_compression_parameters(unsigned long flags, unsigned long *offset, unsigned short *pitch, unsigned short *size) { GAL_COMPRESSIONPARAMS sCompParams; INIT_GAL(&sCompParams); sCompParams.dwSubfunction = GALFN_GETCOMPRESSIONPARAMS; sCompParams.dwFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompParams)) return 0; else { *offset = sCompParams.dwCompOffset; *pitch = sCompParams.dwCompPitch; *size = sCompParams.dwCompSize; return 1; } } /*-------------------------------------------------------------------------- * Gal_vga_mode_switch * * Description:This function signals the beginning or end of a * mode switch. * parameters: * active: It specifies the mode switch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_vga_mode_switch(int active) { GAL_VGAMODEDATA sVgaData; INIT_GAL(&sVgaData); sVgaData.dwSubfunction = GALFN_VGAMODESWITCH; sVgaData.dwFlags = active; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgaData)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_vga_clear_extended * * Description: This will clear the Svga data. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_vga_clear_extended(void) { GAL_VGAMODEDATA sVgaData; INIT_GAL(&sVgaData); sVgaData.dwSubfunction = GALFN_VGACLEARCRTEXT; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgaData)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_vga_pitch * * Description: This function sets VGA register values in VGA * structure for specified pitch. * parameters: * pVgaData: It specifies the vga structure. * pitch: It specifies the number of bytes between scanlines. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_vga_pitch(PGAL_VGAMODEDATA pVgaData, unsigned short pitch) { INIT_GAL(pVgaData); pVgaData->dwSubfunction = GALFN_VGASETPITCH; pVgaData->dwFlags = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_vga_restore * * Description: This function sets the VGA state to the values in the * VGA structure. * parameters: * pVgaData: It specifies the vga structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_vga_restore(PGAL_VGAMODEDATA pVgaData) { INIT_GAL(pVgaData); pVgaData->dwSubfunction = GALFN_VGARESTORE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_vga_save * * Description: This function saves the current VGA state in the * VGA structure. * parameters: * pVgaData: It specifies the vga structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_vga_save(PGAL_VGAMODEDATA pVgaData) { INIT_GAL(pVgaData); pVgaData->dwSubfunction = GALFN_VGASAVE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_vga_mode * * Description: This function sets VGA register values in VGA * structure for specified mode. * parameters: * pVgaData: It specifies the vga structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_vga_mode(PGAL_VGAMODEDATA pVgaData) { INIT_GAL(pVgaData); pVgaData->dwSubfunction = GALFN_VGASETMODE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_enabled_in_bios * * Description: This function gets the status of the FP in BIOS. * parameters: * status: returns the state of FP in Bios. * pParam: It specifies the panel parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_enabled_in_bios(int *state) { GAL_PNLBIOS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLBIOSENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { *state = pStat.state; return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_info_from_bios * * Description: This function gets the parameters of the FP in BIOS. * parameters: * status: returns the state of FP in Bios. * pParam: It specifies the panel parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_info_from_bios(int *xres, int *yres, int *bpp, int *hz) { GAL_PNLBIOS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLBIOSINFO; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { *xres = pStat.XRes; *yres = pStat.YRes; *bpp = pStat.Bpp; *hz = pStat.Freq; return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_set_params * * Description: This function sets the panel parameters. * parameters: * flags: * pParam: It specifies the panel parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_set_params(unsigned long flags, PPnl_PanelParams pParam) { GAL_PNLPARAMS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLSETPARAMS; pParam->Flags = flags; direct_memcpy(&(pStat.PanelParams), pParam, sizeof(Pnl_PanelParams)); if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_get_params * * Description: This function gets the panel parameters. * parameters: * flags: * pParam: It specifies the panel parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_get_params(unsigned long flags, PPnl_PanelParams pParam) { GAL_PNLPARAMS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLGETPARAMS; direct_memcpy(&(pStat.PanelParams), pParam, sizeof(Pnl_PanelParams)); pStat.PanelParams.Flags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { direct_memcpy(pParam, &(pStat.PanelParams), sizeof(Pnl_PanelParams)); return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_init * * Description: This function initializes the panel parameters. * parameters: * pParam: It specifies the panel parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_init(PPnl_PanelParams pParam) { GAL_PNLPARAMS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLINITPANEL; direct_memcpy(&(pStat.PanelParams), pParam, sizeof(Pnl_PanelParams)); if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_pnl_save * * Description: This function saves the current panel parameters. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_save(void) { GAL_PNLPARAMS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLSAVESTATE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_restore * * Description: This function restores the current panel parameters. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_restore(void) { GAL_PNLPARAMS pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLRESTORESTATE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_powerup * * Description: This function powers up the panel. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_powerup(void) { GAL_BASE pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLPOWERUP; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_pnl_powerdown * * Description: This function powers down the panel. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_pnl_powerdown(void) { GAL_BASE pStat; INIT_GAL(&pStat); pStat.dwSubfunction = GALFN_PNLPOWERDOWN; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_enable_panning * * Description: This routine enables the panning when the Mode * is bigger than the panel size. * parameters: * x: x-positon of the screen. * y: y-positon of the screen. * * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_enable_panning(int x, int y) { GAL_ENABLEPANNING pEnablePanning; INIT_GAL(&pEnablePanning); pEnablePanning.dwSubfunction = GALFN_ENABLEPANNING; pEnablePanning.x = x; pEnablePanning.y = y; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pEnablePanning)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_tv_set_params * * Description: This function sets the tv parameters of * tvparameters structure. * parameters: * flags: * pTV: It specifies the tv parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_tv_set_params(unsigned long flags, PGAL_TVPARAMS pTV) { INIT_GAL(pTV); pTV->dwSubfunction = GALFN_SETTVPARAMS; pTV->dwFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_tv_get_params * * Description: This function gets the tv parameters of * tvparameters structure. * parameters: * flags: Dummy flag * pTV: It specifies the tv parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_tv_get_params(unsigned long flags, PGAL_TVPARAMS pTV) { INIT_GAL(pTV); pTV->dwSubfunction = GALFN_GETTVPARAMS; pTV->dwFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_tv_set_timings * * Description: This function sets the tv timing registers. * parameters: * flags: Dummy flag. * pTV: It specifies the tv parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_tv_set_timings(unsigned long flags, PGAL_TVTIMING pTV) { INIT_GAL(pTV); pTV->dwSubfunction = GALFN_SETTVTIMING; pTV->dwFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_tv_get_timings * * Description: This function gets the tv timing registers. * parameters: * flags: Dummy flag. * pTV: It specifies the tv parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_tv_get_timings(unsigned long flags, PGAL_TVTIMING pTV) { INIT_GAL(pTV); pTV->dwSubfunction = GALFN_GETTVTIMING; pTV->dwFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_tv_enable * * Description: This function sets the tv state of the device . * parameters: * bState : set the tv state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_tv_enable(int bState) { GAL_TVPARAMS pTV; INIT_GAL(&pTV); pTV.dwSubfunction = GALFN_SETENABLE; pTV.bState = bState; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pTV)) return 0; else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_tv_enable * * Description: This function gets the tv state of the device . * parameters: * bState : get the tv state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_tv_enable(unsigned int *bState) { GAL_TVPARAMS pTV; INIT_GAL(&pTV); pTV.dwSubfunction = GALFN_GETENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pTV)) { *bState = 0; return 0; } else { *bState = pTV.bState; return 1; } } /*-------------------------------------------------------------------------- * Gal_is_tv_mode_supported * * Description: This function checks the tv mode is supported or not. * parameters: * flags: Dummy flag * pTV: It specifies the tv parameters structure. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_is_tv_mode_supported(unsigned long flags, PGAL_TVPARAMS pTV, int *bState) { INIT_GAL(pTV); pTV->dwSubfunction = GALFN_ISTVMODESUPPORTED; pTV->dwFlags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) { return 0; } else { *bState = pTV->bState; return 1; } } /** Video **********************************************************/ /*-------------------------------------------------------------------------- * Gal_set_video_enable * * Description: This function sets the video enable state. * parameters: * enable: Its value is '1' to enable video and '0' to disable video. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_enable(int enable) { GAL_VIDEOENABLE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOENABLE; sSetVideo.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_format * * Description: This function sets the video format. * parameters: * format: Its video format value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_format(int format) { GAL_VIDEOFORMAT sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOFORMAT; sSetVideo.format = format; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_size * * Description: This function sets the video size. * parameters: * width: Width of the video. * height: Height of the video. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_size(unsigned short width, unsigned short height) { GAL_VIDEOSIZE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOSIZE; sSetVideo.width = width; sSetVideo.height = height; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_offset * * Description: This function sets the video size. * parameters: * offset: Offset of the video. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_offset(unsigned long offset) { GAL_VIDEOOFFSET sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOOFFSET; sSetVideo.offset = offset; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_window * * Description: This function sets the video window. * parameters: * x: X co-ordinate of the Video screen. * y: Y co-ordinate of the Video screen. * w: Width of the Video screen. * h: Height of the Video screen. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_window(short x, short y, short w, short h) { GAL_VIDEOWINDOW sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOWINDOW; sSetVideo.x = x; sSetVideo.y = y; sSetVideo.w = w; sSetVideo.h = h; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_scale * * Description: This function sets the video scale. * parameters: * srcw: Source width. * srch: Source height. * dstw: Destination width. * dsth: Destination height. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) { GAL_VIDEOSCALE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOSCALE; sSetVideo.srcw = srcw; sSetVideo.srch = srch; sSetVideo.dstw = dstw; sSetVideo.dsth = dsth; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_filter. * * Description: This function sets the video filter. * parameters: * xfilter: X-co-ordinate filter. * yfilter: Y-co-ordinate filter. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_filter(int xfilter, int yfilter) { GAL_VIDEOFILTER sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOFILTER; sSetVideo.xfilter = xfilter; sSetVideo.yfilter = yfilter; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_color_key. * * Description: This function sets the video color key. * parameters: * key: Color key. * mask: Color mask. * bluescreen: Value for bluescreen. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen) { GAL_VIDEOCOLORKEY sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOCOLORKEY; sSetVideo.key = key; sSetVideo.mask = mask; sSetVideo.bluescreen = bluescreen; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_downscale_enable. * * Description: This function sets the video downscale enable state. * parameters: * enable: Value for enable or disable the video downscale. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_downscale_enable(int enable) { GAL_VIDEODOWNSCALEENABLE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEODOWNSCALEENABLE; sSetVideo.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_downscale_config. * * Description: This function sets the video downscale configuration. * parameters: * type: Video down scale type. * m: Factor for the Video overlay window. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_downscale_config(unsigned short type, unsigned short m) { GAL_VIDEODOWNSCALECONFIG sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEODOWNSCALECONFIG; sSetVideo.type = type; sSetVideo.m = m; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_downscale_coefficients. * * Description: This function sets the video downscale coefficients. * parameters: * coef1: Video downscale filter coefficient. * coef2: Video downscale filter coefficient. * coef3: Video downscale filter coefficient. * coef4: Video downscale filter coefficient. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4) { GAL_VIDEODOWNSCALECOEFF sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEODOWNSCALECOEFF; sSetVideo.coef1 = coef1; sSetVideo.coef2 = coef2; sSetVideo.coef3 = coef3; sSetVideo.coef4 = coef4; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_source. * * Description: This function sets the video source to either memory or Direct * VIP * parameters: * source: Video source. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_source(int source) { GAL_VIDEOSOURCE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOSOURCE; sSetVideo.source = source; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_interlaced * * Description: This function configures the Video processor video overlay mode * to be interlaced YUV. * parameters: * enable: Value used to enable or disalbe the Video interlaced. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_interlaced(int enable) { GAL_SETVIDEOINTERLACED sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOINTERLACED; sSetVideo.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_color_space * * Description: This function configures the Video processor to prcoess * graphics and video in either YUV or RGB color space. * * parameters: * enable: Value used to enable or disalbe the Video color space. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_color_space_YUV(int colorspace) { GAL_COLORSPACEYUV sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOCOLORSPACE; sSetVideo.colorspace = colorspace; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_cursor. * * Description: This function configures the Video Hardware cursor. * * * parameters: * key: color key. * mask: color mask. *select_color2: selected for color2. * color1: color1 value. * color2: color2 value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2) { GAL_VIDEOCURSOR sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOCURSOR; sSetVideo.key = key; sSetVideo.mask = mask; sSetVideo.select_color2 = select_color2; sSetVideo.color1 = color1; sSetVideo.color2 = color2; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_request. * * Description: This function sets the horizontal(pixel) and vertical(line) * video request values. * * parameters: * x: X video request value. * y: Y video request value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_request(short x, short y) { GAL_VIDEOREQUEST sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOREQUEST; sSetVideo.x = x; sSetVideo.y = y; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_alpha_enable. * * Description: This function enables or disables the currently selected * alpha region. * * parameters: * enable: Value to enalbe or disable alha region. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_alpha_enable(int enable) { GAL_ALPHAENABLE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETALPHAENABLE; sSetVideo.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_alpha_enable. * * Description: This function gets the alpha enable state. * * parameters: * enable: Pointer to get the enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_alpha_enable(int *enable) { GAL_ALPHAENABLE sGetalphaenable; INIT_GAL(&sGetalphaenable); sGetalphaenable.dwSubfunction = GALFN_GETALPHAENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphaenable)) return 0; else *enable = sGetalphaenable.enable; return 1; } /*-------------------------------------------------------------------------- * Gal_set_alpha_window * * Description: This function sets the size of the currently selected * alpha region. * parameters: * x: X co-ordinate of the alpha region. * y: Y co-ordinate of the alpha region. * width: Width of the alpha region. * height: Height of the alpha region. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_alpha_window(short x, short y, unsigned short width, unsigned short height) { GAL_ALPHAWINDOW sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETALPHAWINDOW; sSetVideo.x = x; sSetVideo.y = y; sSetVideo.width = width; sSetVideo.height = height; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_alpha_size * * Description: This function gets the size of the currently selected * alpha region. * parameters: * x: X co-ordinate of the alpha region. * y: Y co-ordinate of the alpha region. * width: Width of the alpha region. * height: Height of the alpha region. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height) { GAL_ALPHASIZE sGetalphasize; INIT_GAL(&sGetalphasize); sGetalphasize.dwSubfunction = GALFN_GETALPHASIZE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphasize)) return 0; else { *x = *(sGetalphasize.x); *y = *(sGetalphasize.y); *width = *(sGetalphasize.width); *height = *(sGetalphasize.height); return 1; } } /*-------------------------------------------------------------------------- * Gal_set_alpha_value * * Description: This function sets the alpha value for the selected alpha * region. It also specifies an increment/decrement value for * fading. * parameters: * alpha: Alpha value for the currently selected alpha region. * delta: Gives the increment/decrement fading value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_alpha_value(unsigned char alpha, char delta) { GAL_ALPHAVALUE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETALPHAVALUE; sSetVideo.alpha = alpha; sSetVideo.delta = delta; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_alpha_value * * Description: This function gets the alpha value for the selected alpha * region. It also gets increment/decrement value for * fading. * parameters: * alpha: Alpha value for the currently selected alpha region. * delta: Gives the increment/decrement fading value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_alpha_value(unsigned char *alpha, char *delta) { GAL_ALPHAVALUE sGetalphavalue; INIT_GAL(&sGetalphavalue); sGetalphavalue.dwSubfunction = GALFN_GETALPHAVALUE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphavalue)) return 0; else { *alpha = sGetalphavalue.alpha; *delta = sGetalphavalue.delta; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_alpha_priority * * Description: This function sets the priority of the selected alpha * region. * parameters: * priority: Gives the priority value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_alpha_priority(int priority) { GAL_ALPHAPRIORITY sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETALPHAPRIORITY; sSetVideo.priority = priority; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_alpha_priority * * Description: This function gets the priority of the selected alpha * region. * parameters: * priority: Gives the priority value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_alpha_priority(int *priority) { GAL_ALPHAPRIORITY sGetalphapriority; INIT_GAL(&sGetalphapriority); sGetalphapriority.dwSubfunction = GALFN_GETALPHAPRIORITY; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphapriority)) return 0; else { *priority = sGetalphapriority.priority; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_alpha_color * * Description: This function sets the color to be displayed inside the * currently of the selected alpha window. * parameters: * color: Gives the color value to be displayed. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_alpha_color(unsigned long color) { GAL_ALPHACOLOR sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETALPHACOLOR; sSetVideo.color = color; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_get_alpha_color * * Description: This function gets the color to be displayed inside the * currently of the selected alpha window. * parameters: * color: Gives the color value to be displayed. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_alpha_color(unsigned long *color) { GAL_ALPHACOLOR sGetalphacolor; INIT_GAL(&sGetalphacolor); sGetalphacolor.dwSubfunction = GALFN_GETALPHACOLOR; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphacolor)) return 0; else { *color = sGetalphacolor.color; return 1; } } /*-------------------------------------------------------------------------- * Gal_select_alpha_region * * Description: This function selects the alpha region should be used for * future updates. * parameters: * region: Gives the alpha window number. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_select_alpha_region(int region) { GAL_ALPHAREGION sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETALPHAREGION; sSetVideo.region = region; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_outside_alpha * * Description: This function enable/disable the video outside alpha region. * parameters: * enable: Gives the value for enable/disable. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_outside_alpha(int enable) { GAL_VIDEOOUTSIDEALPHA sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOOUTSIDEALPHA; sSetVideo.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_video_palette * * Description: This function loads the video hardware palette. * parameters: * palette: Gives value for hardware palette. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_palette(unsigned long *palette) { GAL_VIDEOPALETTE sSetVideo; INIT_GAL(&sSetVideo); sSetVideo.dwSubfunction = GALFN_SETVIDEOPALETTE; if (palette == NULL) { sSetVideo.identity = 1; } else { sSetVideo.identity = 0; direct_memcpy(sSetVideo.palette, palette, 256 * sizeof(*palette)); } if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) return 0; else return 1; } /** Video **********************************************************/ /*-------------------------------------------------------------------------- * Gal_set_icon_enable * * Description: This function enable/disables the hardware icon. The icon * position and colors should be programmed prior to calling * this routine. * parameters: * enable: Gives value for enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_icon_enable(int enable) { GAL_ICONENABLE sSetIconenable; INIT_GAL(&sSetIconenable); sSetIconenable.dwSubfunction = GALFN_SETICONENABLE; sSetIconenable.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconenable)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_icon_colors * * Description: This function sets the three hardware icon colors. * parameters: * color0: Gives first color value. * color1: Gives second color value. * color2: Gives third color value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2) { GAL_ICONCOLORS sSetIconcolors; INIT_GAL(&sSetIconcolors); sSetIconcolors.dwSubfunction = GALFN_SETICONCOLORS; sSetIconcolors.color0 = color0; sSetIconcolors.color1 = color1; sSetIconcolors.color2 = color2; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconcolors)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_icon_position. * * Description: This function sets the hardware icon position. * parameters: * memoffset: Memory offset of the icon buffer. * xpos: Starting X co-ordinate for the hardware icon. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_icon_position(unsigned long memoffset, unsigned short xpos) { GAL_ICONPOSITION sSetIconposi; INIT_GAL(&sSetIconposi); sSetIconposi.dwSubfunction = GALFN_SETICONPOSITION; sSetIconposi.memoffset = memoffset; sSetIconposi.xpos = xpos; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconposi)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_icon_shape64. * * Description: This function initializes the icon buffer according to * the current mode. * parameters: * memoffset: Memory offset of the icon buffer. * andmask: Andmask of the icon buffer. * xormask: Xormask of the icon buffer. * lines: Lines of the icon buffer. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines) { GAL_ICONSHAPE64 sSetIconshape64; INIT_GAL(&sSetIconshape64); sSetIconshape64.dwSubfunction = GALFN_SETICONSHAPE64; sSetIconshape64.memoffset = memoffset; *(sSetIconshape64.andmask) = *andmask; *(sSetIconshape64.xormask) = *xormask; sSetIconshape64.lines = lines; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconshape64)) { return 0; } else { return 1; } } /* VIP Functions */ /*-------------------------------------------------------------------------- * Gal_set_vip_enable * * Description: This function enable/disables the writes to memory from the * video port. * position and colors should be programmed prior to calling * this routine. * parameters: * enable: Gives value for enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_enable(int enable) { GAL_VIPENABLE sSetVipenable; INIT_GAL(&sSetVipenable); sSetVipenable.dwSubfunction = GALFN_SETVIPENABLE; sSetVipenable.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipenable)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vip_enable * * Description: This function gets the enable state of the * video port. * parameters: * enable: Gives value for enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vip_enable(int *enable) { GAL_VIPENABLE sGetVipenable; INIT_GAL(&sGetVipenable); sGetVipenable.dwSubfunction = GALFN_GETVIPENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipenable)) { return 0; } else { *enable = sGetVipenable.enable; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vip_capture_run_mode * * Description: This function selects the VIP capture run mode. * * parameters: * mode: VIP capture run mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_capture_run_mode(int mode) { GAL_VIPCAPTURERUNMODE sSetVipcapturerunmode; INIT_GAL(&sSetVipcapturerunmode); sSetVipcapturerunmode.dwSubfunction = GALFN_SETVIPCAPTURERUNMODE; sSetVipcapturerunmode.mode = mode; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipcapturerunmode)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vip_base * * Description: This routine sets the odd and even base address values for * the VIP memory buffer. * parameters: * even: Even base address. * odd: odd base address. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_base(unsigned long even, unsigned long odd) { GAL_VIPBASE sSetVipBase; INIT_GAL(&sSetVipBase); sSetVipBase.dwSubfunction = GALFN_SETVIPBASE; sSetVipBase.even = even; sSetVipBase.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipBase)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vip_base * * Description: This routine gets the base address value for * the VIP memory buffer. * parameters: * address: VIP base address. * odd: odd base address. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vip_base(unsigned long *address, int odd) { GAL_VIPBASE sGetVipBase; INIT_GAL(&sGetVipBase); sGetVipBase.dwSubfunction = GALFN_GETVIPBASE; sGetVipBase.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipBase)) { return 0; } else { *address = sGetVipBase.address; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vip_pitch * * Description: This routine sets the number of bytes between scanlines * for the VIP data. * parameters: * pitch: VIP pitch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_pitch(unsigned long pitch) { GAL_VIPPITCH sSetVipPitch; INIT_GAL(&sSetVipPitch); sSetVipPitch.dwSubfunction = GALFN_SETVIPPITCH; sSetVipPitch.pitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipPitch)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vip_pitch * * Description: This routine gets the number of bytes between scanlines * for the VIP data. * parameters: * pitch: VIP pitch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vip_pitch(unsigned long *pitch) { GAL_VIPPITCH sGetVipPitch; INIT_GAL(&sGetVipPitch); sGetVipPitch.dwSubfunction = GALFN_GETVIPPITCH; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipPitch)) { return 0; } else { *pitch = sGetVipPitch.pitch; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vip_mode * * Description: This routine sets the VIP operating mode. * parameters: * mode: VIP operating mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_mode(int mode) { GAL_VIPMODE sSetVipMode; INIT_GAL(&sSetVipMode); sSetVipMode.dwSubfunction = GALFN_SETVIPMODE; sSetVipMode.mode = mode; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipMode)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vip_mode * * Description: This routine gets the VIP operating mode. * parameters: * mode: VIP operating mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vip_mode(int *mode) { GAL_VIPMODE sGetVipMode; INIT_GAL(&sGetVipMode); sGetVipMode.dwSubfunction = GALFN_GETVIPMODE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipMode)) { return 0; } else { *mode = sGetVipMode.mode; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vip_bus_request_threshold_high * * Description: This function sets the VIP FIFO bus request threshold. * * parameters: * enable: Enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_bus_request_threshold_high(int enable) { GAL_VIPBUS_RTH sSetVipBRTH; INIT_GAL(&sSetVipBRTH); sSetVipBRTH.dwSubfunction = GALFN_SETVIPBRTH; sSetVipBRTH.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipBRTH)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vip_bus_request_threshold_high * * Description: This function gets the VIP FIFO bus request threshold. * * parameters: * enable: Enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vip_bus_request_threshold_high(int *enable) { GAL_VIPBUS_RTH sGetVipBRTH; INIT_GAL(&sGetVipBRTH); sGetVipBRTH.dwSubfunction = GALFN_GETVIPBRTH; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipBRTH)) { return 0; } else { *enable = sGetVipBRTH.enable; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vip_last_line * * Description: This function sets the maximum number of lines captured * in each field. * * parameters: * last_line: Maximum number of lines captured in each field. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vip_last_line(int last_line) { GAL_VIPLASTLINE sSetViplastline; INIT_GAL(&sSetViplastline); sSetViplastline.dwSubfunction = GALFN_SETVIPLASTLINE; sSetViplastline.last_line = last_line; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetViplastline)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vip_line * * Description: This function gets the number of the current video line being * recieved by the VIP interface. * * parameters: * vip_line: Number of the current video line. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vip_line(int *vip_line) { GAL_VIPLINE sGetVipline; INIT_GAL(&sGetVipline); sGetVipline.dwSubfunction = GALFN_GETVIPLINE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipline)) { return 0; } else { *vip_line = sGetVipline.status; return 1; } } /*-------------------------------------------------------------------------- * Gal_test_vip_odd_field * * Description: This function tests the VIP odd field. * * parameters: * status: Status of the odd field. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_test_vip_odd_field(int *status) { GAL_TESTVIPODDFIELD sTestVipoddfield; INIT_GAL(&sTestVipoddfield); sTestVipoddfield.dwSubfunction = GALFN_TESTVIPODDFIELD; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTestVipoddfield)) { return 0; } else { *status = sTestVipoddfield.status; return 1; } } /*-------------------------------------------------------------------------- * Gal_test_vip_bases_updated * * Description: This function tests the VIP bases updated. * * parameters: * status: Status of the VIP bases updated. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_test_vip_bases_updated(int *status) { GAL_TESTVIPBASESUPDATED sTestVipbasesupdated; INIT_GAL(&sTestVipbasesupdated); sTestVipbasesupdated.dwSubfunction = GALFN_TESTVIPBASESUPDATED; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTestVipbasesupdated)) { return 0; } else { *status = sTestVipbasesupdated.status; return 1; } } /*-------------------------------------------------------------------------- * Gal_test_vip_fifo_overflow * * Description: This function tests the VIP FIFO overflow. * * parameters: * status: Status of the VIP FIFO overflow. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_test_vip_fifo_overflow(int *status) { GAL_TESTVIPOVERFLOW sTestVipoverflow; INIT_GAL(&sTestVipoverflow); sTestVipoverflow.dwSubfunction = GALFN_TESTVIPFIFOOVERFLOW; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTestVipoverflow)) { return 0; } else { *status = sTestVipoverflow.status; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_enable * * Description: This function enable/disables the VBI data capture. * * parameters: * enable: VBI enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_enable(int enable) { GAL_VBIENABLE sSetVbienable; INIT_GAL(&sSetVbienable); sSetVbienable.dwSubfunction = GALFN_SETVBIENABLE; sSetVbienable.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbienable)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_enable * * Description: This function gets the enable state of the VBI data capture. * * parameters: * enable: VBI enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_enable(int *enable) { GAL_VBIENABLE sGetVbienable; INIT_GAL(&sGetVbienable); sGetVbienable.dwSubfunction = GALFN_GETVBIENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbienable)) { return 0; } else { *enable = sGetVbienable.enable; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_base * * Description: This function sets the VBI base addresses. * * parameters: * even: Even base address. * odd: Odd base address. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_base(unsigned long even, unsigned long odd) { GAL_VBIBASE sSetVbiBase; INIT_GAL(&sSetVbiBase); sSetVbiBase.dwSubfunction = GALFN_SETVBIBASE; sSetVbiBase.even = even; sSetVbiBase.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiBase)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_base * * Description: This function gets the VBI base address. * * parameters: * address: VBI base address. * odd: Odd base address. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_base(unsigned long *address, int odd) { GAL_VBIBASE sGetVbiBase; INIT_GAL(&sGetVbiBase); sGetVbiBase.dwSubfunction = GALFN_GETVBIBASE; sGetVbiBase.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiBase)) { return 0; } else { *address = sGetVbiBase.address; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_pitch * * Description: This function sets the number of bytes between scanlines for * VBI capture. * * parameters: * pitch: VBI pitch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_pitch(unsigned long pitch) { GAL_VBIPITCH sSetVbiPitch; INIT_GAL(&sSetVbiPitch); sSetVbiPitch.dwSubfunction = GALFN_SETVBIPITCH; sSetVbiPitch.pitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiPitch)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_pitch * * Description: This function gets the number of bytes between scanlines for * VBI capture. * * parameters: * pitch: VBI pitch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_pitch(unsigned long *pitch) { GAL_VBIPITCH sGetVbiPitch; INIT_GAL(&sGetVbiPitch); sGetVbiPitch.dwSubfunction = GALFN_GETVBIPITCH; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiPitch)) { return 0; } else { *pitch = sGetVbiPitch.pitch; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_mode * * Description: This function sets the VBI data types captured to memory. * * parameters: * mode: VBI mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_mode(int mode) { GAL_VBIMODE sSetVbiMode; INIT_GAL(&sSetVbiMode); sSetVbiMode.dwSubfunction = GALFN_SETVBIMODE; sSetVbiMode.mode = mode; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiMode)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_mode * * Description: This function gets the VBI data types captured to memory. * * parameters: * mode: VBI mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_mode(int *mode) { GAL_VBIMODE sGetVbiMode; INIT_GAL(&sGetVbiMode); sGetVbiMode.dwSubfunction = GALFN_GETVBIMODE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiMode)) { return 0; } else { *mode = sGetVbiMode.mode; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_direct * * Description: This function sets the VBI lines to be passed to the * Direct VIP. * * parameters: * even_lines: VBI even lines. * odd_lines: VBI odd lines. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines) { GAL_SETVBIDIRECT sSetVbidirect; INIT_GAL(&sSetVbidirect); sSetVbidirect.dwSubfunction = GALFN_SETVBIDIRECT; sSetVbidirect.even_lines = even_lines; sSetVbidirect.odd_lines = odd_lines; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbidirect)) { return 0; } else { return 1; } } BOOLEAN Gal2_set_destination_stride(unsigned short stride) { GAL_STRIDE sSetStride; INIT_GAL(&sSetStride); sSetStride.dwSubfunction = GALFN_SETDESTINATIONSTRIDE; sSetStride.stride = stride; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetStride)) return 0; else return 1; } BOOLEAN Gal2_set_pattern_origin(int x, int y) { GAL_PATTERNORIGIN sSetPatOrigin; INIT_GAL(&sSetPatOrigin); sSetPatOrigin.dwSubfunction = GALFN_SETPATTERNORIGIN; sSetPatOrigin.x = x; sSetPatOrigin.y = y; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetPatOrigin)) return 0; else return 1; } /*-------------------------------------------------------------------------- * Gal_set_vbi_direct * * Description: This function gets the VBI lines to be passed to the * Direct VIP. * * parameters: * odd: VBI odd lines. * direct_lines: VBI direct lines. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_direct(int odd, unsigned long *direct_lines) { GAL_GETVBIDIRECT sGetVbidirect; INIT_GAL(&sGetVbidirect); sGetVbidirect.dwSubfunction = GALFN_GETVBIDIRECT; sGetVbidirect.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbidirect)) { return 0; } else { *direct_lines = sGetVbidirect.direct_lines; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_interrupt * * Description: This function enable/disables the VBI field interrupt. * * parameters: * enable: Value to enable/disable VBI interrupt. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_interrupt(int enable) { GAL_VBIINTERRUPT sSetVbiinterrupt; INIT_GAL(&sSetVbiinterrupt); sSetVbiinterrupt.dwSubfunction = GALFN_SETVBIINTERRUPT; sSetVbiinterrupt.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiinterrupt)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_interrupt * * Description: This function gets the VBI field interrupt. * * parameters: * enable: Value of enable/disable VBI interrupt. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_interrupt(int *enable) { GAL_VBIINTERRUPT sGetVbiinterrupt; INIT_GAL(&sGetVbiinterrupt); sGetVbiinterrupt.dwSubfunction = GALFN_GETVBIINTERRUPT; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiinterrupt)) { return 0; } else { *enable = sGetVbiinterrupt.enable; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_source_stride * * Description: This function sets the stride to be used in successive screen * to screen BLTs. * * parameters: * enable: Value of enable/disable VBI interrupt. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_set_source_stride(unsigned short stride) { GAL_STRIDE sSetsourcestride; INIT_GAL(&sSetsourcestride); sSetsourcestride.dwSubfunction = GALFN_SETSOURCESTRIDE; sSetsourcestride.stride = stride; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetsourcestride)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_source_transparency * * Description: This function sets the source transparency color and * mask to be used in future rendering routines. * to screen BLTs. * * parameters: * color: Source color. * mask: Source mask. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_set_source_transparency(unsigned long color, unsigned long mask) { GAL_SOURCETRANSPARENCY sSetsourcetransparency; INIT_GAL(&sSetsourcetransparency); sSetsourcetransparency.dwSubfunction = GALFN_SETSOURCETRANSPARENCY; sSetsourcetransparency.color = color; sSetsourcetransparency.mask = mask; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetsourcetransparency)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_alpha_mode * * Description: This function sets the alpha blending mode. * parameters: * mode: Alpha blending mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_set_alpha_mode(int mode) { GAL_GFX2ALPHAMODE sSetalphamode; INIT_GAL(&sSetalphamode); sSetalphamode.dwSubfunction = GALFN_GFX2SETALPHAMODE; sSetalphamode.mode = mode; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetalphamode)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_gfx2_set_alpha_value * * Description: This function sets the alpha value to be used with certain * alpha blending modes. * parameters: * value: Alpha blending value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_set_alpha_value(unsigned char value) { GAL_GFX2ALPHAVALUE sSetalphavalue; INIT_GAL(&sSetalphavalue); sSetalphavalue.dwSubfunction = GALFN_GFX2SETALPHAVALUE; sSetalphavalue.value = value; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetalphavalue)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal2_pattern_fill * * Description: This function used to fill the pattern of GX2. * It allows the arbitary destination stride. The rendering * position is also specified as an offset instead of (x,y) * position. * parameters: * dstoffset: Rendering offset. * width: Width of the pattern. * height: Height of the pattern. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height) { GAL_GFX2PATTERNFILL sPatternfill; INIT_GAL(&sPatternfill); sPatternfill.dwSubfunction = GALFN_GFX2PATTERNFILL; sPatternfill.dstoffset = dstoffset; sPatternfill.width = width; sPatternfill.height = height; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPatternfill)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_gfx2_screen_to_screen_blt * * Description: This function used for screen to screen BLTs of GX2. * It allows the arbitary source and destination strides and * alpha blending. * parameters: * srcoffset: Source Rendering offset. * dstoffset: Destination Rendering offset. * width: Width of the screen. * height: Height of the screen. * flags: Flags of the screen to screen BLT. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags) { GAL_GFX2SCREENTOSCREENBLT sScreentoScreenblt; INIT_GAL(&sScreentoScreenblt); sScreentoScreenblt.dwSubfunction = GALFN_GFX2SCREENTOSCREENBLT; sScreentoScreenblt.srcoffset = srcoffset; sScreentoScreenblt.dstoffset = dstoffset; sScreentoScreenblt.width = width; sScreentoScreenblt.height = height; sScreentoScreenblt.flags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sScreentoScreenblt)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal2_mono_expand_blt * * Description: This function used to expand monochrome data stored in * graphics memory for screen to screen BLTs. * parameters: * srcbase: Source Rendering base address. * srcx: Source X offset. * srcy: Source Y offset. * dstoffset: Destination Rendering offset. * width: Width of the screen. * height: Height of the screen. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed) { GAL_GFX2MONOEXPANDBLT sMonoexpandblt; INIT_GAL(&sMonoexpandblt); sMonoexpandblt.dwSubfunction = GALFN_GFX2MONOEXPANDBLT; sMonoexpandblt.srcbase = srcbase; sMonoexpandblt.srcx = srcx; sMonoexpandblt.srcy = srcy; sMonoexpandblt.dstoffset = dstoffset; sMonoexpandblt.width = width; sMonoexpandblt.height = height; sMonoexpandblt.byte_packed = byte_packed; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sMonoexpandblt)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal2_color_bitmap_to_screen_blt * * Description: This function used for color bmp to screen BLTs. * parameters: * srcx: Source X offset. * srcy: Source Y offset. * dstoffset: Destination Rendering offset. * width: Width of the screen. * height: Height of the screen. * *data: Color bmp data. * pitch: Pitch of the dispaly mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, unsigned short pitch) { GAL_GFX2COLORBMPTOSCRBLT sColorbmptoscrblt; INIT_GAL(&sColorbmptoscrblt); sColorbmptoscrblt.dwSubfunction = GALFN_GFX2COLORBMPTOSCRBLT; sColorbmptoscrblt.srcx = srcx; sColorbmptoscrblt.srcy = srcy; sColorbmptoscrblt.dstoffset = dstoffset; sColorbmptoscrblt.width = width; sColorbmptoscrblt.height = height; sColorbmptoscrblt.data = *data; sColorbmptoscrblt.pitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sColorbmptoscrblt)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal2_mono_bitmap_to_screen_blt * * Description: This function used for mono bmp to screen BLTs. * parameters: * srcx: Source X offset. * srcy: Source Y offset. * dstoffset: Destination Rendering offset. * width: Width of the screen. * height: Height of the screen. * *data: mono bmp data. * pitch: Pitch of the display mode. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, unsigned short pitch) { GAL_GFX2MONOBMPTOSCRBLT sMonobmptoscrblt; INIT_GAL(&sMonobmptoscrblt); sMonobmptoscrblt.dwSubfunction = GALFN_GFX2MONOBMPTOSCRBLT; sMonobmptoscrblt.srcx = srcx; sMonobmptoscrblt.srcy = srcy; sMonobmptoscrblt.dstoffset = dstoffset; sMonobmptoscrblt.width = width; sMonobmptoscrblt.height = height; sMonobmptoscrblt.data = *data; sMonobmptoscrblt.pitch = pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sMonobmptoscrblt)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal2_bresenham_line * * Description: This function used to draw bresenham line. It allows the * arbitary destination stride. * parameters: * dstoffset: Destination offset. * length: Length of the line. * initerr: Intial error. * axialerr: * diagerr: * flags: * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) { GAL_GFX2BRESENHAMLINE sBresenhamline; INIT_GAL(&sBresenhamline); sBresenhamline.dwSubfunction = GALFN_GFX2BRESENHAMLINE; sBresenhamline.dstoffset = dstoffset; sBresenhamline.length = length; sBresenhamline.initerr = initerr; sBresenhamline.axialerr = axialerr; sBresenhamline.diagerr = diagerr; sBresenhamline.flags = flags; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBresenhamline)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal2_sync_to_vblank * * Description: This function sets the a flag to synchronize the next * rendering routine to VBLANK. * parameters: none. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal2_sync_to_vblank(void) { GAL_GFX2SYNCTOVBLANK sSynctovblank; INIT_GAL(&sSynctovblank); sSynctovblank.dwSubfunction = GALFN_GFX2SYNCTOVBLANK; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSynctovblank)) { return 0; } else { return 1; } } /* Video routines */ /*-------------------------------------------------------------------------- * Gal_set_video_yuv_pitch * * Description: This function sets the Video YUV pitch. * * parameters: * y_pitch: Y pitch. * uv_pitch: UV pitch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_yuv_pitch(unsigned long y_pitch, unsigned long uv_pitch) { GAL_VIDEOYUVPITCH sSetVideoyuvpitch; INIT_GAL(&sSetVideoyuvpitch); sSetVideoyuvpitch.dwSubfunction = GALFN_SETVIDEOYUVPITCH; sSetVideoyuvpitch.y_pitch = y_pitch; sSetVideoyuvpitch.uv_pitch = uv_pitch; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoyuvpitch)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_video_yuv_pitch * * Description: This function gets the Video YUV pitch. * * parameters: * y_pitch: Y pitch. * uv_pitch: UV pitch. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_video_yuv_pitch(unsigned long *y_pitch, unsigned long *uv_pitch) { GAL_VIDEOYUVPITCH sGetVideoyuvpitch; INIT_GAL(&sGetVideoyuvpitch); sGetVideoyuvpitch.dwSubfunction = GALFN_GETVIDEOYUVPITCH; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVideoyuvpitch)) { return 0; } else { *y_pitch = sGetVideoyuvpitch.y_pitch; *uv_pitch = sGetVideoyuvpitch.uv_pitch; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_video_yuv_offsets * * Description: This function sets the Video YUV offsets. * * parameters: * y_offset: Y offset. * u_offset: U offset. * v_offset: V offset. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_yuv_offsets(unsigned long y_offset, unsigned long u_offset, unsigned long v_offset) { GAL_VIDEOYUVOFFSETS sSetVideoyuvoffsets; INIT_GAL(&sSetVideoyuvoffsets); sSetVideoyuvoffsets.dwSubfunction = GALFN_SETVIDEOYUVOFFSETS; sSetVideoyuvoffsets.dwYoffset = y_offset; sSetVideoyuvoffsets.dwUoffset = u_offset; sSetVideoyuvoffsets.dwVoffset = v_offset; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoyuvoffsets)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_video_yuv_offsets * * Description: This function gets the Video YUV offsets. * * parameters: * y_offset: Y offset. * u_offset: U offset. * v_offset: V offset. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_video_yuv_offsets(unsigned long *y_offset, unsigned long *u_offset, unsigned long *v_offset) { GAL_VIDEOYUVOFFSETS sGetVideoyuvoffsets; INIT_GAL(&sGetVideoyuvoffsets); sGetVideoyuvoffsets.dwSubfunction = GALFN_GETVIDEOYUVOFFSETS; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVideoyuvoffsets)) { return 0; } else { *y_offset = sGetVideoyuvoffsets.dwYoffset; *u_offset = sGetVideoyuvoffsets.dwUoffset; *v_offset = sGetVideoyuvoffsets.dwVoffset; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_video_left_crop * * Description: This function sets the number of pixels which will be cropped * from the beginning of each video line. * * parameters: * x: * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_left_crop(unsigned short x) { GAL_VIDEOLEFTCROP sSetVideoleftcrop;; INIT_GAL(&sSetVideoleftcrop); sSetVideoleftcrop.dwSubfunction = GALFN_SETVIDEOLEFTCROP; sSetVideoleftcrop.x = x; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoleftcrop)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_video_vertical_downscale * * Description: This function sets the vertical downscale factor for the video * overlay window. * * parameters: * srch: Height of the source. * dsth: Height of the destination. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_video_vertical_downscale(unsigned short srch, unsigned short dsth) { GAL_VIDEOVERTICALDOWNSCALE sSetVideoverticaldownscale; INIT_GAL(&sSetVideoverticaldownscale); sSetVideoverticaldownscale.dwSubfunction = GALFN_SETVIDEOVERTICALDOWNSCALE; sSetVideoverticaldownscale.srch = srch; sSetVideoverticaldownscale.dsth = dsth; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoverticaldownscale)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_source * * Description: This function sets the VBI source. * * parameters: * source: VBI Source type. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_source(VbiSourceType source) { GAL_VBISOURCE sSetVbisource; INIT_GAL(&sSetVbisource); sSetVbisource.dwSubfunction = GALFN_SETVBISOURCE; sSetVbisource.source = source; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbisource)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_source * * Description: This function gets the VBI source. * * parameters: * source: VBI Source type. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_source(VbiSourceType * source) { GAL_VBISOURCE sGetVbisource; INIT_GAL(&sGetVbisource); sGetVbisource.dwSubfunction = GALFN_GETVBISOURCE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbisource)) { return 0; } else { *source = sGetVbisource.source; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_lines * * Description: This function sets the VBI lines. * * parameters: * even: VBI even lines. * odd: VBI odd lines. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_lines(unsigned long even, unsigned long odd) { GAL_VBILINES sSetVbilines; INIT_GAL(&sSetVbilines); sSetVbilines.dwSubfunction = GALFN_SETVBILINES; sSetVbilines.even = even; sSetVbilines.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbilines)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vbi_lines * * Description: This function gets the VBI lines. * * parameters: * lines: VBI lines. * odd: VBI odd lines. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_lines(int odd, unsigned long *lines) { GAL_VBILINES sGetVbilines; INIT_GAL(&sGetVbilines); sGetVbilines.dwSubfunction = GALFN_GETVBILINES; sGetVbilines.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbilines)) { return 0; } else { *lines = sGetVbilines.lines; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_total * * Description: This function sets the total number of VBI bytes for each * field. * * parameters: * even: * odd: * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vbi_total(unsigned long even, unsigned long odd) { GAL_VBITOTAL sSetVbitotal; INIT_GAL(&sSetVbitotal); sSetVbitotal.dwSubfunction = GALFN_SETVBITOTAL; sSetVbitotal.even = even; sSetVbitotal.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbitotal)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vbi_total * * Description: This function gets the total number of VBI bytes in the * field. * * parameters: * even: * odd: * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vbi_total(int odd, unsigned long *total) { GAL_VBITOTAL sGetVbitotal; INIT_GAL(&sGetVbitotal); sGetVbitotal.dwSubfunction = GALFN_GETVBITOTAL; sGetVbitotal.odd = odd; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbitotal)) { return 0; } else { *total = sGetVbitotal.total; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_vertical_scaler_offset * * Description: This function sets the Video vertical scaler offset. * * parameters: * offset: Vertical Scaler offset. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_vertical_scaler_offset(char offset) { GAL_VSCALEROFFSET sSetVscaleroffset; INIT_GAL(&sSetVscaleroffset); sSetVscaleroffset.dwSubfunction = GALFN_SETVSCALEROFFSET; sSetVscaleroffset.offset = offset; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVscaleroffset)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_vertical_scaler_offset * * Description: This function gets the Video vertical scaler offset. * * parameters: * offset: Vertical Scaler offset. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_vertical_scaler_offset(char *offset) { GAL_VSCALEROFFSET sGetVscaleroffset; INIT_GAL(&sGetVscaleroffset); sGetVscaleroffset.dwSubfunction = GALFN_GETVSCALEROFFSET; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVscaleroffset)) { return 0; } else { *offset = sGetVscaleroffset.offset; return 1; } } /*-------------------------------------------------------------------------- * Gal_get_video_interlaced * * Description: This function gets the video interlaced mode. * parameters: * interlaced: ptr to the interlaced status. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_video_interlaced(int *interlaced) { GAL_GETVIDEOINTERLACED sGetvideointerlaced; INIT_GAL(&sGetvideointerlaced); sGetvideointerlaced.dwSubfunction = GALFN_GETVIDEOINTERLACED; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetvideointerlaced)) { return 0; } else { *interlaced = sGetvideointerlaced.interlaced; return 1; } } /*-------------------------------------------------------------------------- * Gal_get_color_space_YUV * * Description: This function gets the video color space YUV. * parameters: * colorspace: ptr to the color space. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_color_space_YUV(int *colorspace) { GAL_COLORSPACEYUV sGetcolorspaceyuv; INIT_GAL(&sGetcolorspaceyuv); sGetcolorspaceyuv.dwSubfunction = GALFN_GETCOLORSPACEYUV; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetcolorspaceyuv)) { return 0; } else { *colorspace = sGetcolorspaceyuv.colorspace; return 1; } } /*-------------------------------------------------------------------------- * Gal_get_genlock_enable * * Description: This function gets the enable state of the genlock. * parameters: * enable: ptr to the enable state of the genlock. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_genlock_enable(int *enable) { GAL_GENLOCKENABLE sGetgenlockenable; INIT_GAL(&sGetgenlockenable); sGetgenlockenable.dwSubfunction = GALFN_GETGENLOCKENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetgenlockenable)) { return 0; } else { *enable = sGetgenlockenable.enable; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_genlock_enable * * Description: This function enable/disables and configure the genlock * according to the parameters. * parameters: * enable: enable state of the genlock. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_genlock_enable(int enable) { GAL_GENLOCKENABLE sSetgenlockenable; INIT_GAL(&sSetgenlockenable); sSetgenlockenable.dwSubfunction = GALFN_SETGENLOCKENABLE; sSetgenlockenable.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetgenlockenable)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_genlock_delay * * Description: This function gets the genlock delay. * parameters: * delay: Ptr to the genlock delay. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_genlock_delay(unsigned long *delay) { GAL_GENLOCKDELAY sGetgenlockdelay; INIT_GAL(&sGetgenlockdelay); sGetgenlockdelay.dwSubfunction = GALFN_GETGENLOCKDELAY; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetgenlockdelay)) { return 0; } else { *delay = sGetgenlockdelay.delay; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_genlock_delay * * Description: This function sets the genlock delay. * parameters: * delay: genlock delay. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_genlock_delay(unsigned long delay) { GAL_GENLOCKDELAY sSetgenlockdelay; INIT_GAL(&sSetgenlockdelay); sSetgenlockdelay.dwSubfunction = GALFN_SETGENLOCKDELAY; sSetgenlockdelay.delay = delay; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetgenlockdelay)) { return 0; } else { return 1; } } BOOLEAN Gal_set_top_line_in_odd(int enable) { GAL_TOPLINEINODD sSettoplineinodd; INIT_GAL(&sSettoplineinodd); sSettoplineinodd.dwSubfunction = GALFN_SETTOPLINEINODD; sSettoplineinodd.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSettoplineinodd)) { return 0; } else { return 1; } } /*-------------------------------------------------------------------------- * Gal_get_video_cursor. * * Description: This function gets configuration of the Video Hardware * cursor. * parameters: * key: color key. * mask: color mask. *select_color2: selected for color2. * color1: color1 value. * color2: color2 value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned long *color2) { GAL_VIDEOCURSOR sGetvideocursor; INIT_GAL(&sGetvideocursor); sGetvideocursor.dwSubfunction = GALFN_GETVIDEOCURSOR; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetvideocursor)) { return 0; } else { *key = sGetvideocursor.key; *mask = sGetvideocursor.mask; *select_color2 = sGetvideocursor.select_color2; *color1 = sGetvideocursor.color1; *color2 = sGetvideocursor.color2; return 1; } } /*-------------------------------------------------------------------------- * Gal_read_crc. * * Description: This function reads the hardware CRC value, which is used for * automated testing. * parameters: * crc: Holds the crc value. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_read_crc(unsigned long *crc) { GAL_READCRC sReadcrc; INIT_GAL(&sReadcrc); sReadcrc.dwSubfunction = GALFN_READCRC; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sReadcrc)) { return 0; } else { *crc = sReadcrc.crc; return 1; } } /*-------------------------------------------------------------------------- * Gal_read_window_crc. * * Description: This function reads the hardware CRC value for a subsection * of the display. * * parameters: * source: * x: * y: * width: * height: * crc: * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32, unsigned long *crc) { GAL_READWINDOWCRC sReadwindowcrc; INIT_GAL(&sReadwindowcrc); sReadwindowcrc.dwSubfunction = GALFN_READWINDOWCRC; sReadwindowcrc.source = source; sReadwindowcrc.x = x; sReadwindowcrc.y = y; sReadwindowcrc.width = width; sReadwindowcrc.height = height; sReadwindowcrc.crc32 = crc32; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sReadwindowcrc)) { return 0; } else { *crc = sReadwindowcrc.crc; return 1; } } /*-------------------------------------------------------------------------- * Gal_get_macrovision_enable. * * Description: This function gets the enable state of the macrovision. * * parameters: * enable: ptr holds the macrovision enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_get_macrovision_enable(int *enable) { GAL_MACROVISIONENABLE sGetmacrovisionenable; INIT_GAL(&sGetmacrovisionenable); sGetmacrovisionenable.dwSubfunction = GALFN_GETMACROVISIONENABLE; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetmacrovisionenable)) { return 0; } else { *enable = sGetmacrovisionenable.enable; return 1; } } /*-------------------------------------------------------------------------- * Gal_set_macrovision_enable. * * Description: This function gets the enable state of the macrovision. * * parameters: * enable: macrovision enable state. * return: '1' was returned on success otherwise '0' was returned. *------------------------------------------------------------------------*/ BOOLEAN Gal_set_macrovision_enable(int enable) { GAL_MACROVISIONENABLE sSetmacrovisionenable; INIT_GAL(&sSetmacrovisionenable); sSetmacrovisionenable.dwSubfunction = GALFN_SETMACROVISIONENABLE; sSetmacrovisionenable.enable = enable; if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetmacrovisionenable)) { return 0; } else { return 1; } } DirectFB-1.2.10/gfxdrivers/nsc/nsc.c0000644000175000017500000004451111164361026014040 00000000000000/* * $Workfile: $ * $Revision: 1.16 $ * * File Contents: This file contains the main functions of the NSC DFB. * * Project: NSC Direct Frame buffer device driver * */ /* NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * National Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * National Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * National Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "nsc_galproto.h" #define NSC_ACCEL 1 #define GP_VECTOR_DEST_DATA 0x8 #define GP_VECTOR_MINOR_AXIS_POS 0x4 #define GP_VECTOR_MAJOR_AXIS_POS 0x2 #define GP_VECTOR_Y_MAJOR 0x1 #define GFX_CPU_REDCLOUD 3 #define GX_SUPPORTED_DRAWINGFLAGS DSDRAW_NOFX #define GX_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | \ DFXL_DRAWRECTANGLE | \ DFXL_DRAWLINE) #define GX_SUPPORTED_BLITTINGFUNCTIONS DFXL_BLIT #define GX_SUPPORTED_BLITTINGFLAGS DSBLIT_SRC_COLORKEY DFB_GRAPHICS_DRIVER(nsc) typedef struct { unsigned long Color; unsigned long src_offset; unsigned long dst_offset; unsigned long src_pitch; unsigned long dst_pitch; unsigned long src_colorkey; int v_srcColorkey; }NSCDeviceData; typedef struct { unsigned int cpu_version; int cpu; }NSCDriverData; static GAL_ADAPTERINFO sAdapterInfo; static bool nscDrawLine(void *drv, void *dev, DFBRegion *line); static bool nscFillRectangle(void *drv, void *dev, DFBRectangle *rect); static bool nscDrawRectangle(void *drv, void *dev, DFBRectangle *rect); static bool nscBlit(void *drv, void *dev, DFBRectangle *rect, int dx, int dy); static bool nscBlitGu1(void *drv, void *dev, DFBRectangle *rect, int dx, int dy); static DFBResult gxEngineSync(void *drv, void *dev) { Gal_wait_until_idle(); return DFB_OK; } static inline void nsc_validate_srcColorkey(NSCDriverData *gxdrv, NSCDeviceData *gxdev, CardState *state) { if (gxdev->v_srcColorkey) return; gxdev->src_colorkey = state->src_colorkey; gxdev->v_srcColorkey = 1; } static void gxCheckState(void *drv, void *dev, CardState *state, DFBAccelerationMask accel) { #if NSC_ACCEL NSCDriverData *gxdrv = (NSCDriverData *) drv; NSCDeviceData *gxdev = (NSCDeviceData *) dev; if(state->destination->config.format != DSPF_RGB16) return; if (DFB_BLITTING_FUNCTION(accel)) { if(state->source->config.format != DSPF_RGB16) return; if (gxdrv->cpu) { /* GU2 - if there are no other blitting flags than the supported * and the source and destination formats are the same */ if (!(state->blittingflags & ~GX_SUPPORTED_BLITTINGFLAGS) && state->source && state->source->config.format != DSPF_RGB24) { state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; } } else{ /* GU1 - source width must match frame buffer strid */ if(state->source) { int src_pitch = 0; int dst_pitch = 0; if(state->source) { src_pitch = state->source->config.size.w * DFB_BYTES_PER_PIXEL(state->source->config.format); } if (state->modified & SMF_DESTINATION) { if(state->destination && state->dst.buffer) dst_pitch = state->dst.pitch; } if(dst_pitch == 0) { dst_pitch = gxdev->dst_pitch; } if(src_pitch == dst_pitch && state->source) { state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; } } } } else { /* if there are no other drawing flags than the supported */ if (!(state->drawingflags & ~GX_SUPPORTED_DRAWINGFLAGS)) { state->accel |= GX_SUPPORTED_DRAWINGFUNCTIONS; } } #endif /* NSC_ACCEL */ } static void gxSetState(void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel) { NSCDriverData *gxdrv = (NSCDriverData *) drv; NSCDeviceData *gxdev = (NSCDeviceData *) dev; if (state->mod_hw & SMF_SRC_COLORKEY) gxdev->v_srcColorkey = 0; switch (accel) { case DFXL_BLIT: state->set |= DFXL_BLIT; if (state->blittingflags & DSBLIT_SRC_COLORKEY) nsc_validate_srcColorkey(gxdrv, gxdev, state); break; case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWLINE | DFXL_DRAWRECTANGLE; break; default: D_BUG("unexpected drawing/blitting function"); break; } if (state->mod_hw & SMF_DESTINATION) { /* set offset & pitch */ gxdev->dst_offset = state->dst.offset; gxdev->dst_pitch = state->dst.pitch; } if (state->mod_hw & SMF_SOURCE && state->source) { gxdev->src_offset = state->src.offset; gxdev->src_pitch = state->src.pitch; } if (state->mod_hw & (SMF_DESTINATION | SMF_COLOR)) { switch (state->destination->config.format) { case DSPF_A8: gxdev->Color = state->color.a; break; case DSPF_ARGB1555: gxdev->Color = PIXEL_ARGB1555(state->color.a, state->color.r, state->color.g, state->color.b); break; case DSPF_RGB16: gxdev->Color = PIXEL_RGB16(state->color.r, state->color.g, state->color.b); break; default: D_BUG("unexpected pixelformat"); break; } } state->mod_hw = 0; } static bool nscDrawLine(void *drv, void *dev, DFBRegion *line) { long dx, dy, adx, ady; short majorErr; unsigned short destData; NSCDeviceData *gxdev = (NSCDeviceData *) dev; int yoffset; destData = 0; /* Value will be 0x8 (or) 0 */ dx = line->x2 - line->x1; /* delta values */ dy = line->y2 - line->y1; adx = ABS(dx); ady = ABS(dy); yoffset = gxdev->dst_offset / gxdev->dst_pitch; /* Canonical Bresenham stepper. * * We use hardware to draw the pixels to take care of alu modes * * and whatnot. */ Gal_set_raster_operation(0xF0); Gal_set_solid_pattern(gxdev->Color); if (adx >= ady) { unsigned short vectorMode; vectorMode = destData; if (dy >= 0) vectorMode |= GP_VECTOR_MINOR_AXIS_POS; if (dx >= 0) vectorMode |= GP_VECTOR_MAJOR_AXIS_POS; majorErr = (short)(ady << 1); Gal_bresenham_line((short)line->x1, (short)line->y1 + yoffset, (short)adx, (short)(majorErr - adx), (short)majorErr, (short)(majorErr - (adx << 1)), vectorMode); } else { unsigned short vectorMode; vectorMode = destData | GP_VECTOR_Y_MAJOR; if (dx >= 0) vectorMode |= GP_VECTOR_MINOR_AXIS_POS; if (dy >= 0) vectorMode |= GP_VECTOR_MAJOR_AXIS_POS; majorErr = (short)(adx << 1); Gal_bresenham_line((short)line->x1, (short)line->y1 + yoffset, (short)ady, (short)(majorErr - ady), (short)majorErr, (short)(majorErr - (ady << 1)), vectorMode); } return true; } static bool nscFillRectangle(void *drv, void *dev, DFBRectangle *rect) { NSCDeviceData *gxdev = (NSCDeviceData *) dev; int yoffset; Gal_set_raster_operation(0xF0); Gal_set_solid_pattern(gxdev->Color); yoffset = gxdev->dst_offset / gxdev->dst_pitch; Gal_pattern_fill(rect->x, rect->y + yoffset, rect->w, rect->h); return true; } static bool nscDrawRectangle(void *drv, void *dev, DFBRectangle *rect) { NSCDeviceData *gxdev = (NSCDeviceData *) dev; int yoffset; Gal_set_raster_operation(0xF0); Gal_set_solid_pattern(gxdev->Color); yoffset = gxdev->dst_offset / gxdev->dst_pitch; Gal_pattern_fill(rect->x, rect->y + yoffset, rect->w, 1); Gal_pattern_fill(rect->x, ((rect->y + yoffset + rect->h) - 1), rect->w, 1); Gal_pattern_fill(rect->x, (rect->y + yoffset + 1), 1, (rect->h - 2)); Gal_pattern_fill(((rect->x + rect->w) - 1), (rect->y + yoffset + 1), 1, (rect->h - 2)); return true; } static bool nscBlit(void *drv, void *dev, DFBRectangle * rect, int dx, int dy) { NSCDeviceData *nscdev = (NSCDeviceData *) dev; unsigned long soffset = (rect->x * nscdev->src_pitch) + (rect->y * 2); unsigned long doffset = (dy * nscdev->dst_pitch) + (dx * 2); Gal_set_solid_pattern(nscdev->Color); if (nscdev->v_srcColorkey) { Gal2_set_source_transparency(nscdev->src_colorkey, 0xFFFF); } Gal_set_raster_operation(0xCC); Gal2_set_source_stride((unsigned short)nscdev->src_pitch); Gal2_set_destination_stride(nscdev->dst_pitch); Gal2_screen_to_screen_blt(nscdev->src_offset + soffset, nscdev->dst_offset + doffset, (unsigned short)rect->w, (unsigned short)rect->h, 1); return true; } static bool nscBlitGu1(void *drv, void *dev, DFBRectangle * rect, int dx, int dy) { int result, yoff; NSCDeviceData *nscdev = (NSCDeviceData *) dev; Gal_set_solid_pattern(nscdev->Color); if (nscdev->v_srcColorkey) { //FIXME Gal_set_source_transparency(nscdev->src_colorkey, 0xFFFF); } #if 0 printf("rect x %d y %d w %d h %d dx %d dy %d src_off %x dst_off %x src pitch %x dst pitch %x\n", rect->x, rect->y, rect->w, rect->h, dx, dy, nscdev->src_offset, nscdev->dst_offset, nscdev->src_pitch, nscdev->dst_pitch); #endif Gal_set_raster_operation(0xCC); yoff = nscdev->src_offset / nscdev->src_pitch; result = Gal_screen_to_screen_blt(rect->x, rect->y + yoff, dx, dy, (unsigned short)rect->w, (unsigned short)rect->h); return true; } /* exported symbols */ static int driver_probe(CoreGraphicsDevice *device) { Gal_initialize_interface(); if(!Gal_get_adapter_info(&sAdapterInfo)) return 0; return sAdapterInfo.dwFrameBufferBase == dfb_gfxcard_memory_physical( device, 0 ); } static void driver_get_info(CoreGraphicsDevice *device, GraphicsDriverInfo *info) { /* fill driver info structure */ snprintf(info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "NSC GX1 and GX2 Driver"); snprintf(info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "NSC"); info->version.major = 1; info->version.minor = 1; info->driver_data_size = sizeof(NSCDriverData); info->device_data_size = sizeof(NSCDeviceData); } static DFBResult driver_init_driver(CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core) { NSCDriverData *gxdrv = (NSCDriverData *) driver_data; Gal_set_compression_enable(0); gxdrv->cpu_version = sAdapterInfo.dwCPUVersion; gxdrv->cpu = 0; if ((gxdrv->cpu_version & 0xFF) == GFX_CPU_REDCLOUD) { gxdrv->cpu = 1; } D_DEBUG("CPU is GX%d", gxdrv->cpu); #if NSC_ACCEL funcs->CheckState = gxCheckState; funcs->SetState = gxSetState; funcs->EngineSync = gxEngineSync; funcs->FillRectangle = nscFillRectangle; funcs->DrawLine = nscDrawLine; funcs->DrawRectangle = nscDrawRectangle; funcs->DrawLine = nscDrawLine; if (gxdrv->cpu) { funcs->Blit = nscBlit; } else { funcs->Blit = nscBlitGu1; } #endif /* NSC_ACCEL */ /*dfb_config->pollvsync_after = 1;*/ return DFB_OK; } static DFBResult driver_init_device(CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data) { snprintf(device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "NSC GX1/GX2 driver version"); snprintf(device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "nsc"); printf("Dependent NSC Kernel FrameBuffer driver version is 2.7.7 or later\n"); device_info->caps.flags = CCF_NOTRIEMU; device_info->caps.accel = GX_SUPPORTED_DRAWINGFUNCTIONS; device_info->caps.drawing = GX_SUPPORTED_DRAWINGFLAGS; device_info->caps.accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.blitting = GX_SUPPORTED_BLITTINGFLAGS; return DFB_OK; } static void driver_close_device(CoreGraphicsDevice * device, void *driver_data, void *device_data) { NSCDeviceData *gxdev = (NSCDeviceData *) device_data; (void)gxdev; D_DEBUG("DirectFB/nsc: 5"); } static void driver_close_driver(CoreGraphicsDevice *device, void *driver_data) { D_DEBUG("DirectFB/nsc: 6"); } DirectFB-1.2.10/gfxdrivers/nsc/include/0000777000175000017500000000000011307522570014615 500000000000000DirectFB-1.2.10/gfxdrivers/nsc/include/gfx_type.h0000644000175000017500000003246711164361026016541 00000000000000/* * $Workfile: gfx_type.h $ * * This header file defines the pneumonics used when calling Durango routines. * This file is automatically included by gfx_rtns.h */ /* NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * National Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * National Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * National Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ #ifndef _gfx_type_h #define _gfx_type_h /* MSR DEFINITIONS */ typedef enum DevStatus { FOUND, NOT_KNOWN, REQ_NOT_FOUND, REQ_NOT_INSTALLED } DEV_STATUS; typedef struct msr { DEV_STATUS Present; /* Node enumeration status */ unsigned char Id; /* Device ID (from MSR specs) */ unsigned long Address; /* Address - 32-bit MBus address at which 'Id' is found */ } MSR; typedef struct mValue { unsigned long high; unsigned long low; } Q_WORD; typedef struct mbusNode { unsigned long address; unsigned int deviceId; unsigned int claimed; } MBUS_NODE; /* MSR ARRAY INDEXES */ /* These are indexes into the array of MBus devices. These */ /* should not be confused with the class codes at MSR register */ /* 0x2000. */ #define RC_ID_MBIU0 0x00 #define RC_ID_MBIU1 0x01 #define RC_ID_MCP 0x02 #define RC_ID_MPCI 0x03 #define RC_ID_MC 0x04 #define RC_ID_GP 0x05 #define RC_ID_VG 0x06 #define RC_ID_DF 0x07 #define RC_ID_FG 0x08 #define RC_ID_VA 0x09 #define CP_ID_MBIU 0x0A #define CP_ID_MPCI 0x0B #define CP_ID_USB2 0x0C #define CP_ID_ATAC 0x0D #define CP_ID_MDD 0x0E #define CP_ID_ACC 0x0F #define CP_ID_USB1 0x10 #define CP_ID_MCP 0x11 /* MBUS DEVICE CLASS CODES */ /* These are the device ids for the known Redcloud MBus devices. */ #define RC_CC_MBIU 0x01 #define RC_CC_MCP 0x02 #define RC_CC_MPCI 0x05 #define RC_CC_MC 0x20 #define RC_CC_GP 0x3D #define RC_CC_VG 0x3E #define RC_CC_DF 0x3F #define RC_CC_FG 0xF0 #define RC_CC_VA 0x86 #define CP_CC_MBIU 0x01 #define CP_CC_MPCI 0x05 #define CP_CC_USB2 0x42 #define CP_CC_ATAC 0x47 #define CP_CC_MDD 0xDF #define CP_CC_ACC 0x33 #define CP_CC_USB1 0x42 #define CP_CC_MCP 0x02 /* VAIL AND MBIUS ARE AT KNOWN ADDRESSES */ /* We can initialize the addresses of these devices in advance, */ /* as their location should never change. */ #define RC_MB0_MBIU0 0x10000000 #define RC_MB0_MBIU1 0x40000000 #define CP_MB0_MBIU0 0x51010000 #define RC_MB0_CPU 0x00000000 #define FAKE_ADDRESS 0xFFFFFFFF /* MSR PORT DESCRIPTORS */ #define NOT_POPULATED 0 #define NOT_INSTALLED 0xFFFE #define REFLECTIVE 0xFFFF /* CRC DATA SOURCES */ #define CRC_SOURCE_GFX_DATA 0x00 #define CRC_SOURCE_CRT_RGB 0x01 #define CRC_SOURCE_FP_DATA 0x02 /* TV DEFINITIONS */ typedef enum TVStandardType { TV_STANDARD_NTSC = 1, TV_STANDARD_PAL } TVStandardType; typedef enum GfxOnTVType { GFX_ON_TV_SQUARE_PIXELS = 1, GFX_ON_TV_NO_SCALING } GfxOnTVType; #define CRT_DISABLE 0x00 #define CRT_ENABLE 0x01 #define CRT_STANDBY 0x02 #define CRT_SUSPEND 0x03 #define TV_OUTPUT_COMPOSITE 0x01 #define TV_OUTPUT_S_VIDEO 0x02 #define TV_OUTPUT_YUV 0x03 #define TV_OUTPUT_SCART 0x04 #define TV_FLICKER_FILTER_NONE 0x01 #define TV_FLICKER_FILTER_NORMAL 0x02 #define TV_FLICKER_FILTER_INTERLACED 0x03 #define TV_YC_DELAY_NONE 0x01 #define TV_Y_DELAY_ONE_PIXEL 0x02 #define TV_C_DELAY_ONE_PIXEL 0x03 #define TV_C_DELAY_TWO_PIXELS 0x04 #define TV_SUB_CARRIER_RESET_NEVER 0x01 #define TV_SUB_CARRIER_RESET_EVERY_TWO_LINES 0x02 #define TV_SUB_CARRIER_RESET_EVERY_TWO_FRAMES 0x03 #define TV_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES 0x04 #define TVENC_RESET_EVERY_ODD_FIELD 0x01 #define TVENC_RESET_EVERY_EVEN_FIELD 0x02 #define TVENC_RESET_NEXT_ODD_FIELD 0x03 #define TVENC_RESET_NEXT_EVEN_FIELD 0x04 #define TVENC_RESET_EVERY_FIELD 0x05 #define TVENC_RESET_EVERY_X_ODD_FIELDS 0x06 #define TVENC_RESET_EVERY_X_EVEN_FIELDS 0x07 /* VBI FORMATS */ #define VBI_FORMAT_VIDEO 0x1 #define VBI_FORMAT_RAW 0x2 #define VBI_FORMAT_CC 0x4 #define VBI_FORMAT_NABTS 0x8 /* VIDEO DEFINITIONS */ #define VIDEO_FORMAT_UYVY 0x0 #define VIDEO_FORMAT_Y2YU 0x1 #define VIDEO_FORMAT_YUYV 0x2 #define VIDEO_FORMAT_YVYU 0x3 #define VIDEO_FORMAT_Y0Y1Y2Y3 0x4 #define VIDEO_FORMAT_Y3Y2Y1Y0 0x5 #define VIDEO_FORMAT_Y1Y0Y3Y2 0x6 #define VIDEO_FORMAT_Y1Y2Y3Y0 0x7 #define VIDEO_FORMAT_RGB 0x8 #define VIDEO_FORMAT_P2M_P2L_P1M_P1L 0x9 #define VIDEO_FORMAT_P1M_P1L_P2M_P2L 0xA #define VIDEO_FORMAT_P1M_P2L_P2M_P1L 0xB #define VIDEO_DOWNSCALE_KEEP_1_OF 0x1 #define VIDEO_DOWNSCALE_DROP_1_OF 0x2 typedef enum VideoSourceType { /* The source from which the video processor shows full screen video */ VIDEO_SOURCE_MEMORY = 1, VIDEO_SOURCE_DVIP } VideoSourceType; typedef enum VbiSourceType { /* The source from which the video processor takes VBI */ VBI_SOURCE_MEMORY = 1, VBI_SOURCE_DVIP } VbiSourceType; /* GENLOCK DEFINITIONS */ #define GENLOCK_SINGLE 0x001 #define GENLOCK_FIELD_SYNC 0x001 #define GENLOCK_CONTINUOUS 0x002 #define GENLOCK_SYNCED_EDGE_FALLING 0x004 #define GENLOCK_SYNCING_EDGE_FALLING 0x008 #define GENLOCK_TIMEOUT 0x010 #define GENLOCK_TVENC_RESET_EVEN_FIELD 0x020 #define GENLOCK_TVENC_RESET_BEFORE_DELAY 0x040 #define GENLOCK_TVENC_RESET 0x080 #define GENLOCK_SYNC_TO_TVENC 0x100 /* VIP DEFINITIONS */ #define VIP_MODE_C 0x1 #define VIP_CAPTURE_STOP_LINE 0x1 #define VIP_CAPTURE_STOP_FIELD 0x2 #define VIP_CAPTURE_START_FIELD 0x4 #define VBI_ANCILLARY 0x1 #define VBI_TASK_A 0x2 #define VBI_TASK_B 0x4 /* VGA STRUCTURE */ #define GFX_STD_CRTC_REGS 25 #define GFX_EXT_CRTC_REGS 16 #define GFX_VGA_FLAG_MISC_OUTPUT 0x00000001 #define GFX_VGA_FLAG_STD_CRTC 0x00000002 #define GFX_VGA_FLAG_EXT_CRTC 0x00000004 /* FS450 TV Standard flags */ #define GFX_TV_STANDARD_NTSC_M 0x0001 #define GFX_TV_STANDARD_NTSC_M_J 0x0002 #define GFX_TV_STANDARD_PAL_B 0x0004 #define GFX_TV_STANDARD_PAL_D 0x0008 #define GFX_TV_STANDARD_PAL_H 0x0010 #define GFX_TV_STANDARD_PAL_I 0x0020 #define GFX_TV_STANDARD_PAL_M 0x0040 #define GFX_TV_STANDARD_PAL_N 0x0080 #define GFX_TV_STANDARD_PAL_G 0x0100 /* FS450 VGA Mode flags */ #define GFX_VGA_MODE_UNKNOWN 0 #define GFX_VGA_MODE_640X480 0x0001 #define GFX_VGA_MODE_720X487 0x0002 #define GFX_VGA_MODE_720X576 0x0004 #define GFX_VGA_MODE_800X600 0x0008 #define GFX_VGA_MODE_1024X768 0x0010 /* FS450 TVout mode flags */ #define GFX_TVOUT_MODE_CVBS 0x0001 #define GFX_TVOUT_MODE_YC 0x0002 #define GFX_TVOUT_MODE_RGB 0x0004 #define GFX_TVOUT_MODE_CVBS_YC (GFX_TVOUT_MODE_CVBS | GFX_TVOUT_MODE_YC) /* FS450 Luma and Chroma Filters */ #define GFX_LUMA_FILTER 0x0001 #define GFX_CHROMA_FILTER 0x0002 /* APS Trigger Bits */ #define GFX_APS_TRIGGER_OFF 0 #define GFX_APS_TRIGGER_AGC_ONLY 1 #define GFX_APS_TRIGGER_AGC_2_LINE 2 #define GFX_APS_TRIGGER_AGC_4_LINE 3 typedef struct { int xsize; int ysize; int hz; int clock; unsigned char miscOutput; unsigned char stdCRTCregs[GFX_STD_CRTC_REGS]; unsigned char extCRTCregs[GFX_EXT_CRTC_REGS]; } gfx_vga_struct; /* POSSIBLE STATUS VALUES */ #define GFX_STATUS_UNSUPPORTED (-3) #define GFX_STATUS_BAD_PARAMETER (-2) #define GFX_STATUS_ERROR (-1) #define GFX_STATUS_OK 0 /* CPU AND VIDEO TYPES */ #define GFX_CPU_GXLV 1 #define GFX_CPU_SC1200 2 #define GFX_CPU_REDCLOUD 3 #define GFX_CPU_PYRAMID 0x20801 #define GFX_VID_CS5530 1 #define GFX_VID_SC1200 2 #define GFX_VID_REDCLOUD 3 /* CHIP NAME AND REVISION */ typedef enum ChipType { CHIP_NOT_DETECTED, SC1200_REV_A, SC1200_REV_B1_B2, SC1200_REV_B3, SC1200_REV_C1, SC1200_REV_D1, SC1200_REV_D1_1, SC1200_REV_D2_MVD, /* Macrovision disabled */ SC1200_REV_D2_MVE, /* Macrovision enabled */ SC1200_FUTURE_REV } ChipType; #endif /* !_gfx_type_h */ DirectFB-1.2.10/gfxdrivers/nsc/include/Makefile.am0000644000175000017500000000011111164361026016554 00000000000000EXTRA_DIST = \ gfx_regs.h \ gfx_type.h \ nsc_galproto.h \ pnl_defs.h DirectFB-1.2.10/gfxdrivers/nsc/include/Makefile.in0000644000175000017500000002551511307521500016576 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = gfxdrivers/nsc/include DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ gfx_regs.h \ gfx_type.h \ nsc_galproto.h \ pnl_defs.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/nsc/include/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/nsc/include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/nsc/include/gfx_regs.h0000644000175000017500000021163711164361026016516 00000000000000/* * $Workfile: gfx_regs.h $ * * This header file contains the graphics register definitions. */ /* NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * National Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * National Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * National Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ /*----------------------------------*/ /* FIRST GENERATION GRAPHICS UNIT */ /*----------------------------------*/ #define GP_DST_XCOOR 0x8100 /* x destination origin */ #define GP_DST_YCOOR 0x8102 /* y destination origin */ #define GP_WIDTH 0x8104 /* pixel width */ #define GP_HEIGHT 0x8106 /* pixel height */ #define GP_SRC_XCOOR 0x8108 /* x source origin */ #define GP_SRC_YCOOR 0x810A /* y source origin */ #define GP_VECTOR_LENGTH 0x8104 /* vector length */ #define GP_INIT_ERROR 0x8106 /* vector initial error */ #define GP_AXIAL_ERROR 0x8108 /* axial error increment */ #define GP_DIAG_ERROR 0x810A /* diagonal error increment */ #define GP_SRC_COLOR_0 0x810C /* source color 0 */ #define GP_SRC_COLOR_1 0x810E /* source color 1 */ #define GP_PAT_COLOR_0 0x8110 /* pattern color 0 */ #define GP_PAT_COLOR_1 0x8112 /* pattern color 1 */ #define GP_PAT_COLOR_2 0x8114 /* pattern color 2 */ #define GP_PAT_COLOR_3 0x8116 /* pattern color 3 */ #define GP_PAT_DATA_0 0x8120 /* bits 31:0 of pattern */ #define GP_PAT_DATA_1 0x8124 /* bits 63:32 of pattern */ #define GP_PAT_DATA_2 0x8128 /* bits 95:64 of pattern */ #define GP_PAT_DATA_3 0x812C /* bits 127:96 of pattern */ #define GP_VGA_WRITE 0x8140 /* VGA write path control */ #define GP_VGA_READ 0x8144 /* VGA read path control */ #define GP_RASTER_MODE 0x8200 /* raster operation */ #define GP_VECTOR_MODE 0x8204 /* vector mode register */ #define GP_BLIT_MODE 0x8208 /* blit mode register */ #define GP_BLIT_STATUS 0x820C /* blit status register */ #define GP_VGA_BASE 0x8210 /* VGA memory offset (x64K) */ #define GP_VGA_LATCH 0x8214 /* VGA display latch */ /* "GP_VECTOR_MODE" BIT DEFINITIONS */ #define VM_X_MAJOR 0x0000 /* X major vector */ #define VM_Y_MAJOR 0x0001 /* Y major vector */ #define VM_MAJOR_INC 0x0002 /* positive major axis step */ #define VM_MINOR_INC 0x0004 /* positive minor axis step */ #define VM_READ_DST_FB 0x0008 /* read destination data */ /* "GP_RASTER_MODE" BIT DEFINITIONS */ #define RM_PAT_DISABLE 0x0000 /* pattern is disabled */ #define RM_PAT_MONO 0x0100 /* 1BPP pattern expansion */ #define RM_PAT_DITHER 0x0200 /* 2BPP pattern expansion */ #define RM_PAT_COLOR 0x0300 /* 8BPP or 16BPP pattern */ #define RM_PAT_MASK 0x0300 /* mask for pattern mode */ #define RM_PAT_TRANSPARENT 0x0400 /* transparent 1BPP pattern */ #define RM_SRC_TRANSPARENT 0x0800 /* transparent 1BPP source */ /* "GP_BLIT_STATUS" BIT DEFINITIONS */ #define BS_BLIT_BUSY 0x0001 /* blit engine is busy */ #define BS_PIPELINE_BUSY 0x0002 /* graphics pipeline is busy*/ #define BS_BLIT_PENDING 0x0004 /* blit pending */ #define BC_FLUSH 0x0080 /* flush pipeline requests */ #define BC_8BPP 0x0000 /* 8BPP mode */ #define BC_16BPP 0x0100 /* 16BPP mode */ #define BC_FB_WIDTH_1024 0x0000 /* framebuffer width = 1024 */ #define BC_FB_WIDTH_2048 0x0200 /* framebuffer width = 2048 */ #define BC_FB_WIDTH_4096 0x0400 /* framebuffer width = 4096 */ /* "GP_BLIT_MODE" BIT DEFINITIONS */ #define BM_READ_SRC_NONE 0x0000 /* source foreground color */ #define BM_READ_SRC_FB 0x0001 /* read source from FB */ #define BM_READ_SRC_BB0 0x0002 /* read source from BB0 */ #define BM_READ_SRC_BB1 0x0003 /* read source from BB1 */ #define BM_READ_SRC_MASK 0x0003 /* read source mask */ #define BM_READ_DST_NONE 0x0000 /* no destination data */ #define BM_READ_DST_BB0 0x0008 /* destination from BB0 */ #define BM_READ_DST_BB1 0x000C /* destination from BB1 */ #define BM_READ_DST_FB0 0x0010 /* dest from FB (store BB0) */ #define BM_READ_DST_FB1 0x0014 /* dest from FB (store BB1) */ #define BM_READ_DST_MASK 0x001C /* read destination mask */ #define BM_WRITE_FB 0x0000 /* write to framebuffer */ #define BM_WRITE_MEM 0x0020 /* write to memory */ #define BM_WRITE_MASK 0x0020 /* write mask */ #define BM_SOURCE_COLOR 0x0000 /* source is 8BPP or 16BPP */ #define BM_SOURCE_EXPAND 0x0040 /* source is 1BPP */ #define BM_SOURCE_TEXT 0x00C0 /* source is 1BPP text */ #define BM_SOURCE_MASK 0x00C0 /* source mask */ #define BM_REVERSE_Y 0x0100 /* reverse Y direction */ /*---------------------------------------*/ /* FIRST GENERATION DISPLAY CONTROLLER */ /*---------------------------------------*/ #define DC_UNLOCK 0x8300 /* lock register */ #define DC_GENERAL_CFG 0x8304 /* config registers... */ #define DC_TIMING_CFG 0x8308 #define DC_OUTPUT_CFG 0x830C #define DC_FB_ST_OFFSET 0x8310 /* framebuffer start offset */ #define DC_CB_ST_OFFSET 0x8314 /* compression start offset */ #define DC_CURS_ST_OFFSET 0x8318 /* cursor start offset */ #define DC_ICON_ST_OFFSET 0x831C /* icon start offset */ #define DC_VID_ST_OFFSET 0x8320 /* video start offset */ #define DC_LINE_DELTA 0x8324 /* fb and cb skip counts */ #define DC_BUF_SIZE 0x8328 /* fb and cb line size */ #define DC_H_TIMING_1 0x8330 /* horizontal timing... */ #define DC_H_TIMING_2 0x8334 #define DC_H_TIMING_3 0x8338 #define DC_FP_H_TIMING 0x833C #define DC_V_TIMING_1 0x8340 /* vertical timing... */ #define DC_V_TIMING_2 0x8344 #define DC_V_TIMING_3 0x8348 #define DC_FP_V_TIMING 0x834C #define DC_CURSOR_X 0x8350 /* cursor x position */ #define DC_ICON_X 0x8354 /* HACK - 1.3 definition */ #define DC_V_LINE_CNT 0x8354 /* vertical line counter */ #define DC_CURSOR_Y 0x8358 /* cursor y position */ #define DC_ICON_Y 0x835C /* HACK - 1.3 definition */ #define DC_SS_LINE_CMP 0x835C /* line compare value */ #define DC_CURSOR_COLOR 0x8360 /* cursor colors */ #define DC_ICON_COLOR 0x8364 /* icon colors */ #define DC_BORDER_COLOR 0x8368 /* border color */ #define DC_PAL_ADDRESS 0x8370 /* palette address */ #define DC_PAL_DATA 0x8374 /* palette data */ #define DC_DFIFO_DIAG 0x8378 /* display FIFO diagnostic */ #define DC_CFIFO_DIAG 0x837C /* compression FIF0 diagnostic */ /* PALETTE LOCATIONS */ #define PAL_CURSOR_COLOR_0 0x100 #define PAL_CURSOR_COLOR_1 0x101 #define PAL_ICON_COLOR_0 0x102 #define PAL_ICON_COLOR_1 0x103 #define PAL_OVERSCAN_COLOR 0x104 /* UNLOCK VALUE */ #define DC_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ /* "DC_GENERAL_CFG" BIT DEFINITIONS */ #define DC_GCFG_DFLE 0x00000001 /* display FIFO load enable */ #define DC_GCFG_CURE 0x00000002 /* cursor enable */ #define DC_GCFG_VCLK_DIV 0x00000004 /* vid clock divisor */ #define DC_GCFG_PLNO 0x00000004 /* planar offset LSB */ #define DC_GCFG_PPC 0x00000008 /* pixel pan compatibility */ #define DC_GCFG_CMPE 0x00000010 /* compression enable */ #define DC_GCFG_DECE 0x00000020 /* decompression enable */ #define DC_GCFG_DCLK_MASK 0x000000C0 /* dotclock multiplier */ #define DC_GCFG_DCLK_POS 6 /* dotclock multiplier */ #define DC_GCFG_DFHPSL_MASK 0x00000F00 /* FIFO high-priority start */ #define DC_GCFG_DFHPSL_POS 8 /* FIFO high-priority start */ #define DC_GCFG_DFHPEL_MASK 0x0000F000 /* FIFO high-priority end */ #define DC_GCFG_DFHPEL_POS 12 /* FIFO high-priority end */ #define DC_GCFG_CIM_MASK 0x00030000 /* compressor insert mode */ #define DC_GCFG_CIM_POS 16 /* compressor insert mode */ #define DC_GCFG_FDTY 0x00040000 /* frame dirty mode */ #define DC_GCFG_RTPM 0x00080000 /* real-time perf. monitor */ #define DC_GCFG_DAC_RS_MASK 0x00700000 /* DAC register selects */ #define DC_GCFG_DAC_RS_POS 20 /* DAC register selects */ #define DC_GCFG_CKWR 0x00800000 /* clock write */ #define DC_GCFG_LDBL 0x01000000 /* line double */ #define DC_GCFG_DIAG 0x02000000 /* FIFO diagnostic mode */ #define DC_GCFG_CH4S 0x04000000 /* sparse refresh mode */ #define DC_GCFG_SSLC 0x08000000 /* enable line compare */ #define DC_GCFG_VIDE 0x10000000 /* video enable */ #define DC_GCFG_DFCK 0x20000000 /* divide flat-panel clock - rev 2.3 down */ #define DC_GCFG_VRDY 0x20000000 /* video port speed - rev 2.4 up */ #define DC_GCFG_DPCK 0x40000000 /* divide pixel clock */ #define DC_GCFG_DDCK 0x80000000 /* divide dot clock */ /* "DC_TIMING_CFG" BIT DEFINITIONS */ #define DC_TCFG_FPPE 0x00000001 /* flat-panel power enable */ #define DC_TCFG_HSYE 0x00000002 /* horizontal sync enable */ #define DC_TCFG_VSYE 0x00000004 /* vertical sync enable */ #define DC_TCFG_BLKE 0x00000008 /* blank enable */ #define DC_TCFG_DDCK 0x00000010 /* DDC clock */ #define DC_TCFG_TGEN 0x00000020 /* timing generator enable */ #define DC_TCFG_VIEN 0x00000040 /* vertical interrupt enable*/ #define DC_TCFG_BLNK 0x00000080 /* blink enable */ #define DC_TCFG_CHSP 0x00000100 /* horizontal sync polarity */ #define DC_TCFG_CVSP 0x00000200 /* vertical sync polarity */ #define DC_TCFG_FHSP 0x00000400 /* panel horz sync polarity */ #define DC_TCFG_FVSP 0x00000800 /* panel vert sync polarity */ #define DC_TCFG_FCEN 0x00001000 /* flat-panel centering */ #define DC_TCFG_CDCE 0x00002000 /* HACK - 1.3 definition */ #define DC_TCFG_PLNR 0x00002000 /* planar mode enable */ #define DC_TCFG_INTL 0x00004000 /* interlace scan */ #define DC_TCFG_PXDB 0x00008000 /* pixel double */ #define DC_TCFG_BKRT 0x00010000 /* blink rate */ #define DC_TCFG_PSD_MASK 0x000E0000 /* power sequence delay */ #define DC_TCFG_PSD_POS 17 /* power sequence delay */ #define DC_TCFG_DDCI 0x08000000 /* DDC input (RO) */ #define DC_TCFG_SENS 0x10000000 /* monitor sense (RO) */ #define DC_TCFG_DNA 0x20000000 /* display not active (RO) */ #define DC_TCFG_VNA 0x40000000 /* vertical not active (RO) */ #define DC_TCFG_VINT 0x80000000 /* vertical interrupt (RO) */ /* "DC_OUTPUT_CFG" BIT DEFINITIONS */ #define DC_OCFG_8BPP 0x00000001 /* 8/16 bpp select */ #define DC_OCFG_555 0x00000002 /* 16 bpp format */ #define DC_OCFG_PCKE 0x00000004 /* PCLK enable */ #define DC_OCFG_FRME 0x00000008 /* frame rate mod enable */ #define DC_OCFG_DITE 0x00000010 /* dither enable */ #define DC_OCFG_2PXE 0x00000020 /* 2 pixel enable */ #define DC_OCFG_2XCK 0x00000040 /* 2 x pixel clock */ #define DC_OCFG_2IND 0x00000080 /* 2 index enable */ #define DC_OCFG_34ADD 0x00000100 /* 3- or 4-bit add */ #define DC_OCFG_FRMS 0x00000200 /* frame rate mod select */ #define DC_OCFG_CKSL 0x00000400 /* clock select */ #define DC_OCFG_PRMP 0x00000800 /* palette re-map */ #define DC_OCFG_PDEL 0x00001000 /* panel data enable low */ #define DC_OCFG_PDEH 0x00002000 /* panel data enable high */ #define DC_OCFG_CFRW 0x00004000 /* comp line buffer r/w sel */ #define DC_OCFG_DIAG 0x00008000 /* comp line buffer diag */ #define MC_MEM_CNTRL1 0x00008400 #define MC_DR_ADD 0x00008418 #define MC_DR_ACC 0x0000841C /* MC_MEM_CNTRL1 BIT DEFINITIONS */ #define MC_XBUSARB 0x00000008 /* 0 = GP priority < CPU priority */ /* 1 = GP priority = CPU priority */ /* GXm databook V2.0 is wrong ! */ /*----------*/ /* CS5530 */ /*----------*/ /* CS5530 REGISTER DEFINITIONS */ #define CS5530_VIDEO_CONFIG 0x0000 #define CS5530_DISPLAY_CONFIG 0x0004 #define CS5530_VIDEO_X_POS 0x0008 #define CS5530_VIDEO_Y_POS 0x000C #define CS5530_VIDEO_SCALE 0x0010 #define CS5530_VIDEO_COLOR_KEY 0x0014 #define CS5530_VIDEO_COLOR_MASK 0x0018 #define CS5530_PALETTE_ADDRESS 0x001C #define CS5530_PALETTE_DATA 0x0020 #define CS5530_DOT_CLK_CONFIG 0x0024 #define CS5530_CRCSIG_TFT_TV 0x0028 /* "CS5530_VIDEO_CONFIG" BIT DEFINITIONS */ #define CS5530_VCFG_VID_EN 0x00000001 #define CS5530_VCFG_VID_REG_UPDATE 0x00000002 #define CS5530_VCFG_VID_INP_FORMAT 0x0000000C #define CS5530_VCFG_8_BIT_4_2_0 0x00000004 #define CS5530_VCFG_16_BIT_4_2_0 0x00000008 #define CS5530_VCFG_GV_SEL 0x00000010 #define CS5530_VCFG_CSC_BYPASS 0x00000020 #define CS5530_VCFG_X_FILTER_EN 0x00000040 #define CS5530_VCFG_Y_FILTER_EN 0x00000080 #define CS5530_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define CS5530_VCFG_INIT_READ_MASK 0x01FF0000 #define CS5530_VCFG_EARLY_VID_RDY 0x02000000 #define CS5530_VCFG_LINE_SIZE_UPPER 0x08000000 #define CS5530_VCFG_4_2_0_MODE 0x10000000 #define CS5530_VCFG_16_BIT_EN 0x20000000 #define CS5530_VCFG_HIGH_SPD_INT 0x40000000 /* "CS5530_DISPLAY_CONFIG" BIT DEFINITIONS */ #define CS5530_DCFG_DIS_EN 0x00000001 #define CS5530_DCFG_HSYNC_EN 0x00000002 #define CS5530_DCFG_VSYNC_EN 0x00000004 #define CS5530_DCFG_DAC_BL_EN 0x00000008 #define CS5530_DCFG_DAC_PWDNX 0x00000020 #define CS5530_DCFG_FP_PWR_EN 0x00000040 #define CS5530_DCFG_FP_DATA_EN 0x00000080 #define CS5530_DCFG_CRT_HSYNC_POL 0x00000100 #define CS5530_DCFG_CRT_VSYNC_POL 0x00000200 #define CS5530_DCFG_FP_HSYNC_POL 0x00000400 #define CS5530_DCFG_FP_VSYNC_POL 0x00000800 #define CS5530_DCFG_XGA_FP 0x00001000 #define CS5530_DCFG_FP_DITH_EN 0x00002000 #define CS5530_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define CS5530_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define CS5530_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define CS5530_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define CS5530_DCFG_VG_CK 0x00100000 #define CS5530_DCFG_GV_PAL_BYP 0x00200000 #define CS5530_DCFG_DDC_SCL 0x00400000 #define CS5530_DCFG_DDC_SDA 0x00800000 #define CS5530_DCFG_DDC_OE 0x01000000 #define CS5530_DCFG_16_BIT_EN 0x02000000 /*----------*/ /* SC1200 */ /*----------*/ /* SC1200 VIDEO REGISTER DEFINITIONS */ #define SC1200_VIDEO_CONFIG 0x000 #define SC1200_DISPLAY_CONFIG 0x004 #define SC1200_VIDEO_X_POS 0x008 #define SC1200_VIDEO_Y_POS 0x00C #define SC1200_VIDEO_UPSCALE 0x010 #define SC1200_VIDEO_COLOR_KEY 0x014 #define SC1200_VIDEO_COLOR_MASK 0x018 #define SC1200_PALETTE_ADDRESS 0x01C #define SC1200_PALETTE_DATA 0x020 #define SC1200_VID_MISC 0x028 #define SC1200_VID_CLOCK_SELECT 0x02C #define SC1200_VIDEO_DOWNSCALER_CONTROL 0x03C #define SC1200_VIDEO_DOWNSCALER_COEFFICIENTS 0x40 #define SC1200_VID_CRC 0x044 #define SC1200_DEVICE_ID 0x048 #define SC1200_VID_ALPHA_CONTROL 0x04C #define SC1200_CURSOR_COLOR_KEY 0x050 #define SC1200_CURSOR_COLOR_MASK 0x054 #define SC1200_CURSOR_COLOR_1 0x058 #define SC1200_CURSOR_COLOR_2 0x05C #define SC1200_ALPHA_XPOS_1 0x060 #define SC1200_ALPHA_YPOS_1 0x064 #define SC1200_ALPHA_COLOR_1 0x068 #define SC1200_ALPHA_CONTROL_1 0x06C #define SC1200_ALPHA_XPOS_2 0x070 #define SC1200_ALPHA_YPOS_2 0x074 #define SC1200_ALPHA_COLOR_2 0x078 #define SC1200_ALPHA_CONTROL_2 0x07C #define SC1200_ALPHA_XPOS_3 0x080 #define SC1200_ALPHA_YPOS_3 0x084 #define SC1200_ALPHA_COLOR_3 0x088 #define SC1200_ALPHA_CONTROL_3 0x08C #define SC1200_VIDEO_REQUEST 0x090 #define SC1200_ALPHA_WATCH 0x094 #define SC1200_VIDEO_DISPLAY_MODE 0x400 #define SC1200_VIDEO_ODD_VBI_LINE_ENABLE 0x40C #define SC1200_VIDEO_EVEN_VBI_LINE_ENABLE 0x410 #define SC1200_VIDEO_VBI_HORIZ_CONTROL 0x414 #define SC1200_VIDEO_ODD_VBI_TOTAL_COUNT 0x418 #define SC1200_VIDEO_EVEN_VBI_TOTAL_COUNT 0x41C #define SC1200_GENLOCK 0x420 #define SC1200_GENLOCK_DELAY 0x424 #define SC1200_TVOUT_HORZ_TIM 0x800 #define SC1200_TVOUT_HORZ_SYNC 0x804 #define SC1200_TVOUT_VERT_SYNC 0x808 #define SC1200_TVOUT_LINE_END 0x80C #define SC1200_TVOUT_VERT_DOWNSCALE 0x810 /* REV. A & B */ #define SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE 0x810 /* REV. C */ #define SC1200_TVOUT_HORZ_SCALING 0x814 #define SC1200_TVOUT_DEBUG 0x818 #define SC1200_TVENC_TIM_CTRL_1 0xC00 #define SC1200_TVENC_TIM_CTRL_2 0xC04 #define SC1200_TVENC_TIM_CTRL_3 0xC08 #define SC1200_TVENC_SUB_FREQ 0xC0C #define SC1200_TVENC_DISP_POS 0xC10 #define SC1200_TVENC_DISP_SIZE 0xC14 #define SC1200_TVENC_CC_DATA 0xC18 #define SC1200_TVENC_EDS_DATA 0xC1C #define SC1200_TVENC_CGMS_DATA 0xC20 #define SC1200_TVENC_WSS_DATA 0xC24 #define SC1200_TVENC_CC_CONTROL 0xC28 #define SC1200_TVENC_DAC_CONTROL 0xC2C #define SC1200_TVENC_MV_CONTROL 0xC30 /* "SC1200_VIDEO_CONFIG" BIT DEFINITIONS */ #define SC1200_VCFG_VID_EN 0x00000001 #define SC1200_VCFG_VID_INP_FORMAT 0x0000000C #define SC1200_VCFG_UYVY_FORMAT 0x00000000 #define SC1200_VCFG_Y2YU_FORMAT 0x00000004 #define SC1200_VCFG_YUYV_FORMAT 0x00000008 #define SC1200_VCFG_YVYU_FORMAT 0x0000000C #define SC1200_VCFG_X_FILTER_EN 0x00000040 #define SC1200_VCFG_Y_FILTER_EN 0x00000080 #define SC1200_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define SC1200_VCFG_INIT_READ_MASK 0x01FF0000 #define SC1200_VCFG_LINE_SIZE_UPPER 0x08000000 #define SC1200_VCFG_4_2_0_MODE 0x10000000 /* "SC1200_DISPLAY_CONFIG" BIT DEFINITIONS */ #define SC1200_DCFG_DIS_EN 0x00000001 #define SC1200_DCFG_HSYNC_EN 0x00000002 #define SC1200_DCFG_VSYNC_EN 0x00000004 #define SC1200_DCFG_DAC_BL_EN 0x00000008 #define SC1200_DCFG_FP_PWR_EN 0x00000040 #define SC1200_DCFG_FP_DATA_EN 0x00000080 #define SC1200_DCFG_CRT_HSYNC_POL 0x00000100 #define SC1200_DCFG_CRT_VSYNC_POL 0x00000200 #define SC1200_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define SC1200_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define SC1200_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define SC1200_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define SC1200_DCFG_VG_CK 0x00100000 #define SC1200_DCFG_GV_PAL_BYP 0x00200000 #define SC1200_DCFG_DDC_SCL 0x00400000 #define SC1200_DCFG_DDC_SDA 0x00800000 #define SC1200_DCFG_DDC_OE 0x01000000 /* "SC1200_VID_MISC" BIT DEFINITIONS */ #define SC1200_GAMMA_BYPASS_BOTH 0x00000001 #define SC1200_DAC_POWER_DOWN 0x00000400 #define SC1200_ANALOG_POWER_DOWN 0x00000800 #define SC1200_PLL_POWER_NORMAL 0x00001000 /* "SC1200_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ #define SC1200_VIDEO_DOWNSCALE_ENABLE 0x00000001 #define SC1200_VIDEO_DOWNSCALE_FACTOR_POS 1 #define SC1200_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E #define SC1200_VIDEO_DOWNSCALE_TYPE_A 0x00000000 #define SC1200_VIDEO_DOWNSCALE_TYPE_B 0x00000040 #define SC1200_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 /* "SC1200_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ #define SC1200_VIDEO_DOWNSCALER_COEF1_POS 0 #define SC1200_VIDEO_DOWNSCALER_COEF2_POS 8 #define SC1200_VIDEO_DOWNSCALER_COEF3_POS 16 #define SC1200_VIDEO_DOWNSCALER_COEF4_POS 24 #define SC1200_VIDEO_DOWNSCALER_COEF_MASK 0xF /* VIDEO DE-INTERLACING AND ALPHA CONTROL (REGISTER 0x4C) */ #define SC1200_VERTICAL_SCALER_SHIFT_MASK 0x00000007 #define SC1200_VERTICAL_SCALER_SHIFT_INIT 0x00000004 #define SC1200_VERTICAL_SCALER_SHIFT_EN 0x00000010 #define SC1200_TOP_LINE_IN_ODD 0x00000040 #define SC1200_NO_CK_OUTSIDE_ALPHA 0x00000100 #define SC1200_VIDEO_IS_INTERLACED 0x00000200 #define SC1200_CSC_VIDEO_YUV_TO_RGB 0x00000400 #define SC1200_CSC_GFX_RGB_TO_YUV 0x00000800 #define SC1200_VIDEO_INPUT_IS_RGB 0x00002000 #define SC1200_VIDEO_LINE_OFFSET_ODD 0x00001000 #define SC1200_ALPHA1_PRIORITY_POS 16 #define SC1200_ALPHA1_PRIORITY_MASK 0x00030000 #define SC1200_ALPHA2_PRIORITY_POS 18 #define SC1200_ALPHA2_PRIORITY_MASK 0x000C0000 #define SC1200_ALPHA3_PRIORITY_POS 20 #define SC1200_ALPHA3_PRIORITY_MASK 0x00300000 /* VIDEO CURSOR COLOR KEY DEFINITIONS (REGISTER 0x50) */ #define SC1200_CURSOR_COLOR_KEY_OFFSET_POS 24 #define SC1200_CURSOR_COLOR_BITS 23 #define SC1200_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ /* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ #define SC1200_ALPHA_COLOR_ENABLE 0x01000000 /* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ #define SC1200_ACTRL_WIN_ENABLE 0x00010000 #define SC1200_ACTRL_LOAD_ALPHA 0x00020000 /* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ #define SC1200_VIDEO_Y_REQUEST_POS 0 #define SC1200_VIDEO_X_REQUEST_POS 16 #define SC1200_VIDEO_REQUEST_MASK 0x00000FFF /* VIDEO DISPLAY MODE (REGISTER 0x400) */ #define SC1200_VIDEO_SOURCE_MASK 0x00000003 #define SC1200_VIDEO_SOURCE_GX1 0x00000000 #define SC1200_VIDEO_SOURCE_DVIP 0x00000002 #define SC1200_VBI_SOURCE_MASK 0x00000004 #define SC1200_VBI_SOURCE_DVIP 0x00000000 #define SC1200_VBI_SOURCE_GX1 0x00000004 /* ODD/EVEN VBI LINE ENABLE (REGISTERS 0x40C, 0x410) */ #define SC1200_VIDEO_VBI_LINE_ENABLE_MASK 0x00FFFFFC #define SC1200_VIDEO_ALL_ACTIVE_IS_VBI 0x01000000 #define SC1200_VIDEO_VBI_LINE_OFFSET_POS 25 #define SC1200_VIDEO_VBI_LINE_OFFSET_MASK 0x3E000000 /* ODD/EVEN VBI TOTAL COUNT (REGISTERS 0x418, 0x41C) */ #define SC1200_VIDEO_VBI_TOTAL_COUNT_MASK 0x000FFFFF /* GENLOCK BIT DEFINITIONS */ #define SC1200_GENLOCK_SINGLE_ENABLE 0x00000001 #define SC1200_GENLOCK_FIELD_SYNC_ENABLE 0x00000001 #define SC1200_GENLOCK_CONTINUOUS_ENABLE 0x00000002 #define SC1200_GENLOCK_GX_VSYNC_FALLING_EDGE 0x00000004 #define SC1200_GENLOCK_VIP_VSYNC_FALLING_EDGE 0x00000008 #define SC1200_GENLOCK_TIMEOUT_ENABLE 0x00000010 #define SC1200_GENLOCK_TVENC_RESET_EVEN_FIELD 0x00000020 #define SC1200_GENLOCK_TVENC_RESET_BEFORE_DELAY 0x00000040 #define SC1200_GENLOCK_TVENC_RESET_ENABLE 0x00000080 #define SC1200_GENLOCK_SYNC_TO_TVENC 0x00000100 #define SC1200_GENLOCK_DELAY_MASK 0x001FFFFF /* TVOUT HORIZONTAL PRE ENCODER SCALE BIT DEFINITIONS */ #define SC1200_TVOUT_YC_DELAY_MASK 0x00C00000 #define SC1200_TVOUT_YC_DELAY_NONE 0x00000000 #define SC1200_TVOUT_Y_DELAY_ONE_PIXEL 0x00400000 #define SC1200_TVOUT_C_DELAY_ONE_PIXEL 0x00800000 #define SC1200_TVOUT_C_DELAY_TWO_PIXELS 0x00C00000 /* TVOUT HORIZONTAL SCALING/CONTROL BIT DEFINITIONS */ #define SC1200_TVOUT_FLICKER_FILTER_MASK 0x60000000 #define SC1200_TVOUT_FLICKER_FILTER_FOURTH_HALF_FOURTH 0x00000000 #define SC1200_TVOUT_FLICKER_FILTER_HALF_ONE_HALF 0x20000000 #define SC1200_TVOUT_FLICKER_FILTER_DISABLED 0x40000000 #define SC1200_TVENC_EXTERNAL_RESET_INTERVAL_MASK 0x0F000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_ODD_FIELD 0x00000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_EVEN_FIELD 0x02000000 #define SC1200_TVENC_EXTERNAL_RESET_NEXT_ODD_FIELD 0x05000000 #define SC1200_TVENC_EXTERNAL_RESET_NEXT_EVEN_FIELD 0x07000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_FIELD 0x0E000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_X_ODD_FIELDS 0x08000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_X_EVEN_FIELDS 0x0A000000 /* TVOUT DEBUG BIT DEFINITIONS */ #define SC1200_TVOUT_FIELD_STATUS_EVEN 0x00000040 #define SC1200_TVOUT_FIELD_STATUS_TV 0x00000080 #define SC1200_TVOUT_CRT_VSYNC_STATUS_TRAILING 0x00000100 #define SC1200_TVOUT_FIELD_STATUS_INVERT 0x00000200 #define SC1200_TVOUT_CONVERTER_INTERPOLATION 0x00000400 /* TVENC TIMING/CONTROL 1 BIT DEFINITIONS (REGISTER 0xC00) */ #define SC1200_TVENC_VPHASE_MASK 0x001FF800 #define SC1200_TVENC_VPHASE_POS 11 #define SC1200_TVENC_SUB_CARRIER_RESET_MASK 0x30000000 #define SC1200_TVENC_SUB_CARRIER_RESET_NEVER 0x00000000 #define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_LINES 0x10000000 #define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_FRAMES 0x20000000 #define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES 0x30000000 #define SC1200_TVENC_VIDEO_TIMING_ENABLE 0x80000000 /* TVENC TIMING/CONTROL 2 BIT DEFINITIONS (REGISTER 0xC04) */ #define SC1200_TVENC_OUTPUT_YCBCR 0x40000000 #define SC1200_TVENC_CFS_MASK 0x00030000 #define SC1200_TVENC_CFS_BYPASS 0x00000000 #define SC1200_TVENC_CFS_CVBS 0x00020000 #define SC1200_TVENC_CFS_SVIDEO 0x00030000 /* TVENC TIMING/CONTROL 3 BIT DEFINITIONS (REGISTER 0xC08) */ #define SC1200_TVENC_CS 0x00000001 #define SC1200_TVENC_SYNCMODE_MASK 0x00000006 #define SC1200_TVENC_SYNC_ON_GREEN 0x00000002 #define SC1200_TVENC_SYNC_ON_CVBS 0x00000004 #define SC1200_TVENC_CM 0x00000008 /* TVENC DAC CONTROL BIT DEFINITIONS (REGISTER 0xC2C) */ #define SC1200_TVENC_TRIM_MASK 0x00000007 #define SC1200_TVENC_POWER_DOWN 0x00000020 /* TVENC MV CONTROL BIT DEFINITIONS (REGISTER 0xC30) */ #define SC1200_TVENC_MV_ENABLE 0xBE /* SC1200 VIP REGISTER DEFINITIONS */ #define SC1200_VIP_CONFIG 0x00000000 #define SC1200_VIP_CONTROL 0x00000004 #define SC1200_VIP_STATUS 0x00000008 #define SC1200_VIP_CURRENT_LINE 0x00000010 #define SC1200_VIP_LINE_TARGET 0x00000014 #define SC1200_ODD_DIRECT_VBI_LINE_ENABLE 0x00000018 #define SC1200_EVEN_DIRECT_VBI_LINE_ENABLE 0x0000001C #define SC1200_VIP_ODD_BASE 0x00000020 #define SC1200_VIP_EVEN_BASE 0x00000024 #define SC1200_VIP_PITCH 0x00000028 #define SC1200_VBI_ODD_BASE 0x00000040 #define SC1200_VBI_EVEN_BASE 0x00000044 #define SC1200_VBI_PITCH 0x00000048 /* "SC1200_VIP_CONFIG" BIT DEFINITIONS */ #define SC1200_VIP_MODE_MASK 0x00000003 #define SC1200_VIP_MODE_C 0x00000002 #define SC1200_VBI_ANCILLARY_TO_MEMORY 0x000C0000 #define SC1200_VBI_TASK_A_TO_MEMORY 0x00140000 #define SC1200_VBI_TASK_B_TO_MEMORY 0x00240000 #define SC1200_VIP_BUS_REQUEST_THRESHOLD 0x00400000 /* "SC1200_VIP_CONTROL" BIT DEFINITIONS */ #define SC1200_CAPTURE_RUN_MODE_MASK 0x00000003 #define SC1200_CAPTURE_RUN_MODE_STOP_LINE 0x00000000 #define SC1200_CAPTURE_RUN_MODE_STOP_FIELD 0x00000001 #define SC1200_CAPTURE_RUN_MODE_START 0x00000003 #define SC1200_VIP_DATA_CAPTURE_EN 0x00000100 #define SC1200_VIP_VBI_CAPTURE_EN 0x00000200 #define SC1200_VIP_VBI_FIELD_INTERRUPT_EN 0x00010000 /* "SC1200_VIP_STATUS" BIT DEFINITIONS */ #define SC1200_VIP_CURRENT_FIELD_ODD 0x01000000 #define SC1200_VIP_BASE_NOT_UPDATED 0x00200000 #define SC1200_VIP_FIFO_OVERFLOW 0x00100000 #define SC1200_VIP_CLEAR_LINE_INT 0x00020000 #define SC1200_VIP_CLEAR_FIELD_INT 0x00010000 #define SC1200_VBI_DATA_CAPTURE_ACTIVE 0x00000200 #define SC1200_VIDEO_DATA_CAPTURE_ACTIVE 0x00000100 /* "SC1200_VIP_CURRENT_LINE" BIT DEFINITIONS */ #define SC1200_VIP_CURRENT_LINE_MASK 0x000003FF /* "SC1200_VIP_LINE_TARGET" BIT DEFINITIONS */ #define SC1200_VIP_LAST_LINE_MASK 0x03FF0000 /* "SC1200_VIP_PITCH" BIT DEFINITION */ #define SC1200_VIP_PITCH_MASK 0x0000FFFC /* "SC1200_VBI_PITCH" BIT DEFINITION */ #define SC1200_VBI_PITCH_MASK 0x0000FFFC /* SC1200 DIRECT VBI LINE ENABLE BIT DEFINITION */ #define SC1200_DIRECT_VBI_LINE_ENABLE_MASK 0x00FFFFFF /* SC1200 CONFIGURATION BLOCK */ #define SC1200_CB_BASE_ADDR 0x9000 #define SC1200_CB_WDTO 0x0000 #define SC1200_CB_WDCNFG 0x0002 #define SC1200_CB_WDSTS 0x0004 #define SC1200_CB_TMVALUE 0x0008 #define SC1200_CB_TMCNFG 0x000D #define SC1200_CB_PMR 0x0030 #define SC1200_CB_MCR 0x0034 #define SC1200_CB_INTSEL 0x0038 #define SC1200_CB_PID 0x003C #define SC1200_CB_REV 0x003D /* SC1200 HIGH RESOLUTION TIMER CONFIGURATION REGISTER BITS */ #define SC1200_TMCLKSEL_27MHZ 0x2 /*---------------------------------*/ /* PHILIPS SAA7114 VIDEO DECODER */ /*---------------------------------*/ #define SAA7114_CHIPADDR 0x42 /* VIDEO DECODER REGISTER DEFINITIONS */ #define SAA7114_ANALOG_INPUT_CTRL1 0x02 #define SAA7114_LUMINANCE_CONTROL 0x09 #define SAA7114_BRIGHTNESS 0x0A #define SAA7114_CONTRAST 0x0B #define SAA7114_SATURATION 0x0C #define SAA7114_HUE 0x0D #define SAA7114_STATUS 0x1F #define SAA7114_IPORT_CONTROL 0x86 /* TASK A REGISTER DEFINITIONS */ #define SAA7114_TASK_A_HORZ_OUTPUT_LO 0x9C #define SAA7114_TASK_A_HORZ_OUTPUT_HI 0x9D #define SAA7114_TASK_A_HSCALE_LUMA_LO 0xA8 #define SAA7114_TASK_A_HSCALE_LUMA_HI 0xA9 #define SAA7114_TASK_A_HSCALE_CHROMA_LO 0xAC #define SAA7114_TASK_A_HSCALE_CHROMA_HI 0xAD /* TASK B REGISTER DEFINITIONS */ #define SAA7114_HORZ_OFFSET_LO 0xC4 #define SAA7114_HORZ_OFFSET_HI 0xC5 #define SAA7114_HORZ_INPUT_LO 0xC6 #define SAA7114_HORZ_INPUT_HI 0xC7 #define SAA7114_VERT_OFFSET_LO 0xC8 #define SAA7114_VERT_OFFSET_HI 0xC9 #define SAA7114_VERT_INPUT_LO 0xCA #define SAA7114_VERT_INPUT_HI 0xCB #define SAA7114_HORZ_OUTPUT_LO 0xCC #define SAA7114_HORZ_OUTPUT_HI 0xCD #define SAA7114_VERT_OUTPUT_LO 0xCE #define SAA7114_VERT_OUTPUT_HI 0xCF #define SAA7114_HORZ_PRESCALER 0xD0 #define SAA7114_HORZ_ACL 0xD1 #define SAA7114_HORZ_FIR_PREFILTER 0xD2 #define SAA7114_FILTER_CONTRAST 0xD5 #define SAA7114_FILTER_SATURATION 0xD6 #define SAA7114_HSCALE_LUMA_LO 0xD8 #define SAA7114_HSCALE_LUMA_HI 0xD9 #define SAA7114_HSCALE_CHROMA_LO 0xDC #define SAA7114_HSCALE_CHROMA_HI 0xDD #define SAA7114_VSCALE_LUMA_LO 0xE0 #define SAA7114_VSCALE_LUMA_HI 0xE1 #define SAA7114_VSCALE_CHROMA_LO 0xE2 #define SAA7114_VSCALE_CHROMA_HI 0xE3 #define SAA7114_VSCALE_CONTROL 0xE4 #define SAA7114_VSCALE_CHROMA_OFFS0 0xE8 #define SAA7114_VSCALE_CHROMA_OFFS1 0xE9 #define SAA7114_VSCALE_CHROMA_OFFS2 0xEA #define SAA7114_VSCALE_CHROMA_OFFS3 0xEB #define SAA7114_VSCALE_LUMINA_OFFS0 0xEC #define SAA7114_VSCALE_LUMINA_OFFS1 0xED #define SAA7114_VSCALE_LUMINA_OFFS2 0xEE #define SAA7114_VSCALE_LUMINA_OFFS3 0xEF /* Still need to determine PHO value (common phase offset) */ #define SAA7114_VSCALE_PHO 0x00 /*----------------------------------------------*/ /* SECOND GENERATION GRAPHICS UNIT (REDCLOUD) */ /*----------------------------------------------*/ #define MGP_DST_OFFSET 0x0000 /* dst address */ #define MGP_SRC_OFFSET 0x0004 /* src address */ #define MGP_VEC_ERR 0x0004 /* vector diag/axial errors */ #define MGP_STRIDE 0x0008 /* src and dst strides */ #define MGP_WID_HEIGHT 0x000C /* width and height of BLT */ #define MGP_VEC_LEN 0x000C /* vector length/init error */ #define MGP_SRC_COLOR_FG 0x0010 /* src mono data fgcolor */ #define MGP_SRC_COLOR_BG 0x0014 /* src mono data bkcolor */ #define MGP_PAT_COLOR_0 0x0018 /* pattern color 0 */ #define MGP_PAT_COLOR_1 0x001C /* pattern color 1 */ #define MGP_PAT_COLOR_2 0x0020 /* pattern color 2 */ #define MGP_PAT_COLOR_3 0x0024 /* pattern color 3 */ #define MGP_PAT_COLOR_4 0x0028 /* pattern color 4 */ #define MGP_PAT_COLOR_5 0x002C /* pattern color 5 */ #define MGP_PAT_DATA_0 0x0030 /* pattern data 0 */ #define MGP_PAT_DATA_1 0x0034 /* pattern data 1 */ #define MGP_RASTER_MODE 0x0038 /* raster operation */ #define MGP_VECTOR_MODE 0x003C /* render vector */ #define MGP_BLT_MODE 0x0040 /* render BLT */ #define MGP_BLT_STATUS 0x0044 /* BLT status register */ #define MGP_RESET 0x0044 /* reset register (write) */ #define MGP_HST_SOURCE 0x0048 /* host src data (bitmap) */ #define MGP_BASE_OFFSET 0x004C /* base render offset */ /* MGP_RASTER_MODE DEFINITIONS */ #define MGP_RM_BPPFMT_332 0x00000000 /* 8 BPP, 3:3:2 */ #define MGP_RM_BPPFMT_4444 0x40000000 /* 16 BPP, 4:4:4:4 */ #define MGP_RM_BPPFMT_1555 0x50000000 /* 16 BPP, 1:5:5:5 */ #define MGP_RM_BPPFMT_565 0x60000000 /* 16 BPP, 5:6:5 */ #define MGP_RM_BPPFMT_8888 0x80000000 /* 32 BPP, 8:8:8:8 */ #define MGP_RM_ALPHA_EN_MASK 0x00C00000 /* Alpha enable */ #define MGP_RM_ALPHA_TO_RGB 0x00400000 /* Alpha applies to RGB */ #define MGP_RM_ALPHA_TO_ALPHA 0x00800000 /* Alpha applies to alpha */ #define MGP_RM_ALPHA_OP_MASK 0x00300000 /* Alpha operation */ #define MGP_RM_ALPHA_TIMES_A 0x00000000 /* Alpha * A */ #define MGP_RM_BETA_TIMES_B 0x00100000 /* (1-alpha) * B */ #define MGP_RM_A_PLUS_BETA_B 0x00200000 /* A + (1-alpha) * B */ #define MGP_RM_ALPHA_A_PLUS_BETA_B 0x00300000 /* alpha * A + (1 - alpha)B */ #define MGP_RM_ALPHA_SELECT 0x000E0000 /* Alpha Select */ #define MGP_RM_SELECT_ALPHA_A 0x00000000 /* Alpha from channel A */ #define MGP_RM_SELECT_ALPHA_B 0x00020000 /* Alpha from channel B */ #define MGP_RM_SELECT_ALPHA_R 0x00040000 /* Registered alpha */ #define MGP_RM_SELECT_ALPHA_1 0x00060000 /* Constant 1 */ #define MGP_RM_SELECT_ALPHA_CHAN_A 0x00080000 /* RGB Values from A */ #define MGP_RM_SELECT_ALPHA_CHAN_B 0x000A0000 /* RGB Values from B */ #define MGP_RM_DEST_FROM_CHAN_A 0x00010000 /* Alpha channel select */ #define MGP_RM_PAT_FLAGS 0x00000700 /* pattern related bits */ #define MGP_RM_PAT_MONO 0x00000100 /* monochrome pattern */ #define MGP_RM_PAT_COLOR 0x00000200 /* color pattern */ #define MGP_RM_PAT_TRANS 0x00000400 /* pattern transparency */ #define MGP_RM_SRC_TRANS 0x00000800 /* source transparency */ /* MGP_VECTOR_MODE DEFINITIONS */ #define MGP_VM_DST_REQ 0x00000008 /* dst data required */ #define MGP_VM_THROTTLE 0x00000010 /* sync to VBLANK */ /* MGP_BLT_MODE DEFINITIONS */ #define MGP_BM_SRC_FB 0x00000001 /* src = frame buffer */ #define MGP_BM_SRC_HOST 0x00000002 /* src = host register */ #define MGP_BM_DST_REQ 0x00000004 /* dst data required */ #define MGP_BM_SRC_MONO 0x00000040 /* monochrome source data */ #define MGP_BM_SRC_BP_MONO 0x00000080 /* Byte-packed monochrome */ #define MGP_BM_NEG_YDIR 0x00000100 /* negative Y direction */ #define MGP_BM_NEG_XDIR 0x00000200 /* negative X direction */ #define MGP_BM_THROTTLE 0x00000400 /* sync to VBLANK */ /* MGP_BLT_STATUS DEFINITIONS */ #define MGP_BS_BLT_BUSY 0x00000001 /* GP is not idle */ #define MGP_BS_BLT_PENDING 0x00000004 /* second BLT is pending */ #define MGP_BS_HALF_EMPTY 0x00000008 /* src FIFO half empty */ /* ALPHA BLENDING MODES */ #define ALPHA_MODE_BLEND 0x00000000 /*---------------------------------------------------*/ /* SECOND GENERATION DISPLAY CONTROLLER (REDCLOUD) */ /*---------------------------------------------------*/ #define MDC_UNLOCK 0x00000000 /* Unlock register */ #define MDC_GENERAL_CFG 0x00000004 /* Config registers */ #define MDC_DISPLAY_CFG 0x00000008 #define MDC_GFX_SCL 0x0000000C /* Graphics scaling */ #define MDC_FB_ST_OFFSET 0x00000010 /* Frame buffer start offset */ #define MDC_CB_ST_OFFSET 0x00000014 /* Compression start offset */ #define MDC_CURS_ST_OFFSET 0x00000018 /* Cursor buffer start offset */ #define MDC_ICON_ST_OFFSET 0x0000001C /* Icon buffer start offset */ #define MDC_VID_Y_ST_OFFSET 0x00000020 /* Video Y Buffer start offset */ #define MDC_VID_U_ST_OFFSET 0x00000024 /* Video U Buffer start offset */ #define MDC_VID_V_ST_OFFSET 0x00000028 /* Video V Buffer start offset */ #define MDC_LINE_SIZE 0x00000030 /* Video, CB, and FB line sizes */ #define MDC_GFX_PITCH 0x00000034 /* FB and DB skip counts */ #define MDC_VID_YUV_PITCH 0x00000038 /* Y, U and V buffer skip counts */ #define MDC_H_ACTIVE_TIMING 0x00000040 /* Horizontal timings */ #define MDC_H_BLANK_TIMING 0x00000044 #define MDC_H_SYNC_TIMING 0x00000048 #define MDC_V_ACTIVE_TIMING 0x00000050 /* Vertical Timings */ #define MDC_V_BLANK_TIMING 0x00000054 #define MDC_V_SYNC_TIMING 0x00000058 #define MDC_CURSOR_X 0x00000060 /* Cursor X position */ #define MDC_CURSOR_Y 0x00000064 /* Cursor Y Position */ #define MDC_ICON_X 0x00000068 /* Icon X Position */ #define MDC_LINE_CNT_STATUS 0x0000006C /* Icon Y Position */ #define MDC_PAL_ADDRESS 0x00000070 /* Palette Address */ #define MDC_PAL_DATA 0x00000074 /* Palette Data */ #define MDC_DFIFO_DIAG 0x00000078 /* Display FIFO diagnostic */ #define MDC_CFIFO_DIAG 0x0000007C /* Compression FIFO diagnostic */ #define MDC_VID_DS_DELTA 0x00000080 /* Vertical Downscaling fraction */ #define MDC_PHY_MEM_OFFSET 0x00000084 /* VG Base Address Register */ #define MDC_DV_CTL 0x00000088 /* Dirty-Valid Control Register */ #define MDC_DV_ACC 0x0000008C /* Dirty-Valid RAM Access */ /* UNLOCK VALUE */ #define MDC_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ /* VG MBUS DEVICE SMI MSR FIELDS */ #define MDC_VG_BL_MASK 0x00000001 #define MDC_MISC_MASK 0x00000002 #define MDC_ISR0_MASK 0x00000004 #define MDC_VGA_BL_MASK 0x00000008 #define MDC_CRTCIO_MSK 0x00000010 #define MDC_VG_BLANK_SMI 0x00000001 #define MDC_MISC_SMI 0x00000002 #define MDC_ISR0_SMI 0x00000004 #define MDC_VGA_BLANK_SMI 0x00000008 #define MDC_CRTCIO_SMI 0x00000010 /* MDC_GENERAL_CFG BIT FIELDS */ #define MDC_GCFG_DBUG 0x80000000 #define MDC_GCFG_DBSL 0x40000000 #define MDC_GCFG_CFRW 0x20000000 #define MDC_GCFG_DIAG 0x10000000 #define MDC_GCFG_GXRFS4 0x08000000 #define MDC_GCFG_SGFR 0x04000000 #define MDC_GCFG_SGRE 0x02000000 #define MDC_GCFG_SIGE 0x01000000 #define MDC_GCFG_YUVM 0x00100000 #define MDC_GCFG_VDSE 0x00080000 #define MDC_GCFG_VGAFT 0x00040000 #define MDC_GCFG_FDTY 0x00020000 #define MDC_GCFG_STFM 0x00010000 #define MDC_GCFG_DFHPEL_MASK 0x0000F000 #define MDC_GCFG_DFHPSL_MASK 0x00000F00 #define MDC_GCFG_VGAE 0x00000080 #define MDC_GCFG_DECE 0x00000040 #define MDC_GCFG_CMPE 0x00000020 #define MDC_GCFG_VIDE 0x00000008 #define MDC_GCFG_ICNE 0x00000004 #define MDC_GCFG_CURE 0x00000002 #define MDC_GCFG_DFLE 0x00000001 /* MDC_DISPLAY_CFG BIT FIELDS */ #define MDC_DCFG_A20M 0x80000000 #define MDC_DCFG_A18M 0x40000000 #define MDC_DCFG_VISL 0x08000000 #define MDC_DCFG_FRLK 0x04000000 #define MDC_DCFG_PALB 0x02000000 #define MDC_DCFG_PIX_PAN_MASK 0x00F00000 #define MDC_DCFG_DCEN 0x00080000 #define MDC_DCFG_16BPP_MODE_MASK 0x00000C00 #define MDC_DCFG_16BPP 0x00000000 #define MDC_DCFG_15BPP 0x00000400 #define MDC_DCFG_12BPP 0x00000800 #define MDC_DCFG_DISP_MODE_MASK 0x00000300 #define MDC_DCFG_DISP_MODE_8BPP 0x00000000 #define MDC_DCFG_DISP_MODE_16BPP 0x00000100 #define MDC_DCFG_DISP_MODE_24BPP 0x00000200 #define MDC_DCFG_SCLE 0x00000080 #define MDC_DCFG_TRUP 0x00000040 #define MDC_DCFG_VIEN 0x00000020 #define MDC_DCFG_VDEN 0x00000010 #define MDC_DCFG_GDEN 0x00000008 #define MDC_DCFG_VCKE 0x00000004 #define MDC_DCFG_PCKE 0x00000002 #define MDC_DCFG_TGEN 0x00000001 /* MDC_LINE_CNT BIT FIELDS */ #define MDC_LNCNT_DNA 0x80000000 #define MDC_LNCNT_VNA 0x40000000 #define MDC_LNCNT_VSA 0x20000000 #define MDC_LNCNT_VINT 0x10000000 #define MDC_LNCNT_FLIP 0x08000000 #define MDC_LNCNT_V_LINE_CNT 0x07FF0000 #define MDC_LNCNT_VFLIP 0x00008000 #define MDC_LNCNT_SIGC 0x00004000 #define MDC_LNCNT_SS_LINE_CMP 0x000007FF /* MDC_FB_ST_OFFSET BIT FIELDS */ #define MDC_FB_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_CB_ST_OFFSET BIT FIELDS */ #define MDC_CB_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_CURS_ST_OFFSET BIT FIELDS */ #define MDC_CURS_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_ICON_ST_OFFSET BIT FIELDS */ #define MDC_ICON_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_VID_Y_ST_OFFSET BIT FIELDS */ #define MDC_VID_Y_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_VID_U_ST_OFFSET BIT FIELDS */ #define MDC_VID_U_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_VID_V_ST_OFFSET BIT FIELDS */ #define MDC_VID_V_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_LINE_SIZE BIT FIELDS */ #define MDC_LINE_SIZE_VLS_MASK 0xFF000000 #define MDC_LINE_SIZE_CBLS_MASK 0x007F0000 #define MDC_LINE_SIZE_FBLS_MASK 0x000007FF /* MDC_GFX_PITCH BIT FIELDS */ #define MDC_GFX_PITCH_CBP_MASK 0xFFFF0000 #define MDC_GFX_PITCH_FBP_MASK 0x0000FFFF /* MDC_VID_YUV_PITCH BIT FIELDS */ #define MDC_YUV_PITCH_UVP_MASK 0xFFFF0000 #define MDC_YUV_PITCH_YBP_MASK 0x0000FFFF /* MDC_H_ACTIVE_TIMING BIT FIELDS */ #define MDC_HAT_HT_MASK 0x0FF80000 #define MDC_HAT_HA_MASK 0x00000FF8 /* MDC_H_BLANK_TIMING BIT FIELDS */ #define MDC_HBT_HBE_MASK 0x0FF80000 #define MDC_HBT_HBS_MASK 0x00000FF8 /* MDC_H_SYNC_TIMING BIT FIELDS */ #define MDC_HST_HSE_MASK 0x0FF80000 #define MDC_HST_HSS_MASK 0x00000FF8 /* MDC_V_ACTIVE_TIMING BIT FIELDS */ #define MDC_VAT_VT_MASK 0x07FF0000 #define MDC_VAT_VA_MASK 0x000007FF /* MDC_V_BLANK_TIMING BIT FIELDS */ #define MDC_VBT_VBE_MASK 0x07FF0000 #define MDC_VBT_VBS_MASK 0x000007FF /* MDC_V_SYNC_TIMING BIT FIELDS */ #define MDC_VST_VSE_MASK 0x07FF0000 #define MDC_VST_VSS_MASK 0x000007FF /* MDC_DV_CTL BIT DEFINITIONS */ #define MDC_DV_LINE_SIZE_MASK 0x00000C00 #define MDC_DV_LINE_SIZE_1024 0x00000000 #define MDC_DV_LINE_SIZE_2048 0x00000400 #define MDC_DV_LINE_SIZE_4096 0x00000800 #define MDC_DV_LINE_SIZE_8192 0x00000C00 /* VGA DEFINITIONS */ #define MDC_SEQUENCER_INDEX 0x03C4 #define MDC_SEQUENCER_DATA 0x03C5 #define MDC_SEQUENCER_RESET 0x00 #define MDC_SEQUENCER_CLK_MODE 0x01 #define MDC_RESET_VGA_DISP_ENABLE 0x03 #define MDC_CLK_MODE_SCREEN_OFF 0x20 /*---------------------------------------------------*/ /* REDCLOUD DISPLAY FILTER */ /*---------------------------------------------------*/ /* RCDF VIDEO REGISTER DEFINITIONS */ #define RCDF_VIDEO_CONFIG 0x000 #define RCDF_DISPLAY_CONFIG 0x008 #define RCDF_VIDEO_X_POS 0x010 #define RCDF_VIDEO_Y_POS 0x018 #define RCDF_VIDEO_SCALE 0x020 #define RCDF_VIDEO_COLOR_KEY 0x028 #define RCDF_VIDEO_COLOR_MASK 0x030 #define RCDF_PALETTE_ADDRESS 0x038 #define RCDF_PALETTE_DATA 0x040 #define RCDF_VID_MISC 0x050 #define RCDF_VID_CLOCK_SELECT 0x058 #define RCDF_VIDEO_DOWNSCALER_CONTROL 0x078 #define RCDF_VIDEO_DOWNSCALER_COEFFICIENTS 0x080 #define RCDF_VID_CRC 0x088 #define RCDF_VID_CRC32 0x090 #define RCDF_VID_ALPHA_CONTROL 0x098 #define RCDF_CURSOR_COLOR_KEY 0x0A0 #define RCDF_CURSOR_COLOR_MASK 0x0A8 #define RCDF_CURSOR_COLOR_1 0x0B0 #define RCDF_CURSOR_COLOR_2 0x0B8 #define RCDF_ALPHA_XPOS_1 0x0C0 #define RCDF_ALPHA_YPOS_1 0x0C8 #define RCDF_ALPHA_COLOR_1 0x0D0 #define RCDF_ALPHA_CONTROL_1 0x0D8 #define RCDF_ALPHA_XPOS_2 0x0E0 #define RCDF_ALPHA_YPOS_2 0x0E8 #define RCDF_ALPHA_COLOR_2 0x0F0 #define RCDF_ALPHA_CONTROL_2 0x0F8 #define RCDF_ALPHA_XPOS_3 0x100 #define RCDF_ALPHA_YPOS_3 0x108 #define RCDF_ALPHA_COLOR_3 0x110 #define RCDF_ALPHA_CONTROL_3 0x118 #define RCDF_VIDEO_REQUEST 0x120 #define RCDF_ALPHA_WATCH 0x128 #define RCDF_VIDEO_TEST_MODE 0x210 #define RCDF_POWER_MANAGEMENT 0x410 /* DISPLAY FILTER POWER MANAGEMENT DEFINITIONS */ #define RCDF_PM_PANEL_POWER_ON 0x01000000 /* DISPLAY FILTER MSRS */ #define RCDF_MBD_MSR_DIAG_DF 0x2010 #define RCDF_DIAG_32BIT_CRC 0x80000000 /* "RCDF_VIDEO_CONFIG" BIT DEFINITIONS */ #define RCDF_VCFG_VID_EN 0x00000001 #define RCDF_VCFG_VID_INP_FORMAT 0x0000000C #define RCDF_VCFG_X_FILTER_EN 0x00000040 #define RCDF_VCFG_Y_FILTER_EN 0x00000080 #define RCDF_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define RCDF_VCFG_INIT_READ_MASK 0x01FF0000 #define RCDF_VCFG_LINE_SIZE_UPPER 0x08000000 #define RCDF_VCFG_4_2_0_MODE 0x10000000 #define RCDF_VCFG_UYVY_FORMAT 0x00000000 #define RCDF_VCFG_Y2YU_FORMAT 0x00000004 #define RCDF_VCFG_YUYV_FORMAT 0x00000008 #define RCDF_VCFG_YVYU_FORMAT 0x0000000C /* "RCDF_DISPLAY_CONFIG" BIT DEFINITIONS */ #define RCDF_DCFG_DIS_EN 0x00000001 #define RCDF_DCFG_HSYNC_EN 0x00000002 #define RCDF_DCFG_VSYNC_EN 0x00000004 #define RCDF_DCFG_DAC_BL_EN 0x00000008 #define RCDF_DCFG_FP_PWR_EN 0x00000040 #define RCDF_DCFG_FP_DATA_EN 0x00000080 #define RCDF_DCFG_CRT_HSYNC_POL 0x00000100 #define RCDF_DCFG_CRT_VSYNC_POL 0x00000200 #define RCDF_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define RCDF_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define RCDF_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define RCDF_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define RCDF_DCFG_VG_CK 0x00100000 #define RCDF_DCFG_GV_PAL_BYP 0x00200000 #define RCDF_DAC_VREF 0x04000000 #define RCDF_FP_ON_STATUS 0x08000000 /* "RCDF_VID_MISC" BIT DEFINITIONS */ #define RCDF_GAMMA_BYPASS_BOTH 0x00000001 #define RCDF_DAC_POWER_DOWN 0x00000400 #define RCDF_ANALOG_POWER_DOWN 0x00000800 /* "RCDF_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ #define RCDF_VIDEO_DOWNSCALE_ENABLE 0x00000001 #define RCDF_VIDEO_DOWNSCALE_FACTOR_POS 1 #define RCDF_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E #define RCDF_VIDEO_DOWNSCALE_TYPE_A 0x00000000 #define RCDF_VIDEO_DOWNSCALE_TYPE_B 0x00000040 #define RCDF_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 /* "RCDF_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ #define RCDF_VIDEO_DOWNSCALER_COEF1_POS 0 #define RCDF_VIDEO_DOWNSCALER_COEF2_POS 8 #define RCDF_VIDEO_DOWNSCALER_COEF3_POS 16 #define RCDF_VIDEO_DOWNSCALER_COEF4_POS 24 #define RCDF_VIDEO_DOWNSCALER_COEF_MASK 0xF /* VIDEO DE-INTERLACING AND ALPHA CONTROL */ #define RCDF_NO_CK_OUTSIDE_ALPHA 0x00000100 #define RCDF_CSC_VIDEO_YUV_TO_RGB 0x00000400 #define RCDF_VIDEO_INPUT_IS_RGB 0x00002000 #define RCDF_ALPHA1_PRIORITY_POS 16 #define RCDF_ALPHA1_PRIORITY_MASK 0x00030000 #define RCDF_ALPHA2_PRIORITY_POS 18 #define RCDF_ALPHA2_PRIORITY_MASK 0x000C0000 #define RCDF_ALPHA3_PRIORITY_POS 20 #define RCDF_ALPHA3_PRIORITY_MASK 0x00300000 /* VIDEO CURSOR COLOR KEY DEFINITIONS */ #define RCDF_CURSOR_COLOR_KEY_ENABLE 0x20000000 #define RCDF_CURSOR_COLOR_KEY_OFFSET_POS 24 #define RCDF_CURSOR_COLOR_BITS 23 #define RCDF_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ /* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ #define RCDF_ALPHA_COLOR_ENABLE 0x01000000 /* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ #define RCDF_ACTRL_WIN_ENABLE 0x00010000 #define RCDF_ACTRL_LOAD_ALPHA 0x00020000 /* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ #define RCDF_VIDEO_Y_REQUEST_POS 0 #define RCDF_VIDEO_X_REQUEST_POS 16 #define RCDF_VIDEO_REQUEST_MASK 0x000007FF /* GEODELINK DEVICE MSR REGISTER SUMMARY */ #define MBD_MSR_CAP 0x2000 /* Device Capabilities */ #define MBD_MSR_CONFIG 0x2001 /* Device Master Configuration Register */ #define MBD_MSR_SMI 0x2002 /* MBus Device SMI Register */ #define MBD_MSR_ERROR 0x2003 /* MBus Device Error */ #define MBD_MSR_PM 0x2004 /* MBus Device Power Management Register */ #define MBD_MSR_DIAG 0x2005 /* Mbus Device Diagnostic Register */ /* DISPLAY FILTER MBD_MSR_DIAG DEFINITIONS */ #define RCDF_MBD_DIAG_SEL0 0x00007FFF /* Lower 32-bits of Diag Bus Select */ #define RCDF_MBD_DIAG_EN0 0x00008000 /* Enable for lower 32-bits of diag bus */ #define RCDF_MBD_DIAG_SEL1 0x7FFF0000 /* Upper 32-bits of Diag Bus Select */ #define RCDF_MBD_DIAG_EN1 0x80000000 /* Enable for upper 32-bits of diag bus */ /* DISPLAY FILTER MBD_MSR_CONFIG DEFINITIONS */ #define RCDF_CONFIG_FMT_MASK 0x00000038 /* Output Format */ #define RCDF_CONFIG_FMT_CRT 0x00000000 #define RCDF_CONFIG_FMT_FP 0x00000008 /* MCP MSR DEFINITIONS */ #define MCP_CLKOFF 0x0010 #define MCP_CLKACTIVE 0x0011 #define MCP_CLKDISABLE 0x0012 #define MCP_CLK4ACK 0x0013 #define MCP_SYS_RSTPLL 0x0014 #define MCP_DOTPLL 0x0015 #define MCP_DBGCLKCTL 0x0016 #define MCP_RC_REVID 0x0017 #define MCP_SETM0CTL 0x0040 #define MCP_SETN0CTL 0x0048 #define MCP_CMPVAL0 0x0050 #define MCP_CMPMASK0 0x0051 #define MCP_REGA 0x0058 #define MCP_REGB 0x0059 #define MCP_REGAMASK 0x005A #define MCP_REGAVAL 0x005B #define MCP_REGBMASK 0x005C #define MCP_REGBVAL 0x005D #define MCP_FIFOCTL 0x005E #define MCP_DIAGCTL 0x005F #define MCP_H0CTL 0x0060 #define MCP_XSTATE 0x0066 #define MCP_YSTATE 0x0067 #define MCP_ACTION0 0x0068 /* MCP_SYS_RSTPLL DEFINITIONS */ #define MCP_DOTPOSTDIV3 0x00000008 #define MCP_DOTPREMULT2 0x00000004 #define MCP_DOTPREDIV2 0x00000002 /* MCP MBD_MSR_DIAG DEFINITIONS */ #define MCP_MBD_DIAG_SEL0 0x00000007 #define MCP_MBD_DIAG_EN0 0x00008000 #define MCP_MBD_DIAG_SEL1 0x00070000 #define MCP_MBD_DIAG_EN1 0x80000000 /* MCP_DOTPLL DEFINITIONS */ #define MCP_DOTPLL_P 0x00000003 #define MCP_DOTPLL_N 0x000001FC #define MCP_DOTPLL_M 0x00001E00 #define MCP_DOTPLL_LOCK 0x02000000 #define MCP_DOTPLL_BYPASS 0x00008000 /*---------------------------------------------------*/ /* THIRD GENERATION DISPLAY CONTROLLER (CASTLE) */ /*---------------------------------------------------*/ #define DC3_UNLOCK 0x00000000 /* Unlock register */ #define DC3_GENERAL_CFG 0x00000004 /* Config registers */ #define DC3_DISPLAY_CFG 0x00000008 #define DC3_FB_ST_OFFSET 0x00000010 /* Frame buffer start offset */ #define DC3_CB_ST_OFFSET 0x00000014 /* Compression start offset */ #define DC3_CURS_ST_OFFSET 0x00000018 /* Cursor buffer start offset */ #define DC3_VID_Y_ST_OFFSET 0x00000020 /* Video Y Buffer start offset */ #define DC3_VID_U_ST_OFFSET 0x00000024 /* Video U Buffer start offset */ #define DC3_VID_V_ST_OFFSET 0x00000028 /* Video V Buffer start offset */ #define DC3_LINE_SIZE 0x00000030 /* Video, CB, and FB line sizes */ #define DC3_GFX_PITCH 0x00000034 /* FB and DB skip counts */ #define DC3_VID_YUV_PITCH 0x00000038 /* Y, U and V buffer skip counts */ #define DC3_H_ACTIVE_TIMING 0x00000040 /* Horizontal timings */ #define DC3_H_BLANK_TIMING 0x00000044 #define DC3_H_SYNC_TIMING 0x00000048 #define DC3_V_ACTIVE_TIMING 0x00000050 /* Vertical Timings */ #define DC3_V_BLANK_TIMING 0x00000054 #define DC3_V_SYNC_TIMING 0x00000058 #define DC3_CURSOR_X 0x00000060 /* Cursor X position */ #define DC3_CURSOR_Y 0x00000064 /* Cursor Y Position */ #define DC3_LINE_CNT_STATUS 0x0000006C /* Icon Y Position */ #define DC3_PAL_ADDRESS 0x00000070 /* Palette Address */ #define DC3_PAL_DATA 0x00000074 /* Palette Data */ #define DC3_DFIFO_DIAG 0x00000078 /* Display FIFO diagnostic */ #define DC3_CFIFO_DIAG 0x0000007C /* Compression FIFO diagnostic */ #define DC3_VID_DS_DELTA 0x00000080 /* Vertical Downscaling fraction */ #define DC3_PHY_MEM_OFFSET 0x00000084 /* VG Base Address Register */ #define DC3_DV_CTL 0x00000088 /* Dirty-Valid Control Register */ #define DC3_DV_ACC 0x0000008C /* Dirty-Valid RAM Access */ #define DC3_COLOR_KEY 0x000000B8 /* Graphics color key */ #define DC3_COLOR_MASK 0x000000BC /* Graphics color key mask */ /* UNLOCK VALUE */ #define DC3_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ /* VG MBUS DEVICE SMI MSR FIELDS */ #define DC3_VG_BL_MASK 0x00000001 #define DC3_MISC_MASK 0x00000002 #define DC3_ISR0_MASK 0x00000004 #define DC3_VGA_BL_MASK 0x00000008 #define DC3_CRTCIO_MSK 0x00000010 #define DC3_VG_BLANK_SMI 0x00000001 #define DC3_MISC_SMI 0x00000002 #define DC3_ISR0_SMI 0x00000004 #define DC3_VGA_BLANK_SMI 0x00000008 #define DC3_CRTCIO_SMI 0x00000010 /* DC3_GENERAL_CFG BIT FIELDS */ #define DC3_GCFG_DBUG 0x80000000 #define DC3_GCFG_DBSL 0x40000000 #define DC3_GCFG_CFRW 0x20000000 #define DC3_GCFG_DIAG 0x10000000 #define DC3_GCFG_GXRFS4 0x08000000 #define DC3_GCFG_SGFR 0x04000000 #define DC3_GCFG_SGRE 0x02000000 #define DC3_GCFG_SIGE 0x01000000 #define DC3_GCFG_YUVM 0x00100000 #define DC3_GCFG_VDSE 0x00080000 #define DC3_GCFG_VGAFT 0x00040000 #define DC3_GCFG_FDTY 0x00020000 #define DC3_GCFG_STFM 0x00010000 #define DC3_GCFG_DFHPEL_MASK 0x0000F000 #define DC3_GCFG_DFHPSL_MASK 0x00000F00 #define DC3_GCFG_VGAE 0x00000080 #define DC3_GCFG_DECE 0x00000040 #define DC3_GCFG_CMPE 0x00000020 #define DC3_GCFG_VIDE 0x00000008 #define DC3_GCFG_ICNE 0x00000004 #define DC3_GCFG_CURE 0x00000002 #define DC3_GCFG_DFLE 0x00000001 /* DC3_DISPLAY_CFG BIT FIELDS */ #define DC3_DCFG_A20M 0x80000000 #define DC3_DCFG_A18M 0x40000000 #define DC3_DCFG_VISL 0x08000000 #define DC3_DCFG_FRLK 0x04000000 #define DC3_DCFG_PALB 0x02000000 #define DC3_DCFG_PIX_PAN_MASK 0x00F00000 #define DC3_DCFG_DCEN 0x00080000 #define DC3_DCFG_16BPP_MODE_MASK 0x00000C00 #define DC3_DCFG_16BPP 0x00000000 #define DC3_DCFG_15BPP 0x00000400 #define DC3_DCFG_12BPP 0x00000800 #define DC3_DCFG_DISP_MODE_MASK 0x00000300 #define DC3_DCFG_DISP_MODE_8BPP 0x00000000 #define DC3_DCFG_DISP_MODE_16BPP 0x00000100 #define DC3_DCFG_DISP_MODE_24BPP 0x00000200 #define DC3_DCFG_SCLE 0x00000080 #define DC3_DCFG_TRUP 0x00000040 #define DC3_DCFG_VIEN 0x00000020 #define DC3_DCFG_VDEN 0x00000010 #define DC3_DCFG_GDEN 0x00000008 #define DC3_DCFG_VCKE 0x00000004 #define DC3_DCFG_PCKE 0x00000002 #define DC3_DCFG_TGEN 0x00000001 /* DC3_LINE_CNT BIT FIELDS */ #define DC3_LNCNT_DNA 0x80000000 #define DC3_LNCNT_VNA 0x40000000 #define DC3_LNCNT_VSA 0x20000000 #define DC3_LNCNT_VINT 0x10000000 #define DC3_LNCNT_FLIP 0x08000000 #define DC3_LNCNT_V_LINE_CNT 0x07FF0000 #define DC3_LNCNT_VFLIP 0x00008000 #define DC3_LNCNT_SIGC 0x00004000 #define DC3_LNCNT_SS_LINE_CMP 0x000007FF /* DC3_FB_ST_OFFSET BIT FIELDS */ #define DC3_FB_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_CB_ST_OFFSET BIT FIELDS */ #define DC3_CB_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_CURS_ST_OFFSET BIT FIELDS */ #define DC3_CURS_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_ICON_ST_OFFSET BIT FIELDS */ #define DC3_ICON_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_VID_Y_ST_OFFSET BIT FIELDS */ #define DC3_VID_Y_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_VID_U_ST_OFFSET BIT FIELDS */ #define DC3_VID_U_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_VID_V_ST_OFFSET BIT FIELDS */ #define DC3_VID_V_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_LINE_SIZE BIT FIELDS */ #define DC3_LINE_SIZE_VLS_MASK 0x3FF00000 #define DC3_LINE_SIZE_CBLS_MASK 0x0007F000 #define DC3_LINE_SIZE_FBLS_MASK 0x000003FF #define DC3_LINE_SIZE_CB_SHIFT 12 #define DC3_LINE_SIZE_VB_SHIFT 20 /* DC3_GFX_PITCH BIT FIELDS */ #define DC3_GFX_PITCH_CBP_MASK 0xFFFF0000 #define DC3_GFX_PITCH_FBP_MASK 0x0000FFFF /* DC3_VID_YUV_PITCH BIT FIELDS */ #define DC3_YUV_PITCH_UVP_MASK 0xFFFF0000 #define DC3_YUV_PITCH_YBP_MASK 0x0000FFFF /* DC3_H_ACTIVE_TIMING BIT FIELDS */ #define DC3_HAT_HT_MASK 0x0FF80000 #define DC3_HAT_HA_MASK 0x00000FF8 /* DC3_H_BLANK_TIMING BIT FIELDS */ #define DC3_HBT_HBE_MASK 0x0FF80000 #define DC3_HBT_HBS_MASK 0x00000FF8 /* DC3_H_SYNC_TIMING BIT FIELDS */ #define DC3_HST_HSE_MASK 0x0FF80000 #define DC3_HST_HSS_MASK 0x00000FF8 /* DC3_V_ACTIVE_TIMING BIT FIELDS */ #define DC3_VAT_VT_MASK 0x07FF0000 #define DC3_VAT_VA_MASK 0x000007FF /* DC3_V_BLANK_TIMING BIT FIELDS */ #define DC3_VBT_VBE_MASK 0x07FF0000 #define DC3_VBT_VBS_MASK 0x000007FF /* DC3_V_SYNC_TIMING BIT FIELDS */ #define DC3_VST_VSE_MASK 0x07FF0000 #define DC3_VST_VSS_MASK 0x000007FF /* DC3_DV_CTL BIT DEFINITIONS */ #define DC3_DV_LINE_SIZE_MASK 0x00000C00 #define DC3_DV_LINE_SIZE_1024 0x00000000 #define DC3_DV_LINE_SIZE_2048 0x00000400 #define DC3_DV_LINE_SIZE_4096 0x00000800 #define DC3_DV_LINE_SIZE_8192 0x00000C00 #define DC3_CLR_KEY_DATA_MASK 0x00FFFFFF #define DC3_CLR_KEY_ENABLE 0x01000000 #define DC3_CLR_KEY_INVERT 0x02000000 /* VGA DEFINITIONS */ #define DC3_SEQUENCER_INDEX 0x03C4 #define DC3_SEQUENCER_DATA 0x03C5 #define DC3_SEQUENCER_RESET 0x00 #define DC3_SEQUENCER_CLK_MODE 0x01 #define DC3_RESET_VGA_DISP_ENABLE 0x03 #define DC3_CLK_MODE_SCREEN_OFF 0x20 /*---------------------------------------------------*/ /* CASTLE DISPLAY FILTER */ /*---------------------------------------------------*/ /* CASTLE VIDEO REGISTER DEFINITIONS */ #define CASTLE_VIDEO_CONFIG 0x000 #define CASTLE_DISPLAY_CONFIG 0x008 #define CASTLE_VIDEO_X_POS 0x010 #define CASTLE_VIDEO_Y_POS 0x018 #define CASTLE_VIDEO_COLOR_KEY 0x028 #define CASTLE_VIDEO_COLOR_MASK 0x030 #define CASTLE_PALETTE_ADDRESS 0x038 #define CASTLE_PALETTE_DATA 0x040 #define CASTLE_VID_MISC 0x050 #define CASTLE_VID_CLOCK_SELECT 0x058 #define CASTLE_VIDEO_YSCALE 0x060 #define CASTLE_VIDEO_XSCALE 0x068 #define CASTLE_VIDEO_DOWNSCALER_CONTROL 0x078 #define CASTLE_VID_CRC 0x088 #define CASTLE_VID_CRC32 0x090 #define CASTLE_VID_ALPHA_CONTROL 0x098 #define CASTLE_CURSOR_COLOR_KEY 0x0A0 #define CASTLE_CURSOR_COLOR_MASK 0x0A8 #define CASTLE_CURSOR_COLOR_1 0x0B0 #define CASTLE_CURSOR_COLOR_2 0x0B8 #define CASTLE_ALPHA_XPOS_1 0x0C0 #define CASTLE_ALPHA_YPOS_1 0x0C8 #define CASTLE_ALPHA_COLOR_1 0x0D0 #define CASTLE_ALPHA_CONTROL_1 0x0D8 #define CASTLE_ALPHA_XPOS_2 0x0E0 #define CASTLE_ALPHA_YPOS_2 0x0E8 #define CASTLE_ALPHA_COLOR_2 0x0F0 #define CASTLE_ALPHA_CONTROL_2 0x0F8 #define CASTLE_ALPHA_XPOS_3 0x100 #define CASTLE_ALPHA_YPOS_3 0x108 #define CASTLE_ALPHA_COLOR_3 0x110 #define CASTLE_ALPHA_CONTROL_3 0x118 #define CASTLE_VIDEO_REQUEST 0x120 #define CASTLE_ALPHA_WATCH 0x128 #define CASTLE_VIDEO_TEST_MODE 0x210 #define CASTLE_POWER_MANAGEMENT 0x410 /* DISPLAY FILTER POWER MANAGEMENT DEFINITIONS */ #define CASTLE_PM_PANEL_POWER_ON 0x01000000 /* DISPLAY FILTER MSRS */ #define CASTLE_MBD_MSR_DIAG_DF 0x2010 #define CASTLE_DIAG_32BIT_CRC 0x80000000 /* "CASTLE_VIDEO_CONFIG" BIT DEFINITIONS */ #define CASTLE_VCFG_VID_EN 0x00000001 #define CASTLE_VCFG_VID_INP_FORMAT 0x0000000C #define CASTLE_VCFG_SCALER_BYPASS 0x00000020 #define CASTLE_VCFG_X_FILTER_EN 0x00000040 #define CASTLE_VCFG_Y_FILTER_EN 0x00000080 #define CASTLE_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define CASTLE_VCFG_INIT_READ_MASK 0x01FF0000 #define CASTLE_VCFG_LINE_SIZE_UPPER 0x08000000 #define CASTLE_VCFG_4_2_0_MODE 0x10000000 #define CASTLE_VCFG_UYVY_FORMAT 0x00000000 #define CASTLE_VCFG_Y2YU_FORMAT 0x00000004 #define CASTLE_VCFG_YUYV_FORMAT 0x00000008 #define CASTLE_VCFG_YVYU_FORMAT 0x0000000C /* "CASTLE_DISPLAY_CONFIG" BIT DEFINITIONS */ #define CASTLE_DCFG_DIS_EN 0x00000001 #define CASTLE_DCFG_HSYNC_EN 0x00000002 #define CASTLE_DCFG_VSYNC_EN 0x00000004 #define CASTLE_DCFG_DAC_BL_EN 0x00000008 #define CASTLE_DCFG_FP_PWR_EN 0x00000040 #define CASTLE_DCFG_FP_DATA_EN 0x00000080 #define CASTLE_DCFG_CRT_HSYNC_POL 0x00000100 #define CASTLE_DCFG_CRT_VSYNC_POL 0x00000200 #define CASTLE_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define CASTLE_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define CASTLE_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define CASTLE_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define CASTLE_DCFG_VG_CK 0x00100000 #define CASTLE_DCFG_GV_PAL_BYP 0x00200000 #define CASTLE_DAC_VREF 0x04000000 #define CASTLE_FP_ON_STATUS 0x08000000 /* "CASTLE_VID_MISC" BIT DEFINITIONS */ #define CASTLE_GAMMA_BYPASS_BOTH 0x00000001 #define CASTLE_DAC_POWER_DOWN 0x00000400 #define CASTLE_ANALOG_POWER_DOWN 0x00000800 /* "CASTLE_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ #define CASTLE_VIDEO_DOWNSCALE_ENABLE 0x00000001 #define CASTLE_VIDEO_DOWNSCALE_FACTOR_POS 1 #define CASTLE_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E #define CASTLE_VIDEO_DOWNSCALE_TYPE_A 0x00000000 #define CASTLE_VIDEO_DOWNSCALE_TYPE_B 0x00000040 #define CASTLE_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 /* "CASTLE_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ #define CASTLE_VIDEO_DOWNSCALER_COEF1_POS 0 #define CASTLE_VIDEO_DOWNSCALER_COEF2_POS 8 #define CASTLE_VIDEO_DOWNSCALER_COEF3_POS 16 #define CASTLE_VIDEO_DOWNSCALER_COEF4_POS 24 #define CASTLE_VIDEO_DOWNSCALER_COEF_MASK 0xF /* VIDEO DE-INTERLACING AND ALPHA CONTROL */ #define CASTLE_NO_CK_OUTSIDE_ALPHA 0x00000100 #define CASTLE_CSC_VIDEO_YUV_TO_RGB 0x00000400 #define CASTLE_VIDEO_INPUT_IS_RGB 0x00002000 #define CASTLE_ALPHA1_PRIORITY_POS 16 #define CASTLE_ALPHA1_PRIORITY_MASK 0x00030000 #define CASTLE_ALPHA2_PRIORITY_POS 18 #define CASTLE_ALPHA2_PRIORITY_MASK 0x000C0000 #define CASTLE_ALPHA3_PRIORITY_POS 20 #define CASTLE_ALPHA3_PRIORITY_MASK 0x00300000 /* VIDEO CURSOR COLOR KEY DEFINITIONS */ #define CASTLE_CURSOR_COLOR_KEY_ENABLE 0x20000000 #define CASTLE_CURSOR_COLOR_KEY_OFFSET_POS 24 #define CASTLE_CURSOR_COLOR_BITS 23 #define CASTLE_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ /* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ #define CASTLE_ALPHA_COLOR_ENABLE 0x01000000 /* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ #define CASTLE_ACTRL_WIN_ENABLE 0x00010000 #define CASTLE_ACTRL_LOAD_ALPHA 0x00020000 /* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ #define CASTLE_VIDEO_Y_REQUEST_POS 0 #define CASTLE_VIDEO_X_REQUEST_POS 16 #define CASTLE_VIDEO_REQUEST_MASK 0x000007FF /* END OF FILE */ DirectFB-1.2.10/gfxdrivers/nsc/include/pnl_defs.h0000644000175000017500000001603211164361026016474 00000000000000/* * $Workfile: pnl_defs.h $ * * File Contents: This file contains definitions of the Geode * frame buffer panel data structures. * * SubModule: Geode FlatPanel library * */ /* NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * National Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * National Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * National Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ #ifndef _pnl_defs_h #define _pnl_defs_h typedef enum { MARMOT_PLATFORM = 0, UNICORN_PLATFORM, CENTAURUS_PLATFORM, ARIES_PLATFORM, CARMEL_PLATFORM, HYDRA_PLATFORM, DORADO_PLATFORM, DRACO_PLATFORM, REDCLOUD_PLATFORM, OTHER_PLATFORM } SYS_BOARD; #define PNL_9210 0x01 #define PNL_9211_A 0x02 #define PNL_9211_C 0x04 #define PNL_UNKNOWN_CHIP 0x08 #define PNL_TFT 0x01 #define PNL_SSTN 0x02 #define PNL_DSTN 0x04 #define PNL_TWOP 0x08 #define PNL_UNKNOWN_PANEL 0x10 #define PNL_MONO_PANEL 0x01 #define PNL_COLOR_PANEL 0x02 #define PNL_UNKNOWN_COLOR 0x08 #define PNL_PANELPRESENT 0x01 #define PNL_PLATFORM 0x02 #define PNL_PANELCHIP 0x04 #define PNL_PANELSTAT 0x08 #define PNL_OVERRIDE_STAT 0x10 #define PNL_OVERRIDE_ALL 0x1F typedef struct _Pnl_PanelStat_ { int Type; int XRes; int YRes; int Depth; int MonoColor; } Pnl_PanelStat; typedef struct _Pnl_Params_ { unsigned long Flags; int PanelPresent; int Platform; int PanelChip; Pnl_PanelStat PanelStat; } Pnl_PanelParams, *PPnl_PanelParams; #endif /* _pnl_defs_h */ /* END OF FILE */ DirectFB-1.2.10/gfxdrivers/nsc/include/nsc_galproto.h0000644000175000017500000014762411164361026017410 00000000000000/* * $Workfile: nsc_galproto.h $ * $Revision: 1.3 $ * * File Contents: This file contains the main functions of the Geode * frame buffer device drivers GAL function prototypes and * data structures. * * Project: Geode Frame buffer device driver * */ /* NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * National Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * National Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * * Neither the name of the National Semiconductor Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * National Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the GNU General * Public License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ #ifndef __GALPROTO_SEP_20_2000 #define __GALPROTO_SEP_20_2000 /* durango reg definitions and type's */ #include #include /* Panel related definition */ #include typedef int SWORD; typedef unsigned int DWORD; typedef unsigned short WORD; typedef unsigned char CHAR; typedef unsigned char BOOLEAN; typedef unsigned int *PDWORD; /***************************************/ /* Applications/User mode drivers use this ioctl to * send a graphics device request to the frame buffer * driver */ #define FBIOGAL_API 0x4700 /* * Applications must sign the I/O packet with this value */ #define FBGAL_SIGNATURE 0xC0C0BABE /* * Version is a 16:16 fixed value * Current version is 1.0000 */ #define FBGAL_VERSION 0x10000 /* * Definitions for Graphics Subfunctions * */ typedef enum GALFN_CODES { /* General Adapter level functions */ GALFN_GETADAPTERINFO = 0, GALFN_SETSOFTVGASTATE, GALFN_GETSOFTVGASTATE, GALFN_WAITUNTILIDLE, GALFN_WAITVERTICALBLANK, GALFN_SETCRTENABLE, GALFN_WRITEREG, GALFN_READREG, /* Change/Get Display hardware state */ GALFN_ISDISPLAYMODESUPPORTED, GALFN_SETDISPLAYMODE, GALFN_GETDISPLAYMODE, GALFN_SETBPP, GALFN_SETDISPLAYBPP, GALFN_GETDISPLAYBPP, GALFN_SETDISPLAYPITCH, GALFN_GETDISPLAYPITCH, GALFN_SETDISPLAYOFFSET, GALFN_GETDISPLAYOFFSET, GALFN_DOTCLKTOREFRESH, GALFN_GETDISPLAYTIMINGS, GALFN_SETDISPLAYTIMINGS, GALFN_SETPALETTE, GALFN_GETPALETTE, GALFN_SETPALETTE_ENTRY, GALFN_GETPALETTE_ENTRY, GALFN_SETFIXEDTIMINGS, /* Hardware cursor funtions */ GALFN_SETCURSORENABLE, GALFN_GETCURSORENABLE, GALFN_SETCURSORPOSITION, GALFN_GETCURSORPOSITION, GALFN_SETCURSORCOLORS, GALFN_GETCURSORCOLORS, GALFN_SETCURSORSHAPE, GALFN_SETCURSORSHAPE_RCLD, /* grafix rendering funtions */ GALFN_SETSOLIDPATTERN, GALFN_SETRASTEROPERATION, GALFN_SETSOLIDSOURCE, GALFN_PATTERNFILL, GALFN_SETMONOSOURCE, GALFN_SETMONOPATTERN, GALFN_SCREENTOSCREENBLT, GALFN_SCREENTOSCREENXBLT, GALFN_BRESENHAMLINE, GALFN_COLOR_PATTERNFILL, GALFN_COLOR_BITMAP_TO_SCREEN_BLT, GALFN_COLOR_BITMAP_TO_SCREEN_XBLT, GALFN_MONO_BITMAP_TO_SCREEN_BLT, GALFN_TEXT_BLT, /* VGA Support functions */ GALFN_VGAMODESWITCH, GALFN_VGACLEARCRTEXT, GALFN_VGASETPITCH, GALFN_VGARESTORE, GALFN_VGASAVE, GALFN_VGASETMODE, /* Compression functions */ GALFN_SETCOMPRESSIONSTATE, GALFN_GETCOMPRESSIONSTATE, GALFN_SETCOMPRESSIONPARAMS, GALFN_GETCOMPRESSIONPARAMS, /* Panel Support functions */ GALFN_PNLSETPARAMS, GALFN_PNLGETPARAMS, GALFN_PNLINITPANEL, GALFN_PNLSAVESTATE, GALFN_PNLRESTORESTATE, GALFN_PNLPOWERUP, GALFN_PNLPOWERDOWN, GALFN_PNLBIOSENABLE, GALFN_PNLBIOSINFO, GALFN_ENABLEPANNING, /* TV Support functions */ GALFN_SETTVPARAMS, GALFN_GETTVPARAMS, GALFN_SETTVTIMING, GALFN_GETTVTIMING, GALFN_SETENABLE, GALFN_GETENABLE, GALFN_ISTVMODESUPPORTED, /* Video Support functions */ GALFN_SETVIDEOENABLE, GALFN_SETVIDEOFORMAT, GALFN_SETVIDEOSIZE, GALFN_SETVIDEOOFFSET, GALFN_SETVIDEOWINDOW, GALFN_SETVIDEOSCALE, GALFN_SETVIDEOFILTER, GALFN_SETVIDEOCOLORKEY, GALFN_SETVIDEODOWNSCALEENABLE, GALFN_SETVIDEODOWNSCALECONFIG, GALFN_SETVIDEODOWNSCALECOEFF, GALFN_SETVIDEOSOURCE, GALFN_SETVIDEOINTERLACED, GALFN_SETVIDEOCURSOR, GALFN_SETVIDEOREQUEST, GALFN_SETALPHAENABLE, GALFN_SETALPHAWINDOW, GALFN_SETALPHAVALUE, GALFN_SETALPHAPRIORITY, GALFN_SETALPHACOLOR, GALFN_SETALPHAREGION, GALFN_SETVIDEOOUTSIDEALPHA, GALFN_SETVIDEOPALETTE, GALFN_GETVIDEOINFO, GALFN_SETVIDEOCOLORSPACE, /* VIP Supported functions */ GALFN_SETVIPENABLE, GALFN_SETVIPCAPTURERUNMODE, GALFN_SETVIPBASE, GALFN_SETVIPPITCH, GALFN_SETVIPMODE, GALFN_SETVIPBRTH, GALFN_SETVIPLASTLINE, GALFN_TESTVIPODDFIELD, GALFN_TESTVIPBASESUPDATED, GALFN_SETVBIENABLE, GALFN_SETVBIMODE, GALFN_SETVBIBASE, GALFN_SETVBIPITCH, GALFN_SETVBIDIRECT, GALFN_SETVBIINTERRUPT, GALFN_SETGENLOCKENABLE, GALFN_SETTOPLINEINODD, GALFN_SETGENLOCKDELAY, GALFN_SETMACROVISIONENABLE, GALFN_GETVIPENABLE, GALFN_GETVIPBASE, GALFN_GETVIPPITCH, GALFN_GETVIPMODE, GALFN_GETVIPBRTH, GALFN_GETVIPLINE, GALFN_GETVBIENABLE, GALFN_GETVBIBASE, GALFN_GETVBIPITCH, GALFN_GETVBIMODE, GALFN_GETVBIDIRECT, GALFN_GETVBIINTERRUPT, GALFN_TESTVIPFIFOOVERFLOW, /* Second generation rendering routines */ GALFN_SETICONENABLE, GALFN_SETICONCOLORS, GALFN_SETICONPOSITION, GALFN_SETICONSHAPE64, GALFN_SETSOURCESTRIDE, GALFN_SETDESTINATIONSTRIDE, GALFN_SETSOURCETRANSPARENCY, GALFN_SETPATTERNORIGIN, GALFN_GFX2SETALPHAMODE, GALFN_GFX2SETALPHAVALUE, GALFN_GFX2PATTERNFILL, GALFN_GFX2COLORPATTERNFILL, GALFN_GFX2SCREENTOSCREENBLT, GALFN_GFX2MONOEXPANDBLT, GALFN_GFX2COLORBMPTOSCRBLT, GALFN_GFX2MONOBMPTOSCRBLT, GALFN_GFX2TEXTBLT, GALFN_GFX2BRESENHAMLINE, GALFN_GFX2SYNCTOVBLANK, /* Change/Get Video routines */ GALFN_SETCOLORSPACEYUV, GALFN_SETVIDEOYUVPITCH, GALFN_SETVIDEOYUVOFFSETS, GALFN_SETVIDEOLEFTCROP, GALFN_SETVIDEOVERTICALDOWNSCALE, GALFN_SETVBISOURCE, GALFN_SETVBILINES, GALFN_SETVBITOTAL, GALFN_SETVSCALEROFFSET, GALFN_GETVBISOURCE, GALFN_GETVBILINES, GALFN_GETVBITOTAL, GALFN_GETVSCALEROFFSET, GALFN_GETVIDEOINTERLACED, GALFN_GETCOLORSPACEYUV, GALFN_GETGENLOCKENABLE, GALFN_GETGENLOCKDELAY, GALFN_GETVIDEOCURSOR, GALFN_READCRC, GALFN_READWINDOWCRC, GALFN_GETMACROVISIONENABLE, GALFN_GETALPHAENABLE, GALFN_GETALPHASIZE, GALFN_GETALPHAVALUE, GALFN_GETALPHAPRIORITY, GALFN_GETALPHACOLOR, GALFN_GETVIDEOYUVPITCH, GALFN_GETVIDEOYUVOFFSETS, /* Additional VGA Support functions */ GALFN_VGATESTPCI, GALFN_VGAGETPCICOMMAND, GALFN_VGASEQRESET, GALFN_VGASETGRAPHICSBITS, /* This is last function supported. * If you want to define ioctl function. * You should define before this function. * Update that the lastfunction supported to new value. */ GALFN_LASTFUNCTION_SUPPORTED } GALFN_CODES; /* end of GAL function list */ #define GAL_HEADER\ DWORD dwSignature; /* Sign all structs with FBGAL_SIGNATURE */\ DWORD dwSize; /* Size of struct for that subfunction */\ DWORD dwVersion; /* Current version of the API */\ DWORD dwSubfunction; /* GAL subfunction */\ DWORD dwReturnValue; /* Return value from subfunction */ /* * #define GALFN_PNLPOWERUP * #define GALFN_PNLPOWERDOWN */ typedef struct __GAL_BASE { GAL_HEADER} GAL_BASE, *PGAL_BASE; /* * #define GALFN_GETADAPTERINFO */ typedef struct __GAL_GETADAPTERINFO { GAL_HEADER DWORD dwCPUVersion; DWORD dwCPUType; DWORD dwFrameBufferBase; DWORD dwFrameBufferSize; DWORD dwGfxRegisterBase; DWORD dwGpsRegisterBase; DWORD dwVidRegisterBase; DWORD dwVipRegisterBase; DWORD dwVideoVersion; DWORD dwMaxSupportedPixelClock; } GAL_ADAPTERINFO, *PGAL_ADAPTERINFO; #define GAL_SOFTVGASTATE_ENABLE 1 #define GAL_SOFTVGASTATE_DISABLE 0 /* * #define GALFN_SOFTVGASTATE */ typedef struct __GAL_SOFTVGASTATE { GAL_HEADER BOOLEAN bSoftVgaEnable; } GAL_SOFTVGASTATE, *PGAL_SOFTVGASTATE; /* * #define GALFN_WAITUNTILIDLE */ typedef struct __GAL_WAITUNTILIDLE { GAL_HEADER} GAL_WAITUNTILIDLE, *PGAL_WAITUNTILIDLE; /* * #define GALFN_WAITVERTICALBLANK */ typedef struct __GAL_WAITVERTICALBLANK { GAL_HEADER} GAL_WAITVERTICALBLANK, *PGAL_WAITVERTICALBLANK; #define GAL_REG 0x1 #define GAL_VID 0x2 #define GAL_VIP 0x4 /* * #define GALFN_WRITEREG * #define GALFN_READREG */ typedef struct __GAL_HWACCESS { GAL_HEADER DWORD dwType; DWORD dwOffset; DWORD dwValue; DWORD dwByteCount; } GAL_HWACCESS, *PGAL_HWACCESS; /* * #define GALFN_ISDISPLAYMODESUPPORTED * #define GALFN_SETDISPLAYMODE * #define GALFN_GETDISPLAYMODE */ typedef struct __GAL_DISPLAYMODE { GAL_HEADER WORD wXres; WORD wYres; WORD wBpp; WORD wRefresh; DWORD dwSupported; } GAL_DISPLAYMODE, *PGAL_DISPLAYMODE; /* * #define GALFN_SETBPP * #define GALFN_GETBPP * #define GALFN_SETPITCH * #define GALFN_GETPITCH * #define GALFN_SETOFFSET * #define GALFN_GETOFFSET */ typedef struct __GAL_DISPLAYPARAMS { GAL_HEADER DWORD dwOffset; WORD wBpp; WORD wPitch; } GAL_DISPLAYPARAMS, *PGAL_DISPLAYPARAMS; /* * #define GALFN_DOTCLKTOREFRESH */ typedef struct __GAL_DOTCLKTOREFRESH { GAL_HEADER DWORD dwDotClock; WORD wXres; WORD wYres; WORD wBpp; WORD wRefreshRate; } GAL_DOTCLKTOREFRESH, *PGAL_DOTCLKTOREFRESH; /* * #define GALFN_GETDISPLAYTIMINGS * #define GALFN_SETDISPLAYTIMINGS */ typedef struct __GAL_DISPLAYTIMING { GAL_HEADER DWORD dwDotClock; WORD wPitch; WORD wBpp; WORD wHTotal; WORD wHActive; WORD wHSyncStart; WORD wHSyncEnd; WORD wHBlankStart; WORD wHBlankEnd; WORD wVTotal; WORD wVActive; WORD wVSyncStart; WORD wVSyncEnd; WORD wVBlankStart; WORD wVBlankEnd; WORD wPolarity; } GAL_DISPLAYTIMING, *PGAL_DISPLAYTIMING; /* * #define GALFN_SETPALETTE_ENTRY * #define GALFN_GETPALETTE_ENTRY */ typedef struct __GAL_PALETTE_ENTRY { GAL_HEADER DWORD dwIndex; DWORD dwPalette; } GAL_PALETTE_ENTRY, *PGAL_PALETTE_ENTRY; /* * #define GALFN_SETPALETTE * #define GALFN_GETPALETTE */ typedef struct __GAL_PALETTE { GAL_HEADER DWORD dwColors[256]; } GAL_PALETTE, *PGAL_PALETTE; /* * #define GALFN_COMPRESSIONSTATE */ typedef struct __GAL_COMPRESSIONSTATE { GAL_HEADER BOOLEAN bCompressionState; } GAL_COMPRESSIONSTATE, *PGAL_COMPRESSIONSTATE; #define GAL_COMPRESSION_ENABLE 1 #define GAL_COMPRESSION_DISABLE 0 #define GAL_COMPRESSION_OFFSET 1 #define GAL_COMPRESSION_PITCH 2 #define GAL_COMPRESSION_SIZE 4 #define GAL_COMPRESSION_ALL 7 /* * #define GALFN_COMPRESSIONPARAMS */ typedef struct __GAL_COMPRESSIONPARAMS { GAL_HEADER DWORD dwFlags; DWORD dwCompOffset; WORD dwCompPitch; WORD dwCompSize; } GAL_COMPRESSIONPARAMS, *PGAL_COMPRESSIONPARAMS; #define GAL_SETCURSORENABLE_ENABLE 1 #define GAL_SETCURSORENABLE_DISABLE 0 /* * #define GALFN_CURSORENABLE */ typedef struct __GAL_CURSORENABLE { GAL_HEADER BOOLEAN bCursorEnable; } GAL_CURSORENABLE, *PGAL_CURSORENABLE; /* * #define GALFN_CURSORPOSITION */ typedef struct __GAL_CURSORPOSITION { GAL_HEADER DWORD dwMemOffset; WORD wXPos; WORD wYPos; WORD wXHot; WORD wYHot; } GAL_CURSORPOSITION, *PGAL_CURSORPOSITION; /* * #define GALFN_SETCURSORSHAPE */ typedef struct __GAL_SETCURSORSHAPE { GAL_HEADER DWORD dwMemOffset; DWORD dwAndMask[32]; /* Most gfx hardware support only 32x32 */ DWORD dwXorMask[32]; } GAL_SETCURSORSHAPE, *PGAL_SETCURSORSHAPE; /* * #define GALFN_SETCURSORCOLORS */ typedef struct __GAL_CURSORCOLORS { GAL_HEADER DWORD dwBgColor; DWORD dwFgColor; } GAL_CURSORCOLORS, *PGAL_CURSORCOLORS; /* * #define GALFN_SETSOLIDPATTERN */ typedef struct __GAL_SETSOLIDPATTERN { GAL_HEADER DWORD dwColor; } GAL_SETSOLIDPATTERN, *PGAL_SETSOLIDPATTERN; /* * #define GALFN_SETRASTEROPERATION */ typedef struct __GAL_SETRASTEROPERATION { GAL_HEADER CHAR cRop; } GAL_RASTEROPERATION, *PGAL_RASTEROPERATION; /* * #define GALFN_SETSOLIDSOURCE */ typedef struct __GAL_SETSOLIDSOURCE { GAL_HEADER DWORD dwColor; } GAL_SETSOLIDSOURCE, *PGAL_SETSOLIDSOURCE; /* * #define GALFN_PATTERNFILL */ typedef struct __GAL_PATTERNFILL { GAL_HEADER WORD wXPos; WORD wYPos; WORD wWidth; WORD wHeight; } GAL_PATTERNFILL, *PGAL_PATTERNFILL; /* * #define GALFN_SETMONOSOURCE */ typedef struct __GAL_SETMONOSOURCE { GAL_HEADER DWORD dwBgColor; DWORD dwFgColor; CHAR cTransparency; } GAL_SETMONOSOURCE, *PGAL_SETMONOSOURCE; /* * #define GALFN_SETMONOPATTERN */ typedef struct __GAL_SETMONOPATTERN { GAL_HEADER DWORD dwBgColor; DWORD dwFgColor; DWORD dwData0; DWORD dwData1; CHAR cTransparency; } GAL_SETMONOPATTERN, *PGAL_SETMONOPATTERN; /* * #define GALFN_SCREENTOSCREENBLT */ typedef struct __GAL_SCREENTOSCREENBLT { GAL_HEADER WORD wXStart; WORD wYStart; WORD wXEnd; WORD wYEnd; WORD wWidth; WORD wHeight; } GAL_SCREENTOSCREENBLT, *PGAL_SCREENTOSCREENBLT; /* * #define GALFN_SCREENTOSCREENXBLT */ typedef struct __GAL_SCREENTOSCREENXBLT { GAL_HEADER WORD wXStart; WORD wYStart; WORD wXEnd; WORD wYEnd; WORD wWidth; WORD wHeight; DWORD dwColor; } GAL_SCREENTOSCREENXBLT, *PGAL_SCREENTOSCREENXBLT; /* * #define GALFN_BRESENHAMLINE */ typedef struct __GAL_BRESENHAMLINE { GAL_HEADER WORD wX1; WORD wY1; WORD wLength; WORD wErr; WORD wE1; WORD wE2; WORD wFlags; } GAL_BRESENHAMLINE, *PGAL_BRESENHAMLINE; /* * #define GALFN_COLOR_PATTERNFILL */ typedef struct __GAL_COLOR_PATTERNFILL { GAL_HEADER WORD wDsty; WORD wDstx; WORD wWidth; WORD wHeight; DWORD dwPattern; } GAL_COLOR_PATTERNFILL, *PGAL_COLOR_PATTERNFILL; /* * #define GALFN_COLOR_BITMAP_TO_SCREEN_BLT */ typedef struct __GAL_COLOR_BITMAP_TO_SCREEN_BLT { GAL_HEADER WORD wSrcx; WORD wSrcy; WORD wDstx; WORD wDsty; WORD wWidth; WORD wHeight; DWORD dwData; WORD wPitch; } GAL_COLOR_BITMAP_TO_SCREEN_BLT, *PGAL_COLOR_BITMAP_TO_SCREEN_BLT; /* * #define GALFN_COLOR_BITMAP_TO_SCREEN_XBLT */ typedef struct __GAL_COLOR_BITMAP_TO_SCREEN_XBLT { GAL_HEADER WORD wSrcx; WORD wSrcy; WORD wDstx; WORD wDsty; WORD wWidth; WORD wHeight; DWORD dwData; WORD wPitch; DWORD dwColor; } GAL_COLOR_BITMAP_TO_SCREEN_XBLT, *PGAL_COLOR_BITMAP_TO_SCREEN_XBLT; /* * #define GALFN_MONO_BITMAP_TO_SCREEN_BLT */ typedef struct __GAL_MONO_BITMAP_TO_SCREEN_BLT { GAL_HEADER WORD wSrcx; WORD wSrcy; WORD wDstx; WORD wDsty; WORD wWidth; WORD wHeight; DWORD dwData; WORD wPitch; } GAL_MONO_BITMAP_TO_SCREEN_BLT, *PGAL_MONO_BITMAP_TO_SCREEN_BLT; /* * #define GALFN_TEXT_BLT */ typedef struct __GAL_TEXT_BLT { GAL_HEADER WORD wDstx; WORD wDsty; WORD wWidth; WORD wHeight; DWORD dwData; } GAL_TEXT_BLT, *PGAL_TEXT_BLT; /* * * #define GALFN_VGAMODESWITCH * * #define GALFN_VGACLEARCRTEXT * * #define GALFN_VGASETPITCH * * #define GALFN_VGARESTORE * * #define GALFN_VGASAVE * * #define GALFN_VGASETMODE */ typedef struct __GAL_VGAREGS { int xsize; int ysize; int hz; int clock; unsigned char miscOutput; unsigned char stdCRTCregs[GFX_STD_CRTC_REGS]; unsigned char extCRTCregs[GFX_EXT_CRTC_REGS]; } GAL_VGAREGS, *PGAL_VGAREGS; typedef struct __GAL_VGAMODEDATA { GAL_HEADER DWORD dwFlags; /* Flags for this subfunction */ GAL_VGAREGS sVgaRegs; /* CRT+SEQ+SEQ register data block */ WORD wXres; WORD wYres; WORD wBpp; WORD wRefresh; } GAL_VGAMODEDATA, *PGAL_VGAMODEDATA; typedef struct __GAL_VGATESTPCI { GAL_HEADER SWORD softvga; } GAL_VGATESTPCI, *PGAL_VGATESTPCI; typedef struct __GAL_VGAGETPCICOMMAND { GAL_HEADER unsigned char value; } GAL_VGAGETPCICOMMAND, *PGAL_VGAGETPCICOMMAND; typedef struct __GAL_VGASEQRESET { GAL_HEADER SWORD reset; SWORD statusok; } GAL_VGASEQRESET, *PGAL_VGASEQRESET; typedef struct __GAL_VGASETGRAPHICSBITS { GAL_HEADER SWORD statusok; } GAL_VGASETGRAPHICSBITS, *PGAL_VGASETGRAPHICSBITS; /******** Panel Support functions *********************/ /* * #define GALFN_PNLSETPARAMS * #define GALFN_PNLGETPARAMS * #define GALFN_PNLINITPANEL * #define GALFN_PNLSAVESTATE * #define GALFN_PNLRESTORESTATE */ typedef struct __GAL_PNLPARAMS { GAL_HEADER Pnl_PanelParams PanelParams; } GAL_PNLPARAMS, *PGAL_PNLPARAMS; /* * #define GALFN_PNLBIOSENABLE * #define GALFN_PNLBIOSINFO */ typedef struct __GAL_PNLBIOS { GAL_HEADER int state; int XRes; int YRes; int Bpp; int Freq; } GAL_PNLBIOS, *PGAL_PNLBIOS; typedef struct __GAL_ENABLEPANNING { GAL_HEADER int x; int y; } GAL_ENABLEPANNING, *PGAL_ENABLEPANNING; /* * #define GALFN_SETCRTENABLE * #define GALFN_GETCRTENABLE */ typedef struct __GAL_CRTENABLE { GAL_HEADER WORD wCrtEnable; } GAL_CRTENABLE, *PGAL_CRTENABLE; #define GAL_TVSTATE 0x01 #define GAL_TVOUTPUT 0x02 #define GAL_TVFORMAT 0x04 #define GAL_TVRESOLUTION 0x08 #define GAL_TVALL 0x0F /* * #define GALFN_SETTVPARAMS * #define GALFN_GETTVPARAMS * #define GALFN_SETENABLE * #define GALFN_GETENABLE * #define GALFN_ISTVMODESUPPORTED */ typedef struct __GAL_TVPARAMS { GAL_HEADER DWORD dwFlags; WORD wWidth; WORD wHeight; WORD wStandard; WORD wType; WORD wOutput; WORD wResolution; BOOLEAN bState; } GAL_TVPARAMS, *PGAL_TVPARAMS; /* * #define GALFN_SETTVTIMING * #define GALFN_GETTVTIMING */ typedef struct __GAL_TVTIMING { GAL_HEADER DWORD dwFlags; /* not used currently */ unsigned long HorzTim; unsigned long HorzSync; unsigned long VertSync; unsigned long LineEnd; unsigned long VertDownscale; unsigned long HorzScaling; unsigned long TimCtrl1; unsigned long TimCtrl2; unsigned long Subfreq; unsigned long DispPos; unsigned long DispSize; unsigned long Debug; unsigned long DacCtrl; unsigned long DotClock; } GAL_TVTIMING, *PGAL_TVTIMING; /******** Video Support functions *********************/ typedef struct __GAL_SETVIDEOENABLE { GAL_HEADER BOOLEAN enable; } GAL_VIDEOENABLE, *PGAL_VIDEOENABLE; typedef struct __GAL_SETVIDEOFORMAT { GAL_HEADER int format; } GAL_VIDEOFORMAT, *PGAL_VIDEOFORMAT; typedef struct __GAL_SETVIDEOSIZE { GAL_HEADER unsigned short width; unsigned short height; } GAL_VIDEOSIZE, *PGAL_VIDEOSIZE; typedef struct __GAL_SETVIDEOOFFSET { GAL_HEADER unsigned long offset; } GAL_VIDEOOFFSET, *PGAL_VIDEOOFFSET; typedef struct __GAL_SETVIDEOWINDOW { GAL_HEADER short x; short y; short w; short h; } GAL_VIDEOWINDOW, *PGAL_VIDEOWINDOW; typedef struct __GAL_SETVIDEOSCALE { GAL_HEADER unsigned short srcw; unsigned short srch; unsigned short dstw; unsigned short dsth; } GAL_VIDEOSCALE, *PGAL_VIDEOSCALE; typedef struct __GAL_SETVIDEOFILTER { GAL_HEADER int xfilter; int yfilter; } GAL_VIDEOFILTER, *PGAL_VIDEOFILTER; typedef struct __GAL_SETVIDEOCOLORKEY { GAL_HEADER unsigned long key; unsigned long mask; int bluescreen; } GAL_VIDEOCOLORKEY, *PGAL_VIDEOCOLORKEY; typedef struct __GAL_SETVIDEODOWNSCALEENABLE { GAL_HEADER int enable; } GAL_VIDEODOWNSCALEENABLE, *PGAL_VIDEODOWNSCALEENABLE; typedef struct __GAL_SETVIDEODOWNSCALECONFIG { GAL_HEADER unsigned short type; unsigned short m; } GAL_VIDEODOWNSCALECONFIG, *PGAL_VIDEODOWNSCALECONFIG; typedef struct __GAL_SETVIDEODOWNSCALECOEFF { GAL_HEADER unsigned short coef1; unsigned short coef2; unsigned short coef3; unsigned short coef4; } GAL_VIDEODOWNSCALECOEFF, *PGAL_VIDEODOWNSCALECOEFF; #define GAL_VIDEO_SOURCE_MEMORY 0x0 #define GAL_VIDEO_SOURCE_DVIP 0x1 typedef struct __GAL_SETVIDEOSOURCE { GAL_HEADER int source; } GAL_VIDEOSOURCE, *PGAL_VIDEOSOURCE; typedef struct __GAL_SETVIDEOINTERLACED { GAL_HEADER int enable; } GAL_SETVIDEOINTERLACED, *PGAL_SETVIDEOINTERLACED; typedef struct __GAL_GETVIDEOINTERLACED { GAL_HEADER int interlaced; } GAL_GETVIDEOINTERLACED, *PGAL_GETVIDEOINTERLACED; typedef struct __GAL_COLORSPACEYUV { GAL_HEADER int colorspace; } GAL_COLORSPACEYUV, *PGAL_COLORSPACEYUV; typedef struct __GAL_SETGENLOCKENABLE { GAL_HEADER int enable; } GAL_GENLOCKENABLE, *PGAL_GENLOCKENABLE; typedef struct __GAL_SETGENLOCKDELAY { GAL_HEADER int delay; } GAL_GENLOCKDELAY, *PGAL_GENLOCKDELAY; typedef struct __GAL_SETTOPLINEINODD { GAL_HEADER int enable; } GAL_TOPLINEINODD, *PGAL_TOPLINEINODD; typedef struct __GAL_SETVIDEOCURSOR { GAL_HEADER unsigned long key; unsigned long mask; unsigned short select_color2; unsigned long color1; unsigned long color2; } GAL_VIDEOCURSOR, *PGAL_VIDEOCURSOR; typedef struct __GAL_READCRC { GAL_HEADER DWORD crc; } GAL_READCRC, *PGAL_READCRC; typedef struct __GAL_READWINDOWCRC { GAL_HEADER SWORD source; WORD x; WORD y; WORD width; WORD height; SWORD crc32; DWORD crc; } GAL_READWINDOWCRC, *PGAL_READWINDOWCRC; typedef struct __GAL_GETALPHASIZE { GAL_HEADER WORD * x; WORD *y; WORD *width; WORD *height; } GAL_ALPHASIZE, *PGAL_ALPHASIZE; typedef struct __GAL_SETMACROVISIONENABLE { GAL_HEADER SWORD enable; } GAL_MACROVISIONENABLE, *PGAL_MACROVISIONENABLE; typedef struct __GAL_SETVIDEOREQUEST { GAL_HEADER short x; short y; } GAL_VIDEOREQUEST, *PGAL_VIDEOREQUEST; typedef struct __GAL_ALPHAENABLE { GAL_HEADER int enable; } GAL_ALPHAENABLE, *PGAL_ALPHAENABLE; typedef struct __GAL_SETALPHAWINDOW { GAL_HEADER short x; short y; unsigned short width; unsigned short height; } GAL_ALPHAWINDOW, *PGAL_ALPHAWINDOW; typedef struct __GAL_ALPHAVALUE { GAL_HEADER unsigned char alpha; char delta; } GAL_ALPHAVALUE, *PGAL_ALPHAVALUE; typedef struct __GAL_ALPHAPRIORITY { GAL_HEADER int priority; } GAL_ALPHAPRIORITY, *PGAL_ALPHAPRIORITY; typedef struct __GAL_ALPHACOLOR { GAL_HEADER unsigned long color; } GAL_ALPHACOLOR, *PGAL_ALPHACOLOR; typedef struct __GAL_SETALPHAREGION { GAL_HEADER int region; } GAL_ALPHAREGION, *PGAL_ALPHAREGION; typedef struct __GAL_SETVIDEOOUTSIDEALPHA { GAL_HEADER int enable; } GAL_VIDEOOUTSIDEALPHA, *PGAL_VIDEOOUTSIDEALPHA; typedef struct __GAL_SETVIDEOPALETTE { GAL_HEADER int identity; unsigned long palette[256]; } GAL_VIDEOPALETTE, *PGAL_VIDEOPALETTE; typedef struct __GAL_VIDEOINFO { GAL_HEADER int enable; int format; int filter; unsigned long src_size; unsigned long dst_size; unsigned long line_size; unsigned long xclip; unsigned long offset; unsigned long scale; unsigned long position; int color_key_src; unsigned long color_key; unsigned long color_key_mask; int downscale_enable; unsigned short downscale_type; unsigned short downscale_mask; unsigned short downscale_coef1; unsigned short downscale_coef2; unsigned short downscale_coef3; unsigned short downscale_coef4; } GAL_VIDEOINFO, *PGAL_VIDEOINFO; /* ICON related data strucures */ typedef struct __GAL_SETICONENABLE { GAL_HEADER SWORD enable; } GAL_ICONENABLE, *PGAL_ICONENABLE; typedef struct __GAL_SETICONCOLORS { GAL_HEADER DWORD color0; DWORD color1; DWORD color2; } GAL_ICONCOLORS, *PGAL_ICONCOLORS; typedef struct __GAL_SETICONPOSITION { GAL_HEADER DWORD memoffset; WORD xpos; } GAL_ICONPOSITION, *PGAL_ICONPOSITION; typedef struct __GAL_SETICONSHAPE64 { GAL_HEADER DWORD memoffset; DWORD *andmask; DWORD *xormask; DWORD lines; } GAL_ICONSHAPE64, *PGAL_ICONSHAPE64; /* VIP related data strucures */ typedef struct __GAL_SETVIPENABLE { GAL_HEADER SWORD enable; } GAL_VIPENABLE, *PGAL_VIPENABLE; typedef struct __GAL_SETVIPCAPTURERUNMODE { GAL_HEADER SWORD mode; } GAL_VIPCAPTURERUNMODE, *PGAL_VIPCAPTURERUNMODE; typedef struct __GAL_SETVIPBASE { GAL_HEADER DWORD even; DWORD odd; DWORD address; } GAL_VIPBASE, *PGAL_VIPBASE; typedef struct __GAL_SETVIPPITCH { GAL_HEADER DWORD pitch; } GAL_VIPPITCH, *PGAL_VIPPITCH; typedef struct __GAL_SETVIPMODE { GAL_HEADER SWORD mode; } GAL_VIPMODE, *PGAL_VIPMODE; typedef struct __GAL_SETVIPBUS_RTH { GAL_HEADER SWORD enable; } GAL_VIPBUS_RTH, *PGAL_VIPBUS_RTH; typedef struct __GAL_SETVIPLASTLINE { GAL_HEADER SWORD last_line; } GAL_VIPLASTLINE, *PGAL_VIPLASTLINE; typedef struct __GAL_TESTVIPODDFIELD { GAL_HEADER SWORD status; } GAL_TESTVIPODDFIELD, *PGAL_TESTVIPODDFIELD; typedef struct __GAL_TESTVIPBASESUPDATED { GAL_HEADER SWORD status; } GAL_TESTVIPBASESUPDATED, *PGAL_TESTVIPBASESUPDATED; typedef struct __GAL_TESTVIPFIFOOVERFLOW { GAL_HEADER SWORD status; } GAL_TESTVIPOVERFLOW, *PGAL_TESTVIPOVERFLOW; typedef struct __GAL_GETVIPLINE { GAL_HEADER SWORD status; } GAL_VIPLINE, *PGAL_VIPLINE; /* VBI related data strucures */ typedef struct __GAL_VBIENABLE { GAL_HEADER SWORD enable; } GAL_VBIENABLE, *PGAL_VBIENABLE; typedef struct __GAL_VBIBASE { GAL_HEADER DWORD even; DWORD odd; DWORD address; } GAL_VBIBASE, *PGAL_VBIBASE; typedef struct __GAL_VBIPITCH { GAL_HEADER DWORD pitch; } GAL_VBIPITCH, *PGAL_VBIPITCH; typedef struct __GAL_VBIMODE { GAL_HEADER SWORD mode; } GAL_VBIMODE, *PGAL_VBIMODE; typedef struct __GAL_SETVBIDIRECT { GAL_HEADER DWORD even_lines; DWORD odd_lines; } GAL_SETVBIDIRECT, *PGAL_SETVBIDIRECT; typedef struct __GAL_GETVBIDIRECT { GAL_HEADER SWORD odd; DWORD direct_lines; } GAL_GETVBIDIRECT, *PGAL_GETVBIDIRECT; typedef struct __GAL_VBIINTERRUPT { GAL_HEADER SWORD enable; } GAL_VBIINTERRUPT, *PGAL_VBIINTERRUPT; /* Second generation rendering routines data structures */ typedef struct __GAL_SETSTRIDE { GAL_HEADER WORD stride; } GAL_STRIDE, *PGAL_STRIDE; typedef struct __GAL_SETPATTERNORIGIN { GAL_HEADER int x; int y; } GAL_PATTERNORIGIN, *PGAL_PATTERNORIGIN; typedef struct __GAL_SETSOURCETRANSPARENCY { GAL_HEADER DWORD color; DWORD mask; } GAL_SOURCETRANSPARENCY, *PGAL_SOURCETRANSPARENCY; typedef struct __GAL_GFX2SETALPHAMODE { GAL_HEADER SWORD mode; } GAL_GFX2ALPHAMODE, *PGAL_GFX2ALPHAMODE; typedef struct __GAL_GFX2SETALPHAVALUE { GAL_HEADER CHAR value; } GAL_GFX2ALPHAVALUE, *PGAL_GFX2ALPHAVALUE; typedef struct __GAL_GFX2PATTERNFILL { GAL_HEADER DWORD dstoffset; WORD width; WORD height; } GAL_GFX2PATTERNFILL, *PGAL_GFX2PATTERNFILL; typedef struct __GAL_GFX2COLORPATTERNFILL { GAL_HEADER DWORD dstoffset; WORD width; WORD height; DWORD pattern; } GAL_GFX2COLORPATTERNFILL, *PGAL_GFX2COLORPATTERNFILL; typedef struct __GAL_GFX2SCREENTOSCREENBLT { GAL_HEADER DWORD srcoffset; DWORD dstoffset; WORD width; WORD height; SWORD flags; } GAL_GFX2SCREENTOSCREENBLT, *PGAL_GFX2SCREENTOSCREENBLT; typedef struct __GAL_GFX2MONOEXPANDBLT { GAL_HEADER unsigned long srcbase; WORD srcx; WORD srcy; DWORD dstoffset; WORD width; WORD height; WORD byte_packed; } GAL_GFX2MONOEXPANDBLT, *PGAL_GFX2MONOEXPANDBLT; typedef struct __GAL_GFX2COLORBMPTOSCRBLT { GAL_HEADER WORD srcx; WORD srcy; DWORD dstoffset; WORD width; WORD height; DWORD data; WORD pitch; } GAL_GFX2COLORBMPTOSCRBLT, *PGAL_GFX2COLORBMPTOSCRBLT; typedef struct __GAL_GFX2MONOBMPTOSCRBLT { GAL_HEADER WORD srcbase; WORD srcx; WORD srcy; DWORD dstoffset; WORD width; WORD height; DWORD data; WORD pitch; } GAL_GFX2MONOBMPTOSCRBLT, *PGAL_GFX2MONOBMPTOSCRBLT; typedef struct __GAL_GFX2TEXTBLT { GAL_HEADER DWORD dstoffset; WORD width; WORD height; DWORD data; } GAL_GFX2TEXTBLT, *PGAL_GFX2TEXTBLT; typedef struct __GAL_GFX2BRESENHAMLINE { GAL_HEADER DWORD dstoffset; WORD length; WORD initerr; WORD axialerr; WORD diagerr; WORD flags; } GAL_GFX2BRESENHAMLINE, *PGAL_GFX2BRESENHAMLINE; typedef struct __GAL_GFX2SYNCTOVBLANK { GAL_HEADER} GAL_GFX2SYNCTOVBLANK, *PGAL_GFX2SYNCTOVBLANK; /* GALFN_SETVIDEOYUVPITCH */ typedef struct _GAL_SETVIDEOYUVPITCH { GAL_HEADER unsigned long y_pitch; unsigned long uv_pitch; } GAL_VIDEOYUVPITCH, *PGAL_VIDEOYUVPITCH; /* GALFN_SETVIDEOYUVOFFSETS */ typedef struct _GAL_VIDEOYUVOFFSETS { GAL_HEADER unsigned long dwYoffset; unsigned long dwUoffset; unsigned long dwVoffset; } GAL_VIDEOYUVOFFSETS, *PGAL_VIDEOYUVOFFSETS; typedef struct __GAL_SETVIDEOLEFTCROP { GAL_HEADER WORD x; SWORD status; } GAL_VIDEOLEFTCROP, *PGAL_VIDEOLEFTCROP; typedef struct __GAL_SETVIDEOVERTICALDOWNSCALE { GAL_HEADER WORD srch; WORD dsth; SWORD status; } GAL_VIDEOVERTICALDOWNSCALE, *PGAL_VIDEOVERTICALDOWNSCALE; typedef struct __GAL_VBISOURCE { GAL_HEADER VideoSourceType source; SWORD status; } GAL_VBISOURCE, *PGAL_VBISOURCE; typedef struct __GAL_VBILINES { GAL_HEADER DWORD even; DWORD odd; SWORD status; DWORD lines; } GAL_VBILINES, *PGAL_VBILINES; typedef struct __GAL_VBITOTAL { GAL_HEADER DWORD even; DWORD odd; SWORD status; DWORD total; } GAL_VBITOTAL, *PGAL_VBITOTAL; typedef struct __GAL_VSCALEROFFSET { GAL_HEADER char offset; SWORD status; } GAL_VSCALEROFFSET, *PGAL_VSCALEROFFSET; /* MSR data strucures */ typedef struct __GAL_IDMSRDEVICE { GAL_HEADER MSR * pDev; DWORD address; DEV_STATUS dev_status; } GAL_IDMSRDEVICE, *PGAL_IDMSRDEVICE; typedef struct __GAL_GETMSRDEVADDRESS { GAL_HEADER WORD device; unsigned long address; DEV_STATUS dev_status; } GAL_GETMSRDEVADDRESS, *PGAL_GETMSRDEVADDRESS; typedef struct __GAL_GETMBUSIDATADDRESS { GAL_HEADER unsigned int device; unsigned long address; DEV_STATUS dev_status; } GAL_GETMBUSIDATADDRESS, *PGAL_GETMBUSIDATADDRESS; /* Gal device function's prototye declarations */ /** Init **********************************************************/ BOOLEAN Gal_initialize_interface(void); BOOLEAN Gal_cleanup_interface(void); BOOLEAN Gal_get_adapter_info(PGAL_ADAPTERINFO pAdapterInfo); BOOLEAN Gal_set_softvga_state(BOOLEAN); BOOLEAN Gal_get_softvga_state(int *bState); BOOLEAN Gal_set_crt_enable(int); BOOLEAN Gal_wait_until_idle(void); BOOLEAN Gal_wait_vertical_blank(void); BOOLEAN Gal_write_register(int type, unsigned long offset, unsigned long value, int size); BOOLEAN Gal_read_register(int type, unsigned long offset, unsigned long *value, int size); /** Display Engine ******************************************************/ BOOLEAN Gal_is_display_mode_supported(int xres, int yres, int bpp, int hz, int *supported); BOOLEAN Gal_set_display_mode(int xres, int yres, int bpp, int hz); BOOLEAN Gal_get_display_mode(int *xres, int *yres, int *bpp, int *hz); BOOLEAN Gal_set_bpp(unsigned short bpp); BOOLEAN Gal_set_display_bpp(unsigned short bpp); BOOLEAN Gal_get_display_bpp(unsigned short *bpp); BOOLEAN Gal_set_display_pitch(unsigned short pitch); BOOLEAN Gal_get_display_pitch(unsigned short *pitch); BOOLEAN Gal_set_display_offset(unsigned long offset); BOOLEAN Gal_get_display_offset(unsigned long *offset); BOOLEAN Gal_get_refreshrate_from_dotclock(int xres, int yres, int bpp, int *hz, unsigned long frequency); BOOLEAN Gal_get_display_timing(PGAL_DISPLAYTIMING pDisplayTiming); BOOLEAN Gal_set_display_timing(PGAL_DISPLAYTIMING pDisplayTiming); BOOLEAN Gal_set_fixed_timings(int pnlXres, int pnlYres, int totXres, int totYres, int bpp); BOOLEAN Gal_set_display_palette_entry(unsigned long index, unsigned long palette); BOOLEAN Gal_get_display_palette_entry(unsigned long index, unsigned long *palette); BOOLEAN Gal_set_display_palette(PGAL_PALETTE); BOOLEAN Gal_get_display_palette(PGAL_PALETTE); BOOLEAN Gal_set_cursor_enable(int enable); BOOLEAN Gal_get_cursor_enable(int *enable); BOOLEAN Gal_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); BOOLEAN Gal_get_cursor_colors(unsigned long *bkcolor, unsigned long *fgcolor); BOOLEAN Gal_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot); BOOLEAN Gal_get_cursor_position(unsigned long *memoffset, unsigned short *xpos, unsigned short *ypos, unsigned short *xhotspot, unsigned short *yhotspot); BOOLEAN Gal_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); BOOLEAN Gal_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); /** Render ********************************************************/ BOOLEAN Gal_set_solid_pattern(unsigned long color); BOOLEAN Gal_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned char transparency); BOOLEAN Gal_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparency); BOOLEAN Gal_set_raster_operation(unsigned char rop); BOOLEAN Gal_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height); BOOLEAN Gal_set_solid_source(unsigned long color); BOOLEAN Gal_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height); BOOLEAN Gal_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color); BOOLEAN Gal_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); BOOLEAN Gal_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long pattern); BOOLEAN Gal_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data, long pitch); BOOLEAN Gal_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data, long pitch, unsigned long color); BOOLEAN Gal_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data, short pitch); BOOLEAN Gal_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long data); /** Compression*******************************************************/ BOOLEAN Gal_set_compression_enable(BOOLEAN); BOOLEAN Gal_get_compression_enable(int *flag); BOOLEAN Gal_set_compression_parameters(unsigned long flags, unsigned long offset, unsigned short pitch, unsigned short size); BOOLEAN Gal_get_compression_parameters(unsigned long flags, unsigned long *offset, unsigned short *pitch, unsigned short *size); /** VGA **********************************************************/ BOOLEAN Gal_vga_mode_switch(int active); BOOLEAN Gal_vga_clear_extended(void); BOOLEAN Gal_vga_pitch(PGAL_VGAMODEDATA pvregs, unsigned short pitch); BOOLEAN Gal_vga_restore(PGAL_VGAMODEDATA pvregs); BOOLEAN Gal_vga_save(PGAL_VGAMODEDATA pvregs); BOOLEAN Gal_vga_mode(PGAL_VGAMODEDATA pvregs); BOOLEAN Gal_vga_test_pci(int *softvga); BOOLEAN Gal_vga_get_pci_command(unsigned char *value); BOOLEAN Gal_vga_seq_reset(int reset); BOOLEAN Gal_vga_set_graphics_bits(void); /** Panel **********************************************************/ BOOLEAN Gal_pnl_set_params(unsigned long flags, PPnl_PanelParams pParam); BOOLEAN Gal_pnl_get_params(unsigned long flags, PPnl_PanelParams pParam); BOOLEAN Gal_pnl_init(PPnl_PanelParams pParam); BOOLEAN Gal_pnl_save(void); BOOLEAN Gal_pnl_restore(void); BOOLEAN Gal_pnl_powerup(void); BOOLEAN Gal_pnl_powerdown(void); BOOLEAN Gal_enable_panning(int x, int y); BOOLEAN Gal_pnl_enabled_in_bios(int *state); BOOLEAN Gal_pnl_info_from_bios(int *xres, int *yres, int *bpp, int *hz); /** TV **********************************************************/ BOOLEAN Gal_tv_set_params(unsigned long flags, PGAL_TVPARAMS pTV); BOOLEAN Gal_tv_get_params(unsigned long flags, PGAL_TVPARAMS pTV); BOOLEAN Gal_tv_set_timings(unsigned long flags, PGAL_TVTIMING pTV); BOOLEAN Gal_tv_get_timings(unsigned long flags, PGAL_TVTIMING pTV); BOOLEAN Gal_set_tv_enable(int bState); BOOLEAN Gal_get_tv_enable(unsigned int *bState); BOOLEAN Gal_is_tv_mode_supported(unsigned long flags, PGAL_TVPARAMS pTV, int *bState); /** Video **********************************************************/ BOOLEAN Gal_set_video_enable(int enable); BOOLEAN Gal_set_video_format(int format); BOOLEAN Gal_set_video_size(unsigned short width, unsigned short height); BOOLEAN Gal_set_video_offset(unsigned long offset); BOOLEAN Gal_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset); BOOLEAN Gal_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); BOOLEAN Gal_set_video_window(short x, short y, short w, short h); BOOLEAN Gal_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); BOOLEAN Gal_set_video_filter(int xfilter, int yfilter); BOOLEAN Gal_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen); BOOLEAN Gal_set_video_downscale_enable(int enable); BOOLEAN Gal_set_video_downscale_config(unsigned short type, unsigned short m); BOOLEAN Gal_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4); BOOLEAN Gal_set_video_source(int source); BOOLEAN Gal_set_video_interlaced(int enable); BOOLEAN Gal_get_video_interlaced(int *interlaced); BOOLEAN Gal_set_color_space_YUV(int enable); BOOLEAN Gal_get_color_space_YUV(int *colorspace); BOOLEAN Gal_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2); BOOLEAN Gal_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned long *color2); BOOLEAN Gal_set_video_request(short x, short y); BOOLEAN Gal_set_alpha_enable(int enable); BOOLEAN Gal_get_alpha_enable(int *enable); BOOLEAN Gal_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height); BOOLEAN Gal_set_video_request(short x, short y); BOOLEAN Gal_set_alpha_window(short x, short y, unsigned short width, unsigned short height); BOOLEAN Gal_set_alpha_value(unsigned char alpha, char delta); BOOLEAN Gal_get_alpha_value(unsigned char *alpha, char *delta); BOOLEAN Gal_set_alpha_priority(int priority); BOOLEAN Gal_get_alpha_priority(int *priority); BOOLEAN Gal_set_alpha_color(unsigned long color); BOOLEAN Gal_get_alpha_color(unsigned long *color); BOOLEAN Gal_select_alpha_region(int region); BOOLEAN Gal_set_video_outside_alpha(int enable); BOOLEAN Gal_set_video_palette(unsigned long *palette); /* Icon related prototypes */ BOOLEAN Gal_set_icon_enable(int enable); BOOLEAN Gal_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2); BOOLEAN Gal_set_icon_position(unsigned long memoffset, unsigned short xpos); BOOLEAN Gal_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines); /* Icon related prototypes */ BOOLEAN Gal_set_vip_enable(int enable); BOOLEAN Gal_get_vip_enable(int *enable); BOOLEAN Gal_set_vip_capture_run_mode(int mode); BOOLEAN Gal_set_vip_base(unsigned long even, unsigned long odd); BOOLEAN Gal_get_vip_base(unsigned long *address, int odd); BOOLEAN Gal_set_vip_pitch(unsigned long pitch); BOOLEAN Gal_get_vip_pitch(unsigned long *pitch); BOOLEAN Gal_set_vip_mode(int mode); BOOLEAN Gal_get_vip_mode(int *mode); BOOLEAN Gal_set_vbi_enable(int enable); BOOLEAN Gal_get_vbi_enable(int *enable); BOOLEAN Gal_set_vbi_mode(int mode); BOOLEAN Gal_get_vbi_mode(int *mode); BOOLEAN Gal_set_vbi_base(unsigned long even, unsigned long odd); BOOLEAN Gal_get_vbi_base(unsigned long *address, int odd); BOOLEAN Gal_set_vbi_pitch(unsigned long pitch); BOOLEAN Gal_get_vbi_pitch(unsigned long *pitch); BOOLEAN Gal_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines); BOOLEAN Gal_get_vbi_direct(int odd, unsigned long *vbi_direct); BOOLEAN Gal_set_vbi_interrupt(int enable); BOOLEAN Gal_get_vbi_interrupt(int *enable); BOOLEAN Gal_set_vip_bus_request_threshold_high(int enable); BOOLEAN Gal_get_vip_bus_request_threshold_high(int *enable); BOOLEAN Gal_set_vip_last_line(int last_line); BOOLEAN Gal_test_vip_odd_field(int *status); BOOLEAN Gal_test_vip_bases_updated(int *status); BOOLEAN Gal_test_vip_fifo_overflow(int *status); BOOLEAN Gal_get_vip_line(int *status); /* Second generation rendering routines */ BOOLEAN Gal_set_source_stride(unsigned short stride); BOOLEAN Gal_set_destination_stride(unsigned short stride); BOOLEAN Gal_set_source_transparency(unsigned long color, unsigned long mask); BOOLEAN Gal2_set_source_transparency(unsigned long color, unsigned long mask); BOOLEAN Gal2_set_source_stride(unsigned short stride); BOOLEAN Gal2_set_destination_stride(unsigned short stride); BOOLEAN Gal2_set_pattern_origin(int x, int y); BOOLEAN Gal2_set_alpha_mode(int mode); BOOLEAN Gal2_set_alpha_value(unsigned char value); BOOLEAN Gal2_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height); BOOLEAN Gal2_color_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long pattern); BOOLEAN Gal2_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags); BOOLEAN Gal2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed); BOOLEAN Gal2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, unsigned short pitch); BOOLEAN Gal2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, unsigned short pitch); BOOLEAN Gal2_text_blt(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long data); BOOLEAN Gal2_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); BOOLEAN Gal2_sync_to_vblank(void); /* Video routines */ BOOLEAN Gal_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); BOOLEAN Gal_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch); BOOLEAN Gal_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset); BOOLEAN Gal_get_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset); BOOLEAN Gal_set_video_left_crop(unsigned short x); BOOLEAN Gal_set_video_vertical_downscale(unsigned short srch, unsigned short dsth); BOOLEAN Gal_set_vbi_source(VbiSourceType source); BOOLEAN Gal_get_vbi_source(VbiSourceType * source); BOOLEAN Gal_set_vbi_lines(unsigned long even, unsigned long odd); BOOLEAN Gal_get_vbi_lines(int odd, unsigned long *lines); BOOLEAN Gal_set_vbi_total(unsigned long even, unsigned long odd); BOOLEAN Gal_get_vbi_total(int odd, unsigned long *total); BOOLEAN Gal_set_vertical_scaler_offset(char offset); BOOLEAN Gal_get_vertical_scaler_offset(char *offset); BOOLEAN Gal_get_genlock_enable(int *enable); BOOLEAN Gal_set_genlock_enable(int flags); BOOLEAN Gal_get_genlock_delay(unsigned long *delay); BOOLEAN Gal_set_genlock_delay(unsigned long delay); BOOLEAN Gal_set_top_line_in_odd(int enable); BOOLEAN Gal_read_crc(unsigned long *crc); BOOLEAN Gal_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32, unsigned long *crc); BOOLEAN Gal_set_macrovision_enable(int enable); BOOLEAN Gal_get_macrovision_enable(int *enable); /* MSR routines */ BOOLEAN Gal_id_msr_dev_address(MSR * pDev, unsigned long address); BOOLEAN Gal_get_msr_dev_address(unsigned int device, unsigned long *address); #endif DirectFB-1.2.10/gfxdrivers/sh772x/0000777000175000017500000000000011307522571013452 500000000000000DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_jpeg.c0000644000175000017500000002736011245562152015503 00000000000000#ifdef SH7722_DEBUG_JPEG #define DIRECT_ENABLE_DEBUG #endif #include #include #undef HAVE_STDLIB_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sh7722.h" #include "sh7722_jpeglib.h" D_DEBUG_DOMAIN( SH7722_JPEG, "SH7722/JPEG", "SH7722 JPEG Processing Unit" ); /**********************************************************************************************************************/ static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ); static DFBResult Construct( IDirectFBImageProvider *thiz, ... ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, SH7722_JPEG ) /* * private data struct of IDirectFBImageProvider_SH7722_JPEG */ typedef struct { int ref; /* reference counter */ SH7722_JPEG_context info; CoreDFB *core; IDirectFBDataBuffer *buffer; DirectStream *stream; DIRenderCallback render_callback; void *render_callback_context; } IDirectFBImageProvider_SH7722_JPEG_data; /**********************************************************************************************************************/ static void IDirectFBImageProvider_SH7722_JPEG_Destruct( IDirectFBImageProvider *thiz ) { IDirectFBImageProvider_SH7722_JPEG_data *data = thiz->priv; data->buffer->Release( data->buffer ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBImageProvider_SH7722_JPEG_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_SH7722_JPEG) data->ref++; return DFB_OK; } static DirectResult IDirectFBImageProvider_SH7722_JPEG_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_SH7722_JPEG) if (--data->ref == 0) IDirectFBImageProvider_SH7722_JPEG_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBImageProvider_SH7722_JPEG_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *dest_rect ) { DFBResult ret; DFBRegion clip; DFBRectangle rect; IDirectFBSurface_data *dst_data; CoreSurface *dst_surface; CoreSurfaceBufferLock lock; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_SH7722_JPEG); if (!data->buffer) return DFB_BUFFEREMPTY; DIRECT_INTERFACE_GET_DATA_FROM(destination, dst_data, IDirectFBSurface); dst_surface = dst_data->surface; if (!dst_surface) return DFB_DESTROYED; dfb_region_from_rectangle( &clip, &dst_data->area.current ); if (dest_rect) { if (dest_rect->w < 1 || dest_rect->h < 1) return DFB_INVARG; rect.x = dest_rect->x + dst_data->area.wanted.x; rect.y = dest_rect->y + dst_data->area.wanted.y; rect.w = dest_rect->w; rect.h = dest_rect->h; } else rect = dst_data->area.wanted; if (!dfb_rectangle_region_intersects( &rect, &clip )) return DFB_OK; ret = dfb_surface_lock_buffer( dst_surface, CSBR_BACK, CSAF_GPU_WRITE, &lock ); if (ret) return ret; ret = SH7722_JPEG_Decode( &data->info, &rect, &clip, dst_surface->config.format, lock.phys, lock.addr, lock.pitch, dst_surface->config.size.w, dst_surface->config.size.h ); dfb_surface_unlock_buffer( dst_surface, &lock ); return ret; } static DFBResult IDirectFBImageProvider_SH7722_JPEG_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *context ) { DIRECT_INTERFACE_GET_DATA (IDirectFBImageProvider_SH7722_JPEG) data->render_callback = callback; data->render_callback_context = context; return DFB_OK; } static DFBResult IDirectFBImageProvider_SH7722_JPEG_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_SH7722_JPEG) if (!data->buffer) return DFB_BUFFEREMPTY; desc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; desc->height = data->info.height; desc->width = data->info.width; desc->pixelformat = data->info.mode420 ? DSPF_NV12 : DSPF_NV16; return DFB_OK; } static DFBResult IDirectFBImageProvider_SH7722_JPEG_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_SH7722_JPEG) if (!desc) return DFB_INVARG; if (!data->buffer) return DFB_BUFFEREMPTY; desc->caps = DICAPS_NONE; return DFB_OK; } static DFBResult IDirectFBImageProvider_SH7722_JPEG_WriteBack( IDirectFBImageProvider *thiz, IDirectFBSurface *surface, const DFBRectangle *src_rect, const char *filename ) { DFBResult ret; DFBRegion clip; DFBRectangle rect; IDirectFBSurface_data *src_data; CoreSurface *src_surface; CoreSurfaceBufferLock lock; DFBDimension jpeg_size; CoreSurface *tmp_surface; CoreSurfaceBufferLock tmp_lock; int tmp_pitch; unsigned int tmp_phys; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_SH7722_JPEG) if (!surface || !filename) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM(surface, src_data, IDirectFBSurface); D_DEBUG_AT( SH7722_JPEG, "%s - surface %p, rect %p to file %s\n", __FUNCTION__, surface, src_rect, filename ); src_surface = src_data->surface; if (!src_surface) return DFB_DESTROYED; switch (src_surface->config.format) { case DSPF_NV12: case DSPF_NV16: case DSPF_RGB16: case DSPF_RGB32: case DSPF_RGB24: break; default: /* FIXME: implement fallback */ D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } dfb_region_from_rectangle( &clip, &src_data->area.current ); if (src_rect) { if (src_rect->w < 1 || src_rect->h < 1) return DFB_INVARG; rect.x = src_rect->x + src_data->area.wanted.x; rect.y = src_rect->y + src_data->area.wanted.y; rect.w = src_rect->w; rect.h = src_rect->h; } else rect = src_data->area.wanted; if (!dfb_rectangle_region_intersects( &rect, &clip )) return DFB_INVAREA; jpeg_size.w = src_surface->config.size.w; jpeg_size.h = src_surface->config.size.h; /* it would be great if we had intermediate storage, since * this prevents handling the encoding in 16-line chunks, * causing scaling artefacts at the border of these chunks */ tmp_pitch = (jpeg_size.w + 3) & ~3; ret = dfb_surface_create_simple( data->core, tmp_pitch, jpeg_size.h, DSPF_NV16, DSCAPS_VIDEOONLY, CSTF_NONE, 0, 0, &tmp_surface ); if( ret ) { /* too bad, we proceed without */ D_DEBUG_AT( SH7722_JPEG, "%s - failed to create intermediate storage: %d\n", __FUNCTION__, ret ); tmp_surface = 0; tmp_phys = 0; } else { /* lock it to get the address */ ret = dfb_surface_lock_buffer( tmp_surface, CSBR_FRONT, CSAF_GPU_READ | CSAF_GPU_WRITE, &tmp_lock ); if (ret) { D_DEBUG_AT( SH7722_JPEG, "%s - failed to lock intermediate storage: %d\n", __FUNCTION__, ret ); dfb_surface_unref( tmp_surface ); tmp_surface = 0; tmp_phys = 0; } else { tmp_phys = tmp_lock.phys; D_DEBUG_AT( SH7722_JPEG, "%s - surface locked at %x\n", __FUNCTION__, tmp_phys ); } } ret = dfb_surface_lock_buffer( src_surface, CSBR_FRONT, CSAF_GPU_READ, &lock ); if ( ret == DFB_OK ) { ret = SH7722_JPEG_Encode( filename, &rect, src_surface->config.format, lock.phys, lock.pitch, jpeg_size.w, jpeg_size.h, tmp_phys ); dfb_surface_unlock_buffer( src_surface, &lock ); } if( tmp_surface ) { /* unlock and release the created surface */ dfb_surface_unlock_buffer( tmp_surface, &tmp_lock ); dfb_surface_unref( tmp_surface ); } return ret; } /**********************************************************************************************************************/ static DFBResult Probe( IDirectFBImageProvider_ProbeContext *ctx ) { SH7722DeviceData *sdev = dfb_gfxcard_get_device_data(); #ifndef JPU_SUPPORT return DFB_UNSUPPORTED; #endif if (sdev->sh772x != 7722) return DFB_UNSUPPORTED; /* Called with NULL when used for encoding. */ if (!ctx) return DFB_OK; if (ctx->header[0] == 0xff && ctx->header[1] == 0xd8 && ctx->filename) return DFB_OK; return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, ... ) { DFBResult ret; IDirectFBDataBuffer *buffer; CoreDFB *core; va_list tag; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_SH7722_JPEG); va_start( tag, thiz ); buffer = va_arg( tag, IDirectFBDataBuffer * ); core = va_arg( tag, CoreDFB * ); va_end( tag ); data->ref = 1; data->buffer = buffer; data->core = core; if (buffer) { IDirectFBDataBuffer_File_data *file_data; ret = buffer->AddRef( buffer ); if (ret) { DIRECT_DEALLOCATE_INTERFACE(thiz); return ret; } DIRECT_INTERFACE_GET_DATA_FROM( buffer, file_data, IDirectFBDataBuffer_File ); data->stream = file_data->stream; ret = SH7722_JPEG_Open( file_data->stream, &data->info ); if (ret) { buffer->Release( buffer ); DIRECT_DEALLOCATE_INTERFACE(thiz); return ret; } } thiz->AddRef = IDirectFBImageProvider_SH7722_JPEG_AddRef; thiz->Release = IDirectFBImageProvider_SH7722_JPEG_Release; thiz->RenderTo = IDirectFBImageProvider_SH7722_JPEG_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_SH7722_JPEG_SetRenderCallback; thiz->GetImageDescription = IDirectFBImageProvider_SH7722_JPEG_GetImageDescription; thiz->GetSurfaceDescription = IDirectFBImageProvider_SH7722_JPEG_GetSurfaceDescription; thiz->WriteBack = IDirectFBImageProvider_SH7722_JPEG_WriteBack; return DFB_OK; } DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_jpeglib.c0000644000175000017500000016041411164361026016165 00000000000000#ifdef SH7722_DEBUG_JPEG #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include #include #include #include #include #include #include #include #ifdef STANDALONE #include "sh7722_jpeglib_standalone.h" #else #undef HAVE_STDLIB_H #include #include #include #include #include #include #include #include #include #include #include #endif #include #include #include #include "sh7722_jpeglib.h" #include "sh7722_regs.h" D_DEBUG_DOMAIN( SH7722_JPEG, "SH7722/JPEG", "SH7722 JPEG Processing Unit" ); /**********************************************************************************************************************/ /* * private data struct of SH7722_JPEG */ typedef struct { int ref_count; int gfx_fd; SH772xGfxSharedArea *gfx_shared; unsigned long jpeg_phys; unsigned long jpeg_lb1; unsigned long jpeg_lb2; volatile void *jpeg_virt; unsigned long mmio_phys; volatile void *mmio_base; } SH7722_JPEG_data; /**********************************************************************************************************************/ #if 1 static inline u32 SH7722_GETREG32( SH7722_JPEG_data *data, u32 address ) { SH772xRegister reg = { address, 0 }; if (ioctl( data->gfx_fd, SH772xGFX_IOCTL_GETREG32, ® ) < 0) D_PERROR( "SH772xGFX_IOCTL_GETREG32( 0x%08x )\n", reg.address ); return reg.value; } static inline void SH7722_SETREG32( SH7722_JPEG_data *data, u32 address, u32 value ) { SH772xRegister reg = { address, value }; if (ioctl( data->gfx_fd, SH772xGFX_IOCTL_SETREG32, ® ) < 0) D_PERROR( "SH772xGFX_IOCTL_SETREG32( 0x%08x, 0x%08x )\n", reg.address, reg.value ); } #else static inline u32 SH7722_GETREG32( SH7722_JPEG_data *data, u32 address ) { D_ASSERT( address >= data->mmio_phys ); D_ASSERT( address < (data->mmio_phys + data->mmio_length) ); return *(volatile u32*)(data->mmio_base + (address - data->mmio_phys)); } static inline void SH7722_SETREG32( SH7722_JPEG_data *data, u32 address, u32 value ) { D_ASSERT( address >= data->mmio_phys ); D_ASSERT( address < (data->mmio_phys + data->mmio_length) ); *(volatile u32*)(data->mmio_base + (address - data->mmio_phys)) = value; } #endif static inline int coded_data_amount( SH7722_JPEG_data *data ) { return (SH7722_GETREG32(data, JCDTCU) << 16) | (SH7722_GETREG32(data, JCDTCM) << 8) | SH7722_GETREG32(data, JCDTCD); } /**********************************************************************************************************************/ static DirectResult DecodeHW( SH7722_JPEG_data *data, SH7722_JPEG_context *info, const DFBRectangle *rect, const DFBRegion *clip, DFBSurfacePixelFormat format, unsigned long phys, int pitch, unsigned int width, unsigned int height ) { DirectResult ret; unsigned int len; int i; int cw, ch; bool reload = false; SH772xGfxSharedArea *shared = data->gfx_shared; SH7722JPEG jpeg; u32 vtrcr = 0; u32 vswpout = 0; DirectStream *stream = info->stream; D_ASSERT( data != NULL ); DFB_RECTANGLE_ASSERT( rect ); DFB_REGION_ASSERT( clip ); cw = clip->x2 - clip->x1 + 1; ch = clip->y2 - clip->y1 + 1; if (cw < 1 || ch < 1) return DR_INVAREA; D_DEBUG_AT( SH7722_JPEG, "%s( %p, 0x%08lx|%d [%dx%d] %s )\n", __FUNCTION__, data, phys, pitch, info->width, info->height, dfb_pixelformat_name(format) ); D_DEBUG_AT( SH7722_JPEG, " -> %d,%d - %4dx%4d [clip %d,%d - %4dx%4d]\n", DFB_RECTANGLE_VALS( rect ), DFB_RECTANGLE_VALS_FROM_REGION( clip ) ); /* * Kernel based state machine * * Execution enters the kernel and only returns to user space for * - end of decoding * - error in decoding * - reload requested * * TODO * - finish clipping (maybe not all is possible without tricky code) * - modify state machine to be used by Construct(), GetSurfaceDescription() and RenderTo() to avoid redundancy * - check return code and length from GetData() */ /* No cropping of top or left edge :( */ if (clip->x1 > rect->x || clip->y1 > rect->y) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } /* Init VEU transformation control (format conversion). */ if (!info->mode420) vtrcr |= (1 << 14); switch (format) { case DSPF_NV12: vswpout = 0x70; break; case DSPF_NV16: vswpout = 0x70; vtrcr |= (1 << 22); break; case DSPF_RGB16: vswpout = 0x60; vtrcr |= (6 << 16) | 2; break; case DSPF_RGB32: vswpout = 0x40; vtrcr |= (19 << 16) | 2; break; case DSPF_RGB24: vswpout = 0x70; vtrcr |= (21 << 16) | 2; break; default: D_BUG( "unexpected format %s", dfb_pixelformat_name(format) ); return DR_BUG; } /* Calculate destination base address. */ phys += DFB_BYTES_PER_LINE(format, rect->x) + rect->y * pitch; jpeg.phys = phys; D_DEBUG_AT( SH7722_JPEG, " -> locking JPU...\n" ); if (ioctl( data->gfx_fd, SH7722GFX_IOCTL_LOCK_JPEG )) { ret = errno2result( errno ); D_PERROR( "SH7722/JPEG: Could not lock JPEG engine!\n" ); return ret; } D_DEBUG_AT( SH7722_JPEG, " -> loading...\n" ); /* Fill first reload buffer. */ ret = direct_stream_read( stream, SH7722GFX_JPEG_RELOAD_SIZE, (void*) data->jpeg_virt, &len ); if (ret) { ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); D_DERROR( ret, "SH7722/JPEG: Could not fill first reload buffer!\n" ); return DR_IO; } D_DEBUG_AT( SH7722_JPEG, " -> setting...\n" ); /* Initialize JPEG state. */ jpeg.state = SH7722_JPEG_START; jpeg.flags = 0; jpeg.buffers = 1; /* Enable reload if buffer was filled completely (coded data length >= one reload buffer). */ if (len == SH7722GFX_JPEG_RELOAD_SIZE) { jpeg.flags |= SH7722_JPEG_FLAG_RELOAD; reload = true; } /* Program JPU from RESET. */ SH7722_SETREG32( data, JCCMD, JCCMD_RESET ); SH7722_SETREG32( data, JCMOD, JCMOD_INPUT_CTRL | JCMOD_DSP_DECODE ); SH7722_SETREG32( data, JIFCNT, JIFCNT_VJSEL_JPU ); SH7722_SETREG32( data, JIFECNT, JIFECNT_SWAP_4321 ); SH7722_SETREG32( data, JIFDSA1, data->jpeg_phys ); SH7722_SETREG32( data, JIFDSA2, data->jpeg_phys + SH7722GFX_JPEG_RELOAD_SIZE ); SH7722_SETREG32( data, JIFDDRSZ, len & 0x00FFFF00 ); if (info->width == cw && info->height == ch && rect->w == cw && rect->h == ch && (( info->mode420 && format == DSPF_NV12) || (!info->mode420 && format == DSPF_NV16))) { /* Setup JPU for decoding in frame mode (directly to surface). */ SH7722_SETREG32( data, JINTE, JINTS_INS5_ERROR | JINTS_INS6_DONE | (reload ? JINTS_INS14_RELOAD : 0) ); SH7722_SETREG32( data, JIFDCNT, JIFDCNT_SWAP_4321 | (reload ? JIFDCNT_RELOAD_ENABLE : 0) ); SH7722_SETREG32( data, JIFDDYA1, phys ); SH7722_SETREG32( data, JIFDDCA1, phys + pitch * height ); SH7722_SETREG32( data, JIFDDMW, pitch ); } else { jpeg.flags |= SH7722_JPEG_FLAG_CONVERT; /* Setup JPU for decoding in line buffer mode. */ SH7722_SETREG32( data, JINTE, JINTS_INS5_ERROR | JINTS_INS6_DONE | JINTS_INS11_LINEBUF0 | JINTS_INS12_LINEBUF1 | (reload ? JINTS_INS14_RELOAD : 0) ); SH7722_SETREG32( data, JIFDCNT, JIFDCNT_LINEBUF_MODE | (SH7722GFX_JPEG_LINEBUFFER_HEIGHT << 16) | JIFDCNT_SWAP_4321 | (reload ? JIFDCNT_RELOAD_ENABLE : 0) ); SH7722_SETREG32( data, JIFDDYA1, data->jpeg_lb1 ); SH7722_SETREG32( data, JIFDDCA1, data->jpeg_lb1 + SH7722GFX_JPEG_LINEBUFFER_SIZE_Y ); SH7722_SETREG32( data, JIFDDYA2, data->jpeg_lb2 ); SH7722_SETREG32( data, JIFDDCA2, data->jpeg_lb2 + SH7722GFX_JPEG_LINEBUFFER_SIZE_Y ); SH7722_SETREG32( data, JIFDDMW, SH7722GFX_JPEG_LINEBUFFER_PITCH ); /* Setup VEU for conversion/scaling (from line buffer to surface). */ SH7722_SETREG32( data, VEU_VBSRR, 0x00000100 ); SH7722_SETREG32( data, VEU_VESTR, 0x00000000 ); SH7722_SETREG32( data, VEU_VESWR, SH7722GFX_JPEG_LINEBUFFER_PITCH ); SH7722_SETREG32( data, VEU_VESSR, (info->height << 16) | info->width ); SH7722_SETREG32( data, VEU_VBSSR, 16 ); SH7722_SETREG32( data, VEU_VEDWR, pitch ); SH7722_SETREG32( data, VEU_VDAYR, phys ); SH7722_SETREG32( data, VEU_VDACR, phys + pitch * height ); SH7722_SETREG32( data, VEU_VTRCR, vtrcr ); SH7722_SETREG32( data, VEU_VRFCR, (((info->height << 12) / rect->h) << 16) | ((info->width << 12) / rect->w) ); SH7722_SETREG32( data, VEU_VRFSR, (ch << 16) | cw ); SH7722_SETREG32( data, VEU_VENHR, 0x00000000 ); SH7722_SETREG32( data, VEU_VFMCR, 0x00000000 ); SH7722_SETREG32( data, VEU_VAPCR, 0x00000000 ); SH7722_SETREG32( data, VEU_VSWPR, 0x00000007 | vswpout ); SH7722_SETREG32( data, VEU_VEIER, 0x00000101 ); } D_DEBUG_AT( SH7722_JPEG, " -> starting...\n" ); /* Clear interrupts in shared flags. */ shared->jpeg_ints = 0; /* State machine. */ while (true) { /* Run the state machine. */ if (ioctl( data->gfx_fd, SH7722GFX_IOCTL_RUN_JPEG, &jpeg ) < 0) { ret = errno2result( errno ); D_PERROR( "SH7722/JPEG: SH7722GFX_IOCTL_RUN_JPEG failed!\n" ); break; } D_ASSERT( jpeg.state != SH7722_JPEG_START ); /* Handle end (or error). */ if (jpeg.state == SH7722_JPEG_END) { if (jpeg.error) { D_ERROR( "SH7722/JPEG: ERROR 0x%x!\n", jpeg.error ); ret = DR_IO; } break; } /* Check for reload requests. */ for (i=1; i<=2; i++) { if (jpeg.buffers & i) { if (jpeg.flags & SH7722_JPEG_FLAG_RELOAD) { D_ASSERT( reload ); ret = direct_stream_read( stream, SH7722GFX_JPEG_RELOAD_SIZE, (void*) data->jpeg_virt + SH7722GFX_JPEG_RELOAD_SIZE * (i-1), &len ); if (ret) { D_DERROR( ret, "SH7722/JPEG: Could not refill %s reload buffer!\n", i == 1 ? "first" : "second" ); jpeg.buffers &= ~i; jpeg.flags &= ~SH7722_JPEG_FLAG_RELOAD; } else if (len < SH7722GFX_JPEG_RELOAD_SIZE) jpeg.flags &= ~SH7722_JPEG_FLAG_RELOAD; } else jpeg.buffers &= ~i; } } } ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); return ret; } static int calculate_scaling( int input, int output ) { int frac = 0; int mant = 0; if( input == output ) { /* no scaling, done */ return 0; } mant = input / output; frac = ((input * 4096 / output) & ~7) - mant * 4096; if( input < output ) { /* upscaling */ if( input*8 < output ) /* out-of-range */ return -1; while( output > 1 + (int)((input-1)*4096/frac) ) { frac -= 8; } } else { /* downscaling */ int a,size,pmant; if( output*16 < input ) /* out-of-range */ return -1; while(1) { pmant = "1122333344444444"[mant] - '0'; a = mant * 4096 + frac; size = (2*(input-1)*pmant)/(2*pmant); size = (((size-1) * 4096 * pmant) + a) / a; if( output <= size ) break; if( frac ) frac -= 8; else { mant--; frac = 0xff8; } } } return (mant << 12) + frac; } static DirectResult EncodeHW( SH7722_JPEG_data *data, const char *filename, const DFBRectangle *rect, DFBSurfacePixelFormat format, unsigned long phys, int pitch, unsigned int width, unsigned int height, unsigned long tmpphys ) { DirectResult ret; int i, fd; int written = 0; SH772xGfxSharedArea *shared = data->gfx_shared; u32 vtrcr = 0; u32 vswpin = 0; bool mode420 = false; SH7722JPEG jpeg; int horizontalscaling = 0; int verticalscaling = 0; int clipwidth, clipheight; DFBRectangle cliprect; /* VEU has cliprequirement of 4 bytes, input and output must be 4 pixel aligned. * We have to be careful with scaling: take clipped output and input */ cliprect.h = (rect->h + 0x3) & ~0x3; cliprect.w = (rect->w + 0x3) & ~0x3; clipheight = (height + 0x3) & ~0x3; clipwidth = (width + 0x3) & ~0x3; D_ASSERT( data != NULL ); DFB_RECTANGLE_ASSERT( rect ); D_DEBUG_AT( SH7722_JPEG, "%s( %p, 0x%08lx|%d [%dx%d] %s )\n", __FUNCTION__, data, phys, pitch, width, height, dfb_pixelformat_name(format) ); D_DEBUG_AT( SH7722_JPEG, " -> %d,%d - %4dx%4d (at %lx)\n", DFB_RECTANGLE_VALS( rect ), tmpphys ); /* JPU input is 16x16 to 2560x1920 */ if (width < 16 || width > 2560 || height < 16 || height > 1920) return DR_INVAREA; if (rect->w < 1 || rect->h < 1) return DR_INVAREA; horizontalscaling = calculate_scaling( cliprect.w, clipwidth ); verticalscaling = calculate_scaling( cliprect.h, clipheight ); if( !tmpphys ) { /* we don't have enough memory, so we do it in 16 pixel steps */ int h = ((rect->h * SH7722GFX_JPEG_LINEBUFFER_HEIGHT / height) + 0x3) & ~0x3; verticalscaling = calculate_scaling( h, SH7722GFX_JPEG_LINEBUFFER_HEIGHT ); } /* scaling out-of-range? */ if( horizontalscaling == -1 || verticalscaling == -1 ) return DR_INVAREA; /* * Kernel based state machine * * Execution enters the kernel and only returns to user space for * - end of encoding * - error in encoding * - buffer loaded * * TODO * - finish clipping (maybe not all is possible without tricky code) */ /* Init VEU transformation control (format conversion). */ if (format == DSPF_NV12) mode420 = true; else vtrcr |= (1 << 22); switch (format) { case DSPF_NV12: vswpin = 0x07; break; case DSPF_NV16: vswpin = 0x07; vtrcr |= (1 << 14); break; case DSPF_RGB16: vswpin = 0x06; vtrcr |= (3 << 8) | 3; break; case DSPF_RGB32: vswpin = 0x04; vtrcr |= (0 << 8) | 3; break; case DSPF_RGB24: vswpin = 0x07; vtrcr |= (2 << 8) | 3; break; default: D_BUG( "unexpected format %s", dfb_pixelformat_name(format) ); return DR_BUG; } /* Calculate source base address. */ /* TODO: NV12 input with offset. Colour will be off.. */ phys += DFB_BYTES_PER_LINE(format, rect->x) + rect->y * pitch; jpeg.phys = phys; D_DEBUG_AT( SH7722_JPEG, " -> locking JPU...\n" ); if (ioctl( data->gfx_fd, SH7722GFX_IOCTL_LOCK_JPEG )) { ret = errno2result( errno ); D_PERROR( "SH7722/JPEG: Could not lock JPEG engine!\n" ); return ret; } D_DEBUG_AT( SH7722_JPEG, " -> opening '%s' for writing...\n", filename ); fd = open( filename, O_WRONLY | O_CREAT | O_TRUNC, 0644 ); if (fd < 0) { ret = errno2result( errno ); ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); D_PERROR( "SH7722/JPEG: Failed to open '%s' for writing!\n", filename ); return ret; } D_DEBUG_AT( SH7722_JPEG, " -> setting...\n" ); /* Initialize JPEG state. */ jpeg.state = SH7722_JPEG_START; jpeg.flags = SH7722_JPEG_FLAG_ENCODE; jpeg.buffers = 3; /* Always enable reload mode. */ jpeg.flags |= SH7722_JPEG_FLAG_RELOAD; /* Program JPU from RESET. */ SH7722_SETREG32( data, JCCMD, JCCMD_RESET ); SH7722_SETREG32( data, JCMOD, JCMOD_INPUT_CTRL | JCMOD_DSP_ENCODE | (mode420 ? 2 : 1) ); SH7722_SETREG32( data, JCQTN, 0x14 ); SH7722_SETREG32( data, JCHTN, 0x3C ); SH7722_SETREG32( data, JCDRIU, 0x02 ); SH7722_SETREG32( data, JCDRID, 0x00 ); SH7722_SETREG32( data, JCHSZU, width >> 8 ); SH7722_SETREG32( data, JCHSZD, width & 0xff ); SH7722_SETREG32( data, JCVSZU, height >> 8 ); SH7722_SETREG32( data, JCVSZD, height & 0xff ); SH7722_SETREG32( data, JIFCNT, JIFCNT_VJSEL_JPU ); SH7722_SETREG32( data, JIFDCNT, JIFDCNT_SWAP_4321 ); SH7722_SETREG32( data, JIFEDA1, data->jpeg_phys ); SH7722_SETREG32( data, JIFEDA2, data->jpeg_phys + SH7722GFX_JPEG_RELOAD_SIZE ); SH7722_SETREG32( data, JIFEDRSZ, SH7722GFX_JPEG_RELOAD_SIZE ); SH7722_SETREG32( data, JIFESHSZ, clipwidth ); SH7722_SETREG32( data, JIFESVSZ, clipheight ); if (width == rect->w && height == rect->h && (format == DSPF_NV12 || format == DSPF_NV16)) { D_DEBUG_AT( SH7722_JPEG, " -> no VEU needed\n" ); /* no scaling, and supported format - so no VEU needed */ /* Setup JPU for encoding in frame mode (directly from surface). */ SH7722_SETREG32( data, JINTE, JINTS_INS10_XFER_DONE | JINTS_INS13_LOADED ); SH7722_SETREG32( data, JIFECNT, JIFECNT_SWAP_4321 | JIFECNT_RELOAD_ENABLE | (mode420 ? 1 : 0) ); SH7722_SETREG32( data, JIFESYA1, phys ); SH7722_SETREG32( data, JIFESCA1, phys + pitch * height ); SH7722_SETREG32( data, JIFESMW, pitch ); } else { /* Setup JPU for encoding in line buffer mode. */ jpeg.flags |= SH7722_JPEG_FLAG_CONVERT; jpeg.height = height; jpeg.inputheight = rect->h; SH7722_SETREG32( data, JINTE, JINTS_INS11_LINEBUF0 | JINTS_INS12_LINEBUF1 | JINTS_INS10_XFER_DONE | JINTS_INS13_LOADED ); if( tmpphys ) { /* we have enough memory, so we just read one big "line" */ SH7722_SETREG32( data, JIFECNT, JIFECNT_LINEBUF_MODE | (height << 16) | JIFECNT_SWAP_4321 | JIFECNT_RELOAD_ENABLE | (mode420 ? 1 : 0) ); SH7722_SETREG32( data, JIFESYA1, tmpphys ); SH7722_SETREG32( data, JIFESCA1, tmpphys + clipwidth * height ); /* Y is 8bpp */ SH7722_SETREG32( data, JIFESMW, clipwidth ); } else { SH7722_SETREG32( data, JIFECNT, JIFECNT_LINEBUF_MODE | (SH7722GFX_JPEG_LINEBUFFER_HEIGHT << 16) | JIFECNT_SWAP_4321 | JIFECNT_RELOAD_ENABLE | (mode420 ? 1 : 0) ); SH7722_SETREG32( data, JIFESYA1, data->jpeg_lb1 ); SH7722_SETREG32( data, JIFESCA1, data->jpeg_lb1 + SH7722GFX_JPEG_LINEBUFFER_SIZE_Y ); SH7722_SETREG32( data, JIFESMW, SH7722GFX_JPEG_LINEBUFFER_PITCH ); } SH7722_SETREG32( data, JIFESYA2, data->jpeg_lb2 ); SH7722_SETREG32( data, JIFESCA2, data->jpeg_lb2 + SH7722GFX_JPEG_LINEBUFFER_SIZE_Y ); /* we will not use the VEU in burst mode since we cannot program the * destination addresses intermediately in line mode. */ SH7722_SETREG32( data, VEU_VBSRR, 0x00000100 ); SH7722_SETREG32( data, VEU_VESTR, 0x00000000 ); SH7722_SETREG32( data, VEU_VSAYR, phys ); SH7722_SETREG32( data, VEU_VSACR, phys + pitch * height ); SH7722_SETREG32( data, VEU_VESWR, pitch ); if( tmpphys ) { SH7722_SETREG32( data, VEU_VESSR, (cliprect.h << 16) | cliprect.w ); SH7722_SETREG32( data, VEU_VEDWR, clipwidth ); SH7722_SETREG32( data, VEU_VDAYR, tmpphys ); SH7722_SETREG32( data, VEU_VDACR, tmpphys + clipwidth * height ); SH7722_SETREG32( data, VEU_VRFSR, (clipheight << 16) | clipwidth ); } else { int h = ((rect->h * SH7722GFX_JPEG_LINEBUFFER_HEIGHT / height) + 0x3) & ~0x3; SH7722_SETREG32( data, VEU_VESSR, (h << 16) | cliprect.w ); SH7722_SETREG32( data, VEU_VEDWR, SH7722GFX_JPEG_LINEBUFFER_PITCH ); SH7722_SETREG32( data, VEU_VDAYR, data->jpeg_lb1 ); SH7722_SETREG32( data, VEU_VDACR, data->jpeg_lb1 + SH7722GFX_JPEG_LINEBUFFER_SIZE_Y ); SH7722_SETREG32( data, VEU_VRFSR, (SH7722GFX_JPEG_LINEBUFFER_HEIGHT << 16) | clipwidth ); } SH7722_SETREG32( data, VEU_VRFCR, (verticalscaling << 16) | horizontalscaling ); SH7722_SETREG32( data, VEU_VTRCR, vtrcr ); SH7722_SETREG32( data, VEU_VENHR, 0x00000000 ); SH7722_SETREG32( data, VEU_VFMCR, 0x00000000 ); SH7722_SETREG32( data, VEU_VAPCR, 0x00000000 ); SH7722_SETREG32( data, VEU_VSWPR, 0x00000070 | vswpin ); SH7722_SETREG32( data, VEU_VEIER, 0x00000101 ); } /* Init quantization tables. */ SH7722_SETREG32( data, JCQTBL0( 0), 0x100B0B0E ); SH7722_SETREG32( data, JCQTBL0( 1), 0x0C0A100E ); SH7722_SETREG32( data, JCQTBL0( 2), 0x0D0E1211 ); SH7722_SETREG32( data, JCQTBL0( 3), 0x10131828 ); SH7722_SETREG32( data, JCQTBL0( 4), 0x1A181616 ); SH7722_SETREG32( data, JCQTBL0( 5), 0x18312325 ); SH7722_SETREG32( data, JCQTBL0( 6), 0x1D283A33 ); SH7722_SETREG32( data, JCQTBL0( 7), 0x3D3C3933 ); SH7722_SETREG32( data, JCQTBL0( 8), 0x38374048 ); SH7722_SETREG32( data, JCQTBL0( 9), 0x5C4E4044 ); SH7722_SETREG32( data, JCQTBL0(10), 0x57453738 ); SH7722_SETREG32( data, JCQTBL0(11), 0x506D5157 ); SH7722_SETREG32( data, JCQTBL0(12), 0x5F626768 ); SH7722_SETREG32( data, JCQTBL0(13), 0x673E4D71 ); SH7722_SETREG32( data, JCQTBL0(14), 0x79706478 ); SH7722_SETREG32( data, JCQTBL0(15), 0x5C656763 ); SH7722_SETREG32( data, JCQTBL1( 0), 0x11121218 ); SH7722_SETREG32( data, JCQTBL1( 1), 0x15182F1A ); SH7722_SETREG32( data, JCQTBL1( 2), 0x1A2F6342 ); SH7722_SETREG32( data, JCQTBL1( 3), 0x38426363 ); SH7722_SETREG32( data, JCQTBL1( 4), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1( 5), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1( 6), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1( 7), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1( 8), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1( 9), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1(10), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1(11), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1(12), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1(13), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1(14), 0x63636363 ); SH7722_SETREG32( data, JCQTBL1(15), 0x63636363 ); /* Init huffman tables. */ SH7722_SETREG32( data, JCHTBD0(0), 0x00010501 ); SH7722_SETREG32( data, JCHTBD0(1), 0x01010101 ); SH7722_SETREG32( data, JCHTBD0(2), 0x01000000 ); SH7722_SETREG32( data, JCHTBD0(3), 0x00000000 ); SH7722_SETREG32( data, JCHTBD0(4), 0x00010203 ); SH7722_SETREG32( data, JCHTBD0(5), 0x04050607 ); SH7722_SETREG32( data, JCHTBD0(6), 0x08090A0B ); SH7722_SETREG32( data, JCHTBD1(0), 0x00030101 ); SH7722_SETREG32( data, JCHTBD1(1), 0x01010101 ); SH7722_SETREG32( data, JCHTBD1(2), 0x01010100 ); SH7722_SETREG32( data, JCHTBD1(3), 0x00000000 ); SH7722_SETREG32( data, JCHTBD1(4), 0x00010203 ); SH7722_SETREG32( data, JCHTBD1(5), 0x04050607 ); SH7722_SETREG32( data, JCHTBD1(6), 0x08090A0B ); SH7722_SETREG32( data, JCHTBA0( 0), 0x00020103 ); SH7722_SETREG32( data, JCHTBA0( 1), 0x03020403 ); SH7722_SETREG32( data, JCHTBA0( 2), 0x05050404 ); SH7722_SETREG32( data, JCHTBA0( 3), 0x0000017D ); SH7722_SETREG32( data, JCHTBA0( 4), 0x01020300 ); SH7722_SETREG32( data, JCHTBA0( 5), 0x04110512 ); SH7722_SETREG32( data, JCHTBA0( 6), 0x21314106 ); SH7722_SETREG32( data, JCHTBA0( 7), 0x13516107 ); SH7722_SETREG32( data, JCHTBA0( 8), 0x22711432 ); SH7722_SETREG32( data, JCHTBA0( 9), 0x8191A108 ); SH7722_SETREG32( data, JCHTBA0(10), 0x2342B1C1 ); SH7722_SETREG32( data, JCHTBA0(11), 0x1552D1F0 ); SH7722_SETREG32( data, JCHTBA0(12), 0x24336272 ); SH7722_SETREG32( data, JCHTBA0(13), 0x82090A16 ); SH7722_SETREG32( data, JCHTBA0(14), 0x1718191A ); SH7722_SETREG32( data, JCHTBA0(15), 0x25262728 ); SH7722_SETREG32( data, JCHTBA0(16), 0x292A3435 ); SH7722_SETREG32( data, JCHTBA0(17), 0x36373839 ); SH7722_SETREG32( data, JCHTBA0(18), 0x3A434445 ); SH7722_SETREG32( data, JCHTBA0(19), 0x46474849 ); SH7722_SETREG32( data, JCHTBA0(20), 0x4A535455 ); SH7722_SETREG32( data, JCHTBA0(21), 0x56575859 ); SH7722_SETREG32( data, JCHTBA0(22), 0x5A636465 ); SH7722_SETREG32( data, JCHTBA0(23), 0x66676869 ); SH7722_SETREG32( data, JCHTBA0(24), 0x6A737475 ); SH7722_SETREG32( data, JCHTBA0(25), 0x76777879 ); SH7722_SETREG32( data, JCHTBA0(26), 0x7A838485 ); SH7722_SETREG32( data, JCHTBA0(27), 0x86878889 ); SH7722_SETREG32( data, JCHTBA0(28), 0x8A929394 ); SH7722_SETREG32( data, JCHTBA0(29), 0x95969798 ); SH7722_SETREG32( data, JCHTBA0(30), 0x999AA2A3 ); SH7722_SETREG32( data, JCHTBA0(31), 0xA4A5A6A7 ); SH7722_SETREG32( data, JCHTBA0(32), 0xA8A9AAB2 ); SH7722_SETREG32( data, JCHTBA0(33), 0xB3B4B5B6 ); SH7722_SETREG32( data, JCHTBA0(34), 0xB7B8B9BA ); SH7722_SETREG32( data, JCHTBA0(35), 0xC2C3C4C5 ); SH7722_SETREG32( data, JCHTBA0(36), 0xC6C7C8C9 ); SH7722_SETREG32( data, JCHTBA0(37), 0xCAD2D3D4 ); SH7722_SETREG32( data, JCHTBA0(38), 0xD5D6D7D8 ); SH7722_SETREG32( data, JCHTBA0(39), 0xD9DAE1E2 ); SH7722_SETREG32( data, JCHTBA0(40), 0xE3E4E5E6 ); SH7722_SETREG32( data, JCHTBA0(41), 0xE7E8E9EA ); SH7722_SETREG32( data, JCHTBA0(42), 0xF1F2F3F4 ); SH7722_SETREG32( data, JCHTBA0(43), 0xF5F6F7F8 ); SH7722_SETREG32( data, JCHTBA0(44), 0xF9FA0000 ); SH7722_SETREG32( data, JCHTBA1( 0), 0x00020102 ); SH7722_SETREG32( data, JCHTBA1( 1), 0x04040304 ); SH7722_SETREG32( data, JCHTBA1( 2), 0x07050404 ); SH7722_SETREG32( data, JCHTBA1( 3), 0x00010277 ); SH7722_SETREG32( data, JCHTBA1( 4), 0x00010203 ); SH7722_SETREG32( data, JCHTBA1( 5), 0x11040521 ); SH7722_SETREG32( data, JCHTBA1( 6), 0x31061241 ); SH7722_SETREG32( data, JCHTBA1( 7), 0x51076171 ); SH7722_SETREG32( data, JCHTBA1( 8), 0x13223281 ); SH7722_SETREG32( data, JCHTBA1( 9), 0x08144291 ); SH7722_SETREG32( data, JCHTBA1(10), 0xA1B1C109 ); SH7722_SETREG32( data, JCHTBA1(11), 0x233352F0 ); SH7722_SETREG32( data, JCHTBA1(12), 0x156272D1 ); SH7722_SETREG32( data, JCHTBA1(13), 0x0A162434 ); SH7722_SETREG32( data, JCHTBA1(14), 0xE125F117 ); SH7722_SETREG32( data, JCHTBA1(15), 0x18191A26 ); SH7722_SETREG32( data, JCHTBA1(16), 0x2728292A ); SH7722_SETREG32( data, JCHTBA1(17), 0x35363738 ); SH7722_SETREG32( data, JCHTBA1(18), 0x393A4344 ); SH7722_SETREG32( data, JCHTBA1(19), 0x45464748 ); SH7722_SETREG32( data, JCHTBA1(20), 0x494A5354 ); SH7722_SETREG32( data, JCHTBA1(21), 0x55565758 ); SH7722_SETREG32( data, JCHTBA1(22), 0x595A6364 ); SH7722_SETREG32( data, JCHTBA1(23), 0x65666768 ); SH7722_SETREG32( data, JCHTBA1(24), 0x696A7374 ); SH7722_SETREG32( data, JCHTBA1(25), 0x75767778 ); SH7722_SETREG32( data, JCHTBA1(26), 0x797A8283 ); SH7722_SETREG32( data, JCHTBA1(27), 0x84858687 ); SH7722_SETREG32( data, JCHTBA1(28), 0x88898A92 ); SH7722_SETREG32( data, JCHTBA1(29), 0x93949596 ); SH7722_SETREG32( data, JCHTBA1(30), 0x9798999A ); SH7722_SETREG32( data, JCHTBA1(31), 0xA2A3A4A5 ); SH7722_SETREG32( data, JCHTBA1(32), 0xA6A7A8A9 ); SH7722_SETREG32( data, JCHTBA1(33), 0xAAB2B3B4 ); SH7722_SETREG32( data, JCHTBA1(34), 0xB5B6B7B8 ); SH7722_SETREG32( data, JCHTBA1(35), 0xB9BAC2C3 ); SH7722_SETREG32( data, JCHTBA1(36), 0xC4C5C6C7 ); SH7722_SETREG32( data, JCHTBA1(37), 0xC8C9CAD2 ); SH7722_SETREG32( data, JCHTBA1(38), 0xD3D4D5D6 ); SH7722_SETREG32( data, JCHTBA1(39), 0xD7D8D9DA ); SH7722_SETREG32( data, JCHTBA1(40), 0xE2E3E4E5 ); SH7722_SETREG32( data, JCHTBA1(41), 0xE6E7E8E9 ); SH7722_SETREG32( data, JCHTBA1(42), 0xEAF2F3F4 ); SH7722_SETREG32( data, JCHTBA1(43), 0xF5F6F7F8 ); SH7722_SETREG32( data, JCHTBA1(44), 0xF9FA0000 ); /* Clear interrupts in shared flags. */ shared->jpeg_ints = 0; D_DEBUG_AT( SH7722_JPEG, " -> starting...\n" ); /* State machine. */ while (true) { /* Run the state machine. */ if (ioctl( data->gfx_fd, SH7722GFX_IOCTL_RUN_JPEG, &jpeg ) < 0) { ret = errno2result( errno ); D_PERROR( "SH7722/JPEG: SH7722GFX_IOCTL_RUN_JPEG failed!\n" ); break; } D_ASSERT( jpeg.state != SH7722_JPEG_START ); /* Check for loaded buffers. */ for (i=1; i<=2; i++) { if (jpeg.buffers & i) { int amount = coded_data_amount( data ) - written; if (amount > SH7722GFX_JPEG_RELOAD_SIZE) amount = SH7722GFX_JPEG_RELOAD_SIZE; D_INFO( "SH7722/JPEG: Coded data amount: + %5d (buffer %d)\n", amount, i ); written += write( fd, (void*) data->jpeg_virt + SH7722GFX_JPEG_RELOAD_SIZE * (i-1), amount ); } } /* Handle end (or error). */ if (jpeg.state == SH7722_JPEG_END) { if (jpeg.error) { D_ERROR( "SH7722/JPEG: ERROR 0x%x!\n", jpeg.error ); ret = DR_IO; } break; } } D_INFO( "SH7722/JPEG: Coded data amount: = %5d (written: %d, buffers: %d)\n", coded_data_amount( data ), written, jpeg.buffers ); ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); close( fd ); return DR_OK; } #if 0 static DirectResult DecodeHeader( SH7722_JPEG_data *data, DirectStream *stream, SH7722_JPEG_context *info ) { DirectResult ret; unsigned int len; SH772xGfxSharedArea *shared; D_DEBUG_AT( SH7722_JPEG, "%s( %p )\n", __FUNCTION__, data ); D_ASSERT( data != NULL ); shared = data->gfx_shared; /* * Do minimal stuff to decode the image header, serving as a good probe mechanism as well. */ D_DEBUG_AT( SH7722_JPEG, " -> locking JPU...\n" ); if (ioctl( data->gfx_fd, SH7722GFX_IOCTL_LOCK_JPEG )) { ret = errno2result( errno ); D_PERROR( "SH7722/JPEG: Could not lock JPEG engine!\n" ); return ret; } D_DEBUG_AT( SH7722_JPEG, " -> loading 32k...\n" ); /* Prefill reload buffer with 32k. */ ret = direct_stream_peek( stream, 32*1024, 0, (void*) data->jpeg_virt, &len ); if (ret) { ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); D_DEBUG_AT( SH7722_JPEG, " -> ERROR from PeekData(): %s\n", DirectResultString(ret) ); return DR_IO; } D_DEBUG_AT( SH7722_JPEG, " -> %u bytes loaded, setting...\n", len ); /* Program JPU from RESET. */ SH7722_SETREG32( data, JCCMD, JCCMD_RESET ); SH7722_SETREG32( data, JCMOD, JCMOD_INPUT_CTRL | JCMOD_DSP_DECODE ); SH7722_SETREG32( data, JINTE, JINTS_INS3_HEADER | JINTS_INS5_ERROR ); SH7722_SETREG32( data, JIFCNT, JIFCNT_VJSEL_JPU ); SH7722_SETREG32( data, JIFECNT, JIFECNT_SWAP_4321 ); SH7722_SETREG32( data, JIFDCNT, JIFDCNT_SWAP_4321 ); SH7722_SETREG32( data, JIFDSA1, data->jpeg_phys ); SH7722_SETREG32( data, JIFDDRSZ, len ); D_DEBUG_AT( SH7722_JPEG, " -> starting...\n" ); /* Clear interrupts in shared flags. */ shared->jpeg_ints = 0; /* Start decoder and begin reading from buffer. */ SH7722_SETREG32( data, JCCMD, JCCMD_START ); /* Stall machine. */ while (true) { /* Check for new interrupts in shared flags... */ u32 ints = shared->jpeg_ints; if (ints) { /* ...and clear them (FIXME: race condition in case of multiple IRQs per command!). */ shared->jpeg_ints &= ~ints; D_DEBUG_AT( SH7722_JPEG, " -> JCSTS 0x%08x, JINTS 0x%08x\n", SH7722_GETREG32( data, JCSTS ), ints ); /* Check for errors! */ if (ints & JINTS_INS5_ERROR) { D_ERROR( "SH7722/JPEG: ERROR 0x%x!\n", SH7722_GETREG32( data, JCDERR ) ); ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); return DR_IO; } /* Check for header interception... */ if (ints & JINTS_INS3_HEADER) { /* ...remember image information... */ info->width = SH7722_GETREG32( data, JIFDDHSZ ); info->height = SH7722_GETREG32( data, JIFDDVSZ ); info->mode420 = (SH7722_GETREG32( data, JCMOD ) & 2) ? true : false; D_DEBUG_AT( SH7722_JPEG, " -> %dx%d (4:2:%c)\n", info->width, info->height, info->mode420 ? '0' : '2' ); break; } } else { D_DEBUG_AT( SH7722_JPEG, " -> waiting...\n" ); /* ...otherwise wait for the arrival of new interrupt(s). */ if (ioctl( data->gfx_fd, SH7722GFX_IOCTL_WAIT_JPEG ) < 0) { D_PERROR( "SH7722/JPEG: Waiting for IRQ failed! (ints: 0x%x - JINTS 0x%x, JCSTS 0x%x)\n", ints, SH7722_GETREG32( data, JINTS ), SH7722_GETREG32( data, JCSTS ) ); ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); return DR_FAILURE; } } } ioctl( data->gfx_fd, SH7722GFX_IOCTL_UNLOCK_JPEG ); if (info->width < 16 || info->width > 2560) return DR_UNSUPPORTED; if (info->height < 16 || info->height > 1920) return DR_UNSUPPORTED; return DR_OK; } #endif /**********************************************************************************************************************/ static void write_rgb_span( u8 *src, void *dst, int len, DFBSurfacePixelFormat format ) { int i; switch (format) { case DSPF_RGB332: for (i = 0; i < len; i++) ((u8*)dst)[i] = PIXEL_RGB332( src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_ARGB1555: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_ARGB1555( 0xff, src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_ARGB2554: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_ARGB2554( 0xff, src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_ARGB4444: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_ARGB4444( 0xff, src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_RGB16: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_RGB16( src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_RGB24: direct_memcpy( dst, src, len*3 ); break; case DSPF_RGB32: for (i = 0; i < len; i++) ((u32*)dst)[i] = PIXEL_RGB32( src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_ARGB: for (i = 0; i < len; i++) ((u32*)dst)[i] = PIXEL_ARGB( 0xff, src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_AiRGB: for (i = 0; i < len; i++) ((u32*)dst)[i] = PIXEL_AiRGB( 0xff, src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_RGB555: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_RGB555( src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_BGR555: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_BGR555( src[i*3+0], src[i*3+1], src[i*3+2] ); break; case DSPF_RGB444: for (i = 0; i < len; i++) ((u16*)dst)[i] = PIXEL_RGB444( src[i*3+0], src[i*3+1], src[i*3+2] ); break; default: D_ONCE( "unimplemented destination format (0x%08x)", format ); break; } } static inline void copy_line_nv16( u16 *yy, u16 *cbcr, const u8 *src_ycbcr, int width ) { int x; D_ASSUME( !(width & 1) ); for (x=0; x> 1); src_ycbcr += 6; } } static inline void copy_line_y( u16 *yy, const u8 *src_ycbcr, int width ) { int x; D_ASSUME( !(width & 1) ); for (x=0; xx2 - clip->x1 + 1; ch = clip->y2 - clip->y1 + 1; if (cw < 1 || ch < 1) return DR_INVAREA; D_DEBUG_AT( SH7722_JPEG, "%s( %p, %p|%d [%dx%d] %s )\n", __FUNCTION__, info, addr, pitch, info->width, info->height, dfb_pixelformat_name(format) ); D_DEBUG_AT( SH7722_JPEG, " -> %d,%d - %4dx%4d [clip %d,%d - %4dx%4d]\n", DFB_RECTANGLE_VALS( rect ), DFB_RECTANGLE_VALS_FROM_REGION( clip ) ); /* No cropping or clipping yet :( */ if (clip->x1 != 0 || clip->y1 != 0 || clip->x2 != rect->w - 1 || clip->y2 != rect->h - 1 || rect->w != width || rect->h != height) { D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } info->cinfo.output_components = 3; /* Calculate destination base address. */ addr += DFB_BYTES_PER_LINE( format, rect->x ) + rect->y * pitch; /* Not all formats yet :( */ switch (format) { case DSPF_RGB332: case DSPF_ARGB1555: case DSPF_ARGB2554: case DSPF_ARGB4444: case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: case DSPF_AiRGB: case DSPF_RGB555: case DSPF_BGR555: case DSPF_RGB444: info->cinfo.out_color_space = JCS_RGB; break; case DSPF_NV12: if (rect->x & 1) return DFB_INVARG; if (rect->y & 1) return DFB_INVARG; addr_uv += rect->x + rect->y / 2 * pitch; info->cinfo.out_color_space = JCS_YCbCr; break; case DSPF_NV16: if (rect->x & 1) return DFB_INVARG; addr_uv += rect->x + rect->y * pitch; info->cinfo.out_color_space = JCS_YCbCr; break; default: D_UNIMPLEMENTED(); return DR_UNIMPLEMENTED; } D_DEBUG_AT( SH7722_JPEG, " -> decoding...\n" ); jpeg_start_decompress( &info->cinfo ); row_stride = ((info->cinfo.output_width + 1) & ~1) * 3; buffer = (*info->cinfo.mem->alloc_sarray)((j_common_ptr) &info->cinfo, JPOOL_IMAGE, row_stride, 1); while (info->cinfo.output_scanline < info->cinfo.output_height) { jpeg_read_scanlines( &info->cinfo, buffer, 1 ); switch (format) { case DSPF_NV12: if (info->cinfo.output_scanline & 1) { copy_line_nv16( addr, addr_uv, *buffer, (rect->w + 1) & ~1 ); addr_uv += pitch; } else copy_line_y( addr, *buffer, (rect->w + 1) & ~1 ); break; case DSPF_NV16: copy_line_nv16( addr, addr_uv, *buffer, (rect->w + 1) & ~1 ); addr_uv += pitch; break; default: write_rgb_span( *buffer, addr, rect->w, format ); break; } addr += pitch; } jpeg_finish_decompress( &info->cinfo ); return DFB_OK; } /**********************************************************************************************************************/ static DirectResult Initialize_GFX( SH7722_JPEG_data *data ) { D_DEBUG_AT( SH7722_JPEG, "%s( %p )\n", __FUNCTION__, data ); /* Open the drawing engine device. */ data->gfx_fd = direct_try_open( "/dev/sh772x_gfx", "/dev/misc/sh772x_gfx", O_RDWR, true ); if (data->gfx_fd < 0) return DR_INIT; /* Map its shared data. */ data->gfx_shared = mmap( NULL, direct_page_align( sizeof(SH772xGfxSharedArea) ), PROT_READ | PROT_WRITE, MAP_SHARED, data->gfx_fd, 0 ); if (data->gfx_shared == MAP_FAILED) { D_PERROR( "SH7722/GFX: Could not map shared area!\n" ); close( data->gfx_fd ); return DR_INIT; } D_DEBUG_AT( SH7722_JPEG, " -> magic 0x%08x\n", data->gfx_shared->magic ); D_DEBUG_AT( SH7722_JPEG, " -> buffer 0x%08lx\n", data->gfx_shared->buffer_phys ); D_DEBUG_AT( SH7722_JPEG, " -> jpeg 0x%08lx\n", data->gfx_shared->jpeg_phys ); /* Check the magic value. */ if (data->gfx_shared->magic != SH7722GFX_SHARED_MAGIC) { D_ERROR( "SH7722/GFX: Magic value 0x%08x doesn't match 0x%08x!\n", data->gfx_shared->magic, SH7722GFX_SHARED_MAGIC ); munmap( (void*) data->gfx_shared, direct_page_align( sizeof(SH772xGfxSharedArea) ) ); close( data->gfx_fd ); return DR_INIT; } return DR_OK; } static DirectResult Shutdown_GFX( SH7722_JPEG_data *data ) { munmap( (void*) data->gfx_shared, direct_page_align( sizeof(SH772xGfxSharedArea) ) ); close( data->gfx_fd ); return DR_OK; } /**********************************************************************************************************************/ static DirectResult Initialize_Mem( SH7722_JPEG_data *data, unsigned long phys ) { int fd; D_DEBUG_AT( SH7722_JPEG, "%s( %p, 0x%08lx )\n", __FUNCTION__, data, phys ); fd = open( "/dev/mem", O_RDWR | O_SYNC ); if (fd < 0) { D_PERROR( "SH7722/JPEG: Could not open /dev/mem!\n" ); return DR_INIT; } data->jpeg_virt = mmap( NULL, direct_page_align( SH7722GFX_JPEG_SIZE ), PROT_READ | PROT_WRITE, MAP_SHARED, fd, phys ); if (data->jpeg_virt == MAP_FAILED) { D_PERROR( "SH7722/JPEG: Could not map /dev/mem at 0x%08lx (length %lu)!\n", phys, direct_page_align( SH7722GFX_JPEG_SIZE ) ); close( fd ); return DR_INIT; } data->jpeg_phys = phys; data->jpeg_lb1 = data->jpeg_phys + SH7722GFX_JPEG_RELOAD_SIZE * 2; data->jpeg_lb2 = data->jpeg_lb1 + SH7722GFX_JPEG_LINEBUFFER_SIZE; close( fd ); return DR_OK; } static DirectResult Shutdown_Mem( SH7722_JPEG_data *data ) { munmap( (void*) data->jpeg_virt, direct_page_align( SH7722GFX_JPEG_SIZE ) ); return DR_OK; } /**********************************************************************************************************************/ #define JPEG_PROG_BUF_SIZE 0x10000 typedef struct { struct jpeg_source_mgr pub; /* public fields */ JOCTET *data; /* start of buffer */ DirectStream *stream; int peekonly; int peekoffset; } stream_source_mgr; typedef stream_source_mgr * stream_src_ptr; static void stream_init_source (j_decompress_ptr cinfo) { stream_src_ptr src = (stream_src_ptr) cinfo->src; direct_stream_seek( src->stream, 0 ); /* ignore return value */ } static boolean stream_fill_input_buffer (j_decompress_ptr cinfo) { DFBResult ret; unsigned int nbytes = 0; stream_src_ptr src = (stream_src_ptr) cinfo->src; struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 50000; direct_stream_wait( src->stream, JPEG_PROG_BUF_SIZE, &tv ); if (src->peekonly) { ret = direct_stream_peek( src->stream, JPEG_PROG_BUF_SIZE, src->peekoffset, src->data, &nbytes ); if (ret && ret != DFB_EOF) D_DERROR( ret, "SH7722/JPEG: direct_stream_peek() failed!\n" ); src->peekoffset += MAX( nbytes, 0 ); } else { ret = direct_stream_read( src->stream, JPEG_PROG_BUF_SIZE, src->data, &nbytes ); if (ret && ret != DFB_EOF) D_DERROR( ret, "SH7722/JPEG: direct_stream_read() failed!\n" ); } if (ret || nbytes <= 0) { /* Insert a fake EOI marker */ src->data[0] = (JOCTET) 0xFF; src->data[1] = (JOCTET) JPEG_EOI; nbytes = 2; } src->pub.next_input_byte = src->data; src->pub.bytes_in_buffer = nbytes; return TRUE; } static void stream_skip_input_data (j_decompress_ptr cinfo, long num_bytes) { stream_src_ptr src = (stream_src_ptr) cinfo->src; if (num_bytes > 0) { while (num_bytes > (long) src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; (void)stream_fill_input_buffer(cinfo); } src->pub.next_input_byte += (size_t) num_bytes; src->pub.bytes_in_buffer -= (size_t) num_bytes; } } static void stream_term_source (j_decompress_ptr cinfo) { } static void jpeg_stream_src (j_decompress_ptr cinfo, DirectStream *stream, int peekonly) { stream_src_ptr src; cinfo->src = (struct jpeg_source_mgr *) cinfo->mem->alloc_small ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (stream_source_mgr)); src = (stream_src_ptr) cinfo->src; src->data = (JOCTET *) cinfo->mem->alloc_small ((j_common_ptr) cinfo, JPOOL_PERMANENT, JPEG_PROG_BUF_SIZE * sizeof (JOCTET)); src->stream = stream; src->peekonly = peekonly; src->peekoffset = 0; src->pub.init_source = stream_init_source; src->pub.fill_input_buffer = stream_fill_input_buffer; src->pub.skip_input_data = stream_skip_input_data; src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->pub.term_source = stream_term_source; src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ src->pub.next_input_byte = NULL; /* until buffer loaded */ } struct my_error_mgr { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; static void jpeglib_panic(j_common_ptr cinfo) { struct my_error_mgr *myerr = (struct my_error_mgr*) cinfo->err; longjmp(myerr->setjmp_buffer, 1); } /**********************************************************************************************************************/ static SH7722_JPEG_data data; DirectResult SH7722_JPEG_Initialize( void ) { DirectResult ret; if (data.ref_count) { data.ref_count++; return DR_OK; } ret = Initialize_GFX( &data ); if (ret) return ret; ret = Initialize_Mem( &data, data.gfx_shared->jpeg_phys ); if (ret) { Shutdown_GFX( &data ); return ret; } data.ref_count = 1; return DR_OK; } DirectResult SH7722_JPEG_Shutdown( void ) { if (!data.ref_count) return DR_DEAD; if (--data.ref_count) return DR_OK; Shutdown_Mem( &data ); Shutdown_GFX( &data ); return DR_OK; } DirectResult SH7722_JPEG_Open( DirectStream *stream, SH7722_JPEG_context *context ) { struct my_error_mgr jerr; if (!data.ref_count) return DR_DEAD; context->cinfo.err = jpeg_std_error( &jerr.pub ); jerr.pub.error_exit = jpeglib_panic; if (setjmp( jerr.setjmp_buffer )) { D_ERROR( "SH7722/JPEG: Error while reading headers!\n" ); jpeg_destroy_decompress( &context->cinfo ); return DFB_FAILURE; } jpeg_create_decompress( &context->cinfo ); jpeg_stream_src( &context->cinfo, stream, 1 ); jpeg_read_header( &context->cinfo, TRUE ); jpeg_calc_output_dimensions( &context->cinfo ); context->stream = stream; context->width = context->cinfo.output_width; context->height = context->cinfo.output_height; context->mode420 = context->cinfo.comp_info[1].h_samp_factor == context->cinfo.comp_info[0].h_samp_factor / 2 && context->cinfo.comp_info[1].v_samp_factor == context->cinfo.comp_info[0].v_samp_factor / 2 && context->cinfo.comp_info[2].h_samp_factor == context->cinfo.comp_info[0].h_samp_factor / 2 && context->cinfo.comp_info[2].v_samp_factor == context->cinfo.comp_info[0].v_samp_factor / 2; context->mode444 = context->cinfo.comp_info[1].h_samp_factor == context->cinfo.comp_info[0].h_samp_factor && context->cinfo.comp_info[1].v_samp_factor == context->cinfo.comp_info[0].v_samp_factor && context->cinfo.comp_info[2].h_samp_factor == context->cinfo.comp_info[0].h_samp_factor && context->cinfo.comp_info[2].v_samp_factor == context->cinfo.comp_info[0].v_samp_factor; return DFB_OK; } DirectResult SH7722_JPEG_Decode( SH7722_JPEG_context *context, const DFBRectangle *rect, const DFBRegion *clip, DFBSurfacePixelFormat format, unsigned long phys, void *addr, int pitch, unsigned int width, unsigned int height ) { DFBResult ret = DFB_UNSUPPORTED; DFBRectangle _rect; DFBRegion _clip; struct my_error_mgr jerr; bool sw_only = false; if (!data.ref_count) return DR_DEAD; context->cinfo.err = jpeg_std_error( &jerr.pub ); jerr.pub.error_exit = jpeglib_panic; if (setjmp( jerr.setjmp_buffer )) { D_ERROR( "SH7722/JPEG: Error while decoding image!\n" ); return DFB_FAILURE; } switch (format) { case DSPF_NV12: case DSPF_NV16: case DSPF_RGB16: case DSPF_RGB32: case DSPF_RGB24: break; case DSPF_RGB332: case DSPF_ARGB1555: case DSPF_ARGB2554: case DSPF_ARGB4444: case DSPF_ARGB: case DSPF_AiRGB: case DSPF_RGB555: case DSPF_BGR555: case DSPF_RGB444: sw_only = true; break; default: return DR_UNSUPPORTED; } if (!rect) { _rect.x = 0; _rect.y = 0; _rect.w = width; _rect.h = height; rect = &_rect; } if (!clip) { _clip.x1 = _rect.x; _clip.y1 = _rect.y; _clip.x2 = _rect.x + _rect.w - 1; _clip.y2 = _rect.y + _rect.h - 1; clip = &_clip; } if (!context->mode444 && !sw_only) ret = DecodeHW( &data, context, rect, clip, format, phys, pitch, width, height ); if (ret) { if (addr) { ret = DecodeSW( context, rect, clip, format, addr, pitch, width, height ); } else { int fd, len = direct_page_align( DFB_PLANE_MULTIPLY( format, height ) * pitch ); fd = open( "/dev/mem", O_RDWR | O_SYNC ); if (fd < 0) { D_PERROR( "SH7722/JPEG: Could not open /dev/mem!\n" ); return DR_INIT; } addr = mmap( NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, phys ); if (addr == MAP_FAILED) { D_PERROR( "SH7722/JPEG: Could not map /dev/mem at 0x%08lx (length %d)!\n", phys, len ); close( fd ); return DR_INIT; } ret = DecodeSW( context, rect, clip, format, addr, pitch, width, height ); munmap( addr, len ); } } return ret; } DirectResult SH7722_JPEG_Close( SH7722_JPEG_context *context ) { jpeg_destroy_decompress( &context->cinfo ); return DFB_OK; } DirectResult SH7722_JPEG_Encode( const char *filename, const DFBRectangle *srcrect, DFBSurfacePixelFormat srcformat, unsigned long srcphys, int srcpitch, unsigned int width, unsigned int height, unsigned int tmpphys ) { DFBRectangle _rect; if (!data.ref_count) return DR_DEAD; switch (srcformat) { case DSPF_NV12: case DSPF_NV16: case DSPF_RGB16: case DSPF_RGB32: case DSPF_RGB24: break; default: return DR_UNSUPPORTED; } if (!srcrect) { _rect.x = 0; _rect.y = 0; _rect.w = width; _rect.h = height; srcrect = &_rect; } return EncodeHW( &data, filename, srcrect, srcformat, srcphys, srcpitch, width, height, tmpphys ); } DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_blt.c0000644000175000017500000020141611245562152015333 00000000000000#ifdef SH7722_DEBUG_BLT #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sh7722.h" #include "sh7722_blt.h" D_DEBUG_DOMAIN( SH7722_BLT, "SH7722/BLT", "Renesas SH7722 Drawing Engine" ); D_DEBUG_DOMAIN( SH7722_StartStop, "SH7722/StartStop", "Renesas SH7722 Drawing Start/Stop" ); /* * State validation flags. * * There's no prefix because of the macros below. */ enum { DEST = 0x00000001, CLIP = 0x00000002, DEST_CLIP = 0x00000003, SOURCE = 0x00000010, MASK = 0x00000020, COLOR = 0x00000100, COLOR_KEY = 0x00001000, COLOR_CHANGE = 0x00002000, BLENDING = 0x00010000, MATRIX = 0x00100000, BLIT_OP = 0x01000000, ALL = 0x01113133 }; /* * Map pixel formats. */ static const int pixel_formats[DFB_NUM_PIXELFORMATS] = { 3, /* DSPF_ARGB1555 = 0 */ 1, /* DSPF_RGB16 = 1 */ 7, /* DSPF_RGB24 = 2 */ 0, /* DSPF_RGB32 = 3 */ 0, /* DSPF_ARGB = 4 */ 10, /* DSPF_A8 = 5 */ -1, /* DSPF_YUY2 = 6 */ -1, /* DSPF_RGB332 = 7 */ -1, /* DSPF_UYVY = 8 */ -1, /* DSPF_I420 = 9 */ -1, /* DSPF_YV12 = 10 */ -1, /* DSPF_LUT8 = 11 */ -1, /* DSPF_ALUT44 = 12 */ -1, /* DSPF_AiRGB = 13 */ 8, /* DSPF_A1 = 14 */ -1, /* DSPF_NV12 = 15 */ -1, /* DSPF_NV16 = 16 */ -1, /* DSPF_ARGB2554 = 17 */ 4, /* DSPF_ARGB4444 = 18 */ -1, /* DSPF_NV21 = 19 */ -1, /* DSPF_AYUV = 20 */ -1, /* DSPF_A4 = 21 */ -1, /* DSPF_ARGB1666 = 22 */ -1, /* DSPF_ARGB6666 = 23 */ 6, /* DSPF_RGB18 = 24 */ -1, /* DSPF_LUT2 = 25 */ 4, /* DSPF_RGB444 = 26 */ 3, /* DSPF_RGB555 = 27 */ }; /* * State handling macros. */ #define SH7722_VALIDATE(flags) do { sdev->v_flags |= (flags); } while (0) #define SH7722_INVALIDATE(flags) do { sdev->v_flags &= ~(flags); } while (0) #define SH7722_CHECK_VALIDATE(flag) do { \ if ((sdev->v_flags & flag) != flag) \ sh7722_validate_##flag( sdrv, sdev, state ); \ } while (0) #define DUMP_INFO() D_DEBUG_AT( SH7722_BLT, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); #define AA_COEF 133 /**********************************************************************************************************************/ static bool sh7722FillRectangle ( void *drv, void *dev, DFBRectangle *rect ); static bool sh7722FillRectangleMatrixAA( void *drv, void *dev, DFBRectangle *rect ); static bool sh7722DrawRectangle ( void *drv, void *dev, DFBRectangle *rect ); static bool sh7722DrawRectangleMatrixAA( void *drv, void *dev, DFBRectangle *rect ); static bool sh7722DrawLine ( void *drv, void *dev, DFBRegion *line ); static bool sh7722DrawLineMatrix ( void *drv, void *dev, DFBRegion *line ); static bool sh7722DrawLineAA ( void *drv, void *dev, DFBRegion *line ); /**********************************************************************************************************************/ static inline bool check_blend_functions( const CardState *state ) { switch (state->src_blend) { case DSBF_ZERO: case DSBF_ONE: case DSBF_DESTCOLOR: case DSBF_INVDESTCOLOR: case DSBF_SRCALPHA: case DSBF_INVSRCALPHA: case DSBF_DESTALPHA: case DSBF_INVDESTALPHA: return true; default: break; } switch (state->dst_blend) { case DSBF_ZERO: case DSBF_ONE: case DSBF_SRCCOLOR: case DSBF_INVSRCCOLOR: case DSBF_SRCALPHA: case DSBF_INVSRCALPHA: case DSBF_DESTALPHA: case DSBF_INVDESTALPHA: return true; default: break; } return false; } /**********************************************************************************************************************/ static inline bool start_hardware( SH7722DriverData *sdrv ) { SH772xGfxSharedArea *shared = sdrv->gfx_shared; D_DEBUG_AT( SH7722_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); if (shared->hw_running || !shared->next_valid || shared->next_end == shared->next_start) return false; shared->hw_running = true; shared->hw_start = shared->next_start; shared->hw_end = shared->next_end; shared->next_start = shared->next_end = (shared->hw_end + 1 + 3) & ~3; shared->next_valid = false; shared->num_words += shared->hw_end - shared->hw_start; shared->num_starts++; DUMP_INFO(); D_ASSERT( shared->buffer[shared->hw_end] == 0xF0000000 ); SH7722_TDG_SETREG32( sdrv, BEM_HC_DMA_ADR, shared->buffer_phys + shared->hw_start*4 ); SH7722_TDG_SETREG32( sdrv, BEM_HC_DMA_START, 1 ); return true; } __attribute__((noinline)) static void flush_prepared( SH7722DriverData *sdrv ) { SH772xGfxSharedArea *shared = sdrv->gfx_shared; unsigned int timeout = 2; D_DEBUG_AT( SH7722_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); D_ASSERT( sdrv->prep_num < SH772xGFX_BUFFER_WORDS ); D_ASSERT( sdrv->prep_num <= D_ARRAY_SIZE(sdrv->prep_buf) ); /* Something prepared? */ while (sdrv->prep_num) { int next_end; /* Mark shared information as invalid. From this point on the interrupt handler * will not continue with the next block, and we'll start the hardware ourself. */ shared->next_valid = false; /* Check if there's enough space at the end. * Wait until hardware has started next block before it gets too big. */ if (shared->next_end + sdrv->prep_num >= SH772xGFX_BUFFER_WORDS || shared->next_end - shared->next_start >= SH772xGFX_BUFFER_WORDS/4) { /* If there's no next block waiting, start at the beginning. */ if (shared->next_start == shared->next_end) shared->next_start = shared->next_end = 0; else { D_ASSERT( shared->buffer[shared->hw_end] == 0xF0000000 ); /* Mark area as valid again. */ shared->next_valid = true; /* Start in case it got idle while doing the checks. */ if (!start_hardware( sdrv )) { /* * Hardware has not been started (still running). * Check for timeout. */ if (!timeout--) { D_ERROR( "SH7722/Blt: Timeout waiting for processing!\n" ); direct_log_printf( NULL, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); D_ASSERT( shared->buffer[shared->hw_end] == 0xF0000000 ); sh7722EngineReset( sdrv, sdrv->dev ); } /* Wait til next block is started. */ ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_WAIT_NEXT ); } /* Start over with the checks. */ continue; } } /* We are appending in case there was already a next block. */ next_end = shared->next_end + sdrv->prep_num; /* Reset the timeout counter. */ timeout = 2; /* While the hardware is running... */ while (shared->hw_running) { D_ASSERT( shared->buffer[shared->hw_end] == 0xF0000000 ); /* ...make sure we don't over lap with its current buffer, otherwise wait. */ if (shared->hw_start > next_end || shared->hw_end < shared->next_start) break; /* Check for timeout. */ if (!timeout--) { D_ERROR( "SH7722/Blt: Timeout waiting for space!\n" ); direct_log_printf( NULL, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); D_ASSERT( shared->buffer[shared->hw_end] == 0xF0000000 ); sh7722EngineReset( sdrv, sdrv->dev ); } /* Wait til next block is started. */ ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_WAIT_NEXT ); } /* Copy from local to shared buffer. */ direct_memcpy( (void*) &shared->buffer[shared->next_end], &sdrv->prep_buf[0], sdrv->prep_num * sizeof(__u32) ); /* Terminate the block. */ shared->buffer[next_end] = 0xF0000000; /* Update next block information and mark valid. */ shared->next_end = next_end; shared->next_valid = true; /* Reset local counter. */ sdrv->prep_num = 0; } /* Start in case it is idle. */ start_hardware( sdrv ); } static inline __u32 * start_buffer( SH7722DriverData *sdrv, int space ) { /* Check for space in local buffer. */ if (sdrv->prep_num + space > SH7722GFX_MAX_PREPARE) { /* Flush local buffer. */ flush_prepared( sdrv ); D_ASSERT( sdrv->prep_num == 0 ); } /* Return next write position. */ return &sdrv->prep_buf[sdrv->prep_num]; } static inline void submit_buffer( SH7722DriverData *sdrv, int entries ) { D_ASSERT( sdrv->prep_num + entries <= SH7722GFX_MAX_PREPARE ); /* Increment next write position. */ sdrv->prep_num += entries; } /**********************************************************************************************************************/ static inline void sh7722_validate_DEST_CLIP( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 10 ); D_DEBUG_AT( SH7722_BLT, "%s( 0x%08lx [%d] - %4d,%4d-%4dx%4d )\n", __FUNCTION__, state->dst.phys, state->dst.pitch, DFB_RECTANGLE_VALS_FROM_REGION( &state->clip ) ); /* Set clip. */ prep[0] = BEM_PE_SC0_MIN; prep[1] = SH7722_XY( state->clip.x1, state->clip.y1 ); prep[2] = BEM_PE_SC0_MAX; prep[3] = SH7722_XY( state->clip.x2, state->clip.y2 ); /* Only clip? */ if (sdev->v_flags & DEST) { submit_buffer( sdrv, 4 ); } else { CoreSurface *surface = state->destination; CoreSurfaceBuffer *buffer = state->dst.buffer; sdev->dst_phys = state->dst.phys; sdev->dst_pitch = state->dst.pitch; sdev->dst_bpp = DFB_BYTES_PER_PIXEL( buffer->format ); sdev->dst_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS; /* Set destination. */ prep[4] = BEM_PE_DST; prep[5] = pixel_formats[sdev->dst_index]; prep[6] = BEM_PE_DST_BASE; prep[7] = sdev->dst_phys; prep[8] = BEM_PE_DST_SIZE; prep[9] = SH7722_XY( sdev->dst_pitch / sdev->dst_bpp, surface->config.size.h ); submit_buffer( sdrv, 10 ); } /* Set the flags. */ SH7722_VALIDATE( DEST_CLIP ); } static inline void sh7722_validate_SOURCE( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { CoreSurface *surface = state->source; CoreSurfaceBuffer *buffer = state->src.buffer; __u32 *prep = start_buffer( sdrv, 6 ); sdev->src_phys = state->src.phys; sdev->src_pitch = state->src.pitch; sdev->src_bpp = DFB_BYTES_PER_PIXEL( buffer->format ); sdev->src_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS; /* Set source. */ prep[0] = BEM_TE_SRC; prep[1] = pixel_formats[sdev->src_index]; prep[2] = BEM_TE_SRC_BASE; prep[3] = sdev->src_phys; prep[4] = BEM_TE_SRC_SIZE; prep[5] = SH7722_XY( sdev->src_pitch / sdev->src_bpp, surface->config.size.h ); submit_buffer( sdrv, 6 ); /* Set the flag. */ SH7722_VALIDATE( SOURCE ); } __attribute__((noinline)) static void sh7722_validate_MASK( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { CoreSurface *surface = state->source_mask; CoreSurfaceBuffer *buffer = state->src_mask.buffer; __u32 *prep = start_buffer( sdrv, 6 ); sdev->mask_phys = state->src_mask.phys; sdev->mask_pitch = state->src_mask.pitch; sdev->mask_format = buffer->format; sdev->mask_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS; sdev->mask_offset = state->src_mask_offset; sdev->mask_flags = state->src_mask_flags; /* Set mask. */ prep[0] = BEM_TE_MASK; prep[1] = TE_MASK_ENABLE | pixel_formats[sdev->mask_index]; prep[2] = BEM_TE_MASK_SIZE; prep[3] = SH7722_XY( sdev->mask_pitch / DFB_BYTES_PER_PIXEL(sdev->mask_format), surface->config.size.h ); prep[4] = BEM_TE_MASK_BASE; prep[5] = sdev->mask_phys + sdev->mask_pitch * sdev->mask_offset.y + DFB_BYTES_PER_LINE( sdev->mask_format, sdev->mask_offset.x ); submit_buffer( sdrv, 6 ); /* Set the flag. */ SH7722_VALIDATE( MASK ); } static inline void sh7722_validate_COLOR( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 4 ); prep[0] = BEM_BE_COLOR1; prep[1] = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); prep[2] = BEM_WR_FGC; prep[3] = prep[1]; submit_buffer( sdrv, 4 ); /* Set the flag. */ SH7722_VALIDATE( COLOR ); } __attribute__((noinline)) static void sh7722_validate_COLOR_KEY( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { CoreSurfaceBuffer *buffer = state->src.buffer; __u32 *prep = start_buffer( sdrv, 4 ); prep[0] = BEM_PE_CKEY; prep[1] = CKEY_EXCLUDE_ALPHA | CKEY_EXCLUDE_UNUSED | CKEY_B_ENABLE; prep[2] = BEM_PE_CKEY_B; switch (buffer->format) { case DSPF_ARGB: case DSPF_RGB32: prep[3] = state->src_colorkey; break; case DSPF_RGB16: prep[3] = RGB16_TO_RGB32( state->src_colorkey ); break; case DSPF_ARGB1555: case DSPF_RGB555: prep[3] = ARGB1555_TO_RGB32( state->src_colorkey ); break; case DSPF_ARGB4444: case DSPF_RGB444: prep[3] = ARGB4444_TO_RGB32( state->src_colorkey ); break; default: D_BUG( "unexpected pixelformat" ); } submit_buffer( sdrv, 4 ); /* Set the flag. */ SH7722_VALIDATE( COLOR_KEY ); } /* let compiler decide here :) */ static void sh7722_validate_COLOR_CHANGE( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 6 ); prep[0] = BEM_PE_COLORCHANGE; prep[1] = COLORCHANGE_COMPARE_FIRST | COLORCHANGE_EXCLUDE_UNUSED; prep[2] = BEM_PE_COLORCHANGE_0; prep[3] = 0xffffff; prep[4] = BEM_PE_COLORCHANGE_1; prep[5] = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); submit_buffer( sdrv, 6 ); /* Set the flag. */ SH7722_VALIDATE( COLOR_CHANGE ); } /* DSBF_UNKNOWN = 0 */ /* BLE_DSTF_ZERO = 0 DSBF_ZERO = 1 */ /* BLE_DSTF_ONE = 1 DSBF_ONE = 2 */ /* BLE_DSTF_SRC = 2 DSBF_SRCCOLOR = 3 */ /* BLE_DSTF_1_SRC = 3 DSBF_INVSRCCOLOR = 4 */ /* BLE_DSTF_SRC_A = 4 DSBF_SRCALPHA = 5 */ /* BLE_DSTF_1_SRC_A = 5 DSBF_INVSRCALPHA = 6 */ /* BLE_DSTF_DST_A = 6 DSBF_DESTALPHA = 7 */ /* BLE_DSTF_1_DST_A = 7 DSBF_INVDESTALPHA = 8 */ /* DSBF_DESTCOLOR = 9 */ /* Hey, matches!!? :-P DSBF_INVDESTCOLOR = 10 */ /* DSBF_SRCALPHASAT = 11 */ static inline void sh7722_validate_BLENDING( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 2 ); sdev->ble_dstf = (state->dst_blend - 1) & 7; sdev->ble_srcf = ((state->src_blend - 1) & 7) << 4; prep[0] = BEM_PE_FIXEDALPHA; prep[1] = (state->color.a << 24) | (state->color.a << 16); submit_buffer( sdrv, 2 ); /* Set the flag. */ SH7722_VALIDATE( BLENDING ); } __attribute__((noinline)) static void sh7722_validate_MATRIX( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 12 ); prep[0] = BEM_BE_MATRIX_A; prep[1] = state->matrix[0]; prep[2] = BEM_BE_MATRIX_B; prep[3] = state->matrix[1]; prep[4] = BEM_BE_MATRIX_C; prep[5] = state->matrix[2]; prep[6] = BEM_BE_MATRIX_D; prep[7] = state->matrix[3]; prep[8] = BEM_BE_MATRIX_E; prep[9] = state->matrix[4]; prep[10] = BEM_BE_MATRIX_F; prep[11] = state->matrix[5]; submit_buffer( sdrv, 12 ); /* Keep for CPU transformation of lines. */ direct_memcpy( sdev->matrix, state->matrix, sizeof(s32) * 6 ); /* Set the flag. */ SH7722_VALIDATE( MATRIX ); } static inline void sh7722_validate_BLIT_OP( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 2 ); prep[0] = BEM_PE_OPERATION; prep[1] = BLE_FUNC_NONE; if (state->blittingflags & DSBLIT_XOR) prep[1] |= BLE_ROP_XOR; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { prep[1] |= BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | sdev->ble_dstf; switch (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { case DSBLIT_BLEND_ALPHACHANNEL: prep[1] |= BLE_SRCA_SOURCE_ALPHA; break; case DSBLIT_BLEND_COLORALPHA: prep[1] |= BLE_SRCA_FIXED; break; } } else if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA) prep[1] |= BLE_FUNC_AxB_plus_CxD | BLE_SRCA_ALPHA_CHANNEL | BLE_SRCF_SRC_A | BLE_DSTF_1_SRC_A; submit_buffer( sdrv, 2 ); /* Set the flag. */ SH7722_VALIDATE( BLIT_OP ); } /**********************************************************************************************************************/ __attribute__((noinline)) static void invalidate_ckey( SH7722DriverData *sdrv, SH7722DeviceData *sdev ) { __u32 *prep = start_buffer( sdrv, 4 ); prep[0] = BEM_PE_CKEY; prep[1] = 0; prep[2] = BEM_PE_CKEY_B; prep[3] = 0; submit_buffer( sdrv, 4 ); sdev->ckey_b_enabled = false; SH7722_INVALIDATE( COLOR_KEY ); } __attribute__((noinline)) static void invalidate_color_change( SH7722DriverData *sdrv, SH7722DeviceData *sdev ) { __u32 *prep = start_buffer( sdrv, 2 ); prep[0] = BEM_PE_COLORCHANGE; prep[1] = COLORCHANGE_DISABLE; submit_buffer( sdrv, 2 ); sdev->color_change_enabled = false; SH7722_INVALIDATE( COLOR_CHANGE ); } __attribute__((noinline)) static void invalidate_mask( SH7722DriverData *sdrv, SH7722DeviceData *sdev ) { u32 *prep = start_buffer( sdrv, 2 ); prep[0] = BEM_TE_MASK; prep[1] = TE_MASK_DISABLE; submit_buffer( sdrv, 2 ); sdev->mask_enabled = false; SH7722_INVALIDATE( MASK ); } /**********************************************************************************************************************/ DFBResult sh7722EngineSync( void *drv, void *dev ) { DFBResult ret = DFB_OK; SH7722DriverData *sdrv = drv; SH772xGfxSharedArea *shared = sdrv->gfx_shared; D_DEBUG_AT( SH7722_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); while (shared->hw_running && ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_WAIT_IDLE ) < 0) { if (errno == EINTR) continue; ret = errno2result( errno ); D_PERROR( "SH7722/BLT: SH7722GFX_IOCTL_WAIT_IDLE failed!\n" ); direct_log_printf( NULL, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); break; } if (ret == DFB_OK) { D_ASSERT( !shared->hw_running ); D_ASSERT( !shared->next_valid ); } return ret; } void sh7722EngineReset( void *drv, void *dev ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep; D_DEBUG_AT( SH7722_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_RESET ); prep = start_buffer( sdrv, 20 ); prep[0] = BEM_PE_OPERATION; prep[1] = 0x00000000; prep[2] = BEM_PE_COLORCHANGE; prep[3] = 0x00000000; prep[4] = BEM_PE_CKEY; prep[5] = 0x00000000; prep[6] = BEM_PE_CKEY_B; prep[7] = 0; prep[8] = BEM_PE_FIXEDALPHA; prep[9] = 0x80000000; prep[10] = BEM_TE_SRC_CNV; prep[11] = 0x00100010; /* full conversion of Ad, As, Cd and Cs */ prep[12] = BEM_TE_FILTER; prep[13] = 0x00000000; /* 0 = nearest, 3 = up bilinear / down average */ prep[14] = BEM_PE_SC; prep[15] = 0x00000001; /* enable clipping */ prep[16] = BEM_BE_ORIGIN; prep[17] = SH7722_XY( 0, 0 ); prep[18] = BEM_TE_MASK_CNV; prep[19] = 2; submit_buffer( sdrv, 20 ); sdev->ckey_b_enabled = false; sdev->color_change_enabled = false; sdev->mask_enabled = false; } void sh7722EmitCommands( void *drv, void *dev ) { SH7722DriverData *sdrv = drv; D_DEBUG_AT( SH7722_BLT, "%s()\n", __FUNCTION__ ); flush_prepared( sdrv ); } void sh7722FlushTextureCache( void *drv, void *dev ) { SH7722DriverData *sdrv = drv; __u32 *prep = start_buffer( sdrv, 4 ); D_DEBUG_AT( SH7722_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); prep[0] = BEM_PE_CACHE; prep[1] = 2; prep[2] = BEM_TE_INVALID; prep[3] = 1; submit_buffer( sdrv, 4 ); } /**********************************************************************************************************************/ void sh7722CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { D_DEBUG_AT( SH7722_BLT, "%s( %p, 0x%08x )\n", __FUNCTION__, state, accel ); /* Return if the desired function is not supported at all. */ if (accel & ~(SH7722_SUPPORTED_DRAWINGFUNCTIONS | SH7722_SUPPORTED_BLITTINGFUNCTIONS)) return; /* Return if the destination format is not supported. */ switch (state->destination->config.format) { case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB16: case DSPF_ARGB1555: case DSPF_RGB555: case DSPF_ARGB4444: case DSPF_RGB444: break; default: return; } /* Check if drawing or blitting is requested. */ if (DFB_DRAWING_FUNCTION( accel )) { /* Return if unsupported drawing flags are set. */ if (state->drawingflags & ~SH7722_SUPPORTED_DRAWINGFLAGS) return; /* Return if blending with unsupported blend functions is requested. */ if (state->drawingflags & DSDRAW_BLEND) { /* Check blend functions. */ if (!check_blend_functions( state )) return; /* XOR only without blending. */ if (state->drawingflags & DSDRAW_XOR) return; } /* Enable acceleration of drawing functions. */ state->accel |= SH7722_SUPPORTED_DRAWINGFUNCTIONS; } else { DFBSurfaceBlittingFlags flags = state->blittingflags; /* Return if unsupported blitting flags are set. */ if (flags & ~SH7722_SUPPORTED_BLITTINGFLAGS) return; /* Return if the source format is not supported. */ switch (state->source->config.format) { case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB16: case DSPF_ARGB1555: case DSPF_RGB555: case DSPF_ARGB4444: case DSPF_RGB444: break; default: return; } /* Return if blending with unsupported blend functions is requested. */ if (flags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { /* Check blend functions. */ if (!check_blend_functions( state )) return; } /* XOR only without blending etc. */ if (flags & DSBLIT_XOR && flags & ~(DSBLIT_SRC_COLORKEY | DSBLIT_ROTATE180 | DSBLIT_XOR)) return; /* Return if colorizing for non-font surfaces is requested. */ if ((flags & DSBLIT_COLORIZE) && !(state->source->type & CSTF_FONT)) return; /* Return if blending with both alpha channel and value is requested. */ if (D_FLAGS_ARE_SET( flags, DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) return; /* Mask checking. */ if (flags & DSBLIT_SRC_MASK_ALPHA) { if (!state->source_mask) return; /* Return if the source mask format is not supported. */ switch (state->source_mask->config.format) { case DSPF_A1: case DSPF_A8: break; default: return; } } /* Enable acceleration of blitting functions. */ state->accel |= SH7722_SUPPORTED_BLITTINGFUNCTIONS; } } /* * Make sure that the hardware is programmed for execution of 'accel' according to the 'state'. */ void sh7722SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; StateModificationFlags modified = state->mod_hw; D_DEBUG_AT( SH7722_BLT, "%s( %p, 0x%08x ) <- modified 0x%08x\n", __FUNCTION__, state, accel, modified ); DUMP_INFO(); /* * 1) Invalidate hardware states * * Each modification to the hw independent state invalidates one or more hardware states. */ /* Simply invalidate all? */ if (modified == SMF_ALL) { SH7722_INVALIDATE( ALL ); } else if (modified) { /* Invalidate destination registers. */ if (modified & SMF_DESTINATION) SH7722_INVALIDATE( DEST ); /* Invalidate clipping registers. */ if (modified & SMF_CLIP) SH7722_INVALIDATE( CLIP ); /* Invalidate source registers. */ if (modified & SMF_SOURCE) SH7722_INVALIDATE( SOURCE | COLOR_KEY ); else if (modified & SMF_SRC_COLORKEY) SH7722_INVALIDATE( COLOR_KEY ); /* Invalidate mask registers. */ if (modified & (SMF_SOURCE_MASK | SMF_SOURCE_MASK_VALS)) SH7722_INVALIDATE( MASK ); /* Invalidate color registers. */ if (modified & SMF_COLOR) SH7722_INVALIDATE( BLENDING | COLOR | COLOR_CHANGE ); else if (modified & (SMF_SRC_BLEND | SMF_SRC_BLEND)) SH7722_INVALIDATE( BLENDING ); /* Invalidate matrix registers. */ if (modified & SMF_MATRIX) SH7722_INVALIDATE( MATRIX ); /* Invalidate blitting operation. */ if (modified & SMF_BLITTING_FLAGS) SH7722_INVALIDATE( BLIT_OP ); } /* * 2) Validate hardware states * * Each function has its own set of states that need to be validated. */ /* Always requiring valid destination and clip. */ SH7722_CHECK_VALIDATE( DEST_CLIP ); /* Use transformation matrix? */ if (state->render_options & DSRO_MATRIX) SH7722_CHECK_VALIDATE( MATRIX ); /* Depending on the function... */ switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: /* ...require valid color. */ SH7722_CHECK_VALIDATE( COLOR ); /* Use blending? */ if (state->drawingflags & DSDRAW_BLEND) { /* need valid source and destination blend factors */ SH7722_CHECK_VALIDATE( BLENDING ); } /* Clear old ckeys */ if (sdev->ckey_b_enabled) invalidate_ckey( sdrv, sdev ); /* Clear old mask */ if (sdev->mask_enabled) invalidate_mask( sdrv, sdev ); /* Choose function. */ switch (accel) { case DFXL_FILLRECTANGLE: if (state->render_options & (DSRO_MATRIX | DSRO_ANTIALIAS)) funcs->FillRectangle = sh7722FillRectangleMatrixAA; else funcs->FillRectangle = sh7722FillRectangle; break; case DFXL_DRAWRECTANGLE: if (state->render_options & (DSRO_MATRIX | DSRO_ANTIALIAS)) funcs->DrawRectangle = sh7722DrawRectangleMatrixAA; else funcs->DrawRectangle = sh7722DrawRectangle; break; case DFXL_DRAWLINE: if (state->render_options & DSRO_ANTIALIAS) funcs->DrawLine = sh7722DrawLineAA; else if (state->render_options & DSRO_MATRIX) funcs->DrawLine = sh7722DrawLineMatrix; else funcs->DrawLine = sh7722DrawLine; break; default: break; } /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set = SH7722_SUPPORTED_DRAWINGFUNCTIONS; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: /* ...require valid source. */ SH7722_CHECK_VALIDATE( SOURCE ); /* Use blending? */ if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { /* need valid source and destination blend factors */ SH7722_CHECK_VALIDATE( BLENDING ); } /* Use color keying? */ if (state->blittingflags & DSBLIT_SRC_COLORKEY) { /* Need valid color key settings (enabling). */ SH7722_CHECK_VALIDATE( COLOR_KEY ); sdev->ckey_b_enabled = true; } /* Disable color keying? */ else if (sdev->ckey_b_enabled) invalidate_ckey( sdrv, sdev ); /* Use color change? */ if (state->blittingflags & DSBLIT_COLORIZE) { /* Need valid color change settings (enabling). */ SH7722_CHECK_VALIDATE( COLOR_CHANGE ); sdev->color_change_enabled = true; } /* Disable color change? */ else if (sdev->color_change_enabled) invalidate_color_change( sdrv, sdev ); /* Use mask? */ if (state->blittingflags & DSBLIT_SRC_MASK_ALPHA) { /* need valid mask */ SH7722_CHECK_VALIDATE( MASK ); sdev->mask_enabled = true; } /* Disable mask? */ else if (sdev->mask_enabled) invalidate_mask( sdrv, sdev ); SH7722_CHECK_VALIDATE( BLIT_OP ); /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set = SH7722_SUPPORTED_BLITTINGFUNCTIONS; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } sdev->dflags = state->drawingflags; sdev->bflags = state->blittingflags; sdev->render_options = state->render_options; sdev->color = state->color; /* * 4) Clear modification flags * * All flags have been evaluated in 1) and remembered for further validation. * If the hw independent state is not modified, this function won't get called * for subsequent rendering functions, unless they aren't defined by 3). */ state->mod_hw = 0; } /**********************************************************************************************************************/ static inline void draw_rectangle( SH7722DriverData *sdrv, SH7722DeviceData *sdev, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, bool antialias, bool full ) { u32 ctrl = antialias ? WR_CTRL_ANTIALIAS : 0; u32 *prep = start_buffer( sdrv, full ? 24 : 12 ); if (antialias) { prep[0] = BEM_WR_FGC; prep[1] = PIXEL_ARGB( (sdev->color.a * AA_COEF) >> 8, (sdev->color.r * AA_COEF) >> 8, (sdev->color.g * AA_COEF) >> 8, (sdev->color.b * AA_COEF) >> 8 ); prep[2] = BEM_PE_FIXEDALPHA; prep[3] = (sdev->color.a * AA_COEF) << 16; } else { prep[0] = BEM_WR_FGC; prep[1] = PIXEL_ARGB( sdev->color.a, sdev->color.r, sdev->color.g, sdev->color.b ); prep[2] = BEM_PE_FIXEDALPHA; prep[3] = (sdev->color.a << 24) << (sdev->color.a << 16); } prep[4] = BEM_WR_V1; prep[5] = SH7722_XY( x1, y1 ); prep[6] = BEM_WR_V2; prep[7] = SH7722_XY( x2, y2 ); prep[8] = BEM_PE_OPERATION; prep[9] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : (antialias ? (BLE_FUNC_AxB_plus_CxD | BLE_SRCF_ONE | BLE_SRCA_FIXED | BLE_DSTF_1_SRC_A) : BLE_FUNC_NONE ); if (sdev->dflags & DSDRAW_XOR) prep[9] |= BLE_ROP_XOR; prep[10] = BEM_WR_CTRL; prep[11] = WR_CTRL_LINE | ctrl; if (full) { prep[12] = BEM_WR_V2; prep[13] = SH7722_XY( x3, y3 ); prep[14] = BEM_WR_CTRL; prep[15] = WR_CTRL_POLYLINE | ctrl; prep[16] = BEM_WR_V2; prep[17] = SH7722_XY( x4, y4 ); prep[18] = BEM_WR_CTRL; prep[19] = WR_CTRL_POLYLINE | ctrl; prep[20] = BEM_WR_V2; prep[21] = SH7722_XY( x1, y1 ); prep[22] = BEM_WR_CTRL; prep[23] = WR_CTRL_POLYLINE | ctrl; submit_buffer( sdrv, 24 ); } else { prep[7] = SH7722_XY( x3, y3 ); prep[11] |= WR_CTRL_ENDPOINT; submit_buffer( sdrv, 12 ); } } /* * Render a filled rectangle using the current hardware state. */ static bool sh7722FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 8 ); D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); DUMP_INFO(); prep[0] = BEM_BE_V1; prep[1] = SH7722_XY( rect->x, rect->y ); prep[2] = BEM_BE_V2; prep[3] = SH7722_XY( rect->w, rect->h ); prep[4] = BEM_PE_OPERATION; prep[5] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[5] |= BLE_ROP_XOR; prep[6] = BEM_BE_CTRL; prep[7] = BE_CTRL_RECTANGLE | BE_CTRL_SCANMODE_LINE; submit_buffer( sdrv, 8 ); return true; } /* * This version sends a quadrangle to have all four edges transformed. */ static bool sh7722FillRectangleMatrixAA( void *drv, void *dev, DFBRectangle *rect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep; D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); DUMP_INFO(); if (sdev->render_options & DSRO_ANTIALIAS) { int x1 = rect->x; int y1 = rect->y; int x2 = rect->x + rect->w; int y2 = rect->y; int x3 = rect->x + rect->w; int y3 = rect->y + rect->h; int x4 = rect->x; int y4 = rect->y + rect->h; if (sdev->render_options & DSRO_MATRIX) { int t; t = ((x1 * sdev->matrix[0]) + (y1 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y1 = ((x1 * sdev->matrix[3]) + (y1 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x1 = t; t = ((x2 * sdev->matrix[0]) + (y2 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y2 = ((x2 * sdev->matrix[3]) + (y2 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x2 = t; t = ((x3 * sdev->matrix[0]) + (y3 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y3 = ((x3 * sdev->matrix[3]) + (y3 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x3 = t; t = ((x4 * sdev->matrix[0]) + (y4 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y4 = ((x4 * sdev->matrix[3]) + (y4 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x4 = t; } prep = start_buffer( sdrv, 28 ); prep[0] = BEM_WR_FGC; prep[1] = PIXEL_ARGB( (sdev->color.a * AA_COEF) >> 8, (sdev->color.r * AA_COEF) >> 8, (sdev->color.g * AA_COEF) >> 8, (sdev->color.b * AA_COEF) >> 8 ); prep[2] = BEM_PE_FIXEDALPHA; prep[3] = (sdev->color.a * AA_COEF) << 16; prep[4] = BEM_WR_V1; prep[5] = SH7722_XY( x1, y1 ); prep[6] = BEM_WR_V2; prep[7] = SH7722_XY( x2, y2 ); prep[8] = BEM_PE_OPERATION; prep[9] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : (BLE_FUNC_AxB_plus_CxD | BLE_SRCF_ONE | BLE_SRCA_FIXED | BLE_DSTF_1_SRC_A); if (sdev->dflags & DSDRAW_XOR) prep[9] |= BLE_ROP_XOR; prep[10] = BEM_WR_CTRL; prep[11] = WR_CTRL_LINE | WR_CTRL_ANTIALIAS; if (rect->h > 1 && rect->w > 1) { prep[12] = BEM_WR_V2; prep[13] = SH7722_XY( x3, y3 ); prep[14] = BEM_WR_CTRL; prep[15] = WR_CTRL_POLYLINE | WR_CTRL_ANTIALIAS; prep[16] = BEM_WR_V2; prep[17] = SH7722_XY( x4, y4 ); prep[18] = BEM_WR_CTRL; prep[19] = WR_CTRL_POLYLINE | WR_CTRL_ANTIALIAS; prep[20] = BEM_WR_V2; prep[21] = SH7722_XY( x1, y1 ); prep[22] = BEM_WR_CTRL; prep[23] = WR_CTRL_POLYLINE | WR_CTRL_ANTIALIAS; prep[24] = BEM_WR_FGC; prep[25] = PIXEL_ARGB( sdev->color.a, sdev->color.r, sdev->color.g, sdev->color.b ); prep[26] = BEM_PE_FIXEDALPHA; prep[27] = (sdev->color.a << 24) << (sdev->color.a << 16); submit_buffer( sdrv, 28 ); } else { prep[7] = SH7722_XY( x3, y3 ); prep[11] |= WR_CTRL_ENDPOINT; prep[12] = BEM_WR_FGC; prep[13] = PIXEL_ARGB( sdev->color.a, sdev->color.r, sdev->color.g, sdev->color.b ); prep[14] = BEM_PE_FIXEDALPHA; prep[15] = (sdev->color.a << 24) << (sdev->color.a << 16); submit_buffer( sdrv, 16 ); } } prep = start_buffer( sdrv, 12 ); prep[0] = BEM_BE_V1; prep[1] = SH7722_XY( rect->x, rect->y ); prep[2] = BEM_BE_V2; prep[3] = SH7722_XY( rect->x, rect->y + rect->h ); prep[4] = BEM_BE_V3; prep[5] = SH7722_XY( rect->x + rect->w, rect->y ); prep[6] = BEM_BE_V4; prep[7] = SH7722_XY( rect->x + rect->w, rect->y + rect->h ); prep[8] = BEM_PE_OPERATION; prep[9] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[9] |= BLE_ROP_XOR; prep[10] = BEM_BE_CTRL; if (sdev->render_options & DSRO_MATRIX) prep[11] = BE_CTRL_QUADRANGLE | BE_CTRL_SCANMODE_4x4 | BE_CTRL_MATRIX | BE_CTRL_FIXMODE_16_16;// | BE_CTRL_ORIGIN; else prep[11] = BE_CTRL_QUADRANGLE | BE_CTRL_SCANMODE_LINE; submit_buffer( sdrv, 12 ); return true; } /* * Render a filled triangle using the current hardware state. */ bool sh7722FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep; D_DEBUG_AT( SH7722_BLT, "%s( %d,%d - %d,%d - %d,%d )\n", __FUNCTION__, tri->x1, tri->y1, tri->x2, tri->y2, tri->x3, tri->y3 ); DUMP_INFO(); if (sdev->render_options & DSRO_ANTIALIAS) { int x1, y1; int x2, y2; int x3, y3; if (sdev->render_options & DSRO_MATRIX) { x1 = ((tri->x1 * sdev->matrix[0]) + (tri->y1 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y1 = ((tri->x1 * sdev->matrix[3]) + (tri->y1 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x2 = ((tri->x2 * sdev->matrix[0]) + (tri->y2 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y2 = ((tri->x2 * sdev->matrix[3]) + (tri->y2 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x3 = ((tri->x3 * sdev->matrix[0]) + (tri->y3 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y3 = ((tri->x3 * sdev->matrix[3]) + (tri->y3 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; } else { x1 = tri->x1; y1 = tri->y1; x2 = tri->x2; y2 = tri->y2; x3 = tri->x3; y3 = tri->y3; } prep = start_buffer( sdrv, 24 ); prep[0] = BEM_WR_FGC; prep[1] = PIXEL_ARGB( (sdev->color.a * AA_COEF) >> 8, (sdev->color.r * AA_COEF) >> 8, (sdev->color.g * AA_COEF) >> 8, (sdev->color.b * AA_COEF) >> 8 ); prep[2] = BEM_PE_FIXEDALPHA; prep[3] = (sdev->color.a * AA_COEF) << 16; prep[4] = BEM_WR_V1; prep[5] = SH7722_XY( x1, y1 ); prep[6] = BEM_WR_V2; prep[7] = SH7722_XY( x2, y2 ); prep[8] = BEM_PE_OPERATION; prep[9] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : (BLE_FUNC_AxB_plus_CxD | BLE_SRCF_ONE | BLE_SRCA_FIXED | BLE_DSTF_1_SRC_A); if (sdev->dflags & DSDRAW_XOR) prep[9] |= BLE_ROP_XOR; prep[10] = BEM_WR_CTRL; prep[11] = WR_CTRL_LINE | WR_CTRL_ANTIALIAS; prep[12] = BEM_WR_V2; prep[13] = SH7722_XY( x3, y3 ); prep[14] = BEM_WR_CTRL; prep[15] = WR_CTRL_POLYLINE | WR_CTRL_ANTIALIAS; prep[16] = BEM_WR_V2; prep[17] = SH7722_XY( x1, y1 ); prep[18] = BEM_WR_CTRL; prep[19] = WR_CTRL_POLYLINE | WR_CTRL_ANTIALIAS; prep[20] = BEM_WR_FGC; prep[21] = PIXEL_ARGB( sdev->color.a, sdev->color.r, sdev->color.g, sdev->color.b ); prep[22] = BEM_PE_FIXEDALPHA; prep[23] = (sdev->color.a << 24) << (sdev->color.a << 16); submit_buffer( sdrv, 24 ); } prep = start_buffer( sdrv, 12 ); prep[0] = BEM_BE_V1; prep[1] = SH7722_XY( tri->x1, tri->y1 ); prep[2] = BEM_BE_V2; prep[3] = SH7722_XY( tri->x2, tri->y2 ); prep[4] = BEM_BE_V3; prep[5] = SH7722_XY( tri->x3, tri->y3 ); prep[6] = BEM_BE_V4; prep[7] = SH7722_XY( tri->x3, tri->y3 ); prep[8] = BEM_PE_OPERATION; prep[9] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[9] |= BLE_ROP_XOR; prep[10] = BEM_BE_CTRL; prep[11] = BE_CTRL_QUADRANGLE | BE_CTRL_SCANMODE_LINE; if (sdev->render_options & DSRO_MATRIX) prep[11] |= BE_CTRL_MATRIX | BE_CTRL_FIXMODE_16_16;// | BE_CTRL_ORIGIN; submit_buffer( sdrv, 12 ); return true; } /* * Render rectangle outlines using the current hardware state. */ static bool sh7722DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 20 ); int x1 = rect->x; int y1 = rect->y; int x2 = rect->x + rect->w; int y2 = rect->y + rect->h; D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); DUMP_INFO(); prep[0] = BEM_WR_V1; prep[1] = (y1 << 16) | x1; prep[2] = BEM_WR_V2; prep[3] = (y1 << 16) | x2; prep[4] = BEM_PE_OPERATION; prep[5] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[5] |= BLE_ROP_XOR; prep[6] = BEM_WR_CTRL; prep[7] = WR_CTRL_LINE; if (rect->h > 1 && rect->w > 1) { prep[8] = BEM_WR_V2; prep[9] = (y2 << 16) | x2; prep[10] = BEM_WR_CTRL; prep[11] = WR_CTRL_POLYLINE; prep[12] = BEM_WR_V2; prep[13] = (y2 << 16) | x1; prep[14] = BEM_WR_CTRL; prep[15] = WR_CTRL_POLYLINE; prep[16] = BEM_WR_V2; prep[17] = (y1 << 16) | x1; prep[18] = BEM_WR_CTRL; prep[19] = WR_CTRL_POLYLINE; submit_buffer( sdrv, 20 ); } else { prep[3] = (y2 << 16) | x2; prep[7] |= WR_CTRL_ENDPOINT; submit_buffer( sdrv, 8 ); } return true; } static bool sh7722DrawRectangleMatrixAA( void *drv, void *dev, DFBRectangle *rect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; int x1 = rect->x; int y1 = rect->y; int x2 = rect->x + rect->w; int y2 = rect->y; int x3 = rect->x + rect->w; int y3 = rect->y + rect->h; int x4 = rect->x; int y4 = rect->y + rect->h; D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); DUMP_INFO(); if (sdev->render_options & DSRO_MATRIX) { int t; t = ((x1 * sdev->matrix[0]) + (y1 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y1 = ((x1 * sdev->matrix[3]) + (y1 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x1 = t; t = ((x2 * sdev->matrix[0]) + (y2 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y2 = ((x2 * sdev->matrix[3]) + (y2 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x2 = t; t = ((x3 * sdev->matrix[0]) + (y3 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y3 = ((x3 * sdev->matrix[3]) + (y3 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x3 = t; t = ((x4 * sdev->matrix[0]) + (y4 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y4 = ((x4 * sdev->matrix[3]) + (y4 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x4 = t; } if (sdev->render_options & DSRO_ANTIALIAS) draw_rectangle( sdrv, sdev, x1, y1, x2, y2, x3, y3, x4, y4, true, rect->h > 1 && rect->w > 1 ); draw_rectangle( sdrv, sdev, x1, y1, x2, y2, x3, y3, x4, y4, false, rect->h > 1 && rect->w > 1 ); return true; } /* * Render a line using the current hardware state. */ static bool sh7722DrawLine( void *drv, void *dev, DFBRegion *line ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 8 ); D_DEBUG_AT( SH7722_BLT, "%s( %d, %d -> %d, %d )\n", __FUNCTION__, DFB_REGION_VALS( line ) ); DUMP_INFO(); prep[0] = BEM_WR_V1; prep[1] = SH7722_XY( line->x1, line->y1 ); prep[2] = BEM_WR_V2; prep[3] = SH7722_XY( line->x2, line->y2 ); prep[4] = BEM_PE_OPERATION; prep[5] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[5] |= BLE_ROP_XOR; prep[6] = BEM_WR_CTRL; prep[7] = WR_CTRL_LINE | WR_CTRL_ENDPOINT; submit_buffer( sdrv, 8 ); return true; } static bool sh7722DrawLineMatrix( void *drv, void *dev, DFBRegion *line ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 8 ); D_DEBUG_AT( SH7722_BLT, "%s( %d, %d -> %d, %d )\n", __FUNCTION__, DFB_REGION_VALS( line ) ); DUMP_INFO(); int x1 = ((line->x1 * sdev->matrix[0]) + (line->y1 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; int y1 = ((line->x1 * sdev->matrix[3]) + (line->y1 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; int x2 = ((line->x2 * sdev->matrix[0]) + (line->y2 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; int y2 = ((line->x2 * sdev->matrix[3]) + (line->y2 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; prep[0] = BEM_WR_V1; prep[1] = SH7722_XY( x1, y1 ); prep[2] = BEM_WR_V2; prep[3] = SH7722_XY( x2, y2 ); prep[4] = BEM_PE_OPERATION; prep[5] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[5] |= BLE_ROP_XOR; prep[6] = BEM_WR_CTRL; prep[7] = WR_CTRL_LINE | WR_CTRL_ENDPOINT; submit_buffer( sdrv, 8 ); return true; } static bool sh7722DrawLineAA( void *drv, void *dev, DFBRegion *line ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 24 ); int x1, y1; int x2, y2; D_DEBUG_AT( SH7722_BLT, "%s( %d, %d -> %d, %d )\n", __FUNCTION__, DFB_REGION_VALS( line ) ); DUMP_INFO(); if (sdev->render_options & DSRO_MATRIX) { x1 = ((line->x1 * sdev->matrix[0]) + (line->y1 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y1 = ((line->x1 * sdev->matrix[3]) + (line->y1 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; x2 = ((line->x2 * sdev->matrix[0]) + (line->y2 * sdev->matrix[1]) + sdev->matrix[2]) >> 16; y2 = ((line->x2 * sdev->matrix[3]) + (line->y2 * sdev->matrix[4]) + sdev->matrix[5]) >> 16; } else { x1 = line->x1; y1 = line->y1; x2 = line->x2; y2 = line->y2; } prep[0] = BEM_WR_FGC; prep[1] = PIXEL_ARGB( (sdev->color.a * AA_COEF) >> 8, (sdev->color.r * AA_COEF) >> 8, (sdev->color.g * AA_COEF) >> 8, (sdev->color.b * AA_COEF) >> 8 ); prep[2] = BEM_PE_FIXEDALPHA; prep[3] = (sdev->color.a * AA_COEF) << 16; prep[4] = BEM_WR_V1; prep[5] = SH7722_XY( x1, y1 ); prep[6] = BEM_WR_V2; prep[7] = SH7722_XY( x2, y2 ); prep[8] = BEM_PE_OPERATION; prep[9] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : (BLE_FUNC_AxB_plus_CxD | BLE_SRCF_ONE | BLE_SRCA_FIXED | BLE_DSTF_1_SRC_A); if (sdev->dflags & DSDRAW_XOR) prep[9] |= BLE_ROP_XOR; prep[10] = BEM_WR_CTRL; prep[11] = WR_CTRL_LINE | WR_CTRL_ENDPOINT | WR_CTRL_ANTIALIAS; prep[12] = BEM_WR_FGC; prep[13] = PIXEL_ARGB( sdev->color.a, sdev->color.r, sdev->color.g, sdev->color.b ); prep[14] = BEM_PE_FIXEDALPHA; prep[15] = (sdev->color.a << 24) | (sdev->color.a << 16); prep[16] = BEM_WR_V1; prep[17] = SH7722_XY( x1, y1 ); prep[18] = BEM_WR_V2; prep[19] = SH7722_XY( x2, y2 ); prep[20] = BEM_PE_OPERATION; prep[21] = (sdev->dflags & DSDRAW_BLEND) ? (BLE_FUNC_AxB_plus_CxD | sdev->ble_srcf | BLE_SRCA_FIXED | sdev->ble_dstf) : BLE_FUNC_NONE; if (sdev->dflags & DSDRAW_XOR) prep[21] |= BLE_ROP_XOR; prep[22] = BEM_WR_CTRL; prep[23] = WR_CTRL_LINE | WR_CTRL_ENDPOINT; submit_buffer( sdrv, 24 ); return true; } /* * Common implementation for Blit() and StretchBlit(). */ static inline bool sh7722DoBlit( SH7722DriverData *sdrv, SH7722DeviceData *sdev, DFBRectangle *rect, int x, int y, int w, int h ) { int num = 8; __u32 *prep = start_buffer( sdrv, 12 ); D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d -> %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ), x, y, w, h ); DUMP_INFO(); prep[0] = BEM_BE_SRC_LOC; /* Stencil mode needs a workaround, because the hardware always adds the source location. */ if (sdev->bflags & DSBLIT_SRC_MASK_ALPHA && sdev->mask_flags & DSMF_STENCIL) prep[1] = SH7722_XY( 0, 0 ); else prep[1] = SH7722_XY( rect->x, rect->y ); prep[2] = BEM_BE_SRC_SIZE; prep[3] = SH7722_XY( rect->w, rect->h ); prep[4] = BEM_BE_V1; prep[5] = SH7722_XY( x, y ); prep[6] = BEM_BE_V2; prep[7] = SH7722_XY( w, h ); /* Stencil mode needs a workaround, because the hardware always adds the source location. */ if (sdev->bflags & DSBLIT_SRC_MASK_ALPHA && sdev->mask_flags & DSMF_STENCIL) { prep[num++] = BEM_TE_SRC_BASE; prep[num++] = sdev->src_phys + sdev->src_pitch * rect->y + sdev->src_bpp * rect->x; SH7722_INVALIDATE( SOURCE ); } prep[num++] = BEM_BE_CTRL; prep[num++] = BE_CTRL_RECTANGLE | BE_CTRL_TEXTURE | BE_CTRL_SCANMODE_LINE; if (sdev->bflags & DSBLIT_ROTATE180) prep[num-1] |= BE_FLIP_BOTH; else if (rect->w == w && rect->h == h) /* No blit direction handling for StretchBlit(). */ prep[num-1] |= BE_CTRL_BLTDIR_AUTOMATIC; submit_buffer( sdrv, num ); return true; } /* * This version sends a quadrangle to have all four edges transformed. */ __attribute__((noinline)) static bool sh7722DoBlitM( SH7722DriverData *sdrv, SH7722DeviceData *sdev, DFBRectangle *rect, int x1, int y1, int x2, int y2 ) { int num = 12; __u32 *prep = start_buffer( sdrv, 16 ); D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d -> %d, %d - %d, %d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ), x1, y1, x2, y2 ); DUMP_INFO(); prep[0] = BEM_BE_SRC_LOC; /* Stencil mode needs a workaround, because the hardware always adds the source location. */ if (sdev->bflags & DSBLIT_SRC_MASK_ALPHA && sdev->mask_flags & DSMF_STENCIL) prep[1] = SH7722_XY( 0, 0 ); else prep[1] = SH7722_XY( rect->x, rect->y ); prep[2] = BEM_BE_SRC_SIZE; prep[3] = SH7722_XY( rect->w, rect->h ); prep[4] = BEM_BE_V1; prep[5] = SH7722_XY( x1, y1 ); prep[6] = BEM_BE_V2; prep[7] = SH7722_XY( x1, y2 ); prep[8] = BEM_BE_V3; prep[9] = SH7722_XY( x2, y1 ); prep[10] = BEM_BE_V4; prep[11] = SH7722_XY( x2, y2 ); /* Stencil mode needs a workaround, because the hardware always adds the source location. */ if (sdev->bflags & DSBLIT_SRC_MASK_ALPHA && sdev->mask_flags & DSMF_STENCIL) { prep[num++] = BEM_TE_SRC_BASE; prep[num++] = sdev->src_phys + sdev->src_pitch * rect->y + sdev->src_bpp * rect->x; SH7722_INVALIDATE( SOURCE ); } prep[num++] = BEM_BE_CTRL; prep[num++] = BE_CTRL_QUADRANGLE | BE_CTRL_TEXTURE | BE_CTRL_SCANMODE_4x4 | BE_CTRL_MATRIX | BE_CTRL_FIXMODE_16_16;// | BE_CTRL_ORIGIN; if (sdev->bflags & DSBLIT_ROTATE180) prep[num-1] |= BE_FLIP_BOTH; submit_buffer( sdrv, num ); return true; } /* * Blit a rectangle using the current hardware state. */ bool sh7722Blit( void *drv, void *dev, DFBRectangle *rect, int x, int y ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d -> %d, %d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ), x, y ); if (sdev->render_options & DSRO_MATRIX) return sh7722DoBlitM( sdrv, sdev, rect, DFB_REGION_VALS_FROM_RECTANGLE_VALS( x, y, rect->w, rect->h ) ); return sh7722DoBlit( sdrv, sdev, rect, x, y, rect->w, rect->h ); } /* * StretchBlit a rectangle using the current hardware state. */ bool sh7722StretchBlit( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; D_DEBUG_AT( SH7722_BLT, "%s( %d, %d - %dx%d -> %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( srect ), DFB_RECTANGLE_VALS( drect ) ); if (sdev->render_options & DSRO_MATRIX) return sh7722DoBlitM( sdrv, sdev, srect, DFB_REGION_VALS_FROM_RECTANGLE( drect ) ); return sh7722DoBlit( sdrv, sdev, srect, drect->x, drect->y, drect->w, drect->h ); } DirectFB-1.2.10/gfxdrivers/sh772x/sh7723_blt.c0000644000175000017500000006772611164361026015347 00000000000000#ifdef SH7723_DEBUG_BLT #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sh7722.h" #include "sh7723_blt.h" D_DEBUG_DOMAIN( SH7723_BLT, "SH7723/BLT", "Renesas SH7723 Drawing Engine" ); /* * State validation flags. * * There's no prefix because of the macros below. */ enum { DEST = 0x00000001, CLIP = 0x00000002, DEST_CLIP = 0x00000003, COLOR16 = 0x00000100, ALPHA = 0x00001000, SOURCE = 0x00010000, STRANS = 0x00020000, ALL = 0x00031103, }; /* * State handling macros. */ #define SH7723_VALIDATE(flags) do { sdev->v_flags |= (flags); } while (0) #define SH7723_INVALIDATE(flags) do { sdev->v_flags &= ~(flags); } while (0) #define SH7723_CHECK_VALIDATE(flag) do { \ if ((sdev->v_flags & flag) != flag) \ sh7723_validate_##flag( sdrv, sdev, state ); \ } while (0) #define DUMP_INFO() D_DEBUG_AT( SH7723_BLT, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); /**********************************************************************************************************************/ static inline bool start_hardware( SH7722DriverData *sdrv ) { SH772xGfxSharedArea *shared = sdrv->gfx_shared; D_DEBUG_AT( SH7723_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); if (shared->hw_running || !shared->next_valid || shared->next_end == shared->next_start) return false; shared->hw_running = true; shared->hw_start = shared->next_start; shared->hw_end = shared->next_end; shared->next_start = shared->next_end = (shared->hw_end + 1 + 3) & ~3; shared->next_valid = false; shared->num_words += shared->hw_end - shared->hw_start; shared->num_starts++; DUMP_INFO(); D_ASSERT( shared->buffer[shared->hw_end] == M2DG_OPCODE_TRAP ); SH7722_TDG_SETREG32( sdrv, M2DG_DLSAR, shared->buffer_phys + shared->hw_start*4 ); SH7722_TDG_SETREG32( sdrv, M2DG_SCLR, 1 ); return true; } __attribute__((noinline)) static void flush_prepared( SH7722DriverData *sdrv ) { SH772xGfxSharedArea *shared = sdrv->gfx_shared; unsigned int timeout = 2; D_DEBUG_AT( SH7723_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); D_ASSERT( sdrv->prep_num < SH772xGFX_BUFFER_WORDS ); D_ASSERT( sdrv->prep_num <= D_ARRAY_SIZE(sdrv->prep_buf) ); /* Something prepared? */ while (sdrv->prep_num) { int next_end; /* Mark shared information as invalid. From this point on the interrupt handler * will not continue with the next block, and we'll start the hardware ourself. */ shared->next_valid = false; /* Check if there's enough space at the end. * Wait until hardware has started next block before it gets too big. */ if (shared->next_end + sdrv->prep_num >= SH772xGFX_BUFFER_WORDS || shared->next_end - shared->next_start >= SH772xGFX_BUFFER_WORDS/4) { /* If there's no next block waiting, start at the beginning. */ if (shared->next_start == shared->next_end) shared->next_start = shared->next_end = 0; else { D_ASSERT( shared->buffer[shared->hw_end] == M2DG_OPCODE_TRAP ); /* Mark area as valid again. */ shared->next_valid = true; /* Start in case it got idle while doing the checks. */ if (!start_hardware( sdrv )) { /* * Hardware has not been started (still running). * Check for timeout. */ if (!timeout--) { D_ERROR( "SH7723/Blt: Timeout waiting for processing!\n" ); direct_log_printf( NULL, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); D_ASSERT( shared->buffer[shared->hw_end] == M2DG_OPCODE_TRAP ); sh7723EngineReset( sdrv, sdrv->dev ); } /* Wait til next block is started. */ ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_WAIT_NEXT ); } /* Start over with the checks. */ continue; } } /* We are appending in case there was already a next block. */ next_end = shared->next_end + sdrv->prep_num; /* Reset the timeout counter. */ timeout = 2; /* While the hardware is running... */ while (shared->hw_running) { D_ASSERT( shared->buffer[shared->hw_end] == M2DG_OPCODE_TRAP ); /* ...make sure we don't over lap with its current buffer, otherwise wait. */ if (shared->hw_start > next_end || shared->hw_end < shared->next_start) break; /* Check for timeout. */ if (!timeout--) { D_ERROR( "SH7723/Blt: Timeout waiting for space!\n" ); direct_log_printf( NULL, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); D_ASSERT( shared->buffer[shared->hw_end] == M2DG_OPCODE_TRAP ); sh7723EngineReset( sdrv, sdrv->dev ); } /* Wait til next block is started. */ ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_WAIT_NEXT ); } /* Copy from local to shared buffer. */ direct_memcpy( (void*) &shared->buffer[shared->next_end], &sdrv->prep_buf[0], sdrv->prep_num * sizeof(__u32) ); /* Terminate the block. */ shared->buffer[next_end] = M2DG_OPCODE_TRAP; /* Update next block information and mark valid. */ shared->next_end = next_end; shared->next_valid = true; /* Reset local counter. */ sdrv->prep_num = 0; } /* Start in case it is idle. */ start_hardware( sdrv ); } static inline __u32 * start_buffer( SH7722DriverData *sdrv, int space ) { /* Check for space in local buffer. */ if (sdrv->prep_num + space > SH7722GFX_MAX_PREPARE) { /* Flush local buffer. */ flush_prepared( sdrv ); D_ASSERT( sdrv->prep_num == 0 ); } /* Return next write position. */ return &sdrv->prep_buf[sdrv->prep_num]; } static inline void submit_buffer( SH7722DriverData *sdrv, int entries ) { D_ASSERT( sdrv->prep_num + entries <= SH7722GFX_MAX_PREPARE ); /* Increment next write position. */ sdrv->prep_num += entries; } /**********************************************************************************************************************/ static inline void sh7723_validate_DEST_CLIP( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 18 ); D_DEBUG_AT( SH7723_BLT, "%s( 0x%08lx [%d] - %4d,%4d-%4dx%4d )\n", __FUNCTION__, state->dst.phys, state->dst.pitch, DFB_RECTANGLE_VALS_FROM_REGION( &state->clip ) ); prep[0] = M2DG_OPCODE_WPR; prep[1] = 0x0d4; prep[2] = SH7723_XY( state->clip.x1, state->clip.y1 ) ; prep[3] = M2DG_OPCODE_WPR; prep[4] = 0x0d8; prep[5] = SH7723_XY( state->clip.x2, state->clip.y2) ; if (sdev->v_flags & DEST) { submit_buffer( sdrv, 6 ); } else { CoreSurface *surface = state->destination; CoreSurfaceBuffer *buffer = state->dst.buffer; sdev->dst_phys = state->dst.phys; sdev->dst_pitch = state->dst.pitch; sdev->dst_bpp = DFB_BYTES_PER_PIXEL( buffer->format ); sdev->dst_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS; sdev->rclr &= ~0x00140000; switch (buffer->format) { case DSPF_RGB16: sdev->rclr |= 0x00040000; break; case DSPF_ARGB1555: sdev->rclr |= 0x00140000; break; default: D_BUG("Unexpected pixelformat\n"); return; } /* Set destination start address. */ prep[ 6] = M2DG_OPCODE_WPR; prep[ 7] = 0x50; prep[ 8] = sdev->dst_phys; /* Set destination stride. */ prep[ 9] = M2DG_OPCODE_WPR; prep[10] = 0x5c; prep[11] = sdev->dst_pitch / sdev->dst_bpp; /* Set destination pixelformat in rendering control. */ prep[12] = M2DG_OPCODE_WPR; prep[13] = 0xc0; prep[14] = sdev->rclr; /* Set system clipping rectangle. */ prep[15] = M2DG_OPCODE_WPR; prep[16] = 0xd0; prep[17] = SH7723_XY( surface->config.size.w - 1, surface->config.size.h - 1 ); submit_buffer( sdrv, 18 ); } /* Set the flags. */ SH7723_VALIDATE( DEST_CLIP ); } static inline void sh7723_validate_COLOR16( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { sdev->color16 = dfb_pixel_from_color( state->destination->config.format, &state->color ); /* Set the flags. */ SH7723_VALIDATE( COLOR16 ); } static inline void sh7723_validate_ALPHA( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 3 ); prep[0] = M2DG_OPCODE_WPR; prep[1] = 0x088; prep[2] = state->color.a; submit_buffer( sdrv, 3 ); /* Set the flags. */ SH7723_VALIDATE( ALPHA ); } static inline void sh7723_validate_SOURCE( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 6 ); CoreSurfaceBuffer *buffer = state->src.buffer; sdev->src_phys = state->src.phys; sdev->src_pitch = state->src.pitch; sdev->src_bpp = DFB_BYTES_PER_PIXEL( buffer->format ); sdev->src_index = DFB_PIXELFORMAT_INDEX( buffer->format ) % DFB_NUM_PIXELFORMATS; /* Set source start address. */ prep[0] = M2DG_OPCODE_WPR; prep[1] = 0x4c; prep[2] = sdev->src_phys; /* Set source stride. */ prep[3] = M2DG_OPCODE_WPR; prep[4] = 0x58; prep[5] = sdev->src_pitch / sdev->src_bpp; submit_buffer( sdrv, 6 ); /* Set the flags. */ SH7723_VALIDATE( SOURCE ); } static inline void sh7723_validate_STRANS( SH7722DriverData *sdrv, SH7722DeviceData *sdev, CardState *state ) { __u32 *prep = start_buffer( sdrv, 3 ); prep[0] = M2DG_OPCODE_WPR; prep[1] = 0x080; prep[2] = state->src_colorkey; submit_buffer( sdrv, 3 ); /* Set the flags. */ SH7723_VALIDATE( STRANS ); } /**********************************************************************************************************************/ DFBResult sh7723EngineSync( void *drv, void *dev ) { DFBResult ret = DFB_OK; SH7722DriverData *sdrv = drv; SH772xGfxSharedArea *shared = sdrv->gfx_shared; D_DEBUG_AT( SH7723_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); while (shared->hw_running && ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_WAIT_IDLE ) < 0) { if (errno == EINTR) continue; ret = errno2result( errno ); D_PERROR( "SH7723/BLT: SH7723GFX_IOCTL_WAIT_IDLE failed!\n" ); direct_log_printf( NULL, " -> %srunning, hw %d-%d, next %d-%d - %svalid\n", \ sdrv->gfx_shared->hw_running ? "" : "not ", \ sdrv->gfx_shared->hw_start, \ sdrv->gfx_shared->hw_end, \ sdrv->gfx_shared->next_start, \ sdrv->gfx_shared->next_end, \ sdrv->gfx_shared->next_valid ? "" : "not " ); break; } if (ret == DFB_OK) { D_ASSERT( !shared->hw_running ); D_ASSERT( !shared->next_valid ); } return ret; } void sh7723EngineReset( void *drv, void *dev ) { SH7722DriverData *sdrv = drv; __u32 *prep; D_DEBUG_AT( SH7723_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_RESET ); prep = start_buffer( sdrv, 4 ); /* Reset current pointer. */ prep[0] = M2DG_OPCODE_MOVE; prep[1] = 0; /* Reset local offset. */ prep[2] = M2DG_OPCODE_LCOFS; prep[3] = 0; submit_buffer( sdrv, 4 ); } void sh7723EmitCommands( void *drv, void *dev ) { SH7722DriverData *sdrv = drv; D_DEBUG_AT( SH7723_BLT, "%s()\n", __FUNCTION__ ); flush_prepared( sdrv ); } void sh7723FlushTextureCache( void *drv, void *dev ) { SH7722DriverData *sdrv = drv; __u32 *prep = start_buffer( sdrv, 1 ); D_DEBUG_AT( SH7723_BLT, "%s()\n", __FUNCTION__ ); DUMP_INFO(); prep[0] = M2DG_OPCODE_SYNC | M2DG_SYNC_TCLR; submit_buffer( sdrv, 1 ); } /**********************************************************************************************************************/ void sh7723CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { D_DEBUG_AT( SH7723_BLT, "%s( %p, 0x%08x )\n", __FUNCTION__, state, accel ); /* Return if the desired function is not supported at all. */ if (accel & ~(SH7723_SUPPORTED_DRAWINGFUNCTIONS | SH7723_SUPPORTED_BLITTINGFUNCTIONS)) return; /* Return if the destination format is not supported. */ switch (state->destination->config.format) { case DSPF_RGB16: // case DSPF_ARGB1555: break; default: return; } /* Check if drawing or blitting is requested. */ if (DFB_DRAWING_FUNCTION( accel )) { /* Return if unsupported drawing flags are set. */ if (state->drawingflags & ~SH7723_SUPPORTED_DRAWINGFLAGS) return; /* Return if blending with unsupported blend functions is requested. */ if (state->drawingflags & DSDRAW_BLEND) { switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: break; default: return; } /* Return if blending with unsupported blend functions is requested. */ if (state->src_blend != DSBF_SRCALPHA || state->dst_blend != DSBF_INVSRCALPHA) return; /* XOR only without blending. */ if (state->drawingflags & DSDRAW_XOR) return; } /* Enable acceleration of drawing functions. */ state->accel |= accel; } else { DFBSurfaceBlittingFlags flags = state->blittingflags; /* Return if unsupported blitting flags are set. */ if (flags & ~SH7723_SUPPORTED_BLITTINGFLAGS) return; /* Return if the source format is not supported. */ if (state->source->config.format != state->destination->config.format) return; /* Return if blending with unsupported blend functions is requested. */ if (flags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { if (state->src_blend != DSBF_SRCALPHA || state->dst_blend != DSBF_INVSRCALPHA) return; } /* XOR only without blending etc. */ if (flags & DSBLIT_XOR && flags & ~(DSBLIT_SRC_COLORKEY | DSBLIT_ROTATE180 | DSBLIT_XOR)) return; /* Return if colorizing for non-font surfaces is requested. */ if ((flags & DSBLIT_COLORIZE) && !(state->source->type & CSTF_FONT)) return; /* Return if blending with both alpha channel and value is requested. */ if (D_FLAGS_ARE_SET( flags, DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) return; /* Enable acceleration of blitting functions. */ state->accel |= accel; } } /* * Make sure that the hardware is programmed for execution of 'accel' according to the 'state'. */ void sh7723SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; StateModificationFlags modified = state->mod_hw; D_DEBUG_AT( SH7723_BLT, "%s( %p, 0x%08x ) <- modified 0x%08x\n", __FUNCTION__, state, accel, modified ); DUMP_INFO(); /* * 1) Invalidate hardware states * * Each modification to the hw independent state invalidates one or more hardware states. */ /* Simply invalidate all? */ if (modified == SMF_ALL) { SH7723_INVALIDATE( ALL ); } else if (modified) { /* Invalidate destination registers. */ if (modified & SMF_DESTINATION) SH7723_INVALIDATE( DEST | COLOR16 ); /* Invalidate clipping registers. */ if (modified & SMF_CLIP) SH7723_INVALIDATE( CLIP ); /* Invalidate color registers. */ if (modified & SMF_COLOR) SH7723_INVALIDATE( ALPHA | COLOR16 ); /* Invalidate source registers. */ if (modified & SMF_SOURCE) SH7723_INVALIDATE( SOURCE ); /* Invalidate source colorkey. */ if (modified & SMF_SRC_COLORKEY) SH7723_INVALIDATE( STRANS ); } /* * 2) Validate hardware states * * Each function has its own set of states that need to be validated. */ /* Always requiring valid destination and clip. */ SH7723_CHECK_VALIDATE( DEST_CLIP ); /* Depending on the function... */ switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWLINE: /* ...require valid color. */ SH7723_CHECK_VALIDATE( COLOR16 ); /* If blending is used, validate the alpha value. */ if (state->drawingflags & DSDRAW_BLEND) SH7723_CHECK_VALIDATE( ALPHA ); /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set = SH7723_SUPPORTED_DRAWINGFUNCTIONS; break; case DFXL_BLIT: /* ...require valid source. */ SH7723_CHECK_VALIDATE( SOURCE ); /* If blending is used, validate the alpha value. */ if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) SH7723_CHECK_VALIDATE( ALPHA ); /* If colorkeying is used, validate the colorkey. */ if (state->blittingflags & DSBLIT_SRC_COLORKEY) SH7723_CHECK_VALIDATE( STRANS ); /* * 3) Tell which functions can be called without further validation, i.e. SetState() * * When the hw independent state is changed, this collection is reset. */ state->set = SH7723_SUPPORTED_BLITTINGFUNCTIONS; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } sdev->dflags = state->drawingflags; sdev->bflags = state->blittingflags; sdev->render_options = state->render_options; sdev->color = state->color; /* * 4) Clear modification flags * * All flags have been evaluated in 1) and remembered for further validation. * If the hw independent state is not modified, this function won't get called * for subsequent rendering functions, unless they aren't defined by 3). */ state->mod_hw = 0; } /**********************************************************************************************************************/ /* * Render a filled rectangle using the current hardware state. */ bool sh7723FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 6 ); D_DEBUG_AT( SH7723_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); DUMP_INFO(); prep[0] = M2DG_OPCODE_BITBLTC | M2DG_DRAWMODE_CLIP; if (sdev->dflags & DSDRAW_BLEND) prep[0] |= M2DG_DRAWMODE_ALPHA; prep[1] = 0xcc; prep[2] = sdev->color16; prep[3] = rect->w - 1; prep[4] = rect->h - 1; prep[5] = SH7723_XY( rect->x, rect->y ); submit_buffer( sdrv, 6 ); return true; } /**********************************************************************************************************************/ /* * Render rectangle outlines using the current hardware state. */ bool sh7723DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer(sdrv, 8 ); int x1, x2, y1, y2; x1 = rect->x; y1 = rect->y; x2 = rect->x + rect->w - 1; y2 = rect->y + rect->h - 1; D_DEBUG_AT( SH7723_BLT, "%s( %d, %d - %dx%d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( rect ) ); DUMP_INFO(); prep[0] = M2DG_OPCODE_LINE_C | M2DG_DRAWMODE_CLIP; if (sdev->dflags & DSDRAW_BLEND) prep[0] |= M2DG_DRAWMODE_ALPHA; prep[1] = (sdev->color16 << 16 ) | 5; prep[2] = 0; prep[3] = SH7723_XY( x1, y1 ); prep[4] = SH7723_XY( x2, y1 ); prep[5] = SH7723_XY( x2, y2 ); prep[6] = SH7723_XY( x1, y2 ); prep[7] = SH7723_XY( x1, y1 ); submit_buffer( sdrv, 8 ); return true; } /**********************************************************************************************************************/ /* * Render a triangle using the current hardware state. */ bool sh7723FillTriangle( void *drv, void *dev, DFBTriangle *triangle ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 6 ); D_DEBUG_AT( SH7723_BLT, "%s( %d, %d - %dx, %d - %d, %d )\n", __FUNCTION__, DFB_TRIANGLE_VALS( triangle ) ); DUMP_INFO(); prep[0] = M2DG_OPCODE_POLYGON_4C | M2DG_DRAWMODE_CLIP; if (sdev->dflags & DSDRAW_BLEND) prep[0] |= M2DG_DRAWMODE_ALPHA; prep[1] = sdev->color16; prep[2] = SH7723_XY( triangle->x1, triangle->y1 ); prep[3] = SH7723_XY( triangle->x2, triangle->y2 ); prep[4] = SH7723_XY( triangle->x3, triangle->y3 ); prep[5] = SH7723_XY( triangle->x3, triangle->y3 ); submit_buffer( sdrv, 6 ); /* * TODO: use rlined to draw the aa'ed outline of a polygon * if also aval, set blke to 1 */ return true; } /**********************************************************************************************************************/ /* * Render a line with the specified width using the current hardware state. */ bool sh7723DrawLine( void *drv, void *dev, DFBRegion *line ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 5 ); D_DEBUG_AT( SH7723_BLT, "%s( %d, %d - %d, %d )\n", __FUNCTION__, line->x1, line->y1, line->x2, line->y2 ); DUMP_INFO(); prep[0] = M2DG_OPCODE_LINE_C | M2DG_DRAWMODE_CLIP; if (sdev->render_options & DSRO_ANTIALIAS) prep[0] |= M2DG_DRAWMODE_ANTIALIAS; prep[1] = (sdev->color16 << 16) | 2; prep[2] = 0; prep[3] = SH7723_XY( line->x1, line->y1 ); prep[4] = SH7723_XY( line->x2, line->y2 ); submit_buffer( sdrv, 5); return true; } /* * Blit a rectangle using the current hardware state. */ bool sh7723Blit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { SH7722DriverData *sdrv = drv; SH7722DeviceData *sdev = dev; __u32 *prep = start_buffer( sdrv, 6 ); D_DEBUG_AT( SH7723_BLT, "%s( %d, %d - %dx%d <- %d, %d )\n", __FUNCTION__, dx, dy, rect->w, rect->h, rect->x, rect->y ); DUMP_INFO(); prep[0] = M2DG_OPCODE_BITBLTA | M2DG_DRAWMODE_CLIP; if (sdev->bflags & DSBLIT_BLEND_COLORALPHA) prep[0] |= M2DG_DRAWMODE_ALPHA; if (sdev->bflags & DSBLIT_SRC_COLORKEY) prep[0] |= M2DG_DRAWMODE_STRANS; if (sdev->src_phys == sdev->dst_phys) { if (dy > rect->y) prep[0] |= M2DG_DRAWMODE_DSTDIR_Y | M2DG_DRAWMODE_SRCDIR_Y; else if (dy == rect->y) { if (dx > rect->x) prep[0] |= M2DG_DRAWMODE_DSTDIR_X | M2DG_DRAWMODE_SRCDIR_X; } } prep[1] = 0xcc; prep[2] = SH7723_XY( rect->x, rect->y ); prep[3] = rect->w - 1; prep[4] = rect->h - 1; prep[5] = SH7723_XY( dx, dy ); submit_buffer( sdrv, 6 ); return true; } DirectFB-1.2.10/gfxdrivers/sh772x/README.sh77220000644000175000017500000002624411164361026015206 00000000000000Renesas SH7722 graphics driver ============================== This driver supports the SH7722 SoC from Renesas Solutions Corp. controlling - LCDC (LCD Controller) for display - BEU (Blit Engine Unit) for blending of planes - TDG (2D Graphics) for accelerated operations It's using a kernel device called sh7722gfx which mainly does interrupt handling. The 2D Graphics unit supports display lists in RAM and reads them via DMA. These lists consist of double word entries, first word designates a register, second word contains the data to write. Once a list has been completely processed, the hardware generates an interrupt to start the next list. The kernel module allocates a ring buffer for usage as a display list. The user space prepares a block of commands and puts it into the ring buffer. If the hardware is idle, it's started directly from user space. When a DMA completion interrupt is received, the next block of commands is started from kernel space. If the hardware is still running the previous block, new commands are appended to the next one. The driver is designed to run without any locking or system calls. Only a few interrupts happen over time depending on the operations. The hardware is not getting idle, while commands are being sent to keep it busy. There's just a minimal gap which is the interrupt handler setting the new start address and kicking the hardware again. To build the kernel module use "make -f Makefile.kernel". You might want to set the variables KERNEL_SOURCE, KERNEL_BUILD (if != KERNEL_SOURCE), KERNEL_VERSION and DESTDIR. To run the driver you need the DevMem system module using the directfbrc.sh7722 file (renamed to directfbrc in $prefix/etc). Performance (as of 2007-09-21, multi app, 127.79 BogoMIPS) ---------------------------------------------------------- Only 14% CPU load with df_andi running 800x480 at 28.1 fps :) Benchmarking with 256x256 in 16bit mode... (16bit) CPU load Anti-aliased Text 3.020 secs ( 41.721 KChars/sec) [100%] Anti-aliased Text (blend) 3.328 secs ( 10.817 KChars/sec) [100%] Fill Rectangle 5.549 secs (* 69.681 MPixel/sec) [ 3%] Fill Rectangle (blend) 11.873 secs (* 22.079 MPixel/sec) [ 1%] Fill Rectangles [10] 9.384 secs (* 69.838 MPixel/sec) [ 0%] Fill Rectangles [10] (blend) 14.836 secs (* 22.086 MPixel/sec) [ 0%] Fill Triangles 3.024 secs (+ 50.929 MPixel/sec) [ 40%] Fill Triangles (blend) 3.064 secs (+ 20.319 MPixel/sec) [ 8%] Draw Rectangle 3.284 secs (* 6.942 KRects/sec) [ 26%] Draw Rectangle (blend) 3.302 secs (* 6.268 KRects/sec) [ 25%] Draw Lines [10] 3.238 secs (* 28.103 KLines/sec) [ 20%] Draw Lines [10] (blend) 3.198 secs (* 27.829 KLines/sec) [ 19%] Fill Spans 3.092 secs (* 61.466 MPixel/sec) [ 33%] Fill Spans (blend) 3.094 secs (* 21.181 MPixel/sec) [ 11%] Blit 10.436 secs (* 30.143 MPixel/sec) [ 2%] Blit colorkeyed 9.333 secs (* 32.301 MPixel/sec) [ 2%] Blit destination colorkeyed 3.763 secs ( 6.966 MPixel/sec) [ 99%] Blit with format conversion 13.369 secs (* 22.549 MPixel/sec) [ 1%] Blit with colorizing 4.419 secs ( 2.966 MPixel/sec) [100%] Blit from 32bit (blend) 21.973 secs (* 13.123 MPixel/sec) [ 1%] Blit from 32bit (blend) with colorizing 5.129 secs ( 1.277 MPixel/sec) [100%] Stretch Blit 10.271 secs (* 33.463 MPixel/sec) [ 3%] Stretch Blit colorkeyed 7.895 secs (* 35.159 MPixel/sec) [ 3%] (*) SH7722/BLT: 940 starts, 940 done, 940 interrupts, 43 wait_idle, 780 wait_next, 89 idle (*) SH7722/BLT: 24700744 words, 26277 words/start, 277536 words/idle, 10 starts/idle * = accelerated + = half way accelerated Performance (as of 2007-09-25, multi app, 127.79 BogoMIPS) ---------------------------------------------------------- Only 13% CPU load with df_andi running 800x480 at 28.8 fps :) Only 46% CPU load with ClanBomber2 running 800x600 at 48 fps :) Benchmarking with 256x256 in 16bit mode... (16bit) CPU load Anti-aliased Text 3.057 secs (* 98.920 KChars/sec) [ 47%] ! Anti-aliased Text (blend) 3.298 secs ( 10.915 KChars/sec) [100%] Fill Rectangle 5.732 secs (* 69.743 MPixel/sec) [ 3%] Fill Rectangle (blend) 11.571 secs (* 22.088 MPixel/sec) [ 1%] Fill Rectangles [10] 9.384 secs (* 69.838 MPixel/sec) [ 0%] Fill Rectangles [10] (blend) 14.836 secs (* 22.086 MPixel/sec) [ 0%] Fill Triangles 4.176 secs (* 61.989 MPixel/sec) [ 6%] ! Fill Triangles (blend) 8.132 secs (* 21.759 MPixel/sec) [ 2%] ! Draw Rectangle 3.216 secs (* 6.965 KRects/sec) [ 26%] Draw Rectangle (blend) 3.290 secs (* 6.322 KRects/sec) [ 22%] Draw Lines [10] 3.216 secs (* 28.296 KLines/sec) [ 14%] Draw Lines [10] (blend) 3.196 secs (* 28.160 KLines/sec) [ 14%] Fill Spans 3.086 secs (* 61.586 MPixel/sec) [ 25%] Fill Spans (blend) 3.092 secs (* 21.195 MPixel/sec) [ 7%] Blit 8.692 secs (* 30.159 MPixel/sec) [ 2%] Blit 180 4.783 secs (* 30.144 MPixel/sec) [ 2%] ! Blit colorkeyed 11.965 secs (* 32.316 MPixel/sec) [ 2%] Blit destination colorkeyed 3.795 secs ( 6.907 MPixel/sec) [ 99%] Blit with format conversion 9.039 secs (* 22.476 MPixel/sec) [ 1%] Blit with colorizing 4.414 secs ( 2.969 MPixel/sec) [100%] Blit from 32bit (blend) 23.375 secs (* 13.177 MPixel/sec) [ 1%] Blit from 32bit (blend) with colorizing 5.137 secs ( 1.275 MPixel/sec) [100%] Stretch Blit 8.976 secs (* 33.495 MPixel/sec) [ 2%] Stretch Blit colorkeyed 9.728 secs (* 35.226 MPixel/sec) [ 2%] (*) SH7722/BLT: 521 starts, 521 done, 521 interrupts, 45 wait_idle, 363 wait_next, 90 idle (*) SH7722/BLT: 11511104 words, 22094 words/start, 127901 words/idle, 5 starts/idle * = accelerated ! = updated Statistics ---------- The statistics at the end are more valuable when looking at one case at a time: Fill Rectangle 5.834 secs (* 69.647 MPixel/sec) [ 4%] (*) SH7722/BLT: 16 starts, 16 done, 16 interrupts, 4 wait_idle, 2 wait_next, 11 idle (*) SH7722/BLT: 74840 words, 4677 words/start, 6803 words/idle, 1 starts/idle This means that while the FillRectangle() benchmark was running, the hardware didn't get idle, which is obvious when running the benchmark for just 10 ms: Fill Rectangle 0.191 secs (* 68.624 MPixel/sec) [ 10%] (*) SH7722/BLT: 13 starts, 13 done, 13 interrupts, 4 wait_idle, 0 wait_next, 11 idle (*) SH7722/BLT: 2840 words, 218 words/start, 258 words/idle, 1 starts/idle See? The same number of times becoming idle, but a few less interrupts. Don't worry about the 191 ms the benchmark needed to complete, after 10 ms of stuffing the display list, we need to wait until the hardware is done before measuring the time it took and calculating the result. Here's FillSpans() which as opposed to FillRectangle() does a lot of small commands: Fill Spans 3.028 secs (* 61.467 MPixel/sec) [ 34%] (*) SH7722/BLT: 245 starts, 245 done, 245 interrupts, 3 wait_idle, 185 wait_next, 22 idle (*) SH7722/BLT: 5828128 words, 23788 words/start, 264914 words/idle, 11 starts/idle Example kernel log (debug mode) ------------------------------- 0.549.014 - sh7722_reset : Resetting hardware... 0.549.046 - sh7722_reset : Initializing shared area... 0.549.748 - sh7722_reset : Clearing interrupts... 0.549.770 - sh7722_reset : Ready ( idle, hw 0- 0, next 0- 0, invalid, HC 0000000, INT 000000) 0.568.700 - sh7722_wait : Waiting..... (running, hw 0- 54, next 56- 56, invalid, HC 1010111, INT 000000) 0.573.339 - sh7722_tdg_irq : -Interrupt (running, hw 0- 54, next 56- 56, invalid, HC 0000000, INT 100100) 0.573.397 - sh7722_tdg_irq : '-> Idle. (running, hw 0- 54, next 56- 56, invalid, HC 0000000, INT 000000) 0.573.480 - sh7722_wait : ........done ( idle, hw 0- 54, next 56- 56, invalid, HC 0000000, INT 000000) 0.583.575 - sh7722_wait : Waiting..... (running, hw 56- 78, next 80- 80, invalid, HC 1010111, INT 000000) 0.588.414 - sh7722_tdg_irq : -Interrupt (running, hw 56- 78, next 80- 80, invalid, HC 0000000, INT 100100) 0.588.470 - sh7722_tdg_irq : '-> Idle. (running, hw 56- 78, next 80- 80, invalid, HC 0000000, INT 000000) 0.588.544 - sh7722_wait : ........done ( idle, hw 56- 78, next 80- 80, invalid, HC 0000000, INT 000000) 0.601.336 - sh7722_tdg_irq : -Interrupt (running, hw 80- 102, next 104- 104, invalid, HC 0000000, INT 100100) 0.601.420 - sh7722_tdg_irq : '-> Idle. (running, hw 80- 102, next 104- 104, invalid, HC 0000000, INT 000000) 0.700.117 - sh7722_tdg_irq : -Interrupt (running, hw 104- 124, next 128- 128, invalid, HC 0000000, INT 100100) 0.700.205 - sh7722_tdg_irq : '-> Idle. (running, hw 104- 124, next 128- 128, invalid, HC 0000000, INT 000000) 3.115.419 - sh7722_tdg_irq : -Interrupt (running, hw 128- 220, next 224- 224, invalid, HC 0000000, INT 100100) 3.115.506 - sh7722_tdg_irq : '-> Idle. (running, hw 128- 220, next 224- 224, invalid, HC 0000000, INT 000000) 3.151.700 - sh7722_tdg_irq : -Interrupt (running, hw 224- 324, next 328- 328, invalid, HC 0000000, INT 100100) 3.151.788 - sh7722_tdg_irq : '-> Idle. (running, hw 224- 324, next 328- 328, invalid, HC 0000000, INT 000000) 3.159.160 - sh7722_wait : Waiting..... (running, hw 328- 444, next 448-12994, valid, HC 1010111, INT 000100) 3.161.783 - sh7722_tdg_irq : -Interrupt (running, hw 328- 444, next 448-12994, valid, HC 0000000, INT 100100) 3.161.839 - sh7722_tdg_irq : '-> Start! (running, hw 448-12994, next 12996-12996, invalid, HC 0000000, INT 000000) 4.316.367 - sh7722_tdg_irq : -Interrupt (running, hw 448-12994, next 12996-12996, invalid, HC 0000000, INT 100100) 4.316.434 - sh7722_tdg_irq : '-> Idle. (running, hw 448-12994, next 12996-12996, invalid, HC 0000000, INT 000000) 4.316.505 - sh7722_wait : ........done ( idle, hw 448-12994, next 12996-12996, invalid, HC 0000000, INT 000000) DirectFB-1.2.10/gfxdrivers/sh772x/directfbrc.sh77230000644000175000017500000000045211164361026016352 00000000000000 system = devmem video-phys = f800000 # Requires 'mem=120M' kernel option!!!!! video-length = 8388608 # 8MB of physically contiguous memory for acceleration mmio-phys = a4680000 # Start of 2DG register space mmio-length = 65536 # Size of register space accelerator = 11591 # 0x2D47 (2DG) DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_multi.h0000644000175000017500000000031211164361026015676 00000000000000#ifndef __SH7722__MULTI_H__ #define __SH7722__MULTI_H__ #include "sh7722_types.h" #define SH7722_MULTI_SUPPORTED_OPTIONS (DLOP_SRC_COLORKEY) extern DisplayLayerFuncs sh7722MultiLayerFuncs; #endif DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/0000777000175000017500000000000011307522571016215 500000000000000DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/sh772x_gfx.h0000644000175000017500000000642611164361026020215 00000000000000#ifndef __SH772X_GFX_H__ #define __SH772X_GFX_H__ #include #define SH772xGFX_BUFFER_WORDS 0x1f000 /* Number of 32bit words in display list (ring buffer). */ #define SH7722GFX_SHARED_MAGIC 0x77220001 /* Increase if binary compatibility is broken. */ #define SH7723GFX_SHARED_MAGIC 0x77230001 /* Increase if binary compatibility is broken. */ #define SH7722GFX_JPEG_RELOAD_SIZE (64 * 1024) #define SH7722GFX_JPEG_LINEBUFFER_PITCH (2560) #define SH7722GFX_JPEG_LINEBUFFER_HEIGHT (16) #define SH7722GFX_JPEG_LINEBUFFER_SIZE (SH7722GFX_JPEG_LINEBUFFER_PITCH * SH7722GFX_JPEG_LINEBUFFER_HEIGHT * 2) #define SH7722GFX_JPEG_LINEBUFFER_SIZE_Y (SH7722GFX_JPEG_LINEBUFFER_PITCH * SH7722GFX_JPEG_LINEBUFFER_HEIGHT) #define SH7722GFX_JPEG_SIZE (SH7722GFX_JPEG_LINEBUFFER_SIZE * 2 + SH7722GFX_JPEG_RELOAD_SIZE * 2) typedef volatile struct { u32 buffer[SH772xGFX_BUFFER_WORDS]; int hw_start; int hw_end; int hw_running; int next_start; int next_end; int next_valid; unsigned long buffer_phys; unsigned int num_words; unsigned int num_starts; unsigned int num_done; unsigned int num_interrupts; unsigned int num_wait_idle; unsigned int num_wait_next; unsigned int num_idle; u32 jpeg_ints; unsigned long jpeg_phys; u32 magic; } SH772xGfxSharedArea; typedef struct { u32 address; /* in */ u32 value; /* in/out */ } SH772xRegister; typedef enum { SH7722_JPEG_START, SH7722_JPEG_RUN, SH7722_JPEG_END } SH7722JPEGState; typedef enum { SH7722_JPEG_FLAG_RELOAD = 0x00000001, /* enable reload mode */ SH7722_JPEG_FLAG_CONVERT = 0x00000002, /* enable conversion through VEU */ SH7722_JPEG_FLAG_ENCODE = 0x00000004 /* set encoding mode */ } SH7722JPEGFlags; typedef struct { SH7722JPEGState state; /* starting, running or ended (done/error) */ SH7722JPEGFlags flags; /* control decoding options */ u32 buffers; /* input = loaded buffers, output = buffers to reload */ u32 error; /* valid in END state, non-zero means error */ unsigned long phys; /* needed in case of scaling, prevents rounding errors */ int height; int inputheight; } SH7722JPEG; /* Just initialization and synchronization. * Hardware is started from user space via MMIO to DMA registers. */ #define SH772xGFX_IOCTL_RESET _IO( 'G', 0 ) #define SH772xGFX_IOCTL_WAIT_IDLE _IO( 'G', 1 ) #define SH772xGFX_IOCTL_WAIT_NEXT _IO( 'G', 2 ) /* JPEG processing, requires programming from user space. */ #define SH7722GFX_IOCTL_WAIT_JPEG _IO ( 'J', 0 ) #define SH7722GFX_IOCTL_RUN_JPEG _IOWR( 'J', 1, SH7722JPEG ) #define SH7722GFX_IOCTL_LOCK_JPEG _IO ( 'J', 2 ) #define SH7722GFX_IOCTL_UNLOCK_JPEG _IO ( 'J', 3 ) /* Register access limited to BEU, LCDC, VOU and JPU. */ #define SH772xGFX_IOCTL_SETREG32 _IOW( 'g', 0, SH772xRegister ) #define SH772xGFX_IOCTL_GETREG32 _IOR( 'g', 1, SH772xRegister ) /* Generic IOCTL to power the display, do this after programming the LCD Controller */ #define SH772xGFX_IOCTL_POWER_DISPLAY _IO( 'k', 0 ) #endif DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/sh772x_driver.c0000644000175000017500000000376011164361026020715 00000000000000/* * SH7722/SH7723 Graphics Device * * Copyright (C) 2006-2008 IGEL Co.,Ltd * * Written by Denis Oliver Kropp * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 * as published by the Free Software Foundation. */ #include #include #include #include #include "sh7722.h" #include "sh7723.h" /**********************************************************************************************************************/ static int sh772x_init = 0; /**********************************************************************************************************************/ static int __init sh772x_driver_init( void ) { int ret = -ENODEV; if ((ctrl_inl(CCN_PVR) & 0xffff00) == 0x300800) { switch (ctrl_inl(CCN_PRR) & 0xf00) { case 0xa00: ret = sh7722_init(); if (ret) return ret; sh772x_init = 7722; break; case 0x500: ret = sh7723_init(); if (ret) return ret; sh772x_init = 7723; break; } } return ret; } module_init( sh772x_driver_init ); /**********************************************************************************************************************/ static void __exit sh772x_driver_exit( void ) { switch (sh772x_init) { case 7722: sh7722_exit(); break; case 7723: sh7723_exit(); break; } } module_exit( sh772x_driver_exit ); /**********************************************************************************************************************/ MODULE_AUTHOR( "Denis Oliver Kropp & Janine Kropp " ); MODULE_LICENSE( "GPL v2" ); DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/Makefile0000644000175000017500000000011111164361026017557 00000000000000obj-m += sh772x_gfx.o sh772x_gfx-y += sh772x_driver.o sh7722.o sh7723.o DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/sh7722.h0000644000175000017500000000065611164361026017242 00000000000000/* * SH7722/SH7723 Graphics Device * * Copyright (C) 2006-2008 IGEL Co.,Ltd * * Written by Denis Oliver Kropp * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 * as published by the Free Software Foundation. */ #ifndef __SH7722_H__ #define __SH7722_H__ int sh7722_init( void ); void sh7722_exit( void ); #endif DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/sh7723.c0000644000175000017500000004114111164361026017230 00000000000000/* * SH7723 Graphics Device * * Copyright (C) 2006-2008 IGEL Co.,Ltd * * Written by Janine Kropp , * Denis Oliver Kropp * * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 * as published by the Free Software Foundation. */ #include #include #include #include #include #include #include #include #include #include #include #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) #include #endif #include //#define SH7723GFX_DEBUG_2DG //#define SH7723GFX_IRQ_POLLER /**********************************************************************************************************************/ #ifndef SH7723_BEU_IRQ #define SH7723_BEU_IRQ 53 #endif #ifndef SH7723_TDG_IRQ #define SH7723_TDG_IRQ 44 #endif /**********************************************************************************************************************/ #define ENGINE_REG_TOP 0xA4680000 #define SH7723_BEU_BASE 0xFE930000 #define M2DG_REG(x) (*(volatile u32*)((x)+ENGINE_REG_TOP)) #define BEU_REG(x) (*(volatile u32*)((x)+SH7723_BEU_BASE)) #define M2DG_SCLR M2DG_REG(0x000) #define M2DG_DLSAR M2DG_REG(0x048) #define M2DG_STATUS M2DG_REG(0x004) #define M2DG_STATUS_CLEAR M2DG_REG(0x008) #define M2DG_INT_ENABLE M2DG_REG(0x00c) #define M2DG_SCLR_START 0x00000001 #define M2DG_SCLR_RESET 0x80000000 #define M2DG_INT_TRAP 0x0001 #define M2DG_INT_INTERRUPT 0x0002 #define M2DG_INT_ERROR 0x0004 #define M2DG_INT_ANY 0x0007 #define BEVTR BEU_REG(0x0018C) /**********************************************************************************************************************/ #ifdef SH7723GFX_DEBUG_2DG #define QPRINT(x...) do { \ char buf[128]; \ struct timeval tv; \ do_gettimeofday( &tv ); \ snprintf( buf, sizeof(buf), x ); \ printk( KERN_DEBUG "%ld.%03ld.%03ld - %-17s: %s\n", \ tv.tv_sec - base_time.tv_sec, \ tv.tv_usec / 1000, tv.tv_usec % 1000, __FUNCTION__, buf ); \ } while (0) #else #define QPRINT(x...) do {} while (0) #endif #define QDUMP(msg) QPRINT( "%-12s (%s, hw %5d-%5d, next %5d-%5d, %svalid, " \ "STATUS 0x%07x)", msg, \ shared->hw_running ? "running" : " idle", \ shared->hw_start, \ shared->hw_end, \ shared->next_start, \ shared->next_end, \ shared->next_valid ? " " : "in", \ M2DG_STATUS & M2DG_INT_ANY ); /**********************************************************************************************************************/ static DECLARE_WAIT_QUEUE_HEAD( wait_idle ); static DECLARE_WAIT_QUEUE_HEAD( wait_next ); static SH772xGfxSharedArea *shared; static struct timeval base_time; #ifndef SHARED_AREA_PHYS static struct page *shared_page; static unsigned int shared_order; #endif #ifdef SH7723GFX_IRQ_POLLER static int stop_poller; #endif /**********************************************************************************************************************/ static int sh7723_reset( SH772xGfxSharedArea *shared ) { do_gettimeofday( &base_time ); QPRINT( "Resetting hardware..." ); M2DG_SCLR = M2DG_SCLR_RESET; udelay( 5 ); M2DG_SCLR = 0; QPRINT( "Initializing shared area..." ); memset( (void*) shared, 0, sizeof(SH772xGfxSharedArea) ); shared->buffer_phys = virt_to_phys(&shared->buffer[0]); shared->magic = SH7723GFX_SHARED_MAGIC; QPRINT( "Clearing interrupts..." ); M2DG_STATUS_CLEAR = M2DG_INT_ANY; M2DG_INT_ENABLE = M2DG_INT_ANY; QDUMP( "Ready" ); return 0; } /* copied from board-ap325rxa.c */ #define PORT_PSCR 0xA405011E #define PORT_PSDR 0xA405013E #define FPGA_LCDREG 0xB4100180 #define FPGA_BKLREG 0xB4100212 static int sh7723_power_display( void ) { msleep(100); /* ASD AP-320/325 LCD ON */ ctrl_outw(0x0018, FPGA_LCDREG); /* backlight */ ctrl_outw((ctrl_inw(PORT_PSCR) & ~0x00C0) | 0x40, PORT_PSCR); ctrl_outb(ctrl_inb(PORT_PSDR) & ~0x08, PORT_PSDR); ctrl_outw(0x100, FPGA_BKLREG); return 0; } static int sh7723_wait_idle( SH772xGfxSharedArea *shared ) { int ret; QDUMP( "Waiting....." ); /* Does not need to be atomic. There's a lock in user space, * but anyhow, this is just for statistics. */ shared->num_wait_idle++; ret = wait_event_interruptible_timeout( wait_idle, !shared->hw_running, 42*HZ ); if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (%srunning, hw %d-%d, next %d-%d - %svalid, " "STATUS 0x%08x)\n", __FUNCTION__, shared->hw_running ? "" : "not ", shared->hw_start, shared->hw_end, shared->next_start, shared->next_end, shared->next_valid ? "" : "not ", M2DG_STATUS & M2DG_INT_ANY ); } QDUMP( "........done" ); return (ret > 0) ? 0 : (ret < 0) ? ret : -ETIMEDOUT; } static int sh7723_wait_next( SH772xGfxSharedArea *shared ) { int ret; QDUMP( "Waiting....." ); /* Does not need to be atomic. There's a lock in user space, * but anyhow, this is just for statistics. */ shared->num_wait_next++; ret = wait_event_interruptible_timeout( wait_next, !shared->hw_running || shared->next_start == shared->next_end, 42*HZ ); if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (%srunning, hw %d-%d, next %d-%d - %svalid, " "STATUS 0x%08x)\n", __FUNCTION__, shared->hw_running ? "" : "not ", shared->hw_start, shared->hw_end, shared->next_start, shared->next_end, shared->next_valid ? "" : "not ", M2DG_STATUS & M2DG_INT_ANY ); } QDUMP( "........done" ); return (ret > 0) ? 0 : (ret < 0) ? ret : -ETIMEDOUT; } /**********************************************************************************************************************/ static irqreturn_t sh7723_beu_irq( int irq, void *ctx ) { BEVTR = 0; /* Nothing here so far. But Vsync could be added. */ return IRQ_HANDLED; } static irqreturn_t sh7723_tdg_irq( int irq, void *ctx ) { SH772xGfxSharedArea *shared = ctx; u32 status = M2DG_STATUS & M2DG_INT_ANY; if (! (status & M2DG_INT_ANY)) { #ifndef SH7723GFX_IRQ_POLLER printk( KERN_WARNING "%s: bogus interrupt, STATUS 0x%08x!\n", __FUNCTION__, status ); #endif return IRQ_NONE; } // if (status & ~0x100) QDUMP( "-Interrupt" ); if (status & M2DG_INT_ERROR) printk( KERN_ERR "%s: error! STATUS 0x%08x!\n", __FUNCTION__, status ); shared->num_interrupts++; /* Clear the interrupt. */ M2DG_STATUS_CLEAR = status; if (status & (M2DG_INT_TRAP | M2DG_INT_ERROR)) { if (!shared->hw_running) printk( KERN_WARNING "%s: huh, hw running? STATUS 0x%08x!\n", __FUNCTION__, status ); if (status & M2DG_INT_ERROR) { printk( KERN_ERR "%s: ERROR! (%srunning, hw %d-%d, next %d-%d - %svalid, " "STATUS 0x%08x)\n", __FUNCTION__, shared->hw_running ? "" : "not ", shared->hw_start, shared->hw_end, shared->next_start, shared->next_end, shared->next_valid ? "" : "not ", status ); M2DG_SCLR = M2DG_SCLR_RESET; } /* Next valid means user space is not in the process of extending the buffer. */ if (shared->next_valid && shared->next_start != shared->next_end) { shared->hw_start = shared->next_start; shared->hw_end = shared->next_end; shared->next_start = shared->next_end = (shared->hw_end + 1 + 3) & ~3; shared->next_valid = 0; shared->num_words += shared->hw_end - shared->hw_start; shared->num_starts++; QDUMP( " '-> Start!" ); M2DG_DLSAR = shared->buffer_phys + shared->hw_start*4; M2DG_SCLR = M2DG_SCLR_START; wake_up_all( &wait_next ); } else { shared->num_idle++; QDUMP( " '-> Idle." ); //check if needed // BEM_PE_CACHE = 1; shared->hw_running = 0; wake_up_all( &wait_next ); wake_up_all( &wait_idle ); } shared->num_done++; } return IRQ_HANDLED; } #ifdef SH7723GFX_IRQ_POLLER static int sh7723_tdg_irq_poller( void *arg ) { daemonize( "%s", __FUNCTION__ ); sigfillset( ¤t->blocked ); while (!stop_poller) { set_current_state( TASK_UNINTERRUPTIBLE ); schedule_timeout( 1 ); sh7723_tdg_irq( SH7723_TDG_IRQ, (void*) arg ); } stop_poller = 0; return 0; } #endif /**********************************************************************************************************************/ static int sh7723gfx_ioctl( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ) { SH772xRegister reg; switch (cmd) { case SH772xGFX_IOCTL_RESET: return sh7723_reset( shared ); case SH772xGFX_IOCTL_WAIT_IDLE: return sh7723_wait_idle( shared ); case SH772xGFX_IOCTL_WAIT_NEXT: return sh7723_wait_next( shared ); case SH772xGFX_IOCTL_SETREG32: if (copy_from_user( ®, (void*)arg, sizeof(SH772xRegister) )) return -EFAULT; /* BEU, LCDC, VOU, 2DG */ if ((reg.address < 0xFE930000 || reg.address > 0xFEA102D0) && (reg.address < 0xA4680000 || reg.address > 0xA468FFFF)) return -EACCES; *(volatile __u32 *) reg.address = reg.value; return 0; case SH772xGFX_IOCTL_GETREG32: if (copy_from_user( ®, (void*)arg, sizeof(SH772xRegister) )) return -EFAULT; /* BEU, LCDC, VOU */ if ((reg.address < 0xFE930000 || reg.address > 0xFEA102D0) && (reg.address < 0xA4680000 || reg.address > 0xA468FFFF)) return -EACCES; reg.value = *(volatile __u32 *) reg.address; if (copy_to_user( (void*)arg, ®, sizeof(SH772xRegister) )) return -EFAULT; return 0; case SH772xGFX_IOCTL_POWER_DISPLAY: return sh7723_power_display( ); } return -ENOSYS; } static int sh7723gfx_mmap( struct file *file, struct vm_area_struct *vma ) { unsigned int size; /* Just allow mapping at offset 0. */ if (vma->vm_pgoff) return -EINVAL; /* Check size of requested mapping. */ size = vma->vm_end - vma->vm_start; if (size != PAGE_ALIGN(sizeof(SH772xGfxSharedArea))) return -EINVAL; /* Set reserved and I/O flag for the area. */ vma->vm_flags |= VM_RESERVED | VM_IO; /* Select uncached access. */ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) return remap_pfn_range( vma, vma->vm_start, virt_to_phys((void*)shared) >> PAGE_SHIFT, size, vma->vm_page_prot ); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) return remap_page_range( vma, vma->vm_start, virt_to_phys((void*)shared), size, vma->vm_page_prot ); #else return io_remap_page_range( vma->vm_start, virt_to_phys((void*)shared), size, vma->vm_page_prot ); #endif } /**********************************************************************************************************************/ static struct file_operations sh7723gfx_fops = { ioctl: sh7723gfx_ioctl, mmap: sh7723gfx_mmap }; static struct miscdevice sh7723gfx_miscdev = { minor: 196, // 7*7*2*2 name: "sh772x_gfx", fops: &sh7723gfx_fops }; /**********************************************************************************************************************/ int sh7723_init( void ) { #ifndef SHARED_AREA_PHYS int i; #endif int ret; /* Register the SH7723 graphics device. */ ret = misc_register( &sh7723gfx_miscdev ); if (ret < 0) { printk( KERN_ERR "%s: misc_register() for minor %d failed! (error %d)\n", __FUNCTION__, sh7723gfx_miscdev.minor, ret ); return ret; } /* Allocate and initialize the shared area. */ #ifdef SHARED_AREA_PHYS #if SHARED_AREA_SIZE < PAGE_ALIGN(sizeof(SH772xGfxSharedArea)) #error SHARED_AREA_SIZE < PAGE_ALIGN(sizeof(SH772xGfxSharedArea))! #endif shared = ioremap( SHARED_AREA_PHYS, PAGE_ALIGN(sizeof(SH772xGfxSharedArea)) ); #else shared_order = get_order(sizeof(SH772xGfxSharedArea)); shared_page = alloc_pages( GFP_DMA | GFP_KERNEL, shared_order ); shared = ioremap( virt_to_phys( page_address(shared_page) ), PAGE_ALIGN(sizeof(SH772xGfxSharedArea)) ); for (i=0; i<1< * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 * as published by the Free Software Foundation. */ #ifndef __SH7723_H__ #define __SH7723_H__ int sh7723_init( void ); void sh7723_exit( void ); #endif DirectFB-1.2.10/gfxdrivers/sh772x/kernel-module/sh7722.c0000644000175000017500000011335111164361026017232 00000000000000/* * SH7722 Graphics Device * * Copyright (C) 2006-2008 IGEL Co.,Ltd * * Written by Denis Oliver Kropp * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 * as published by the Free Software Foundation. */ #include #include #include #include #include #include #include #include #include #include #include #include #include //#define SH7722GFX_DEBUG_2DG //#define SH7722GFX_DEBUG_JPU //#define SH7722GFX_IRQ_POLLER /**********************************************************************************************************************/ #ifndef SH7722_BEU_IRQ #define SH7722_BEU_IRQ 53 #endif #ifndef SH7722_VEU_IRQ #define SH7722_VEU_IRQ 54 #endif #ifndef SH7722_JPU_IRQ #define SH7722_JPU_IRQ 27 #endif #ifndef SH7722_TDG_IRQ #define SH7722_TDG_IRQ 109 #endif /**********************************************************************************************************************/ #define ENGINE_REG_TOP 0xFD000000 #define SH7722_VEU_BASE 0xFE920000 #define SH7722_BEU_BASE 0xFE930000 #define SH7722_JPU_BASE 0xFEA00000 #define BEM_REG(x) (*(volatile u32*)((x)+ENGINE_REG_TOP)) #define VEU_REG(x) (*(volatile u32*)((x)+SH7722_VEU_BASE)) #define BEU_REG(x) (*(volatile u32*)((x)+SH7722_BEU_BASE)) #define JPU_REG(x) (*(volatile u32*)((x)+SH7722_JPU_BASE)) #define BEM_HC_STATUS BEM_REG(0x00000) #define BEM_HC_RESET BEM_REG(0x00004) #define BEM_HC_CLOCK BEM_REG(0x00008) #define BEM_HC_INT_STATUS BEM_REG(0x00020) #define BEM_HC_INT_MASK BEM_REG(0x00024) #define BEM_HC_INT_CLEAR BEM_REG(0x00028) #define BEM_HC_CACHE_FLUSH BEM_REG(0x0002C) #define BEM_HC_DMA_ADR BEM_REG(0x00040) #define BEM_HC_DMA_START BEM_REG(0x00044) #define BEM_HC_DMA_STOP BEM_REG(0x00048) #define BEM_PE_CACHE BEM_REG(0x010B0) #define BEVTR BEU_REG(0x0018C) #define JPU_JCCMD JPU_REG(0x00004) #define JPU_JCSTS JPU_REG(0x00008) #define JPU_JINTE JPU_REG(0x00038) #define JPU_JINTS JPU_REG(0x0003C) #define JPU_JCDERR JPU_REG(0x00040) #define JPU_JCRST JPU_REG(0x00044) #define JPU_JIFDDVSZ JPU_REG(0x000B4) #define JPU_JIFDDHSZ JPU_REG(0x000B8) #define JPU_JIFDDYA1 JPU_REG(0x000BC) #define JPU_JIFDDCA1 JPU_REG(0x000C0) #define JPU_JIFDDYA2 JPU_REG(0x000C4) #define JPU_JIFDDCA2 JPU_REG(0x000C8) #define JPU_JIFESYA1 JPU_REG(0x00074) #define JPU_JIFESCA1 JPU_REG(0x00078) #define JPU_JIFESYA2 JPU_REG(0x0007C) #define JPU_JIFESCA2 JPU_REG(0x00080) #define JPU_JIFEDA1 JPU_REG(0x00090) #define JPU_JIFEDA2 JPU_REG(0x00094) #define VEU_VESTR VEU_REG(0x00000) #define VEU_VESWR VEU_REG(0x00010) #define VEU_VESSR VEU_REG(0x00014) #define VEU_VSAYR VEU_REG(0x00018) #define VEU_VSACR VEU_REG(0x0001c) #define VEU_VDAYR VEU_REG(0x00034) #define VEU_VDACR VEU_REG(0x00038) #define VEU_VTRCR VEU_REG(0x00050) #define VEU_VRFSR VEU_REG(0x00058) #define VEU_VEVTR VEU_REG(0x000A4) #define VEU_VSTAR VEU_REG(0x000b0) #define JINTS_MASK 0x00007C68 #define JINTS_INS3_HEADER 0x00000008 #define JINTS_INS5_ERROR 0x00000020 #define JINTS_INS6_DONE 0x00000040 #define JINTS_INS10_XFER_DONE 0x00000400 #define JINTS_INS11_LINEBUF0 0x00000800 #define JINTS_INS12_LINEBUF1 0x00001000 #define JINTS_INS13_LOADED 0x00002000 #define JINTS_INS14_RELOAD 0x00004000 #define JCCMD_START 0x00000001 #define JCCMD_RESTART 0x00000002 #define JCCMD_END 0x00000004 #define JCCMD_RESET 0x00000080 #define JCCMD_LCMD2 0x00000100 #define JCCMD_LCMD1 0x00000200 #define JCCMD_READ_RESTART 0x00000400 #define JCCMD_WRITE_RESTART 0x00000800 #define VTRCR_CHRR 0x0000C000 /**********************************************************************************************************************/ #ifdef SH7722GFX_DEBUG_2DG #define QPRINT(x...) do { \ char buf[128]; \ struct timeval tv; \ do_gettimeofday( &tv ); \ snprintf( buf, sizeof(buf), x ); \ printk( KERN_DEBUG "%ld.%03ld.%03ld - %-17s: %s\n", \ tv.tv_sec - base_time.tv_sec, \ tv.tv_usec / 1000, tv.tv_usec % 1000, __FUNCTION__, buf ); \ } while (0) #else #define QPRINT(x...) do {} while (0) #endif #define QDUMP(msg) QPRINT( "%-12s (%s, hw %5d-%5d, next %5d-%5d, %svalid, " \ "HC %07x, INT %06x)", msg, \ shared->hw_running ? "running" : " idle", \ shared->hw_start, \ shared->hw_end, \ shared->next_start, \ shared->next_end, \ shared->next_valid ? " " : "in", \ BEM_HC_STATUS, BEM_HC_INT_STATUS ); /**********************************************************************************************************************/ #ifdef SH7722GFX_DEBUG_JPU #define JPRINT(x...) do { \ char buf[128]; \ struct timeval tv; \ do_gettimeofday( &tv ); \ snprintf( buf, sizeof(buf), x ); \ printk( KERN_DEBUG "%ld.%03ld.%03ld - %-17s: %s\n", \ tv.tv_sec - base_time.tv_sec, \ tv.tv_usec / 1000, tv.tv_usec % 1000, __FUNCTION__, buf ); \ } while (0) #else #define JPRINT(x...) do {} while (0) #endif /**********************************************************************************************************************/ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) # define USE_DMA_ALLOC_COHERENT #endif static DECLARE_WAIT_QUEUE_HEAD( wait_idle ); static DECLARE_WAIT_QUEUE_HEAD( wait_next ); static SH772xGfxSharedArea *shared; static struct timeval base_time; static struct page *shared_page; static unsigned int shared_order; #ifdef USE_DMA_ALLOC_COHERENT static unsigned long shared_phys; #endif #ifdef SH7722GFX_IRQ_POLLER static int stop_poller; #endif /**********************************************************************************************************************/ static DECLARE_WAIT_QUEUE_HEAD( wait_jpeg_irq ); static DECLARE_WAIT_QUEUE_HEAD( wait_jpeg_run ); static DECLARE_WAIT_QUEUE_HEAD( wait_jpeg_lock ); static struct page *jpeg_page; static unsigned int jpeg_order; static volatile void *jpeg_area; static u32 jpeg_buffers; static int jpeg_buffer; static u32 jpeg_error; static int jpeg_encode; static int jpeg_reading; static int jpeg_writing; static int jpeg_reading_line; static int jpeg_writing_line; static int jpeg_height; static int jpeg_inputheight; static unsigned long jpeg_phys; static int jpeg_end; static u32 jpeg_linebufs; static int jpeg_linebuf; static int jpeg_line; static int jpeg_line_veu; /* is the VEU done yet? */ static int veu_linebuf; static int veu_running; static pid_t jpeg_locked; /**********************************************************************************************************************/ static int sh7722_reset( SH772xGfxSharedArea *shared ) { int i; do_gettimeofday( &base_time ); QPRINT( "Resetting hardware..." ); BEM_HC_CLOCK = 0; for (i=0; i<30000; i++); BEM_HC_CLOCK = 0x1111; BEM_HC_RESET = 0x1111; for (i=0; i<30000; i++); BEM_HC_RESET = 0; QPRINT( "Initializing shared area..." ); memset( (void*) shared, 0, sizeof(SH772xGfxSharedArea) ); #ifdef USE_DMA_ALLOC_COHERENT shared->buffer_phys = shared_phys; #else shared->buffer_phys = virt_to_phys(&shared->buffer[0]); #endif shared->jpeg_phys = virt_to_phys(jpeg_area); shared->magic = SH7722GFX_SHARED_MAGIC; QPRINT( "Clearing interrupts..." ); BEM_HC_INT_CLEAR = 0x111111; BEM_HC_INT_MASK = 0x110011; BEM_HC_CACHE_FLUSH = 0; QDUMP( "Ready" ); return 0; } static int sh7722_wait_idle( SH772xGfxSharedArea *shared ) { int ret; QDUMP( "Waiting....." ); /* Does not need to be atomic. There's a lock in user space, * but anyhow, this is just for statistics. */ shared->num_wait_idle++; ret = wait_event_interruptible_timeout( wait_idle, !shared->hw_running, 42*HZ ); if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (%srunning, hw %d-%d, next %d-%d - %svalid, " "STATUS 0x%08x, INT_STATUS 0x%08x)\n", __FUNCTION__, shared->hw_running ? "" : "not ", shared->hw_start, shared->hw_end, shared->next_start, shared->next_end, shared->next_valid ? "" : "not ", BEM_HC_STATUS, BEM_HC_INT_STATUS ); } QDUMP( "........done" ); return (ret > 0) ? 0 : (ret < 0) ? ret : -ETIMEDOUT; } static int sh7722_wait_next( SH772xGfxSharedArea *shared ) { int ret; QDUMP( "Waiting....." ); /* Does not need to be atomic. There's a lock in user space, * but anyhow, this is just for statistics. */ shared->num_wait_next++; ret = wait_event_interruptible_timeout( wait_next, !shared->hw_running || shared->next_start == shared->next_end, 42*HZ ); if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (%srunning, hw %d-%d, next %d-%d - %svalid, " "STATUS 0x%08x, INT_STATUS 0x%08x)\n", __FUNCTION__, shared->hw_running ? "" : "not ", shared->hw_start, shared->hw_end, shared->next_start, shared->next_end, shared->next_valid ? "" : "not ", BEM_HC_STATUS, BEM_HC_INT_STATUS ); } QDUMP( "........done" ); return (ret > 0) ? 0 : (ret < 0) ? ret : -ETIMEDOUT; } /**********************************************************************************************************************/ static int sh7722_wait_jpeg( SH772xGfxSharedArea *shared ) { int ret; ret = wait_event_interruptible_timeout( wait_jpeg_irq, shared->jpeg_ints, HZ ); if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (status 0x%08x, ints 0x%08x)\n", __FUNCTION__, JPU_JCSTS, JPU_JINTS ); } return (ret > 0) ? 0 : (ret < 0) ? ret : -ETIMEDOUT; } static int sh7722_run_jpeg( SH772xGfxSharedArea *shared, SH7722JPEG *jpeg ) { int ret; int encode = (jpeg->flags & SH7722_JPEG_FLAG_ENCODE) ? 1 : 0; int convert = (jpeg->flags & SH7722_JPEG_FLAG_CONVERT) ? 1 : 0; JPRINT( "run JPEG called %d", jpeg->state ); switch (jpeg->state) { case SH7722_JPEG_START: JPRINT( "START (buffers: %d, flags: 0x%x)", jpeg->buffers, jpeg->flags ); jpeg_line = 0; jpeg_line_veu = 0; jpeg_end = 0; jpeg_error = 0; jpeg_encode = encode; jpeg_reading = 0; jpeg_writing = 2; jpeg_reading_line = encode && !convert; jpeg_writing_line = !encode; jpeg_height = jpeg->height; jpeg_inputheight = jpeg->inputheight; jpeg_phys = jpeg->phys; jpeg_linebuf = 0; jpeg_linebufs = 0; jpeg_buffer = 0; jpeg_buffers = jpeg->buffers; veu_linebuf = 0; veu_running = 0; jpeg->state = SH7722_JPEG_RUN; jpeg->error = 0; // if (!encode || !convert) JPU_JCCMD = JCCMD_START; break; case SH7722_JPEG_RUN: JPRINT( "RUN (buffers: %d)", jpeg->buffers ); /* Validate loaded buffers. */ jpeg_buffers |= jpeg->buffers; break; default: printk( KERN_ERR "%s: INVALID STATE %d! (status 0x%08x, ints 0x%08x)\n", __FUNCTION__, jpeg->state, JPU_JCSTS, JPU_JINTS ); return -EINVAL; } if (encode) { if (convert) { if (jpeg_linebufs != 3 && !veu_running) { JPRINT( " '-> convert start (buffers: %d, veu linebuf: %d)", jpeg_buffers, veu_linebuf ); veu_running = 1; VEU_VDAYR = veu_linebuf ? JPU_JIFESYA2 : JPU_JIFESYA1; VEU_VDACR = veu_linebuf ? JPU_JIFESCA2 : JPU_JIFESCA1; VEU_VESTR = 0x1; } } if (jpeg_buffers && !jpeg_writing) { JPRINT( " '-> write start (buffers: %d)", jpeg_buffers ); jpeg_writing = 1; JPU_JCCMD = JCCMD_WRITE_RESTART; } } else if (jpeg_buffers && !jpeg_reading) { JPRINT( " '-> read start (buffers: %d)", jpeg_buffers ); jpeg_reading = 1; JPU_JCCMD = JCCMD_READ_RESTART; } ret = wait_event_interruptible_timeout( wait_jpeg_run, jpeg_end || jpeg_error || (jpeg_buffers != 3 && (jpeg->flags & SH7722_JPEG_FLAG_RELOAD)), 5 * HZ ); if (ret < 0) return ret; if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (JCSTS 0x%08x, JINTS 0x%08x, JCRST 0x%08x)\n", __FUNCTION__, JPU_JCSTS, JPU_JINTS, JPU_JCRST ); return -ETIMEDOUT; } if (jpeg_error) { /* Return error. */ jpeg->state = SH7722_JPEG_END; jpeg->error = jpeg_error; JPRINT( " '-> ERROR (0x%x)", jpeg->error ); } else { /* Return buffers to reload or to empty. */ jpeg->buffers = jpeg_buffers ^ 3; if (jpeg_end) { JPRINT( " '-> END" ); /* Return end. */ jpeg->state = SH7722_JPEG_END; jpeg->buffers |= 1 << jpeg_buffer; } else if (encode) JPRINT( " '-> LOADED (%d)", jpeg->buffers ); else JPRINT( " '-> RELOAD (%d)", jpeg->buffers ); } return 0; } static int sh7722_lock_jpeg( SH772xGfxSharedArea *shared ) { int ret; if (jpeg_locked) { ret = wait_event_interruptible_timeout( wait_jpeg_lock, !jpeg_locked, 5 * HZ ); if (ret < 0) return ret; if (!ret) { printk( KERN_ERR "%s: TIMEOUT! (status 0x%08x, ints 0x%08x)\n", __FUNCTION__, JPU_JCSTS, JPU_JINTS ); return -ETIMEDOUT; } } jpeg_locked = current->pid; return 0; } static int sh7722_unlock_jpeg( SH772xGfxSharedArea *shared ) { if (jpeg_locked != current->pid) return -EIO; jpeg_locked = 0; wake_up_all( &wait_jpeg_lock ); return 0; } /**********************************************************************************************************************/ static irqreturn_t sh7722_jpu_irq( int irq, void *ctx ) { u32 ints; SH772xGfxSharedArea *shared = ctx; ints = JPU_JINTS; JPU_JINTS = ~ints & JINTS_MASK; if (ints & (JINTS_INS3_HEADER | JINTS_INS5_ERROR | JINTS_INS6_DONE)) JPU_JCCMD = JCCMD_END; JPRINT( " ... JPU int 0x%08x (veu_linebuf:%d,jpeg_linebuf:%d,jpeg_linebufs:%d,jpeg_line:%d,jpeg_buffers:%d)", ints, veu_linebuf, jpeg_linebuf, jpeg_linebufs, jpeg_line, jpeg_buffers ); if (ints) { shared->jpeg_ints |= ints; wake_up_all( &wait_jpeg_irq ); /* Header */ if (ints & JINTS_INS3_HEADER) { JPRINT( " -> HEADER (%dx%d)", JPU_JIFDDHSZ, JPU_JIFDDVSZ ); } /* Error */ if (ints & JINTS_INS5_ERROR) { jpeg_error = JPU_JCDERR; JPRINT( " -> ERROR 0x%08x!", jpeg_error ); wake_up_all( &wait_jpeg_run ); } /* Done */ if (ints & JINTS_INS6_DONE) { jpeg_end = 1; JPRINT( " -> DONE" ); JPU_JCCMD = JCCMD_END; wake_up_all( &wait_jpeg_run ); } /* Done */ if (ints & JINTS_INS10_XFER_DONE) { jpeg_end = 1; JPRINT( " -> XFER DONE" ); JPU_JCCMD = JCCMD_END; wake_up_all( &wait_jpeg_run ); } /* Line buffer ready? FIXME: encoding */ if (ints & (JINTS_INS11_LINEBUF0 | JINTS_INS12_LINEBUF1)) { JPRINT( " -> LINEBUF %d", jpeg_linebuf ); if (jpeg_encode) { jpeg_linebufs &= ~(1 << jpeg_linebuf); jpeg_linebuf = jpeg_linebuf ? 0 : 1; if (jpeg_linebufs) { jpeg_reading_line = 1; /* should still be one */ if (!jpeg_end) JPU_JCCMD = JCCMD_LCMD2 | JCCMD_LCMD1; } else { jpeg_reading_line = 0; } jpeg_line += 16; if (jpeg_line_veu CONVERT %d", veu_linebuf ); veu_running = 1; /* we will not update VESSR or VRFSR to prevent recalculating * the input lines in case of partial content. * This prevents hangups in case of program errors */ n = jpeg_line_veu * jpeg_inputheight; while (n >= jpeg_height*8) { offset+=8; n -= jpeg_height*8; } while (n >= jpeg_height) { offset++; n -= jpeg_height; } /* VEU_VSACR is only used for CbCr, so we can simplify a bit */ n = (VEU_VTRCR & VTRCR_CHRR) ? 0 : 1; VEU_VSAYR = jpeg_phys + offset * VEU_VESWR; VEU_VSACR = jpeg_phys + ((offset >> n) + jpeg_height) * VEU_VESWR; VEU_VDAYR = veu_linebuf ? JPU_JIFESYA2 : JPU_JIFESYA1; VEU_VDACR = veu_linebuf ? JPU_JIFESCA2 : JPU_JIFESCA1; VEU_VESTR = 0x1; } } else { jpeg_linebufs |= (1 << jpeg_linebuf); jpeg_linebuf = jpeg_linebuf ? 0 : 1; if (jpeg_linebufs != 3) { jpeg_writing_line = 1; /* should still be one */ if (jpeg_line > 0 && !jpeg_end) JPU_JCCMD = JCCMD_LCMD1 | JCCMD_LCMD2; } else { jpeg_writing_line = 0; } jpeg_line += 16; if (!veu_running && !jpeg_end && !jpeg_error) { JPRINT( " -> CONVERT %d", veu_linebuf ); veu_running = 1; VEU_VSAYR = veu_linebuf ? JPU_JIFDDYA2 : JPU_JIFDDYA1; VEU_VSACR = veu_linebuf ? JPU_JIFDDCA2 : JPU_JIFDDCA1; VEU_VESTR = 0x101; } } } /* Loaded */ if (ints & JINTS_INS13_LOADED) { JPRINT( " -> LOADED %d (writing: %d)", jpeg_buffer, jpeg_writing ); jpeg_buffers &= ~(1 << jpeg_buffer); jpeg_buffer = jpeg_buffer ? 0 : 1; jpeg_writing--; wake_up_all( &wait_jpeg_run ); } /* Reload */ if (ints & JINTS_INS14_RELOAD) { JPRINT( " -> RELOAD %d", jpeg_buffer ); jpeg_buffers &= ~(1 << jpeg_buffer); jpeg_buffer = jpeg_buffer ? 0 : 1; if (jpeg_buffers) { jpeg_reading = 1; /* should still be one */ JPU_JCCMD = JCCMD_READ_RESTART; } else jpeg_reading = 0; wake_up_all( &wait_jpeg_run ); } } return IRQ_HANDLED; } /**********************************************************************************************************************/ static irqreturn_t sh7722_veu_irq( int irq, void *ctx ) { u32 events = VEU_VEVTR; VEU_VEVTR = ~events & 0x101; JPRINT( " ... VEU int 0x%08x (veu_linebuf:%d,jpeg_linebuf:%d,jpeg_linebufs:%d,jpeg_line:%d)", events, veu_linebuf, jpeg_linebuf, jpeg_linebufs, jpeg_line ); /* update the lines processed. * If we have tmpphys memory, we are ready now (veu lines == height) */ jpeg_line_veu += (VEU_VRFSR >> 16); if (jpeg_encode) { /* Fill line buffers. */ jpeg_linebufs |= 1 << veu_linebuf; /* Resume encoding if it was blocked. */ if (!jpeg_reading_line && !jpeg_end && !jpeg_error && jpeg_linebufs) { JPRINT( " -> ENCODE %d", veu_linebuf ); jpeg_reading_line = 1; JPU_JCCMD = JCCMD_LCMD2 | JCCMD_LCMD1; } veu_linebuf = veu_linebuf ? 0 : 1; if( jpeg_line_veu < jpeg_height /* still some more lines to do */ && jpeg_linebufs != 3 /* and still some place to put them */ && !jpeg_end /* safety, should not happen */ && !jpeg_error ) { int offset = 0; int n = 0; JPRINT( " -> CONVERT %d", veu_linebuf ); n = jpeg_line_veu * jpeg_inputheight; while (n >= jpeg_height*8) { offset+=8; n -= jpeg_height*8; } while (n >= jpeg_height) { offset++; n -= jpeg_height; } /* VEU_VSACR is only used for CbCr, so we can simplify a bit */ n = (VEU_VTRCR & VTRCR_CHRR) ? 0 : 1; VEU_VSAYR = jpeg_phys + offset * VEU_VESWR; VEU_VSACR = jpeg_phys + ((offset >> n) + jpeg_height) * VEU_VESWR; VEU_VDAYR = veu_linebuf ? JPU_JIFESYA2 : JPU_JIFESYA1; VEU_VDACR = veu_linebuf ? JPU_JIFESCA2 : JPU_JIFESCA1; veu_running = 1; /* kick VEU to continue */ VEU_VESTR = 0x1; } else { veu_running = 0; } } else { /* Release line buffer. */ jpeg_linebufs &= ~(1 << veu_linebuf); /* Resume decoding if it was blocked. */ if (!jpeg_writing_line && !jpeg_end && !jpeg_error && jpeg_linebufs != 3) { JPRINT( " -> RESUME %d", jpeg_linebuf ); jpeg_writing_line = 1; JPU_JCCMD = JCCMD_LCMD1 | JCCMD_LCMD2; } veu_linebuf = veu_linebuf ? 0 : 1; if (jpeg_linebufs) { JPRINT( " -> CONVERT %d", veu_linebuf ); veu_running = 1; /* should still be one */ VEU_VSAYR = veu_linebuf ? JPU_JIFDDYA2 : JPU_JIFDDYA1; VEU_VSACR = veu_linebuf ? JPU_JIFDDCA2 : JPU_JIFDDCA1; VEU_VESTR = 0x101; } else { if (jpeg_end) wake_up_all( &wait_jpeg_run ); veu_running = 0; } } return IRQ_HANDLED; } /**********************************************************************************************************************/ static irqreturn_t sh7722_beu_irq( int irq, void *ctx ) { BEVTR = 0; /* Nothing here so far. But Vsync could be added. */ return IRQ_HANDLED; } /**********************************************************************************************************************/ static irqreturn_t sh7722_tdg_irq( int irq, void *ctx ) { SH772xGfxSharedArea *shared = ctx; u32 status = BEM_HC_INT_STATUS; if (! (status & 0x111111)) { #ifndef SH7722GFX_IRQ_POLLER printk( KERN_WARNING "%s: bogus interrupt, INT_STATUS 0x%08x!\n", __FUNCTION__, status ); #endif return IRQ_NONE; } if (status & ~0x100) QDUMP( "-Interrupt" ); if (status & ~0x101100) printk( KERN_ERR "%s: error! INT_STATUS 0x%08x!\n", __FUNCTION__, status ); shared->num_interrupts++; /* Clear the interrupt. */ BEM_HC_INT_CLEAR = status; if (status & 0x100010) { if (!shared->hw_running) printk( KERN_WARNING "%s: hw not running? INT_STATUS 0x%08x!\n", __FUNCTION__, status ); if (status & 0x10) { printk( KERN_ERR "%s: RUNAWAY! (%srunning, hw %d-%d, next %d-%d - %svalid, " "STATUS 0x%08x, INT_STATUS 0x%08x)\n", __FUNCTION__, shared->hw_running ? "" : "not ", shared->hw_start, shared->hw_end, shared->next_start, shared->next_end, shared->next_valid ? "" : "not ", BEM_HC_STATUS, status ); BEM_HC_RESET = 0x1111; } /* Next valid means user space is not in the process of extending the buffer. */ if (shared->next_valid && shared->next_start != shared->next_end) { shared->hw_start = shared->next_start; shared->hw_end = shared->next_end; shared->next_start = shared->next_end = (shared->hw_end + 1 + 3) & ~3; shared->next_valid = 0; shared->num_words += shared->hw_end - shared->hw_start; shared->num_starts++; QDUMP( " '-> Start!" ); BEM_HC_DMA_ADR = shared->buffer_phys + shared->hw_start*4; BEM_HC_DMA_START = 1; wake_up_all( &wait_next ); } else { shared->num_idle++; QDUMP( " '-> Idle." ); BEM_PE_CACHE = 1; shared->hw_running = 0; wake_up_all( &wait_next ); wake_up_all( &wait_idle ); } shared->num_done++; } return IRQ_HANDLED; } #ifdef SH7722GFX_IRQ_POLLER static int sh7722_tdg_irq_poller( void *arg ) { daemonize( "%s", __FUNCTION__ ); sigfillset( ¤t->blocked ); while (!stop_poller) { set_current_state( TASK_UNINTERRUPTIBLE ); schedule_timeout( 1 ); sh7722_tdg_irq( SH7722_TDG_IRQ, (void*) arg ); } stop_poller = 0; return 0; } #endif /**********************************************************************************************************************/ /**********************************************************************************************************************/ static int sh7722gfx_flush( struct file *filp, fl_owner_t id ) { if (jpeg_locked == current->pid) { jpeg_locked = 0; wake_up_all( &wait_jpeg_lock ); } return 0; } static int sh7722gfx_ioctl( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ) { int ret; SH772xRegister reg; SH7722JPEG jpeg; switch (cmd) { case SH772xGFX_IOCTL_RESET: return sh7722_reset( shared ); case SH772xGFX_IOCTL_WAIT_IDLE: return sh7722_wait_idle( shared ); case SH772xGFX_IOCTL_WAIT_NEXT: return sh7722_wait_next( shared ); case SH772xGFX_IOCTL_SETREG32: if (copy_from_user( ®, (void*)arg, sizeof(SH772xRegister) )) return -EFAULT; /* VEU, BEU, LCDC, VOU, JPEG */ if (reg.address < 0xFE920000 || reg.address > 0xFEA102D0) return -EACCES; *(volatile __u32 *) reg.address = reg.value; return 0; case SH772xGFX_IOCTL_GETREG32: if (copy_from_user( ®, (void*)arg, sizeof(SH772xRegister) )) return -EFAULT; /* VEU, BEU, LCDC, VOU, JPEG */ if (reg.address < 0xFE920000 || reg.address > 0xFEA102D0) return -EACCES; reg.value = *(volatile __u32 *) reg.address; if (copy_to_user( (void*)arg, ®, sizeof(SH772xRegister) )) return -EFAULT; return 0; case SH7722GFX_IOCTL_WAIT_JPEG: return sh7722_wait_jpeg( shared ); case SH7722GFX_IOCTL_RUN_JPEG: if (copy_from_user( &jpeg, (void*)arg, sizeof(SH7722JPEG) )) return -EFAULT; ret = sh7722_run_jpeg( shared, &jpeg ); if (ret) return ret; if (copy_to_user( (void*)arg, &jpeg, sizeof(SH7722JPEG) )) return -EFAULT; return 0; case SH7722GFX_IOCTL_LOCK_JPEG: return sh7722_lock_jpeg( shared ); case SH7722GFX_IOCTL_UNLOCK_JPEG: return sh7722_unlock_jpeg( shared ); } return -ENOSYS; } static int sh7722gfx_mmap( struct file *file, struct vm_area_struct *vma ) { unsigned int size; /* Just allow mapping at offset 0. */ if (vma->vm_pgoff) return -EINVAL; /* Check size of requested mapping. */ size = vma->vm_end - vma->vm_start; if (size != PAGE_ALIGN(sizeof(SH772xGfxSharedArea))) return -EINVAL; /* Set reserved and I/O flag for the area. */ vma->vm_flags |= VM_RESERVED | VM_IO; /* Select uncached access. */ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); #ifdef USE_DMA_ALLOC_COHERENT return remap_pfn_range( vma, vma->vm_start, (__u32)shared >> PAGE_SHIFT, size, vma->vm_page_prot ); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) return remap_pfn_range( vma, vma->vm_start, virt_to_phys((void*)shared) >> PAGE_SHIFT, size, vma->vm_page_prot ); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) return remap_page_range( vma, vma->vm_start, virt_to_phys((void*)shared), size, vma->vm_page_prot ); #else return io_remap_page_range( vma->vm_start, virt_to_phys((void*)shared), size, vma->vm_page_prot ); #endif } /**********************************************************************************************************************/ static struct file_operations sh7722gfx_fops = { flush: sh7722gfx_flush, ioctl: sh7722gfx_ioctl, mmap: sh7722gfx_mmap }; static struct miscdevice sh7722gfx_miscdev = { minor: 196, // 7*7*2*2 name: "sh772x_gfx", fops: &sh7722gfx_fops }; /**********************************************************************************************************************/ int sh7722_init( void ) { int i; int ret; /* Register the SH7722 graphics device. */ ret = misc_register( &sh7722gfx_miscdev ); if (ret < 0) { printk( KERN_ERR "%s: misc_register() for minor %d failed! (error %d)\n", __FUNCTION__, sh7722gfx_miscdev.minor, ret ); return ret; } /* Allocate and initialize the shared area. */ #ifdef USE_DMA_ALLOC_COHERENT shared = dma_alloc_coherent( NULL, sizeof(SH772xGfxSharedArea), (dma_addr_t*)&shared_phys, GFP_KERNEL ); printk( KERN_INFO "sh7722gfx: shared area at %p [%lx/%lx] using %d bytes\n", shared, virt_to_phys(shared), shared_phys, sizeof(SH772xGfxSharedArea) ); #else shared_order = get_order(PAGE_ALIGN(sizeof(SH772xGfxSharedArea))); shared_page = alloc_pages( GFP_DMA | GFP_KERNEL, shared_order ); shared = ioremap( virt_to_phys( page_address(shared_page) ), PAGE_ALIGN(sizeof(SH772xGfxSharedArea)) ); for (i=0; i<1< #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sh7722.h" #include "sh7722_types.h" #include "sh7722_multi.h" D_DEBUG_DOMAIN( SH7722_Layer, "SH7722/Layer", "Renesas SH7722 Layers" ); /**********************************************************************************************************************/ static int sh7722LayerDataSize( void ) { return sizeof(SH7722MultiLayerData); } static int sh7722RegionDataSize( void ) { return sizeof(SH7722MultiRegionData); } static DFBResult sh7722InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_SCREEN_POSITION | DLCAPS_SRC_COLORKEY | DLCAPS_WINDOWS; description->type = DLTF_GRAPHICS; description->regions = 4; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Multi Window" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = sdev->lcd_width; config->height = sdev->lcd_height; config->pixelformat = DSPF_NV16; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; return DFB_OK; } static DFBResult sh7722TestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); if (config->options & ~SH7722_MULTI_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; switch (config->format) { case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB24: case DSPF_RGB16: break; #if FIXME_MAKE_CONFIGURABLE_ case DSPF_NV12: case DSPF_NV16: break; #endif default: fail |= CLRCF_FORMAT; } if (config->width < 32 || config->width > 1280) fail |= CLRCF_WIDTH; if (config->height < 32 || config->height > 1024) fail |= CLRCF_HEIGHT; if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult sh7722AddRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config ) { int n; SH7722MultiRegionData *sreg = region_data; SH7722MultiLayerData *slay = layer_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); if (slay->added == 0xF) return DFB_LIMITEXCEEDED; for (n=0; n<4; n++) if (! (slay->added & (1 << n))) break; D_ASSERT( n < 4 ); sreg->config = *config; slay->added |= 1 << n; D_MAGIC_SET( sreg, SH7722MultiRegionData ); return DFB_OK; } static DFBResult sh7722SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { int n; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722MultiRegionData *sreg = region_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( sreg, SH7722MultiRegionData ); fusion_skirmish_prevail( &sdev->beu_lock ); /* Wait for idle BEU. */ BEU_Wait( sdrv, sdev ); n = sreg->index; D_ASSERT( n >= 0 ); D_ASSERT( n <= 3 ); /* Update position? */ if (updated & CLRCF_DEST) { /* Set horizontal and vertical offset. */ SH7722_SETREG32( sdrv, BMLOCR(n), (config->dest.y << 16) | config->dest.x ); } /* Update size? */ if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT)) { /* Set width and height. */ SH7722_SETREG32( sdrv, BMSSZR(n), (config->height << 16) | config->width ); } /* Update surface? */ if (updated & CLRCF_SURFACE) { CoreSurfaceBuffer *buffer; D_ASSERT( surface != NULL ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); /* Set buffer pitch. */ SH7722_SETREG32( sdrv, BMSMWR(n), lock->pitch ); /* Set buffer offset (Y plane or RGB packed). */ SH7722_SETREG32( sdrv, BMSAYR(n), lock->phys ); /* Set buffer offset (UV plane). */ if (DFB_PLANAR_PIXELFORMAT(buffer->format)) { D_ASSUME( buffer->format == DSPF_NV12 || buffer->format == DSPF_NV16 ); SH7722_SETREG32( sdrv, BMSACR(n), lock->phys + lock->pitch * surface->config.size.h ); } } /* Update format? */ if (updated & CLRCF_FORMAT) { unsigned long tBMSIFR = 0; /* Set pixel format. */ switch (config->format) { case DSPF_NV12: tBMSIFR |= CHRR_YCBCR_420; break; case DSPF_NV16: tBMSIFR |= CHRR_YCBCR_422; break; case DSPF_ARGB: tBMSIFR |= RPKF_ARGB; break; case DSPF_RGB32: tBMSIFR |= RPKF_RGB32; break; case DSPF_RGB24: tBMSIFR |= RPKF_RGB24; break; case DSPF_RGB16: tBMSIFR |= RPKF_RGB16; break; default: break; } /* FIXME: all regions need to have the same format! */ SH7722_SETREG32( sdrv, BMSIFR, tBMSIFR ); } SH7722_SETREG32( sdrv, BMWCR0, SH7722_GETREG32( sdrv, BMWCR0 ) | (1 << n) ); fusion_skirmish_dismiss( &sdev->beu_lock ); return DFB_OK; } static DFBResult sh7722RemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { int n; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722MultiRegionData *sreg = region_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( sreg, SH7722MultiRegionData ); n = sreg->index; D_ASSERT( n >= 0 ); D_ASSERT( n <= 3 ); fusion_skirmish_prevail( &sdev->beu_lock ); /* Wait for idle BEU. */ BEU_Wait( sdrv, sdev ); /* Disable multi window. */ SH7722_SETREG32( sdrv, BMWCR0, SH7722_GETREG32( sdrv, BMWCR0 ) & ~(1 << n) ); /* Start operation! */ BEU_Start( sdrv, sdev ); fusion_skirmish_dismiss( &sdev->beu_lock ); return DFB_OK; } static DFBResult sh7722FlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { int n; CoreSurfaceBuffer *buffer; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722MultiRegionData *sreg = region_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_ASSERT( surface != NULL ); D_ASSERT( sdrv != NULL ); D_ASSERT( sdev != NULL ); D_MAGIC_ASSERT( sreg, SH7722MultiRegionData ); n = sreg->index; D_ASSERT( n >= 0 ); D_ASSERT( n <= 3 ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); fusion_skirmish_prevail( &sdev->beu_lock ); /* Wait for idle BEU. */ BEU_Wait( sdrv, sdev ); /* Set buffer pitch. */ SH7722_SETREG32( sdrv, BMSMWR(n), lock->pitch ); /* Set buffer offset (Y plane or RGB packed). */ SH7722_SETREG32( sdrv, BMSAYR(n), lock->phys ); /* Set buffer offset (UV plane). */ if (DFB_PLANAR_PIXELFORMAT(buffer->format)) { D_ASSUME( buffer->format == DSPF_NV12 || buffer->format == DSPF_NV16 ); SH7722_SETREG32( sdrv, BMSACR(n), lock->phys + lock->pitch * surface->config.size.h ); } /* Start operation! */ BEU_Start( sdrv, sdev ); fusion_skirmish_dismiss( &sdev->beu_lock ); /* Wait for idle BEU? */ if (flags & DSFLIP_WAIT) BEU_Wait( sdrv, sdev ); dfb_surface_flip( surface, false ); return DFB_OK; } static DFBResult sh7722UpdateRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, const DFBRegion *update, CoreSurfaceBufferLock *lock ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_ASSERT( surface != NULL ); D_ASSERT( sdrv != NULL ); D_ASSERT( sdev != NULL ); /* Start operation! */ BEU_Start( sdrv, sdev ); return DFB_OK; } DisplayLayerFuncs sh7722MultiLayerFuncs = { .LayerDataSize = sh7722LayerDataSize, .RegionDataSize = sh7722RegionDataSize, .InitLayer = sh7722InitLayer, .TestRegion = sh7722TestRegion, .AddRegion = sh7722AddRegion, .SetRegion = sh7722SetRegion, .RemoveRegion = sh7722RemoveRegion, .FlipRegion = sh7722FlipRegion, .UpdateRegion = sh7722UpdateRegion, }; DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_regs.h0000644000175000017500000005076711164361026015527 00000000000000#ifndef __SH7722__SH7722_REGS_H__ #define __SH7722__SH7722_REGS_H__ /****************************************************************************** * Register access */ #define VEU_REG_BASE 0xFE920000 #define SH7722_BEU_BASE 0xFE930000 #define LCDC_REG_BASE 0xFE940000 #define JPEG_REG_BASE 0xFEA00000 /****************************************************************************** * BEU */ /* BEU start register */ #define BESTR (SH7722_BEU_BASE + 0x0000) /* BEU source memory width register 1 */ #define BSMWR1 (SH7722_BEU_BASE + 0x0010) /* BEU source size register 1 */ #define BSSZR1 (SH7722_BEU_BASE + 0x0014) /* BEU source address Y register 1 */ #define BSAYR1 (SH7722_BEU_BASE + 0x0018) /* BEU source address C register 1 */ #define BSACR1 (SH7722_BEU_BASE + 0x001C) /* BEU source address A register 1 */ #define BSAAR1 (SH7722_BEU_BASE + 0x0020) /* BEU source image format register 1 */ #define BSIFR1 (SH7722_BEU_BASE + 0x0024) /* BEU source memory width register 2 */ #define BSMWR2 (SH7722_BEU_BASE + 0x0028) /* BEU source size register 2 */ #define BSSZR2 (SH7722_BEU_BASE + 0x002C) /* BEU source address Y register 2 */ #define BSAYR2 (SH7722_BEU_BASE + 0x0030) /* BEU source address C register 2 */ #define BSACR2 (SH7722_BEU_BASE + 0x0034) /* BEU source address A register 2 */ #define BSAAR2 (SH7722_BEU_BASE + 0x0038) /* BEU source image format register 2 */ #define BSIFR2 (SH7722_BEU_BASE + 0x003C) /* BEU source memory width register 3 */ #define BSMWR3 (SH7722_BEU_BASE + 0x0040) /* BEU source size register 3 */ #define BSSZR3 (SH7722_BEU_BASE + 0x0044) /* BEU source address Y register 3 */ #define BSAYR3 (SH7722_BEU_BASE + 0x0048) /* BEU source address C register 3 */ #define BSACR3 (SH7722_BEU_BASE + 0x004C) /* BEU source address A register 3 */ #define BSAAR3 (SH7722_BEU_BASE + 0x0050) /* BEU source image format register 3 */ #define BSIFR3 (SH7722_BEU_BASE + 0x0054) /* BEU tile pattern size register */ #define BTPSR (SH7722_BEU_BASE + 0x0058) /* BEU multidisplay source memory width register 1 */ #define BMSMWR1 (SH7722_BEU_BASE + 0x0070) /* BEU multidisplay source size register 1 */ #define BMSSZR1 (SH7722_BEU_BASE + 0x0074) /* BEU multidisplay source address Y register 1 */ #define BMSAYR1 (SH7722_BEU_BASE + 0x0078) /* BEU multidisplay source address C register 1 */ #define BMSACR1 (SH7722_BEU_BASE + 0x007C) /* BEU multidisplay source memory width register 2 */ #define BMSMWR2 (SH7722_BEU_BASE + 0x0080) /* BEU multidisplay source size register 2 */ #define BMSSZR2 (SH7722_BEU_BASE + 0x0084) /* BEU multidisplay source address Y register 2 */ #define BMSAYR2 (SH7722_BEU_BASE + 0x0088) /* BEU multidisplay source address C register 2 */ #define BMSACR2 (SH7722_BEU_BASE + 0x008C) /* BEU multidisplay source memory width register 3 */ #define BMSMWR3 (SH7722_BEU_BASE + 0x0090) /* BEU multidisplay source size register 3 */ #define BMSSZR3 (SH7722_BEU_BASE + 0x0094) /* BEU multidisplay source address Y register 3 */ #define BMSAYR3 (SH7722_BEU_BASE + 0x0098) /* BEU multidisplay source address C register 3 */ #define BMSACR3 (SH7722_BEU_BASE + 0x009C) /* BEU multidisplay source memory width register 4 */ #define BMSMWR4 (SH7722_BEU_BASE + 0x00A0) /* BEU multidisplay source size register 4 */ #define BMSSZR4 (SH7722_BEU_BASE + 0x00A4) /* BEU multidisplay source address Y register 4 */ #define BMSAYR4 (SH7722_BEU_BASE + 0x00A8) /* BEU multidisplay source address C register 4 */ #define BMSACR4 (SH7722_BEU_BASE + 0x00AC) /* BEU multidisplay source image format register */ #define BMSIFR (SH7722_BEU_BASE + 0x00F0) /* BEU blend control register 0 */ #define BBLCR0 (SH7722_BEU_BASE + 0x0100) /* BEU blend control register 1 */ #define BBLCR1 (SH7722_BEU_BASE + 0x0104) /* BEU process control register */ #define BPROCR (SH7722_BEU_BASE + 0x0108) /* BEU multiwindow control register 0 */ #define BMWCR0 (SH7722_BEU_BASE + 0x010C) /* Blend location register 1 */ #define BLOCR1 (SH7722_BEU_BASE + 0x0114) /* Blend location register 2 */ #define BLOCR2 (SH7722_BEU_BASE + 0x0118) /* Blend location register 3 */ #define BLOCR3 (SH7722_BEU_BASE + 0x011C) /* BEU multidisplay location register 1 */ #define BMLOCR1 (SH7722_BEU_BASE + 0x0120) /* BEU multidisplay location register 2 */ #define BMLOCR2 (SH7722_BEU_BASE + 0x0124) /* BEU multidisplay location register 3 */ #define BMLOCR3 (SH7722_BEU_BASE + 0x0128) /* BEU multidisplay location register 4 */ #define BMLOCR4 (SH7722_BEU_BASE + 0x012C) /* BEU multidisplay transparent color control register 1 */ #define BMPCCR1 (SH7722_BEU_BASE + 0x0130) /* BEU multidisplay transparent color control register 2 */ #define BMPCCR2 (SH7722_BEU_BASE + 0x0134) /* Blend pack form register */ #define BPKFR (SH7722_BEU_BASE + 0x0140) /* BEU transparent color control register 0 */ #define BPCCR0 (SH7722_BEU_BASE + 0x0144) /* BEU transparent color control register 11 */ #define BPCCR11 (SH7722_BEU_BASE + 0x0148) /* BEU transparent color control register 12 */ #define BPCCR12 (SH7722_BEU_BASE + 0x014C) /* BEU transparent color control register 21 */ #define BPCCR21 (SH7722_BEU_BASE + 0x0150) /* BEU transparent color control register 22 */ #define BPCCR22 (SH7722_BEU_BASE + 0x0154) /* BEU transparent color control register 31 */ #define BPCCR31 (SH7722_BEU_BASE + 0x0158) /* BEU transparent color control register 32 */ #define BPCCR32 (SH7722_BEU_BASE + 0x015C) /* BEU destination memory width register */ #define BDMWR (SH7722_BEU_BASE + 0x0160) /* BEU destination address Y register */ #define BDAYR (SH7722_BEU_BASE + 0x0164) /* BEU destination address C register */ #define BDACR (SH7722_BEU_BASE + 0x0168) /* BEU address fixed register */ #define BAFXR (SH7722_BEU_BASE + 0x0180) /* BEU swapping register */ #define BSWPR (SH7722_BEU_BASE + 0x0184) /* BEU event interrupt enable register */ #define BEIER (SH7722_BEU_BASE + 0x0188) /* BEU event register */ #define BEVTR (SH7722_BEU_BASE + 0x018C) /* BEU register control register */ #define BRCNTR (SH7722_BEU_BASE + 0x0194) /* BEU status register */ #define BSTAR (SH7722_BEU_BASE + 0x0198) /* BEU module reset register */ #define BBRSTR (SH7722_BEU_BASE + 0x019C) /* BEU register-plane forcible setting register */ #define BRCHR (SH7722_BEU_BASE + 0x01A0) /* Color Lookup Table - CLUT registers (0-255) */ #define BCLUT(n) (SH7722_BEU_BASE + 0x3000 + (n) * 0x04) /* BEU source memory width registers (0-2) */ #define BSMWR(n) (SH7722_BEU_BASE + 0x0010 + (n) * 0x18) /* BEU source size registers (0-2) */ #define BSSZR(n) (SH7722_BEU_BASE + 0x0014 + (n) * 0x18) /* BEU source address Y registers (0-2) */ #define BSAYR(n) (SH7722_BEU_BASE + 0x0018 + (n) * 0x18) /* BEU source address C registers (0-2) */ #define BSACR(n) (SH7722_BEU_BASE + 0x001C + (n) * 0x18) /* BEU source address A registers (0-2) */ #define BSAAR(n) (SH7722_BEU_BASE + 0x0020 + (n) * 0x18) /* BEU source image format registers (0-2) */ #define BSIFR(n) (SH7722_BEU_BASE + 0x0024 + (n) * 0x18) /* BEU multidisplay source memory width registers (0-3) */ #define BMSMWR(n) (SH7722_BEU_BASE + 0x0070 + (n) * 0x10) /* BEU multidisplay source size registers (0-3) */ #define BMSSZR(n) (SH7722_BEU_BASE + 0x0074 + (n) * 0x10) /* BEU multidisplay source address Y registers (0-3) */ #define BMSAYR(n) (SH7722_BEU_BASE + 0x0078 + (n) * 0x10) /* BEU multidisplay source address C registers (0-3) */ #define BMSACR(n) (SH7722_BEU_BASE + 0x007C + (n) * 0x10) /* Blend location registers (0-2) */ #define BLOCR(n) (SH7722_BEU_BASE + 0x0114 + (n) * 0x04) /* BEU multidisplay location registers (0-3) */ #define BMLOCR(n) (SH7722_BEU_BASE + 0x0120 + (n) * 0x04) /* BSIFR1-3 */ #define CHRR_YCBCR_444 0x000 #define CHRR_YCBCR_422 0x100 #define CHRR_YCBCR_420 0x200 #define CHRR_aYCBCR_444 0x300 #define CHRR_aYCBCR_422 0x400 #define CHRR_aYCBCR_420 0x500 #define RPKF_ARGB 0x000 #define RPKF_RGB32 0x000 #define RPKF_RGB24 0x002 #define RPKF_RGB16 0x003 /* BSIFR1 */ #define BSIFR1_IN1TE_RGBYUV 0x1000 /* BSIFR3 */ #define BSIFR3_MOD0_OSD 0x1000 #define BSIFR3_MOD1_LUT 0x2000 /* BPKFR */ #define WPCK_RGB12 2 #define WPCK_RGB16 6 #define WPCK_RGB18 17 #define WPCK_RGB32 19 #define WPCK_RGB24 21 #define CHDS_YCBCR444 0x000 #define CHDS_YCBCR422 0x100 #define CHDS_YCBCR420 0x200 #define BPKFR_RY_YUV 0x000 #define BPKFR_RY_RGB 0x800 #define BPKFR_TE_DISABLED 0x000 #define BPKFR_TE_ENABLED 0x400 /* BBLCR0 */ #define BBLCR0_LAY_123 0x05000000 #define BBLCR0_AMUX_BLENDPIXEL(n) (0x10000000 << (n)) /* BBLCR1 */ #define MT_MEMORY 0x10000 #define MT_VOU 0x20000 #define MT_MEMORY_VOU 0x30000 #define MT_LCDC 0x40000 #define MT_LCDC_MEMORY 0x50000 #define BBLCR1_PWD_INPUT1 0x00000000 #define BBLCR1_PWD_INPUT2 0x01000000 #define BBLCR1_PWD_INPUT3 0x02000000 #define BBLCR1_PWD_INPUT_MASK 0x03000000 /* BSWPR */ #define BSWPR_MODSEL_GLOBAL 0x00000000 #define BSWPR_MODSEL_EACH 0x80000000 #define BSWPR_INPUT_BYTESWAP 0x00000001 #define BSWPR_INPUT_WORDSWAP 0x00000002 #define BSWPR_INPUT_LONGSWAP 0x00000004 #define BSWPR_OUTPUT_BYTESWAP 0x00000010 #define BSWPR_OUTPUT_WORDSWAP 0x00000020 #define BSWPR_OUTPUT_LONGSWAP 0x00000040 #define BSWPR_INPUT2_BYTESWAP 0x00000100 #define BSWPR_INPUT2_WORDSWAP 0x00000200 #define BSWPR_INPUT2_LONGSWAP 0x00000400 #define BSWPR_INPUT3_BYTESWAP 0x00010000 #define BSWPR_INPUT3_WORDSWAP 0x00020000 #define BSWPR_INPUT3_LONGSWAP 0x00040000 #define BSWPR_MULWIN_BYTESWAP 0x01000000 #define BSWPR_MULWIN_WORDSWAP 0x02000000 #define BSWPR_MULWIN_LONGSWAP 0x04000000 /****************************************************************************** * VEU */ #define VEU_VESTR (VEU_REG_BASE + 0x0000) #define VEU_VESWR (VEU_REG_BASE + 0x0010) #define VEU_VESSR (VEU_REG_BASE + 0x0014) #define VEU_VSAYR (VEU_REG_BASE + 0x0018) #define VEU_VSACR (VEU_REG_BASE + 0x001c) #define VEU_VBSSR (VEU_REG_BASE + 0x0020) #define VEU_VEDWR (VEU_REG_BASE + 0x0030) #define VEU_VDAYR (VEU_REG_BASE + 0x0034) #define VEU_VDACR (VEU_REG_BASE + 0x0038) #define VEU_VTRCR (VEU_REG_BASE + 0x0050) #define VEU_VRFCR (VEU_REG_BASE + 0x0054) #define VEU_VRFSR (VEU_REG_BASE + 0x0058) #define VEU_VENHR (VEU_REG_BASE + 0x005c) #define VEU_VFMCR (VEU_REG_BASE + 0x0070) #define VEU_VVTCR (VEU_REG_BASE + 0x0074) #define VEU_VHTCR (VEU_REG_BASE + 0x0078) #define VEU_VAPCR (VEU_REG_BASE + 0x0080) #define VEU_VECCR (VEU_REG_BASE + 0x0084) #define VEU_VAFXR (VEU_REG_BASE + 0x0090) #define VEU_VSWPR (VEU_REG_BASE + 0x0094) #define VEU_VEIER (VEU_REG_BASE + 0x00a0) #define VEU_VEVTR (VEU_REG_BASE + 0x00a4) #define VEU_VSTAR (VEU_REG_BASE + 0x00b0) #define VEU_VBSRR (VEU_REG_BASE + 0x00b4) /****************************************************************************** * LCD */ #define LCDC_LUT(n) (LCDC_REG_BASE + (n) * 4) #define LCDC_MLDDCKPAT1R (LCDC_REG_BASE + 0x0400) #define LCDC_MLDDCKPAT2R (LCDC_REG_BASE + 0x0404) #define LCDC_SLDDCKPAT1R (LCDC_REG_BASE + 0x0408) #define LCDC_SLDDCKPAT2R (LCDC_REG_BASE + 0x040c) #define LCDC_LDDCKR (LCDC_REG_BASE + 0x0410) #define LCDC_LDDCKSTPR (LCDC_REG_BASE + 0x0414) #define LCDC_MLDMT1R (LCDC_REG_BASE + 0x0418) #define LCDC_MLDMT2R (LCDC_REG_BASE + 0x041c) #define LCDC_MLDMT3R (LCDC_REG_BASE + 0x0420) #define LCDC_MLDDFR (LCDC_REG_BASE + 0x0424) #define LCDC_MLDSM1R (LCDC_REG_BASE + 0x0428) #define LCDC_MLDSM2R (LCDC_REG_BASE + 0x042c) #define LCDC_MLDSA1R (LCDC_REG_BASE + 0x0430) #define LCDC_MLDSA2R (LCDC_REG_BASE + 0x0434) #define LCDC_MLDMLSR (LCDC_REG_BASE + 0x0438) #define LCDC_MLDWBFR (LCDC_REG_BASE + 0x043c) #define LCDC_MLDWBCNTR (LCDC_REG_BASE + 0x0440) #define LCDC_MLDWBAR (LCDC_REG_BASE + 0x0444) #define LCDC_MLDHCNR (LCDC_REG_BASE + 0x0448) #define LCDC_MLDHSYNR (LCDC_REG_BASE + 0x044c) #define LCDC_MLDVLNR (LCDC_REG_BASE + 0x0450) #define LCDC_MLDVSYNR (LCDC_REG_BASE + 0x0454) #define LCDC_MLDHPDR (LCDC_REG_BASE + 0x0458) #define LCDC_MLDVPDR (LCDC_REG_BASE + 0x045c) #define LCDC_MLDPMR (LCDC_REG_BASE + 0x0460) #define LCDC_LDPALCR (LCDC_REG_BASE + 0x0464) #define LCDC_LDINTR (LCDC_REG_BASE + 0x0468) #define LCDC_LDSR (LCDC_REG_BASE + 0x046c) #define LCDC_LDCNT1R (LCDC_REG_BASE + 0x0470) #define LCDC_LDCNT2R (LCDC_REG_BASE + 0x0474) #define LCDC_LDRCNTR (LCDC_REG_BASE + 0x0478) #define LCDC_LDDDSR (LCDC_REG_BASE + 0x047c) #define LCDC_LDRCR (LCDC_REG_BASE + 0x0484) /****************************************************************************** * JPEG */ /* JPEG code mode register */ #define JCMOD (JPEG_REG_BASE + 0x0000) /* JPEG code command register */ #define JCCMD (JPEG_REG_BASE + 0x0004) /* JPEG code status register */ #define JCSTS (JPEG_REG_BASE + 0x0008) /* JPEG code quantization table number register */ #define JCQTN (JPEG_REG_BASE + 0x000C) /* JPEG code Huffman table number register */ #define JCHTN (JPEG_REG_BASE + 0x0010) /* JPEG code DRI upper register */ #define JCDRIU (JPEG_REG_BASE + 0x0014) /* JPEG code DRI lower register */ #define JCDRID (JPEG_REG_BASE + 0x0018) /* JPEG code vertical size upper register */ #define JCVSZU (JPEG_REG_BASE + 0x001C) /* JPEG code vertical size lower register */ #define JCVSZD (JPEG_REG_BASE + 0x0020) /* JPEG code horizontal size upper register */ #define JCHSZU (JPEG_REG_BASE + 0x0024) /* JPEG code horizontal size lower register */ #define JCHSZD (JPEG_REG_BASE + 0x0028) /* JPEG code data count upper register */ #define JCDTCU (JPEG_REG_BASE + 0x002C) /* JPEG code data count middle register */ #define JCDTCM (JPEG_REG_BASE + 0x0030) /* JPEG code data count lower register */ #define JCDTCD (JPEG_REG_BASE + 0x0034) /* JPEG interrupt enable register */ #define JINTE (JPEG_REG_BASE + 0x0038) /* JPEG interrupt status register */ #define JINTS (JPEG_REG_BASE + 0x003C) /* JPEG code decode error register */ #define JCDERR (JPEG_REG_BASE + 0x0040) /* JPEG code reset register */ #define JCRST (JPEG_REG_BASE + 0x0044) /* JPEG interface control register */ #define JIFCNT (JPEG_REG_BASE + 0x0060) /* JPEG interface encoding control register */ #define JIFECNT (JPEG_REG_BASE + 0x0070) /* JPEG interface encode source Y address register 1 */ #define JIFESYA1 (JPEG_REG_BASE + 0x0074) /* JPEG interface encode source C address register 1 */ #define JIFESCA1 (JPEG_REG_BASE + 0x0078) /* JPEG interface encode source Y address register 2 */ #define JIFESYA2 (JPEG_REG_BASE + 0x007C) /* JPEG interface encode source C address register 2 */ #define JIFESCA2 (JPEG_REG_BASE + 0x0080) /* JPEG interface encode source memory width register */ #define JIFESMW (JPEG_REG_BASE + 0x0084) /* JPEG interface encode source vertical size register */ #define JIFESVSZ (JPEG_REG_BASE + 0x0088) /* JPEG interface encode source horizontal size register */ #define JIFESHSZ (JPEG_REG_BASE + 0x008C) /* JPEG interface encode destination address register 1 */ #define JIFEDA1 (JPEG_REG_BASE + 0x0090) /* JPEG interface encode destination address register 2 */ #define JIFEDA2 (JPEG_REG_BASE + 0x0094) /* JPEG interface encode data reload size register */ #define JIFEDRSZ (JPEG_REG_BASE + 0x0098) /* JPEG interface decoding control register */ #define JIFDCNT (JPEG_REG_BASE + 0x00A0) /* JPEG interface decode source address register 1 */ #define JIFDSA1 (JPEG_REG_BASE + 0x00A4) /* JPEG interface decode source address register 2 */ #define JIFDSA2 (JPEG_REG_BASE + 0x00A8) /* JPEG interface decode data reload size register */ #define JIFDDRSZ (JPEG_REG_BASE + 0x00AC) /* JPEG interface decode destination memory width register */ #define JIFDDMW (JPEG_REG_BASE + 0x00B0) /* JPEG interface decode destination vertical size register */ #define JIFDDVSZ (JPEG_REG_BASE + 0x00B4) /* JPEG interface decode destination horizontal size register */ #define JIFDDHSZ (JPEG_REG_BASE + 0x00B8) /* JPEG interface decode destination Y address register 1 */ #define JIFDDYA1 (JPEG_REG_BASE + 0x00BC) /* JPEG interface decode destination C address register 1 */ #define JIFDDCA1 (JPEG_REG_BASE + 0x00C0) /* JPEG interface decode destination Y address register 2 */ #define JIFDDYA2 (JPEG_REG_BASE + 0x00C4) /* JPEG interface decode destination C address register 2 */ #define JIFDDCA2 (JPEG_REG_BASE + 0x00C8) /* JPEG code quantization table 0 register */ #define JCQTBL0(n) (JPEG_REG_BASE + 0x10000 + (((n)*4) & 0x3C)) // to 0x1003C /* JPEG code quantization table 1 register */ #define JCQTBL1(n) (JPEG_REG_BASE + 0x10040 + (((n)*4) & 0x3C)) // to 0x1007C /* JPEG code quantization table 2 register */ #define JCQTBL2(n) (JPEG_REG_BASE + 0x10080 + (((n)*4) & 0x3C)) // to 0x100BC /* JPEG code quantization table 3 register */ #define JCQTBL3(n) (JPEG_REG_BASE + 0x100C0 + (((n)*4) & 0x3C)) // to 0x100FC /* JPEG code Huffman table DC0 register */ #define JCHTBD0(n) (JPEG_REG_BASE + 0x10100 + (((n)*4) & 0x1C)) // to 0x1010C /* JPEG code Huffman table DC0 register */ //#define JCHTBD1(n) (JPEG_REG_BASE + 0x10110 + (((n)*4) & 0x0C)) // to 0x10118 /* JPEG code Huffman table AC0 register */ #define JCHTBA0(n) (JPEG_REG_BASE + 0x10120 + (((n)*4) & 0xFC)) // to 0x1012C /* JPEG code Huffman table AC0 register */ //#define JCHTBA1(n) (JPEG_REG_BASE + 0x10130 + (((n)*4) & 0x0C)) // to 0x101D0 /* JPEG code Huffman table DC1 register */ #define JCHTBD1(n) (JPEG_REG_BASE + 0x10200 + (((n)*4) & 0x1C)) // to 0x1020C /* JPEG code Huffman table DC1 register */ //#define JCHTBD3(n) (JPEG_REG_BASE + 0x10210 + (((n)*4) & 0x0C)) // to 0x10218 /* JPEG code Huffman table AC1 register */ #define JCHTBA1(n) (JPEG_REG_BASE + 0x10220 + (((n)*4) & 0xFC)) // to 0x1022C /* JPEG code Huffman table AC1 register */ //#define JCHTBA3(n) (JPEG_REG_BASE + 0x10230 + (((n)*4) & 0xFC)) // to 0x102D0 #define JCCMD_START 0x00000001 #define JCCMD_RESTART 0x00000002 #define JCCMD_END 0x00000004 #define JCCMD_LCMD2 0x00000100 #define JCCMD_LCMD1 0x00000200 #define JCCMD_RESET 0x00000080 #define JCCMD_READ_RESTART 0x00000400 #define JCCMD_WRITE_RESTART 0x00000800 #define JCMOD_DSP_ENCODE 0x00000000 #define JCMOD_DSP_DECODE 0x00000008 #define JCMOD_INPUT_CTRL 0x00000080 // must always be set #define JIFCNT_VJSEL_JPU 0x00000000 #define JIFCNT_VJSEL_VPU 0x00000002 #define JIFECNT_LINEBUF_MODE 0x00000002 #define JIFECNT_SWAP_1234 0x00000000 #define JIFECNT_SWAP_2143 0x00000010 #define JIFECNT_SWAP_3412 0x00000020 #define JIFECNT_SWAP_4321 0x00000030 #define JIFECNT_RELOAD_ENABLE 0x00000040 #define JIFDCNT_LINEBUF_MODE 0x00000001 #define JIFDCNT_SWAP_1234 0x00000000 #define JIFDCNT_SWAP_2143 0x00000002 #define JIFDCNT_SWAP_3412 0x00000004 #define JIFDCNT_SWAP_4321 0x00000006 #define JIFDCNT_RELOAD_ENABLE 0x00000008 #define JINTS_MASK 0x00007C68 #define JINTS_INS3_HEADER 0x00000008 #define JINTS_INS5_ERROR 0x00000020 #define JINTS_INS6_DONE 0x00000040 #define JINTS_INS10_XFER_DONE 0x00000400 #define JINTS_INS11_LINEBUF0 0x00000800 #define JINTS_INS12_LINEBUF1 0x00001000 #define JINTS_INS13_LOADED 0x00002000 #define JINTS_INS14_RELOAD 0x00004000 #endif DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_types.h0000644000175000017500000000631211164361026015716 00000000000000#ifndef __SH7722__TYPES_H__ #define __SH7722__TYPES_H__ #include #include #define SH7722GFX_MAX_PREPARE 8192 typedef enum { SH7722_LAYER_INPUT1, SH7722_LAYER_INPUT2, SH7722_LAYER_INPUT3, SH7722_LAYER_MULTIWIN } SH7722LayerID; typedef struct { SH7722LayerID layer; } SH7722LayerData; typedef struct { int magic; CoreLayerRegionConfig config; CoreSurface *surface; CorePalette *palette; } SH7722RegionData; typedef struct { unsigned int added; unsigned int visible; } SH7722MultiLayerData; typedef struct { int magic; int index; CoreLayerRegionConfig config; CoreSurface *surface; CorePalette *palette; } SH7722MultiRegionData; typedef struct { int sh772x; int lcd_width; int lcd_height; int lcd_offset; int lcd_pitch; int lcd_size; unsigned long lcd_phys; DFBSurfacePixelFormat lcd_format; /* state validation */ int v_flags; /* prepared register values */ u32 ble_srcf; u32 ble_dstf; /* cached values */ unsigned long dst_phys; int dst_pitch; int dst_bpp; int dst_index; unsigned long src_phys; int src_pitch; int src_bpp; int src_index; unsigned long mask_phys; int mask_pitch; DFBSurfacePixelFormat mask_format; int mask_index; DFBPoint mask_offset; DFBSurfaceMaskFlags mask_flags; DFBSurfaceDrawingFlags dflags; DFBSurfaceBlittingFlags bflags; DFBSurfaceRenderOptions render_options; bool ckey_b_enabled; bool color_change_enabled; bool mask_enabled; unsigned int input_mask; s32 matrix[6]; DFBColor color; /* locking */ FusionSkirmish beu_lock; /* sh7723 */ u32 rclr; u32 color16; } SH7722DeviceData; typedef struct { SH7722DeviceData *dev; CoreDFB *core; CoreGraphicsDevice *device; CoreScreen *screen; CoreLayer *multi; CoreLayer *input1; CoreLayer *input2; CoreLayer *input3; int gfx_fd; SH772xGfxSharedArea *gfx_shared; int prep_num; __u32 prep_buf[SH7722GFX_MAX_PREPARE]; volatile void *mmio_base; int num_inputs; volatile void *lcd_virt; } SH7722DriverData; #endif DirectFB-1.2.10/gfxdrivers/sh772x/Makefile.in0000644000175000017500000005754711307521500015444 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = sh7722_jpegtool$(EXEEXT) DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/sh772x ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sh7722dir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sh7722dir)" libLTLIBRARIES_INSTALL = $(INSTALL) sh7722LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) $(sh7722_LTLIBRARIES) libdirectfb_sh7722_la_DEPENDENCIES = \ $(top_builddir)/src/libdirectfb.la libsh7722_jpeg.la am_libdirectfb_sh7722_la_OBJECTS = sh7722.lo sh7722_blt.lo \ sh7723_blt.lo sh7722_jpeg.lo sh7722_layer.lo sh7722_lcd.lo \ sh7722_multi.lo sh7722_screen.lo libdirectfb_sh7722_la_OBJECTS = $(am_libdirectfb_sh7722_la_OBJECTS) libdirectfb_sh7722_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_sh7722_la_LDFLAGS) $(LDFLAGS) -o $@ libsh7722_jpeg_la_LIBADD = am_libsh7722_jpeg_la_OBJECTS = sh7722_jpeglib.lo libsh7722_jpeg_la_OBJECTS = $(am_libsh7722_jpeg_la_OBJECTS) libsh7722_jpeg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsh7722_jpeg_la_LDFLAGS) $(LDFLAGS) -o $@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_sh7722_jpegtool_OBJECTS = sh7722_jpegtool.$(OBJEXT) sh7722_jpegtool_OBJECTS = $(am_sh7722_jpegtool_OBJECTS) sh7722_jpegtool_DEPENDENCIES = $(top_builddir)/src/libdirectfb.la \ libsh7722_jpeg.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_sh7722_la_SOURCES) \ $(libsh7722_jpeg_la_SOURCES) $(sh7722_jpegtool_SOURCES) DIST_SOURCES = $(libdirectfb_sh7722_la_SOURCES) \ $(libsh7722_jpeg_la_SOURCES) $(sh7722_jpegtool_SOURCES) sh7722DATA_INSTALL = $(INSTALL_DATA) DATA = $(sh7722_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ directfbrc.sh7722 \ directfbrc.sh7723 \ Makefile.kernel \ README.sh7722 \ kernel-module/sh772x_driver.c \ kernel-module/sh772x_gfx.h \ kernel-module/sh7722.c \ kernel-module/sh7722.h \ kernel-module/sh7723.c \ kernel-module/sh7723.h \ kernel-module/Makefile INCLUDES = \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems \ -I$(srcdir)/kernel-module lib_LTLIBRARIES = libsh7722_jpeg.la libsh7722_jpeg_la_SOURCES = \ sh7722_jpeglib.c \ sh7722_jpeglib.h libsh7722_jpeg_la_LDFLAGS = \ -export-dynamic \ -avoid-version sh7722_jpegtool_SOURCES = \ sh7722_jpegtool.c sh7722_jpegtool_LDADD = \ $(top_builddir)/src/libdirectfb.la \ libsh7722_jpeg.la sh7722_LTLIBRARIES = libdirectfb_sh7722.la @BUILD_STATIC_TRUE@sh7722_DATA = $(sh7722_LTLIBRARIES:.la=.o) sh7722dir = $(MODULEDIR)/gfxdrivers libdirectfb_sh7722_la_SOURCES = \ sh7722.c \ sh7722.h \ sh7722_blt.c \ sh7722_blt.h \ sh7723_blt.c \ sh7723_blt.h \ sh7722_jpeg.c \ sh7722_layer.c \ sh7722_layer.h \ sh7722_lcd.c \ sh7722_lcd.h \ sh7722_multi.c \ sh7722_multi.h \ sh7722_regs.h \ sh7722_screen.c \ sh7722_screen.h \ sh7722_types.h libdirectfb_sh7722_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_sh7722_la_LIBADD = \ $(top_builddir)/src/libdirectfb.la \ libsh7722_jpeg.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/sh772x/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/sh772x/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-sh7722LTLIBRARIES: $(sh7722_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(sh7722dir)" || $(MKDIR_P) "$(DESTDIR)$(sh7722dir)" @list='$(sh7722_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sh7722LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(sh7722dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sh7722LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(sh7722dir)/$$f"; \ else :; fi; \ done uninstall-sh7722LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(sh7722_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(sh7722dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(sh7722dir)/$$p"; \ done clean-sh7722LTLIBRARIES: -test -z "$(sh7722_LTLIBRARIES)" || rm -f $(sh7722_LTLIBRARIES) @list='$(sh7722_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_sh7722.la: $(libdirectfb_sh7722_la_OBJECTS) $(libdirectfb_sh7722_la_DEPENDENCIES) $(libdirectfb_sh7722_la_LINK) -rpath $(sh7722dir) $(libdirectfb_sh7722_la_OBJECTS) $(libdirectfb_sh7722_la_LIBADD) $(LIBS) libsh7722_jpeg.la: $(libsh7722_jpeg_la_OBJECTS) $(libsh7722_jpeg_la_DEPENDENCIES) $(libsh7722_jpeg_la_LINK) -rpath $(libdir) $(libsh7722_jpeg_la_OBJECTS) $(libsh7722_jpeg_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done sh7722_jpegtool$(EXEEXT): $(sh7722_jpegtool_OBJECTS) $(sh7722_jpegtool_DEPENDENCIES) @rm -f sh7722_jpegtool$(EXEEXT) $(LINK) $(sh7722_jpegtool_OBJECTS) $(sh7722_jpegtool_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_blt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_jpeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_jpeglib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_jpegtool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_layer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_lcd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_multi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7722_screen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh7723_blt.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-sh7722DATA: $(sh7722_DATA) @$(NORMAL_INSTALL) test -z "$(sh7722dir)" || $(MKDIR_P) "$(DESTDIR)$(sh7722dir)" @list='$(sh7722_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(sh7722DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sh7722dir)/$$f'"; \ $(sh7722DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sh7722dir)/$$f"; \ done uninstall-sh7722DATA: @$(NORMAL_UNINSTALL) @list='$(sh7722_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sh7722dir)/$$f'"; \ rm -f "$(DESTDIR)$(sh7722dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sh7722dir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sh7722dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool clean-sh7722LTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-sh7722DATA install-sh7722LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ uninstall-sh7722DATA uninstall-sh7722LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-sh7722LTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sh7722DATA \ install-sh7722LTLIBRARIES install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-libLTLIBRARIES uninstall-sh7722DATA \ uninstall-sh7722LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_lcd.c0000644000175000017500000001343411164361026015312 00000000000000#ifdef SH7722_DEBUG_LCD #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include "sh7722.h" D_DEBUG_DOMAIN( SH7722_LCD, "SH7722/LCD", "Renesas SH7722 LCD" ); /**********************************************************************************************************************/ void sh7722_lcd_setup( void *drv, int width, int height, ulong phys, int pitch, DFBSurfacePixelFormat format, bool swap ) { u32 MLDDFR = 0; u32 LDDDSR = 0; u32 reg; D_DEBUG_AT( SH7722_LCD, "%s( %dx%d @%lu:%d )\n", __FUNCTION__, width, height, phys, pitch ); D_ASSERT( width > 7 ); D_ASSERT( height > 0 ); D_ASSERT( (phys & 7) == 0 ); D_ASSERT( pitch > 0 ); D_ASSERT( pitch < 0x10000 ); D_ASSERT( (pitch & 3) == 0 ); /* Choose input format. */ switch (format) { case DSPF_RGB32: case DSPF_ARGB: MLDDFR = 0; break; case DSPF_RGB16: MLDDFR = 3; break; case DSPF_RGB444: case DSPF_ARGB4444: MLDDFR = 8; break; case DSPF_RGB24: MLDDFR = 11; break; case DSPF_NV12: MLDDFR = 0x10000; break; case DSPF_NV16: MLDDFR = 0x10100; break; default: D_BUG( "invalid format" ); return; } /* Setup swapping. */ switch (format) { case DSPF_NV12: /* 1 byte */ case DSPF_NV16: case DSPF_RGB24: LDDDSR = 7; break; case DSPF_RGB16: /* 2 byte */ case DSPF_RGB444: case DSPF_ARGB4444: LDDDSR = 6; break; case DSPF_RGB32: /* 4 byte */ case DSPF_ARGB: LDDDSR = 4; break; default: D_BUG( "invalid format" ); return; } /* software reset of the LCD device */ reg = SH7722_GETREG32( drv, LCDC_LDCNT2R ); SH7722_SETREG32( drv, LCDC_LDCNT2R, reg | 0x100 ); while( SH7722_GETREG32( drv, LCDC_LDCNT2R ) & 0x100 ); /* stop the LCD while configuring */ SH7722_SETREG32( drv, LCDC_LDCNT2R, 0 ); SH7722_SETREG32( drv, LCDC_LDDCKSTPR, 1 ); SH7722_SETREG32( drv, LCDC_MLDDCKPAT1R, 0x05555555 ); SH7722_SETREG32( drv, LCDC_MLDDCKPAT2R, 0x55555555 ); SH7722_SETREG32( drv, LCDC_LDDCKR, 0x0000003c ); SH7722_SETREG32( drv, LCDC_MLDMT2R, 0x00000000 ); SH7722_SETREG32( drv, LCDC_MLDMT3R, 0x00000000 ); SH7722_SETREG32( drv, LCDC_MLDDFR, MLDDFR ); SH7722_SETREG32( drv, LCDC_MLDSM1R, 0x00000000 ); SH7722_SETREG32( drv, LCDC_MLDSM2R, 0x00000000 ); SH7722_SETREG32( drv, LCDC_MLDSA1R, phys ); SH7722_SETREG32( drv, LCDC_MLDSA2R, DFB_PLANAR_PIXELFORMAT( format ) ? (phys + pitch * height) : 0 ); SH7722_SETREG32( drv, LCDC_MLDMLSR, pitch ); SH7722_SETREG32( drv, LCDC_MLDWBCNTR, 0x00000000 ); SH7722_SETREG32( drv, LCDC_MLDWBAR, 0x00000000 ); #if 0 SH7722_SETREG32( drv, LCDC_MLDMT1R, 0x18000006 ); SH7722_SETREG32( drv, LCDC_MLDHCNR, ((width / 8) << 16) | (1056 / 8) ); SH7722_SETREG32( drv, LCDC_MLDHSYNR, ((128 / 8) << 16) | (840 / 8) ); SH7722_SETREG32( drv, LCDC_MLDVLNR, (height << 16) | 525 ); SH7722_SETREG32( drv, LCDC_MLDVSYNR, (2 << 16) | 490 ); SH7722_SETREG32( drv, LCDC_MLDPMR, 0xf6000f00 ); #elif 0 SH7722_SETREG32( drv, LCDC_MLDMT1R, 0x1c00000a ); SH7722_SETREG32( drv, LCDC_MLDHCNR, 0x00500060); SH7722_SETREG32( drv, LCDC_MLDHSYNR, 0x00010052); SH7722_SETREG32( drv, LCDC_MLDVLNR, 0x01e00200); SH7722_SETREG32( drv, LCDC_MLDVSYNR, 0x000301f0); SH7722_SETREG32( drv, LCDC_MLDPMR, 0x00000000 ); //igel #elif defined(SH7722_ALGO_PANEL) SH7722_SETREG32( drv, LCDC_MLDMT1R, 0x1c00000a ); SH7722_SETREG32( drv, LCDC_MLDHCNR, 0x00500060); SH7722_SETREG32( drv, LCDC_MLDHSYNR, 0x00010052); SH7722_SETREG32( drv, LCDC_MLDVLNR, 0x01e0020e); SH7722_SETREG32( drv, LCDC_MLDVSYNR, 0x000301f0); SH7722_SETREG32( drv, LCDC_MLDPMR, 0x00000000 ); //igel #elif defined(ALGO_AP325) SH7722_SETREG32( drv, LCDC_MLDMT1R, 0x1800000a ); SH7722_SETREG32( drv, LCDC_MLDHCNR, ((width / 8) << 16) | (1000 / 8) ); SH7722_SETREG32( drv, LCDC_MLDHSYNR, ((8 / 8) << 16) | (960 / 8) ); SH7722_SETREG32( drv, LCDC_MLDVLNR, (height << 16) | 624 ); SH7722_SETREG32( drv, LCDC_MLDVSYNR, (1 << 16) | 560 ); SH7722_SETREG32( drv, LCDC_MLDPMR, 0x00000000 ); #endif SH7722_SETREG32( drv, LCDC_LDINTR, 0x00000000 ); SH7722_SETREG32( drv, LCDC_LDRCNTR, 0x00000000 ); SH7722_SETREG32( drv, LCDC_LDDDSR, swap ? LDDDSR : 0 ); SH7722_SETREG32( drv, LCDC_LDRCR, 0x00000000 ); SH7722_SETREG32( drv, LCDC_LDPALCR, 0x00000000 ); /* enable and start displaying */ SH7722_SETREG32( drv, LCDC_LDCNT1R, 0x00000001 ); SH7722_SETREG32( drv, LCDC_LDCNT2R, 0x00000003 ); SH7722_SETREG32( drv, LCDC_LDDCKSTPR, 0 ); while( SH7722_GETREG32( drv, LCDC_LDDCKSTPR ) & 0x10000 ); /* finally, turn the display on */ { SH7722DriverData *sdrv = drv; if (ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_POWER_DISPLAY ) < 0) D_PERROR( "SH772xGFX_IOCTL_POWER_DISPLAY\n" ); } } DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_lcd.h0000644000175000017500000000071611164361026015316 00000000000000#ifndef __SH7722__LCD_H__ #define __SH7722__LCD_H__ #include "sh7722_types.h" void sh7722_lcd_setup( void *drv, int width, int height, ulong phys, int pitch, DFBSurfacePixelFormat format, bool swap ); #endif DirectFB-1.2.10/gfxdrivers/sh772x/directfbrc.sh77220000644000175000017500000000045211164361026016351 00000000000000 system = devmem video-phys = f800000 # Requires 'mem=120M' kernel option!!!!! video-length = 8388608 # 8MB of physically contiguous memory for acceleration mmio-phys = fd000000 # Start of 2DG register space mmio-length = 65536 # Size of register space accelerator = 11591 # 0x2D47 (2DG) DirectFB-1.2.10/gfxdrivers/sh772x/sh7723_blt.h0000644000175000017500000002000111164361026015323 00000000000000#ifndef __SH7723_BLT_H__ #define __SH7723_BLT_H__ #include #include "sh7722_types.h" #define SH7723_SUPPORTED_DRAWINGFLAGS (DSDRAW_NOFX | DSDRAW_BLEND) #define SH7723_SUPPORTED_DRAWINGFUNCTIONS (DFXL_FILLRECTANGLE | \ DFXL_FILLTRIANGLE | \ DFXL_DRAWLINE | \ DFXL_DRAWRECTANGLE) #define SH7723_SUPPORTED_BLITTINGFLAGS (DSBLIT_BLEND_COLORALPHA | \ DSBLIT_SRC_COLORKEY) #define SH7723_SUPPORTED_BLITTINGFUNCTIONS (DFXL_BLIT) DFBResult sh7723EngineSync ( void *drv, void *dev ); void sh7723EngineReset ( void *drv, void *dev ); void sh7723FlushTextureCache( void *drv, void *dev ); void sh7723EmitCommands ( void *drv, void *dev ); void sh7723CheckState ( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ); void sh7723SetState ( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ); bool sh7723FillRectangle ( void *drv, void *dev, DFBRectangle *rect ); bool sh7723FillTriangle ( void *drv, void *dev, DFBTriangle *triangle ); bool sh7723DrawRectangle ( void *drv, void *dev, DFBRectangle *rect ); bool sh7723DrawLine ( void *drv, void *dev, DFBRegion *line ); bool sh7723Blit ( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); #define SH7723_S16S16(h,l) ((u32)((((u16)(h)) << 16) | ((u16)(l)))) #define SH7723_XY(x,y) SH7723_S16S16(x,y) #define SH7723_TDG_BASE 0xA4680000 //#define BEM_HC_DMA_START (SH7723_TDG_BASE + 0x00044) #define M2DG_SCLR (SH7723_TDG_BASE + 0x000) //#define BEM_HC_DMA_ADR (SH7723_TDG_BASE + 0x00040) #define M2DG_DLSAR (SH7723_TDG_BASE + 0x048) #define M2DG_OPCODE_TRAP 0x00000000 #define M2DG_OPCODE_WPR 0x18000000 #define M2DG_OPCODE_SYNC 0x12000000 #define M2DG_OPCODE_LCOFS 0x40000000 #define M2DG_OPCODE_MOVE 0x48000000 #define M2DG_OPCODE_NOP 0x08000000 #define M2DG_OPCODE_INTERRUPT 0x08008000 #define M2DG_SYNC_TCLR 0x00000010 #define M2DG_OPCODE_POLYGON_4C 0x80000000 #define M2DG_OPCODE_LINE_C 0xB0000000 #define M2DG_OPCODE_BITBLTA 0xA2000100 #define M2DG_OPCODE_BITBLTC 0xA0000000 #define M2DG_DRAWMODE_STRANS 0x00000800 #define M2DG_DRAWMODE_CLIP 0x00002000 #define M2DG_DRAWMODE_ANTIALIAS 0x00000002 #define M2DG_DRAWMODE_ALPHA 0x00000002 #define M2DG_DRAWMODE_SRCDIR_X 0x00000040 #define M2DG_DRAWMODE_SRCDIR_Y 0x00000020 #define M2DG_DRAWMODE_DSTDIR_X 0x00000010 #define M2DG_DRAWMODE_DSTDIR_Y 0x00000008 //ignore and replace #define BEM_WR_CTRL (0x00400) #define BEM_WR_V1 (0x00410) #define BEM_WR_V2 (0x00414) #define BEM_WR_FGC (0x00420) #define BEM_BE_CTRL (0x00800) #define BEM_BE_V1 (0x00810) #define BEM_BE_V2 (0x00814) #define BEM_BE_V3 (0x00818) #define BEM_BE_V4 (0x0081C) #define BEM_BE_COLOR1 (0x00820) #define BEM_BE_SRC_LOC (0x00830) #define BEM_BE_SRC_SIZE (0x00834) #define BEM_BE_MATRIX_A (0x00850) #define BEM_BE_MATRIX_B (0x00854) #define BEM_BE_MATRIX_C (0x00858) #define BEM_BE_MATRIX_D (0x0085C) #define BEM_BE_MATRIX_E (0x00860) #define BEM_BE_MATRIX_F (0x00864) #define BEM_BE_ORIGIN (0x00870) #define BEM_BE_SC_MIN (0x00880) #define BEM_BE_SC_MAX (0x00884) #define BEM_TE_SRC (0x00C00) #define BEM_TE_SRC_BASE (0x00C04) #define BEM_TE_SRC_SIZE (0x00C08) #define BEM_TE_SRC_CNV (0x00C0C) #define BEM_TE_MASK (0x00C10) #define BEM_TE_MASK_BASE (0x00C14) #define BEM_TE_MASK_SIZE (0x00C18) #define BEM_TE_MASK_CNV (0x00C1C) #define BEM_TE_ALPHA (0x00C28) #define BEM_TE_FILTER (0x00C30) #define BEM_TE_INVALID (0x00C40) #define BEM_PE_DST (0x01000) #define BEM_PE_DST_BASE (0x01004) #define BEM_PE_DST_SIZE (0x01008) #define BEM_PE_SC (0x0100C) #define BEM_PE_SC0_MIN (0x01010) #define BEM_PE_SC0_MAX (0x01014) #define BEM_PE_CKEY (0x01040) #define BEM_PE_CKEY_B (0x01044) #define BEM_PE_CKEY_A (0x01048) #define BEM_PE_COLORCHANGE (0x01050) #define BEM_PE_ALPHA (0x01058) #define BEM_PE_COLORCHANGE_0 (0x01060) #define BEM_PE_COLORCHANGE_1 (0x01064) #define BEM_PE_OPERATION (0x01080) #define BEM_PE_FIXEDALPHA (0x01084) #define BEM_PE_OFFSET (0x01088) #define BEM_PE_MASK (0x01094) #define BEM_PE_CACHE (0x010B0) /* * BEM_BE_CTRL */ #define BE_FLIP_NONE 0x00000000 #define BE_FLIP_HORIZONTAL 0x01000000 #define BE_FLIP_VERTICAL 0x02000000 #define BE_FLIP_BOTH 0x03000000 #define BE_CTRL_FIXMODE_20_12 0x00000000 #define BE_CTRL_FIXMODE_16_16 0x00100000 #define BE_CTRL_CLIP 0x00080000 #define BE_CTRL_ORIGIN 0x00040000 #define BE_CTRL_ZOOM 0x00020000 #define BE_CTRL_MATRIX 0x00010000 #define BE_CTRL_SCANMODE_LINE 0x00000000 #define BE_CTRL_SCANMODE_4x4 0x00001000 #define BE_CTRL_SCANMODE_8x4 0x00002000 #define BE_CTRL_BLTDIR_FORWARD 0x00000000 #define BE_CTRL_BLTDIR_BACKWARD 0x00000100 #define BE_CTRL_BLTDIR_AUTOMATIC 0x00000200 #define BE_CTRL_TEXTURE 0x00000020 #define BE_CTRL_QUADRANGLE 0x00000002 #define BE_CTRL_RECTANGLE 0x00000001 /* * BEM_PE_OPERATION */ #define BLE_FUNC_NONE 0x00000000 #define BLE_FUNC_AxB_plus_CxD 0x10000000 #define BLE_FUNC_CxD_minus_AxB 0x20000000 #define BLE_FUNC_AxB_minus_CxD 0x30000000 #define BLE_ROP_XOR 0x01660000 #define BLE_SRCA_FIXED 0x00000000 #define BLE_SRCA_SOURCE_ALPHA 0x00001000 #define BLE_SRCA_ALPHA_CHANNEL 0x00002000 #define BLE_DSTA_FIXED 0x00000000 #define BLE_DSTA_DEST_ALPHA 0x00000100 #define BLE_SRCF_ZERO 0x00000000 #define BLE_SRCF_ONE 0x00000010 #define BLE_SRCF_DST 0x00000020 #define BLE_SRCF_1_DST 0x00000030 #define BLE_SRCF_SRC_A 0x00000040 #define BLE_SRCF_1_SRC_A 0x00000050 #define BLE_SRCF_DST_A 0x00000060 #define BLE_SRCF_1_DST_A 0x00000070 #define BLE_DSTO_DST 0x00000000 #define BLE_DSTO_OFFSET 0x00000008 #define BLE_DSTF_ZERO 0x00000000 #define BLE_DSTF_ONE 0x00000001 #define BLE_DSTF_SRC 0x00000002 #define BLE_DSTF_1_SRC 0x00000003 #define BLE_DSTF_SRC_A 0x00000004 #define BLE_DSTF_1_SRC_A 0x00000005 #define BLE_DSTF_DST_A 0x00000006 #define BLE_DSTF_1_DST_A 0x00000007 /* * BEM_PE_CKEY */ #define CKEY_EXCLUDE_UNUSED 0x00100000 #define CKEY_EXCLUDE_ALPHA 0x00010000 #define CKEY_A_ENABLE 0x00000100 #define CKEY_B_ENABLE 0x00000001 /* * BEM_PE_COLORCHANGE */ #define COLORCHANGE_DISABLE 0x00000000 #define COLORCHANGE_COMPARE_FIRST 0x0000000b #define COLORCHANGE_EXCLUDE_UNUSED 0x00010000 /* * BEM_PE_MASK */ #define PE_MASK_DISABLE 0x00000000 #define PE_MASK_COLOR 0x00000001 #define PE_MASK_ALPHA 0x00000080 /* * BEM_TE_MASK */ #define TE_MASK_DISABLE 0x00000000 #define TE_MASK_ENABLE 0x00010000 /* * BEM_WR_CTRL */ #define WR_CTRL_LINE 0x00000002 #define WR_CTRL_POLYLINE 0x00000003 #define WR_CTRL_ANTIALIAS 0x00020100 #define WR_CTRL_ENDPOINT 0x00001000 #endif DirectFB-1.2.10/gfxdrivers/sh772x/Makefile.kernel0000644000175000017500000000364011164361026016305 00000000000000KERNEL_VERSION ?= $(shell uname -r) KERNEL_MODLIB ?= /lib/modules/$(KERNEL_VERSION) KERNEL_BUILD ?= $(SYSROOT)$(KERNEL_MODLIB)/build KERNEL_SOURCE ?= $(SYSROOT)$(KERNEL_MODLIB)/source ifeq ($(shell test -L $(KERNEL_BUILD) && echo yes),yes) KERNEL_BUILD := $(SYSROOT)$(shell readlink $(KERNEL_BUILD)) endif ifeq ($(shell test -L $(KERNEL_SOURCE) && echo yes),yes) KERNEL_SOURCE := $(SYSROOT)$(shell readlink $(KERNEL_SOURCE)) endif K_VERSION := $(shell echo $(KERNEL_VERSION) | cut -d . -f 1) K_PATCHLEVEL := $(shell echo $(KERNEL_VERSION) | cut -d . -f 2) K_SUBLEVEL := $(shell echo $(KERNEL_VERSION) | cut -d . -f 3 | cut -d '-' -f 1) DESTDIR ?= $(SYSROOT) ifeq ($(DEBUG_2DG),yes) CPPFLAGS += -DSH7722GFX_DEBUG_2DG endif ifeq ($(DEBUG_JPU),yes) CPPFLAGS += -DSH7722GFX_DEBUG_JPU endif ifeq ($(shell test -e $(KERNEL_BUILD)/include/linux/autoconf.h && echo yes),yes) AUTOCONF_H = -include $(KERNEL_BUILD)/include/linux/autoconf.h endif ifeq ($(shell test -e $(KERNEL_BUILD)/include/linux/config.h && echo yes),yes) CPPFLAGS += -DHAVE_LINUX_CONFIG_H endif check-version = $(shell expr \( $(K_VERSION) \* 65536 + $(K_PATCHLEVEL) \* 256 + $(K_SUBLEVEL) \) \>= \( $(1) \* 65536 + $(2) \* 256 + $(3) \)) .PHONY: all install clean all: ifeq ($(call check-version,2,6,24),1) $(MAKE) -C $(KERNEL_BUILD) \ KCPPFLAGS="$(CPPFLAGS) -I`pwd`/kernel-module" \ SUBDIRS="`pwd`/kernel-module" modules else $(MAKE) -C $(KERNEL_BUILD) \ CPPFLAGS="$(CPPFLAGS) -D__KERNEL__ -I`pwd`/kernel-module -I$(KERNEL_BUILD)/include -I$(KERNEL_SOURCE)/include $(AUTOCONF_H)" \ SUBDIRS="`pwd`/kernel-module" modules endif clean: rm -rf kernel-module/*.*o kernel-module/.*.*o* kernel-module/*.mod.c kernel-module/.tmp_versions install: all install -v -m 0755 -d $(DESTDIR)/lib/modules/$(KERNEL_VERSION)/renesas install -v -m 0644 kernel-module/sh772x_gfx.ko $(DESTDIR)/lib/modules/$(KERNEL_VERSION)/renesas/ .PHONY: all clean DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_screen.h0000644000175000017500000000020511164361026016024 00000000000000#ifndef __SH7722__SCREEN_H__ #define __SH7722__SCREEN_H__ #include extern ScreenFuncs sh7722ScreenFuncs; #endif DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_blt.h0000644000175000017500000001657411164361026015346 00000000000000#ifndef __SH7722_BLT_H__ #define __SH7722_BLT_H__ #include #include "sh7722_types.h" #define SH7722_SUPPORTED_DRAWINGFLAGS (DSDRAW_BLEND | \ DSDRAW_XOR) #define SH7722_SUPPORTED_DRAWINGFUNCTIONS (DFXL_FILLRECTANGLE | \ DFXL_FILLTRIANGLE | \ DFXL_DRAWRECTANGLE | \ DFXL_DRAWLINE) #define SH7722_SUPPORTED_BLITTINGFLAGS (DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_BLEND_COLORALPHA | \ DSBLIT_SRC_COLORKEY | \ DSBLIT_ROTATE180 | \ DSBLIT_COLORIZE | \ DSBLIT_XOR | \ DSBLIT_SRC_MASK_ALPHA) #define SH7722_SUPPORTED_BLITTINGFUNCTIONS (DFXL_BLIT | \ DFXL_STRETCHBLIT) DFBResult sh7722EngineSync ( void *drv, void *dev ); void sh7722EngineReset ( void *drv, void *dev ); void sh7722FlushTextureCache( void *drv, void *dev ); void sh7722EmitCommands ( void *drv, void *dev ); void sh7722CheckState ( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ); void sh7722SetState ( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ); bool sh7722FillTriangle ( void *drv, void *dev, DFBTriangle *tri ); bool sh7722Blit ( void *drv, void *dev, DFBRectangle *rect, int x, int y ); bool sh7722StretchBlit ( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); #define SH7722_S16S16(h,l) ((u32)((((u16)(h)) << 16) | ((u16)(l)))) #define SH7722_XY(x,y) SH7722_S16S16(y,x) #define SH7722_TDG_BASE 0xFD000000 #define BEM_HC_DMA_ADR (SH7722_TDG_BASE + 0x00040) #define BEM_HC_DMA_START (SH7722_TDG_BASE + 0x00044) #define BEM_WR_CTRL (0x00400) #define BEM_WR_V1 (0x00410) #define BEM_WR_V2 (0x00414) #define BEM_WR_FGC (0x00420) #define BEM_BE_CTRL (0x00800) #define BEM_BE_V1 (0x00810) #define BEM_BE_V2 (0x00814) #define BEM_BE_V3 (0x00818) #define BEM_BE_V4 (0x0081C) #define BEM_BE_COLOR1 (0x00820) #define BEM_BE_SRC_LOC (0x00830) #define BEM_BE_SRC_SIZE (0x00834) #define BEM_BE_MATRIX_A (0x00850) #define BEM_BE_MATRIX_B (0x00854) #define BEM_BE_MATRIX_C (0x00858) #define BEM_BE_MATRIX_D (0x0085C) #define BEM_BE_MATRIX_E (0x00860) #define BEM_BE_MATRIX_F (0x00864) #define BEM_BE_ORIGIN (0x00870) #define BEM_BE_SC_MIN (0x00880) #define BEM_BE_SC_MAX (0x00884) #define BEM_TE_SRC (0x00C00) #define BEM_TE_SRC_BASE (0x00C04) #define BEM_TE_SRC_SIZE (0x00C08) #define BEM_TE_SRC_CNV (0x00C0C) #define BEM_TE_MASK (0x00C10) #define BEM_TE_MASK_BASE (0x00C14) #define BEM_TE_MASK_SIZE (0x00C18) #define BEM_TE_MASK_CNV (0x00C1C) #define BEM_TE_ALPHA (0x00C28) #define BEM_TE_FILTER (0x00C30) #define BEM_TE_INVALID (0x00C40) #define BEM_PE_DST (0x01000) #define BEM_PE_DST_BASE (0x01004) #define BEM_PE_DST_SIZE (0x01008) #define BEM_PE_SC (0x0100C) #define BEM_PE_SC0_MIN (0x01010) #define BEM_PE_SC0_MAX (0x01014) #define BEM_PE_CKEY (0x01040) #define BEM_PE_CKEY_B (0x01044) #define BEM_PE_CKEY_A (0x01048) #define BEM_PE_COLORCHANGE (0x01050) #define BEM_PE_ALPHA (0x01058) #define BEM_PE_COLORCHANGE_0 (0x01060) #define BEM_PE_COLORCHANGE_1 (0x01064) #define BEM_PE_OPERATION (0x01080) #define BEM_PE_FIXEDALPHA (0x01084) #define BEM_PE_OFFSET (0x01088) #define BEM_PE_MASK (0x01094) #define BEM_PE_CACHE (0x010B0) /* * BEM_BE_CTRL */ #define BE_FLIP_NONE 0x00000000 #define BE_FLIP_HORIZONTAL 0x01000000 #define BE_FLIP_VERTICAL 0x02000000 #define BE_FLIP_BOTH 0x03000000 #define BE_CTRL_FIXMODE_20_12 0x00000000 #define BE_CTRL_FIXMODE_16_16 0x00100000 #define BE_CTRL_CLIP 0x00080000 #define BE_CTRL_ORIGIN 0x00040000 #define BE_CTRL_ZOOM 0x00020000 #define BE_CTRL_MATRIX 0x00010000 #define BE_CTRL_SCANMODE_LINE 0x00000000 #define BE_CTRL_SCANMODE_4x4 0x00001000 #define BE_CTRL_SCANMODE_8x4 0x00002000 #define BE_CTRL_BLTDIR_FORWARD 0x00000000 #define BE_CTRL_BLTDIR_BACKWARD 0x00000100 #define BE_CTRL_BLTDIR_AUTOMATIC 0x00000200 #define BE_CTRL_TEXTURE 0x00000020 #define BE_CTRL_QUADRANGLE 0x00000002 #define BE_CTRL_RECTANGLE 0x00000001 /* * BEM_PE_OPERATION */ #define BLE_FUNC_NONE 0x00000000 #define BLE_FUNC_AxB_plus_CxD 0x10000000 #define BLE_FUNC_CxD_minus_AxB 0x20000000 #define BLE_FUNC_AxB_minus_CxD 0x30000000 #define BLE_ROP_XOR 0x01660000 #define BLE_SRCA_FIXED 0x00000000 #define BLE_SRCA_SOURCE_ALPHA 0x00001000 #define BLE_SRCA_ALPHA_CHANNEL 0x00002000 #define BLE_DSTA_FIXED 0x00000000 #define BLE_DSTA_DEST_ALPHA 0x00000100 #define BLE_SRCF_ZERO 0x00000000 #define BLE_SRCF_ONE 0x00000010 #define BLE_SRCF_DST 0x00000020 #define BLE_SRCF_1_DST 0x00000030 #define BLE_SRCF_SRC_A 0x00000040 #define BLE_SRCF_1_SRC_A 0x00000050 #define BLE_SRCF_DST_A 0x00000060 #define BLE_SRCF_1_DST_A 0x00000070 #define BLE_DSTO_DST 0x00000000 #define BLE_DSTO_OFFSET 0x00000008 #define BLE_DSTF_ZERO 0x00000000 #define BLE_DSTF_ONE 0x00000001 #define BLE_DSTF_SRC 0x00000002 #define BLE_DSTF_1_SRC 0x00000003 #define BLE_DSTF_SRC_A 0x00000004 #define BLE_DSTF_1_SRC_A 0x00000005 #define BLE_DSTF_DST_A 0x00000006 #define BLE_DSTF_1_DST_A 0x00000007 /* * BEM_PE_CKEY */ #define CKEY_EXCLUDE_UNUSED 0x00100000 #define CKEY_EXCLUDE_ALPHA 0x00010000 #define CKEY_A_ENABLE 0x00000100 #define CKEY_B_ENABLE 0x00000001 /* * BEM_PE_COLORCHANGE */ #define COLORCHANGE_DISABLE 0x00000000 #define COLORCHANGE_COMPARE_FIRST 0x0000000b #define COLORCHANGE_EXCLUDE_UNUSED 0x00010000 /* * BEM_PE_MASK */ #define PE_MASK_DISABLE 0x00000000 #define PE_MASK_COLOR 0x00000001 #define PE_MASK_ALPHA 0x00000080 /* * BEM_TE_MASK */ #define TE_MASK_DISABLE 0x00000000 #define TE_MASK_ENABLE 0x00010000 /* * BEM_WR_CTRL */ #define WR_CTRL_LINE 0x00000002 #define WR_CTRL_POLYLINE 0x00000003 #define WR_CTRL_ANTIALIAS 0x00020100 #define WR_CTRL_ENDPOINT 0x00001000 #endif DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_layer.c0000644000175000017500000003573011164361026015667 00000000000000#ifdef SH7722_DEBUG_LAYER #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sh7722.h" #include "sh7722_types.h" #include "sh7722_layer.h" #include "sh7722_lcd.h" D_DEBUG_DOMAIN( SH7722_Layer, "SH7722/Layer", "Renesas SH7722 Layers" ); /**********************************************************************************************************************/ static int sh7722LayerDataSize( void ) { return sizeof(SH7722LayerData); } static int sh7722RegionDataSize( void ) { return sizeof(SH7722RegionData); } static DFBResult sh7722InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722LayerData *data = layer_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); /* initialize layer data */ data->layer = SH7722_LAYER_INPUT1 + sdrv->num_inputs++; /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_ALPHACHANNEL | DLCAPS_OPACITY | DLCAPS_SCREEN_POSITION | DLCAPS_SRC_COLORKEY; description->type = DLTF_STILL_PICTURE | DLTF_GRAPHICS | DLTF_VIDEO; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Input %d", sdrv->num_inputs ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = sdev->lcd_width;; config->height = sdev->lcd_height; config->pixelformat = DSPF_RGB16; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_ALPHACHANNEL; return DFB_OK; } static DFBResult sh7722TestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722LayerData *slay = layer_data; CoreLayerRegionConfigFlags fail = 0; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); if (config->options & ~SH7722_LAYER_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; switch (config->format) { case DSPF_LUT8: /* Indexed only for third input */ if (slay->layer != SH7722_LAYER_INPUT3) fail |= CLRCF_FORMAT; break; case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB24: case DSPF_RGB16: break; case DSPF_NV12: case DSPF_NV16: /* YUV only for first input */ if (slay->layer != SH7722_LAYER_INPUT1) fail |= CLRCF_FORMAT; break; default: fail |= CLRCF_FORMAT; } if (config->width < 32 || config->width > sdev->lcd_width) fail |= CLRCF_WIDTH; if (config->height < 32 || config->height > sdev->lcd_height) fail |= CLRCF_HEIGHT; if (config->dest.x >= sdev->lcd_width || config->dest.y >= sdev->lcd_height) fail |= CLRCF_DEST; if (config->dest.x < 0) { config->dest.x = 0; // FIXME // fail |= CLRCF_DEST; } if (config->dest.y < 0) { config->dest.y = 0; // FIXME // fail |= CLRCF_DEST; } if (failed) *failed = fail; if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult sh7722AddRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config ) { SH7722RegionData *sreg = region_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); sreg->config = *config; D_MAGIC_SET( sreg, SH7722RegionData ); return DFB_OK; } static DFBResult sh7722SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { int i, n; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722RegionData *sreg = region_data; SH7722LayerData *slay = layer_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_MAGIC_ASSERT( sreg, SH7722RegionData ); n = slay->layer - SH7722_LAYER_INPUT1; D_ASSERT( n >= 0 ); D_ASSERT( n <= 2 ); fusion_skirmish_prevail( &sdev->beu_lock ); /* Wait for idle BEU. */ BEU_Wait( sdrv, sdev ); /* Update position? */ if (updated & CLRCF_DEST) { /* Set horizontal and vertical offset. */ SH7722_SETREG32( sdrv, BLOCR(n), (config->dest.y << 16) | config->dest.x ); } /* Update size? */ if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT)) { int cw = config->width; int ch = config->height; if (config->dest.x + cw > sdev->lcd_width) cw = sdev->lcd_width - config->dest.x; if (config->dest.y + ch > sdev->lcd_height) ch = sdev->lcd_height - config->dest.y; /* Set width and height. */ SH7722_SETREG32( sdrv, BSSZR(n), (ch << 16) | cw ); SH7722_SETREG32( sdrv, BTPSR, (ch << 16) | cw ); } /* Update surface? */ if (updated & CLRCF_SURFACE) { CoreSurfaceBuffer *buffer = lock->buffer; /* Set buffer pitch. */ SH7722_SETREG32( sdrv, BSMWR(n), lock->pitch ); /* Set buffer offset (Y plane or RGB packed). */ SH7722_SETREG32( sdrv, BSAYR(n), lock->phys ); /* Set buffer offset (UV plane). */ if (DFB_PLANAR_PIXELFORMAT(buffer->format)) { D_ASSUME( buffer->format == DSPF_NV12 || buffer->format == DSPF_NV16 ); SH7722_SETREG32( sdrv, BSACR(n), lock->phys + lock->pitch * surface->config.size.h ); } sreg->surface = surface; } /* Update format? */ if (updated & CLRCF_FORMAT) { unsigned long tBSIFR = 0; unsigned long tBSWPR = BSWPR_MODSEL_EACH | (SH7722_GETREG32( sdrv, BSWPR ) & ~(7 << (n*8))); /* Set pixel format. */ switch (config->format) { case DSPF_NV12: tBSIFR |= CHRR_YCBCR_420 | BSIFR1_IN1TE_RGBYUV; break; case DSPF_NV16: tBSIFR |= CHRR_YCBCR_422 | BSIFR1_IN1TE_RGBYUV; break; case DSPF_ARGB: tBSIFR |= RPKF_ARGB; break; case DSPF_RGB32: tBSIFR |= RPKF_RGB32; break; case DSPF_RGB24: tBSIFR |= RPKF_RGB24; break; case DSPF_RGB16: tBSIFR |= RPKF_RGB16; break; case DSPF_LUT8: tBSIFR |= BSIFR3_MOD0_OSD | BSIFR3_MOD1_LUT; break; default: break; } #if 0 /* Set swapping. */ switch (config->format) { case DSPF_LUT8: case DSPF_NV12: case DSPF_NV16: tBSWPR |= (BSWPR_INPUT_BYTESWAP | BSWPR_INPUT_WORDSWAP | BSWPR_INPUT_LONGSWAP) << (n*8); break; case DSPF_RGB16: tBSWPR |= (BSWPR_INPUT_WORDSWAP | BSWPR_INPUT_LONGSWAP) << (n*8); break; case DSPF_ARGB: case DSPF_RGB32: case DSPF_RGB24: tBSWPR |= (BSWPR_INPUT_LONGSWAP) << (n*8); break; default: break; } #endif SH7722_SETREG32( sdrv, BSIFR(n), tBSIFR ); SH7722_SETREG32( sdrv, BSWPR, tBSWPR ); } /* Update options or opacity? */ if (updated & (CLRCF_OPTIONS | CLRCF_OPACITY | CLRCF_FORMAT)) { unsigned long tBBLCR0 = BBLCR0_LAY_123; /* Set opacity value. */ tBBLCR0 &= ~(0xff << (n*8)); tBBLCR0 |= ((config->options & CLRCF_OPACITY) ? config->opacity : 0xff) << (n*8); /* Enable/disable alpha channel. */ if ((config->options & DLOP_ALPHACHANNEL) && DFB_PIXELFORMAT_HAS_ALPHA(config->format)) tBBLCR0 |= BBLCR0_AMUX_BLENDPIXEL(n); else tBBLCR0 &= ~BBLCR0_AMUX_BLENDPIXEL(n); SH7722_SETREG32( sdrv, BBLCR0, tBBLCR0 ); } /* Update CLUT? */ if (updated & CLRCF_PALETTE && palette) { const DFBColor *entries = palette->entries; for (i=0; i<256; i++) { SH7722_SETREG32( sdrv, BCLUT(i), PIXEL_ARGB( entries[i].a, entries[i].r, entries[i].g, entries[i].b ) ); } } /* Enable or disable input. */ if ((config->options & DLOP_OPACITY) && !config->opacity) sdev->input_mask &= ~(1 << n); else sdev->input_mask |= (1 << n); /* Choose parent input. */ if (sdev->input_mask) { unsigned long tBBLCR1 = SH7722_GETREG32( sdrv, BBLCR1 ) & ~BBLCR1_PWD_INPUT_MASK; if (sdev->input_mask & 4) tBBLCR1 |= BBLCR1_PWD_INPUT3; else if (sdev->input_mask & 2) tBBLCR1 |= BBLCR1_PWD_INPUT2; else tBBLCR1 |= BBLCR1_PWD_INPUT1; SH7722_SETREG32( sdrv, BBLCR1, tBBLCR1 ); } fusion_skirmish_dismiss( &sdev->beu_lock ); sreg->config = *config; return DFB_OK; } static DFBResult sh7722RemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { int n; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722LayerData *slay = layer_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_ASSERT( sdev != NULL ); D_ASSERT( slay != NULL ); n = slay->layer - SH7722_LAYER_INPUT1; D_ASSERT( n >= 0 ); D_ASSERT( n <= 2 ); fusion_skirmish_prevail( &sdev->beu_lock ); /* Wait for idle BEU. */ BEU_Wait( sdrv, sdev ); sdev->input_mask &= ~(1 << n); /* Choose parent input. */ if (sdev->input_mask) { unsigned long tBBLCR1 = SH7722_GETREG32( sdrv, BBLCR1 ) & ~BBLCR1_PWD_INPUT_MASK; if (sdev->input_mask & 4) tBBLCR1 |= BBLCR1_PWD_INPUT3; else if (sdev->input_mask & 2) tBBLCR1 |= BBLCR1_PWD_INPUT2; else tBBLCR1 |= BBLCR1_PWD_INPUT1; SH7722_SETREG32( sdrv, BBLCR1, tBBLCR1 ); } /* Start operation! */ BEU_Start( sdrv, sdev ); fusion_skirmish_dismiss( &sdev->beu_lock ); return DFB_OK; } static DFBResult sh7722FlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { int n; CoreSurfaceBuffer *buffer; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; SH7722LayerData *slay = layer_data; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_ASSERT( surface != NULL ); D_ASSERT( sdrv != NULL ); D_ASSERT( sdev != NULL ); D_ASSERT( slay != NULL ); n = slay->layer - SH7722_LAYER_INPUT1; D_ASSERT( n >= 0 ); D_ASSERT( n <= 2 ); buffer = lock->buffer; D_ASSERT( buffer != NULL ); fusion_skirmish_prevail( &sdev->beu_lock ); /* Set buffer offset (Y plane or RGB packed). */ SH7722_SETREG32( sdrv, BSAYR(n), lock->phys ); /* Set buffer offset (UV plane). */ if (DFB_PLANAR_PIXELFORMAT(buffer->format)) { D_ASSUME( buffer->format == DSPF_NV12 || buffer->format == DSPF_NV16 ); SH7722_SETREG32( sdrv, BSACR(n), lock->phys + lock->pitch * surface->config.size.h ); } /* Start operation! */ BEU_Start( sdrv, sdev ); fusion_skirmish_dismiss( &sdev->beu_lock ); /* Wait for idle BEU? */ if (flags & DSFLIP_WAIT) BEU_Wait( sdrv, sdev ); dfb_surface_flip( surface, false ); return DFB_OK; } static DFBResult sh7722UpdateRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, const DFBRegion *update, CoreSurfaceBufferLock *lock ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; D_DEBUG_AT( SH7722_Layer, "%s()\n", __FUNCTION__ ); D_ASSERT( surface != NULL ); D_ASSERT( sdrv != NULL ); D_ASSERT( sdev != NULL ); /* Start operation! */ BEU_Start( sdrv, sdev ); if (!(surface->config.caps & DSCAPS_FLIPPING)) BEU_Wait( sdrv, sdev ); return DFB_OK; } DisplayLayerFuncs sh7722LayerFuncs = { .LayerDataSize = sh7722LayerDataSize, .RegionDataSize = sh7722RegionDataSize, .InitLayer = sh7722InitLayer, .TestRegion = sh7722TestRegion, .AddRegion = sh7722AddRegion, .SetRegion = sh7722SetRegion, .RemoveRegion = sh7722RemoveRegion, .FlipRegion = sh7722FlipRegion, .UpdateRegion = sh7722UpdateRegion, }; DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_jpegtool.c0000644000175000017500000000613011164361026016366 00000000000000#ifdef SH7722_DEBUG_JPEG #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include #include #include #include #ifdef STANDALONE #include "sh7722_jpeglib_standalone.h" #else #include #include #include #include #include #include #include #include #include #endif #include "sh7722_jpeglib.h" void write_ppm( const char *filename, unsigned long phys, int pitch, unsigned int width, unsigned int height ) { int i; int fd; int size; void *mem; FILE *file; size = direct_page_align( pitch * height ); fd = open( "/dev/mem", O_RDWR ); if (fd < 0) { D_PERROR( "SH7722/JPEG: Could not open /dev/mem!\n" ); return; } mem = mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, phys ); if (mem == MAP_FAILED) { D_PERROR( "SH7722/JPEG: Could not map /dev/mem at 0x%08lx (length %d)!\n", phys, size ); close( fd ); return; } close( fd ); file = fopen( filename, "wb" ); if (!file) { D_PERROR( "SH7722/JPEG: Could not open '%s' for writing!\n", filename ); munmap( mem, size ); return; } fprintf( file, "P6\n%d %d\n255\n", width, height ); for (i=0; i\n", argv[0] ); return -1; } #ifndef STANDALONE direct_initialize(); direct_config->debug = true; #endif ret = SH7722_JPEG_Initialize(); if (ret) return ret; ret = direct_stream_create( argv[1], &stream ); if (ret) goto out; ret = SH7722_JPEG_Open( stream, &info ); if (ret) goto out; D_INFO( "SH7722/JPEGTool: Opened %dx%d image (4:%s)\n", info.width, info.height, info.mode420 ? "2:0" : info.mode444 ? "4:4" : "2:2?" ); format = DSPF_RGB24;// info.mode444 ? DSPF_NV16 : DSPF_NV12; pitch = (DFB_BYTES_PER_LINE( format, info.width ) + 31) & ~31; ret = SH7722_JPEG_Decode( &info, NULL, NULL, format, 0x0f800000, NULL, pitch, info.width, info.height ); if (ret) goto out; // Use RGB24 format for this // write_ppm( "test.ppm", 0x0f800000, pitch, info.width, info.height ); ret = SH7722_JPEG_Encode( "test.jpg", NULL, format, 0x0f800000, pitch, info.width, info.height, 0 ); if (ret) goto out; out: if (stream) direct_stream_destroy( stream ); SH7722_JPEG_Shutdown(); return ret; } DirectFB-1.2.10/gfxdrivers/sh772x/sh7722.h0000644000175000017500000000653011164361026014474 00000000000000#ifndef __SH7722__SH7722_H__ #define __SH7722__SH7722_H__ #include #include #include "sh7722_regs.h" #include "sh7722_types.h" #define SH772X_FBDEV_SUPPORT // #define JPU_SUPPORT /****************************************************************************** * Platform specific values (FIXME: add runtime config) */ #define ALGO_AP325 #undef SH7722_ALGO_PANEL /* LCD Panel Configuration */ #if defined(SH7722_ALGO_PANEL) # define SH7722_LCD_WIDTH 640 # define SH7722_LCD_HEIGHT 480 #elif defined(ALGO_AP325) # define SH7722_LCD_WIDTH 800 # define SH7722_LCD_HEIGHT 480 #else # define SH7722_LCD_WIDTH 800 # define SH7722_LCD_HEIGHT 480 #endif /****************************************************************************** * Register access */ //#define SH7722_TDG_REG_USE_IOCTLS #ifdef SH7722_TDG_REG_USE_IOCTLS static inline u32 SH7722_TDG_GETREG32( SH7722DriverData *sdrv, u32 address ) { SH772xRegister reg = { address, 0 }; if (ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_GETREG32, ® ) < 0) D_PERROR( "SH772xGFX_IOCTL_GETREG32( 0x%08x )\n", reg.address ); return reg.value; } static inline void SH7722_TDG_SETREG32( SH7722DriverData *sdrv, u32 address, u32 value ) { SH772xRegister reg = { address, value }; if (ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_SETREG32, ® ) < 0) D_PERROR( "SH772xGFX_IOCTL_SETREG32( 0x%08x, 0x%08x )\n", reg.address, reg.value ); } #else static inline u32 SH7722_TDG_GETREG32( SH7722DriverData *sdrv, u32 address ) { D_ASSERT( address >= dfb_config->mmio_phys ); D_ASSERT( address < (dfb_config->mmio_phys + dfb_config->mmio_length) ); return *(volatile u32*)(sdrv->mmio_base + (address - dfb_config->mmio_phys)); } static inline void SH7722_TDG_SETREG32( SH7722DriverData *sdrv, u32 address, u32 value ) { D_ASSERT( address >= dfb_config->mmio_phys ); D_ASSERT( address < (dfb_config->mmio_phys + dfb_config->mmio_length) ); *(volatile u32*)(sdrv->mmio_base + (address - dfb_config->mmio_phys)) = value; } #endif static inline u32 SH7722_GETREG32( SH7722DriverData *sdrv, u32 address ) { SH772xRegister reg = { address, 0 }; if (ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_GETREG32, ® ) < 0) D_PERROR( "SH772xGFX_IOCTL_GETREG32( 0x%08x )\n", reg.address ); return reg.value; } static inline void SH7722_SETREG32( SH7722DriverData *sdrv, u32 address, u32 value ) { SH772xRegister reg = { address, value }; if (ioctl( sdrv->gfx_fd, SH772xGFX_IOCTL_SETREG32, ® ) < 0) D_PERROR( "SH772xGFX_IOCTL_SETREG32( 0x%08x, 0x%08x )\n", reg.address, reg.value ); } static inline void BEU_Start( SH7722DriverData *sdrv, SH7722DeviceData *sdev ) { /* Wait for idle BEU. */ while (SH7722_GETREG32( sdrv, BSTAR ) & 1); /* Start operation! */ SH7722_SETREG32( sdrv, BESTR, (sdev->input_mask << 8) | 1 ); } static inline void BEU_Wait( SH7722DriverData *sdrv, SH7722DeviceData *sdev ) { /* Wait for idle BEU. */ while (SH7722_GETREG32( sdrv, BSTAR ) & 1); } #endif DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_layer.h0000644000175000017500000000035011164361026015662 00000000000000#ifndef __SH7722__LAYER_H__ #define __SH7722__LAYER_H__ #include "sh7722_types.h" #define SH7722_LAYER_SUPPORTED_OPTIONS (DLOP_ALPHACHANNEL | DLOP_OPACITY | DLOP_SRC_COLORKEY) extern DisplayLayerFuncs sh7722LayerFuncs; #endif DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_screen.c0000644000175000017500000000366311164361026016032 00000000000000#ifdef SH7722_DEBUG_SCREEN #define DIRECT_ENABLE_DEBUG #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sh7722.h" #include "sh7722_screen.h" D_DEBUG_DOMAIN( SH7722_Screen, "SH7722/Screen", "Renesas SH7722 Screen" ); /**********************************************************************************************************************/ static DFBResult sh7722InitScreen( CoreScreen *screen, CoreGraphicsDevice *device, void *driver_data, void *screen_data, DFBScreenDescription *description ) { D_DEBUG_AT( SH7722_Screen, "%s()\n", __FUNCTION__ ); /* Set the screen capabilities. */ description->caps = DSCCAPS_NONE; /* Set the screen name. */ snprintf( description->name, DFB_SCREEN_DESC_NAME_LENGTH, "SH7722 Screen" ); return DFB_OK; } static DFBResult sh7722GetScreenSize( CoreScreen *screen, void *driver_data, void *screen_data, int *ret_width, int *ret_height ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = sdrv->dev; D_DEBUG_AT( SH7722_Screen, "%s()\n", __FUNCTION__ ); D_ASSERT( ret_width != NULL ); D_ASSERT( ret_height != NULL ); *ret_width = sdev->lcd_width; *ret_height = sdev->lcd_height; return DFB_OK; } ScreenFuncs sh7722ScreenFuncs = { .InitScreen = sh7722InitScreen, .GetScreenSize = sh7722GetScreenSize, }; DirectFB-1.2.10/gfxdrivers/sh772x/sh7722_jpeglib.h0000644000175000017500000000340511164361026016166 00000000000000#ifndef __SH7722__SH7722_JPEGLIB_H__ #define __SH7722__SH7722_JPEGLIB_H__ #include typedef struct { DirectStream *stream; int width; int height; bool mode420; bool mode444; struct jpeg_decompress_struct cinfo; } SH7722_JPEG_context; DirectResult SH7722_JPEG_Initialize( void ); DirectResult SH7722_JPEG_Shutdown( void ); DirectResult SH7722_JPEG_Open ( DirectStream *stream, SH7722_JPEG_context *context ); DirectResult SH7722_JPEG_Decode( SH7722_JPEG_context *context, const DFBRectangle *rect, const DFBRegion *clip, DFBSurfacePixelFormat format, unsigned long phys, void *addr, int pitch, unsigned int width, unsigned int height ); DirectResult SH7722_JPEG_Close ( SH7722_JPEG_context *context ); DirectResult SH7722_JPEG_Encode( const char *filename, const DFBRectangle *srcrect, DFBSurfacePixelFormat srcformat, unsigned long srcphys, int srcpitch, unsigned int width, unsigned int height, unsigned int tmpphys ); #endif DirectFB-1.2.10/gfxdrivers/sh772x/sh7722.c0000644000175000017500000004037711164361026014476 00000000000000#ifdef SH7722_DEBUG_DRIVER #define DIRECT_ENABLE_DEBUG #endif #include #include #undef HAVE_STDLIB_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( sh7722 ) #include "sh7722.h" #include "sh7722_blt.h" #include "sh7722_jpeglib.h" #include "sh7722_layer.h" #include "sh7722_lcd.h" #include "sh7722_multi.h" #include "sh7722_screen.h" #include "sh7723_blt.h" #ifdef SH772X_FBDEV_SUPPORT #include #include #endif D_DEBUG_DOMAIN( SH7722_Driver, "SH7722/Driver", "Renesas SH7722 Driver" ); /**********************************************************************************************************************/ static int driver_probe( CoreGraphicsDevice *device ) { D_DEBUG_AT( SH7722_Driver, "%s()\n", __FUNCTION__ ); return dfb_gfxcard_get_accelerator( device ) == 0x2D47; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { D_DEBUG_AT( SH7722_Driver, "%s()\n", __FUNCTION__ ); /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "Renesas SH772x Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Denis & Janine Kropp" ); info->version.major = 0; info->version.minor = 9; info->driver_data_size = sizeof(SH7722DriverData); info->device_data_size = sizeof(SH7722DeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { DFBResult ret; SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = device_data; D_DEBUG_AT( SH7722_Driver, "%s()\n", __FUNCTION__ ); /* Keep pointer to shared device data. */ sdrv->dev = device_data; /* Keep core and device pointer. */ sdrv->core = core; sdrv->device = device; /* Open the drawing engine device. */ sdrv->gfx_fd = direct_try_open( "/dev/sh772x_gfx", "/dev/misc/sh772x_gfx", O_RDWR, true ); if (sdrv->gfx_fd < 0) return DFB_INIT; /* Map its shared data. */ sdrv->gfx_shared = mmap( NULL, direct_page_align( sizeof(SH772xGfxSharedArea) ), PROT_READ | PROT_WRITE, MAP_SHARED, sdrv->gfx_fd, 0 ); if (sdrv->gfx_shared == MAP_FAILED) { D_PERROR( "SH7722/Driver: Could not map shared area!\n" ); close( sdrv->gfx_fd ); return DFB_INIT; } sdrv->mmio_base = dfb_gfxcard_map_mmio( device, 0, -1 ); if (!sdrv->mmio_base) { D_PERROR( "SH7722/Driver: Could not map MMIO area!\n" ); munmap( (void*) sdrv->gfx_shared, direct_page_align( sizeof(SH772xGfxSharedArea) ) ); close( sdrv->gfx_fd ); return DFB_INIT; } /* Check the magic value. */ switch (sdrv->gfx_shared->magic) { case SH7722GFX_SHARED_MAGIC: sdev->sh772x = 7722; /* Initialize function table. */ funcs->EngineReset = sh7722EngineReset; funcs->EngineSync = sh7722EngineSync; funcs->EmitCommands = sh7722EmitCommands; funcs->CheckState = sh7722CheckState; funcs->SetState = sh7722SetState; funcs->FillTriangle = sh7722FillTriangle; funcs->Blit = sh7722Blit; funcs->StretchBlit = sh7722StretchBlit; funcs->FlushTextureCache = sh7722FlushTextureCache; /* Initialize JPEG library. */ ret = SH7722_JPEG_Initialize(); if (ret) { D_DERROR( ret, "SH7722/Driver: JPEG initialization failed!\n" ); dfb_gfxcard_unmap_mmio( device, sdrv->mmio_base, -1 ); munmap( (void*) sdrv->gfx_shared, direct_page_align( sizeof(SH772xGfxSharedArea) ) ); close( sdrv->gfx_fd ); return DFB_INIT; } break; case SH7723GFX_SHARED_MAGIC: sdev->sh772x = 7723; /* Initialize function table. */ funcs->EngineReset = sh7723EngineReset; funcs->EngineSync = sh7723EngineSync; funcs->EmitCommands = sh7723EmitCommands; funcs->CheckState = sh7723CheckState; funcs->SetState = sh7723SetState; funcs->FillRectangle = sh7723FillRectangle; funcs->FillTriangle = sh7723FillTriangle; funcs->DrawRectangle = sh7723DrawRectangle; funcs->DrawLine = sh7723DrawLine; funcs->Blit = sh7723Blit; break; default: D_ERROR( "SH772x/Driver: Magic value 0x%08x doesn't match 0x%08x or 0x%08x!\n", sdrv->gfx_shared->magic, SH7722GFX_SHARED_MAGIC, SH7723GFX_SHARED_MAGIC ); dfb_gfxcard_unmap_mmio( device, sdrv->mmio_base, -1 ); munmap( (void*) sdrv->gfx_shared, direct_page_align( sizeof(SH772xGfxSharedArea) ) ); close( sdrv->gfx_fd ); return DFB_INIT; } /* Get virtual address for the LCD buffer in slaves here, master does it in driver_init_device(). */ #ifndef SH772X_FBDEV_SUPPORT if (!dfb_core_is_master( core )) sdrv->lcd_virt = dfb_gfxcard_memory_virtual( device, sdev->lcd_offset ); #endif /* Register primary screen. */ sdrv->screen = dfb_screens_register( device, driver_data, &sh7722ScreenFuncs ); /* Register three input system layers. */ sdrv->input1 = dfb_layers_register( sdrv->screen, driver_data, &sh7722LayerFuncs ); sdrv->input2 = dfb_layers_register( sdrv->screen, driver_data, &sh7722LayerFuncs ); sdrv->input3 = dfb_layers_register( sdrv->screen, driver_data, &sh7722LayerFuncs ); /* Register multi window layer. */ sdrv->multi = dfb_layers_register( sdrv->screen, driver_data, &sh7722MultiLayerFuncs ); return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { SH7722DriverData *sdrv = driver_data; SH7722DeviceData *sdev = device_data; D_DEBUG_AT( SH7722_Driver, "%s()\n", __FUNCTION__ ); /* FIXME: Add a runtime option / config file. */ sdev->lcd_format = DSPF_RGB16; /* Check format of LCD buffer. */ switch (sdev->lcd_format) { case DSPF_RGB16: case DSPF_NV16: break; default: return DFB_UNSUPPORTED; } if (sdev->sh772x == 7723) memset( dfb_gfxcard_memory_virtual(device,0), 0, dfb_gfxcard_memory_length() ); /* * Setup LCD buffer. */ #ifdef SH772X_FBDEV_SUPPORT { struct fb_fix_screeninfo fsi; struct fb_var_screeninfo vsi; int fbdev; if ((fbdev = open("/dev/fb", O_RDONLY)) < 0) { D_ERROR( "SH7722/Driver: Can't open fbdev to get LCDC info!\n" ); return DFB_FAILURE; } if (ioctl(fbdev, FBIOGET_FSCREENINFO, &fsi) < 0) { D_ERROR( "SH7722/Driver: FBIOGET_FSCREEINFO failed.\n" ); close(fbdev); return DFB_FAILURE; } if (ioctl(fbdev, FBIOGET_VSCREENINFO, &vsi) < 0) { D_ERROR( "SH7722/Driver: FBIOGET_VSCREEINFO failed.\n" ); close(fbdev); return DFB_FAILURE; } sdev->lcd_width = vsi.xres; sdev->lcd_height = vsi.yres; sdev->lcd_pitch = fsi.line_length; sdev->lcd_size = fsi.smem_len; sdev->lcd_offset = 0; sdev->lcd_phys = fsi.smem_start; #if 0 sdrv->lcd_virt = mmap(NULL, fsi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fbdev, 0); if (sdrv->lcd_virt == MAP_FAILED) { D_PERROR( "SH7722/Driver: mapping fbdev failed.\n" ); close(fbdev); return DFB_FAILURE; } /* Clear LCD buffer. */ switch (sdev->lcd_format) { case DSPF_RGB16: memset( (void*) sdrv->lcd_virt, 0x00, sdev->lcd_height * sdev->lcd_pitch ); break; case DSPF_NV16: memset( (void*) sdrv->lcd_virt, 0x10, sdev->lcd_height * sdev->lcd_pitch ); memset( (void*) sdrv->lcd_virt + sdev->lcd_height * sdev->lcd_pitch, 0x80, sdev->lcd_height * sdev->lcd_pitch ); break; default: D_BUG( "unsupported format" ); return DFB_BUG; } #endif close(fbdev); } #else sdev->lcd_width = SH7722_LCD_WIDTH; sdev->lcd_height = SH7722_LCD_HEIGHT; sdev->lcd_pitch = (DFB_BYTES_PER_LINE( sdev->lcd_format, sdev->lcd_width ) + 0xf) & ~0xf; sdev->lcd_size = DFB_PLANE_MULTIPLY( sdev->lcd_format, sdev->lcd_height ) * sdev->lcd_pitch; sdev->lcd_offset = dfb_gfxcard_reserve_memory( device, sdev->lcd_size ); if (sdev->lcd_offset < 0) { D_ERROR( "SH7722/Driver: Allocating %d bytes for the LCD buffer failed!\n", sdev->lcd_size ); return DFB_FAILURE; } sdev->lcd_phys = dfb_gfxcard_memory_physical( device, sdev->lcd_offset ); /* Get virtual addresses for LCD buffer in master here, slaves do it in driver_init_driver(). */ sdrv->lcd_virt = dfb_gfxcard_memory_virtual( device, sdev->lcd_offset ); #endif D_INFO( "SH7722/LCD: Allocated %dx%d %s Buffer (%d bytes) at 0x%08lx (%p)\n", sdev->lcd_width, sdev->lcd_height, dfb_pixelformat_name(sdev->lcd_format), sdev->lcd_size, sdev->lcd_phys, sdrv->lcd_virt ); D_ASSERT( ! (sdev->lcd_pitch & 0xf) ); D_ASSERT( ! (sdev->lcd_phys & 0xf) ); /* * Initialize hardware. */ switch (sdev->sh772x) { case 7722: /* Reset the drawing engine. */ sh7722EngineReset( sdrv, sdev ); /* Fill in the device info. */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "SH7722" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "Renesas" ); /* Set device limitations. */ device_info->limits.surface_byteoffset_alignment = 16; device_info->limits.surface_bytepitch_alignment = 8; /* Set device capabilities. */ device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS; device_info->caps.accel = SH7722_SUPPORTED_DRAWINGFUNCTIONS | SH7722_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = SH7722_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = SH7722_SUPPORTED_BLITTINGFLAGS; /* Change font format for acceleration. */ if (!dfb_config->software_only) { dfb_config->font_format = DSPF_ARGB; dfb_config->font_premult = false; } break; case 7723: /* Reset the drawing engine. */ sh7723EngineReset( sdrv, sdev ); /* Fill in the device info. */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "SH7723" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "Renesas" ); /* Set device limitations. */ device_info->limits.surface_byteoffset_alignment = 512; device_info->limits.surface_bytepitch_alignment = 64; /* Set device capabilities. */ device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS; device_info->caps.accel = SH7723_SUPPORTED_DRAWINGFUNCTIONS | \ SH7723_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = SH7723_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = SH7723_SUPPORTED_BLITTINGFLAGS; break; default: D_BUG( "unexpected device" ); return DFB_BUG; } /* Wait for idle BEU. */ while (SH7722_GETREG32( sdrv, BSTAR ) & 1); /* Disable all inputs. */ SH7722_SETREG32( sdrv, BESTR, 0 ); /* Disable all multi windows. */ SH7722_SETREG32( sdrv, BMWCR0, SH7722_GETREG32( sdrv, BMWCR0 ) & ~0xf ); #ifndef SH772X_FBDEV_SUPPORT /* Clear LCD buffer. */ switch (sdev->lcd_format) { case DSPF_RGB16: memset( (void*) sdrv->lcd_virt, 0x00, sdev->lcd_height * sdev->lcd_pitch ); break; case DSPF_NV16: memset( (void*) sdrv->lcd_virt, 0x10, sdev->lcd_height * sdev->lcd_pitch ); memset( (void*) sdrv->lcd_virt + sdev->lcd_height * sdev->lcd_pitch, 0x80, sdev->lcd_height * sdev->lcd_pitch ); break; default: D_BUG( "unsupported format" ); return DFB_BUG; } #endif /* * TODO: Make LCD Buffer format and primary BEU format runtime configurable. */ /* Set output pixel format of the BEU. */ switch (sdev->lcd_format) { case DSPF_RGB16: SH7722_SETREG32( sdrv, BPKFR, BPKFR_RY_RGB | WPCK_RGB16 ); break; case DSPF_NV16: SH7722_SETREG32( sdrv, BPKFR, BPKFR_RY_RGB | BPKFR_TE_ENABLED | CHDS_YCBCR422 ); SH7722_SETREG32( sdrv, BDACR, sdev->lcd_phys + sdev->lcd_height * sdev->lcd_pitch ); break; default: D_BUG( "unsupported format" ); return DFB_BUG; } SH7722_SETREG32( sdrv, BPROCR, 0x00000000 ); /* Have BEU render into LCD buffer. */ SH7722_SETREG32( sdrv, BBLCR1, MT_MEMORY ); SH7722_SETREG32( sdrv, BDAYR, sdev->lcd_phys & 0xfffffffc ); SH7722_SETREG32( sdrv, BDMWR, sdev->lcd_pitch & 0x0003fffc ); #ifndef SH772X_FBDEV_SUPPORT /* Setup LCD controller to show the buffer. */ sh7722_lcd_setup( sdrv, sdev->lcd_width, sdev->lcd_height, sdev->lcd_phys, sdev->lcd_pitch, sdev->lcd_format, false ); #endif /* Initialize BEU lock. */ fusion_skirmish_init( &sdev->beu_lock, "BEU", dfb_core_world(sdrv->core) ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { SH7722DeviceData *sdev = device_data; D_DEBUG_AT( SH7722_Driver, "%s()\n", __FUNCTION__ ); /* Destroy BEU lock. */ fusion_skirmish_destroy( &sdev->beu_lock ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { SH7722DriverData *sdrv = driver_data; SH772xGfxSharedArea *shared = sdrv->gfx_shared; (void) shared; D_DEBUG_AT( SH7722_Driver, "%s()\n", __FUNCTION__ ); D_INFO( "SH7722/BLT: %u starts, %u done, %u interrupts, %u wait_idle, %u wait_next, %u idle\n", shared->num_starts, shared->num_done, shared->num_interrupts, shared->num_wait_idle, shared->num_wait_next, shared->num_idle ); D_INFO( "SH7722/BLT: %u words, %u words/start, %u words/idle, %u starts/idle\n", shared->num_words, shared->num_words / shared->num_starts, shared->num_words / shared->num_idle, shared->num_starts / shared->num_idle ); /* Shutdown JPEG library. */ SH7722_JPEG_Shutdown(); /* Unmap shared area. */ munmap( (void*) sdrv->gfx_shared, direct_page_align( sizeof(SH772xGfxSharedArea) ) ); /* Close Drawing Engine device. */ close( sdrv->gfx_fd ); } DirectFB-1.2.10/gfxdrivers/ati128/0000777000175000017500000000000011307522570013417 500000000000000DirectFB-1.2.10/gfxdrivers/ati128/ati128_state.c0000644000175000017500000002551311245562152015716 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "ati128.h" #include "ati128_state.h" static u32 ati128SourceBlend[] = { SCALE_3D_CNTL_ALPHA_BLEND_SRC_ZERO, /* DSBF_ZERO */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_ONE, /* DSBF_ONE */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_SRCCOLOR, /* DSBF_SRCCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVSRCCOLOR, /* DSBF_INVSRCCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_SRCALPHA, /* DSBF_SRCALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVSRCALPHA, /* DSBF_INVSRCALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_DSTALPHA, /* DSBF_DESTALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVDSTALPHA, /* DSBF_INVDESTALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_DSTCOLOR, /* DSBF_DESTCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVDSTCOLOR, /* DSBF_INVDESTCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_SRC_SAT /* DSBF_SRCALPHASAT */ }; static u32 ati128DestBlend[] = { SCALE_3D_CNTL_ALPHA_BLEND_DST_ZERO, /* DSBF_ZERO */ SCALE_3D_CNTL_ALPHA_BLEND_DST_ONE, /* DSBF_ONE */ SCALE_3D_CNTL_ALPHA_BLEND_DST_SRCCOLOR, /* DSBF_SRCCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_DST_INVSRCCOLOR, /* DSBF_INVSRCCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_DST_SRCALPHA, /* DSBF_SRCALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_DST_INVSRCALPHA, /* DSBF_INVSRCALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_DST_DSTALPHA, /* DSBF_DESTALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_DST_INVDSTALPHA, /* DSBF_INVDESTALPHA */ SCALE_3D_CNTL_ALPHA_BLEND_DST_DSTCOLOR, /* DSBF_DESTCOLOR */ SCALE_3D_CNTL_ALPHA_BLEND_DST_INVDSTCOLOR, /* DSBF_INVDESTCOLOR */ 0 /* DSBF_SRCALPHASAT */ }; void ati128_set_destination( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { CoreSurface *destination = state->destination; if (adev->v_destination) return; ati128_waitfifo( adrv, adev, 1 ); switch (destination->config.format) { case DSPF_RGB332: ati128_out32( adrv->mmio_base, DST_PITCH_OFFSET, ((state->dst.pitch >> 3) << 21) | (state->dst.offset >> 5)); adev->ATI_dst_bpp = DST_8BPP_RGB332; break; case DSPF_ARGB1555: ati128_out32( adrv->mmio_base, DST_PITCH_OFFSET, ((state->dst.pitch >> 4) << 21) | (state->dst.offset >> 5)); adev->ATI_dst_bpp = DST_15BPP; break; case DSPF_RGB16: ati128_out32( adrv->mmio_base, DST_PITCH_OFFSET, ((state->dst.pitch >> 4) << 21) | (state->dst.offset >> 5)); adev->ATI_dst_bpp = DST_16BPP; break; case DSPF_RGB24: ati128_out32( adrv->mmio_base, DST_PITCH_OFFSET, ((state->dst.pitch >> 3) << 21) | (state->dst.offset >> 5)); adev->ATI_dst_bpp = DST_24BPP; break; case DSPF_RGB32: case DSPF_ARGB: ati128_out32( adrv->mmio_base, DST_PITCH_OFFSET, ((state->dst.pitch >> 5) << 21) | (state->dst.offset >> 5)); adev->ATI_dst_bpp = DST_32BPP; break; default: D_BUG( "unexpected pixelformat!" ); break; } adev->destination = destination; adev->v_destination = 1; } void ati128_set_source( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { if (adev->v_source) return; ati128_waitfifo( adrv, adev, 3 ); switch (state->source->config.format) { case DSPF_RGB332: ati128_out32( adrv->mmio_base, SRC_PITCH, state->src.pitch >> 3); ati128_out32( adrv->mmio_base, CLR_CMP_MASK, 0x000000FF ); break; case DSPF_ARGB1555: ati128_out32( adrv->mmio_base, SRC_PITCH, state->src.pitch >> 4); ati128_out32( adrv->mmio_base, CLR_CMP_MASK, 0x00007FFF ); break; case DSPF_RGB16: ati128_out32( adrv->mmio_base, SRC_PITCH, state->src.pitch >> 4); ati128_out32( adrv->mmio_base, CLR_CMP_MASK, 0x0000FFFF ); break; case DSPF_RGB24: ati128_out32( adrv->mmio_base, SRC_PITCH, state->src.pitch >> 3); ati128_out32( adrv->mmio_base, CLR_CMP_MASK, 0x00FFFFFF ); break; case DSPF_RGB32: case DSPF_ARGB: ati128_out32( adrv->mmio_base, SRC_PITCH, state->src.pitch >> 5); ati128_out32( adrv->mmio_base, CLR_CMP_MASK, 0x00FFFFFF ); break; default: D_BUG( "unexpected pixelformat!" ); break; } ati128_out32( adrv->mmio_base, SRC_OFFSET, state->src.offset ); adev->source = state->source; adev->src = &state->src; adev->v_source = 1; } void ati128_set_clip( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { ati128_waitfifo( adrv, adev, 2 ); /* 24bpp needs special treatment */ if (state->destination->config.format == DSPF_RGB24) { ati128_out32( adrv->mmio_base, SC_TOP_LEFT, (state->clip.y1 << 16) | (state->clip.x1*3) ); ati128_out32( adrv->mmio_base, SC_BOTTOM_RIGHT, (state->clip.y2 << 16) | ((state->clip.x2*3) + 3)); } else { ati128_out32( adrv->mmio_base, SC_TOP_LEFT, (state->clip.y1 << 16) | state->clip.x1 ); ati128_out32( adrv->mmio_base, SC_BOTTOM_RIGHT, (state->clip.y2 << 16) | state->clip.x2 ); } } void ati128_set_color( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { u32 fill_color = 0; if (adev->v_color) return; switch (state->destination->config.format) { case DSPF_RGB332: fill_color = PIXEL_RGB332( state->color.r, state->color.g, state->color.b ); break; case DSPF_ARGB1555: fill_color = PIXEL_ARGB1555( state->color.a, state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB16: fill_color = PIXEL_RGB16( state->color.r, state->color.g, state->color.b ); break; case DSPF_RGB24: case DSPF_RGB32: fill_color = PIXEL_RGB32( state->color.r, state->color.g, state->color.b ); break; case DSPF_ARGB: fill_color = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); break; default: D_BUG( "unexpected pixelformat!" ); break; } ati128_waitfifo( adrv, adev, 1 ); ati128_out32( adrv->mmio_base, DP_BRUSH_FRGD_CLR, fill_color); adev->fake_texture_color = PIXEL_ARGB( state->color.a, state->color.r, state->color.g, state->color.b ); adev->v_color = 1; } void ati128_set_src_colorkey( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { if (adev->v_src_colorkey) return; ati128_waitfifo( adrv, adev, 1 ); ati128_out32( adrv->mmio_base, CLR_CMP_CLR_SRC, state->src_colorkey ); adev->v_src_colorkey = 1; } void ati128_set_blittingflags( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { if (adev->v_blittingflags) return; if (state->blittingflags & DSBLIT_SRC_COLORKEY) { adev->ATI_color_compare = (1 << 24) | 5; } else { adev->ATI_color_compare = 0; } adev->blittingflags = state->blittingflags; adev->v_blittingflags = 1; } void ati128_set_blending_function( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ) { if (adev->v_blending_function) return; adev->ATI_blend_function = SCALE_3D_CNTL_SCALE_3D_FN_SCALE | ati128SourceBlend[state->src_blend - 1] | ati128DestBlend [state->dst_blend - 1] | SCALE_3D_CNTL_TEX_MAP_AEN_ON; adev->v_blending_function = 1; } DirectFB-1.2.10/gfxdrivers/ati128/Makefile.am0000644000175000017500000000136411245562152015374 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/ati128 INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src ati128dir = $(MODULEDIR)/gfxdrivers ati128_LTLIBRARIES = libdirectfb_ati128.la if BUILD_STATIC ati128_DATA = $(ati128_LTLIBRARIES:.la=.o) endif libdirectfb_ati128_la_SOURCES = \ ati128.c \ ati128.h \ ati128_overlay.c \ ati128_state.c \ ati128_state.h \ regs.h \ mmio.h libdirectfb_ati128_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_ati128_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/ati128/Makefile.in0000644000175000017500000004536311307521477015420 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/ati128 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(ati128dir)" "$(DESTDIR)$(ati128dir)" ati128LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(ati128_LTLIBRARIES) libdirectfb_ati128_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_ati128_la_OBJECTS = ati128.lo ati128_overlay.lo \ ati128_state.lo libdirectfb_ati128_la_OBJECTS = $(am_libdirectfb_ati128_la_OBJECTS) libdirectfb_ati128_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_ati128_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_ati128_la_SOURCES) DIST_SOURCES = $(libdirectfb_ati128_la_SOURCES) ati128DATA_INSTALL = $(INSTALL_DATA) DATA = $(ati128_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src ati128dir = $(MODULEDIR)/gfxdrivers ati128_LTLIBRARIES = libdirectfb_ati128.la @BUILD_STATIC_TRUE@ati128_DATA = $(ati128_LTLIBRARIES:.la=.o) libdirectfb_ati128_la_SOURCES = \ ati128.c \ ati128.h \ ati128_overlay.c \ ati128_state.c \ ati128_state.h \ regs.h \ mmio.h libdirectfb_ati128_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_ati128_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/ati128/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/ati128/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-ati128LTLIBRARIES: $(ati128_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(ati128dir)" || $(MKDIR_P) "$(DESTDIR)$(ati128dir)" @list='$(ati128_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(ati128LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(ati128dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(ati128LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(ati128dir)/$$f"; \ else :; fi; \ done uninstall-ati128LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(ati128_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(ati128dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(ati128dir)/$$p"; \ done clean-ati128LTLIBRARIES: -test -z "$(ati128_LTLIBRARIES)" || rm -f $(ati128_LTLIBRARIES) @list='$(ati128_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_ati128.la: $(libdirectfb_ati128_la_OBJECTS) $(libdirectfb_ati128_la_DEPENDENCIES) $(libdirectfb_ati128_la_LINK) -rpath $(ati128dir) $(libdirectfb_ati128_la_OBJECTS) $(libdirectfb_ati128_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ati128.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ati128_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ati128_state.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-ati128DATA: $(ati128_DATA) @$(NORMAL_INSTALL) test -z "$(ati128dir)" || $(MKDIR_P) "$(DESTDIR)$(ati128dir)" @list='$(ati128_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(ati128DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(ati128dir)/$$f'"; \ $(ati128DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(ati128dir)/$$f"; \ done uninstall-ati128DATA: @$(NORMAL_UNINSTALL) @list='$(ati128_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(ati128dir)/$$f'"; \ rm -f "$(DESTDIR)$(ati128dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(ati128dir)" "$(DESTDIR)$(ati128dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-ati128LTLIBRARIES clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-ati128DATA install-ati128LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-ati128DATA uninstall-ati128LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean \ clean-ati128LTLIBRARIES clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-ati128DATA \ install-ati128LTLIBRARIES install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-ati128DATA uninstall-ati128LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/ati128/mmio.h0000644000175000017500000000657311245562152014461 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___ATI128_MMIO_H__ #define ___ATI128_MMIO_H__ #include #include "ati128.h" static inline void ati128_out32(volatile u8 *mmioaddr, u32 reg, u32 value) { #ifdef __powerpc__ asm volatile("stwbrx %0,%1,%2;eieio" : : "r"(value), "b"(reg), "r"(mmioaddr) : "memory"); #else *((volatile u32*)(mmioaddr+reg)) = value; #endif } static inline u32 ati128_in32(volatile u8 *mmioaddr, u32 reg) { #ifdef __powerpc__ u32 value; asm volatile("lwbrx %0,%1,%2;eieio" : "=r"(value) : "b"(reg), "r"(mmioaddr)); return value; #else return *((volatile u32*)(mmioaddr+reg)); #endif } static inline void ati128_waitidle( ATI128DriverData *adrv, ATI128DeviceData *adev ) { int timeout = 1000000; while (timeout--) { if ((ati128_in32( adrv->mmio_base, GUI_STAT) & 0x00000FFF) == 64) break; adev->idle_waitcycles++; } timeout = 1000000; while (timeout--) { if ((ati128_in32( adrv->mmio_base, GUI_STAT) & (GUI_ACTIVE | ENG_3D_BUSY)) == ENGINE_IDLE) break; adev->idle_waitcycles++; } ati128_out32( adrv->mmio_base, PC_NGUI_CTLSTAT, ati128_in32( adrv->mmio_base, PC_NGUI_CTLSTAT) | 0x000000ff); timeout = 1000000; while (timeout--) { if ((ati128_in32( adrv->mmio_base, PC_NGUI_CTLSTAT) & PC_BUSY) != PC_BUSY) break; adev->idle_waitcycles++; } adev->fifo_space = 60; } static inline void ati128_waitfifo( ATI128DriverData *adrv, ATI128DeviceData *adev, unsigned int requested_fifo_space) { int timeout = 1000000; adev->waitfifo_sum += requested_fifo_space; adev->waitfifo_calls++; if (adev->fifo_space < requested_fifo_space) { while (timeout--) { adev->fifo_waitcycles++; adev->fifo_space = ati128_in32( adrv->mmio_base, GUI_STAT) & 0x00000FFF; if (adev->fifo_space >= requested_fifo_space) break; } } else { adev->fifo_cache_hits++; } adev->fifo_space -= requested_fifo_space; } #endif DirectFB-1.2.10/gfxdrivers/ati128/regs.h0000644000175000017500000015001111164361026014440 00000000000000#ifndef REG_RAGE128_H #define REG_RAGE128_H #define CLOCK_CNTL_INDEX 0x0008 #define CLOCK_CNTL_DATA 0x000c #define BIOS_0_SCRATCH 0x0010 #define BUS_CNTL 0x0030 #define GEN_INT_CNTL 0x0040 #define CRTC_GEN_CNTL 0x0050 #define CRTC_EXT_CNTL 0x0054 #define DAC_CNTL 0x0058 #define I2C_CNTL_1 0x0094 #define PALETTE_INDEX 0x00b0 #define PALETTE_DATA 0x00b4 #define CONFIG_CNTL 0x00e0 #define GEN_RESET_CNTL 0x00f0 #define CONFIG_MEMSIZE 0x00f8 #define MEM_CNTL 0x0140 #define AGP_BASE 0x0170 #define AGP_CNTL 0x0174 #define AGP_APER_OFFSET 0x0178 #define PCI_GART_PAGE 0x017c #define PC_NGUI_MODE 0x0180 #define PC_NGUI_CTLSTAT 0x0184 #define MPP_TB_CONFIG 0x01C0 #define MPP_GP_CONFIG 0x01C8 #define VIPH_CONTROL 0x01D0 #define CRTC_H_TOTAL_DISP 0x0200 #define CRTC_H_SYNC_STRT_WID 0x0204 #define CRTC_V_TOTAL_DISP 0x0208 #define CRTC_V_SYNC_STRT_WID 0x020c #define CRTC_OFFSET 0x0224 #define CRTC_OFFSET_CNTL 0x0228 #define CRTC_PITCH 0x022c #define OVR_CLR 0x0230 #define OVR_WID_LEFT_RIGHT 0x0234 #define OVR_WID_TOP_BOTTOM 0x0238 #define LVDS_GEN_CNTL 0x02d0 #define DDA_CONFIG 0x02e0 #define DDA_ON_OFF 0x02e4 #define VGA_DDA_CONFIG 0x02e8 #define VGA_DDA_ON_OFF 0x02ec #define OV0_SCALE_CNTL 0x0420 #define SUBPIC_CNTL 0x0540 #define PM4_BUFFER_OFFSET 0x0700 #define PM4_BUFFER_CNTL 0x0704 #define PM4_BUFFER_WM_CNTL 0x0708 #define PM4_BUFFER_DL_RPTR_ADDR 0x070c #define PM4_BUFFER_DL_RPTR 0x0710 #define PM4_BUFFER_DL_WPTR 0x0714 #define PM4_VC_FPU_SETUP 0x071c #define PM4_FPU_CNTL 0x0720 #define PM4_VC_FORMAT 0x0724 #define PM4_VC_CNTL 0x0728 #define PM4_VC_I01 0x072c #define PM4_VC_VLOFF 0x0730 #define PM4_VC_VLSIZE 0x0734 #define PM4_IW_INDOFF 0x0738 #define PM4_IW_INDSIZE 0x073c #define PM4_FPU_FPX0 0x0740 #define PM4_FPU_FPY0 0x0744 #define PM4_FPU_FPX1 0x0748 #define PM4_FPU_FPY1 0x074c #define PM4_FPU_FPX2 0x0750 #define PM4_FPU_FPY2 0x0754 #define PM4_FPU_FPY3 0x0758 #define PM4_FPU_FPY4 0x075c #define PM4_FPU_FPY5 0x0760 #define PM4_FPU_FPY6 0x0764 #define PM4_FPU_FPR 0x0768 #define PM4_FPU_FPG 0x076c #define PM4_FPU_FPB 0x0770 #define PM4_FPU_FPA 0x0774 #define PM4_FPU_INTXY0 0x0780 #define PM4_FPU_INTXY1 0x0784 #define PM4_FPU_INTXY2 0x0788 #define PM4_FPU_INTARGB 0x078c #define PM4_FPU_FPTWICEAREA 0x0790 #define PM4_FPU_DMAJOR01 0x0794 #define PM4_FPU_DMAJOR12 0x0798 #define PM4_FPU_DMAJOR02 0x079c #define PM4_FPU_STAT 0x07a0 #define PM4_STAT 0x07b8 #define PM4_TEST_CNTL 0x07d0 #define PM4_MICROCODE_ADDR 0x07d4 #define PM4_MICROCODE_RADDR 0x07d8 #define PM4_MICROCODE_DATAH 0x07dc #define PM4_MICROCODE_DATAL 0x07e0 #define PM4_CMDFIFO_ADDR 0x07e4 #define PM4_CMDFIFO_DATAH 0x07e8 #define PM4_CMDFIFO_DATAL 0x07ec #define PM4_BUFFER_ADDR 0x07f0 #define PM4_BUFFER_DATAH 0x07f4 #define PM4_BUFFER_DATAL 0x07f8 #define PM4_MICRO_CNTL 0x07fc #define CAP0_TRIG_CNTL 0x0950 #define CAP1_TRIG_CNTL 0x09c0 /****************************************************************************** * GUI Block Memory Mapped Registers * * These registers are FIFOed. * *****************************************************************************/ #define PM4_FIFO_DATA_EVEN 0x1000 #define PM4_FIFO_DATA_ODD 0x1004 #define DST_OFFSET 0x1404 #define DST_PITCH 0x1408 #define DST_WIDTH 0x140c #define DST_HEIGHT 0x1410 #define SRC_X 0x1414 #define SRC_Y 0x1418 #define DST_X 0x141c #define DST_Y 0x1420 #define SRC_PITCH_OFFSET 0x1428 #define DST_PITCH_OFFSET 0x142c #define SRC_Y_X 0x1434 #define DST_Y_X 0x1438 #define DST_HEIGHT_WIDTH 0x143c #define DP_GUI_MASTER_CNTL 0x146c #define BRUSH_SCALE 0x1470 #define BRUSH_Y_X 0x1474 #define DP_BRUSH_BKGD_CLR 0x1478 #define DP_BRUSH_FRGD_CLR 0x147c #define DST_WIDTH_X 0x1588 #define DST_HEIGHT_WIDTH_8 0x158c #define SRC_X_Y 0x1590 #define DST_X_Y 0x1594 #define DST_WIDTH_HEIGHT 0x1598 #define DST_WIDTH_X_INCY 0x159c #define DST_HEIGHT_Y 0x15a0 #define DST_X_SUB 0x15a4 #define DST_Y_SUB 0x15a8 #define SRC_OFFSET 0x15ac #define SRC_PITCH 0x15b0 #define DST_HEIGHT_WIDTH_BW 0x15b4 #define CLR_CMP_CNTL 0x15c0 #define CLR_CMP_CLR_SRC 0x15c4 #define CLR_CMP_CLR_DST 0x15c8 #define CLR_CMP_MASK 0x15cc #define DP_SRC_FRGD_CLR 0x15d8 #define DP_SRC_BKGD_CLR 0x15dc #define DST_BRES_ERR 0x1628 #define DST_BRES_INC 0x162c #define DST_BRES_DEC 0x1630 #define DST_BRES_LNTH 0x1634 #define DST_BRES_LNTH_SUB 0x1638 #define SC_LEFT 0x1640 #define SC_RIGHT 0x1644 #define SC_TOP 0x1648 #define SC_BOTTOM 0x164c #define SRC_SC_RIGHT 0x1654 #define SRC_SC_BOTTOM 0x165c #define GUI_DEBUG0 0x16a0 #define GUI_DEBUG1 0x16a4 #define GUI_TIMEOUT 0x16b0 #define GUI_TIMEOUT0 0x16b4 #define GUI_TIMEOUT1 0x16b8 #define GUI_PROBE 0x16bc #define DP_CNTL 0x16c0 #define DP_DATATYPE 0x16c4 #define DP_MIX 0x16c8 #define DP_WRITE_MASK 0x16cc #define DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0 #define DEFAULT_OFFSET 0x16e0 #define DEFAULT_PITCH 0x16e4 #define DEFAULT_SC_BOTTOM_RIGHT 0x16e8 #define SC_TOP_LEFT 0x16ec #define SC_BOTTOM_RIGHT 0x16f0 #define SRC_SC_BOTTOM_RIGHT 0x16f4 #define WAIT_UNTIL 0x1720 #define CACHE_CNTL 0x1724 #define GUI_STAT 0x1740 #define PC_GUI_MODE 0x1744 #define PC_GUI_CTLSTAT 0x1748 #define PC_DEBUG_MODE 0x1760 #define BRES_DST_ERR_DEC 0x1780 #define TRAIL_BRES_T12_ERR_DEC 0x1784 #define TRAIL_BRES_T12_INC 0x1788 #define DP_T12_CNTL 0x178c #define DST_BRES_T1_LNTH 0x1790 #define DST_BRES_T2_LNTH 0x1794 #define SCALE_SRC_HEIGHT_WIDTH 0x1994 #define SCALE_OFFSET_0 0x1998 #define SCALE_PITCH 0x199c #define SCALE_X_INC 0x19a0 #define SCALE_Y_INC 0x19a4 #define SCALE_HACC 0x19a8 #define SCALE_VACC 0x19ac #define SCALE_DST_X_Y 0x19b0 #define SCALE_DST_HEIGHT_WIDTH 0x19b4 #define SCALE_3D_CNTL 0x1a00 #define SCALE_3D_DATATYPE 0x1a20 #define SETUP_CNTL 0x1bc4 #define SOLID_COLOR 0x1bc8 #define WINDOW_XY_OFFSET 0x1bcc #define DRAW_LINE_POINT 0x1bd0 #define SETUP_CNTL_PM4 0x1bd4 #define DST_PITCH_OFFSET_C 0x1c80 #define DP_GUI_MASTER_CNTL_C 0x1c84 #define SC_TOP_LEFT_C 0x1c88 #define SC_BOTTOM_RIGHT_C 0x1c8c #define CLR_CMP_MASK_3D 0x1A28 #define MISC_3D_STATE_CNTL_REG 0x1CA0 #define MC_SRC1_CNTL 0x19D8 #define TEX_CNTL 0x1800 /* CONSTANTS */ #define ENG_3D_BUSY 0x02000000 #define GUI_ACTIVE 0x80000000 #define ENGINE_IDLE 0x0 #define PLL_WR_EN 0x00000080 #define CLK_PIN_CNTL 0x0001 #define PPLL_CNTL 0x0002 #define PPLL_REF_DIV 0x0003 #define PPLL_DIV_0 0x0004 #define PPLL_DIV_1 0x0005 #define PPLL_DIV_2 0x0006 #define PPLL_DIV_3 0x0007 #define VCLK_ECP_CNTL 0x0008 #define HTOTAL_CNTL 0x0009 #define X_MPLL_REF_FB_DIV 0x000a #define XPLL_CNTL 0x000b #define XDLL_CNTL 0x000c #define XCLK_CNTL 0x000d #define MPLL_CNTL 0x000e #define MCLK_CNTL 0x000f #define AGP_PLL_CNTL 0x0010 #define FCP_CNTL 0x0012 #define PLL_TEST_CNTL 0x0013 #define PPLL_RESET 0x01 #define PPLL_ATOMIC_UPDATE_EN 0x10000 #define PPLL_VGA_ATOMIC_UPDATE_EN 0x20000 #define PPLL_REF_DIV_MASK 0x3FF #define PPLL_FB3_DIV_MASK 0x7FF #define PPLL_POST3_DIV_MASK 0x70000 #define PPLL_ATOMIC_UPDATE_R 0x8000 #define PPLL_ATOMIC_UPDATE_W 0x8000 #define MEM_CFG_TYPE_MASK 0x3 #define XCLK_SRC_SEL_MASK 0x7 #define XPLL_FB_DIV_MASK 0xFF00 #define X_MPLL_REF_DIV_MASK 0xFF /* CRTC control values (CRTC_GEN_CNTL) */ #define CRTC_CSYNC_EN 0x00000010 #define CRTC_PIX_WIDTH_MASK 0x00000700 #define CRTC_PIX_WIDTH_4BPP 0x00000100 #define CRTC_PIX_WIDTH_8BPP 0x00000200 #define CRTC_PIX_WIDTH_15BPP 0x00000300 #define CRTC_PIX_WIDTH_16BPP 0x00000400 #define CRTC_PIX_WIDTH_24BPP 0x00000500 #define CRTC_PIX_WIDTH_32BPP 0x00000600 /* DAC_CNTL bit constants */ #define DAC_8BIT_EN 0x00000100 #define DAC_MASK 0xFF000000 #define DAC_BLANKING 0x00000004 #define DAC_RANGE_CNTL 0x00000003 #define DAC_RANGE_CNTL 0x00000003 #define DAC_PALETTE_ACCESS_CNTL 0x00000020 #define DAC_PDWN 0x00008000 /* GEN_RESET_CNTL bit constants */ #define SOFT_RESET_GUI 0x00000001 #define SOFT_RESET_VCLK 0x00000100 #define SOFT_RESET_PCLK 0x00000200 #define SOFT_RESET_ECP 0x00000400 #define SOFT_RESET_DISPENG_XCLK 0x00000800 /* PC_GUI_CTLSTAT bit constants */ #define PC_BUSY_INIT 0x10000000 #define PC_BUSY_GUI 0x20000000 #define PC_BUSY_NGUI 0x40000000 #define PC_BUSY 0x80000000 #define BUS_MASTER_DIS 0x00000040 #define PM4_BUFFER_CNTL_NONPM4 0x00000000 /* DP_DATATYPE bit constants */ #define DST_8BPP 0x00000002 #define DST_15BPP 0x00000003 #define DST_16BPP 0x00000004 #define DST_24BPP 0x00000005 #define DST_32BPP 0x00000006 #define DST_8BPP_RGB332 0x00000007 #define DST_8BPP_Y8 0x00000008 #define DST_8BPP_RGB8 0x00000009 #define DST_16BPP_VYUY422 0x0000000b #define DST_16BPP_YVYU422 0x0000000c #define DST_32BPP_AYUV444 0x0000000e #define DST_16BPP_ARGB4444 0x0000000f #define BRUSH_8x8MONO 0x00000000 #define BRUSH_8x8MONO_LBKGD 0x00000100 #define BRUSH_8x1MONO 0x00000200 #define BRUSH_8x1MONO_LBKGD 0x00000300 #define BRUSH_1x8MONO 0x00000400 #define BRUSH_1x8MONO_LBKGD 0x00000500 #define BRUSH_32x1MONO 0x00000600 #define BRUSH_32x1MONO_LBKGD 0x00000700 #define BRUSH_32x32MONO 0x00000800 #define BRUSH_32x32MONO_LBKGD 0x00000900 #define BRUSH_8x8COLOR 0x00000a00 #define BRUSH_8x1COLOR 0x00000b00 #define BRUSH_1x8COLOR 0x00000c00 #define BRUSH_SOLIDCOLOR 0x00000d00 #define SRC_MONO 0x00000000 #define SRC_MONO_LBKGD 0x00010000 #define SRC_DSTCOLOR 0x00030000 #define BYTE_ORDER_MSB_TO_LSB 0x00000000 #define BYTE_ORDER_LSB_TO_MSB 0x40000000 #define DP_CONVERSION_TEMP 0x80000000 /* DP_GUI_MASTER_CNTL bit constants */ #define GMC_SRC_PITCH_OFFSET_DEFAULT 0x00000000 #define GMC_DST_PITCH_OFFSET_DEFAULT 0x00000000 #define GMC_SRC_CLIP_DEFAULT 0x00000000 #define GMC_DST_CLIP_DEFAULT 0x00000000 #define GMC_BRUSH_SOLIDCOLOR 0x000000d0 #define GMC_SRC_DSTCOLOR 0x00003000 #define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000 #define GMC_DP_SRC_RECT 0x02000000 #define GMC_3D_FCN_EN_CLR 0x00000000 #define GMC_AUX_CLIP_CLEAR 0x20000000 #define GMC_DST_CLR_CMP_FCN_CLEAR 0x10000000 #define GMC_WRITE_MASK_SET 0x40000000 #define GMC_DP_CONVERSION_TEMP_6500 0x00000000 /* DP_GUI_MASTER_CNTL ROP3 named constants */ #define ROP3_PATCOPY 0x00f00000 #define ROP3_SRCCOPY 0x00cc0000 #define SRC_DSTCOLOR 0x00030000 /* DP_CNTL bit constants */ #define DST_X_RIGHT_TO_LEFT 0x00000000 #define DST_X_LEFT_TO_RIGHT 0x00000001 #define DST_Y_BOTTOM_TO_TOP 0x00000000 #define DST_Y_TOP_TO_BOTTOM 0x00000002 #define DST_X_MAJOR 0x00000000 #define DST_Y_MAJOR 0x00000004 #define DST_X_TILE 0x00000008 #define DST_Y_TILE 0x00000010 #define DST_LAST_PEL 0x00000020 #define DST_TRAIL_X_RIGHT_TO_LEFT 0x00000000 #define DST_TRAIL_X_LEFT_TO_RIGHT 0x00000040 #define DST_TRAP_FILL_RIGHT_TO_LEFT 0x00000000 #define DST_TRAP_FILL_LEFT_TO_RIGHT 0x00000080 #define DST_BRES_SIGN 0x00000100 #define DST_HOST_BIG_ENDIAN_EN 0x00000200 #define DST_POLYLINE_NONLAST 0x00008000 #define DST_RASTER_STALL 0x00010000 #define DST_POLY_EDGE 0x00040000 /* DP_MIX bit constants */ #define DP_SRC_RECT 0x00000200 #define DP_SRC_HOST 0x00000300 #define DP_SRC_HOST_BYTEALIGN 0x00000400 /* LVDS_GEN_CNTL constants */ #define LVDS_BL_MOD_LEVEL_MASK 0x0000ff00 #define LVDS_BL_MOD_LEVEL_SHIFT 0x8 #define LVDS_BL_MOD_EN 0x00010000 #define LVDS_DIGION 0x00040000 #define LVDS_BLON 0x00080000 /* from the ati128ddk */ #define FOG_3D_TABLE_START 0x1810 #define FOG_3D_TABLE_END 0x1814 #define FOG_3D_TABLE_DENSITY 0x181c #define FOG_TABLE_INDEX 0x1a14 #define FOG_TABLE_DATA 0x1a18 /* MISC_3D_STATE */ #define MISC_3D_STATE_SCALE_3D_FN_NOP (0x00000000 << 8) #define MISC_3D_STATE_SCALE_3D_FN_SCALE (0x00000001 << 8) #define MISC_3D_STATE_SCALE_3D_FN_TMAP_SHADE (0x00000002 << 8) #define MISC_3D_STATE_SCALE_PIX_REP_BLEND (0x00000000 << 10) #define MISC_3D_STATE_SCALE_PIX_REP_REPLICATE (0x00000001 << 10) #define MISC_3D_STATE_ALPHA_COMB_FNC_ADD_CLAMP (0x00000000 << 12) #define MISC_3D_STATE_ALPHA_COMB_FNC_ADD_NO_CLAMP (0x00000001 << 12) #define MISC_3D_STATE_ALPHA_COMB_FNC_SUB_SRC_DST_CLAMP (0x00000002 << 12) #define MISC_3D_STATE_ALPHA_COMB_FNC_SUB_SRC_DST_NO_CLAMP (0x00000003 << 12) #define MISC_3D_STATE_FOG_TABLE_EN_VERTEX_FOG (0x00000000 << 14) #define MISC_3D_STATE_FOG_TABLE_EN_TABLE_FOG (0x00000001 << 14) #define MISC_3D_STATE_ALPHA_BLEND_SRC_ZERO (0x00000000 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_ONE (0x00000001 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_SRCCOLOR (0x00000002 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_INVSRCCOLOR (0x00000003 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_SRCALPHA (0x00000004 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_INVSRCALPHA (0x00000005 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_DESTALPHA (0x00000006 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_INVDESTALPHA (0x00000007 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_DESTCOLOR (0x00000008 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_INVDESTCOLOR (0x00000009 << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_SRCALPHASAT (0x0000000a << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_BOTHSRCALPHA (0x0000000b << 16) #define MISC_3D_STATE_ALPHA_BLEND_SRC_BOTHINVSRCALPHA (0x0000000c << 16) #define MISC_3D_STATE_ALPHA_BLEND_DST_ZERO (0x00000000 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_ONE (0x00000001 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_SRCCOLOR (0x00000002 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_INVSRCCOLOR (0x00000003 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_SRCALPHA (0x00000004 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_INVSRCALPHA (0x00000005 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_DESTALPHA (0x00000006 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_INVDESTALPHA (0x00000007 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_DESTCOLOR (0x00000008 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_INVDESTCOLOR (0x00000009 << 20) #define MISC_3D_STATE_ALPHA_BLEND_DST_SRCALPHASAT (0x0000000a << 20) #define MISC_3D_STATE_ALPHA_TEST_OP_NEVER (0x00000000 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_LESS (0x00000001 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_LESSEQUAL (0x00000002 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_EQUAL (0x00000003 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_GREATEREQUAL (0x00000004 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_GREATER (0x00000005 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_NEQUAL (0x00000006 << 24) #define MISC_3D_STATE_ALPHA_TEST_OP_ALWAYS (0x00000007 << 24) /* Z_STEN_CNTL */ #define Z_STEN_CNTL_Z_PIX_WIDTH_16 (0x00000000 << 1) #define Z_STEN_CNTL_Z_PIX_WIDTH_24 (0x00000001 << 1) #define Z_STEN_CNTL_Z_PIX_WIDTH_32 (0x00000002 << 1) #define Z_STEN_CNTL_Z_TEST_NEVER (0x00000000 << 4) #define Z_STEN_CNTL_Z_TEST_LESS (0x00000001 << 4) #define Z_STEN_CNTL_Z_TEST_LESSEQUAL (0x00000002 << 4) #define Z_STEN_CNTL_Z_TEST_EQUAL (0x00000003 << 4) #define Z_STEN_CNTL_Z_TEST_GREATEREQUAL (0x00000004 << 4) #define Z_STEN_CNTL_Z_TEST_GREATER (0x00000005 << 4) #define Z_STEN_CNTL_Z_TEST_NEQUAL (0x00000006 << 4) #define Z_STEN_CNTL_Z_TEST_ALWAYS (0x00000007 << 4) #define Z_STEN_CNTL_STENCIL_TEST_NEVER (0x00000000 << 12) #define Z_STEN_CNTL_STENCIL_TEST_LESS (0x00000001 << 12) #define Z_STEN_CNTL_STENCIL_TEST_LESSEQUAL (0x00000002 << 12) #define Z_STEN_CNTL_STENCIL_TEST_EQUAL (0x00000003 << 12) #define Z_STEN_CNTL_STENCIL_TEST_GREATEREQUAL (0x00000004 << 12) #define Z_STEN_CNTL_STENCIL_TEST_GREATER (0x00000005 << 12) #define Z_STEN_CNTL_STENCIL_TEST_NEQUAL (0x00000006 << 12) #define Z_STEN_CNTL_STENCIL_TEST_ALWAYS (0x00000007 << 12) #define Z_STEN_CNTL_STENCIL_S_FAIL_OP_KEEP (0x00000000 << 16) #define Z_STEN_CNTL_STENCIL_S_FAIL_OP_ZERO (0x00000001 << 16) #define Z_STEN_CNTL_STENCIL_S_FAIL_OP_REPLACE (0x00000002 << 16) #define Z_STEN_CNTL_STENCIL_S_FAIL_OP_INC (0x00000003 << 16) #define Z_STEN_CNTL_STENCIL_S_FAIL_OP_DEC (0x00000004 << 16) #define Z_STEN_CNTL_STENCIL_S_FAIL_OP_INV (0x00000005 << 16) #define Z_STEN_CNTL_STENCIL_ZPASS_OP_KEEP (0x00000000 << 20) #define Z_STEN_CNTL_STENCIL_ZPASS_OP_ZERO (0x00000001 << 20) #define Z_STEN_CNTL_STENCIL_ZPASS_OP_REPLACE (0x00000002 << 20) #define Z_STEN_CNTL_STENCIL_ZPASS_OP_INC (0x00000003 << 20) #define Z_STEN_CNTL_STENCIL_ZPASS_OP_DEC (0x00000004 << 20) #define Z_STEN_CNTL_STENCIL_ZPASS_OP_INV (0x00000005 << 20) #define Z_STEN_CNTL_STENCIL_ZFAIL_OP_KEEP (0x00000000 << 24) #define Z_STEN_CNTL_STENCIL_ZFAIL_OP_ZERO (0x00000001 << 24) #define Z_STEN_CNTL_STENCIL_ZFAIL_OP_REPLACE (0x00000002 << 24) #define Z_STEN_CNTL_STENCIL_ZFAIL_OP_INC (0x00000003 << 24) #define Z_STEN_CNTL_STENCIL_ZFAIL_OP_DEC (0x00000004 << 24) #define Z_STEN_CNTL_STENCIL_ZFAIL_OP_INV (0x00000005 << 24) /* TEX_CNTL */ #define TEX_CNTL_Z_EN_OFF (0x00000000 << 0) #define TEX_CNTL_Z_EN_ON (0x00000001 << 0) #define TEX_CNTL_Z_MASK_DIS (0x00000000 << 1) #define TEX_CNTL_Z_MASK_EN (0x00000001 << 1) #define TEX_CNTL_STENCIL_EN_OFF (0x00000000 << 3) #define TEX_CNTL_STENCIL_EN_ON (0x00000001 << 3) #define TEX_CNTL_TEX_EN_SHADE (0x00000000 << 4) #define TEX_CNTL_TEX_EN_TMAP (0x00000001 << 4) #define TEX_CNTL_SECONDARY_TEX_EN_OFF (0x00000000 << 5) #define TEX_CNTL_SECONDARY_TEX_EN_ON (0x00000001 << 5) #define TEX_CNTL_FOG_EN_OFF (0x00000000 << 7) #define TEX_CNTL_FOG_EN_ON (0x00000001 << 7) #define TEX_CNTL_DITHRE_EN_OFF (0x00000000 << 8) #define TEX_CNTL_DITHRE_EN_ON (0x00000001 << 8) #define TEX_CNTL_ALPHA_EN_OFF (0x00000000 << 9) #define TEX_CNTL_ALPHA_EN_ON (0x00000001 << 9) #define TEX_CNTL_ALPHA_TEST_EN_OFF (0x00000000 << 10) #define TEX_CNTL_ALPHA_TEST_EN_ON (0x00000001 << 10) #define TEX_CNTL_SPEC_LIGHT_EN_OFF (0x00000000 << 11) #define TEX_CNTL_SPEC_LIGHT_EN_ON (0x00000001 << 11) #define TEX_CNTL_TEX_CHROMA_KEY_EN_OFF (0x00000000 << 12) #define TEX_CNTL_TEX_CHROMA_KEY_EN_ON (0x00000001 << 12) #define TEX_CNTL_AMASK_EN_OFF (0x00000000 << 13) #define TEX_CNTL_AMASK_EN_ON (0x00000001 << 13) #define TEX_CNTL_LIGHT_FN_DIS (0x00000000 << 14) #define TEX_CNTL_LIGHT_FN_COPY (0x00000001 << 14) #define TEX_CNTL_LIGHT_FN_MODULATE (0x00000002 << 14) #define TEX_CNTL_LIGHT_FN_ADD (0x00000003 << 14) #define TEX_CNTL_LIGHT_FN_BLEND_CONSTANT (0x00000004 << 14) #define TEX_CNTL_LIGHT_FN_BLEND_TEXTURE (0x00000005 << 14) #define TEX_CNTL_LIGHT_FN_BLEND_VERTEX (0x00000006 << 14) #define TEX_CNTL_LIGHT_FN_BLEND_CONST_COLOR (0x00000007 << 14) #define TEX_CNTL_ALPHA_LIGHT_FN_DIS (0x00000000 << 18) #define TEX_CNTL_ALPHA_LIGHT_FN_COPY (0x00000001 << 18) #define TEX_CNTL_ALPHA_LIGHT_FN_MODULATE (0x00000002 << 18) #define TEX_CNTL_ALPHA_LIGHT_FN_ADD (0x00000003 << 18) //#define TEX_CNTL_ANTI_ALIAS_FN #define TEX_CNTL_TEX_CACHE_FLUSH_OFF (0x00000000 << 23) #define TEX_CNTL_TEX_CACHE_FLUSH_ON (0x00000001 << 23) //#define TEX_CNTL_LOD_BIAS /* PRIM_TEX_CNTL */ #define PRIM_TEX_CNTL_PRIM_MIN_BLEND_FN_NEAREST (0x00000000 << 0) #define PRIM_TEX_CNTL_PRIM_MIN_BLEND_FN_LINEAR (0x00000001 << 0) #define PRIM_TEX_CNTL_PRIM_MIN_BLEND_FN_MIPNEAREST (0x00000002 << 0) #define PRIM_TEX_CNTL_PRIM_MIN_BLEND_FN_MIPLINEAR (0x00000003 << 0) #define PRIM_TEX_CNTL_PRIM_MIN_BLEND_FN_LINEARMIPNEAREST (0x00000004 << 0) #define PRIM_TEX_CNTL_PRIM_MIN_BLEND_FN_LINEARMIPLINEAR (0x00000005 << 0) #define PRIM_TEX_CNTL_PRIM_MAG_BLEND_FN_NEAREST (0x00000000 << 4) #define PRIM_TEX_CNTL_PRIM_MAG_BLEND_FN_LINEAR (0x00000001 << 4) #define PRIM_TEX_CNTL_MIP_MAP_DIS_OFF (0x00000000 << 7) #define PRIM_TEX_CNTL_MIP_MAP_DIS_ON (0x00000001 << 7) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_S_WRAP (0x00000000 << 8) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_S_MIRROR (0x00000001 << 8) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_S_CLAMP (0x00000002 << 8) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_S_BORDER_COLOR (0x00000003 << 8) #define PRIM_TEX_CNTL_PRIM_TEX_WRAP_S_OFF (0x00000000 << 10) #define PRIM_TEX_CNTL_PRIM_TEX_WRAP_S_ON (0x00000001 << 10) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_T_WRAP (0x00000000 << 11) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_T_MIRROR (0x00000001 << 11) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_T_CLAMP (0x00000002 << 11) #define PRIM_TEX_CNTL_PRIM_TEX_CLAMP_MODE_T_BORDER_COLOR (0x00000003 << 11) #define PRIM_TEX_CNTL_PRIM_TEX_WRAP_T_OFF (0x00000000 << 13) #define PRIM_TEX_CNTL_PRIM_TEX_WRAP_T_ON (0x00000001 << 13) #define PRIM_TEX_CNTL_PRIM_TEX_PERSPECTIVE_DIS_OFF (0x00000000 << 14) #define PRIM_TEX_CNTL_PRIM_TEX_PERSPECTIVE_DIS_ON (0x00000001 << 14) #define PRIM_TEX_CNTL_PRIM_DATATYPE_VQ (0x00000000 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_CI4 (0x00000001 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_CI8 (0x00000002 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_ARGB1555 (0x00000003 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_RGB565 (0x00000004 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_RGB888 (0x00000005 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_ARGB8888 (0x00000006 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_RGB332 (0x00000007 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_Y8 (0x00000008 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_RGB8 (0x00000009 << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_CI16 (0x0000000a << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_YUV422 (0x0000000b << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_YUV422_2 (0x0000000c << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_AYUV444 (0x0000000d << 16) #define PRIM_TEX_CNTL_PRIM_DATATYPE_ARGB4444 (0x0000000e << 16) //#define PRIM_TEX_CNTL_PRIM_PALETTE_OFF_ //#define PRIM_TEX_CNTL_PRIM_PSEUDOCOLOR_DATATYPE_ /* SETP_CNTL */ #define SETUP_CNTL_DONT_START_TRI_OFF (0x00000000 << 0) #define SETUP_CNTL_DONT_START_TRI_ON (0x00000001 << 0) #define SETUP_CNTL_Z_BIAS (0x00000000 << 1) #define SETUP_CNTL_DONT_START_ANY_OFF (0x00000000 << 2) #define SETUP_CNTL_DONT_START_ANY_ON (0x00000001 << 2) #define SETUP_CNTL_COLOR_FNC_SOLID_COLOR (0x00000000 << 3) #define SETUP_CNTL_COLOR_FNC_FLAT_VERT_1 (0x00000001 << 3) #define SETUP_CNTL_COLOR_FNC_FLAT_VERT_2 (0x00000002 << 3) #define SETUP_CNTL_COLOR_FNC_FLAT_VERT_3 (0x00000003 << 3) #define SETUP_CNTL_COLOR_FNC_GOURAUD (0x00000004 << 3) #define SETUP_CNTL_PRIM_TYPE_SELECT_TRI (0x00000000 << 7) #define SETUP_CNTL_PRIM_TYPE_SELECT_LINE (0x00000001 << 7) #define SETUP_CNTL_PRIM_TYPE_SELECT_POINT (0x00000002 << 7) #define SETUP_CNTL_PRIM_TYPE_SELECT_POLY_EDGE (0x00000003 << 7) #define SETUP_CNTL_TEXTURE_ST_FORMAT_MULT_W (0x00000000 << 9) #define SETUP_CNTL_TEXTURE_ST_FORMAT_DIRECT (0x00000001 << 9) #define SETUP_CNTL_STARTING_VERTEX_SELECT_1 (0x00000001 << 14) #define SETUP_CNTL_STARTING_VERTEX_SELECT_2 (0x00000002 << 14) #define SETUP_CNTL_STARTING_VERTEX_SELECT_3 (0x00000003 << 14) #define SETUP_CNTL_ENDING_VERTEX_SELECT_1 (0x00000001 << 16) #define SETUP_CNTL_ENDING_VERTEX_SELECT_2 (0x00000002 << 16) #define SETUP_CNTL_ENDING_VERTEX_SELECT_3 (0x00000003 << 16) #define SETUP_CNTL_SU_POLY_LINE_LAST (0x00000000 << 18) #define SETUP_CNTL_SU_POLY_LINE_NOT_LAST (0x00000001 << 18) #define SETUP_CNTL_SUB_PIX_AMOUNT_2BITS (0x00000000 << 19) #define SETUP_CNTL_SUB_PIX_AMOUNT_4BITS (0x00000001 << 19) //#define SETUP_CNTL_SU_POLY_EDGE //#define SETUP_CNTL_SU_EDGE_DST_Y_MAJOR //#define SETUP_CNTL_SU_STATE #define SETUP_CNTL_SET_UP_CONTINUE (0x00000001 << 31) /* PM4_VC_FPU_SETUP */ #define PM4_VC_FPU_SETUP_FRONT_DIR_CW (0x00000000 << 0) #define PM4_VC_FPU_SETUP_FRONT_DIR_CCW (0x00000001 << 0) #define PM4_VC_FPU_SETUP_BACKFACE_CULLING_FN_CULL (0x00000000 << 1) #define PM4_VC_FPU_SETUP_BACKFACE_CULLING_FN_POINT (0x00000001 << 1) #define PM4_VC_FPU_SETUP_BACKFACE_CULLING_FN_LINE (0x00000002 << 1) #define PM4_VC_FPU_SETUP_BACKFACE_CULLING_FN_REV_SOLID (0x00000003 << 1) #define PM4_VC_FPU_SETUP_FRONTFACE_CULLING_FN_CULL (0x00000000 << 3) #define PM4_VC_FPU_SETUP_FRONTFACE_CULLING_FN_POINT (0x00000001 << 3) #define PM4_VC_FPU_SETUP_FRONTFACE_CULLING_FN_LINE (0x00000002 << 3) #define PM4_VC_FPU_SETUP_FRONTFACE_CULLING_FN_REV_SOLID (0x00000003 << 3) #define PM4_VC_FPU_SETUP_PM4_COLOR_FCN_SOLID (0x00000000 << 5) #define PM4_VC_FPU_SETUP_PM4_COLOR_FCN_FLAT (0x00000001 << 5) #define PM4_VC_FPU_SETUP_PM4_COLOR_FCN_GOURAUD (0x00000002 << 5) #define PM4_VC_FPU_SETUP_PM4_COLOR_FCN_GOURAUD2 (0x00000003 << 5) #define PM4_VC_FPU_SETUP_PM4_SUB_PIX_AMOUNT_2BITS (0x00000000 << 7) #define PM4_VC_FPU_SETUP_PM4_SUB_PIX_AMOUNT_4BITS (0x00000001 << 7) #define PM4_VC_FPU_SETUP_FPU_MODE_2D (0x00000000 << 8) #define PM4_VC_FPU_SETUP_FPU_MODE_3D (0x00000001 << 8) #define PM4_VC_FPU_SETUP_TRAP_DISABLE_OFF (0x00000000 << 9) #define PM4_VC_FPU_SETUP_TRAP_DISABLE_ON (0x00000001 << 9) #define PM4_VC_FPU_SETUP_EDGE_ANTIALIAS_OFF (0x00000000 << 10) #define PM4_VC_FPU_SETUP_EDGE_ANTIALIAS_ON (0x00000001 << 10) #define PM4_VC_FPU_SETUP_SUPERSAMPLE_OFF (0x00000000 << 11) #define PM4_VC_FPU_SETUP_SUPERSAMPLE_ON (0x00000001 << 11) #define PM4_VC_FPU_SETUP_XFACTOR_2 (0x00000000 << 12) #define PM4_VC_FPU_SETUP_XFACTOR_4 (0x00000001 << 12) #define PM4_VC_FPU_SETUP_YFACTOR_2 (0x00000000 << 13) #define PM4_VC_FPU_SETUP_YFACTOR_4 (0x00000001 << 13) #define PM4_VC_FPU_SETUP_FLAT_SHADE_VERTEX_D3D (0x00000000 << 14) #define PM4_VC_FPU_SETUP_FLAT_SHADE_VERTEX_OPENGL (0x00000001 << 14) #define PM4_VC_FPU_SETUP_FPU_ROUND_EN_OFF (0x00000000 << 15) #define PM4_VC_FPU_SETUP_FPU_ROUND_EN_ON (0x00000001 << 15) #define PM4_VC_FPU_SETUP_VC_WM_SEL_8DW (0x00000000 << 16) #define PM4_VC_FPU_SETUP_VC_WM_SEL_16DW (0x00000001 << 16) #define PM4_VC_FPU_SETUP_VC_WM_SEL_32DW (0x00000002 << 16) /* SEC_TEX_CNTL */ #define SEC_TEX_CNTL_SEC_SRC_SEL_ST_0 (0x00000000 << 0) #define SEC_TEX_CNTL_SEC_SRC_SEL_ST_1 (0x00000001 << 0) /* [PRIM_ | SEC_] SEC_TEX_COMBINE_CNTL */ #define TEX_COMBINE_CNTL_COMB_FNC_DIS (0x00000000 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_COPY (0x00000001 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_COPY_INP (0x00000002 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_MODULATE (0x00000003 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_MODULATE2X (0x00000004 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_MODULATE4X (0x00000005 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_ADD (0x00000006 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_ADD_SIGNED (0x00000007 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_VERTEX (0x00000008 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_TEXTURE (0x00000009 << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_CONST (0x0000000a << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_PREMULT (0x0000000b << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_PREV (0x0000000c << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_PREMULT_INV (0x0000000d << 0) #define TEX_COMBINE_CNTL_COMB_FNC_ADD_SIGNED2X (0x0000000e << 0) #define TEX_COMBINE_CNTL_COMB_FNC_BLEND_CONST_COLOR (0x0000000f << 0) #define TEX_COMBINE_CNTL_COLOR_FACTOR_TEX (0x00000004 << 4) #define TEX_COMBINE_CNTL_COLOR_FACTOR_NTEX (0x00000005 << 4) #define TEX_COMBINE_CNTL_COLOR_FACTOR_ALPHA (0x00000006 << 4) #define TEX_COMBINE_CNTL_COLOR_FACTOR_NALPHA (0x00000007 << 4) #define TEX_COMBINE_CNTL_INPUT_FACTOR_CONST_COLOR (0x00000002 << 10) #define TEX_COMBINE_CNTL_INPUT_FACTOR_CONST_ALPHA (0x00000003 << 10) #define TEX_COMBINE_CNTL_INPUT_FACTOR_INT_COLOR (0x00000004 << 10) #define TEX_COMBINE_CNTL_INPUT_FACTOR_INT_ALPHA (0x00000005 << 10) #define TEX_COMBINE_CNTL_INPUT_FACTOR_PREV_COLOR (0x00000008 << 10) #define TEX_COMBINE_CNTL_INPUT_FACTOR_PREV_ALPHA (0x00000009 << 10) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_DIS (0x00000000 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_COPY (0x00000001 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_COPY_INP (0x00000002 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_MODULATE (0x00000003 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_MODULATE2X (0x00000004 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_MODULATE4X (0x00000005 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_ADD (0x00000006 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_ADD_SIGNED (0x00000007 << 14) #define TEX_COMBINE_CNTL_COMB_FNC_ALPHA_ADD_SIGNED2X (0x0000000e << 14) #define TEX_COMBINE_CNTL_ALPHA_FACTOR_TEX_ALPHA (0x00000006 << 18) #define TEX_COMBINE_CNTL_ALPHA_FACTOR_NTEX_ALPHA (0x00000007 << 18) #define TEX_COMBINE_CNTL_INP_FACTOR_ALPHA_CONST_ALPHA (0x00000001 << 25) #define TEX_COMBINE_CNTL_INP_FACTOR_ALPHA_INT_ALPHA (0x00000002 << 25) #define TEX_COMBINE_CNTL_INP_FACTOR_ALPHA_PREV_ALPHA (0x00000004 << 25) /* SCALE_3D_CNTL */ #define SCALE_3D_CNTL_SCALE_DITHER_ERR_DIFF (0x00000000 << 1) #define SCALE_3D_CNTL_SCALE_DITHER_TABLE (0x00000001 << 1) #define SCALE_3D_CNTL_TEX_CACHE_SIZE_FULL (0x00000000 << 2) #define SCALE_3D_CNTL_TEX_CACHE_SIZE_HALF (0x00000001 << 2) #define SCALE_3D_CNTL_DITHER_INIT_CURR (0x00000000 << 3) #define SCALE_3D_CNTL_DITHER_INIT_RESET (0x00000001 << 3) #define SCALE_3D_CNTL_ROUND_EN_OFF (0x00000000 << 4) #define SCALE_3D_CNTL_ROUND_EN_ON (0x00000001 << 4) #define SCALE_3D_CNTL_TEX_CACHE_DIS_OFF (0x00000000 << 5) #define SCALE_3D_CNTL_TEX_CACHE_DIS_ON (0x00000001 << 5) #define SCALE_3D_CNTL_SCALE_3D_FN_NONE (0x00000000 << 6) #define SCALE_3D_CNTL_SCALE_3D_FN_SCALE (0x00000001 << 6) #define SCALE_3D_CNTL_SCALE_3D_FN_TMAP_SHADE (0x00000002 << 6) #define SCALE_3D_CNTL_SCALE_PIX_REP_BLEND (0x00000000 << 8) #define SCALE_3D_CNTL_SCALE_PIX_REP_REP (0x00000001 << 8) #define SCALE_3D_CNTL_TEX_CACHE_SPLIT_OFF (0x00000000 << 9) #define SCALE_3D_CNTL_TEX_CACHE_SPLIT_ON (0x00000001 << 9) #define SCALE_3D_CNTL_APPLE_YUV_MODE_OFF (0x00000000 << 10) #define SCALE_3D_CNTL_APPLE_YUV_MODE_ON (0x00000001 << 10) #define SCALE_3D_CNTL_TEX_CACHE_PAL_MODE_OFF (0x00000000 << 11) #define SCALE_3D_CNTL_TEX_CACHE_PAL_MODE_ON (0x00000001 << 11) #define SCALE_3D_CNTL_ALPHA_COMB_FNC_ADD_CLAMP (0x00000000 << 12) #define SCALE_3D_CNTL_ALPHA_COMB_FNC_ADD_NCLAMP (0x00000001 << 12) #define SCALE_3D_CNTL_ALPHA_COMB_FNC_SUB_DST_SRC_CLAMP (0x00000002 << 12) #define SCALE_3D_CNTL_ALPHA_COMB_FNC_SUB_DST_SRC_NCLAMP (0x00000003 << 12) #define SCALE_3D_CNTL_FOG_TABLE_EN_OFF (0x00000000 << 14) #define SCALE_3D_CNTL_FOG_TABLE_EN_ON (0x00000001 << 14) #define SCALE_3D_CNTL_SIGNED_DST_CLAMP_OFF (0x00000000 << 15) #define SCALE_3D_CNTL_SIGNED_DST_CLAMP_ON (0x00000001 << 15) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_ZERO (0x00000000 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_ONE (0x00000001 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_SRCCOLOR (0x00000002 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVSRCCOLOR (0x00000003 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_SRCALPHA (0x00000004 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVSRCALPHA (0x00000005 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_DSTALPHA (0x00000006 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVDSTALPHA (0x00000007 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_DSTCOLOR (0x00000008 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVDSTCOLOR (0x00000009 << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_SAT (0x0000000a << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_BLEND (0x0000000b << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_SRC_INVBLEND (0x0000000c << 16) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_ZERO (0x00000000 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_ONE (0x00000001 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_SRCCOLOR (0x00000002 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_INVSRCCOLOR (0x00000003 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_SRCALPHA (0x00000004 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_INVSRCALPHA (0x00000005 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_DSTALPHA (0x00000006 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_INVDSTALPHA (0x00000007 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_DSTCOLOR (0x00000008 << 20) #define SCALE_3D_CNTL_ALPHA_BLEND_DST_INVDSTCOLOR (0x00000009 << 20) #define SCALE_3D_CNTL_ALPHA_TEST_OP_NEVER (0x00000000 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_LESS (0x00000001 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_LESSEQUAL (0x00000002 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_EQUAL (0x00000003 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_GREATEREQUAL (0x00000004 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_GREATER (0x00000005 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_NEQUAL (0x00000006 << 24) #define SCALE_3D_CNTL_ALPHA_TEST_OP_ALWAYS (0x00000007 << 24) #define SCALE_3D_CNTL_COMPOSITE_SHADOW_CMP_EQUAL (0x00000000 << 28) #define SCALE_3D_CNTL_COMPOSITE_SHADOW_CMP_NEQUAL (0x00000001 << 28) #define SCALE_3D_CNTL_COMPOSITE_SHADOW_EN_OFF (0x00000000 << 29) #define SCALE_3D_CNTL_COMPOSITE_SHADOW_EN_ON (0x00000001 << 29) #define SCALE_3D_CNTL_TEX_MAP_AEN_OFF (0x00000000 << 30) #define SCALE_3D_CNTL_TEX_MAP_AEN_ON (0x00000001 << 30) #define SCALE_3D_CNTL_TEX_CACHE_LINE_SIZE_8QW (0x00000000 << 31) #define SCALE_3D_CNTL_TEX_CACHE_LINE_SIZE_4QW (0x00000001 << 31) #define SCALE_3D_DATATYPE 0x1a20 #define SETUP_CNTL 0x1bc4 #define SOLID_COLOR 0x1bc8 #define WINDOW_XY_OFFSET 0x1bcc #define DRAW_LINE_POINT 0x1bd0 #define SETUP_CNTL_PM4 0x1bd4 #define DST_PITCH_OFFSET_C 0x1c80 #define DP_GUI_MASTER_CNTL_C 0x1c84 #define SC_TOP_LEFT_C 0x1c88 #define SC_BOTTOM_RIGHT_C 0x1c8c #define Z_OFFSET_C 0x1c90 #define Z_PITCH_C 0x1c94 #define Z_STEN_CNTL_C 0x1c98 #define TEX_CNTL_C 0x1c9c #define TEXTURE_CLR_CMP_CLR_C 0x1CA4 #define TEXTURE_CLR_CMP_MSK_C 0x1CA8 #define FOG_COLOR_C 0x1CAC #define PRIM_TEX_CNTL_C 0x1CB0 #define PRIM_TEX_COMBINE_CNTL_C 0x1CB4 #define TEX_SIZE_PITCH_C 0x1CB8 #define PRIM_TEX_0_OFFSET_C 0x1CBC #define PRIM_TEX_1_OFFSET_C 0x1CC0 #define PRIM_TEX_2_OFFSET_C 0x1CC4 #define PRIM_TEX_3_OFFSET_C 0x1CC8 #define PRIM_TEX_4_OFFSET_C 0x1CCC #define PRIM_TEX_5_OFFSET_C 0x1CD0 #define PRIM_TEX_6_OFFSET_C 0x1CD4 #define PRIM_TEX_7_OFFSET_C 0x1CD8 #define PRIM_TEX_8_OFFSET_C 0x1CDC #define PRIM_TEX_9_OFFSET_C 0x1CE0 #define PRIM_TEX_10_OFFSET_C 0x1CE4 #define SEC_TEX_CNTL_C 0x1D00 #define SEC_TEX_COMBINE_CNTL_C 0x1D04 #define SEC_TEX_0_OFFSET_C 0x1D08 #define SEC_TEX_1_OFFSET_C 0x1D0C #define SEC_TEX_2_OFFSET_C 0x1D10 #define SEC_TEX_3_OFFSET_C 0x1D14 #define SEC_TEX_4_OFFSET_C 0x1D18 #define SEC_TEX_5_OFFSET_C 0x1D1C #define SEC_TEX_6_OFFSET_C 0x1D20 #define SEC_TEX_7_OFFSET_C 0x1D24 #define SEC_TEX_8_OFFSET_C 0x1D28 #define SEC_TEX_9_OFFSET_C 0x1D2C #define SEC_TEX_10_OFFSET_C 0x1D30 #define CONSTANT_COLOR_C 0x1D34 #define PRIM_TEXTURE_BORDER_COLOR_C 0x1D38 #define SEC_TEXTURE_BORDER_COLOR_C 0x1D3C #define STEN_REF_MASK_C 0x1D40 #define PLANE_3D_MASK_C 0x1D44 #define CLR_CMP_MASK_3D 0x1A28 #define MC_SRC1_CNTL 0x19D8 #define TEX_CNTL 0x1800 #define CLR_CMP_CLR_3D 0x1A24 /* first overlay unit (there is only one) */ #define OV0_Y_X_START 0x0400 #define OV0_Y_X_END 0x0404 #define OV0_EXCLUSIVE_HORZ 0x0408 # define R128_EXCL_HORZ_START_MASK 0x000000ff # define R128_EXCL_HORZ_END_MASK 0x0000ff00 # define R128_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000 # define R128_EXCL_HORZ_EXCLUSIVE_EN 0x80000000 #define OV0_EXCLUSIVE_VERT 0x040C # define R128_EXCL_VERT_START_MASK 0x000003ff # define R128_EXCL_VERT_END_MASK 0x03ff0000 #define OV0_REG_LOAD_CNTL 0x0410 # define R128_REG_LD_CTL_LOCK 0x00000001L # define R128_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L # define R128_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L # define R128_REG_LD_CTL_LOCK_READBACK 0x00000008L #define OV0_SCALE_CNTL 0x0420 # define R128_SCALER_PIX_EXPAND 0x00000001L # define R128_SCALER_Y2R_TEMP 0x00000002L # define R128_SCALER_HORZ_PICK_NEAREST 0x00000003L # define R128_SCALER_VERT_PICK_NEAREST 0x00000004L # define R128_SCALER_SIGNED_UV 0x00000010L # define R128_SCALER_GAMMA_SEL_MASK 0x00000060L # define R128_SCALER_GAMMA_SEL_BRIGHT 0x00000000L # define R128_SCALER_GAMMA_SEL_G22 0x00000020L # define R128_SCALER_GAMMA_SEL_G18 0x00000040L # define R128_SCALER_GAMMA_SEL_G14 0x00000060L # define R128_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L # define R128_SCALER_SURFAC_FORMAT 0x00000f00L # define R128_SCALER_SOURCE_15BPP 0x00000300L # define R128_SCALER_SOURCE_16BPP 0x00000400L # define R128_SCALER_SOURCE_32BPP 0x00000600L # define R128_SCALER_SOURCE_YUV9 0x00000900L # define R128_SCALER_SOURCE_YUV12 0x00000A00L # define R128_SCALER_SOURCE_VYUY422 0x00000B00L # define R128_SCALER_SOURCE_YVYU422 0x00000C00L # define R128_SCALER_SMART_SWITCH 0x00008000L # define R128_SCALER_BURST_PER_PLANE 0x00ff0000L # define R128_SCALER_DOUBLE_BUFFER 0x01000000L # define R128_SCALER_DIS_LIMIT 0x08000000L # define R128_SCALER_PRG_LOAD_START 0x10000000L # define R128_SCALER_INT_EMU 0x20000000L # define R128_SCALER_ENABLE 0x40000000L # define R128_SCALER_SOFT_RESET 0x80000000L #define OV0_V_INC 0x0424 #define OV0_P1_V_ACCUM_INIT 0x0428 # define OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L # define OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L #define OV0_P23_V_ACCUM_INIT 0x042C #define OV0_P1_BLANK_LINES_AT_TOP 0x0430 # define R128_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL # define R128_P1_ACTIVE_LINES_M1 0x0fff0000L #define OV0_P23_BLANK_LINES_AT_TOP 0x0434 # define R128_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL # define R128_P23_ACTIVE_LINES_M1 0x07ff0000L #define OV0_VID_BUF0_BASE_ADRS 0x0440 # define R128_VIF_BUF0_PITCH_SEL 0x00000001L # define R128_VIF_BUF0_TILE_ADRS 0x00000002L # define R128_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L # define R128_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L #define OV0_VID_BUF1_BASE_ADRS 0x0444 # define R128_VIF_BUF1_PITCH_SEL 0x00000001L # define R128_VIF_BUF1_TILE_ADRS 0x00000002L # define R128_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L # define R128_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L #define OV0_VID_BUF2_BASE_ADRS 0x0448 # define R128_VIF_BUF2_PITCH_SEL 0x00000001L # define R128_VIF_BUF2_TILE_ADRS 0x00000002L # define R128_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L # define R128_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L #define OV0_VID_BUF3_BASE_ADRS 0x044C #define OV0_VID_BUF4_BASE_ADRS 0x0450 #define OV0_VID_BUF5_BASE_ADRS 0x0454 #define OV0_VID_BUF_PITCH0_VALUE 0x0460 #define OV0_VID_BUF_PITCH1_VALUE 0x0464 #define OV0_AUTO_FLIP_CNTL 0x0470 #define OV0_DEINTERLACE_PATTERN 0x0474 #define OV0_H_INC 0x0480 #define OV0_STEP_BY 0x0484 #define OV0_P1_H_ACCUM_INIT 0x0488 #define OV0_P23_H_ACCUM_INIT 0x048C #define OV0_P1_X_START_END 0x0494 #define OV0_P2_X_START_END 0x0498 #define OV0_P3_X_START_END 0x049C #define OV0_FILTER_CNTL 0x04A0 #define OV0_FOUR_TAP_COEF_0 0x04B0 #define OV0_FOUR_TAP_COEF_1 0x04B4 #define OV0_FOUR_TAP_COEF_2 0x04B8 #define OV0_FOUR_TAP_COEF_3 0x04BC #define OV0_FOUR_TAP_COEF_4 0x04C0 #define OV0_COLOR_CNTL 0x04E0 #define OV0_VIDEO_KEY_CLR 0x04E4 #define OV0_VIDEO_KEY_MSK 0x04E8 #define OV0_GRAPHICS_KEY_CLR 0x04EC #define OV0_GRAPHICS_KEY_MSK 0x04F0 #define OV0_KEY_CNTL 0x04F4 # define R128_VIDEO_KEY_FN_MASK 0x00000007L # define R128_VIDEO_KEY_FN_FALSE 0x00000000L # define R128_VIDEO_KEY_FN_TRUE 0x00000001L # define R128_VIDEO_KEY_FN_EQ 0x00000004L # define R128_VIDEO_KEY_FN_NE 0x00000005L # define R128_GRAPHIC_KEY_FN_MASK 0x00000070L # define R128_GRAPHIC_KEY_FN_FALSE 0x00000000L # define R128_GRAPHIC_KEY_FN_TRUE 0x00000010L # define R128_GRAPHIC_KEY_FN_EQ 0x00000040L # define R128_GRAPHIC_KEY_FN_NE 0x00000050L # define R128_CMP_MIX_MASK 0x00000100L # define R128_CMP_MIX_OR 0x00000000L # define R128_CMP_MIX_AND 0x00000100L #define OV0_TEST 0x04F8 /* added by DirectFB programmers */ #define CRTC_OFFSET_FLIP_CNTL 0x00010000 #define MEM_ADDR_CONFIG 0x0148 #endif DirectFB-1.2.10/gfxdrivers/ati128/ati128_overlay.c0000644000175000017500000003440211245562152016254 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "ati128.h" typedef struct { CoreLayerRegionConfig config; /* overlay registers */ struct { u32 H_INC; u32 STEP_BY; u32 Y_X_START; u32 Y_X_END; u32 V_INC; u32 P1_BLANK_LINES_AT_TOP; u32 P23_BLANK_LINES_AT_TOP; u32 VID_BUF_PITCH0_VALUE; u32 VID_BUF_PITCH1_VALUE; u32 P1_X_START_END; u32 P2_X_START_END; u32 P3_X_START_END; u32 VID_BUF0_BASE_ADRS; u32 VID_BUF1_BASE_ADRS; u32 VID_BUF2_BASE_ADRS; u32 P1_V_ACCUM_INIT; u32 P23_V_ACCUM_INIT; u32 P1_H_ACCUM_INIT; u32 P23_H_ACCUM_INIT; u32 SCALE_CNTL; } regs; } ATIOverlayLayerData; static void ov0_set_regs( ATI128DriverData *adrv, ATIOverlayLayerData *aov0 ); static void ov0_calc_regs( ATI128DriverData *adrv, ATIOverlayLayerData *aov0, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); #define OV0_SUPPORTED_OPTIONS (DLOP_NONE) /**********************/ static int ov0LayerDataSize( void ) { return sizeof(ATIOverlayLayerData); } static DFBResult ov0InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; volatile u8 *mmio = adrv->mmio_base; /* set capabilities and type */ description->caps = DLCAPS_SCREEN_LOCATION | DLCAPS_SURFACE; description->type = DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "ATI128 Overlay" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ adjustment->flags = DCAF_NONE; /* reset overlay */ ati128_out32( mmio, OV0_SCALE_CNTL, 0x80000000 ); ati128_out32( mmio, OV0_EXCLUSIVE_HORZ, 0 ); ati128_out32( mmio, OV0_AUTO_FLIP_CNTL, 0 ); ati128_out32( mmio, OV0_FILTER_CNTL, 0x0000000f ); ati128_out32( mmio, OV0_COLOR_CNTL, 0x00101000 ); ati128_out32( mmio, OV0_KEY_CNTL, 0x10 ); ati128_out32( mmio, OV0_TEST, 0 ); return DFB_OK; } static void ov0OnOff( ATI128DriverData *adrv, ATIOverlayLayerData *aov0, int on ) { /* set/clear enable bit */ if (on) aov0->regs.SCALE_CNTL |= R128_SCALER_ENABLE; else aov0->regs.SCALE_CNTL &= ~R128_SCALER_ENABLE; /* write back to card */ ati128_out32( adrv->mmio_base, OV0_SCALE_CNTL, aov0->regs.SCALE_CNTL ); } static DFBResult ov0TestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { CoreLayerRegionConfigFlags fail = 0; /* check for unsupported options */ if (config->options & ~OV0_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; /* check pixel format */ switch (config->format) { case DSPF_YUY2: case DSPF_UYVY: case DSPF_I420: case DSPF_YV12: break; default: fail |= CLRCF_FORMAT; } /* check width */ if (config->width > 2048 || config->width < 1) fail |= CLRCF_WIDTH; /* check height */ if (config->height > 1024 || config->height < 1) fail |= CLRCF_HEIGHT; /* write back failing fields */ if (failed) *failed = fail; /* return failure if any field failed */ if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ov0SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; ATIOverlayLayerData *aov0 = (ATIOverlayLayerData*) layer_data; /* remember configuration */ aov0->config = *config; ov0_calc_regs( adrv, aov0, config, surface, lock ); ov0_set_regs( adrv, aov0 ); /* enable overlay */ ov0OnOff( adrv, aov0, 1 ); return DFB_OK; } static DFBResult ov0RemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; ATIOverlayLayerData *aov0 = (ATIOverlayLayerData*) layer_data; /* disable overlay */ ov0OnOff( adrv, aov0, 0 ); return DFB_OK; } static DFBResult ov0FlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; ATIOverlayLayerData *aov0 = (ATIOverlayLayerData*) layer_data; dfb_surface_flip( surface, false ); ov0_calc_regs( adrv, aov0, &aov0->config, surface, lock ); ov0_set_regs( adrv, aov0 ); return DFB_OK; } DisplayLayerFuncs atiOverlayFuncs = { .LayerDataSize = ov0LayerDataSize, .InitLayer = ov0InitLayer, .TestRegion = ov0TestRegion, .SetRegion = ov0SetRegion, .RemoveRegion = ov0RemoveRegion, .FlipRegion = ov0FlipRegion, }; /* internal */ static void ov0_set_regs( ATI128DriverData *adrv, ATIOverlayLayerData *aov0 ) { volatile u8 *mmio = adrv->mmio_base; ati128_out32( mmio, OV0_REG_LOAD_CNTL, 1 ); while (!(ati128_in32( mmio, OV0_REG_LOAD_CNTL ) & (1 << 3))); ati128_out32( mmio, OV0_H_INC, aov0->regs.H_INC ); ati128_out32( mmio, OV0_STEP_BY, aov0->regs.STEP_BY ); ati128_out32( mmio, OV0_Y_X_START, aov0->regs.Y_X_START ); ati128_out32( mmio, OV0_Y_X_END, aov0->regs.Y_X_END ); ati128_out32( mmio, OV0_V_INC, aov0->regs.V_INC ); ati128_out32( mmio, OV0_P1_BLANK_LINES_AT_TOP, aov0->regs.P1_BLANK_LINES_AT_TOP ); ati128_out32( mmio, OV0_P23_BLANK_LINES_AT_TOP, aov0->regs.P23_BLANK_LINES_AT_TOP ); ati128_out32( mmio, OV0_VID_BUF_PITCH0_VALUE, aov0->regs.VID_BUF_PITCH0_VALUE ); ati128_out32( mmio, OV0_VID_BUF_PITCH1_VALUE, aov0->regs.VID_BUF_PITCH1_VALUE ); ati128_out32( mmio, OV0_P1_X_START_END, aov0->regs.P1_X_START_END ); ati128_out32( mmio, OV0_P2_X_START_END, aov0->regs.P2_X_START_END ); ati128_out32( mmio, OV0_P3_X_START_END, aov0->regs.P3_X_START_END ); ati128_out32( mmio, OV0_VID_BUF0_BASE_ADRS, aov0->regs.VID_BUF0_BASE_ADRS ); ati128_out32( mmio, OV0_VID_BUF1_BASE_ADRS, aov0->regs.VID_BUF1_BASE_ADRS ); ati128_out32( mmio, OV0_VID_BUF2_BASE_ADRS, aov0->regs.VID_BUF2_BASE_ADRS ); ati128_out32( mmio, OV0_P1_V_ACCUM_INIT, aov0->regs.P1_V_ACCUM_INIT ); ati128_out32( mmio, OV0_P23_V_ACCUM_INIT, aov0->regs.P23_V_ACCUM_INIT ); ati128_out32( mmio, OV0_P1_H_ACCUM_INIT, aov0->regs.P1_H_ACCUM_INIT ); ati128_out32( mmio, OV0_P23_H_ACCUM_INIT, aov0->regs.P23_H_ACCUM_INIT ); ati128_out32( mmio, OV0_SCALE_CNTL, aov0->regs.SCALE_CNTL ); ati128_out32( mmio, OV0_REG_LOAD_CNTL, 0 ); } static void ov0_calc_regs( ATI128DriverData *adrv, ATIOverlayLayerData *aov0, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { int h_inc, v_inc, step_by, tmp; int p1_h_accum_init, p23_h_accum_init; int p1_v_accum_init, p23_v_accum_init; DFBRegion dstBox; int dst_w; int dst_h; u32 offset_u = 0, offset_v = 0; /* destination box */ dstBox.x1 = config->dest.x; dstBox.y1 = config->dest.y; dstBox.x2 = config->dest.x + config->dest.w; dstBox.y2 = config->dest.y + config->dest.h; /* destination size */ dst_w = config->dest.w; dst_h = config->dest.h; /* clear everything but the enable bit that may be set*/ aov0->regs.SCALE_CNTL &= R128_SCALER_ENABLE; /* calculate incrementors */ h_inc = (surface->config.size.w << 12) / dst_w; v_inc = (surface->config.size.h << 20) / dst_h; step_by = 1; while (h_inc >= (2 << 12)) { step_by++; h_inc >>= 1; } /* calculate values for horizontal accumulators */ tmp = 0x00028000 + (h_inc << 3); p1_h_accum_init = ((tmp << 4) & 0x000f8000) | ((tmp << 12) & 0xf0000000); tmp = 0x00028000 + (h_inc << 2); p23_h_accum_init = ((tmp << 4) & 0x000f8000) | ((tmp << 12) & 0x70000000); /* calculate values for vertical accumulators */ tmp = 0x00018000; p1_v_accum_init = ((tmp << 4) & 0x03ff8000) | 0x00000001; tmp = 0x00018000; p23_v_accum_init = ((tmp << 4) & 0x01ff8000) | 0x00000001; /* choose pixel format and calculate buffer offsets for planar modes */ switch (surface->config.format) { case DSPF_UYVY: aov0->regs.SCALE_CNTL = R128_SCALER_SOURCE_YVYU422; break; case DSPF_YUY2: aov0->regs.SCALE_CNTL = R128_SCALER_SOURCE_VYUY422; break; case DSPF_I420: aov0->regs.SCALE_CNTL = R128_SCALER_SOURCE_YUV12; offset_u = lock->offset + surface->config.size.h * lock->pitch; offset_v = offset_u + (surface->config.size.h >> 1) * (lock->pitch >> 1); break; case DSPF_YV12: aov0->regs.SCALE_CNTL = R128_SCALER_SOURCE_YUV12; offset_v = lock->offset + surface->config.size.h * lock->pitch; offset_u = offset_v + (surface->config.size.h >> 1) * (lock->pitch >> 1); break; default: D_BUG("unexpected pixelformat"); aov0->regs.SCALE_CNTL = 0; return; } aov0->regs.SCALE_CNTL |= R128_SCALER_DOUBLE_BUFFER | R128_SCALER_BURST_PER_PLANE | R128_SCALER_Y2R_TEMP | R128_SCALER_PIX_EXPAND; aov0->regs.H_INC = h_inc | ((h_inc >> 1) << 16); aov0->regs.V_INC = v_inc; aov0->regs.STEP_BY = step_by | (step_by << 8); aov0->regs.Y_X_START = dstBox.x1 | (dstBox.y1 << 16); aov0->regs.Y_X_END = dstBox.x2 | (dstBox.y2 << 16); aov0->regs.P1_BLANK_LINES_AT_TOP = 0x00000fff | ((surface->config.size.h - 1) << 16); aov0->regs.P23_BLANK_LINES_AT_TOP = 0x000007ff | ((((surface->config.size.h + 1) >> 1) - 1) << 16); aov0->regs.VID_BUF_PITCH0_VALUE = lock->pitch; aov0->regs.VID_BUF_PITCH1_VALUE = lock->pitch >> 1; aov0->regs.P1_X_START_END = surface->config.size.w - 1; aov0->regs.P2_X_START_END = (surface->config.size.w >> 1) - 1; aov0->regs.P3_X_START_END = (surface->config.size.w >> 1) - 1; aov0->regs.VID_BUF0_BASE_ADRS = lock->offset & 0x03fffff0; aov0->regs.VID_BUF1_BASE_ADRS = (offset_u & 0x03fffff0) | 1; aov0->regs.VID_BUF2_BASE_ADRS = (offset_v & 0x03fffff0) | 1; aov0->regs.P1_H_ACCUM_INIT = p1_h_accum_init; aov0->regs.P23_H_ACCUM_INIT = p23_h_accum_init; aov0->regs.P1_V_ACCUM_INIT = p1_v_accum_init; aov0->regs.P23_V_ACCUM_INIT = p23_v_accum_init; } DirectFB-1.2.10/gfxdrivers/ati128/ati128.h0000644000175000017500000000435311245562152014522 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___ATI128_H__ #define ___ATI128_H__ #include #include #include typedef struct { volatile u8 *mmio_base; } ATI128DriverData; typedef struct { CoreSurface *source; CoreSurface *destination; CoreSurfaceBufferLock *src; DFBSurfaceBlittingFlags blittingflags; /* store some ATI register values in native format */ u32 ATI_dst_bpp; u32 ATI_color_compare; u32 ATI_blend_function; /* used for the fake texture hack */ u32 ATI_fake_texture_src; u32 fake_texture_color; unsigned int fake_texture_number; /* state validation */ int v_destination; int v_color; int v_blending_function; int v_source; int v_src_colorkey; int v_blittingflags; /* for fifo/performance monitoring */ unsigned int fifo_space; unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; } ATI128DeviceData; extern DisplayLayerFuncs atiOverlayFuncs; #endif DirectFB-1.2.10/gfxdrivers/ati128/ati128.c0000644000175000017500000007126311245562152014521 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( ati128 ) #include "regs.h" #include "mmio.h" #include "ati128_state.h" #include "ati128.h" /* driver capability flags */ #ifndef __powerpc__ #define ATI128_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #else #define ATI128_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_NOFX) #endif #define ATI128_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE) #define ATI128_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_SRC_COLORKEY | DSBLIT_BLEND_ALPHACHANNEL) #define ATI128_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT) /* macro for S12.0 and S14.0 format */ #define S12(val) (((u16)((s16)(val)))&0x3fff) #define S14(val) (((u16)((s16)(val)))&0x3fff) /** CARD FUNCTIONS **/ static bool ati128FillRectangle( void *drv, void *dev, DFBRectangle *rect ); static bool ati128FillBlendRectangle( void *drv, void *dev, DFBRectangle *rect ); static bool ati128DrawRectangle( void *drv, void *dev, DFBRectangle *rect ); static bool ati128DrawBlendRectangle( void *drv, void *dev, DFBRectangle *rect ); /* required implementations */ static DFBResult ati128EngineSync( void *drv, void *dev ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; ati128_waitidle( adrv, adev ); return DFB_OK; } static bool ati128_check_blend( CardState *state ) { if (state->dst_blend == DSBF_SRCALPHASAT) return false; return true; } static void ati128CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { case DSPF_RGB332: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } /* check for the special drawing function that does not support the usually supported drawingflags */ if (accel == DFXL_DRAWLINE && state->drawingflags != DSDRAW_NOFX) return; /* if there are no other drawing flags than the supported */ if (!(accel & ~ATI128_SUPPORTED_DRAWINGFUNCTIONS) && !(state->drawingflags & ~ATI128_SUPPORTED_DRAWINGFLAGS)) { if (state->drawingflags & DSDRAW_BLEND && !ati128_check_blend( state )) return; state->accel |= ATI128_SUPPORTED_DRAWINGFUNCTIONS; } /* if there are no other blitting flags than the supported and the source has the minimum size */ if (!(accel & ~ATI128_SUPPORTED_BLITTINGFUNCTIONS) && !(state->blittingflags & ~ATI128_SUPPORTED_BLITTINGFLAGS) && state->source && state->source->config.size.w >= 8 && state->source->config.size.h >= 8 ) { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL && !ati128_check_blend( state )) return; switch (state->source->config.format) { case DSPF_RGB332: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB24: case DSPF_RGB32: case DSPF_ARGB: state->accel |= ATI128_SUPPORTED_BLITTINGFUNCTIONS; default: ; } } } static void ati128SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; if (state->mod_hw & SMF_SOURCE) adev->v_source = 0; if (state->mod_hw & SMF_DESTINATION) adev->v_destination = adev->v_color = 0; if (state->mod_hw & SMF_COLOR) adev->v_color = 0; if (state->mod_hw & SMF_SRC_COLORKEY) adev->v_src_colorkey = 0; if (state->mod_hw & SMF_BLITTING_FLAGS) adev->v_blittingflags = 0; if (state->mod_hw & (SMF_SRC_BLEND | SMF_DST_BLEND)) adev->v_blending_function = 0; ati128_set_destination( adrv, adev, state); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: if (state->drawingflags & DSDRAW_BLEND) { ati128_set_blending_function( adrv, adev, state ); funcs->FillRectangle = ati128FillBlendRectangle; funcs->DrawRectangle = ati128DrawBlendRectangle; } else { funcs->FillRectangle = ati128FillRectangle; funcs->DrawRectangle = ati128DrawRectangle; } case DFXL_DRAWLINE: ati128_set_color( adrv, adev, state ); state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWLINE | DFXL_DRAWRECTANGLE ; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: ati128_set_source( adrv, adev, state ); if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) ati128_set_blending_function( adrv, adev, state ); if (state->blittingflags & DSBLIT_SRC_COLORKEY) ati128_set_src_colorkey( adrv, adev, state ); ati128_set_blittingflags( adrv, adev, state ); state->set |= DFXL_BLIT | DFXL_STRETCHBLIT; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } if (state->mod_hw & SMF_CLIP) ati128_set_clip( adrv, adev, state); state->mod_hw = 0; } static bool ati128FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; ati128_waitfifo( adrv, adev, 5 ); /* set the destination datatype */ ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | BRUSH_SOLIDCOLOR ); /* set direction */ ati128_out32( mmio, DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM); /* set the drawing command */ ati128_out32( mmio, DP_MIX, ROP3_PATCOPY | DP_SRC_RECT ); /* set parameters */ ati128_out32( mmio, DST_Y_X, (S14(rect->y) << 16) | S12(rect->x) ); /* this executes the drawing command */ ati128_out32( mmio, DST_HEIGHT_WIDTH, (rect->h << 16) | rect->w ); return true; } static bool ati128FillBlendRectangle( void *drv, void *dev, DFBRectangle *rect ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; u32 fts = adev->ATI_fake_texture_src + (adev->fake_texture_number & 7)*4; ati128_waitidle( adrv, adev ); *((u32*) dfb_gfxcard_memory_virtual(NULL,fts) ) = adev->fake_texture_color; ati128_waitidle( adrv, adev ); ati128_out32( mmio, SCALE_3D_DATATYPE, DST_32BPP ); ati128_out32( mmio, SCALE_PITCH, 1 ); /* enable scaling with filtering */ ati128_out32( mmio, SCALE_3D_CNTL, adev->ATI_blend_function ); ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | SRC_DSTCOLOR ); ati128_out32( mmio, DP_MIX, ROP3_SRCCOPY | DP_SRC_RECT ); /* flush the texture cache */ ati128_out32( mmio, TEX_CNTL, TEX_CNTL_ALPHA_EN_ON | TEX_CNTL_TEX_CACHE_FLUSH_ON); /* set source offset */ ati128_out32( mmio, SCALE_OFFSET_0, fts ) ; /* set height and width of the source */ ati128_out32( mmio, SCALE_SRC_HEIGHT_WIDTH, (8 << 16) | 8); /* set the scaling increment registers */ ati128_out32( mmio, SCALE_X_INC, 0 ); ati128_out32( mmio, SCALE_Y_INC, 0 ); /* reset accumulator regs */ ati128_out32( mmio, SCALE_HACC, 0x00000000 ); ati128_out32( mmio, SCALE_VACC, 0x00000000 ); /* set the destination coordinates */ ati128_out32( mmio, SCALE_DST_X_Y, (S12(rect->x) << 16) | S14(rect->y) ); /* set destination height and width and perform the blit */ ati128_out32( mmio, SCALE_DST_HEIGHT_WIDTH, (rect->h << 16) | rect->w ); /*reset scaling and texture control register */ ati128_out32( mmio, SCALE_3D_CNTL, 0x00000000 ); ati128_out32( mmio, TEX_CNTL, 0); adev->fake_texture_number++; return true; } static bool ati128DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; ati128_waitfifo( adrv, adev, 3 ); /* set the destination datatype */ ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | BRUSH_SOLIDCOLOR ); /* set direction */ ati128_out32( mmio, DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM); /* set the drawing command */ ati128_out32( mmio, DP_MIX, ROP3_PATCOPY | DP_SRC_RECT ); ati128_waitfifo( adrv, adev, 7 ); /* first line */ ati128_out32( mmio, DST_Y_X, (S14(rect->y) << 16) | S12(rect->x)); ati128_out32( mmio, DST_HEIGHT_WIDTH, (rect->h << 16) | 1); /* second line */ ati128_out32( mmio, DST_HEIGHT_WIDTH, (1 << 16) | rect->w ); /* third line */ ati128_out32( mmio, DST_Y_X, (S14(rect->y+rect->h-1) << 16) | S12(rect->x)); ati128_out32( mmio, DST_HEIGHT_WIDTH, (1 << 16) | rect->w ); /* fourth line */ ati128_out32( mmio, DST_Y_X, (S14(rect->y) << 16) | S12(rect->x+rect->w-1)); ati128_out32( mmio, DST_HEIGHT_WIDTH, rect->h << 16 | 1); return true; } static bool ati128DrawBlendRectangle( void *drv, void *dev, DFBRectangle *rect ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; u32 fts = adev->ATI_fake_texture_src + (adev->fake_texture_number & 7)*4; ati128_waitidle( adrv, adev ); *((u32*) dfb_gfxcard_memory_virtual(NULL,fts) ) = adev->fake_texture_color; ati128_waitidle( adrv, adev ); ati128_out32( mmio, SCALE_3D_DATATYPE, DST_32BPP ); ati128_out32( mmio, SCALE_PITCH, 1 ); /* enable scaling with filtering */ ati128_out32( mmio, SCALE_3D_CNTL, adev->ATI_blend_function ); ati128_out32( mmio, TEX_CNTL, TEX_CNTL_ALPHA_EN_ON | TEX_CNTL_TEX_CACHE_FLUSH_ON); ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | SRC_DSTCOLOR ); ati128_out32( mmio, DP_MIX, ROP3_SRCCOPY | DP_SRC_RECT ); /* set source offset */ ati128_out32( mmio, SCALE_OFFSET_0, adev->ATI_fake_texture_src ); /* set height and width of the source */ ati128_out32( mmio, SCALE_SRC_HEIGHT_WIDTH, (8 << 16) | 8); /* set the scaling increment registers */ ati128_out32( mmio, SCALE_X_INC, 0 ); ati128_out32( mmio, SCALE_Y_INC, 0 ); /* reset accumulator regs */ ati128_out32( mmio, SCALE_HACC, 0x00000000 ); ati128_out32( mmio, SCALE_VACC, 0x00000000 ); /* set the destination coordinates */ /*-----------------------*/ /* first line */ ati128_out32( mmio, SCALE_DST_X_Y, (S12(rect->x) << 16) | S14(rect->y) ); ati128_out32( mmio, SCALE_DST_HEIGHT_WIDTH, (rect->h << 16) | 1); /* second line */ ati128_out32( mmio, SCALE_DST_HEIGHT_WIDTH, (1 << 16) | rect->w ); /* third line */ ati128_out32( mmio, SCALE_DST_X_Y, (S12(rect->x) << 16) | S14(rect->y+rect->h-1)); ati128_out32( mmio, SCALE_DST_HEIGHT_WIDTH, (1 << 16) | rect->w ); /* fourth line */ ati128_out32( mmio, SCALE_DST_X_Y, (S12(rect->x+rect->w-1) << 16) | S14(rect->y)); ati128_out32( mmio, SCALE_DST_HEIGHT_WIDTH, rect->h << 16 | 1); /*-----------------------*/ /* reset scaling and texture control register */ ati128_out32( mmio, SCALE_3D_CNTL, 0x00000000 ); ati128_out32( mmio, TEX_CNTL, 0 ); adev->fake_texture_number++; return true; } static bool ati128DrawLine( void *drv, void *dev, DFBRegion *line ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; int dx, dy; int small, large; int x_dir, y_dir, y_major; int err, inc, dec; /* Determine x & y deltas and x & y direction bits. */ if (line->x1 < line->x2) { dx = line->x2 - line->x1; x_dir = 1 << 31; } else { dx = line->x1 - line->x2; x_dir = 0 << 31; } if (line->y1 < line->y2) { dy = line->y2 - line->y1; y_dir = 1 << 15; } else { dy = line->y1 - line->y2; y_dir = 0 << 15; } /* Determine x & y min and max values; also determine y major bit. */ if (dx < dy) { small = dx; large = dy; y_major = 1 << 2; } else { small = dy; large = dx; y_major = 0 << 2; } /* Calculate Bresenham parameters and draw line. */ err = -large; inc = small * 2; dec = large *(-2); ati128_waitfifo( adrv, adev, 8 ); /* set the destination datatype */ ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | BRUSH_SOLIDCOLOR | ROP3_SRCCOPY ); ati128_out32( mmio, DP_MIX, ROP3_PATCOPY ); /* set start coorinates */ ati128_out32( mmio, DST_Y_X, (S14(line->y1) << 16) | S12(line->x1)); /* allow setting of last pel bit and polygon outline bit for line drawing */ ati128_out32( mmio, DP_CNTL_XDIR_YDIR_YMAJOR, y_major | y_dir | x_dir ); /* set bresenham registers and start drawing */ ati128_out32( mmio, DST_BRES_ERR, err ); ati128_out32( mmio, DST_BRES_INC, inc ); ati128_out32( mmio, DST_BRES_DEC, dec ); ati128_out32( mmio, DST_BRES_LNTH, large + 1 ); return true; } static bool ati128StretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; u32 src = 0; u32 scalex = (u32)(((double)sr->w/(double)dr->w) * 65536); u32 scaley = (u32)(((double)sr->h/(double)dr->h) * 65536); ati128_waitfifo( adrv, adev, 9 ); /* make sure that color compare register is restored to last state */ ati128_out32( mmio, CLR_CMP_CNTL, adev->ATI_color_compare ); switch (adev->source->config.format) { case DSPF_RGB332: ati128_out32( mmio, SCALE_3D_DATATYPE, DST_8BPP_RGB332 ); ati128_out32( mmio, SCALE_PITCH, adev->src->pitch >>3); src = adev->src->offset + sr->y * adev->src->pitch + sr->x; ati128_out32( mmio, TEX_CNTL, 0); break; case DSPF_ARGB1555: /* FIXME: alpha channel will be zero ;( */ ati128_out32( mmio, SCALE_3D_DATATYPE, DST_15BPP ); ati128_out32( mmio, SCALE_PITCH, adev->src->pitch >>4); src = adev->src->offset + sr->y * adev->src->pitch + sr->x*2; ati128_out32( mmio, TEX_CNTL, 0); break; case DSPF_RGB16: ati128_out32( mmio, SCALE_3D_DATATYPE, DST_16BPP ); ati128_out32( mmio, SCALE_PITCH, adev->src->pitch >>4); src = adev->src->offset + sr->y * adev->src->pitch + sr->x*2; ati128_out32( mmio, TEX_CNTL, 0); break; case DSPF_RGB24: ati128_out32( mmio, SCALE_3D_DATATYPE, DST_24BPP ); ati128_out32( mmio, SCALE_PITCH, adev->src->pitch >>3); src = adev->src->offset + sr->y * adev->src->pitch + sr->x*3; ati128_out32( mmio, TEX_CNTL, 0); break; case DSPF_RGB32: ati128_out32( mmio, SCALE_3D_DATATYPE, DST_32BPP ); ati128_out32( mmio, SCALE_PITCH, adev->src->pitch >>5); src = adev->src->offset + sr->y * adev->src->pitch + sr->x*4; ati128_out32( mmio, TEX_CNTL, 0); break; case DSPF_ARGB: ati128_out32( mmio, SCALE_3D_DATATYPE, DST_32BPP ); ati128_out32( mmio, SCALE_PITCH, adev->src->pitch >>5); src = adev->src->offset + sr->y * adev->src->pitch + sr->x*4; if (adev->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) ati128_out32( mmio, TEX_CNTL, TEX_CNTL_ALPHA_EN_ON ); else ati128_out32( mmio, TEX_CNTL, 0 ); break; default: D_BUG( "unexpected pixelformat!" ); return false; } ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | SRC_DSTCOLOR ); /* set the blend function */ if (adev->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) ati128_out32( mmio, SCALE_3D_CNTL, adev->ATI_blend_function ); else ati128_out32( mmio, SCALE_3D_CNTL, SCALE_3D_CNTL_SCALE_3D_FN_SCALE ); /* set up source data and copy type */ ati128_out32( mmio, DP_MIX, ROP3_SRCCOPY | DP_SRC_RECT ); /* set source offset */ ati128_out32( mmio, SCALE_OFFSET_0, src); /* set height and width of the source */ ati128_out32( mmio, SCALE_SRC_HEIGHT_WIDTH, (sr->h << 16) | sr->w); ati128_waitfifo( adrv, adev, 9 ); /* set the scaling increment registers */ ati128_out32( mmio, SCALE_X_INC, scalex ); ati128_out32( mmio, SCALE_Y_INC, scaley ); /* reset accumulator regs */ ati128_out32( mmio, SCALE_HACC, 0x00000000 ); ati128_out32( mmio, SCALE_VACC, 0x00000000 ); /* set the destination coordinates */ ati128_out32( mmio, SCALE_DST_X_Y, (S12(dr->x) << 16) | S14(dr->y) ); /* set destination height and width and perform the blit */ ati128_out32( mmio, SCALE_DST_HEIGHT_WIDTH, (dr->h << 16) | dr->w ); /*reset scaling and texture control register */ ati128_out32( mmio, SCALE_3D_CNTL, 0x00000000 ); ati128_out32( mmio, TEX_CNTL, 0x00000000 ); /* set CLR_CMP_CNTL to zero, to insure that drawing funcions work corrently */ if (adev->ATI_color_compare) ati128_out32( mmio, CLR_CMP_CNTL, 0 ); return true; } static bool ati128Blit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { ATI128DriverData *adrv = (ATI128DriverData*) drv; ATI128DeviceData *adev = (ATI128DeviceData*) dev; volatile u8 *mmio = adrv->mmio_base; u32 dir_cmd = 0; if ((adev->source->config.format != adev->destination->config.format) || (adev->blittingflags & DSBLIT_BLEND_ALPHACHANNEL)) { DFBRectangle sr = { rect->x, rect->y, rect->w, rect->h }; DFBRectangle dr = { dx, dy, rect->w, rect->h }; ati128StretchBlit( adrv, adev, &sr, &dr ); return true; } /* check which blitting direction should be used */ if (rect->x <= dx) { dir_cmd |= DST_X_RIGHT_TO_LEFT; rect->x += rect->w-1; dx += rect->w-1; } else { dir_cmd |= DST_X_LEFT_TO_RIGHT; } if (rect->y <= dy) { dir_cmd |= DST_Y_BOTTOM_TO_TOP; rect->y += rect->h-1; dy += rect->h-1; } else { dir_cmd |= DST_Y_TOP_TO_BOTTOM; } ati128_waitfifo( adrv, adev, 9 ); /* make sure that color compare register is restored to last state */ ati128_out32( mmio, CLR_CMP_CNTL, adev->ATI_color_compare ); /* set blitting direction */ ati128_out32( mmio, DP_CNTL, dir_cmd ); ati128_out32( mmio, DP_DATATYPE, adev->ATI_dst_bpp | SRC_DSTCOLOR ); ati128_out32( mmio, DP_MIX, ROP3_SRCCOPY | DP_SRC_RECT ); ati128_out32( mmio, SRC_Y_X, (rect->y << 16) | rect->x); ati128_out32( mmio, DST_Y_X, (S14(dy) << 16) | S12(dx) ); ati128_out32( mmio, DST_HEIGHT_WIDTH, (rect->h << 16) | rect->w); /* set CLR_CMP_CNTL to zero, to insure that drawing funcions work corrently */ if (adev->ATI_color_compare) ati128_out32( mmio, CLR_CMP_CNTL, 0 ); if (dir_cmd != (DST_Y_TOP_TO_BOTTOM | DST_X_LEFT_TO_RIGHT)) { ati128_out32( mmio, DP_CNTL, DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM ); } return true; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_ATI_RAGE128: /* ATI Rage 128 */ return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "ATI Rage 128 Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); info->version.major = 0; info->version.minor = 2; info->driver_data_size = sizeof (ATI128DriverData); info->device_data_size = sizeof (ATI128DeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; adrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!adrv->mmio_base) return DFB_IO; funcs->CheckState = ati128CheckState; funcs->SetState = ati128SetState; funcs->EngineSync = ati128EngineSync; funcs->FillRectangle = ati128FillRectangle; funcs->DrawRectangle = ati128DrawRectangle; funcs->DrawLine = ati128DrawLine; funcs->Blit = ati128Blit; funcs->StretchBlit = ati128StretchBlit; /* overlay support */ dfb_layers_register( dfb_screens_at(DSCID_PRIMARY), driver_data, &atiOverlayFuncs ); return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; ATI128DeviceData *adev = (ATI128DeviceData*) device_data; volatile u8 *mmio = adrv->mmio_base; /* fill device info */ snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Rage 128" ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "ATI" ); device_info->caps.flags = CCF_CLIPPING; device_info->caps.accel = ATI128_SUPPORTED_DRAWINGFUNCTIONS | ATI128_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = ATI128_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = ATI128_SUPPORTED_BLITTINGFLAGS; device_info->limits.surface_byteoffset_alignment = 32 * 4; device_info->limits.surface_pixelpitch_alignment = 32; /* initialize card */ ati128_waitfifo( adrv, adev, 6 ); ati128_out32( mmio, DP_GUI_MASTER_CNTL, GMC_SRC_PITCH_OFFSET_DEFAULT | GMC_DST_PITCH_OFFSET_DEFAULT | GMC_SRC_CLIP_DEFAULT | GMC_DST_CLIP_DEFAULT | GMC_BRUSH_SOLIDCOLOR | GMC_SRC_DSTCOLOR | GMC_BYTE_ORDER_MSB_TO_LSB | GMC_DP_CONVERSION_TEMP_6500 | ROP3_PATCOPY | GMC_DP_SRC_RECT | GMC_3D_FCN_EN_CLR | GMC_DST_CLR_CMP_FCN_CLEAR | GMC_AUX_CLIP_CLEAR | GMC_WRITE_MASK_SET); ati128_out32( mmio, SCALE_3D_CNTL, 0x00000000 ); ati128_out32( mmio, TEX_CNTL, 0x00000000 ); /* reserve 32bit pixel for fake texture at end of framebuffer */ adev->ATI_fake_texture_src = dfb_gfxcard_reserve_memory( device, 4*32 ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { ATI128DeviceData *adev = (ATI128DeviceData*) device_data; ATI128DriverData *adrv = (ATI128DriverData*) driver_data; volatile u8 *mmio = adrv->mmio_base; D_DEBUG( "DirectFB/ATI128: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFB/ATI128: %9d ati128_waitfifo calls\n", adev->waitfifo_calls ); D_DEBUG( "DirectFB/ATI128: %9d register writes (ati128_waitfifo sum)\n", adev->waitfifo_sum ); D_DEBUG( "DirectFB/ATI128: %9d FIFO wait cycles (depends on CPU)\n", adev->fifo_waitcycles ); D_DEBUG( "DirectFB/ATI128: %9d IDLE wait cycles (depends on CPU)\n", adev->idle_waitcycles ); D_DEBUG( "DirectFB/ATI128: %9d FIFO space cache hits(depends on CPU)\n", adev->fifo_cache_hits ); D_DEBUG( "DirectFB/ATI128: Conclusion:\n" ); D_DEBUG( "DirectFB/ATI128: Average register writes/ati128_waitfifo" "call:%.2f\n", adev->waitfifo_sum/(float)(adev->waitfifo_calls) ); D_DEBUG( "DirectFB/ATI128: Average wait cycles/ati128_waitfifo call:" " %.2f\n", adev->fifo_waitcycles/(float)(adev->waitfifo_calls) ); D_DEBUG( "DirectFB/ATI128: Average fifo space cache hits: %02d%%\n", (int)(100 * adev->fifo_cache_hits/ (float)(adev->waitfifo_calls)) ); /* clean up, make sure that aty128fb does not hang in kernel space afterwards */ ati128_waitfifo( adrv, adev, 3 ); ati128_out32( mmio, DP_GUI_MASTER_CNTL, GMC_SRC_PITCH_OFFSET_DEFAULT | GMC_DST_PITCH_OFFSET_DEFAULT | GMC_SRC_CLIP_DEFAULT | GMC_DST_CLIP_DEFAULT | GMC_BRUSH_SOLIDCOLOR | GMC_SRC_DSTCOLOR | GMC_BYTE_ORDER_MSB_TO_LSB | GMC_DP_CONVERSION_TEMP_6500 | ROP3_PATCOPY | GMC_DP_SRC_RECT | GMC_3D_FCN_EN_CLR | GMC_DST_CLR_CMP_FCN_CLEAR | GMC_AUX_CLIP_CLEAR | GMC_WRITE_MASK_SET); ati128_out32( mmio, SCALE_3D_CNTL, 0x00000000 ); ati128_out32( mmio, TEX_CNTL, 0x00000000 ); } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { ATI128DriverData *adrv = (ATI128DriverData*) driver_data; dfb_gfxcard_unmap_mmio( device, adrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/ati128/ati128_state.h0000644000175000017500000000450511245562152015721 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___ATI128_STATE_H__ #define ___ATI128_STATE_H__ #include "ati128.h" void ati128_set_destination( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); void ati128_set_source( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); void ati128_set_blittingflags( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); void ati128_set_clip( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); void ati128_set_color( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); void ati128_set_src_colorkey( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); void ati128_set_blending_function( ATI128DriverData *adrv, ATI128DeviceData *adev, CardState *state ); #endif DirectFB-1.2.10/gfxdrivers/mach64/0000777000175000017500000000000011307522570013471 500000000000000DirectFB-1.2.10/gfxdrivers/mach64/mach64.h0000644000175000017500000000600611245562152014643 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MACH64_H__ #define ___MACH64_H__ #include #include #include #define S13( val ) ((val) & 0x3FFF) #define S14( val ) ((val) & 0x7FFF) typedef enum { m_source = 0x001, m_source_scale = 0x002, m_color = 0x004, m_color_3d = 0x008, m_color_tex = 0x010, m_srckey = 0x020, m_srckey_scale = 0x040, m_dstkey = 0x080, m_disable_key = 0x100, m_draw_blend = 0x200, m_blit_blend = 0x400, } Mach64StateBits; #define MACH64_VALIDATE(b) (mdev->valid |= (b)) #define MACH64_INVALIDATE(b) (mdev->valid &= ~(b)) #define MACH64_IS_VALID(b) (mdev->valid & (b)) typedef enum { CHIP_UNKNOWN = 0, CHIP_264VT, CHIP_3D_RAGE, CHIP_264VT3, CHIP_3D_RAGE_II, CHIP_3D_RAGE_IIPLUS, CHIP_3D_RAGE_LT, CHIP_264VT4, CHIP_3D_RAGE_IIC, CHIP_3D_RAGE_PRO, CHIP_3D_RAGE_LT_PRO, CHIP_3D_RAGE_XLXC, CHIP_3D_RAGE_MOBILITY, } Mach64ChipType; typedef struct { Mach64ChipType chip; /* for fifo/performance monitoring */ unsigned int fifo_space; unsigned int waitfifo_sum; unsigned int waitfifo_calls; unsigned int fifo_waitcycles; unsigned int idle_waitcycles; unsigned int fifo_cache_hits; Mach64StateBits valid; u32 hw_debug; u32 hw_debug_orig; u32 pix_width; u32 draw_blend; u32 blit_blend; int tex_offset; int tex_pitch; int tex_height; int tex_size; int scale_offset; int scale_pitch; CoreSurface *source; bool blit_deinterlace; int field; DFBRegion clip; bool use_scaler_3d; } Mach64DeviceData; typedef struct { int accelerator; volatile u8 *mmio_base; Mach64DeviceData *device_data; } Mach64DriverData; extern DisplayLayerFuncs mach64OverlayFuncs; #endif DirectFB-1.2.10/gfxdrivers/mach64/Makefile.am0000644000175000017500000000135411245562152015445 00000000000000## Makefile.am for DirectFB/gfxdrivers/mach64 INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src mach64_LTLIBRARIES = libdirectfb_mach64.la if BUILD_STATIC mach64_DATA = $(mach64_LTLIBRARIES:.la=.o) endif mach64dir = $(MODULEDIR)/gfxdrivers libdirectfb_mach64_la_SOURCES = \ mach64.c \ mach64.h \ mach64_state.c \ mach64_state.h \ mach64_overlay.c \ regs.h \ mmio.h libdirectfb_mach64_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_mach64_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/mach64/Makefile.in0000644000175000017500000004536311307521477015472 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/mach64 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(mach64dir)" "$(DESTDIR)$(mach64dir)" mach64LTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(mach64_LTLIBRARIES) libdirectfb_mach64_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_mach64_la_OBJECTS = mach64.lo mach64_state.lo \ mach64_overlay.lo libdirectfb_mach64_la_OBJECTS = $(am_libdirectfb_mach64_la_OBJECTS) libdirectfb_mach64_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_mach64_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_mach64_la_SOURCES) DIST_SOURCES = $(libdirectfb_mach64_la_SOURCES) mach64DATA_INSTALL = $(INSTALL_DATA) DATA = $(mach64_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/systems \ -I$(top_srcdir)/src mach64_LTLIBRARIES = libdirectfb_mach64.la @BUILD_STATIC_TRUE@mach64_DATA = $(mach64_LTLIBRARIES:.la=.o) mach64dir = $(MODULEDIR)/gfxdrivers libdirectfb_mach64_la_SOURCES = \ mach64.c \ mach64.h \ mach64_state.c \ mach64_state.h \ mach64_overlay.c \ regs.h \ mmio.h libdirectfb_mach64_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_mach64_la_LIBADD = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/mach64/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/mach64/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-mach64LTLIBRARIES: $(mach64_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(mach64dir)" || $(MKDIR_P) "$(DESTDIR)$(mach64dir)" @list='$(mach64_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(mach64LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(mach64dir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(mach64LTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(mach64dir)/$$f"; \ else :; fi; \ done uninstall-mach64LTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(mach64_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(mach64dir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(mach64dir)/$$p"; \ done clean-mach64LTLIBRARIES: -test -z "$(mach64_LTLIBRARIES)" || rm -f $(mach64_LTLIBRARIES) @list='$(mach64_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_mach64.la: $(libdirectfb_mach64_la_OBJECTS) $(libdirectfb_mach64_la_DEPENDENCIES) $(libdirectfb_mach64_la_LINK) -rpath $(mach64dir) $(libdirectfb_mach64_la_OBJECTS) $(libdirectfb_mach64_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach64_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mach64_state.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-mach64DATA: $(mach64_DATA) @$(NORMAL_INSTALL) test -z "$(mach64dir)" || $(MKDIR_P) "$(DESTDIR)$(mach64dir)" @list='$(mach64_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(mach64DATA_INSTALL) '$$d$$p' '$(DESTDIR)$(mach64dir)/$$f'"; \ $(mach64DATA_INSTALL) "$$d$$p" "$(DESTDIR)$(mach64dir)/$$f"; \ done uninstall-mach64DATA: @$(NORMAL_UNINSTALL) @list='$(mach64_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(mach64dir)/$$f'"; \ rm -f "$(DESTDIR)$(mach64dir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(mach64dir)" "$(DESTDIR)$(mach64dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-mach64LTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-mach64DATA install-mach64LTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-mach64DATA uninstall-mach64LTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-mach64LTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-mach64DATA install-mach64LTLIBRARIES install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-mach64DATA uninstall-mach64LTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/mach64/mmio.h0000644000175000017500000001254111245562152014523 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MACH64_MMIO_H__ #define ___MACH64_MMIO_H__ #include #include "mach64.h" static inline void mach64_out8( volatile u8 *mmioaddr, u32 reg, u8 value ) { *((volatile u8*)(mmioaddr+reg)) = value; } static inline u8 mach64_in8( volatile u8 *mmioaddr, u32 reg ) { return *((volatile u8*)(mmioaddr+reg)); } static inline void mach64_out32( volatile u8 *mmioaddr, u32 reg, u32 value ) { #ifdef __powerpc__ if (reg >= 0x400) asm volatile("stwbrx %0,%1,%2;eieio" : : "r"(value), "b"(reg-0x800), "r"(mmioaddr) : "memory"); else asm volatile("stwbrx %0,%1,%2;eieio" : : "r"(value), "b"(reg), "r"(mmioaddr) : "memory"); #else if (reg >= 0x400) *((volatile u32*)(mmioaddr+reg-0x800)) = value; else *((volatile u32*)(mmioaddr+reg)) = value; #endif } static inline u32 mach64_in32( volatile u8 *mmioaddr, u32 reg ) { #ifdef __powerpc__ u32 value; if (reg >= 0x400) asm volatile("lwbrx %0,%1,%2;eieio" : "=r"(value) : "b"(reg-0x800), "r"(mmioaddr)); else asm volatile("lwbrx %0,%1,%2;eieio" : "=r"(value) : "b"(reg), "r"(mmioaddr)); return value; #else if (reg >= 0x400) return *((volatile u32*)(mmioaddr+reg-0x800)); else return *((volatile u32*)(mmioaddr+reg)); #endif } static const u32 lt_lcd_regs[] = { CONFIG_PANEL_LT, LCD_GEN_CTRL_LT, DSTN_CONTROL_LT, HFB_PITCH_ADDR_LT, HORZ_STRETCHING_LT, VERT_STRETCHING_LT, 0, /* EXT_VERT_STRETCH */ LT_GIO_LT, POWER_MANAGEMENT_LT }; #if 0 static inline void mach64_in_lcd( Mach64DeviceData *mdev, volatile u8 *mmioaddr, u8 reg, u32 value ) { if (mdev->chip == CHIP_3D_RAGE_LT) { mach64_out32( mmioaddr, lt_lcd_regs[reg], value ); } else if (mdev->chip >= CHIP_3D_RAGE_LT_PRO) { mach64_out8( mmioaddr, LCD_INDEX, reg ); mach64_out32( mmioaddr, LCD_DATA, value ); } } #endif static inline u32 mach64_in_lcd( Mach64DeviceData *mdev, volatile u8 *mmioaddr, u8 reg ) { if (mdev->chip == CHIP_3D_RAGE_LT) { return mach64_in32( mmioaddr, lt_lcd_regs[reg] ); } else if (mdev->chip >= CHIP_3D_RAGE_LT_PRO) { mach64_out8( mmioaddr, LCD_INDEX, reg ); return mach64_in32( mmioaddr, LCD_DATA ); } else { return 0; } } #if 0 static inline void mach64_out_pll( volatile u8 *mmioaddr, u8 reg, u8 value ) { mach64_out8( mmioaddr, CLOCK_CNTL1, (reg << 2) | PLL_WR_EN ); mach64_out8( mmioaddr, CLOCK_CNTL2, value ); } #endif static inline u8 mach64_in_pll( volatile u8 *mmioaddr, u8 reg ) { mach64_out8( mmioaddr, CLOCK_CNTL1, reg << 2 ); return mach64_in8( mmioaddr, CLOCK_CNTL2 ); } static inline void mach64_waitidle( Mach64DriverData *mdrv, Mach64DeviceData *mdev ) { int timeout = 1000000; while (timeout--) { if ((mach64_in32( mdrv->mmio_base, FIFO_STAT ) & 0x0000FFFF) == 0) break; mdev->idle_waitcycles++; } timeout = 1000000; while (timeout--) { if ((mach64_in32( mdrv->mmio_base, GUI_STAT ) & GUI_ACTIVE) == 0) break; mdev->idle_waitcycles++; } mdev->fifo_space = 16; } static inline void mach64_waitfifo( Mach64DriverData *mdrv, Mach64DeviceData *mdev, unsigned int requested_fifo_space ) { u32 fifo_stat; int timeout = 1000000; mdev->waitfifo_sum += requested_fifo_space; mdev->waitfifo_calls++; if (mdev->fifo_space < requested_fifo_space) { while (timeout--) { mdev->fifo_waitcycles++; fifo_stat = mach64_in32( mdrv->mmio_base, FIFO_STAT ) & 0x0000FFFF; mdev->fifo_space = 16; while (fifo_stat) { mdev->fifo_space--; fifo_stat >>= 1; } if (mdev->fifo_space >= requested_fifo_space) break; } } else { mdev->fifo_cache_hits++; } mdev->fifo_space -= requested_fifo_space; } #endif DirectFB-1.2.10/gfxdrivers/mach64/regs.h0000644000175000017500000010126311164361026014517 00000000000000#ifndef __MACH64_REGS_H__ #define __MACH64_REGS_H__ /* LCD Panel registers */ #define CONFIG_PANEL 0x00 #define LCD_GEN_CTRL 0x01 #define DSTN_CONTROL 0x02 #define HFB_PITCH_ADDR 0x03 #define HORZ_STRETCHING 0x04 #define VERT_STRETCHING 0x05 #define EXT_VERT_STRETCH 0x06 #define LT_GIO 0x07 #define POWER_MANAGEMENT 0x08 #define ZVGPIO 0x09 #define ICON_CLR0 0x0A #define ICON_CLR1 0x0B #define ICON_OFFSET 0x0C #define ICON_HORZ_VERT_POSN 0x0D #define ICON_HORZ_VERT_OFF 0x0E #define ICON2_CLR0 0x0F #define ICON2_CLR1 0x10 #define ICON2_OFFSET 0x11 #define ICON2_HORZ_VERT_POSN 0x12 #define ICON2_HORZ_VERT_OFF 0x13 #define LCD_MISC_CNTL 0x14 #define TMDS_CNTL 0x15 #define SCRATCH_PAD_4 0x15 #define TMDS_SYNC_CHAR_SETA 0x16 #define SCRATCH_PAD_5 0x16 #define TMDS_SYNC_CHAR_SETB 0x17 #define SCRATCH_PAD_6 0x17 #define TMDS_CRC 0x18 #define SCRATCH_PAD_7 0x18 #define PLTSTBLK_GEN_SEED 0x19 #define SCRATCH_PAD_8 0x19 #define SYNC_GEN_CNTL 0x1A #define PATTERN_GEN_SEED 0x1B #define APC_CNTL 0x1C #define POWER_MANAGEMENT_2 0x1D #define PRI_ERR_PATTERN 0x1E #define CUR_ERR_PATTERN 0x1F #define PLTSTBLK_RPT 0x20 #define SYNC_RPT 0x21 #define CRC_PATTERN_RPT 0x22 #define PL_TRANSMITTER_CNTL 0x23 #define PL_PLL_CNTL 0x24 #define ALPHA_BLENDING 0x25 #define PORTRAIT_GEN_CNTL 0x26 #define APC_CTRL_IO 0x27 #define TEST_IO 0x28 #define TEST_OUTPUTS 0x29 #define DP1_MEM_ACCESS 0x2A #define DP0_MEM_ACCESS 0x2B #define DP0_DEBUG_A 0x2C #define DP0_DEBUG_B 0x2D #define DP1_DEBUG_A 0x2E #define DP1_DEBUG_B 0x2F #define DPCTRL_DEBUG_A 0x30 #define DPCTRL_DEBUG_B 0x31 #define MEMBLK_DEBUG 0x32 /* #define SCRATCH_PAD_4 0x33 */ #define APC_LUT_AB 0x33 /* #define SCRATCH_PAD_5 0x34 */ #define APC_LUT_CD 0x34 /* #define SCRATCH_PAD_6 0x35 */ #define APC_LUT_EF 0x25 /* #define SCRATCH_PAD_7 0x36 */ #define APC_LUT_GH 0x36 /* #define SCRATCH_PAD_8 0x37 */ #define APC_LUT_IJ 0x37 #define APC_LUT_KL 0x38 #define APC_LUT_MN 0x39 #define APC_LUT_OP 0x3A /* LCD_GEN_CTRL */ #define LCD_ON 0x00000002 /* VERT_STRETCHING */ #define VERT_STRETCH_RATIO0 0x000003FF #define VERT_STRETCH_EN 0x80000000 /* PLL registers */ #define MPLL_CNTL 0x00 #define VPLL_CNTL 0x01 #define PLL_REF_DIV 0x02 #define PLL_GEN_CNTL 0x03 #define MCLK_FB_DIV 0x04 #define PLL_VCLK_CNTL 0x05 #define VCLK_POST_DIV 0x06 #define VCLK0_FB_DIV 0x07 #define VCLK1_FB_DIV 0x08 #define VCLK2_FB_DIV 0x09 #define VCLK3_FB_DIV 0x0A #define PLL_EXT_CNTL 0x0B #define DLL_CNTL 0x0C #define DLL1_CNTL 0x0C #define VFC_CNTL 0x0D #define PLL_TEST_CNTL 0x0E #define PLL_TEST_COUNT 0x0F #define LVDSPLL_CNTL0 0x10 #define LVDS_CNTL0 0x10 #define LVDSPLL_CNTL1 0x11 #define LVDS_CNTL1 0x11 #define AGP1_CNTL 0x12 #define AGP2_CNTL 0x13 #define DLL2_CNTL 0x14 #define SCLK_FB_DIV 0x15 #define SPLL_CNTL1 0x16 #define SPLL_CNTL2 0x17 #define APLL_STRAPS 0x18 #define EXT_VPLL_CNTL 0x19 #define EXT_VPLL_REF_DIV 0x1A #define EXT_VPLL_FB_DIV 0x1B #define EXT_VPLL_MSB 0x1C #define HTOTAL_CNTL 0x1D #define BYTE_CLK_CNTL 0x1E #define TV_PLL_CNTL1 0x1F #define TV_PLL_CNTL2 0x20 #define TV_PLL_CNTL 0x21 #define EXT_TV_PLL 0x22 #define V2PLL_CNTL 0x23 #define PLL_V2CLK_CNTL 0x24 #define EXT_V2PLL_REF_DIV 0x25 #define EXT_V2PLL_FB_DIV 0x26 #define EXT_V2PLL_MSB 0x27 #define HTOTAL2_CNTL 0x28 #define PLL_YCLK_CNTL 0x29 #define PM_DYN_CLK_CNTL 0x2A /* PLL_VCLK_CNTL */ #define ECP_DIV 0x30 /* TV Out registers */ /* 0x00 - 0x0F */ #define TV_MASTER_CNTL 0x10 /* 0x11 */ #define TV_RGB_CNTL 0x12 /* 0x13 */ #define TV_SYNC_CNTL 0x14 /* 0x15 - 1F */ #define TV_HTOTAL 0x20 #define TV_HDISP 0x21 #define TV_HSIZE 0x22 #define TV_HSTART 0x23 #define TV_HCOUNT 0x24 #define TV_VTOTAL 0x25 #define TV_VDISP 0x26 #define TV_VCOUNT 0x27 #define TV_FTOTAL 0x28 #define TV_FCOUNT 0x29 #define TV_FRESTART 0x2A #define TV_HRESTART 0x2B #define TV_VRESTART 0x2C /* 0x2D - 0x5F */ #define TV_HOST_READ_DATA 0x60 #define TV_HOST_WRITE_DATA 0x61 #define TV_HOST_RD_WT_CNTL 0x62 /* 0x63 - 0x6F */ #define TV_VSCALER_CNTL 0x70 #define TV_TIMING_CNTL 0x71 #define TV_GAMMA_CNTL 0x72 #define TV_Y_FALL_CNTL 0x73 #define TV_Y_RISE_CNTL 0x74 #define TV_Y_SAW_TOOTH_CNTL 0x75 /* 0x76 - 0x7F */ #define TV_MODULATOR_CNTL1 0x80 #define TV_MODULATOR_CNTL2 0x81 /* 0x82 - 0x8F */ #define TV_PRE_DAC_MUX_CNTL 0x90 /* 0x91 - 0x9F */ #define TV_DAC_CNTL 0xA0 /* 0xA1 - 0xAF */ #define TV_CRC_CNTL 0xB0 #define TV_VIDEO_PORT_SIG 0xB1 /* 0xB2 - 0xB7 */ #define TV_VBI_CC_CNTL 0xB8 #define TV_VBI_EDS_CNTL 0xB9 #define TV_VBI_20BIT_CNTL 0xBA /* 0xBB - 0xBC */ #define TV_VBI_DTO_CNTL 0xBD #define TV_VBI_LEVEL_CNTL 0xBE /* 0xBF */ #define TV_UV_ADR 0xC0 #define TV_FIFO_TEST_CNTL 0xC1 /* 0xC2 - 0xFF */ /* Main registers */ #define CRTC_H_TOTAL_DISP 0x000 #define CRTC2_H_TOTAL_DISP 0x000 #define CRTC_H_SYNC_STRT_WID 0x004 #define CRTC2_H_SYNC_STRT_WID 0x004 #define CRTC_V_TOTAL_DISP 0x008 #define CRTC2_V_TOTAL_DISP 0x008 #define CRTC_V_SYNC_STRT_WID 0x00C #define CRTC2_V_SYNC_STRT_WID 0x00C #define CRTC_VLINE_CRNT_VLINE 0x010 #define CRTC2_VLINE_CRNT_VLINE 0x010 #define CRTC_OFF_PITCH 0x014 #define CRTC_INT_CNTL 0x018 #define CRTC_GEN_CNTL 0x01C #define TV_OUT_INDEX 0x01D #define DSP_CONFIG 0x020 #define PM_DSP_CONFIG 0x020 #define DSP_ON_OFF 0x024 #define PM_DSP_ON_OFF 0x024 #define TV_OUT_DATA 0x01D #define TIMER_CONFIG 0x028 #define MEM_BUF_CNTL 0x02C #define SHARED_CNTL 0x030 #define SHARED_MEM_CONFIG 0x034 #define MEM_ADDR_CONFIG 0x034 #define CRT_TRAP 0x038 #define I2C_CNTL_0 0x03C #define DSTN_CONTROL_LT 0x03C #define OVR_CLR 0x040 #define OVR2_CLR 0x040 #define OVR_WID_LEFT_RIGHT 0x044 #define OVR2_WID_LEFT_RIGHT 0x044 #define OVR_WID_TOP_BOTTOM 0x048 #define OVR2_WID_TOP_BOTTOM 0x048 #define VGA_DSP_CONFIG 0x04C #define PM_VGA_DSP_CONFIG 0x04C #define VGA_DSP_ON_OFF 0x050 #define PM_VGA_DSP_ON_OFF 0x050 #define DSP2_CONFIG 0x054 #define PM_DSP2_CONFIG 0x054 #define DSP2_ON_OFF 0x058 #define PM_DSP2_ON_OFF 0x058 #define CRTC2_OFF_PITCH 0x05C #define CUR_CLR0 0x060 #define CUR2_CLR0 0x060 #define CUR_CLR1 0x064 #define CUR2_CLR1 0x064 #define CUR_OFFSET 0x068 #define CUR2_OFFSET 0x068 #define CUR_HORZ_VERT_POSN 0x06C #define CUR2_HORZ_VERT_POSN 0x06C #define CUR_HORZ_VERT_OFF 0x070 #define CUR2_HORZ_VERT_OFF 0x070 #define CONFIG_PANEL_LT 0x074 #define GP_IO 0x078 #define HW_DEBUG 0x07C #define SCRATCH_REG0 0x080 #define SCRATCH_REG1 0x084 #define SCRATCH_REG2 0x088 #define SCRATCH_REG3 0x08C #define CLOCK_CNTL 0x090 #define CLOCK_CNTL0 0x090 #define CLOCK_CNTL1 0x091 #define CLOCK_CNTL2 0x092 #define CLOCK_CNTL3 0x093 #define CONFIG_STAT1 0x094 #define CONFIG_STAT2 0x098 /* 0x09C */ #define BUS_CNTL 0x0A0 #define LCD_INDEX 0x0A4 #define LCD_DATA 0x0A8 #define HFB_PITCH_ADDR_LT 0x0A8 #define EXT_MEM_CNTL 0x0AC #define MEM_CNTL 0x0B0 #define MEM_VGA_WP_SEL 0x0B4 #define MEM_VGA_RP_SEL 0x0B8 #define I2C_CNTL_1 0x0BC #define LT_GIO_LT 0x0BC #define DAC_REGS 0x0C0 #define DAC_CNTL 0x0C4 #define EXT_DAC_REGS 0x0C8 #define HORZ_STRETCHING_LT 0x0C8 #define VERT_STRETCHING_LT 0x0CC #define GEN_TEST_CNTL 0x0D0 #define CUSTOM_MACRO_CNTL 0x0D4 #define LCD_GEN_CTRL_LT 0x0D4 #define POWER_MANAGEMENT_LT 0x0D8 #define CONFIG_CNTL 0x0DC #define CONFIG_CHIP_ID 0x0E0 #define CONFIG_STAT0 0x0E4 #define CRC_SIG 0x0E8 #define CRC2_SIG 0x0E8 /* 0x0EC - 0x0FC */ #define DST_OFF_PITCH 0x100 #define DST_X 0x104 #define DST_Y 0x108 #define DST_Y_X 0x10C #define DST_WIDTH 0x110 #define DST_HEIGHT 0x114 #define DST_HEIGHT_WIDTH 0x118 #define DST_X_WIDTH 0x11C #define DST_BRES_LNTH 0x120 /* #define LEAD_BRES_LNTH 0x120 */ #define DST_BRES_ERR 0x124 #define LEAD_BRES_ERR 0x124 #define DST_BRES_INC 0x128 #define LEAD_BRES_INC 0x128 #define DST_BRES_DEC 0x12C #define LEAD_BRES_DEC 0x12C #define DST_CNTL 0x130 /* #define DST_Y_X 0x134 */ #define TRAIL_BRES_ERR 0x138 #define TRAIL_BRES_INC 0x13C #define TRAIL_BRES_DEC 0x140 #define LEAD_BRES_LNTH 0x144 #define Z_OFF_PITCH 0x148 #define Z_CNTL 0x14C #define ALPHA_TST_CNTL 0x150 /* 0x154 */ #define SECONDARY_STW_EXP 0x158 #define SECONDARY_S_X_INC 0x15C #define SECONDARY_S_Y_INC 0x160 #define SECONDARY_S_START 0x164 #define SECONDARY_W_X_INC 0x168 #define SECONDARY_W_Y_INC 0x16C #define SECONDARY_W_START 0x170 #define SECONDARY_T_X_INC 0x174 #define SECONDARY_T_Y_INC 0x178 #define SECONDARY_T_START 0x17C #define SRC_OFF_PITCH 0x180 #define SRC_X 0x184 #define SRC_Y 0x188 #define SRC_Y_X 0x18C #define SRC_WIDTH1 0x190 #define SRC_HEIGHT1 0x194 #define SRC_HEIGHT1_WIDTH1 0x198 #define SRC_X_START 0x19C #define SRC_Y_START 0x1A0 #define SRC_Y_X_START 0x1A4 #define SRC_WIDTH2 0x1A8 #define SRC_HEIGHT2 0x1AC #define SRC_HEIGHT2_WIDTH2 0x1B0 #define SRC_CNTL 0x1B4 /* 0x1B8 - 0x1BC */ #define SCALE_Y_OFF 0x1C0 #define SCALE_OFF 0x1C0 #define TEX_0_OFF 0x1C0 #define SECONDARY_SCALE_OFF 0x1C4 #define TEX_1_OFF 0x1C4 #define TEX_2_OFF 0x1C8 #define TEX_3_OFF 0x1CC #define TEX_4_OFF 0x1D0 #define TEX_5_OFF 0x1D4 #define TEX_6_OFF 0x1D8 #define SCALE_WIDTH 0x1DC #define TEX_7_OFF 0x1DC #define SCALE_HEIGHT 0x1E0 #define TEX_8_OFF 0x1E0 #define TEX_9_OFF 0x1E4 #define TEX_10_OFF 0x1E8 #define SCALE_Y_PITCH 0x1EC #define SCALE_PITCH 0x1EC /* #define S_Y_INC 0x1EC */ #define SCALE_X_INC 0x1F0 /* #define RED_X_INC 0x1F0 */ #define SCALE_Y_INC 0x1F4 /* #define GREEN_X_INC 0x1F4 */ #define SCALE_VACC 0x1F8 #define SCALE_3D_CNTL 0x1FC #define HOST_DATA0 0x200 #define HOST_DATA1 0x204 #define HOST_DATA2 0x208 #define HOST_DATA3 0x20C #define HOST_DATA4 0x210 #define HOST_DATA5 0x214 #define HOST_DATA6 0x218 #define HOST_DATA7 0x21C #define HOST_DATA8 0x220 #define HOST_DATA9 0x224 #define HOST_DATAA 0x228 #define HOST_DATAB 0x22C #define HOST_DATAC 0x230 #define HOST_DATAD 0x234 #define HOST_DATAE 0x238 #define HOST_DATAF 0x23C #define HOST_CNTL 0x240 #define BM_HOSTDATA 0x244 #define BM_ADDR 0x248 #define BM_DATA 0x248 #define BM_GUI_TABLE_CMD 0x24C /* 0x250 - 0x27C */ #define PAT_REG0 0x280 #define PAT_REG1 0x284 #define PAT_CNTL 0x288 /* 0x28C - 0x29C */ #define SC_LEFT 0x2A0 #define SC_RIGHT 0x2A4 #define SC_LEFT_RIGHT 0x2A8 #define SC_TOP 0x2AC #define SC_BOTTOM 0x2B0 #define SC_TOP_BOTTOM 0x2B4 #define USR1_DST_OFF_PITCH 0x2B8 #define USR2_DST_OFF_PITCH 0x2BC #define DP_BKGD_CLR 0x2C0 #define DP_FRGD_CLR 0x2C4 #define DP_FOG_CLR 0x2C4 #define DP_WRITE_MSK 0x2C8 #define DP_CHAIN_MSK 0x2CC #define DP_PIX_WIDTH 0x2D0 #define DP_MIX 0x2D4 #define DP_SRC 0x2D8 #define DP_FRGD_CLR_MIX 0x2DC #define DP_FRGD_BKGD_CLR 0x2E0 /* 0x2E4 */ #define DST_X_Y 0x2E8 #define DST_WIDTH_HEIGHT 0x2EC #define USR_DST_PITCH 0x2F0 /* 0x2F4 */ #define DP_SET_GUI_ENGINE2 0x2F8 #define DP_SET_GUI_ENGINE 0x2FC #define CLR_CMP_CLR 0x300 #define CLR_CMP_MSK 0x304 #define CLR_CMP_CNTL 0x308 /* 0x30C */ #define FIFO_STAT 0x310 /* 0x314 - 0x31C */ #define CONTEXT_MSK 0x320 /* 0x324 */ /* 0x328 */ #define CONTEXT_LOAD_CNTL 0x32C #define GUI_TRAJ_CNTL 0x330 /* 0x334 */ #define GUI_STAT 0x338 /* 0x33C */ #define S_X_INC2 0x340 #define TEX_PALETTE_INDEX 0x340 #define S_Y_INC2 0x344 #define STW_EXP 0x344 #define S_XY_INC2 0x348 #define LOG_MAX_INC 0x348 #define S_X_INC_START 0x34C #define S_X_INC 0x34C #define S_Y_INC 0x350 /* #define SCALE_Y_PITCH 0x350 */ /* #define SCALE_PITCH 0x350 */ #define S_START 0x354 #define T_X_INC2 0x358 #define W_X_INC 0x358 #define T_Y_INC2 0x35C #define W_Y_INC 0x35C #define T_XY_INC2 0x360 #define W_START 0x360 #define T_X_INC_START 0x364 #define T_X_INC 0x364 #define SECONDARY_SCALE_PITCH 0x368 #define T_Y_INC 0x368 #define T_START 0x36C #define TEX_SIZE_PITCH 0x370 #define TEX_CNTL 0x374 #define SECONDARY_TEX_OFFSET 0x378 #define TEX_PAL_WR 0x37C #define TEX_PALETTE 0x37C #define SCALE_PITCH_BOTH 0x380 #define SECONDARY_SCALE_OFF_ACC 0x384 #define SCALE_OFF_ACC 0x388 #define SCALE_DST_Y_X 0x38C /* 0x390 - 0x394 */ #define COMPOSITE_SHADOW_ID 0x398 #define SECONDARY_SCALE_X_INC 0x39C #define SPECULAR_RED_X_INC 0x39C #define SPECULAR_RED_Y_INC 0x3A0 #define SECONDARY_SCALE_HACC 0x3A4 #define SPECULAR_RED_START 0x3A4 #define SPECULAR_GREEN_X_INC 0x3A8 #define SPECULAR_GREEN_Y_INC 0x3AC #define SPECULAR_GREEN_START 0x3B0 #define SPECULAR_BLUE_X_INC 0x3B4 #define SPECULAR_BLUE_Y_INC 0x3B8 #define SPECULAR_BLUE_START 0x3BC /* #define SCALE_X_INC 0x3C0 */ #define RED_X_INC 0x3C0 #define RED_Y_INC 0x3C4 #define SCALE_HACC 0x3C8 #define RED_START 0x3C8 /* #define SCALE_Y_INC 0x3CC */ #define GREEN_X_INC 0x3CC #define SECONDARY_SCALE_Y_INC 0x3D0 #define GREEN_Y_INC 0x3D0 #define SECONDARY_SCALE_VACC 0x3D4 #define GREEN_START 0x3D4 #define SCALE_XUV_INC 0x3D8 #define BLUE_X_INC 0x3D8 #define BLUE_Y_INC 0x3DC #define SCALE_UV_HACC 0x3E0 #define BLUE_START 0x3E0 #define Z_X_INC 0x3E4 #define Z_Y_INC 0x3E8 #define Z_START 0x3EC #define ALPHA_X_INC 0x3F0 #define FOG_X_INC 0x3F0 #define ALPHA_Y_INC 0x3F4 #define FOG_Y_INC 0x3F4 #define ALPHA_START 0x3F8 #define FOG_START 0x3F8 /* 0x3FC */ #define OVERLAY_Y_X_START 0x400 #define OVERLAY_Y_X_END 0x404 #define OVERLAY_VIDEO_KEY_CLR 0x408 #define OVERLAY_VIDEO_KEY_MSK 0x40C #define OVERLAY_GRAPHICS_KEY_CLR 0x410 #define OVERLAY_GRAPHICS_KEY_MSK 0x414 #define OVERLAY_KEY_CNTL 0x418 /* 0x41C */ #define OVERLAY_SCALE_INC 0x420 #define OVERLAY_SCALE_CNTL 0x424 #define SCALER_HEIGHT_WIDTH 0x428 #define SCALER_TEST 0x42C /* 0x430 */ #define SCALER_BUF0_OFFSET 0x434 #define SCALER_BUF1_OFFSET 0x438 #define SCALER_BUF_PITCH 0x43C #define CAPTURE_START_END 0x440 #define CAPTURE_X_WIDTH 0x444 #define VIDEO_FORMAT 0x448 #define VBI_START_END 0x44C #define CAPTURE_CONFIG 0x450 #define TRIG_CNTL 0x454 #define OVERLAY_EXCLUSIVE_HORZ 0x458 #define OVERLAY_EXCLUSIVE_VERT 0x45C #define VBI_WIDTH 0x460 #define CAPTURE_DEBUG 0x464 #define VIDEO_SYNC_TEST 0x468 /* 0x46C */ #define SNAPSHOT_VH_COUNTS 0x470 #define SNAPSHOT_F_COUNT 0x474 #define N_VIF_COUNT 0x478 #define SNAPSHOT_VIF_COUNT 0x47C #define BUF0_OFFSET 0x480 #define CAPTURE_BUF0_OFFSET 0x480 #define CAPTURE_BUF1_OFFSET 0x484 #define ONESHOT_BUF_OFFSET 0x488 #define CAPTURE_BUF_PITCH 0x488 #define BUF0_PITCH 0x48C /* 0x490 - 0x494 */ #define BUF1_OFFSET 0x498 /* 0x49C - 0x4A0 */ #define BUF1_PITCH 0x4A4 /* 0x4A8 */ #define BUF0_CAP_OFFSET 0x4AC #define BUF1_CAP_OFFSET 0x4B0 #define SNAPSHOT2_VH_COUNTS 0x4B0 #define SNAPSHOT2_F_COUNT 0x4B4 #define N_VIF2_COUNT 0x4B8 #define SNAPSHOT2_VIF_COUNT 0x4BC #define MPP_CONFIG 0x4C0 #define MPP_STROBE_SEQ 0x4C4 #define MPP_ADDR 0x4C8 #define MPP_DATA 0x4CC #define TVO_CNTL 0x500 /* 0x504 - 0x540 */ #define CRT_HORZ_VERT_LOAD 0x544 #define AGP_BASE 0x548 #define AGP_CNTL 0x54C #define SCALER_COLOUR_CNTL 0x550 #define SCALER_H_COEFF0 0x554 #define SCALER_H_COEFF1 0x558 #define SCALER_H_COEFF2 0x55C #define SCALER_H_COEFF3 0x560 #define SCALER_H_COEFF4 0x564 /* 0x568 - 0x56C */ #define GUI_CMDFIFO_DEBUG 0x570 #define GUI_CMDFIFO_DATA 0x574 #define GUI_CNTL 0x578 /* 0x57C */ #define BM_FRAME_BUF_OFFSET 0x580 #define BM_SYSTEM_MEM_ADDR 0x584 #define BM_COMMAND 0x588 #define BM_STATUS 0x58C /* 0x590 - 0x5B4 */ #define BM_GUI_TABLE 0x5B8 #define BM_SYSTEM_TABLE 0x5BC /* 0x5D0 */ #define SCALER_BUF0_OFFSET_U 0x5D4 #define SCALER_BUF0_OFFSET_V 0x5D8 #define SCALER_BUF1_OFFSET_U 0x5DC #define SCALER_BUF1_OFFSET_V 0x5E0 /* 0x5E4 - 0x63C */ #define VERTEX_1_S 0x640 #define VERTEX_1_T 0x644 #define VERTEX_1_W 0x648 #define VERTEX_1_SPEC_ARGB 0x64C #define VERTEX_1_Z 0x650 #define VERTEX_1_ARGB 0x654 #define VERTEX_1_X_Y 0x658 /* #define ONE_OVER_AREA 0x65C */ #define VERTEX_2_S 0x660 #define VERTEX_2_T 0x664 #define VERTEX_2_W 0x668 #define VERTEX_2_SPEC_ARGB 0x66C #define VERTEX_2_Z 0x670 #define VERTEX_2_ARGB 0x674 #define VERTEX_2_X_Y 0x678 /* #define ONE_OVER_AREA 0x67C */ #define VERTEX_3_S 0x680 #define VERTEX_3_T 0x684 #define VERTEX_3_W 0x688 #define VERTEX_3_SPEC_ARGB 0x68C #define VERTEX_3_Z 0x690 #define VERTEX_3_ARGB 0x694 #define VERTEX_3_X_Y 0x698 #define ONE_OVER_AREA 0x69C #define VERTEX_3_SECONDARY_S 0x6A0 #define VERTEX_3_SECONDARY_T 0x6A4 #define VERTEX_3_SECONDARY_W 0x6A8 /* #define VERTEX_1_S 0x6AC */ /* #define VERTEX_1_T 0x6B0 */ /* #define VERTEX_1_W 0x6B4 */ /* #define VERTEX_2_S 0x6B8 */ /* #define VERTEX_2_T 0x6BC */ /* #define VERTEX_2_W 0x6C0 */ /* #define VERTEX_3_S 0x6C4 */ /* #define VERTEX_3_T 0x6C8 */ /* #define VERTEX_3_W 0x6CC */ /* #define VERTEX_1_SPEC_ARGB 0x6D0 */ /* #define VERTEX_2_SPEC_ARGB 0x6D4 */ /* #define VERTEX_3_SPEC_ARGB 0x6D8 */ /* #define VERTEX_1_Z 0x6DC */ /* #define VERTEX_2_Z 0x6E0 */ /* #define VERTEX_3_Z 0x6E4 */ /* #define VERTEX_1_ARGB 0x6E8 */ /* #define VERTEX_2_ARGB 0x6EC */ /* #define VERTEX_3_ARGB 0x6F0 */ /* #define VERTEX_1_X_Y 0x6F4 */ /* #define VERTEX_2_X_Y 0x6F8 */ /* #define VERTEX_3_X_Y 0x6FC */ #define ONE_OVER_AREA_UC 0x700 #define SETUP_CNTL 0x704 /* 0x708 - 0x724 */ #define VERTEX_1_SECONDARY_S 0x728 #define VERTEX_1_SECONDARY_T 0x72C #define VERTEX_1_SECONDARY_W 0x730 #define VERTEX_2_SECONDARY_S 0x734 #define VERTEX_2_SECONDARY_T 0x738 #define VERTEX_2_SECONDARY_W 0x73C /* 0x740 - 0x7FC */ /* HW_DEBUG */ #define INTER_PRIM_DIS 0x00000040 #define AUTO_BLKWRT_COLOR_DIS 0x00000100 #define AUTO_FF_DIS 0x00001000 #define AUTO_BLKWRT_DIS 0x00002000 /* CLOCK_CNTL1 */ #define PLL_WR_EN 0x02 /* CONFIG_CHIP_ID */ #define CFG_CHIP_TYPE 0x0000FFFF #define CFG_CHIP_CLASS 0x00FF0000 #define CFG_CHIP_MAJOR 0x07000000 #define CFG_CHIP_FND_ID 0x38000000 #define CFG_CHIP_MINOR 0xC0000000 /* CONFIG_STAT0 */ #define CFG_MEM_TYPE 0x00000007 #define CFG_MEM_TYPE_SGRAM 0x00000005 /* DST_BRES_LNTH */ #define DRAW_TRAP 0x00008000 #define LINE_DIS 0x80000000 /* DST_CNTL */ #define DST_X_DIR 0x00000001 #define DST_Y_DIR 0x00000002 #define DST_Y_MAJOR 0x00000004 #define DST_X_TILE 0x00000008 #define DST_Y_TILE 0x00000010 #define DST_LAST_PEL 0x00000020 #define DST_POLYGON_EN 0x00000040 #define DST_24_ROTATION_EN 0x00000080 #define TRAIL_X_DIR 0x00002000 #define TRAP_FILL_DIR 0x00004000 /* ALPHA_TST_CNTL */ #define ALPHA_DST_SEL_ZERO 0x00000000 #define ALPHA_DST_SEL_ONE 0x00000100 #define ALPHA_DST_SEL_SRCALPHA 0x00000400 #define ALPHA_DST_SEL_INVSRCALPHA 0x00000500 #define ALPHA_DST_SEL_DSTALPHA 0x00000600 #define ALPHA_DST_SEL_INVDSTALPHA 0x00000700 /* SRC_CNTL */ #define SRC_PATTERN_EN 0x00000001 #define SRC_ROTATION_EN 0x00000002 #define SRC_LINEAR_EN 0x00000004 #define SRC_BYTE_ALIGN 0x00000008 #define SRC_LINE_X_DIR 0x00000010 #define FAST_FILL_EN 0x00000040 #define COLOR_REG_WRITE_EN 0x00002000 #define BLOCK_WRITE_EN 0x00004000 /* DP_PIX_WIDTH (GT) */ #define DST_PIX_WIDTH_MONO 0x00000000 #define DST_PIX_WIDTH_CI8 0x00000002 #define DST_PIX_WIDTH_ARGB1555 0x00000003 #define DST_PIX_WIDTH_RGB565 0x00000004 #define DST_PIX_WIDTH_RGB888 0x00000005 #define DST_PIX_WIDTH_ARGB8888 0x00000006 #define DST_PIX_WIDTH_RGB332 0x00000007 #define DST_PIX_WIDTH_Y8 0x00000008 #define DST_PIX_WIDTH_RGB8 0x00000009 #define DST_PIX_WIDTH_VYUY 0x0000000B #define DST_PIX_WIDTH_YVYU 0x0000000C #define DST_PIX_WIDTH_AYUV8888 0x0000000E #define DST_PIX_WIDTH_ARGB4444 0x0000000F #define SRC_PIX_WIDTH_MONO 0x00000000 #define SRC_PIX_WIDTH_CI8 0x00000200 #define SRC_PIX_WIDTH_ARGB1555 0x00000300 #define SRC_PIX_WIDTH_RGB565 0x00000400 #define SRC_PIX_WIDTH_ARGB8888 0x00000600 #define SRC_PIX_WIDTH_RGB332 0x00000700 #define SRC_PIX_WIDTH_Y8 0x00000800 #define SRC_PIX_WIDTH_VYUY 0x00000B00 #define SRC_PIX_WIDTH_YVYU 0x00000C00 #define SRC_PIX_WIDTH_AYUV8888 0x00000E00 #define SRC_PIX_WIDTH_ARGB4444 0x00000F00 #define SCALE_PIX_WIDTH_CI8 0x20000000 #define SCALE_PIX_WIDTH_ARGB1555 0x30000000 #define SCALE_PIX_WIDTH_RGB565 0x40000000 #define SCALE_PIX_WIDTH_ARGB8888 0x60000000 #define SCALE_PIX_WIDTH_RGB332 0x70000000 #define SCALE_PIX_WIDTH_Y8 0x80000000 #define SCALE_PIX_WIDTH_RGB8 0x90000000 #define SCALE_PIX_WIDTH_VYUY 0xB0000000 #define SCALE_PIX_WIDTH_YVYU 0xC0000000 #define SCALE_PIX_WIDTH_AYUV8888 0xE0000000 #define SCALE_PIX_WIDTH_ARGB4444 0xF0000000 /* DP_PIX_WIDTH (GX/CT/VT) */ #define DST_PIX_WIDTH_8BPP 0x00000002 #define DST_PIX_WIDTH_15BPP 0x00000003 #define DST_PIX_WIDTH_16BPP 0x00000004 #define DST_PIX_WIDTH_32BPP 0x00000006 #define SRC_PIX_WIDTH_8BPP 0x00000200 #define SRC_PIX_WIDTH_15BPP 0x00000300 #define SRC_PIX_WIDTH_16BPP 0x00000400 #define SRC_PIX_WIDTH_32BPP 0x00000600 /* DP_PIX_WIDTH masks */ #define DST_PIX_WIDTH 0x0000000F #define SRC_PIX_WIDTH 0x00000F00 #define SCALE_PIX_WIDTH 0xF0000000 /* DP_MIX */ #define BKGD_MIX_DST 0x00000003 #define BKGD_MIX_SRC 0x00000007 #define FRGD_MIX_DST 0x00030000 #define FRGD_MIX_SRC 0x00070000 /* DP_SRC */ #define BKGD_SRC_BKGD_CLR 0x00000000 #define BKGD_SRC_FRGD_CLR 0x00000001 #define BKGD_SRC_HOST 0x00000002 #define BKGD_SRC_BLIT 0x00000003 #define BKGD_SRC_PATTERN 0x00000004 #define BKGD_SRC_SCALE 0x00000005 #define FRGD_SRC_BKGD_CLR 0x00000000 #define FRGD_SRC_FRGD_CLR 0x00000100 #define FRGD_SRC_HOST 0x00000200 #define FRGD_SRC_BLIT 0x00000300 #define FRGD_SRC_PATTERN 0x00000400 #define FRGD_SRC_SCALE 0x00000500 #define MONO_SRC_ONE 0x00000000 #define MONO_SRC_PATTERN 0x00010000 #define MONO_SRC_HOST 0x00020000 #define MONO_SRC_BLIT 0x00030000 /* CLR_CMP_CNTL */ #define CLR_CMP_FN_FALSE 0x00000000 #define CLR_CMP_FN_TRUE 0x00000001 #define CLR_CMP_FN_NOT_EQUAL 0x00000004 #define CLR_CMP_FN_EQUAL 0x00000005 #define CLR_CMP_SRC_DEST 0x00000000 #define CLR_CMP_SRC_2D 0x01000000 #define CLR_CMP_SRC_SCALE 0x02000000 /* GUI_STAT */ #define GUI_ACTIVE 0x00000001 /* SCALE_3D_CNTL */ #define SCALE_PIX_EXPAND 0x00000001 #define SCALE_DITHER 0x00000002 #define DITHER_EN 0x00000004 #define DITHER_INIT 0x00000008 #define ROUND_EN 0x00000010 #define TEX_CACHE_DIS 0x00000020 #define SCALE_3D_FCN_NOP 0x00000000 #define SCALE_3D_FCN_SCALE 0x00000040 #define SCALE_3D_FCN_TEXTURE 0x00000080 #define SCALE_3D_FCN_SHADE 0x000000C0 #define SCALE_PIX_REP 0x00000100 #define NEAREST_TEX_VIS 0x00000200 #define TEX_CACHE_SPLIT 0x00000200 #define APPLE_YUV_MODE 0x00000400 #define ALPHA_FOG_EN_DIS 0x00000000 #define ALPHA_FOG_EN_ALPHA 0x00000800 #define ALPHA_FOG_EN_FOG 0x00001000 #define COLOR_OVERRIDE 0x00002000 #define ALPHA_BLND_SAT 0x00002000 #define RED_DITHER_MAX 0x00004000 #define SIGNED_DST_CLAMP 0x00008000 #define ALPHA_BLND_SRC_ZERO 0x00000000 #define ALPHA_BLND_SRC_ONE 0x00010000 #define ALPHA_BLND_SRC_DSTCOLOR 0x00020000 #define ALPHA_BLND_SRC_INVDSTCOLOR 0x00030000 #define ALPHA_BLND_SRC_SRCALPHA 0x00040000 #define ALPHA_BLND_SRC_INVSRCALPHA 0x00050000 #define ALPHA_BLND_SRC_DSTALPHA 0x00060000 #define ALPHA_BLND_SRC_INVDSTALPHA 0x00070000 #define ALPHA_BLND_DST_ZERO 0x00000000 #define ALPHA_BLND_DST_ONE 0x00080000 #define ALPHA_BLND_DST_SRCCOLOR 0x00100000 #define ALPHA_BLND_DST_INVSRCCOLOR 0x00180000 #define ALPHA_BLND_DST_SRCALPHA 0x00200000 #define ALPHA_BLND_DST_INVSRCALPHA 0x00280000 #define ALPHA_BLND_DST_DSTALPHA 0x00300000 #define ALPHA_BLND_DST_INVDSTALPHA 0x00380000 #define TEX_LIGHT_FCN_REPLACE 0x00000000 #define TEX_LIGHT_FCN_MODULATE 0x00400000 #define TEX_LIGHT_FCN_ALPHA_DECAL 0x00800000 #define MIP_MAP_DISABLE 0x01000000 #define BILINEAR_TEX_EN 0x02000000 #define TEX_BLEND_FCN_NEAREST_MIPMAP_NEAREST 0x00000000 #define TEX_BLEND_FCN_NEAREST_MIPMAP_LINEAR 0x04000000 #define TEX_BLEND_FCN_LINEAR_MIPMAP_NEAREST 0x08000000 #define TEX_BLEND_FCN_LINEAR_MIPMAP_LINEAR 0x0C000000 #define TEX_AMASK_AEN 0x10000000 #define TEX_AMASK_MODE 0x20000000 #define TEX_MAP_AEN 0x40000000 #define SRC_3D_SEL 0x80000000 /* TEX_CNTL */ #define TEX_CACHE_FLUSH 0x00800000 /* OVERLAY_Y_X_START */ #define OVERLAY_LOCK_START 0x80000000 /* OVERLAY_Y_X_END */ #define OVERLAY_LOCK_END 0x80000000 /* OVERLAY_KEY_CNTL */ #define VIDEO_KEY_FN_FALSE 0x00000000 #define VIDEO_KEY_FN_TRUE 0x00000001 #define VIDEO_KEY_FN_NOT_EQUAL 0x00000004 #define VIDEO_KEY_FN_EQUAL 0x00000005 #define GRAPHICS_KEY_FN_FALSE 0x00000000 #define GRAPHICS_KEY_FN_TRUE 0x00000010 #define GRAPHICS_KEY_FN_NOT_EQUAL 0x00000040 #define GRAPHICS_KEY_FN_EQUAL 0x00000050 #define OVERLAY_CMP_MIX_OR 0x00000000 #define OVERLAY_CMP_MIX_AND 0x00000100 /* OVERLAY_SCALE_CNTL */ /* #define SCALE_PIX_EXPAND 0x00000001 */ #define SCALE_Y2R_TEMP 0x00000002 #define SCALE_HORZ_MODE 0x00000004 #define SCALE_VERT_MODE 0x00000008 #define SCALE_SIGNED_UV 0x00000010 #define SCALE_GAMMA_SEL 0x00000060 #define SCALE_BANDWITH 0x04000000 #define SCALE_DIS_LIMIT 0x08000000 #define SCALE_CLK_FORCE_ON 0x20000000 #define OVERLAY_EN 0x40000000 #define SCALE_EN 0x80000000 /* VIDEO_FORMAT */ #define VIDEO_IN_VYUY422 0x0000000B #define VIDEO_IN_YVYU422 0x0000000C #define VIDEO_SIGNED_UV 0x00000010 #define SCALER_IN_RGB15 0x00030000 #define SCALER_IN_RGB16 0x00040000 #define SCALER_IN_RGB32 0x00060000 #define SCALER_IN_YUV9 0x00090000 #define SCALER_IN_YUV12 0x000A0000 #define SCALER_IN_VYUY422 0x000B0000 #define SCALER_IN_YVYU422 0x000C0000 /* CAPTURE_CONFIG */ #define OVL_BUF_MODE_SINGLE 0x00000000 #define OVL_BUF_MODE_DOUBLE 0x10000000 #define OVL_BUF_NEXT_BUF0 0x00000000 #define OVL_BUF_NEXT_BUF1 0x20000000 #endif DirectFB-1.2.10/gfxdrivers/mach64/mach64_overlay.c0000644000175000017500000006254311245562152016407 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "mach64.h" typedef struct { CoreLayerRegionConfig config; bool visible; /* overlay registers */ struct { u32 overlay_Y_X_START; u32 overlay_Y_X_END; u32 overlay_GRAPHICS_KEY_CLR; u32 overlay_GRAPHICS_KEY_MSK; u32 overlay_VIDEO_KEY_CLR; u32 overlay_VIDEO_KEY_MSK; u32 overlay_KEY_CNTL; u32 overlay_SCALE_INC; u32 overlay_SCALE_CNTL; u32 scaler_HEIGHT_WIDTH; u32 scaler_BUF_PITCH; u32 scaler_BUF0_OFFSET; u32 scaler_BUF1_OFFSET; u32 scaler_BUF0_OFFSET_U; u32 scaler_BUF0_OFFSET_V; u32 scaler_BUF1_OFFSET_U; u32 scaler_BUF1_OFFSET_V; u32 video_FORMAT; u32 capture_CONFIG; } regs; } Mach64OverlayLayerData; static void ov_reset( Mach64DriverData *mdrv ); static void ov_set_regs( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ); static void ov_calc_regs( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void ov_set_buffer( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ); static void ov_calc_buffer( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ); static void ov_set_colorkey( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ); static void ov_calc_colorkey( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config ); static void ov_set_opacity( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ); static void ov_calc_opacity( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config ); static void ov_set_field( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ); #define OV_SUPPORTED_OPTIONS (DLOP_SRC_COLORKEY | DLOP_DST_COLORKEY | DLOP_DEINTERLACING) /**********************/ static int ovLayerDataSize( void ) { return sizeof(Mach64OverlayLayerData); } static DFBResult ovInitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64DeviceData *mdev = mdrv->device_data; /* set capabilities and type */ description->caps = DLCAPS_SCREEN_LOCATION | DLCAPS_SURFACE | DLCAPS_DST_COLORKEY | DLCAPS_DEINTERLACING; if (mdev->chip >= CHIP_264VT3) description->caps |= DLCAPS_SRC_COLORKEY; description->type = DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "Mach64 Overlay" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = (mdev->chip >= CHIP_264VT3) ? 640 : 320; config->height = (mdev->chip >= CHIP_264VT3) ? 480 : 240; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; adjustment->flags = DCAF_NONE; if (mdev->chip >= CHIP_3D_RAGE_PRO) { description->caps |= DLCAPS_BRIGHTNESS | DLCAPS_SATURATION; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ adjustment->flags |= DCAF_BRIGHTNESS | DCAF_SATURATION; adjustment->brightness = 0x8000; adjustment->saturation = 0x8000; } return DFB_OK; } static DFBResult ovTestRegion( CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64DeviceData *mdev = mdrv->device_data; CoreLayerRegionConfigFlags fail = 0; int max_width, max_height = 1024; switch (mdev->chip) { case CHIP_264VT: /* 264VT2 verified */ case CHIP_3D_RAGE: /* not verified */ max_width = 384; break; case CHIP_264VT3: /* not verified */ case CHIP_3D_RAGE_II: /* not verified */ case CHIP_3D_RAGE_IIPLUS: case CHIP_264VT4: /* not verified */ case CHIP_3D_RAGE_IIC: case CHIP_3D_RAGE_XLXC: case CHIP_3D_RAGE_MOBILITY: max_width = 720; break; case CHIP_3D_RAGE_PRO: /* not verified */ case CHIP_3D_RAGE_LT_PRO: max_width = 768; break; default: D_BUG( "unknown chip" ); return DFB_UNSUPPORTED; } if (config->options & DLOP_DEINTERLACING) max_height = 2048; /* check for unsupported options */ if (config->options & ~OV_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; /* * Video keying doesn't work the same way on 264VT2 as it does * on later chips. If enabled the overlay goes completely black * so clearly it does something but not what we want. */ if (mdev->chip < CHIP_264VT3 && config->options & DLOP_SRC_COLORKEY) fail |= CLRCF_OPTIONS; /* check pixel format */ switch (config->format) { case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_YUY2: case DSPF_UYVY: break; case DSPF_I420: case DSPF_YV12: if (mdev->chip >= CHIP_3D_RAGE_PRO) break; default: fail |= CLRCF_FORMAT; } switch (config->format) { case DSPF_I420: case DSPF_YV12: if (config->height & 1) fail |= CLRCF_HEIGHT; case DSPF_YUY2: case DSPF_UYVY: if (config->width & 1) fail |= CLRCF_WIDTH; default: break; } /* check width */ if (config->width > max_width || config->width < 1) fail |= CLRCF_WIDTH; /* check height */ if (config->height > max_height || config->height < 1) fail |= CLRCF_HEIGHT; /* write back failing fields */ if (failed) *failed = fail; /* return failure if any field failed */ if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ovSetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64OverlayLayerData *mov = (Mach64OverlayLayerData*) layer_data; /* remember configuration */ mov->config = *config; if (updated == CLRCF_ALL) ov_reset( mdrv ); if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_SOURCE | CLRCF_DEST | CLRCF_OPTIONS)) { ov_calc_buffer( mdrv, mov, config, surface, lock ); ov_calc_regs( mdrv, mov, config, surface, lock ); ov_set_buffer( mdrv, mov ); ov_set_regs( mdrv, mov ); } if (updated & (CLRCF_OPTIONS | CLRCF_SRCKEY | CLRCF_DSTKEY)) { ov_calc_colorkey( mdrv, mov, config ); ov_set_colorkey( mdrv, mov ); } if (updated & CLRCF_OPTIONS) ov_set_field( mdrv, mov ); if (updated & (CLRCF_DEST | CLRCF_OPACITY)) { ov_calc_opacity( mdrv, mov, config ); ov_set_opacity( mdrv, mov ); } return DFB_OK; } static DFBResult ovRemoveRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, 2 ); /* * On 264VT2 the keyer sometimes remains active * even after the overlay has been disabled. */ mach64_out32( mmio, OVERLAY_KEY_CNTL, VIDEO_KEY_FN_FALSE | GRAPHICS_KEY_FN_FALSE | OVERLAY_CMP_MIX_OR ); mach64_out32( mmio, OVERLAY_SCALE_CNTL, 0 ); return DFB_OK; } static DFBResult ovFlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64OverlayLayerData *mov = (Mach64OverlayLayerData*) layer_data; ov_calc_buffer( mdrv, mov, &mov->config, surface, lock ); ov_set_buffer( mdrv, mov ); dfb_surface_flip( surface, false ); return DFB_OK; } static DFBResult ovSetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; if (mdev->chip < CHIP_3D_RAGE_PRO) return DFB_UNSUPPORTED; mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, SCALER_COLOUR_CNTL, (((adj->brightness >> 9) - 64) & 0x0000007F) | ((adj->saturation >> 3) & 0x00001F00) | ((adj->saturation << 5) & 0x001F0000) ); return DFB_OK; } static DFBResult ovSetInputField( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64OverlayLayerData *mov = (Mach64OverlayLayerData*) layer_data; mov->regs.capture_CONFIG = OVL_BUF_MODE_SINGLE | (field ? OVL_BUF_NEXT_BUF1 : OVL_BUF_NEXT_BUF0); ov_set_field( mdrv, mov ); return DFB_OK; } DisplayLayerFuncs mach64OverlayFuncs = { .LayerDataSize = ovLayerDataSize, .InitLayer = ovInitLayer, .TestRegion = ovTestRegion, .SetRegion = ovSetRegion, .RemoveRegion = ovRemoveRegion, .FlipRegion = ovFlipRegion, .SetColorAdjustment = ovSetColorAdjustment, .SetInputField = ovSetInputField, }; /* internal */ static void ov_reset( Mach64DriverData *mdrv ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; if (mdev->chip >= CHIP_3D_RAGE_PRO) { mach64_waitfifo( mdrv, mdev, 6 ); mach64_out32( mmio, SCALER_H_COEFF0, 0x00002000 ); mach64_out32( mmio, SCALER_H_COEFF1, 0x0D06200D ); mach64_out32( mmio, SCALER_H_COEFF2, 0x0D0A1C0D ); mach64_out32( mmio, SCALER_H_COEFF3, 0x0C0E1A0C ); mach64_out32( mmio, SCALER_H_COEFF4, 0x0C14140C ); mach64_out32( mmio, SCALER_COLOUR_CNTL, 0x00101000 ); } if (mdev->chip >= CHIP_264VT3) { mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, OVERLAY_EXCLUSIVE_HORZ, 0 ); mach64_out32( mmio, OVERLAY_EXCLUSIVE_VERT, 0 ); } mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, OVERLAY_SCALE_CNTL, 0 ); mach64_out32( mmio, SCALER_TEST, 0 ); } static void ov_set_regs( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, (mdev->chip >= CHIP_264VT3) ? 6 : 7 ); mach64_out32( mmio, VIDEO_FORMAT, mov->regs.video_FORMAT ); mach64_out32( mmio, OVERLAY_Y_X_START, mov->regs.overlay_Y_X_START ); mach64_out32( mmio, OVERLAY_Y_X_END, mov->regs.overlay_Y_X_END ); mach64_out32( mmio, OVERLAY_SCALE_INC, mov->regs.overlay_SCALE_INC ); mach64_out32( mmio, SCALER_HEIGHT_WIDTH, mov->regs.scaler_HEIGHT_WIDTH ); if (mdev->chip >= CHIP_264VT3) { mach64_out32( mmio, SCALER_BUF_PITCH, mov->regs.scaler_BUF_PITCH ); } else { mach64_out32( mmio, BUF0_PITCH, mov->regs.scaler_BUF_PITCH ); mach64_out32( mmio, BUF1_PITCH, mov->regs.scaler_BUF_PITCH ); } } static void ov_set_buffer( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, (mdev->chip >= CHIP_3D_RAGE_PRO) ? 6 : 2 ); if (mdev->chip >= CHIP_264VT3) { mach64_out32( mmio, SCALER_BUF0_OFFSET, mov->regs.scaler_BUF0_OFFSET ); mach64_out32( mmio, SCALER_BUF1_OFFSET, mov->regs.scaler_BUF1_OFFSET ); } else { mach64_out32( mmio, BUF0_OFFSET, mov->regs.scaler_BUF0_OFFSET ); mach64_out32( mmio, BUF1_OFFSET, mov->regs.scaler_BUF1_OFFSET ); } if (mdev->chip >= CHIP_3D_RAGE_PRO) { mach64_out32( mmio, SCALER_BUF0_OFFSET_U, mov->regs.scaler_BUF0_OFFSET_U ); mach64_out32( mmio, SCALER_BUF0_OFFSET_V, mov->regs.scaler_BUF0_OFFSET_V ); mach64_out32( mmio, SCALER_BUF1_OFFSET_U, mov->regs.scaler_BUF1_OFFSET_U ); mach64_out32( mmio, SCALER_BUF1_OFFSET_V, mov->regs.scaler_BUF1_OFFSET_V ); } } static void ov_set_colorkey( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, 5 ); mach64_out32( mmio, OVERLAY_GRAPHICS_KEY_CLR, mov->regs.overlay_GRAPHICS_KEY_CLR ); mach64_out32( mmio, OVERLAY_GRAPHICS_KEY_MSK, mov->regs.overlay_GRAPHICS_KEY_MSK ); mach64_out32( mmio, OVERLAY_VIDEO_KEY_CLR, mov->regs.overlay_VIDEO_KEY_CLR ); mach64_out32( mmio, OVERLAY_VIDEO_KEY_MSK, mov->regs.overlay_VIDEO_KEY_MSK ); mach64_out32( mmio, OVERLAY_KEY_CNTL, mov->regs.overlay_KEY_CNTL ); } static void ov_set_opacity( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, OVERLAY_SCALE_CNTL, mov->regs.overlay_SCALE_CNTL ); } static void ov_set_field( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, CAPTURE_CONFIG, mov->regs.capture_CONFIG ); } static void ov_calc_regs( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { Mach64DeviceData *mdev = mdrv->device_data; volatile u8 *mmio = mdrv->mmio_base; VideoMode *mode = dfb_system_current_mode(); int yres = mode->yres; unsigned int pitch = lock->pitch / DFB_BYTES_PER_PIXEL( surface->config.format ); DFBRectangle source = config->source; DFBRectangle dest = config->dest; DFBRegion dst; int h_inc, v_inc; u32 lcd_gen_ctrl, vert_stretching; u8 ecp_div; if (mode->doubled) { dest.y *= 2; dest.h *= 2; yres *= 2; } if (config->options & DLOP_DEINTERLACING) { source.y /= 2; source.h /= 2; pitch *= 2; } else mov->regs.capture_CONFIG = OVL_BUF_MODE_SINGLE | OVL_BUF_NEXT_BUF0; dst.x1 = dest.x; dst.y1 = dest.y; dst.x2 = dest.x + dest.w - 1; dst.y2 = dest.y + dest.h - 1; mov->visible = dfb_region_intersect( &dst, 0, 0, mode->xres - 1, yres - 1 ); if (mode->laced) { dest.y /= 2; dest.h /= 2; } ecp_div = (mach64_in_pll( mmio, PLL_VCLK_CNTL ) & ECP_DIV) >> 4; h_inc = (source.w << (12 + ecp_div)) / dest.w; lcd_gen_ctrl = mach64_in_lcd( mdev, mmio, LCD_GEN_CTRL ); vert_stretching = mach64_in_lcd( mdev, mmio, VERT_STRETCHING ); if ((lcd_gen_ctrl & LCD_ON) && (vert_stretching & VERT_STRETCH_EN)) v_inc = (source.h << 2) * (vert_stretching & VERT_STRETCH_RATIO0) / dest.h; else v_inc = (source.h << 12) / dest.h; switch (surface->config.format) { case DSPF_RGB555: case DSPF_ARGB1555: mov->regs.video_FORMAT = SCALER_IN_RGB15; break; case DSPF_RGB16: mov->regs.video_FORMAT = SCALER_IN_RGB16; break; case DSPF_RGB32: mov->regs.video_FORMAT = SCALER_IN_RGB32; break; case DSPF_UYVY: mov->regs.video_FORMAT = SCALER_IN_YVYU422; break; case DSPF_YUY2: mov->regs.video_FORMAT = SCALER_IN_VYUY422; break; case DSPF_I420: case DSPF_YV12: mov->regs.video_FORMAT = SCALER_IN_YUV12; break; default: D_BUG( "unexpected pixelformat" ); } mov->regs.scaler_HEIGHT_WIDTH = (source.w << 16) | source.h; mov->regs.scaler_BUF_PITCH = pitch; mov->regs.overlay_Y_X_START = (dst.x1 << 16) | dst.y1 | OVERLAY_LOCK_START; mov->regs.overlay_Y_X_END = (dst.x2 << 16) | dst.y2; mov->regs.overlay_SCALE_INC = (h_inc << 16) | v_inc; } static void ov_calc_buffer( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config, CoreSurface *surface, CoreSurfaceBufferLock *lock ) { unsigned int pitch = lock->pitch; DFBRectangle source = config->source; u32 offset, offset_u, offset_v; int cropleft, croptop; if (config->options & DLOP_DEINTERLACING) { source.y /= 2; source.h /= 2; pitch *= 2; } /* Source cropping */ cropleft = source.x; croptop = source.y; /* Add destination cropping */ if (config->dest.x < 0) cropleft += -config->dest.x * source.w / config->dest.w; if (config->dest.y < 0) croptop += -config->dest.y * source.h / config->dest.h; switch (surface->config.format) { case DSPF_I420: cropleft &= ~15; croptop &= ~1; offset_u = lock->offset + surface->config.size.h * lock->pitch; offset_v = offset_u + surface->config.size.h/2 * lock->pitch/2; offset_u += croptop/2 * pitch/2 + cropleft/2; offset_v += croptop/2 * pitch/2 + cropleft/2; break; case DSPF_YV12: cropleft &= ~15; croptop &= ~1; offset_v = lock->offset + surface->config.size.h * lock->pitch; offset_u = offset_v + surface->config.size.h/2 * lock->pitch/2; offset_v += croptop/2 * pitch/2 + cropleft/2; offset_u += croptop/2 * pitch/2 + cropleft/2; break; default: offset_u = 0; offset_v = 0; break; } offset = lock->offset; offset += croptop * pitch + cropleft * DFB_BYTES_PER_PIXEL( surface->config.format ); mov->regs.scaler_BUF0_OFFSET = offset; mov->regs.scaler_BUF0_OFFSET_U = offset_u; mov->regs.scaler_BUF0_OFFSET_V = offset_v; mov->regs.scaler_BUF1_OFFSET = offset + lock->pitch; mov->regs.scaler_BUF1_OFFSET_U = offset_u + lock->pitch/2; mov->regs.scaler_BUF1_OFFSET_V = offset_v + lock->pitch/2; } static u32 ovColorKey[] = { VIDEO_KEY_FN_TRUE | GRAPHICS_KEY_FN_TRUE | OVERLAY_CMP_MIX_OR, /* 0 */ VIDEO_KEY_FN_NOT_EQUAL | GRAPHICS_KEY_FN_FALSE | OVERLAY_CMP_MIX_OR, /* DLOP_SRC_COLORKEY */ VIDEO_KEY_FN_FALSE | GRAPHICS_KEY_FN_EQUAL | OVERLAY_CMP_MIX_OR, /* DLOP_DST_COLORKEY */ VIDEO_KEY_FN_NOT_EQUAL | GRAPHICS_KEY_FN_EQUAL | OVERLAY_CMP_MIX_AND /* DLOP_SRC_COLORKEY | DLOP_DST_COLORKEY */ }; static void ov_calc_colorkey( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config ) { DFBSurfacePixelFormat primary_format = dfb_primary_layer_pixelformat(); /* Video key is always RGB24 */ mov->regs.overlay_VIDEO_KEY_CLR = PIXEL_RGB32( config->src_key.r, config->src_key.g, config->src_key.b ); /* The same mask is used for all three components */ mov->regs.overlay_VIDEO_KEY_MSK = 0xFF; switch (primary_format) { case DSPF_RGB332: mov->regs.overlay_GRAPHICS_KEY_CLR = PIXEL_RGB332( config->dst_key.r, config->dst_key.g, config->dst_key.b ); break; case DSPF_RGB555: mov->regs.overlay_GRAPHICS_KEY_CLR = PIXEL_RGB555( config->dst_key.r, config->dst_key.g, config->dst_key.b ); break; case DSPF_ARGB1555: mov->regs.overlay_GRAPHICS_KEY_CLR = PIXEL_RGB555( config->dst_key.r, config->dst_key.g, config->dst_key.b ); break; case DSPF_RGB16: mov->regs.overlay_GRAPHICS_KEY_CLR = PIXEL_RGB16( config->dst_key.r, config->dst_key.g, config->dst_key.b ); break; case DSPF_ARGB: case DSPF_RGB32: mov->regs.overlay_GRAPHICS_KEY_CLR = PIXEL_RGB32( config->dst_key.r, config->dst_key.g, config->dst_key.b ); break; default: D_BUG( "unexpected pixelformat" ); } mov->regs.overlay_GRAPHICS_KEY_MSK = (1 << DFB_COLOR_BITS_PER_PIXEL( primary_format )) - 1; mov->regs.overlay_KEY_CNTL = ovColorKey[(config->options >> 3) & 3]; } static void ov_calc_opacity( Mach64DriverData *mdrv, Mach64OverlayLayerData *mov, CoreLayerRegionConfig *config ) { mov->regs.overlay_SCALE_CNTL = SCALE_PIX_EXPAND | SCALE_Y2R_TEMP; if (config->opacity && mov->visible) mov->regs.overlay_SCALE_CNTL |= OVERLAY_EN | SCALE_EN; } DirectFB-1.2.10/gfxdrivers/mach64/mach64_state.c0000644000175000017500000005330611245562152016043 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "regs.h" #include "mmio.h" #include "mach64.h" #include "mach64_state.h" 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) ); } void mach64gt_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_RGB332; break; case DSPF_RGB555: case DSPF_ARGB1555: mdev->pix_width |= DST_PIX_WIDTH_ARGB1555; break; case DSPF_RGB444: case DSPF_ARGB4444: mdev->pix_width |= DST_PIX_WIDTH_ARGB4444; break; case DSPF_RGB16: mdev->pix_width |= DST_PIX_WIDTH_RGB565; break; case DSPF_RGB32: case DSPF_ARGB: mdev->pix_width |= DST_PIX_WIDTH_ARGB8888; break; default: D_BUG( "unexpected pixelformat!" ); return; } mdev->draw_blend &= ~DITHER_EN; mdev->blit_blend &= ~DITHER_EN; if (DFB_COLOR_BITS_PER_PIXEL( destination->config.format ) < 24) { mdev->draw_blend |= DITHER_EN; mdev->blit_blend |= DITHER_EN; } mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, DST_OFF_PITCH, (state->dst.offset/8) | ((pitch/8) << 22) ); } void mach64_set_source( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *source = state->source; unsigned int pitch = state->src.pitch / DFB_BYTES_PER_PIXEL( source->config.format ); if (MACH64_IS_VALID( m_source )) return; mdev->pix_width &= ~SRC_PIX_WIDTH; switch (source->config.format) { case DSPF_RGB332: mdev->pix_width |= SRC_PIX_WIDTH_8BPP; break; case DSPF_RGB555: case DSPF_ARGB1555: mdev->pix_width |= SRC_PIX_WIDTH_15BPP; break; case DSPF_RGB16: mdev->pix_width |= SRC_PIX_WIDTH_16BPP; break; case DSPF_RGB32: case DSPF_ARGB: mdev->pix_width |= SRC_PIX_WIDTH_32BPP; break; default: D_BUG( "unexpected pixelformat!" ); return; } mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, SRC_OFF_PITCH, (state->src.offset/8) | ((pitch/8) << 22) ); MACH64_VALIDATE( m_source ); } void mach64gt_set_source( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *source = state->source; unsigned int pitch = state->src.pitch / DFB_BYTES_PER_PIXEL( source->config.format ); if (MACH64_IS_VALID( m_source )) return; mdev->pix_width &= ~SRC_PIX_WIDTH; switch (source->config.format) { case DSPF_RGB332: mdev->pix_width |= SRC_PIX_WIDTH_RGB332; break; case DSPF_RGB555: case DSPF_ARGB1555: mdev->pix_width |= SRC_PIX_WIDTH_ARGB1555; break; case DSPF_RGB444: case DSPF_ARGB4444: mdev->pix_width |= SRC_PIX_WIDTH_ARGB4444; break; case DSPF_RGB16: mdev->pix_width |= SRC_PIX_WIDTH_RGB565; break; case DSPF_RGB32: case DSPF_ARGB: mdev->pix_width |= SRC_PIX_WIDTH_ARGB8888; break; default: D_BUG( "unexpected pixelformat!" ); return; } mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, SRC_OFF_PITCH, (state->src.offset/8) | ((pitch/8) << 22) ); MACH64_VALIDATE( m_source ); } void mach64gt_set_source_scale( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *source = state->source; unsigned int offset = state->src.offset; unsigned int pitch = state->src.pitch; int height = source->config.size.h; if (MACH64_IS_VALID( m_source_scale )) return; mdev->pix_width &= ~SCALE_PIX_WIDTH; switch (source->config.format) { case DSPF_RGB332: mdev->pix_width |= SCALE_PIX_WIDTH_RGB332; break; case DSPF_RGB555: case DSPF_ARGB1555: mdev->pix_width |= SCALE_PIX_WIDTH_ARGB1555; break; case DSPF_RGB444: case DSPF_ARGB4444: mdev->pix_width |= SCALE_PIX_WIDTH_ARGB4444; break; case DSPF_RGB16: mdev->pix_width |= SCALE_PIX_WIDTH_RGB565; break; case DSPF_RGB32: case DSPF_ARGB: mdev->pix_width |= SCALE_PIX_WIDTH_ARGB8888; break; default: D_BUG( "unexpected pixelformat!" ); return; } mdev->blit_blend &= ~SCALE_PIX_EXPAND; if (DFB_COLOR_BITS_PER_PIXEL( source->config.format ) < 24) mdev->blit_blend |= SCALE_PIX_EXPAND; mdev->field = source->field; if (mdev->blit_deinterlace) { if (mdev->field) { if (source->config.caps & DSCAPS_SEPARATED) { offset += height/2 * pitch; } else { offset += pitch; pitch *= 2; } } height /= 2; } mdev->source = source; mdev->scale_offset = offset; mdev->scale_pitch = pitch; mdev->tex_offset = offset; mdev->tex_pitch = direct_log2( pitch / DFB_BYTES_PER_PIXEL( source->config.format ) ); mdev->tex_height = direct_log2( height ); mdev->tex_size = MAX( mdev->tex_pitch, mdev->tex_height ); mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, TEX_SIZE_PITCH, (mdev->tex_pitch << 0) | (mdev->tex_size << 4) | (mdev->tex_height << 8) ); if (mdev->chip >= CHIP_3D_RAGE_PRO) { mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, TEX_CNTL, TEX_CACHE_FLUSH ); } MACH64_VALIDATE( m_source_scale ); } void mach64_set_clip( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, SC_LEFT_RIGHT, (S13( state->clip.x2 ) << 16) | S13( state->clip.x1 ) ); mach64_out32( mmio, SC_TOP_BOTTOM, (S14( state->clip.y2 ) << 16) | S14( state->clip.y1 ) ); } void mach64_set_color( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; DFBColor color = state->color; u32 clr; if (MACH64_IS_VALID( m_color )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = (color.r * (color.a + 1)) >> 8; color.g = (color.g * (color.a + 1)) >> 8; color.b = (color.b * (color.a + 1)) >> 8; } switch (state->destination->config.format) { case DSPF_RGB332: clr = PIXEL_RGB332( color.r, color.g, color.b ); break; case DSPF_RGB555: clr = PIXEL_RGB555( color.r, color.g, color.b ); break; case DSPF_ARGB1555: clr = PIXEL_ARGB1555( color.a, color.r, color.g, color.b ); break; case DSPF_RGB444: clr = PIXEL_RGB444( color.r, color.g, color.b ); break; case DSPF_ARGB4444: clr = PIXEL_ARGB4444( color.a, color.r, color.g, color.b ); break; case DSPF_RGB16: clr = PIXEL_RGB16( color.r, color.g, color.b ); break; case DSPF_RGB32: clr = PIXEL_RGB32( color.r, color.g, color.b ); break; case DSPF_ARGB: clr = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; default: D_BUG( "unexpected pixelformat!" ); return; } mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, DP_FRGD_CLR, clr ); MACH64_VALIDATE( m_color ); } void mach64_set_color_3d( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; DFBColor color = state->color; if (MACH64_IS_VALID( m_color_3d )) return; if (state->drawingflags & DSDRAW_SRC_PREMULTIPLY) { color.r = (color.r * (color.a + 1)) >> 8; color.g = (color.g * (color.a + 1)) >> 8; color.b = (color.b * (color.a + 1)) >> 8; } /* Some 3D color registers scaler registers are shared. */ mach64_waitfifo( mdrv, mdev, 7 ); mach64_out32( mmio, RED_X_INC, 0 ); mach64_out32( mmio, RED_START, color.r << 16 ); mach64_out32( mmio, GREEN_X_INC, 0 ); mach64_out32( mmio, GREEN_START, color.g << 16 ); mach64_out32( mmio, BLUE_X_INC, 0 ); mach64_out32( mmio, BLUE_START, color.b << 16 ); mach64_out32( mmio, ALPHA_START, color.a << 16 ); MACH64_INVALIDATE( m_color_tex | m_blit_blend ); MACH64_VALIDATE( m_color_3d ); } void mach64_set_color_tex( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; DFBColor color = state->color; if (MACH64_IS_VALID( m_color_tex )) return; if (state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { if (state->blittingflags & DSBLIT_COLORIZE) { color.r = (color.r * (color.a + 1)) >> 8; color.g = (color.g * (color.a + 1)) >> 8; color.b = (color.b * (color.a + 1)) >> 8; } else { color.r = color.g = color.b = color.a; } } /* Some 3D color registers scaler registers are shared. */ mach64_waitfifo( mdrv, mdev, 7 ); mach64_out32( mmio, RED_X_INC, 0 ); mach64_out32( mmio, RED_START, color.r << 16 ); mach64_out32( mmio, GREEN_X_INC, 0 ); mach64_out32( mmio, GREEN_START, color.g << 16 ); mach64_out32( mmio, BLUE_X_INC, 0 ); mach64_out32( mmio, BLUE_START, color.b << 16 ); mach64_out32( mmio, ALPHA_START, color.a << 16 ); MACH64_INVALIDATE( m_color_3d | m_blit_blend ); MACH64_VALIDATE( m_color_tex ); } void mach64_set_src_colorkey( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; if (MACH64_IS_VALID( m_srckey )) return; mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, CLR_CMP_MSK, (1 << DFB_COLOR_BITS_PER_PIXEL( state->source->config.format )) - 1 ); mach64_out32( mmio, CLR_CMP_CLR, state->src_colorkey ); mach64_out32( mmio, CLR_CMP_CNTL, CLR_CMP_FN_EQUAL | CLR_CMP_SRC_2D ); MACH64_VALIDATE( m_srckey ); MACH64_INVALIDATE( m_srckey_scale | m_dstkey | m_disable_key ); } void mach64_set_src_colorkey_scale( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; u32 clr, msk; if (MACH64_IS_VALID( m_srckey_scale )) return; if (mdev->chip < CHIP_3D_RAGE_PRO) { switch (state->source->config.format) { case DSPF_RGB332: clr = ((state->src_colorkey & 0xE0) << 16) | ((state->src_colorkey & 0x1C) << 11) | ((state->src_colorkey & 0x03) << 6); msk = 0xE0E0C0; break; case DSPF_RGB444: case DSPF_ARGB4444: clr = ((state->src_colorkey & 0x0F00) << 12) | ((state->src_colorkey & 0x00F0) << 8) | ((state->src_colorkey & 0x000F) << 4); msk = 0xF0F0F0; break; case DSPF_RGB555: case DSPF_ARGB1555: clr = ((state->src_colorkey & 0x7C00) << 9) | ((state->src_colorkey & 0x03E0) << 6) | ((state->src_colorkey & 0x001F) << 3); msk = 0xF8F8F8; break; case DSPF_RGB16: clr = ((state->src_colorkey & 0xF800) << 8) | ((state->src_colorkey & 0x07E0) << 5) | ((state->src_colorkey & 0x001F) << 3); msk = 0xF8FCF8; break; case DSPF_RGB32: case DSPF_ARGB: clr = state->src_colorkey; msk = 0xFFFFFF; break; default: D_BUG( "unexpected pixelformat!" ); return; } } else { clr = state->src_colorkey; msk = (1 << DFB_COLOR_BITS_PER_PIXEL( state->source->config.format )) - 1; } mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, CLR_CMP_MSK, msk ); mach64_out32( mmio, CLR_CMP_CLR, clr ); mach64_out32( mmio, CLR_CMP_CNTL, CLR_CMP_FN_EQUAL | CLR_CMP_SRC_SCALE ); MACH64_VALIDATE( m_srckey_scale ); MACH64_INVALIDATE( m_srckey | m_dstkey | m_disable_key ); } void mach64_set_dst_colorkey( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; if (MACH64_IS_VALID( m_dstkey )) return; mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, CLR_CMP_MSK, (1 << DFB_COLOR_BITS_PER_PIXEL( state->destination->config.format )) - 1 ); mach64_out32( mmio, CLR_CMP_CLR, state->dst_colorkey ); mach64_out32( mmio, CLR_CMP_CNTL, CLR_CMP_FN_NOT_EQUAL | CLR_CMP_SRC_DEST ); MACH64_VALIDATE( m_dstkey ); MACH64_INVALIDATE( m_srckey | m_srckey_scale | m_disable_key ); } void mach64_disable_colorkey( Mach64DriverData *mdrv, Mach64DeviceData *mdev ) { volatile u8 *mmio = mdrv->mmio_base; if (MACH64_IS_VALID( m_disable_key )) return; mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, CLR_CMP_CNTL, CLR_CMP_FN_FALSE ); MACH64_VALIDATE( m_disable_key ); MACH64_INVALIDATE( m_srckey | m_srckey_scale | m_dstkey ); } static u32 mach64SourceBlend[] = { ALPHA_BLND_SRC_ZERO, ALPHA_BLND_SRC_ONE, 0, 0, ALPHA_BLND_SRC_SRCALPHA, ALPHA_BLND_SRC_INVSRCALPHA, ALPHA_BLND_SRC_DSTALPHA, ALPHA_BLND_SRC_INVDSTALPHA, ALPHA_BLND_SRC_DSTCOLOR, ALPHA_BLND_SRC_INVDSTCOLOR, ALPHA_BLND_SAT }; static u32 mach64DestBlend[] = { ALPHA_BLND_DST_ZERO, ALPHA_BLND_DST_ONE, ALPHA_BLND_DST_SRCCOLOR, ALPHA_BLND_DST_INVSRCCOLOR, ALPHA_BLND_DST_SRCALPHA, ALPHA_BLND_DST_INVSRCALPHA, ALPHA_BLND_DST_DSTALPHA, ALPHA_BLND_DST_INVDSTALPHA, 0, 0, 0 }; void mach64_set_draw_blend( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; if (MACH64_IS_VALID( m_draw_blend )) return; mdev->draw_blend &= DITHER_EN; mdev->draw_blend |= ALPHA_FOG_EN_ALPHA | mach64SourceBlend[state->src_blend - 1] | mach64DestBlend [state->dst_blend - 1]; if (mdev->chip >= CHIP_3D_RAGE_PRO) { /* FIXME: This is wrong. */ mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, ALPHA_TST_CNTL, ALPHA_DST_SEL_DSTALPHA ); } MACH64_VALIDATE( m_draw_blend ); } void mach64_set_blit_blend( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ) { volatile u8 *mmio = mdrv->mmio_base; if (MACH64_IS_VALID( m_blit_blend )) return; mdev->blit_blend &= SCALE_PIX_EXPAND | DITHER_EN; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { /* Disable dithering because it is applied even when * the source pixels are completely transparent. */ if (DFB_PIXELFORMAT_HAS_ALPHA( state->source->config.format )) mdev->blit_blend &= ~DITHER_EN; mdev->blit_blend |= ALPHA_FOG_EN_ALPHA | mach64SourceBlend[state->src_blend - 1] | mach64DestBlend [state->dst_blend - 1]; if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { if (DFB_PIXELFORMAT_HAS_ALPHA( state->source->config.format )) { mdev->blit_blend |= TEX_MAP_AEN; } else { mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, ALPHA_START, 0xFF << 16 ); MACH64_INVALIDATE( m_color_3d | m_color_tex ); } } if (mdev->chip >= CHIP_3D_RAGE_PRO) { /* FIXME: This is wrong. */ mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, ALPHA_TST_CNTL, ALPHA_DST_SEL_DSTALPHA ); } } else { /* This needs to be set even without alpha blending. * Otherwise alpha channel won't get copied. */ if (DFB_PIXELFORMAT_HAS_ALPHA( state->source->config.format )) mdev->blit_blend |= TEX_MAP_AEN; if (mdev->chip >= CHIP_3D_RAGE_PRO) { /* FIXME: This is wrong. */ mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, ALPHA_TST_CNTL, ALPHA_DST_SEL_SRCALPHA ); } } if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) mdev->blit_blend |= TEX_LIGHT_FCN_MODULATE; MACH64_VALIDATE( m_blit_blend ); } DirectFB-1.2.10/gfxdrivers/mach64/mach64_state.h0000644000175000017500000000702711245562152016047 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ___MACH64_STATE_H__ #define ___MACH64_STATE_H__ #include "mach64.h" void mach64_set_destination( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64gt_set_destination( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_source( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64gt_set_source( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64gt_set_source_scale( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_clip( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_color( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_color_3d( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_color_tex( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_src_colorkey( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_src_colorkey_scale( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_dst_colorkey( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_disable_colorkey( Mach64DriverData *mdrv, Mach64DeviceData *mdev ); void mach64_set_draw_blend( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); void mach64_set_blit_blend( Mach64DriverData *mdrv, Mach64DeviceData *mdev, CardState *state ); #endif DirectFB-1.2.10/gfxdrivers/mach64/mach64.c0000644000175000017500000015736611245562152014656 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( mach64 ) #include "regs.h" #include "mmio.h" #include "mach64_state.h" #include "mach64.h" /* driver capability flags */ #define MACH64_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_DST_COLORKEY | DSDRAW_SRC_PREMULTIPLY) #define MACH64_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY) #define MACH64_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE) #define MACH64_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT) #define MACH64GT_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_DST_COLORKEY | DSDRAW_BLEND | DSDRAW_SRC_PREMULTIPLY) #define MACH64GT_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_SRC_COLORKEY | DSBLIT_DST_COLORKEY | DSBLIT_BLEND_COLORALPHA | \ DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_COLORIZE | DSBLIT_DEINTERLACE | \ DSBLIT_SRC_PREMULTCOLOR) #define MACH64GT_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE | DFXL_FILLTRIANGLE) #define MACH64GT_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT) static bool mach64DrawLine2D( void *drv, void *dev, DFBRegion *line ); static bool mach64DrawLine3D( void *drv, void *dev, DFBRegion *line ); static bool mach64Blit2D( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool mach64BlitScaleOld( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool mach64StretchBlitScaleOld( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool mach64BlitScale( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool mach64StretchBlitScale( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool mach64BlitTexOld( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool mach64StretchBlitTexOld( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); static bool mach64BlitTex( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); static bool mach64StretchBlitTex( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ); /* required implementations */ static void mach64EngineReset( void *drv, void *dev ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; mach64_waitidle( mdrv, mdev ); mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, DP_WRITE_MSK, 0xFFFFFFFF ); mach64_out32( mmio, DP_MIX, FRGD_MIX_SRC | BKGD_MIX_DST ); if (mdrv->accelerator == FB_ACCEL_ATI_MACH64GT) { mach64_waitfifo( mdrv, mdev, 12 ); /* Some 3D registers aren't accessible without this. */ mach64_out32( mmio, SCALE_3D_CNTL, SCALE_3D_FCN_SHADE ); mach64_out32( mmio, SRC_CNTL, 0 ); mach64_out32( mmio, Z_CNTL, 0 ); mach64_out32( mmio, RED_X_INC, 0 ); mach64_out32( mmio, RED_Y_INC, 0 ); mach64_out32( mmio, GREEN_X_INC, 0 ); mach64_out32( mmio, GREEN_Y_INC, 0 ); mach64_out32( mmio, BLUE_X_INC, 0 ); mach64_out32( mmio, BLUE_Y_INC, 0 ); mach64_out32( mmio, ALPHA_X_INC, 0 ); mach64_out32( mmio, ALPHA_Y_INC, 0 ); mach64_out32( mmio, SCALE_3D_CNTL, 0 ); } if (mdev->chip >= CHIP_3D_RAGE_PRO) mach64_out32( mmio, HW_DEBUG, mdev->hw_debug ); } static DFBResult mach64EngineSync( void *drv, void *dev ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64_waitidle( mdrv, mdev ); return DFB_OK; } static void mach64FlushTextureCache( void *drv, void *dev ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; if (mdev->chip >= CHIP_3D_RAGE_PRO) { mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, TEX_CNTL, TEX_CACHE_FLUSH ); } } static bool mach64_use_scaler( Mach64DeviceData *mdev, CardState *state, DFBAccelerationMask accel ) { if (accel & DFXL_STRETCHBLIT || state->source->config.format != state->destination->config.format || state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_DEINTERLACE)) return true; return false; } static bool mach64_use_tex( Mach64DeviceData *mdev, CardState *state, DFBAccelerationMask accel ) { if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) return true; /* * 3D Rage II chips lock up if the scaler is used with destination * color keying. Using the texture engine works however. */ if (mdev->chip < CHIP_3D_RAGE_PRO && mach64_use_scaler( mdev, state, accel ) && state->blittingflags & DSBLIT_DST_COLORKEY) return true; return false; } static bool mach64_use_scaler_3d( Mach64DeviceData *mdev, CardState *state, DFBAccelerationMask accel ) { if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & DSDRAW_BLEND) return true; } else { if (accel & DFXL_STRETCHBLIT || state->source->config.format != state->destination->config.format || state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_DEINTERLACE | DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) return true; } return false; } static bool mach64_check_blend( Mach64DeviceData *mdev, CardState *state ) { switch (state->src_blend) { case DSBF_SRCCOLOR: case DSBF_INVSRCCOLOR: return false; case DSBF_DESTALPHA: case DSBF_INVDESTALPHA: case DSBF_SRCALPHASAT: if (mdev->chip < CHIP_3D_RAGE_PRO) return false; default: break; } switch (state->dst_blend) { case DSBF_DESTCOLOR: case DSBF_INVDESTCOLOR: case DSBF_SRCALPHASAT: return false; case DSBF_DESTALPHA: case DSBF_INVDESTALPHA: if (mdev->chip < CHIP_3D_RAGE_PRO) return false; default: break; } return true; } static void mach64CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { switch (state->destination->config.format) { case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MACH64_SUPPORTED_DRAWINGFLAGS) return; state->accel |= MACH64_SUPPORTED_DRAWINGFUNCTIONS; } else { if (state->source->config.format != state->destination->config.format) return; if (state->blittingflags & ~MACH64_SUPPORTED_BLITTINGFLAGS) return; /* Can't do source and destination color keying at the same time. */ if (state->blittingflags & DSBLIT_SRC_COLORKEY && state->blittingflags & DSBLIT_DST_COLORKEY) return; state->accel |= MACH64_SUPPORTED_BLITTINGFUNCTIONS; } } static void mach64GTCheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { Mach64DeviceData *mdev = (Mach64DeviceData*) dev; switch (state->destination->config.format) { case DSPF_RGB444: case DSPF_ARGB4444: /* Not supported. */ if (mdev->chip < CHIP_3D_RAGE_PRO) return; /* Causes the chip to lock up. */ if (mdev->chip < CHIP_3D_RAGE_XLXC && mach64_use_scaler_3d( mdev, state, accel )) return; case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (DFB_DRAWING_FUNCTION( accel )) { if (state->drawingflags & ~MACH64GT_SUPPORTED_DRAWINGFLAGS) return; if (state->drawingflags & DSDRAW_BLEND && !mach64_check_blend( mdev, state )) return; /* Causes the chip to lock up. */ if (state->drawingflags & DSDRAW_BLEND && state->drawingflags & DSDRAW_DST_COLORKEY) return; state->accel |= MACH64GT_SUPPORTED_DRAWINGFUNCTIONS; } else { CoreSurface *source = state->source; switch (source->config.format) { case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB444: case DSPF_ARGB4444: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; default: return; } if (state->blittingflags & ~MACH64GT_SUPPORTED_BLITTINGFLAGS) return; if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA) && !mach64_check_blend( mdev, state )) return; /* Can't do alpha modulation. */ if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL && state->blittingflags & DSBLIT_BLEND_COLORALPHA) return; /* Can't do source and destination color keying at the same time. */ if (state->blittingflags & DSBLIT_SRC_COLORKEY && state->blittingflags & DSBLIT_DST_COLORKEY) return; /* Causes the chip to lock up. */ if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA) && state->blittingflags & DSBLIT_DST_COLORKEY) return; if (mach64_use_tex( mdev, state, accel )) { /* Max texture size is 1024x1024. */ if (source->config.size.w > 1024 || source->config.size.h > 1024) return; state->accel |= MACH64GT_SUPPORTED_BLITTINGFUNCTIONS; } else if (mach64_use_scaler( mdev, state, accel )) { /* Max scaler source size depends on the chip type. */ if (mdev->chip < CHIP_3D_RAGE_PRO) { /* Tested on 3D Rage II+ and IIC. */ if (source->config.size.w > 4095 || source->config.size.h > 4095) return; } else { /* Tested on 3D Rage LT Pro, XL and Mobility. */ if (source->config.size.w > 4096 || source->config.size.h > 16384) return; } state->accel |= MACH64GT_SUPPORTED_BLITTINGFUNCTIONS; } else state->accel |= accel; } } static void mach64SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; if (state->mod_hw == SMF_ALL) { mdev->valid = 0; } else if (state->mod_hw) { if (state->mod_hw & SMF_SOURCE) MACH64_INVALIDATE( m_source | m_srckey ); if (state->mod_hw & SMF_SRC_COLORKEY) MACH64_INVALIDATE( m_srckey ); if (state->mod_hw & SMF_DESTINATION) MACH64_INVALIDATE( m_color | m_dstkey ); if (state->mod_hw & SMF_COLOR) MACH64_INVALIDATE( m_color ); if (state->mod_hw & SMF_DST_COLORKEY) MACH64_INVALIDATE( m_dstkey ); if (state->mod_hw & SMF_BLITTING_FLAGS) MACH64_INVALIDATE( m_srckey | m_dstkey | m_disable_key ); if (state->mod_hw & SMF_DRAWING_FLAGS) MACH64_INVALIDATE( m_color | m_dstkey | m_disable_key ); } if (state->mod_hw & SMF_DESTINATION) mach64_set_destination( mdrv, mdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, DP_SRC, FRGD_SRC_FRGD_CLR ); mach64_out32( mmio, DP_PIX_WIDTH, mdev->pix_width ); mach64_set_color( mdrv, mdev, state ); if (state->drawingflags & DSDRAW_DST_COLORKEY) mach64_set_dst_colorkey( mdrv, mdev, state ); else mach64_disable_colorkey( mdrv, mdev ); funcs->DrawLine = mach64DrawLine2D; state->set = DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: mach64_set_source( mdrv, mdev, state ); mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, DP_SRC, FRGD_SRC_BLIT ); mach64_out32( mmio, DP_PIX_WIDTH, mdev->pix_width ); if (state->blittingflags & DSBLIT_DST_COLORKEY) mach64_set_dst_colorkey( mdrv, mdev, state ); else if (state->blittingflags & DSBLIT_SRC_COLORKEY) mach64_set_src_colorkey( mdrv, mdev, state ); else mach64_disable_colorkey( mdrv, mdev ); funcs->Blit = mach64Blit2D; state->set = DFXL_BLIT; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } if (state->mod_hw & SMF_CLIP) { mach64_set_clip( mdrv, mdev, state ); mdev->clip = state->clip; } state->mod_hw = 0; } static void mach64GTSetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; bool use_scaler_3d; if (state->mod_hw == SMF_ALL) { mdev->valid = 0; } else if (state->mod_hw) { if (state->mod_hw & SMF_SOURCE) MACH64_INVALIDATE( m_source | m_source_scale | m_srckey | m_srckey_scale | m_blit_blend ); if (state->mod_hw & SMF_SRC_COLORKEY) MACH64_INVALIDATE( m_srckey | m_srckey_scale ); if (state->mod_hw & SMF_DESTINATION) MACH64_INVALIDATE( m_color | m_dstkey ); if (state->mod_hw & SMF_COLOR) MACH64_INVALIDATE( m_color | m_color_3d | m_color_tex ); if (state->mod_hw & SMF_DST_COLORKEY) MACH64_INVALIDATE( m_dstkey ); if (state->mod_hw & SMF_BLITTING_FLAGS) MACH64_INVALIDATE( m_color_tex | m_source_scale | m_srckey | m_srckey_scale | m_dstkey | m_disable_key | m_blit_blend ); if (state->mod_hw & SMF_DRAWING_FLAGS) MACH64_INVALIDATE( m_color | m_color_3d | m_dstkey | m_disable_key | m_draw_blend ); if (state->mod_hw & (SMF_SRC_BLEND | SMF_DST_BLEND)) MACH64_INVALIDATE( m_draw_blend | m_blit_blend ); } use_scaler_3d = mach64_use_scaler_3d( mdev, state, accel ); /* At least 3D Rage II+ and IIC chips _will_ lock up without this. */ if (mdev->chip < CHIP_3D_RAGE_PRO && use_scaler_3d != mdev->use_scaler_3d) mach64_waitidle( mdrv, mdev ); mdev->use_scaler_3d = use_scaler_3d; if (state->mod_hw & SMF_DESTINATION) mach64gt_set_destination( mdrv, mdev, state ); switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: case DFXL_FILLTRIANGLE: if (use_scaler_3d) { mach64_waitfifo( mdrv, mdev, 3 ); /* Some 3D registers aren't accessible without this. */ mach64_out32( mmio, SCALE_3D_CNTL, SCALE_3D_FCN_SHADE ); mach64_out32( mmio, DP_SRC, FRGD_SRC_SCALE ); mach64_out32( mmio, DP_PIX_WIDTH, mdev->pix_width ); mach64_set_color_3d( mdrv, mdev, state ); mach64_set_draw_blend( mdrv, mdev, state ); mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, SCALE_3D_CNTL, SCALE_3D_FCN_SHADE | mdev->draw_blend ); funcs->DrawLine = mach64DrawLine3D; } else { mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, SCALE_3D_CNTL, 0 ); mach64_out32( mmio, DP_SRC, FRGD_SRC_FRGD_CLR ); mach64_out32( mmio, DP_PIX_WIDTH, mdev->pix_width ); mach64_set_color( mdrv, mdev, state ); funcs->DrawLine = mach64DrawLine2D; } if (state->drawingflags & DSDRAW_DST_COLORKEY) mach64_set_dst_colorkey( mdrv, mdev, state ); else mach64_disable_colorkey( mdrv, mdev ); state->set = DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE | DFXL_FILLTRIANGLE; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: mdev->blit_deinterlace = state->blittingflags & DSBLIT_DEINTERLACE; if (use_scaler_3d) { mach64_waitfifo( mdrv, mdev, 1 ); /* Some 3D registers aren't accessible without this. */ mach64_out32( mmio, SCALE_3D_CNTL, SCALE_3D_FCN_SHADE ); mach64gt_set_source_scale( mdrv, mdev, state ); mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, DP_SRC, FRGD_SRC_SCALE ); mach64_out32( mmio, DP_PIX_WIDTH, mdev->pix_width ); if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) mach64_set_color_tex( mdrv, mdev, state ); mach64_set_blit_blend( mdrv, mdev, state ); if (state->blittingflags & DSBLIT_DST_COLORKEY) mach64_set_dst_colorkey( mdrv, mdev, state ); else if (state->blittingflags & DSBLIT_SRC_COLORKEY) mach64_set_src_colorkey_scale( mdrv, mdev, state ); else mach64_disable_colorkey( mdrv, mdev ); if (mdev->chip < CHIP_3D_RAGE_PRO) { if (mach64_use_tex( mdev, state, accel )) { funcs->Blit = mach64BlitTexOld; funcs->StretchBlit = mach64StretchBlitTexOld; } else { funcs->Blit = mach64BlitScaleOld; funcs->StretchBlit = mach64StretchBlitScaleOld; } } else { if (mach64_use_tex( mdev, state, accel )) { funcs->Blit = mach64BlitTex; funcs->StretchBlit = mach64StretchBlitTex; } else { funcs->Blit = mach64BlitScale; funcs->StretchBlit = mach64StretchBlitScale; } } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; } else { mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, SCALE_3D_CNTL, 0 ); mach64gt_set_source( mdrv, mdev, state ); mach64_waitfifo( mdrv, mdev, 2 ); mach64_out32( mmio, DP_SRC, FRGD_SRC_BLIT ); mach64_out32( mmio, DP_PIX_WIDTH, mdev->pix_width ); if (state->blittingflags & DSBLIT_DST_COLORKEY) mach64_set_dst_colorkey( mdrv, mdev, state ); else if (state->blittingflags & DSBLIT_SRC_COLORKEY) mach64_set_src_colorkey( mdrv, mdev, state ); else mach64_disable_colorkey( mdrv, mdev ); funcs->Blit = mach64Blit2D; state->set = DFXL_BLIT; } break; default: D_BUG( "unexpected drawing/blitting function" ); break; } if (state->mod_hw & SMF_CLIP) { mach64_set_clip( mdrv, mdev, state ); mdev->clip = state->clip; } state->mod_hw = 0; } /* */ static bool mach64FillRectangle( void *drv, void *dev, DFBRectangle *rect ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, DST_CNTL, DST_X_DIR | DST_Y_DIR ); mach64_out32( mmio, DST_Y_X, (S13( rect->x ) << 16) | S14( rect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (rect->w << 16) | rect->h ); return true; } static bool mach64DrawRectangle( void *drv, void *dev, DFBRectangle *rect ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; volatile u8 *mmio = mdrv->mmio_base; int x2 = rect->x + rect->w - 1; int y2 = rect->y + rect->h - 1; mach64_waitfifo( mdrv, mdev, 8 ); mach64_out32( mmio, DST_CNTL, DST_X_DIR | DST_Y_DIR ); mach64_out32( mmio, DST_Y_X, (S13( rect->x ) << 16) | S14( rect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (1 << 16) | rect->h ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (rect->w << 16) | 1 ); mach64_out32( mmio, DST_CNTL, 0 ); mach64_out32( mmio, DST_Y_X, (S13( x2 ) << 16) | S14( y2 ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (1 << 16) | rect->h ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (rect->w << 16) | 1 ); return true; } static void mach64_draw_line( Mach64DriverData *mdrv, Mach64DeviceData *mdev, int x1, int y1, int x2, int y2, bool draw_3d ) { volatile u8 *mmio = mdrv->mmio_base; u32 dst_cntl = 0; int dx, dy; dx = x2 - x1; dy = y2 - y1; if (dx < 0) dx = -dx; else dst_cntl |= DST_X_DIR; if (dy < 0) dy = -dy; else dst_cntl |= DST_Y_DIR; if (!dx || !dy) { /* horizontal / vertical line */ mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, DST_CNTL, dst_cntl); mach64_out32( mmio, DST_Y_X, (S13( x1 ) << 16) | S14( y1 ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, ((dx+1) << 16) | (dy+1) ); return; } if (dx < dy) { int tmp = dx; dx = dy; dy = tmp; dst_cntl |= DST_Y_MAJOR; } mach64_waitfifo( mdrv, mdev, 6 ); mach64_out32( mmio, DST_CNTL, DST_LAST_PEL | dst_cntl ); mach64_out32( mmio, DST_Y_X, (S13( x1 ) << 16) | S14( y1 ) ); /* Bresenham parameters must be calculated differently * for the 2D and 3D engines. */ if (draw_3d) { mach64_out32( mmio, DST_BRES_ERR, -dx ); mach64_out32( mmio, DST_BRES_INC, 2*dy ); mach64_out32( mmio, DST_BRES_DEC, -2*dx ); mach64_out32( mmio, DST_BRES_LNTH, dx+1 ); } else { mach64_out32( mmio, DST_BRES_ERR, 2*dy-dx ); mach64_out32( mmio, DST_BRES_INC, 2*dy ); mach64_out32( mmio, DST_BRES_DEC, 2*dy-2*dx ); mach64_out32( mmio, DST_BRES_LNTH, dx+1 ); } } static bool mach64DrawLine2D( void *drv, void *dev, DFBRegion *line ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64_draw_line( mdrv, mdev, line->x1, line->y1, line->x2, line->y2, false ); return true; } static bool mach64DrawLine3D( void *drv, void *dev, DFBRegion *line ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64_draw_line( mdrv, mdev, line->x1, line->y1, line->x2, line->y2, true ); return true; } static void mach64_fill_trapezoid( Mach64DriverData *mdrv, Mach64DeviceData *mdev, int X1l, int X1r, int X2l, int X2r, int Y, int dY ) { volatile u8 *mmio = mdrv->mmio_base; u32 dst_cntl; int dXl, dXr; X1r++; X2r++; dst_cntl = DST_Y_DIR | TRAP_FILL_DIR; dXl = X2l - X1l; if (dXl < 0) dXl = -dXl; else dst_cntl |= DST_X_DIR; dXr = X2r - X1r; if (dXr < 0) dXr = -dXr; else dst_cntl |= TRAIL_X_DIR; mach64_waitfifo( mdrv, mdev, 9 ); mach64_out32( mmio, DST_CNTL, dst_cntl ); mach64_out32( mmio, DST_Y_X, (S13( X1l ) << 16) | S14( Y ) ); mach64_out32( mmio, LEAD_BRES_ERR, -dY ); mach64_out32( mmio, LEAD_BRES_INC, 2*dXl ); mach64_out32( mmio, LEAD_BRES_DEC, -2*dY ); mach64_out32( mmio, TRAIL_BRES_ERR, -dY ); mach64_out32( mmio, TRAIL_BRES_INC, 2*dXr ); mach64_out32( mmio, TRAIL_BRES_DEC, -2*dY ); mach64_out32( mmio, LEAD_BRES_LNTH, (S14( X1r ) << 16) | (dY+1) | DRAW_TRAP | LINE_DIS ); } static bool mach64FillTriangle( void *drv, void *dev, DFBTriangle *tri ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; dfb_sort_triangle( tri ); if (tri->y2 == tri->y3) { mach64_fill_trapezoid( mdrv, mdev, tri->x1, tri->x1, MIN( tri->x2, tri->x3), MAX( tri->x2, tri->x3 ), tri->y1, tri->y3 - tri->y1 ); } else if (tri->y1 == tri->y2) { mach64_fill_trapezoid( mdrv, mdev, MIN( tri->x1, tri->x2), MAX( tri->x1, tri->x2 ), tri->x3, tri->x3, tri->y1, tri->y3 - tri->y1 ); } else { int majDx = tri->x3 - tri->x1; int majDy = tri->y3 - tri->y1; int topDx = tri->x2 - tri->x1; int topDy = tri->y2 - tri->y1; int botDy = tri->y3 - tri->y2; int topXperY = (topDx << 20) / topDy; int X2a = tri->x1 + (((topXperY * topDy) + (1<<19)) >> 20); int majXperY = (majDx << 20) / majDy; int majX2 = tri->x1 + (((majXperY * topDy) + (1<<19)) >> 20); int majX2a = majX2 - ((majXperY + (1<<19)) >> 20); mach64_fill_trapezoid( mdrv, mdev, tri->x1, tri->x1, MIN( X2a, majX2a ), MAX( X2a, majX2a ), tri->y1, topDy - 1 ); mach64_fill_trapezoid( mdrv, mdev, MIN( tri->x2, majX2 ), MAX( tri->x2, majX2 ), tri->x3, tri->x3, tri->y2, botDy ); } return true; } static void mach64DoBlit2D( Mach64DriverData *mdrv, Mach64DeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect ) { volatile u8 *mmio = mdrv->mmio_base; u32 dst_cntl = 0; if (srect->x <= drect->x) { srect->x += srect->w - 1; drect->x += drect->w - 1; } else dst_cntl |= DST_X_DIR; if (srect->y <= drect->y) { srect->y += srect->h - 1; drect->y += drect->h - 1; } else dst_cntl |= DST_Y_DIR; mach64_waitfifo( mdrv, mdev, 5 ); mach64_out32( mmio, SRC_Y_X, (S13( srect->x ) << 16) | S14( srect->y ) ); mach64_out32( mmio, SRC_HEIGHT1_WIDTH1, (srect->w << 16) | srect->h ); mach64_out32( mmio, DST_CNTL, dst_cntl ); mach64_out32( mmio, DST_Y_X, (S13( drect->x ) << 16) | S14( drect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (drect->w << 16) | drect->h ); } static void mach64DoBlitScaleOld( Mach64DriverData *mdrv, Mach64DeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *source = mdev->source; u32 scale_3d_cntl = SCALE_3D_FCN_SCALE | mdev->blit_blend; int hacc, vacc; if (!filter) scale_3d_cntl |= SCALE_PIX_REP; if (mdev->blit_deinterlace) { srect->y /= 2; srect->h /= 2; } srect->x <<= 16; srect->y <<= 16; srect->w <<= 16; srect->h <<= 16; /* * SCALE_HACC and SCALE_VACC have limited scale so we need to change * SCALE_Y_OFF in order to handle the full range of source coordinates. */ hacc = srect->x & 0xFFFF0; /* s4.12 */ vacc = srect->y & 0xFFFF0; /* s4.12 */ srect->x &= ~0xFFFFF; srect->y &= ~0xFFFFF; mach64_waitfifo( mdrv, mdev, 14 ); mach64_out32( mmio, SCALE_3D_CNTL, scale_3d_cntl ); mach64_out32( mmio, SCALE_Y_OFF, mdev->scale_offset + (srect->y >> 16) * mdev->scale_pitch + (srect->x >> 16) * DFB_BYTES_PER_PIXEL( source->config.format ) ); mach64_out32( mmio, SCALE_WIDTH, (srect->w + hacc) >> 16 ); mach64_out32( mmio, SCALE_HEIGHT, (srect->h + vacc) >> 16 ); mach64_out32( mmio, SCALE_Y_PITCH, mdev->scale_pitch / DFB_BYTES_PER_PIXEL( source->config.format ) ); mach64_out32( mmio, SCALE_X_INC, srect->w / drect->w ); mach64_out32( mmio, SCALE_Y_INC, srect->h / drect->h ); if (mdev->blit_deinterlace && mdev->field) vacc += 0x8000; mach64_out32( mmio, SCALE_VACC, vacc ); mach64_out32( mmio, SCALE_HACC, hacc ); mach64_out32( mmio, SCALE_XUV_INC, (srect->w/2) / (drect->w/2) ); mach64_out32( mmio, SCALE_UV_HACC, hacc >> 1 ); mach64_out32( mmio, DST_CNTL, DST_X_DIR | DST_Y_DIR ); mach64_out32( mmio, DST_Y_X, (S13( drect->x ) << 16) | S14( drect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (drect->w << 16) | drect->h ); /* Some scaler and 3D color registers are shared. */ MACH64_INVALIDATE( m_color_3d | m_color_tex ); } static void mach64DoBlitScale( Mach64DriverData *mdrv, Mach64DeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; CoreSurface *source = mdev->source; u32 scale_3d_cntl = SCALE_3D_FCN_SCALE | mdev->blit_blend; int hacc, vacc; if (!filter) scale_3d_cntl |= SCALE_PIX_REP; if (mdev->blit_deinterlace) { srect->y /= 2; srect->h /= 2; } srect->x <<= 16; srect->y <<= 16; srect->w <<= 16; srect->h <<= 16; /* Hardware bug: Hitting SC_TOP results in incorrect rendering. */ if (drect->y < mdev->clip.y1) { int sy, dy; dy = mdev->clip.y1 - drect->y; sy = (u64) srect->h * dy / drect->h; srect->y += sy; srect->h -= sy; drect->y += dy; drect->h -= dy; } /* * SCALE_HACC and SCALE_VACC have limited scale so we need to change * SCALE_OFF in order to handle the full range of source coordinates. */ hacc = srect->x & 0xFFFFF0; /* s8.12 */ vacc = srect->y & 0xFFFF0; /* s4.12 */ srect->x &= ~0xFFFFFF; srect->y &= ~0xFFFFF; mach64_waitfifo( mdrv, mdev, 12 ); mach64_out32( mmio, SCALE_3D_CNTL, scale_3d_cntl ); mach64_out32( mmio, SCALE_OFF, mdev->scale_offset + (srect->y >> 16) * mdev->scale_pitch + (srect->x >> 16) * DFB_BYTES_PER_PIXEL( source->config.format ) ); mach64_out32( mmio, SCALE_WIDTH, (srect->w + hacc) >> 16 ); mach64_out32( mmio, SCALE_HEIGHT, (srect->h + vacc) >> 16 ); mach64_out32( mmio, SCALE_PITCH, mdev->scale_pitch / DFB_BYTES_PER_PIXEL( source->config.format ) ); mach64_out32( mmio, SCALE_X_INC, srect->w / drect->w ); mach64_out32( mmio, SCALE_Y_INC, srect->h / drect->h ); if (mdev->blit_deinterlace && mdev->field) vacc += 0x8000; mach64_out32( mmio, SCALE_VACC, vacc ); mach64_out32( mmio, SCALE_HACC, hacc ); mach64_out32( mmio, DST_CNTL, DST_X_DIR | DST_Y_DIR ); mach64_out32( mmio, DST_Y_X, (S13( drect->x ) << 16) | S14( drect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (drect->w << 16) | drect->h ); /* Some scaler and 3D color registers are shared. */ MACH64_INVALIDATE( m_color_3d | m_color_tex ); } static void mach64DoBlitTexOld( Mach64DriverData *mdrv, Mach64DeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; u32 scale_3d_cntl = SCALE_3D_FCN_TEXTURE | MIP_MAP_DISABLE | mdev->blit_blend; if (mdev->blit_deinterlace) { srect->y /= 2; srect->h /= 2; } srect->x <<= 1; srect->y <<= 1; srect->w <<= 1; srect->h <<= 1; /* Must add 0.5 to get correct rendering. */ srect->x += 0x1; srect->y += 0x1; if (filter) { /* Avoid using texels outside of texture. */ srect->w -= 0x2; srect->h -= 0x2; scale_3d_cntl |= BILINEAR_TEX_EN | TEX_BLEND_FCN_LINEAR_MIPMAP_NEAREST; } if (mdev->blit_deinterlace && mdev->field) srect->y += 0x1; mach64_waitfifo( mdrv, mdev, 14 ); mach64_out32( mmio, SCALE_3D_CNTL, scale_3d_cntl ); mach64_out32( mmio, TEX_0_OFF + (mdev->tex_size << 2), mdev->tex_offset ); mach64_out32( mmio, S_X_INC2, 0 ); mach64_out32( mmio, S_Y_INC2, 0 ); mach64_out32( mmio, S_XY_INC2, 0 ); mach64_out32( mmio, S_X_INC_START, (srect->w << (25 - mdev->tex_size)) / drect->w ); mach64_out32( mmio, S_Y_INC, 0 ); mach64_out32( mmio, S_START, (srect->x << (25 - mdev->tex_size)) ); mach64_out32( mmio, T_X_INC2, 0 ); mach64_out32( mmio, T_Y_INC2, 0 ); mach64_out32( mmio, T_XY_INC2, 0 ); mach64_out32( mmio, T_X_INC_START, 0 ); mach64_out32( mmio, T_Y_INC, (srect->h << (25 - mdev->tex_size)) / drect->h ); mach64_out32( mmio, T_START, (srect->y << (25 - mdev->tex_size)) ); mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, DST_CNTL, DST_X_DIR | DST_Y_DIR ); mach64_out32( mmio, DST_Y_X, (S13( drect->x ) << 16) | S14( drect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (drect->w << 16) | drect->h ); } static void mach64DoBlitTex( Mach64DriverData *mdrv, Mach64DeviceData *mdev, DFBRectangle *srect, DFBRectangle *drect, bool filter ) { volatile u8 *mmio = mdrv->mmio_base; u32 scale_3d_cntl = SCALE_3D_FCN_TEXTURE | MIP_MAP_DISABLE | mdev->blit_blend; if (mdev->blit_deinterlace) { srect->y /= 2; srect->h /= 2; } srect->x <<= 1; srect->y <<= 1; srect->w <<= 1; srect->h <<= 1; /* Must add 0.5 to get correct rendering. */ srect->x += 0x1; srect->y += 0x1; if (filter) { /* Avoid using texels outside of texture. */ srect->w -= 0x2; srect->h -= 0x2; scale_3d_cntl |= BILINEAR_TEX_EN | TEX_BLEND_FCN_LINEAR_MIPMAP_NEAREST; } if (mdev->blit_deinterlace && mdev->field) srect->y += 0x1; mach64_waitfifo( mdrv, mdev, 13 ); mach64_out32( mmio, SCALE_3D_CNTL, scale_3d_cntl ); mach64_out32( mmio, TEX_0_OFF + (mdev->tex_size << 2), mdev->tex_offset ); mach64_out32( mmio, STW_EXP, (1 << 16) | (0 << 8) | (0 << 0) ); /* This register doesn't seem to have any effect on the result. */ mach64_out32( mmio, LOG_MAX_INC, 0 ); mach64_out32( mmio, S_X_INC, (srect->w << (23 - mdev->tex_pitch)) / drect->w ); mach64_out32( mmio, S_Y_INC, 0 ); mach64_out32( mmio, S_START, (srect->x << (23 - mdev->tex_pitch)) ); mach64_out32( mmio, W_X_INC, 0 ); mach64_out32( mmio, W_Y_INC, 0 ); mach64_out32( mmio, W_START, 1 << 23 ); mach64_out32( mmio, T_X_INC, 0 ); mach64_out32( mmio, T_Y_INC, (srect->h << (23 - mdev->tex_height)) / drect->h ); mach64_out32( mmio, T_START, (srect->y << (23 - mdev->tex_height)) ); mach64_waitfifo( mdrv, mdev, 3 ); mach64_out32( mmio, DST_CNTL, DST_X_DIR | DST_Y_DIR ); mach64_out32( mmio, DST_Y_X, (S13( drect->x ) << 16) | S14( drect->y ) ); mach64_out32( mmio, DST_HEIGHT_WIDTH, (drect->w << 16) | drect->h ); } static bool mach64Blit2D( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; mach64DoBlit2D( mdrv, mdev, rect, &drect ); return true; } static bool mach64BlitScaleOld( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; mach64DoBlitScaleOld( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool mach64StretchBlitScaleOld( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64DoBlitScaleOld( mdrv, mdev, srect, drect, true ); return true; } static bool mach64BlitScale( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; mach64DoBlitScale( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool mach64StretchBlitScale( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64DoBlitScale( mdrv, mdev, srect, drect, true ); return true; } static bool mach64BlitTexOld( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; mach64DoBlitTexOld( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool mach64StretchBlitTexOld( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64DoBlitTexOld( mdrv, mdev, srect, drect, true ); return true; } static bool mach64BlitTex( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; DFBRectangle drect = { dx, dy, rect->w, rect->h }; mach64DoBlitTex( mdrv, mdev, rect, &drect, mdev->blit_deinterlace ); return true; } static bool mach64StretchBlitTex( void *drv, void *dev, DFBRectangle *srect, DFBRectangle *drect ) { Mach64DriverData *mdrv = (Mach64DriverData*) drv; Mach64DeviceData *mdev = (Mach64DeviceData*) dev; mach64DoBlitTex( mdrv, mdev, srect, drect, true ); return true; } /* */ #define MACH64_CFG_CHIP_TYPE( a, b ) (((a) << 8) | (b)) static Mach64ChipType mach64_chip_type_vt( Mach64DriverData *mdrv, GraphicsDeviceInfo *device_info ) { u32 config_chip_id = mach64_in32( mdrv->mmio_base, CONFIG_CHIP_ID ); u32 cfg_chip_type = config_chip_id & CFG_CHIP_TYPE; switch (cfg_chip_type) { case MACH64_CFG_CHIP_TYPE( 'V', 'T' ): switch ((config_chip_id & CFG_CHIP_MAJOR) >> 24) { case 0: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, (config_chip_id & CFG_CHIP_MINOR) ? "ATI-264VT2 (%c%c)" : "ATI-264VT (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_264VT; case 1: case 2: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "ATI-264VT3 (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_264VT3; } break; case MACH64_CFG_CHIP_TYPE( 'V', 'U' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "ATI-264VT3 (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_264VT3; case MACH64_CFG_CHIP_TYPE( 'V', 'V' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "ATI-264VT4 (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_264VT4; } D_WARN( "DirectFB/Mach64: Unknown VT chip type %c%c (0x%08x)", cfg_chip_type >> 8, cfg_chip_type & 0xFF, config_chip_id ); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Mach64 VT" ); return CHIP_UNKNOWN; } static Mach64ChipType mach64_chip_type_gt( Mach64DriverData *mdrv, GraphicsDeviceInfo *device_info ) { u32 config_chip_id = mach64_in32( mdrv->mmio_base, CONFIG_CHIP_ID ); u32 cfg_chip_type = config_chip_id & CFG_CHIP_TYPE; switch (cfg_chip_type) { case MACH64_CFG_CHIP_TYPE( 'G', 'T' ): switch ((config_chip_id & CFG_CHIP_MAJOR) >> 24) { case 0: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE; case 1: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage II (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_II; case 2: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage II+ (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_IIPLUS; } break; case MACH64_CFG_CHIP_TYPE( 'G', 'U' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage II+ (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_IIPLUS; case MACH64_CFG_CHIP_TYPE( 'L', 'G' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage LT (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_LT; case MACH64_CFG_CHIP_TYPE( 'G', 'V' ): case MACH64_CFG_CHIP_TYPE( 'G', 'W' ): case MACH64_CFG_CHIP_TYPE( 'G', 'Y' ): case MACH64_CFG_CHIP_TYPE( 'G', 'Z' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage IIC (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_IIC; case MACH64_CFG_CHIP_TYPE( 'G', 'B' ): case MACH64_CFG_CHIP_TYPE( 'G', 'D' ): case MACH64_CFG_CHIP_TYPE( 'G', 'I' ): case MACH64_CFG_CHIP_TYPE( 'G', 'P' ): case MACH64_CFG_CHIP_TYPE( 'G', 'Q' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage Pro (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_PRO; case MACH64_CFG_CHIP_TYPE( 'L', 'B' ): case MACH64_CFG_CHIP_TYPE( 'L', 'D' ): case MACH64_CFG_CHIP_TYPE( 'L', 'I' ): case MACH64_CFG_CHIP_TYPE( 'L', 'P' ): case MACH64_CFG_CHIP_TYPE( 'L', 'Q' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage LT Pro (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_LT_PRO; case MACH64_CFG_CHIP_TYPE( 'G', 'M' ): case MACH64_CFG_CHIP_TYPE( 'G', 'O' ): case MACH64_CFG_CHIP_TYPE( 'G', 'R' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage XL (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_XLXC; case MACH64_CFG_CHIP_TYPE( 'G', 'L' ): case MACH64_CFG_CHIP_TYPE( 'G', 'N' ): case MACH64_CFG_CHIP_TYPE( 'G', 'S' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage XC (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_XLXC; case MACH64_CFG_CHIP_TYPE( 'L', 'M' ): case MACH64_CFG_CHIP_TYPE( 'L', 'N' ): case MACH64_CFG_CHIP_TYPE( 'L', 'R' ): case MACH64_CFG_CHIP_TYPE( 'L', 'S' ): snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "3D Rage Mobility (%c%c)", cfg_chip_type >> 8, cfg_chip_type & 0xFF ); return CHIP_3D_RAGE_MOBILITY; } D_WARN( "DirectFB/Mach64: Unknown GT chip type %c%c (0x%08x)", cfg_chip_type >> 8, cfg_chip_type & 0xFF, config_chip_id ); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Mach64 GT" ); return CHIP_UNKNOWN; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_ATI_MACH64GX: case FB_ACCEL_ATI_MACH64CT: case FB_ACCEL_ATI_MACH64VT: case FB_ACCEL_ATI_MACH64GT: return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "ATI Mach64 Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "Ville Syrjala" ); info->version.major = 0; info->version.minor = 13; info->driver_data_size = sizeof (Mach64DriverData); info->device_data_size = sizeof (Mach64DeviceData); } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; mdrv->mmio_base = (volatile u8*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!mdrv->mmio_base) return DFB_IO; mdrv->device_data = (Mach64DeviceData*) device_data; mdrv->accelerator = dfb_gfxcard_get_accelerator( device ); funcs->EngineReset = mach64EngineReset; funcs->EngineSync = mach64EngineSync; funcs->CheckState = mach64CheckState; funcs->SetState = mach64SetState; funcs->FillRectangle = mach64FillRectangle; funcs->DrawRectangle = mach64DrawRectangle; /* Set dynamically: funcs->DrawLine, funcs->Blit, funcs->StretchBlit */ switch (mdrv->accelerator) { case FB_ACCEL_ATI_MACH64GT: if (!dfb_config->font_format) dfb_config->font_format = DSPF_ARGB; funcs->FlushTextureCache = mach64FlushTextureCache; funcs->CheckState = mach64GTCheckState; funcs->SetState = mach64GTSetState; funcs->FillTriangle = mach64FillTriangle; case FB_ACCEL_ATI_MACH64VT: mdrv->mmio_base += 0x400; dfb_layers_register( dfb_screens_at( DSCID_PRIMARY ), driver_data, &mach64OverlayFuncs ); break; } return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64DeviceData *mdev = (Mach64DeviceData*) device_data; volatile u8 *mmio = mdrv->mmio_base; /* fill device info */ device_info->caps.flags = CCF_CLIPPING; switch (mdrv->accelerator) { case FB_ACCEL_ATI_MACH64GT: device_info->caps.drawing = MACH64GT_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = MACH64GT_SUPPORTED_BLITTINGFLAGS; device_info->caps.accel = MACH64GT_SUPPORTED_DRAWINGFUNCTIONS | MACH64GT_SUPPORTED_BLITTINGFUNCTIONS; break; default: device_info->caps.drawing = MACH64_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = MACH64_SUPPORTED_BLITTINGFLAGS; device_info->caps.accel = MACH64_SUPPORTED_DRAWINGFUNCTIONS | MACH64_SUPPORTED_BLITTINGFUNCTIONS; break; } switch (mdrv->accelerator) { case FB_ACCEL_ATI_MACH64GX: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Mach64 GX" ); break; case FB_ACCEL_ATI_MACH64CT: snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Mach64 CT" ); break; case FB_ACCEL_ATI_MACH64VT: mdev->chip = mach64_chip_type_vt( mdrv, device_info ); break; case FB_ACCEL_ATI_MACH64GT: mdev->chip = mach64_chip_type_gt( mdrv, device_info ); /* Max texture size is 1024x1024 */ device_info->limits.surface_max_power_of_two_pixelpitch = 1024; device_info->limits.surface_max_power_of_two_height = 1024; break; } snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "ATI" ); device_info->limits.surface_byteoffset_alignment = 8; device_info->limits.surface_bytepitch_alignment = 16; device_info->limits.surface_pixelpitch_alignment = 8; /* 3D Rage Pro is the first chip that supports auto fast fill/block write. */ if (mdev->chip >= CHIP_3D_RAGE_PRO) { mdev->hw_debug = mach64_in32( mmio, HW_DEBUG ); /* Save original HW_DEBUG. */ mdev->hw_debug_orig = mdev->hw_debug; /* Enable auto fast fill and fast fill/block write scissoring. */ mdev->hw_debug &= ~(AUTO_FF_DIS | INTER_PRIM_DIS); if ((mach64_in32( mmio, CONFIG_STAT0 ) & CFG_MEM_TYPE) == CFG_MEM_TYPE_SGRAM) { /* Enable auto block write and auto color register updates. */ mdev->hw_debug &= ~(AUTO_BLKWRT_DIS | AUTO_BLKWRT_COLOR_DIS); device_info->limits.surface_byteoffset_alignment = 64; device_info->limits.surface_bytepitch_alignment = 64; } } return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; Mach64DeviceData *mdev = (Mach64DeviceData*) device_data; volatile u8 *mmio = mdrv->mmio_base; D_DEBUG( "DirectFB/Mach64: FIFO Performance Monitoring:\n" ); D_DEBUG( "DirectFB/Mach64: %9d mach64_waitfifo calls\n", mdev->waitfifo_calls ); D_DEBUG( "DirectFB/Mach64: %9d register writes (mach64_waitfifo sum)\n", mdev->waitfifo_sum ); D_DEBUG( "DirectFB/Mach64: %9d FIFO wait cycles (depends on CPU)\n", mdev->fifo_waitcycles ); D_DEBUG( "DirectFB/Mach64: %9d IDLE wait cycles (depends on CPU)\n", mdev->idle_waitcycles ); D_DEBUG( "DirectFB/Mach64: %9d FIFO space cache hits(depends on CPU)\n", mdev->fifo_cache_hits ); D_DEBUG( "DirectFB/Mach64: Conclusion:\n" ); D_DEBUG( "DirectFB/Mach64: Average register writes/mach64_waitfifo" "call:%.2f\n", mdev->waitfifo_sum/(float)(mdev->waitfifo_calls) ); D_DEBUG( "DirectFB/Mach64: Average wait cycles/mach64_waitfifo call:" " %.2f\n", mdev->fifo_waitcycles/(float)(mdev->waitfifo_calls) ); D_DEBUG( "DirectFB/Mach64: Average fifo space cache hits: %02d%%\n", (int)(100 * mdev->fifo_cache_hits/ (float)(mdev->waitfifo_calls)) ); switch (mdrv->accelerator) { case FB_ACCEL_ATI_MACH64GT: mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, SCALE_3D_CNTL, 0 ); case FB_ACCEL_ATI_MACH64VT: mach64_waitfifo( mdrv, mdev, 1 ); mach64_out32( mmio, OVERLAY_SCALE_CNTL, 0 ); break; } if (mdev->chip >= CHIP_3D_RAGE_PRO) { /* Restore original HW_DEBUG. */ mach64_out32( mmio, HW_DEBUG, mdev->hw_debug_orig ); } } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { Mach64DriverData *mdrv = (Mach64DriverData*) driver_data; switch (mdrv->accelerator) { case FB_ACCEL_ATI_MACH64VT: case FB_ACCEL_ATI_MACH64GT: mdrv->mmio_base -= 0x400; break; } dfb_gfxcard_unmap_mmio( device, mdrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/nvidia/0000777000175000017500000000000011307522570013661 500000000000000DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_state.h0000644000175000017500000000476711245562152016437 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NVIDIA_STATE_H__ #define __NVIDIA_STATE_H__ void nv_set_destination ( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_source ( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_clip ( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_drawing_color ( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_blitting_color( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_blend_function( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_drawingflags ( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); void nv_set_blittingflags ( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ); #endif /* __NVIDIA_STATE_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_3d.h0000644000175000017500000000240711164361026015607 00000000000000/* Copyright (C) 2004-2006 Claudio Ciccani This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NVIDIA_3D_H__ #define __NVIDIA_3D_H__ bool nvFillRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool nvFillTriangle3D( void *drv, void *dev, DFBTriangle *tri ); bool nvDrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ); bool nvDrawLine3D( void *drv, void *dev, DFBRegion *line ); bool nvTextureTriangles( void *drv, void *dev, DFBVertex *vertices, int num, DFBTriangleFormation formation ); #endif /* __NVIDIA_3D_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_objects.h0000644000175000017500000001344111245562152016735 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NVIDIA_OBJECTS_H__ #define __NVIDIA_OBJECTS_H__ #include "nvidia.h" #include "nvidia_accel.h" /* Engine */ #define ENGINE_SW 0 #define ENGINE_GRAPHICS 1 #define ENGINE_DVD 2 static __inline__ u32 nv_hashkey( u32 obj ) { return ((obj >> 0) & 0x000001FF) ^ ((obj >> 9) & 0x000001FF) ^ ((obj >> 18) & 0x000001FF) ^ ((obj >> 27) & 0x000001FF) ^ (0 << 5); /* channel 0 */ } /* DMA flags */ #define DMA_FLAG_PAGE_TABLE (1 << 12) /* valid */ #define DMA_FLAG_PAGE_ENTRY_NONLIN (0 << 13) #define DMA_FLAG_PAGE_ENTRY_LINEAR (1 << 13) #define DMA_FLAG_ACCESS_RDWR (0 << 14) #define DMA_FLAG_ACCESS_RDONLY (1 << 14) #define DMA_FLAG_ACCESS_WRONLY (2 << 14) #define DMA_FLAG_TARGET_NVM (0 << 16) #define DMA_FLAG_TARGET_NVM_TILED (1 << 16) #define DMA_FLAG_TARGET_PCI (2 << 16) #define DMA_FLAG_TARGET_AGP (3 << 16) /* DMA frame access */ #define DMA_FRAME_UNKNOWN_FLAG (1 << 0) #define DMA_FRAME_ACCESS_RDONLY (0 << 1) #define DMA_FRAME_ACCESS_RDWR (1 << 1) static inline void nv_store_dma( NVidiaDriverData *nvdrv, u32 obj, u32 addr, u32 class, u32 flags, u32 size, u32 frame, u32 access ) { volatile void *mmio = nvdrv->mmio_base; u32 key = nv_hashkey( obj ); u32 ctx = addr | (ENGINE_SW << 16) | (1 << 31); /* NV_PRAMIN_RAMRO_0 */ nv_out32( mmio, PRAMIN + (addr << 4) + 0, class | flags ); nv_out32( mmio, PRAMIN + (addr << 4) + 4, size - 1 ); nv_out32( mmio, PRAMIN + (addr << 4) + 8, (frame & 0xFFFFF000) | access ); nv_out32( mmio, PRAMIN + (addr << 4) + 12, (frame & 0xFFFFF000) | access ); /* store object id and context */ nv_out32( mmio, PRAMHT + (key << 3) + 0, obj ); nv_out32( mmio, PRAMHT + (key << 3) + 4, ctx ); } /* Context flags */ #define CTX_FLAG_CHROMA_KEY (1 << 12) #define CTX_FLAG_USER_CLIP (1 << 13) #define CTX_FLAG_SWIZZLE (1 << 14) #define CTX_FLAG_PATCH_COPY (0 << 15) #define CTX_FLAG_PATCH_ROP (1 << 15) #define CTX_FLAG_PATCH_BLEND (2 << 15) #define CTX_FLAG_PATCH_SRCCOPY (3 << 15) #define CTX_FLAG_PATCH_COLOR_MULTIPLY (4 << 15) #define CTX_FLAG_PATCH_BLEND_PREMULTIPLIED (5 << 15) #define CTX_FLAG_SYNCHRONIZE (1 << 18) #define CTX_FLAG_ENDIAN_LITTLE (0 << 19) #define CTX_FLAG_ENDIAN_BIG (1 << 19) #define CTX_FLAG_CONVERSION_COMPAT (0 << 20) #define CTX_FLAG_CONVERSION_DITHER (1 << 20) #define CTX_FLAG_CONVERSION_TRUNC (2 << 20) #define CTX_FLAG_CONVERSION_SUB_TRUNC (3 << 20) #define CTX_FLAG_SINGLE_STEP (1 << 23) #define CTX_FLAG_PATCH (1 << 24) /* valid */ #define CTX_FLAG_CTX_SURFACE0 (1 << 25) /* valid */ #define CTX_FLAG_CTX_SURFACE1 (1 << 26) /* valid */ #define CTX_FLAG_CTX_PATTERN (1 << 27) /* valid */ #define CTX_FLAG_CTX_ROP (1 << 28) /* valid */ #define CTX_FLAG_CTX_BETA1 (1 << 29) /* valid */ #define CTX_FLAG_CTX_BETA4 (1 << 30) /* valid */ static inline void nv_store_object( NVidiaDriverData *nvdrv, u32 obj, u32 addr, u32 class, u32 flags, u32 dma0, u32 dma1 ) { volatile void *mmio = nvdrv->mmio_base; u32 key = nv_hashkey( obj ); u32 ctx = addr | (ENGINE_GRAPHICS << 16) | (1 << 31); /* set the endian flag here, for simplicity */ #ifdef WORDS_BIGENDIAN flags |= CTX_FLAG_ENDIAN_BIG; #endif /* NV_PRAMIN_CTX_0 */ nv_out32( mmio, PRAMIN + (addr << 4) + 0, class | flags ); /* NV_PRAMIN_CTX_1 */ nv_out32( mmio, PRAMIN + (addr << 4) + 4, 0x00000000 ); /* color */ /* NV_PRAMIN_CTX_2 */ nv_out32( mmio, PRAMIN + (addr << 4) + 8, dma0 | (dma1 << 16) ); /* NV_PRAMIN_CTX_3 */ nv_out32( mmio, PRAMIN + (addr << 4) + 12, 0x00000000 ); /* traps */ /* store object id and context */ nv_out32( mmio, PRAMHT + (key << 3) + 0, obj ); nv_out32( mmio, PRAMHT + (key << 3) + 4, ctx ); } static inline void nv_assign_object( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, int subc, u32 object, bool reset ) { if (reset || nvdev->subchannel_object[subc] != object) { nv_begin( subc, SET_OBJECT, 1 ); nv_outr( object ); nvdev->subchannel_object[subc] = object; } } #endif /* __NVIDIA_OBJECTS_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/Makefile.am0000644000175000017500000000163011245562152015632 00000000000000## Makefile.am for DirectFB/src/core/gfxcards/nvidia INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems nvidia_LTLIBRARIES = libdirectfb_nvidia.la if BUILD_STATIC nvidia_DATA = $(nvidia_LTLIBRARIES:.la=.o) endif nvidiadir = $(MODULEDIR)/gfxdrivers libdirectfb_nvidia_la_SOURCES = \ nvidia.c \ nvidia_state.c \ nvidia_2d.c \ nvidia_3d.c \ nvidia_primary.c \ nvidia_overlay.c \ nvidia.h \ nvidia_regs.h \ nvidia_accel.h \ nvidia_objects.h \ nvidia_state.h \ nvidia_2d.h \ nvidia_3d.h libdirectfb_nvidia_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_nvidia_la_LIBADD = -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/gfxdrivers/nvidia/Makefile.in0000644000175000017500000004632411307521500015643 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = gfxdrivers/nvidia ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(nvidiadir)" "$(DESTDIR)$(nvidiadir)" nvidiaLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(nvidia_LTLIBRARIES) libdirectfb_nvidia_la_DEPENDENCIES = \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la am_libdirectfb_nvidia_la_OBJECTS = nvidia.lo nvidia_state.lo \ nvidia_2d.lo nvidia_3d.lo nvidia_primary.lo nvidia_overlay.lo libdirectfb_nvidia_la_OBJECTS = $(am_libdirectfb_nvidia_la_OBJECTS) libdirectfb_nvidia_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libdirectfb_nvidia_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_nvidia_la_SOURCES) DIST_SOURCES = $(libdirectfb_nvidia_la_SOURCES) nvidiaDATA_INSTALL = $(INSTALL_DATA) DATA = $(nvidia_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/systems nvidia_LTLIBRARIES = libdirectfb_nvidia.la @BUILD_STATIC_TRUE@nvidia_DATA = $(nvidia_LTLIBRARIES:.la=.o) nvidiadir = $(MODULEDIR)/gfxdrivers libdirectfb_nvidia_la_SOURCES = \ nvidia.c \ nvidia_state.c \ nvidia_2d.c \ nvidia_3d.c \ nvidia_primary.c \ nvidia_overlay.c \ nvidia.h \ nvidia_regs.h \ nvidia_accel.h \ nvidia_objects.h \ nvidia_state.h \ nvidia_2d.h \ nvidia_3d.h libdirectfb_nvidia_la_LDFLAGS = \ -export-dynamic \ -avoid-version \ $(DFB_LDFLAGS) libdirectfb_nvidia_la_LIBADD = -lm \ $(top_builddir)/lib/direct/libdirect.la \ $(top_builddir)/lib/fusion/libfusion.la \ $(top_builddir)/src/libdirectfb.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/nvidia/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gfxdrivers/nvidia/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-nvidiaLTLIBRARIES: $(nvidia_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(nvidiadir)" || $(MKDIR_P) "$(DESTDIR)$(nvidiadir)" @list='$(nvidia_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(nvidiaLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nvidiadir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(nvidiaLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nvidiadir)/$$f"; \ else :; fi; \ done uninstall-nvidiaLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(nvidia_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(nvidiadir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(nvidiadir)/$$p"; \ done clean-nvidiaLTLIBRARIES: -test -z "$(nvidia_LTLIBRARIES)" || rm -f $(nvidia_LTLIBRARIES) @list='$(nvidia_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_nvidia.la: $(libdirectfb_nvidia_la_OBJECTS) $(libdirectfb_nvidia_la_DEPENDENCIES) $(libdirectfb_nvidia_la_LINK) -rpath $(nvidiadir) $(libdirectfb_nvidia_la_OBJECTS) $(libdirectfb_nvidia_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia_2d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia_3d.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia_overlay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia_primary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nvidia_state.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nvidiaDATA: $(nvidia_DATA) @$(NORMAL_INSTALL) test -z "$(nvidiadir)" || $(MKDIR_P) "$(DESTDIR)$(nvidiadir)" @list='$(nvidia_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(nvidiaDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(nvidiadir)/$$f'"; \ $(nvidiaDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(nvidiadir)/$$f"; \ done uninstall-nvidiaDATA: @$(NORMAL_UNINSTALL) @list='$(nvidia_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(nvidiadir)/$$f'"; \ rm -f "$(DESTDIR)$(nvidiadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(nvidiadir)" "$(DESTDIR)$(nvidiadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-nvidiaLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-nvidiaDATA install-nvidiaLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nvidiaDATA uninstall-nvidiaLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-nvidiaLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-nvidiaDATA install-nvidiaLTLIBRARIES install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-nvidiaDATA \ uninstall-nvidiaLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/gfxdrivers/nvidia/nvidia.h0000644000175000017500000001633511245562152015231 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NVIDIA_H__ #define __NVIDIA_H__ #include #include #include #include /* * Object's identifier */ enum { OBJ_DMA_IN = 0x00800000, OBJ_SURFACES2D = 0x00800001, OBJ_SURFACES3D = 0x00800002, OBJ_CLIP = 0x00800003, OBJ_BETA1 = 0x00800004, OBJ_BETA4 = 0x00800005, OBJ_RECTANGLE = 0x00800010, OBJ_TRIANGLE = 0x00800011, OBJ_LINE = 0x00800012, OBJ_SCREENBLT = 0x00800013, OBJ_IMAGEBLT = 0x00800014, OBJ_SCALEDIMAGE = 0x00800015, OBJ_STRETCHEDIMAGE = 0x00800016, OBJ_TEXTRIANGLE = 0x00800017, OBJ_DMA_OUT = 0x00800018 }; /* * Object's offset into context table [PRAMIN + (address)*16] */ enum { ADDR_DMA_IN = 0x1160, ADDR_SURFACES2D = 0x1162, ADDR_SURFACES3D = 0x1163, ADDR_CLIP = 0x1164, ADDR_BETA1 = 0x1165, ADDR_BETA4 = 0x1166, ADDR_RECTANGLE = 0x1167, ADDR_TRIANGLE = 0x1168, ADDR_LINE = 0x1169, ADDR_SCREENBLT = 0x116A, ADDR_IMAGEBLT = 0x116B, ADDR_SCALEDIMAGE = 0x116C, ADDR_STRETCHEDIMAGE = 0x116D, ADDR_TEXTRIANGLE = 0x116E, ADDR_DMA_OUT = 0x116F }; /* * Object's subchannel */ enum { SUBC_SURFACES2D = 0, SUBC_SURFACES3D = 0, SUBC_BETA1 = 0, SUBC_BETA4 = 0, SUBC_CLIP = 1, SUBC_RECTANGLE = 2, SUBC_TRIANGLE = 3, SUBC_LINE = 4, SUBC_SCREENBLT = 5, SUBC_IMAGEBLT = 5, SUBC_SCALEDIMAGE = 6, SUBC_STRETCHEDIMAGE = 6, SUBC_TEXTRIANGLE = 7 }; #define SMF_DRAWING_COLOR (SMF_COLOR << 16) #define SMF_BLITTING_COLOR (SMF_COLOR << 17) #define SMF_SOURCE_TEXTURE (SMF_SOURCE << 1) typedef struct { StateModificationFlags set; u32 fb_offset; u32 fb_size; u32 agp_offset; DFBSurfacePixelFormat dst_format; u32 dst_offset; u32 dst_pitch; bool dst_422; DFBSurfacePixelFormat src_format; u32 src_offset; u8 *src_address; u32 src_pitch; u32 src_width; u32 src_height; bool src_system; bool src_interlaced; CoreSurfaceBufferLock *src_lock; DFBRectangle clip; u32 color2d; u32 color3d; DFBSurfaceDrawingFlags drawingflags; DFBSurfaceBlittingFlags blittingflags; const s32 *matrix; /* NVRectangle/NVTriangle/NVLine registers */ u32 drawing_operation; // SetOperation /* NVScaledImage registers */ u32 scaler_operation; // SetOperation u32 scaler_format; // SetColorFormat u32 scaler_filter; // SetImageInFormat /* NVImageBlt/NVStretchedImage registers */ u32 system_operation; // SetOperation u32 system_format; // SetColorFormat /* Remember value of NVBeta1 & NVBeta4 */ bool beta1_set; u32 beta1_val; bool beta4_set; u32 beta4_val; /* 3D stuff */ bool enabled_3d; // 3d engine enabled u32 buf_offset[2]; // reserved buffers CoreSurfaceBuffer *src_texture; // current source for TextureTriangles u32 max_texture_size; struct { bool modified; u32 colorkey; u32 offset; u32 format; u32 filter; u32 blend; u32 control; u32 fog; } state3d[2]; // 0 => drawing | 1 => blitting /* Remember subchannels configuration */ u32 subchannel_object[8]; /* Chipsets informations */ u32 chip; u32 arch; /* AGP control */ bool use_agp; int agp_key; unsigned int agp_aper_base; unsigned int agp_aper_size; /* DMA control */ bool use_dma; unsigned int dma_size; unsigned int dma_offset; unsigned int dma_max; unsigned int dma_cur; unsigned int dma_free; unsigned int dma_put; unsigned int dma_get; volatile u32 *cmd_ptr; /* FIFO control */ unsigned int fifo_free; /* for performance monitoring */ unsigned int waitfree_sum; unsigned int waitfree_calls; unsigned int free_waitcycles; unsigned int idle_waitcycles; unsigned int cache_hits; } NVidiaDeviceData; enum { NV_ARCH_04 = 0x04, NV_ARCH_05 = 0x05, NV_ARCH_10 = 0x10, NV_ARCH_20 = 0x20, NV_ARCH_30 = 0x30 }; typedef struct { CoreGraphicsDevice *device; NVidiaDeviceData *device_data; volatile void *fb_base; volatile void *agp_base; volatile void *mmio_base; volatile void *dma_base; } NVidiaDriverData; extern ScreenFuncs nvidiaPrimaryScreenFuncs; extern ScreenFuncs OldPrimaryScreenFuncs; extern void *OldPrimaryScreenDriverData; extern DisplayLayerFuncs nvidiaPrimaryLayerFuncs; extern DisplayLayerFuncs OldPrimaryLayerFuncs; extern void *OldPrimaryLayerDriverData; extern DisplayLayerFuncs nvidiaOverlayFuncs; #endif /* __NVIDIA_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_3d.c0000644000175000017500000004256411164361026015612 00000000000000/* Copyright (C) 2004-2006 Claudio Ciccani This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "nvidia.h" #include "nvidia_regs.h" #include "nvidia_accel.h" #include "nvidia_3d.h" static __inline__ u32 f2d( float f ) { union { float f; u32 d; } t; t.f = f; return t.d; } #define nv_setstate3d( state3d ) { \ if ((state3d)->modified) { \ nv_begin( SUBC_TEXTRIANGLE, TXTRI_COLOR_KEY, 7 ); \ nv_outr( (state3d)->colorkey ); \ nv_outr( (state3d)->offset ); \ nv_outr( (state3d)->format ); \ nv_outr( (state3d)->filter ); \ nv_outr( (state3d)->blend ); \ nv_outr( (state3d)->control ); \ nv_outr( (state3d)->fog ); \ \ (state3d)->modified = false; \ } \ } #define nv_putvertex( i, x, y, z, w, col, spc, s, t ) { \ nv_begin( SUBC_TEXTRIANGLE, TXTRI_VERTEX0+(i)*32, 8 ); \ nv_outr( f2d( x ) ); \ nv_outr( f2d( y ) ); \ nv_outr( f2d( z ) ); \ nv_outr( f2d( w ) ); \ nv_outr( col ); \ nv_outr( spc ); \ nv_outr( f2d( s ) ); \ nv_outr( f2d( t ) ); \ } #define nv_emit_vertices( i, v0, v1, v2, v3, v4, v5, v6, v7 ) { \ nv_begin( SUBC_TEXTRIANGLE, TXTRI_PRIMITIVE0+(i)*4, 1 ); \ nv_outr( ((v7) << 28) | ((v6) << 24) | \ ((v5) << 20) | ((v4) << 16) | \ ((v3) << 12) | ((v2) << 8) | \ ((v1) << 4) | (v0) ); \ } static void nv_load_texture( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev ); #define M_TRANSFORM(x, y, retx, rety, m) { \ float _x, _y; \ _x = ((x) * (m)[0] + (y) * (m)[1] + (m)[2]) / 65536.f; \ _y = ((x) * (m)[3] + (y) * (m)[4] + (m)[5]) / 65536.f; \ retx = _x; \ rety = _y; \ } bool nvFillRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; float x1, y1; float x2, y2; x1 = rect->x; x2 = rect->x+rect->w; y1 = rect->y; y2 = rect->y+rect->h; nv_setstate3d( &nvdev->state3d[0] ); if (nvdev->matrix) { float x, y; M_TRANSFORM( x1, y1, x, y, nvdev->matrix ); nv_putvertex( 0, x, y, 0, 1, nvdev->color3d, 0, 0, 0 ); M_TRANSFORM( x2, y1, x, y, nvdev->matrix ); nv_putvertex( 1, x, y, 0, 1, nvdev->color3d, 0, 0, 0 ); M_TRANSFORM( x2, y2, x, y, nvdev->matrix ); nv_putvertex( 2, x, y, 0, 1, nvdev->color3d, 0, 0, 0 ); M_TRANSFORM( x1, y2, x, y, nvdev->matrix ); nv_putvertex( 3, x, y, 0, 1, nvdev->color3d, 0, 0, 0 ); } else { nv_putvertex( 0, x1, y1, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 1, x2, y1, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 2, x2, y2, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 3, x1, y2, 0, 1, nvdev->color3d, 0, 0, 0 ); } nv_emit_vertices( 0, 0, 1, 2, 0, 2, 3, 0, 0 ); return true; } bool nvFillTriangle3D( void *drv, void *dev, DFBTriangle *tri ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; float x1, y1; float x2, y2; float x3, y3; x1 = tri->x1; x2 = tri->x2; x3 = tri->x3; y1 = tri->y1; y2 = tri->y2; y3 = tri->y3; if (nvdev->matrix) { M_TRANSFORM( x1, y1, x1, y1, nvdev->matrix ); M_TRANSFORM( x2, y2, x2, y2, nvdev->matrix ); M_TRANSFORM( x3, y3, x3, y3, nvdev->matrix ); } nv_setstate3d( &nvdev->state3d[0] ); nv_putvertex( 0, x1, y1, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 1, x2, y2, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 2, x3, y3, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_emit_vertices( 0, 0, 1, 2, 0, 0, 0, 0, 0 ); return true; } bool nvDrawRectangle3D( void *drv, void *dev, DFBRectangle *rect ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; DFBRegion r[4]; int i; if (nvdev->matrix) { DFBRegion line; /* top */ line = (DFBRegion) { rect->x, rect->y, rect->x+rect->w, rect->y }; nvDrawLine3D( drv, dev, &line ); /* right */ line = (DFBRegion) { rect->x+rect->w, rect->y, rect->x+rect->w, rect->y+rect->h }; nvDrawLine3D( drv, dev, &line ); /* bottom */ line = (DFBRegion) { rect->x, rect->y+rect->h, rect->x+rect->w, rect->y+rect->h }; nvDrawLine3D( drv, dev, &line ); /* left */ line = (DFBRegion) { rect->x, rect->y, rect->x, rect->y+rect->h }; nvDrawLine3D( drv, dev, &line ); return true; } /* top */ r[0].x1 = rect->x; r[0].y1 = rect->y; r[0].x2 = rect->x + rect->w; r[0].y2 = rect->y + 1; /* right */ r[1].x1 = rect->x + rect->w - 1; r[1].y1 = rect->y + 1; r[1].x2 = rect->x + rect->w; r[1].y2 = rect->y + rect->h - 1; /* bottom */ r[2].x1 = rect->x; r[2].y1 = rect->y + rect->h - 1; r[2].x2 = rect->x + rect->w; r[2].y2 = rect->y + rect->h; /* left */ r[3].x1 = rect->x; r[3].y1 = rect->y + 1; r[3].x2 = rect->x + 1; r[3].y2 = rect->y + rect->h - 1; nv_setstate3d( &nvdev->state3d[0] ); for (i = 0; i < 4; i++) { nv_putvertex( 0, r[i].x1, r[i].y1, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 1, r[i].x2, r[i].y1, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 2, r[i].x2, r[i].y2, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 3, r[i].x1, r[i].y2, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_emit_vertices( 0, 0, 1, 2, 0, 2, 3, 0, 0 ); } return true; } bool nvDrawLine3D( void *drv, void *dev, DFBRegion *line ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; float xinc, yinc; float x1, y1; float x2, y2; float dx, dy; x1 = line->x1; x2 = line->x2; y1 = line->y1; y2 = line->y2; if (nvdev->matrix) { M_TRANSFORM( x1, y1, x1, y1, nvdev->matrix ); M_TRANSFORM( x2, y2, x2, y2, nvdev->matrix ); dx = fabs(x2 - x1); dy = fabs(y2 - y1); } else { dx = abs(line->x2 - line->x1); dy = abs(line->y2 - line->y1); } if (dx > dy) { /* more horizontal */ xinc = 0.0; yinc = 0.5; } else { /* more vertical */ xinc = 0.5; yinc = 0.0; } nv_setstate3d( &nvdev->state3d[0] ); nv_putvertex( 0, x1 - xinc, y1 - yinc, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 1, x1 + xinc, y1 + yinc, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 2, x2 + xinc, y2 + yinc, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_putvertex( 3, x2 - xinc, y2 - yinc, 0, 1, nvdev->color3d, 0, 0, 0 ); nv_emit_vertices( 0, 2, 0, 1, 3, 0, 2, 0, 0 ); return true; } bool nvTextureTriangles( void *drv, void *dev, DFBVertex *ve, int num, DFBTriangleFormation formation ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; float s_scale; float t_scale; int i; /* load source texture into texture buffer */ nv_load_texture( nvdrv, nvdev ); s_scale = (float)nvdev->src_width / (float)(1 << ((nvdev->state3d[1].format >> 16) & 0xF)); t_scale = (float)nvdev->src_height / (float)(1 << ((nvdev->state3d[1].format >> 20) & 0xF)); for (i = 0; i < num; i++) { if (nvdev->matrix) M_TRANSFORM( ve[i].x, ve[i].y, ve[i].x, ve[i].y, nvdev->matrix ); ve[i].x += 0.5; ve[i].y += 0.5; ve[i].s *= s_scale; ve[i].t *= t_scale; } nv_setstate3d( &nvdev->state3d[1] ); switch (formation) { case DTTF_LIST: for (i = 0; i < num; i += 3) { nv_putvertex( 0, ve[i].x, ve[i].y, ve[i].z, ve[i].w, nvdev->color3d, 0, ve[i].s, ve[i].t ); nv_putvertex( 1, ve[i+1].x, ve[i+1].y, ve[i+1].z, ve[i+1].w, nvdev->color3d, 0, ve[i+1].s, ve[i+1].t ); nv_putvertex( 2, ve[i+2].x, ve[i+2].y, ve[i+2].z, ve[i+2].w, nvdev->color3d, 0, ve[i+2].s, ve[i+2].t ); nv_emit_vertices( 0, 0, 1, 2, 0, 0, 0, 0, 0 ); } break; case DTTF_STRIP: nv_putvertex( 0, ve[0].x, ve[0].y, ve[0].z, ve[0].w, nvdev->color3d, 0, ve[0].s, ve[0].t ); nv_putvertex( 1, ve[1].x, ve[1].y, ve[1].z, ve[1].w, nvdev->color3d, 0, ve[1].s, ve[1].t ); nv_putvertex( 2, ve[2].x, ve[2].y, ve[2].z, ve[2].w, nvdev->color3d, 0, ve[2].s, ve[2].t ); nv_emit_vertices( 0, 0, 1, 2, 0, 0, 0, 0, 0 ); for (i = 3; i < num; i++) { nv_putvertex( 0, ve[i-2].x, ve[i-2].y, ve[i-2].z, ve[i-2].w, nvdev->color3d, 0, ve[i-2].s, ve[i-2].t ); nv_putvertex( 1, ve[i-1].x, ve[i-1].y, ve[i-1].z, ve[i-1].w, nvdev->color3d, 0, ve[i-1].s, ve[i-1].t ); nv_putvertex( 2, ve[i].x, ve[i].y, ve[i].z, ve[i].w, nvdev->color3d, 0, ve[i].s, ve[i].t ); nv_emit_vertices( 0, 0, 1, 2, 0, 0, 0, 0, 0 ); } break; case DTTF_FAN: nv_putvertex( 0, ve[0].x, ve[0].y, ve[0].z, ve[0].w, nvdev->color3d, 0, ve[0].s, ve[0].t ); nv_putvertex( 1, ve[1].x, ve[1].y, ve[1].z, ve[1].w, nvdev->color3d, 0, ve[1].s, ve[1].t ); nv_putvertex( 2, ve[2].x, ve[2].y, ve[2].z, ve[2].w, nvdev->color3d, 0, ve[2].s, ve[2].t ); nv_emit_vertices( 0, 0, 1, 2, 0, 0, 0, 0, 0 ); for (i = 3; i < num; i++) { nv_putvertex( 0, ve[0].x, ve[0].y, ve[0].z, ve[0].w, nvdev->color3d, 0, ve[0].s, ve[0].t ); nv_putvertex( 1, ve[i-1].x, ve[i-1].y, ve[i-1].z, ve[i-1].w, nvdev->color3d, 0, ve[i-1].s, ve[i-1].t ); nv_putvertex( 2, ve[i].x, ve[i].y, ve[i].z, ve[i].w, nvdev->color3d, 0, ve[i].s, ve[i].t ); nv_emit_vertices( 0, 0, 1, 2, 0, 0, 0, 0, 0 ); } break; default: D_BUG( "unexpected triangle formation" ); return false; } return true; } /* * Surface to Texture conversion routines. */ #define VINC 0xAAAAAAAC #define VMASK 0x55555555 #define UINC 0x55555558 #define UMASK 0xAAAAAAAA static inline void a8_to_tex( u32 *dst, u8 *src, int pitch, int width, int height ) { u32 u, v; int i; for (v = 0; height--; v = (v + VINC) & VMASK) { for (i = 0, u = 0; i < width; i += 2, u = (u + UINC) & UMASK) { #ifdef WORDS_BIGENDIAN dst[(u|v)/4] = ((src[i+0] & 0xF0) << 24) | ((src[i+1] & 0xF0) << 8) | 0x0FFF0FFF; #else dst[(u|v)/4] = ((src[i+0] & 0xF0) << 8) | ((src[i+1] & 0xF0) << 24) | 0x0FFF0FFF; #endif } if (width & 1) { u = (u + UINC) & UMASK; dst[(u|v)/4] = ((src[width-1] & 0xF0) << 8) | 0x0FFF; } src += pitch; } } static inline void rgb16_to_tex( u32 *dst, u8 *src, int pitch, int width, int height ) { u32 u, v; int i; for (v = 0; height--; v = (v + VINC) & VMASK) { for (i = 0, u = 0; i < width/2; i++, u = (u + UINC) & UMASK) dst[(u|v)/4] = ((u32*) src)[i]; if (width & 1) { u = (u + UINC) & UMASK; dst[(u|v)/4] = ((u16*) src)[width-1]; } src += pitch; } } static inline void rgb32_to_tex( u32 *dst, u8 *src, int pitch, int width, int height ) { u32 u, v; int i; for (v = 0; height--; v = (v + VINC) & VMASK) { for (i = 0, u = 0; i < width; i += 2, u = (u + UINC) & UMASK) { register u32 pix0, pix1; pix0 = ((u32*) src)[i]; pix0 = RGB32_TO_RGB16( pix0 ); pix1 = ((u32*) src)[i+1]; pix1 = RGB32_TO_RGB16( pix1 ); #ifdef WORDS_BIGENDIAN dst[(u|v)/4] = (pix0 << 16) | pix1; #else dst[(u|v)/4] = pix0 | (pix1 << 16); #endif } if (width & 1) { u = (u + UINC) & UMASK; dst[(u|v)/4] = RGB32_TO_RGB16( ((u32*) src)[width-1] ); } src += pitch; } } static inline void argb_to_tex( u32 *dst, u8 *src, int pitch, int width, int height ) { u32 u, v; int i; for (v = 0; height--; v = (v + VINC) & VMASK) { for (i = 0, u = 0; i < width; i += 2, u = (u + UINC) & UMASK) { register u32 pix0, pix1; pix0 = ((u32*) src)[i]; pix0 = ARGB_TO_ARGB4444( pix0 ); pix1 = ((u32*) src)[i+1]; pix1 = ARGB_TO_ARGB4444( pix1 ); #ifdef WORDS_BIGENDIAN dst[(u|v)/4] = (pix0 << 16) | pix1; #else dst[(u|v)/4] = pix0 | (pix1 << 16); #endif } if (width & 1) { u = (u + UINC) & UMASK; dst[(u|v)/4] = ARGB_TO_ARGB4444( ((u32*) src)[width-1] ); } src += pitch; } } static void nv_load_texture( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev ) { CoreSurfaceBuffer *buffer = nvdev->src_texture; u32 *dst; dst = dfb_gfxcard_memory_virtual( nvdrv->device, nvdev->buf_offset[1] ); #if 0 if (nvdev->src_interlaced) { if (surface->caps & DSCAPS_SEPARATED) { if (surface->field) field_offset = nvdev->src_height * src_pitch; } else { if (surface->field) field_offset = src_pitch; src_pitch *= 2; } } #endif switch (buffer->format) { case DSPF_A8: a8_to_tex( dst, nvdev->src_lock->addr, nvdev->src_lock->pitch, nvdev->src_width, nvdev->src_height ); break; case DSPF_ARGB1555: case DSPF_RGB16: rgb16_to_tex( dst, nvdev->src_lock->addr, nvdev->src_lock->pitch, nvdev->src_width, nvdev->src_height ); break; case DSPF_RGB32: rgb32_to_tex( dst, nvdev->src_lock->addr, nvdev->src_lock->pitch, nvdev->src_width, nvdev->src_height ); break; case DSPF_ARGB: argb_to_tex( dst, nvdev->src_lock->addr, nvdev->src_lock->pitch, nvdev->src_width, nvdev->src_height ); break; default: D_BUG( "unexpected pixelformat" ); break; } } DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_primary.c0000644000175000017500000001301211164361026016751 00000000000000/* Copyright (C) 2005-2006 Claudio Ciccani This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "nvidia.h" #include "nvidia_regs.h" #include "nvidia_accel.h" /************************** Primary Screen functions **************************/ static DFBResult crtc1InitScreen( CoreScreen *screen, CoreGraphicsDevice *device, void *driver_data, void *screen_data, DFBScreenDescription *description ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; volatile u8 *mmio = nvdrv->mmio_base; if (OldPrimaryScreenFuncs.InitScreen) OldPrimaryScreenFuncs.InitScreen( screen, device, OldPrimaryScreenDriverData, screen_data, description ); description->caps |= DSCCAPS_VSYNC; snprintf( description->name, DFB_SCREEN_DESC_NAME_LENGTH, "NVidia Primary Screen" ); nv_out32( mmio, PCRTC_INTR_EN, PCRTC_INTR_EN_VBLANK_DISABLED ); #ifdef WORDS_BIGENDIAN nv_out32( mmio, PCRTC_CONFIG, PCRTC_CONFIG_SIGNAL_HSYNC | PCRTC_CONFIG_ENDIAN_BIG ); #else nv_out32( mmio, PCRTC_CONFIG, PCRTC_CONFIG_SIGNAL_HSYNC | PCRTC_CONFIG_ENDIAN_LITTLE ); #endif nv_out32( mmio, PCRTC_INTR, PCRTC_INTR_VBLANK_RESET ); return DFB_OK; } static DFBResult crtc1WaitVSync( CoreScreen *screen, void *driver_data, void *screen_data ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; volatile u8 *mmio = nvdrv->mmio_base; if (!dfb_config->pollvsync_none) { int i; for (i = 0; i < 2000000; i++) { if (!(nv_in8( mmio, PCIO_CRTC_STATUS ) & 8)) break; } for (i = 0; i < 2000000;) { if (nv_in8( mmio, PCIO_CRTC_STATUS ) & 8) break; i++; if ((i % 2000) == 0) { struct timespec ts = { 0, 10000 }; nanosleep( &ts, NULL ); } } } return DFB_OK; } #if 0 static DFBResult crtc1GetScreenSize( CoreScreen *screen, void *driver_data, void *screen_data, int *ret_width, int *ret_height ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; volatile u8 *mmio = nvdrv->mmio_base; int w, h; int val; /* stolen from RivaTV */ w = nv_incrtc( mmio, CRTC_HORIZ_DISPLAY_END ); w |= (nv_incrtc( mmio, CRTC_HORIZ_EXTRA ) & 0x02) << 7; w = (w + 1) << 3; h = nv_incrtc( mmio, CRTC_VERT_DISPLAY_END ); val = nv_incrtc( mmio, CRTC_OVERFLOW ); h |= (val & 0x02) << 7; h |= (val & 0x40) << 3; h++; h |= nv_incrtc( mmio, CRTC_EXTRA ) << 9; h |= nv_incrtc( mmio, 0x41 ) << 9; h >>= (nv_incrtc( mmio, CRTC_MAX_SCAN_LINE ) & 0x80) >> 7; D_DEBUG( "DirectFB/NVidia/Crtc1: " "detected screen resolution %dx%d.\n", w, h ); *ret_width = w; *ret_height = h; return DFB_OK; } #endif ScreenFuncs nvidiaPrimaryScreenFuncs = { .InitScreen = crtc1InitScreen, .WaitVSync = crtc1WaitVSync, //.GetScreenSize = crtc1GetScreenSize }; ScreenFuncs OldPrimaryScreenFuncs; void *OldPrimaryScreenDriverData; /*************************** Primary Layer hooks ******************************/ static DFBResult fb0FlipRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaDeviceData *nvdev = nvdrv->device_data; u32 offset; dfb_surface_flip( surface, false ); offset = (lock->offset + nvdev->fb_offset) & ~3; nv_out32( nvdrv->mmio_base, PCRTC_START, offset ); if (flags & DSFLIP_WAIT) dfb_layer_wait_vsync( layer ); return DFB_OK; } DisplayLayerFuncs nvidiaPrimaryLayerFuncs = { .FlipRegion = fb0FlipRegion }; DisplayLayerFuncs OldPrimaryLayerFuncs; void *OldPrimaryLayerDriverData; DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_2d.c0000644000175000017500000004304311245562152015605 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "nvidia.h" #include "nvidia_regs.h" #include "nvidia_accel.h" #include "nvidia_2d.h" static void nv_copy32( volatile u32 *dst, u8 *src, int n ) { u32 *D = (u32*) dst; u32 *S = (u32*) src; #ifdef ARCH_X86 __asm__ __volatile__( "rep; movsl" : "=&D" (D), "=&S" (S) : "c" (n), "0" (D), "1" (S) : "memory" ); #else do { *D++ = *S++; } while (--n); #endif } static void nv_copy16( volatile u32 *dst, u8 *src, int n ) { u32 *D = (u32*) dst; u16 *S = (u16*) src; #ifdef ARCH_X86 __asm__ __volatile__( "rep; movsl" : "=&D" (D), "=&S" (S) : "c" (n/2), "0" (D), "1" (S) : "memory" ); #else for (; n > 1; n -= 2) { *D++ = *((u32*)S); S += 2; } #endif if (n & 1) *D = *S; } static inline bool nv_clip_source( DFBRectangle *rect, u32 width, u32 height ) { if (rect->x >= width || rect->y >= height) return false; if (rect->x < 0) { rect->w += rect->x; rect->x = 0; } if (rect->y < 0) { rect->h += rect->y; rect->y = 0; } rect->w = MIN( rect->w, width - rect->x ); rect->h = MIN( rect->h, height - rect->y ); return (rect->w > 0 && rect->h > 0); } #define M_TRANSFORM(x, y, retx, rety, m) { \ s32 _x, _y; \ _x = ((s64)(x) * (m)[0] + (y) * (m)[1] + (m)[2] + 0x8000) >> 16; \ _y = ((s64)(x) * (m)[3] + (y) * (m)[4] + (m)[5] + 0x8000) >> 16; \ retx = _x; \ rety = _y; \ } bool nvFillRectangle2D( void *drv, void *dev, DFBRectangle *rect ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; if (nvdev->dst_422) { rect->x /= 2; rect->w = (rect->w+1) >> 1; } if (nvdev->matrix) { int x1 = rect->x, x2 = rect->x+rect->w; int y1 = rect->y, y2 = rect->y+rect->h; int x, y; nv_begin( SUBC_TRIANGLE, TRI_COLOR, 1 ); nv_outr( nvdev->color2d ); nv_begin( SUBC_TRIANGLE, TRI_POINT0, 3 ); M_TRANSFORM( x1, y1, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x2, y1, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x1, y2, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); nv_begin( SUBC_TRIANGLE, TRI_POINT0, 3 ); M_TRANSFORM( x2, y1, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x2, y2, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x1, y2, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); } else { nv_begin( SUBC_RECTANGLE, RECT_COLOR, 1 ); nv_outr( nvdev->color2d ); nv_begin( SUBC_RECTANGLE, RECT_TOP_LEFT, 2 ); nv_outr( (rect->y << 16) | (rect->x & 0xFFFF) ); nv_outr( (rect->h << 16) | (rect->w & 0xFFFF) ); } return true; } bool nvFillTriangle2D( void *drv, void *dev, DFBTriangle *tri ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; if (nvdev->matrix) { M_TRANSFORM( tri->x1, tri->y1, tri->x1, tri->y1, nvdev->matrix ); M_TRANSFORM( tri->x2, tri->y3, tri->x2, tri->y2, nvdev->matrix ); M_TRANSFORM( tri->x3, tri->y3, tri->x3, tri->y3, nvdev->matrix ); } nv_begin( SUBC_TRIANGLE, TRI_COLOR, 1 ); nv_outr( nvdev->color2d ); nv_begin( SUBC_TRIANGLE, TRI_POINT0, 3 ); nv_outr( (tri->y1 << 16) | (tri->x1 & 0xFFFF) ); nv_outr( (tri->y2 << 16) | (tri->x2 & 0xFFFF) ); nv_outr( (tri->y3 << 16) | (tri->x3 & 0xFFFF) ); return true; } bool nvDrawRectangle2D( void *drv, void *dev, DFBRectangle *rect ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; if (nvdev->dst_422) { rect->x /= 2; rect->w = (rect->w+1) >> 1; } if (nvdev->matrix) { int x1 = rect->x, x2 = rect->x+rect->w; int y1 = rect->y, y2 = rect->y+rect->h; int x, y; nv_begin( SUBC_LINE, LINE_COLOR, 1 ); nv_outr( nvdev->color2d ); nv_begin( SUBC_LINE, LINE_POINT0, 8 ); /* top */ M_TRANSFORM( x1, y1, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x2, y1, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); /* right */ nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x2, y2, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); /* bottom */ nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x1, y2, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); /* left */ nv_outr( (y << 16) | (x & 0xFFFF) ); M_TRANSFORM( x1, y1, x, y, nvdev->matrix ); nv_outr( (y << 16) | (x & 0xFFFF) ); } else { nv_begin( SUBC_RECTANGLE, RECT_COLOR, 1 ); nv_outr( nvdev->color2d ); nv_begin( SUBC_RECTANGLE, RECT_TOP_LEFT, 8 ); /* top */ nv_outr( (rect->y << 16) | (rect->x & 0xFFFF) ); nv_outr( (1 << 16) | (rect->w & 0xFFFF) ); /* bottom */ nv_outr( ((rect->y + rect->h - 1) << 16) | (rect->x & 0xFFFF) ); nv_outr( (1 << 16) | (rect->w & 0xFFFF) ); /* left */ nv_outr( ((rect->y + 1) << 16) | (rect->x & 0xFFFF) ); nv_outr( ((rect->h - 2) << 16) | 1 ); /* right */ nv_outr( ((rect->y + 1) << 16) | ((rect->x + rect->w - 1) & 0xFFFF) ); nv_outr( ((rect->h - 2) << 16) | 1 ); } return true; } bool nvDrawLine2D( void *drv, void *dev, DFBRegion *line ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; if (nvdev->matrix) { M_TRANSFORM( line->x1, line->y1, line->x1, line->y1, nvdev->matrix ); M_TRANSFORM( line->x2, line->y2, line->x2, line->y2, nvdev->matrix ); } nv_begin( SUBC_LINE, LINE_COLOR, 1 ); nv_outr( nvdev->color2d ); nv_begin( SUBC_LINE, LINE_POINT0, 2 ); nv_outr( (line->y1 << 16) | (line->x1 & 0xFFFF) ); nv_outr( (line->y2 << 16) | (line->x2 & 0xFFFF) ); return true; } bool nvBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; if (nvdev->blittingflags & DSBLIT_DEINTERLACE || nvdev->matrix) { DFBRectangle dr = { dx, dy, rect->w, rect->h }; return nvStretchBlit( drv, dev, rect, &dr ); } if (nvdev->dst_422) { dx /= 2; rect->x /= 2; rect->w = (rect->w+1) >> 1; } if (nvdev->blittingflags || nvdev->src_format != nvdev->dst_format) { DFBRectangle *clip = &nvdev->clip; u32 src_width = (nvdev->src_width + 1) & ~1; u32 src_height = (nvdev->src_height + 1) & ~1; u32 filter = 0; if (nvdev->dst_422) src_width >>= 1; if (nvdev->arch > NV_ARCH_04) filter = SCALER_IN_FORMAT_ORIGIN_CORNER | SCALER_IN_FORMAT_FILTER_NEAREST; nv_begin( SUBC_SCALEDIMAGE, SCALER_COLOR_FORMAT, 1 ); nv_outr( nvdev->scaler_format ); nv_begin( SUBC_SCALEDIMAGE, SCALER_CLIP_POINT, 6 ); nv_outr( (clip->y << 16) | (clip->x & 0xFFFF) ); nv_outr( (clip->h << 16) | (clip->w & 0xFFFF) ); nv_outr( (dy << 16) | (dx & 0xFFFF) ); nv_outr( (rect->h << 16) | (rect->w & 0xFFFF) ); nv_outr( 0x100000 ); nv_outr( 0x100000 ); nv_begin( SUBC_SCALEDIMAGE, SCALER_IN_SIZE, 4 ); nv_outr( (src_height << 16) | (src_width & 0xFFFF) ); nv_outr( (nvdev->src_pitch & 0xFFFF) | filter ); nv_outr( nvdev->src_offset ); nv_outr( (rect->y << 20) | ((rect->x<<4) & 0xFFFF) ); } else { nv_begin( SUBC_SCREENBLT, BLIT_TOP_LEFT_SRC, 3 ); nv_outr( (rect->y << 16) | (rect->x & 0xFFFF) ); nv_outr( (dy << 16) | (dx & 0xFFFF) ); nv_outr( (rect->h << 16) | (rect->w & 0xFFFF) ); } return true; } bool nvBlitFromCPU( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; u8 *src = nvdev->src_address; u32 src_w; u32 src_h; int w, h, n; if (nvdev->blittingflags & DSBLIT_DEINTERLACE || nvdev->matrix) { DFBRectangle dr = { dx, dy, rect->x, rect->y }; return nvStretchBlitFromCPU( drv, dev, rect, &dr ); } if (!nv_clip_source( rect, nvdev->src_width, nvdev->src_height )) return true; src_w = (DFB_BYTES_PER_PIXEL(nvdev->src_format) == 2) ? ((rect->w + 1) & ~1) : rect->w; src_h = rect->h; nv_begin( SUBC_IMAGEBLT, IBLIT_COLOR_FORMAT, 1 ); nv_outr( nvdev->system_format ); nv_begin( SUBC_IMAGEBLT, IBLIT_POINT, 3 ); nv_outr( (dy << 16) | (dx & 0xFFFF) ); nv_outr( (rect->h << 16) | (rect->w & 0xFFFF) ); nv_outr( (src_h << 16) | (src_w & 0xFFFF) ); n = nvdev->use_dma ? 256 : 128; switch (nvdev->src_format) { case DSPF_ARGB1555: case DSPF_RGB16: src += rect->y * nvdev->src_pitch + rect->x * 2; for (h = rect->h; h--;) { u8 *s = src; for (w = rect->w; w >= n*2; w -= n*2) { nv_begin( SUBC_IMAGEBLT, IBLIT_PIXEL0, n ); direct_memcpy( (void*)nvdev->cmd_ptr, s, n*4 ); s += n*4; } if (w > 0) { nv_begin( SUBC_IMAGEBLT, IBLIT_PIXEL0, (w+1)>>1 ); nv_copy16( nvdev->cmd_ptr, s, w ); } src += nvdev->src_pitch; } break; default: src += rect->y * nvdev->src_pitch + rect->x * 4; for (h = rect->h; h--;) { u8 *s = src; for (w = rect->w; w >= n; w -= n) { nv_begin( SUBC_IMAGEBLT, IBLIT_PIXEL0, n ); direct_memcpy( (void*)nvdev->cmd_ptr, s, n*4 ); s += n*4; } if (w > 0) { nv_begin( SUBC_IMAGEBLT, IBLIT_PIXEL0, w ); nv_copy32( nvdev->cmd_ptr, s, w ); } src += nvdev->src_pitch; } break; } return true; } bool nvStretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; DFBRectangle *cr = &nvdev->clip; u32 src_width = (nvdev->src_width + 1) & ~1; u32 src_height = (nvdev->src_height + 1) & ~1; if (nvdev->dst_422) { sr->x /= 2; sr->w = (sr->w+1) >> 1; dr->x /= 2; dr->w = (dr->w+1) >> 1; src_width >>= 1; } if (nvdev->blittingflags & DSBLIT_DEINTERLACE) { sr->y /= 2; sr->h = (sr->h+1) / 2; } if (nvdev->matrix) { int x1, y1, x2, y2; if (!nvdev->matrix[0] || !nvdev->matrix[4]) return true; M_TRANSFORM( dr->x, dr->y, x1, y1, nvdev->matrix ); M_TRANSFORM( dr->x+dr->w, dr->y+dr->h, x2, y2, nvdev->matrix ); dr->x = x1; dr->w = x2-x1; dr->y = y1; dr->h = y2-y1; } nv_begin( SUBC_SCALEDIMAGE, SCALER_COLOR_FORMAT, 1 ); nv_outr( nvdev->scaler_format ); nv_begin( SUBC_SCALEDIMAGE, SCALER_CLIP_POINT, 6 ); nv_outr( (cr->y << 16) | (cr->x & 0xFFFF) ); nv_outr( (cr->h << 16) | (cr->w & 0xFFFF) ); nv_outr( (dr->y << 16) | (dr->x & 0xFFFF) ); nv_outr( (dr->h << 16) | (dr->w & 0xFFFF) ); nv_outr( (sr->w << 20) / dr->w ); nv_outr( (sr->h << 20) / dr->h ); nv_begin( SUBC_SCALEDIMAGE, SCALER_IN_SIZE, 4 ); nv_outr( (src_height << 16) | (src_width & 0xFFFF) ); nv_outr( (nvdev->src_pitch & 0xFFFF) | nvdev->scaler_filter ); nv_outr( nvdev->src_offset ); nv_outr( (sr->y << 20) | ((sr->x << 4) & 0xFFFF) ); return true; } bool nvStretchBlitFromCPU( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; DFBRectangle *cr = &nvdev->clip; u8 *src = nvdev->src_address; u32 src_w; u32 src_h; int w, h, n; if (!nv_clip_source( sr, nvdev->src_width, nvdev->src_height )) return true; if (nvdev->blittingflags & DSBLIT_DEINTERLACE) { sr->y /= 2; sr->h /= 2; } if (nvdev->matrix) { int x1, y1, x2, y2; if (!nvdev->matrix[0] || !nvdev->matrix[4]) return true; M_TRANSFORM( dr->x, dr->y, x1, y1, nvdev->matrix ); M_TRANSFORM( dr->x+dr->w, dr->y+dr->h, x2, y2, nvdev->matrix ); dr->x = x1; dr->w = x2-x1; dr->y = y1; dr->h = y2-y1; } src_w = (DFB_BYTES_PER_PIXEL(nvdev->src_format) == 2) ? ((sr->w + 1) & ~1) : sr->w; src_h = sr->h; nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_COLOR_FORMAT, 1 ); nv_outr( nvdev->system_format ); nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_IN_SIZE, 6 ); nv_outr( (src_h << 16) | (src_w & 0xFFFF) ); nv_outr( (dr->w << 20) / src_w ); nv_outr( (dr->h << 20) / src_h ); nv_outr( (cr->y << 16) | (cr->x & 0xFFFF) ); nv_outr( (cr->h << 16) | (cr->w & 0xFFFF) ); nv_outr( (dr->y << 20) | ((dr->x<<4) & 0xFFFF) ); n = nvdev->use_dma ? 256 : 128; switch (nvdev->src_format) { case DSPF_ARGB1555: case DSPF_RGB16: src += sr->y * nvdev->src_pitch + sr->x * 2; for (h = sr->h; h--;) { u8 *s = src; for (w = sr->w; w >= n*2; w -= n*2) { nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_PIXEL0, n ); direct_memcpy( (void*)nvdev->cmd_ptr, s, n*4 ); s += n*4; } if (w > 0) { nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_PIXEL0, (w+1)>>1 ); nv_copy16( nvdev->cmd_ptr, s, w ); } src += nvdev->src_pitch; } break; default: src += sr->y * nvdev->src_pitch + sr->x * 4; for (h = sr->h; h--;) { u8 *s= src; for (w = sr->w; w >= n; w -= n) { nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_PIXEL0, n ); direct_memcpy( (void*)nvdev->cmd_ptr, s, n*4 ); s += n*4; } if (w > 0) { nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_PIXEL0, w ); nv_copy32( nvdev->cmd_ptr, s, w ); } src += nvdev->src_pitch; } break; } return true; } DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_overlay.c0000644000175000017500000004656711245562152016777 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Oliver Schwartz and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "nvidia.h" #include "nvidia_regs.h" #include "nvidia_accel.h" typedef struct { CoreLayerRegionConfig config; CoreSurface *videoSurface; CoreSurfaceBufferLock *lock; short brightness; short contrast; short hue; short saturation; int field; struct { u32 BUFFER; u32 STOP; u32 UVBASE_0; u32 UVBASE_1; u32 UVOFFSET_0; u32 UVOFFSET_1; u32 BASE_0; u32 BASE_1; u32 OFFSET_0; u32 OFFSET_1; u32 SIZE_IN_0; u32 SIZE_IN_1; u32 POINT_IN_0; u32 POINT_IN_1; u32 DS_DX_0; u32 DS_DX_1; u32 DT_DY_0; u32 DT_DY_1; u32 POINT_OUT_0; u32 POINT_OUT_1; u32 SIZE_OUT_0; u32 SIZE_OUT_1; u32 FORMAT_0; u32 FORMAT_1; } regs; } NVidiaOverlayLayerData; static void ov0_set_regs ( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0, CoreLayerRegionConfigFlags flags ); static void ov0_calc_regs ( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags flags ); static void ov0_set_colorkey( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0, CoreLayerRegionConfig *config ); static void ov0_set_csc ( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0 ); #define OV0_SUPPORTED_OPTIONS \ ( DLOP_DST_COLORKEY | DLOP_DEINTERLACING ) /**********************/ static int ov0LayerDataSize( void ) { return sizeof(NVidiaOverlayLayerData); } static DFBResult ov0InitLayer( CoreLayer *layer, void *driver_data, void *layer_data, DFBDisplayLayerDescription *description, DFBDisplayLayerConfig *config, DFBColorAdjustment *adjustment ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaOverlayLayerData *nvov0 = (NVidiaOverlayLayerData*) layer_data; /* set capabilities and type */ description->caps = DLCAPS_SURFACE | DLCAPS_SCREEN_LOCATION | DLCAPS_BRIGHTNESS | DLCAPS_CONTRAST | DLCAPS_SATURATION | DLCAPS_HUE | DLCAPS_DST_COLORKEY | DLCAPS_DEINTERLACING; description->type = DLTF_VIDEO | DLTF_STILL_PICTURE; /* set name */ snprintf( description->name, DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "NVidia Overlay" ); /* fill out the default configuration */ config->flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; config->width = 640; config->height = 480; config->pixelformat = DSPF_YUY2; config->buffermode = DLBM_FRONTONLY; config->options = DLOP_NONE; /* fill out default color adjustment, only fields set in flags will be accepted from applications */ adjustment->flags = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_SATURATION | DCAF_HUE; adjustment->brightness = 0x8000; adjustment->contrast = 0x8000; adjustment->saturation = 0x8000; adjustment->hue = 0x8000; /* reset overlay */ nvov0->brightness = 0; nvov0->contrast = 4096; nvov0->hue = 0; nvov0->saturation = 4096; ov0_set_csc( nvdrv, nvov0 ); return DFB_OK; } static DFBResult ov0Remove( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; volatile u8 *mmio = nvdrv->mmio_base; /* disable overlay */ nv_out32( mmio, PVIDEO_STOP, PVIDEO_STOP_OVERLAY_ACTIVE | PVIDEO_STOP_METHOD_IMMEDIATELY ); nv_out32( mmio, PVIDEO_BUFFER, 0 ); return DFB_OK; } static DFBResult ov0TestRegion(CoreLayer *layer, void *driver_data, void *layer_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags *failed ) { NVidiaDriverData *nvdrv = driver_data; NVidiaDeviceData *nvdev = nvdrv->device_data; CoreLayerRegionConfigFlags fail = CLRCF_NONE; /* check for unsupported options */ if (config->options & ~OV0_SUPPORTED_OPTIONS) fail |= CLRCF_OPTIONS; /* check buffermode */ switch (config->buffermode) { case DLBM_FRONTONLY: case DLBM_BACKSYSTEM: case DLBM_BACKVIDEO: case DLBM_TRIPLE: break; default: fail |= CLRCF_BUFFERMODE; break; } /* check pixel format */ switch (config->format) { case DSPF_YUY2: case DSPF_UYVY: break; case DSPF_NV12: /*case DSPF_NV21:*/ if (nvdev->arch < NV_ARCH_30) fail |= CLRCF_FORMAT; break; default: fail |= CLRCF_FORMAT; break; } /* check width */ if (config->width > 2046 || config->width < 1) fail |= CLRCF_WIDTH; /* check height */ if (config->height > 2046 || config->height < 1) fail |= CLRCF_HEIGHT; /* write back failing fields */ if (failed) *failed = fail; /* return failure if any field failed */ if (fail) return DFB_UNSUPPORTED; return DFB_OK; } static DFBResult ov0SetRegion( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags updated, CoreSurface *surface, CorePalette *palette, CoreSurfaceBufferLock *lock ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaOverlayLayerData *nvov0 = (NVidiaOverlayLayerData*) layer_data; /* remember configuration */ nvov0->config = *config; nvov0->videoSurface = surface; nvov0->lock = lock; /* set configuration */ if (updated & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_SOURCE | CLRCF_DEST | CLRCF_OPTIONS | CLRCF_OPACITY)) { ov0_calc_regs( nvdrv, nvov0, config, updated ); ov0_set_regs( nvdrv, nvov0, updated ); } /* set destination colorkey */ if (updated & CLRCF_DSTKEY) ov0_set_colorkey( nvdrv, nvov0, config ); return DFB_OK; } static DFBResult ov0FlipRegion ( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, CoreSurface *surface, DFBSurfaceFlipFlags flags, CoreSurfaceBufferLock *lock ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaOverlayLayerData *nvov0 = (NVidiaOverlayLayerData*) layer_data; nvov0->videoSurface = surface; nvov0->lock = lock; dfb_surface_flip( nvov0->videoSurface, false ); ov0_calc_regs( nvdrv, nvov0, &nvov0->config, CLRCF_SURFACE ); ov0_set_regs( nvdrv, nvov0, CLRCF_SURFACE ); if (flags & DSFLIP_WAIT) dfb_layer_wait_vsync( layer ); return DFB_OK; } static DFBResult ov0SetColorAdjustment( CoreLayer *layer, void *driver_data, void *layer_data, DFBColorAdjustment *adj ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaOverlayLayerData *nvov0 = (NVidiaOverlayLayerData*) layer_data; if (adj->flags & DCAF_BRIGHTNESS) { nvov0->brightness = (adj->brightness >> 8) - 128; D_DEBUG( "DirectFB/NVidia/Overlay: brightness=%i\n", nvov0->brightness ); } if (adj->flags & DCAF_CONTRAST) { nvov0->contrast = 8191 - (adj->contrast >> 3); /* contrast inverted ?! */ D_DEBUG( "DirectFB/NVidia/Overlay: contrast=%i\n", nvov0->contrast ); } if (adj->flags & DCAF_SATURATION) { nvov0->saturation = adj->saturation >> 3; D_DEBUG( "DirectFB/NVidia/Overlay: saturation=%i\n", nvov0->saturation ); } if (adj->flags & DCAF_HUE) { nvov0->hue = (adj->hue / 182 - 180) % 360; D_DEBUG( "DirectFB/NVidia/Overlay: hue=%i\n", nvov0->hue ); } ov0_set_csc( nvdrv, nvov0 ); return DFB_OK; } static DFBResult ov0SetInputField( CoreLayer *layer, void *driver_data, void *layer_data, void *region_data, int field ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaOverlayLayerData *nvov0 = (NVidiaOverlayLayerData*) layer_data; nvov0->field = field; nvov0->regs.BUFFER = 1 << (field << 2); nv_out32( nvdrv->mmio_base, PVIDEO_BUFFER, nvov0->regs.BUFFER ); return DFB_OK; } DisplayLayerFuncs nvidiaOverlayFuncs = { .LayerDataSize = ov0LayerDataSize, .InitLayer = ov0InitLayer, .SetRegion = ov0SetRegion, .RemoveRegion = ov0Remove, .TestRegion = ov0TestRegion, .FlipRegion = ov0FlipRegion, .SetColorAdjustment = ov0SetColorAdjustment, .SetInputField = ov0SetInputField, }; /* internal */ static void ov0_set_regs( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0, CoreLayerRegionConfigFlags flags ) { volatile u8 *mmio = nvdrv->mmio_base; if (flags & CLRCF_SURFACE) { if (DFB_PLANAR_PIXELFORMAT(nvov0->config.format)) { nv_out32( mmio, PVIDEO_UVBASE_0, nvov0->regs.UVBASE_0 ); nv_out32( mmio, PVIDEO_UVBASE_1, nvov0->regs.UVBASE_1 ); nv_out32( mmio, PVIDEO_UVOFFSET_0, nvov0->regs.UVOFFSET_0 ); nv_out32( mmio, PVIDEO_UVOFFSET_1, nvov0->regs.UVOFFSET_1 ); } nv_out32( mmio, PVIDEO_BASE_0, nvov0->regs.BASE_0 ); nv_out32( mmio, PVIDEO_BASE_1, nvov0->regs.BASE_1 ); nv_out32( mmio, PVIDEO_OFFSET_0, nvov0->regs.OFFSET_0 ); nv_out32( mmio, PVIDEO_OFFSET_1, nvov0->regs.OFFSET_1 ); } if (flags & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_OPTIONS)) { nv_out32( mmio, PVIDEO_SIZE_IN_0, nvov0->regs.SIZE_IN_0 ); nv_out32( mmio, PVIDEO_SIZE_IN_1, nvov0->regs.SIZE_IN_1 ); } if (flags & (CLRCF_SOURCE | CLRCF_DEST | CLRCF_OPTIONS)) { nv_out32( mmio, PVIDEO_POINT_IN_0, nvov0->regs.POINT_IN_0 ); nv_out32( mmio, PVIDEO_POINT_IN_1, nvov0->regs.POINT_IN_1 ); nv_out32( mmio, PVIDEO_DS_DX_0, nvov0->regs.DS_DX_0 ); nv_out32( mmio, PVIDEO_DS_DX_1, nvov0->regs.DS_DX_1 ); nv_out32( mmio, PVIDEO_DT_DY_0, nvov0->regs.DT_DY_0 ); nv_out32( mmio, PVIDEO_DT_DY_1, nvov0->regs.DT_DY_1 ); } if (flags & CLRCF_DEST) { nv_out32( mmio, PVIDEO_POINT_OUT_0, nvov0->regs.POINT_OUT_0 ); nv_out32( mmio, PVIDEO_POINT_OUT_1, nvov0->regs.POINT_OUT_1 ); nv_out32( mmio, PVIDEO_SIZE_OUT_0, nvov0->regs.SIZE_OUT_0 ); nv_out32( mmio, PVIDEO_SIZE_OUT_1, nvov0->regs.SIZE_OUT_1 ); } if (flags & (CLRCF_FORMAT | CLRCF_SURFACE | CLRCF_OPTIONS)) { nv_out32( mmio, PVIDEO_FORMAT_0, nvov0->regs.FORMAT_0 ); nv_out32( mmio, PVIDEO_FORMAT_1, nvov0->regs.FORMAT_1 ); } nv_out32( mmio, PVIDEO_BUFFER, nvov0->regs.BUFFER ); nv_out32( mmio, PVIDEO_STOP, nvov0->regs.STOP ); } static void ov0_calc_regs( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags flags ) { NVidiaDeviceData *nvdev = nvdrv->device_data; if (flags & (CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_SOURCE | CLRCF_DEST | CLRCF_OPTIONS)) { int width = config->width; int height = config->height; DFBRectangle source = config->source; DFBRectangle dest = config->dest; source.x <<= 4; source.y <<= 4; if (dest.x < 0) { source.x -= (dest.x * source.w << 4) / dest.w; source.w += dest.x * source.w / dest.w; dest.w += dest.x; dest.x = 0; } if (dest.y < 0) { source.y -= (dest.y * source.h << 4) / dest.h; source.h += dest.y * source.h / dest.h; dest.h += dest.y; dest.y = 0; } if (config->options & DLOP_DEINTERLACING) { height /= 2; source.y /= 2; source.h /= 2; } if (source.w < 1 || source.h < 1 || dest.w < 1 || dest.h < 1) { nvov0->regs.STOP = PVIDEO_STOP_OVERLAY_ACTIVE | PVIDEO_STOP_METHOD_NORMALLY; return; } nvov0->regs.SIZE_IN_0 = nvov0->regs.SIZE_IN_1 = ((height << 16) & PVIDEO_SIZE_IN_HEIGHT_MSK) | ( width & PVIDEO_SIZE_IN_WIDTH_MSK); nvov0->regs.POINT_IN_0 = nvov0->regs.POINT_IN_1 = ((source.y << 16) & PVIDEO_POINT_IN_T_MSK) | ( source.x & PVIDEO_POINT_IN_S_MSK); nvov0->regs.DS_DX_0 = nvov0->regs.DS_DX_1 = (source.w << 20) / dest.w; nvov0->regs.DT_DY_0 = nvov0->regs.DT_DY_1 = (source.h << 20) / dest.h; nvov0->regs.POINT_OUT_0 = nvov0->regs.POINT_OUT_1 = ((dest.y << 16) & PVIDEO_POINT_OUT_Y_MSK) | ( dest.x & PVIDEO_POINT_OUT_X_MSK); nvov0->regs.SIZE_OUT_0 = nvov0->regs.SIZE_OUT_1 = ((dest.h << 16) & PVIDEO_SIZE_OUT_HEIGHT_MSK) | ( dest.w & PVIDEO_SIZE_OUT_WIDTH_MSK); } if (flags & (CLRCF_SURFACE | CLRCF_FORMAT | CLRCF_OPTIONS)) { CoreSurfaceBufferLock *lock = nvov0->lock; u32 format; if (config->options & DLOP_DEINTERLACING) format = (lock->pitch*2) & PVIDEO_FORMAT_PITCH_MSK; else format = lock->pitch & PVIDEO_FORMAT_PITCH_MSK; if (DFB_PLANAR_PIXELFORMAT(config->format)) format |= PVIDEO_FORMAT_PLANAR_NV; if (config->format == DSPF_UYVY) format |= PVIDEO_FORMAT_COLOR_YB8CR8YA8CB8; else format |= PVIDEO_FORMAT_COLOR_CR8YB8CB8YA8; if (config->options & DLOP_DST_COLORKEY) format |= PVIDEO_FORMAT_DISPLAY_COLOR_KEY_EQUAL; /* Use Buffer 0 for Odd field */ nvov0->regs.OFFSET_0 = (nvdev->fb_offset + lock->offset) & PVIDEO_OFFSET_MSK; /* Use Buffer 1 for Even field */ nvov0->regs.OFFSET_1 = nvov0->regs.OFFSET_0 + lock->pitch; if (DFB_PLANAR_PIXELFORMAT(config->format)) { CoreSurface *surface = nvov0->videoSurface; nvov0->regs.UVOFFSET_0 = (nvov0->regs.OFFSET_0 + lock->pitch * surface->config.size.h) & PVIDEO_UVOFFSET_MSK; nvov0->regs.UVOFFSET_1 = nvov0->regs.UVOFFSET_0 + lock->pitch; } nvov0->regs.FORMAT_0 = nvov0->regs.FORMAT_1 = format; } nvov0->regs.BUFFER = 1 << (nvov0->field << 2); nvov0->regs.STOP = (config->opacity) ? PVIDEO_STOP_OVERLAY_INACTIVE : PVIDEO_STOP_OVERLAY_ACTIVE; nvov0->regs.STOP |= PVIDEO_STOP_METHOD_NORMALLY; } static void ov0_set_colorkey( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0, CoreLayerRegionConfig *config ) { u32 key; key = dfb_color_to_pixel( dfb_primary_layer_pixelformat(), config->dst_key.r, config->dst_key.g, config->dst_key.b ); nv_out32( nvdrv->mmio_base, PVIDEO_COLOR_KEY, key ); } static void ov0_set_csc( NVidiaDriverData *nvdrv, NVidiaOverlayLayerData *nvov0 ) { volatile u8 *mmio = nvdrv->mmio_base; s32 satSine; s32 satCosine; double angle; angle = (double) nvov0->hue * M_PI / 180.0; satSine = nvov0->saturation * sin(angle); if (satSine < -1024) satSine = -1024; satCosine = nvov0->saturation * cos(angle); if (satCosine < -1024) satCosine = -1024; nv_out32( mmio, PVIDEO_LUMINANCE_0, (nvov0->brightness << 16) | (nvov0->contrast & 0xffff) ); nv_out32( mmio, PVIDEO_LUMINANCE_1, (nvov0->brightness << 16) | (nvov0->contrast & 0xffff) ); nv_out32( mmio, PVIDEO_CHROMINANCE_0, (satSine << 16) | (satCosine & 0xffff) ); nv_out32( mmio, PVIDEO_CHROMINANCE_1, (satSine << 16) | (satCosine & 0xffff) ); } DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_accel.h0000644000175000017500000001670311245562152016357 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NVIDIA_ACCEL_H__ #define __NVIDIA_ACCEL_H__ #include #include "nvidia.h" #include "nvidia_regs.h" static __inline__ void nv_out8( volatile void *mmioaddr, u32 reg, u8 value ) { *((volatile u8*)(mmioaddr+reg)) = value; } static __inline__ void nv_out16( volatile void *mmioaddr, u32 reg, u16 value ) { *((volatile u16*)(mmioaddr+reg)) = value; } static __inline__ void nv_out32( volatile void *mmioaddr, u32 reg, u32 value ) { *((volatile u32*)(mmioaddr+reg)) = value; } static __inline__ u8 nv_in8( volatile void *mmioaddr, u32 reg ) { return *((volatile u8*)(mmioaddr+reg)); } static __inline__ u16 nv_in16( volatile void *mmioaddr, u32 reg ) { return *((volatile u16*)(mmioaddr+reg)); } static __inline__ u32 nv_in32( volatile void *mmioaddr, u32 reg ) { return *((volatile u32*)(mmioaddr+reg)); } static __inline__ void nv_outcrtc( volatile void *mmioaddr, u8 reg, u8 value ) { nv_out8( mmioaddr, PCIO_CRTC_INDEX, reg ); nv_out8( mmioaddr, PCIO_CRTC_DATA, value ); } static __inline__ u8 nv_incrtc( volatile void *mmioaddr, u8 reg ) { nv_out8( mmioaddr, PCIO_CRTC_INDEX, reg ); return nv_in8( mmioaddr, PCIO_CRTC_DATA ); } #define WAIT_MAX 10000000 static inline void nv_waitidle( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev ) { u32 status; int waitcycles = 0; do { status = nv_in32( nvdrv->mmio_base, PGRAPH_STATUS ); if (++waitcycles > WAIT_MAX) { D_BREAK( "Engine timed out" ); /* avoid card crash */ _exit(-1); } } while (status & PGRAPH_STATUS_STATE_BUSY); nvdev->idle_waitcycles += waitcycles; } /* * FIFO control */ static inline void nv_waitfifo( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, unsigned int space ) { volatile void *mmio = nvdrv->mmio_base; int waitcycles = 0; nvdev->waitfree_sum += (space); nvdev->waitfree_calls++; if (nvdev->fifo_free < space) { do { #ifdef WORDS_BIGENDIAN nvdev->fifo_free = nv_in16( mmio, FIFO_FREE ) >> 2; #else nvdev->fifo_free = nv_in32( mmio, FIFO_FREE ) >> 2; #endif if (++waitcycles > WAIT_MAX) { D_BREAK( "FIFO timed out" ); /* avoid card crash */ _exit(-1); } } while (nvdev->fifo_free < space); nvdev->free_waitcycles += waitcycles; } else nvdev->cache_hits++; nvdev->fifo_free -= space; } /* * DMA control */ static inline void nv_emitdma( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev ) { if (nvdev->dma_put != nvdev->dma_cur) { volatile u8 scratch; /* flush MTRR buffers */ scratch = nv_in8( nvdrv->fb_base, 0 ); nv_out32( nvdrv->mmio_base, DMA_PUT, nvdev->dma_cur << 2 ); nvdev->dma_put = nvdev->dma_cur; } } static inline void nv_waitdma( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, unsigned int space ) { volatile void *mmio = nvdrv->mmio_base; volatile void *ring = nvdrv->dma_base; int waitcycles = 0; nvdev->waitfree_sum += (space); nvdev->waitfree_calls++; if (nvdev->dma_free < space) { do { nvdev->dma_get = nv_in32( mmio, DMA_GET ) >> 2; if (nvdev->dma_put >= nvdev->dma_get) { nvdev->dma_free = nvdev->dma_max - nvdev->dma_cur; if (nvdev->dma_free < space) { /* rewind ring */ nv_out32( ring, nvdev->dma_cur << 2, 0x20000000 ); if (!nvdev->dma_get) { if (!nvdev->dma_put) { nvdev->dma_cur = 1; nv_emitdma( nvdrv, nvdev ); } do { nvdev->dma_get = nv_in32( mmio, DMA_GET ) >> 2; if (++waitcycles > WAIT_MAX) { D_BREAK( "DMA timed out" ); /* avoid card crash */ _exit(-1); } } while (!nvdev->dma_get); } nvdev->dma_cur = 0; nv_emitdma( nvdrv, nvdev ); nvdev->dma_free = nvdev->dma_get - 1; } } else { nvdev->dma_free = nvdev->dma_get - nvdev->dma_cur - 1; } if (++waitcycles > WAIT_MAX) { D_BREAK( "DMA timed out" ); /* avoid card crash */ _exit(-1); } } while (nvdev->dma_free < space); nvdev->free_waitcycles += waitcycles; } else nvdev->cache_hits++; nvdev->dma_free -= space; } /* Begin writing into ring/fifo */ #define nv_begin( subc, start, size ) { \ if (nvdev->use_dma) { \ nv_waitdma( nvdrv, nvdev, (size)+1 ); \ nv_out32( nvdrv->dma_base, nvdev->dma_cur << 2, \ ((size) << 18) | ((subc)*0x2000 + (start)) ); \ nvdev->cmd_ptr = nvdrv->dma_base; \ nvdev->cmd_ptr += nvdev->dma_cur + 1; \ nvdev->dma_cur += (size) + 1; \ D_ASSERT( nvdev->dma_cur <= nvdev->dma_max ); \ } else { \ nv_waitfifo( nvdrv, nvdev, size ); \ nvdev->cmd_ptr = (nvdrv->mmio_base + FIFO_ADDRESS + \ (subc)*0x2000 + (start)); \ } \ } /* Output to ring/register */ #define nv_outr( value ) *nvdev->cmd_ptr++ = (value) #endif /* __NVIDIA_ACCEL_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_regs.h0000644000175000017500000023115511164361026016245 00000000000000#ifndef __NVIDIA_REGS_H__ #define __NVIDIA_REGS_H__ /* PMC */ #define PMC 0x00000000 /* PBUS */ #define PBUS 0x00001000 /* PFIFO */ #define PFIFO 0x00002000 #define PFIFO_DELAY_0 0x00002040 #define PFIFO_DELAY_0_WAIT_RETRY_MSK 0x000003FF #define PFIFO_DMA_TIMESLICE 0x00002044 #define PFIFO_DMA_TIMESLICE_SELECT_MSK 0x0001FFFF #define PFIFO_DMA_TIMESLICE_SELECT_1 0x00000000 #define PFIFO_DMA_TIMESLICE_SELECT_16K 0x00003FFF #define PFIFO_DMA_TIMESLICE_SELECT_32K 0x00007FFF #define PFIFO_DMA_TIMESLICE_SELECT_64K 0x0000FFFF #define PFIFO_DMA_TIMESLICE_SELECT_128K 0x0001FFFF #define PFIFO_DMA_TIMESLICE_TIMEOUT_DISABLED 0x00000000 #define PFIFO_DMA_TIMESLICE_TIMEOUT_ENABLED 0x01000000 #define PFIFO_PIO_TIMESLICE 0x00002048 #define PFIFO_PIO_TIMESLICE_SELECT_MSK 0x0001FFFF #define PFIFO_PIO_TIMESLICE_SELECT_1 0x00000000 #define PFIFO_PIO_TIMESLICE_SELECT_16K 0x00003FFF #define PFIFO_PIO_TIMESLICE_SELECT_32K 0x00007FFF #define PFIFO_PIO_TIMESLICE_SELECT_64K 0x0000FFFF #define PFIFO_PIO_TIMESLICE_SELECT_128K 0x0001FFFF #define PFIFO_PIO_TIMESLICE_TIMEOUT_DISABLED 0x00000000 #define PFIFO_PIO_TIMESLICE_TIMEOUT_ENABLED 0x01000000 #define PFIFO_TIMESLICE 0x0000204C #define PFIFO_TIMESLICE_TIMER_MSK 0x0003FFFF #define PFIFO_NEXT_CHANNEL 0x00002050 #define PFIFO_NEXT_CHANNEL_CHID_MSK 0x0000001F #define PFIFO_NEXT_CHANNEL_MODE_PIO 0x00000000 #define PFIFO_NEXT_CHANNEL_MODE_DMA 0x00000100 #define PFIFO_NEXT_CHANNEL_SWITCH_NOT_PENDING 0x00000000 #define PFIFO_NEXT_CHANNEL_SWITCH_PENDING 0x00001000 #define PFIFO_DEBUG_0 0x00002080 #define PFIFO_DEBUG_0_CACHE_ERROR0_NOT_PENDING 0x00000000 #define PFIFO_DEBUG_0_CACHE_ERROR0_PENDING 0x00000001 #define PFIFO_DEBUG_0_CACHE_ERROR1_NOT_PENDING 0x00000000 #define PFIFO_DEBUG_0_CACHE_ERROR1_PENDING 0x00000010 #define PFIFO_INTR 0x00002100 #define PFIFO_INTR_RESET 0xFFFFFFFF #define PFIFO_INTR_CACHE_ERROR_NOT_PENDING 0x00000000 #define PFIFO_INTR_CACHE_ERROR_PENDING 0x00000001 #define PFIFO_INTR_CACHE_ERROR_RESET 0x00000001 #define PFIFO_INTR_RUNOUT_NOT_PENDING 0x00000000 #define PFIFO_INTR_RUNOUT_PENDING 0x00000010 #define PFIFO_INTR_RUNOUT_RESET 0x00000010 #define PFIFO_INTR_RUNOUT_OVERFLOW_NOT_PENDING 0x00000000 #define PFIFO_INTR_RUNOUT_OVERFLOW_PENDING 0x00000100 #define PFIFO_INTR_RUNOUT_OVERFLOW_RESET 0x00000100 #define PFIFO_INTR_DMA_PUSHER_NOT_PENDING 0x00000000 #define PFIFO_INTR_DMA_PUSHER_PENDING 0x00001000 #define PFIFO_INTR_DMA_PUSHER_RESET 0x00001000 #define PFIFO_INTR_DMA_PT_NOT_PENDING 0x00000000 #define PFIFO_INTR_DMA_PT_PENDING 0x00010000 #define PFIFO_INTR_DMA_PT_RESET 0x00010000 #define PFIFO_INTR_SEMAPHORE_NOT_PENDING 0x00000000 #define PFIFO_INTR_SEMAPHORE_PENDING 0x00100000 #define PFIFO_INTR_SEMAPHORE_RESET 0x00100000 #define PFIFO_INTR_ACQUIRE_TIMEOUT_NOT_PENDING 0x00000000 #define PFIFO_INTR_ACQUIRE_TIMEOUT_PENDING 0x01000000 #define PFIFO_INTR_ACQUIRE_TIMEOUT_RESET 0x01000000 #define PFIFO_INTR_EN 0x00002140 #define PFIFO_INTR_EN_DISABLED 0x00000000 #define PFIFO_INTR_EN_CACHE_ERROR_DISABLED 0x00000000 #define PFIFO_INTR_EN_CACHE_ERROR_ENABLED 0x00000001 #define PFIFO_INTR_EN_RUNOUT_DISABLED 0x00000000 #define PFIFO_INTR_EN_RUNOUT_ENABLED 0x00000010 #define PFIFO_INTR_EN_RUNOUT_OVERFLOW_DISABLED 0x00000000 #define PFIFO_INTR_EN_RUNOUT_OVERFLOW_ENABLED 0x00000100 #define PFIFO_INTR_EN_DMA_PUSHER_DISABLED 0x00000000 #define PFIFO_INTR_EN_DMA_PUSHER_ENABLED 0x00001000 #define PFIFO_INTR_EN_DMA_PT_DISABLED 0x00000000 #define PFIFO_INTR_EN_DMA_PT_ENABLED 0x00010000 #define PFIFO_INTR_EN_SEMAPHORE_DISABLED 0x00000000 #define PFIFO_INTR_EN_SEMAPHORE_ENABLED 0x00100000 #define PFIFO_INTR_EN_ACQUIRE_TIMEOUT_DISABLED 0x00000000 #define PFIFO_INTR_EN_ACQUIRE_TIMEOUT_ENABLED 0x01000000 #define PFIFO_RAMHT 0x00002210 #define PFIFO_RAMHT_BASE_ADDRESS_MSK 0x000001F0 #define PFIFO_RAMHT_SIZE_4K 0x00000000 #define PFIFO_RAMHT_SIZE_8K 0x00010000 #define PFIFO_RAMHT_SIZE_16K 0x00020000 #define PFIFO_RAMHT_SIZE_32K 0x00030000 #define PFIFO_RAMHT_SEARCH_16 0x00000000 #define PFIFO_RAMHT_SEARCH_32 0x01000000 #define PFIFO_RAMHT_SEARCH_64 0x02000000 #define PFIFO_RAMHT_SEARCH_128 0x03000000 #define PFIFO_RAMFC 0x00002214 #define PFIFO_RAMFC_BASE_ADDRESS_MSK 0x000001F8 #define PFIFO_RAMRO 0x00002218 #define PFIFO_RAMRO_BASE_ADDRESS_MSK 0x000001FE #define PFIFO_RAMRO_BASE_ADDRESS_11800 0x00000118 #define PFIFO_RAMRO_BASE_ADDRESS_11400 0x00000114 #define PFIFO_RAMRO_BASE_ADDRESS_11200 0x00000112 #define PFIFO_RAMRO_BASE_ADDRESS_12000 0x00000120 #define PFIFO_RAMRO_SIZE_512 0x00000000 #define PFIFO_RAMRO_SIZE_8K 0x00010000 #define PFIFO_CACHES 0x00002500 #define PFIFO_CACHES_REASSIGN_DISABLED 0x00000000 #define PFIFO_CACHES_REASSIGN_ENABLED 0x00000001 #define PFIFO_CACHES_DMA_SUSPEND_IDLE 0x00000000 #define PFIFO_CACHES_DMA_SUSPEND_BUSY 0x00000010 #define PFIFO_MODE 0x00002504 #define PFIFO_MODE_CHANNEL_0_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_0_DMA 0x00000001 #define PFIFO_MODE_CHANNEL_1_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_1_DMA 0x00000002 #define PFIFO_MODE_CHANNEL_2_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_2_DMA 0x00000004 #define PFIFO_MODE_CHANNEL_3_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_3_DMA 0x00000008 #define PFIFO_MODE_CHANNEL_4_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_4_DMA 0x00000010 #define PFIFO_MODE_CHANNEL_5_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_5_DMA 0x00000020 #define PFIFO_MODE_CHANNEL_6_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_6_DMA 0x00000040 #define PFIFO_MODE_CHANNEL_7_PIO 0x00000000 #define PFIFO_MODE_CHANNEL_7_DMA 0x00000080 #define PFIFO_DMA 0x00002508 #define PFIFO_DMA_CHANNEL_0_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_0_PENDING 0x00000001 #define PFIFO_DMA_CHANNEL_1_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_1_PENDING 0x00000002 #define PFIFO_DMA_CHANNEL_2_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_2_PENDING 0x00000004 #define PFIFO_DMA_CHANNEL_3_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_3_PENDING 0x00000008 #define PFIFO_DMA_CHANNEL_4_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_4_PENDING 0x00000010 #define PFIFO_DMA_CHANNEL_5_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_5_PENDING 0x00000020 #define PFIFO_DMA_CHANNEL_6_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_6_PENDING 0x00000040 #define PFIFO_DMA_CHANNEL_7_NOT_PENDING 0x00000000 #define PFIFO_DMA_CHANNEL_7_PENDING 0x00000080 #define PFIFO_SIZE 0x0000250C #define PFIFO_SIZE_CHANNEL_0_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_0_512_BYTES 0x00000001 #define PFIFO_SIZE_CHANNEL_1_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_1_512_BYTES 0x00000002 #define PFIFO_SIZE_CHANNEL_2_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_2_512_BYTES 0x00000004 #define PFIFO_SIZE_CHANNEL_3_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_3_512_BYTES 0x00000008 #define PFIFO_SIZE_CHANNEL_4_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_4_512_BYTES 0x00000010 #define PFIFO_SIZE_CHANNEL_5_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_5_512_BYTES 0x00000020 #define PFIFO_SIZE_CHANNEL_6_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_6_512_BYTES 0x00000040 #define PFIFO_SIZE_CHANNEL_7_124_BYTES 0x00000000 #define PFIFO_SIZE_CHANNEL_7_512_BYTES 0x00000080 #define PFIFO_CACHE0_PUSH0 0x00003000 #define PFIFO_CACHE0_PUSH0_ACCESS_DISABLED 0x00000000 #define PFIFO_CACHE0_PUSH0_ACCESS_ENABLED 0x00000001 #define PFIFO_CACHE1_PUSH0 0x00003200 #define PFIFO_CACHE1_PUSH0_ACCESS_DISABLED 0x00000000 #define PFIFO_CACHE1_PUSH0_ACCESS_ENABLED 0x00000001 #define PFIFO_CACHE0_PUSH1 0x00003004 #define PFIFO_CACHE0_PUSH1_CHID_MSK 0x0000001F #define PFIFO_CACHE1_PUSH1 0x00003204 #define PFIFO_CACHE1_PUSH1_CHID_MSK 0x0000001F #define PFIFO_CACHE1_PUSH1_MODE_PIO 0x00000000 #define PFIFO_CACHE1_PUSH1_MODE_DMA 0x00000100 #define PFIFO_CACHE1_DMA_PUSH 0x00003220 #define PFIFO_CACHE1_DMA_PUSH_ACCESS_DISABLED 0x00000000 #define PFIFO_CACHE1_DMA_PUSH_ACCESS_ENABLED 0x00000001 #define PFIFO_CACHE1_DMA_PUSH_STATE_IDLE 0x00000000 #define PFIFO_CACHE1_DMA_PUSH_STATE_BUSY 0x00000010 #define PFIFO_CACHE1_DMA_PUSH_BUFFER_NOT_EMPTY 0x00000000 #define PFIFO_CACHE1_DMA_PUSH_BUFFER_EMPTY 0x00000100 #define PFIFO_CACHE1_DMA_PUSH_STATUS_RUNNING 0x00000000 #define PFIFO_CACHE1_DMA_PUSH_STATUS_SUSPENDED 0x00001000 #define PFIFO_CACHE1_DMA_FETCH 0x00003224 #define PFIFO_CACHE1_DMA_FETCH_TRIG_8_BYTES 0x00000000 #define PFIFO_CACHE1_DMA_FETCH_TRIG_16_BYTES 0x00000008 #define PFIFO_CACHE1_DMA_FETCH_TRIG_24_BYTES 0x00000010 #define PFIFO_CACHE1_DMA_FETCH_TRIG_32_BYTES 0x00000018 #define PFIFO_CACHE1_DMA_FETCH_TRIG_40_BYTES 0x00000020 #define PFIFO_CACHE1_DMA_FETCH_TRIG_48_BYTES 0x00000028 #define PFIFO_CACHE1_DMA_FETCH_TRIG_56_BYTES 0x00000030 #define PFIFO_CACHE1_DMA_FETCH_TRIG_64_BYTES 0x00000038 #define PFIFO_CACHE1_DMA_FETCH_TRIG_72_BYTES 0x00000040 #define PFIFO_CACHE1_DMA_FETCH_TRIG_80_BYTES 0x00000048 #define PFIFO_CACHE1_DMA_FETCH_TRIG_88_BYTES 0x00000050 #define PFIFO_CACHE1_DMA_FETCH_TRIG_96_BYTES 0x00000058 #define PFIFO_CACHE1_DMA_FETCH_TRIG_104_BYTES 0x00000060 #define PFIFO_CACHE1_DMA_FETCH_TRIG_112_BYTES 0x00000068 #define PFIFO_CACHE1_DMA_FETCH_TRIG_120_BYTES 0x00000070 #define PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES 0x00000078 #define PFIFO_CACHE1_DMA_FETCH_TRIG_136_BYTES 0x00000080 #define PFIFO_CACHE1_DMA_FETCH_TRIG_144_BYTES 0x00000088 #define PFIFO_CACHE1_DMA_FETCH_TRIG_152_BYTES 0x00000090 #define PFIFO_CACHE1_DMA_FETCH_TRIG_160_BYTES 0x00000098 #define PFIFO_CACHE1_DMA_FETCH_TRIG_168_BYTES 0x000000A0 #define PFIFO_CACHE1_DMA_FETCH_TRIG_176_BYTES 0x000000A8 #define PFIFO_CACHE1_DMA_FETCH_TRIG_184_BYTES 0x000000B0 #define PFIFO_CACHE1_DMA_FETCH_TRIG_192_BYTES 0x000000B8 #define PFIFO_CACHE1_DMA_FETCH_TRIG_200_BYTES 0x000000C0 #define PFIFO_CACHE1_DMA_FETCH_TRIG_208_BYTES 0x000000C8 #define PFIFO_CACHE1_DMA_FETCH_TRIG_216_BYTES 0x000000D0 #define PFIFO_CACHE1_DMA_FETCH_TRIG_224_BYTES 0x000000D8 #define PFIFO_CACHE1_DMA_FETCH_TRIG_232_BYTES 0x000000E0 #define PFIFO_CACHE1_DMA_FETCH_TRIG_240_BYTES 0x000000E8 #define PFIFO_CACHE1_DMA_FETCH_TRIG_248_BYTES 0x000000F0 #define PFIFO_CACHE1_DMA_FETCH_TRIG_256_BYTES 0x000000F8 #define PFIFO_CACHE1_DMA_FETCH_SIZE_32_BYTES 0x00000000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_64_BYTES 0x00002000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_96_BYTES 0x00004000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_128_BYTES 0x00006000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_160_BYTES 0x00008000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_192_BYTES 0x0000A000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_224_BYTES 0x0000C000 #define PFIFO_CACHE1_DMA_FETCH_SIZE_256_BYTES 0x0000E000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_0 0x00000000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_1 0x00010000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_2 0x00020000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_3 0x00030000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_4 0x00040000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_5 0x00050000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_6 0x00060000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_7 0x00070000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_8 0x00080000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_9 0x00090000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_10 0x000A0000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_11 0x000B0000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_12 0x000C0000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_13 0x000D0000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_14 0x000E0000 #define PFIFO_CACHE1_DMA_FETCH_MAX_REQS_15 0x000F0000 #define PFIFO_CACHE1_LITTLE_ENDIAN 0x00000000 #define PFIFO_CACHE1_BIG_ENDIAN 0x80000000 #define PFIFO_CACHE1_DMA_PUT 0x00003240 #define PFIFO_CACHE1_DMA_GET 0x00003244 #define PFIFO_CACHE1_REF 0x00003248 #define PFIFO_CACHE1_DMA_SUBROUTINE 0x0000324C #define PFIFO_CACHE1_DMA_SUBROUTINE_OFFSET_MSK 0x1FFFFFFC #define PFIFO_CACHE1_DMA_SUBROUTINE_STATE_INACTIVE 0x00000000 #define PFIFO_CACHE1_DMA_SUBROUTINE_STATE_ACTIVE 0x00000001 #define PFIFO_CACHE1_DMA_DCOUNT 0x000032A0 #define PFIFO_CACHE1_DMA_DCOUNT_VALUE_MSK 0x00001FFC #define PFIFO_CACHE1_DMA_GET_JMP_SHADOW 0x000032A4 #define PFIFO_CACHE1_DMA_RSVD_SHADOW 0x000032A8 #define PFIFO_CACHE1_DMA_DATA_SHADOW 0x000032AC #define PFIFO_CACHE1_DMA_STATE 0x00003228 #define PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_INC 0x00000000 #define PFIFO_CACHE1_DMA_STATE_METHOD_TYPE_NON_INC 0x00000001 #define PFIFO_CACHE1_DMA_STATE_METHOD_MSK 0x00001FFC #define PFIFO_CACHE1_DMA_STATE_SUBCHANNEL 0x0000E000 #define PFIFO_CACHE1_DMA_STATE_METHOD_COUNT_MSK 0x1FFC0000 #define PFIFO_CACHE1_DMA_STATE_ERROR_NONE 0x00000000 #define PFIFO_CACHE1_DMA_STATE_ERROR_CALL 0x20000000 #define PFIFO_CACHE1_DMA_STATE_ERROR_NON_CACHE 0x40000000 #define PFIFO_CACHE1_DMA_STATE_ERROR_RETURN 0x60000000 #define PFIFO_CACHE1_DMA_STATE_ERROR_RESERVED_CMD 0x80000000 #define PFIFO_CACHE1_DMA_STATE_ERROR_PROTECTION 0xC0000000 #define PFIFO_CACHE1_DMA_INSTANCE 0x0000322C #define PFIFO_CACHE1_DMA_CTL 0x00003230 #define PFIFO_CACHE1_DMA_CTL_ADJUST_MSK 0x00000FFC #define PFIFO_CACHE1_DMA_CTL_PAGE_TABLE_PRESENT 0x00001000 #define PFIFO_CACHE1_DMA_CTL_PAGE_ENTRY_LINEAR 0x00002000 #define PFIFO_CACHE1_DMA_CTL_TARGET_NODE_NVM 0x00000000 #define PFIFO_CACHE1_DMA_CTL_TARGET_NODE_PCI 0x00020000 #define PFIFO_CACHE1_DMA_CTL_TARGET_NODE_AGP 0x00030000 #define PFIFO_CACHE1_DMA_CTL_AT_INFO_INVALID 0x00000000 #define PFIFO_CACHE1_DMA_CTL_AT_INFO_VALID 0x80000000 #define PFIFO_CACHE1_DMA_LIMIT 0x00003234 #define PFIFO_CACHE1_DMA_TLB_TAG 0x00003238 #define PFIFO_CACHE1_DMA_TLB_TAG_ADDRESS_MSK 0x1FFFF000 #define PFIFO_CACHE1_DMA_TLB_TAG_STATE_INVALID 0x00000000 #define PFIFO_CACHE1_DMA_TLB_TAG_STATE_VALID 0x00000001 #define PFIFO_CACHE1_DMA_TLB_PTE 0x0000323C #define PFIFO_CACHE1_DMA_TLB_PTE_ADDRESS_MSK 0xFFFFF000 #define PFIFO_CACHE0_PULL0 0x00003050 #define PFIFO_CACHE0_PULL0_ACCESS_DISABLED 0x00000000 #define PFIFO_CACHE0_PULL0_ACCESS_ENABLED 0x00000001 #define PFIFO_CACHE0_PULL0_HASH_SUCCEEDED 0x00000000 #define PFIFO_CACHE0_PULL0_HASH_FAILED 0x00000010 #define PFIFO_CACHE0_PULL0_DEVICE_HARDWARE 0x00000000 #define PFIFO_CACHE0_PULL0_DEVICE_SOFTWARE 0x00000100 #define PFIFO_CACHE0_PULL0_HASH_STATE_IDLE 0x00000000 #define PFIFO_CACHE0_PULL0_HASH_STATE_BUSY 0x00001000 #define PFIFO_CACHE1_PULL0 0x00003250 #define PFIFO_CACHE1_PULL0_ACCESS_DISABLED 0x00000000 #define PFIFO_CACHE1_PULL0_ACCESS_ENABLED 0x00000001 #define PFIFO_CACHE1_PULL0_HASH_SUCCEEDED 0x00000000 #define PFIFO_CACHE1_PULL0_HASH_FAILED 0x00000010 #define PFIFO_CACHE1_PULL0_DEVICE_HARDWARE 0x00000000 #define PFIFO_CACHE1_PULL0_DEVICE_SOFTWARE 0x00000100 #define PFIFO_CACHE1_PULL0_HASH_STATE_IDLE 0x00000000 #define PFIFO_CACHE1_PULL0_HASH_STATE_BUSY 0x00001000 #define PFIFO_CACHE1_PULL0_ACQUIRE_STATE_IDLE 0x00000000 #define PFIFO_CACHE1_PULL0_ACQUIRE_STATE_BUSY 0x00010000 #define PFIFO_CACHE1_PULL0_SEMAPHORE_NO_ERROR 0x00000000 #define PFIFO_CACHE1_PULL0_SEMAPHORE_BAD_ARG 0x00100000 #define PFIFO_CACHE1_PULL0_SEMAPHORE_ISTATE 0x00200000 #define PFIFO_CACHE0_PULL1 0x00003054 #define PFIFO_CACHE0_PULL1_ENGINE_SW 0x00000000 #define PFIFO_CACHE0_PULL1_ENGINE_GRAPHICS 0x00000001 #define PFIFO_CACHE0_PULL1_ENGINE_DVD 0x00000002 #define PFIFO_CACHE1_PULL1 0x00003254 #define PFIFO_CACHE1_PULL1_ENGINE_SW 0x00000000 #define PFIFO_CACHE1_PULL1_ENGINE_GRAPHICS 0x00000001 #define PFIFO_CACHE1_PULL1_ENGINE_DVD 0x00000002 #define PFIFO_CACHE1_PULL1_ACQUIRE 0x00000010 #define PFIFO_CACHE1_PULL1_ACQUIRE_INACTIVE 0x00000000 #define PFIFO_CACHE1_PULL1_ACQUIRE_ACTIVE 0x00000010 #define PFIFO_CACHE1_PULL1_SEM_TARGET_NODE 0x00030000 #define PFIFO_CACHE1_PULL1_SEM_TARGET_NODE_NVM 0x00000000 #define PFIFO_CACHE1_PULL1_SEM_TARGET_NODE_PCI 0x00020000 #define PFIFO_CACHE1_PULL1_SEM_TARGET_NODE_AGP 0x00030000 #define PFIFO_CACHE0_HASH 0x00003058 #define PFIFO_CACHE0_HASH_INSTANCE_MSK 0x0000FFFF #define PFIFO_CACHE1_HASH 0x00003258 #define PFIFO_CACHE1_HASH_INSTANCE_MSK 0x0000FFFF #define PFIFO_CACHE1_ACQUIRE_0 0x00003260 #define PFIFO_CACHE1_ACQUIRE_1 0x00003264 #define PFIFO_CACHE1_ACQUIRE_2 0x00003268 #define PFIFO_CACHE1_SEMAPHORE 0x0000326C #define PFIFO_CACHE1_SEMAPHORE_CTXDMA_INVALID 0x00000000 #define PFIFO_CACHE1_SEMAPHORE_CTXDMA_VALID 0x00000001 #define PFIFO_CACHE1_SEMAPHORE_OFFSET_MSK 0x00000FFC #define PFIFO_CACHE1_SEMAPHORE_PAGE_ADDRESS_MSK 0xFFFFF000 #define PFIFO_CACHE0_STATUS 0x00003014 #define PFIFO_CACHE0_STATUS_LOW_MARK_NOT_EMPTY 0x00000000 #define PFIFO_CACHE0_STATUS_LOW_MARK_EMPTY 0x00000010 #define PFIFO_CACHE0_STATUS_HIGH_MARK_NOT_FULL 0x00000000 #define PFIFO_CACHE0_STATUS_HIGH_MARK_FULL 0x00000100 #define PFIFO_CACHE1_STATUS 0x00003214 #define PFIFO_CACHE1_STATUS_LOW_MARK_NOT_EMPTY 0x00000000 #define PFIFO_CACHE1_STATUS_LOW_MARK_EMPTY 0x00000010 #define PFIFO_CACHE1_STATUS_HIGH_MARK_NOT_FULL 0x00000000 #define PFIFO_CACHE1_STATUS_HIGH_MARK_FULL 0x00000100 #define PFIFO_CACHE1_STATUS1 0x00003218 #define PFIFO_CACHE1_STATUS1_RANOUT_FALSE 0x00000000 #define PFIFO_CACHE1_STATUS1_RANOUT_TRUE 0x00000001 #define PFIFO_CACHE0_PUT 0x00003010 #define PFIFO_CACHE1_PUT 0x00003210 #define PFIFO_CACHE0_GET 0x00003070 #define PFIFO_CACHE1_GET 0x00003270 #define PFIFO_CACHE0_ENGINE 0x00003080 #define PFIFO_CACHE0_ENGINE_0_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_0_GRAPHICS 0x00000001 #define PFIFO_CACHE0_ENGINE_0_DVD 0x00000002 #define PFIFO_CACHE0_ENGINE_1_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_1_GRAPHICS 0x00000010 #define PFIFO_CACHE0_ENGINE_1_DVD 0x00000020 #define PFIFO_CACHE0_ENGINE_2_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_2_GRAPHICS 0x00000100 #define PFIFO_CACHE0_ENGINE_2_DVD 0x00000200 #define PFIFO_CACHE0_ENGINE_3_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_3_GRAPHICS 0x00001000 #define PFIFO_CACHE0_ENGINE_3_DVD 0x00002000 #define PFIFO_CACHE0_ENGINE_4_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_4_GRAPHICS 0x00010000 #define PFIFO_CACHE0_ENGINE_4_DVD 0x00020000 #define PFIFO_CACHE0_ENGINE_5_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_5_GRAPHICS 0x00100000 #define PFIFO_CACHE0_ENGINE_5_DVD 0x00200000 #define PFIFO_CACHE0_ENGINE_6_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_6_GRAPHICS 0x01000000 #define PFIFO_CACHE0_ENGINE_6_DVD 0x02000000 #define PFIFO_CACHE0_ENGINE_7_SW 0x00000000 #define PFIFO_CACHE0_ENGINE_7_GRAPHICS 0x10000000 #define PFIFO_CACHE0_ENGINE_7_DVD 0x20000000 #define PFIFO_CACHE1_ENGINE 0x00003280 #define PFIFO_CACHE1_ENGINE_0_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_0_GRAPHICS 0x00000001 #define PFIFO_CACHE1_ENGINE_0_DVD 0x00000002 #define PFIFO_CACHE1_ENGINE_1_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_1_GRAPHICS 0x00000010 #define PFIFO_CACHE1_ENGINE_1_DVD 0x00000020 #define PFIFO_CACHE1_ENGINE_2_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_2_GRAPHICS 0x00000100 #define PFIFO_CACHE1_ENGINE_2_DVD 0x00000200 #define PFIFO_CACHE1_ENGINE_3_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_3_GRAPHICS 0x00001000 #define PFIFO_CACHE1_ENGINE_3_DVD 0x00002000 #define PFIFO_CACHE1_ENGINE_4_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_4_GRAPHICS 0x00010000 #define PFIFO_CACHE1_ENGINE_4_DVD 0x00020000 #define PFIFO_CACHE1_ENGINE_5_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_5_GRAPHICS 0x00100000 #define PFIFO_CACHE1_ENGINE_5_DVD 0x00200000 #define PFIFO_CACHE1_ENGINE_6_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_6_GRAPHICS 0x01000000 #define PFIFO_CACHE1_ENGINE_6_DVD 0x02000000 #define PFIFO_CACHE1_ENGINE_7_SW 0x00000000 #define PFIFO_CACHE1_ENGINE_7_GRAPHICS 0x10000000 #define PFIFO_CACHE1_ENGINE_7_DVD 0x20000000 #define PFIFO_CACHE0_METHOD 0x00003100 #define PFIFO_CACHE0_METHOD_ADDRESS_MSK 0x00001FFC #define PFIFO_CACHE0_METHOD_SUBCHANNEL_MSK 0x0000E000 #define PFIFO_CACHE1_METHOD 0x00003800 #define PFIFO_CACHE1_METHOD_ADDRESS_MSK 0x00001FFC #define PFIFO_CACHE1_METHOD_SUBCHANNEL_MSK 0x0000E000 #define PFIFO_CACHE1_METHOD_ALIAS 0x00003C00 #define PFIFO_CACHE0_DATA 0x00003104 #define PFIFO_CACHE1_DATA 0x00003804 #define PFIFO_CACHE1_DATA_ALIAS 0x00003C04 #define PFIFO_DEVICE 0x00002800 #define PFIFO_DEVICE_CHID_MSK 0x0000001F #define PFIFO_DEVICE_SWITCH 0x01000000 #define PFIFO_DEVICE_SWITCH_UNAVAILABLE 0x00000000 #define PFIFO_DEVICE_SWITCH_AVAILABLE 0x01000000 #define PFIFO_RUNOUT_STATUS 0x00002400 #define PFIFO_RUNOUT_STATUS_RANOUT_FALSE 0x00000000 #define PFIFO_RUNOUT_STATUS_RANOUT_TRUE 0x00000001 #define PFIFO_RUNOUT_STATUS_LOW_MARK_NOT_EMPTY 0x00000000 #define PFIFO_RUNOUT_STATUS_LOW_MARK_EMPTY 0x00000010 #define PFIFO_RUNOUT_STATUS_HIGH_MARK_NOT_FULL 0x00000000 #define PFIFO_RUNOUT_STATUS_HIGH_MARK_FULL 0x00000100 #define PFIFO_RUNOUT_PUT 0x00002410 #define PFIFO_RUNOUT_PUT_ADDRES_MSK 0x00001FF8 #define PFIFO_RUNOUT_GET 0x00002420 #define PFIFO_RUNOUT_GET_ADDRESS_MSK 0x00003FF8 /* PVIDEO */ #define PVIDEO 0x00008000 #define PVIDEO_DEBUG_0 0x00008080 #define PVIDEO_DEBUG_0_HLF_RATE_ROW_RD_DISABLED 0x00000000 #define PVIDEO_DEBUG_0_HLF_RATE_ROW_RD_ENABLED 0x00000001 #define PVIDEO_DEBUG_0_LIMIT_CHECK_DISABLED 0x00000000 #define PVIDEO_DEBUG_0_LIMIT_CHECK_ENABLED 0x00000010 #define PVIDEO_DEBUG_0_HUE_FOLD_DISABLED 0x00000000 #define PVIDEO_DEBUG_0_HUE_FOLD_ENABLED 0x00000100 #define PVIDEO_DEBUG_1 0x00008084 #define PVIDEO_DEBUG_1_REQ_DELAY_MSK 0x000007FF #define PVIDEO_DEBUG_1_REQ_DELAY_DEFAULT 0x00000064 #define PVIDEO_DEBUG_1_REQ_DELAY_INIT 0x00000050 #define PVIDEO_DEBUG_2 0x00008088 #define PVIDEO_DEBUG_2_BURST1_MSK 0x000007E0 #define PVIDEO_DEBUG_2_BURST1_DEFAULT 0x00000100 #define PVIDEO_DEBUG_2_BURST1_INIT 0x00000200 #define PVIDEO_DEBUG_2_BURST2_MSK 0x07E00000 #define PVIDEO_DEBUG_2_BURST2_DEFAULT 0x02000000 #define PVIDEO_DEBUG_3 0x0000808C #define PVIDEO_DEBUG_3_WATER_MARK1_MSK 0x000007F0 #define PVIDEO_DEBUG_3_WATER_MARK1_DEFAULT 0x000004B0 #define PVIDEO_DEBUG_3_WATER_MARK1_INIT 0x00000400 #define PVIDEO_DEBUG_3_WATER_MARK2_MSK 0x07F00000 #define PVIDEO_DEBUG_3_WATER_MARK2_DEFAULT 0x03B00000 #define PVIDEO_DEBUG_3_WATER_MARK2_INIT 0x04000000 #define PVIDEO_DEBUG_4 0x00008090 #define PVIDEO_DEBUG_4_V_COEFF_B_MSK 0x00FFFFE0 #define PVIDEO_DEBUG_4_V_COEFF_B_DEFAULT 0x0016A0A0 #define PVIDEO_DEBUG_4_V_COEFF_B_ALWAYS 0x00000000 #define PVIDEO_DEBUG_4_V_COEFF_B_NEVER 0x00FFFFE0 #define PVIDEO_DEBUG_5 0x00008094 #define PVIDEO_DEBUG_5_H_L_COEFF_D_MSK 0x003FFFF0 #define PVIDEO_DEBUG_5_H_L_COEFF_D_DEFAULT 0x00188160 #define PVIDEO_DEBUG_5_H_L_COEFF_D_ALWAYS 0x00000000 #define PVIDEO_DEBUG_5_H_L_COEFF_D_NEVER 0x003FFFF0 #define PVIDEO_DEBUG_6 0x00008098 #define PVIDEO_DEBUG_6_H_L_COEFF_C_MSK 0x003FFFF0 #define PVIDEO_DEBUG_6_H_L_COEFF_C_DEFAULT 0x0012C730 #define PVIDEO_DEBUG_6_H_L_COEFF_C_ALWAYS 0x00000000 #define PVIDEO_DEBUG_6_H_L_COEFF_C_NEVER 0x003FFFF0 #define PVIDEO_DEBUG_7 0x0000809C #define PVIDEO_DEBUG_7_H_L_COEFF_B_MSK 0x003FFFF0 #define PVIDEO_DEBUG_7_H_L_COEFF_B_DEFAULT 0x00000000 #define PVIDEO_DEBUG_7_H_L_COEFF_B_ALWAYS 0x00000000 #define PVIDEO_DEBUG_7_H_L_COEFF_B_NEVER 0x003FFFF0 #define PVIDEO_DEBUG_8 0x000080A0 #define PVIDEO_DEBUG_8_PIPE_FILL_MSK 0x000007F0 #define PVIDEO_DEBUG_8_PIPE_FILL_DEFAULT 0x000000B0 #define PVIDEO_DEBUG_9 0x000080A4 #define PVIDEO_DEBUG_9_FIFO_A_UNDERFLOW_FALSE 0x00000000 #define PVIDEO_DEBUG_9_FIFO_A_UNDERFLOW_TRUE 0x00000001 #define PVIDEO_DEBUG_9_FIFO_A_UNDERFLOW_RESET 0x00000001 #define PVIDEO_DEBUG_9_FIFO_A_OVERFLOW_FALSE 0x00000000 #define PVIDEO_DEBUG_9_FIFO_A_OVERFLOW_TRUE 0x00000010 #define PVIDEO_DEBUG_9_FIFO_A_OVERFLOW_RESET 0x00000010 #define PVIDEO_DEBUG_9_FIFO_B_UNDERFLOW_FALSE 0x00000000 #define PVIDEO_DEBUG_9_FIFO_B_UNDERFLOW_TRUE 0x00000100 #define PVIDEO_DEBUG_9_FIFO_B_UNDERFLOW_RESET 0x00000100 #define PVIDEO_DEBUG_9_FIFO_B_OVERFLOW_FALSE 0x00000000 #define PVIDEO_DEBUG_9_FIFO_B_OVERFLOW_TRUE 0x00001000 #define PVIDEO_DEBUG_9_FIFO_B_OVERFLOW_RESET 0x00001000 #define PVIDEO_DEBUG_10 0x000080A8 #define PVIDEO_DEBUG_10_SCREEN_LINE_MSK 0x00001FFF #define PVIDEO_DEBUG_10_SCREEN_LINE_FIRST 0x00000000 #define PVIDEO_DEBUG_10_SCAN_COUNT_MSK 0x001F0000 #define PVIDEO_DEBUG_10_SCAN_COUNT_FIRST 0x00000000 #define PVIDEO_DEBUG_10_SCAN_COUNT_OVERFLOW 0x00100000 #define PVIDEO_DEBUG_10_SCANNING_NEITHER 0x00000000 #define PVIDEO_DEBUG_10_SCANNING_BUFFER_0 0x02000000 #define PVIDEO_DEBUG_10_SCANNING_BUFFER_1 0x03000000 #define PVIDEO_INTR 0x00008100 #define PVIDEO_INTR_BUFFER_0_NOT_PENDING 0x00000000 #define PVIDEO_INTR_BUFFER_0_PENDING 0x00000001 #define PVIDEO_INTR_BUFFER_0_RESET 0x00000001 #define PVIDEO_INTR_BUFFER_1_NOT_PENDING 0x00000000 #define PVIDEO_INTR_BUFFER_1_PENDING 0x00000010 #define PVIDEO_INTR_BUFFER_1_RESET 0x00000010 #define PVIDEO_INTR_REASON 0x00008104 #define PVIDEO_INTR_REASON_BUFFER_0_NOTIFICATION 0x00000000 #define PVIDEO_INTR_REASON_BUFFER_0_PROTECTION_FAULT 0x00000001 #define PVIDEO_INTR_REASON_BUFFER_1_NOTIFICATION 0x00000000 #define PVIDEO_INTR_REASON_BUFFER_1_PROTECTION_FAULT 0x00000010 #define PVIDEO_INTR_EN 0x00008140 #define PVIDEO_INTR_EN_BUFFER_0_DISABLED 0x00000000 #define PVIDEO_INTR_EN_BUFFER_0_ENABLED 0x00000001 #define PVIDEO_INTR_EN_BUFFER_1_DISABLED 0x00000000 #define PVIDEO_INTR_EN_BUFFER_1_ENABLED 0x00000010 #define PVIDEO_BUFFER 0x00008700 #define PVIDEO_BUFFER_0_USE_NOT_PENDING 0x00000000 #define PVIDEO_BUFFER_0_USE_PENDING 0x00000001 #define PVIDEO_BUFFER_0_USE_SET 0x00000001 #define PVIDEO_BUFFER_1_USE_NOT_PENDING 0x00000000 #define PVIDEO_BUFFER_1_USE_PENDING 0x00000010 #define PVIDEO_BUFFER_1_USE_SET 0x00000010 #define PVIDEO_STOP 0x00008704 #define PVIDEO_STOP_OVERLAY_INACTIVE 0x00000000 #define PVIDEO_STOP_OVERLAY_ACTIVE 0x00000001 #define PVIDEO_STOP_METHOD_IMMEDIATELY 0x00000000 #define PVIDEO_STOP_METHOD_NORMALLY 0x00000010 #define PVIDEO_UVBASE_0 0x00008800 #define PVIDEO_UVBASE_1 0x00008804 #define PVIDEO_UVBASE_MSK 0xFFFFFFC0 #define PVIDEO_UVLIMIT_0 0x00008808 #define PVIDEO_UVLIMIT_1 0x0000880C #define PVIDEO_UVOFFSET_0 0x00008820 #define PVIDEO_UVOFFSET_1 0x00008824 #define PVIDEO_UVOFFSET_MSK 0xFFFFFFC0 #define PVIDEO_BASE_0 0x00008900 #define PVIDEO_BASE_1 0x00008904 #define PVIDEO_BASE_MSK 0xFFFFFFC0 #define PVIDEO_LIMIT_0 0x00008908 #define PVIDEO_LIMIT_1 0x0000890C #define PVIDEO_LUMINANCE_0 0x00008910 #define PVIDEO_LUMINANCE_1 0x00008914 #define PVIDEO_CHROMINANCE_0 0x00008918 #define PVIDEO_CHROMINANCE_1 0x0000891C #define PVIDEO_OFFSET_0 0x00008920 #define PVIDEO_OFFSET_1 0x00008924 #define PVIDEO_OFFSET_MSK 0xFFFFFFC0 #define PVIDEO_SIZE_IN_0 0x00008928 #define PVIDEO_SIZE_IN_1 0x0000892C #define PVIDEO_SIZE_IN_WIDTH_MSK 0x000007FF #define PVIDEO_SIZE_IN_HEIGHT_MSK 0x07FF0000 #define PVIDEO_POINT_IN_0 0x00008930 #define PVIDEO_POINT_IN_1 0x00008934 #define PVIDEO_POINT_IN_S_MSK 0x00007FFF #define PVIDEO_POINT_IN_T_MSK 0xFFFE0000 #define PVIDEO_DS_DX_0 0x00008938 #define PVIDEO_DS_DX_1 0x0000893C #define PVIDEO_DT_DY_0 0x00008940 #define PVIDEO_DT_DY_1 0x00008944 #define PVIDEO_POINT_OUT_0 0x00008948 #define PVIDEO_POINT_OUT_1 0x0000894C #define PVIDEO_POINT_OUT_X_MSK 0x00000FFF #define PVIDEO_POINT_OUT_Y_MSK 0x0FFF0000 #define PVIDEO_SIZE_OUT_0 0x00008950 #define PVIDEO_SIZE_OUT_1 0x00008954 #define PVIDEO_SIZE_OUT_WIDTH_MSK 0x00000FFF #define PVIDEO_SIZE_OUT_HEIGHT_MSK 0x0FFF0000 #define PVIDEO_FORMAT_0 0x00008958 #define PVIDEO_FORMAT_1 0x0000895C #define PVIDEO_FORMAT_PLANAR_NV 0x00000001 #define PVIDEO_FORMAT_PITCH_MSK 0x00001FC0 #define PVIDEO_FORMAT_COLOR_YB8CR8YA8CB8 0x00000000 #define PVIDEO_FORMAT_COLOR_CR8YB8CB8YA8 0x00010000 #define PVIDEO_FORMAT_COLOR_ECR8EYB8ECB8EYA8 0x00110000 #define PVIDEO_FORMAT_DISPLAY_ALWAYS 0x00000000 #define PVIDEO_FORMAT_DISPLAY_COLOR_KEY_EQUAL 0x00100000 #define PVIDEO_FORMAT_MATRIX_ITURBT601 0x00000000 #define PVIDEO_FORMAT_MATRIX_ITURBT709 0x01000000 #define PVIDEO_COLOR_KEY 0x00008B00 #define PVIDEO_TEST 0x00008D00 #define PVIDEO_TEST_MODE_DISABLE 0x00000000 #define PVIDEO_TEST_MODE_ENABLE 0x00000001 #define PVIDEO_TEST_ADDRESS_MSK 0x00007F00 /* Array [0...11] */ #define PVIDEO_TST_WRITE 0x00008D10 /* Array [0...11] */ #define PVIDEO_TST_READ 0x00008D40 /* PTIMER */ #define PTIMER 0x00009000 /* PVIO */ #define PVIO 0x000C0000 #define PVIO_SEQ_INDEX 0x000C03C4 #define PVIO_SEQ_DATA 0x000C03C5 #define PVIO_GRA_INDEX 0x000C03CE #define PCIO_GRA_DATA 0x000C03CF /* PVGA */ #define PVGA 0x000A0000 /* PFB */ #define PFB 0x00100000 #define PFB_BOOT_0 0x00100000 #define PFB_BOOT_0_RAM_AMOUNT_32MB 0x00000000 #define PFB_BOOT_0_RAM_AMOUNT_4MB 0x00000001 #define PFB_BOOT_0_RAM_AMOUNT_8MB 0x00000002 #define PFB_BOOT_0_RAM_AMOUNT_16MB 0x00000003 #define PFB_BOOT_0_RAM_WIDTH_128 0x00000004 #define PFB_BOOT_0_RAM_TYPE_SGRAM_8MBIT 0x00000000 #define PFB_BOOT_0_RAM_TYPE_SGRAM_16MBIT 0x00000008 #define PFB_BOOT_0_RAM_TYPE_SGRAM_16MBIT_4BANK 0x00000010 #define PFB_BOOT_0_RAM_TYPE_SDRAM_16MBIT 0x00000018 #define PFB_BOOT_0_RAM_TYPE_SDRAM_64MBIT 0x00000020 #define PFB_BOOT_0_RAM_TYPE_SDRAM_64MBITX16 0x00000028 /* PEXTDEV */ #define PEXTDEV 0x00101000 /* PGRAPH */ #define PGRAPH 0x00400000 #define PGRAPH_DEBUG_0 0x00400080 #define PGRAPH_DEBUG_1 0x00400084 #define PGRAPH_DEBUG_2 0x00400088 #define PGRAPH_DEBUG_3 0x0040008C #define PGRAPH_DEBUG_4 0x00400090 #define PGRAPH_DEBUG_5 0x00400094 #define PGRAPH_DEBUG_6 0x00400820 #define PGRAPH_INTR 0x00400100 #define PGRAPH_NSTATUS 0x00400104 #define PGRAPH_NSOURCE 0x00400108 #define PGRAPH_INTR_EN 0x00400140 #define PGRAPH_FIFO 0x00400720 #define PGRAPH_FIFO_ACCESS_DISABLED 0x00000000 #define PGRAPH_FIFO_ACCESS_ENABLED 0x00000001 #define PGRAPH_STATUS 0x00400700 #define PGRAPH_STATUS_STATE_IDLE 0x00000000 #define PGRAPH_STATUS_STATE_BUSY 0x00000001 #define PGRAPH_STATUS_FINE_RASTERIZER_IDLE 0x00000000 #define PGRAPH_STATUS_FINE_RASTERIZER_BUSY 0x00000002 #define PGRAPH_STATUS_COARSE_RASTERIZER_IDLE 0x00000000 #define PGRAPH_STATUS_COARSE_RASTERIZER_BUSY 0x00000004 #define PGRAPH_STATUS_FE_3D_IDLE 0x00000000 #define PGRAPH_STATUS_FE_3D_BUSY 0x00000008 #define PGRAPH_STATUS_FE_2D_IDLE 0x00000000 #define PGRAPH_STATUS_FE_2D_BUSY 0x00000010 #define PGRAPH_STATUS_XY_LOGIC_IDLE 0x00000000 #define PGRAPH_STATUS_XY_LOGIC_BUSY 0x00000020 #define PGRAPH_STATUS_RASTERIZER_2D_IDLE 0x00000000 #define PGRAPH_STATUS_RASTERIZER_2D_BUSY 0x00000080 #define PGRAPH_STATUS_IDX_IDLE 0x00000000 #define PGRAPH_STATUS_IDX_BUSY 0x00000100 #define PGRAPH_STATUS_XF_IDLE 0x00000000 #define PGRAPH_STATUS_XF_BUSY 0x00000200 #define PGRAPH_STATUS_VTX_IDLE 0x00000000 #define PGRAPH_STATUS_VTX_BUSY 0x00000400 #define PGRAPH_STATUS_CAS_IDLE 0x00000000 #define PGRAPH_STATUS_CAS_BUSY 0x00000800 #define PGRAPH_STATUS_PORT_NOTIFY_IDLE 0x00000000 #define PGRAPH_STATUS_PORT_NOTIFY_BUSY 0x00001000 #define PGRAPH_STATUS_SHADER_IDLE 0x00000000 #define PGRAPH_STATUS_SHADER_BUSY 0x00002000 #define PGRAPH_STATUS_SHADER_BE_IDLE 0x00000000 #define PGRAPH_STATUS_SHADER_BE_BUSY 0x00004000 #define PGRAPH_STATUS_PORT_DMA_IDLE 0x00000000 #define PGRAPH_STATUS_PORT_DMA_BUSY 0x00010000 #define PGRAPH_STATUS_DMA_ENGINE_IDLE 0x00000000 #define PGRAPH_STATUS_DMA_ENGINE_BUSY 0x00020000 #define PGRAPH_STATUS_DMA_NOTIFY_IDLE 0x00000000 #define PGRAPH_STATUS_DMA_NOTIFY_BUSY 0x00100000 #define PGRAPH_STATUS_DMA_BUFFER_NOTIFY_IDLE 0x00000000 #define PGRAPH_STATUS_DMA_BUFFER_NOTIFY_BUSY 0x00200000 #define PGRAPH_STATUS_DMA_WARNING_NOTIFY_IDLE 0x00000000 #define PGRAPH_STATUS_DMA_WARNING_NOTIFY_BUSY 0x00400000 #define PGRAPH_STATUS_ZCULL_IDLE 0x00000000 #define PGRAPH_STATUS_ZCULL_BUSY 0x00800000 #define PGRAPH_STATUS_FDIFF_IDLE 0x00000000 #define PGRAPH_STATUS_FDIFF_BUSY 0x01000000 #define PGRAPH_STATUS_SETUP_IDLE 0x00000000 #define PGRAPH_STATUS_SETUP_BUSY 0x02000000 #define PGRAPH_STATUS_CACHE_IDLE 0x00000000 #define PGRAPH_STATUS_CACHE_BUSY 0x04000000 #define PGRAPH_STATUS_COMBINER_IDLE 0x00000000 #define PGRAPH_STATUS_COMBINER_BUSY 0x08000000 #define PGRAPH_STATUS_PREROP_IDLE 0x00000000 #define PGRAPH_STATUS_PREROP_BUSY 0x10000000 #define PGRAPH_STATUS_ROP_IDLE 0x00000000 #define PGRAPH_STATUS_ROP_BUSY 0x20000000 #define PGRAPH_STATUS_PORT_USER_IDLE 0x00000000 #define PGRAPH_STATUS_PORT_USER_BUSY 0x40000000 #define PGRAPH_STATUS_PORT_FB_IDLE 0x00000000 #define PGRAPH_STATUS_PORT_FB_BUSY 0x80000000 #define NV10_PGRAPH_WINDOWCLIP_HORIZONTAL 0x00400F00 #define NV10_PGRAPH_WINDOWCLIP_VERTICAL 0x00400F20 #define NV10_PGRAPH_XFMODE0 0x00400F40 #define NV10_PGRAPH_XFMODE1 0x00400F44 #define NV10_PGRAPH_GLOBALSTATE0 0x00400F48 #define NV10_PGRAPH_GLOBALSTATE1 0x00400F4C #define NV10_PGRAPH_PIPE_ADDRESS 0x00400F50 #define NV10_PGRAPH_PIPE_DATA 0x00400F54 /* PCRTC */ #define PCRTC 0x00600000 #define PCRTC_INTR 0x00600100 #define PCRTC_INTR_VBLANK_RESET 0x00000001 #define PCRTC_INTR_EN 0x00600140 #define PCRTC_INTR_EN_VBLANK_DISABLED 0x00000000 #define PCRTC_INTR_EN_VBLANK_ENABLED 0x00000001 #define PCRTC_START 0x00600800 #define PCRTC_CONFIG 0x00600804 #define PCRTC_CONFIG_SIGNAL_VGA 0x00000000 #define PCRTC_CONFIG_SIGNAL_NON_VGA 0x00000001 #define PCRTC_CONFIG_SIGNAL_HSYNC 0x00000002 #define PCRTC_CONFIG_ENDIAN 0x80000000 #define PCRTC_CONFIG_ENDIAN_LITTLE 0x00000000 #define PCRTC_CONFIG_ENDIAN_BIG 0x80000000 #define PCRTC_RASTER 0x00600808 #define PCRTC_RASTER_POSITION_MSK 0x000007FF #define PCRTC_RASTER_SA_LOAD_DISPLAY 0x00000000 #define PCRTC_RASTER_SA_LOAD_BEFORE 0x00001000 #define PCRTC_RASTER_SA_LOAD_AFTER 0x00002000 #define PCRTC_RASTER_VERT_BLANK_ACTIVE 0x00010000 #define PCRTC_RASTER_VERT_BLANK_INACTIVE 0x00000000 #define PCRTC_RASTER_FIELD_EVEN 0x00000000 #define PCRTC_RASTER_FIELD_ODD 0x00100000 #define PCRTC_RASTER_STEREO_LEFT 0x00000000 #define PCRTC_RASTER_STEREO_RIGHT 0x01000000 /* PCRTC2 */ #define PCRTC2 0x00600800 #define PCRTC2_INTR 0x00600900 #define PCRTC2_INTR_VBLANK_RESET 0x00000001 #define PCRTC2_INTR_EN 0x00600940 #define PCRTC2_INTR_EN_VBLANK_DISABLED 0x00000000 #define PCRTC2_INTR_EN_VBLANK_ENABLED 0x00000001 #define PCRTC2_START 0x00601000 #define PCRTC2_CONFIG 0x00601004 #define PCRTC2_CONFIG_SIGNAL_VGA 0x00000000 #define PCRTC2_CONFIG_SIGNAL_NON_VGA 0x00000001 #define PCRTC2_CONFIG_SIGNAL_HSYNC 0x00000002 #define PCRTC2_CONFIG_ENDIAN 0x80000000 #define PCRTC2_CONFIG_ENDIAN_LITTLE 0x00000000 #define PCRTC2_CONFIG_ENDIAN_BIG 0x80000000 #define PCRTC2_RASTER 0x00601008 #define PCRTC2_RASTER_POSITION_MSK 0x000007FF #define PCRTC2_RASTER_SA_LOAD_DISPLAY 0x00000000 #define PCRTC2_RASTER_SA_LOAD_BEFORE 0x00001000 #define PCRTC2_RASTER_SA_LOAD_AFTER 0x00002000 #define PCRTC2_RASTER_VERT_BLANK_ACTIVE 0x00010000 #define PCRTC2_RASTER_VERT_BLANK_INACTIVE 0x00000000 #define PCRTC2_RASTER_FIELD_EVEN 0x00000000 #define PCRTC2_RASTER_FIELD_ODD 0x00100000 #define PCRTC2_RASTER_STEREO_LEFT 0x00000000 #define PCRTC2_RASTER_STEREO_RIGHT 0x01000000 /* PCIO */ #define PCIO 0x00601000 #define PCIO_ATTR_INDEX 0x006013C0 #define PCIO_ATTR_DATA 0x006013C1 #define PCIO_CRTC_INDEX 0x006013D4 #define PCIO_CRTC_DATA 0x006013D5 /* CRTC Registers */ #define CRTC_HORIZ_TOTAL 0x00 #define CRTC_HORIZ_DISPLAY_END 0x01 #define CRTC_HORIZ_BLANK_START 0x02 #define CRTC_HORIZ_BLANK_END 0x03 #define CRTC_HORIZ_RETRACE_START 0x04 #define CRTC_HORIZ_RETRACE_END 0x05 #define CRTC_VERT_TOTAL 0x06 #define CRTC_OVERFLOW 0x07 #define CRTC_PRESET_ROW_SCAN 0x08 #define CRTC_MAX_SCAN_LINE 0x09 #define CRTC_CURSOR_START 0x0A #define CRTC_CURSOR_END 0x0B #define CRTC_START_ADDR_HIGH 0x0C #define CRTC_START_ADDR_LOW 0x0D #define CRTC_CURSOR_LOCATION_HIGH 0x0E #define CRTC_CURSOR_LOCATION_LOW 0x0F #define CRTC_VERT_RETRACE_START 0x10 #define CRTC_VERT_RETRACE_END 0x11 #define CRTC_VERT_DISPLAY_END 0x12 #define CRTC_OFFSET 0x13 #define CRTC_UNDERLINE_LOCATION 0x14 #define CRTC_VERT_BLANK_START 0x15 #define CRTC_VERT_BLANK_END 0x16 #define CRTC_MODE_CONTROL 0x17 #define CRTC_LINE_COMPARE 0x18 #define CRTC_REPAINT0 0x19 #define CRTC_HORIZ_EXTRA 0x2d #define CRTC_EXTRA 0x25 #define CRTC_FIFO_CONTROL 0x1b #define CRTC_FIFO 0x20 #define CRTC_REPAINT1 0x1a #define CRTC_GRCURSOR0 0x30 #define CRTC_GRCURSOR1 0x31 #define CRTC_PIXEL 0x28 #define PCIO_CRTC_STATUS 0x006013DA /* PRAMDAC */ #define PRAMDAC 0x00680000 /* PDIO */ #define PDIO 0x00681000 /* PRAMIN */ #define PRAMIN 0x00700000 /* PRAMHT */ #define PRAMHT 0x00710000 /*************************** FIFO Registers ******************************/ #define FIFO_ADDRESS 0x00800000 #define FIFO_FREE 0x00800010 #define DMA_PUT 0x00800040 #define DMA_GET 0x00800044 /* * Generic subchannel registers */ #define SET_OBJECT 0x00000000 /* * 2D surfaces */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextDmaSource; /* 0184-0187 */ u32 SetContextDmaDestin; /* 0188-018B */ u32 Reserved01[0x05D]; u32 Format; /* 0300-0303 */ u32 Pitch; /* 0304-0307 */ u32 SourceOffset; /* 0308-030B */ u32 DestOffset; /* 030C-030F */ u32 Reserved02[0x73C]; } NVSurfaces2D; #define SURFACES2D_FORMAT 0x00000300 #define SURFACES2D_FORMAT_Y8 0x00000001 #define SURFACES2D_FORMAT_X1R5G5B5 0x00000002 #define SURFACES2D_FORMAT_A1R5G5B5 0x00000003 #define SURFACES2D_FORMAT_R5G6B5 0x00000004 #define SURFACES2D_FORMAT_Y16 0x00000005 #define SURFACES2D_FORMAT_X8R8G8B8 0x00000006 #define SURFACES2D_FORMAT_A8R8G8B8 0x0000000A #define SURFACES2D_FORMAT_Y32 0x0000000B #define SURFACES2D_PITCH 0x00000304 #define SURFACES2D_SRC_OFFSET 0x00000308 #define SURFACES2D_DST_OFFSET 0x0000030C /* * 3D surfaces */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextDmaColor; /* 0184-0187 */ u32 SetContextDmaZeta; /* 0188-018B */ u32 Reserved01[0x05B]; u32 ClipHorizontal; /* 02F8-02FB */ u32 ClipVertical; /* 02FC-02FF */ u32 Format; /* 0300-0303 */ u32 ClipSize; /* 0304-0307 */ u32 Pitch; /* 0308-030B */ u32 RenderOffset; /* 030C-030F */ u32 DepthOffset; /* 0310-0313 */ u32 Reserved02[0x73B]; } NVSurfaces3D; #define SURFACES3D_CLIP_HORIZONTAL 0x000002F8 #define SURFACES3D_CLIP_VERTICAL 0x000002FC #define SURFACES3D_FORMAT 0x00000300 #define SURFACES3D_FORMAT_COLOR_A1R5G5B5 0x00000001 #define SURFACES3D_FORMAT_COLOR_X1R5G5B5 0x00000002 #define SURFACES3D_FORMAT_COLOR_R5G6B5 0x00000003 #define SURAFCES3D_FORMAT_COLOR_X8R8G8B8 0x00000006 #define SURFACES3D_FORMAT_COLOR_A8R8G8B8 0x00000008 #define SURFACES3D_FORMAT_TYPE_PITCH 0x00000100 #define SURFACES3D_FORMAT_TYPE_SWIZZLE 0x00000200 #define SURFACES3D_CLIP_SIZE 0x00000304 #define SURFACES3D_PITCH 0x00000308 #define SURFACES3D_RENDER_OFFSET 0x0000030C #define SURFACES3D_DEPTH_OFFSET 0x00000310 /* * Scissor clip rectangle */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextDmaImage; /* 0184-0187 */ u32 Reserved01[0x05E]; u32 TopLeft; /* 0300-0303 */ u32 WidthHeight; /* 0304-0307 */ u32 Reserved02[0x73E]; } NVClip; #define CLIP_TOP_LEFT 0x00000300 #define CLIP_WIDTH_HEIGHT 0x00000304 /* * Global alpha factor */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 Reserved01[0x05F]; u32 SetBeta1D31; /* 0300-0303 */ u32 Reserved02[0x73F]; } NVBeta1; #define BETA1_FACTOR 0x00000300 /* * Global ARGB factor */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 Reserved01[0x05F]; u32 SetBetaFactor; /* 0300-0303 */ u32 Reserved02[0x73F]; } NVBeta4; #define BETA4_FACTOR 0x00000300 /* * Generic Flags */ /* Operation */ #define OPERATION_COPY 0 #define OPERATION_ROP 1 #define OPERATION_BLEND 2 #define OPERATION_SRCCOPY 3 #define OPERATION_COLOR_MULTIPLY 4 #define OPERATION_BLEND_PREMULTIPLIED 5 /* ColorConversion */ #define COLOR_CONVERSION_DITHER 0 #define COLOR_CONVERSION_TRUNCATE 1 #define COLOR_CONVERSION_SUBTR_TRUNCATE 2 /* * 2D solid rectangle */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextClip; /* 0184-0187 */ u32 SetContextPattern; /* 0188-018B */ u32 SetContextRop; /* 018C-018F */ u32 SetContextBeta1; /* 0190-0193 */ u32 SetContextSurface; /* 0194-0197 */ u32 Reserved01[0x059]; u32 SetOperation; /* 02FC-02FF */ u32 SetColorFormat; /* 0300-0303 */ u32 Color; /* 0304-0307 */ u32 Reserved02[0x03E]; u32 TopLeft; /* 0400-0403 */ u32 WidthHeight; /* 0404-0407 */ u32 Reserved03[0x6FE]; } NVRectangle; #define RECT_OPERATION 0x000002FC #define RECT_COLOR_FORMAT 0x00000300 #define RECT_COLOR_FORMAT_Y16 0x00000001 #define RECT_COLOR_FORMAT_A1Y15 0x00000002 #define RECT_COLOR_FORMAT_Y32 0x00000003 #define RECT_COLOR 0x00000304 #define RECT_TOP_LEFT 0x00000400 #define RECT_WIDTH_HEIGHT 0x00000404 /* * 2D solid triangle */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextClip; /* 0184-0187 */ u32 SetContextPattern; /* 0188-018B */ u32 SetContextRop; /* 018C-018F */ u32 SetContextBeta1; /* 0190-0193 */ u32 SetContextSurface; /* 0194-0197 */ u32 Reserved01[0x059]; u32 SetOperation; /* 02FC-02FF */ u32 SetColorFormat; /* 0300-0303 */ u32 Color; /* 0304-0307 */ u32 Reserved02[0x002]; u32 TrianglePoint0; /* 0310-0313 */ u32 TrianglePoint1; /* 0314-0317 */ u32 TrianglePoint2; /* 0318-031B */ u32 Reserved03[0x001]; s32 Triangle32Point0X; /* 0320-0323 */ s32 Triangle32Point0Y; /* 0324-0327 */ s32 Triangle32Point1X; /* 0328-032B */ s32 Triangle32Point1Y; /* 032C-032F */ s32 Triangle32Point2X; /* 0330-0333 */ s32 Triangle32Point2Y; /* 0334-0337 */ u32 Reserved04[0x032]; u32 Trimesh[32]; /* 0400-047F */ struct { /* 0480- */ s32 x; /* 0- 3 */ s32 y; /* 4- 7 */ } Trimesh32[16]; /* -04FF */ struct { /* 0500- */ u32 color; /* 0- 3 */ u32 point0; /* 4- 7 */ u32 point1; /* 8- B */ u32 point2; /* C- F */ } ColorTriangle[8]; /* -057F */ struct { /* 0580- */ u32 color; /* 0- 3 */ u32 point; /* 4- 7 */ } ColorTrimesh[16]; /* -05FF */ u32 Reserved05[0x680]; } NVTriangle; #define TRI_OPERATION 0x000002FC #define TRI_COLOR_FORMAT 0x00000300 #define TRI_COLOR_FORMAT_Y16 0x00000001 #define TRI_COLOR_FORMAT_A1Y15 0x00000002 #define TRI_COLOR_FORMAT_Y32 0x00000003 #define TRI_COLOR 0x00000304 #define TRI_POINT0 0x00000310 #define TRI_POINT1 0x00000314 #define TRI_POINT2 0x00000318 /* * 2D solid */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextClip; /* 0184-0187 */ u32 SetContextPattern; /* 0188-018B */ u32 SetContextRop; /* 018C-018F */ u32 SetContextBeta1; /* 0190-0193 */ u32 SetContextSurface; /* 0194-0197 */ u32 Reserved01[0x059]; u32 SetOperation; /* 02FC-02FF */ u32 SetColorFormat; /* 0300-0303 */ u32 Color; /* 0304-0307 */ u32 Reserved02[0x03E]; struct { /* 0400- */ u32 point0; /* 0- 3 */ u32 point1; /* 4- 7 */ } Lin[16]; /* -047F */ struct { /* 0480- */ u32 point0X; /* 0- 3 */ u32 point0Y; /* 4- 7 */ u32 point1X; /* 8- B */ u32 point1Y; /* C- F */ } Lin32[8]; /* -04FF */ u32 PolyLin[32]; /* 0500-057F */ struct { /* 0580- */ u32 x; /* 0- 3 */ u32 y; /* 4- 7 */ } PolyLin32[16]; /* -05FF */ struct { /* 0600- */ u32 color; /* 0- 3 */ u32 point; /* 4- 7 */ } ColorPolyLin[16]; /* -067F */ u32 Reserved03[0x660]; } NVLine; #define LINE_OPERATION 0x000002FC #define LINE_COLOR_FORMAT 0x00000300 #define LINE_COLOR_FORMAT_Y16 0x00000001 #define LINE_COLOR_FORMAT_A1Y15 0x00000002 #define LINE_COLOR_FORMAT_Y32 0x00000003 #define LINE_COLOR 0x00000304 #define LINE_POINT0 0x00000400 #define LINE_POINT1 0x00000404 /* * 2D screen-screen BLT */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 WaitForIdle; /* 0108-010B (09F_WAIT_FOR_IDLE) */ u32 WaitForSync; /* 010C-010F (09F_WAIT_FOR_CRTC) */ u32 Reserved00[0x01C]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextColorKey; /* 0184-0187 */ u32 SetContextClip; /* 0188-018B */ u32 SetContextPattern; /* 018C-018F */ u32 SetContextRop; /* 0190-0193 */ u32 SetContextBeta1; /* 0194-0197 */ u32 SetContextBeta4; /* 0198-019B */ u32 SetContextSurface; /* 019C-019F */ u32 Reserved01[0x057]; u32 SetOperation; /* 02FC-02FF */ u32 TopLeftSrc; /* 0300-0303 */ u32 TopLeftDst; /* 0304-0307 */ u32 WidthHeight; /* 0308-030B */ u32 Reserved02[0x73D]; } NVScreenBlt; #define BLIT_OPERATION 0x000002FC #define BLIT_TOP_LEFT_SRC 0x00000300 #define BLIT_TOP_LEFT_DST 0x00000304 #define BLIT_WIDTH_HEIGHT 0x00000308 /* * 2D CPU to screen BLT */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextColorKey; /* 0184-0187 */ u32 SetContextClip; /* 0188-018B */ u32 SetContextPattern; /* 018C-018F */ u32 SetContextRop; /* 0190-0193 */ u32 SetContextBeta1; /* 0194-0197 */ u32 SetContextBeta4; /* 0198-019B */ u32 SetContextSurface; /* 019C-019F */ u32 Reserved01[0x056]; u32 SetColorConversion; /* 02F8-02FB */ u32 SetOperation; /* 02FC-02FF */ u32 SetColorFormat; /* 0300-0303 */ u32 Point; /* 0304-0307 */ u32 SizeOut; /* 0308-030B */ u32 SizeIn; /* 030C-030F */ u32 Reserved02[0x03C]; u32 Pixel[1792]; /* 0400- */ } NVImageBlt; #define IBLIT_COLOR_CONVERSION 0x000002F8 #define IBLIT_OPERATION 0x000002FC #define IBLIT_COLOR_FORMAT 0x00000300 #define IBLIT_COLOR_FORMAT_R5G6B5 0x00000001 #define IBLIT_COLOR_FORMAT_A1R5G5B5 0x00000002 #define IBLIT_COLOR_FORMAT_X1R5G5B5 0x00000003 #define IBLIT_COLOR_FORMAT_A8R8G8B8 0x00000004 #define IBLIT_COLOR_FORMAT_X8R8G8B8 0x00000005 #define IBLIT_POINT 0x00000304 #define IBLIT_SIZE_OUT 0x00000308 #define IBLIT_SIZE_IN 0x0000030C #define IBLIT_PIXEL0 0x00000400 /* * 2D scaled image BLT */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextDmaImage; /* 0184-0187 */ u32 SetContextPattern; /* 0188-018B */ u32 SetContextRop; /* 018C-018F */ u32 SetContextBeta1; /* 0190-0193 */ u32 SetContextBeta4; /* 0194-0197 */ u32 SetContextSurface; /* 0198-019C */ u32 Reserved01[0x058]; u32 SetColorConversion; /* 02FC-02FF */ u32 SetColorFormat; /* 0300-0303 */ u32 SetOperation; /* 0304-0307 */ u32 ClipPoint; /* 0308-030B */ u32 ClipSize; /* 030C-030F */ u32 ImageOutPoint; /* 0310-0313 */ u32 ImageOutSize; /* 0314-0317 */ u32 DuDx; /* 0318-031B */ u32 DvDy; /* 031C-031F */ u32 Reserved02[0x038]; u32 ImageInSize; /* 0400-0403 */ u32 ImageInFormat; /* 0404-0407 */ u32 ImageInOffset; /* 0408-040B */ u32 ImageInPoint; /* 040C-040F */ u32 Reserved03[0x6FC]; } NVScaledImage; #define SCALER_COLOR_CONVERSION 0x000002FC #define SCALER_COLOR_FORMAT 0x00000300 #define SCALER_COLOR_FORMAT_A1R5G5B5 0x00000001 #define SCALER_COLOR_FORMAT_X1R5G5B5 0x00000002 #define SCALER_COLOR_FORMAT_A8R8G8B8 0x00000003 #define SCALER_COLOR_FORMAT_X8R8G8B8 0x00000004 #define SCALER_COLOR_FORMAT_V8YB8U8YA8 0x00000005 #define SCALER_COLOR_FORMAT_YB8V8YA8U8 0x00000006 #define SCALER_COLOR_FORMAT_R5G6B5 0x00000007 #define SCALER_COLOR_FORMAT_Y8 0x00000008 #define SCALER_COLOR_FORMAT_AY8 0x00000009 #define SCALER_OPERATION 0x00000304 #define SCALER_CLIP_POINT 0x00000308 #define SCALER_CLIP_SIZE 0x0000030C #define SCALER_OUT_POINT 0x00000310 #define SCALER_OUT_SIZE 0x00000314 #define SCALER_DU_DX 0x00000318 #define SCALER_DV_DY 0x0000031C #define SCALER_IN_SIZE 0x00000400 #define SCALER_IN_FORMAT 0x00000404 #define SCALER_IN_FORMAT_ORIGIN_CENTER 0x00010000 #define SCALER_IN_FORMAT_ORIGIN_CORNER 0x00020000 #define SCALER_IN_FORMAT_FILTER_NEAREST 0x00000000 #define SCALER_IN_FORMAT_FILTER_LINEAR 0x01000000 #define SCALER_IN_OFFSET 0x00000408 #define SCALER_IN_POINT 0x0000040C /* * 2D stretched image from CPU BLT */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextColorKey; /* 0184-0187 */ u32 SetContextPattern; /* 0188-018B */ u32 SetContextRop; /* 018C-018F */ u32 SetContextBeta1; /* 0190-0193 */ u32 SetContextBeta4; /* 0194-0197 */ u32 SetContextSurface; /* 0198-019C */ u32 Reserved01[0x057]; u32 SetColorConversion; /* 02F8-02FB */ u32 SetOperation; /* 02FC-02FF */ u32 SetColorFormat; /* 0300-0303 */ u32 ImageInSize; /* 0304-0307 */ u32 DxDu; /* 0308-030B */ u32 DyDv; /* 030C-030F */ u32 ClipPoint; /* 0310-0313 */ u32 ClipSize; /* 0314-0317 */ u32 ImageOutPoint; /* 0318-031B */ u32 Reserved02[0x039]; u32 Pixel[1792]; /* 0400- */ } NVStretchedImage; #define ISTRETCH_COLOR_CONVERSION 0x000002F8 #define ISTRETCH_OPERATION 0x000002FC #define ISTRETCH_COLOR_FORMAT 0x00000300 #define ISTRETCH_COLOR_FORMAT_R5G6B5 0x00000001 #define ISTRETCH_COLOR_FORMAT_A1R5G5B5 0x00000002 #define ISTRETCH_COLOR_FORMAT_X1R5G5B5 0x00000003 #define ISTRETCH_COLOR_FORMAT_A8R8G8B8 0x00000004 #define ISTRETCH_COLOR_FORMAT_X8R8G8B8 0x00000005 #define ISTRETCH_IN_SIZE 0x00000304 #define ISTRETCH_DX_DU 0x00000308 #define ISTRETCH_DY_DV 0x0000030C #define ISTRETCH_CLIP_POINT 0x00000310 #define ISTRETCH_CLIP_SIZE 0x00000314 #define ISTRETCH_OUT_POINT 0x00000318 #define ISTRETCH_PIXEL0 0x00000400 /* * 3D textured, Z buffered triangle */ typedef volatile struct { u32 NoOperation; /* 0100-0103 */ u32 Notify; /* 0104-0107 */ u32 Reserved00[0x01E]; u32 SetContextDmaNotify; /* 0180-0183 */ u32 SetContextDmaA; /* 0184-0187 */ u32 SetContextDmaB; /* 0188-018B */ u32 SetContextSurfaces; /* 018C-018F */ u32 Reserved01[0x05C]; u32 ColorKey; /* 0300-0303 */ u32 TextureOffset; /* 0304-0307 */ u32 TextureFormat; /* 0308-030B */ u32 TextureFilter; /* 030C-030F */ u32 Blend; /* 0310-0313 */ u32 Control; /* 0314-0317 */ u32 FogColor; /* 0318-031B */ u32 Reserved02[0x039]; struct { /* 0400- */ float sx; /* 00- 03 */ float sy; /* 04- 07 */ float sz; /* 08- 0B */ float rhw; /* 0C- 0F */ u32 color; /* 10- 13 */ u32 specular; /* 14- 17 */ float ts; /* 18- 1B */ float tt; /* 1C- 1F */ } Tlvertex[16]; /* -05FF */ u32 DrawPrimitives[64]; /* 0600-063F */ u32 Reserved03[0x640]; } NVTexturedTriangleDx5; #define TXTRI_COLOR_KEY 0x00000300 #define TXTRI_OFFSET 0x00000304 #define TXTRI_FORMAT 0x00000308 #define TXTRI_FORMAT_CONTEXT_DMA_A 0x00000001 #define TXTRI_FORMAT_CONTEXT_DMA_B 0x00000002 #define TXTRI_FORMAT_COLORKEYENABLE 0x00000004 #define TXTRI_FORMAT_ORIGIN_ZOH_CENTER 0x00000010 #define TXTRI_FORMAT_ORIGIN_ZOH_CORNER 0x00000020 #define TXTRI_FORMAT_ORIGIN_FOH_CENTER 0x00000040 #define TXTRI_FORMAT_ORIGIN_FOH_CORNER 0x00000080 #define TXTRI_FORMAT_COLOR_Y8 0x00000100 #define TXTRI_FORMAT_COLOR_A1R5G5B5 0x00000200 #define TXTRI_FORMAT_COLOR_X1R5G5B5 0x00000300 #define TXTRI_FORMAT_COLOR_A4R4G4B4 0x00000400 #define TXTRI_FORMAT_COLOR_R5G6B5 0x00000500 #define TXTRI_FORMAT_COLOR_A8R8G8B8 0x00000600 #define TXTRI_FORMAT_COLOR_X8R8G8B8 0x00000700 #define TXTRI_FORMAT_MIPMAP_LEVELS_MSK 0x0000F000 #define TXTRI_FORMAT_BASE_SIZE_U_MSK 0x000F0000 #define TXTRI_FORMAT_BASE_SIZE_V_MSK 0x00F00000 #define TXTRI_FORMAT_U_WRAP 0x01000000 #define TXTRI_FORMAT_U_MIRROR 0x02000000 #define TXTRI_FORMAT_U_CLAMP 0x03000000 #define TXTRI_FORMAT_U_CLAMP_BORDER 0x04000000 #define TXTRI_FORMAT_WRAPU_ENABLE 0x08000000 #define TXTRI_FORMAT_V_WRAP 0x10000000 #define TXTRI_FORMAT_V_MIRROR 0x20000000 #define TXTRI_FORMAT_V_CLAMP 0x30000000 #define TXTRI_FORMAT_V_CLAMP_BORDER 0x40000000 #define TXTRI_FORMAT_WRAPV_ENABLE 0x80000000 #define TXTRI_FILTER 0x0000030C #define TXTRI_FILTER_KERNEL_SIZE_X_MSK 0x000000FF #define TXTRI_FILTER_KERNEL_SIZE_Y_MSK 0x00007F00 #define TXTRI_FILTER_MIPMAP_DITHER_ENABLE 0x00008000 #define TXTRI_FILTER_MIPMAPLODBIAS_MSK 0x00FF0000 #define TXTRI_FILTER_TEXTUREMIN_NEAREST 0x01000000 #define TXTRI_FILTER_TEXTUREMIN_LINEAR 0x02000000 #define TXTRI_FILTER_TEXTUREMIN_MIPNEAREST 0x03000000 #define TXTRI_FILTER_TEXTUREMIN_MIPLINEAR 0x04000000 #define TXTRI_FILTER_TEXTUREMIN_LINEARMIPNEAREST 0x05000000 #define TXTRI_FILTER_TEXTUREMIN_LINEARMIPLINEAR 0x06000000 #define TXTRI_FILTER_ANISOTROPIC_MIN_ENABLE 0x08000000 #define TXTRI_FILTER_TEXTUREMAG_NEAREST 0x10000000 #define TXTRI_FILTER_TEXTUREMAG_LINEAR 0x20000000 #define TXTRI_FILTER_TEXTUREMAG_MIPNEAREST 0x30000000 #define TXTRI_FILTER_TEXTUREMAG_MIPLINEAR 0x40000000 #define TXTRI_FILTER_TEXTUREMAG_LINEARMIPNEAREST 0x50000000 #define TXTRI_FILTER_TEXTUREMAG_LINEARMIPLINEAR 0x60000000 #define TXTRI_FILTER_ANISOTROPIC_MAG_ENABLE 0x80000000 #define TXTRI_BLEND 0x00000310 #define TXTRI_BLEND_TEXTUREMAPBLEND_DECAL 0x00000001 #define TXTRI_BLEND_TEXTUREMAPBLEND_MODULATE 0x00000002 #define TXTRI_BLEND_TEXTUREMAPBLEND_DECALALPHA 0x00000003 #define TXTRI_BLEND_TEXTUREMAPBLEND_MODULATEALPHA 0x00000004 #define TXTRI_BLEND_TEXTUREMAPBLEND_DECALMASK 0x00000005 #define TXTRI_BLEND_TEXTUREMAPBLEND_MODULATEMASK 0x00000006 #define TXTRI_BLEND_TEXTUREMAPBLEND_COPY 0x00000007 #define TXTRI_BLEND_TEXTUREMAPBLEND_ADD 0x00000008 #define TXTRI_BLEND_OPERATION_MUX_TALPHALSB 0x00000010 #define TXTRI_BLEND_OPERATION_MUX_TALPHAMSB 0x00000020 #define TXTRI_BLEND_SHADEMODE_FLAT 0x00000040 #define TXTRI_BLEND_SHADEMODE_GOURAUD 0x00000080 #define TXTRI_BLEND_SHADEMODE_PHONG 0x000000C0 #define TXTRI_BLEND_TEXTUREPERSPECTIVE_ENABLE 0x00000100 #define TXTRI_BLEND_SPECULAR_ENABLE 0x00001000 #define TXTRI_BLEND_FOG_ENABLE 0x00010000 #define TXTRI_BLEND_ALPHABLEND_ENABLE 0x00100000 #define TXTRI_BLEND_SRCBLEND_ZERO 0x01000000 #define TXTRI_BLEND_SRCBLEND_ONE 0x02000000 #define TXTRI_BLEND_SRCBLEND_SRCCOLOR 0x03000000 #define TXTRI_BLEND_SRCBLEND_INVSRCCOLOR 0x04000000 #define TXTRI_BLEND_SRCBLEND_SRCALPHA 0x05000000 #define TXTRI_BLEND_SRCBLEND_INVSRCALPHA 0x06000000 #define TXTRI_BLEND_SRCBLEND_DESTALPHA 0x07000000 #define TXTRI_BLEND_SRCBLEND_INVDESTALPHA 0x08000000 #define TXTRI_BLEND_SRCBLEND_DESTCOLOR 0x09000000 #define TXTRI_BLEND_SRCBLEND_INVDESTCOLOR 0x0A000000 #define TXTRI_BLEND_SRCBLEND_SRCALPHASAT 0x0B000000 #define TXTRI_BLEND_DESTBLEND_ZERO 0x10000000 #define TXTRI_BLEND_DESTBLEND_ONE 0x20000000 #define TXTRI_BLEND_DESTBLEND_SRCCOLOR 0x30000000 #define TXTRI_BLEND_DESTBLEND_INVSRCCOLOR 0x40000000 #define TXTRI_BLEND_DESTBLEND_SRCALPHA 0x50000000 #define TXTRI_BLEND_DESTBLEND_INVSRCALPHA 0x60000000 #define TXTRI_BLEND_DESTBLEND_DESTALPHA 0x70000000 #define TXTRI_BLEND_DESTBLEND_INVDESTALPHA 0x80000000 #define TXTRI_BLEND_DESTBLEND_DESTCOLOR 0x90000000 #define TXTRI_BLEND_DESTBLEND_INVDESTCOLOR 0xA0000000 #define TXTRI_BLEND_DESTBLEND_SRCALPHASAT 0xB0000000 #define TXTRI_CONTROL 0x00000314 #define TXTRI_CONTROL_ALPHAREF_MSK 0x000000FF #define TXTRI_CONTROL_ALPHAFUNC_NEVER 0x00000100 #define TXTRI_CONTROL_ALPHAFUNC_LESS 0x00000200 #define TXTRI_CONTROL_ALPHAFUNC_EQUAL 0x00000300 #define TXTRI_CONTROL_ALPHAFUNC_LESSEQUAL 0x00000400 #define TXTRI_CONTROL_ALPHAFUNC_GREATER 0x00000500 #define TXTRI_CONTROL_ALPHAFUNC_NOTEQUAL 0x00000600 #define TXTRI_CONTROL_ALPHAFUNC_GREATEREQUAL 0x00000700 #define TXTRI_CONTROL_ALPHAFUNC_ALWAYS 0x00000800 #define TXTRI_CONTROL_ALPHATEST_ENABLE 0x00001000 #define TXTRI_CONTROL_ORIGIN_CENTER 0x00000000 #define TXTRI_CONTROL_ORIGIN_CORNER 0x00002000 #define TXTRI_CONTROL_Z_ENABLE 0x00004000 #define TXTRI_CONTROL_ZFUNC_NEVER 0x00010000 #define TXTRI_CONTROL_ZFUNC_LESS 0x00020000 #define TXTRI_CONTROL_ZFUNC_EQUAL 0x00030000 #define TXTRI_CONTROL_ZFUNC_LESSEQUAL 0x00040000 #define TXTRI_CONTROL_ZFUNC_GREATER 0x00050000 #define TXTRI_CONTROL_ZFUNC_NOTEQUAL 0x00060000 #define TXTRI_CONTROL_ZFUNC_GREATEREQUAL 0x00070000 #define TXTRI_CONTROL_ZFUNC_ALWAYS 0x00080000 #define TXTRI_CONTROL_CULLMODE_NONE 0x00100000 #define TXTRI_CONTROL_CULLMODE_CW 0x00200000 #define TXTRI_CONTROL_CULLMODE_CCW 0x00300000 #define TXTRI_CONTROL_DITHER_ENABLE 0x00400000 #define TXTRI_CONTROL_Z_PERSPECTIVE_ENABLE 0x00800000 #define TXTRI_CONTROL_ZWRITE_ENABLE 0x01000000 #define TXTRI_CONTROL_Z_FORMAT_FIXED 0x40000000 #define TXTRI_CONTROL_Z_FORMAT_FLOAT 0x80000000 #define TXTRI_FOG_COLOR 0x00000318 #define TXTRI_VERTEX0 0x00000400 #define TXTRI_VERTEX0_X 0x00000400 #define TXTRI_VERTEX0_Y 0x00000404 #define TXTRI_VERTEX0_Z 0x00000408 #define TXTRI_VERTEX0_W 0x0000040C #define TXTRI_VERTEX0_COLOR 0x00000410 #define TXTRI_VERTEX0_SPECULAR 0x00000414 #define TXTRI_VERTEX0_S 0x00000418 #define TXTRI_VERTEX0_T 0x0000041C #define TXTRI_PRIMITIVE0 0x00000600 typedef volatile struct { u32 SetObject; /* 0000-0003 */ u32 Reserved00[0x003]; #ifdef WORDS_BIGENDIAN u32 Free; /* 0010-0013 */ #else u16 Free; /* 0010-0011 */ u16 Nop; /* 0012-0013 */ #endif u32 Reserved01[0x00B]; u32 DmaPut; /* 0040-0043 */ u32 DmaGet; /* 0044-0047 */ u32 Reserved02[0x02E]; union { NVSurfaces2D Surfaces2D; NVSurfaces3D Surfaces3D; NVClip Clip; NVBeta1 Beta1; NVBeta4 Beta4; NVRectangle Rectangle; NVTriangle Triangle; NVLine Line; NVScreenBlt ScreenBlt; NVImageBlt ImageBlt; NVScaledImage ScaledImage; NVStretchedImage StretchedImage; NVTexturedTriangleDx5 TexTriangle; } o; } NVDmaSubChannel; typedef volatile struct { NVDmaSubChannel sub[8]; } NVDmaChannel; #endif /* __NVIDIA_REGS_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/nvidia.c0000644000175000017500000024043211245562152015221 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFB_GRAPHICS_DRIVER( nvidia ) #include "nvidia.h" #include "nvidia_regs.h" #include "nvidia_accel.h" #include "nvidia_objects.h" #include "nvidia_state.h" #include "nvidia_2d.h" #include "nvidia_3d.h" /* Riva TNT */ #define NV4_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #define NV4_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | \ DFXL_FILLTRIANGLE | DFXL_DRAWLINE) #define NV4_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_DEINTERLACE) #define NV4_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES) /* Riva TNT2 */ #define NV5_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #define NV5_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | \ DFXL_FILLTRIANGLE | DFXL_DRAWLINE) #define NV5_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_COLORIZE | DSBLIT_DEINTERLACE) #define NV5_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES) /* GeForce1/GeForce2/GeForce4 */ #define NV10_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #define NV10_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | \ DFXL_FILLTRIANGLE | DFXL_DRAWLINE) #define NV10_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR | \ DSBLIT_DEINTERLACE) #define NV10_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT | DFXL_TEXTRIANGLES) /* GeForce3/GeForce4Ti */ #define NV20_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #define NV20_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | \ DFXL_FILLTRIANGLE | DFXL_DRAWLINE) #define NV20_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL | \ DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR | \ DSBLIT_DEINTERLACE) #define NV20_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT | DFXL_STRETCHBLIT) /* GeForceFX */ #define NV30_SUPPORTED_DRAWINGFLAGS \ (DSDRAW_BLEND) #define NV30_SUPPORTED_DRAWINGFUNCTIONS \ (DFXL_FILLRECTANGLE | DFXL_DRAWRECTANGLE | \ DFXL_FILLTRIANGLE | DFXL_DRAWLINE) #define NV30_SUPPORTED_BLITTINGFLAGS \ (DSBLIT_NOFX) #define NV30_SUPPORTED_BLITTINGFUNCTIONS \ (DFXL_BLIT) #define DSBLIT_MODULATE_ALPHA \ (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL) #define DSBLIT_MODULATE_COLOR \ (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR) #define DSBLIT_MODULATE \ (DSBLIT_MODULATE_ALPHA | DSBLIT_MODULATE_COLOR) static void nvAfterSetVar( void *driver_data, void *device_data ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) device_data; volatile u8 *mmio = nvdrv->mmio_base; int i; nv_waitidle( nvdrv, nvdev ); /* reconfigure PFIFO for selected mode (DMA/PIO) */ nv_out32( mmio, PFIFO_CACHES, PFIFO_CACHES_REASSIGN_DISABLED ); if (nvdev->use_dma) { nv_out32( mmio, PFIFO_MODE, PFIFO_MODE_CHANNEL_0_DMA ); nv_out32( mmio, PFIFO_NEXT_CHANNEL, PFIFO_NEXT_CHANNEL_MODE_DMA ); } else { nv_out32( mmio, PFIFO_MODE, PFIFO_MODE_CHANNEL_0_PIO ); nv_out32( mmio, PFIFO_NEXT_CHANNEL, PFIFO_NEXT_CHANNEL_MODE_PIO ); } nv_out32( mmio, PFIFO_CACHE1_PUSH0, PFIFO_CACHE1_PULL1_ENGINE_SW ); nv_out32( mmio, PFIFO_CACHE1_PULL0, PFIFO_CACHE1_PULL0_ACCESS_DISABLED ); if (nvdev->use_dma) { nv_out32( mmio, PFIFO_CACHE1_PUSH1, PFIFO_CACHE1_PUSH1_MODE_DMA ); } else { nv_out32( mmio, PFIFO_CACHE1_PUSH1, PFIFO_CACHE1_PUSH1_MODE_PIO ); } nv_out32( mmio, PFIFO_CACHE1_DMA_PUT, 0 ); nv_out32( mmio, PFIFO_CACHE1_DMA_GET, 0 ); if (nvdev->use_dma) { nv_out32( mmio, PFIFO_CACHE1_DMA_INSTANCE, ADDR_DMA_OUT ); } else { nv_out32( mmio, PFIFO_CACHE1_DMA_INSTANCE, 0 ); } nv_out32( mmio, PFIFO_CACHE0_PUSH0, PFIFO_CACHE0_PUSH0_ACCESS_DISABLED ); nv_out32( mmio, PFIFO_CACHE0_PULL0, PFIFO_CACHE0_PULL0_ACCESS_DISABLED ); nv_out32( mmio, PFIFO_RAMHT, 0x00000100 | PFIFO_RAMHT_SIZE_4K | PFIFO_RAMHT_SEARCH_128 ); nv_out32( mmio, PFIFO_RAMFC, 0x00000110 ); nv_out32( mmio, PFIFO_RAMRO, 0x00000112 | PFIFO_RAMRO_SIZE_512 ); nv_out32( mmio, PFIFO_SIZE, 0x0000FFFF ); nv_out32( mmio, PFIFO_CACHE1_HASH, 0x0000FFFF ); nv_out32( mmio, PFIFO_INTR_EN, PFIFO_INTR_EN_DISABLED ); nv_out32( mmio, PFIFO_INTR, PFIFO_INTR_RESET ); nv_out32( mmio, PFIFO_CACHE0_PULL1, PFIFO_CACHE0_PULL1_ENGINE_GRAPHICS ); if (nvdev->use_dma) { if (nvdev->use_agp) { nv_out32( mmio, PFIFO_CACHE1_DMA_CTL, PFIFO_CACHE1_DMA_CTL_PAGE_TABLE_PRESENT | PFIFO_CACHE1_DMA_CTL_PAGE_ENTRY_LINEAR | PFIFO_CACHE1_DMA_CTL_TARGET_NODE_AGP ); } else { nv_out32( mmio, PFIFO_CACHE1_DMA_CTL, PFIFO_CACHE1_DMA_CTL_PAGE_TABLE_PRESENT | PFIFO_CACHE1_DMA_CTL_PAGE_ENTRY_LINEAR | PFIFO_CACHE1_DMA_CTL_TARGET_NODE_NVM ); } nv_out32( mmio, PFIFO_CACHE1_DMA_LIMIT, nvdev->dma_size - 4 ); nv_out32( mmio, PFIFO_CACHE1_ENGINE, PFIFO_CACHE1_ENGINE_0_SW ); #ifdef WORDS_BIGENDIAN nv_out32( mmio, PFIFO_CACHE1_DMA_FETCH, PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES | PFIFO_CACHE1_DMA_FETCH_MAX_REQS_15 | PFIFO_CACHE1_BIG_ENDIAN ); #else nv_out32( mmio, PFIFO_CACHE1_DMA_FETCH, PFIFO_CACHE1_DMA_FETCH_TRIG_128_BYTES | PFIFO_CACHE1_DMA_FETCH_MAX_REQS_15 | PFIFO_CACHE1_LITTLE_ENDIAN ); #endif nv_out32( mmio, PFIFO_CACHE1_DMA_PUSH, PFIFO_CACHE1_DMA_PUSH_ACCESS_ENABLED ); } else { nv_out32( mmio, PFIFO_CACHE1_DMA_PUSH, PFIFO_CACHE1_DMA_PUSH_ACCESS_DISABLED ); } nv_out32( mmio, PFIFO_CACHE1_PUSH0, PFIFO_CACHE1_PUSH0_ACCESS_ENABLED ); nv_out32( mmio, PFIFO_CACHE1_PULL0, PFIFO_CACHE1_PULL0_ACCESS_ENABLED ); nv_out32( mmio, PFIFO_CACHE1_PULL1, PFIFO_CACHE1_PULL1_ENGINE_GRAPHICS ); nv_out32( mmio, PFIFO_CACHES, PFIFO_CACHES_REASSIGN_ENABLED ); nv_out32( mmio, PFIFO_INTR_EN, PFIFO_INTR_EN_CACHE_ERROR_ENABLED ); if (nvdev->arch == NV_ARCH_10) { nv_out32( mmio, PGRAPH_DEBUG_1, 0x00118701 ); nv_out32( mmio, PGRAPH_DEBUG_2, 0x24F82AD9 ); for (i = 0; i < 8; i++) { nv_out32( mmio, NV10_PGRAPH_WINDOWCLIP_HORIZONTAL+i*4, 0x07FF0800 ); nv_out32( mmio, NV10_PGRAPH_WINDOWCLIP_VERTICAL +i*4, 0x07FF0800 ); } nv_out32( mmio, NV10_PGRAPH_XFMODE0, 0x10000000 ); nv_out32( mmio, NV10_PGRAPH_XFMODE1, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006740 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006750 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x40000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x40000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x40000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x40000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006760 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006770 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC5000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC5000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006780 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x000067A0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006AB0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006AC0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006C10 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xBF800000 ); for (i = 0; i < 8; i++) { nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x7030+i*16 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x7149F2CA ); } nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006A80 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006AA0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00000040 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000005 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006400 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x4B7FFFFF ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006410 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC5000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC5000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006420 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x00006430 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x000064C0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x477FFFFF ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x3F800000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x000064D0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC5000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC5000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x000064E0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC4FFF000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0xC4FFF000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_ADDRESS, 0x000064F0 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_PIPE_DATA, 0x00000000 ); nv_out32( mmio, NV10_PGRAPH_XFMODE0, 0x30000000 ); nv_out32( mmio, NV10_PGRAPH_XFMODE1, 0x00000004 ); nv_out32( mmio, NV10_PGRAPH_GLOBALSTATE0, 0x10000000 ); nv_out32( mmio, NV10_PGRAPH_GLOBALSTATE1, 0x00000000 ); } nvdev->dma_max = nvdev->dma_size/4 - 1; nvdev->dma_cur = 0; nvdev->dma_free = nvdev->dma_max; nvdev->dma_put = 0; nvdev->dma_get = 0; nvdev->fifo_free = 0; } static void nvEngineReset( void *drv, void *dev ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; int i; /* reput objects into subchannels */ for (i = 0; i < 8; i++) { nv_assign_object( nvdrv, nvdev, i, nvdev->subchannel_object[i], true ); } nvdev->set = 0; nvdev->dst_format = DSPF_UNKNOWN; nvdev->dst_pitch = 0; nvdev->src_pitch = 0; nvdev->beta1_set = false; nvdev->beta4_set = false; } static DFBResult nvEngineSync( void *drv, void *dev ) { nv_waitidle( (NVidiaDriverData*)drv, (NVidiaDeviceData*)dev ); return DFB_OK; } static void nvFlushTextureCache( void *drv, void *dev ) { NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; /* invalidate source texture */ nvdev->set &= ~SMF_SOURCE_TEXTURE; } static void nvEmitCommands( void *drv, void *dev ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; if (nvdev->use_dma) nv_emitdma( nvdrv, nvdev ); } static void nv4CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; CoreSurface *destination = state->destination; CoreSurface *source = state->source; switch (destination->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: if (DFB_BLITTING_FUNCTION( accel )) { if (accel != DFXL_BLIT || state->blittingflags || source->config.format != destination->config.format) return; } else { if (state->drawingflags != DSDRAW_NOFX) return; } break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_YUY2: case DSPF_UYVY: if (DFB_BLITTING_FUNCTION( accel )) { if (accel & ~(DFXL_BLIT | DFXL_STRETCHBLIT) || state->blittingflags != DSBLIT_NOFX || source->config.format != destination->config.format) return; } else { if (accel & (DFXL_FILLTRIANGLE | DFXL_DRAWLINE) || state->drawingflags != DSDRAW_NOFX) return; } break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { /* check unsupported blitting flags */ if (accel & ~NV4_SUPPORTED_BLITTINGFUNCTIONS || state->blittingflags & ~NV4_SUPPORTED_BLITTINGFLAGS) return; if (accel == DFXL_TEXTRIANGLES) { u32 size = 1 << (direct_log2(source->config.size.w) + direct_log2(source->config.size.h)); if (size > nvdev->max_texture_size) return; } else { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { if (state->src_blend != DSBF_SRCALPHA || state->dst_blend != DSBF_INVSRCALPHA) return; } if (state->render_options & DSRO_MATRIX && (state->matrix[0] < 0 || state->matrix[1] || state->matrix[3] || state->matrix[4] < 0)) return; } switch (source->config.format) { case DSPF_LUT8: case DSPF_ALUT44: if (destination->config.format != source->config.format || !dfb_palette_equal( source->palette, destination->palette )) return; break; case DSPF_A8: case DSPF_RGB332: if (destination->config.format != source->config.format) return; break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_RGB16: switch (accel) { case DFXL_BLIT: if (state->blittingflags != DSBLIT_NOFX || destination->config.format != DSPF_RGB16) return; break; case DFXL_STRETCHBLIT: return; default: break; } break; case DSPF_YUY2: case DSPF_UYVY: if (accel == DFXL_TEXTRIANGLES) return; break; default: return; } state->accel |= accel; } else { /* check unsupported drawing flags */ if (accel & ~NV4_SUPPORTED_DRAWINGFUNCTIONS || state->drawingflags & ~NV4_SUPPORTED_DRAWINGFLAGS) return; state->accel |= NV4_SUPPORTED_DRAWINGFUNCTIONS; } } static void nv5CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; CoreSurface *destination = state->destination; CoreSurface *source = state->source; switch (destination->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: if (DFB_BLITTING_FUNCTION( accel )) { if (accel != DFXL_BLIT || state->blittingflags || source->config.format != destination->config.format) return; } else { if (state->drawingflags != DSDRAW_NOFX) return; } break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_YUY2: case DSPF_UYVY: if (DFB_BLITTING_FUNCTION( accel )) { if (accel & ~(DFXL_BLIT | DFXL_STRETCHBLIT) || state->blittingflags != DSBLIT_NOFX || source->config.format != destination->config.format) return; } else { if (accel & (DFXL_FILLTRIANGLE | DFXL_DRAWLINE) || state->drawingflags != DSDRAW_NOFX) return; } break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { /* check unsupported blitting flags */ if (accel & ~NV5_SUPPORTED_BLITTINGFUNCTIONS || state->blittingflags & ~NV5_SUPPORTED_BLITTINGFLAGS) return; if (accel == DFXL_TEXTRIANGLES) { u32 size = 1 << (direct_log2(source->config.size.w) + direct_log2(source->config.size.h)); if (size > nvdev->max_texture_size) return; } else { if (state->blittingflags & DSBLIT_MODULATE) { if (state->blittingflags & DSBLIT_MODULATE_ALPHA && state->blittingflags & DSBLIT_MODULATE_COLOR) return; if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { if (state->src_blend != DSBF_SRCALPHA || state->dst_blend != DSBF_INVSRCALPHA) return; } } if (state->render_options & DSRO_MATRIX && (state->matrix[0] < 0 || state->matrix[1] || state->matrix[3] || state->matrix[4] < 0)) return; } switch (source->config.format) { case DSPF_LUT8: case DSPF_ALUT44: if (destination->config.format != source->config.format || /*state->src.buffer->policy == CSP_SYSTEMONLY ||*/ !dfb_palette_equal( source->palette, destination->palette )) return; break; case DSPF_A8: case DSPF_RGB332: if (destination->config.format != source->config.format /*|| state->src.buffer->policy == CSP_SYSTEMONLY*/) return; break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: /* disable host-to-video blit for simple blits */ /*if (state->src.buffer->policy == CSP_SYSTEMONLY && accel == DFXL_BLIT && !state->blittingflags && source->config.format == destination->config.format) return;*/ break; case DSPF_YUY2: case DSPF_UYVY: if (accel & ~(DFXL_BLIT | DFXL_STRETCHBLIT) /*|| state->src.buffer->policy == CSP_SYSTEMONLY*/) return; break; default: return; } state->accel |= accel; } else { /* check unsupported drawing flags */ if (accel & ~NV5_SUPPORTED_DRAWINGFUNCTIONS || state->drawingflags & ~NV5_SUPPORTED_DRAWINGFLAGS) return; state->accel |= NV5_SUPPORTED_DRAWINGFUNCTIONS; } } static void nv10CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; CoreSurface *destination = state->destination; CoreSurface *source = state->source; switch (destination->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: if (DFB_BLITTING_FUNCTION( accel )) { if (accel != DFXL_BLIT || state->blittingflags || source->config.format != destination->config.format) return; } else { if (state->drawingflags != DSDRAW_NOFX) return; } break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_YUY2: case DSPF_UYVY: if (DFB_BLITTING_FUNCTION( accel )) { if (accel & ~(DFXL_BLIT | DFXL_STRETCHBLIT) || state->blittingflags != DSBLIT_NOFX || source->config.format != destination->config.format) return; } else { if (accel & (DFXL_FILLTRIANGLE | DFXL_DRAWLINE) || state->drawingflags != DSDRAW_NOFX) return; } break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { /* check unsupported blitting flags */ if (accel & ~NV10_SUPPORTED_BLITTINGFUNCTIONS || state->blittingflags & ~NV10_SUPPORTED_BLITTINGFLAGS) return; if (accel == DFXL_TEXTRIANGLES) { u32 size = 1 << (direct_log2(source->config.size.w) + direct_log2(source->config.size.h)); if (size > nvdev->max_texture_size) return; } else { if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { if (state->blittingflags & DSBLIT_MODULATE_COLOR) { if (source->config.format == DSPF_ARGB && state->src_blend != DSBF_ONE) return; } if (state->src_blend != DSBF_ONE && state->src_blend != DSBF_SRCALPHA) return; if (state->dst_blend != DSBF_INVSRCALPHA) return; } if (state->render_options & DSRO_MATRIX && (state->matrix[0] < 0 || state->matrix[1] || state->matrix[3] || state->matrix[4] < 0)) return; } switch (source->config.format) { case DSPF_A8: if (DFB_BYTES_PER_PIXEL(destination->config.format) != 4 /*|| state->src.buffer->policy == CSP_SYSTEMONLY*/) return; break; case DSPF_LUT8: case DSPF_ALUT44: if (destination->config.format != source->config.format || /*state->src.buffer->policy == CSP_SYSTEMONLY ||*/ !dfb_palette_equal( source->palette, destination->palette )) return; break; case DSPF_RGB332: if (destination->config.format != source->config.format /*|| state->src.buffer->policy == CSP_SYSTEMONLY*/) return; break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: /* disable host-to-video blit for simple blits */ /*if (state->src.buffer->policy == CSP_SYSTEMONLY && accel == DFXL_BLIT && !state->blittingflags && source->config.format == destination->config.format) return;*/ break; case DSPF_YUY2: case DSPF_UYVY: if (accel & ~(DFXL_BLIT | DFXL_STRETCHBLIT) /*|| state->src.buffer->policy == CSP_SYSTEMONLY*/) return; break; default: return; } state->accel |= accel; } else { /* check unsupported drawing flags */ if (accel & ~NV10_SUPPORTED_DRAWINGFUNCTIONS || state->drawingflags & ~NV10_SUPPORTED_DRAWINGFLAGS) return; state->accel |= NV10_SUPPORTED_DRAWINGFUNCTIONS; } } static void nv20CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { CoreSurface *destination = state->destination; CoreSurface *source = state->source; switch (destination->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: if (DFB_BLITTING_FUNCTION( accel )) { if (state->blittingflags != DSBLIT_NOFX || source->config.format != destination->config.format) return; } else { if (state->drawingflags != DSDRAW_NOFX) return; } break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_YUY2: case DSPF_UYVY: if (DFB_BLITTING_FUNCTION( accel )) { if (accel & ~(DFXL_BLIT | DFXL_STRETCHBLIT) || state->blittingflags != DSBLIT_NOFX || source->config.format != destination->config.format) return; } else { if (accel & (DFXL_FILLTRIANGLE | DFXL_DRAWLINE) || state->drawingflags != DSDRAW_NOFX) return; } break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { /* check unsupported blitting functions/flags */ if (accel & ~NV20_SUPPORTED_BLITTINGFUNCTIONS || state->blittingflags & ~NV20_SUPPORTED_BLITTINGFLAGS) return; if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) { if (state->blittingflags & DSBLIT_MODULATE_COLOR) { if (source->config.format == DSPF_ARGB && state->src_blend != DSBF_ONE) return; } if (state->src_blend != DSBF_ONE && state->src_blend != DSBF_SRCALPHA) return; if (state->dst_blend != DSBF_INVSRCALPHA) return; } if (state->render_options & DSRO_MATRIX && (state->matrix[0] < 0 || state->matrix[1] || state->matrix[3] || state->matrix[4] < 0)) return; switch (source->config.format) { case DSPF_A8: /*if (state->src.buffer->policy == CSP_SYSTEMONLY) return;*/ break; case DSPF_LUT8: case DSPF_ALUT44: if (destination->config.format != source->config.format || /*state->src.buffer->policy == CSP_SYSTEMONLY ||*/ !dfb_palette_equal( source->palette, destination->palette )) return; break; case DSPF_RGB332: if (destination->config.format != source->config.format /*|| state->src.buffer->policy == CSP_SYSTEMONLY*/) return; break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: /* disable host-to-video blit for simple blits */ /*if (state->src.buffer->policy == CSP_SYSTEMONLY && accel == DFXL_BLIT && !state->blittingflags && source->config.format == destination->config.format) return;*/ break; case DSPF_YUY2: case DSPF_UYVY: /*if (state->src.buffer->policy == CSP_SYSTEMONLY) return;*/ break; default: return; } state->accel |= accel; } else { /* check unsupported drawing flags */ if (accel & ~NV20_SUPPORTED_DRAWINGFUNCTIONS || state->drawingflags & ~NV20_SUPPORTED_DRAWINGFLAGS) return; if (state->drawingflags & DSDRAW_BLEND && state->src_blend != DSBF_SRCALPHA && state->dst_blend != DSBF_INVSRCALPHA) return; state->accel |= NV20_SUPPORTED_DRAWINGFUNCTIONS; } } static void nv30CheckState( void *drv, void *dev, CardState *state, DFBAccelerationMask accel ) { CoreSurface *destination = state->destination; CoreSurface *source = state->source; switch (destination->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: if (DFB_DRAWING_FUNCTION( accel ) && state->drawingflags != DSDRAW_NOFX) return; break; case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: break; case DSPF_YUY2: case DSPF_UYVY: if (accel & (DFXL_FILLTRIANGLE | DFXL_DRAWLINE) || state->drawingflags != DSDRAW_NOFX) return; break; default: return; } if (DFB_BLITTING_FUNCTION( accel )) { /* check unsupported blitting functions/flags */ if (accel & ~NV30_SUPPORTED_BLITTINGFUNCTIONS || state->blittingflags & ~NV30_SUPPORTED_BLITTINGFLAGS) return; if (state->render_options & DSRO_MATRIX && (state->matrix[0] != 0x10000 || state->matrix[1] || state->matrix[3] || state->matrix[4] != 0x10000)) return; switch (source->config.format) { case DSPF_LUT8: case DSPF_ALUT44: if (!dfb_palette_equal( source->palette, destination->palette )) return; case DSPF_A8: case DSPF_RGB332: case DSPF_RGB555: case DSPF_ARGB1555: case DSPF_RGB16: case DSPF_RGB32: case DSPF_ARGB: case DSPF_YUY2: case DSPF_UYVY: if (/*state->src.buffer->policy == CSP_SYSTEMONLY ||*/ source->config.format != destination->config.format) return; break; default: return; } state->accel |= accel; } else { /* check unsupported drawing flags */ if (accel & ~NV30_SUPPORTED_DRAWINGFUNCTIONS || state->drawingflags & ~NV30_SUPPORTED_DRAWINGFLAGS) return; if (state->drawingflags & DSDRAW_BLEND && state->src_blend != DSBF_SRCALPHA && state->dst_blend != DSBF_INVSRCALPHA) return; state->accel |= NV30_SUPPORTED_DRAWINGFUNCTIONS; } } #define M_IDENTITY(m) ((m)[0] == 0x10000 && (m)[1] == 0 && (m)[2] == 0 && \ (m)[3] == 0 && (m)[4] == 0x10000 && (m)[5] == 0) static void nv4SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; nvdev->set &= ~state->mod_hw; if (state->mod_hw & SMF_COLOR) nvdev->set &= ~(SMF_DRAWING_COLOR | SMF_BLITTING_COLOR); nv_set_destination( nvdrv, nvdev, state ); nv_set_clip( nvdrv, nvdev, state ); if (state->render_options & DSRO_MATRIX && !M_IDENTITY(state->matrix)) nvdev->matrix = state->matrix; else nvdev->matrix = NULL; switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: nv_set_drawing_color( nvdrv, nvdev, state ); if (state->drawingflags & DSDRAW_BLEND) nv_set_blend_function( nvdrv, nvdev, state ); nv_set_drawingflags( nvdrv, nvdev, state ); if ((state->drawingflags & DSDRAW_BLEND || nvdev->matrix) && nvdev->enabled_3d) { nvdev->state3d[0].modified = true; funcs->FillRectangle = nvFillRectangle3D; funcs->FillTriangle = nvFillTriangle3D; funcs->DrawRectangle = nvDrawRectangle3D; funcs->DrawLine = nvDrawLine3D; } else { funcs->FillRectangle = nvFillRectangle2D; funcs->FillTriangle = nvFillTriangle2D; funcs->DrawRectangle = nvDrawRectangle2D; funcs->DrawLine = nvDrawLine2D; } state->set = DFXL_FILLRECTANGLE | DFXL_FILLTRIANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: nv_set_source( nvdrv, nvdev, state ); if (state->blittingflags & DSBLIT_MODULATE_ALPHA) { nv_set_blend_function( nvdrv, nvdev, state ); nv_set_blitting_color( nvdrv, nvdev, state ); } nv_set_blittingflags( nvdrv, nvdev, state ); if (accel == DFXL_TEXTRIANGLES) { if (nvdev->src_texture != state->src.buffer) nvdev->set &= ~SMF_SOURCE_TEXTURE; nvdev->src_texture = state->src.buffer; nvdev->state3d[1].modified = true; state->set = DFXL_TEXTRIANGLES; } else { state->set = DFXL_BLIT | DFXL_STRETCHBLIT; } break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } static void nv5SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; nvdev->set &= ~state->mod_hw; if (state->mod_hw & SMF_COLOR) nvdev->set &= ~(SMF_DRAWING_COLOR | SMF_BLITTING_COLOR); nv_set_destination( nvdrv, nvdev, state ); nv_set_clip( nvdrv, nvdev, state ); if (state->render_options & DSRO_MATRIX && !M_IDENTITY(state->matrix)) nvdev->matrix = state->matrix; else nvdev->matrix = NULL; switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: nv_set_drawing_color( nvdrv, nvdev, state ); if (state->drawingflags & DSDRAW_BLEND) nv_set_blend_function( nvdrv, nvdev, state ); nv_set_drawingflags( nvdrv, nvdev, state ); if ((state->drawingflags & DSDRAW_BLEND || nvdev->matrix) && nvdev->enabled_3d) { nvdev->state3d[0].modified = true; funcs->FillRectangle = nvFillRectangle3D; funcs->FillTriangle = nvFillTriangle3D; funcs->DrawRectangle = nvDrawRectangle3D; funcs->DrawLine = nvDrawLine3D; } else { funcs->FillRectangle = nvFillRectangle2D; funcs->FillTriangle = nvFillTriangle2D; funcs->DrawRectangle = nvDrawRectangle2D; funcs->DrawLine = nvDrawLine2D; } state->set = DFXL_FILLRECTANGLE | DFXL_FILLTRIANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: nv_set_source( nvdrv, nvdev, state ); if (state->blittingflags & DSBLIT_MODULATE) { nv_set_blend_function( nvdrv, nvdev, state ); nv_set_blitting_color( nvdrv, nvdev, state ); } nv_set_blittingflags( nvdrv, nvdev, state ); if (accel == DFXL_TEXTRIANGLES) { if (nvdev->src_texture != state->src.buffer) nvdev->set &= ~SMF_SOURCE_TEXTURE; nvdev->src_texture = state->src.buffer; nvdev->state3d[1].modified = true; state->set = DFXL_TEXTRIANGLES; } else { if (nvdev->src_system) { funcs->Blit = nvBlitFromCPU; funcs->StretchBlit = nvStretchBlitFromCPU; } else { funcs->Blit = nvBlit; funcs->StretchBlit = nvStretchBlit; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; } break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } static void nv10SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; nvdev->set &= ~state->mod_hw; if (state->mod_hw & SMF_COLOR) nvdev->set &= ~(SMF_DRAWING_COLOR | SMF_BLITTING_COLOR); nv_set_destination( nvdrv, nvdev, state ); nv_set_clip( nvdrv, nvdev, state ); if (state->render_options & DSRO_MATRIX && !M_IDENTITY(state->matrix)) nvdev->matrix = state->matrix; else nvdev->matrix = NULL; switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: nv_set_drawing_color( nvdrv, nvdev, state ); if (state->drawingflags & DSDRAW_BLEND) nv_set_blend_function( nvdrv, nvdev, state ); nv_set_drawingflags( nvdrv, nvdev, state ); if ((state->drawingflags & DSDRAW_BLEND || nvdev->matrix) && nvdev->enabled_3d) { nvdev->state3d[0].modified = true; funcs->FillRectangle = nvFillRectangle3D; funcs->FillTriangle = nvFillTriangle3D; funcs->DrawRectangle = nvDrawRectangle3D; funcs->DrawLine = nvDrawLine3D; } else { funcs->FillRectangle = nvFillRectangle2D; funcs->FillTriangle = nvFillTriangle2D; funcs->DrawRectangle = nvDrawRectangle2D; funcs->DrawLine = nvDrawLine2D; } state->set = DFXL_FILLRECTANGLE | DFXL_FILLTRIANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: case DFXL_TEXTRIANGLES: nv_set_source( nvdrv, nvdev, state ); if (state->blittingflags & DSBLIT_MODULATE) { nv_set_blend_function( nvdrv, nvdev, state ); nv_set_blitting_color( nvdrv, nvdev, state ); } nv_set_blittingflags( nvdrv, nvdev, state ); if (accel == DFXL_TEXTRIANGLES) { if (nvdev->src_texture != state->src.buffer) nvdev->set &= ~SMF_SOURCE_TEXTURE; nvdev->src_texture = state->src.buffer; nvdev->state3d[1].modified = true; state->set = DFXL_TEXTRIANGLES; } else { if (nvdev->src_system) { funcs->Blit = nvBlitFromCPU; funcs->StretchBlit = nvStretchBlitFromCPU; } else { funcs->Blit = nvBlit; funcs->StretchBlit = nvStretchBlit; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; } break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } static void nv20SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; nvdev->set &= ~state->mod_hw; if (state->mod_hw & SMF_COLOR) nvdev->set &= ~(SMF_DRAWING_COLOR | SMF_BLITTING_COLOR); nv_set_destination( nvdrv, nvdev, state ); nv_set_clip( nvdrv, nvdev, state ); if (state->render_options & DSRO_MATRIX && !M_IDENTITY(state->matrix)) nvdev->matrix = state->matrix; else nvdev->matrix = NULL; switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: nv_set_drawing_color( nvdrv, nvdev, state ); nv_set_drawingflags( nvdrv, nvdev, state ); state->set = DFXL_FILLRECTANGLE | DFXL_FILLTRIANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: case DFXL_STRETCHBLIT: nv_set_source( nvdrv, nvdev, state ); if (state->blittingflags & DSBLIT_MODULATE) { if (state->modified & SMF_SRC_BLEND) nvdev->set &= ~SMF_BLITTING_FLAGS; nv_set_blitting_color( nvdrv, nvdev, state ); } nv_set_blittingflags( nvdrv, nvdev, state ); if (nvdev->src_system) { funcs->Blit = nvBlitFromCPU; funcs->StretchBlit = nvStretchBlitFromCPU; } else { if (DFB_BITS_PER_PIXEL(nvdev->dst_format) == 8) nvdev->scaler_filter = SCALER_IN_FORMAT_ORIGIN_CORNER | SCALER_IN_FORMAT_FILTER_NEAREST; else nvdev->scaler_filter = SCALER_IN_FORMAT_ORIGIN_CENTER | SCALER_IN_FORMAT_FILTER_LINEAR; funcs->Blit = nvBlit; funcs->StretchBlit = nvStretchBlit; } state->set = DFXL_BLIT | DFXL_STRETCHBLIT; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } static void nv30SetState( void *drv, void *dev, GraphicsDeviceFuncs *funcs, CardState *state, DFBAccelerationMask accel ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) drv; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) dev; nvdev->set &= ~state->mod_hw; if (state->mod_hw & SMF_COLOR) nvdev->set &= ~(SMF_DRAWING_COLOR | SMF_BLITTING_COLOR); nv_set_destination( nvdrv, nvdev, state ); nv_set_clip( nvdrv, nvdev, state ); if (state->render_options & DSRO_MATRIX && !M_IDENTITY(state->matrix)) nvdev->matrix = state->matrix; else nvdev->matrix = NULL; switch (accel) { case DFXL_FILLRECTANGLE: case DFXL_FILLTRIANGLE: case DFXL_DRAWRECTANGLE: case DFXL_DRAWLINE: nv_set_drawing_color( nvdrv, nvdev, state ); nv_set_drawingflags( nvdrv, nvdev, state ); state->set = DFXL_FILLRECTANGLE | DFXL_FILLTRIANGLE | DFXL_DRAWRECTANGLE | DFXL_DRAWLINE; break; case DFXL_BLIT: nv_set_source( nvdrv, nvdev, state ); state->set = DFXL_BLIT; break; default: D_BUG( "unexpected drawing/blitting function" ); break; } state->mod_hw = 0; } /* exported symbols */ static int driver_probe( CoreGraphicsDevice *device ) { switch (dfb_gfxcard_get_accelerator( device )) { case FB_ACCEL_NV4: case FB_ACCEL_NV5: case FB_ACCEL_NV_10: case FB_ACCEL_NV_20: case FB_ACCEL_NV_30: case FB_ACCEL_NV_40: return 1; } return 0; } static void driver_get_info( CoreGraphicsDevice *device, GraphicsDriverInfo *info ) { /* fill driver info structure */ snprintf( info->name, DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "nVidia NV4/NV5/NV10/NV20/NV30 Driver" ); snprintf( info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" ); snprintf( info->url, DFB_GRAPHICS_DRIVER_INFO_URL_LENGTH, "http://www.directfb.org" ); snprintf( info->license, DFB_GRAPHICS_DRIVER_INFO_LICENSE_LENGTH, "LGPL" ); info->version.major = 0; info->version.minor = 6; info->driver_data_size = sizeof(NVidiaDriverData); info->device_data_size = sizeof(NVidiaDeviceData); } static void nv_find_architecture( NVidiaDriverData *nvdrv, u32 *ret_chip, u32 *ret_arch ) { unsigned int vendor_id; unsigned int device_id; unsigned int arch = 0; device_id = nv_in32( nvdrv->mmio_base, 0x00 ) >> 16; /* id:rev */ if (!device_id) { dfb_system_get_deviceid( &vendor_id, &device_id ); if (vendor_id != 0x10DE) { D_ERROR( "DirectFB/NVidia: Could not detect device id!\n" " -> Please, specify the bus location of" " the card by using the 'busid' option.\n" ); vendor_id = device_id = 0; } } switch (device_id & 0xFFF0) { case 0x0020: /* Riva TNT/TNT2 */ arch = (device_id == 0x0020) ? NV_ARCH_04 : NV_ARCH_05; break; case 0x0100: /* GeForce */ case 0x0110: /* GeForce2 MX */ case 0x0150: /* GeForce2 GTS/Ti/Ultra */ case 0x0170: /* GeForce4 MX/Go */ case 0x0180: /* GeForce4 MX/Go AGP8X */ //case 0x01A0: /* GeForce2 Integrated GPU */ //case 0x01F0: /* GeForce4 MX Integrated GPU */ arch = NV_ARCH_10; break; case 0x0200: /* GeForce3 */ case 0x0250: /* GeForce4 Ti */ case 0x0280: /* GeForce4 Ti AGP8X */ case 0x02A0: /* GeForce3 Integrated GPU (XBox) */ arch = NV_ARCH_20; break; case 0x0300: /* GeForce FX 5800 */ case 0x0310: /* GeForce FX 5600 */ case 0x0320: /* GeForce FX 5200 */ case 0x0330: /* GeForce FX 5900 */ case 0x0340: /* GeForce FX 5700 */ arch = NV_ARCH_30; break; default: break; } if (ret_chip) *ret_chip = device_id; if (ret_arch) *ret_arch = arch; } static DFBResult driver_init_driver( CoreGraphicsDevice *device, GraphicsDeviceFuncs *funcs, void *driver_data, void *device_data, CoreDFB *core ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) device_data; u32 arch = 0; nvdrv->device = device; nvdrv->device_data = device_data; nvdrv->fb_base = (volatile void*) dfb_gfxcard_memory_virtual( device, 0 ); nvdrv->agp_base = (volatile void*) dfb_gfxcard_auxmemory_virtual( device, 0 ); nvdrv->mmio_base = (volatile void*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!nvdrv->mmio_base) return DFB_IO; if (nvdev->use_dma) { nvdrv->dma_base = nvdev->use_agp ? nvdrv->agp_base : nvdrv->fb_base; nvdrv->dma_base += nvdev->dma_offset; } funcs->AfterSetVar = nvAfterSetVar; funcs->EngineReset = nvEngineReset; funcs->EngineSync = nvEngineSync; funcs->EmitCommands = nvEmitCommands; funcs->FillRectangle = nvFillRectangle2D; // dynamic funcs->FillTriangle = nvFillTriangle2D; // dynamic funcs->DrawRectangle = nvDrawRectangle2D; // dynamic funcs->DrawLine = nvDrawLine2D; // dynamic funcs->Blit = nvBlit; // dynamic nv_find_architecture( nvdrv, NULL, &arch ); switch (arch) { case NV_ARCH_04: funcs->FlushTextureCache = nvFlushTextureCache; funcs->CheckState = nv4CheckState; funcs->SetState = nv4SetState; funcs->StretchBlit = nvStretchBlit; funcs->TextureTriangles = nvTextureTriangles; break; case NV_ARCH_05: funcs->FlushTextureCache = nvFlushTextureCache; funcs->CheckState = nv5CheckState; funcs->SetState = nv5SetState; funcs->StretchBlit = nvStretchBlit; funcs->TextureTriangles = nvTextureTriangles; break; case NV_ARCH_10: funcs->FlushTextureCache = nvFlushTextureCache; funcs->CheckState = nv10CheckState; funcs->SetState = nv10SetState; funcs->StretchBlit = nvStretchBlit; funcs->TextureTriangles = nvTextureTriangles; break; case NV_ARCH_20: funcs->CheckState = nv20CheckState; funcs->SetState = nv20SetState; funcs->StretchBlit = nvStretchBlit; break; case NV_ARCH_30: funcs->CheckState = nv30CheckState; funcs->SetState = nv30SetState; break; default: funcs->AfterSetVar = NULL; funcs->EngineReset = NULL; break; } dfb_screens_hook_primary( device, driver_data, &nvidiaPrimaryScreenFuncs, &OldPrimaryScreenFuncs, &OldPrimaryScreenDriverData ); dfb_layers_hook_primary( device, driver_data, &nvidiaPrimaryLayerFuncs, &OldPrimaryLayerFuncs, &OldPrimaryLayerDriverData ); dfb_layers_register( dfb_screens_at( DSCID_PRIMARY ), driver_data, &nvidiaOverlayFuncs ); return DFB_OK; } static DFBResult driver_init_device( CoreGraphicsDevice *device, GraphicsDeviceInfo *device_info, void *driver_data, void *device_data ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) device_data; int ram_total = dfb_system_videoram_length(); int ram_used = dfb_gfxcard_memory_length(); nv_find_architecture( nvdrv, &nvdev->chip, &nvdev->arch ); snprintf( device_info->name, DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "NV%02X (%04x)", (nvdev->chip >> 4) & 0xFF, nvdev->chip ); snprintf( device_info->vendor, DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "nVidia" ); switch (nvdev->arch) { case NV_ARCH_04: device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS; device_info->caps.accel = NV4_SUPPORTED_DRAWINGFUNCTIONS | NV4_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = NV4_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = NV4_SUPPORTED_BLITTINGFLAGS; break; case NV_ARCH_05: device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS /*| CCF_READSYSMEM*/; device_info->caps.accel = NV5_SUPPORTED_DRAWINGFUNCTIONS | NV5_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = NV5_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = NV5_SUPPORTED_BLITTINGFLAGS; break; case NV_ARCH_10: device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS /*| CCF_READSYSMEM*/; device_info->caps.accel = NV10_SUPPORTED_DRAWINGFUNCTIONS | NV10_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = NV10_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = NV10_SUPPORTED_BLITTINGFLAGS; break; case NV_ARCH_20: device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS /* | CCF_READSYSMEM*/; /* Crash reported when the flag is on. */ device_info->caps.accel = NV20_SUPPORTED_DRAWINGFUNCTIONS | NV20_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = NV20_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = NV20_SUPPORTED_BLITTINGFLAGS; break; case NV_ARCH_30: device_info->caps.flags = CCF_CLIPPING | CCF_RENDEROPTS; device_info->caps.accel = NV30_SUPPORTED_DRAWINGFUNCTIONS | NV30_SUPPORTED_BLITTINGFUNCTIONS; device_info->caps.drawing = NV30_SUPPORTED_DRAWINGFLAGS; device_info->caps.blitting = NV30_SUPPORTED_BLITTINGFLAGS; break; default: device_info->caps.flags = 0; device_info->caps.accel = 0; device_info->caps.drawing = 0; device_info->caps.blitting = 0; break; } device_info->limits.surface_byteoffset_alignment = 64; device_info->limits.surface_pixelpitch_alignment = 32; dfb_config->pollvsync_after = 1; /* GeForce3 Intergrated GPU (XBox) */ if (nvdev->chip == 0x02A0) { nvdev->fb_offset = (long)nvdrv->fb_base & 0x0FFFFFFF; ram_total += nvdev->fb_offset; } nvdev->fb_size = 1 << direct_log2( ram_total ); /* skip if unsupported arch (NV40) */ if (!nvdev->arch) return DFB_OK; nvdev->agp_offset = dfb_gfxcard_auxmemory_physical( nvdrv->device, 0 ); if (dfb_config->dma) { int offset = -1; if (dfb_gfxcard_auxmemory_length() >= 64*1024) { offset = dfb_gfxcard_reserve_auxmemory( nvdrv->device, 64*1024 ); if (offset < 0) { D_ERROR( "DirectFB/NVidia: " "couldn't reserve 64Kb of agp memory!\n" ); } else { nvdev->use_agp = true; nvdev->use_dma = true; nvdev->dma_size = 64*1024; nvdev->dma_offset = offset; nvdrv->dma_base = nvdrv->agp_base + offset; } } if (offset < 0) { int len; len = 32*1024 + ((ram_used - 32*1024) & 0x1FFFF); offset = dfb_gfxcard_reserve_memory( nvdrv->device, len ); if (offset < 0) { D_ERROR( "DirectFB/NVidia: " "couldn't reserve %d bytes of video memory!\n", len ); } else { nvdev->use_dma = true; nvdev->dma_size = 32*1024; nvdev->dma_offset = offset; nvdrv->dma_base = nvdrv->fb_base + offset; ram_used -= len; } } D_INFO ( "DirectFB/NVidia: DMA acceleration %s.\n", nvdev->use_dma ? "enabled" : "disabled" ); D_DEBUG( "DirectFB/NVidia: DMA target is %s.\n", nvdev->use_agp ? "AGP" : "NVM" ); } /* reserve memory for textures/color buffers */ if (device_info->caps.accel & DFXL_TEXTRIANGLES) { unsigned tex_size; int len, offset; /* if we have more than 32MB of video memory, use a 1024x1024 texture */ if (ram_used > (32 << 20)) tex_size = 1024*1024; /* if we have more than 16MB of video memory, use a 1024x512 texture */ else if (ram_used > (16 << 20)) tex_size = 1024*512; /* otherwise use a 512x512 texture */ else tex_size = 512*512; len = tex_size*2 + 8; len += (ram_used - len) & 0xFF; offset = dfb_gfxcard_reserve_memory( nvdrv->device, len ); if (offset < 0) { /* if video memory allocation failed, disable 3d acceleration */ D_ERROR( "DirectFB/NVidia: " "couldn't reserve %d bytes of video memory!\n", len ); D_INFO( "DirectFB/NVidia: 3D acceleration disabled.\n" ); device_info->caps.accel &= ~DFXL_TEXTRIANGLES; } else { D_DEBUG( "DirectFB/NVidia: " "reserved %d bytes for 3D buffers at offset 0x%08x.\n", len, offset ); nvdev->enabled_3d = true; nvdev->buf_offset[0] = offset + tex_size*2; // color nvdev->buf_offset[1] = offset; // texture nvdev->max_texture_size = tex_size; } } if (nvdev->enabled_3d) { /* set default 3d state for drawing functions */ nvdev->state3d[0].modified = true; nvdev->state3d[0].colorkey = 0; nvdev->state3d[0].offset = nvdev->fb_offset + nvdev->buf_offset[0]; nvdev->state3d[0].format = TXTRI_FORMAT_CONTEXT_DMA_A | TXTRI_FORMAT_ORIGIN_ZOH_CORNER | TXTRI_FORMAT_ORIGIN_FOH_CORNER | TXTRI_FORMAT_COLOR_R5G6B5 | TXTRI_FORMAT_U_WRAP | TXTRI_FORMAT_V_WRAP | 0x00111000; // 2x2 nvdev->state3d[0].filter = TXTRI_FILTER_TEXTUREMIN_NEAREST | TXTRI_FILTER_TEXTUREMAG_NEAREST; nvdev->state3d[0].blend = TXTRI_BLEND_TEXTUREMAPBLEND_MODULATEALPHA | TXTRI_BLEND_OPERATION_MUX_TALPHAMSB | TXTRI_BLEND_SHADEMODE_FLAT | TXTRI_BLEND_SRCBLEND_ONE | TXTRI_BLEND_DESTBLEND_ZERO; nvdev->state3d[0].control = TXTRI_CONTROL_ALPHAFUNC_ALWAYS | TXTRI_CONTROL_ORIGIN_CORNER | TXTRI_CONTROL_ZFUNC_ALWAYS | TXTRI_CONTROL_CULLMODE_NONE | TXTRI_CONTROL_Z_FORMAT_FIXED; nvdev->state3d[0].fog = 0; /* set default 3d state for blitting functions */ nvdev->state3d[1].modified = true; nvdev->state3d[1].colorkey = 0; nvdev->state3d[1].offset = nvdev->fb_offset + nvdev->buf_offset[1]; nvdev->state3d[1].format = TXTRI_FORMAT_CONTEXT_DMA_A | TXTRI_FORMAT_ORIGIN_ZOH_CORNER | TXTRI_FORMAT_ORIGIN_FOH_CORNER | TXTRI_FORMAT_COLOR_R5G6B5 | TXTRI_FORMAT_U_CLAMP | TXTRI_FORMAT_V_CLAMP | 0x00001000; nvdev->state3d[1].filter = TXTRI_FILTER_TEXTUREMIN_LINEAR | TXTRI_FILTER_TEXTUREMAG_LINEAR; nvdev->state3d[1].blend = TXTRI_BLEND_TEXTUREMAPBLEND_COPY | TXTRI_BLEND_OPERATION_MUX_TALPHAMSB | TXTRI_BLEND_SHADEMODE_GOURAUD | TXTRI_BLEND_TEXTUREPERSPECTIVE_ENABLE | TXTRI_BLEND_SRCBLEND_ONE | TXTRI_BLEND_DESTBLEND_ZERO; nvdev->state3d[1].control = TXTRI_CONTROL_ALPHAFUNC_ALWAYS | TXTRI_CONTROL_ORIGIN_CENTER | TXTRI_CONTROL_ZFUNC_ALWAYS | TXTRI_CONTROL_CULLMODE_NONE | TXTRI_CONTROL_DITHER_ENABLE | TXTRI_CONTROL_Z_FORMAT_FIXED; nvdev->state3d[1].fog = 0; /* clear color buffer */ memset( dfb_gfxcard_memory_virtual( device, nvdev->buf_offset[0] ), 0xFF, 8 ); } /* write dma objects configuration */ nv_store_dma( nvdrv, OBJ_DMA_IN, ADDR_DMA_IN, 0x00, DMA_FLAG_PAGE_TABLE | DMA_FLAG_PAGE_ENTRY_LINEAR | DMA_FLAG_ACCESS_RDWR | DMA_FLAG_TARGET_NVM, nvdev->fb_size, 0x00000000, DMA_FRAME_ACCESS_RDWR ); if (nvdev->use_dma) { if (nvdev->use_agp) { nv_store_dma( nvdrv, OBJ_DMA_OUT, ADDR_DMA_OUT, 0x02, DMA_FLAG_PAGE_TABLE | DMA_FLAG_PAGE_ENTRY_LINEAR | DMA_FLAG_ACCESS_RDWR | DMA_FLAG_TARGET_AGP, nvdev->dma_size, nvdev->agp_offset+nvdev->dma_offset, DMA_FRAME_ACCESS_RDWR ); } else { nv_store_dma( nvdrv, OBJ_DMA_OUT, ADDR_DMA_OUT, 0x02, DMA_FLAG_PAGE_TABLE | DMA_FLAG_PAGE_ENTRY_LINEAR | DMA_FLAG_ACCESS_RDWR | DMA_FLAG_TARGET_NVM, nvdev->dma_size, nvdev->fb_offset+nvdev->dma_offset, DMA_FRAME_ACCESS_RDWR ); } } /* write graphics objects configuration */ nv_store_object( nvdrv, OBJ_SURFACES2D, ADDR_SURFACES2D, 0x42, 0, 0, 0 ); nv_store_object( nvdrv, OBJ_CLIP, ADDR_CLIP, 0x19, 0, 0, 0 ); nv_store_object( nvdrv, OBJ_BETA1, ADDR_BETA1, 0x12, 0, 0, 0 ); nv_store_object( nvdrv, OBJ_BETA4, ADDR_BETA4, 0x72, 0, 0, 0 ); nv_store_object( nvdrv, OBJ_RECTANGLE, ADDR_RECTANGLE, 0x5E, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_TRIANGLE, ADDR_TRIANGLE, 0x5D, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_LINE, ADDR_LINE, 0x5C, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH, ADDR_DMA_IN, ADDR_DMA_IN ); switch (nvdev->arch) { case NV_ARCH_04: nv_store_object( nvdrv, OBJ_SCREENBLT, ADDR_SCREENBLT, 0x1F, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SCALEDIMAGE, ADDR_SCALEDIMAGE, 0x37, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_COPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_TEXTRIANGLE, ADDR_TEXTRIANGLE, 0x54, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_COPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SURFACES3D, ADDR_SURFACES3D, 0x53, 0, 0, 0 ); break; case NV_ARCH_05: nv_store_object( nvdrv, OBJ_SCREENBLT, ADDR_SCREENBLT, 0x5F, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_IMAGEBLT, ADDR_IMAGEBLT, 0x65, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SCALEDIMAGE, ADDR_SCALEDIMAGE, 0x63, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_STRETCHEDIMAGE, ADDR_STRETCHEDIMAGE, 0x66, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_TEXTRIANGLE, ADDR_TEXTRIANGLE, 0x54, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SURFACES3D, ADDR_SURFACES3D, 0x53, 0, 0, 0 ); break; case NV_ARCH_10: nv_store_object( nvdrv, OBJ_SCREENBLT, ADDR_SCREENBLT, 0x5F, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_IMAGEBLT, ADDR_IMAGEBLT, 0x65, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SCALEDIMAGE, ADDR_SCALEDIMAGE, 0x89, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_STRETCHEDIMAGE, ADDR_STRETCHEDIMAGE, 0x66, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_TEXTRIANGLE, ADDR_TEXTRIANGLE, 0x94, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SURFACES3D, ADDR_SURFACES3D, 0x93, 0, 0, 0 ); break; case NV_ARCH_20: case NV_ARCH_30: default: nv_store_object( nvdrv, OBJ_SCREENBLT, ADDR_SCREENBLT, 0x9F, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_IMAGEBLT, ADDR_IMAGEBLT, 0x65, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SCALEDIMAGE, ADDR_SCALEDIMAGE, 0x89, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_STRETCHEDIMAGE, ADDR_STRETCHEDIMAGE, 0x66, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CONVERSION_DITHER | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_TEXTRIANGLE, ADDR_TEXTRIANGLE, 0x94, CTX_FLAG_USER_CLIP | CTX_FLAG_PATCH_SRCCOPY | CTX_FLAG_PATCH | CTX_FLAG_CTX_SURFACE0, ADDR_DMA_IN, ADDR_DMA_IN ); nv_store_object( nvdrv, OBJ_SURFACES3D, ADDR_SURFACES3D, 0x93, 0, 0, 0 ); break; } /* assign default objects to subchannels */ nvdev->subchannel_object[SUBC_SURFACES2D] = OBJ_SURFACES2D; nvdev->subchannel_object[SUBC_CLIP] = OBJ_CLIP; nvdev->subchannel_object[SUBC_RECTANGLE] = OBJ_RECTANGLE; nvdev->subchannel_object[SUBC_TRIANGLE] = OBJ_TRIANGLE; nvdev->subchannel_object[SUBC_LINE] = OBJ_LINE; nvdev->subchannel_object[SUBC_SCREENBLT] = OBJ_SCREENBLT; nvdev->subchannel_object[SUBC_SCALEDIMAGE] = OBJ_SCALEDIMAGE; nvdev->subchannel_object[SUBC_TEXTRIANGLE] = OBJ_TEXTRIANGLE; if (nvdev->arch == NV_ARCH_04) { nvdev->drawing_operation = OPERATION_COPY; nvdev->scaler_operation = OPERATION_COPY; nvdev->scaler_filter = 0; nvdev->system_operation = OPERATION_COPY; } else { nvdev->drawing_operation = OPERATION_SRCCOPY; nvdev->scaler_operation = OPERATION_SRCCOPY; nvdev->scaler_filter = SCALER_IN_FORMAT_ORIGIN_CENTER | SCALER_IN_FORMAT_FILTER_LINEAR; nvdev->system_operation = OPERATION_SRCCOPY; } nvAfterSetVar( driver_data, device_data ); return DFB_OK; } static void driver_close_device( CoreGraphicsDevice *device, void *driver_data, void *device_data ) { NVidiaDeviceData *nvdev = (NVidiaDeviceData*) device_data; D_DEBUG( "DirectFB/NVidia: Performance Monitoring:\n" ); D_DEBUG( "DirectFB/NVidia: %9d nv_wait* calls\n", nvdev->waitfree_calls ); D_DEBUG( "DirectFB/NVidia: %9d register writes\n", nvdev->waitfree_sum ); D_DEBUG( "DirectFB/NVidia: %9d FIFO/DMA wait cycles (depends on CPU)\n", nvdev->free_waitcycles ); D_DEBUG( "DirectFB/NVidia: %9d IDLE wait cycles (depends on CPU)\n", nvdev->idle_waitcycles ); D_DEBUG( "DirectFB/NVidia: %9d FIFO/DMA space cache hits (depends on CPU)\n", nvdev->cache_hits ); D_DEBUG( "DirectFB/NVidia: Conclusion:\n" ); D_DEBUG( "DirectFB/NVidia: Average register writes/nv_wait* call:%.2f\n", nvdev->waitfree_sum/(float)(nvdev->waitfree_calls ? : 1) ); D_DEBUG( "DirectFB/NVidia: Average wait cycles/nv_wait* call: %.2f\n", nvdev->free_waitcycles/(float)(nvdev->waitfree_calls ? : 1) ); D_DEBUG( "DirectFB/NVidia: Average FIFO/DMA space cache hits: %02d%%\n", (int)(100 * nvdev->cache_hits/ (float)(nvdev->waitfree_calls ? : 1)) ); /* reset channel mode to PIO to avoid crash in rivafb */ if (nvdev->use_dma) { nvdev->use_dma = false; nvAfterSetVar( driver_data, device_data ); } } static void driver_close_driver( CoreGraphicsDevice *device, void *driver_data ) { NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; dfb_gfxcard_unmap_mmio( device, nvdrv->mmio_base, -1 ); } DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_2d.h0000644000175000017500000000346111245562152015612 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NVIDIA_2D_H__ #define __NVIDIA_2D_H__ bool nvFillRectangle2D( void *drv, void *dev, DFBRectangle *rect ); bool nvFillTriangle2D( void *drv, void *dev, DFBTriangle *tri ); bool nvDrawRectangle2D( void *drv, void *dev, DFBRectangle *rect ); bool nvDrawLine2D( void *drv, void *dev, DFBRegion *line ); bool nvBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); bool nvBlitFromCPU( void *drv, void *dev, DFBRectangle *rect, int dx, int dy ); bool nvStretchBlit( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ); bool nvStretchBlitFromCPU( void *drv, void *dev, DFBRectangle *sr, DFBRectangle *dr ); #endif /* __NVIDIA_2D_H__ */ DirectFB-1.2.10/gfxdrivers/nvidia/nvidia_state.c0000644000175000017500000006446711245562152016435 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "nvidia.h" #include "nvidia_regs.h" #include "nvidia_accel.h" #include "nvidia_objects.h" #include "nvidia_state.h" #define NVIDIA_IS_SET( flag ) ((nvdev->set & SMF_##flag) == SMF_##flag) #define NVIDIA_SET( flag ) nvdev->set |= SMF_##flag #define NVIDIA_UNSET( flag ) nvdev->set &= ~SMF_##flag void nv_set_destination( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { CoreSurface *surface = state->destination; volatile u8 *mmio = nvdrv->mmio_base; u32 dst_offset; u32 dst_pitch; u32 src_pitch; if (NVIDIA_IS_SET( DESTINATION )) return; dst_offset = (state->dst.offset + nvdev->fb_offset) & ~63; dst_pitch = state->dst.pitch & ~31; src_pitch = (nvdev->src_pitch & ~31) ? : 32; // align to 32, maybe system buffer pitch if (nvdev->dst_format != surface->config.format) { u32 sformat2D = 0; u32 sformat3D = 0; u32 cformat = 0; bool dst_422 = false; switch (surface->config.format) { case DSPF_A8: case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: sformat2D = SURFACES2D_FORMAT_Y8; cformat = RECT_COLOR_FORMAT_Y32; break; case DSPF_RGB555: sformat2D = SURFACES2D_FORMAT_X1R5G5B5; sformat3D = SURFACES3D_FORMAT_COLOR_X1R5G5B5; cformat = RECT_COLOR_FORMAT_A1Y15; break; case DSPF_ARGB1555: sformat2D = SURFACES2D_FORMAT_A1R5G5B5; sformat3D = SURFACES3D_FORMAT_COLOR_A1R5G5B5; cformat = RECT_COLOR_FORMAT_A1Y15; break; case DSPF_RGB16: sformat2D = SURFACES2D_FORMAT_R5G6B5; sformat3D = SURFACES3D_FORMAT_COLOR_R5G6B5; cformat = RECT_COLOR_FORMAT_Y16; break; case DSPF_RGB32: sformat2D = SURFACES2D_FORMAT_X8R8G8B8; sformat3D = SURAFCES3D_FORMAT_COLOR_X8R8G8B8; cformat = RECT_COLOR_FORMAT_Y32; break; case DSPF_ARGB: sformat2D = SURFACES2D_FORMAT_A8R8G8B8; sformat3D = SURFACES3D_FORMAT_COLOR_A8R8G8B8; cformat = 0x0D; break; case DSPF_YUY2: sformat2D = SURFACES2D_FORMAT_A8R8G8B8; cformat = 0x12; dst_422 = true; break; case DSPF_UYVY: sformat2D = SURFACES2D_FORMAT_A8R8G8B8; cformat = 0x13; dst_422 = true; break; default: D_BUG( "unexpected pixelformat" ); return; } if (sformat2D == SURFACES2D_FORMAT_A8R8G8B8) { /* need to set color format manually */ nv_waitidle( nvdrv, nvdev ); nv_out32( mmio, PRAMIN + (ADDR_RECTANGLE << 4) + 4, cformat << 8 ); nv_out32( mmio, PRAMIN + (ADDR_TRIANGLE << 4) + 4, cformat << 8 ); nv_out32( mmio, PRAMIN + (ADDR_LINE << 4) + 4, cformat << 8 ); nv_assign_object( nvdrv, nvdev, SUBC_RECTANGLE, OBJ_RECTANGLE, true ); nv_assign_object( nvdrv, nvdev, SUBC_TRIANGLE, OBJ_TRIANGLE, true ); nv_assign_object( nvdrv, nvdev, SUBC_LINE, OBJ_LINE, true ); } else { nv_begin( SUBC_RECTANGLE, RECT_COLOR_FORMAT, 1 ); nv_outr( cformat ); nv_begin( SUBC_TRIANGLE, TRI_COLOR_FORMAT, 1 ); nv_outr( cformat ); nv_begin( SUBC_LINE, LINE_COLOR_FORMAT, 1 ); nv_outr( cformat ); } nv_assign_object( nvdrv, nvdev, SUBC_SURFACES2D, OBJ_SURFACES2D, false ); nv_begin( SUBC_SURFACES2D, SURFACES2D_FORMAT, 2 ); nv_outr( sformat2D ); nv_outr( (dst_pitch << 16) | (src_pitch & 0xFFFF) ); nv_begin( SUBC_SURFACES2D, SURFACES2D_DST_OFFSET, 1 ); nv_outr( dst_offset ); if (nvdev->enabled_3d && sformat3D) { nv_assign_object( nvdrv, nvdev, SUBC_SURFACES3D, OBJ_SURFACES3D, false ); nv_begin( SUBC_SURFACES3D, SURFACES3D_FORMAT, 1 ); nv_outr( sformat3D | SURFACES3D_FORMAT_TYPE_PITCH ); nv_begin( SUBC_SURFACES3D, SURFACES3D_PITCH, 2 ); nv_outr( (64 << 16) | (dst_pitch & 0xFFFF) ); nv_outr( dst_offset ); } if (nvdev->dst_422 != dst_422) { NVIDIA_UNSET( CLIP ); NVIDIA_UNSET( BLITTING_FLAGS ); nvdev->dst_422 = dst_422; } NVIDIA_UNSET( COLOR ); NVIDIA_UNSET( DST_BLEND ); } else if (nvdev->dst_offset != dst_offset || nvdev->dst_pitch != dst_pitch) { nv_assign_object( nvdrv, nvdev, SUBC_SURFACES2D, OBJ_SURFACES2D, false ); nv_begin( SUBC_SURFACES2D, SURFACES2D_PITCH, 1 ); nv_outr( (dst_pitch << 16) | (src_pitch & 0xFFFF) ); nv_begin( SUBC_SURFACES2D, SURFACES2D_DST_OFFSET, 1 ); nv_outr( dst_offset ); if (nvdev->enabled_3d) { nv_assign_object( nvdrv, nvdev, SUBC_SURFACES3D, OBJ_SURFACES3D, false ); nv_begin( SUBC_SURFACES3D, SURFACES3D_PITCH, 2 ); nv_outr( (64 << 16) | (dst_pitch & 0xFFFF) ); nv_outr( dst_offset ); } } nvdev->dst_format = surface->config.format; nvdev->dst_offset = dst_offset; nvdev->dst_pitch = dst_pitch; NVIDIA_SET( DESTINATION ); } void nv_set_source( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { CoreSurface *surface = state->source; nvdev->src_lock = &state->src; if (NVIDIA_IS_SET( SOURCE )) { if ((state->blittingflags & DSBLIT_DEINTERLACE) == (nvdev->blittingflags & DSBLIT_DEINTERLACE)) return; } if (state->src.buffer->policy == CSP_SYSTEMONLY) { if (!nvdev->src_system) { nv_assign_object( nvdrv, nvdev, SUBC_IMAGEBLT, OBJ_IMAGEBLT, false ); nv_assign_object( nvdrv, nvdev, SUBC_STRETCHEDIMAGE, OBJ_STRETCHEDIMAGE, false ); NVIDIA_UNSET( BLITTING_FLAGS ); } nvdev->src_address = state->src.addr; nvdev->src_pitch = state->src.pitch; nvdev->src_system = true; } else { u32 src_offset = (state->src.offset + nvdev->fb_offset) & ~63; u32 src_pitch = state->src.pitch & ~31; if (nvdev->src_offset != src_offset || nvdev->src_pitch != src_pitch) { nv_assign_object( nvdrv, nvdev, SUBC_SURFACES2D, OBJ_SURFACES2D, false ); nv_begin( SUBC_SURFACES2D, SURFACES2D_PITCH, 2 ); nv_outr( (nvdev->dst_pitch << 16) | (src_pitch & 0xFFFF) ); nv_outr( src_offset ); } if (nvdev->src_system) { nv_assign_object( nvdrv, nvdev, SUBC_SCREENBLT, OBJ_SCREENBLT, false ); nv_assign_object( nvdrv, nvdev, SUBC_SCALEDIMAGE, OBJ_SCALEDIMAGE, false ); NVIDIA_UNSET( BLITTING_FLAGS ); } nvdev->src_offset = src_offset; nvdev->src_pitch = src_pitch; nvdev->src_system = false; } nvdev->src_width = surface->config.size.w; nvdev->src_height = surface->config.size.h; if (state->blittingflags & DSBLIT_DEINTERLACE) { nvdev->src_height /= 2; if (surface->config.caps & DSCAPS_SEPARATED) { if (surface->field) { nvdev->src_address += nvdev->src_height * nvdev->src_pitch; nvdev->src_offset += nvdev->src_height * nvdev->src_pitch; } } else { if (surface->field) { nvdev->src_address += nvdev->src_pitch; nvdev->src_offset += nvdev->src_pitch; } nvdev->src_pitch *= 2; } nvdev->src_interlaced = true; } else nvdev->src_interlaced = false; if (nvdev->enabled_3d) { u32 size_u = direct_log2(surface->config.size.w) & 0xF; u32 size_v = direct_log2(surface->config.size.h) & 0xF; nvdev->state3d[1].offset = nvdev->fb_offset + nvdev->buf_offset[1]; nvdev->state3d[1].format &= 0xFF00FFFF; nvdev->state3d[1].format |= (size_u << 16) | (size_v << 20); } if (nvdev->src_format != surface->config.format) { NVIDIA_UNSET( SRC_BLEND ); NVIDIA_UNSET( BLITTING_FLAGS ); nvdev->src_format = surface->config.format; } NVIDIA_SET( SOURCE ); } void nv_set_clip( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { DFBRectangle *cr = &nvdev->clip; if (NVIDIA_IS_SET( CLIP )) return; cr->x = state->clip.x1; cr->y = state->clip.y1; cr->w = state->clip.x2 - state->clip.x1 + 1; cr->h = state->clip.y2 - state->clip.y1 + 1; if (nvdev->dst_422) { cr->x = cr->x / 2; cr->w = (cr->w / 2) ? : 1; } nv_begin( SUBC_CLIP, CLIP_TOP_LEFT, 2 ); nv_outr( (cr->y << 16) | (cr->x & 0xFFFF) ); nv_outr( (cr->h << 16) | (cr->w & 0xFFFF) ); NVIDIA_SET( CLIP ); } void nv_set_drawing_color( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { DFBColor color = state->color; int y, u, v; if (NVIDIA_IS_SET( DRAWING_COLOR ) && NVIDIA_IS_SET( DRAWING_FLAGS )) return; switch (nvdev->dst_format) { case DSPF_A8: nvdev->color2d = color.a; break; case DSPF_LUT8: nvdev->color2d = state->color_index; break; case DSPF_ALUT44: nvdev->color2d = (state->color_index & 0x0F) | (state->color.a & 0xF0); break; case DSPF_RGB332: nvdev->color2d = PIXEL_RGB332( color.r, color.g, color.b ); break; case DSPF_RGB555: case DSPF_ARGB1555: nvdev->color2d = PIXEL_ARGB1555( color.a, color.r, color.g, color.b ); break; case DSPF_RGB16: nvdev->color2d = PIXEL_RGB16( color.r, color.g, color.b ); break; case DSPF_RGB32: nvdev->color2d = PIXEL_RGB32( color.r, color.g, color.b ); break; case DSPF_ARGB: nvdev->color2d = PIXEL_ARGB( color.a, color.r, color.g, color.b ); break; case DSPF_YUY2: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); nvdev->color2d = PIXEL_YUY2( y, u, v ); break; case DSPF_UYVY: RGB_TO_YCBCR( color.r, color.g, color.b, y, u, v ); nvdev->color2d = PIXEL_UYVY( y, u, v ); break; default: D_BUG( "unexpected pixelformat" ); break; } nvdev->color3d = PIXEL_ARGB(color.a, color.r, color.g, color.b); if (nvdev->dst_format == DSPF_ARGB1555) { nv_assign_object( nvdrv, nvdev, SUBC_SURFACES2D, OBJ_SURFACES2D, false ); nv_begin( SUBC_SURFACES2D, SURFACES2D_FORMAT, 1 ); nv_outr( (nvdev->color2d & 0x8000) ? SURFACES2D_FORMAT_A1R5G5B5 : SURFACES2D_FORMAT_X1R5G5B5 ); } if (state->drawingflags & DSDRAW_BLEND && !nvdev->enabled_3d) { if (!nvdev->beta1_set || nvdev->beta1_val != (color.a << 23)) { nv_assign_object( nvdrv, nvdev, SUBC_BETA1, OBJ_BETA1, false ); nv_begin( SUBC_BETA1, BETA1_FACTOR, 1 ); nv_outr( color.a << 23 ); nvdev->beta1_val = color.a << 23; nvdev->beta1_set = true; } } NVIDIA_SET ( DRAWING_COLOR ); NVIDIA_UNSET( BLITTING_COLOR ); } void nv_set_blitting_color( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { DFBColor color = state->color; if (NVIDIA_IS_SET( BLITTING_COLOR ) && NVIDIA_IS_SET( BLITTING_FLAGS )) return; if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR) || (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL && state->src_blend == DSBF_ONE)) { nvdev->color3d = (state->blittingflags & DSBLIT_BLEND_COLORALPHA) ? (color.a << 24) : 0xFF000000; if (state->blittingflags & DSBLIT_COLORIZE && state->blittingflags & (DSBLIT_SRC_PREMULTCOLOR | DSBLIT_BLEND_COLORALPHA)) { nvdev->color3d |= PIXEL_RGB32( color.r * color.a / 0xFF, color.g * color.a / 0xFF, color.b * color.a / 0xFF ); } else if (state->blittingflags & DSBLIT_COLORIZE) { nvdev->color3d |= PIXEL_RGB32( color.r, color.g, color.b ); } else if (state->blittingflags & (DSBLIT_SRC_PREMULTCOLOR | DSBLIT_BLEND_COLORALPHA)) { nvdev->color3d |= PIXEL_RGB32( color.a, color.a, color.a ); } else { nvdev->color3d |= 0x00FFFFFF; } if (!nvdev->beta4_set || nvdev->beta4_val != nvdev->color3d) { nv_assign_object( nvdrv, nvdev, SUBC_BETA4, OBJ_BETA4, false ); nv_begin( SUBC_BETA4, BETA4_FACTOR, 1 ); nv_outr( nvdev->color3d ); nvdev->beta4_val = nvdev->color3d; nvdev->beta4_set = true; } } else if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL)) { u32 beta1; if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { nvdev->color3d = (color.a << 24) | 0x00FFFFFF; beta1 = color.a << 23; } else { nvdev->color3d = 0xFFFFFFFF; beta1 = 0x7F800000; } if (!nvdev->beta1_set || nvdev->beta1_val != beta1) { nv_assign_object( nvdrv, nvdev, SUBC_BETA1, OBJ_BETA1, false ); nv_begin( SUBC_BETA1, BETA1_FACTOR, 1 ); nv_outr( beta1 ); nvdev->beta1_val = beta1; nvdev->beta1_set = true; } } NVIDIA_SET ( BLITTING_COLOR ); NVIDIA_UNSET( DRAWING_COLOR ); } void nv_set_blend_function( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { DFBSurfaceBlendFunction sblend, dblend; if (NVIDIA_IS_SET( SRC_BLEND ) && NVIDIA_IS_SET( DST_BLEND )) return; sblend = state->src_blend; dblend = state->dst_blend; if (!DFB_PIXELFORMAT_HAS_ALPHA(nvdev->dst_format)) { if (sblend == DSBF_DESTALPHA) sblend = DSBF_ONE; else if (sblend == DSBF_INVDESTALPHA) sblend = DSBF_ZERO; if (dblend == DSBF_DESTALPHA) dblend = DSBF_ONE; else if (dblend == DSBF_INVDESTALPHA) dblend = DSBF_ZERO; } nvdev->state3d[0].blend &= 0x00FFFFFF; nvdev->state3d[0].blend |= (sblend << 24) | (dblend << 28); nvdev->state3d[1].blend &= 0x00FFFFFF; nvdev->state3d[1].blend |= (sblend << 24) | (dblend << 28); if (!NVIDIA_IS_SET( SRC_BLEND )) NVIDIA_UNSET( BLITTING_FLAGS ); NVIDIA_SET( SRC_BLEND ); NVIDIA_SET( DST_BLEND ); } void nv_set_drawingflags( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { if (NVIDIA_IS_SET( DRAWING_FLAGS )) return; if (!nvdev->enabled_3d) { u32 operation; if (state->drawingflags & DSDRAW_BLEND) operation = OPERATION_BLEND; else operation = OPERATION_SRCCOPY; if (nvdev->drawing_operation != operation) { nv_begin( SUBC_RECTANGLE, RECT_OPERATION, 1 ); nv_outr( operation ); nv_begin( SUBC_TRIANGLE, TRI_OPERATION, 1 ); nv_outr( operation ); nv_begin( SUBC_LINE, LINE_OPERATION, 1 ); nv_outr( operation ); nvdev->drawing_operation = operation; } } else { if (state->drawingflags & DSDRAW_BLEND) nvdev->state3d[0].blend |= TXTRI_BLEND_ALPHABLEND_ENABLE; else nvdev->state3d[0].blend &= ~TXTRI_BLEND_ALPHABLEND_ENABLE; } nvdev->drawingflags = state->drawingflags; NVIDIA_SET( DRAWING_FLAGS ); } void nv_set_blittingflags( NVidiaDriverData *nvdrv, NVidiaDeviceData *nvdev, CardState *state ) { u32 operation; bool src_alpha; if (NVIDIA_IS_SET( BLITTING_FLAGS )) return; operation = (nvdev->arch > NV_ARCH_04) ? OPERATION_SRCCOPY : OPERATION_COPY; src_alpha = true; if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL)) { if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR) || (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL && state->src_blend == DSBF_ONE)) { operation = OPERATION_BLEND_PREMULTIPLIED; } else { operation = OPERATION_BLEND; src_alpha = !!(state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL); } } else if (state->blittingflags & (DSBLIT_COLORIZE | DSBLIT_SRC_PREMULTCOLOR)) { operation = OPERATION_COLOR_MULTIPLY; } if (nvdev->src_system) { switch (nvdev->src_format) { case DSPF_RGB555: nvdev->system_format = IBLIT_COLOR_FORMAT_X1R5G5B5; break; case DSPF_ARGB1555: nvdev->system_format = src_alpha ? IBLIT_COLOR_FORMAT_A1R5G5B5 : IBLIT_COLOR_FORMAT_X1R5G5B5; break; case DSPF_RGB16: nvdev->system_format = IBLIT_COLOR_FORMAT_R5G6B5; break; case DSPF_RGB32: nvdev->system_format = IBLIT_COLOR_FORMAT_X8R8G8B8; break; case DSPF_ARGB: nvdev->system_format = src_alpha ? IBLIT_COLOR_FORMAT_A8R8G8B8 : IBLIT_COLOR_FORMAT_X8R8G8B8; break; default: D_BUG( "unexpected pixelformat" ); break; } if (nvdev->system_operation != operation) { nv_begin( SUBC_IMAGEBLT, IBLIT_OPERATION, 1 ); nv_outr( operation ); nv_begin( SUBC_STRETCHEDIMAGE, ISTRETCH_OPERATION, 1 ); nv_outr( operation ); nvdev->system_operation = operation; } } else { switch (nvdev->src_format) { case DSPF_A8: nvdev->scaler_format = SCALER_COLOR_FORMAT_AY8; break; case DSPF_LUT8: case DSPF_ALUT44: case DSPF_RGB332: nvdev->scaler_format = SCALER_COLOR_FORMAT_Y8; break; case DSPF_RGB555: nvdev->scaler_format = SCALER_COLOR_FORMAT_X1R5G5B5; break; case DSPF_ARGB1555: nvdev->scaler_format = src_alpha ? SCALER_COLOR_FORMAT_A1R5G5B5 : SCALER_COLOR_FORMAT_X1R5G5B5; break; case DSPF_RGB16: nvdev->scaler_format = SCALER_COLOR_FORMAT_R5G6B5; break; case DSPF_RGB32: nvdev->scaler_format = SCALER_COLOR_FORMAT_X8R8G8B8; break; case DSPF_ARGB: nvdev->scaler_format = src_alpha ? SCALER_COLOR_FORMAT_A8R8G8B8 : SCALER_COLOR_FORMAT_X8R8G8B8; break; case DSPF_YUY2: nvdev->scaler_format = nvdev->dst_422 ? SCALER_COLOR_FORMAT_A8R8G8B8 : SCALER_COLOR_FORMAT_V8YB8U8YA8; break; case DSPF_UYVY: nvdev->scaler_format = nvdev->dst_422 ? SCALER_COLOR_FORMAT_A8R8G8B8 : SCALER_COLOR_FORMAT_YB8V8YA8U8; break; default: D_BUG( "unexpected pixelformat 0x%08x", nvdev->src_format ); break; } if (nvdev->scaler_operation != operation) { nv_begin( SUBC_SCALEDIMAGE, SCALER_OPERATION, 1 ); nv_outr( operation ); nvdev->scaler_operation = operation; } } if (nvdev->enabled_3d) { nvdev->state3d[1].format &= 0xFFFFF0FF; nvdev->state3d[1].blend &= 0xFF00FFF0; switch (nvdev->src_format) { case DSPF_RGB555: nvdev->state3d[1].format |= TXTRI_FORMAT_COLOR_X1R5G5B5; break; case DSPF_ARGB1555: nvdev->state3d[1].format |= TXTRI_FORMAT_COLOR_A1R5G5B5; break; case DSPF_A8: case DSPF_ARGB: nvdev->state3d[1].format |= TXTRI_FORMAT_COLOR_A4R4G4B4; break; default: nvdev->state3d[1].format |= TXTRI_FORMAT_COLOR_R5G6B5; break; } if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_COLORIZE | DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_SRC_PREMULTCOLOR)) { if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) nvdev->state3d[1].blend |= TXTRI_BLEND_TEXTUREMAPBLEND_MODULATEALPHA; else nvdev->state3d[1].blend |= TXTRI_BLEND_TEXTUREMAPBLEND_MODULATE; if (state->blittingflags & (DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL)) nvdev->state3d[1].blend |= TXTRI_BLEND_ALPHABLEND_ENABLE; } else nvdev->state3d[1].blend |= TXTRI_BLEND_TEXTUREMAPBLEND_COPY; } nvdev->blittingflags = state->blittingflags; NVIDIA_SET( BLITTING_FLAGS ); } DirectFB-1.2.10/Makefile.in0000644000175000017500000006176411307521510012214 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/directfb-config.in $(srcdir)/directfb-internal.pc.in \ $(srcdir)/directfb.pc.in $(srcdir)/directfb.spec.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO compile config.guess config.sub depcomp install-sh \ ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = directfb-config directfb.pc directfb-internal.pc \ directfb.spec am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" binSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = data docs include lib src systems tools wm interfaces \ proxy inputdrivers gfxdrivers tests patches rules DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 @HAVE_LINUX_TRUE@LINUXONLY_DIRS = inputdrivers gfxdrivers @BUILD_TOOLS_TRUE@TOOLS_DIR = tools @BUILD_TESTS_TRUE@TESTS_DIR = tests @ENABLE_VOODOO_TRUE@PROXY_DIR = proxy SUBDIRS = \ data \ docs \ include \ lib \ src \ systems \ $(TOOLS_DIR) \ wm \ interfaces \ $(PROXY_DIR) \ $(LINUXONLY_DIRS) \ $(TESTS_DIR) \ patches \ rules bin_SCRIPTS = directfb-config pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = directfb.pc directfb-internal.pc EXTRA_DIST = \ autogen.sh \ fb.modes \ directfb.spec.in \ directfb.spec all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 directfb-config: $(top_builddir)/config.status $(srcdir)/directfb-config.in cd $(top_builddir) && $(SHELL) ./config.status $@ directfb.pc: $(top_builddir)/config.status $(srcdir)/directfb.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ directfb-internal.pc: $(top_builddir)/config.status $(srcdir)/directfb-internal.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ directfb.spec: $(top_builddir)/config.status $(srcdir)/directfb.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ else :; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-exec-am: install-binSCRIPTS install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-binSCRIPTS \ uninstall-pkgconfigDATA # Generate the HTML API documentation: html: make -C docs/html # Compile the directfb-csource utility: directfb-csource: make -C tools directfb-csource .PHONY: html directfb-csource # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/config.h.in0000644000175000017500000000752311307521725012173 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 if you are compiling for PowerPC. */ #undef ARCH_PPC /* Define to 1 if you are compiling for SH4. */ #undef ARCH_SH4 /* Define to 1 if you are compiling for ix86. */ #undef ARCH_X86 /* Define to 1 if you are compiling for AMD64. */ #undef ARCH_X86_64 /* Define to 1 if Video4Linux 2 is supported. */ #undef DFB_HAVE_V4L2 /* Define to 1 if smooth scaling code should be built. */ #undef DFB_SMOOTH_SCALING /* The DirectFB version */ #undef DIRECTFB_VERSION /* Define to 1 if you have the header file. */ #undef HAVE_ASM_PAGE_H /* Define to 1 if you have the declaration of `PTHREAD_MUTEX_RECURSIVE', and to 0 if you don't. */ #undef HAVE_DECL_PTHREAD_MUTEX_RECURSIVE /* Define to 1 if you have the declaration of `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP', and to 0 if you don't. */ #undef HAVE_DECL_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if inb, outb and iopl are available. */ #undef HAVE_INB_OUTB_IOPL /* Define to 1 if struct input_absinfo is defined in linux/input.h. */ #undef HAVE_INPUT_ABSINFO /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `c_r' library (-lc_r). */ #undef HAVE_LIBC_R /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_COMPILER_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYSIO /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if Linux Input driver should use FBDev system module for console keymap queries. */ #undef LINUX_INPUT_USE_FBDEV /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if compiling on KallistiOS. */ #undef USE_KOS /* Define to 1 if MMX assembly is available. */ #undef USE_MMX /* Define to 1 if ppc assembly is available. */ #undef USE_PPCASM /* Define to 1 if SSE assembly is available. */ #undef USE_SSE /* Define to 1 to build with sysfs support. */ #undef USE_SYSFS /* Define to 1 to build with zlib compression. */ #undef USE_ZLIB /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN DirectFB-1.2.10/INSTALL0000644000175000017500000002245010753066007011176 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. DirectFB-1.2.10/m4/0000777000175000017500000000000011307522564010547 500000000000000DirectFB-1.2.10/m4/as-ac-expand.m40000644000175000017500000000210511164361026013157 00000000000000dnl as-ac-expand.m4 0.2.0 dnl autostars m4 macro for expanding directories using configure's prefix dnl thomas@apestaart.org dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR) dnl example dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local AC_DEFUN([AS_AC_EXPAND], [ EXP_VAR=[$1] FROM_VAR=[$2] dnl first expand prefix and exec_prefix if necessary prefix_save=$prefix exec_prefix_save=$exec_prefix dnl if no prefix given, then use /usr/local, the default prefix if test "x$prefix" = "xNONE"; then prefix="$ac_default_prefix" fi dnl if no exec_prefix given, then use prefix if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" dnl loop until it doesn't change anymore while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var" = "x$full_var"; then break; fi full_var=$new_full_var done dnl clean up full_var=$new_full_var AC_SUBST([$1], "$full_var") dnl restore prefix and exec_prefix prefix=$prefix_save exec_prefix=$exec_prefix_save ]) DirectFB-1.2.10/directfb.pc.in0000644000175000017500000000054311164361026012653 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: DirectFB Description: Graphics and windowing library for the Linux frame buffer device Version: @VERSION@ Requires: fusion direct Libs: -L${libdir} -ldirectfb @THREADLIB@ @OSX_LIBS@ Libs.private: -L${libdir} @DYNLIB@ @ZLIB_LIBS@ Cflags: @THREADFLAGS@ -I@INCLUDEDIR@ DirectFB-1.2.10/tests/0000777000175000017500000000000011307522571011367 500000000000000DirectFB-1.2.10/tests/Makefile.am0000644000175000017500000000260211245562152013337 00000000000000## Makefile.am for DirectFB/tests INCLUDES = \ -I$(top_builddir)/lib \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -DLINUX_2_6 noinst_PROGRAMS = \ dfbtest_blit \ dfbtest_reinit \ dfbtest_scale \ direct_stream \ direct_test \ fusion_fork \ fusion_reactor \ fusion_skirmish \ fusion_stream libdirectfb = $(top_builddir)/src/libdirectfb.la libfusion = $(top_builddir)/lib/fusion/libfusion.la libdirect = $(top_builddir)/lib/direct/libdirect.la dfbtest_blit_SOURCES = dfbtest_blit.c dfbtest_blit_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbtest_reinit_SOURCES = dfbtest_reinit.c dfbtest_reinit_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbtest_scale_SOURCES = dfbtest_scale.c dfbtest_scale_LDADD = $(libdirectfb) $(libfusion) $(libdirect) direct_stream_SOURCES = direct_stream.c direct_stream_LDADD = $(libdirect) direct_test_SOURCES = direct_test.c direct_test_LDADD = $(libdirect) fusion_fork_SOURCES = fusion_fork.c fusion_fork_LDADD = $(libdirectfb) $(libfusion) $(libdirect) fusion_reactor_SOURCES = fusion_reactor.c fusion_reactor_LDADD = $(libdirectfb) $(libfusion) $(libdirect) fusion_skirmish_SOURCES = fusion_skirmish.c fusion_skirmish_LDADD = $(libdirectfb) $(libfusion) $(libdirect) fusion_stream_SOURCES = fusion_stream.c fusion_stream_LDADD = $(libdirectfb) $(libfusion) $(libdirect) DirectFB-1.2.10/tests/fusion_stream.c0000644000175000017500000004035511245562152014334 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MAX_NUM_BLOCKS 10000 #define SIZE_ALIGNMASK 0x3 #define ALIGN_SIZE(s) (((s) + SIZE_ALIGNMASK) & ~SIZE_ALIGNMASK) /**********************************************************************************************************************/ static int parse_cmdline ( int argc, char *argv[] ); static int show_usage ( void ); /**********************************************************************************************************************/ static inline unsigned long get_millis( void ) { struct timeval tv; gettimeofday( &tv, NULL ); return tv.tv_sec * 1000 + tv.tv_usec / 1000; } /**********************************************************************************************************************/ static unsigned int bit_rate; static bool run_busy; static bool do_fork; static bool do_thread; /**********************************************************************************************************************/ static long block_size = 184; static long num_blocks = 16; /**********************************************************************************************************************/ static int fuser, fnice, fsystem, fidle, ftotal; static int cuser, cnice, csystem, cidle, ctotal; static int puser, pnice, psystem, pidle, ptotal; static int duser, dnice, dsystem, didle, dtotal; static int read_stat( void ) { char dummy[4]; int wa = 0, hi = 0, si = 0; FILE *file; puser = cuser; pnice = cnice; psystem = csystem; pidle = cidle; ptotal = ctotal; file = fopen( "/proc/stat", "r" ); if (!file) { perror( "Could not open '/proc/stat'" ); return 0; } if (fscanf( file, "%3s %d %d %d %d %d %d %d", dummy, &cuser, &cnice, &csystem, &cidle, &wa, &hi, &si ) < 4) { fprintf( stderr, "Parsing '/proc/stat' failed!\n" ); return 0; } fclose( file ); /* Compatibility with 2.6 split up idle times. */ cidle += wa + hi + si; /* Count nice as idle. */ cidle += cnice; cnice = 0; ctotal = cuser + cnice + csystem + cidle; duser = cuser - puser; dnice = cnice - pnice; dsystem = csystem - psystem; didle = cidle - pidle; dtotal = ctotal - ptotal; if (!ftotal) { fuser = cuser; fnice = cnice; fsystem = csystem; fidle = cidle; ftotal = ctotal; } return 1; } /**********************************************************************************************************************/ static pthread_t busy_thread; static pthread_mutex_t busy_lock = PTHREAD_MUTEX_INITIALIZER; static unsigned int busy_alive = 1; static unsigned int busy_count; static void * busy_loop( void *arg ) { setpriority( PRIO_PROCESS, 0, 19 ); while (busy_alive) { int i; for (i=0; i<100000; i++); pthread_mutex_lock( &busy_lock ); busy_count++; pthread_mutex_unlock( &busy_lock ); } return NULL; } /**********************************************************************************************************************/ static FusionCallHandlerResult call_handler( int caller, int call_arg, void *call_ptr, void *ctx, unsigned int serial, int *ret_val ) { static u32 checksum = 0; int i; const u32 *values = call_ptr; for (i=0; i MAX_NUM_BLOCKS) num_blocks = MAX_NUM_BLOCKS; if (!num_blocks) { num_blocks = 1; delay = 970 * block_size / (bit_rate * 1024 / 8) * 1000 - 2000; } } sync(); if (run_busy) { pthread_create( &busy_thread, NULL, busy_loop, NULL ); printf( "Calibrating...\n" ); pthread_mutex_lock( &busy_lock ); for (i=0; i<7; i++) { int busy_rate; busy_count = 0; t1 = get_millis(); pthread_mutex_unlock( &busy_lock ); usleep( 300000 ); pthread_mutex_lock( &busy_lock ); t2 = get_millis(); busy_rate = busy_count * 1000 / (t2 - t1); if (busy_rate > max_busy) max_busy = busy_rate; } printf( "Calibrating done. (%d busy counts/sec)\n", max_busy ); } ret = fusion_enter( -1, 23, FER_MASTER, &world ); if (ret) return ret; ret = fusion_call_init( &call, call_handler, NULL, world ); if (ret) return ret; ret = fusion_shm_pool_create( world, "Stream Buffer", block_size + 8192, false, &pool ); if (ret) return ret; ret = fusion_shm_pool_allocate( pool, block_size, false, true, &buffer ); if (ret) return ret; /* * Do the fork() magic! */ if (do_fork) { fusion_world_set_fork_action( world, FFA_FORK ); switch (fork()) { case -1: D_PERROR( "fork() failed!\n" ); return -1; case 0: /* child continues as the producer */ run_busy = false; break; default: /* parent is the consumer (callback in Fusion Dispatch thread) */ produce = false; usleep( 50000 ); } fusion_world_set_fork_action( world, FFA_CLOSE ); } start = t1 = get_millis(); if (run_busy) { busy_count = 0; pthread_mutex_unlock( &busy_lock ); } #ifdef LINUX_2_4 delay -= 10000; #endif do { if (bit_rate || !produce) { if (delay > 10) usleep( delay ); } if (produce) { for (i=0; i 2000) { if (produce) { long long kbits = 0, avgkbits, total_time, diff_time, diff_bytes; printf( "\n\n\n" ); total_time = t2 - start; diff_time = t2 - t1; diff_bytes = bytes - last_bytes; avgkbits = (long long)bytes * 8LL * 1000LL / (long long)total_time / 1024LL; if (diff_time) kbits = (long long)diff_bytes * 8LL * 1000LL / (long long)diff_time / 1024LL; printf( "Total Time: %7lld ms\n", total_time ); printf( "Stream Size: %7lld kb\n", bytes / 1024 ); printf( "Stream Rate: %7lld kb/sec -> %lld.%03lld MBit (avg. %lld.%03lld MBit)\n", kbits / 8, (kbits * 1000 / 1024) / 1000, (kbits * 1000 / 1024) % 1000, (avgkbits * 1000 / 1024) / 1000, (avgkbits * 1000 / 1024) % 1000 ); printf( "\n" ); if (last_bytes && bit_rate) { long long diff_bytes = (bytes - last_bytes) * 1000 / (t2 - t1); long long need_bytes = bit_rate * 1024 / 8; if (diff_bytes) { int new_blocks = (num_blocks * need_bytes + diff_bytes/2) / diff_bytes; num_blocks = (new_blocks + num_blocks + 1) / 2; if (num_blocks > MAX_NUM_BLOCKS) num_blocks = MAX_NUM_BLOCKS; } } read_stat(); if (ftotal != ctotal && dtotal) { int load, aload; load = 1000 - didle * 1000 / dtotal; aload = 1000 - (cidle - fidle) * 1000 / (ctotal - ftotal); printf( "Overall Stats\n" ); printf( " Total Time: %7lld ms\n", t2 - start ); printf( " Block Size: %7ld\n", block_size ); printf( " Blocks/cycle: %7ld\n", num_blocks ); printf( " Blocks/second: %7lld\n", (blocks - last_blocks) * 1000 / diff_time ); printf( " Delay: %7d\n", delay ); printf( " CPU Load: %5d.%d %% (avg. %d.%d %%)\n", load / 10, load % 10, aload / 10, aload % 10 ); } last_bytes = bytes; last_blocks = blocks; } if (run_busy) { pthread_mutex_lock( &busy_lock ); if (last_busy) { int busy_diff; int busy_rate, busy_load; int abusy_rate, abusy_load; busy_diff = busy_count - last_busy; busy_rate = max_busy - (busy_diff * 1000 / (t2 - t1)); busy_load = busy_rate * 1000 / max_busy; abusy_rate = max_busy - (busy_count * 1000 / (t2 - start)); abusy_load = abusy_rate * 1000 / max_busy; printf( " Real CPU Load: %5d.%d %% (avg. %d.%d %%)\n", busy_load / 10, busy_load % 10, abusy_load / 10, abusy_load % 10 ); } last_busy = busy_count; pthread_mutex_unlock( &busy_lock ); } t1 = t2; } } while (active > 0); if (run_busy) { busy_alive = 0; pthread_join( busy_thread, NULL ); } return -1; } /**********************************************************************************************************************/ static int parse_cmdline( int argc, char *argv[] ) { int i; char *end; for (i=1; i Size of each block of data\n" " -b <0-n> Designated bit rate in kbit (0 = unlimited)\n" " -B <0-n> Designated bit rate in Mbit (0 = unlimited)\n" " -c Run busy loop counting spare CPU cycles to get real CPU load\n" " -f Fork to have the producer in a separate process\n" " -t Force calls to be handled in a separate thread\n" "\n" ); return -1; } DirectFB-1.2.10/tests/Makefile.in0000644000175000017500000004777111307521507013366 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ noinst_PROGRAMS = dfbtest_blit$(EXEEXT) dfbtest_reinit$(EXEEXT) \ dfbtest_scale$(EXEEXT) direct_stream$(EXEEXT) \ direct_test$(EXEEXT) fusion_fork$(EXEEXT) \ fusion_reactor$(EXEEXT) fusion_skirmish$(EXEEXT) \ fusion_stream$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_dfbtest_blit_OBJECTS = dfbtest_blit.$(OBJEXT) dfbtest_blit_OBJECTS = $(am_dfbtest_blit_OBJECTS) dfbtest_blit_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_dfbtest_reinit_OBJECTS = dfbtest_reinit.$(OBJEXT) dfbtest_reinit_OBJECTS = $(am_dfbtest_reinit_OBJECTS) dfbtest_reinit_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_dfbtest_scale_OBJECTS = dfbtest_scale.$(OBJEXT) dfbtest_scale_OBJECTS = $(am_dfbtest_scale_OBJECTS) dfbtest_scale_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_direct_stream_OBJECTS = direct_stream.$(OBJEXT) direct_stream_OBJECTS = $(am_direct_stream_OBJECTS) direct_stream_DEPENDENCIES = $(libdirect) am_direct_test_OBJECTS = direct_test.$(OBJEXT) direct_test_OBJECTS = $(am_direct_test_OBJECTS) direct_test_DEPENDENCIES = $(libdirect) am_fusion_fork_OBJECTS = fusion_fork.$(OBJEXT) fusion_fork_OBJECTS = $(am_fusion_fork_OBJECTS) fusion_fork_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_fusion_reactor_OBJECTS = fusion_reactor.$(OBJEXT) fusion_reactor_OBJECTS = $(am_fusion_reactor_OBJECTS) fusion_reactor_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_fusion_skirmish_OBJECTS = fusion_skirmish.$(OBJEXT) fusion_skirmish_OBJECTS = $(am_fusion_skirmish_OBJECTS) fusion_skirmish_DEPENDENCIES = $(libdirectfb) $(libfusion) \ $(libdirect) am_fusion_stream_OBJECTS = fusion_stream.$(OBJEXT) fusion_stream_OBJECTS = $(am_fusion_stream_OBJECTS) fusion_stream_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dfbtest_blit_SOURCES) $(dfbtest_reinit_SOURCES) \ $(dfbtest_scale_SOURCES) $(direct_stream_SOURCES) \ $(direct_test_SOURCES) $(fusion_fork_SOURCES) \ $(fusion_reactor_SOURCES) $(fusion_skirmish_SOURCES) \ $(fusion_stream_SOURCES) DIST_SOURCES = $(dfbtest_blit_SOURCES) $(dfbtest_reinit_SOURCES) \ $(dfbtest_scale_SOURCES) $(direct_stream_SOURCES) \ $(direct_test_SOURCES) $(fusion_fork_SOURCES) \ $(fusion_reactor_SOURCES) $(fusion_skirmish_SOURCES) \ $(fusion_stream_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/lib \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src \ -DLINUX_2_6 libdirectfb = $(top_builddir)/src/libdirectfb.la libfusion = $(top_builddir)/lib/fusion/libfusion.la libdirect = $(top_builddir)/lib/direct/libdirect.la dfbtest_blit_SOURCES = dfbtest_blit.c dfbtest_blit_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbtest_reinit_SOURCES = dfbtest_reinit.c dfbtest_reinit_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbtest_scale_SOURCES = dfbtest_scale.c dfbtest_scale_LDADD = $(libdirectfb) $(libfusion) $(libdirect) direct_stream_SOURCES = direct_stream.c direct_stream_LDADD = $(libdirect) direct_test_SOURCES = direct_test.c direct_test_LDADD = $(libdirect) fusion_fork_SOURCES = fusion_fork.c fusion_fork_LDADD = $(libdirectfb) $(libfusion) $(libdirect) fusion_reactor_SOURCES = fusion_reactor.c fusion_reactor_LDADD = $(libdirectfb) $(libfusion) $(libdirect) fusion_skirmish_SOURCES = fusion_skirmish.c fusion_skirmish_LDADD = $(libdirectfb) $(libfusion) $(libdirect) fusion_stream_SOURCES = fusion_stream.c fusion_stream_LDADD = $(libdirectfb) $(libfusion) $(libdirect) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done dfbtest_blit$(EXEEXT): $(dfbtest_blit_OBJECTS) $(dfbtest_blit_DEPENDENCIES) @rm -f dfbtest_blit$(EXEEXT) $(LINK) $(dfbtest_blit_OBJECTS) $(dfbtest_blit_LDADD) $(LIBS) dfbtest_reinit$(EXEEXT): $(dfbtest_reinit_OBJECTS) $(dfbtest_reinit_DEPENDENCIES) @rm -f dfbtest_reinit$(EXEEXT) $(LINK) $(dfbtest_reinit_OBJECTS) $(dfbtest_reinit_LDADD) $(LIBS) dfbtest_scale$(EXEEXT): $(dfbtest_scale_OBJECTS) $(dfbtest_scale_DEPENDENCIES) @rm -f dfbtest_scale$(EXEEXT) $(LINK) $(dfbtest_scale_OBJECTS) $(dfbtest_scale_LDADD) $(LIBS) direct_stream$(EXEEXT): $(direct_stream_OBJECTS) $(direct_stream_DEPENDENCIES) @rm -f direct_stream$(EXEEXT) $(LINK) $(direct_stream_OBJECTS) $(direct_stream_LDADD) $(LIBS) direct_test$(EXEEXT): $(direct_test_OBJECTS) $(direct_test_DEPENDENCIES) @rm -f direct_test$(EXEEXT) $(LINK) $(direct_test_OBJECTS) $(direct_test_LDADD) $(LIBS) fusion_fork$(EXEEXT): $(fusion_fork_OBJECTS) $(fusion_fork_DEPENDENCIES) @rm -f fusion_fork$(EXEEXT) $(LINK) $(fusion_fork_OBJECTS) $(fusion_fork_LDADD) $(LIBS) fusion_reactor$(EXEEXT): $(fusion_reactor_OBJECTS) $(fusion_reactor_DEPENDENCIES) @rm -f fusion_reactor$(EXEEXT) $(LINK) $(fusion_reactor_OBJECTS) $(fusion_reactor_LDADD) $(LIBS) fusion_skirmish$(EXEEXT): $(fusion_skirmish_OBJECTS) $(fusion_skirmish_DEPENDENCIES) @rm -f fusion_skirmish$(EXEEXT) $(LINK) $(fusion_skirmish_OBJECTS) $(fusion_skirmish_LDADD) $(LIBS) fusion_stream$(EXEEXT): $(fusion_stream_OBJECTS) $(fusion_stream_DEPENDENCIES) @rm -f fusion_stream$(EXEEXT) $(LINK) $(fusion_stream_OBJECTS) $(fusion_stream_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbtest_blit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbtest_reinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbtest_scale.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/direct_stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/direct_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fusion_fork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fusion_reactor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fusion_skirmish.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fusion_stream.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/tests/direct_test.c0000644000175000017500000000664211245562152013770 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include static int show_usage( const char *name ) { fprintf( stderr, "Usage: %s [-f ] [-u :]\n", name ); return -1; } int main( int argc, char *argv[] ) { int i; DirectResult ret; DirectLogType log_type = DLT_STDERR; const char *log_param = NULL; DirectLog *log; for (i=1; idebug = true; direct_print_memleaks(); return 0; } DirectFB-1.2.10/tests/dfbtest_scale.c0000644000175000017500000001105311164361026014246 00000000000000/* (c) Copyright 2008 Denis Oliver Kropp All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include static int show_usage( const char *prg ) { fprintf( stderr, "Usage: %s \n", prg ); return -1; } int main( int argc, char *argv[] ) { int i; DFBResult ret; DFBSurfaceDescription desc; IDirectFB *dfb; IDirectFBImageProvider *provider = NULL; IDirectFBSurface *source = NULL; IDirectFBSurface *dest = NULL; const char *url = NULL; /* Parse arguments. */ for (i=1; iCreateImageProvider( dfb, url, &provider ); if (ret) { D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateImageProvider( '%s' ) failed!\n", url ); goto out; } /* Get the surface description. */ ret = provider->GetSurfaceDescription( provider, &desc ); if (ret) { D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::GetSurfaceDescription() failed!\n" ); goto out; } desc.pixelformat = DSPF_LUT8; D_INFO( "DFBTest/Scale: Source is %dx%d using %s\n", desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) ); /* Create a surface for the image. */ ret = dfb->CreateSurface( dfb, &desc, &source ); if (ret) { D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" ); goto out; } ret = provider->RenderTo( provider, source, NULL ); if (ret) { D_DERROR( ret, "DFBTest/Scale: IDirectFBImageProvider::RenderTo() failed!\n" ); goto out; } desc.width = desc.width * 3 / 4; desc.height = desc.height * 3 / 4; if (DFB_PIXELFORMAT_IS_INDEXED( desc.pixelformat )) desc.pixelformat = DSPF_ARGB; D_INFO( "DFBTest/Scale: Destination is %dx%d using %s\n", desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) ); /* Create a surface for the image. */ ret = dfb->CreateSurface( dfb, &desc, &dest ); if (ret) { D_DERROR( ret, "DFBTest/Scale: IDirectFB::CreateSurface() failed!\n" ); goto out; } dest->SetBlittingFlags( dest, DSBLIT_SRC_PREMULTIPLY ); dest->StretchBlit( dest, source, NULL, NULL ); dest->Dump( dest, "dfbtest_scale", NULL ); out: if (dest) dest->Release( dest ); if (source) source->Release( source ); if (provider) provider->Release( provider ); /* Shutdown DirectFB. */ dfb->Release( dfb ); return ret; } DirectFB-1.2.10/tests/fusion_skirmish.c0000644000175000017500000000710311245562152014664 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #if DIRECT_BUILD_DEBUGS #define MSG(x...) \ do { \ direct_debug( x ); \ } while (0) #else #define MSG(x...) \ do { \ } while (0) #endif static FusionWorld *m_world; int main( int argc, char *argv[] ) { DirectResult ret; FusionSkirmish skirmish; DirectFBInit( &argc, &argv ); ret = fusion_enter( -1, 0, FER_MASTER, &m_world ); if (ret) { D_DERROR( ret, "fusion_enter() failed" ); return ret; } MSG( "Entered world %d as master (FusionID %lu, pid %d)\n", fusion_world_index( m_world ), fusion_id( m_world ), getpid() ); MSG( "Initializing skirmish...\n" ); ret = fusion_skirmish_init( &skirmish, "Test", m_world ); if (ret) { D_DERROR( ret, "fusion_skirmish_init() failed\n" ); return -1; } MSG( "Locking skirmish...\n" ); ret = fusion_skirmish_prevail( &skirmish ); if (ret) { D_DERROR( ret, "fusion_skirmish_prevail() failed!\n" ); return -2; } MSG( "Waiting at skirmish...\n" ); ret = fusion_skirmish_wait( &skirmish, 10 ); if (ret != DFB_TIMEOUT) { D_DERROR( ret, "fusion_skirmish_wait() did not timeout!\n" ); return -3; } MSG( "Unlocking skirmish...\n" ); ret = fusion_skirmish_dismiss( &skirmish ); if (ret) { D_DERROR( ret, "fusion_skirmish_dismiss() failed!\n" ); return -4; } MSG( "Exiting from world %d (FusionID %lu, pid %d)...\n", fusion_world_index( m_world ), fusion_id( m_world ), getpid() ); fusion_exit( m_world, false ); return 0; } DirectFB-1.2.10/tests/fusion_fork.c0000644000175000017500000001104111245562152013770 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #define MSG(x...) \ do { \ direct_log_printf( NULL, "- " x ); \ } while (0) typedef struct { unsigned int foo; } TestMessage; static FusionWorld *m_world; static FusionRef m_ref; static FusionReactor *m_reactor; static Reaction m_reaction; static ReactionResult reaction_callback( const void *msg_data, void *ctx ) { MSG( "Received message (FusionID %lu, pid %d)!\n", fusion_id( m_world ), getpid() ); return RS_OK; } int main( int argc, char *argv[] ) { DirectResult ret; pid_t child_pid; TestMessage message = {0}; DirectFBInit( &argc, &argv ); ret = fusion_enter( -1, 0, FER_MASTER, &m_world ); if (ret) { D_DERROR( ret, "fusion_enter() failed" ); return ret; } MSG( "Entered world %d as master (FusionID %lu, pid %d)\n", fusion_world_index( m_world ), fusion_id( m_world ), getpid() ); ret = fusion_ref_init( &m_ref, "Test", m_world ); if (ret) { D_DERROR( ret, "fusion_ref_init() failed" ); return -1; } MSG( "Adding local reference...\n" ); fusion_ref_up( &m_ref, false ); m_reactor = fusion_reactor_new( sizeof(TestMessage), "Test", m_world ); if (!m_reactor) { D_ERROR( "fusion_reactor_new() failed\n" ); return -1; } MSG( "Attaching to reactor...\n" ); ret = fusion_reactor_attach( m_reactor, reaction_callback, NULL, &m_reaction ); if (ret) { D_DERROR( ret, "fusion_reactor_attach() failed" ); return ret; } MSG( ".........FORKING NOW.........\n" ); fusion_world_set_fork_action( m_world, FFA_FORK ); child_pid = fork(); fusion_world_set_fork_action( m_world, FFA_CLOSE ); switch (child_pid) { case -1: D_PERROR( "fork() failed" ); break; case 0: setsid(); MSG( "...arrived after fork() in child (pid %d)..\n", getpid() ); MSG( "..child (FusionID %lu).\n", fusion_id( m_world ) ); break; default: usleep( 200000 ); MSG( "...returned from fork() in parent, child pid %d.\n", child_pid ); break; } MSG( "Sending message via reactor...\n" ); fusion_reactor_dispatch( m_reactor, &message, true, NULL ); usleep( 200000 ); MSG( "Removing local reference...\n" ); fusion_ref_down( &m_ref, false ); usleep( 200000 ); MSG( "Exiting from world %d (FusionID %lu, pid %d)...\n", fusion_world_index( m_world ), fusion_id( m_world ), getpid() ); fusion_exit( m_world, false ); return 0; } DirectFB-1.2.10/tests/dfbtest_reinit.c0000644000175000017500000000404611164361026014455 00000000000000/* (c) Copyright 2008 Denis Oliver Kropp All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include int main( int argc, char *argv[] ) { DFBResult ret; IDirectFB *dfb; /* Initialize DirectFB. */ ret = DirectFBInit( &argc, &argv ); if (ret) { D_DERROR( ret, "DFBTest/Reinit: DirectFBInit() failed!\n" ); return ret; } /* Create super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { D_DERROR( ret, "DFBTest/Reinit: 1st DirectFBCreate() failed!\n" ); return ret; } /* Shutdown DirectFB. */ dfb->Release( dfb ); /* Create super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { D_DERROR( ret, "DFBTest/Reinit: 2nd DirectFBCreate() failed!\n" ); return ret; } /* Shutdown DirectFB. */ dfb->Release( dfb ); return ret; } DirectFB-1.2.10/tests/direct_stream.c0000644000175000017500000000755011164361026014300 00000000000000/* (c) Copyright 2008 Denis Oliver Kropp All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Direct_Cat, "Direct/Cat", "libdirect cat" ); static int show_usage( const char *prg ) { fprintf( stderr, "Usage: %s \n", prg ); return -1; } int main( int argc, char *argv[] ) { DirectResult ret; int i, fdo; DirectStream *stream; const char *url = NULL; /* Parse arguments. */ for (i=1; i #include #include #include #include #include #include #include static const DirectFBPixelFormatNames( format_names ); /**********************************************************************************************************************/ static DFBBoolean parse_format( const char *arg, DFBSurfacePixelFormat *_f ) { int i = 0; while (format_names[i].format != DSPF_UNKNOWN) { if (!strcasecmp( arg, format_names[i].name )) { *_f = format_names[i].format; return DFB_TRUE; } ++i; } fprintf (stderr, "\nInvalid format specified!\n\n" ); return DFB_FALSE; } static int print_usage( const char *prg ) { int i = 0; fprintf (stderr, "\n"); fprintf (stderr, "== DirectFB Blitting Test (version %s) ==\n", DIRECTFB_VERSION); fprintf (stderr, "\n"); fprintf (stderr, "Known pixel formats:\n"); while (format_names[i].format != DSPF_UNKNOWN) { DFBSurfacePixelFormat format = format_names[i].format; fprintf (stderr, " %-10s %2d bits, %d bytes", format_names[i].name, DFB_BITS_PER_PIXEL(format), DFB_BYTES_PER_PIXEL(format)); if (DFB_PIXELFORMAT_HAS_ALPHA(format)) fprintf (stderr, " ALPHA"); if (DFB_PIXELFORMAT_IS_INDEXED(format)) fprintf (stderr, " INDEXED"); if (DFB_PLANAR_PIXELFORMAT(format)) { int planes = DFB_PLANE_MULTIPLY(format, 1000); fprintf (stderr, " PLANAR (x%d.%03d)", planes / 1000, planes % 1000); } fprintf (stderr, "\n"); ++i; } fprintf (stderr, "\n"); fprintf (stderr, "\n"); fprintf (stderr, "Usage: %s [options]\n", prg); fprintf (stderr, "\n"); fprintf (stderr, "Options:\n"); fprintf (stderr, " -h, --help Show this help message\n"); fprintf (stderr, " -v, --version Print version information\n"); fprintf (stderr, " -s, --source Source pixel format\n"); fprintf (stderr, " -d, --dest Destination pixel format\n"); fprintf (stderr, " -r, --resize Set destination from source size\n"); fprintf (stderr, " -b, --benchmark Enable benchmarking mode\n"); fprintf (stderr, " -R, --rerender Rerender before every blit (benchmark)\n"); return -1; } /**********************************************************************************************************************/ int main( int argc, char *argv[] ) { int i; DFBResult ret; DFBSurfaceDescription desc; IDirectFB *dfb; IDirectFBImageProvider *provider = NULL; IDirectFBSurface *source = NULL; IDirectFBSurface *dest = NULL; const char *url = NULL; DFBSurfacePixelFormat source_format = DSPF_UNKNOWN; DFBSurfacePixelFormat dest_format = DSPF_UNKNOWN; bool dest_resize = false; bool benchmark = false; bool rerender = false; /* Initialize DirectFB. */ ret = DirectFBInit( &argc, &argv ); if (ret) { D_DERROR( ret, "DFBTest/Blit: DirectFBInit() failed!\n" ); return ret; } /* Parse arguments. */ for (i=1; iCreateImageProvider( dfb, url, &provider ); if (ret) { D_DERROR( ret, "DFBTest/Blit: IDirectFB::CreateImageProvider( '%s' ) failed!\n", url ); goto out; } /* Get the surface description. */ ret = provider->GetSurfaceDescription( provider, &desc ); if (ret) { D_DERROR( ret, "DFBTest/Blit: IDirectFBImageProvider::GetSurfaceDescription() failed!\n" ); goto out; } if (source_format != DSPF_UNKNOWN) desc.pixelformat = source_format; D_INFO( "DFBTest/Blit: Source is %dx%d using %s\n", desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) ); /* Create a surface for the image. */ ret = dfb->CreateSurface( dfb, &desc, &source ); if (ret) { D_DERROR( ret, "DFBTest/Blit: IDirectFB::CreateSurface() failed!\n" ); goto out; } ret = provider->RenderTo( provider, source, NULL ); if (ret) { D_DERROR( ret, "DFBTest/Blit: IDirectFBImageProvider::RenderTo() failed!\n" ); goto out; } /* Fill description for a primary surface. */ desc.flags = DSDESC_CAPS; desc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING; if (dest_format != DSPF_UNKNOWN) { desc.flags |= DSDESC_PIXELFORMAT; desc.pixelformat = dest_format; } if (dest_resize) desc.flags |= DSDESC_WIDTH | DSDESC_HEIGHT; dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN ); /* Create a primary surface. */ ret = dfb->CreateSurface( dfb, &desc, &dest ); if (ret) { D_DERROR( ret, "DFBTest/Blit: IDirectFB::CreateSurface() failed!\n" ); goto out; } dest->GetSize( dest, &desc.width, &desc.height ); dest->GetPixelFormat( dest, &desc.pixelformat ); D_INFO( "DFBTest/Blit: Destination is %dx%d using %s\n", desc.width, desc.height, dfb_pixelformat_name(desc.pixelformat) ); dest->StretchBlit( dest, source, NULL, NULL ); dest->Flip( dest, NULL, DSFLIP_NONE ); if (benchmark) { int num = 0; long long start, diff = 0, speed; sync(); sleep( 1 ); dest->StretchBlit( dest, source, NULL, NULL ); D_INFO( "DFBTest/Blit: Benchmarking...\n" ); dfb->WaitIdle( dfb ); start = direct_clock_get_millis(); do { if (rerender) { ret = provider->RenderTo( provider, source, NULL ); if (ret) { D_DERROR( ret, "DFBTest/Blit: IDirectFBImageProvider::RenderTo() failed!\n" ); goto out; } } dest->StretchBlit( dest, source, NULL, NULL ); if ((num & 7) == 7) diff = direct_clock_get_millis() - start; num++; } while (diff < 2300); dfb->WaitIdle( dfb ); diff = direct_clock_get_millis() - start; speed = (long long) num * desc.width * desc.height / diff; D_INFO( "DFBTest/Blit: Speed is %lld.%03lld MPixel/sec (%dx%d x %d in %lld.%03lld sec)\n", speed / 1000LL, speed % 1000LL, desc.width, desc.height, num, diff / 1000LL, diff % 1000LL ); } else sleep( 2 ); out: if (dest) dest->Release( dest ); if (source) source->Release( source ); if (provider) provider->Release( provider ); /* Shutdown DirectFB. */ dfb->Release( dfb ); return ret; } DirectFB-1.2.10/tests/fusion_reactor.c0000644000175000017500000001330211245562152014470 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . All rights reserved. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #if DIRECT_BUILD_DEBUGS #define MSG(x...) \ do { \ direct_debug( x ); \ } while (0) #else #define MSG(x...) \ do { \ } while (0) #endif typedef struct { unsigned int foo; } TestMessage; static FusionWorld *m_world; static ReactionResult reaction_callback( const void *msg_data, void *ctx ) { MSG( "Received message (FusionID %lu, pid %d)!\n", fusion_id( m_world ), getpid() ); return RS_REMOVE; } static FusionCallHandlerResult dispatch_callback (int caller, int call_arg, void *call_ptr, void *ctx, unsigned int serial, int *ret_val ) { MSG( "Got dispatch callback (FusionID %lu, pid %d)!\n", fusion_id( m_world ), getpid() ); return FCHR_RETURN; } int main( int argc, char *argv[] ) { DirectResult ret; pid_t child_pid; TestMessage message = {0}; FusionReactor *reactor; Reaction reaction; FusionCall call; DirectFBInit( &argc, &argv ); ret = fusion_enter( -1, 0, FER_MASTER, &m_world ); if (ret) { D_DERROR( ret, "fusion_enter() failed" ); return ret; } MSG( "Entered world %d as master (FusionID %lu, pid %d)\n", fusion_world_index( m_world ), fusion_id( m_world ), getpid() ); reactor = fusion_reactor_new( sizeof(TestMessage), "Test", m_world ); if (!reactor) { D_ERROR( "fusion_reactor_new() failed\n" ); return -1; } MSG( "Attaching to reactor...\n" ); ret = fusion_reactor_attach( reactor, reaction_callback, NULL, &reaction ); if (ret) { D_DERROR( ret, "fusion_reactor_attach() failed" ); return ret; } MSG( ".........FORKING NOW.........\n" ); fusion_world_set_fork_action( m_world, FFA_FORK ); child_pid = fork(); fusion_world_set_fork_action( m_world, FFA_CLOSE ); switch (child_pid) { case -1: D_PERROR( "fork() failed" ); break; case 0: setsid(); MSG( "...arrived after fork() in child (pid %d)..\n", getpid() ); MSG( "..child (FusionID %lu).\n", fusion_id( m_world ) ); usleep( 400000 ); break; default: usleep( 100000 ); MSG( "...returned from fork() in parent, child pid %d.\n", child_pid ); MSG( "Initializing dispatch callback...\n" ); ret = fusion_call_init( &call, dispatch_callback, NULL, m_world ); if (ret) { D_DERROR( ret, "fusion_call_init() failed" ); return ret; } MSG( "Setting dispatch callback...\n" ); ret = fusion_reactor_set_dispatch_callback( reactor, &call, NULL ); if (ret) { D_DERROR( ret, "fusion_reactor_set_dispatch_callback() failed" ); return ret; } MSG( "Sending message via reactor...\n" ); fusion_reactor_dispatch( reactor, &message, true, NULL ); usleep( 100000 ); MSG( "Destroying reactor...\n" ); fusion_reactor_destroy( reactor ); MSG( "...destroyed reactor!\n" ); usleep( 400000 ); MSG( "Freeing reactor...\n" ); fusion_reactor_free( reactor ); MSG( "...freed reactor!\n" ); break; } MSG( "Exiting from world %d (FusionID %lu, pid %d)...\n", fusion_world_index( m_world ), fusion_id( m_world ), getpid() ); fusion_exit( m_world, false ); return 0; } DirectFB-1.2.10/proxy/0000777000175000017500000000000011307522567011413 500000000000000DirectFB-1.2.10/proxy/requestor/0000777000175000017500000000000011307522567013444 500000000000000DirectFB-1.2.10/proxy/requestor/idirectfbwindow_requestor.h0000644000175000017500000000277711245562152021035 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBWINDOW_REQUESTOR_H__ #define __IDIRECTFBWINDOW_REQUESTOR_H__ #include /* * private data struct of IDirectFBWindow_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBWindow_Requestor_data; #endif DirectFB-1.2.10/proxy/requestor/idirectfbpalette_requestor.c0000644000175000017500000002345011245562152021146 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbpalette_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBPalette *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBPalette, Requestor ) /**************************************************************************************************/ static void IDirectFBPalette_Requestor_Destruct( IDirectFBPalette *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBPalette_Requestor_AddRef( IDirectFBPalette *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBPalette_Requestor_Release( IDirectFBPalette *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (--data->ref == 0) IDirectFBPalette_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBPalette_Requestor_GetCapabilities( IDirectFBPalette *thiz, DFBPaletteCapabilities *ret_caps ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBPaletteCapabilities caps; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (!ret_caps) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBPALETTE_METHOD_ID_GetCapabilities, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, caps ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_caps = caps; return DFB_OK; } static DFBResult IDirectFBPalette_Requestor_GetSize( IDirectFBPalette *thiz, unsigned int *ret_size ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; unsigned int size; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (!ret_size) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBPALETTE_METHOD_ID_GetSize, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, size ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_size = size; return DFB_OK; } static DFBResult IDirectFBPalette_Requestor_SetEntries( IDirectFBPalette *thiz, const DFBColor *entries, unsigned int num_entries, unsigned int offset ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (!entries) return DFB_INVARG; if (!num_entries) return DFB_OK; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBPALETTE_METHOD_ID_SetEntries, VREQ_RESPOND, &response, VMBT_DATA, num_entries * sizeof(DFBColor), entries, VMBT_UINT, num_entries, VMBT_UINT, offset, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBPalette_Requestor_GetEntries( IDirectFBPalette *thiz, DFBColor *entries, unsigned int num_entries, unsigned int offset ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (!entries) return DFB_INVARG; if (!num_entries) return DFB_OK; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBPALETTE_METHOD_ID_GetEntries, VREQ_RESPOND, &response, VMBT_UINT, num_entries, VMBT_UINT, offset, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, entries, num_entries * sizeof(DFBColor) ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBPalette_Requestor_FindBestMatch( IDirectFBPalette *thiz, u8 r, u8 g, u8 b, u8 a, unsigned int *ret_index ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; unsigned int index; DFBColor color = { a, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (!ret_index) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBPALETTE_METHOD_ID_FindBestMatch, VREQ_RESPOND, &response, VMBT_DATA, sizeof(color), &color, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, index ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_index = index; return DFB_OK; } static DFBResult IDirectFBPalette_Requestor_CreateCopy( IDirectFBPalette *thiz, IDirectFBPalette **ret_interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Requestor) if (!ret_interface) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBPalette *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBPalette_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBPalette_Requestor_AddRef; thiz->Release = IDirectFBPalette_Requestor_Release; thiz->GetCapabilities = IDirectFBPalette_Requestor_GetCapabilities; thiz->GetSize = IDirectFBPalette_Requestor_GetSize; thiz->SetEntries = IDirectFBPalette_Requestor_SetEntries; thiz->GetEntries = IDirectFBPalette_Requestor_GetEntries; thiz->FindBestMatch = IDirectFBPalette_Requestor_FindBestMatch; thiz->CreateCopy = IDirectFBPalette_Requestor_CreateCopy; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbeventbuffer_requestor.c0000644000175000017500000002075011245562152022023 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbeventbuffer_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBEventBuffer *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBEventBuffer, Requestor ) /**************************************************************************************************/ static void *feed_thread( DirectThread *thread, void *arg ); /**************************************************************************************************/ static void IDirectFBEventBuffer_Requestor_Destruct( IDirectFBEventBuffer *thiz ) { IDirectFBEventBuffer_Requestor_data *data = thiz->priv; D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); data->stop = true; data->src->WakeUp( data->src ); direct_thread_join( data->thread ); direct_thread_destroy( data->thread ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBEventBuffer_Requestor_AddRef( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBEventBuffer_Requestor_Release( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) if (--data->ref == 0) IDirectFBEventBuffer_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBEventBuffer_Requestor_Reset( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_WaitForEvent( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_WaitForEventWithTimeout( IDirectFBEventBuffer *thiz, unsigned int seconds, unsigned int milli_seconds ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_WakeUp( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_GetEvent( IDirectFBEventBuffer *thiz, DFBEvent *event ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_PeekEvent( IDirectFBEventBuffer *thiz, DFBEvent *event ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_HasEvent( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBEventBuffer_Requestor_PostEvent( IDirectFBEventBuffer *thiz, const DFBEvent *event ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) if (!event) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBEVENTBUFFER_METHOD_ID_PostEvent, VREQ_NONE, NULL, VMBT_DATA, sizeof(DFBEvent), event, VMBT_NONE ); } static DFBResult IDirectFBEventBuffer_Requestor_CreateFileDescriptor( IDirectFBEventBuffer *thiz, int *fd ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBEventBuffer *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBEventBuffer_Requestor) voodoo_manager_register_remote( manager, false, thiz, instance ); data->ref = 1; data->manager = manager; data->instance = instance; data->src = arg; data->dst = thiz; thiz->AddRef = IDirectFBEventBuffer_Requestor_AddRef; thiz->Release = IDirectFBEventBuffer_Requestor_Release; thiz->Reset = IDirectFBEventBuffer_Requestor_Reset; thiz->WaitForEvent = IDirectFBEventBuffer_Requestor_WaitForEvent; thiz->WaitForEventWithTimeout = IDirectFBEventBuffer_Requestor_WaitForEventWithTimeout; thiz->GetEvent = IDirectFBEventBuffer_Requestor_GetEvent; thiz->PeekEvent = IDirectFBEventBuffer_Requestor_PeekEvent; thiz->HasEvent = IDirectFBEventBuffer_Requestor_HasEvent; thiz->PostEvent = IDirectFBEventBuffer_Requestor_PostEvent; thiz->WakeUp = IDirectFBEventBuffer_Requestor_WakeUp; thiz->CreateFileDescriptor = IDirectFBEventBuffer_Requestor_CreateFileDescriptor; data->thread = direct_thread_create( DTT_INPUT, feed_thread, data, "Event Feed" ); return DFB_OK; } /**************************************************************************************************/ static void * feed_thread( DirectThread *thread, void *arg ) { DFBResult ret; IDirectFBEventBuffer_Requestor_data *data = arg; IDirectFBEventBuffer *src = data->src; IDirectFBEventBuffer *dst = data->dst; while (!data->stop) { DFBEvent event; ret = src->WaitForEvent( src ); if (ret) { if (ret == DFB_INTERRUPTED) continue; DirectFBError( "IDirectFBEventBuffer::WaitForEvent", ret ); return NULL; } if (data->stop) return NULL; while (src->GetEvent( src, &event ) == DFB_OK) { ret = dst->PostEvent( dst, &event ); if (ret) { DirectFBError( "IDirectFBEventBuffer::PostEvent", ret ); return NULL; } if (data->stop) return NULL; } } return NULL; } DirectFB-1.2.10/proxy/requestor/Makefile.am0000644000175000017500000001170011245562146015411 00000000000000## Makefile.am for DirectFB/proxy/requestor INTERFACES_DIR = $(MODULEDIR)/interfaces idirectfbdir = $(INTERFACES_DIR)/IDirectFB idirectfbdatabufferdir = $(INTERFACES_DIR)/IDirectFBDataBuffer idirectfbdisplaylayerdir = $(INTERFACES_DIR)/IDirectFBDisplayLayer idirectfbeventbufferdir = $(INTERFACES_DIR)/IDirectFBEventBuffer idirectfbfontdir = $(INTERFACES_DIR)/IDirectFBFont idirectfbimageproviderdir = $(INTERFACES_DIR)/IDirectFBImageProvider idirectfbinputdevicedir = $(INTERFACES_DIR)/IDirectFBInputDevice idirectfbpalettedir = $(INTERFACES_DIR)/IDirectFBPalette idirectfbscreendir = $(INTERFACES_DIR)/IDirectFBScreen idirectfbsurfacedir = $(INTERFACES_DIR)/IDirectFBSurface idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/proxy/dispatcher \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" LIBS = \ $(top_builddir)/lib/voodoo/libvoodoo.la \ $(top_builddir)/lib/direct/libdirect.la idirectfb_LTLIBRARIES = \ libidirectfb_requestor.la idirectfbdatabuffer_LTLIBRARIES = \ libidirectfbdatabuffer_requestor.la idirectfbdisplaylayer_LTLIBRARIES = \ libidirectfbdisplaylayer_requestor.la idirectfbeventbuffer_LTLIBRARIES = \ libidirectfbeventbuffer_requestor.la idirectfbfont_LTLIBRARIES = \ libidirectfbfont_requestor.la idirectfbimageprovider_LTLIBRARIES = \ libidirectfbimageprovider_requestor.la idirectfbinputdevice_LTLIBRARIES = \ libidirectfbinputdevice_requestor.la idirectfbpalette_LTLIBRARIES = \ libidirectfbpalette_requestor.la idirectfbscreen_LTLIBRARIES = \ libidirectfbscreen_requestor.la idirectfbsurface_LTLIBRARIES = \ libidirectfbsurface_requestor.la idirectfbwindow_LTLIBRARIES = \ libidirectfbwindow_requestor.la if BUILD_STATIC idirectfb_DATA = libidirectfb_requestor.o idirectfbdatabuffer_DATA = libidirectfbdatabuffer_requestor.o idirectfbdisplaylayer_DATA = libidirectfbdisplaylayer_requestor.o idirectfbeventbuffer_DATA = libidirectfbeventbuffer_requestor.o idirectfbfont_DATA = libidirectfbfont_requestor.o idirectfbimageprovider_DATA = libidirectfbimageprovider_requestor.o idirectfbinputdevice_DATA = libidirectfbinputdevice_requestor.o idirectfbpalette_DATA = libidirectfbpalette_requestor.o idirectfbscreen_DATA = libidirectfbscreen_requestor.o idirectfbsurface_DATA = libidirectfbsurface_requestor.o idirectfbwindow_DATA = libidirectfbwindow_requestor.o endif libidirectfb_requestor_la_SOURCES = idirectfb_requestor.c libidirectfb_requestor_la_LDFLAGS = -avoid-version -module libidirectfb_requestor_la_LIBADD = $(LIBS) libidirectfbdatabuffer_requestor_la_SOURCES = idirectfbdatabuffer_requestor.c libidirectfbdatabuffer_requestor_la_LDFLAGS = -avoid-version -module libidirectfbdatabuffer_requestor_la_LIBADD = $(LIBS) libidirectfbdisplaylayer_requestor_la_SOURCES = idirectfbdisplaylayer_requestor.c idirectfbdisplaylayer_requestor.h libidirectfbdisplaylayer_requestor_la_LDFLAGS = -avoid-version -module libidirectfbdisplaylayer_requestor_la_LIBADD = $(LIBS) libidirectfbeventbuffer_requestor_la_SOURCES = idirectfbeventbuffer_requestor.c idirectfbeventbuffer_requestor.h libidirectfbeventbuffer_requestor_la_LDFLAGS = -avoid-version -module libidirectfbeventbuffer_requestor_la_LIBADD = $(LIBS) libidirectfbfont_requestor_la_SOURCES = idirectfbfont_requestor.c idirectfbfont_requestor.h libidirectfbfont_requestor_la_LDFLAGS = -avoid-version -module libidirectfbfont_requestor_la_LIBADD = $(LIBS) libidirectfbimageprovider_requestor_la_SOURCES = idirectfbimageprovider_requestor.c libidirectfbimageprovider_requestor_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_requestor_la_LIBADD = $(LIBS) libidirectfbinputdevice_requestor_la_SOURCES = idirectfbinputdevice_requestor.c idirectfbinputdevice_requestor.h libidirectfbinputdevice_requestor_la_LDFLAGS = -avoid-version -module libidirectfbinputdevice_requestor_la_LIBADD = $(LIBS) libidirectfbpalette_requestor_la_SOURCES = idirectfbpalette_requestor.c idirectfbpalette_requestor.h libidirectfbpalette_requestor_la_LDFLAGS = -avoid-version -module libidirectfbpalette_requestor_la_LIBADD = $(LIBS) libidirectfbscreen_requestor_la_SOURCES = idirectfbscreen_requestor.c libidirectfbscreen_requestor_la_LDFLAGS = -avoid-version -module libidirectfbscreen_requestor_la_LIBADD = $(LIBS) libidirectfbsurface_requestor_la_SOURCES = idirectfbsurface_requestor.c idirectfbsurface_requestor.h libidirectfbsurface_requestor_la_LDFLAGS = -avoid-version -module libidirectfbsurface_requestor_la_LIBADD = $(LIBS) libidirectfbwindow_requestor_la_SOURCES = idirectfbwindow_requestor.c idirectfbwindow_requestor.h libidirectfbwindow_requestor_la_LDFLAGS = -avoid-version -module libidirectfbwindow_requestor_la_LIBADD = $(LIBS) include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/proxy/requestor/idirectfbeventbuffer_requestor.h0000644000175000017500000000331311245562152022024 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBEVENTBUFFER_REQUESTOR_H__ #define __IDIRECTFBEVENTBUFFER_REQUESTOR_H__ #include #include #include /* * private data struct of IDirectFBEventBuffer_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; IDirectFBEventBuffer *src; IDirectFBEventBuffer *dst; bool stop; DirectThread *thread; } IDirectFBEventBuffer_Requestor_data; #endif DirectFB-1.2.10/proxy/requestor/idirectfbsurface_requestor.c0000644000175000017500000012020511245562152021134 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbfont_requestor.h" #include "idirectfbpalette_requestor.h" #include "idirectfbsurface_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBSurface *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBSurface, Requestor ) /**************************************************************************************************/ static void IDirectFBSurface_Requestor_Destruct( IDirectFBSurface *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBSurface_Requestor_AddRef( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBSurface_Requestor_Release( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (--data->ref == 0) IDirectFBSurface_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBSurface_Requestor_GetPixelFormat( IDirectFBSurface *thiz, DFBSurfacePixelFormat *ret_format ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBSurfacePixelFormat format; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!ret_format) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetPixelFormat, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, format ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_format = format; return ret; } static DFBResult IDirectFBSurface_Requestor_GetAccelerationMask( IDirectFBSurface *thiz, IDirectFBSurface *source, DFBAccelerationMask *ret_mask ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBAccelerationMask mask; IDirectFBSurface_Requestor_data *source_data = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (source) DIRECT_INTERFACE_GET_DATA_FROM( source, source_data, IDirectFBSurface_Requestor ); ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetAccelerationMask, VREQ_RESPOND, &response, VMBT_ID, source_data ? source_data->instance : VOODOO_INSTANCE_NONE, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, mask ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_mask = mask; return ret; } static DFBResult IDirectFBSurface_Requestor_GetPosition( IDirectFBSurface *thiz, int *x, int *y ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBPoint *position; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!x && !y) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetPosition, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, position ); VOODOO_PARSER_END( parser ); if (x) *x = position->x; if (y) *y = position->y; voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBSurface_Requestor_GetSize( IDirectFBSurface *thiz, int *width, int *height ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBDimension *dimension; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!width && !height) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetSize, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, dimension ); VOODOO_PARSER_END( parser ); if (width) *width = dimension->w; if (height) *height = dimension->h; voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBSurface_Requestor_GetVisibleRectangle( IDirectFBSurface *thiz, DFBRectangle *rect ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!rect) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetVisibleRectangle, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, rect, sizeof(DFBRectangle) ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBSurface_Requestor_GetCapabilities( IDirectFBSurface *thiz, DFBSurfaceCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!caps) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_GetPalette( IDirectFBSurface *thiz, IDirectFBPalette **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetPalette, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBPalette", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFBSurface_Requestor_SetPalette( IDirectFBSurface *thiz, IDirectFBPalette *palette ) { IDirectFBPalette_Requestor_data *palette_data = NULL; DIRECT_INTERFACE_GET_DATA( IDirectFBSurface_Requestor ) if (!palette) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( palette, palette_data, IDirectFBPalette_Requestor ); return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetPalette, VREQ_QUEUE, NULL, VMBT_ID, palette_data->instance, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetAlphaRamp( IDirectFBSurface *thiz, u8 a0, u8 a1, u8 a2, u8 a3 ) { DIRECT_INTERFACE_GET_DATA( IDirectFBSurface_Requestor ) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_Lock( IDirectFBSurface *thiz, DFBSurfaceLockFlags flags, void **ret_ptr, int *ret_pitch ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!flags || !ret_ptr || !ret_pitch) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_GetFramebufferOffset( IDirectFBSurface *thiz, int *offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!offset) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_Unlock( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_Flip( IDirectFBSurface *thiz, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) /* HACK for performance */ // flags &= ~DSFLIP_WAITFORSYNC; if (flags & DSFLIP_WAIT) { DirectResult ret; VoodooResponseMessage *response; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_Flip, VREQ_RESPOND, &response, VMBT_ODATA, sizeof(DFBRegion), region, VMBT_INT, flags, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_Flip, VREQ_NONE, NULL, VMBT_ODATA, sizeof(DFBRegion), region, VMBT_INT, flags, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetField( IDirectFBSurface *thiz, int field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (field < 0 || field > 1) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_Clear( IDirectFBSurface *thiz, u8 r, u8 g, u8 b, u8 a ) { DFBColor color = { a, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_Clear, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBColor), &color, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetClip( IDirectFBSurface *thiz, const DFBRegion *clip ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetClip, VREQ_QUEUE, NULL, VMBT_ODATA, sizeof(DFBRegion), clip, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetColor( IDirectFBSurface *thiz, u8 r, u8 g, u8 b, u8 a ) { DFBColor color = { a, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetColor, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBColor), &color, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetColorIndex( IDirectFBSurface *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_SetSrcBlendFunction( IDirectFBSurface *thiz, DFBSurfaceBlendFunction src ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_SetDstBlendFunction( IDirectFBSurface *thiz, DFBSurfaceBlendFunction dst ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_SetPorterDuff( IDirectFBSurface *thiz, DFBSurfacePorterDuffRule rule ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_SetSrcColorKey( IDirectFBSurface *thiz, u8 r, u8 g, u8 b ) { DFBColor color = { 0, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetSrcColorKey, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBColor), &color, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetSrcColorKeyIndex( IDirectFBSurface *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetSrcColorKeyIndex, VREQ_QUEUE, NULL, VMBT_UINT, index, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetDstColorKey( IDirectFBSurface *thiz, u8 r, u8 g, u8 b ) { DFBColor color = { 0, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetDstColorKey, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBColor), &color, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetDstColorKeyIndex( IDirectFBSurface *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetDstColorKeyIndex, VREQ_QUEUE, NULL, VMBT_UINT, index, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetFont( IDirectFBSurface *thiz, IDirectFBFont *font ) { IDirectFBFont_Requestor_data *font_data = NULL; DIRECT_INTERFACE_GET_DATA( IDirectFBSurface_Requestor ) if (data->font == font) return DFB_OK; if (font) { font->AddRef (font); DIRECT_INTERFACE_GET_DATA_FROM( font, font_data, IDirectFBFont_Requestor ); } if (data->font) data->font->Release (data->font); data->font = font; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetFont, VREQ_QUEUE, NULL, VMBT_ID, font_data ? font_data->instance : VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_GetFont( IDirectFBSurface *thiz, IDirectFBFont **font ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_SetDrawingFlags( IDirectFBSurface *thiz, DFBSurfaceDrawingFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetDrawingFlags, VREQ_QUEUE, NULL, VMBT_INT, flags, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_FillRectangle( IDirectFBSurface *thiz, int x, int y, int w, int h ) { DFBRectangle rect = { x, y, w, h }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (w <= 0 || h <= 0) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_FillRectangle, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBRectangle), &rect, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_FillRectangles( IDirectFBSurface *thiz, const DFBRectangle *rects, unsigned int num_rects ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!rects || !num_rects) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_FillRectangles, VREQ_QUEUE, NULL, VMBT_UINT, num_rects, VMBT_DATA, num_rects * sizeof(DFBRectangle), rects, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_FillSpans( IDirectFBSurface *thiz, int y, const DFBSpan *spans, unsigned int num_spans ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!spans || !num_spans) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_FillSpans, VREQ_QUEUE, NULL, VMBT_INT, y, VMBT_UINT, num_spans, VMBT_DATA, num_spans * sizeof(DFBSpan), spans, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_DrawLine( IDirectFBSurface *thiz, int x1, int y1, int x2, int y2 ) { DFBRegion line = { x1, y1, x2, y2 }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_DrawLine, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBRegion), &line, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_DrawLines( IDirectFBSurface *thiz, const DFBRegion *lines, unsigned int num_lines ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!lines || !num_lines) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_DrawLines, VREQ_QUEUE, NULL, VMBT_UINT, num_lines, VMBT_DATA, num_lines * sizeof(DFBRegion), lines, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_DrawRectangle( IDirectFBSurface *thiz, int x, int y, int w, int h ) { DFBRectangle rect = { x, y, w, h }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (w <= 0 || h <= 0) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_DrawRectangle, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBRectangle), &rect, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_FillTriangle( IDirectFBSurface *thiz, int x1, int y1, int x2, int y2, int x3, int y3 ) { DFBTriangle triangle = { x1, y1, x2, y2, x3, y3 }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_FillTriangle, VREQ_QUEUE, NULL, VMBT_DATA, sizeof(DFBTriangle), &triangle, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetBlittingFlags( IDirectFBSurface *thiz, DFBSurfaceBlittingFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetBlittingFlags, VREQ_QUEUE, NULL, VMBT_INT, flags, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_Blit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *rect, int x, int y ) { DFBPoint point = { x, y }; IDirectFBSurface_Requestor_data *source_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!source) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( source, source_data, IDirectFBSurface_Requestor ); return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_Blit, VREQ_QUEUE, NULL, VMBT_ID, source_data->instance, VMBT_ODATA, sizeof(DFBRectangle), rect, VMBT_DATA, sizeof(point), &point, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_TileBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *rect, int x, int y ) { DFBPoint point = { x, y }; IDirectFBSurface_Requestor_data *source_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!source) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( source, source_data, IDirectFBSurface_Requestor ); return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_TileBlit, VREQ_QUEUE, NULL, VMBT_ID, source_data->instance, VMBT_ODATA, sizeof(DFBRectangle), rect, VMBT_DATA, sizeof(point), &point, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_BatchBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rects, const DFBPoint *dest_points, int num ) { IDirectFBSurface_Requestor_data *source_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!source || !source_rects || !dest_points || num < 1) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( source, source_data, IDirectFBSurface_Requestor ); return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_BatchBlit, VREQ_QUEUE, NULL, VMBT_ID, source_data->instance, VMBT_UINT, num, VMBT_DATA, num * sizeof(DFBRectangle), source_rects, VMBT_DATA, num * sizeof(DFBPoint), dest_points, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_StretchBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rect, const DFBRectangle *destination_rect ) { IDirectFBSurface_Requestor_data *source_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!source) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( source, source_data, IDirectFBSurface_Requestor ); return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_StretchBlit, VREQ_QUEUE, NULL, VMBT_ID, source_data->instance, VMBT_ODATA, sizeof(DFBRectangle), source_rect, VMBT_ODATA, sizeof(DFBRectangle), destination_rect, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_TextureTriangles( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBVertex *vertices, const int *indices, int num, DFBTriangleFormation formation ) { int i; int num_vertices = 0; IDirectFBSurface_Requestor_data *source_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!source || !vertices || num < 3) return DFB_INVARG; if (indices) { for (i=0; imanager, data->instance, IDIRECTFBSURFACE_METHOD_ID_TextureTriangles, VREQ_QUEUE, NULL, VMBT_ID, source_data->instance, VMBT_DATA, num_vertices * sizeof(DFBVertex), vertices, VMBT_ODATA, num * sizeof(int), indices, VMBT_INT, num, VMBT_INT, formation, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_DrawString( IDirectFBSurface *thiz, const char *text, int bytes, int x, int y, DFBSurfaceTextFlags flags ) { DFBPoint point = { x, y }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!text) return DFB_INVARG; if (!data->font) return DFB_MISSINGFONT; if (bytes < 0) bytes = strlen (text); if (bytes == 0) return DFB_OK; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_DrawString, VREQ_QUEUE, NULL, VMBT_DATA, bytes, text, VMBT_INT, bytes, VMBT_DATA, sizeof(point), &point, VMBT_INT, flags, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_DrawGlyph( IDirectFBSurface *thiz, unsigned int index, int x, int y, DFBSurfaceTextFlags flags ) { DFBPoint point = { x, y }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!index) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_DrawGlyph, VREQ_QUEUE, NULL, VMBT_UINT, index, VMBT_DATA, sizeof(point), &point, VMBT_INT, flags, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetEncoding( IDirectFBSurface *thiz, DFBTextEncodingID encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_SetEncoding, VREQ_QUEUE, NULL, VMBT_UINT, encoding, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_GetSubSurface( IDirectFBSurface *thiz, const DFBRectangle *rect, IDirectFBSurface **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_GetSubSurface, VREQ_RESPOND, &response, VMBT_ODATA, sizeof(DFBRectangle), rect, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBSurface", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFBSurface_Requestor_GetGL( IDirectFBSurface *thiz, IDirectFBGL **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!interface) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_Dump( IDirectFBSurface *thiz, const char *directory, const char *prefix ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) if (!directory || !prefix) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Requestor_DisableAcceleration( IDirectFBSurface *thiz, DFBAccelerationMask mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_DisableAcceleration, VREQ_QUEUE, NULL, VMBT_UINT, mask, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_ReleaseSource( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSURFACE_METHOD_ID_ReleaseSource, VREQ_QUEUE, NULL, VMBT_NONE ); } static DFBResult IDirectFBSurface_Requestor_SetIndexTranslation( IDirectFBSurface *thiz, const int *indices, int num_indices ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBSurface *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBSurface_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBSurface_Requestor_AddRef; thiz->Release = IDirectFBSurface_Requestor_Release; thiz->GetCapabilities = IDirectFBSurface_Requestor_GetCapabilities; thiz->GetPosition = IDirectFBSurface_Requestor_GetPosition; thiz->GetSize = IDirectFBSurface_Requestor_GetSize; thiz->GetVisibleRectangle = IDirectFBSurface_Requestor_GetVisibleRectangle; thiz->GetPixelFormat = IDirectFBSurface_Requestor_GetPixelFormat; thiz->GetAccelerationMask = IDirectFBSurface_Requestor_GetAccelerationMask; thiz->GetPalette = IDirectFBSurface_Requestor_GetPalette; thiz->SetPalette = IDirectFBSurface_Requestor_SetPalette; thiz->SetAlphaRamp = IDirectFBSurface_Requestor_SetAlphaRamp; thiz->Lock = IDirectFBSurface_Requestor_Lock; thiz->GetFramebufferOffset = IDirectFBSurface_Requestor_GetFramebufferOffset; thiz->Unlock = IDirectFBSurface_Requestor_Unlock; thiz->Flip = IDirectFBSurface_Requestor_Flip; thiz->SetField = IDirectFBSurface_Requestor_SetField; thiz->Clear = IDirectFBSurface_Requestor_Clear; thiz->SetClip = IDirectFBSurface_Requestor_SetClip; thiz->SetColor = IDirectFBSurface_Requestor_SetColor; thiz->SetColorIndex = IDirectFBSurface_Requestor_SetColorIndex; thiz->SetSrcBlendFunction = IDirectFBSurface_Requestor_SetSrcBlendFunction; thiz->SetDstBlendFunction = IDirectFBSurface_Requestor_SetDstBlendFunction; thiz->SetPorterDuff = IDirectFBSurface_Requestor_SetPorterDuff; thiz->SetSrcColorKey = IDirectFBSurface_Requestor_SetSrcColorKey; thiz->SetSrcColorKeyIndex = IDirectFBSurface_Requestor_SetSrcColorKeyIndex; thiz->SetDstColorKey = IDirectFBSurface_Requestor_SetDstColorKey; thiz->SetDstColorKeyIndex = IDirectFBSurface_Requestor_SetDstColorKeyIndex; thiz->SetBlittingFlags = IDirectFBSurface_Requestor_SetBlittingFlags; thiz->Blit = IDirectFBSurface_Requestor_Blit; thiz->TileBlit = IDirectFBSurface_Requestor_TileBlit; thiz->BatchBlit = IDirectFBSurface_Requestor_BatchBlit; thiz->StretchBlit = IDirectFBSurface_Requestor_StretchBlit; thiz->TextureTriangles = IDirectFBSurface_Requestor_TextureTriangles; thiz->SetDrawingFlags = IDirectFBSurface_Requestor_SetDrawingFlags; thiz->FillRectangle = IDirectFBSurface_Requestor_FillRectangle; thiz->FillRectangles = IDirectFBSurface_Requestor_FillRectangles; thiz->FillSpans = IDirectFBSurface_Requestor_FillSpans; thiz->DrawLine = IDirectFBSurface_Requestor_DrawLine; thiz->DrawLines = IDirectFBSurface_Requestor_DrawLines; thiz->DrawRectangle = IDirectFBSurface_Requestor_DrawRectangle; thiz->FillTriangle = IDirectFBSurface_Requestor_FillTriangle; thiz->SetFont = IDirectFBSurface_Requestor_SetFont; thiz->GetFont = IDirectFBSurface_Requestor_GetFont; thiz->DrawString = IDirectFBSurface_Requestor_DrawString; thiz->DrawGlyph = IDirectFBSurface_Requestor_DrawGlyph; thiz->SetEncoding = IDirectFBSurface_Requestor_SetEncoding; thiz->GetSubSurface = IDirectFBSurface_Requestor_GetSubSurface; thiz->GetGL = IDirectFBSurface_Requestor_GetGL; thiz->Dump = IDirectFBSurface_Requestor_Dump; thiz->DisableAcceleration = IDirectFBSurface_Requestor_DisableAcceleration; thiz->ReleaseSource = IDirectFBSurface_Requestor_ReleaseSource; thiz->SetIndexTranslation = IDirectFBSurface_Requestor_SetIndexTranslation; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/Makefile.in0000644000175000017500000017077611307521505015436 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = proxy/requestor ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(idirectfbdir)" \ "$(DESTDIR)$(idirectfbdatabufferdir)" \ "$(DESTDIR)$(idirectfbdisplaylayerdir)" \ "$(DESTDIR)$(idirectfbeventbufferdir)" \ "$(DESTDIR)$(idirectfbfontdir)" \ "$(DESTDIR)$(idirectfbimageproviderdir)" \ "$(DESTDIR)$(idirectfbinputdevicedir)" \ "$(DESTDIR)$(idirectfbpalettedir)" \ "$(DESTDIR)$(idirectfbscreendir)" \ "$(DESTDIR)$(idirectfbsurfacedir)" \ "$(DESTDIR)$(idirectfbwindowdir)" "$(DESTDIR)$(idirectfbdir)" \ "$(DESTDIR)$(idirectfbdatabufferdir)" \ "$(DESTDIR)$(idirectfbdisplaylayerdir)" \ "$(DESTDIR)$(idirectfbeventbufferdir)" \ "$(DESTDIR)$(idirectfbfontdir)" \ "$(DESTDIR)$(idirectfbimageproviderdir)" \ "$(DESTDIR)$(idirectfbinputdevicedir)" \ "$(DESTDIR)$(idirectfbpalettedir)" \ "$(DESTDIR)$(idirectfbscreendir)" \ "$(DESTDIR)$(idirectfbsurfacedir)" \ "$(DESTDIR)$(idirectfbwindowdir)" idirectfbLTLIBRARIES_INSTALL = $(INSTALL) idirectfbdatabufferLTLIBRARIES_INSTALL = $(INSTALL) idirectfbdisplaylayerLTLIBRARIES_INSTALL = $(INSTALL) idirectfbeventbufferLTLIBRARIES_INSTALL = $(INSTALL) idirectfbfontLTLIBRARIES_INSTALL = $(INSTALL) idirectfbimageproviderLTLIBRARIES_INSTALL = $(INSTALL) idirectfbinputdeviceLTLIBRARIES_INSTALL = $(INSTALL) idirectfbpaletteLTLIBRARIES_INSTALL = $(INSTALL) idirectfbscreenLTLIBRARIES_INSTALL = $(INSTALL) idirectfbsurfaceLTLIBRARIES_INSTALL = $(INSTALL) idirectfbwindowLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(idirectfb_LTLIBRARIES) \ $(idirectfbdatabuffer_LTLIBRARIES) \ $(idirectfbdisplaylayer_LTLIBRARIES) \ $(idirectfbeventbuffer_LTLIBRARIES) \ $(idirectfbfont_LTLIBRARIES) \ $(idirectfbimageprovider_LTLIBRARIES) \ $(idirectfbinputdevice_LTLIBRARIES) \ $(idirectfbpalette_LTLIBRARIES) $(idirectfbscreen_LTLIBRARIES) \ $(idirectfbsurface_LTLIBRARIES) $(idirectfbwindow_LTLIBRARIES) libidirectfb_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfb_requestor_la_OBJECTS = idirectfb_requestor.lo libidirectfb_requestor_la_OBJECTS = \ $(am_libidirectfb_requestor_la_OBJECTS) libidirectfb_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libidirectfb_requestor_la_LDFLAGS) \ $(LDFLAGS) -o $@ libidirectfbdatabuffer_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbdatabuffer_requestor_la_OBJECTS = \ idirectfbdatabuffer_requestor.lo libidirectfbdatabuffer_requestor_la_OBJECTS = \ $(am_libidirectfbdatabuffer_requestor_la_OBJECTS) libidirectfbdatabuffer_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbdatabuffer_requestor_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbdisplaylayer_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbdisplaylayer_requestor_la_OBJECTS = \ idirectfbdisplaylayer_requestor.lo libidirectfbdisplaylayer_requestor_la_OBJECTS = \ $(am_libidirectfbdisplaylayer_requestor_la_OBJECTS) libidirectfbdisplaylayer_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbdisplaylayer_requestor_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbeventbuffer_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbeventbuffer_requestor_la_OBJECTS = \ idirectfbeventbuffer_requestor.lo libidirectfbeventbuffer_requestor_la_OBJECTS = \ $(am_libidirectfbeventbuffer_requestor_la_OBJECTS) libidirectfbeventbuffer_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbeventbuffer_requestor_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbfont_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbfont_requestor_la_OBJECTS = idirectfbfont_requestor.lo libidirectfbfont_requestor_la_OBJECTS = \ $(am_libidirectfbfont_requestor_la_OBJECTS) libidirectfbfont_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbfont_requestor_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbimageprovider_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbimageprovider_requestor_la_OBJECTS = \ idirectfbimageprovider_requestor.lo libidirectfbimageprovider_requestor_la_OBJECTS = \ $(am_libidirectfbimageprovider_requestor_la_OBJECTS) libidirectfbimageprovider_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbimageprovider_requestor_la_LDFLAGS) $(LDFLAGS) \ -o $@ libidirectfbinputdevice_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbinputdevice_requestor_la_OBJECTS = \ idirectfbinputdevice_requestor.lo libidirectfbinputdevice_requestor_la_OBJECTS = \ $(am_libidirectfbinputdevice_requestor_la_OBJECTS) libidirectfbinputdevice_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbinputdevice_requestor_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbpalette_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbpalette_requestor_la_OBJECTS = \ idirectfbpalette_requestor.lo libidirectfbpalette_requestor_la_OBJECTS = \ $(am_libidirectfbpalette_requestor_la_OBJECTS) libidirectfbpalette_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbpalette_requestor_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbscreen_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbscreen_requestor_la_OBJECTS = \ idirectfbscreen_requestor.lo libidirectfbscreen_requestor_la_OBJECTS = \ $(am_libidirectfbscreen_requestor_la_OBJECTS) libidirectfbscreen_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbscreen_requestor_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbsurface_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbsurface_requestor_la_OBJECTS = \ idirectfbsurface_requestor.lo libidirectfbsurface_requestor_la_OBJECTS = \ $(am_libidirectfbsurface_requestor_la_OBJECTS) libidirectfbsurface_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbsurface_requestor_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbwindow_requestor_la_DEPENDENCIES = $(LIBS) am_libidirectfbwindow_requestor_la_OBJECTS = \ idirectfbwindow_requestor.lo libidirectfbwindow_requestor_la_OBJECTS = \ $(am_libidirectfbwindow_requestor_la_OBJECTS) libidirectfbwindow_requestor_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbwindow_requestor_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libidirectfb_requestor_la_SOURCES) \ $(libidirectfbdatabuffer_requestor_la_SOURCES) \ $(libidirectfbdisplaylayer_requestor_la_SOURCES) \ $(libidirectfbeventbuffer_requestor_la_SOURCES) \ $(libidirectfbfont_requestor_la_SOURCES) \ $(libidirectfbimageprovider_requestor_la_SOURCES) \ $(libidirectfbinputdevice_requestor_la_SOURCES) \ $(libidirectfbpalette_requestor_la_SOURCES) \ $(libidirectfbscreen_requestor_la_SOURCES) \ $(libidirectfbsurface_requestor_la_SOURCES) \ $(libidirectfbwindow_requestor_la_SOURCES) DIST_SOURCES = $(libidirectfb_requestor_la_SOURCES) \ $(libidirectfbdatabuffer_requestor_la_SOURCES) \ $(libidirectfbdisplaylayer_requestor_la_SOURCES) \ $(libidirectfbeventbuffer_requestor_la_SOURCES) \ $(libidirectfbfont_requestor_la_SOURCES) \ $(libidirectfbimageprovider_requestor_la_SOURCES) \ $(libidirectfbinputdevice_requestor_la_SOURCES) \ $(libidirectfbpalette_requestor_la_SOURCES) \ $(libidirectfbscreen_requestor_la_SOURCES) \ $(libidirectfbsurface_requestor_la_SOURCES) \ $(libidirectfbwindow_requestor_la_SOURCES) idirectfbDATA_INSTALL = $(INSTALL_DATA) idirectfbdatabufferDATA_INSTALL = $(INSTALL_DATA) idirectfbdisplaylayerDATA_INSTALL = $(INSTALL_DATA) idirectfbeventbufferDATA_INSTALL = $(INSTALL_DATA) idirectfbfontDATA_INSTALL = $(INSTALL_DATA) idirectfbimageproviderDATA_INSTALL = $(INSTALL_DATA) idirectfbinputdeviceDATA_INSTALL = $(INSTALL_DATA) idirectfbpaletteDATA_INSTALL = $(INSTALL_DATA) idirectfbscreenDATA_INSTALL = $(INSTALL_DATA) idirectfbsurfaceDATA_INSTALL = $(INSTALL_DATA) idirectfbwindowDATA_INSTALL = $(INSTALL_DATA) DATA = $(idirectfb_DATA) $(idirectfbdatabuffer_DATA) \ $(idirectfbdisplaylayer_DATA) $(idirectfbeventbuffer_DATA) \ $(idirectfbfont_DATA) $(idirectfbimageprovider_DATA) \ $(idirectfbinputdevice_DATA) $(idirectfbpalette_DATA) \ $(idirectfbscreen_DATA) $(idirectfbsurface_DATA) \ $(idirectfbwindow_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = \ $(top_builddir)/lib/voodoo/libvoodoo.la \ $(top_builddir)/lib/direct/libdirect.la LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INTERFACES_DIR = $(MODULEDIR)/interfaces idirectfbdir = $(INTERFACES_DIR)/IDirectFB idirectfbdatabufferdir = $(INTERFACES_DIR)/IDirectFBDataBuffer idirectfbdisplaylayerdir = $(INTERFACES_DIR)/IDirectFBDisplayLayer idirectfbeventbufferdir = $(INTERFACES_DIR)/IDirectFBEventBuffer idirectfbfontdir = $(INTERFACES_DIR)/IDirectFBFont idirectfbimageproviderdir = $(INTERFACES_DIR)/IDirectFBImageProvider idirectfbinputdevicedir = $(INTERFACES_DIR)/IDirectFBInputDevice idirectfbpalettedir = $(INTERFACES_DIR)/IDirectFBPalette idirectfbscreendir = $(INTERFACES_DIR)/IDirectFBScreen idirectfbsurfacedir = $(INTERFACES_DIR)/IDirectFBSurface idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/proxy/dispatcher \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" idirectfb_LTLIBRARIES = \ libidirectfb_requestor.la idirectfbdatabuffer_LTLIBRARIES = \ libidirectfbdatabuffer_requestor.la idirectfbdisplaylayer_LTLIBRARIES = \ libidirectfbdisplaylayer_requestor.la idirectfbeventbuffer_LTLIBRARIES = \ libidirectfbeventbuffer_requestor.la idirectfbfont_LTLIBRARIES = \ libidirectfbfont_requestor.la idirectfbimageprovider_LTLIBRARIES = \ libidirectfbimageprovider_requestor.la idirectfbinputdevice_LTLIBRARIES = \ libidirectfbinputdevice_requestor.la idirectfbpalette_LTLIBRARIES = \ libidirectfbpalette_requestor.la idirectfbscreen_LTLIBRARIES = \ libidirectfbscreen_requestor.la idirectfbsurface_LTLIBRARIES = \ libidirectfbsurface_requestor.la idirectfbwindow_LTLIBRARIES = \ libidirectfbwindow_requestor.la @BUILD_STATIC_TRUE@idirectfb_DATA = libidirectfb_requestor.o @BUILD_STATIC_TRUE@idirectfbdatabuffer_DATA = libidirectfbdatabuffer_requestor.o @BUILD_STATIC_TRUE@idirectfbdisplaylayer_DATA = libidirectfbdisplaylayer_requestor.o @BUILD_STATIC_TRUE@idirectfbeventbuffer_DATA = libidirectfbeventbuffer_requestor.o @BUILD_STATIC_TRUE@idirectfbfont_DATA = libidirectfbfont_requestor.o @BUILD_STATIC_TRUE@idirectfbimageprovider_DATA = libidirectfbimageprovider_requestor.o @BUILD_STATIC_TRUE@idirectfbinputdevice_DATA = libidirectfbinputdevice_requestor.o @BUILD_STATIC_TRUE@idirectfbpalette_DATA = libidirectfbpalette_requestor.o @BUILD_STATIC_TRUE@idirectfbscreen_DATA = libidirectfbscreen_requestor.o @BUILD_STATIC_TRUE@idirectfbsurface_DATA = libidirectfbsurface_requestor.o @BUILD_STATIC_TRUE@idirectfbwindow_DATA = libidirectfbwindow_requestor.o libidirectfb_requestor_la_SOURCES = idirectfb_requestor.c libidirectfb_requestor_la_LDFLAGS = -avoid-version -module libidirectfb_requestor_la_LIBADD = $(LIBS) libidirectfbdatabuffer_requestor_la_SOURCES = idirectfbdatabuffer_requestor.c libidirectfbdatabuffer_requestor_la_LDFLAGS = -avoid-version -module libidirectfbdatabuffer_requestor_la_LIBADD = $(LIBS) libidirectfbdisplaylayer_requestor_la_SOURCES = idirectfbdisplaylayer_requestor.c idirectfbdisplaylayer_requestor.h libidirectfbdisplaylayer_requestor_la_LDFLAGS = -avoid-version -module libidirectfbdisplaylayer_requestor_la_LIBADD = $(LIBS) libidirectfbeventbuffer_requestor_la_SOURCES = idirectfbeventbuffer_requestor.c idirectfbeventbuffer_requestor.h libidirectfbeventbuffer_requestor_la_LDFLAGS = -avoid-version -module libidirectfbeventbuffer_requestor_la_LIBADD = $(LIBS) libidirectfbfont_requestor_la_SOURCES = idirectfbfont_requestor.c idirectfbfont_requestor.h libidirectfbfont_requestor_la_LDFLAGS = -avoid-version -module libidirectfbfont_requestor_la_LIBADD = $(LIBS) libidirectfbimageprovider_requestor_la_SOURCES = idirectfbimageprovider_requestor.c libidirectfbimageprovider_requestor_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_requestor_la_LIBADD = $(LIBS) libidirectfbinputdevice_requestor_la_SOURCES = idirectfbinputdevice_requestor.c idirectfbinputdevice_requestor.h libidirectfbinputdevice_requestor_la_LDFLAGS = -avoid-version -module libidirectfbinputdevice_requestor_la_LIBADD = $(LIBS) libidirectfbpalette_requestor_la_SOURCES = idirectfbpalette_requestor.c idirectfbpalette_requestor.h libidirectfbpalette_requestor_la_LDFLAGS = -avoid-version -module libidirectfbpalette_requestor_la_LIBADD = $(LIBS) libidirectfbscreen_requestor_la_SOURCES = idirectfbscreen_requestor.c libidirectfbscreen_requestor_la_LDFLAGS = -avoid-version -module libidirectfbscreen_requestor_la_LIBADD = $(LIBS) libidirectfbsurface_requestor_la_SOURCES = idirectfbsurface_requestor.c idirectfbsurface_requestor.h libidirectfbsurface_requestor_la_LDFLAGS = -avoid-version -module libidirectfbsurface_requestor_la_LIBADD = $(LIBS) libidirectfbwindow_requestor_la_SOURCES = idirectfbwindow_requestor.c idirectfbwindow_requestor.h libidirectfbwindow_requestor_la_LDFLAGS = -avoid-version -module libidirectfbwindow_requestor_la_LIBADD = $(LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu proxy/requestor/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu proxy/requestor/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-idirectfbLTLIBRARIES: $(idirectfb_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdir)" @list='$(idirectfb_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfb_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbdir)/$$p"; \ done clean-idirectfbLTLIBRARIES: -test -z "$(idirectfb_LTLIBRARIES)" || rm -f $(idirectfb_LTLIBRARIES) @list='$(idirectfb_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbdatabufferLTLIBRARIES: $(idirectfbdatabuffer_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbdatabufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdatabufferdir)" @list='$(idirectfbdatabuffer_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdatabufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbdatabufferdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdatabufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbdatabufferdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbdatabufferLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbdatabuffer_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbdatabufferdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbdatabufferdir)/$$p"; \ done clean-idirectfbdatabufferLTLIBRARIES: -test -z "$(idirectfbdatabuffer_LTLIBRARIES)" || rm -f $(idirectfbdatabuffer_LTLIBRARIES) @list='$(idirectfbdatabuffer_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbdisplaylayerLTLIBRARIES: $(idirectfbdisplaylayer_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbdisplaylayerdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdisplaylayerdir)" @list='$(idirectfbdisplaylayer_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdisplaylayerLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdisplaylayerLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbdisplaylayerLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbdisplaylayer_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$p"; \ done clean-idirectfbdisplaylayerLTLIBRARIES: -test -z "$(idirectfbdisplaylayer_LTLIBRARIES)" || rm -f $(idirectfbdisplaylayer_LTLIBRARIES) @list='$(idirectfbdisplaylayer_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbeventbufferLTLIBRARIES: $(idirectfbeventbuffer_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbeventbufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbeventbufferdir)" @list='$(idirectfbeventbuffer_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbeventbufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbeventbufferdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbeventbufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbeventbufferdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbeventbufferLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbeventbuffer_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbeventbufferdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbeventbufferdir)/$$p"; \ done clean-idirectfbeventbufferLTLIBRARIES: -test -z "$(idirectfbeventbuffer_LTLIBRARIES)" || rm -f $(idirectfbeventbuffer_LTLIBRARIES) @list='$(idirectfbeventbuffer_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbfontLTLIBRARIES: $(idirectfbfont_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbfontLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbfontdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbfontdir)/$$p"; \ done clean-idirectfbfontLTLIBRARIES: -test -z "$(idirectfbfont_LTLIBRARIES)" || rm -f $(idirectfbfont_LTLIBRARIES) @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbimageproviderLTLIBRARIES: $(idirectfbimageprovider_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbimageproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbimageproviderdir)" @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbimageproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbimageproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbimageproviderLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbimageproviderdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbimageproviderdir)/$$p"; \ done clean-idirectfbimageproviderLTLIBRARIES: -test -z "$(idirectfbimageprovider_LTLIBRARIES)" || rm -f $(idirectfbimageprovider_LTLIBRARIES) @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbinputdeviceLTLIBRARIES: $(idirectfbinputdevice_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbinputdevicedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbinputdevicedir)" @list='$(idirectfbinputdevice_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbinputdeviceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbinputdevicedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbinputdeviceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbinputdevicedir)/$$f"; \ else :; fi; \ done uninstall-idirectfbinputdeviceLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbinputdevice_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbinputdevicedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbinputdevicedir)/$$p"; \ done clean-idirectfbinputdeviceLTLIBRARIES: -test -z "$(idirectfbinputdevice_LTLIBRARIES)" || rm -f $(idirectfbinputdevice_LTLIBRARIES) @list='$(idirectfbinputdevice_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbpaletteLTLIBRARIES: $(idirectfbpalette_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbpalettedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbpalettedir)" @list='$(idirectfbpalette_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbpaletteLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbpalettedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbpaletteLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbpalettedir)/$$f"; \ else :; fi; \ done uninstall-idirectfbpaletteLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbpalette_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbpalettedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbpalettedir)/$$p"; \ done clean-idirectfbpaletteLTLIBRARIES: -test -z "$(idirectfbpalette_LTLIBRARIES)" || rm -f $(idirectfbpalette_LTLIBRARIES) @list='$(idirectfbpalette_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbscreenLTLIBRARIES: $(idirectfbscreen_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbscreendir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbscreendir)" @list='$(idirectfbscreen_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbscreenLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbscreendir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbscreenLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbscreendir)/$$f"; \ else :; fi; \ done uninstall-idirectfbscreenLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbscreen_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbscreendir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbscreendir)/$$p"; \ done clean-idirectfbscreenLTLIBRARIES: -test -z "$(idirectfbscreen_LTLIBRARIES)" || rm -f $(idirectfbscreen_LTLIBRARIES) @list='$(idirectfbscreen_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbsurfaceLTLIBRARIES: $(idirectfbsurface_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbsurfacedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbsurfacedir)" @list='$(idirectfbsurface_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbsurfaceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbsurfacedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbsurfaceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbsurfacedir)/$$f"; \ else :; fi; \ done uninstall-idirectfbsurfaceLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbsurface_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbsurfacedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbsurfacedir)/$$p"; \ done clean-idirectfbsurfaceLTLIBRARIES: -test -z "$(idirectfbsurface_LTLIBRARIES)" || rm -f $(idirectfbsurface_LTLIBRARIES) @list='$(idirectfbsurface_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbwindowLTLIBRARIES: $(idirectfbwindow_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbwindowdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbwindowdir)" @list='$(idirectfbwindow_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbwindowLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbwindowdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbwindowLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbwindowdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbwindowLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbwindow_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbwindowdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbwindowdir)/$$p"; \ done clean-idirectfbwindowLTLIBRARIES: -test -z "$(idirectfbwindow_LTLIBRARIES)" || rm -f $(idirectfbwindow_LTLIBRARIES) @list='$(idirectfbwindow_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libidirectfb_requestor.la: $(libidirectfb_requestor_la_OBJECTS) $(libidirectfb_requestor_la_DEPENDENCIES) $(libidirectfb_requestor_la_LINK) -rpath $(idirectfbdir) $(libidirectfb_requestor_la_OBJECTS) $(libidirectfb_requestor_la_LIBADD) $(LIBS) libidirectfbdatabuffer_requestor.la: $(libidirectfbdatabuffer_requestor_la_OBJECTS) $(libidirectfbdatabuffer_requestor_la_DEPENDENCIES) $(libidirectfbdatabuffer_requestor_la_LINK) -rpath $(idirectfbdatabufferdir) $(libidirectfbdatabuffer_requestor_la_OBJECTS) $(libidirectfbdatabuffer_requestor_la_LIBADD) $(LIBS) libidirectfbdisplaylayer_requestor.la: $(libidirectfbdisplaylayer_requestor_la_OBJECTS) $(libidirectfbdisplaylayer_requestor_la_DEPENDENCIES) $(libidirectfbdisplaylayer_requestor_la_LINK) -rpath $(idirectfbdisplaylayerdir) $(libidirectfbdisplaylayer_requestor_la_OBJECTS) $(libidirectfbdisplaylayer_requestor_la_LIBADD) $(LIBS) libidirectfbeventbuffer_requestor.la: $(libidirectfbeventbuffer_requestor_la_OBJECTS) $(libidirectfbeventbuffer_requestor_la_DEPENDENCIES) $(libidirectfbeventbuffer_requestor_la_LINK) -rpath $(idirectfbeventbufferdir) $(libidirectfbeventbuffer_requestor_la_OBJECTS) $(libidirectfbeventbuffer_requestor_la_LIBADD) $(LIBS) libidirectfbfont_requestor.la: $(libidirectfbfont_requestor_la_OBJECTS) $(libidirectfbfont_requestor_la_DEPENDENCIES) $(libidirectfbfont_requestor_la_LINK) -rpath $(idirectfbfontdir) $(libidirectfbfont_requestor_la_OBJECTS) $(libidirectfbfont_requestor_la_LIBADD) $(LIBS) libidirectfbimageprovider_requestor.la: $(libidirectfbimageprovider_requestor_la_OBJECTS) $(libidirectfbimageprovider_requestor_la_DEPENDENCIES) $(libidirectfbimageprovider_requestor_la_LINK) -rpath $(idirectfbimageproviderdir) $(libidirectfbimageprovider_requestor_la_OBJECTS) $(libidirectfbimageprovider_requestor_la_LIBADD) $(LIBS) libidirectfbinputdevice_requestor.la: $(libidirectfbinputdevice_requestor_la_OBJECTS) $(libidirectfbinputdevice_requestor_la_DEPENDENCIES) $(libidirectfbinputdevice_requestor_la_LINK) -rpath $(idirectfbinputdevicedir) $(libidirectfbinputdevice_requestor_la_OBJECTS) $(libidirectfbinputdevice_requestor_la_LIBADD) $(LIBS) libidirectfbpalette_requestor.la: $(libidirectfbpalette_requestor_la_OBJECTS) $(libidirectfbpalette_requestor_la_DEPENDENCIES) $(libidirectfbpalette_requestor_la_LINK) -rpath $(idirectfbpalettedir) $(libidirectfbpalette_requestor_la_OBJECTS) $(libidirectfbpalette_requestor_la_LIBADD) $(LIBS) libidirectfbscreen_requestor.la: $(libidirectfbscreen_requestor_la_OBJECTS) $(libidirectfbscreen_requestor_la_DEPENDENCIES) $(libidirectfbscreen_requestor_la_LINK) -rpath $(idirectfbscreendir) $(libidirectfbscreen_requestor_la_OBJECTS) $(libidirectfbscreen_requestor_la_LIBADD) $(LIBS) libidirectfbsurface_requestor.la: $(libidirectfbsurface_requestor_la_OBJECTS) $(libidirectfbsurface_requestor_la_DEPENDENCIES) $(libidirectfbsurface_requestor_la_LINK) -rpath $(idirectfbsurfacedir) $(libidirectfbsurface_requestor_la_OBJECTS) $(libidirectfbsurface_requestor_la_LIBADD) $(LIBS) libidirectfbwindow_requestor.la: $(libidirectfbwindow_requestor_la_OBJECTS) $(libidirectfbwindow_requestor_la_DEPENDENCIES) $(libidirectfbwindow_requestor_la_LINK) -rpath $(idirectfbwindowdir) $(libidirectfbwindow_requestor_la_OBJECTS) $(libidirectfbwindow_requestor_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfb_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbdatabuffer_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbdisplaylayer_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbeventbuffer_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbinputdevice_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbpalette_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbscreen_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbsurface_requestor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbwindow_requestor.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idirectfbDATA: $(idirectfb_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdir)" @list='$(idirectfb_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbdir)/$$f'"; \ $(idirectfbDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbdir)/$$f"; \ done uninstall-idirectfbDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfb_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbdir)/$$f"; \ done install-idirectfbdatabufferDATA: $(idirectfbdatabuffer_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbdatabufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdatabufferdir)" @list='$(idirectfbdatabuffer_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbdatabufferDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbdatabufferdir)/$$f'"; \ $(idirectfbdatabufferDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbdatabufferdir)/$$f"; \ done uninstall-idirectfbdatabufferDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbdatabuffer_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbdatabufferdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbdatabufferdir)/$$f"; \ done install-idirectfbdisplaylayerDATA: $(idirectfbdisplaylayer_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbdisplaylayerdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdisplaylayerdir)" @list='$(idirectfbdisplaylayer_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbdisplaylayerDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f'"; \ $(idirectfbdisplaylayerDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f"; \ done uninstall-idirectfbdisplaylayerDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbdisplaylayer_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f"; \ done install-idirectfbeventbufferDATA: $(idirectfbeventbuffer_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbeventbufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbeventbufferdir)" @list='$(idirectfbeventbuffer_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbeventbufferDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbeventbufferdir)/$$f'"; \ $(idirectfbeventbufferDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbeventbufferdir)/$$f"; \ done uninstall-idirectfbeventbufferDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbeventbuffer_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbeventbufferdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbeventbufferdir)/$$f"; \ done install-idirectfbfontDATA: $(idirectfbfont_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" @list='$(idirectfbfont_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbfontDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ $(idirectfbfontDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ done uninstall-idirectfbfontDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbfont_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ done install-idirectfbimageproviderDATA: $(idirectfbimageprovider_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbimageproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbimageproviderdir)" @list='$(idirectfbimageprovider_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbimageproviderDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ $(idirectfbimageproviderDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ done uninstall-idirectfbimageproviderDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbimageprovider_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ done install-idirectfbinputdeviceDATA: $(idirectfbinputdevice_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbinputdevicedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbinputdevicedir)" @list='$(idirectfbinputdevice_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbinputdeviceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbinputdevicedir)/$$f'"; \ $(idirectfbinputdeviceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbinputdevicedir)/$$f"; \ done uninstall-idirectfbinputdeviceDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbinputdevice_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbinputdevicedir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbinputdevicedir)/$$f"; \ done install-idirectfbpaletteDATA: $(idirectfbpalette_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbpalettedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbpalettedir)" @list='$(idirectfbpalette_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbpaletteDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbpalettedir)/$$f'"; \ $(idirectfbpaletteDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbpalettedir)/$$f"; \ done uninstall-idirectfbpaletteDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbpalette_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbpalettedir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbpalettedir)/$$f"; \ done install-idirectfbscreenDATA: $(idirectfbscreen_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbscreendir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbscreendir)" @list='$(idirectfbscreen_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbscreenDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbscreendir)/$$f'"; \ $(idirectfbscreenDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbscreendir)/$$f"; \ done uninstall-idirectfbscreenDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbscreen_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbscreendir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbscreendir)/$$f"; \ done install-idirectfbsurfaceDATA: $(idirectfbsurface_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbsurfacedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbsurfacedir)" @list='$(idirectfbsurface_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbsurfaceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbsurfacedir)/$$f'"; \ $(idirectfbsurfaceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbsurfacedir)/$$f"; \ done uninstall-idirectfbsurfaceDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbsurface_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbsurfacedir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbsurfacedir)/$$f"; \ done install-idirectfbwindowDATA: $(idirectfbwindow_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbwindowdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbwindowdir)" @list='$(idirectfbwindow_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbwindowDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbwindowdir)/$$f'"; \ $(idirectfbwindowDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbwindowdir)/$$f"; \ done uninstall-idirectfbwindowDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbwindow_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbwindowdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbwindowdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(idirectfbdir)" "$(DESTDIR)$(idirectfbdatabufferdir)" "$(DESTDIR)$(idirectfbdisplaylayerdir)" "$(DESTDIR)$(idirectfbeventbufferdir)" "$(DESTDIR)$(idirectfbfontdir)" "$(DESTDIR)$(idirectfbimageproviderdir)" "$(DESTDIR)$(idirectfbinputdevicedir)" "$(DESTDIR)$(idirectfbpalettedir)" "$(DESTDIR)$(idirectfbscreendir)" "$(DESTDIR)$(idirectfbsurfacedir)" "$(DESTDIR)$(idirectfbwindowdir)" "$(DESTDIR)$(idirectfbdir)" "$(DESTDIR)$(idirectfbdatabufferdir)" "$(DESTDIR)$(idirectfbdisplaylayerdir)" "$(DESTDIR)$(idirectfbeventbufferdir)" "$(DESTDIR)$(idirectfbfontdir)" "$(DESTDIR)$(idirectfbimageproviderdir)" "$(DESTDIR)$(idirectfbinputdevicedir)" "$(DESTDIR)$(idirectfbpalettedir)" "$(DESTDIR)$(idirectfbscreendir)" "$(DESTDIR)$(idirectfbsurfacedir)" "$(DESTDIR)$(idirectfbwindowdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-idirectfbLTLIBRARIES \ clean-idirectfbdatabufferLTLIBRARIES \ clean-idirectfbdisplaylayerLTLIBRARIES \ clean-idirectfbeventbufferLTLIBRARIES \ clean-idirectfbfontLTLIBRARIES \ clean-idirectfbimageproviderLTLIBRARIES \ clean-idirectfbinputdeviceLTLIBRARIES \ clean-idirectfbpaletteLTLIBRARIES \ clean-idirectfbscreenLTLIBRARIES \ clean-idirectfbsurfaceLTLIBRARIES \ clean-idirectfbwindowLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-idirectfbDATA install-idirectfbLTLIBRARIES \ install-idirectfbdatabufferDATA \ install-idirectfbdatabufferLTLIBRARIES \ install-idirectfbdisplaylayerDATA \ install-idirectfbdisplaylayerLTLIBRARIES \ install-idirectfbeventbufferDATA \ install-idirectfbeventbufferLTLIBRARIES \ install-idirectfbfontDATA install-idirectfbfontLTLIBRARIES \ install-idirectfbimageproviderDATA \ install-idirectfbimageproviderLTLIBRARIES \ install-idirectfbinputdeviceDATA \ install-idirectfbinputdeviceLTLIBRARIES \ install-idirectfbpaletteDATA \ install-idirectfbpaletteLTLIBRARIES \ install-idirectfbscreenDATA install-idirectfbscreenLTLIBRARIES \ install-idirectfbsurfaceDATA \ install-idirectfbsurfaceLTLIBRARIES \ install-idirectfbwindowDATA install-idirectfbwindowLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idirectfbDATA uninstall-idirectfbLTLIBRARIES \ uninstall-idirectfbdatabufferDATA \ uninstall-idirectfbdatabufferLTLIBRARIES \ uninstall-idirectfbdisplaylayerDATA \ uninstall-idirectfbdisplaylayerLTLIBRARIES \ uninstall-idirectfbeventbufferDATA \ uninstall-idirectfbeventbufferLTLIBRARIES \ uninstall-idirectfbfontDATA uninstall-idirectfbfontLTLIBRARIES \ uninstall-idirectfbimageproviderDATA \ uninstall-idirectfbimageproviderLTLIBRARIES \ uninstall-idirectfbinputdeviceDATA \ uninstall-idirectfbinputdeviceLTLIBRARIES \ uninstall-idirectfbpaletteDATA \ uninstall-idirectfbpaletteLTLIBRARIES \ uninstall-idirectfbscreenDATA \ uninstall-idirectfbscreenLTLIBRARIES \ uninstall-idirectfbsurfaceDATA \ uninstall-idirectfbsurfaceLTLIBRARIES \ uninstall-idirectfbwindowDATA \ uninstall-idirectfbwindowLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-idirectfbLTLIBRARIES \ clean-idirectfbdatabufferLTLIBRARIES \ clean-idirectfbdisplaylayerLTLIBRARIES \ clean-idirectfbeventbufferLTLIBRARIES \ clean-idirectfbfontLTLIBRARIES \ clean-idirectfbimageproviderLTLIBRARIES \ clean-idirectfbinputdeviceLTLIBRARIES \ clean-idirectfbpaletteLTLIBRARIES \ clean-idirectfbscreenLTLIBRARIES \ clean-idirectfbsurfaceLTLIBRARIES \ clean-idirectfbwindowLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-idirectfbDATA \ install-idirectfbLTLIBRARIES install-idirectfbdatabufferDATA \ install-idirectfbdatabufferLTLIBRARIES \ install-idirectfbdisplaylayerDATA \ install-idirectfbdisplaylayerLTLIBRARIES \ install-idirectfbeventbufferDATA \ install-idirectfbeventbufferLTLIBRARIES \ install-idirectfbfontDATA install-idirectfbfontLTLIBRARIES \ install-idirectfbimageproviderDATA \ install-idirectfbimageproviderLTLIBRARIES \ install-idirectfbinputdeviceDATA \ install-idirectfbinputdeviceLTLIBRARIES \ install-idirectfbpaletteDATA \ install-idirectfbpaletteLTLIBRARIES \ install-idirectfbscreenDATA install-idirectfbscreenLTLIBRARIES \ install-idirectfbsurfaceDATA \ install-idirectfbsurfaceLTLIBRARIES \ install-idirectfbwindowDATA install-idirectfbwindowLTLIBRARIES \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-idirectfbDATA \ uninstall-idirectfbLTLIBRARIES \ uninstall-idirectfbdatabufferDATA \ uninstall-idirectfbdatabufferLTLIBRARIES \ uninstall-idirectfbdisplaylayerDATA \ uninstall-idirectfbdisplaylayerLTLIBRARIES \ uninstall-idirectfbeventbufferDATA \ uninstall-idirectfbeventbufferLTLIBRARIES \ uninstall-idirectfbfontDATA uninstall-idirectfbfontLTLIBRARIES \ uninstall-idirectfbimageproviderDATA \ uninstall-idirectfbimageproviderLTLIBRARIES \ uninstall-idirectfbinputdeviceDATA \ uninstall-idirectfbinputdeviceLTLIBRARIES \ uninstall-idirectfbpaletteDATA \ uninstall-idirectfbpaletteLTLIBRARIES \ uninstall-idirectfbscreenDATA \ uninstall-idirectfbscreenLTLIBRARIES \ uninstall-idirectfbsurfaceDATA \ uninstall-idirectfbsurfaceLTLIBRARIES \ uninstall-idirectfbwindowDATA \ uninstall-idirectfbwindowLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/proxy/requestor/idirectfbsurface_requestor.h0000644000175000017500000000310311245562152021136 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBSURFACE_REQUESTOR_H__ #define __IDIRECTFBSURFACE_REQUESTOR_H__ #include #include /* * private data struct of IDirectFBSurface_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; IDirectFBFont *font; } IDirectFBSurface_Requestor_data; #endif DirectFB-1.2.10/proxy/requestor/idirectfbinputdevice_requestor.c0000644000175000017500000003465311245562152022036 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbinputdevice_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBInputDevice *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBInputDevice, Requestor ) /**************************************************************************************************/ static void IDirectFBInputDevice_Requestor_Destruct( IDirectFBInputDevice *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBInputDevice_Requestor_AddRef( IDirectFBInputDevice *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBInputDevice_Requestor_Release( IDirectFBInputDevice *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (--data->ref == 0) IDirectFBInputDevice_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBInputDevice_Requestor_GetID( IDirectFBInputDevice *thiz, DFBInputDeviceID *ret_id ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBInputDeviceID id; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_id) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBINPUTDEVICE_METHOD_ID_GetID, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_ID( parser, id ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_id = id; return DFB_OK; } static DFBResult IDirectFBInputDevice_Requestor_CreateEventBuffer( IDirectFBInputDevice *thiz, IDirectFBEventBuffer **ret_interface ) { DFBResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer *dispatcher; VoodooInstanceID instance; VoodooResponseMessage *response; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_interface) return DFB_INVARG; /* Create the real interface. */ DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBEventBuffer ); IDirectFBEventBuffer_Construct( buffer, NULL, NULL ); /* Create the dispatcher. */ ret = voodoo_construct_dispatcher( data->manager, "IDirectFBEventBuffer", buffer, data->instance, NULL, &instance, &ptr ); if (ret) { buffer->Release( buffer ); return ret; } dispatcher = ptr; /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBINPUTDEVICE_METHOD_ID_CreateEventBuffer, VREQ_RESPOND, &response, VMBT_ID, instance, VMBT_NONE ); if (ret) { dispatcher->Release( dispatcher ); return ret; } ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } voodoo_manager_finish_request( data->manager, response ); /* Return the dispatcher interface. */ *ret_interface = dispatcher; return DFB_OK; } static DFBResult IDirectFBInputDevice_Requestor_AttachEventBuffer( IDirectFBInputDevice *thiz, IDirectFBEventBuffer *buffer ) { DFBResult ret; IDirectFBEventBuffer_Dispatcher_data *buffer_data; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!buffer) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Dispatcher ); /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBINPUTDEVICE_METHOD_ID_AttachEventBuffer, VREQ_RESPOND, &response, VMBT_ID, buffer_data->self, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBInputDevice_Requestor_DetachEventBuffer( IDirectFBInputDevice *thiz, IDirectFBEventBuffer *buffer ) { DFBResult ret; IDirectFBEventBuffer_Dispatcher_data *buffer_data; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!buffer) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Dispatcher ); /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBINPUTDEVICE_METHOD_ID_DetachEventBuffer, VREQ_RESPOND, &response, VMBT_ID, buffer_data->self, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBInputDevice_Requestor_GetDescription( IDirectFBInputDevice *thiz, DFBInputDeviceDescription *ret_desc ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_desc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBINPUTDEVICE_METHOD_ID_GetDescription, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, ret_desc, sizeof(DFBInputDeviceDescription) ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBInputDevice_Requestor_GetKeymapEntry( IDirectFBInputDevice *thiz, int keycode, DFBInputDeviceKeymapEntry *ret_entry ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_entry) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBINPUTDEVICE_METHOD_ID_GetKeymapEntry, VREQ_RESPOND, &response, VMBT_INT, keycode, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, ret_entry, sizeof(DFBInputDeviceKeymapEntry) ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBInputDevice_Requestor_GetKeyState( IDirectFBInputDevice *thiz, DFBInputDeviceKeyIdentifier key_id, DFBInputDeviceKeyState *ret_state ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_state) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Requestor_GetModifiers( IDirectFBInputDevice *thiz, DFBInputDeviceModifierMask *ret_modifiers ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_modifiers) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Requestor_GetLockState( IDirectFBInputDevice *thiz, DFBInputDeviceLockState *ret_locks ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_locks) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Requestor_GetButtons( IDirectFBInputDevice *thiz, DFBInputDeviceButtonMask *ret_buttons ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_buttons) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Requestor_GetButtonState( IDirectFBInputDevice *thiz, DFBInputDeviceButtonIdentifier button, DFBInputDeviceButtonState *ret_state ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_state || (int)button < DIBI_FIRST || button > DIBI_LAST) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Requestor_GetAxis( IDirectFBInputDevice *thiz, DFBInputDeviceAxisIdentifier axis, int *ret_pos ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_pos || (int)axis < DIAI_FIRST || axis > DIAI_LAST) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Requestor_GetXY( IDirectFBInputDevice *thiz, int *ret_x, int *ret_y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Requestor) if (!ret_x && !ret_y) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBInputDevice *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBInputDevice_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBInputDevice_Requestor_AddRef; thiz->Release = IDirectFBInputDevice_Requestor_Release; thiz->GetID = IDirectFBInputDevice_Requestor_GetID; thiz->GetDescription = IDirectFBInputDevice_Requestor_GetDescription; thiz->GetKeymapEntry = IDirectFBInputDevice_Requestor_GetKeymapEntry; thiz->CreateEventBuffer = IDirectFBInputDevice_Requestor_CreateEventBuffer; thiz->AttachEventBuffer = IDirectFBInputDevice_Requestor_AttachEventBuffer; thiz->DetachEventBuffer = IDirectFBInputDevice_Requestor_DetachEventBuffer; thiz->GetKeyState = IDirectFBInputDevice_Requestor_GetKeyState; thiz->GetModifiers = IDirectFBInputDevice_Requestor_GetModifiers; thiz->GetLockState = IDirectFBInputDevice_Requestor_GetLockState; thiz->GetButtons = IDirectFBInputDevice_Requestor_GetButtons; thiz->GetButtonState = IDirectFBInputDevice_Requestor_GetButtonState; thiz->GetAxis = IDirectFBInputDevice_Requestor_GetAxis; thiz->GetXY = IDirectFBInputDevice_Requestor_GetXY; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbdatabuffer_requestor.c0000644000175000017500000003545311245562152021621 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include static DFBResult Probe(); static DFBResult Construct( IDirectFBDataBuffer *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBDataBuffer, Requestor ) /**************************************************************************************************/ /* * private data struct of IDirectFBDataBuffer_Requestor */ typedef struct { IDirectFBDataBuffer_data base; VoodooManager *manager; VoodooInstanceID instance; } IDirectFBDataBuffer_Requestor_data; /**************************************************************************************************/ static void IDirectFBDataBuffer_Requestor_Destruct( IDirectFBDataBuffer *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); IDirectFBDataBuffer_Destruct( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBDataBuffer_Requestor_AddRef( IDirectFBDataBuffer *thiz ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_AddRef, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); if (ret == DFB_OK) data->base.ref++; return ret; } static DFBResult IDirectFBDataBuffer_Requestor_Release( IDirectFBDataBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) if (--data->base.ref == 0) IDirectFBDataBuffer_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBDataBuffer_Requestor_Flush( IDirectFBDataBuffer *thiz ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_Flush, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDataBuffer_Requestor_Finish( IDirectFBDataBuffer *thiz ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_Finish, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDataBuffer_Requestor_SeekTo( IDirectFBDataBuffer *thiz, unsigned int offset ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_SeekTo, VREQ_RESPOND, &response, VMBT_UINT, offset, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDataBuffer_Requestor_GetPosition( IDirectFBDataBuffer *thiz, unsigned int *ret_offset ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; unsigned int offset; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) if (!ret_offset) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_GetPosition, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, offset ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_offset = offset; return ret; } static DFBResult IDirectFBDataBuffer_Requestor_GetLength( IDirectFBDataBuffer *thiz, unsigned int *ret_length ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; unsigned int length; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) if (!ret_length) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_GetLength, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, length ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_length = length; return ret; } static DFBResult IDirectFBDataBuffer_Requestor_WaitForData( IDirectFBDataBuffer *thiz, unsigned int length ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_WaitForData, VREQ_RESPOND, &response, VMBT_UINT, length, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDataBuffer_Requestor_WaitForDataWithTimeout( IDirectFBDataBuffer *thiz, unsigned int length, unsigned int seconds, unsigned int milli_seconds ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_WaitForDataWithTimeout, VREQ_RESPOND, &response, VMBT_UINT, length, VMBT_UINT, seconds, VMBT_UINT, milli_seconds, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDataBuffer_Requestor_GetData( IDirectFBDataBuffer *thiz, unsigned int length, void *dest, unsigned int *ret_read ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; unsigned int read; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) if (!length || !dest) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_GetData, VREQ_RESPOND, &response, VMBT_UINT, length, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, read ); VOODOO_PARSER_READ_DATA( parser, dest, length ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); if (ret_read) *ret_read = read; return ret; } static DFBResult IDirectFBDataBuffer_Requestor_PeekData( IDirectFBDataBuffer *thiz, unsigned int length, int offset, void *dest, unsigned int *ret_read ) { DFBResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; unsigned int read; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) if (!length || !dest) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_PeekData, VREQ_RESPOND, &response, VMBT_UINT, length, VMBT_INT, offset, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, read ); VOODOO_PARSER_READ_DATA( parser, dest, length ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); if (ret_read) *ret_read = read; return ret; } static DFBResult IDirectFBDataBuffer_Requestor_HasData( IDirectFBDataBuffer *thiz ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_HasData, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDataBuffer_Requestor_PutData( IDirectFBDataBuffer *thiz, const void *source, unsigned int length ) { DFBResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Requestor) if (!source || !length) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDATABUFFER_METHOD_ID_PutData, VREQ_RESPOND, &response, VMBT_UINT, length, VMBT_DATA, length, source, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBDataBuffer *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBDataBuffer_Requestor) ret = IDirectFBDataBuffer_Construct( thiz, NULL, NULL ); if (ret) return ret; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBDataBuffer_Requestor_AddRef; thiz->Release = IDirectFBDataBuffer_Requestor_Release; thiz->Flush = IDirectFBDataBuffer_Requestor_Flush; thiz->Finish = IDirectFBDataBuffer_Requestor_Finish; thiz->SeekTo = IDirectFBDataBuffer_Requestor_SeekTo; thiz->GetPosition = IDirectFBDataBuffer_Requestor_GetPosition; thiz->GetLength = IDirectFBDataBuffer_Requestor_GetLength; thiz->WaitForData = IDirectFBDataBuffer_Requestor_WaitForData; thiz->WaitForDataWithTimeout = IDirectFBDataBuffer_Requestor_WaitForDataWithTimeout; thiz->GetData = IDirectFBDataBuffer_Requestor_GetData; thiz->PeekData = IDirectFBDataBuffer_Requestor_PeekData; thiz->HasData = IDirectFBDataBuffer_Requestor_HasData; thiz->PutData = IDirectFBDataBuffer_Requestor_PutData; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbpalette_requestor.h0000644000175000017500000000300311245562152021143 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBPALETTE_REQUESTOR_H__ #define __IDIRECTFBPALETTE_REQUESTOR_H__ #include /* * private data struct of IDirectFBPalette_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBPalette_Requestor_data; #endif DirectFB-1.2.10/proxy/requestor/idirectfbfont_requestor.h0000644000175000017500000000276711245562152020473 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBFONT_REQUESTOR_H__ #define __IDIRECTFBFONT_REQUESTOR_H__ #include /* * private data struct of IDirectFBFont_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBFont_Requestor_data; #endif DirectFB-1.2.10/proxy/requestor/idirectfbfont_requestor.c0000644000175000017500000003624011245562152020457 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbfont_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBFont *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, Requestor ) /**************************************************************************************************/ static void IDirectFBFont_Requestor_Destruct( IDirectFBFont *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBFont_Requestor_AddRef( IDirectFBFont *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_Release( IDirectFBFont *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (--data->ref == 0) IDirectFBFont_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetAscender( IDirectFBFont *thiz, int *ret_ascender ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int ascender; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!ret_ascender) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetAscender, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, ascender ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_ascender = ascender; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetDescender( IDirectFBFont *thiz, int *ret_descender ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int descender; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!ret_descender) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetDescender, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, descender ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_descender = descender; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetHeight( IDirectFBFont *thiz, int *ret_height ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int height; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!ret_height) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetHeight, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, height ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_height = height; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetMaxAdvance( IDirectFBFont *thiz, int *ret_maxadvance ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int maxadvance; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!ret_maxadvance) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetMaxAdvance, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, maxadvance ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_maxadvance = maxadvance; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetKerning( IDirectFBFont *thiz, unsigned int prev_index, unsigned int current_index, int *ret_kern_x, int *ret_kern_y) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int kern_x; int kern_y; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!ret_kern_x && !ret_kern_y) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetMaxAdvance, VREQ_RESPOND, &response, VMBT_UINT, prev_index, VMBT_UINT, current_index, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, kern_x ); VOODOO_PARSER_GET_INT( parser, kern_y ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_kern_x = kern_x; *ret_kern_y = kern_y; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetStringExtents( IDirectFBFont *thiz, const char *text, int bytes, DFBRectangle *logical_rect, DFBRectangle *ink_rect ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBRectangle *logical; const DFBRectangle *ink; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!text || (!logical_rect && !ink_rect)) return DFB_INVARG; if (bytes < 0) bytes = strlen (text); if (bytes == 0) { if (logical_rect) memset( logical_rect, 0, sizeof(DFBRectangle) ); if (ink_rect) memset( ink_rect, 0, sizeof(DFBRectangle) ); return DFB_OK; } ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetStringExtents, VREQ_RESPOND, &response, VMBT_DATA, bytes, text, VMBT_INT, bytes, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, logical ); VOODOO_PARSER_GET_DATA( parser, ink ); VOODOO_PARSER_END( parser ); if (logical_rect) *logical_rect = *logical; if (ink_rect) *ink_rect = *ink; voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetStringWidth( IDirectFBFont *thiz, const char *text, int bytes, int *ret_width ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int width; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!text || !ret_width) return DFB_INVARG; if (bytes < 0) bytes = strlen (text); if (bytes == 0) return DFB_OK; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetStringWidth, VREQ_RESPOND, &response, VMBT_DATA, bytes, text, VMBT_INT, bytes, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, width ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_width = width; return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetGlyphExtents( IDirectFBFont *thiz, unsigned int index, DFBRectangle *rect, int *ret_advance ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBRectangle *extents; int advance; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) if (!rect && !ret_advance) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBFONT_METHOD_ID_GetGlyphExtents, VREQ_RESPOND, &response, VMBT_UINT, index, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, extents ); VOODOO_PARSER_GET_INT( parser, advance ); VOODOO_PARSER_END( parser ); if (rect) *rect = *extents; if (advance) *ret_advance = advance; voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBFont_Requestor_GetStringBreak( IDirectFBFont *thiz, const char *text, int bytes, int max_width, int *ret_width, int *ret_str_length, const char **ret_next_line ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Requestor_SetEncoding( IDirectFBFont *thiz, DFBTextEncodingID encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Requestor_EnumEncodings( IDirectFBFont *thiz, DFBTextEncodingCallback callback, void *ctx ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Requestor_FindEncoding( IDirectFBFont *thiz, const char *name, DFBTextEncodingID *encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Requestor) return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBFont *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBFont_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBFont_Requestor_AddRef; thiz->Release = IDirectFBFont_Requestor_Release; thiz->GetAscender = IDirectFBFont_Requestor_GetAscender; thiz->GetDescender = IDirectFBFont_Requestor_GetDescender; thiz->GetHeight = IDirectFBFont_Requestor_GetHeight; thiz->GetMaxAdvance = IDirectFBFont_Requestor_GetMaxAdvance; thiz->GetKerning = IDirectFBFont_Requestor_GetKerning; thiz->GetStringWidth = IDirectFBFont_Requestor_GetStringWidth; thiz->GetStringExtents = IDirectFBFont_Requestor_GetStringExtents; thiz->GetGlyphExtents = IDirectFBFont_Requestor_GetGlyphExtents; thiz->GetStringBreak = IDirectFBFont_Requestor_GetStringBreak; thiz->SetEncoding = IDirectFBFont_Requestor_SetEncoding; thiz->EnumEncodings = IDirectFBFont_Requestor_EnumEncodings; thiz->FindEncoding = IDirectFBFont_Requestor_FindEncoding; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbinputdevice_requestor.h0000644000175000017500000000302311245562152022026 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBINPUTDEVICE_REQUESTOR_H__ #define __IDIRECTFBINPUTDEVICE_REQUESTOR_H__ #include /* * private data struct of IDirectFBInputDevice_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBInputDevice_Requestor_data; #endif DirectFB-1.2.10/proxy/requestor/idirectfb_requestor.c0000644000175000017500000007141711245562152017575 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include static DFBResult Probe(); static DFBResult Construct( IDirectFB *thiz, const char *host, int session ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFB, Requestor ) /**************************************************************************************************/ /* * private data struct of IDirectFB_Requestor */ typedef struct { int ref; /* reference counter */ VoodooClient *client; VoodooManager *manager; VoodooInstanceID instance; DFBCooperativeLevel level; /* current cooperative level */ } IDirectFB_Requestor_data; /**************************************************************************************************/ static void IDirectFB_Requestor_Destruct( IDirectFB *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFB_Requestor_AddRef( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFB_Requestor_Release( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (--data->ref == 0) IDirectFB_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFB_Requestor_SetCooperativeLevel( IDirectFB *thiz, DFBCooperativeLevel level ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (level == data->level) return DFB_OK; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_SetCooperativeLevel, VREQ_RESPOND, &response, VMBT_INT, level, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) data->level = level; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFB_Requestor_GetDeviceDescription( IDirectFB *thiz, DFBGraphicsDeviceDescription *ret_desc ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_GetDeviceDescription, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) { VoodooMessageParser parser; VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, ret_desc, sizeof(DFBGraphicsDeviceDescription) ); VOODOO_PARSER_END( parser ); } voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFB_Requestor_EnumVideoModes( IDirectFB *thiz, DFBVideoModeCallback callbackfunc, void *callbackdata ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int i, num; IDirectFB_Dispatcher_EnumVideoModes_Item *items; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!callbackfunc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_EnumVideoModes, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, num ); VOODOO_PARSER_COPY_DATA( parser, items ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); for (i=0; imanager, data->instance, IDIRECTFB_METHOD_ID_SetVideoMode, VREQ_RESPOND, &response, VMBT_INT, width, VMBT_INT, height, VMBT_INT, bpp, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFB_Requestor_CreateSurface( IDirectFB *thiz, const DFBSurfaceDescription *desc, IDirectFBSurface **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!desc || !ret_interface) return DFB_INVARG; if (desc->flags & (DSDESC_PALETTE | DSDESC_PREALLOCATED)) D_ONCE( "DSDESC_PALETTE and DSDESC_PREALLOCATED not supported yet" ); ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_CreateSurface, VREQ_RESPOND, &response, VMBT_DATA, sizeof(DFBSurfaceDescription), desc, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBSurface", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFB_Requestor_CreatePalette( IDirectFB *thiz, const DFBPaletteDescription *desc, IDirectFBPalette **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!interface) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_EnumScreens( IDirectFB *thiz, DFBScreenCallback callbackfunc, void *callbackdata ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int i, num; IDirectFB_Dispatcher_EnumScreens_Item *items; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!callbackfunc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_EnumScreens, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, num ); VOODOO_PARSER_COPY_DATA( parser, items ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); for (i=0; imanager, data->instance, IDIRECTFB_METHOD_ID_GetScreen, VREQ_RESPOND, &response, VMBT_ID, id, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBScreen", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFB_Requestor_EnumDisplayLayers( IDirectFB *thiz, DFBDisplayLayerCallback callbackfunc, void *callbackdata ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!callbackfunc) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_GetDisplayLayer( IDirectFB *thiz, DFBDisplayLayerID id, IDirectFBDisplayLayer **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_GetDisplayLayer, VREQ_RESPOND, &response, VMBT_ID, id, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBDisplayLayer", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFB_Requestor_EnumInputDevices( IDirectFB *thiz, DFBInputDeviceCallback callbackfunc, void *callbackdata ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int i, num; IDirectFB_Dispatcher_EnumInputDevices_Item *items; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!callbackfunc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_EnumInputDevices, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; if (response->result) { voodoo_manager_finish_request( data->manager, response ); return response->result; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, num ); VOODOO_PARSER_COPY_DATA( parser, items ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); for (i=0; imanager, data->instance, IDIRECTFB_METHOD_ID_GetInputDevice, VREQ_RESPOND, &response, VMBT_ID, id, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBInputDevice", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFB_Requestor_CreateEventBuffer( IDirectFB *thiz, IDirectFBEventBuffer **ret_interface) { DFBResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer *dispatcher; VoodooInstanceID instance; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!ret_interface) return DFB_INVARG; /* Create the real interface. */ DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBEventBuffer ); IDirectFBEventBuffer_Construct( buffer, NULL, NULL ); /* Create the dispatcher. */ ret = voodoo_construct_dispatcher( data->manager, "IDirectFBEventBuffer", buffer, data->instance, NULL, &instance, &ptr ); if (ret) { buffer->Release( buffer ); return ret; } dispatcher = ptr; /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_CreateEventBuffer, VREQ_NONE, NULL, VMBT_ID, instance, VMBT_NONE ); if (ret) { dispatcher->Release( dispatcher ); return ret; } /* Return the dispatcher interface. */ *ret_interface = dispatcher; return DFB_OK; } static DFBResult IDirectFB_Requestor_CreateInputEventBuffer( IDirectFB *thiz, DFBInputDeviceCapabilities caps, DFBBoolean global, IDirectFBEventBuffer **ret_interface) { DFBResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer *dispatcher; VoodooInstanceID instance; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!ret_interface) return DFB_INVARG; /* Create the real interface. */ DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBEventBuffer ); IDirectFBEventBuffer_Construct( buffer, NULL, NULL ); /* Create the dispatcher. */ ret = voodoo_construct_dispatcher( data->manager, "IDirectFBEventBuffer", buffer, data->instance, NULL, &instance, &ptr ); if (ret) { buffer->Release( buffer ); return ret; } dispatcher = ptr; /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_CreateInputEventBuffer, VREQ_NONE, NULL, VMBT_ID, instance, VMBT_INT, caps, VMBT_INT, global, VMBT_NONE ); if (ret) { dispatcher->Release( dispatcher ); return ret; } /* Return the dispatcher interface. */ *ret_interface = dispatcher; return DFB_OK; } static DFBResult IDirectFB_Requestor_CreateImageProvider( IDirectFB *thiz, const char *filename, IDirectFBImageProvider **ret_interface ) { DFBResult ret; DFBDataBufferDescription desc; IDirectFBDataBuffer *buffer; IDirectFBImageProvider *provider; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) /* Check arguments */ if (!filename || !ret_interface) return DFB_INVARG; /* Create a data buffer. */ desc.flags = DBDESC_FILE; desc.file = filename; ret = thiz->CreateDataBuffer( thiz, &desc, &buffer ); if (ret) return ret; /* Create (probing) the image provider. */ ret = buffer->CreateImageProvider( buffer, &provider ); if (ret) { buffer->Release( buffer ); return ret; } /* We don't need it anymore, image provider has its own reference. */ buffer->Release( buffer ); /* Return the new provider. */ *ret_interface = provider; return ret; } static DFBResult IDirectFB_Requestor_CreateVideoProvider( IDirectFB *thiz, const char *filename, IDirectFBVideoProvider **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) /* Check arguments */ if (!interface || !filename) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_CreateFont( IDirectFB *thiz, const char *filename, const DFBFontDescription *desc, IDirectFBFont **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!ret_interface) return DFB_INVARG; if (!filename || !desc) { D_ONCE( "unimplemented" ); return DFB_UNSUPPORTED; } ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_CreateFont, VREQ_RESPOND, &response, VMBT_STRING, filename, VMBT_DATA, sizeof(DFBFontDescription), desc, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBFont", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFB_Requestor_CreateDataBuffer( IDirectFB *thiz, const DFBDataBufferDescription *desc, IDirectFBDataBuffer **ret_interface ) { DFBResult ret; IDirectFBDataBuffer *buffer; IDirectFBDataBuffer *dispatcher; VoodooInstanceID instance; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!ret_interface) return DFB_INVARG; /* Create the real interface. */ if (!desc) { DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBDataBuffer ); ret = IDirectFBDataBuffer_Streamed_Construct( buffer, NULL ); } else if (desc->flags & DBDESC_FILE) { if (!desc->file) return DFB_INVARG; DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBDataBuffer ); ret = IDirectFBDataBuffer_File_Construct( buffer, desc->file, NULL ); } else if (desc->flags & DBDESC_MEMORY) { if (!desc->memory.data || !desc->memory.length) return DFB_INVARG; DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBDataBuffer ); ret = IDirectFBDataBuffer_Memory_Construct( buffer, desc->memory.data, desc->memory.length, NULL ); } else return DFB_INVARG; if (ret) return ret; /* Create the dispatcher. */ ret = voodoo_construct_dispatcher( data->manager, "IDirectFBDataBuffer", buffer, data->instance, NULL, &instance, &ptr ); if (ret) { buffer->Release( buffer ); return ret; } dispatcher = ptr; /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_CreateDataBuffer, VREQ_NONE, NULL, VMBT_ID, instance, VMBT_NONE ); if (ret) { dispatcher->Release( dispatcher ); return ret; } /* Return the dispatcher(!) interface. */ *ret_interface = dispatcher; return DFB_OK; } static DFBResult IDirectFB_Requestor_SetClipboardData( IDirectFB *thiz, const char *mime_type, const void *data, unsigned int size, struct timeval *timestamp ) { if (!mime_type || !data || !size) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_GetClipboardData( IDirectFB *thiz, char **mime_type, void **clip_data, unsigned int *size ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!mime_type && !clip_data && !size) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_GetClipboardTimeStamp( IDirectFB *thiz, struct timeval *timestamp ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) if (!timestamp) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_Suspend( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_Resume( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_WaitIdle( IDirectFB *thiz ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFB_METHOD_ID_WaitIdle, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFB_Requestor_WaitForSync( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Requestor_GetInterface( IDirectFB *thiz, const char *type, const char *implementation, void *arg, void **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } /* * Constructor * * Fills in function pointers and intializes data structure. */ static DFBResult Construct( IDirectFB *thiz, const char *host, int session ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFB_Requestor) data->ref = 1; data->level = DFSCL_NORMAL; ret = voodoo_client_create( host, session, &data->client ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } data->manager = voodoo_client_manager( data->client ); ret = voodoo_manager_super( data->manager, "IDirectFB", &data->instance ); if (ret) { voodoo_client_destroy( data->client ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } thiz->AddRef = IDirectFB_Requestor_AddRef; thiz->Release = IDirectFB_Requestor_Release; thiz->SetCooperativeLevel = IDirectFB_Requestor_SetCooperativeLevel; thiz->GetDeviceDescription = IDirectFB_Requestor_GetDeviceDescription; thiz->EnumVideoModes = IDirectFB_Requestor_EnumVideoModes; thiz->SetVideoMode = IDirectFB_Requestor_SetVideoMode; thiz->CreateSurface = IDirectFB_Requestor_CreateSurface; thiz->CreatePalette = IDirectFB_Requestor_CreatePalette; thiz->EnumScreens = IDirectFB_Requestor_EnumScreens; thiz->GetScreen = IDirectFB_Requestor_GetScreen; thiz->EnumDisplayLayers = IDirectFB_Requestor_EnumDisplayLayers; thiz->GetDisplayLayer = IDirectFB_Requestor_GetDisplayLayer; thiz->EnumInputDevices = IDirectFB_Requestor_EnumInputDevices; thiz->GetInputDevice = IDirectFB_Requestor_GetInputDevice; thiz->CreateEventBuffer = IDirectFB_Requestor_CreateEventBuffer; thiz->CreateInputEventBuffer = IDirectFB_Requestor_CreateInputEventBuffer; thiz->CreateImageProvider = IDirectFB_Requestor_CreateImageProvider; thiz->CreateVideoProvider = IDirectFB_Requestor_CreateVideoProvider; thiz->CreateFont = IDirectFB_Requestor_CreateFont; thiz->CreateDataBuffer = IDirectFB_Requestor_CreateDataBuffer; thiz->SetClipboardData = IDirectFB_Requestor_SetClipboardData; thiz->GetClipboardData = IDirectFB_Requestor_GetClipboardData; thiz->GetClipboardTimeStamp = IDirectFB_Requestor_GetClipboardTimeStamp; thiz->Suspend = IDirectFB_Requestor_Suspend; thiz->Resume = IDirectFB_Requestor_Resume; thiz->WaitIdle = IDirectFB_Requestor_WaitIdle; thiz->WaitForSync = IDirectFB_Requestor_WaitForSync; thiz->GetInterface = IDirectFB_Requestor_GetInterface; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbwindow_requestor.c0000644000175000017500000007430611245562152021025 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbsurface_requestor.h" #include "idirectfbwindow_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBWindow *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBWindow, Requestor ) /**************************************************************************************************/ static void IDirectFBWindow_Requestor_Destruct( IDirectFBWindow *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBWindow_Requestor_AddRef( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBWindow_Requestor_Release( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (--data->ref == 0) IDirectFBWindow_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBWindow_Requestor_CreateEventBuffer( IDirectFBWindow *thiz, IDirectFBEventBuffer **ret_interface ) { DFBResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer *dispatcher; VoodooInstanceID instance; VoodooResponseMessage *response; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!ret_interface) return DFB_INVARG; /* Create the real interface. */ DIRECT_ALLOCATE_INTERFACE( buffer, IDirectFBEventBuffer ); IDirectFBEventBuffer_Construct( buffer, NULL, NULL ); /* Create the dispatcher. */ ret = voodoo_construct_dispatcher( data->manager, "IDirectFBEventBuffer", buffer, data->instance, NULL, &instance, &ptr ); if (ret) { buffer->Release( buffer ); return ret; } dispatcher = ptr; /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_CreateEventBuffer, VREQ_RESPOND, &response, VMBT_ID, instance, VMBT_NONE ); if (ret) { dispatcher->Release( dispatcher ); return ret; } ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } voodoo_manager_finish_request( data->manager, response ); /* Return the dispatcher interface. */ *ret_interface = dispatcher; return DFB_OK; } static DFBResult IDirectFBWindow_Requestor_AttachEventBuffer( IDirectFBWindow *thiz, IDirectFBEventBuffer *buffer ) { DFBResult ret; IDirectFBEventBuffer_Dispatcher_data *buffer_data; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!buffer) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Dispatcher ); /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_AttachEventBuffer, VREQ_RESPOND, &response, VMBT_ID, buffer_data->self, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_DetachEventBuffer( IDirectFBWindow *thiz, IDirectFBEventBuffer *buffer ) { DFBResult ret; IDirectFBEventBuffer_Dispatcher_data *buffer_data; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!buffer) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Dispatcher ); /* Send the request including the instance ID of the dispatcher. */ ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_DetachEventBuffer, VREQ_RESPOND, &response, VMBT_ID, buffer_data->self, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_EnableEvents( IDirectFBWindow *thiz, DFBWindowEventType mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_DisableEvents( IDirectFBWindow *thiz, DFBWindowEventType mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_GetID( IDirectFBWindow *thiz, DFBWindowID *ret_id ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBWindowID id; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!ret_id) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GetID, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_ID( parser, id ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_id = id; return ret; } static DFBResult IDirectFBWindow_Requestor_GetPosition( IDirectFBWindow *thiz, int *x, int *y ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBPoint *position; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!x && !y) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GetPosition, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, position ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); if (x) *x = position->x; if (y) *y = position->y; return ret; } static DFBResult IDirectFBWindow_Requestor_GetSize( IDirectFBWindow *thiz, int *width, int *height ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBDimension *size; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!width && !height) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GetSize, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, size ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); if (width) *width = size->w; if (height) *height = size->h; return ret; } static DFBResult IDirectFBWindow_Requestor_GetSurface( IDirectFBWindow *thiz, IDirectFBSurface **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GetSurface, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBSurface", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFBWindow_Requestor_SetProperty( IDirectFBWindow *thiz, const char *key, void *value, void **old_value ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_GetProperty( IDirectFBWindow *thiz, const char *key, void **value ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_RemoveProperty( IDirectFBWindow *thiz, const char *key, void **value ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_SetOptions( IDirectFBWindow *thiz, DFBWindowOptions options ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (options & ~DWOP_ALL) return DFB_INVARG; return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_SetOptions, VREQ_NONE, NULL, VMBT_INT, options, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_GetOptions( IDirectFBWindow *thiz, DFBWindowOptions *ret_options ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBWindowOptions options; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!ret_options) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GetOptions, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, options ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_options = options; return ret; } static DFBResult IDirectFBWindow_Requestor_SetColorKey( IDirectFBWindow *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_SetColorKeyIndex( IDirectFBWindow *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_SetOpaqueRegion( IDirectFBWindow *thiz, int x1, int y1, int x2, int y2 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_SetOpacity( IDirectFBWindow *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_SetOpacity, VREQ_NONE, NULL, VMBT_UINT, opacity, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_GetOpacity( IDirectFBWindow *thiz, u8 *ret_opacity ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; u8 opacity; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!ret_opacity) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GetOpacity, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_UINT( parser, opacity ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_opacity = opacity; return ret; } static DFBResult IDirectFBWindow_Requestor_SetCursorShape( IDirectFBWindow *thiz, IDirectFBSurface *shape, int hot_x, int hot_y ) { DFBPoint hot = { hot_x, hot_y }; DirectResult ret; VoodooResponseMessage *response; IDirectFBSurface_Requestor_data *shape_data; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) if (!shape) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( shape, shape_data, IDirectFBSurface_Requestor); ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_SetCursorShape, VREQ_RESPOND, &response, VMBT_ID, shape_data->instance, VMBT_DATA, sizeof(DFBPoint), &hot, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_RequestFocus( IDirectFBWindow *thiz ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_RequestFocus, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_GrabKeyboard( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_UngrabKeyboard( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_GrabPointer( IDirectFBWindow *thiz ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_GrabPointer, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_UngrabPointer( IDirectFBWindow *thiz ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_UngrabPointer, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_GrabKey( IDirectFBWindow *thiz, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_UngrabKey( IDirectFBWindow *thiz, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_Move( IDirectFBWindow *thiz, int dx, int dy ) { DFBPoint point = { dx, dy }; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_Move, VREQ_NONE, NULL, VMBT_DATA, sizeof(point), &point, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_MoveTo( IDirectFBWindow *thiz, int x, int y ) { DFBPoint point = { x, y }; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_MoveTo, VREQ_NONE, NULL, VMBT_DATA, sizeof(point), &point, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_Resize( IDirectFBWindow *thiz, int width, int height ) { DirectResult ret; DFBDimension size = { width, height }; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_Resize, VREQ_RESPOND, &response, VMBT_DATA, sizeof(size), &size, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_Raise( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_Raise, VREQ_NONE, NULL, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_SetStackingClass( IDirectFBWindow *thiz, DFBWindowStackingClass stacking_class ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_SetStackingClass, VREQ_NONE, NULL, VMBT_INT, stacking_class, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_Lower( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_Lower, VREQ_NONE, NULL, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_RaiseToTop( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_RaiseToTop, VREQ_NONE, NULL, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_LowerToBottom( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_LowerToBottom, VREQ_NONE, NULL, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_PutAtop( IDirectFBWindow *thiz, IDirectFBWindow *lower ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_PutBelow( IDirectFBWindow *thiz, IDirectFBWindow *upper ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Requestor_Close( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_Close, VREQ_NONE, NULL, VMBT_NONE ); } static DFBResult IDirectFBWindow_Requestor_Destroy( IDirectFBWindow *thiz ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_Destroy, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_SetBounds( IDirectFBWindow *thiz, int x, int y, int w, int h ) { DirectResult ret; DFBRectangle bounds = { x, y, w, h }; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_SetBounds, VREQ_RESPOND, &response, VMBT_DATA, sizeof(bounds), &bounds, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBWindow_Requestor_ResizeSurface( IDirectFBWindow *thiz, int width, int height ) { DirectResult ret; DFBDimension size = { width, height }; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBWINDOW_METHOD_ID_ResizeSurface, VREQ_RESPOND, &response, VMBT_DATA, sizeof(size), &size, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBWindow *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBWindow_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBWindow_Requestor_AddRef; thiz->Release = IDirectFBWindow_Requestor_Release; thiz->GetID = IDirectFBWindow_Requestor_GetID; thiz->GetPosition = IDirectFBWindow_Requestor_GetPosition; thiz->GetSize = IDirectFBWindow_Requestor_GetSize; thiz->CreateEventBuffer = IDirectFBWindow_Requestor_CreateEventBuffer; thiz->AttachEventBuffer = IDirectFBWindow_Requestor_AttachEventBuffer; thiz->DetachEventBuffer = IDirectFBWindow_Requestor_DetachEventBuffer; thiz->EnableEvents = IDirectFBWindow_Requestor_EnableEvents; thiz->DisableEvents = IDirectFBWindow_Requestor_DisableEvents; thiz->GetSurface = IDirectFBWindow_Requestor_GetSurface; thiz->SetProperty = IDirectFBWindow_Requestor_SetProperty; thiz->GetProperty = IDirectFBWindow_Requestor_GetProperty; thiz->RemoveProperty = IDirectFBWindow_Requestor_RemoveProperty; thiz->SetOptions = IDirectFBWindow_Requestor_SetOptions; thiz->GetOptions = IDirectFBWindow_Requestor_GetOptions; thiz->SetColorKey = IDirectFBWindow_Requestor_SetColorKey; thiz->SetColorKeyIndex = IDirectFBWindow_Requestor_SetColorKeyIndex; thiz->SetOpaqueRegion = IDirectFBWindow_Requestor_SetOpaqueRegion; thiz->SetOpacity = IDirectFBWindow_Requestor_SetOpacity; thiz->GetOpacity = IDirectFBWindow_Requestor_GetOpacity; thiz->SetCursorShape = IDirectFBWindow_Requestor_SetCursorShape; thiz->RequestFocus = IDirectFBWindow_Requestor_RequestFocus; thiz->GrabKeyboard = IDirectFBWindow_Requestor_GrabKeyboard; thiz->UngrabKeyboard = IDirectFBWindow_Requestor_UngrabKeyboard; thiz->GrabPointer = IDirectFBWindow_Requestor_GrabPointer; thiz->UngrabPointer = IDirectFBWindow_Requestor_UngrabPointer; thiz->GrabKey = IDirectFBWindow_Requestor_GrabKey; thiz->UngrabKey = IDirectFBWindow_Requestor_UngrabKey; thiz->Move = IDirectFBWindow_Requestor_Move; thiz->MoveTo = IDirectFBWindow_Requestor_MoveTo; thiz->Resize = IDirectFBWindow_Requestor_Resize; thiz->SetStackingClass = IDirectFBWindow_Requestor_SetStackingClass; thiz->Raise = IDirectFBWindow_Requestor_Raise; thiz->Lower = IDirectFBWindow_Requestor_Lower; thiz->RaiseToTop = IDirectFBWindow_Requestor_RaiseToTop; thiz->LowerToBottom = IDirectFBWindow_Requestor_LowerToBottom; thiz->PutAtop = IDirectFBWindow_Requestor_PutAtop; thiz->PutBelow = IDirectFBWindow_Requestor_PutBelow; thiz->Close = IDirectFBWindow_Requestor_Close; thiz->Destroy = IDirectFBWindow_Requestor_Destroy; thiz->SetBounds = IDirectFBWindow_Requestor_SetBounds; thiz->ResizeSurface = IDirectFBWindow_Requestor_ResizeSurface; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbscreen_requestor.c0000644000175000017500000003727411245562152021000 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include static DFBResult Probe(); static DFBResult Construct( IDirectFBScreen *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBScreen, Requestor ) /**************************************************************************************************/ /* * private data struct of IDirectFBScreen_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBScreen_Requestor_data; /**************************************************************************************************/ static void IDirectFBScreen_Requestor_Destruct( IDirectFBScreen *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBScreen_Requestor_AddRef( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBScreen_Requestor_Release( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (--data->ref == 0) IDirectFBScreen_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBScreen_Requestor_GetID( IDirectFBScreen *thiz, DFBScreenID *ret_id ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBScreenID id; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!ret_id) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSCREEN_METHOD_ID_GetID, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_ID( parser, id ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_id = id; return ret; } static DFBResult IDirectFBScreen_Requestor_GetDescription( IDirectFBScreen *thiz, DFBScreenDescription *ret_desc ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBScreenDescription *desc; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!ret_desc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSCREEN_METHOD_ID_GetDescription, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, desc ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_desc = *desc; return ret; } static DFBResult IDirectFBScreen_Requestor_GetSize( IDirectFBScreen *thiz, int *width, int *height ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; const DFBDimension *size; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!width && !height) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSCREEN_METHOD_ID_GetSize, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_DATA( parser, size ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); if (width) *width = size->w; if (height) *height = size->h; return ret; } static DFBResult IDirectFBScreen_Requestor_EnumDisplayLayers( IDirectFBScreen *thiz, DFBDisplayLayerCallback callbackfunc, void *callbackdata ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; int i, num; IDirectFBScreen_Dispatcher_EnumDisplayLayers_Item *items; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!callbackfunc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBSCREEN_METHOD_ID_EnumDisplayLayers, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_INT( parser, num ); VOODOO_PARSER_COPY_DATA( parser, items ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); for (i=0; imanager, data->instance, IDIRECTFBSCREEN_METHOD_ID_SetPowerMode, VREQ_NONE, NULL, VMBT_INT, mode, VMBT_NONE ); } static DFBResult IDirectFBScreen_Requestor_WaitForSync( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) return voodoo_manager_request( data->manager, data->instance, IDIRECTFBSCREEN_METHOD_ID_WaitForSync, VREQ_NONE, NULL, VMBT_NONE ); } static DFBResult IDirectFBScreen_Requestor_GetMixerDescriptions( IDirectFBScreen *thiz, DFBScreenMixerDescription *descriptions ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!descriptions) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_GetMixerConfiguration( IDirectFBScreen *thiz, int mixer, DFBScreenMixerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_TestMixerConfiguration( IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config, DFBScreenMixerConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config || (config->flags & ~DSMCONF_ALL)) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_SetMixerConfiguration( IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config || (config->flags & ~DSMCONF_ALL)) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_GetEncoderDescriptions( IDirectFBScreen *thiz, DFBScreenEncoderDescription *descriptions ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!descriptions) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_GetEncoderConfiguration( IDirectFBScreen *thiz, int encoder, DFBScreenEncoderConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_TestEncoderConfiguration( IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config, DFBScreenEncoderConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config || (config->flags & ~DSECONF_ALL)) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_SetEncoderConfiguration( IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config || (config->flags & ~DSECONF_ALL)) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_GetOutputDescriptions( IDirectFBScreen *thiz, DFBScreenOutputDescription *descriptions ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!descriptions) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_GetOutputConfiguration( IDirectFBScreen *thiz, int output, DFBScreenOutputConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_TestOutputConfiguration( IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config, DFBScreenOutputConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config || (config->flags & ~DSOCONF_ALL)) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Requestor_SetOutputConfiguration( IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Requestor) if (!config || (config->flags & ~DSOCONF_ALL)) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBScreen *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBScreen_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBScreen_Requestor_AddRef; thiz->Release = IDirectFBScreen_Requestor_Release; thiz->GetID = IDirectFBScreen_Requestor_GetID; thiz->GetDescription = IDirectFBScreen_Requestor_GetDescription; thiz->GetSize = IDirectFBScreen_Requestor_GetSize; thiz->EnumDisplayLayers = IDirectFBScreen_Requestor_EnumDisplayLayers; thiz->SetPowerMode = IDirectFBScreen_Requestor_SetPowerMode; thiz->WaitForSync = IDirectFBScreen_Requestor_WaitForSync; thiz->GetMixerDescriptions = IDirectFBScreen_Requestor_GetMixerDescriptions; thiz->GetMixerConfiguration = IDirectFBScreen_Requestor_GetMixerConfiguration; thiz->TestMixerConfiguration = IDirectFBScreen_Requestor_TestMixerConfiguration; thiz->SetMixerConfiguration = IDirectFBScreen_Requestor_SetMixerConfiguration; thiz->GetEncoderDescriptions = IDirectFBScreen_Requestor_GetEncoderDescriptions; thiz->GetEncoderConfiguration = IDirectFBScreen_Requestor_GetEncoderConfiguration; thiz->TestEncoderConfiguration = IDirectFBScreen_Requestor_TestEncoderConfiguration; thiz->SetEncoderConfiguration = IDirectFBScreen_Requestor_SetEncoderConfiguration; thiz->GetOutputDescriptions = IDirectFBScreen_Requestor_GetOutputDescriptions; thiz->GetOutputConfiguration = IDirectFBScreen_Requestor_GetOutputConfiguration; thiz->TestOutputConfiguration = IDirectFBScreen_Requestor_TestOutputConfiguration; thiz->SetOutputConfiguration = IDirectFBScreen_Requestor_SetOutputConfiguration; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbimageprovider_requestor.c0000644000175000017500000001757211245562152022355 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbsurface_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBImageProvider *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, Requestor ) /**************************************************************************************************/ /* * private data struct of IDirectFBImageProvider_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBImageProvider_Requestor_data; /**************************************************************************************************/ static void IDirectFBImageProvider_Requestor_Destruct( IDirectFBImageProvider *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBImageProvider_Requestor_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBImageProvider_Requestor_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Requestor) if (--data->ref == 0) IDirectFBImageProvider_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBImageProvider_Requestor_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *desc ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Requestor) if (!desc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBIMAGEPROVIDER_METHOD_ID_GetSurfaceDescription, VREQ_RESPOND | VREQ_ASYNC, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, desc, sizeof(DFBSurfaceDescription) ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBImageProvider_Requestor_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *desc ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Requestor) if (!desc) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBIMAGEPROVIDER_METHOD_ID_GetImageDescription, VREQ_RESPOND | VREQ_ASYNC, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, desc, sizeof(DFBImageDescription) ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); return DFB_OK; } static DFBResult IDirectFBImageProvider_Requestor_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect ) { DirectResult ret; VoodooResponseMessage *response; IDirectFBSurface_Requestor_data *destination_data; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Requestor) if (!destination) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM( destination, destination_data, IDirectFBSurface_Requestor); ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBIMAGEPROVIDER_METHOD_ID_RenderTo, VREQ_RESPOND | VREQ_ASYNC, &response, VMBT_ID, destination_data->instance, VMBT_ODATA, sizeof(DFBRectangle), destination_rect, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBImageProvider_Requestor_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *callback_data ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBImageProvider_Requestor_AddRef; thiz->Release = IDirectFBImageProvider_Requestor_Release; thiz->GetSurfaceDescription = IDirectFBImageProvider_Requestor_GetSurfaceDescription; thiz->GetImageDescription = IDirectFBImageProvider_Requestor_GetImageDescription; thiz->RenderTo = IDirectFBImageProvider_Requestor_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_Requestor_SetRenderCallback; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbdisplaylayer_requestor.c0000644000175000017500000004534611245562152022222 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbdisplaylayer_requestor.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBDisplayLayer *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBDisplayLayer, Requestor ) /**************************************************************************************************/ static void IDirectFBDisplayLayer_Requestor_Destruct( IDirectFBDisplayLayer *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBDisplayLayer_Requestor_AddRef( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) data->ref++; return DFB_OK; } static DFBResult IDirectFBDisplayLayer_Requestor_Release( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) if (--data->ref == 0) IDirectFBDisplayLayer_Requestor_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBDisplayLayer_Requestor_GetID( IDirectFBDisplayLayer *thiz, DFBDisplayLayerID *ret_id ) { DirectResult ret; VoodooResponseMessage *response; VoodooMessageParser parser; DFBDisplayLayerID id; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) if (!ret_id) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDISPLAYLAYER_METHOD_ID_GetID, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret) { voodoo_manager_finish_request( data->manager, response ); return ret; } VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_GET_ID( parser, id ); VOODOO_PARSER_END( parser ); voodoo_manager_finish_request( data->manager, response ); *ret_id = id; return ret; } static DFBResult IDirectFBDisplayLayer_Requestor_GetDescription( IDirectFBDisplayLayer *thiz, DFBDisplayLayerDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetSurface( IDirectFBDisplayLayer *thiz, IDirectFBSurface **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetScreen( IDirectFBDisplayLayer *thiz, IDirectFBScreen **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDISPLAYLAYER_METHOD_ID_GetScreen, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBScreen", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFBDisplayLayer_Requestor_SetCooperativeLevel( IDirectFBDisplayLayer *thiz, DFBDisplayLayerCooperativeLevel level ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDISPLAYLAYER_METHOD_ID_SetCooperativeLevel, VREQ_RESPOND, &response, VMBT_UINT, level, VMBT_NONE ); if (ret) return ret; ret = response->result; voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDisplayLayer_Requestor_SetOpacity( IDirectFBDisplayLayer *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetCurrentOutputField( IDirectFBDisplayLayer *thiz, int *field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetFieldParity( IDirectFBDisplayLayer *thiz, int field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetScreenLocation( IDirectFBDisplayLayer *thiz, float x, float y, float width, float height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetSrcColorKey( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetDstColorKey( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetLevel( IDirectFBDisplayLayer *thiz, int *level ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetLevel( IDirectFBDisplayLayer *thiz, int level ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetConfiguration( IDirectFBDisplayLayer *thiz, DFBDisplayLayerConfig *ret_config ) { DirectResult ret; VoodooResponseMessage *response; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDISPLAYLAYER_METHOD_ID_GetConfiguration, VREQ_RESPOND, &response, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) { VoodooMessageParser parser; VOODOO_PARSER_BEGIN( parser, response ); VOODOO_PARSER_READ_DATA( parser, ret_config, sizeof(DFBDisplayLayerConfig) ); VOODOO_PARSER_END( parser ); } voodoo_manager_finish_request( data->manager, response ); return ret; } static DFBResult IDirectFBDisplayLayer_Requestor_TestConfiguration( IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config, DFBDisplayLayerConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetConfiguration( IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetBackgroundMode( IDirectFBDisplayLayer *thiz, DFBDisplayLayerBackgroundMode background_mode ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetBackgroundImage( IDirectFBDisplayLayer *thiz, IDirectFBSurface *surface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetBackgroundColor( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b, u8 a ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_CreateWindow( IDirectFBDisplayLayer *thiz, const DFBWindowDescription *desc, IDirectFBWindow **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->instance, IDIRECTFBDISPLAYLAYER_METHOD_ID_CreateWindow, VREQ_RESPOND, &response, VMBT_DATA, sizeof(DFBWindowDescription), desc, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBWindow", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFBDisplayLayer_Requestor_GetWindow( IDirectFBDisplayLayer *thiz, DFBWindowID id, IDirectFBWindow **window ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_EnableCursor( IDirectFBDisplayLayer *thiz, int enable ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetCursorPosition( IDirectFBDisplayLayer *thiz, int *x, int *y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_WarpCursor( IDirectFBDisplayLayer *thiz, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetCursorAcceleration( IDirectFBDisplayLayer *thiz, int numerator, int denominator, int threshold ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetCursorShape( IDirectFBDisplayLayer *thiz, IDirectFBSurface *shape, int hot_x, int hot_y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetCursorOpacity( IDirectFBDisplayLayer *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_GetColorAdjustment( IDirectFBDisplayLayer *thiz, DFBColorAdjustment *adj ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_SetColorAdjustment( IDirectFBDisplayLayer *thiz, const DFBColorAdjustment *adj ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Requestor_WaitForSync( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Requestor) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBDisplayLayer *thiz, VoodooManager *manager, VoodooInstanceID instance, void *arg ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBDisplayLayer_Requestor) data->ref = 1; data->manager = manager; data->instance = instance; thiz->AddRef = IDirectFBDisplayLayer_Requestor_AddRef; thiz->Release = IDirectFBDisplayLayer_Requestor_Release; thiz->GetID = IDirectFBDisplayLayer_Requestor_GetID; thiz->GetDescription = IDirectFBDisplayLayer_Requestor_GetDescription; thiz->GetSurface = IDirectFBDisplayLayer_Requestor_GetSurface; thiz->GetScreen = IDirectFBDisplayLayer_Requestor_GetScreen; thiz->SetCooperativeLevel = IDirectFBDisplayLayer_Requestor_SetCooperativeLevel; thiz->SetOpacity = IDirectFBDisplayLayer_Requestor_SetOpacity; thiz->GetCurrentOutputField = IDirectFBDisplayLayer_Requestor_GetCurrentOutputField; thiz->SetScreenLocation = IDirectFBDisplayLayer_Requestor_SetScreenLocation; thiz->SetSrcColorKey = IDirectFBDisplayLayer_Requestor_SetSrcColorKey; thiz->SetDstColorKey = IDirectFBDisplayLayer_Requestor_SetDstColorKey; thiz->GetLevel = IDirectFBDisplayLayer_Requestor_GetLevel; thiz->SetLevel = IDirectFBDisplayLayer_Requestor_SetLevel; thiz->GetConfiguration = IDirectFBDisplayLayer_Requestor_GetConfiguration; thiz->TestConfiguration = IDirectFBDisplayLayer_Requestor_TestConfiguration; thiz->SetConfiguration = IDirectFBDisplayLayer_Requestor_SetConfiguration; thiz->SetBackgroundMode = IDirectFBDisplayLayer_Requestor_SetBackgroundMode; thiz->SetBackgroundColor = IDirectFBDisplayLayer_Requestor_SetBackgroundColor; thiz->SetBackgroundImage = IDirectFBDisplayLayer_Requestor_SetBackgroundImage; thiz->GetColorAdjustment = IDirectFBDisplayLayer_Requestor_GetColorAdjustment; thiz->SetColorAdjustment = IDirectFBDisplayLayer_Requestor_SetColorAdjustment; thiz->CreateWindow = IDirectFBDisplayLayer_Requestor_CreateWindow; thiz->GetWindow = IDirectFBDisplayLayer_Requestor_GetWindow; thiz->WarpCursor = IDirectFBDisplayLayer_Requestor_WarpCursor; thiz->SetCursorAcceleration = IDirectFBDisplayLayer_Requestor_SetCursorAcceleration; thiz->EnableCursor = IDirectFBDisplayLayer_Requestor_EnableCursor; thiz->GetCursorPosition = IDirectFBDisplayLayer_Requestor_GetCursorPosition; thiz->SetCursorShape = IDirectFBDisplayLayer_Requestor_SetCursorShape; thiz->SetCursorOpacity = IDirectFBDisplayLayer_Requestor_SetCursorOpacity; thiz->SetFieldParity = IDirectFBDisplayLayer_Requestor_SetFieldParity; thiz->WaitForSync = IDirectFBDisplayLayer_Requestor_WaitForSync; return DFB_OK; } DirectFB-1.2.10/proxy/requestor/idirectfbdisplaylayer_requestor.h0000644000175000017500000000302711245562152022215 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBDISPLAYLAYER_REQUESTOR_H__ #define __IDIRECTFBDISPLAYLAYER_REQUESTOR_H__ #include /* * private data struct of IDirectFBDisplayLayer_Requestor */ typedef struct { int ref; /* reference counter */ VoodooManager *manager; VoodooInstanceID instance; } IDirectFBDisplayLayer_Requestor_data; #endif DirectFB-1.2.10/proxy/Makefile.am0000644000175000017500000000010211164361026013344 00000000000000## Makefile.am for DirectFB/proxy SUBDIRS = dispatcher requestor DirectFB-1.2.10/proxy/Makefile.in0000644000175000017500000004037211307521504013370 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = proxy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = dispatcher requestor all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu proxy/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu proxy/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/proxy/dispatcher/0000777000175000017500000000000011307522567013541 500000000000000DirectFB-1.2.10/proxy/dispatcher/idirectfbpalette_dispatcher.h0000644000175000017500000000336311245562152021346 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBPALETTE_DISPATCHER_H__ #define __IDIRECTFBPALETTE_DISPATCHER_H__ #define IDIRECTFBPALETTE_METHOD_ID_AddRef 1 #define IDIRECTFBPALETTE_METHOD_ID_Release 2 #define IDIRECTFBPALETTE_METHOD_ID_GetCapabilities 3 #define IDIRECTFBPALETTE_METHOD_ID_GetSize 4 #define IDIRECTFBPALETTE_METHOD_ID_SetEntries 5 #define IDIRECTFBPALETTE_METHOD_ID_GetEntries 6 #define IDIRECTFBPALETTE_METHOD_ID_FindBestMatch 7 #define IDIRECTFBPALETTE_METHOD_ID_CreateCopy 8 #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbsurface_dispatcher.h0000644000175000017500000001046311245562152021337 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBSURFACE_DISPATCHER_H__ #define __IDIRECTFBSURFACE_DISPATCHER_H__ #define IDIRECTFBSURFACE_METHOD_ID_AddRef 1 #define IDIRECTFBSURFACE_METHOD_ID_Release 2 #define IDIRECTFBSURFACE_METHOD_ID_GetCapabilities 3 #define IDIRECTFBSURFACE_METHOD_ID_GetSize 4 #define IDIRECTFBSURFACE_METHOD_ID_GetVisibleRectangle 5 #define IDIRECTFBSURFACE_METHOD_ID_GetPixelFormat 6 #define IDIRECTFBSURFACE_METHOD_ID_GetAccelerationMask 7 #define IDIRECTFBSURFACE_METHOD_ID_GetPalette 8 #define IDIRECTFBSURFACE_METHOD_ID_SetPalette 9 #define IDIRECTFBSURFACE_METHOD_ID_Lock 10 #define IDIRECTFBSURFACE_METHOD_ID_Unlock 11 #define IDIRECTFBSURFACE_METHOD_ID_Flip 12 #define IDIRECTFBSURFACE_METHOD_ID_SetField 13 #define IDIRECTFBSURFACE_METHOD_ID_Clear 14 #define IDIRECTFBSURFACE_METHOD_ID_SetClip 15 #define IDIRECTFBSURFACE_METHOD_ID_SetColor 16 #define IDIRECTFBSURFACE_METHOD_ID_SetColorIndex 17 #define IDIRECTFBSURFACE_METHOD_ID_SetSrcBlendFunction 18 #define IDIRECTFBSURFACE_METHOD_ID_SetDstBlendFunction 19 #define IDIRECTFBSURFACE_METHOD_ID_SetPorterDuff 20 #define IDIRECTFBSURFACE_METHOD_ID_SetSrcColorKey 21 #define IDIRECTFBSURFACE_METHOD_ID_SetSrcColorKeyIndex 22 #define IDIRECTFBSURFACE_METHOD_ID_SetDstColorKey 23 #define IDIRECTFBSURFACE_METHOD_ID_SetDstColorKeyIndex 24 #define IDIRECTFBSURFACE_METHOD_ID_SetBlittingFlags 25 #define IDIRECTFBSURFACE_METHOD_ID_Blit 26 #define IDIRECTFBSURFACE_METHOD_ID_TileBlit 27 #define IDIRECTFBSURFACE_METHOD_ID_BatchBlit 28 #define IDIRECTFBSURFACE_METHOD_ID_StretchBlit 29 #define IDIRECTFBSURFACE_METHOD_ID_TextureTriangles 30 #define IDIRECTFBSURFACE_METHOD_ID_SetDrawingFlags 31 #define IDIRECTFBSURFACE_METHOD_ID_FillRectangle 32 #define IDIRECTFBSURFACE_METHOD_ID_DrawLine 33 #define IDIRECTFBSURFACE_METHOD_ID_DrawLines 34 #define IDIRECTFBSURFACE_METHOD_ID_DrawRectangle 35 #define IDIRECTFBSURFACE_METHOD_ID_FillTriangle 36 #define IDIRECTFBSURFACE_METHOD_ID_SetFont 37 #define IDIRECTFBSURFACE_METHOD_ID_GetFont 38 #define IDIRECTFBSURFACE_METHOD_ID_DrawString 39 #define IDIRECTFBSURFACE_METHOD_ID_DrawGlyph 40 #define IDIRECTFBSURFACE_METHOD_ID_GetSubSurface 41 #define IDIRECTFBSURFACE_METHOD_ID_GetGL 42 #define IDIRECTFBSURFACE_METHOD_ID_Dump 43 #define IDIRECTFBSURFACE_METHOD_ID_FillRectangles 44 #define IDIRECTFBSURFACE_METHOD_ID_FillSpans 45 #define IDIRECTFBSURFACE_METHOD_ID_GetPosition 46 #define IDIRECTFBSURFACE_METHOD_ID_SetEncoding 47 #define IDIRECTFBSURFACE_METHOD_ID_DisableAcceleration 48 #define IDIRECTFBSURFACE_METHOD_ID_ReleaseSource 49 #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbscreen_dispatcher.c0000644000175000017500000004352311245562152021164 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbscreen_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBScreen, Dispatcher ) /**************************************************************************************************/ /* * private data struct of IDirectFBScreen_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBScreen *real; } IDirectFBScreen_Dispatcher_data; /**************************************************************************************************/ static void IDirectFBScreen_Dispatcher_Destruct( IDirectFBScreen *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBScreen_Dispatcher_AddRef( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBScreen_Dispatcher_Release( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (--data->ref == 0) IDirectFBScreen_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBScreen_Dispatcher_GetID( IDirectFBScreen *thiz, DFBScreenID *id ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!id) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetDescription( IDirectFBScreen *thiz, DFBScreenDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!desc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetSize( IDirectFBScreen *thiz, int *width, int *height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!width && !height) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_EnumDisplayLayers( IDirectFBScreen *thiz, DFBDisplayLayerCallback callbackfunc, void *callbackdata ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!callbackfunc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_SetPowerMode( IDirectFBScreen *thiz, DFBScreenPowerMode mode ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_WaitForSync( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetMixerDescriptions( IDirectFBScreen *thiz, DFBScreenMixerDescription *descriptions ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!descriptions) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetMixerConfiguration( IDirectFBScreen *thiz, int mixer, DFBScreenMixerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_TestMixerConfiguration( IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config, DFBScreenMixerConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config || (config->flags & ~DSMCONF_ALL)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_SetMixerConfiguration( IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config || (config->flags & ~DSMCONF_ALL)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetEncoderDescriptions( IDirectFBScreen *thiz, DFBScreenEncoderDescription *descriptions ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!descriptions) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetEncoderConfiguration( IDirectFBScreen *thiz, int encoder, DFBScreenEncoderConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_TestEncoderConfiguration( IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config, DFBScreenEncoderConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config || (config->flags & ~DSECONF_ALL)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_SetEncoderConfiguration( IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config || (config->flags & ~DSECONF_ALL)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetOutputDescriptions( IDirectFBScreen *thiz, DFBScreenOutputDescription *descriptions ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!descriptions) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_GetOutputConfiguration( IDirectFBScreen *thiz, int output, DFBScreenOutputConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_TestOutputConfiguration( IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config, DFBScreenOutputConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config || (config->flags & ~DSOCONF_ALL)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBScreen_Dispatcher_SetOutputConfiguration( IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) if (!config || (config->flags & ~DSOCONF_ALL)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetID( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBScreenID id; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) ret = real->GetID( real, &id ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_ID, id, VMBT_NONE ); } static DirectResult Dispatch_GetDescription( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBScreenDescription desc; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) ret = real->GetDescription( real, &desc ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBScreenDescription), &desc, VMBT_NONE ); } static DirectResult Dispatch_GetSize( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBDimension size; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) ret = real->GetSize( real, &size.w, &size.h ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBDimension), &size, VMBT_NONE ); } typedef struct { int num; IDirectFBScreen_Dispatcher_EnumDisplayLayers_Item items[MAX_LAYERS]; } EnumDisplayLayers_Context; static DFBEnumerationResult EnumDisplayLayers_Callback( DFBDisplayLayerID layer_id, DFBDisplayLayerDescription desc, void *callbackdata ) { int index; EnumDisplayLayers_Context *context = callbackdata; if (context->num == MAX_LAYERS) { D_WARN( "maximum number of %d layers reached", MAX_LAYERS ); return DFENUM_CANCEL; } index = context->num++; context->items[index].layer_id = layer_id; context->items[index].desc = desc; return DFENUM_OK; } static DirectResult Dispatch_EnumDisplayLayers( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; EnumDisplayLayers_Context context = { 0 }; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) ret = real->EnumDisplayLayers( real, EnumDisplayLayers_Callback, &context ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, context.num, VMBT_DATA, context.num * sizeof(IDirectFBScreen_Dispatcher_EnumDisplayLayers_Item), context.items, VMBT_NONE ); } static DirectResult Dispatch_SetPowerMode( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; DFBScreenPowerMode mode; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, mode ); VOODOO_PARSER_END( parser ); ret = real->SetPowerMode( real, mode ); return DFB_OK; } static DirectResult Dispatch_WaitForSync( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen_Dispatcher) ret = real->WaitForSync( real ); return DFB_OK; } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBScreen/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBSCREEN_METHOD_ID_GetID: return Dispatch_GetID( dispatcher, real, manager, msg ); case IDIRECTFBSCREEN_METHOD_ID_GetDescription: return Dispatch_GetDescription( dispatcher, real, manager, msg ); case IDIRECTFBSCREEN_METHOD_ID_GetSize: return Dispatch_GetSize( dispatcher, real, manager, msg ); case IDIRECTFBSCREEN_METHOD_ID_EnumDisplayLayers: return Dispatch_EnumDisplayLayers( dispatcher, real, manager, msg ); case IDIRECTFBSCREEN_METHOD_ID_SetPowerMode: return Dispatch_SetPowerMode( dispatcher, real, manager, msg ); case IDIRECTFBSCREEN_METHOD_ID_WaitForSync: return Dispatch_WaitForSync( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBScreen *thiz, IDirectFBScreen *real, VoodooManager *manager, VoodooInstanceID super, void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBScreen_Dispatcher) ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, ret_instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } data->ref = 1; data->real = real; thiz->AddRef = IDirectFBScreen_Dispatcher_AddRef; thiz->Release = IDirectFBScreen_Dispatcher_Release; thiz->GetID = IDirectFBScreen_Dispatcher_GetID; thiz->GetDescription = IDirectFBScreen_Dispatcher_GetDescription; thiz->GetSize = IDirectFBScreen_Dispatcher_GetSize; thiz->EnumDisplayLayers = IDirectFBScreen_Dispatcher_EnumDisplayLayers; thiz->SetPowerMode = IDirectFBScreen_Dispatcher_SetPowerMode; thiz->WaitForSync = IDirectFBScreen_Dispatcher_WaitForSync; thiz->GetMixerDescriptions = IDirectFBScreen_Dispatcher_GetMixerDescriptions; thiz->GetMixerConfiguration = IDirectFBScreen_Dispatcher_GetMixerConfiguration; thiz->TestMixerConfiguration = IDirectFBScreen_Dispatcher_TestMixerConfiguration; thiz->SetMixerConfiguration = IDirectFBScreen_Dispatcher_SetMixerConfiguration; thiz->GetEncoderDescriptions = IDirectFBScreen_Dispatcher_GetEncoderDescriptions; thiz->GetEncoderConfiguration = IDirectFBScreen_Dispatcher_GetEncoderConfiguration; thiz->TestEncoderConfiguration = IDirectFBScreen_Dispatcher_TestEncoderConfiguration; thiz->SetEncoderConfiguration = IDirectFBScreen_Dispatcher_SetEncoderConfiguration; thiz->GetOutputDescriptions = IDirectFBScreen_Dispatcher_GetOutputDescriptions; thiz->GetOutputConfiguration = IDirectFBScreen_Dispatcher_GetOutputConfiguration; thiz->TestOutputConfiguration = IDirectFBScreen_Dispatcher_TestOutputConfiguration; thiz->SetOutputConfiguration = IDirectFBScreen_Dispatcher_SetOutputConfiguration; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbpalette_dispatcher.c0000644000175000017500000002774211245562152021350 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "idirectfbpalette_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBPalette, Dispatcher ) /**************************************************************************************************/ /* * private data struct of IDirectFBPalette_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBPalette *real; VoodooInstanceID super; } IDirectFBPalette_Dispatcher_data; /**************************************************************************************************/ static void IDirectFBPalette_Dispatcher_Destruct( IDirectFBPalette *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBPalette_Dispatcher_AddRef( IDirectFBPalette *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBPalette_Dispatcher_Release( IDirectFBPalette *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) if (--data->ref == 0) IDirectFBPalette_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBPalette_Dispatcher_GetCapabilities( IDirectFBPalette *thiz, DFBPaletteCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBPalette_Dispatcher_GetSize( IDirectFBPalette *thiz, unsigned int *size ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBPalette_Dispatcher_SetEntries( IDirectFBPalette *thiz, const DFBColor *entries, unsigned int num_entries, unsigned int offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBPalette_Dispatcher_GetEntries( IDirectFBPalette *thiz, DFBColor *entries, unsigned int num_entries, unsigned int offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBPalette_Dispatcher_FindBestMatch( IDirectFBPalette *thiz, u8 r, u8 g, u8 b, u8 a, unsigned int *index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBPalette_Dispatcher_CreateCopy( IDirectFBPalette *thiz, IDirectFBPalette **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetCapabilities( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBPaletteCapabilities caps; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) ret = real->GetCapabilities( real, &caps ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, caps, VMBT_NONE ); } static DirectResult Dispatch_GetSize( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; unsigned int size; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) ret = real->GetSize( real, &size ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_UINT, size, VMBT_NONE ); } static DirectResult Dispatch_SetEntries( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; const DFBColor *entries; unsigned int num_entries; unsigned int offset; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, entries ); VOODOO_PARSER_GET_UINT( parser, num_entries ); VOODOO_PARSER_GET_UINT( parser, offset ); VOODOO_PARSER_END( parser ); ret = real->SetEntries( real, entries, num_entries, offset ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GetEntries( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; DFBColor *entries; unsigned int num_entries; unsigned int offset; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, num_entries ); VOODOO_PARSER_GET_UINT( parser, offset ); VOODOO_PARSER_END( parser ); entries = alloca( num_entries * sizeof(DFBColor) ); if (!entries) { D_WARN( "out of memory" ); return DFB_NOSYSTEMMEMORY; } ret = real->GetEntries( real, entries, num_entries, offset ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, num_entries * sizeof(DFBColor), entries, VMBT_NONE ); } static DirectResult Dispatch_FindBestMatch( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; const DFBColor *color; unsigned int index; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, color ); VOODOO_PARSER_END( parser ); ret = real->FindBestMatch( real, color->r, color->g, color->b, color->a, &index ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_UINT, index, VMBT_NONE ); } static DirectResult Dispatch_CreateCopy( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBPalette/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBPALETTE_METHOD_ID_GetCapabilities: return Dispatch_GetCapabilities( dispatcher, real, manager, msg ); case IDIRECTFBPALETTE_METHOD_ID_GetSize: return Dispatch_GetSize( dispatcher, real, manager, msg ); case IDIRECTFBPALETTE_METHOD_ID_SetEntries: return Dispatch_SetEntries( dispatcher, real, manager, msg ); case IDIRECTFBPALETTE_METHOD_ID_GetEntries: return Dispatch_GetEntries( dispatcher, real, manager, msg ); case IDIRECTFBPALETTE_METHOD_ID_FindBestMatch: return Dispatch_FindBestMatch( dispatcher, real, manager, msg ); case IDIRECTFBPALETTE_METHOD_ID_CreateCopy: return Dispatch_CreateCopy( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBPalette *thiz, IDirectFBPalette *real, VoodooManager *manager, VoodooInstanceID super, void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBPalette_Dispatcher) ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, ret_instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } data->ref = 1; data->real = real; data->super = super; thiz->AddRef = IDirectFBPalette_Dispatcher_AddRef; thiz->Release = IDirectFBPalette_Dispatcher_Release; thiz->GetCapabilities = IDirectFBPalette_Dispatcher_GetCapabilities; thiz->GetSize = IDirectFBPalette_Dispatcher_GetSize; thiz->SetEntries = IDirectFBPalette_Dispatcher_SetEntries; thiz->GetEntries = IDirectFBPalette_Dispatcher_GetEntries; thiz->FindBestMatch = IDirectFBPalette_Dispatcher_FindBestMatch; thiz->CreateCopy = IDirectFBPalette_Dispatcher_CreateCopy; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/Makefile.am0000644000175000017500000001217411245562146015514 00000000000000## Makefile.am for DirectFB/proxy/dispatcher INTERFACES_DIR = $(MODULEDIR)/interfaces idirectfbdir = $(INTERFACES_DIR)/IDirectFB idirectfbdatabufferdir = $(INTERFACES_DIR)/IDirectFBDataBuffer idirectfbdisplaylayerdir = $(INTERFACES_DIR)/IDirectFBDisplayLayer idirectfbeventbufferdir = $(INTERFACES_DIR)/IDirectFBEventBuffer idirectfbfontdir = $(INTERFACES_DIR)/IDirectFBFont idirectfbimageproviderdir = $(INTERFACES_DIR)/IDirectFBImageProvider idirectfbinputdevicedir = $(INTERFACES_DIR)/IDirectFBInputDevice idirectfbpalettedir = $(INTERFACES_DIR)/IDirectFBPalette idirectfbscreendir = $(INTERFACES_DIR)/IDirectFBScreen idirectfbsurfacedir = $(INTERFACES_DIR)/IDirectFBSurface idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/proxy/requestor \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" LIBS = \ $(top_builddir)/lib/voodoo/libvoodoo.la \ $(top_builddir)/lib/direct/libdirect.la idirectfb_LTLIBRARIES = \ libidirectfb_dispatcher.la idirectfbdatabuffer_LTLIBRARIES = \ libidirectfbdatabuffer_dispatcher.la idirectfbdisplaylayer_LTLIBRARIES = \ libidirectfbdisplaylayer_dispatcher.la idirectfbeventbuffer_LTLIBRARIES = \ libidirectfbeventbuffer_dispatcher.la idirectfbfont_LTLIBRARIES = \ libidirectfbfont_dispatcher.la idirectfbimageprovider_LTLIBRARIES = \ libidirectfbimageprovider_dispatcher.la idirectfbinputdevice_LTLIBRARIES = \ libidirectfbinputdevice_dispatcher.la idirectfbpalette_LTLIBRARIES = \ libidirectfbpalette_dispatcher.la idirectfbscreen_LTLIBRARIES = \ libidirectfbscreen_dispatcher.la idirectfbsurface_LTLIBRARIES = \ libidirectfbsurface_dispatcher.la idirectfbwindow_LTLIBRARIES = \ libidirectfbwindow_dispatcher.la if BUILD_STATIC idirectfb_DATA = libidirectfb_dispatcher.o idirectfbdatabuffer_DATA = libidirectfbdatabuffer_dispatcher.o idirectfbdisplaylayer_DATA = libidirectfbdisplaylayer_dispatcher.o idirectfbeventbuffer_DATA = libidirectfbeventbuffer_dispatcher.o idirectfbfont_DATA = libidirectfbfont_dispatcher.o idirectfbimageprovider_DATA = libidirectfbimageprovider_dispatcher.o idirectfbinputdevice_DATA = libidirectfbinputdevice_dispatcher.o idirectfbpalette_DATA = libidirectfbpalette_dispatcher.o idirectfbscreen_DATA = libidirectfbscreen_dispatcher.o idirectfbsurface_DATA = libidirectfbsurface_dispatcher.o idirectfbwindow_DATA = libidirectfbwindow_dispatcher.o endif libidirectfb_dispatcher_la_SOURCES = idirectfb_dispatcher.c idirectfb_dispatcher.h libidirectfb_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfb_dispatcher_la_LIBADDD = $(LIBS) libidirectfbdatabuffer_dispatcher_la_SOURCES = idirectfbdatabuffer_dispatcher.c idirectfbdatabuffer_dispatcher.h libidirectfbdatabuffer_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbdatabuffer_dispatcher_la_LIBADDD = $(LIBS) libidirectfbdisplaylayer_dispatcher_la_SOURCES = idirectfbdisplaylayer_dispatcher.c idirectfbdisplaylayer_dispatcher.h libidirectfbdisplaylayer_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbdisplaylayer_dispatcher_la_LIBADDD = $(LIBS) libidirectfbeventbuffer_dispatcher_la_SOURCES = idirectfbeventbuffer_dispatcher.c idirectfbeventbuffer_dispatcher.h libidirectfbeventbuffer_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbeventbuffer_dispatcher_la_LIBADDD = $(LIBS) libidirectfbfont_dispatcher_la_SOURCES = idirectfbfont_dispatcher.c idirectfbfont_dispatcher.h libidirectfbfont_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbfont_dispatcher_la_LIBADDD = $(LIBS) libidirectfbimageprovider_dispatcher_la_SOURCES = idirectfbimageprovider_dispatcher.c idirectfbimageprovider_dispatcher.h libidirectfbimageprovider_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_dispatcher_la_LIBADDD = $(LIBS) libidirectfbinputdevice_dispatcher_la_SOURCES = idirectfbinputdevice_dispatcher.c idirectfbinputdevice_dispatcher.h libidirectfbinputdevice_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbinputdevice_dispatcher_la_LIBADDD = $(LIBS) libidirectfbpalette_dispatcher_la_SOURCES = idirectfbpalette_dispatcher.c idirectfbpalette_dispatcher.h libidirectfbpalette_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbpalette_dispatcher_la_LIBADDD = $(LIBS) libidirectfbscreen_dispatcher_la_SOURCES = idirectfbscreen_dispatcher.c idirectfbscreen_dispatcher.h libidirectfbscreen_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbscreen_dispatcher_la_LIBADDD = $(LIBS) libidirectfbsurface_dispatcher_la_SOURCES = idirectfbsurface_dispatcher.c idirectfbsurface_dispatcher.h libidirectfbsurface_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbsurface_dispatcher_la_LIBADDD = $(LIBS) libidirectfbwindow_dispatcher_la_SOURCES = idirectfbwindow_dispatcher.c idirectfbwindow_dispatcher.h libidirectfbwindow_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbwindow_dispatcher_la_LIBADDD = $(LIBS) include $(top_srcdir)/rules/libobject.make DirectFB-1.2.10/proxy/dispatcher/Makefile.in0000644000175000017500000017134211307521504015520 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/rules/libobject.make subdir = proxy/dispatcher ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(idirectfbdir)" \ "$(DESTDIR)$(idirectfbdatabufferdir)" \ "$(DESTDIR)$(idirectfbdisplaylayerdir)" \ "$(DESTDIR)$(idirectfbeventbufferdir)" \ "$(DESTDIR)$(idirectfbfontdir)" \ "$(DESTDIR)$(idirectfbimageproviderdir)" \ "$(DESTDIR)$(idirectfbinputdevicedir)" \ "$(DESTDIR)$(idirectfbpalettedir)" \ "$(DESTDIR)$(idirectfbscreendir)" \ "$(DESTDIR)$(idirectfbsurfacedir)" \ "$(DESTDIR)$(idirectfbwindowdir)" "$(DESTDIR)$(idirectfbdir)" \ "$(DESTDIR)$(idirectfbdatabufferdir)" \ "$(DESTDIR)$(idirectfbdisplaylayerdir)" \ "$(DESTDIR)$(idirectfbeventbufferdir)" \ "$(DESTDIR)$(idirectfbfontdir)" \ "$(DESTDIR)$(idirectfbimageproviderdir)" \ "$(DESTDIR)$(idirectfbinputdevicedir)" \ "$(DESTDIR)$(idirectfbpalettedir)" \ "$(DESTDIR)$(idirectfbscreendir)" \ "$(DESTDIR)$(idirectfbsurfacedir)" \ "$(DESTDIR)$(idirectfbwindowdir)" idirectfbLTLIBRARIES_INSTALL = $(INSTALL) idirectfbdatabufferLTLIBRARIES_INSTALL = $(INSTALL) idirectfbdisplaylayerLTLIBRARIES_INSTALL = $(INSTALL) idirectfbeventbufferLTLIBRARIES_INSTALL = $(INSTALL) idirectfbfontLTLIBRARIES_INSTALL = $(INSTALL) idirectfbimageproviderLTLIBRARIES_INSTALL = $(INSTALL) idirectfbinputdeviceLTLIBRARIES_INSTALL = $(INSTALL) idirectfbpaletteLTLIBRARIES_INSTALL = $(INSTALL) idirectfbscreenLTLIBRARIES_INSTALL = $(INSTALL) idirectfbsurfaceLTLIBRARIES_INSTALL = $(INSTALL) idirectfbwindowLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(idirectfb_LTLIBRARIES) \ $(idirectfbdatabuffer_LTLIBRARIES) \ $(idirectfbdisplaylayer_LTLIBRARIES) \ $(idirectfbeventbuffer_LTLIBRARIES) \ $(idirectfbfont_LTLIBRARIES) \ $(idirectfbimageprovider_LTLIBRARIES) \ $(idirectfbinputdevice_LTLIBRARIES) \ $(idirectfbpalette_LTLIBRARIES) $(idirectfbscreen_LTLIBRARIES) \ $(idirectfbsurface_LTLIBRARIES) $(idirectfbwindow_LTLIBRARIES) libidirectfb_dispatcher_la_LIBADD = am_libidirectfb_dispatcher_la_OBJECTS = idirectfb_dispatcher.lo libidirectfb_dispatcher_la_OBJECTS = \ $(am_libidirectfb_dispatcher_la_OBJECTS) libidirectfb_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libidirectfb_dispatcher_la_LDFLAGS) \ $(LDFLAGS) -o $@ libidirectfbdatabuffer_dispatcher_la_LIBADD = am_libidirectfbdatabuffer_dispatcher_la_OBJECTS = \ idirectfbdatabuffer_dispatcher.lo libidirectfbdatabuffer_dispatcher_la_OBJECTS = \ $(am_libidirectfbdatabuffer_dispatcher_la_OBJECTS) libidirectfbdatabuffer_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbdatabuffer_dispatcher_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbdisplaylayer_dispatcher_la_LIBADD = am_libidirectfbdisplaylayer_dispatcher_la_OBJECTS = \ idirectfbdisplaylayer_dispatcher.lo libidirectfbdisplaylayer_dispatcher_la_OBJECTS = \ $(am_libidirectfbdisplaylayer_dispatcher_la_OBJECTS) libidirectfbdisplaylayer_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbdisplaylayer_dispatcher_la_LDFLAGS) $(LDFLAGS) \ -o $@ libidirectfbeventbuffer_dispatcher_la_LIBADD = am_libidirectfbeventbuffer_dispatcher_la_OBJECTS = \ idirectfbeventbuffer_dispatcher.lo libidirectfbeventbuffer_dispatcher_la_OBJECTS = \ $(am_libidirectfbeventbuffer_dispatcher_la_OBJECTS) libidirectfbeventbuffer_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbeventbuffer_dispatcher_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbfont_dispatcher_la_LIBADD = am_libidirectfbfont_dispatcher_la_OBJECTS = \ idirectfbfont_dispatcher.lo libidirectfbfont_dispatcher_la_OBJECTS = \ $(am_libidirectfbfont_dispatcher_la_OBJECTS) libidirectfbfont_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbfont_dispatcher_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbimageprovider_dispatcher_la_LIBADD = am_libidirectfbimageprovider_dispatcher_la_OBJECTS = \ idirectfbimageprovider_dispatcher.lo libidirectfbimageprovider_dispatcher_la_OBJECTS = \ $(am_libidirectfbimageprovider_dispatcher_la_OBJECTS) libidirectfbimageprovider_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbimageprovider_dispatcher_la_LDFLAGS) $(LDFLAGS) \ -o $@ libidirectfbinputdevice_dispatcher_la_LIBADD = am_libidirectfbinputdevice_dispatcher_la_OBJECTS = \ idirectfbinputdevice_dispatcher.lo libidirectfbinputdevice_dispatcher_la_OBJECTS = \ $(am_libidirectfbinputdevice_dispatcher_la_OBJECTS) libidirectfbinputdevice_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbinputdevice_dispatcher_la_LDFLAGS) $(LDFLAGS) -o \ $@ libidirectfbpalette_dispatcher_la_LIBADD = am_libidirectfbpalette_dispatcher_la_OBJECTS = \ idirectfbpalette_dispatcher.lo libidirectfbpalette_dispatcher_la_OBJECTS = \ $(am_libidirectfbpalette_dispatcher_la_OBJECTS) libidirectfbpalette_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbpalette_dispatcher_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbscreen_dispatcher_la_LIBADD = am_libidirectfbscreen_dispatcher_la_OBJECTS = \ idirectfbscreen_dispatcher.lo libidirectfbscreen_dispatcher_la_OBJECTS = \ $(am_libidirectfbscreen_dispatcher_la_OBJECTS) libidirectfbscreen_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbscreen_dispatcher_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbsurface_dispatcher_la_LIBADD = am_libidirectfbsurface_dispatcher_la_OBJECTS = \ idirectfbsurface_dispatcher.lo libidirectfbsurface_dispatcher_la_OBJECTS = \ $(am_libidirectfbsurface_dispatcher_la_OBJECTS) libidirectfbsurface_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbsurface_dispatcher_la_LDFLAGS) $(LDFLAGS) -o $@ libidirectfbwindow_dispatcher_la_LIBADD = am_libidirectfbwindow_dispatcher_la_OBJECTS = \ idirectfbwindow_dispatcher.lo libidirectfbwindow_dispatcher_la_OBJECTS = \ $(am_libidirectfbwindow_dispatcher_la_OBJECTS) libidirectfbwindow_dispatcher_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) \ $(libidirectfbwindow_dispatcher_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libidirectfb_dispatcher_la_SOURCES) \ $(libidirectfbdatabuffer_dispatcher_la_SOURCES) \ $(libidirectfbdisplaylayer_dispatcher_la_SOURCES) \ $(libidirectfbeventbuffer_dispatcher_la_SOURCES) \ $(libidirectfbfont_dispatcher_la_SOURCES) \ $(libidirectfbimageprovider_dispatcher_la_SOURCES) \ $(libidirectfbinputdevice_dispatcher_la_SOURCES) \ $(libidirectfbpalette_dispatcher_la_SOURCES) \ $(libidirectfbscreen_dispatcher_la_SOURCES) \ $(libidirectfbsurface_dispatcher_la_SOURCES) \ $(libidirectfbwindow_dispatcher_la_SOURCES) DIST_SOURCES = $(libidirectfb_dispatcher_la_SOURCES) \ $(libidirectfbdatabuffer_dispatcher_la_SOURCES) \ $(libidirectfbdisplaylayer_dispatcher_la_SOURCES) \ $(libidirectfbeventbuffer_dispatcher_la_SOURCES) \ $(libidirectfbfont_dispatcher_la_SOURCES) \ $(libidirectfbimageprovider_dispatcher_la_SOURCES) \ $(libidirectfbinputdevice_dispatcher_la_SOURCES) \ $(libidirectfbpalette_dispatcher_la_SOURCES) \ $(libidirectfbscreen_dispatcher_la_SOURCES) \ $(libidirectfbsurface_dispatcher_la_SOURCES) \ $(libidirectfbwindow_dispatcher_la_SOURCES) idirectfbDATA_INSTALL = $(INSTALL_DATA) idirectfbdatabufferDATA_INSTALL = $(INSTALL_DATA) idirectfbdisplaylayerDATA_INSTALL = $(INSTALL_DATA) idirectfbeventbufferDATA_INSTALL = $(INSTALL_DATA) idirectfbfontDATA_INSTALL = $(INSTALL_DATA) idirectfbimageproviderDATA_INSTALL = $(INSTALL_DATA) idirectfbinputdeviceDATA_INSTALL = $(INSTALL_DATA) idirectfbpaletteDATA_INSTALL = $(INSTALL_DATA) idirectfbscreenDATA_INSTALL = $(INSTALL_DATA) idirectfbsurfaceDATA_INSTALL = $(INSTALL_DATA) idirectfbwindowDATA_INSTALL = $(INSTALL_DATA) DATA = $(idirectfb_DATA) $(idirectfbdatabuffer_DATA) \ $(idirectfbdisplaylayer_DATA) $(idirectfbeventbuffer_DATA) \ $(idirectfbfont_DATA) $(idirectfbimageprovider_DATA) \ $(idirectfbinputdevice_DATA) $(idirectfbpalette_DATA) \ $(idirectfbscreen_DATA) $(idirectfbsurface_DATA) \ $(idirectfbwindow_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = \ $(top_builddir)/lib/voodoo/libvoodoo.la \ $(top_builddir)/lib/direct/libdirect.la LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INTERFACES_DIR = $(MODULEDIR)/interfaces idirectfbdir = $(INTERFACES_DIR)/IDirectFB idirectfbdatabufferdir = $(INTERFACES_DIR)/IDirectFBDataBuffer idirectfbdisplaylayerdir = $(INTERFACES_DIR)/IDirectFBDisplayLayer idirectfbeventbufferdir = $(INTERFACES_DIR)/IDirectFBEventBuffer idirectfbfontdir = $(INTERFACES_DIR)/IDirectFBFont idirectfbimageproviderdir = $(INTERFACES_DIR)/IDirectFBImageProvider idirectfbinputdevicedir = $(INTERFACES_DIR)/IDirectFBInputDevice idirectfbpalettedir = $(INTERFACES_DIR)/IDirectFBPalette idirectfbscreendir = $(INTERFACES_DIR)/IDirectFBScreen idirectfbsurfacedir = $(INTERFACES_DIR)/IDirectFBSurface idirectfbwindowdir = $(INTERFACES_DIR)/IDirectFBWindow idirectfbvideoproviderdir = $(INTERFACES_DIR)/IDirectFBVideoProvider INCLUDES = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_builddir)/lib \ -I$(top_srcdir)/src \ -I$(top_srcdir)/proxy/requestor \ -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" idirectfb_LTLIBRARIES = \ libidirectfb_dispatcher.la idirectfbdatabuffer_LTLIBRARIES = \ libidirectfbdatabuffer_dispatcher.la idirectfbdisplaylayer_LTLIBRARIES = \ libidirectfbdisplaylayer_dispatcher.la idirectfbeventbuffer_LTLIBRARIES = \ libidirectfbeventbuffer_dispatcher.la idirectfbfont_LTLIBRARIES = \ libidirectfbfont_dispatcher.la idirectfbimageprovider_LTLIBRARIES = \ libidirectfbimageprovider_dispatcher.la idirectfbinputdevice_LTLIBRARIES = \ libidirectfbinputdevice_dispatcher.la idirectfbpalette_LTLIBRARIES = \ libidirectfbpalette_dispatcher.la idirectfbscreen_LTLIBRARIES = \ libidirectfbscreen_dispatcher.la idirectfbsurface_LTLIBRARIES = \ libidirectfbsurface_dispatcher.la idirectfbwindow_LTLIBRARIES = \ libidirectfbwindow_dispatcher.la @BUILD_STATIC_TRUE@idirectfb_DATA = libidirectfb_dispatcher.o @BUILD_STATIC_TRUE@idirectfbdatabuffer_DATA = libidirectfbdatabuffer_dispatcher.o @BUILD_STATIC_TRUE@idirectfbdisplaylayer_DATA = libidirectfbdisplaylayer_dispatcher.o @BUILD_STATIC_TRUE@idirectfbeventbuffer_DATA = libidirectfbeventbuffer_dispatcher.o @BUILD_STATIC_TRUE@idirectfbfont_DATA = libidirectfbfont_dispatcher.o @BUILD_STATIC_TRUE@idirectfbimageprovider_DATA = libidirectfbimageprovider_dispatcher.o @BUILD_STATIC_TRUE@idirectfbinputdevice_DATA = libidirectfbinputdevice_dispatcher.o @BUILD_STATIC_TRUE@idirectfbpalette_DATA = libidirectfbpalette_dispatcher.o @BUILD_STATIC_TRUE@idirectfbscreen_DATA = libidirectfbscreen_dispatcher.o @BUILD_STATIC_TRUE@idirectfbsurface_DATA = libidirectfbsurface_dispatcher.o @BUILD_STATIC_TRUE@idirectfbwindow_DATA = libidirectfbwindow_dispatcher.o libidirectfb_dispatcher_la_SOURCES = idirectfb_dispatcher.c idirectfb_dispatcher.h libidirectfb_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfb_dispatcher_la_LIBADDD = $(LIBS) libidirectfbdatabuffer_dispatcher_la_SOURCES = idirectfbdatabuffer_dispatcher.c idirectfbdatabuffer_dispatcher.h libidirectfbdatabuffer_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbdatabuffer_dispatcher_la_LIBADDD = $(LIBS) libidirectfbdisplaylayer_dispatcher_la_SOURCES = idirectfbdisplaylayer_dispatcher.c idirectfbdisplaylayer_dispatcher.h libidirectfbdisplaylayer_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbdisplaylayer_dispatcher_la_LIBADDD = $(LIBS) libidirectfbeventbuffer_dispatcher_la_SOURCES = idirectfbeventbuffer_dispatcher.c idirectfbeventbuffer_dispatcher.h libidirectfbeventbuffer_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbeventbuffer_dispatcher_la_LIBADDD = $(LIBS) libidirectfbfont_dispatcher_la_SOURCES = idirectfbfont_dispatcher.c idirectfbfont_dispatcher.h libidirectfbfont_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbfont_dispatcher_la_LIBADDD = $(LIBS) libidirectfbimageprovider_dispatcher_la_SOURCES = idirectfbimageprovider_dispatcher.c idirectfbimageprovider_dispatcher.h libidirectfbimageprovider_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbimageprovider_dispatcher_la_LIBADDD = $(LIBS) libidirectfbinputdevice_dispatcher_la_SOURCES = idirectfbinputdevice_dispatcher.c idirectfbinputdevice_dispatcher.h libidirectfbinputdevice_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbinputdevice_dispatcher_la_LIBADDD = $(LIBS) libidirectfbpalette_dispatcher_la_SOURCES = idirectfbpalette_dispatcher.c idirectfbpalette_dispatcher.h libidirectfbpalette_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbpalette_dispatcher_la_LIBADDD = $(LIBS) libidirectfbscreen_dispatcher_la_SOURCES = idirectfbscreen_dispatcher.c idirectfbscreen_dispatcher.h libidirectfbscreen_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbscreen_dispatcher_la_LIBADDD = $(LIBS) libidirectfbsurface_dispatcher_la_SOURCES = idirectfbsurface_dispatcher.c idirectfbsurface_dispatcher.h libidirectfbsurface_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbsurface_dispatcher_la_LIBADDD = $(LIBS) libidirectfbwindow_dispatcher_la_SOURCES = idirectfbwindow_dispatcher.c idirectfbwindow_dispatcher.h libidirectfbwindow_dispatcher_la_LDFLAGS = -avoid-version -module libidirectfbwindow_dispatcher_la_LIBADDD = $(LIBS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu proxy/dispatcher/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu proxy/dispatcher/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-idirectfbLTLIBRARIES: $(idirectfb_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdir)" @list='$(idirectfb_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfb_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbdir)/$$p"; \ done clean-idirectfbLTLIBRARIES: -test -z "$(idirectfb_LTLIBRARIES)" || rm -f $(idirectfb_LTLIBRARIES) @list='$(idirectfb_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbdatabufferLTLIBRARIES: $(idirectfbdatabuffer_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbdatabufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdatabufferdir)" @list='$(idirectfbdatabuffer_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdatabufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbdatabufferdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdatabufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbdatabufferdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbdatabufferLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbdatabuffer_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbdatabufferdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbdatabufferdir)/$$p"; \ done clean-idirectfbdatabufferLTLIBRARIES: -test -z "$(idirectfbdatabuffer_LTLIBRARIES)" || rm -f $(idirectfbdatabuffer_LTLIBRARIES) @list='$(idirectfbdatabuffer_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbdisplaylayerLTLIBRARIES: $(idirectfbdisplaylayer_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbdisplaylayerdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdisplaylayerdir)" @list='$(idirectfbdisplaylayer_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdisplaylayerLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbdisplaylayerLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbdisplaylayerLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbdisplaylayer_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$p"; \ done clean-idirectfbdisplaylayerLTLIBRARIES: -test -z "$(idirectfbdisplaylayer_LTLIBRARIES)" || rm -f $(idirectfbdisplaylayer_LTLIBRARIES) @list='$(idirectfbdisplaylayer_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbeventbufferLTLIBRARIES: $(idirectfbeventbuffer_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbeventbufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbeventbufferdir)" @list='$(idirectfbeventbuffer_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbeventbufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbeventbufferdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbeventbufferLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbeventbufferdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbeventbufferLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbeventbuffer_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbeventbufferdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbeventbufferdir)/$$p"; \ done clean-idirectfbeventbufferLTLIBRARIES: -test -z "$(idirectfbeventbuffer_LTLIBRARIES)" || rm -f $(idirectfbeventbuffer_LTLIBRARIES) @list='$(idirectfbeventbuffer_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbfontLTLIBRARIES: $(idirectfbfont_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbfontLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbfontdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbfontdir)/$$p"; \ done clean-idirectfbfontLTLIBRARIES: -test -z "$(idirectfbfont_LTLIBRARIES)" || rm -f $(idirectfbfont_LTLIBRARIES) @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbimageproviderLTLIBRARIES: $(idirectfbimageprovider_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbimageproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbimageproviderdir)" @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbimageproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbimageproviderLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbimageproviderLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbimageproviderdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbimageproviderdir)/$$p"; \ done clean-idirectfbimageproviderLTLIBRARIES: -test -z "$(idirectfbimageprovider_LTLIBRARIES)" || rm -f $(idirectfbimageprovider_LTLIBRARIES) @list='$(idirectfbimageprovider_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbinputdeviceLTLIBRARIES: $(idirectfbinputdevice_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbinputdevicedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbinputdevicedir)" @list='$(idirectfbinputdevice_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbinputdeviceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbinputdevicedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbinputdeviceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbinputdevicedir)/$$f"; \ else :; fi; \ done uninstall-idirectfbinputdeviceLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbinputdevice_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbinputdevicedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbinputdevicedir)/$$p"; \ done clean-idirectfbinputdeviceLTLIBRARIES: -test -z "$(idirectfbinputdevice_LTLIBRARIES)" || rm -f $(idirectfbinputdevice_LTLIBRARIES) @list='$(idirectfbinputdevice_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbpaletteLTLIBRARIES: $(idirectfbpalette_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbpalettedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbpalettedir)" @list='$(idirectfbpalette_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbpaletteLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbpalettedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbpaletteLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbpalettedir)/$$f"; \ else :; fi; \ done uninstall-idirectfbpaletteLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbpalette_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbpalettedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbpalettedir)/$$p"; \ done clean-idirectfbpaletteLTLIBRARIES: -test -z "$(idirectfbpalette_LTLIBRARIES)" || rm -f $(idirectfbpalette_LTLIBRARIES) @list='$(idirectfbpalette_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbscreenLTLIBRARIES: $(idirectfbscreen_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbscreendir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbscreendir)" @list='$(idirectfbscreen_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbscreenLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbscreendir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbscreenLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbscreendir)/$$f"; \ else :; fi; \ done uninstall-idirectfbscreenLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbscreen_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbscreendir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbscreendir)/$$p"; \ done clean-idirectfbscreenLTLIBRARIES: -test -z "$(idirectfbscreen_LTLIBRARIES)" || rm -f $(idirectfbscreen_LTLIBRARIES) @list='$(idirectfbscreen_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbsurfaceLTLIBRARIES: $(idirectfbsurface_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbsurfacedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbsurfacedir)" @list='$(idirectfbsurface_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbsurfaceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbsurfacedir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbsurfaceLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbsurfacedir)/$$f"; \ else :; fi; \ done uninstall-idirectfbsurfaceLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbsurface_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbsurfacedir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbsurfacedir)/$$p"; \ done clean-idirectfbsurfaceLTLIBRARIES: -test -z "$(idirectfbsurface_LTLIBRARIES)" || rm -f $(idirectfbsurface_LTLIBRARIES) @list='$(idirectfbsurface_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-idirectfbwindowLTLIBRARIES: $(idirectfbwindow_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(idirectfbwindowdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbwindowdir)" @list='$(idirectfbwindow_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbwindowLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbwindowdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbwindowLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbwindowdir)/$$f"; \ else :; fi; \ done uninstall-idirectfbwindowLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idirectfbwindow_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbwindowdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbwindowdir)/$$p"; \ done clean-idirectfbwindowLTLIBRARIES: -test -z "$(idirectfbwindow_LTLIBRARIES)" || rm -f $(idirectfbwindow_LTLIBRARIES) @list='$(idirectfbwindow_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libidirectfb_dispatcher.la: $(libidirectfb_dispatcher_la_OBJECTS) $(libidirectfb_dispatcher_la_DEPENDENCIES) $(libidirectfb_dispatcher_la_LINK) -rpath $(idirectfbdir) $(libidirectfb_dispatcher_la_OBJECTS) $(libidirectfb_dispatcher_la_LIBADD) $(LIBS) libidirectfbdatabuffer_dispatcher.la: $(libidirectfbdatabuffer_dispatcher_la_OBJECTS) $(libidirectfbdatabuffer_dispatcher_la_DEPENDENCIES) $(libidirectfbdatabuffer_dispatcher_la_LINK) -rpath $(idirectfbdatabufferdir) $(libidirectfbdatabuffer_dispatcher_la_OBJECTS) $(libidirectfbdatabuffer_dispatcher_la_LIBADD) $(LIBS) libidirectfbdisplaylayer_dispatcher.la: $(libidirectfbdisplaylayer_dispatcher_la_OBJECTS) $(libidirectfbdisplaylayer_dispatcher_la_DEPENDENCIES) $(libidirectfbdisplaylayer_dispatcher_la_LINK) -rpath $(idirectfbdisplaylayerdir) $(libidirectfbdisplaylayer_dispatcher_la_OBJECTS) $(libidirectfbdisplaylayer_dispatcher_la_LIBADD) $(LIBS) libidirectfbeventbuffer_dispatcher.la: $(libidirectfbeventbuffer_dispatcher_la_OBJECTS) $(libidirectfbeventbuffer_dispatcher_la_DEPENDENCIES) $(libidirectfbeventbuffer_dispatcher_la_LINK) -rpath $(idirectfbeventbufferdir) $(libidirectfbeventbuffer_dispatcher_la_OBJECTS) $(libidirectfbeventbuffer_dispatcher_la_LIBADD) $(LIBS) libidirectfbfont_dispatcher.la: $(libidirectfbfont_dispatcher_la_OBJECTS) $(libidirectfbfont_dispatcher_la_DEPENDENCIES) $(libidirectfbfont_dispatcher_la_LINK) -rpath $(idirectfbfontdir) $(libidirectfbfont_dispatcher_la_OBJECTS) $(libidirectfbfont_dispatcher_la_LIBADD) $(LIBS) libidirectfbimageprovider_dispatcher.la: $(libidirectfbimageprovider_dispatcher_la_OBJECTS) $(libidirectfbimageprovider_dispatcher_la_DEPENDENCIES) $(libidirectfbimageprovider_dispatcher_la_LINK) -rpath $(idirectfbimageproviderdir) $(libidirectfbimageprovider_dispatcher_la_OBJECTS) $(libidirectfbimageprovider_dispatcher_la_LIBADD) $(LIBS) libidirectfbinputdevice_dispatcher.la: $(libidirectfbinputdevice_dispatcher_la_OBJECTS) $(libidirectfbinputdevice_dispatcher_la_DEPENDENCIES) $(libidirectfbinputdevice_dispatcher_la_LINK) -rpath $(idirectfbinputdevicedir) $(libidirectfbinputdevice_dispatcher_la_OBJECTS) $(libidirectfbinputdevice_dispatcher_la_LIBADD) $(LIBS) libidirectfbpalette_dispatcher.la: $(libidirectfbpalette_dispatcher_la_OBJECTS) $(libidirectfbpalette_dispatcher_la_DEPENDENCIES) $(libidirectfbpalette_dispatcher_la_LINK) -rpath $(idirectfbpalettedir) $(libidirectfbpalette_dispatcher_la_OBJECTS) $(libidirectfbpalette_dispatcher_la_LIBADD) $(LIBS) libidirectfbscreen_dispatcher.la: $(libidirectfbscreen_dispatcher_la_OBJECTS) $(libidirectfbscreen_dispatcher_la_DEPENDENCIES) $(libidirectfbscreen_dispatcher_la_LINK) -rpath $(idirectfbscreendir) $(libidirectfbscreen_dispatcher_la_OBJECTS) $(libidirectfbscreen_dispatcher_la_LIBADD) $(LIBS) libidirectfbsurface_dispatcher.la: $(libidirectfbsurface_dispatcher_la_OBJECTS) $(libidirectfbsurface_dispatcher_la_DEPENDENCIES) $(libidirectfbsurface_dispatcher_la_LINK) -rpath $(idirectfbsurfacedir) $(libidirectfbsurface_dispatcher_la_OBJECTS) $(libidirectfbsurface_dispatcher_la_LIBADD) $(LIBS) libidirectfbwindow_dispatcher.la: $(libidirectfbwindow_dispatcher_la_OBJECTS) $(libidirectfbwindow_dispatcher_la_DEPENDENCIES) $(libidirectfbwindow_dispatcher_la_LINK) -rpath $(idirectfbwindowdir) $(libidirectfbwindow_dispatcher_la_OBJECTS) $(libidirectfbwindow_dispatcher_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfb_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbdatabuffer_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbdisplaylayer_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbeventbuffer_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbimageprovider_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbinputdevice_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbpalette_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbscreen_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbsurface_dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbwindow_dispatcher.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-idirectfbDATA: $(idirectfb_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdir)" @list='$(idirectfb_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbdir)/$$f'"; \ $(idirectfbDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbdir)/$$f"; \ done uninstall-idirectfbDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfb_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbdir)/$$f"; \ done install-idirectfbdatabufferDATA: $(idirectfbdatabuffer_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbdatabufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdatabufferdir)" @list='$(idirectfbdatabuffer_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbdatabufferDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbdatabufferdir)/$$f'"; \ $(idirectfbdatabufferDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbdatabufferdir)/$$f"; \ done uninstall-idirectfbdatabufferDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbdatabuffer_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbdatabufferdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbdatabufferdir)/$$f"; \ done install-idirectfbdisplaylayerDATA: $(idirectfbdisplaylayer_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbdisplaylayerdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbdisplaylayerdir)" @list='$(idirectfbdisplaylayer_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbdisplaylayerDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f'"; \ $(idirectfbdisplaylayerDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f"; \ done uninstall-idirectfbdisplaylayerDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbdisplaylayer_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbdisplaylayerdir)/$$f"; \ done install-idirectfbeventbufferDATA: $(idirectfbeventbuffer_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbeventbufferdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbeventbufferdir)" @list='$(idirectfbeventbuffer_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbeventbufferDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbeventbufferdir)/$$f'"; \ $(idirectfbeventbufferDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbeventbufferdir)/$$f"; \ done uninstall-idirectfbeventbufferDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbeventbuffer_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbeventbufferdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbeventbufferdir)/$$f"; \ done install-idirectfbfontDATA: $(idirectfbfont_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" @list='$(idirectfbfont_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbfontDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ $(idirectfbfontDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ done uninstall-idirectfbfontDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbfont_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ done install-idirectfbimageproviderDATA: $(idirectfbimageprovider_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbimageproviderdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbimageproviderdir)" @list='$(idirectfbimageprovider_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbimageproviderDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ $(idirectfbimageproviderDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ done uninstall-idirectfbimageproviderDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbimageprovider_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbimageproviderdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbimageproviderdir)/$$f"; \ done install-idirectfbinputdeviceDATA: $(idirectfbinputdevice_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbinputdevicedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbinputdevicedir)" @list='$(idirectfbinputdevice_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbinputdeviceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbinputdevicedir)/$$f'"; \ $(idirectfbinputdeviceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbinputdevicedir)/$$f"; \ done uninstall-idirectfbinputdeviceDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbinputdevice_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbinputdevicedir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbinputdevicedir)/$$f"; \ done install-idirectfbpaletteDATA: $(idirectfbpalette_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbpalettedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbpalettedir)" @list='$(idirectfbpalette_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbpaletteDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbpalettedir)/$$f'"; \ $(idirectfbpaletteDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbpalettedir)/$$f"; \ done uninstall-idirectfbpaletteDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbpalette_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbpalettedir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbpalettedir)/$$f"; \ done install-idirectfbscreenDATA: $(idirectfbscreen_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbscreendir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbscreendir)" @list='$(idirectfbscreen_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbscreenDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbscreendir)/$$f'"; \ $(idirectfbscreenDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbscreendir)/$$f"; \ done uninstall-idirectfbscreenDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbscreen_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbscreendir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbscreendir)/$$f"; \ done install-idirectfbsurfaceDATA: $(idirectfbsurface_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbsurfacedir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbsurfacedir)" @list='$(idirectfbsurface_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbsurfaceDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbsurfacedir)/$$f'"; \ $(idirectfbsurfaceDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbsurfacedir)/$$f"; \ done uninstall-idirectfbsurfaceDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbsurface_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbsurfacedir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbsurfacedir)/$$f"; \ done install-idirectfbwindowDATA: $(idirectfbwindow_DATA) @$(NORMAL_INSTALL) test -z "$(idirectfbwindowdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbwindowdir)" @list='$(idirectfbwindow_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(idirectfbwindowDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbwindowdir)/$$f'"; \ $(idirectfbwindowDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbwindowdir)/$$f"; \ done uninstall-idirectfbwindowDATA: @$(NORMAL_UNINSTALL) @list='$(idirectfbwindow_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(idirectfbwindowdir)/$$f'"; \ rm -f "$(DESTDIR)$(idirectfbwindowdir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(idirectfbdir)" "$(DESTDIR)$(idirectfbdatabufferdir)" "$(DESTDIR)$(idirectfbdisplaylayerdir)" "$(DESTDIR)$(idirectfbeventbufferdir)" "$(DESTDIR)$(idirectfbfontdir)" "$(DESTDIR)$(idirectfbimageproviderdir)" "$(DESTDIR)$(idirectfbinputdevicedir)" "$(DESTDIR)$(idirectfbpalettedir)" "$(DESTDIR)$(idirectfbscreendir)" "$(DESTDIR)$(idirectfbsurfacedir)" "$(DESTDIR)$(idirectfbwindowdir)" "$(DESTDIR)$(idirectfbdir)" "$(DESTDIR)$(idirectfbdatabufferdir)" "$(DESTDIR)$(idirectfbdisplaylayerdir)" "$(DESTDIR)$(idirectfbeventbufferdir)" "$(DESTDIR)$(idirectfbfontdir)" "$(DESTDIR)$(idirectfbimageproviderdir)" "$(DESTDIR)$(idirectfbinputdevicedir)" "$(DESTDIR)$(idirectfbpalettedir)" "$(DESTDIR)$(idirectfbscreendir)" "$(DESTDIR)$(idirectfbsurfacedir)" "$(DESTDIR)$(idirectfbwindowdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-idirectfbLTLIBRARIES \ clean-idirectfbdatabufferLTLIBRARIES \ clean-idirectfbdisplaylayerLTLIBRARIES \ clean-idirectfbeventbufferLTLIBRARIES \ clean-idirectfbfontLTLIBRARIES \ clean-idirectfbimageproviderLTLIBRARIES \ clean-idirectfbinputdeviceLTLIBRARIES \ clean-idirectfbpaletteLTLIBRARIES \ clean-idirectfbscreenLTLIBRARIES \ clean-idirectfbsurfaceLTLIBRARIES \ clean-idirectfbwindowLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-idirectfbDATA install-idirectfbLTLIBRARIES \ install-idirectfbdatabufferDATA \ install-idirectfbdatabufferLTLIBRARIES \ install-idirectfbdisplaylayerDATA \ install-idirectfbdisplaylayerLTLIBRARIES \ install-idirectfbeventbufferDATA \ install-idirectfbeventbufferLTLIBRARIES \ install-idirectfbfontDATA install-idirectfbfontLTLIBRARIES \ install-idirectfbimageproviderDATA \ install-idirectfbimageproviderLTLIBRARIES \ install-idirectfbinputdeviceDATA \ install-idirectfbinputdeviceLTLIBRARIES \ install-idirectfbpaletteDATA \ install-idirectfbpaletteLTLIBRARIES \ install-idirectfbscreenDATA install-idirectfbscreenLTLIBRARIES \ install-idirectfbsurfaceDATA \ install-idirectfbsurfaceLTLIBRARIES \ install-idirectfbwindowDATA install-idirectfbwindowLTLIBRARIES install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-idirectfbDATA uninstall-idirectfbLTLIBRARIES \ uninstall-idirectfbdatabufferDATA \ uninstall-idirectfbdatabufferLTLIBRARIES \ uninstall-idirectfbdisplaylayerDATA \ uninstall-idirectfbdisplaylayerLTLIBRARIES \ uninstall-idirectfbeventbufferDATA \ uninstall-idirectfbeventbufferLTLIBRARIES \ uninstall-idirectfbfontDATA uninstall-idirectfbfontLTLIBRARIES \ uninstall-idirectfbimageproviderDATA \ uninstall-idirectfbimageproviderLTLIBRARIES \ uninstall-idirectfbinputdeviceDATA \ uninstall-idirectfbinputdeviceLTLIBRARIES \ uninstall-idirectfbpaletteDATA \ uninstall-idirectfbpaletteLTLIBRARIES \ uninstall-idirectfbscreenDATA \ uninstall-idirectfbscreenLTLIBRARIES \ uninstall-idirectfbsurfaceDATA \ uninstall-idirectfbsurfaceLTLIBRARIES \ uninstall-idirectfbwindowDATA \ uninstall-idirectfbwindowLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-idirectfbLTLIBRARIES \ clean-idirectfbdatabufferLTLIBRARIES \ clean-idirectfbdisplaylayerLTLIBRARIES \ clean-idirectfbeventbufferLTLIBRARIES \ clean-idirectfbfontLTLIBRARIES \ clean-idirectfbimageproviderLTLIBRARIES \ clean-idirectfbinputdeviceLTLIBRARIES \ clean-idirectfbpaletteLTLIBRARIES \ clean-idirectfbscreenLTLIBRARIES \ clean-idirectfbsurfaceLTLIBRARIES \ clean-idirectfbwindowLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-idirectfbDATA \ install-idirectfbLTLIBRARIES install-idirectfbdatabufferDATA \ install-idirectfbdatabufferLTLIBRARIES \ install-idirectfbdisplaylayerDATA \ install-idirectfbdisplaylayerLTLIBRARIES \ install-idirectfbeventbufferDATA \ install-idirectfbeventbufferLTLIBRARIES \ install-idirectfbfontDATA install-idirectfbfontLTLIBRARIES \ install-idirectfbimageproviderDATA \ install-idirectfbimageproviderLTLIBRARIES \ install-idirectfbinputdeviceDATA \ install-idirectfbinputdeviceLTLIBRARIES \ install-idirectfbpaletteDATA \ install-idirectfbpaletteLTLIBRARIES \ install-idirectfbscreenDATA install-idirectfbscreenLTLIBRARIES \ install-idirectfbsurfaceDATA \ install-idirectfbsurfaceLTLIBRARIES \ install-idirectfbwindowDATA install-idirectfbwindowLTLIBRARIES \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-idirectfbDATA \ uninstall-idirectfbLTLIBRARIES \ uninstall-idirectfbdatabufferDATA \ uninstall-idirectfbdatabufferLTLIBRARIES \ uninstall-idirectfbdisplaylayerDATA \ uninstall-idirectfbdisplaylayerLTLIBRARIES \ uninstall-idirectfbeventbufferDATA \ uninstall-idirectfbeventbufferLTLIBRARIES \ uninstall-idirectfbfontDATA uninstall-idirectfbfontLTLIBRARIES \ uninstall-idirectfbimageproviderDATA \ uninstall-idirectfbimageproviderLTLIBRARIES \ uninstall-idirectfbinputdeviceDATA \ uninstall-idirectfbinputdeviceLTLIBRARIES \ uninstall-idirectfbpaletteDATA \ uninstall-idirectfbpaletteLTLIBRARIES \ uninstall-idirectfbscreenDATA \ uninstall-idirectfbscreenLTLIBRARIES \ uninstall-idirectfbsurfaceDATA \ uninstall-idirectfbsurfaceLTLIBRARIES \ uninstall-idirectfbwindowDATA \ uninstall-idirectfbwindowLTLIBRARIES %.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/proxy/dispatcher/idirectfb_dispatcher.h0000644000175000017500000000626711245562152017775 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFB_DISPATCHER_H__ #define __IDIRECTFB_DISPATCHER_H__ #include #define IDIRECTFB_METHOD_ID_AddRef 1 #define IDIRECTFB_METHOD_ID_Release 2 #define IDIRECTFB_METHOD_ID_SetCooperativeLevel 3 #define IDIRECTFB_METHOD_ID_GetDeviceDescription 4 #define IDIRECTFB_METHOD_ID_EnumVideoModes 5 #define IDIRECTFB_METHOD_ID_SetVideoMode 6 #define IDIRECTFB_METHOD_ID_CreateSurface 7 #define IDIRECTFB_METHOD_ID_CreatePalette 8 #define IDIRECTFB_METHOD_ID_EnumScreens 9 #define IDIRECTFB_METHOD_ID_GetScreen 10 #define IDIRECTFB_METHOD_ID_EnumDisplayLayers 11 #define IDIRECTFB_METHOD_ID_GetDisplayLayer 12 #define IDIRECTFB_METHOD_ID_EnumInputDevices 13 #define IDIRECTFB_METHOD_ID_GetInputDevice 14 #define IDIRECTFB_METHOD_ID_CreateEventBuffer 15 #define IDIRECTFB_METHOD_ID_CreateInputEventBuffer 16 #define IDIRECTFB_METHOD_ID_CreateImageProvider 17 #define IDIRECTFB_METHOD_ID_CreateVideoProvider 18 #define IDIRECTFB_METHOD_ID_CreateFont 19 #define IDIRECTFB_METHOD_ID_CreateDataBuffer 20 #define IDIRECTFB_METHOD_ID_SetClipboardData 21 #define IDIRECTFB_METHOD_ID_GetClipboardData 22 #define IDIRECTFB_METHOD_ID_GetClipboardTimeStamp 23 #define IDIRECTFB_METHOD_ID_Suspend 24 #define IDIRECTFB_METHOD_ID_Resume 25 #define IDIRECTFB_METHOD_ID_WaitIdle 26 #define IDIRECTFB_METHOD_ID_WaitForSync 27 #define IDIRECTFB_METHOD_ID_GetInterface 28 typedef struct { int width; int height; int bpp; } IDirectFB_Dispatcher_EnumVideoModes_Item; typedef struct { DFBScreenID screen_id; DFBScreenDescription desc; } IDirectFB_Dispatcher_EnumScreens_Item; typedef struct { DFBInputDeviceID device_id; DFBInputDeviceDescription desc; } IDirectFB_Dispatcher_EnumInputDevices_Item; #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbwindow_dispatcher.c0000644000175000017500000011314711245562152021214 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "idirectfbwindow_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBWindow, Dispatcher ) /**************************************************************************************************/ static void IDirectFBWindow_Dispatcher_Destruct( IDirectFBWindow *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBWindow_Dispatcher_AddRef( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBWindow_Dispatcher_Release( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) if (--data->ref == 0) IDirectFBWindow_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBWindow_Dispatcher_CreateEventBuffer( IDirectFBWindow *thiz, IDirectFBEventBuffer **buffer ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_AttachEventBuffer( IDirectFBWindow *thiz, IDirectFBEventBuffer *buffer ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_DetachEventBuffer( IDirectFBWindow *thiz, IDirectFBEventBuffer *buffer ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_EnableEvents( IDirectFBWindow *thiz, DFBWindowEventType mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_DisableEvents( IDirectFBWindow *thiz, DFBWindowEventType mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetID( IDirectFBWindow *thiz, DFBWindowID *id ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetPosition( IDirectFBWindow *thiz, int *x, int *y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetSize( IDirectFBWindow *thiz, int *width, int *height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetSurface( IDirectFBWindow *thiz, IDirectFBSurface **surface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetProperty( IDirectFBWindow *thiz, const char *key, void *value, void **old_value ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetProperty( IDirectFBWindow *thiz, const char *key, void **value ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_RemoveProperty( IDirectFBWindow *thiz, const char *key, void **value ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetOptions( IDirectFBWindow *thiz, DFBWindowOptions options ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetOptions( IDirectFBWindow *thiz, DFBWindowOptions *options ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetColorKey( IDirectFBWindow *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetColorKeyIndex( IDirectFBWindow *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetOpaqueRegion( IDirectFBWindow *thiz, int x1, int y1, int x2, int y2 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetOpacity( IDirectFBWindow *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GetOpacity( IDirectFBWindow *thiz, u8 *opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetCursorShape( IDirectFBWindow *thiz, IDirectFBSurface *shape, int hot_x, int hot_y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_RequestFocus( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GrabKeyboard( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_UngrabKeyboard( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GrabPointer( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_UngrabPointer( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_GrabKey( IDirectFBWindow *thiz, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_UngrabKey( IDirectFBWindow *thiz, DFBInputDeviceKeySymbol symbol, DFBInputDeviceModifierMask modifiers ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_Move( IDirectFBWindow *thiz, int dx, int dy ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_MoveTo( IDirectFBWindow *thiz, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_Resize( IDirectFBWindow *thiz, int width, int height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_Raise( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetStackingClass( IDirectFBWindow *thiz, DFBWindowStackingClass stacking_class ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_Lower( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_RaiseToTop( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_LowerToBottom( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_PutAtop( IDirectFBWindow *thiz, IDirectFBWindow *lower ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_PutBelow( IDirectFBWindow *thiz, IDirectFBWindow *upper ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_Close( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_Destroy( IDirectFBWindow *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_SetBounds( IDirectFBWindow *thiz, int x, int y, int w, int h ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBWindow_Dispatcher_ResizeSurface( IDirectFBWindow *thiz, int width, int height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_CreateEventBuffer( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; VoodooInstanceID instance; VoodooMessageParser parser; void *requestor; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = real->CreateEventBuffer( real, &buffer ); if (ret) return ret; ret = voodoo_construct_requestor( manager, "IDirectFBEventBuffer", instance, buffer, &requestor ); if (ret) buffer->Release( buffer ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_AttachEventBuffer( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer_Requestor_data *buffer_data; VoodooInstanceID instance; VoodooMessageParser parser; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_remote( manager, instance, &ptr ); if (ret) return ret; buffer = ptr; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Requestor ); ret = real->AttachEventBuffer( real, buffer_data->src ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_DetachEventBuffer( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer_Requestor_data *buffer_data; VoodooInstanceID instance; VoodooMessageParser parser; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_remote( manager, instance, &ptr ); if (ret) return ret; buffer = ptr; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Requestor ); ret = real->DetachEventBuffer( real, buffer_data->src ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GetID( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBWindowID id; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GetID( real, &id ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_ID, id, VMBT_NONE ); } static DirectResult Dispatch_GetPosition( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBPoint position; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GetPosition( real, &position.x, &position.y ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBPoint), &position, VMBT_NONE ); } static DirectResult Dispatch_GetSize( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBDimension size; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GetSize( real, &size.w, &size.h ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBDimension), &size, VMBT_NONE ); } static DirectResult Dispatch_GetSurface( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBSurface *surface; VoodooInstanceID instance; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GetSurface( real, &surface ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBSurface", surface, data->self, NULL, &instance, NULL ); if (ret) { surface->Release( surface ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_SetOptions( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; VoodooMessageParser parser; DFBWindowOptions options; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, options ); VOODOO_PARSER_END( parser ); ret = real->SetOptions( real, options ); return DFB_OK; } static DirectResult Dispatch_GetOptions( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBWindowOptions options; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GetOptions( real, &options ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, options, VMBT_NONE ); } static DirectResult Dispatch_SetOpacity( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; u8 opacity; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, opacity ); VOODOO_PARSER_END( parser ); real->SetOpacity( real, opacity ); return DFB_OK; } static DirectResult Dispatch_GetOpacity( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; u8 opacity; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GetOpacity( real, &opacity ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_UINT, opacity, VMBT_NONE ); } static DirectResult Dispatch_SetCursorShape( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; const DFBPoint *hot; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_DATA( parser, hot ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; ret = real->SetCursorShape( real, surface, hot->x, hot->y ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_RequestFocus( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->RequestFocus( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GrabPointer( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->GrabPointer( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_UngrabPointer( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->UngrabPointer( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_Move( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBPoint *point; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, point ); VOODOO_PARSER_END( parser ); real->Move( real, point->x, point->y ); return DFB_OK; } static DirectResult Dispatch_MoveTo( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBPoint *point; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, point ); VOODOO_PARSER_END( parser ); real->MoveTo( real, point->x, point->y ); return DFB_OK; } static DirectResult Dispatch_Resize( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; VoodooMessageParser parser; const DFBDimension *size; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, size ); VOODOO_PARSER_END( parser ); ret = real->Resize( real, size->w, size->h ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_SetStackingClass( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; VoodooMessageParser parser; DFBWindowStackingClass stacking_class; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, stacking_class ); VOODOO_PARSER_END( parser ); ret = real->SetStackingClass( real, stacking_class ); return DFB_OK; } static DirectResult Dispatch_Raise( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) real->Raise( real ); return DFB_OK; } static DirectResult Dispatch_Lower( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) real->Lower( real ); return DFB_OK; } static DirectResult Dispatch_RaiseToTop( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) real->RaiseToTop( real ); return DFB_OK; } static DirectResult Dispatch_LowerToBottom( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) real->LowerToBottom( real ); return DFB_OK; } static DirectResult Dispatch_Close( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) real->Close( real ); return DFB_OK; } static DirectResult Dispatch_Destroy( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) ret = real->Destroy( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_SetBounds( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; VoodooMessageParser parser; const DFBRectangle *bounds; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, bounds ); VOODOO_PARSER_END( parser ); ret = real->SetBounds( real, bounds->x, bounds->y, bounds->w, bounds->h ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_ResizeSurface( IDirectFBWindow *thiz, IDirectFBWindow *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; VoodooMessageParser parser; const DFBDimension *size; DIRECT_INTERFACE_GET_DATA(IDirectFBWindow_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, size ); VOODOO_PARSER_END( parser ); ret = real->ResizeSurface( real, size->w, size->h ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBWindow/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBWINDOW_METHOD_ID_CreateEventBuffer: return Dispatch_CreateEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_AttachEventBuffer: return Dispatch_AttachEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_DetachEventBuffer: return Dispatch_DetachEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GetID: return Dispatch_GetID( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GetPosition: return Dispatch_GetPosition( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GetSize: return Dispatch_GetSize( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GetSurface: return Dispatch_GetSurface( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_SetOptions: return Dispatch_SetOptions( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GetOptions: return Dispatch_GetOptions( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_SetOpacity: return Dispatch_SetOpacity( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GetOpacity: return Dispatch_GetOpacity( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_SetCursorShape: return Dispatch_SetCursorShape( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_RequestFocus: return Dispatch_RequestFocus( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_GrabPointer: return Dispatch_GrabPointer( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_UngrabPointer: return Dispatch_UngrabPointer( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_Move: return Dispatch_Move( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_MoveTo: return Dispatch_MoveTo( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_Resize: return Dispatch_Resize( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_SetStackingClass: return Dispatch_SetStackingClass( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_Raise: return Dispatch_Raise( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_Lower: return Dispatch_Lower( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_RaiseToTop: return Dispatch_RaiseToTop( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_LowerToBottom: return Dispatch_LowerToBottom( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_Close: return Dispatch_Close( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_Destroy: return Dispatch_Destroy( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_SetBounds: return Dispatch_SetBounds( dispatcher, real, manager, msg ); case IDIRECTFBWINDOW_METHOD_ID_ResizeSurface: return Dispatch_ResizeSurface( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBWindow *thiz, /* Dispatcher interface */ IDirectFBWindow *real, /* Real interface implementation */ VoodooManager *manager, /* Manager of the Voodoo framework */ VoodooInstanceID super, /* Instance ID of the super interface */ void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; VoodooInstanceID instance; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBWindow_Dispatcher) D_ASSERT( real != NULL ); D_ASSERT( manager != NULL ); D_ASSERT( super != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_instance != NULL ); /* Register the dispatcher, getting a new instance ID that refers to it. */ ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, &instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } /* Return the new instance. */ *ret_instance = instance; /* Initialize interface data. */ data->ref = 1; data->real = real; data->self = instance; data->super = super; /* Initialize interface methods. */ thiz->AddRef = IDirectFBWindow_Dispatcher_AddRef; thiz->Release = IDirectFBWindow_Dispatcher_Release; thiz->GetID = IDirectFBWindow_Dispatcher_GetID; thiz->GetPosition = IDirectFBWindow_Dispatcher_GetPosition; thiz->GetSize = IDirectFBWindow_Dispatcher_GetSize; thiz->CreateEventBuffer = IDirectFBWindow_Dispatcher_CreateEventBuffer; thiz->AttachEventBuffer = IDirectFBWindow_Dispatcher_AttachEventBuffer; thiz->DetachEventBuffer = IDirectFBWindow_Dispatcher_DetachEventBuffer; thiz->EnableEvents = IDirectFBWindow_Dispatcher_EnableEvents; thiz->DisableEvents = IDirectFBWindow_Dispatcher_DisableEvents; thiz->GetSurface = IDirectFBWindow_Dispatcher_GetSurface; thiz->SetProperty = IDirectFBWindow_Dispatcher_SetProperty; thiz->GetProperty = IDirectFBWindow_Dispatcher_GetProperty; thiz->RemoveProperty = IDirectFBWindow_Dispatcher_RemoveProperty; thiz->SetOptions = IDirectFBWindow_Dispatcher_SetOptions; thiz->GetOptions = IDirectFBWindow_Dispatcher_GetOptions; thiz->SetColorKey = IDirectFBWindow_Dispatcher_SetColorKey; thiz->SetColorKeyIndex = IDirectFBWindow_Dispatcher_SetColorKeyIndex; thiz->SetOpaqueRegion = IDirectFBWindow_Dispatcher_SetOpaqueRegion; thiz->SetOpacity = IDirectFBWindow_Dispatcher_SetOpacity; thiz->GetOpacity = IDirectFBWindow_Dispatcher_GetOpacity; thiz->SetCursorShape = IDirectFBWindow_Dispatcher_SetCursorShape; thiz->RequestFocus = IDirectFBWindow_Dispatcher_RequestFocus; thiz->GrabKeyboard = IDirectFBWindow_Dispatcher_GrabKeyboard; thiz->UngrabKeyboard = IDirectFBWindow_Dispatcher_UngrabKeyboard; thiz->GrabPointer = IDirectFBWindow_Dispatcher_GrabPointer; thiz->UngrabPointer = IDirectFBWindow_Dispatcher_UngrabPointer; thiz->GrabKey = IDirectFBWindow_Dispatcher_GrabKey; thiz->UngrabKey = IDirectFBWindow_Dispatcher_UngrabKey; thiz->Move = IDirectFBWindow_Dispatcher_Move; thiz->MoveTo = IDirectFBWindow_Dispatcher_MoveTo; thiz->Resize = IDirectFBWindow_Dispatcher_Resize; thiz->SetStackingClass = IDirectFBWindow_Dispatcher_SetStackingClass; thiz->Raise = IDirectFBWindow_Dispatcher_Raise; thiz->Lower = IDirectFBWindow_Dispatcher_Lower; thiz->RaiseToTop = IDirectFBWindow_Dispatcher_RaiseToTop; thiz->LowerToBottom = IDirectFBWindow_Dispatcher_LowerToBottom; thiz->PutAtop = IDirectFBWindow_Dispatcher_PutAtop; thiz->PutBelow = IDirectFBWindow_Dispatcher_PutBelow; thiz->Close = IDirectFBWindow_Dispatcher_Close; thiz->Destroy = IDirectFBWindow_Dispatcher_Destroy; thiz->SetBounds = IDirectFBWindow_Dispatcher_SetBounds; thiz->ResizeSurface = IDirectFBWindow_Dispatcher_ResizeSurface; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbimageprovider_dispatcher.h0000644000175000017500000000324311245562152022542 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBIMAGEPROVIDER_DISPATCHER_H__ #define __IDIRECTFBIMAGEPROVIDER_DISPATCHER_H__ #define IDIRECTFBIMAGEPROVIDER_METHOD_ID_AddRef 1 #define IDIRECTFBIMAGEPROVIDER_METHOD_ID_Release 2 #define IDIRECTFBIMAGEPROVIDER_METHOD_ID_GetSurfaceDescription 3 #define IDIRECTFBIMAGEPROVIDER_METHOD_ID_GetImageDescription 4 #define IDIRECTFBIMAGEPROVIDER_METHOD_ID_RenderTo 5 #define IDIRECTFBIMAGEPROVIDER_METHOD_ID_SetRenderCallback 6 #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbfont_dispatcher.h0000644000175000017500000000351711245562152020657 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBFONT_DISPATCHER_H__ #define __IDIRECTFBFONT_DISPATCHER_H__ #define IDIRECTFBFONT_METHOD_ID_AddRef 1 #define IDIRECTFBFONT_METHOD_ID_Release 2 #define IDIRECTFBFONT_METHOD_ID_GetAscender 3 #define IDIRECTFBFONT_METHOD_ID_GetDescender 4 #define IDIRECTFBFONT_METHOD_ID_GetHeight 5 #define IDIRECTFBFONT_METHOD_ID_GetMaxAdvance 6 #define IDIRECTFBFONT_METHOD_ID_GetKerning 7 #define IDIRECTFBFONT_METHOD_ID_GetStringWidth 8 #define IDIRECTFBFONT_METHOD_ID_GetStringExtents 9 #define IDIRECTFBFONT_METHOD_ID_GetGlyphExtents 10 #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbsurface_dispatcher.c0000644000175000017500000014740611245562152021342 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbsurface_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBSurface, Dispatcher ) /**************************************************************************************************/ /* * private data struct of IDirectFBSurface_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBSurface *real; VoodooInstanceID super; } IDirectFBSurface_Dispatcher_data; /**************************************************************************************************/ static void IDirectFBSurface_Dispatcher_Destruct( IDirectFBSurface *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBSurface_Dispatcher_AddRef( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBSurface_Dispatcher_Release( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (--data->ref == 0) IDirectFBSurface_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBSurface_Dispatcher_GetCapabilities( IDirectFBSurface *thiz, DFBSurfaceCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!caps) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetPosition( IDirectFBSurface *thiz, int *x, int *y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!x && !y) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetSize( IDirectFBSurface *thiz, int *width, int *height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!width && !height) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetVisibleRectangle( IDirectFBSurface *thiz, DFBRectangle *rect ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!rect) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetPixelFormat( IDirectFBSurface *thiz, DFBSurfacePixelFormat *format ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!format) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetAccelerationMask( IDirectFBSurface *thiz, IDirectFBSurface *source, DFBAccelerationMask *mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!mask) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetPalette( IDirectFBSurface *thiz, IDirectFBPalette **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetPalette( IDirectFBSurface *thiz, IDirectFBPalette *palette ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!palette) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetAlphaRamp( IDirectFBSurface *thiz, u8 a0, u8 a1, u8 a2, u8 a3 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_Lock( IDirectFBSurface *thiz, DFBSurfaceLockFlags flags, void **ret_ptr, int *ret_pitch ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!flags || !ret_ptr || !ret_pitch) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetFramebufferOffset( IDirectFBSurface *thiz, int *offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!offset) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_Unlock( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_Flip( IDirectFBSurface *thiz, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetField( IDirectFBSurface *thiz, int field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (field < 0 || field > 1) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_Clear( IDirectFBSurface *thiz, u8 r, u8 g, u8 b, u8 a ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetClip( IDirectFBSurface *thiz, const DFBRegion *clip ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetClip( IDirectFBSurface *thiz, DFBRegion *clip ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!clip) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetColor( IDirectFBSurface *thiz, u8 r, u8 g, u8 b, u8 a ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetColorIndex( IDirectFBSurface *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetSrcBlendFunction( IDirectFBSurface *thiz, DFBSurfaceBlendFunction src ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetDstBlendFunction( IDirectFBSurface *thiz, DFBSurfaceBlendFunction dst ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetPorterDuff( IDirectFBSurface *thiz, DFBSurfacePorterDuffRule rule ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetSrcColorKey( IDirectFBSurface *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetSrcColorKeyIndex( IDirectFBSurface *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetDstColorKey( IDirectFBSurface *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetDstColorKeyIndex( IDirectFBSurface *thiz, unsigned int index ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetFont( IDirectFBSurface *thiz, IDirectFBFont *font ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetFont( IDirectFBSurface *thiz, IDirectFBFont **font ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetDrawingFlags( IDirectFBSurface *thiz, DFBSurfaceDrawingFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_FillRectangle( IDirectFBSurface *thiz, int x, int y, int w, int h ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_FillRectangles( IDirectFBSurface *thiz, const DFBRectangle *rects, unsigned int num_rects ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_FillSpans( IDirectFBSurface *thiz, int y, const DFBSpan *spans, unsigned int num_spans ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_DrawLine( IDirectFBSurface *thiz, int x1, int y1, int x2, int y2 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_DrawLines( IDirectFBSurface *thiz, const DFBRegion *lines, unsigned int num_lines ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!lines || !num_lines) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_DrawRectangle( IDirectFBSurface *thiz, int x, int y, int w, int h ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (w<=0 || h<=0) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_FillTriangle( IDirectFBSurface *thiz, int x1, int y1, int x2, int y2, int x3, int y3 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetBlittingFlags( IDirectFBSurface *thiz, DFBSurfaceBlittingFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_Blit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *rect, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!source) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_TileBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *rect, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!source) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_BatchBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rects, const DFBPoint *dest_points, int num ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!source || !source_rects || !dest_points || num < 1) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_StretchBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rect, const DFBRectangle *destination_rect ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!source) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_TextureTriangles( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBVertex *vertices, const int *indices, int num, DFBTriangleFormation formation ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!source || !vertices || num < 3) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_DrawString( IDirectFBSurface *thiz, const char *text, int bytes, int x, int y, DFBSurfaceTextFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!text) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_DrawGlyph( IDirectFBSurface *thiz, unsigned int index, int x, int y, DFBSurfaceTextFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!index) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetEncoding( IDirectFBSurface *thiz, DFBTextEncodingID encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetSubSurface( IDirectFBSurface *thiz, const DFBRectangle *rect, IDirectFBSurface **surface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!surface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_GetGL( IDirectFBSurface *thiz, IDirectFBGL **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_Dump( IDirectFBSurface *thiz, const char *directory, const char *prefix ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) if (!directory || !prefix) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_DisableAcceleration( IDirectFBSurface *thiz, DFBAccelerationMask mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_ReleaseSource( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBSurface_Dispatcher_SetIndexTranslation( IDirectFBSurface *thiz, const int *indices, int num_indices ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetPosition( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; DFBPoint position; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) ret = real->GetPosition( real, &position.x, &position.y ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBPoint), &position, VMBT_NONE ); } static DirectResult Dispatch_GetSize( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; DFBDimension dimension; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) ret = real->GetSize( real, &dimension.w, &dimension.h ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBDimension), &dimension, VMBT_NONE ); } static DirectResult Dispatch_GetVisibleRectangle( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; DFBRectangle rect; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) ret = real->GetVisibleRectangle( real, &rect ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBRectangle), &rect, VMBT_NONE ); } static DirectResult Dispatch_GetPixelFormat( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DFBResult ret; DFBSurfacePixelFormat format; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) ret = real->GetPixelFormat( real, &format ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, format, VMBT_NONE ); } static DirectResult Dispatch_GetAccelerationMask( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; void *surface = NULL; DFBAccelerationMask mask; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); if (instance != VOODOO_INSTANCE_NONE) { ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; } ret = real->GetAccelerationMask( real, surface, &mask ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, mask, VMBT_NONE ); } static DirectResult Dispatch_GetPalette( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBPalette *palette; VoodooInstanceID instance; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) ret = real->GetPalette( real, &palette ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBPalette", palette, data->super, NULL, &instance, NULL ); if (ret) { palette->Release( palette ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_SetPalette( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; void *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &palette ); if (ret) return ret; real->SetPalette( real, palette ); return DFB_OK; } static DirectResult Dispatch_Flip( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; const DFBRegion *region; DFBSurfaceFlipFlags flags; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ODATA( parser, region ); VOODOO_PARSER_GET_INT( parser, flags ); VOODOO_PARSER_END( parser ); ret = real->Flip( real, region, flags ); if (flags & DSFLIP_WAIT) return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); return DFB_OK; } static DirectResult Dispatch_Clear( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBColor *color; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, color ); VOODOO_PARSER_END( parser ); real->Clear( real, color->r, color->g, color->b, color->a ); return DFB_OK; } static DirectResult Dispatch_SetClip( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBRegion *clip; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ODATA( parser, clip ); VOODOO_PARSER_END( parser ); real->SetClip( real, clip ); return DFB_OK; } static DirectResult Dispatch_SetColor( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBColor *color; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, color ); VOODOO_PARSER_END( parser ); real->SetColor( real, color->r, color->g, color->b, color->a ); return DFB_OK; } static DirectResult Dispatch_SetSrcColorKey( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBColor *color; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, color ); VOODOO_PARSER_END( parser ); real->SetSrcColorKey( real, color->r, color->g, color->b ); return DFB_OK; } static DirectResult Dispatch_SetSrcColorKeyIndex( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; unsigned int index; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, index ); VOODOO_PARSER_END( parser ); real->SetSrcColorKeyIndex( real, index ); return DFB_OK; } static DirectResult Dispatch_SetDstColorKey( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBColor *color; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, color ); VOODOO_PARSER_END( parser ); real->SetDstColorKey( real, color->r, color->g, color->b ); return DFB_OK; } static DirectResult Dispatch_SetDstColorKeyIndex( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; unsigned int index; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, index ); VOODOO_PARSER_END( parser ); real->SetDstColorKeyIndex( real, index ); return DFB_OK; } static DirectResult Dispatch_SetBlittingFlags( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; DFBSurfaceBlittingFlags flags; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, flags ); VOODOO_PARSER_END( parser ); real->SetBlittingFlags( real, flags ); return DFB_OK; } static DirectResult Dispatch_Blit( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; const DFBRectangle *rect; const DFBPoint *point; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_ODATA( parser, rect ); VOODOO_PARSER_GET_DATA( parser, point ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; real->Blit( real, surface, rect, point->x, point->y ); return DFB_OK; } static DirectResult Dispatch_TileBlit( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; const DFBRectangle *rect; const DFBPoint *point; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_ODATA( parser, rect ); VOODOO_PARSER_GET_DATA( parser, point ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; real->TileBlit( real, surface, rect, point->x, point->y ); return DFB_OK; } static DirectResult Dispatch_BatchBlit( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; unsigned int num; const DFBRectangle *source_rects; const DFBPoint *dest_points; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_UINT( parser, num ); VOODOO_PARSER_GET_DATA( parser, source_rects ); VOODOO_PARSER_GET_DATA( parser, dest_points ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; real->BatchBlit( real, surface, source_rects, dest_points, num ); return DFB_OK; } static DirectResult Dispatch_StretchBlit( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; const DFBRectangle *srect; const DFBRectangle *drect; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_ODATA( parser, srect ); VOODOO_PARSER_GET_ODATA( parser, drect ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; real->StretchBlit( real, surface, srect, drect ); return DFB_OK; } static DirectResult Dispatch_TextureTriangles( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; const DFBVertex *vertices; const int *indices; int num; DFBTriangleFormation formation; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_DATA( parser, vertices ); VOODOO_PARSER_GET_ODATA( parser, indices ); VOODOO_PARSER_GET_INT( parser, num ); VOODOO_PARSER_GET_INT( parser, formation ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; real->TextureTriangles( real, surface, vertices, indices, num, formation ); return DFB_OK; } static DirectResult Dispatch_SetDrawingFlags( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; DFBSurfaceDrawingFlags flags; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, flags ); VOODOO_PARSER_END( parser ); real->SetDrawingFlags( real, flags ); return DFB_OK; } static DirectResult Dispatch_FillRectangle( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBRectangle *rect; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, rect ); VOODOO_PARSER_END( parser ); real->FillRectangle( real, rect->x, rect->y, rect->w, rect->h ); return DFB_OK; } static DirectResult Dispatch_FillRectangles( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; unsigned int num_rects; const DFBRectangle *rects; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, num_rects ); VOODOO_PARSER_GET_DATA( parser, rects ); VOODOO_PARSER_END( parser ); real->FillRectangles( real, rects, num_rects ); return DFB_OK; } static DirectResult Dispatch_FillSpans( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; int y; unsigned int num_spans; const DFBSpan *spans; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, y ); VOODOO_PARSER_GET_UINT( parser, num_spans ); VOODOO_PARSER_GET_DATA( parser, spans ); VOODOO_PARSER_END( parser ); real->FillSpans( real, y, spans, num_spans ); return DFB_OK; } static DirectResult Dispatch_DrawLine( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBRegion *line; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, line ); VOODOO_PARSER_END( parser ); real->DrawLine( real, line->x1, line->y1, line->x2, line->y2 ); return DFB_OK; } static DirectResult Dispatch_DrawLines( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; unsigned int num_lines; const DFBRegion *lines; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, num_lines ); VOODOO_PARSER_GET_DATA( parser, lines ); VOODOO_PARSER_END( parser ); real->DrawLines( real, lines, num_lines ); return DFB_OK; } static DirectResult Dispatch_DrawRectangle( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBRectangle *rect; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, rect ); VOODOO_PARSER_END( parser ); real->DrawRectangle( real, rect->x, rect->y, rect->w, rect->h ); return DFB_OK; } static DirectResult Dispatch_FillTriangle( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const DFBTriangle *tri; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, tri ); VOODOO_PARSER_END( parser ); real->FillTriangle( real, tri->x1, tri->y1, tri->x2, tri->y2, tri->x3, tri->y3 ); return DFB_OK; } static DirectResult Dispatch_SetFont( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; void *font; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); if (instance == VOODOO_INSTANCE_NONE) { real->SetFont( real, NULL ); return DFB_OK; } ret = voodoo_manager_lookup_local( manager, instance, NULL, &font ); if (ret) return ret; real->SetFont( real, font ); return DFB_OK; } static DirectResult Dispatch_DrawString( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; const char *text; int bytes; const DFBPoint *point; DFBSurfaceTextFlags flags; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, text ); VOODOO_PARSER_GET_INT( parser, bytes ); VOODOO_PARSER_GET_DATA( parser, point ); VOODOO_PARSER_GET_INT( parser, flags ); VOODOO_PARSER_END( parser ); real->DrawString( real, text, bytes, point->x, point->y, flags ); return DFB_OK; } static DirectResult Dispatch_DrawGlyph( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; unsigned int index; const DFBPoint *point; DFBSurfaceTextFlags flags; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, index ); VOODOO_PARSER_GET_DATA( parser, point ); VOODOO_PARSER_GET_INT( parser, flags ); VOODOO_PARSER_END( parser ); real->DrawGlyph( real, index, point->x, point->y, flags ); return DFB_OK; } static DirectResult Dispatch_SetEncoding( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; DFBTextEncodingID encoding; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, encoding ); VOODOO_PARSER_END( parser ); real->SetEncoding( real, encoding ); return DFB_OK; } static DirectResult Dispatch_GetSubSurface( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; const DFBRectangle *rect; IDirectFBSurface *surface; VoodooInstanceID instance; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ODATA( parser, rect ); VOODOO_PARSER_END( parser ); ret = real->GetSubSurface( real, rect, &surface ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBSurface", surface, data->super, NULL, &instance, NULL ); if (ret) { surface->Release( surface ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_DisableAcceleration( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { VoodooMessageParser parser; DFBAccelerationMask mask; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, mask ); VOODOO_PARSER_END( parser ); real->DisableAcceleration( real, mask ); return DFB_OK; } static DirectResult Dispatch_ReleaseSource( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Dispatcher) real->ReleaseSource( real ); return DFB_OK; } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBSurface/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBSURFACE_METHOD_ID_GetPosition: return Dispatch_GetPosition( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_GetSize: return Dispatch_GetSize( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_GetVisibleRectangle: return Dispatch_GetVisibleRectangle( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_GetPixelFormat: return Dispatch_GetPixelFormat( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_GetAccelerationMask: return Dispatch_GetAccelerationMask( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_GetPalette: return Dispatch_GetPalette( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetPalette: return Dispatch_SetPalette( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_Flip: return Dispatch_Flip( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_Clear: return Dispatch_Clear( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetClip: return Dispatch_SetClip( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetColor: return Dispatch_SetColor( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetSrcColorKey: return Dispatch_SetSrcColorKey( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetSrcColorKeyIndex: return Dispatch_SetSrcColorKeyIndex( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetDstColorKey: return Dispatch_SetDstColorKey( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetDstColorKeyIndex: return Dispatch_SetDstColorKeyIndex( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetBlittingFlags: return Dispatch_SetBlittingFlags( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_Blit: return Dispatch_Blit( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_TileBlit: return Dispatch_TileBlit( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_BatchBlit: return Dispatch_BatchBlit( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_StretchBlit: return Dispatch_StretchBlit( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_TextureTriangles: return Dispatch_TextureTriangles( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetDrawingFlags: return Dispatch_SetDrawingFlags( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_FillRectangle: return Dispatch_FillRectangle( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_DrawLine: return Dispatch_DrawLine( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_DrawLines: return Dispatch_DrawLines( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_DrawRectangle: return Dispatch_DrawRectangle( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_FillTriangle: return Dispatch_FillTriangle( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetFont: return Dispatch_SetFont( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_DrawString: return Dispatch_DrawString( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_DrawGlyph: return Dispatch_DrawGlyph( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_SetEncoding: return Dispatch_SetEncoding( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_GetSubSurface: return Dispatch_GetSubSurface( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_FillRectangles: return Dispatch_FillRectangles( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_FillSpans: return Dispatch_FillSpans( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_DisableAcceleration: return Dispatch_DisableAcceleration( dispatcher, real, manager, msg ); case IDIRECTFBSURFACE_METHOD_ID_ReleaseSource: return Dispatch_ReleaseSource( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBSurface *thiz, IDirectFBSurface *real, VoodooManager *manager, VoodooInstanceID super, void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBSurface_Dispatcher) ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, ret_instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } data->ref = 1; data->real = real; data->super = super; thiz->AddRef = IDirectFBSurface_Dispatcher_AddRef; thiz->Release = IDirectFBSurface_Dispatcher_Release; thiz->GetCapabilities = IDirectFBSurface_Dispatcher_GetCapabilities; thiz->GetPosition = IDirectFBSurface_Dispatcher_GetPosition; thiz->GetSize = IDirectFBSurface_Dispatcher_GetSize; thiz->GetVisibleRectangle = IDirectFBSurface_Dispatcher_GetVisibleRectangle; thiz->GetPixelFormat = IDirectFBSurface_Dispatcher_GetPixelFormat; thiz->GetAccelerationMask = IDirectFBSurface_Dispatcher_GetAccelerationMask; thiz->GetPalette = IDirectFBSurface_Dispatcher_GetPalette; thiz->SetPalette = IDirectFBSurface_Dispatcher_SetPalette; thiz->SetAlphaRamp = IDirectFBSurface_Dispatcher_SetAlphaRamp; thiz->Lock = IDirectFBSurface_Dispatcher_Lock; thiz->GetFramebufferOffset = IDirectFBSurface_Dispatcher_GetFramebufferOffset; thiz->Unlock = IDirectFBSurface_Dispatcher_Unlock; thiz->Flip = IDirectFBSurface_Dispatcher_Flip; thiz->SetField = IDirectFBSurface_Dispatcher_SetField; thiz->Clear = IDirectFBSurface_Dispatcher_Clear; thiz->SetClip = IDirectFBSurface_Dispatcher_SetClip; thiz->GetClip = IDirectFBSurface_Dispatcher_GetClip; thiz->SetColor = IDirectFBSurface_Dispatcher_SetColor; thiz->SetColorIndex = IDirectFBSurface_Dispatcher_SetColorIndex; thiz->SetSrcBlendFunction = IDirectFBSurface_Dispatcher_SetSrcBlendFunction; thiz->SetDstBlendFunction = IDirectFBSurface_Dispatcher_SetDstBlendFunction; thiz->SetPorterDuff = IDirectFBSurface_Dispatcher_SetPorterDuff; thiz->SetSrcColorKey = IDirectFBSurface_Dispatcher_SetSrcColorKey; thiz->SetSrcColorKeyIndex = IDirectFBSurface_Dispatcher_SetSrcColorKeyIndex; thiz->SetDstColorKey = IDirectFBSurface_Dispatcher_SetDstColorKey; thiz->SetDstColorKeyIndex = IDirectFBSurface_Dispatcher_SetDstColorKeyIndex; thiz->SetBlittingFlags = IDirectFBSurface_Dispatcher_SetBlittingFlags; thiz->Blit = IDirectFBSurface_Dispatcher_Blit; thiz->TileBlit = IDirectFBSurface_Dispatcher_TileBlit; thiz->BatchBlit = IDirectFBSurface_Dispatcher_BatchBlit; thiz->StretchBlit = IDirectFBSurface_Dispatcher_StretchBlit; thiz->TextureTriangles = IDirectFBSurface_Dispatcher_TextureTriangles; thiz->SetDrawingFlags = IDirectFBSurface_Dispatcher_SetDrawingFlags; thiz->FillRectangle = IDirectFBSurface_Dispatcher_FillRectangle; thiz->FillRectangles = IDirectFBSurface_Dispatcher_FillRectangles; thiz->FillSpans = IDirectFBSurface_Dispatcher_FillSpans; thiz->DrawLine = IDirectFBSurface_Dispatcher_DrawLine; thiz->DrawLines = IDirectFBSurface_Dispatcher_DrawLines; thiz->DrawRectangle = IDirectFBSurface_Dispatcher_DrawRectangle; thiz->FillTriangle = IDirectFBSurface_Dispatcher_FillTriangle; thiz->SetFont = IDirectFBSurface_Dispatcher_SetFont; thiz->GetFont = IDirectFBSurface_Dispatcher_GetFont; thiz->DrawString = IDirectFBSurface_Dispatcher_DrawString; thiz->DrawGlyph = IDirectFBSurface_Dispatcher_DrawGlyph; thiz->SetEncoding = IDirectFBSurface_Dispatcher_SetEncoding; thiz->GetSubSurface = IDirectFBSurface_Dispatcher_GetSubSurface; thiz->GetGL = IDirectFBSurface_Dispatcher_GetGL; thiz->Dump = IDirectFBSurface_Dispatcher_Dump; thiz->DisableAcceleration = IDirectFBSurface_Dispatcher_DisableAcceleration; thiz->ReleaseSource = IDirectFBSurface_Dispatcher_ReleaseSource; thiz->SetIndexTranslation = IDirectFBSurface_Dispatcher_SetIndexTranslation; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbeventbuffer_dispatcher.h0000644000175000017500000000470511245562152022224 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBEVENTBUFFER_DISPATCHER_H__ #define __IDIRECTFBEVENTBUFFER_DISPATCHER_H__ #include #include #define IDIRECTFBEVENTBUFFER_METHOD_ID_AddRef 1 #define IDIRECTFBEVENTBUFFER_METHOD_ID_Release 2 #define IDIRECTFBEVENTBUFFER_METHOD_ID_Reset 3 #define IDIRECTFBEVENTBUFFER_METHOD_ID_WaitForEvent 4 #define IDIRECTFBEVENTBUFFER_METHOD_ID_WaitForEventWithTimeout 5 #define IDIRECTFBEVENTBUFFER_METHOD_ID_GetEvent 6 #define IDIRECTFBEVENTBUFFER_METHOD_ID_PeekEvent 7 #define IDIRECTFBEVENTBUFFER_METHOD_ID_HasEvent 8 #define IDIRECTFBEVENTBUFFER_METHOD_ID_PostEvent 9 #define IDIRECTFBEVENTBUFFER_METHOD_ID_WakeUp 10 #define IDIRECTFBEVENTBUFFER_METHOD_ID_CreateFileDescriptor 11 /* * private data struct of IDirectFBEventBuffer_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBEventBuffer *real; VoodooInstanceID self; /* The instance of this dispatcher itself. */ VoodooInstanceID super; /* The instance of the super interface. */ VoodooManager *manager; } IDirectFBEventBuffer_Dispatcher_data; #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbimageprovider_dispatcher.c0000644000175000017500000002176011245562152022541 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "idirectfbimageprovider_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBImageProvider *thiz, IDirectFBImageProvider *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBImageProvider, Dispatcher ) /**************************************************************************************************/ /* * private data struct of IDirectFBImageProvider_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBImageProvider *real; } IDirectFBImageProvider_Dispatcher_data; /**************************************************************************************************/ static void IDirectFBImageProvider_Dispatcher_Destruct( IDirectFBImageProvider *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBImageProvider_Dispatcher_AddRef( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBImageProvider_Dispatcher_Release( IDirectFBImageProvider *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) if (--data->ref == 0) IDirectFBImageProvider_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBImageProvider_Dispatcher_GetSurfaceDescription( IDirectFBImageProvider *thiz, DFBSurfaceDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBImageProvider_Dispatcher_GetImageDescription( IDirectFBImageProvider *thiz, DFBImageDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBImageProvider_Dispatcher_RenderTo( IDirectFBImageProvider *thiz, IDirectFBSurface *destination, const DFBRectangle *destination_rect ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBImageProvider_Dispatcher_SetRenderCallback( IDirectFBImageProvider *thiz, DIRenderCallback callback, void *callback_data ) { DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetSurfaceDescription( IDirectFBImageProvider *thiz, IDirectFBImageProvider *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBSurfaceDescription desc; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) ret = real->GetSurfaceDescription( real, &desc ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBSurfaceDescription), &desc, VMBT_NONE ); } static DirectResult Dispatch_GetImageDescription( IDirectFBImageProvider *thiz, IDirectFBImageProvider *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBImageDescription desc; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) ret = real->GetImageDescription( real, &desc ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBImageDescription), &desc, VMBT_NONE ); } static DirectResult Dispatch_RenderTo( IDirectFBImageProvider *thiz, IDirectFBImageProvider *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; VoodooInstanceID instance; const DFBRectangle *rect; void *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBImageProvider_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_ODATA( parser, rect ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_local( manager, instance, NULL, &surface ); if (ret) return ret; ret = real->RenderTo( real, surface, rect ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBImageProvider/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBIMAGEPROVIDER_METHOD_ID_GetSurfaceDescription: return Dispatch_GetSurfaceDescription( dispatcher, real, manager, msg ); case IDIRECTFBIMAGEPROVIDER_METHOD_ID_GetImageDescription: return Dispatch_GetImageDescription( dispatcher, real, manager, msg ); case IDIRECTFBIMAGEPROVIDER_METHOD_ID_RenderTo: return Dispatch_RenderTo( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBImageProvider *thiz, IDirectFBImageProvider *real, VoodooManager *manager, VoodooInstanceID super, void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBImageProvider_Dispatcher) ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, ret_instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } data->ref = 1; data->real = real; thiz->AddRef = IDirectFBImageProvider_Dispatcher_AddRef; thiz->Release = IDirectFBImageProvider_Dispatcher_Release; thiz->GetSurfaceDescription = IDirectFBImageProvider_Dispatcher_GetSurfaceDescription; thiz->GetImageDescription = IDirectFBImageProvider_Dispatcher_GetImageDescription; thiz->RenderTo = IDirectFBImageProvider_Dispatcher_RenderTo; thiz->SetRenderCallback = IDirectFBImageProvider_Dispatcher_SetRenderCallback; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbscreen_dispatcher.h0000644000175000017500000000516411245562152021170 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBSCREEN_DISPATCHER_H__ #define __IDIRECTFBSCREEN_DISPATCHER_H__ #define IDIRECTFBSCREEN_METHOD_ID_AddRef 1 #define IDIRECTFBSCREEN_METHOD_ID_Release 2 #define IDIRECTFBSCREEN_METHOD_ID_GetID 3 #define IDIRECTFBSCREEN_METHOD_ID_GetDescription 4 #define IDIRECTFBSCREEN_METHOD_ID_GetSize 5 #define IDIRECTFBSCREEN_METHOD_ID_EnumDisplayLayers 6 #define IDIRECTFBSCREEN_METHOD_ID_SetPowerMode 7 #define IDIRECTFBSCREEN_METHOD_ID_WaitForSync 8 #define IDIRECTFBSCREEN_METHOD_ID_GetMixerDescriptions 9 #define IDIRECTFBSCREEN_METHOD_ID_GetMixerConfiguration 10 #define IDIRECTFBSCREEN_METHOD_ID_TestMixerConfiguration 11 #define IDIRECTFBSCREEN_METHOD_ID_SetMixerConfiguration 12 #define IDIRECTFBSCREEN_METHOD_ID_GetEncoderDescriptions 13 #define IDIRECTFBSCREEN_METHOD_ID_GetEncoderConfiguration 14 #define IDIRECTFBSCREEN_METHOD_ID_TestEncoderConfiguration 15 #define IDIRECTFBSCREEN_METHOD_ID_SetEncoderConfiguration 16 #define IDIRECTFBSCREEN_METHOD_ID_GetOutputDescriptions 17 #define IDIRECTFBSCREEN_METHOD_ID_GetOutputConfiguration 18 #define IDIRECTFBSCREEN_METHOD_ID_TestOutputConfiguration 19 #define IDIRECTFBSCREEN_METHOD_ID_SetOutputConfiguration 20 typedef struct { DFBDisplayLayerID layer_id; DFBDisplayLayerDescription desc; } IDirectFBScreen_Dispatcher_EnumDisplayLayers_Item; #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbdisplaylayer_dispatcher.c0000644000175000017500000005301711245562152022406 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include "idirectfbdisplaylayer_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBDisplayLayer, Dispatcher ) /**************************************************************************************************/ static void IDirectFBDisplayLayer_Dispatcher_Destruct( IDirectFBDisplayLayer *thiz ) { D_DEBUG( "%s (%p)^n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBDisplayLayer_Dispatcher_AddRef( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBDisplayLayer_Dispatcher_Release( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) if (--data->ref == 0) IDirectFBDisplayLayer_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetID( IDirectFBDisplayLayer *thiz, DFBDisplayLayerID *id ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetDescription( IDirectFBDisplayLayer *thiz, DFBDisplayLayerDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetSurface( IDirectFBDisplayLayer *thiz, IDirectFBSurface **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetScreen( IDirectFBDisplayLayer *thiz, IDirectFBScreen **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetCooperativeLevel( IDirectFBDisplayLayer *thiz, DFBDisplayLayerCooperativeLevel level ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetOpacity( IDirectFBDisplayLayer *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetCurrentOutputField( IDirectFBDisplayLayer *thiz, int *field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetFieldParity( IDirectFBDisplayLayer *thiz, int field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetScreenLocation( IDirectFBDisplayLayer *thiz, float x, float y, float width, float height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetSrcColorKey( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetDstColorKey( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetLevel( IDirectFBDisplayLayer *thiz, int *level ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetLevel( IDirectFBDisplayLayer *thiz, int level ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetConfiguration( IDirectFBDisplayLayer *thiz, DFBDisplayLayerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_TestConfiguration( IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config, DFBDisplayLayerConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetConfiguration( IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetBackgroundMode( IDirectFBDisplayLayer *thiz, DFBDisplayLayerBackgroundMode background_mode ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetBackgroundImage( IDirectFBDisplayLayer *thiz, IDirectFBSurface *surface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetBackgroundColor( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b, u8 a ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_CreateWindow( IDirectFBDisplayLayer *thiz, const DFBWindowDescription *desc, IDirectFBWindow **window ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetWindow( IDirectFBDisplayLayer *thiz, DFBWindowID id, IDirectFBWindow **window ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_EnableCursor( IDirectFBDisplayLayer *thiz, int enable ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetCursorPosition( IDirectFBDisplayLayer *thiz, int *x, int *y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_WarpCursor( IDirectFBDisplayLayer *thiz, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetCursorAcceleration( IDirectFBDisplayLayer *thiz, int numerator, int denominator, int threshold ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetCursorShape( IDirectFBDisplayLayer *thiz, IDirectFBSurface *shape, int hot_x, int hot_y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetCursorOpacity( IDirectFBDisplayLayer *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_GetColorAdjustment( IDirectFBDisplayLayer *thiz, DFBColorAdjustment *adj ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_SetColorAdjustment( IDirectFBDisplayLayer *thiz, const DFBColorAdjustment *adj ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBDisplayLayer_Dispatcher_WaitForSync( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetID( IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBDisplayLayerID id; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) ret = real->GetID( real, &id ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_ID, id, VMBT_NONE ); } static DirectResult Dispatch_GetScreen( IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBScreen *screen; VoodooInstanceID instance; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) ret = real->GetScreen( real, &screen ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBScreen", screen, data->self, NULL, &instance, NULL ); if (ret) { screen->Release( screen ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_GetConfiguration( IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBDisplayLayerConfig config; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) ret = real->GetConfiguration( real, &config ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBDisplayLayerConfig), &config, VMBT_NONE ); } static DirectResult Dispatch_SetCooperativeLevel( IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; DFBDisplayLayerCooperativeLevel level; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, level ); VOODOO_PARSER_END( parser ); ret = real->SetCooperativeLevel( real, level ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_CreateWindow( IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; const DFBWindowDescription *desc; IDirectFBWindow *window; VoodooInstanceID instance; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, desc ); VOODOO_PARSER_END( parser ); ret = real->CreateWindow( real, desc, &window ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBWindow", window, data->self, NULL, &instance, NULL ); if (ret) { window->Release( window ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBDisplayLayer/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBDISPLAYLAYER_METHOD_ID_GetID: return Dispatch_GetID( dispatcher, real, manager, msg ); case IDIRECTFBDISPLAYLAYER_METHOD_ID_GetScreen: return Dispatch_GetScreen( dispatcher, real, manager, msg ); case IDIRECTFBDISPLAYLAYER_METHOD_ID_SetCooperativeLevel: return Dispatch_SetCooperativeLevel( dispatcher, real, manager, msg ); case IDIRECTFBDISPLAYLAYER_METHOD_ID_GetConfiguration: return Dispatch_GetConfiguration( dispatcher, real, manager, msg ); case IDIRECTFBDISPLAYLAYER_METHOD_ID_CreateWindow: return Dispatch_CreateWindow( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBDisplayLayer *thiz, /* Dispatcher interface */ IDirectFBDisplayLayer *real, /* Real interface implementation */ VoodooManager *manager, /* Manager of the Voodoo framework */ VoodooInstanceID super, /* Instance ID of the super interface */ void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; VoodooInstanceID instance; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBDisplayLayer_Dispatcher) D_ASSERT( real != NULL ); D_ASSERT( manager != NULL ); D_ASSERT( super != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_instance != NULL ); /* Register the dispatcher, getting a new instance ID that refers to it. */ ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, &instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } /* Return the new instance. */ *ret_instance = instance; /* Initialize interface data. */ data->ref = 1; data->real = real; data->self = instance; data->super = super; /* Initialize interface methods. */ thiz->AddRef = IDirectFBDisplayLayer_Dispatcher_AddRef; thiz->Release = IDirectFBDisplayLayer_Dispatcher_Release; thiz->GetID = IDirectFBDisplayLayer_Dispatcher_GetID; thiz->GetDescription = IDirectFBDisplayLayer_Dispatcher_GetDescription; thiz->GetSurface = IDirectFBDisplayLayer_Dispatcher_GetSurface; thiz->GetScreen = IDirectFBDisplayLayer_Dispatcher_GetScreen; thiz->SetCooperativeLevel = IDirectFBDisplayLayer_Dispatcher_SetCooperativeLevel; thiz->SetOpacity = IDirectFBDisplayLayer_Dispatcher_SetOpacity; thiz->GetCurrentOutputField = IDirectFBDisplayLayer_Dispatcher_GetCurrentOutputField; thiz->SetScreenLocation = IDirectFBDisplayLayer_Dispatcher_SetScreenLocation; thiz->SetSrcColorKey = IDirectFBDisplayLayer_Dispatcher_SetSrcColorKey; thiz->SetDstColorKey = IDirectFBDisplayLayer_Dispatcher_SetDstColorKey; thiz->GetLevel = IDirectFBDisplayLayer_Dispatcher_GetLevel; thiz->SetLevel = IDirectFBDisplayLayer_Dispatcher_SetLevel; thiz->GetConfiguration = IDirectFBDisplayLayer_Dispatcher_GetConfiguration; thiz->TestConfiguration = IDirectFBDisplayLayer_Dispatcher_TestConfiguration; thiz->SetConfiguration = IDirectFBDisplayLayer_Dispatcher_SetConfiguration; thiz->SetBackgroundMode = IDirectFBDisplayLayer_Dispatcher_SetBackgroundMode; thiz->SetBackgroundColor = IDirectFBDisplayLayer_Dispatcher_SetBackgroundColor; thiz->SetBackgroundImage = IDirectFBDisplayLayer_Dispatcher_SetBackgroundImage; thiz->GetColorAdjustment = IDirectFBDisplayLayer_Dispatcher_GetColorAdjustment; thiz->SetColorAdjustment = IDirectFBDisplayLayer_Dispatcher_SetColorAdjustment; thiz->CreateWindow = IDirectFBDisplayLayer_Dispatcher_CreateWindow; thiz->GetWindow = IDirectFBDisplayLayer_Dispatcher_GetWindow; thiz->WarpCursor = IDirectFBDisplayLayer_Dispatcher_WarpCursor; thiz->SetCursorAcceleration = IDirectFBDisplayLayer_Dispatcher_SetCursorAcceleration; thiz->EnableCursor = IDirectFBDisplayLayer_Dispatcher_EnableCursor; thiz->GetCursorPosition = IDirectFBDisplayLayer_Dispatcher_GetCursorPosition; thiz->SetCursorShape = IDirectFBDisplayLayer_Dispatcher_SetCursorShape; thiz->SetCursorOpacity = IDirectFBDisplayLayer_Dispatcher_SetCursorOpacity; thiz->SetFieldParity = IDirectFBDisplayLayer_Dispatcher_SetFieldParity; thiz->WaitForSync = IDirectFBDisplayLayer_Dispatcher_WaitForSync; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbfont_dispatcher.c0000644000175000017500000004024511245562152020651 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include "idirectfbfont_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, Dispatcher ) /**************************************************************************************************/ /* * private data struct of IDirectFBFont_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBFont *real; } IDirectFBFont_Dispatcher_data; /**************************************************************************************************/ static void IDirectFBFont_Dispatcher_Destruct( IDirectFBFont *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBFont_Dispatcher_AddRef( IDirectFBFont *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBFont_Dispatcher_Release( IDirectFBFont *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (--data->ref == 0) IDirectFBFont_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBFont_Dispatcher_GetAscender( IDirectFBFont *thiz, int *ascender ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetDescender( IDirectFBFont *thiz, int *descender ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!descender) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetHeight( IDirectFBFont *thiz, int *height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!height) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetMaxAdvance( IDirectFBFont *thiz, int *maxadvance ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!maxadvance) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetKerning( IDirectFBFont *thiz, unsigned int prev_index, unsigned int current_index, int *kern_x, int *kern_y) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!kern_x && !kern_y) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetStringExtents( IDirectFBFont *thiz, const char *text, int bytes, DFBRectangle *logical_rect, DFBRectangle *ink_rect ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!text || (!logical_rect && !ink_rect)) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetStringWidth( IDirectFBFont *thiz, const char *text, int bytes, int *width ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!text || !width) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetGlyphExtents( IDirectFBFont *thiz, unsigned int index, DFBRectangle *rect, int *advance ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) if (!rect && !advance) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_GetStringBreak( IDirectFBFont *thiz, const char *text, int bytes, int max_width, int *ret_width, int *ret_str_length, const char **ret_next_line ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_SetEncoding( IDirectFBFont *thiz, DFBTextEncodingID encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_EnumEncodings( IDirectFBFont *thiz, DFBTextEncodingCallback callback, void *ctx ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBFont_Dispatcher_FindEncoding( IDirectFBFont *thiz, const char *name, DFBTextEncodingID *encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetAscender( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; int ascender; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) ret = real->GetAscender( real, &ascender ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, ascender, VMBT_NONE ); } static DirectResult Dispatch_GetDescender( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; int descender; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) ret = real->GetDescender( real, &descender ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, descender, VMBT_NONE ); } static DirectResult Dispatch_GetHeight( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; int height; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) ret = real->GetHeight( real, &height ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, height, VMBT_NONE ); } static DirectResult Dispatch_GetMaxAdvance( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; int max_advance; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) ret = real->GetMaxAdvance( real, &max_advance ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, max_advance, VMBT_NONE ); } static DirectResult Dispatch_GetKerning( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int prev; unsigned int next; int kern_x; int kern_y; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, prev ); VOODOO_PARSER_GET_UINT( parser, next ); VOODOO_PARSER_END( parser ); ret = real->GetKerning( real, prev, next, &kern_x, &kern_y ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, kern_x, VMBT_INT, kern_y, VMBT_NONE ); } static DirectResult Dispatch_GetStringWidth( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; const char *text; int bytes; int width; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, text ); VOODOO_PARSER_GET_INT( parser, bytes ); VOODOO_PARSER_END( parser ); ret = real->GetStringWidth( real, text, bytes, &width ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, width, VMBT_NONE ); } static DirectResult Dispatch_GetStringExtents( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; const char *text; int bytes; DFBRectangle logical; DFBRectangle ink; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, text ); VOODOO_PARSER_GET_INT( parser, bytes ); VOODOO_PARSER_END( parser ); ret = real->GetStringExtents( real, text, bytes, &logical, &ink ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBRectangle), &logical, VMBT_DATA, sizeof(DFBRectangle), &ink, VMBT_NONE ); } static DirectResult Dispatch_GetGlyphExtents( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int index; DFBRectangle extents; int advance; DIRECT_INTERFACE_GET_DATA(IDirectFBFont_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, index ); VOODOO_PARSER_END( parser ); ret = real->GetGlyphExtents( real, index, &extents, &advance ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(extents), &extents, VMBT_INT, advance, VMBT_NONE ); } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBFont/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBFONT_METHOD_ID_GetAscender: return Dispatch_GetAscender( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetDescender: return Dispatch_GetDescender( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetHeight: return Dispatch_GetHeight( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetMaxAdvance: return Dispatch_GetMaxAdvance( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetKerning: return Dispatch_GetKerning( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetStringWidth: return Dispatch_GetStringWidth( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetStringExtents: return Dispatch_GetStringExtents( dispatcher, real, manager, msg ); case IDIRECTFBFONT_METHOD_ID_GetGlyphExtents: return Dispatch_GetGlyphExtents( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBFont *thiz, IDirectFBFont *real, VoodooManager *manager, VoodooInstanceID super, void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBFont_Dispatcher) ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, ret_instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } data->ref = 1; data->real = real; thiz->AddRef = IDirectFBFont_Dispatcher_AddRef; thiz->Release = IDirectFBFont_Dispatcher_Release; thiz->GetAscender = IDirectFBFont_Dispatcher_GetAscender; thiz->GetDescender = IDirectFBFont_Dispatcher_GetDescender; thiz->GetHeight = IDirectFBFont_Dispatcher_GetHeight; thiz->GetMaxAdvance = IDirectFBFont_Dispatcher_GetMaxAdvance; thiz->GetKerning = IDirectFBFont_Dispatcher_GetKerning; thiz->GetStringWidth = IDirectFBFont_Dispatcher_GetStringWidth; thiz->GetStringExtents = IDirectFBFont_Dispatcher_GetStringExtents; thiz->GetGlyphExtents = IDirectFBFont_Dispatcher_GetGlyphExtents; thiz->GetStringBreak = IDirectFBFont_Dispatcher_GetStringBreak; thiz->SetEncoding = IDirectFBFont_Dispatcher_SetEncoding; thiz->EnumEncodings = IDirectFBFont_Dispatcher_EnumEncodings; thiz->FindEncoding = IDirectFBFont_Dispatcher_FindEncoding; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbdatabuffer_dispatcher.h0000644000175000017500000000424311245562152022011 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBDATABUFFER_DISPATCHER_H__ #define __IDIRECTFBDATABUFFER_DISPATCHER_H__ #define IDIRECTFBDATABUFFER_METHOD_ID_AddRef 1 #define IDIRECTFBDATABUFFER_METHOD_ID_Release 2 #define IDIRECTFBDATABUFFER_METHOD_ID_Flush 3 #define IDIRECTFBDATABUFFER_METHOD_ID_Finish 4 #define IDIRECTFBDATABUFFER_METHOD_ID_SeekTo 5 #define IDIRECTFBDATABUFFER_METHOD_ID_GetPosition 6 #define IDIRECTFBDATABUFFER_METHOD_ID_GetLength 7 #define IDIRECTFBDATABUFFER_METHOD_ID_WaitForData 8 #define IDIRECTFBDATABUFFER_METHOD_ID_WaitForDataWithTimeout 9 #define IDIRECTFBDATABUFFER_METHOD_ID_GetData 10 #define IDIRECTFBDATABUFFER_METHOD_ID_PeekData 11 #define IDIRECTFBDATABUFFER_METHOD_ID_HasData 12 #define IDIRECTFBDATABUFFER_METHOD_ID_PutData 13 #define IDIRECTFBDATABUFFER_METHOD_ID_CreateImageProvider 14 #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbwindow_dispatcher.h0000644000175000017500000000773111245562152021222 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBWINDOW_DISPATCHER_H__ #define __IDIRECTFBWINDOW_DISPATCHER_H__ #define IDIRECTFBWINDOW_METHOD_ID_AddRef 1 #define IDIRECTFBWINDOW_METHOD_ID_Release 2 #define IDIRECTFBWINDOW_METHOD_ID_CreateEventBuffer 3 #define IDIRECTFBWINDOW_METHOD_ID_AttachEventBuffer 4 #define IDIRECTFBWINDOW_METHOD_ID_EnableEvents 5 #define IDIRECTFBWINDOW_METHOD_ID_DisableEvents 6 #define IDIRECTFBWINDOW_METHOD_ID_GetID 7 #define IDIRECTFBWINDOW_METHOD_ID_GetPosition 8 #define IDIRECTFBWINDOW_METHOD_ID_GetSize 9 #define IDIRECTFBWINDOW_METHOD_ID_GetSurface 10 #define IDIRECTFBWINDOW_METHOD_ID_SetOptions 11 #define IDIRECTFBWINDOW_METHOD_ID_GetOptions 12 #define IDIRECTFBWINDOW_METHOD_ID_SetColorKey 13 #define IDIRECTFBWINDOW_METHOD_ID_SetColorKeyIndex 14 #define IDIRECTFBWINDOW_METHOD_ID_SetOpaqueRegion 15 #define IDIRECTFBWINDOW_METHOD_ID_SetOpacity 16 #define IDIRECTFBWINDOW_METHOD_ID_GetOpacity 17 #define IDIRECTFBWINDOW_METHOD_ID_SetCursorShape 18 #define IDIRECTFBWINDOW_METHOD_ID_RequestFocus 19 #define IDIRECTFBWINDOW_METHOD_ID_GrabKeyboard 20 #define IDIRECTFBWINDOW_METHOD_ID_UngrabKeyboard 21 #define IDIRECTFBWINDOW_METHOD_ID_GrabPointer 22 #define IDIRECTFBWINDOW_METHOD_ID_UngrabPointer 23 #define IDIRECTFBWINDOW_METHOD_ID_GrabKey 24 #define IDIRECTFBWINDOW_METHOD_ID_UngrabKey 25 #define IDIRECTFBWINDOW_METHOD_ID_Move 26 #define IDIRECTFBWINDOW_METHOD_ID_MoveTo 27 #define IDIRECTFBWINDOW_METHOD_ID_Resize 28 #define IDIRECTFBWINDOW_METHOD_ID_SetStackingClass 29 #define IDIRECTFBWINDOW_METHOD_ID_Raise 30 #define IDIRECTFBWINDOW_METHOD_ID_Lower 31 #define IDIRECTFBWINDOW_METHOD_ID_RaiseToTop 32 #define IDIRECTFBWINDOW_METHOD_ID_LowerToBottom 33 #define IDIRECTFBWINDOW_METHOD_ID_PutAtop 34 #define IDIRECTFBWINDOW_METHOD_ID_PutBelow 35 #define IDIRECTFBWINDOW_METHOD_ID_Close 36 #define IDIRECTFBWINDOW_METHOD_ID_Destroy 37 #define IDIRECTFBWINDOW_METHOD_ID_DetachEventBuffer 38 #define IDIRECTFBWINDOW_METHOD_ID_SetBounds 39 #define IDIRECTFBWINDOW_METHOD_ID_ResizeSurface 40 /* * private data struct of IDirectFBWindow_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBWindow *real; VoodooInstanceID self; VoodooInstanceID super; } IDirectFBWindow_Dispatcher_data; #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbdisplaylayer_dispatcher.h0000644000175000017500000000730111245562152022406 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBDISPLAYLAYER_DISPATCHER_H__ #define __IDIRECTFBDISPLAYLAYER_DISPATCHER_H__ #define IDIRECTFBDISPLAYLAYER_METHOD_ID_AddRef 1 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_Release 2 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetID 3 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetDescription 4 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetSurface 5 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetScreen 6 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetCooperativeLevel 7 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetOpacity 8 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetCurrentOutputField 9 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetScreenLocation 10 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetSrcColorKey 11 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetDstColorKey 12 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetLevel 13 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetLevel 14 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetConfiguration 15 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_TestConfiguration 16 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetConfiguration 17 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetBackgroundMode 18 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetBackgroundColor 19 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetBackgroundImage 20 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetColorAdjustment 21 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetColorAdjustment 22 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_CreateWindow 23 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetWindow 24 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_WarpCursor 25 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetCursorAcceleration 26 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_EnableCursor 27 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_GetCursorPosition 28 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetCursorShape 29 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetCursorOpacity 30 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_SetFieldParity 31 #define IDIRECTFBDISPLAYLAYER_METHOD_ID_WaitForSync 32 /* * private data struct of IDirectFBDisplayLayer_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBDisplayLayer *real; VoodooInstanceID self; VoodooInstanceID super; } IDirectFBDisplayLayer_Dispatcher_data; #endif DirectFB-1.2.10/proxy/dispatcher/idirectfbeventbuffer_dispatcher.c0000644000175000017500000002027411245562152022216 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbeventbuffer_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBEventBuffer *thiz, IDirectFBEventBuffer *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBEventBuffer, Dispatcher ) /**************************************************************************************************/ static void IDirectFBEventBuffer_Dispatcher_Destruct( IDirectFBEventBuffer *thiz ) { IDirectFBEventBuffer_Dispatcher_data *data = thiz->priv; D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); data->real->Release( data->real ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBEventBuffer_Dispatcher_AddRef( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBEventBuffer_Dispatcher_Release( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) if (--data->ref == 0) IDirectFBEventBuffer_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBEventBuffer_Dispatcher_Reset( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->Reset( data->real ); } static DFBResult IDirectFBEventBuffer_Dispatcher_WaitForEvent( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->WaitForEvent( data->real ); } static DFBResult IDirectFBEventBuffer_Dispatcher_WaitForEventWithTimeout( IDirectFBEventBuffer *thiz, unsigned int seconds, unsigned int milli_seconds ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->WaitForEventWithTimeout( data->real, seconds, milli_seconds ); } static DFBResult IDirectFBEventBuffer_Dispatcher_WakeUp( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->WakeUp( data->real ); } static DFBResult IDirectFBEventBuffer_Dispatcher_GetEvent( IDirectFBEventBuffer *thiz, DFBEvent *event ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->GetEvent( data->real, event ); } static DFBResult IDirectFBEventBuffer_Dispatcher_PeekEvent( IDirectFBEventBuffer *thiz, DFBEvent *event ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->PeekEvent( data->real, event ); } static DFBResult IDirectFBEventBuffer_Dispatcher_HasEvent( IDirectFBEventBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->HasEvent( data->real ); } static DFBResult IDirectFBEventBuffer_Dispatcher_PostEvent( IDirectFBEventBuffer *thiz, const DFBEvent *event ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->PostEvent( data->real, event ); } static DFBResult IDirectFBEventBuffer_Dispatcher_CreateFileDescriptor( IDirectFBEventBuffer *thiz, int *fd ) { DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) return data->real->CreateFileDescriptor( data->real, fd ); } /**************************************************************************************************/ static DirectResult Dispatch_PostEvent( IDirectFBEventBuffer *thiz, IDirectFBEventBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { const DFBEvent *event; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFBEventBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, event ); VOODOO_PARSER_END( parser ); real->PostEvent( real, event ); return DFB_OK; } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBEventBuffer/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBEVENTBUFFER_METHOD_ID_PostEvent: return Dispatch_PostEvent( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBEventBuffer *thiz, IDirectFBEventBuffer *real, VoodooManager *manager, VoodooInstanceID super, void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; VoodooInstanceID instance; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBEventBuffer_Dispatcher) ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, &instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } *ret_instance = instance; data->real = real; data->self = instance; data->super = super; data->manager = manager; thiz->AddRef = IDirectFBEventBuffer_Dispatcher_AddRef; thiz->Release = IDirectFBEventBuffer_Dispatcher_Release; thiz->Reset = IDirectFBEventBuffer_Dispatcher_Reset; thiz->WaitForEvent = IDirectFBEventBuffer_Dispatcher_WaitForEvent; thiz->WaitForEventWithTimeout = IDirectFBEventBuffer_Dispatcher_WaitForEventWithTimeout; thiz->GetEvent = IDirectFBEventBuffer_Dispatcher_GetEvent; thiz->PeekEvent = IDirectFBEventBuffer_Dispatcher_PeekEvent; thiz->HasEvent = IDirectFBEventBuffer_Dispatcher_HasEvent; thiz->PostEvent = IDirectFBEventBuffer_Dispatcher_PostEvent; thiz->WakeUp = IDirectFBEventBuffer_Dispatcher_WakeUp; thiz->CreateFileDescriptor = IDirectFBEventBuffer_Dispatcher_CreateFileDescriptor; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbinputdevice_dispatcher.h0000644000175000017500000000502511245562152022224 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBINPUTDEVICE_DISPATCHER_H__ #define __IDIRECTFBINPUTDEVICE_DISPATCHER_H__ #define IDIRECTFBINPUTDEVICE_METHOD_ID_AddRef 1 #define IDIRECTFBINPUTDEVICE_METHOD_ID_Release 2 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetID 3 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetDescription 4 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetKeymapEntry 5 #define IDIRECTFBINPUTDEVICE_METHOD_ID_CreateEventBuffer 6 #define IDIRECTFBINPUTDEVICE_METHOD_ID_AttachEventBuffer 7 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetKeyState 8 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetModifiers 9 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetLockState 10 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetButtons 11 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetButtonState 12 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetAxis 13 #define IDIRECTFBINPUTDEVICE_METHOD_ID_GetXY 14 #define IDIRECTFBINPUTDEVICE_METHOD_ID_DetachEventBuffer 15 /* * private data struct of IDirectFBInputDevice_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFBInputDevice *real; VoodooInstanceID self; VoodooInstanceID super; } IDirectFBInputDevice_Dispatcher_data; #endif DirectFB-1.2.10/proxy/dispatcher/idirectfb_dispatcher.c0000644000175000017500000010453211245562152017762 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfb_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFB *thiz, VoodooManager *manager, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFB, Dispatcher ) /**************************************************************************************************/ typedef struct { DirectLink link; VoodooInstanceID instance; IDirectFBDataBuffer *requestor; } DataBufferEntry; /* * private data struct of IDirectFB_Dispatcher */ typedef struct { int ref; /* reference counter */ IDirectFB *real; VoodooInstanceID self; /* The instance of this dispatcher itself. */ DirectLink *data_buffers; /* list of known data buffers */ } IDirectFB_Dispatcher_data; /**************************************************************************************************/ static void IDirectFB_Dispatcher_Destruct( IDirectFB *thiz ) { DirectLink *l, *n; IDirectFB_Dispatcher_data *data = thiz->priv; D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); direct_list_foreach_safe (l, n, data->data_buffers) { DataBufferEntry *entry = (DataBufferEntry*) l; entry->requestor->Release( entry->requestor ); D_FREE( entry ); } DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFB_Dispatcher_AddRef( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFB_Dispatcher_Release( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (--data->ref == 0) IDirectFB_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFB_Dispatcher_SetCooperativeLevel( IDirectFB *thiz, DFBCooperativeLevel level ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetDeviceDescription( IDirectFB *thiz, DFBGraphicsDeviceDescription *ret_desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!ret_desc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_EnumVideoModes( IDirectFB *thiz, DFBVideoModeCallback callbackfunc, void *callbackdata ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!callbackfunc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_SetVideoMode( IDirectFB *thiz, int width, int height, int bpp ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateSurface( IDirectFB *thiz, const DFBSurfaceDescription *desc, IDirectFBSurface **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!desc || !interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreatePalette( IDirectFB *thiz, const DFBPaletteDescription *desc, IDirectFBPalette **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_EnumScreens( IDirectFB *thiz, DFBScreenCallback callbackfunc, void *callbackdata ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!callbackfunc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetScreen( IDirectFB *thiz, DFBScreenID id, IDirectFBScreen **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_EnumDisplayLayers( IDirectFB *thiz, DFBDisplayLayerCallback callbackfunc, void *callbackdata ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!callbackfunc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetDisplayLayer( IDirectFB *thiz, DFBDisplayLayerID id, IDirectFBDisplayLayer **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_EnumInputDevices( IDirectFB *thiz, DFBInputDeviceCallback callbackfunc, void *callbackdata ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!callbackfunc) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetInputDevice( IDirectFB *thiz, DFBInputDeviceID id, IDirectFBInputDevice **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateEventBuffer( IDirectFB *thiz, IDirectFBEventBuffer **interface) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateInputEventBuffer( IDirectFB *thiz, DFBInputDeviceCapabilities caps, DFBBoolean global, IDirectFBEventBuffer **interface) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateImageProvider( IDirectFB *thiz, const char *filename, IDirectFBImageProvider **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) /* Check arguments */ if (!filename || !interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateVideoProvider( IDirectFB *thiz, const char *filename, IDirectFBVideoProvider **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) /* Check arguments */ if (!interface || !filename) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateFont( IDirectFB *thiz, const char *filename, const DFBFontDescription *desc, IDirectFBFont **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) /* Check arguments */ if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_CreateDataBuffer( IDirectFB *thiz, const DFBDataBufferDescription *desc, IDirectFBDataBuffer **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_SetClipboardData( IDirectFB *thiz, const char *mime_type, const void *data, unsigned int size, struct timeval *timestamp ) { if (!mime_type || !data || !size) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetClipboardData( IDirectFB *thiz, char **mime_type, void **clip_data, unsigned int *size ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!mime_type && !clip_data && !size) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetClipboardTimeStamp( IDirectFB *thiz, struct timeval *timestamp ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) if (!timestamp) return DFB_INVARG; return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_Suspend( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_Resume( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_WaitIdle( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_WaitForSync( IDirectFB *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } static DFBResult IDirectFB_Dispatcher_GetInterface( IDirectFB *thiz, const char *type, const char *implementation, void *arg, void **interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_SetCooperativeLevel( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBCooperativeLevel level; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, level ); VOODOO_PARSER_END( parser ); ret = real->SetCooperativeLevel( real, level ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GetDeviceDescription( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBGraphicsDeviceDescription desc; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) ret = real->GetDeviceDescription( real, &desc ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(DFBGraphicsDeviceDescription), &desc, VMBT_NONE ); } static DirectResult Dispatch_SetVideoMode( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; int width; int height; int bpp; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, width ); VOODOO_PARSER_GET_INT( parser, height ); VOODOO_PARSER_GET_INT( parser, bpp ); VOODOO_PARSER_END( parser ); ret = real->SetVideoMode( real, width, height, bpp ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } #define MAX_MODES 128 typedef struct { int num; IDirectFB_Dispatcher_EnumVideoModes_Item items[MAX_MODES]; } EnumVideoModes_Context; static DFBEnumerationResult EnumVideoModes_Callback( int width, int height, int bpp, void *callbackdata ) { int index; EnumVideoModes_Context *context = callbackdata; if (context->num == MAX_MODES) { D_WARN( "maximum number of %d modes reached", MAX_MODES ); return DFENUM_CANCEL; } index = context->num++; context->items[index].width = width; context->items[index].height = height; context->items[index].bpp = bpp; return DFENUM_OK; } static DirectResult Dispatch_EnumVideoModes( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; EnumVideoModes_Context context = { 0 }; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) ret = real->EnumVideoModes( real, EnumVideoModes_Callback, &context ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, context.num, VMBT_DATA, context.num * sizeof(IDirectFB_Dispatcher_EnumVideoModes_Item), context.items, VMBT_NONE ); } static DirectResult Dispatch_CreateEventBuffer( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; VoodooInstanceID instance; VoodooMessageParser parser; void *requestor; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = real->CreateEventBuffer( real, &buffer ); if (ret) return ret; ret = voodoo_construct_requestor( manager, "IDirectFBEventBuffer", instance, buffer, &requestor ); if (ret) { buffer->Release( buffer ); return ret; } return DFB_OK; } static DirectResult Dispatch_CreateInputEventBuffer( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; VoodooInstanceID instance; DFBInputDeviceCapabilities caps; DFBBoolean global; VoodooMessageParser parser; void *requestor; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_GET_INT( parser, caps ); VOODOO_PARSER_GET_INT( parser, global ); VOODOO_PARSER_END( parser ); ret = real->CreateInputEventBuffer( real, caps, global, &buffer ); if (ret) return ret; ret = voodoo_construct_requestor( manager, "IDirectFBEventBuffer", instance, buffer, &requestor ); if (ret) { buffer->Release( buffer ); return ret; } return DFB_OK; } static DirectResult Dispatch_CreateImageProvider( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DirectLink *l; VoodooMessageParser parser; VoodooInstanceID instance; IDirectFBImageProvider *provider; IDirectFBDataBuffer *buffer = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); direct_list_foreach (l, data->data_buffers) { DataBufferEntry *entry = (DataBufferEntry*) l; if (entry->instance == instance) { buffer = entry->requestor; break; } } ret = buffer->CreateImageProvider( buffer, &provider ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBImageProvider", provider, data->self, NULL, &instance, NULL ); if (ret) { provider->Release( provider ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_CreateSurface( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; const DFBSurfaceDescription *desc; IDirectFBSurface *surface; VoodooInstanceID instance; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_DATA( parser, desc ); VOODOO_PARSER_END( parser ); ret = real->CreateSurface( real, desc, &surface ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBSurface", surface, data->self, NULL, &instance, NULL ); if (ret) { surface->Release( surface ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } typedef struct { int num; IDirectFB_Dispatcher_EnumScreens_Item items[MAX_SCREENS]; } EnumScreens_Context; static DFBEnumerationResult EnumScreens_Callback( DFBScreenID screen_id, DFBScreenDescription desc, void *callbackdata ) { int index; EnumScreens_Context *context = callbackdata; if (context->num == MAX_SCREENS) { D_WARN( "maximum number of %d screens reached", MAX_SCREENS ); return DFENUM_CANCEL; } index = context->num++; context->items[index].screen_id = screen_id; context->items[index].desc = desc; return DFENUM_OK; } static DirectResult Dispatch_EnumScreens( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; EnumScreens_Context context = { 0 }; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) ret = real->EnumScreens( real, EnumScreens_Callback, &context ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, context.num, VMBT_DATA, context.num * sizeof(IDirectFB_Dispatcher_EnumScreens_Item), context.items, VMBT_NONE ); } static DirectResult Dispatch_GetDisplayLayer( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBDisplayLayerID id; IDirectFBDisplayLayer *layer; VoodooInstanceID instance; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, id ); VOODOO_PARSER_END( parser ); ret = real->GetDisplayLayer( real, id, &layer ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBDisplayLayer", layer, data->self, NULL, &instance, NULL ); if (ret) { layer->Release( layer ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } #define MAX_INPUT_DEVICES 64 typedef struct { int num; IDirectFB_Dispatcher_EnumInputDevices_Item items[MAX_INPUT_DEVICES]; } EnumInputDevices_Context; static DFBEnumerationResult EnumInputDevices_Callback( DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata ) { int index; EnumInputDevices_Context *context = callbackdata; if (context->num == MAX_INPUT_DEVICES) { D_WARN( "maximum number of %d input devices reached", MAX_INPUT_DEVICES ); return DFENUM_CANCEL; } index = context->num++; context->items[index].device_id = device_id; context->items[index].desc = desc; return DFENUM_OK; } static DirectResult Dispatch_EnumInputDevices( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; EnumInputDevices_Context context = { 0 }; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) ret = real->EnumInputDevices( real, EnumInputDevices_Callback, &context ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_INT, context.num, VMBT_DATA, context.num * sizeof(IDirectFB_Dispatcher_EnumInputDevices_Item), context.items, VMBT_NONE ); } static DirectResult Dispatch_GetInputDevice( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBScreenID device_id; IDirectFBInputDevice *device; VoodooInstanceID instance; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, device_id ); VOODOO_PARSER_END( parser ); ret = real->GetInputDevice( real, device_id, &device ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBInputDevice", device, data->self, NULL, &instance, NULL ); if (ret) { device->Release( device ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_GetScreen( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBScreenID screen_id; IDirectFBScreen *screen; VoodooInstanceID instance; VoodooMessageParser parser; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, screen_id ); VOODOO_PARSER_END( parser ); ret = real->GetScreen( real, screen_id, &screen ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBScreen", screen, data->self, NULL, &instance, NULL ); if (ret) { screen->Release( screen ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_CreateFont( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBFont *font; VoodooInstanceID instance; VoodooMessageParser parser; const char *filename; const DFBFontDescription *desc; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_STRING( parser, filename ); VOODOO_PARSER_GET_DATA( parser, desc ); VOODOO_PARSER_END( parser ); ret = real->CreateFont( real, filename, desc, &font ); if (ret) return ret; ret = voodoo_construct_dispatcher( manager, "IDirectFBFont", font, data->self, NULL, &instance, NULL ); if (ret) { font->Release( font ); return ret; } return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, instance, VMBT_NONE ); } static DirectResult Dispatch_CreateDataBuffer( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBDataBuffer *requestor; VoodooMessageParser parser; VoodooInstanceID instance; DataBufferEntry *entry; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = voodoo_construct_requestor( manager, "IDirectFBDataBuffer", instance, NULL, &ptr ); if (ret) return ret; requestor = ptr; entry = D_CALLOC( 1, sizeof(DataBufferEntry) ); if (!entry) { D_WARN( "out of memory" ); requestor->Release( requestor ); return DFB_NOSYSTEMMEMORY; } entry->instance = instance; entry->requestor = requestor; direct_list_prepend( &data->data_buffers, &entry->link ); return DFB_OK; } static DirectResult Dispatch_WaitIdle( IDirectFB *thiz, IDirectFB *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFB_Dispatcher) ret = real->WaitIdle( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFB/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFB_METHOD_ID_SetCooperativeLevel: return Dispatch_SetCooperativeLevel( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_GetDeviceDescription: return Dispatch_GetDeviceDescription( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_SetVideoMode: return Dispatch_SetVideoMode( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_EnumVideoModes: return Dispatch_EnumVideoModes( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_CreateSurface: return Dispatch_CreateSurface( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_EnumScreens: return Dispatch_EnumScreens( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_GetScreen: return Dispatch_GetScreen( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_GetDisplayLayer: return Dispatch_GetDisplayLayer( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_EnumInputDevices: return Dispatch_EnumInputDevices( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_GetInputDevice: return Dispatch_GetInputDevice( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_CreateEventBuffer: return Dispatch_CreateEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_CreateInputEventBuffer: return Dispatch_CreateInputEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_CreateImageProvider: return Dispatch_CreateImageProvider( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_CreateFont: return Dispatch_CreateFont( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_CreateDataBuffer: return Dispatch_CreateDataBuffer( dispatcher, real, manager, msg ); case IDIRECTFB_METHOD_ID_WaitIdle: return Dispatch_WaitIdle( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } /* * Constructor * * Fills in function pointers and intializes data structure. */ static DFBResult Construct( IDirectFB *thiz, VoodooManager *manager, VoodooInstanceID *ret_instance ) { DFBResult ret; IDirectFB *real; VoodooInstanceID instance; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFB_Dispatcher) ret = DirectFBCreate( &real ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } ret = voodoo_manager_register_local( manager, true, thiz, real, Dispatch, &instance ); if (ret) { real->Release( real ); DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } *ret_instance = instance; data->ref = 1; data->real = real; data->self = instance; thiz->AddRef = IDirectFB_Dispatcher_AddRef; thiz->Release = IDirectFB_Dispatcher_Release; thiz->SetCooperativeLevel = IDirectFB_Dispatcher_SetCooperativeLevel; thiz->GetDeviceDescription = IDirectFB_Dispatcher_GetDeviceDescription; thiz->EnumVideoModes = IDirectFB_Dispatcher_EnumVideoModes; thiz->SetVideoMode = IDirectFB_Dispatcher_SetVideoMode; thiz->CreateSurface = IDirectFB_Dispatcher_CreateSurface; thiz->CreatePalette = IDirectFB_Dispatcher_CreatePalette; thiz->EnumScreens = IDirectFB_Dispatcher_EnumScreens; thiz->GetScreen = IDirectFB_Dispatcher_GetScreen; thiz->EnumDisplayLayers = IDirectFB_Dispatcher_EnumDisplayLayers; thiz->GetDisplayLayer = IDirectFB_Dispatcher_GetDisplayLayer; thiz->EnumInputDevices = IDirectFB_Dispatcher_EnumInputDevices; thiz->GetInputDevice = IDirectFB_Dispatcher_GetInputDevice; thiz->CreateEventBuffer = IDirectFB_Dispatcher_CreateEventBuffer; thiz->CreateInputEventBuffer = IDirectFB_Dispatcher_CreateInputEventBuffer; thiz->CreateImageProvider = IDirectFB_Dispatcher_CreateImageProvider; thiz->CreateVideoProvider = IDirectFB_Dispatcher_CreateVideoProvider; thiz->CreateFont = IDirectFB_Dispatcher_CreateFont; thiz->CreateDataBuffer = IDirectFB_Dispatcher_CreateDataBuffer; thiz->SetClipboardData = IDirectFB_Dispatcher_SetClipboardData; thiz->GetClipboardData = IDirectFB_Dispatcher_GetClipboardData; thiz->GetClipboardTimeStamp = IDirectFB_Dispatcher_GetClipboardTimeStamp; thiz->Suspend = IDirectFB_Dispatcher_Suspend; thiz->Resume = IDirectFB_Dispatcher_Resume; thiz->WaitIdle = IDirectFB_Dispatcher_WaitIdle; thiz->WaitForSync = IDirectFB_Dispatcher_WaitForSync; thiz->GetInterface = IDirectFB_Dispatcher_GetInterface; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbdatabuffer_dispatcher.c0000644000175000017500000005142511245562152022010 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "idirectfb_dispatcher.h" #include "idirectfbdatabuffer_dispatcher.h" static DFBResult Probe(); static DFBResult Construct( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBDataBuffer, Dispatcher ) /**************************************************************************************************/ /* * private data struct of IDirectFBDataBuffer_Dispatcher */ typedef struct { IDirectFBDataBuffer_data base; IDirectFBDataBuffer *real; VoodooInstanceID self; /* The instance of this dispatcher itself. */ VoodooInstanceID super; /* The instance of the super interface. */ VoodooManager *manager; } IDirectFBDataBuffer_Dispatcher_data; /**************************************************************************************************/ static void IDirectFBDataBuffer_Dispatcher_Destruct( IDirectFBDataBuffer *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); IDirectFBDataBuffer_Destruct( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBDataBuffer_Dispatcher_AddRef( IDirectFBDataBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) data->base.ref++; return DFB_OK; } static DFBResult IDirectFBDataBuffer_Dispatcher_Release( IDirectFBDataBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) if (--data->base.ref == 0) IDirectFBDataBuffer_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBDataBuffer_Dispatcher_Flush( IDirectFBDataBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->Flush( data->real ); } static DFBResult IDirectFBDataBuffer_Dispatcher_Finish( IDirectFBDataBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->Finish( data->real ); } static DFBResult IDirectFBDataBuffer_Dispatcher_SeekTo( IDirectFBDataBuffer *thiz, unsigned int offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->SeekTo( data->real, offset ); } static DFBResult IDirectFBDataBuffer_Dispatcher_GetPosition( IDirectFBDataBuffer *thiz, unsigned int *offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->GetPosition( data->real, offset ); } static DFBResult IDirectFBDataBuffer_Dispatcher_GetLength( IDirectFBDataBuffer *thiz, unsigned int *length ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->GetLength( data->real, length ); } static DFBResult IDirectFBDataBuffer_Dispatcher_WaitForData( IDirectFBDataBuffer *thiz, unsigned int length ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->WaitForData( data->real, length ); } static DFBResult IDirectFBDataBuffer_Dispatcher_WaitForDataWithTimeout( IDirectFBDataBuffer *thiz, unsigned int length, unsigned int seconds, unsigned int milli_seconds ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->WaitForDataWithTimeout( data->real, length, seconds, milli_seconds ); } static DFBResult IDirectFBDataBuffer_Dispatcher_GetData( IDirectFBDataBuffer *thiz, unsigned int length, void *dest, unsigned int *read ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->GetData( data->real, length, dest, read ); } static DFBResult IDirectFBDataBuffer_Dispatcher_PeekData( IDirectFBDataBuffer *thiz, unsigned int length, int offset, void *dest, unsigned int *read ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->PeekData( data->real, length, offset, dest, read ); } static DFBResult IDirectFBDataBuffer_Dispatcher_HasData( IDirectFBDataBuffer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->HasData( data->real ); } static DFBResult IDirectFBDataBuffer_Dispatcher_PutData( IDirectFBDataBuffer *thiz, const void *source, unsigned int length ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) return data->real->PutData( data->real, source, length ); } static DFBResult IDirectFBDataBuffer_Dispatcher_CreateImageProvider( IDirectFBDataBuffer *thiz, IDirectFBImageProvider **ret_interface ) { DirectResult ret; VoodooResponseMessage *response; void *interface = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) if (!ret_interface) return DFB_INVARG; ret = voodoo_manager_request( data->manager, data->super, IDIRECTFB_METHOD_ID_CreateImageProvider, VREQ_RESPOND | VREQ_ASYNC, &response, VMBT_ID, data->self, VMBT_NONE ); if (ret) return ret; ret = response->result; if (ret == DFB_OK) ret = voodoo_construct_requestor( data->manager, "IDirectFBImageProvider", response->instance, NULL, &interface ); voodoo_manager_finish_request( data->manager, response ); *ret_interface = interface; return ret; } static DFBResult IDirectFBDataBuffer_Dispatcher_CreateVideoProvider( IDirectFBDataBuffer *thiz, IDirectFBVideoProvider **ret_interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) if (!ret_interface) return DFB_INVARG; return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_AddRef( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) ret = thiz->AddRef( thiz ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_Release( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) thiz->Release( thiz ); return DFB_OK; } static DirectResult Dispatch_Flush( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) ret = real->Flush( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_Finish( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) ret = real->Finish( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_SeekTo( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int offset; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, offset ); VOODOO_PARSER_END( parser ); ret = real->SeekTo( real, offset ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GetPosition( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; unsigned int offset; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) ret = real->GetPosition( real, &offset ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_UINT, offset, VMBT_NONE ); } static DirectResult Dispatch_GetLength( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; unsigned int length; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) ret = real->GetLength( real, &length ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_UINT, length, VMBT_NONE ); } static DirectResult Dispatch_WaitForData( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int length; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, length ); VOODOO_PARSER_END( parser ); ret = real->WaitForData( real, length ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_WaitForDataWithTimeout( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int length; unsigned int seconds; unsigned int milli_seconds; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, length ); VOODOO_PARSER_GET_UINT( parser, seconds ); VOODOO_PARSER_GET_UINT( parser, milli_seconds ); VOODOO_PARSER_END( parser ); ret = real->WaitForDataWithTimeout( real, length, seconds, milli_seconds ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GetData( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int length; unsigned int read; void *tmp; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, length ); VOODOO_PARSER_END( parser ); if (length > 16384) length = 16384; tmp = alloca( length ); ret = real->GetData( real, length, tmp, &read ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_UINT, read, VMBT_DATA, read, tmp, VMBT_NONE ); } static DirectResult Dispatch_PeekData( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int length; int offset; unsigned int read; void *tmp; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, length ); VOODOO_PARSER_GET_INT( parser, offset ); VOODOO_PARSER_END( parser ); if (length > 16384) length = 16384; tmp = alloca( length ); ret = real->PeekData( real, length, offset, tmp, &read ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_UINT, read, VMBT_DATA, read, tmp, VMBT_NONE ); } static DirectResult Dispatch_HasData( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) ret = real->HasData( real ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_PutData( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; unsigned int length; const void *source; DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_UINT( parser, length ); VOODOO_PARSER_GET_DATA( parser, source ); VOODOO_PARSER_END( parser ); ret = real->PutData( real, source, length ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBDataBuffer/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBDATABUFFER_METHOD_ID_AddRef: return Dispatch_AddRef( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_Release: return Dispatch_Release( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_Flush: return Dispatch_Flush( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_Finish: return Dispatch_Finish( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_SeekTo: return Dispatch_SeekTo( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_GetPosition: return Dispatch_GetPosition( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_GetLength: return Dispatch_GetLength( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_WaitForData: return Dispatch_WaitForData( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_WaitForDataWithTimeout: return Dispatch_WaitForDataWithTimeout( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_GetData: return Dispatch_GetData( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_PeekData: return Dispatch_PeekData( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_HasData: return Dispatch_HasData( dispatcher, real, manager, msg ); case IDIRECTFBDATABUFFER_METHOD_ID_PutData: return Dispatch_PutData( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ) { DFBResult ret; VoodooInstanceID instance; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBDataBuffer_Dispatcher) ret = IDirectFBDataBuffer_Construct( thiz, NULL, NULL ); if (ret) return ret; ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, &instance ); if (ret) { IDirectFBDataBuffer_Destruct( thiz ); return ret; } *ret_instance = instance; data->real = real; data->self = instance; data->super = super; data->manager = manager; thiz->AddRef = IDirectFBDataBuffer_Dispatcher_AddRef; thiz->Release = IDirectFBDataBuffer_Dispatcher_Release; thiz->Flush = IDirectFBDataBuffer_Dispatcher_Flush; thiz->Finish = IDirectFBDataBuffer_Dispatcher_Finish; thiz->SeekTo = IDirectFBDataBuffer_Dispatcher_SeekTo; thiz->GetPosition = IDirectFBDataBuffer_Dispatcher_GetPosition; thiz->GetLength = IDirectFBDataBuffer_Dispatcher_GetLength; thiz->WaitForData = IDirectFBDataBuffer_Dispatcher_WaitForData; thiz->WaitForDataWithTimeout = IDirectFBDataBuffer_Dispatcher_WaitForDataWithTimeout; thiz->GetData = IDirectFBDataBuffer_Dispatcher_GetData; thiz->PeekData = IDirectFBDataBuffer_Dispatcher_PeekData; thiz->HasData = IDirectFBDataBuffer_Dispatcher_HasData; thiz->PutData = IDirectFBDataBuffer_Dispatcher_PutData; thiz->CreateImageProvider = IDirectFBDataBuffer_Dispatcher_CreateImageProvider; thiz->CreateVideoProvider = IDirectFBDataBuffer_Dispatcher_CreateVideoProvider; return DFB_OK; } DirectFB-1.2.10/proxy/dispatcher/idirectfbinputdevice_dispatcher.c0000644000175000017500000004737511245562152022235 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include "idirectfbinputdevice_dispatcher.h" #include static DFBResult Probe(); static DFBResult Construct( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooInstanceID super, void *arg, VoodooInstanceID *ret_instance ); #include DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBInputDevice, Dispatcher ) /**************************************************************************************************/ static void IDirectFBInputDevice_Dispatcher_Destruct( IDirectFBInputDevice *thiz ) { D_DEBUG( "%s (%p)\n", __FUNCTION__, thiz ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } /**************************************************************************************************/ static DFBResult IDirectFBInputDevice_Dispatcher_AddRef( IDirectFBInputDevice *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) data->ref++; return DFB_OK; } static DFBResult IDirectFBInputDevice_Dispatcher_Release( IDirectFBInputDevice *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (--data->ref == 0) IDirectFBInputDevice_Dispatcher_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBInputDevice_Dispatcher_GetID( IDirectFBInputDevice *thiz, DFBInputDeviceID *ret_id ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_id) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_CreateEventBuffer( IDirectFBInputDevice *thiz, IDirectFBEventBuffer **ret_interface ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_AttachEventBuffer( IDirectFBInputDevice *thiz, IDirectFBEventBuffer *buffer ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_DetachEventBuffer( IDirectFBInputDevice *thiz, IDirectFBEventBuffer *buffer ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetDescription( IDirectFBInputDevice *thiz, DFBInputDeviceDescription *ret_desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_desc) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetKeymapEntry( IDirectFBInputDevice *thiz, int keycode, DFBInputDeviceKeymapEntry *ret_entry ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_entry) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetKeyState( IDirectFBInputDevice *thiz, DFBInputDeviceKeyIdentifier key_id, DFBInputDeviceKeyState *ret_state ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_state) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetModifiers( IDirectFBInputDevice *thiz, DFBInputDeviceModifierMask *ret_modifiers ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_modifiers) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetLockState( IDirectFBInputDevice *thiz, DFBInputDeviceLockState *ret_locks ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_locks) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetButtons( IDirectFBInputDevice *thiz, DFBInputDeviceButtonMask *ret_buttons ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_buttons) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetButtonState( IDirectFBInputDevice *thiz, DFBInputDeviceButtonIdentifier button, DFBInputDeviceButtonState *ret_state ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_state || (int)button < DIBI_FIRST || button > DIBI_LAST) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetAxis( IDirectFBInputDevice *thiz, DFBInputDeviceAxisIdentifier axis, int *ret_pos ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_pos || (int)axis < DIAI_FIRST || axis > DIAI_LAST) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DFBResult IDirectFBInputDevice_Dispatcher_GetXY( IDirectFBInputDevice *thiz, int *ret_x, int *ret_y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) if (!ret_x && !ret_y) return DFB_INVARG; D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } /**************************************************************************************************/ static DirectResult Dispatch_GetID( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBInputDeviceID id; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) ret = real->GetID( real, &id ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_ID, id, VMBT_NONE ); } static DirectResult Dispatch_GetDescription( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; DFBInputDeviceDescription desc; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) ret = real->GetDescription( real, &desc ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(desc), &desc, VMBT_NONE ); } static DirectResult Dispatch_GetKeymapEntry( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; VoodooMessageParser parser; int keycode; DFBInputDeviceKeymapEntry entry; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_INT( parser, keycode ); VOODOO_PARSER_END( parser ); ret = real->GetKeymapEntry( real, keycode, &entry ); if (ret) return ret; return voodoo_manager_respond( manager, msg->header.serial, DFB_OK, VOODOO_INSTANCE_NONE, VMBT_DATA, sizeof(entry), &entry, VMBT_NONE ); } static DirectResult Dispatch_CreateEventBuffer( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; VoodooInstanceID instance; VoodooMessageParser parser; void *requestor; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = real->CreateEventBuffer( real, &buffer ); if (ret) return ret; ret = voodoo_construct_requestor( manager, "IDirectFBEventBuffer", instance, buffer, &requestor ); if (ret) buffer->Release( buffer ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_AttachEventBuffer( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer_Requestor_data *buffer_data; VoodooInstanceID instance; VoodooMessageParser parser; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_remote( manager, instance, &ptr ); if (ret) return ret; buffer = ptr; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Requestor ); ret = real->AttachEventBuffer( real, buffer_data->src ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_DetachEventBuffer( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DirectResult ret; IDirectFBEventBuffer *buffer; IDirectFBEventBuffer_Requestor_data *buffer_data; VoodooInstanceID instance; VoodooMessageParser parser; void *ptr; DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) VOODOO_PARSER_BEGIN( parser, msg ); VOODOO_PARSER_GET_ID( parser, instance ); VOODOO_PARSER_END( parser ); ret = voodoo_manager_lookup_remote( manager, instance, &ptr ); if (ret) return ret; buffer = ptr; DIRECT_INTERFACE_GET_DATA_FROM( buffer, buffer_data, IDirectFBEventBuffer_Requestor ); ret = real->DetachEventBuffer( real, buffer_data->src ); return voodoo_manager_respond( manager, msg->header.serial, ret, VOODOO_INSTANCE_NONE, VMBT_NONE ); } static DirectResult Dispatch_GetKeyState( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch_GetModifiers( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch_GetLockState( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch_GetButtons( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch_GetButtonState( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch_GetAxis( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch_GetXY( IDirectFBInputDevice *thiz, IDirectFBInputDevice *real, VoodooManager *manager, VoodooRequestMessage *msg ) { DIRECT_INTERFACE_GET_DATA(IDirectFBInputDevice_Dispatcher) D_UNIMPLEMENTED(); return DFB_UNIMPLEMENTED; } static DirectResult Dispatch( void *dispatcher, void *real, VoodooManager *manager, VoodooRequestMessage *msg ) { D_DEBUG( "IDirectFBInputDevice/Dispatcher: " "Handling request for instance %u with method %u...\n", msg->instance, msg->method ); switch (msg->method) { case IDIRECTFBINPUTDEVICE_METHOD_ID_GetID: return Dispatch_GetID( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetDescription: return Dispatch_GetDescription( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetKeymapEntry: return Dispatch_GetKeymapEntry( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_CreateEventBuffer: return Dispatch_CreateEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_AttachEventBuffer: return Dispatch_AttachEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_DetachEventBuffer: return Dispatch_DetachEventBuffer( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetKeyState: return Dispatch_GetKeyState( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetModifiers: return Dispatch_GetModifiers( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetLockState: return Dispatch_GetLockState( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetButtons: return Dispatch_GetButtons( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetButtonState: return Dispatch_GetButtonState( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetAxis: return Dispatch_GetAxis( dispatcher, real, manager, msg ); case IDIRECTFBINPUTDEVICE_METHOD_ID_GetXY: return Dispatch_GetXY( dispatcher, real, manager, msg ); } return DFB_NOSUCHMETHOD; } /**************************************************************************************************/ static DFBResult Probe() { /* This implementation has to be loaded explicitly. */ return DFB_UNSUPPORTED; } static DFBResult Construct( IDirectFBInputDevice *thiz, /* Dispatcher interface */ IDirectFBInputDevice *real, /* Real interface implementation */ VoodooManager *manager, /* Manager of the Voodoo framework */ VoodooInstanceID super, /* Instance ID of the super interface */ void *arg, /* Optional arguments to constructor */ VoodooInstanceID *ret_instance ) { DFBResult ret; VoodooInstanceID instance; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBInputDevice_Dispatcher) D_ASSERT( real != NULL ); D_ASSERT( manager != NULL ); D_ASSERT( super != VOODOO_INSTANCE_NONE ); D_ASSERT( ret_instance != NULL ); /* Register the dispatcher, getting a new instance ID that refers to it. */ ret = voodoo_manager_register_local( manager, false, thiz, real, Dispatch, &instance ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ); return ret; } /* Return the new instance. */ *ret_instance = instance; /* Initialize interface data. */ data->ref = 1; data->real = real; data->self = instance; data->super = super; /* Initialize interface methods. */ thiz->AddRef = IDirectFBInputDevice_Dispatcher_AddRef; thiz->Release = IDirectFBInputDevice_Dispatcher_Release; thiz->GetID = IDirectFBInputDevice_Dispatcher_GetID; thiz->GetDescription = IDirectFBInputDevice_Dispatcher_GetDescription; thiz->GetKeymapEntry = IDirectFBInputDevice_Dispatcher_GetKeymapEntry; thiz->CreateEventBuffer = IDirectFBInputDevice_Dispatcher_CreateEventBuffer; thiz->AttachEventBuffer = IDirectFBInputDevice_Dispatcher_AttachEventBuffer; thiz->DetachEventBuffer = IDirectFBInputDevice_Dispatcher_DetachEventBuffer; thiz->GetKeyState = IDirectFBInputDevice_Dispatcher_GetKeyState; thiz->GetModifiers = IDirectFBInputDevice_Dispatcher_GetModifiers; thiz->GetLockState = IDirectFBInputDevice_Dispatcher_GetLockState; thiz->GetButtons = IDirectFBInputDevice_Dispatcher_GetButtons; thiz->GetButtonState = IDirectFBInputDevice_Dispatcher_GetButtonState; thiz->GetAxis = IDirectFBInputDevice_Dispatcher_GetAxis; thiz->GetXY = IDirectFBInputDevice_Dispatcher_GetXY; return DFB_OK; } DirectFB-1.2.10/directfb-internal.pc.in0000644000175000017500000000047411164361026014470 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ moduledir=@MODULEDIR@ moduledirname=@MODULEDIRNAME@ includedir=@INTERNALINCLUDEDIR@ Name: DirectFB-Internal Description: Third party module support package for DirectFB. Version: @VERSION@ Requires: directfb = @VERSION@ Cflags: @DFB_INTERNAL_CFLAGS@ -I@INTERNALINCLUDEDIR@ DirectFB-1.2.10/directfb-config.in0000644000175000017500000001563211164361026013522 00000000000000#!/bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ exec_prefix_set=no moduledir=@MODULEDIR@ usage() { cat <[,]...] (default: none) [--graphics=[,]...] (default: none) [--system=[,]...] (default: 'fbdev') [--wm=[,]...] (default: 'default') [--font=[,]...] (default: none) [--imageprovider=[,]...] (default: none) [--videoprovider=[,]...] (default: none) [--fusionsound] [--voodoo] Example for static linking: directfb-config --libs --graphics=matrox,r200 --input=linux_input --font=ft2 --imageprovider=jpeg,png,gif EOF exit $1 } if test $# -eq 0; then usage 1 1>&2 fi lib_directfb=yes lib_avifile=no while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then exec_prefix=$optarg fi ;; --prefix) echo_prefix=yes ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo_exec_prefix=yes ;; --version) echo @DIRECTFB_MAJOR_VERSION@.@DIRECTFB_MINOR_VERSION@.@DIRECTFB_MICRO_VERSION@ ;; --cflags) echo_cflags=yes ;; --libs) echo_libs=yes ;; directfb) lib_directfb=yes ;; avifile) lib_avifile=yes ;; --input=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_input="$echo_input $moduledir/inputdrivers/libdirectfb_$i.o" done echo_static=yes ;; --graphics=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_graphics="$echo_graphics $moduledir/gfxdrivers/libdirectfb_$i.o" done echo_static=yes ;; --font=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_font="$echo_font $moduledir/interfaces/IDirectFBFont/libidirectfbfont_$i.o" case $i in ft2) echo_font="$echo_font -lfreetype" ;; esac done echo_static=yes ;; --system=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_system="$echo_system $moduledir/systems/libdirectfb_$i.o" case $i in fbdev) echo_system="$echo_system @SYSFS_LIBS@" ;; sdl) echo_system="$echo_system @SDL_LIBS@" ;; esac done echo_static=yes ;; --wm=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_wm="$echo_wm $moduledir/wm/libidirectfb_$i.o" case $i in unique) echo_wm="$echo_wm -luniquewm" ;; esac done echo_static=yes ;; --imageprovider=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_imageprovider="$echo_imageprovider $moduledir/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_$i.o" case $i in imlib2) echo_imageprovider="$echo_imageprovider -lImlib2 -lttf -lm -lXext -lX11" ;; jpeg) echo_imageprovider="$echo_imageprovider -ljpeg" ;; png) echo_imageprovider="$echo_imageprovider -lpng -lz -lm" ;; gif) ;; esac done echo_static=yes ;; --videoprovider=*) if test -z "$optarg"; then usage 2 1>&2 fi for i in `echo $optarg | sed 's/,/ /g'`; do echo_videoprovider="$echo_videoprovider $moduledir/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_$i.o" case $i in libmpeg3) echo_videoprovider="$echo_videoprovider -lmpeg3" ;; swf) echo_videoprovider="$echo_videoprovider -ljpeg -lz" ;; openquicktime) echo_videoprovider="$echo_videoprovider -lopenquicktime -lz -lglib -lm" ;; esac done echo_static=yes ;; --fusionsound) echo_fusionsound="-Wl,-uIFusionSound_default -lifusionsound" echo_static=yes ;; --voodoo) echo_voodoo=yes echo_static=yes ;; *) usage 1 1>&2 ;; esac shift done if test "$echo_prefix" = "yes"; then echo $prefix fi if test "$echo_exec_prefix" = "yes"; then echo $exec_prefix fi if test "$echo_cflags" = "yes"; then if test @INCLUDEDIR@ != /usr/include ; then cflags="-I${SYSROOT}@INCLUDEDIR@" fi echo $cflags @THREADFLAGS@ fi if test -n "$echo_static"; then echo -static if test -z "$echo_system"; then echo $moduledir/systems/libdirectfb_fbdev.o @SYSFS_LIBS@ fi if test -z "$echo_wm"; then echo $moduledir/wm/libdirectfbwm_default.o fi fi if test -n "$echo_font"; then echo $echo_font fi if test -n "$echo_imageprovider"; then echo $echo_imageprovider fi if test -n "$echo_videoprovider"; then echo $echo_videoprovider fi if test -n "$echo_input"; then echo $echo_input fi if test -n "$echo_graphics"; then echo $echo_graphics fi if test -n "$echo_system"; then echo $echo_system fi if test -n "$echo_wm"; then echo $echo_wm fi if test -n "$echo_fusionsound"; then echo -L${SYSROOT}$moduledir/interfaces/IFusionSound $echo_fusionsound fi print_voodoo () { echo $moduledir/interfaces/$1/lib$2_dispatcher.o $moduledir/interfaces/$1/lib$2_requestor.o } if test -n "$echo_voodoo"; then print_voodoo IDirectFB idirectfb print_voodoo IDirectFBDataBuffer idirectfbdatabuffer print_voodoo IDirectFBDisplayLayer idirectfbdisplaylayer print_voodoo IDirectFBEventBuffer idirectfbeventbuffer print_voodoo IDirectFBFont idirectfbfont print_voodoo IDirectFBImageProvider idirectfbimageprovider print_voodoo IDirectFBInputDevice idirectfbinputdevice print_voodoo IDirectFBPalette idirectfbpalette print_voodoo IDirectFBScreen idirectfbscreen print_voodoo IDirectFBSurface idirectfbsurface print_voodoo IDirectFBWindow idirectfbwindow echo -lvoodoo fi if test "$echo_libs" = "yes"; then libs=-L${SYSROOT}@libdir@ if test "$lib_directfb" = "yes"; then libs="$libs -ldirectfb -lfusion -ldirect @THREADLIB@" if test -n "$echo_static"; then libs="$libs @DYNLIB@ @ZLIB_LIBS@" fi fi if test "$lib_avifile" = "yes"; then libs="$libs @AVIFILE_LIBS@" fi echo $libs fi DirectFB-1.2.10/patches/0000777000175000017500000000000011307522571011654 500000000000000DirectFB-1.2.10/patches/matroxfb-g400-clock-2.4.22.patch.bz20000644000175000017500000000371311164361026017414 00000000000000BZh91AY&SYq@-T߀~0y`w6ݮ!SHzPihh2@@Lѐɐ240@DқHbj ?T26@2d@QE=LTO6SOC$& bz&14ɠ  #LdI!hɠLFI =MiѦ'JN3T*cbJXgl..Fw,Rhjȩ5GrKEa%PBK,@QBAKEUUK ;IlQJJu;#hJ"P:p]%*kQTaSLsm&41C=dH ;O۰ 's3E>|yrY] M֝]%aTo5R@yqhRBBP@1-QbNs ;]Lw44wIaz$י悽yg̀fHDQߍxw0cYc?PJ&&ܞR?F/cZNB#zهic΂QZ3moסiR~ NA-Q, S|,S@JAJ {JE v>G̶ KZH&"Q+6I 9)Jg>UD>}. HkL3^2 +PuMA&a(LNdA1о:6T0?2jIaUуūQ(Kuez:9-ڵWخ~Xk[ۓ:#V mn\ G'^~\ ǣ5}a;[*&I˦ڑ>Yƪe5Rxmy*grt5M09٘gRῖ]<硩\eضTef`ʪ]ή|Zmm&΅_4/EoE<8$вvpцWHLU\q`6bA6Cz ,} Ci=i[҈)uZ $յ|x*4'K3sGrH9@bq"(:_|vw``f)QTu]PhY=?i:.Kf&?813W5l$6} SN15ZP@ea@_f1o ]Y,}z-Ԩx7(5%Q|ϦFl&٠?$;[A.Uj*g>96Jh.k͹o6Τ}vF?r7DۤӺ'ln4oG}C8|ޤ_'fV;HZDa\;ݠj՛d‘\:yZsqɩ/,5IV]*KZTbڊYmc QkقFE*Y^EɯKvvKCG}]0Ԇˊob:MTQ-k/Jî$O9rsDT4iCW5SՂˢx% 2!ͷLY5nk:K{yh%stC-gPE06P`q :xE kHʹ2n= ^f CJ&uJY46_q£46nqIkȝRq5n#Kpeg+P3'4$؊m,?w$S @DirectFB-1.2.10/patches/matroxfb-full-memory-linux-2.4.21-rc2.patch.bz20000644000175000017500000000077611164361026021747 00000000000000BZh91AY&SY 2_0X{@@4I4Iz2zjyC#@ ƚ& "?(Ѓ4hi&`*y STGPA1a+AIglz;,i5cH|2ۻSa]a)*XcTt:^Dtm M^|}CCGZXk4hyG83#S34zCX5},e̗J[ӳD+ @c̦"ù'98Fx#1@ZTa*5J50 ^W؛uHEB/3-ZE/AA,^Pi`G+۫I, * *狂M"7YŮsC!f4<IWb&XԆ#!+%tP悠NZFFeot2gBĕ",P+IL [A``%%`-C[^ڀlη V|jy$J%H9$DL՘-_H = DirectFB-1.2.10/patches/Makefile.am0000644000175000017500000000103711164361026013622 00000000000000## Makefile.am for DirectFB/patches EXTRA_DIST = \ README.davincifb \ README.fusion \ README.matroxfb-vsync-irq-patch \ README.savagefb \ davincifb-triple-osd0-2.6.10.patch.bz2 \ matroxfb-full-memory-linux-2.4.21-rc2.patch.bz2 \ matroxfb-g400-clock-2.4.22.patch.bz2 \ matroxfb-vsync-irq-2.4.20.patch.bz2 \ matroxfb-vsync-irq-2.4.21-pre6.patch.bz2 \ savagefb-0.3.2-linux-2.4.26.patch.bz2 \ savagefb-0.4.0-linux-2.4.19.patch.bz2 \ savagefb-0.4.0-linux-2.4.21-rc2.patch.bz2 \ vmwarefb-0.7.0-linux-2.4.22.patch.bz2 DirectFB-1.2.10/patches/Makefile.in0000644000175000017500000002632111307521504013634 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = patches DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ README.davincifb \ README.fusion \ README.matroxfb-vsync-irq-patch \ README.savagefb \ davincifb-triple-osd0-2.6.10.patch.bz2 \ matroxfb-full-memory-linux-2.4.21-rc2.patch.bz2 \ matroxfb-g400-clock-2.4.22.patch.bz2 \ matroxfb-vsync-irq-2.4.20.patch.bz2 \ matroxfb-vsync-irq-2.4.21-pre6.patch.bz2 \ savagefb-0.3.2-linux-2.4.26.patch.bz2 \ savagefb-0.4.0-linux-2.4.19.patch.bz2 \ savagefb-0.4.0-linux-2.4.21-rc2.patch.bz2 \ vmwarefb-0.7.0-linux-2.4.22.patch.bz2 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu patches/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu patches/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/patches/savagefb-0.4.0-linux-2.4.19.patch.bz20000644000175000017500000004555211164361026017416 00000000000000BZh91AY&SY\mi`a}׶x\>0ݲ]lM.z=w96xMoG ^}omBϸ}}x=Y}Ff}}M>ײ֨!Ѣ>zӦ{i[ұ3*}|xMNyf{׽:{7vNۺ-EL{'w^﷯[}8,;aÌ܋zUN떽};O_w) 0&!4JU~OOvMֹ T JqռgDc~/ IÑt92e} z{Z.m &vFۄ)ԡ@|:q.]NƕQxҚe{]S q tJu5Up2*L "03HI "«!\$Z""P(,SH)dP-dpW|zk 'fu=LV+fU]cJ%J;m1qF]$Ci_W2T: (gE!oQE Pރ3h`#DNAE5.Sk0 \)#c:2?eݮtĄ\a# BogCm,W[A N+t?* 1Ѫֆv!J퓗4գ2j5/^=0y[[-vQķ{x1`L$΃Pَh:aVdX%7ԛ;+ 4#:R:r&+'Ce&G 0UlUd5t0QmɔʉRTAbB/]ς %P(g3LH!K:Q1$* I+ $\3I+clT],Ţif{XV6!b3GD2)͕-+-c(D̶vb l#4Q.RBk`B 5aC>\0Msa*1tyz:a+kNA#NٸKD515&MQy]g 4|g*Z_1󛬡hmvC—@E#`?hݱh6m>w`37'n<}5BLM&l/+lAl+Z`" R@Y>PDO  *HTQ Yegz59Aj]AVd> )Sާ^S{Y/oʈD,K Ծ N_C0!,X=Yp?E-b/h!I@?Bfʝ#U "L\)uLjogfq'.j!蔼/s& l "I0& dQq7(i)FJ@qt@P*tg9I3~: R D}H"R^Mٖuj)<6c[kHqkJ&[MvT71qb77hLNdL;@qD[ײ&!jQu%'եr!duTcA6j㌱O>lC3D6bL `G6^$S7Jk#_>!ľnŰ/uźzN,l!0!Ԟۮv#ѯ# I~ )ajݚ )>?}5ňek2hͭ5~<a X•\pARzMJCںmD\\ fCv.b+@?vN S~Ul֜1O|G`g [CH((!;LagyVTS'# t%Cz'*h7f-"@+؁fDŽG~0s;^;c@A+_r^DdBwRSu(+h~4C?l7HpFTb%6BM\U 4@UBbLi*E0Bv3+ G$lXcA3" AnK8}8ޤԫ&Io2SG qדF8PDJ8= fHe=_tƏd:kB襙ɗҡ1b6ֳOaǍ%mvZl˯}/vhGB';}`Ô*QJ#ׄ f? A#'scC0}Y;)*7 3 l> Hoy{Y^V\p,F0E,V*]hWӴ^3)<>B"H9阄Ϟ93L#v6SuӦu=NaM镯2=h^o>sV{(~C(yYSUD)ܧlconkiUsq\TOvIۊ7nDIGӛ&IL[ja LhsmUptjƾ~y m-wZݚpO%%U|Yqrsa sةSn/w$I$h-ȫEqفq\w-B1qНBg[t oZ otG{7x`|;!,̅Ѐ:hrHp謂4,z2eyOX[g[ծy>_:gՉ0/ר6fdu#gk45 C}tmjo@Sy'= y;qC3h5Xj6|cJhUS՟G\Y VW_eT{Θrf;a hي-4CI!7'T,>"+V4mxjDAXs~*+L+ąg՚e|cdz%>LA}(B)bd9ލd 'DbPvro:%EadUdv礛~SPQyB}^_I3V!頡sUDqek-Ÿ솏UvaCmMt{N*dX }RO=?V9;<~Md|OXpg{%dsPjGq[]\ YvpA&-DL+ Ii, t!&;9wMdjQW\je4ycŒM$I$*2W .nL;)B/*|&"]z"99|pخ> ܱCipܖny`}=$#y0'+'FZqjI(sXm`?CM+:|MAL|y~NjnfT$#/)<޳J93(U(F((6KFUUX("Up}0F\h<Ӣ.b nO ;wKY[OQ|j!>:~s[,GT>aVa˖<R#c_^t\L헍{F-aݭs`*01W:9ԒL +#LD{osd핢&[vǹ {*[m›65KZDw׃8w$M%bd4zJMF3b4L "q\x8wDo俋JB7T8IՋXh¶RSZcm B+M9-F0Rq6)Kfَ?+$" W(3x=yU+QbxL0ӣT4:|!x7JGyēƶFEUJ̿ygkkIfnjffLzݱZ4zz3nj1l}j7ա&0!ytgm_5G3䙓ֽٔʅQI˰NF.o.Luo뉇oalp7_ޝ=|c Th3$=Tc1Db"&ɿ{)DRD+Jfe汝[(TdfR@d?X `QXMYޯsûOHcu\{r7QUN`s 7*V.g4`@@_JdQ`PR( Tm$VBRH"(#$"0c 'bEu6@*0Qof69D[G rTTΣwXݵ)5Xw0Nwe! )Q|'L, `E߄ Z I$q7˒G*8xu\mv>%I*L IxvD>l\9ADA)fYI(+!nGC=O(ɣ]]y-(d~eάz1͞y o;9ZDW5R5 'wG5ܹ雲i#7d;2eRM3+𳞝[>-8ܵme@o>,\ E*ꍍfI[qd?鍶;8``r>3h FQU|\jIӧZtġ⺧댸)9Ɯ~(~%RAhiZss9=]~'7z"ff|g0ӣA鵞} LvN17x(ds!z5zx0xX X%b!/[nN`n "jEy4ABP CiSxBC 30qlc/03`ܧrXJ\d$LYjYd2M0\aZ4H .B2"NU=4daT3 ֲyGfFmUU|yx >Dz.1E|7UŔCѲƦsi^ Z6+`$3()}>z)oZFz<d͆9e,XFZMLkq2̢$`)Bq!*:OD+- Izlq]/cdraZ0Z9L@_qFE0%?5,LL'AЈbp-;q1]]$28Ƿ-9;4emZֳEhttA1 Q'KfNv+^ uo{-2Clj,~T9tsjp7_~fnU$jtany"aB"QfqyΩ#:bn(b,y=y{ ͧնl|01ie«^S+Uٍn([6Hw~wi/jrJ5Qq*8Sbӷ22Yt J&q!ǵR]nއH]p[̚\ud_`#䤄Tbf&fԲ#C!pg/ MV:,ǍE ;/ww:;.,s%Et"*:$&I#3y0UJdUbzI*@*Mv$Gx-VjId'Q;K8qôfHe$s0(C 0ȍ!I#@hiMd1gM#xѩp>""SCa]IiL tfIsb"!`0:w1 )(;͡#hnYyX9{eFZKX RKRz!kpTxs\oYKЏeoLhk%\VKV3H0̴_;[:(Ȣ0Mh˫g ٞ"D6́~[0{Z4vD5irwl/GCqX@"#,-8-*ȞpFgjqfa bbJ##zaif}{np\FXlITvV2Zp::py?@նfk-JOB~7_cU\՛ɟkI,ј6 /g8 F! c?M47OU إ19qu$hEϱ~s.j1ݱvLw5<5 nlvK|jGC\>q^\ss96FtFʏkAJ᪹My Sv2>MS!_F18ZmkNjW_9R1(mX2ܽ" ֮:rRRKLߋ{;NlA0ӣx@S`bJj-ԕ7 My-4nE(:҆/L\v1+i,VT,#gޙӵz;)Ͷӣ,T&tk 5HeN9Œ9}y-k0k:eׄ(jy&6N+?36YKl䴖EǬ=S l! D"i;<-"4~֒U>h3h~-!a0B,Pbx\Y V,06&?d8sD[Bܪ-N-M(*`䬲C~;^d(Hd:r_"R hk[) * T⺡7N8/_, $BAddH%H(>N[3`>s?]Ψz #Cr8yd1_ FI)i0l̜"(,F(,XXB,PDF,R ,c,Xc,؂l:Ê-I~#CR Wq+DIcC 05cTMhP [(;g`'mhp3?N 2ޖ=k Iͤ"hj17C/sM5X˹^p3qkY|fEa~؈h 5lfæ"=7.'!nڝ _ 1t&J*ӁE)LCs1 Lxڪa|]Op谁F7lK0SzStq 9K",<zm 7jckٮs2$ :W"0LyOA @F5R){Z9Nk@&ܽN+,fb#NMpmr0$'sTL4)PU(wǩ#oo2; 3> !u @㵐i!3NE?}ۏ!OwWloNw!ϕVF<`}'|Q=GT 'ښn!M$IiÆvFxp-;.25{;K8H'> kM)G~}]!]V$ lBc&jN01>&$b!D6?i 窅/<{M}̑xM"x(U )p]A]06:R ZaIHl/tRApxB zŹByC<*L;"EX 9*TDi!x5%Ht@]%@A0 %AI C]y؜%GxohD*JUUUUUĐrAA ²T B 10JHKIVo:ٙ!E2FvE:S"(Ŋ $! N'?78tO۠؅Y{",1uM cX?p,`$U8BU$"*F* s| fblMbDPh&#lS?f~]Tȼߒ`9X@;=R=]A$emPZu<9-buawRq Wrd%a`s"|(,YgD8cm~ރy<8`rs z}SD9v(p lMKWnaA!N!r3`}Qr `mlD7pSܶmm$Imlclch&0/WM+=sn[}9>igi2M.Gyƨ@#r~~?3@9XPAu5<.Uw~Zmqx]u]ׂۭ/i۔2ͦsM55a~H?|&TQl-=2.eE;Y$_nl~ҏf# Clv! '3R3`χ;EQMsf+ L9 Fd7Chy'OqG\"SrK0ZlcDօJb\Zr $7cqZqȄȜvcB;MSA w6Na> 1L9|0 jSlYT@A S]e aX 4 qʄ},QK"fL?rQ|U8cH*DTc& #BS"}AWQ)Ѽg'*Bk51L6YCA0,S$A˧3 8GI=(=zl-e;C߁ikox+F&'aƒbF%;'a4ÏdKʑO^*b+?IJ?Wӊbl 7" X$ԝäoƢtGd,G#=1P&I 8ϗl$%(0S$ؽvFg!Ҙ(55@rā r@5vˇ9:;2]4 6w6lw".QAc8B"0vbB- dUZŲ!$ 2FB)!>, r`tcwCI9ډWP'1ѕLMez!C H:ugǖQ(Pܮ01+}ۻsF5p(v`4+GFE A *E%UUbc@o_۽X RHC;}@<DNU{'Y Ū≃&춰`DAnDLJMW@{itdLi *Yg0m/ٺ˄t~02Hgp  iqLh uo"!kEV0PSX1I:PۙR&O I-kc[11!1w"Aҩ"xkЂ='$%08jMRA8'b;QfL$ ;0=؇4r%h5F(sMsrxྦ+/6 T${;;c_ ڱoo|@a _.1Z%ѺEYIV'G6"!Uh (A-&aՓ9 Z(gX=>*q\k/qRiP.&5!'i|p;)}B,V~m|<*;R+)A2qGJ<ɋi?EHYz XIiCytwoG5d-C@G[z#RDFýC):9Љ:fdGU ,ePUwp:J([::ԧ##'2֠VvAn'Z&eH0 N/5+9Q=?CB뽤X:j]&UL[emEW: -pfxR͝ d &MhsMUUUUUJߤX5̨iy9r绽t_\/HKkgZl܆jF=pÑB%ԇyW[ ܯ)E斺ln2"9M-mqmEÖhJZZ9HNjf 3G!ٹ]l54I@)0w0DQ@_ryiC&P "2 <$SНbJr̀p!̓y]H]OFmsmFqU0 >:\ 0t0-'/YAb2W]Q rcC=4GP1 \wd\q$VNaz/ t-iC{_7tӢV=xNGӱV۲aQ$==VG:RB"Yy؊H&D*p>$-:5 !08:Îs!6<*a=">>@ D paDuM_~! `+qFmIVK~b&dl ziLbD }I2 C" @u/:o0gݙC +[fymQFosҍ$0z ML}O-Eۃ1$~VrHL XvHl`[eK Čf(R1,=,X"(:?O S!\KbH&6CFq֒Zj4R#b ݳ%IN4 & $O=~,mc)`Ĉ@tz@"2 {PځQ|sRʌhvD[CY$ VIa]qɣk[*tdA&q:9-eG$@\GȻa yƉ4E20 ؿ&VcTw C Nf)e#uJ!SeM(:dWkP2J<0gin\ro"Y|zˢm7E[aΛu#Q#rbC"igyB 03Yz%i B h1$pj'lgM/J^fJ0̭?M-ʼD<0&Hm (I`X,hj J#Mp<`{hM!*-- cYn]C@JOM7}c)>À`GQQ" "Ff VB\pjFkoaʆ&,dRFB$%KF3a՘06*QUrzM&#Gq]9Sr 4!2'h yRᶅI\2$]Sz0D; cN fY5i>osn l|9|Š7$r,@nG,:cpXwX3V>YM99a(mj4PcrpM>~LwRO< ^lp^ULwz59=}m^)(g+N&&.ylm!֣cnLg6/ T*j^q9Ͳfz=AD/KVqyȲmUaiYeŵkPc)hsL&(%Z0R*RR|F| 6`lE1ݡDR(,5TN>m dY@ȑMt2DZ@E[PnkofIExuDc֨Qg}yгӦ@E "srX|5LzDܕ9!?̪"EUTUDFEUn|D(b;]i{=iSVyVE@A*ʥ5;=ShNǧ]PFBPل$`5wFvݾsI)Ayb_mMdbU 1Ugi&)<"pyw7[lD_6U[cח#~X/WRb,qהW8Wd np u-Xs߹3 b8\L6먍RI$yp_KbDpY""()K=0(~1P-.`^'+sgŧC<ʤ-O40%BȐs$`bfThcOVZ(4r g”&X/X'ann㉦3xh7l<-h+9Mx!! p<{pPhSl-5\&(TN9c$+ M>0Bdk6PA'?bPTY#,FCuo%gVĺwG#;ER&JF#i)`@AD;}Q8aɼ _墑 &i3pdȧFq ADPawqtةܓC'01d>s8Ә:o(|P!6e4 dWwYj( 7('*Jhx~_YLS$|HZ[]hi^=g91F*\3`n ":0LecQ]jYsYY:X75&j5o am΋Q\i *ytDo=T#_c!fOF(%{8RFHbH( !GPk.1w+J6goɑx;rMve7;xnIU`OCĎHb9! C@B̎޺}a/uS"tXVCGFD i<6>HG2F4%Vp*$9'HI0̒-D1q#× EmXs8S3nb 'aVa"Z?E d0$UTUV"#8@g4Ć!ټh50%($O 42.7q7U! ( 'Db&lJT|}A@s0s0,!p  Yg3i3ϷX'"~#b@Zg^PbdlbD7ȳhZ1&,=EwMI)jc7&z+ Ukb@@(!D }TDG-K\("E,YX /#14E p7ȃN F} 7BC ')D w33nnQ~HĔVˤ zp96QVC)U6 YnhM2NqG[l8 ZHIO(dE%[0m?b2AHP@4hE+u^ 2o ? i^dI.p |7JDirectFB-1.2.10/patches/matroxfb-vsync-irq-2.4.21-pre6.patch.bz20000644000175000017500000000405611164361026020456 00000000000000BZh91AY&SYL߀~4y`k9vԈl$mC@4hѦ@F MB'SM2iM?R~=C@@*K> )K[H[i 11iU(T"i*FWQ (!lŇMlP9ׯ$̄ g@2l*c 3Jy?8h}W+4%Vf&3OoI0Z]2*LU˂:#*(aPq5L a bEb'0*ldRE h-p7acL Z^+Aomܐ j ͭH(ȑrr<$NiֲJP?Ka T4[.3 6lj c| 1".s^$u=EwrsAOŤHG5mn$/t`,l* ;;,420;r! u8֊52J̟wW^ QNnsA &$vV8 ~If㊠m]OMV;JS Qc}VY'u:B +T›3Y ؄ pV';'!pl 1d`$(NH R= f呁5]ZPaJƽ:7djX#dV2XJdQ MI=C`J 2&Twԃp`C&j0UH)Ɖ2x+y5 c֠!APbEȩ3ͯsL8X ]BB13DirectFB-1.2.10/patches/vmwarefb-0.7.0-linux-2.4.22.patch.bz20000644000175000017500000003310411164361026017434 00000000000000BZh91AY&SY`D,K|`Es1{['Og7ѩyuI&h>g׋﷽;e{f w}Q[=}tm:[9xW &z\ʶ]x㻉=kٴrJ۾>jj4/l޷wru&@#M&L56U?TO(h~jPh &Mɩ䞧CQ6h@A ASʇOMO&CLFQL' MQ$ 4<Ѫ=im))A(=M4mLCѡzHFКc"*{JMSڧi꟔C(4mG=@7$d 4)~TT~ԦOz(74A=@4hi5 U Q@PQ$1!%A{g\*Mh]~"I˶m$$X7ZȤ7;EbOڛϊ?~sxs.\Pi=cw!hҢn2g HBHz_s;4?/dw۟N?Y"9Aqn:o~kF5c^z6ܔ1bRB @QdQE&HEPT)4D" *@E٬D /Xӹ{i[,oJ|ߏXz#! ( L$egE XSa2ʪuhq,Tm$MHЭx&0\–L(j4Pɂ1J@j4Q T`'s 3H xy=;9tHҌH[Gz]OjN~z6pӯ`Db]:+q lj[OO3J$LjP4f610MR5]s>p9*)Sd6 (* 昐f,JKM"[IEH&#w%A-MBv"?72".hwm?wE8+3yv\jsr@f!!jֳLr|E{eU}@ͪ@d԰|ƮΫ1\)3Dy5SEddDr@c/{+Տ`(ghl|vwu @_O,J"ADW btѷ;WgGxxh٠$295,pr"{Fqb5 =|W Gz~Meπvd$TPUށ]z^~} ?| yL< .7NJoc>o$;ݢ}('aO0 c`6l[Z~$ǿeb!}5X>^EtMU_ ͲF?2zSǎ=;R^3"IDFϛw*|gŻeJHXbGGϝ؜>_䬸& Qj p=;=Ӹ}c*om0h/' @ͅs#fl;SVv߂lՋ 5xy;s1f!ia.@Ox?aAFĘ*T>{L!ˈNI9wVEbbUNM(CD{| 1LIe%+Ḱ˽걙\S:vI"WDS-dzKJf=IԹ6i;ӽY h1ǭ>}0pvcgUxz#@d>Q<IrL@HsHGSsM閷}87ۿ:M`M( ~HYVC7Ё]Vî3A-2Ȯ"ukOɸ] !:+{|$ !c:O%릏{kVaϲ{ް)뜞/9!39UAf#b2]x@UcD$p8̳gfO.bmc͈xkǬ0Ù@,r㧂7b_'s`n)顈]^ɴuSt?N\KS~kص/DmMQ[h[UZioz*6=:5F.]-qF'qpl;ז5 ͺ̈H}?q 'h8З2+M_`F_m*y< ,s#$rD*D?8]d}vvՂ^KHnY 2{>70nM+-- :-q1QTR(Wx1!Fq*n9 )|H4gF.wϔ2 3 JޖNytcO-edc>T'3M緆gPMHWsg\qkhރ%9 HsLvWQ-Oޒ'$9zg~ur\+y8x͆hm u,&9|ޞc8yB<y2W!P T#Bׁ#ڈ|~SfLq? xNK$\5uBzerI6~UUUU^٫}IP}.f<(ꢄ1͏[|P$o[%ъ#|$ڜi-'pV}0(CFb)ɍ7}0pGys,!`rx#mN6hd9)5< QQ*`F3ʮ}n?1UR{t]Ʀ]Cb}tc7Q@TA"DHۣg%}0MvmEi{|M# >!r  "H#ߐ EΊ cT$co0?8*~,_ZJE?`_+']3]~&G6k0M$ dL|V @OI-偰voq4{IPYLi^;tr{0ίaB~c([t#Ykgu6M$;r_٫S}[TMt,zgfqvs,3<U`X±Co]w.)W23p |M|ЋP|x_96Y:(0HNn瓌H!8;{XGע>XNr!ɓOεuyypk~֬qM 3HXcKnP/er|7i͙ljp5k; \F9{TAt/$6 AF0ŀ0XIpH(Q IPc~ DUYR,"UIP EHb]?. “i(1~XܔFJ4f MUU hǮYfj(a- =X>$'@b*CԤ"0"x XU&$$'wWO7hpm7:'<|V>Jk=7psA1dX͞{I(̅WDvs ٚmuU gUůg3T G6W۔7V{u:9*"z.Zhoz Xvm & m݄܀ btFX 0VYՌEMƯ8`pW)˶Nj:2U"ĿQo],QLUzJ3n t_T`XmL#B9[叅Y`2T:#{p7TX!S@e\G;v9r뫷3L"'!vw~;JB?S@pSMhM(cjXqP0 %6J8J4XX]bPTQA.H^%`@3bm[uRKŧ.y ö́ZHJ9B',[34#1itj d"*27- g#$C*:eV^j@ zHy)ONJ)UU+rm/8? ݛuՖґ8P>bsUpDT9w5%ոO|1f.q}fa.fZ>k*\}*ȇm?oiSQ iWH^a)A=Ea𾞾latC2Q;VR̆;pFt.H $9/V?s`tz`$A⟨6 XQCu#—WG&g}{c[||Nac!#)gxo1_Bن 5O'HW fc[j(,$LɸA9n(:BY~RgH4 Ȇ(0l u>FDPWw4pҥXJEh϶Iz k:uuRΜT2[fFqGF8Cz%0%J!,S,U<.V_s4 ^#qDHV*Hwgxi C&B v";F*ާڏm%q|- (dt!AG/ךB>(7N },=Yz&BTXL*!PKtJTzP;)i#g,.~SsjMDͫs /T^?A8p7uuaی1W%a9 M"'a rJj4FkJ6ezb;WxؚÝ:69 b&]9UiCJf;sw- 6;h# B) 7h My,\y* pZ `P&SlpK!N..;j;;-jsL܌ UAH.x2kܕǸ% $ң%PMסY%s@;ոH4x#ĥ潉Jn&vNU" b3)DN7aޔ&pYɷ+~v:6+ (m'reM*"GX, Cc"h2=T{PPD`ehZ;9Yc$@5;sWtp @sR팀Kp@ E2"u"=QEDߊbőc efEL­p :؄u Gaay׼6Xhy;Bro0mȓV4^ε'7,[yH̃ͨ9/t:{m(9T5`|=] #8Xo^ؾUnL<6&WbzOS@. ΘɳjRnZH( 0s"a.dzQW@{$ ?y>tv ":'\eS_[sX@nJ4;K؁cݸK%(󅒗c*"`3P 콰-] OwFtrf_oY'! (/}tCl %"@pzӪ8$D;0 .#$lxˊ@3D^$31ֳ]볓T4v`!F0XL)$KndZCNA2 𐬬ph,j@LCƪD9#ce}ph2"nNJ!ZQVvq iޒK&@ QdFgÙ #bRZna6B:T"gpP.AqM0zfmICIx> nT5}!B 7}iӔPeUt5MɰG ȬT D&䖻rP*BRT0kHXF4 q6vP o2Le6 x6Kŭn+Ɣ|fپ2T4!]1P"t2./!vU !KFRNqQ<4ZDҹWc$߈8_܊LzgQ6իomPΛb H΀cSMs{ӖEP>`01FB? ()̓$4F4*E'å3sN9\ےPJb'Qu4F:tsZ'sv-AE2#慶iW)_[dcAAX C(ȃa,/Cմ :Iq,$e4v6B,*u\O{trnUX 2ܡ;z6IBPC3x,x?<2G%>q͏2qu2IiBBa(2 lieᝮjk L۟dKna)hꇢȢ/ЌrM ]^k}^/$D23Ǽ2_fuEm=+[7h f^q"! ;ߠd300&f=x,<,Uz$(tx !InI0ږCǨ'wB:@>P$QHu !dyaU ePfWVl3'ļ>N`R\=>W uC< ,xU8+j]-Bh*\=IAS*#=sR" H8byД<;&.\Χ$8Yپ"C4\ZoMp,1`Ò7xM;Xu X ʖˇ(??9L%FҜ"[sy K)~ $ |ړ1ͨu!h楎\aIv19uP͓k^C(/Y!LRF൳ʑyC6pQ9<RAI$|A?9:T# Sg)2.,H1 ŋ#%@Oԟ{S`쩀ڙ~':$d"ü/quO)y $mT?_@uOxe'N$CWq THuOIa;h%D&}%\J0)A2BA-injE洭!{Mlg26~۴Nxfru;Xv#Oy9tD='̒3g|]-ٸ?rP{~83oI'v0~tб9ڄ/.B@ q#!"1 `w:CEsޙ5BB$X -[]B5(br!!|CwUCA܌ Pd\IbG p.B ބFAHCDveB$bbU$$p.b&/Zs Yh9 y;ұ6 y*0PiUF+(b#  d$ 8saBcf$6֢؅7%2Ht BkD5 EI*U4KL }k'Ie6ѱH(:ܓ\|D`NJpHѰyY;, ~$>2l%H2!8@qĂhǭPI Em!$ ̅|wi!O(!]d"Ef8}UGN8˘ikZL0- !(c,*grRS9 t-Z%c95No^J;O%_R%lr E'I,F*"rOWM=[ :l\dZVBFbU ue(+L# fiT8+Ebcb^CBDz) ig8_ *) \Sq[]z@[_0\!-HH ,~ FHR%BEDC9FIY!D| u XhGy1 @XJP |ZOY|›j!43LO\u^R8Fx2R BEKUT++4 6̘eu i$fT=0,7X3AYCA* c1y)a4BHۡUU`UUUEK(07RR=c紀A!AP7GN:wrN'$ɚ>1K!|BZ"D3M 8VMݏ~ WhȺIͧ׮й/lp a|㲍,}mbGˤѭfb`y Ξv6K`5_lP =Ct7w$!~玔.$H]E"hk6>.X^~XlQ`TzqS**UwGE8ˑp^6'޷`T+>M<1=!M{ܭz\$/ܝ!8!KN5qW4 Fogr<<&GjBDb 96 qsGAG4M[a:‹d"7C N2lh\BPh+!*A PL5LzCEFuR"B0Y5]FA (I Dr] )$_@{FuWX;a1/ăz!G[CJ* Px"grJC>ݞA,+\3uJW`Q9GA6vOXEQU* )H2V*y-x, I4cOlv󞤀<0h$J"YA@(:?o}hχi†N#J #H@

jAp(3_NlDa<<]ŃEK7LQWA;! :'3QD2ЭFW$a./wȖ=OQoH8fvֱKt( gbF~#~vHKI=~feRԡMAd1hg^1pIϲ7CEhC-`FjƱ/ƴ<=w7n  ^Z27H+TնUDt"/ 1)Za @ ZHmf Ds勲QPb{c&ѫ'$FZ-CX6LP0ujBSTWfay6!ȓìf$Hb!X. \RՋpv{7a!9Q7@7soW0A^ r1KgDp@ųfg2LÜb(Hh( (ОBJ+:؆m:9㟟D]%P(" Y2e1`+}(59oǁ 1<#BZkKq@]a`t7AGɱu$9knj$L$ !JW~"Ӵ%nT^1]MOnhj;ߎRw&ʩ :аX́8 CgR V:q`ꌒ xuNXR! t=:LGt~4y.xAYھGR*ޖ۰d^h8㄃jJJUBQEDD[`j `AzDJjH@(";Hb)xshrqܣ{#)!S"}C鹢nnb zn™Sn:I6jw_^5!Js9n;a2I$SiIm^`"lIJ7w$)b̸3GXdZ\9)$כ5`M~s<%GPؼ3 n %04r>0;|ūTDP G^\5)MCyQ!THv>fO% c.WWX$ Z$PЌc#{MLU.`=14J&@- 3Ͽe_-{cDi%%mYCfUԫ`uM|)-GYCH rAKZG8$.RKEc3>XDI5ˇ+b /"(H`0"DirectFB-1.2.10/patches/matroxfb-vsync-irq-2.4.20.patch.bz20000644000175000017500000000403411164361026017577 00000000000000BZh91AY&SYL @߀~4y`<wZ +X 4yS&d526S=O(4I)4&ҧzj6@=AhL40dѠ 4zQ2yё=@ hh@h4iC MbA"BhAJi'ii4j4zcDhK.h $,I6dllbODQRAdJ%"IĽ:)j 4IFa(BBw@.Rt;oפi\YJ)/X~ZU{'ES y6׾UqW,tJ[$; VE LCH2w [<` ~ PBAחB$7krtj9+@`6RdRalʲB CaR\^aP_T4g 9U|_ f"0e @D08Q k 7P "b .4m`f &] %3_&WiaQ a1O>r}ۀ^ /꺩*ihOaP=5s`Q#)EO"-G"s'sט@AtUYȓQ)it"4_EuE!ځyg Rcu~D K*Fi ;@K#z70Î>7{AgϞv#uTإ 89/,LQ%hUVZqkl#l3A:QX ^4^@(9xj+ b+`-62%HbhyGBD=hdYٝZ͑̑d*jHSU`5|8tC_~!hͲ>j;d)Cw6:DA%P]$K=89p $\6G-d`(w+R _Yu[5[2`*) (< #QP 7VAԷ OU&L\ _%jJ" 2K/JB.` <՗ޛkA30&mw$S  DirectFB-1.2.10/patches/README.savagefb0000644000175000017500000000125111164361026014221 00000000000000The Savage frame buffer driver is highly experimental. Use at your own risk. There are two alternative patches: savagefb-0.3.2-linux-2.4.19-pre7.patch adds basic frame buffer support for S3 Savage cards savagefb-0.4.0-linux-2.4.19.patch contains the features of the 0.3.2 version plus support for accelerated fills and blits. Unfortunately it doesn't seem to work for all cards. Use 'fbset -accel false' to turn off acceleration. DirectFB-1.2.10/patches/davincifb-triple-osd0-2.6.10.patch.bz20000644000175000017500000000111111164361026020103 00000000000000BZh91AY&SY쐶߀p0Aߠ@:8teBQ$j1OLBhA*OH5S"@42% MOR<&Tzd4PM412ʊ @OE)"' sA~\"h{+L3)}pkF?v0{90#1n5^C 3?Iic 0", _tRdZXN.;Ld^u(ē[L2^>  Y +=#J[cM,fhp8 Ui-4aKMd븘m8 c u0 ?@hD!j z&H64  (7DŽ 駗(/D_L\2ta?%|^eʴE~&ua"겢=UyhpHR P"Syi0ipy-0%I}"0{F Re@ڧHLBX5Qa L3&"5Q#@aV $F4[JP5#,3C05[PQ%Ǩ)„dDirectFB-1.2.10/patches/README.davincifb0000644000175000017500000000016211164361026014370 00000000000000This patch allows triple buffering on OSD0 using RGB16 format and adds support for choosing on+off sync flipping. DirectFB-1.2.10/patches/README.matroxfb-vsync-irq-patch0000644000175000017500000000036511164361026017320 00000000000000This patch adds the ioctl FBIO_WAITFORVSYNC. The calling process' state will be set to TASK_INTERRUPTIBLE, it will be waken up by the interrupt handler for the vertical retrace. Processes can now wait for the vertical retrace without CPU usage. DirectFB-1.2.10/patches/savagefb-0.4.0-linux-2.4.21-rc2.patch.bz20000644000175000017500000004561611164361026020074 00000000000000BZh91AY&SYYa5`axqc IםE`5`L** :}97Yb*Ü;{0@ـ[Xaw#]L KY48P*X;VMoNbEכףIhݧvvJlQMCm!PPHXO8q$RcbVu٘& ,rLuY) 8ݐ)Qؙ2Eb_fD,MW.S`m;`%]%Qb5i (8 t 87,&Rnϓ;~qdžOd9|]_ZP#ߋ @p.<.v5Qjuz bЧ&|XcAg% դjdJBDM$XE P11 @ 1U]iNˋ/mdrD ԒH*B$H͒Qw~xŝ+4,"PE[x54vbnW?/oNCsWᅫ:- htPDHVT'<&[ק1fQzQ F U0Ӈ.3I9≘"HT(21_ZC3hdo/(FwHh7 UAF~mdznrQ$Me>0X|rXA!1x`t;FoE?P_h5.1f +SVP@4AlpY:.ߎ(z[uog [aו?07~5ڰa`37'n9\fl͢$ʙ9La1 D **@$`E TH~pIVB,HΚ05 ^qA$RJ~Og.>ϻpS3"*+F0&fΨ$!1-- BBYe05X=p?ߊ[^C| ?R離t&='3FY1X#fq7>j딽7ɲbb=-!JD"D'L G?}g" stz~oqK@{ģ71JayX] J" @B(yyjY_ahFYJ&[;%Rn=@bܺX25890ǖ(9!oM{"`d<G\$֮t,/%O0N/}H$M՜|SNV؏%M 3R `G6]GrP^ n-T7/x'#6f`B u{:C6Fn# Ic="}љև)K/oV1za١ҴB*ekw?zSU_]A_G͖}xLJX``B0W(}R_s^i8A!]vϢi.nF3^D7b-uIN`r{:4eRPL>. BmΖ0}5)) [ v%C#e5~'3roڸi NǃOٛ;knP'VUہ^ "2!=Cհ/آ/ :P \kTn8&r0Ee %E%6B)l Je3&9ZȌHf"` !< #6UKKj,k@ІIAAI|^oM@N_y(5G>6.l(N8Hc^LS % r+8N Lhʢ$.=[݄+;>uӆ襙ŗPc1j`U'1S΃Y5HIC}FwDztN ai%||@hade: }gp&.c7`wbTnf@{`$XF>C}[K?&~f Z_3sNcн=}.re F 1>ZWY/OWnj;wwWmNp&+ nLyG/UgSUgw C>ǼrLoNjϷCvqlcwvkiUsq $Q='ntͲrDjmR,-󾍔V,4;8l5㢼%YqƉv` ڶ:eCE~&:d$zEU]ğQ?rY*iz]>L&fW0޽6VBg8{K>tGU59kuW>:*PYO"va_W9 lJ&SCnml٧:#ycvf j3mu|<VW_eTycF٩BZ;b&e mPdc_4CkR뭿iN-n3 Of{e],& 3Ŧj49rD;m:h N{TEb=܏Q"#^׹VW ՚w~bAYfn^>M$W頢o; dvcSބ*dԈ")|i0+-k&%EadUdvI7|ROuB:ZYim&tWF0 4KUO mZ=?G㿻 P㝫WWY ȠB0HH;ΞCs$ޓ=|HIb= C,el^怠0:wBB(W a)0\C 6EmcӔʸ4y"b.E 15mbԕoEd/Uv\`T8D<(U|?OnZRST8tϗؖnz)X붹=hO"e0te9WzMj`%WǨڅA D~{tMjXE!8eۋ٨&lLxa?k>Mt";cEsJ }X44Le)7kCB){z)UEU?)ِ5x64,_(YK퉱J_=VK6q^/gD0R?Q/JzB P Eukn`^%5zx ˖U+Qbx#&'Ӹ=XstB kZW=7vyRU"aq33G6׽U!x| Ea=n?\EsJL`%߆IѝM|!miə?f̦fD3&o nߊDŽ]晆tdEɎq0]?Џ>&KGjgϓNsåy=C=zYO"(*E i5t6}jzmsyߌl_ uZ`0K/np&sD XD?O8}: e'ZJ5}lӍ2,ϣXyā`c Ԓ@*$"'@?15l | X `)>yO=ߟ!a@Q}@PAFr,3(ݜ>G悌Sz / seI$YX` ,IBȌ"F!"":<IEܠ/~ WUykpf'2a4=76>Omg^ H~_h,G)YH~%L] I> ' z fޙs-Qj}lGjjYqb '6"29=&2 Dzbc BUTt$C燕AjHĞ_oCfV|<}W\9~2ܟ3gzB[zLy4D`'+fKI\9NXͭ M~`^O.97^u4ڧ6KR:ܴI'~r7}E`p \y%nff7o鉦/]==8 Y}0aDK!f[pS7"n,ߎL aB/Ʉm|>݄ L %SzZEmO*'"nsF1ʇT&HwkhLln͓l5(FoĠfjiBׁ&bb͔ nișv+cdZ-[r{]9ʎ9z1d6VDg'OfzK.uO?*={m+Q˴;{ƍ~*Z_c ᆼ%A>^ikq#`Y*z2K^H/!Jm,w}A:Ļck?g&C9-1tR5w[DaeaۓV]5T"1 ( Xikl ` BlܓKhR"01Qal K)PH6?Ui 0@1A@!W5 #Gqq8rʪ#A?y׵$ S","~J TR //b"ޡ03X0\vQ9>*>U]SvM4?GtiefsBh~V&B6_-=33[lJ0^dP~ y^heίSuiy(e^@zbTTCcBdu$6@S_m7K)ư^yyn{U|qִCֽ1ou@=6.L5]yz8ElQ&^yc ֮@>G=&mqiSD(TNե靉Cvy9TA^4R3L7t6Ƕ_j0KQOz&mgIFs :9$YAI2 (O4e}?+fG^|.M\uدՇ컕ث,ibe gpS帲{麋ji+<_9,Uu5E,6 އϐ2 qWE4xnKY(?F) QdxDlR5M)WdUneuQFZ  ATv !_оt*BTQMY?~־zaVZ:ME@VA )O6&ݡÌrDºXfsI$0SZAvsv^xEtyؖ8Kcj+Nތ \ڦfF "^,A03Bm?o,eA/`ۤIҸyԧ.絭41hW|!" ˼H1ᔤ:7f1r6JOD(E7Mkg(މ9,W8LY k$OmT/1 cs:6N"MkL,Z3F"-mdbfđ # 'rvS A$ "rȲJl̻q+,Ĥ ^wn静iY];$/)Jt)%zZVerRH+NxɺM&'7~M!7/ @xWmI~a4uwd%[ukMI\kԂ UMU";AqIU!ѰhtN5z8rڡ.4HSxY3#tFHuL]yə۞Tv*7'mٹM"Ej(g`OTXX,ך49`:dV"" !TT;z/Xl (mδTe5!i-b*2JQ,^tѰcn/8&BԺqt~@&a1腸«'ۤk] ZTеauN^OA,QD` [џFU+ԛ8 NDg|w* ᩙľ2Z{4gSϙIDj*I,4xpCb6bjqٷ"B_.lb)ق)hg շXPɝ]bHe<+5M{&KGv3RP__ҪƮiٟkI,ј )lO6hez(fs1j Ԫ7Ө%1첡H&RI /d~Axk?l[6lCQL6˒QeMC}Z8^\fEsm6荕-t5wr\ÆMy|CCT݌O=o@HWѦAԘʚo 9?_6d^ hCg`Nv֣ʔr\@dG<HWk&tې&|^gjJ-Mv[4nE(:҆/L\ws5Oq-&Y3XE ;^ts:!Dfi׎H*:5y%} RFG2{d]^Ki%:59Fu6lfnh3ͷF߫ut.F0@鳠x?mkqkct::C!*b=7#PޔW{z;%אvd׿eZ5w kJ)|.K.0LSSlCByiAWb<;$M=ZW'% ӧnIVp oz{dAI> "tBR;>a;EУPKS\]bgDm|*'XSPA$.Ng! B8{2W?y? XJ}ɉ-hB$çퟠEA(,F(,XXB,PDF,R ,c,Xc,''0!vl66>r3!Rlc~Gxs~c. m@@k&4x6Cj8A5&906 ?/;j $B F?7y,^O7nS@4$=*R(ͩ !|w XO>6䛁46|%{3DaxtwM! Dyp7ӱ! _PN L2 O z=)L%I!izpԦ{OBF-͒X <;4󖧸o Kb޼ lTL Ct/ݩ~v{Y Tq= ,q9zEn7< E肮xɊ :Vz!6v"maQ[?IO$ Hۜrpv49nsXgj56qҹp,%p?#!>~i!4NP̀'/ ;=fC4!E3FsIS:رb",X$!7fTb@]e @:g!"gպUWQxZCwv=0Lj"Ϭo2H@a GOV{DĞ78NkǕ^D0\Kקjݣjψ}{pPd}WҙsNAݙa@NCc{HemYhvif44\X5& WJ`dc!}D$$Oy"`۱3%V2Ҥo?qg`Òޟ1@w{,>'Q5S%MKWni H >Fw}?Fr?jmuUg[m]u]x+P ;?<ЩeV}HHoS2G*RӼE 1Q$QI)/ YAJYZ80T?@ X:+\ 7=`9R#hC"C/IsF3HrHCveBőjTkek%*TDb*$5\E EttJCJЄ||7cpC@vD5 h1xЉc~ LkP~ m5BNbeI7t/E bY+[Ͱ*12qf iJ' #BS"}a(TKhސ &X$Ƌ10RBtV`Xcf ,i۲ 7;:w%Qd;X)QU*-ٖD:Y,2?cR\~jiUUUDIa:L }+:7SaM`UsCf'\6 ;<.#,G}`; _W ȃ'0$볏 # $؃0OL׃3}] >!"z{RDZxe<'> T 2yy%6D]F`x՗$E(,#:v;ވ$d B-(Ȫ)YȄD$HB(-BPE31>nrNFmM0̮k'17A !ᎹфWjCgKۘQ(Pl01 5rE JuHȤ0"VZ,UY*W Հ۪\ AM> р"h` &jyaVy2r^apb٠DLohL@1%ZL@<iN 4Ϥ_Å7rIZC1 #Ɍ{@h.ֶ\r*lk5%'"A *HBR}m8Ԝ) XA.'r)'v0P]<+-H?_Ŕf ͨDP6p^6+K3u nASt VHGi-Ż:We4?GFXtoi&$hnu^!-Uh uvKj8& mUZ P0ǼM;D#SuӽϘ% DX}1nF~c:e{t jߏ]J#&w@ Ym'Qn$.ν9*&k\x ݲS-A6.InѡA#A޾(fBA$saX" Xˈ\|F QUE>u8!?ܽ;GA}$R@ S\.`gS91H>S Z TGV~ߞ]6.ࠒ&c}EKiڭ.fzUj<)V`d xFપIqgVhDUY;96:s+{Q]!ܭփ!ʱޛ]aClm(S|з3Jf*3g6b+]†!ߛ5I\)h[ Fj+ C4prm[QxLm⫮h3]wGt> *hNCs˝-;hy!ױD& +j48X5ń2h)-W@@\ 6qaBjaf0ҦfDg *?V.O3o'o&7HL$<>lî+u$dx5hrٸ#q.%:y&9ǎ@N.CM"eS#GOwG+a+%l!E/l6%ۼFJ$oX炀Ra͢",J4b+ BmNut@X1J8p6):WI4𭒺'` )Ir4Re]xT1wL:wSt L3S&#YG>OpZ @MArh\bP7$7fX)8Fk!:9t=lƎiR'ýf t20jg vB ]Beţ/`] q ֩܀}Vge,(u q@"hA!-pdD)|]x&AaR@*8Aa']1QBMT6gh%M& ٿ\V;- *A]NP4#'Q>60 -H̺XN!){;E= nG`hgVdvӽf:)9'WUdu7CDyYOKw&1 3ߧxM4"}3F'0;R<o+yHZB婨:)!"F`HHa:QBS$ADur{2PeFqT=x>  !gOddQjb7܆X_x pletu-mQ*5AB2ǹJ$ kj"Vz0QUCd(e]x./..J<("xⰈ) w42uQ $LTJJyIb#D"&2{1Y; ~PWglZQCy?˧Em+/kooMja}KV _U2zû:R_زP؊H~ف<]o 1H85 b "@BSaDvM 5c/]_%nl<(1ASrNiD| (l.0`.I$RA- FO BqkZ@0YJµMG= ՙijB%7ٿHn:挱D#!b gE[c*XW`( He F0QE(΀Hw'@sMll;iu ܛ9;2ch,ML-И}p9lO;g22DeQ>M :0xnao7?d}#P^ :y^ \CIoi\~hqKudl=N;my+]cl j4w(7N!S$Ib t %%气M)ކ} e mAҘV%Z ,KDbZ#7dXn! w]R(+pͲZ1R@qJA"(*(`"R/nq_ }^Sԭ22L)(07Ļ=$({:wg[)4 q4 zЇ\i:dDU"Ȫ{l{ 9UZNS}W;\άL+-ZSȁ1Hx>YT"igzoB}Ԗ;08\-\ $V$Y2DhP 8y$e;F vhj!TjH~ʭλ9|HbWcEa|ۍ};~GR/8i RC0aí};QFI02R0$d[;z ]ǂh&'QpaIvȄql%/dcQE2"igF" HIPKx?d8/s*C;@LGZo9ghTK˅Z@hHo`nfg@MZ(Ui:JCI< r軖FNª@xad~xEŸ(Wx4NI!3TKgsW&8wbXID;xN";~:( E֟1Q*,20x)L5szxd'Y㠱GgT>Xkkt_rfmAYoᑢIC LHCDǷq"jTu2VZ0ohb ՕSΑj.`Tȶo펰s.evv֥XBJB  A)81wGeY HkQ2ͱ Nj:Qsp#S*!gu,艮cY9ۙUTVGm؄CH};/&r`,,EL@9p8Mp$9k!(#78g6J2`DͨԨqK#B<nEj%L$Vj(k Qu(&Ԕ9q.F3~EekeBC֧\;{,^2 c& !ݸ8VR7MۦYsYY,X_hx#v8 7cWfMpvMaqON,lU7YӐx/÷<6wE#%$dJd״3P9EAwV |]!F|mpxrCT-WV傞P'-=ݪ.;+!32TC@{ZEIF;E t#3ی c4B HBH<Tdol߉ןz1E XĈQl1Vc D~ 2h`pHDF$4B:kE4皆fa:j>d !iᰏHCQ5Sp(TFX9 @$Uc /Cq(sQ̒^ZZ`zY Cf?e!ad7hwɯX&"w_TlH @, L K"H<m UZ&^[%Gɍ>lc+ xYGOWW528c:\3h@z>AG\A?9 B&ZZA)b!r:5e"8flOJE pt0t힟&1_)"b=X}YKٍӬ0uF->+!xG$, `Jfc. ;߉C9cP--$c$tJȲH#&D?D@RT *\d2 P"H~bA.@"|?_Ivb"(H,0DirectFB-1.2.10/patches/savagefb-0.3.2-linux-2.4.26.patch.bz20000644000175000017500000004273611164361026017416 00000000000000BZh91AY&SYjf~`Zwm\Ϭ|7}J=}<^n{뚷ݍs ٝ3j}]wD珩N}{=n[uF{@oq]}붌=>|w=w=NBn'4y炙MWZݤݞz=7gvƾHAkn7G}Ku(Aq 4 L LmOLJljOPzM#@=O)Q L) M6@ AHS&T)ScDSL5?Tz&6j414  Pd#F=4=$3T٩O22h# I@S6UOSҟjBz)Rh4&L5B@hD<ѥOOy&SCePCr'Du DC !tAP$" hJ9_x a]>QM'4eLX$?݀Ⱥ6Ȍ`2AbRV#d bB=ªJ%Udd1|[.&A8WMbTa !Rd |` Ż/o~dF?sznڹ TJJ#zNɏ9 2{\9r#K [Q +fkj'vimS1Ch8 |'Eͻ ug,3NE-N*E(}DD&g0Ô k%֪@Pe0YI0HJa*4ЮQAE<,RiE&̩ !Iaim1UÉrגm!1^j'fplb.}gj WpbdaJz@)j5"/#|𹒡TݼHwQMXec&q%H."&~~|dJjap0 d*e1,Mk0`|,)r XXVBn0T6um*vī&ZxN.tjL;\`R2֩V`PMݿ.|`RROҝ;#Y |-LsGxδkV(f8N^ws"8ӓ&ȫeJ"W=6 x0 [#*l.ɲeU&vӧU^rQEYʼn]`īh1fCZqGĐ(E$P '"IXbI$SVX() [3%ngD߼}fN>%μnӎ*$Hza[8 |?%G87M܉¡WgAղX6܈B$b|BDQB@zXFP'Qѡ"T5HZo=_τ4'b(i!+ȡƩ@!d4o~5;gϬB>]2*SU#UN!”vs[x n laЀp7p|im5Au +k` :XU0t+Ay+*@E.l>XO'j<ŞT7ƤM]$;U1DzC &HATl+ 'O`M²(BDE$gp@C%9B 8 *Qj ȡxx}C䴛ySMF",EDb1^g??mc"^} D@:Kfax鶼s ·SKPhƻ5I+D@]gRff ̽i$=6M~%u#`א>[˗߂u9;77jky $D"UcfG}{gZFa%c\,@ssu E+wD')a=p֐ys-I#hnĉwErMqjs04]=r3.bp(/ߢ ["w{u bHuC#Y)<_ؙjp` !m epD.$ {9s=\}i$!JA#PhnɠAúX'>^};>UTE$>uRdr?.tF%lB@4L1;Y2C3x<#b(ƶ#;lܺQ!﹙;B ))< |uUNy01ٍn2%QAOәhrytonwn8"B!BІH) jCƾk8Խ8W-5灺$H-wwuE{ʐyl/22*@!.!4!0'1Hհ%5VEbviMPjP *D,. Y 3OAZ,&m8Z`Ys"dך67'75EEL/6 <􋂆6Tj"BJThcA^՚v]ˁ=>ef#JL>Xbzc|(D{Ѩ<+0Ϯ~:Ν|:ڧ*'}Xl'ߠ| g90OM:ҝg1oo ]tUobj;4-ۑ'Qv` >J6Yt]|Ȣ0fTTQT_LwQ7F^B©a`$-a2BH 0=8YbP B$fH#f}<&TQ8'DZS|z0צױUz-|c0pl7+k' 9Hl\'tsogF٫t¶d\6e+ٗslv7c\IHe1 qꇴ:3V/{ZX$qO7[͠(هϛoNU$4o`C',3ΘTֲ`?W L%:wBAEEA;3(PsyU9r­J7'~‹Zy2pL"\1F. =XǦIѢ}sINja OW)UWVx\A:xm-jm~t]c={Ncm'bPT1TMK!)óX Bqa [&sK TT'ћW_\߆M߼k{ĸULB5XЇ{m;}.xj3f3լ7kf3 ?rerI"ea+^jk7ydxGjff(v[/LdKRؚ Cl mPʕH ,u-xV24-^7녅2c%T<=M7Q(@!X!:'6y`M(fZ^{hgRe4fP`TYGy^Zf3G{u|~{οB3qȁ@]γ(@$Za-v{K}_xJpqgE '8QAE2NB YH< UxNJZ3 +>gw &ҹҎ `ֱmTchu <3 [_tatxJPʖKZ$b1@P$^4~vPR#'=B)4Gd~sPjDӣ~/E6{U3#AA iTH%D)&eg_ꑽN5>A957xNlA`^ZII$Mb= ԙ6\pG2 9 agKԿ=l"'U6K~պ<֊  nI)izTʳG ( 5 tBH$& 3BMni3 ONZwӉIၠ) 9ڬǐMN<?H6qFhg4wbޑR* 3L4 O힅OoHȅph_^x%Z əm{v]:Dq=+Ymq3Ȗ|N|[[1k6C]vV{i]G/rd *ƨxL(0}*Ln (w y"p-y{  EOcsnGs<2H ATXł0Rw~O7ngWO+~߭\svD =$q*1N!kbB!:$"# B}oA G표%K(*0(ȬdDO[eIG!cEΑf$Gtqzx_řܱ{^C)h9YP(NqA.h.L4nNDw.y`g'g.DAA W.lt̸YSk4uh$!͡< twl+'C܍2ǒI͔p_-#_?;&#UqQE+"n7E{2HVvBmXm9lۏ? M. #/{ٰyѨm D~Cg> weZfX˝n78t؈QURW$eLe"-[~K_i%dk{5Ց'eq%Pr-Z*XdC.*T_*4 U EJ/Gt;ۓEх*Hl'%€ 8H'>gSK0sJq;k3LX c*Js,1_j#]&C}3!R,bRPD( ,j6De- AΆ+h"00تFiopd ?U$F"@?>y'h@0TmiX#ruk^l P)U ``%!Y< ?.*  XN9G| v3Z]{ \jӱxt8u3Ta }*AJٓ}'_KYجt| }ֿ{GĀ⥋2 dllj3K/[Z]kh3@.8*Q@u>Q&( ?o]/VYX/Y;x=G_JͰҟ;ZG:L!B/(SXU{tVF+}r >lwd޷kwDa@ sB# ࣴ]sҥJB^N@箽#Hr4 pKؓB  n>4٦ Jxu^ * &dX6E NmBuM\+fxnݢ / |~s?0.Ĥ"_EBp36fNKt3Ez4ABRXlB v~0L!!qqFf5O0S(d3CQQAI9sXh ]Mɑ3wJ%1dȉ9|Huo^H(owgGÍX8iY"*ƾ[,T -iS-ZPuS'RvVd+C JpWjo9$$ r/B[^kާB{wy;`7` dQ,MQ" ;"f3T',J -rDH}@ ~'@'(3ei}9eV1ܸ5h!#.T\Ed`?Vd(fXh6:4"""ZRԛzG TT}w-를d12U O4VsQ-\0/MY4is]|7L BUp*]R7o=:C%ύѭh/L13_;w*oD]HXFm{`v%R1CT|)f1iTWJ :bB!M^ad31n2v ;#=3$doM;gz]$`FÃ'`,H-Tf94` G1P-lSd&LZWǀa1dKP+CZ8pLlԂ唴4iD#/ CLd6.#pw5W0ق0kЍZ+I\Pdj 2 #bE'@5uDF (ņ*Q` @@R"#$#pH((}e~Mz2>=)82UHM$x׶'gJmazN+&K@?% |Lf;oGg}QMBkAi&^`3k֠8Uqf#t'D3D%]'hg@֡ZH$2R~j.a bdĹ0eYոbgO<8!grΟ-u1^O(iv~@僃@pkz噔r;$϶H:;G}`tlY &6 oEo2xYMYC P[EڙKI$ː>+eW"YopJJybO EݜXy/P8`)5UEcsqllCgA 6g8/G=h^ge:.A- +0ҹ %^%}sO'kj9P>T T/\lIB" FǞI.0 ˨Ӕ&!n~b5!ݒJ+yB HXR'tMԉ~H#IQaa0ēCZl# ${7vjt4fХT޳t:Ь:桥[A! G"GY )14=)dP9@.j !TT;zX~du04RNq3H<`>,PB(/NQ0(7+߫αDdp&p*d=a^S]*ׇ̳D ddAV;k\v<8MBj`lbd2@2b"Ҩ!ZN uHDY[j,$͙|aD'qCofOr0"g'XtZ)K͂)Qn"Ns9pf4:g$&Ch p8g|@,Ű9cpMΤ:L?_u6}=;Å Ʈ'aAfaPt" A$`!&t9p_ŏVEGa0Y[I^9 D7>ZdyFf},R=wY}[f-.K | t7'r“!Tm1:PYz-iG_ D.:83ÝvkoJ,qs_Q#elM#.WDu}N"@#60soLRR gy(v.{(5;fǭɞV^ &`ws{};#PYJf +/+do_H/>^Sʄ>]?yW.1И/``]؆b~аٓl⢼ǘ}߼Y5D}WG$)۹jH\oӯ Ik :40/ $/]o`נ ~NȇX(|ʇQ Yp9+ի+%0)e$OIdRS090r~#,X,X("Ŋ#)1,X|EaBN;h ?ԏ<468O|f]}xZ: #խ31v cOw:4=f>s58նW]AfͫXxQQ$@t_ӽ|='&ҔIL$Yu'& (5YЭhdrTĬ|_ϲ;Tn_xWqyWU @SgČS!]/ jOٷIxy#ּ5i=˭F b_N2boVFA _ t!"{:<:=MRGN!e=CJ #fSΞ3]27\^ #Eؿ0Ӫ]QfՊ`}chL!:U;,R9paw}zPv =; $Q8ZcJ"{dJQNÿ>!t4D7  a`H(8d4"P{T{Ϥˣ{5 N$C+*`)Ԃj@&)UYtM^k,sN,X(,PQc8jnp`a(5 [:4`!?97: F7+cJo,a&R@I2B!%:=^O7}edwQ Ȃj[$~3\մl6 L})N&.& q SP=$eKa.(b.t.OhtC֘'wMa:D+[AbȘ;utt-o;ғkcHq[lgzUI |~0nJ0eξqpi<nj˷t'gmmdmUUQa3[ ڃ2t_X_?UwOI!ЯcAޱn΍ cG7,Mji|!`#,mW5T@fq#f3s6xv)Qԡ "%7D5%1KHF&&#ЪQ`4%>"'DjUQ+s  Ab`SHcq J3dtف4 Wx),=`*11:Om%ČN|HI!~|p? eUUUDWo<ߟ7򉹾v >d)K|{XB&C7ܐ"HAN=>@-aI| 4?Ld7qMۊ ="B#&9TMG鈜8\Ѐ%=șmh 8_D\"# YA/LKde*2,V* !#";&[1"p6$C+ɵ]"!s~ aff,4J00`[=1ӳ'JEyD}HF!LsKfgE͜^u.}1qWKVq=OH[!jj`<->[!!#-Zg!ʚ,!圿Zp:6ed0FcOX `B>3`Z(Uwsy窫krw!,(_PiIav'1*[1/(٬@M3 Uj0" :9W۝BtE-Pļ=R@ Aʒ/L kv,KJjQDȧtI<(z6Y!/҉dAj7n4Or8 r?k*__R=*-żu.$B"Éf2 7m/cUv$Y]h\a5g!p1+T AY>d T5ʉs;kYY~sUV׋ il)r)һSEz"ӿ}8O-[; EwE(#ǖy` Z̗ "uI!}*IVRV/z9(ENnU {L̈́ V}f%ތ7Y]L< dE+J\7Cp?L\޽[~mqC]N2 L O> wב+>sڠk/~$q+'!Ы!iLU',pV`4T!Vд)jN{ё6UUUUUWprbY0!Rӿ:9cN'3,ܭ" FJGg,^|Ts:!(f]DLBȽ*]E/W6Y'v߮dCi$S*h[F h!6rL}^ZIB#8LcTgt=7M`ɴ+ܒԳwQf(fQ!"B8Æ\2lk&7 v6Y3Hȁ0dt_ IMa \3`6~T{Eh1YVa|ܾvR+H.欧ض0₧ ZKعKtPLs $QZ(J fQ̈́'O>H!v 6{.`86 q:&!DEEg,4nhI"@<inc^DZ ޚà¶Ι6M Q$P[%qXF@˜] mz 4J/mLV::GfFxʦLGwj_/ tQ I"F ۞|, OТ=M&$le~E7>D&:+ MӔg} r/tDgHmwq ةMJG T!"ALLJ 5 qUՁ2I9ˊRyTc砲rz;D~XU l ?ƔtAMVT41h%MXL y{z2:AA]7|p<T>hw^=IhJ}˝Q]"kfGe;lFR@9 1TH9ZDTf͵J["F =JwN+ FH]3lD!'@6v ina Sp@M89PKf ,}8 D06H0+Sih*{"5D'&B3nX TcJgѫ:UMv9XGlx[(s6N%f5V _-d*D,cHD/CP؊H7h+{7zMŰǂ q95$l4*FTHzЅH0a ҧfG4^c|1 %'15J(ڽۮ.ظ1u kEV0H) ttQ w_ ?'Y,(akcgM 67ep!"0V"@dat[!.:o3T>uL{S$D&[TB*:0j0W,,1HEOE ,QomA9!XY`+ 4{ZV z0r% eo Ze)YDza41iRcR;EfAnU@5MzK /Br_:d?Xԇ\H~W5ӽ7X0zJ4v4tszH ( i"ԩT'$M,#CI,4958hRyg BI}'tlg1\!ruƪt!06vo5yS`6 8· f!axqͳ>f2g$x8.` .ffOǰpfv P7!X$363jQFWp7_5ާT?ibɚA{{u ?0 1dd'% 44CIqVC`vDHBzZ 9}C4&z쁰 ) ܇'j0#P48KөMn`K܁ciZl`ww{U3 :טᛵu^6>$06zo]).yuZc%ppy_)_;?]H{:@C"9Oxj="@aNNRH{DU"Ȫ|G| g@{!:*P BƫS]Z䅔>s() eRhigpnC9urvԷpB#Na/S$ HhAv޻9$̔3]4 QhL[ٛrbޑ{YIz=h1Ʀ][%{1|+ ۮv|8kIko*ͦt *$Xqpnc][ 'wGbzLN!RϠ$0 %EKigFd!PKX_p73ю xwOP=(Sx=MP#]I*Xq gJ-iV Ue g, Z(͑pJu ߉\fA7a ׉$XOBaP+ZmxmT grd+je*h@ Alt|Ob :@CVDQOq?\PU@dfڇ~pXΛLmk* ;M3,р sxGHNAk2$و09BdxyvlMd$&P/҆#C[l"JP0֩I !p_͌oqއ;LbYIxh 8%=^yEMItowvFLC\HZ[]hcSvҪ{L aD` Cyo !Qi4۰ 6}>.ܓh= C;Rfhe/J$u؎& PB8Cɣ9 i`B'J=z!n^ZDCPk%cƨ}!xۆQƄK2 HH #x!4;-1336`5Q'aVa"Z>dɜ`4n"!r rno-!4IF,yzD I$X"BY" <$$"P'5P 2HEߠ:ـFH@4g~=}HDځ s( ^vΑ, AApВ76*@,@DTGPU~*_~%X("h"+L,|3=6W#![P 2rrDcr6M^;#UMB[Z%33,qOIB &AAi dY 41aFA` !!&VOKP}/~/㿁ڰCH  SW<@DirectFB-1.2.10/patches/README.fusion0000644000175000017500000000007311164361026013747 00000000000000Please download linux-fusion separately from the web site. DirectFB-1.2.10/configure0000755000175000017500000354643611307521475012077 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="include/directfb.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias DIRECTFB_MAJOR_VERSION DIRECTFB_MINOR_VERSION DIRECTFB_MICRO_VERSION DIRECTFB_INTERFACE_AGE DIRECTFB_BINARY_AGE DIRECTFB_VERSION LT_RELEASE LT_CURRENT LT_BINARY LT_REVISION LT_AGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar PKG_CONFIG MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CCAS CCASFLAGS CCASDEPMODE am__fastdepCCAS_TRUE am__fastdepCCAS_FALSE SED GREP EGREP LN_S ECHO AR RANLIB DSYMUTIL NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LD PERL MAN2HTML HAVE_MAN2HTML_TRUE HAVE_MAN2HTML_FALSE OSX_CORE_TRUE OSX_CORE_FALSE X11_CORE_TRUE X11_CORE_FALSE HAVE_LINUX_TRUE HAVE_LINUX_FALSE BUILDPPCASM_TRUE BUILDPPCASM_FALSE THREADFLAGS THREADLIB DYNLIB AS ASFLAGS ENABLE_DEBUG_TRUE ENABLE_DEBUG_FALSE DIRECT_BUILD_DEBUG ENABLE_DEBUGS_TRUE ENABLE_DEBUGS_FALSE DIRECT_BUILD_DEBUGS ENABLE_TRACE_TRUE ENABLE_TRACE_FALSE DIRECT_BUILD_TRACE DIRECT_BUILD_TEXT DIRECT_BUILD_GETTID DIRECT_BUILD_NETWORK DIRECT_BUILD_STDBOOL ENABLE_MULTI_TRUE ENABLE_MULTI_FALSE FUSION_BUILD_MULTI FUSION_BUILD_KERNEL ENABLE_VOODOO_TRUE ENABLE_VOODOO_FALSE ENABLE_UNIQUE_TRUE ENABLE_UNIQUE_FALSE BUILDMMX_TRUE BUILDMMX_FALSE DEVMEM_CORE_TRUE DEVMEM_CORE_FALSE FBDEV_CORE_TRUE FBDEV_CORE_FALSE SDL_CFLAGS SDL_LIBS OSX_LIBS SDL_CORE_TRUE SDL_CORE_FALSE VNC_CONFIG VNC_CORE_TRUE VNC_CORE_FALSE VNC_LIBS VNC_CFLAGS SYSFS_LIBS JPEG_PROVIDER_TRUE JPEG_PROVIDER_FALSE ZLIB_LIBS LIBPNG_CONFIG PNG_PROVIDER_TRUE PNG_PROVIDER_FALSE BUILD_DIRECTFB_CSOURCE_TRUE BUILD_DIRECTFB_CSOURCE_FALSE GIF_PROVIDER_TRUE GIF_PROVIDER_FALSE FREETYPE_CFLAGS FREETYPE_LIBS FREETYPE_PROVIDER_TRUE FREETYPE_PROVIDER_FALSE V4L_PROVIDER_TRUE V4L_PROVIDER_FALSE TSLIB_CFLAGS TSLIB_LIBS SOFTWARE_RENDERING_TRUE SOFTWARE_RENDERING_FALSE DFB_SMOOTH_SCALING FUSION_MESSAGE_SIZE RUNTIME_SYSROOT DIRECTFB_CSOURCE GFX_ATI128_TRUE GFX_ATI128_FALSE GFX_CLE266_TRUE GFX_CLE266_FALSE GFX_CYBER5K_TRUE GFX_CYBER5K_FALSE GFX_DAVINCI_TRUE GFX_DAVINCI_FALSE GFX_EP9X_TRUE GFX_EP9X_FALSE GFX_I810_TRUE GFX_I810_FALSE GFX_I830_TRUE GFX_I830_FALSE GFX_MACH64_TRUE GFX_MACH64_FALSE GFX_MATROX_TRUE GFX_MATROX_FALSE GFX_NEOMAGIC_TRUE GFX_NEOMAGIC_FALSE GFX_NSC_TRUE GFX_NSC_FALSE GFX_NVIDIA_TRUE GFX_NVIDIA_FALSE GFX_OMAP_TRUE GFX_OMAP_FALSE GFX_RADEON_TRUE GFX_RADEON_FALSE GFX_SAVAGE_TRUE GFX_SAVAGE_FALSE GFX_SH772X_TRUE GFX_SH772X_FALSE GFX_SIS315_TRUE GFX_SIS315_FALSE GFX_TDFX_TRUE GFX_TDFX_FALSE GFX_UNICHROME_TRUE GFX_UNICHROME_FALSE GFX_VMWARE_TRUE GFX_VMWARE_FALSE DBOX2REMOTE_TRUE DBOX2REMOTE_FALSE DREAMBOXREMOTE_TRUE DREAMBOXREMOTE_FALSE DYNAPRO_INPUT_TRUE DYNAPRO_INPUT_FALSE ELO_INPUT_TRUE ELO_INPUT_FALSE GUNZE_INPUT_TRUE GUNZE_INPUT_FALSE H3600_TS_TRUE H3600_TS_FALSE JOYSTICK_INPUT_TRUE JOYSTICK_INPUT_FALSE KEYBOARD_INPUT_TRUE KEYBOARD_INPUT_FALSE LINUX_INPUT_TRUE LINUX_INPUT_FALSE LIRC_INPUT_TRUE LIRC_INPUT_FALSE MUTOUCH_TS_TRUE MUTOUCH_TS_FALSE PENMOUNT_TS_TRUE PENMOUNT_TS_FALSE PS2MOUSE_INPUT_TRUE PS2MOUSE_INPUT_FALSE SERIAL_MOUSE_INPUT_TRUE SERIAL_MOUSE_INPUT_FALSE SONYPI_TRUE SONYPI_FALSE TSLIB_TRUE TSLIB_FALSE UCB1X00_TS_TRUE UCB1X00_TS_FALSE WM97XX_TS_TRUE WM97XX_TS_FALSE BUILD_TESTS_TRUE BUILD_TESTS_FALSE BUILD_TOOLS_TRUE BUILD_TOOLS_FALSE CROSS_COMPILING_TRUE CROSS_COMPILING_FALSE BUILD_SHARED_TRUE BUILD_SHARED_FALSE BUILD_STATIC_TRUE BUILD_STATIC_FALSE SOPATH HAVE_LINUX DFB_CFLAGS_OMIT_FRAME_POINTER DFB_LDFLAGS DFB_INTERNAL_CFLAGS X11_CFLAGS X11_LIBS GIF_PROVIDER JPEG_PROVIDER PNG_PROVIDER LIBJPEG LIBPNG FREETYPE_PROVIDER DATADIR MODULEDIR MODULEDIRNAME INCLUDEDIR INTERNALINCLUDEDIR SYSCONFDIR LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG CC CFLAGS LDFLAGS LIBS CPPFLAGS CCAS CCASFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS SDL_CFLAGS SDL_LIBS FREETYPE_CFLAGS FREETYPE_LIBS TSLIB_CFLAGS TSLIB_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-osx build with Mac OS X support [default=auto] --enable-x11 build with X11 support [default=auto] --enable-extra-warnings enable extra warnings [default=no] --enable-profiling enable profiling support [default=no] --enable-debug enable debugging [default=no] --enable-debug-support enable debugging support [default=yes] --enable-trace enable call tracing [default=no] --enable-text enable text output [default=yes] --enable-gettid enable usage of gettid() [default=yes] --enable-network enable network support [default=yes] --enable-multi enable multi application core [default=no] --enable-voodoo enable Voodoo (network support) [default=no] --enable-unique enable Unique (WM Module) [default=no] --enable-mmx enable MMX support [default=auto] --enable-sse enable SSE support [default=auto] --enable-devmem build with generic /dev/mem support [default=yes] --enable-fbdev build with linux fbdev support [default=auto] --enable-sdl build with SDL support [default=no] --enable-vnc build with VNC support [default=auto] --enable-sysfs build with sysfs support [default=auto] --enable-jpeg build JPEG image provider [default=yes] --enable-zlib use zlib, e.g. for screen shots [default=no] --enable-png build PNG image provider [default=yes] --enable-gif build GIF image/video provider [default=yes] --enable-freetype build FreeType2 font provider [default=yes] --enable-video4linux build Video4Linux video provider [default=yes] --enable-video4linux2 build with Video4Linux2 support [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-gfxdrivers= compile gfxdrivers in gfxdrivers may be comma separated 'all' builds all drivers (default), 'none' builds none Possible gfxdrivers are: ati128, cle266, cyber5k, davinci, ep9x, i810, i830, mach64, matrox, neomagic, nsc, nvidia, omap, radeon, savage, sh772x, sis315, tdfx, unichrome, vmware --with-inputdrivers= compile inputdrivers in inputdrivers may be comma separated 'all' builds all drivers (default), 'none' builds none Possible inputdrivers are: dbox2remote, dreamboxremote, dynapro, elo-input, gunze, h3600_ts, joystick, keyboard, linuxinput, lirc, mutouch, penmount, ps2mouse, serialmouse, sonypijogdial, tslib, ucb1x00, wm97xx --without-software build without software rendering (can decrease binary size by >100k) --with-smooth-scaling build with smooth software scaling code (can increase binary size by >100k) --with-tests build test programs --with-message-size=SIZE allow fusion messages up to SIZE bytes [default=1024] --without-tools do not build any tools --with-sysroot=DIR search for lib/share et al within DIR at runtime (e.g. when loading modules) Some influential environment variables: PKG_CONFIG path to pkg-config utility CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags SDL_CFLAGS C compiler flags for SDL, overriding pkg-config SDL_LIBS linker flags for SDL, overriding pkg-config FREETYPE_CFLAGS C compiler flags for FREETYPE, overriding pkg-config FREETYPE_LIBS linker flags for FREETYPE, overriding pkg-config TSLIB_CFLAGS C compiler flags for TSLIB, overriding pkg-config TSLIB_LIBS linker flags for TSLIB, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # # Making releases: # DIRECTFB_MICRO_VERSION += 1; # DIRECTFB_INTERFACE_AGE += 1; # DIRECTFB_BINARY_AGE += 1; # if any functions have been added, set DIRECTFB_INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set DIRECTFB_BINARY_AGE and DIRECTFB_INTERFACE_AGE to 0. # # DIRECTFB_MAJOR_VERSION=1 DIRECTFB_MINOR_VERSION=2 DIRECTFB_MICRO_VERSION=10 DIRECTFB_INTERFACE_AGE=1 DIRECTFB_BINARY_AGE=1 DIRECTFB_VERSION=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION.$DIRECTFB_MICRO_VERSION cat >>confdefs.h <<_ACEOF #define DIRECTFB_VERSION "$DIRECTFB_VERSION" _ACEOF # libtool versioning LT_RELEASE=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION LT_CURRENT=`expr $DIRECTFB_MICRO_VERSION - $DIRECTFB_INTERFACE_AGE` LT_BINARY=`expr $DIRECTFB_MICRO_VERSION - $DIRECTFB_BINARY_AGE` LT_REVISION=$DIRECTFB_INTERFACE_AGE LT_AGE=`expr $DIRECTFB_BINARY_AGE - $DIRECTFB_INTERFACE_AGE` # The earliest version that this release has binary compatibility with. # This is used for module locations. BINARY_VERSION=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION-$LT_BINARY VERSION=$DIRECTFB_VERSION PACKAGE=DirectFB ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- am__api_version='1.10' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=$PACKAGE VERSION=$VERSION # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PKG_CONFIG="" fi fi ac_config_headers="$ac_config_headers config.h" { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi case x"$target" in xNONE | x) target_or_host="$host" ;; *) target_or_host="$target" ;; esac case "$target_or_host" in *-cygwin) ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CCAS_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 5076 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 echo "${ECHO_T}$DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { echo "$as_me:$LINENO: result: $NMEDIT" >&5 echo "${ECHO_T}$NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. echo "int foo(void){return 1;}" > conftest.c $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib ${wl}-single_module conftest.c if test -f libconftest.dylib; then lt_cv_apple_cc_single_mod=yes rm -rf libconftest.dylib* fi rm conftest.c fi fi { echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_ld_exported_symbols_list=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[0123]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil="~$DSYMUTIL \$lib || :" else _lt_dsymutil= fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8128: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8132: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8418: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8422: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8522: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8526: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ compiler_lib_search_dirs \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ fix_srcfile_path \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= compiler_lib_search_dirs_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" if test "$GXX" = yes ; then output_verbose_link_cmd='echo' archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else ld_shlibs_CXX=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext compiler_lib_search_dirs_CXX= if test -n "$compiler_lib_search_path_CXX"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13400: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13404: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13504: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13508: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ compiler_lib_search_dirs_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15102: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15106: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; } if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; } if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15206: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15210: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ compiler_lib_search_dirs_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17426: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17430: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; rdos*) lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17716: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17720: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_GCJ=yes fi else lt_cv_prog_compiler_static_works_GCJ=yes fi fi $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17820: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17824: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_GCJ=no fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" fi sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" fi sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ compiler_lib_search_dirs_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ compiler_lib_search_dirs_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The directories searched by this compiler when creating a shared # library compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6; } if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef int ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of long long" >&5 echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef long long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF ## Work around libstuhl during cross build... if test "$host" != "$build"; then sys_lib_dlsearch_path_spec="" sys_lib_search_path_spec="" fi for ac_prog in perl5 perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$PERL" && break done # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MAN2HTML+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAN2HTML in [\\/]* | ?:[\\/]*) ac_cv_path_MAN2HTML="$MAN2HTML" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MAN2HTML="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAN2HTML" && ac_cv_path_MAN2HTML="no" ;; esac fi MAN2HTML=$ac_cv_path_MAN2HTML if test -n "$MAN2HTML"; then { echo "$as_me:$LINENO: result: $MAN2HTML" >&5 echo "${ECHO_T}$MAN2HTML" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$MAN2HTML" != "no"; then HAVE_MAN2HTML_TRUE= HAVE_MAN2HTML_FALSE='#' else HAVE_MAN2HTML_TRUE='#' HAVE_MAN2HTML_FALSE= fi # Check whether --enable-osx was given. if test "${enable_osx+set}" = set; then enableval=$enable_osx; else enable_osx=yes fi if test "$enable_osx" = "yes"; then if test "${ac_cv_header_Carbon_Carbon_h+set}" = set; then { echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5 echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6; } if test "${ac_cv_header_Carbon_Carbon_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5 echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking Carbon/Carbon.h usability" >&5 echo $ECHO_N "checking Carbon/Carbon.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking Carbon/Carbon.h presence" >&5 echo $ECHO_N "checking Carbon/Carbon.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: Carbon/Carbon.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5 echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6; } if test "${ac_cv_header_Carbon_Carbon_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_Carbon_Carbon_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5 echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6; } fi if test $ac_cv_header_Carbon_Carbon_h = yes; then osx_found=yes else osx_found=no fi if test "$osx_found" = no; then enable_osx=no { echo "$as_me:$LINENO: WARNING: *** no Carbon/Carbon.h found -- building without Mac OS X support." >&5 echo "$as_me: WARNING: *** no Carbon/Carbon.h found -- building without Mac OS X support." >&2;} else OSX_LIBS="-framework Carbon" fi fi if test "$enable_osx" = "yes"; then OSX_CORE_TRUE= OSX_CORE_FALSE='#' else OSX_CORE_TRUE='#' OSX_CORE_FALSE= fi # Check whether --enable-x11 was given. if test "${enable_x11+set}" = set; then enableval=$enable_x11; else enable_x11=yes fi if test "$enable_x11" = "yes"; then CFLAGS_saved="$CFLAGS" CFLAGS="$CFLAGS -I/usr/X11R6/include" if test "${ac_cv_header_X11_X_h+set}" = set; then { echo "$as_me:$LINENO: checking for X11/X.h" >&5 echo $ECHO_N "checking for X11/X.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_X_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_X_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_X_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking X11/X.h usability" >&5 echo $ECHO_N "checking X11/X.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking X11/X.h presence" >&5 echo $ECHO_N "checking X11/X.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: X11/X.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: X11/X.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: X11/X.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: X11/X.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: X11/X.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: X11/X.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: X11/X.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: X11/X.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: X11/X.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: X11/X.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: X11/X.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: X11/X.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: X11/X.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: X11/X.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: X11/X.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: X11/X.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for X11/X.h" >&5 echo $ECHO_N "checking for X11/X.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_X_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_X11_X_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_X_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_X_h" >&6; } fi if test $ac_cv_header_X11_X_h = yes; then x11_found=yes else x11_found=no fi CFLAGS="$CFLAGS_saved" if test "$x11_found" = no; then enable_x11=no { echo "$as_me:$LINENO: WARNING: *** no X11/X.h found -- building without X11 support." >&5 echo "$as_me: WARNING: *** no X11/X.h found -- building without X11 support." >&2;} else X11_LIBS="-L/usr/X11R6/lib -lX11 -lXext" X11_CFLAGS="-I/usr/X11R6/include" fi fi if test "$enable_x11" = "yes"; then X11_CORE_TRUE= X11_CORE_FALSE='#' else X11_CORE_TRUE='#' X11_CORE_FALSE= fi for ac_header in linux/compiler.h linux/unistd.h asm/page.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test x"$CFLAGS" = x"-g -O2"; then CFLAGS= fi CFLAGS="-O3 -ffast-math -pipe $CFLAGS" DFB_INTERNAL_CFLAGS="-D_GNU_SOURCE $DFB_INTERNAL_CFLAGS" # Check whether --enable-extra-warnings was given. if test "${enable_extra_warnings+set}" = set; then enableval=$enable_extra_warnings; else enable_extra_warnings=no fi if test "$enable_extra_warnings" = "yes"; then CFLAGS="-W -Wno-sign-compare -Wno-unused-parameter -Wundef -Wcast-qual -Wcast-align -Waggregate-return -Wmissing-declarations -Winline $CFLAGS" fi # FIXME #if test "$GCC" = "yes"; then # CFLAGS="-Wall -Wno-strict-aliasing $CFLAGS" #fi # # check target architecture # have_x86=no have_x86_64=no have_arm=no have_ppc=no have_sh4=no case "$target_or_host" in i*86-*-*) have_x86=yes cat >>confdefs.h <<\_ACEOF #define ARCH_X86 1 _ACEOF ;; x86_64-*) have_x86=yes have_x86_64=yes cat >>confdefs.h <<\_ACEOF #define ARCH_X86_64 1 _ACEOF ;; *arm*) have_arm=yes ;; ppc-*-linux* | powerpc-*) have_ppc=yes cat >>confdefs.h <<\_ACEOF #define ARCH_PPC 1 _ACEOF ;; sh4-* | sh3-*) have_sh4=yes cat >>confdefs.h <<\_ACEOF #define ARCH_SH4 1 _ACEOF ;; *) ;; esac have_linux=no have_cygwin=no have_kos=no need_libc_r=no need_libdl=yes want_ppcasm=yes case "$target_or_host" in *-linux*) have_linux=yes ;; *-cygwin) have_cygwin=yes need_libdl=no ;; *-freebsd*) need_libc_r=yes need_libdl=no want_ppcasm=yes CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; *-openbsd*) need_libc_r=yes need_libdl=no want_ppcasm=no CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; *-netbsd*) need_libc_r=no need_libdl=no want_ppcasm=yes CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -L/usr/pkg/lib" ;; *-darwin*) need_libc_r=no need_libdl=yes want_ppcasm=no CPPFLAGS="$CPPFLAGS -I/sw/include" LDFLAGS="$LDFLAGS -L/sw/lib" ;; sh-*-elf) if test "$CC" = "kos-cc"; then need_libc_r=no need_libdl=no have_kos=yes fi ;; esac if test "$have_linux" = "yes"; then HAVE_LINUX_TRUE= HAVE_LINUX_FALSE='#' else HAVE_LINUX_TRUE='#' HAVE_LINUX_FALSE= fi if test "$have_ppc" = "yes" && test "$want_ppcasm" = "yes"; then BUILDPPCASM_TRUE= BUILDPPCASM_FALSE='#' else BUILDPPCASM_TRUE='#' BUILDPPCASM_FALSE= fi if test "$have_ppc" = "yes" && test "$want_ppcasm" = "yes"; then cat >>confdefs.h <<\_ACEOF #define USE_PPCASM 1 _ACEOF fi if test "$have_kos" = "yes"; then cat >>confdefs.h <<\_ACEOF #define USE_KOS 1 _ACEOF fi THREADFLAGS="-D_REENTRANT" if test "$have_kos" = "no"; then if test "$need_libc_r" = "yes"; then { echo "$as_me:$LINENO: checking for pthread_attr_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_attr_init (); int main () { return pthread_attr_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_attr_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_attr_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_attr_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6; } if test $ac_cv_lib_c_r_pthread_attr_init = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBC_R 1 _ACEOF LIBS="-lc_r $LIBS" else { { echo "$as_me:$LINENO: error: *** DirectFB requires phtreads in libc_r." >&5 echo "$as_me: error: *** DirectFB requires phtreads in libc_r." >&2;} { (exit 1); exit 1; }; } fi THREADLIB="-lc_r" else { echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_attr_init (); int main () { return pthread_attr_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_attr_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_attr_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_attr_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6; } if test $ac_cv_lib_pthread_pthread_attr_init = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" else { { echo "$as_me:$LINENO: error: *** DirectFB requires libpthread." >&5 echo "$as_me: error: *** DirectFB requires libpthread." >&2;} { (exit 1); exit 1; }; } fi THREADLIB="-lpthread" fi fi { echo "$as_me:$LINENO: checking whether PTHREAD_MUTEX_RECURSIVE is declared" >&5 echo $ECHO_N "checking whether PTHREAD_MUTEX_RECURSIVE is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _GNU_SOURCE #include int main () { #ifndef PTHREAD_MUTEX_RECURSIVE (void) PTHREAD_MUTEX_RECURSIVE; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" >&5 echo "${ECHO_T}$ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE" >&6; } if test $ac_cv_have_decl_PTHREAD_MUTEX_RECURSIVE = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PTHREAD_MUTEX_RECURSIVE 0 _ACEOF { echo "$as_me:$LINENO: WARNING: *** PTHREAD_MUTEX_RECURSIVE is not defined! Dead locks might occur!" >&5 echo "$as_me: WARNING: *** PTHREAD_MUTEX_RECURSIVE is not defined! Dead locks might occur!" >&2;} fi { echo "$as_me:$LINENO: checking whether PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is declared" >&5 echo $ECHO_N "checking whether PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _GNU_SOURCE #include int main () { #ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP (void) PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP" >&5 echo "${ECHO_T}$ac_cv_have_decl_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP" >&6; } if test $ac_cv_have_decl_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 0 _ACEOF { echo "$as_me:$LINENO: WARNING: *** PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not defined! Dead locks might occur!" >&5 echo "$as_me: WARNING: *** PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not defined! Dead locks might occur!" >&2;} fi CPPFLAGS="$THREADFLAGS $CPPFLAGS" DYNLIB="" if test "$need_libdl" = "yes"; then if test "$enable_shared" = "yes"; then { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" else { { echo "$as_me:$LINENO: error: *** DirectFB requires libdl." >&5 echo "$as_me: error: *** DirectFB requires libdl." >&2;} { (exit 1); exit 1; }; } fi DYNLIB="-ldl" fi fi if test "$have_x86" = "yes"; then ## ## HACK HACK HACK automake uses @AS@ like a gcc ## AS=$CC ASFLAGS=$CFLAGS cat >>confdefs.h <<\_ACEOF #define HAVE_INB_OUTB_IOPL 1 _ACEOF { echo "$as_me:$LINENO: checking for sys/io.h" >&5 echo $ECHO_N "checking for sys/io.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char x = inb(0); (void)x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYSIO 1 _ACEOF have_sysio=yes { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else have_sysio=no fi # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; else enable_profiling=no fi if test "$enable_profiling" = "yes"; then CFLAGS="$CFLAGS -pg -g3" else DFB_CFLAGS_OMIT_FRAME_POINTER="-fomit-frame-pointer" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; else enable_debug=no fi if test "$enable_debug" = "yes"; then CFLAGS="$CFLAGS -g3 -fno-inline -Wno-inline" DIRECT_BUILD_DEBUG=1 else DIRECT_BUILD_DEBUG=0 fi if test "$enable_debug" = "yes"; then ENABLE_DEBUG_TRUE= ENABLE_DEBUG_FALSE='#' else ENABLE_DEBUG_TRUE='#' ENABLE_DEBUG_FALSE= fi # Check whether --enable-debug-support was given. if test "${enable_debug_support+set}" = set; then enableval=$enable_debug_support; else enable_debug_support=yes fi if test "$enable_debug_support" = "yes" || test "$enable_debug" = "yes"; then enable_debug_support=yes DIRECT_BUILD_DEBUGS=1 else DIRECT_BUILD_DEBUGS=0 fi if test "$enable_debug_support" = "yes"; then ENABLE_DEBUGS_TRUE= ENABLE_DEBUGS_FALSE='#' else ENABLE_DEBUGS_TRUE='#' ENABLE_DEBUGS_FALSE= fi # Check whether --enable-trace was given. if test "${enable_trace+set}" = set; then enableval=$enable_trace; else enable_trace=no fi if test "$enable_trace" = "yes"; then DFB_INTERNAL_CFLAGS="$DFB_INTERNAL_CFLAGS -finstrument-functions" DIRECT_BUILD_TRACE=1 else DIRECT_BUILD_TRACE=0 fi if test "$enable_trace" = "yes"; then ENABLE_TRACE_TRUE= ENABLE_TRACE_FALSE='#' else ENABLE_TRACE_TRUE='#' ENABLE_TRACE_FALSE= fi # Check whether --enable-text was given. if test "${enable_text+set}" = set; then enableval=$enable_text; else enable_text=yes fi if test "$enable_text" = "no"; then DIRECT_BUILD_TEXT=0 else DIRECT_BUILD_TEXT=1 fi # Check whether --enable-gettid was given. if test "${enable_gettid+set}" = set; then enableval=$enable_gettid; else enable_gettid=yes fi if test "$enable_gettid" = "no"; then DIRECT_BUILD_GETTID=0 else DIRECT_BUILD_GETTID=1 fi # Check whether --enable-network was given. if test "${enable_network+set}" = set; then enableval=$enable_network; else enable_network=yes fi if test "$enable_network" = "no"; then DIRECT_BUILD_NETWORK=0 else DIRECT_BUILD_NETWORK=1 fi if test "${ac_cv_header_stdbool_h+set}" = set; then { echo "$as_me:$LINENO: checking for stdbool.h" >&5 echo $ECHO_N "checking for stdbool.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking stdbool.h usability" >&5 echo $ECHO_N "checking stdbool.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking stdbool.h presence" >&5 echo $ECHO_N "checking stdbool.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdbool.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdbool.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdbool.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdbool.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdbool.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdbool.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdbool.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdbool.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdbool.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdbool.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdbool.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdbool.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdbool.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdbool.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdbool.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdbool.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for stdbool.h" >&5 echo $ECHO_N "checking for stdbool.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdbool_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } fi if test $ac_cv_header_stdbool_h = yes; then DIRECT_BUILD_STDBOOL=1 else DIRECT_BUILD_STDBOOL=0 fi linux_fusion="N/A" # Check whether --enable-multi was given. if test "${enable_multi+set}" = set; then enableval=$enable_multi; else enable_multi=no fi if test "$enable_multi" = "yes"; then linux_fusion=yes if test "${ac_cv_header_linux_fusion_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/fusion.h" >&5 echo $ECHO_N "checking for linux/fusion.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_fusion_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_fusion_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_fusion_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/fusion.h usability" >&5 echo $ECHO_N "checking linux/fusion.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking linux/fusion.h presence" >&5 echo $ECHO_N "checking linux/fusion.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: linux/fusion.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/fusion.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/fusion.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/fusion.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/fusion.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/fusion.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/fusion.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/fusion.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/fusion.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/fusion.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/fusion.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/fusion.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/fusion.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/fusion.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/fusion.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/fusion.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for linux/fusion.h" >&5 echo $ECHO_N "checking for linux/fusion.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_fusion_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_fusion_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_fusion_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_fusion_h" >&6; } fi if test $ac_cv_header_linux_fusion_h = yes; then : else linux_fusion=no fi if test "$linux_fusion" = "yes"; then FUSION_BUILD_KERNEL=1 else fusion_warning=" Linux-Fusion header not found. Using EXPERIMENTAL Builtin Multi application core!" { echo "$as_me:$LINENO: WARNING: *** $fusion_warning *** " >&5 echo "$as_me: WARNING: *** $fusion_warning *** " >&2;} FUSION_BUILD_KERNEL=0 fi FUSION_BUILD_MULTI=1 else FUSION_BUILD_MULTI=0 FUSION_BUILD_KERNEL=0 fi if test "$enable_multi" = "yes"; then ENABLE_MULTI_TRUE= ENABLE_MULTI_FALSE='#' else ENABLE_MULTI_TRUE='#' ENABLE_MULTI_FALSE= fi # Check whether --enable-voodoo was given. if test "${enable_voodoo+set}" = set; then enableval=$enable_voodoo; else enable_voodoo=no fi if test "$enable_voodoo" = "yes"; then ENABLE_VOODOO_TRUE= ENABLE_VOODOO_FALSE='#' else ENABLE_VOODOO_TRUE='#' ENABLE_VOODOO_FALSE= fi # Check whether --enable-unique was given. if test "${enable_unique+set}" = set; then enableval=$enable_unique; else enable_unique=no fi if test "$enable_unique" = "yes"; then ENABLE_UNIQUE_TRUE= ENABLE_UNIQUE_FALSE='#' else ENABLE_UNIQUE_TRUE='#' ENABLE_UNIQUE_FALSE= fi # Check whether --enable-mmx was given. if test "${enable_mmx+set}" = set; then enableval=$enable_mmx; else enable_mmx=$have_x86 fi # Check whether --enable-sse was given. if test "${enable_sse+set}" = set; then enableval=$enable_sse; else enable_sse=$have_x86 fi if test "$enable_mmx" = "yes"; then save_ac_ext="$ac_ext" ac_ext=S { echo "$as_me:$LINENO: checking whether the binutils support MMX" >&5 echo $ECHO_N "checking whether the binutils support MMX... $ECHO_C" >&6; } echo " movq 0, %mm0" > conftest.S if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then cat >>confdefs.h <<\_ACEOF #define USE_MMX 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } if test "$enable_sse" = "yes"; then { echo "$as_me:$LINENO: checking whether the binutils support SSE" >&5 echo $ECHO_N "checking whether the binutils support SSE... $ECHO_C" >&6; } echo " movntps %xmm0, 0" > conftest.S if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then cat >>confdefs.h <<\_ACEOF #define USE_SSE 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else enable_sse=no { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { echo "$as_me:$LINENO: WARNING: **************************************************************** The installed assembler does not supports the SSE command set. Update your binutils package, if you want to compile SSE code. ****************************************************************" >&5 echo "$as_me: WARNING: **************************************************************** The installed assembler does not supports the SSE command set. Update your binutils package, if you want to compile SSE code. ****************************************************************" >&2;} fi fi else enable_mmx=no { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { echo "$as_me:$LINENO: WARNING: **************************************************************** The installed assembler does not supports the MMX command set. Update your binutils package, if you want to compile MMX code. ****************************************************************" >&5 echo "$as_me: WARNING: **************************************************************** The installed assembler does not supports the MMX command set. Update your binutils package, if you want to compile MMX code. ****************************************************************" >&2;} fi rm conftest* ac_ext="$save_ac_ext" else enable_sse=no fi if test "$enable_mmx" = "yes"; then BUILDMMX_TRUE= BUILDMMX_FALSE='#' else BUILDMMX_TRUE='#' BUILDMMX_FALSE= fi # Check whether --enable-devmem was given. if test "${enable_devmem+set}" = set; then enableval=$enable_devmem; else enable_devmem=yes fi if test "$enable_devmem" = "yes"; then DEVMEM_CORE_TRUE= DEVMEM_CORE_FALSE='#' else DEVMEM_CORE_TRUE='#' DEVMEM_CORE_FALSE= fi # Check whether --enable-fbdev was given. if test "${enable_fbdev+set}" = set; then enableval=$enable_fbdev; else enable_fbdev=yes fi if test "$have_linux" = "no"; then enable_fbdev=no { echo "$as_me:$LINENO: WARNING: *** no linux kernel -- building without linux fbdev support." >&5 echo "$as_me: WARNING: *** no linux kernel -- building without linux fbdev support." >&2;} fi if test "$enable_fbdev" = "yes"; then cat >>confdefs.h <<\_ACEOF #define LINUX_INPUT_USE_FBDEV 1 _ACEOF fi if test "$enable_fbdev" = "yes"; then FBDEV_CORE_TRUE= FBDEV_CORE_FALSE='#' else FBDEV_CORE_TRUE='#' FBDEV_CORE_FALSE= fi # Check whether --enable-sdl was given. if test "${enable_sdl+set}" = set; then enableval=$enable_sdl; else enable_sdl=no fi if test "$enable_sdl" = "yes"; then if test "$enable_osx" = "yes"; then { echo "$as_me:$LINENO: WARNING: *** SDL is now unsupported on OSX." >&5 echo "$as_me: WARNING: *** SDL is now unsupported on OSX." >&2;} enable_sdl=no else pkg_failed=no { echo "$as_me:$LINENO: checking for SDL" >&5 echo $ECHO_N "checking for SDL... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$SDL_CFLAGS"; then pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl\"") >&5 ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$SDL_LIBS"; then pkg_cv_SDL_LIBS="$SDL_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sdl\"") >&5 ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sdl"` else SDL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sdl"` fi # Put the nasty error message in config.log where it belongs echo "$SDL_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } enable_sdl=no, { echo "$as_me:$LINENO: WARNING: *** no sdl -- building without SDL support." >&5 echo "$as_me: WARNING: *** no sdl -- building without SDL support." >&2;} elif test $pkg_failed = untried; then enable_sdl=no, { echo "$as_me:$LINENO: WARNING: *** no sdl -- building without SDL support." >&5 echo "$as_me: WARNING: *** no sdl -- building without SDL support." >&2;} else SDL_CFLAGS=$pkg_cv_SDL_CFLAGS SDL_LIBS=$pkg_cv_SDL_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } enable_sdl=yes fi fi fi if test "$enable_sdl" = "yes"; then SDL_CORE_TRUE= SDL_CORE_FALSE='#' else SDL_CORE_TRUE='#' SDL_CORE_FALSE= fi # Check whether --enable-vnc was given. if test "${enable_vnc+set}" = set; then enableval=$enable_vnc; else enable_vnc=yes fi if test "$enable_vnc" = "yes"; then # Extract the first word of "libvncserver-config", so it can be a program name with args. set dummy libvncserver-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_VNC_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $VNC_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_VNC_CONFIG="$VNC_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_VNC_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_VNC_CONFIG" && ac_cv_path_VNC_CONFIG="no" ;; esac fi VNC_CONFIG=$ac_cv_path_VNC_CONFIG if test -n "$VNC_CONFIG"; then { echo "$as_me:$LINENO: result: $VNC_CONFIG" >&5 echo "${ECHO_T}$VNC_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$VNC_CONFIG" = "no"; then enable_vnc=no { echo "$as_me:$LINENO: WARNING: *** libvncserver-config not found -- building without VNC support. See http://libvncserver.sourceforge.net" >&5 echo "$as_me: WARNING: *** libvncserver-config not found -- building without VNC support. See http://libvncserver.sourceforge.net" >&2;} else VNC_CFLAGS=`$VNC_CONFIG --cflags` VNC_LIBS=`$VNC_CONFIG --libs` fi fi if test "$enable_vnc" = "yes"; then VNC_CORE_TRUE= VNC_CORE_FALSE='#' else VNC_CORE_TRUE='#' VNC_CORE_FALSE= fi # Check whether --enable-sysfs was given. if test "${enable_sysfs+set}" = set; then enableval=$enable_sysfs; else enable_sysfs=yes fi use_sysfs=no SYSFS_LIBS= if test "$enable_sysfs" = "yes"; then { echo "$as_me:$LINENO: checking for sysfs_get_mnt_path in -lsysfs" >&5 echo $ECHO_N "checking for sysfs_get_mnt_path in -lsysfs... $ECHO_C" >&6; } if test "${ac_cv_lib_sysfs_sysfs_get_mnt_path+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsysfs $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sysfs_get_mnt_path (); int main () { return sysfs_get_mnt_path (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_sysfs_sysfs_get_mnt_path=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sysfs_sysfs_get_mnt_path=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_sysfs_sysfs_get_mnt_path" >&5 echo "${ECHO_T}$ac_cv_lib_sysfs_sysfs_get_mnt_path" >&6; } if test $ac_cv_lib_sysfs_sysfs_get_mnt_path = yes; then if test "${ac_cv_header_sysfs_libsysfs_h+set}" = set; then { echo "$as_me:$LINENO: checking for sysfs/libsysfs.h" >&5 echo $ECHO_N "checking for sysfs/libsysfs.h... $ECHO_C" >&6; } if test "${ac_cv_header_sysfs_libsysfs_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sysfs_libsysfs_h" >&5 echo "${ECHO_T}$ac_cv_header_sysfs_libsysfs_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sysfs/libsysfs.h usability" >&5 echo $ECHO_N "checking sysfs/libsysfs.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking sysfs/libsysfs.h presence" >&5 echo $ECHO_N "checking sysfs/libsysfs.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sysfs/libsysfs.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sysfs/libsysfs.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for sysfs/libsysfs.h" >&5 echo $ECHO_N "checking for sysfs/libsysfs.h... $ECHO_C" >&6; } if test "${ac_cv_header_sysfs_libsysfs_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sysfs_libsysfs_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sysfs_libsysfs_h" >&5 echo "${ECHO_T}$ac_cv_header_sysfs_libsysfs_h" >&6; } fi if test $ac_cv_header_sysfs_libsysfs_h = yes; then use_sysfs=yes cat >>confdefs.h <<\_ACEOF #define USE_SYSFS 1 _ACEOF SYSFS_LIBS='-lsysfs' else { echo "$as_me:$LINENO: WARNING: *** libsysfs header files not found -- Building without sysfs support." >&5 echo "$as_me: WARNING: *** libsysfs header files not found -- Building without sysfs support." >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** libsysfs not found -- Building without sysfs support." >&5 echo "$as_me: WARNING: *** libsysfs not found -- Building without sysfs support." >&2;} fi fi JPEG=no # Check whether --enable-jpeg was given. if test "${enable_jpeg+set}" = set; then enableval=$enable_jpeg; enable_jpeg="$enableval" else enable_jpeg=yes fi if test "$enable_jpeg" = "yes"; then if test -z "$LIBJPEG"; then { echo "$as_me:$LINENO: checking for jpeg_destroy_decompress in -ljpeg" >&5 echo $ECHO_N "checking for jpeg_destroy_decompress in -ljpeg... $ECHO_C" >&6; } if test "${ac_cv_lib_jpeg_jpeg_destroy_decompress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_destroy_decompress (); int main () { return jpeg_destroy_decompress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_jpeg_jpeg_destroy_decompress=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; } if test $ac_cv_lib_jpeg_jpeg_destroy_decompress = yes; then jpeg_ok=yes else jpeg_ok=no fi if test "$jpeg_ok" = yes; then if test "${ac_cv_header_jpeglib_h+set}" = set; then { echo "$as_me:$LINENO: checking for jpeglib.h" >&5 echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6; } if test "${ac_cv_header_jpeglib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking jpeglib.h usability" >&5 echo $ECHO_N "checking jpeglib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking jpeglib.h presence" >&5 echo $ECHO_N "checking jpeglib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: jpeglib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: jpeglib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: jpeglib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: jpeglib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: jpeglib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for jpeglib.h" >&5 echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6; } if test "${ac_cv_header_jpeglib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_jpeglib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6; } fi if test $ac_cv_header_jpeglib_h = yes; then jpeg_ok=yes else jpeg_ok=no fi if test "$jpeg_ok" = yes; then JPEG=yes LIBJPEG='-ljpeg' else JPEG=no { echo "$as_me:$LINENO: WARNING: *** JPEG header files not found. JPEG image provider will not be built." >&5 echo "$as_me: WARNING: *** JPEG header files not found. JPEG image provider will not be built." >&2;} fi else JPEG=no { echo "$as_me:$LINENO: WARNING: *** JPEG library not found. JPEG image provider will not be built." >&5 echo "$as_me: WARNING: *** JPEG library not found. JPEG image provider will not be built." >&2;} fi else JPEG=yes fi fi if test "$JPEG" = "yes"; then JPEG_PROVIDER_TRUE= JPEG_PROVIDER_FALSE='#' else JPEG_PROVIDER_TRUE='#' JPEG_PROVIDER_FALSE= fi if test "$enable_jpeg" != "no" && test "$JPEG" != "yes"; then jpeg_warning=" JPEG support is missing - many applications won't work correctly!" fi # Check whether --enable-zlib was given. if test "${enable_zlib+set}" = set; then enableval=$enable_zlib; enable_zlib="$enableval" else enable_zlib=no fi use_zlib=no ZLIB_LIBS= if test "$enable_zlib" = "yes"; then { echo "$as_me:$LINENO: checking for gzsetparams in -lz" >&5 echo $ECHO_N "checking for gzsetparams in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_gzsetparams+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gzsetparams (); int main () { return gzsetparams (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_z_gzsetparams=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_gzsetparams=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzsetparams" >&5 echo "${ECHO_T}$ac_cv_lib_z_gzsetparams" >&6; } if test $ac_cv_lib_z_gzsetparams = yes; then if test "${ac_cv_header_zlib_h+set}" = set; then { echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } fi if test $ac_cv_header_zlib_h = yes; then use_zlib=yes cat >>confdefs.h <<\_ACEOF #define USE_ZLIB 1 _ACEOF ZLIB_LIBS='-lz' else { { echo "$as_me:$LINENO: error: *** libz header files not found." >&5 echo "$as_me: error: *** libz header files not found." >&2;} { (exit 1); exit 1; }; } fi else { { echo "$as_me:$LINENO: error: *** libz not found." >&5 echo "$as_me: error: *** libz not found." >&2;} { (exit 1); exit 1; }; } fi fi PNG=no # Check whether --enable-png was given. if test "${enable_png+set}" = set; then enableval=$enable_png; enable_png="$enableval" else enable_png=yes fi if test "$enable_png" = "yes"; then if test -z "$ZLIB_LIBS"; then { echo "$as_me:$LINENO: checking for gzsetparams in -lz" >&5 echo $ECHO_N "checking for gzsetparams in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_gzsetparams+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gzsetparams (); int main () { return gzsetparams (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_z_gzsetparams=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_gzsetparams=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzsetparams" >&5 echo "${ECHO_T}$ac_cv_lib_z_gzsetparams" >&6; } if test $ac_cv_lib_z_gzsetparams = yes; then if test "${ac_cv_header_zlib_h+set}" = set; then { echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking zlib.h usability" >&5 echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking zlib.h presence" >&5 echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for zlib.h" >&5 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } fi if test $ac_cv_header_zlib_h = yes; then ZLIB_LIBS='-lz' else { echo "$as_me:$LINENO: WARNING: *** libz header files not found. PNG image provider will not be built." >&5 echo "$as_me: WARNING: *** libz header files not found. PNG image provider will not be built." >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** libz not found. PNG image provider will not be built." >&5 echo "$as_me: WARNING: *** libz not found. PNG image provider will not be built." >&2;} fi fi # Extract the first word of "libpng-config", so it can be a program name with args. set dummy libpng-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LIBPNG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LIBPNG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBPNG_CONFIG="$LIBPNG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LIBPNG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_LIBPNG_CONFIG" && ac_cv_path_LIBPNG_CONFIG="no" ;; esac fi LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG if test -n "$LIBPNG_CONFIG"; then { echo "$as_me:$LINENO: result: $LIBPNG_CONFIG" >&5 echo "${ECHO_T}$LIBPNG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$LIBPNG_CONFIG" = no; then PNG=no { echo "$as_me:$LINENO: WARNING: *** libpng-config not found " >&5 echo "$as_me: WARNING: *** libpng-config not found " >&2;} else PNG=yes LIBPNG=`$LIBPNG_CONFIG --libs` fi if test -z "$LIBPNG" && test -n "$ZLIB_LIBS"; then { echo "$as_me:$LINENO: checking for png_read_info in -lpng" >&5 echo $ECHO_N "checking for png_read_info in -lpng... $ECHO_C" >&6; } if test "${ac_cv_lib_png_png_read_info+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $ZLIB_LIBS -lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_read_info (); int main () { return png_read_info (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_png_png_read_info=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_png_png_read_info=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_info" >&5 echo "${ECHO_T}$ac_cv_lib_png_png_read_info" >&6; } if test $ac_cv_lib_png_png_read_info = yes; then if test "${ac_cv_header_png_h+set}" = set; then { echo "$as_me:$LINENO: checking for png.h" >&5 echo $ECHO_N "checking for png.h... $ECHO_C" >&6; } if test "${ac_cv_header_png_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5 echo "${ECHO_T}$ac_cv_header_png_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking png.h usability" >&5 echo $ECHO_N "checking png.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking png.h presence" >&5 echo $ECHO_N "checking png.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: png.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: png.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: png.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: png.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: png.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: png.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: png.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: png.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: png.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: png.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for png.h" >&5 echo $ECHO_N "checking for png.h... $ECHO_C" >&6; } if test "${ac_cv_header_png_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_png_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5 echo "${ECHO_T}$ac_cv_header_png_h" >&6; } fi if test $ac_cv_header_png_h = yes; then png_ok=yes else { echo "$as_me:$LINENO: WARNING: *** PNG header files not found. PNG image provider will not be built." >&5 echo "$as_me: WARNING: *** PNG header files not found. PNG image provider will not be built." >&2;} fi else { echo "$as_me:$LINENO: WARNING: *** PNG library not found. PNG image provider will not be built." >&5 echo "$as_me: WARNING: *** PNG library not found. PNG image provider will not be built." >&2;} fi if test "$png_ok" = yes; then { echo "$as_me:$LINENO: checking for png_structp in png.h" >&5 echo $ECHO_N "checking for png_structp in png.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { png_structp pp; png_infop info; png_colorp cmap; (void)png_create_read_struct; (void)pp; (void)info; (void)cmap; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then png_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 png_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $png_ok" >&5 echo "${ECHO_T}$png_ok" >&6; } if test "$png_ok" = yes; then PNG=yes LIBPNG="-lpng $ZLIB_LIBS -lm" else PNG=no { echo "$as_me:$LINENO: WARNING: *** PNG library is too old. PNG image provider will not be built." >&5 echo "$as_me: WARNING: *** PNG library is too old. PNG image provider will not be built." >&2;} fi else PNG=no fi fi fi if test "$PNG" = "yes"; then PNG_PROVIDER_TRUE= PNG_PROVIDER_FALSE='#' else PNG_PROVIDER_TRUE='#' PNG_PROVIDER_FALSE= fi if test "$PNG" = "yes"; then BUILD_DIRECTFB_CSOURCE_TRUE= BUILD_DIRECTFB_CSOURCE_FALSE='#' else BUILD_DIRECTFB_CSOURCE_TRUE='#' BUILD_DIRECTFB_CSOURCE_FALSE= fi if test "$enable_png" != "no" && test "$PNG" != "yes"; then png_warning=" PNG support is missing - many applications won't work correctly!" fi # Check whether --enable-gif was given. if test "${enable_gif+set}" = set; then enableval=$enable_gif; enable_gif="$enableval" else enable_gif=yes fi if test "$enable_gif" = "yes"; then GIF_PROVIDER_TRUE= GIF_PROVIDER_FALSE='#' else GIF_PROVIDER_TRUE='#' GIF_PROVIDER_FALSE= fi # Check whether --enable-freetype was given. if test "${enable_freetype+set}" = set; then enableval=$enable_freetype; enable_freetype="$enableval" else enable_freetype=yes fi if test "$enable_freetype" = "yes"; then pkg_failed=no { echo "$as_me:$LINENO: checking for FREETYPE" >&5 echo $ECHO_N "checking for FREETYPE... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$FREETYPE_CFLAGS"; then pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"freetype2\"") >&5 ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$FREETYPE_LIBS"; then pkg_cv_FREETYPE_LIBS="$FREETYPE_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"freetype2\"") >&5 ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FREETYPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "freetype2"` else FREETYPE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "freetype2"` fi # Put the nasty error message in config.log where it belongs echo "$FREETYPE_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } FREETYPE="no", { echo "$as_me:$LINENO: WARNING: *** no freetype -- FreeType font provider will not be built." >&5 echo "$as_me: WARNING: *** no freetype -- FreeType font provider will not be built." >&2;} elif test $pkg_failed = untried; then FREETYPE="no", { echo "$as_me:$LINENO: WARNING: *** no freetype -- FreeType font provider will not be built." >&5 echo "$as_me: WARNING: *** no freetype -- FreeType font provider will not be built." >&2;} else FREETYPE_CFLAGS=$pkg_cv_FREETYPE_CFLAGS FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } FREETYPE="yes" fi fi if test "$FREETYPE" = "yes"; then FREETYPE_PROVIDER_TRUE= FREETYPE_PROVIDER_FALSE='#' else FREETYPE_PROVIDER_TRUE='#' FREETYPE_PROVIDER_FALSE= fi if test "$enable_freetype" != "no" && test "$FREETYPE" != "yes"; then freetype_warning=" FreeType2 support is missing - many applications won't work correctly!" fi V4L=no if test "$have_linux" = "yes"; then # Check whether --enable-video4linux was given. if test "${enable_video4linux+set}" = set; then enableval=$enable_video4linux; enable_v4l="$enableval" else enable_v4l=yes fi if test "$enable_v4l" = "yes"; then V4L=yes fi fi if test "$V4L" = "yes"; then V4L_PROVIDER_TRUE= V4L_PROVIDER_FALSE='#' else V4L_PROVIDER_TRUE='#' V4L_PROVIDER_FALSE= fi V4L2=no if test "$V4L" = "yes"; then # Check whether --enable-video4linux2 was given. if test "${enable_video4linux2+set}" = set; then enableval=$enable_video4linux2; enable_v4l2="$enableval" else enable_v4l2=no fi if test "$enable_v4l2" = "yes"; then V4L2=yes cat >>confdefs.h <<\_ACEOF #define DFB_HAVE_V4L2 1 _ACEOF fi fi ati128=no cle266=no cyber5k=no davinci=no ep9x=no i810=no i830=no mach64=no matrox=no neomagic=no nsc=no nvidia=no omap=no radeon=no savage=no sh772x=no sis315=no tdfx=no unichrome=no vmware=no if test "$have_linux" = "yes"; then { echo "$as_me:$LINENO: checking which gfxdrivers should be built" >&5 echo $ECHO_N "checking which gfxdrivers should be built... $ECHO_C" >&6; } # Check whether --with-gfxdrivers was given. if test "${with_gfxdrivers+set}" = set; then withval=$with_gfxdrivers; gfxdrivers="$withval" else gfxdrivers="all" fi if test "$gfxdrivers" = "all"; then checkfor_ati128=yes checkfor_cle266=no checkfor_cyber5k=yes checkfor_davinci="$have_arm" checkfor_ep9x=yes checkfor_i810=yes checkfor_i830=yes checkfor_mach64=yes checkfor_matrox=yes checkfor_neomagic=yes checkfor_nsc=yes checkfor_nvidia=yes checkfor_omap="$have_arm" checkfor_radeon=yes checkfor_savage=yes checkfor_sh772x=yes checkfor_sis315=yes checkfor_tdfx=yes checkfor_unichrome=yes checkfor_vmware=yes { echo "$as_me:$LINENO: result: all" >&5 echo "${ECHO_T}all" >&6; } else if test "$gfxdrivers" != "none"; then gfxdrivers=`echo $gfxdrivers | sed 's/,/ /g'` for gfxdriver in $gfxdrivers do case "$gfxdriver" in ati128) checkfor_ati128=yes ;; cle266) checkfor_cle266=yes ;; cyber5k) checkfor_cyber5k=yes ;; davinci) checkfor_davinci=yes ;; ep9x) checkfor_ep9x=yes ;; i810) checkfor_i810=yes ;; i830) checkfor_i830=yes ;; mach64) checkfor_mach64=yes ;; matrox) checkfor_matrox=yes ;; neomagic) checkfor_neomagic=yes ;; nsc) checkfor_nsc=yes ;; nvidia) checkfor_nvidia=yes ;; omap) checkfor_omap=yes ;; radeon) checkfor_radeon=yes ;; savage) checkfor_savage=yes ;; sh772x) checkfor_sh772x=yes ;; sis315) checkfor_sis315=yes ;; tdfx) checkfor_tdfx=yes ;; unichrome) checkfor_unichrome=yes ;; vmware) checkfor_vmware=yes ;; *) echo "Unknown gfxdriver $gfxdriver, exiting!" exit 1 ;; esac done { echo "$as_me:$LINENO: result: $gfxdrivers" >&5 echo "${ECHO_T}$gfxdrivers" >&6; } fi fi if test "$checkfor_ati128" = "yes"; then ati128=yes fi if test "$checkfor_cle266" = "yes" && test "$have_sysio" = "yes"; then cle266=yes fi if test "$checkfor_cyber5k" = "yes"; then cyber5k=yes fi if test "$checkfor_davinci" = "yes"; then davinci=yes fi if test "$checkfor_ep9x" = "yes"; then ep9x=yes fi if test "$checkfor_i810" = "yes" && test "$have_sysio" = "yes"; then i810=yes fi if test "$checkfor_i830" = "yes" && test "$have_sysio" = "yes"; then i830=yes fi if test "$checkfor_mach64" = "yes"; then mach64=yes fi if test "$checkfor_matrox" = "yes"; then matrox=yes fi if test "$checkfor_neomagic" = "yes" && test "$have_sysio" = "yes"; then neomagic=yes fi if test "$checkfor_nsc" = "yes"; then nsc=yes fi if test "$checkfor_nvidia" = "yes"; then nvidia=yes fi if test "$checkfor_omap" = "yes"; then omap=yes fi if test "$checkfor_radeon" = "yes"; then radeon=yes fi if test "$checkfor_savage" = "yes" && test "$have_sysio" = "yes"; then savage=yes fi if test "$checkfor_sh772x" = "yes" && test "$have_sh4" = "yes"; then sh772x=yes fi if test "$checkfor_sis315" = "yes"; then sis315=yes fi if test "$checkfor_tdfx" = "yes"; then tdfx=yes fi if test "$checkfor_unichrome" = "yes" && test "$have_sysio" = "yes"; then unichrome=yes fi if test "$checkfor_vmware" = "yes"; then vmware=yes fi # lets check for input driver checkfor_dbox2remote=no checkfor_dreamboxremote=no checkfor_dynapro=no checkfor_elo=no checkfor_gunze=no checkfor_h3600ts=no checkfor_joystick=no checkfor_keyboard=no checkfor_linux_input=no checkfor_lirc=no checkfor_mutouch=no checkfor_penmount=no checkfor_ps2mouse=no checkfor_serialmouse=no checkfor_sonypijogdial=no checkfor_tslib=no checkfor_ucb1x00=no checkfor_wm97xx=no { echo "$as_me:$LINENO: checking which inputdrivers should be built" >&5 echo $ECHO_N "checking which inputdrivers should be built... $ECHO_C" >&6; } # Check whether --with-inputdrivers was given. if test "${with_inputdrivers+set}" = set; then withval=$with_inputdrivers; inputdrivers="$withval" else inputdrivers="all" fi if test "$inputdrivers" = "all"; then checkfor_dbox2remote=yes checkfor_dreamboxremote=yes checkfor_dynapro=no checkfor_elo=no checkfor_gunze=no checkfor_h3600ts=yes checkfor_joystick=yes checkfor_keyboard=yes checkfor_linux_input=yes checkfor_lirc=yes checkfor_mutouch=yes checkfor_penmount=yes checkfor_ps2mouse=yes checkfor_serialmouse=yes checkfor_sonypijogdial=yes checkfor_tslib=yes checkfor_ucb1x00="$have_arm" checkfor_wm97xx=yes { echo "$as_me:$LINENO: result: all" >&5 echo "${ECHO_T}all" >&6; } else if test "$inputdrivers" != "none"; then inputdrivers=`echo $inputdrivers | sed 's/,/ /g'` for inputdriver in $inputdrivers do case "$inputdriver" in dbox2remote) checkfor_dbox2remote=yes ;; dreamboxremote) checkfor_dreamboxremote=yes ;; dynapro) checkfor_dynapro=yes ;; elo-input) checkfor_elo=yes ;; gunze) checkfor_gunze=yes ;; h3600_ts) checkfor_h3600ts=yes ;; joystick) checkfor_joystick=yes ;; keyboard) checkfor_keyboard=yes ;; linuxinput) checkfor_linux_input=yes ;; lirc) checkfor_lirc=yes ;; mutouch) checkfor_mutouch=yes ;; penmount) checkfor_penmount=yes ;; ps2mouse) checkfor_ps2mouse=yes ;; serialmouse) checkfor_serialmouse=yes ;; sonypijogdial) checkfor_sonypijogdial=yes ;; tslib) checkfor_tslib=yes ;; ucb1x00) checkfor_ucb1x00=yes ;; wm97xx) checkfor_wm97xx=yes ;; *) echo "Unknown inputdriver $inputdriver, exiting!" exit 1 ;; esac done { echo "$as_me:$LINENO: result: $inputdrivers" >&5 echo "${ECHO_T}$inputdrivers" >&6; } fi fi enable_dbox2remote=no if test "$checkfor_dbox2remote" = "yes"; then if test "${ac_cv_header_dbox_fp_h+set}" = set; then { echo "$as_me:$LINENO: checking for dbox/fp.h" >&5 echo $ECHO_N "checking for dbox/fp.h... $ECHO_C" >&6; } if test "${ac_cv_header_dbox_fp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dbox_fp_h" >&5 echo "${ECHO_T}$ac_cv_header_dbox_fp_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dbox/fp.h usability" >&5 echo $ECHO_N "checking dbox/fp.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking dbox/fp.h presence" >&5 echo $ECHO_N "checking dbox/fp.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dbox/fp.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dbox/fp.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dbox/fp.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dbox/fp.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dbox/fp.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dbox/fp.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dbox/fp.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dbox/fp.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dbox/fp.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dbox/fp.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for dbox/fp.h" >&5 echo $ECHO_N "checking for dbox/fp.h... $ECHO_C" >&6; } if test "${ac_cv_header_dbox_fp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dbox_fp_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dbox_fp_h" >&5 echo "${ECHO_T}$ac_cv_header_dbox_fp_h" >&6; } fi if test $ac_cv_header_dbox_fp_h = yes; then enable_dbox2remote=yes else enable_dbox2remote=no { echo "$as_me:$LINENO: WARNING: *** DBox2 Remote input driver will not be built." >&5 echo "$as_me: WARNING: *** DBox2 Remote input driver will not be built." >&2;} fi fi enable_dreamboxremote=no if test "$checkfor_dreamboxremote" = "yes"; then if test "${ac_cv_header_dbox_fp_h+set}" = set; then { echo "$as_me:$LINENO: checking for dbox/fp.h" >&5 echo $ECHO_N "checking for dbox/fp.h... $ECHO_C" >&6; } if test "${ac_cv_header_dbox_fp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dbox_fp_h" >&5 echo "${ECHO_T}$ac_cv_header_dbox_fp_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dbox/fp.h usability" >&5 echo $ECHO_N "checking dbox/fp.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking dbox/fp.h presence" >&5 echo $ECHO_N "checking dbox/fp.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dbox/fp.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dbox/fp.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dbox/fp.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dbox/fp.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dbox/fp.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dbox/fp.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dbox/fp.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dbox/fp.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dbox/fp.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dbox/fp.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dbox/fp.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for dbox/fp.h" >&5 echo $ECHO_N "checking for dbox/fp.h... $ECHO_C" >&6; } if test "${ac_cv_header_dbox_fp_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dbox_fp_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dbox_fp_h" >&5 echo "${ECHO_T}$ac_cv_header_dbox_fp_h" >&6; } fi if test $ac_cv_header_dbox_fp_h = yes; then enable_dreamboxremote=yes else enable_dreamboxremote=no { echo "$as_me:$LINENO: WARNING: *** DreamBox Remote input driver will not be built." >&5 echo "$as_me: WARNING: *** DreamBox Remote input driver will not be built." >&2;} fi fi enable_dynapro_ts=no if test "$checkfor_dynapro" = "yes"; then enable_dynapro_ts=yes fi enable_elo_input=no if test "$checkfor_elo" = "yes"; then enable_elo_input=yes fi enable_gunze_input=no if test "$checkfor_gunze" = "yes"; then enable_gunze_input=yes fi enable_h3600_ts=no if test "$checkfor_h3600ts" = "yes"; then if test "${ac_cv_header_linux_h3600_ts_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/h3600_ts.h" >&5 echo $ECHO_N "checking for linux/h3600_ts.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_h3600_ts_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_h3600_ts_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_h3600_ts_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/h3600_ts.h usability" >&5 echo $ECHO_N "checking linux/h3600_ts.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking linux/h3600_ts.h presence" >&5 echo $ECHO_N "checking linux/h3600_ts.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/h3600_ts.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/h3600_ts.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for linux/h3600_ts.h" >&5 echo $ECHO_N "checking for linux/h3600_ts.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_h3600_ts_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_h3600_ts_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_h3600_ts_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_h3600_ts_h" >&6; } fi if test $ac_cv_header_linux_h3600_ts_h = yes; then enable_h3600_ts=yes else enable_h3600_ts=no { echo "$as_me:$LINENO: WARNING: *** H3600 Touchscreen driver will not be built." >&5 echo "$as_me: WARNING: *** H3600 Touchscreen driver will not be built." >&2;} fi fi enable_joystick=no if test "$checkfor_joystick" = "yes"; then if test "${ac_cv_header_linux_joystick_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/joystick.h" >&5 echo $ECHO_N "checking for linux/joystick.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_joystick_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_joystick_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_joystick_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/joystick.h usability" >&5 echo $ECHO_N "checking linux/joystick.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking linux/joystick.h presence" >&5 echo $ECHO_N "checking linux/joystick.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: linux/joystick.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/joystick.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/joystick.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/joystick.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/joystick.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/joystick.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/joystick.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/joystick.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/joystick.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/joystick.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/joystick.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/joystick.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/joystick.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/joystick.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/joystick.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/joystick.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for linux/joystick.h" >&5 echo $ECHO_N "checking for linux/joystick.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_joystick_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_joystick_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_joystick_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_joystick_h" >&6; } fi if test $ac_cv_header_linux_joystick_h = yes; then enable_joystick=yes else enable_joystick=no { echo "$as_me:$LINENO: WARNING: *** no linux/joystick.h -- Joystick driver will not be built." >&5 echo "$as_me: WARNING: *** no linux/joystick.h -- Joystick driver will not be built." >&2;} fi fi enable_keyboard=no if test "$checkfor_keyboard" = "yes"; then enable_keyboard=yes fi enable_linux_input=no if test "$checkfor_linux_input" = "yes"; then if test "${ac_cv_header_linux_input_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/input.h" >&5 echo $ECHO_N "checking for linux/input.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_input_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_input_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_input_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/input.h usability" >&5 echo $ECHO_N "checking linux/input.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking linux/input.h presence" >&5 echo $ECHO_N "checking linux/input.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: linux/input.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/input.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/input.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/input.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/input.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/input.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/input.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/input.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/input.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/input.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/input.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/input.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/input.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/input.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/input.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/input.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for linux/input.h" >&5 echo $ECHO_N "checking for linux/input.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_input_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_input_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_input_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_input_h" >&6; } fi if test $ac_cv_header_linux_input_h = yes; then enable_linux_input=yes else enable_linux_input=no { echo "$as_me:$LINENO: WARNING: *** no linux/input.h -- Linux Input driver will not be built." >&5 echo "$as_me: WARNING: *** no linux/input.h -- Linux Input driver will not be built." >&2;} fi if test "$enable_linux_input" = "yes"; then { echo "$as_me:$LINENO: checking for struct input_absinfo in linux/input.h" >&5 echo $ECHO_N "checking for struct input_absinfo in linux/input.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct input_absinfo x; (void)x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >>confdefs.h <<\_ACEOF #define HAVE_INPUT_ABSINFO 1 _ACEOF { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi enable_lirc=no if test "$checkfor_lirc" = "yes"; then enable_lirc=yes fi enable_mutouch=no if test "$checkfor_mutouch" = "yes"; then enable_mutouch=yes fi enable_penmount=no if test "$checkfor_penmount" = "yes"; then enable_penmount=yes fi enable_ps2mouse=no if test "$checkfor_ps2mouse" = "yes"; then enable_ps2mouse=yes fi enable_serial_mouse=no if test "$checkfor_serialmouse" = "yes"; then if test "${ac_cv_header_linux_serial_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/serial.h" >&5 echo $ECHO_N "checking for linux/serial.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_serial_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_serial_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_serial_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/serial.h usability" >&5 echo $ECHO_N "checking linux/serial.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking linux/serial.h presence" >&5 echo $ECHO_N "checking linux/serial.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: linux/serial.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/serial.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/serial.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/serial.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/serial.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/serial.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/serial.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/serial.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/serial.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/serial.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/serial.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/serial.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/serial.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/serial.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/serial.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/serial.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for linux/serial.h" >&5 echo $ECHO_N "checking for linux/serial.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_serial_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_serial_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_serial_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_serial_h" >&6; } fi if test $ac_cv_header_linux_serial_h = yes; then enable_serial_mouse=yes else enable_serial_mouse=no { echo "$as_me:$LINENO: WARNING: *** no linux/serial.h -- serial mouse driver will not be built." >&5 echo "$as_me: WARNING: *** no linux/serial.h -- serial mouse driver will not be built." >&2;} fi fi enable_sonypi_jogdial=no if test "$checkfor_sonypijogdial" = "yes"; then if test "${ac_cv_header_linux_sonypi_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/sonypi.h" >&5 echo $ECHO_N "checking for linux/sonypi.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_sonypi_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_sonypi_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_sonypi_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/sonypi.h usability" >&5 echo $ECHO_N "checking linux/sonypi.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking linux/sonypi.h presence" >&5 echo $ECHO_N "checking linux/sonypi.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/sonypi.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/sonypi.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/sonypi.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/sonypi.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/sonypi.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/sonypi.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/sonypi.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/sonypi.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/sonypi.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for linux/sonypi.h" >&5 echo $ECHO_N "checking for linux/sonypi.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_sonypi_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_sonypi_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_sonypi_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_sonypi_h" >&6; } fi if test $ac_cv_header_linux_sonypi_h = yes; then enable_sonypi_jogdial=yes else enable_sonypi_jogdial=no { echo "$as_me:$LINENO: WARNING: *** no linux/sonypi.h -- SonyPI Jogdial driver will not be built." >&5 echo "$as_me: WARNING: *** no linux/sonypi.h -- SonyPI Jogdial driver will not be built." >&2;} fi fi enable_tslib=no if test "$checkfor_tslib" = "yes"; then pkg_failed=no { echo "$as_me:$LINENO: checking for TSLIB" >&5 echo $ECHO_N "checking for TSLIB... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$TSLIB_CFLAGS"; then pkg_cv_TSLIB_CFLAGS="$TSLIB_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"tslib-0.0\"") >&5 ($PKG_CONFIG --exists --print-errors "tslib-0.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_TSLIB_CFLAGS=`$PKG_CONFIG --cflags "tslib-0.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$TSLIB_LIBS"; then pkg_cv_TSLIB_LIBS="$TSLIB_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"tslib-0.0\"") >&5 ($PKG_CONFIG --exists --print-errors "tslib-0.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_TSLIB_LIBS=`$PKG_CONFIG --libs "tslib-0.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TSLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "tslib-0.0"` else TSLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "tslib-0.0"` fi # Put the nasty error message in config.log where it belongs echo "$TSLIB_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } enable_tslib=no, { echo "$as_me:$LINENO: WARNING: *** no tslib -- tslib driver will not be built." >&5 echo "$as_me: WARNING: *** no tslib -- tslib driver will not be built." >&2;} elif test $pkg_failed = untried; then enable_tslib=no, { echo "$as_me:$LINENO: WARNING: *** no tslib -- tslib driver will not be built." >&5 echo "$as_me: WARNING: *** no tslib -- tslib driver will not be built." >&2;} else TSLIB_CFLAGS=$pkg_cv_TSLIB_CFLAGS TSLIB_LIBS=$pkg_cv_TSLIB_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } enable_tslib=yes fi fi enable_ucb1x00_ts=no if test "$checkfor_ucb1x00" = "yes"; then enable_ucb1x00_ts=yes fi enable_wm97xx_ts=no if test "$checkfor_wm97xx" = "yes"; then enable_wm97xx_ts=yes fi fi # Check whether --with-software was given. if test "${with_software+set}" = set; then withval=$with_software; fi if test "$with_software" != "no"; then with_software=yes fi if test "$with_software" != "no"; then SOFTWARE_RENDERING_TRUE= SOFTWARE_RENDERING_FALSE='#' else SOFTWARE_RENDERING_TRUE='#' SOFTWARE_RENDERING_FALSE= fi # Check whether --with-smooth-scaling was given. if test "${with_smooth_scaling+set}" = set; then withval=$with_smooth_scaling; fi if test "$with_smooth_scaling" != "yes" -o "$with_software" != "yes"; then with_smooth_scaling=no else cat >>confdefs.h <<\_ACEOF #define DFB_SMOOTH_SCALING 1 _ACEOF fi # Check whether --with-tests was given. if test "${with_tests+set}" = set; then withval=$with_tests; fi if test "$with_tests" != "yes"; then with_tests=no fi # How big of a buffer fusion uses to read messages from the fusion device # Check whether --with-message-size was given. if test "${with_message_size+set}" = set; then withval=$with_message_size; else with_message_size=no fi test x"$with_message_size" = x"no" && with_message_size=1024 FUSION_MESSAGE_SIZE=$with_message_size # Build tools? # Check whether --with-tools was given. if test "${with_tools+set}" = set; then withval=$with_tools; fi if test "$with_tools" != "no"; then with_tools=yes fi # Sysroot used for runtime module loading, etc. # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then withval=$with_sysroot; RUNTIME_SYSROOT="$withval" else RUNTIME_SYSROOT= fi test x"$RUNTIME_SYSROOT" = x"no" && RUNTIME_SYSROOT= if test "$enable_unique" = "yes"; then if test "$cross_compiling" = "yes" || test "$with_tools" = "no"; then # Extract the first word of "directfb-csource", so it can be a program name with args. set dummy directfb-csource; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_DIRECTFB_CSOURCE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DIRECTFB_CSOURCE in [\\/]* | ?:[\\/]*) ac_cv_path_DIRECTFB_CSOURCE="$DIRECTFB_CSOURCE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DIRECTFB_CSOURCE="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DIRECTFB_CSOURCE" && ac_cv_path_DIRECTFB_CSOURCE="no" ;; esac fi DIRECTFB_CSOURCE=$ac_cv_path_DIRECTFB_CSOURCE if test -n "$DIRECTFB_CSOURCE"; then { echo "$as_me:$LINENO: result: $DIRECTFB_CSOURCE" >&5 echo "${ECHO_T}$DIRECTFB_CSOURCE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$DIRECTFB_CSOURCE" = "xno"; then { { echo "$as_me:$LINENO: error: Could not find a directfb-csource in your PATH" >&5 echo "$as_me: error: Could not find a directfb-csource in your PATH" >&2;} { (exit 1); exit 1; }; } fi fi fi if test "$ati128" = "yes"; then GFX_ATI128_TRUE= GFX_ATI128_FALSE='#' else GFX_ATI128_TRUE='#' GFX_ATI128_FALSE= fi if test "$cle266" = "yes"; then GFX_CLE266_TRUE= GFX_CLE266_FALSE='#' else GFX_CLE266_TRUE='#' GFX_CLE266_FALSE= fi if test "$cyber5k" = "yes"; then GFX_CYBER5K_TRUE= GFX_CYBER5K_FALSE='#' else GFX_CYBER5K_TRUE='#' GFX_CYBER5K_FALSE= fi if test "$davinci" = "yes"; then GFX_DAVINCI_TRUE= GFX_DAVINCI_FALSE='#' else GFX_DAVINCI_TRUE='#' GFX_DAVINCI_FALSE= fi if test "$ep9x" = "yes"; then GFX_EP9X_TRUE= GFX_EP9X_FALSE='#' else GFX_EP9X_TRUE='#' GFX_EP9X_FALSE= fi if test "$i810" = "yes"; then GFX_I810_TRUE= GFX_I810_FALSE='#' else GFX_I810_TRUE='#' GFX_I810_FALSE= fi if test "$i830" = "yes"; then GFX_I830_TRUE= GFX_I830_FALSE='#' else GFX_I830_TRUE='#' GFX_I830_FALSE= fi if test "$mach64" = "yes"; then GFX_MACH64_TRUE= GFX_MACH64_FALSE='#' else GFX_MACH64_TRUE='#' GFX_MACH64_FALSE= fi if test "$matrox" = "yes"; then GFX_MATROX_TRUE= GFX_MATROX_FALSE='#' else GFX_MATROX_TRUE='#' GFX_MATROX_FALSE= fi if test "$neomagic" = "yes"; then GFX_NEOMAGIC_TRUE= GFX_NEOMAGIC_FALSE='#' else GFX_NEOMAGIC_TRUE='#' GFX_NEOMAGIC_FALSE= fi if test "$nsc" = "yes"; then GFX_NSC_TRUE= GFX_NSC_FALSE='#' else GFX_NSC_TRUE='#' GFX_NSC_FALSE= fi if test "$nvidia" = "yes"; then GFX_NVIDIA_TRUE= GFX_NVIDIA_FALSE='#' else GFX_NVIDIA_TRUE='#' GFX_NVIDIA_FALSE= fi if test "$omap" = "yes"; then GFX_OMAP_TRUE= GFX_OMAP_FALSE='#' else GFX_OMAP_TRUE='#' GFX_OMAP_FALSE= fi if test "$radeon" = "yes"; then GFX_RADEON_TRUE= GFX_RADEON_FALSE='#' else GFX_RADEON_TRUE='#' GFX_RADEON_FALSE= fi if test "$savage" = "yes"; then GFX_SAVAGE_TRUE= GFX_SAVAGE_FALSE='#' else GFX_SAVAGE_TRUE='#' GFX_SAVAGE_FALSE= fi if test "$sh772x" = "yes"; then GFX_SH772X_TRUE= GFX_SH772X_FALSE='#' else GFX_SH772X_TRUE='#' GFX_SH772X_FALSE= fi if test "$sis315" = "yes"; then GFX_SIS315_TRUE= GFX_SIS315_FALSE='#' else GFX_SIS315_TRUE='#' GFX_SIS315_FALSE= fi if test "$tdfx" = "yes"; then GFX_TDFX_TRUE= GFX_TDFX_FALSE='#' else GFX_TDFX_TRUE='#' GFX_TDFX_FALSE= fi if test "$unichrome" = "yes"; then GFX_UNICHROME_TRUE= GFX_UNICHROME_FALSE='#' else GFX_UNICHROME_TRUE='#' GFX_UNICHROME_FALSE= fi if test "$vmware" = "yes"; then GFX_VMWARE_TRUE= GFX_VMWARE_FALSE='#' else GFX_VMWARE_TRUE='#' GFX_VMWARE_FALSE= fi if test "$enable_dbox2remote" = "yes"; then DBOX2REMOTE_TRUE= DBOX2REMOTE_FALSE='#' else DBOX2REMOTE_TRUE='#' DBOX2REMOTE_FALSE= fi if test "$enable_dreamboxremote" = "yes"; then DREAMBOXREMOTE_TRUE= DREAMBOXREMOTE_FALSE='#' else DREAMBOXREMOTE_TRUE='#' DREAMBOXREMOTE_FALSE= fi if test "$enable_dynapro_ts" = "yes"; then DYNAPRO_INPUT_TRUE= DYNAPRO_INPUT_FALSE='#' else DYNAPRO_INPUT_TRUE='#' DYNAPRO_INPUT_FALSE= fi if test "$enable_elo_input" = "yes"; then ELO_INPUT_TRUE= ELO_INPUT_FALSE='#' else ELO_INPUT_TRUE='#' ELO_INPUT_FALSE= fi if test "$enable_gunze_input" = "yes"; then GUNZE_INPUT_TRUE= GUNZE_INPUT_FALSE='#' else GUNZE_INPUT_TRUE='#' GUNZE_INPUT_FALSE= fi if test "$enable_h3600_ts" = "yes"; then H3600_TS_TRUE= H3600_TS_FALSE='#' else H3600_TS_TRUE='#' H3600_TS_FALSE= fi if test "$enable_joystick" = "yes"; then JOYSTICK_INPUT_TRUE= JOYSTICK_INPUT_FALSE='#' else JOYSTICK_INPUT_TRUE='#' JOYSTICK_INPUT_FALSE= fi if test "$enable_keyboard" = "yes"; then KEYBOARD_INPUT_TRUE= KEYBOARD_INPUT_FALSE='#' else KEYBOARD_INPUT_TRUE='#' KEYBOARD_INPUT_FALSE= fi if test "$enable_linux_input" = "yes"; then LINUX_INPUT_TRUE= LINUX_INPUT_FALSE='#' else LINUX_INPUT_TRUE='#' LINUX_INPUT_FALSE= fi if test "$enable_lirc" = "yes"; then LIRC_INPUT_TRUE= LIRC_INPUT_FALSE='#' else LIRC_INPUT_TRUE='#' LIRC_INPUT_FALSE= fi if test "$enable_mutouch" = "yes"; then MUTOUCH_TS_TRUE= MUTOUCH_TS_FALSE='#' else MUTOUCH_TS_TRUE='#' MUTOUCH_TS_FALSE= fi if test "$enable_penmount" = "yes" ; then PENMOUNT_TS_TRUE= PENMOUNT_TS_FALSE='#' else PENMOUNT_TS_TRUE='#' PENMOUNT_TS_FALSE= fi if test "$enable_ps2mouse" = "yes"; then PS2MOUSE_INPUT_TRUE= PS2MOUSE_INPUT_FALSE='#' else PS2MOUSE_INPUT_TRUE='#' PS2MOUSE_INPUT_FALSE= fi if test "$enable_serial_mouse" = "yes"; then SERIAL_MOUSE_INPUT_TRUE= SERIAL_MOUSE_INPUT_FALSE='#' else SERIAL_MOUSE_INPUT_TRUE='#' SERIAL_MOUSE_INPUT_FALSE= fi if test "$enable_sonypi_jogdial" = "yes"; then SONYPI_TRUE= SONYPI_FALSE='#' else SONYPI_TRUE='#' SONYPI_FALSE= fi if test "$enable_tslib" = "yes"; then TSLIB_TRUE= TSLIB_FALSE='#' else TSLIB_TRUE='#' TSLIB_FALSE= fi if test "$enable_ucb1x00_ts" = "yes"; then UCB1X00_TS_TRUE= UCB1X00_TS_FALSE='#' else UCB1X00_TS_TRUE='#' UCB1X00_TS_FALSE= fi if test "$enable_wm97xx_ts" = "yes"; then WM97XX_TS_TRUE= WM97XX_TS_FALSE='#' else WM97XX_TS_TRUE='#' WM97XX_TS_FALSE= fi if test "$with_tests" = "yes"; then BUILD_TESTS_TRUE= BUILD_TESTS_FALSE='#' else BUILD_TESTS_TRUE='#' BUILD_TESTS_FALSE= fi if test "$with_tools" = "yes"; then BUILD_TOOLS_TRUE= BUILD_TOOLS_FALSE='#' else BUILD_TOOLS_TRUE='#' BUILD_TOOLS_FALSE= fi if test "$cross_compiling" = "yes"; then CROSS_COMPILING_TRUE= CROSS_COMPILING_FALSE='#' else CROSS_COMPILING_TRUE='#' CROSS_COMPILING_FALSE= fi CFLAGS="$CFLAGS $DFB_INTERNAL_CFLAGS" DFB_LDFLAGS="$LDFLAGS $ZLIB_LIBS" # Honor aclocal flags ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" if test "$enable_shared" = "yes"; then BUILD_SHARED_TRUE= BUILD_SHARED_FALSE='#' else BUILD_SHARED_TRUE='#' BUILD_SHARED_FALSE= fi if test "$enable_static" = "yes"; then BUILD_STATIC_TRUE= BUILD_STATIC_FALSE='#' else BUILD_STATIC_TRUE='#' BUILD_STATIC_FALSE= fi # Change the module directory only for builds that don't *support* debug if test "$enable_debug_support" = "no"; then MODULEDIRNAME=directfb-$BINARY_VERSION-pure else MODULEDIRNAME=directfb-$BINARY_VERSION fi MODULEDIR=$libdir/$MODULEDIRNAME DATADIR=$datadir/directfb-$VERSION INCLUDEDIR=$includedir/directfb INTERNALINCLUDEDIR=$includedir/directfb-internal SOPATH=$libdir/libdirectfb-$LT_RELEASE.so.$LT_CURRENT EXP_VAR=SYSCONFDIR FROM_VAR=$sysconfdir prefix_save=$prefix exec_prefix_save=$exec_prefix if test "x$prefix" = "xNONE"; then prefix="$ac_default_prefix" fi if test "x$exec_prefix" = "xNONE"; then exec_prefix=$prefix fi full_var="$FROM_VAR" while true; do new_full_var="`eval echo $full_var`" if test "x$new_full_var" = "x$full_var"; then break; fi full_var=$new_full_var done full_var=$new_full_var SYSCONFDIR="$full_var" prefix=$prefix_save exec_prefix=$exec_prefix_save CFLAGS="$CFLAGS -Werror-implicit-function-declaration" ac_config_files="$ac_config_files directfb-config directfb.pc directfb-internal.pc directfb.spec Makefile include/Makefile include/directfb_version.h lib/Makefile lib/direct/Makefile lib/direct/build.h lib/direct/direct.pc lib/fusion/Makefile lib/fusion/build.h lib/fusion/fusion.pc lib/fusion/shm/Makefile lib/voodoo/Makefile lib/voodoo/build.h lib/voodoo/voodoo.pc patches/Makefile proxy/Makefile proxy/dispatcher/Makefile proxy/requestor/Makefile rules/Makefile src/Makefile src/core/Makefile src/display/Makefile src/gfx/Makefile src/gfx/generic/Makefile src/input/Makefile src/media/Makefile src/misc/Makefile src/windows/Makefile systems/Makefile systems/devmem/Makefile systems/fbdev/Makefile systems/x11/Makefile systems/osx/Makefile systems/sdl/Makefile systems/vnc/Makefile wm/Makefile wm/default/Makefile wm/unique/Makefile wm/unique/classes/Makefile wm/unique/data/Makefile wm/unique/devices/Makefile gfxdrivers/Makefile gfxdrivers/ati128/Makefile gfxdrivers/cle266/Makefile gfxdrivers/cyber5k/Makefile gfxdrivers/davinci/Makefile gfxdrivers/ep9x/Makefile gfxdrivers/i810/Makefile gfxdrivers/i830/Makefile gfxdrivers/mach64/Makefile gfxdrivers/matrox/Makefile gfxdrivers/neomagic/Makefile gfxdrivers/nsc/Makefile gfxdrivers/nsc/include/Makefile gfxdrivers/nvidia/Makefile gfxdrivers/omap/Makefile gfxdrivers/radeon/Makefile gfxdrivers/savage/Makefile gfxdrivers/sh772x/Makefile gfxdrivers/sis315/Makefile gfxdrivers/tdfx/Makefile gfxdrivers/unichrome/Makefile gfxdrivers/vmware/Makefile inputdrivers/Makefile inputdrivers/dbox2remote/Makefile inputdrivers/dreamboxremote/Makefile inputdrivers/dynapro/Makefile inputdrivers/elo/Makefile inputdrivers/gunze/Makefile inputdrivers/h3600_ts/Makefile inputdrivers/joystick/Makefile inputdrivers/keyboard/Makefile inputdrivers/linux_input/Makefile inputdrivers/lirc/Makefile inputdrivers/mutouch/Makefile inputdrivers/penmount/Makefile inputdrivers/ps2mouse/Makefile inputdrivers/serialmouse/Makefile inputdrivers/sonypi/Makefile inputdrivers/tslib/Makefile inputdrivers/ucb1x00_ts/Makefile inputdrivers/wm97xx_ts/Makefile interfaces/Makefile interfaces/IDirectFBFont/Makefile interfaces/IDirectFBImageProvider/Makefile interfaces/IDirectFBVideoProvider/Makefile data/Makefile tests/Makefile tools/Makefile docs/Makefile docs/dfbg.1 docs/directfb-csource.1 docs/directfbrc.5 docs/html/Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_MAN2HTML_TRUE}" && test -z "${HAVE_MAN2HTML_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_MAN2HTML\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_MAN2HTML\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${OSX_CORE_TRUE}" && test -z "${OSX_CORE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"OSX_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"OSX_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${X11_CORE_TRUE}" && test -z "${X11_CORE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"X11_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"X11_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_LINUX_TRUE}" && test -z "${HAVE_LINUX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILDPPCASM_TRUE}" && test -z "${BUILDPPCASM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILDPPCASM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILDPPCASM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_DEBUG_TRUE}" && test -z "${ENABLE_DEBUG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_DEBUGS_TRUE}" && test -z "${ENABLE_DEBUGS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DEBUGS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_DEBUGS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_TRACE_TRUE}" && test -z "${ENABLE_TRACE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_TRACE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_TRACE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_MULTI_TRUE}" && test -z "${ENABLE_MULTI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MULTI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_MULTI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_VOODOO_TRUE}" && test -z "${ENABLE_VOODOO_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_VOODOO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_VOODOO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_UNIQUE_TRUE}" && test -z "${ENABLE_UNIQUE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_UNIQUE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_UNIQUE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILDMMX_TRUE}" && test -z "${BUILDMMX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILDMMX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILDMMX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DEVMEM_CORE_TRUE}" && test -z "${DEVMEM_CORE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DEVMEM_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DEVMEM_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FBDEV_CORE_TRUE}" && test -z "${FBDEV_CORE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FBDEV_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FBDEV_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SDL_CORE_TRUE}" && test -z "${SDL_CORE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SDL_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SDL_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${VNC_CORE_TRUE}" && test -z "${VNC_CORE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"VNC_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"VNC_CORE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${JPEG_PROVIDER_TRUE}" && test -z "${JPEG_PROVIDER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"JPEG_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"JPEG_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PNG_PROVIDER_TRUE}" && test -z "${PNG_PROVIDER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"PNG_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"PNG_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_DIRECTFB_CSOURCE_TRUE}" && test -z "${BUILD_DIRECTFB_CSOURCE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_DIRECTFB_CSOURCE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_DIRECTFB_CSOURCE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GIF_PROVIDER_TRUE}" && test -z "${GIF_PROVIDER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GIF_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GIF_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREETYPE_PROVIDER_TRUE}" && test -z "${FREETYPE_PROVIDER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREETYPE_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREETYPE_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${V4L_PROVIDER_TRUE}" && test -z "${V4L_PROVIDER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"V4L_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"V4L_PROVIDER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SOFTWARE_RENDERING_TRUE}" && test -z "${SOFTWARE_RENDERING_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SOFTWARE_RENDERING\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SOFTWARE_RENDERING\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_ATI128_TRUE}" && test -z "${GFX_ATI128_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_ATI128\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_ATI128\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_CLE266_TRUE}" && test -z "${GFX_CLE266_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_CLE266\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_CLE266\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_CYBER5K_TRUE}" && test -z "${GFX_CYBER5K_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_CYBER5K\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_CYBER5K\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_DAVINCI_TRUE}" && test -z "${GFX_DAVINCI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_DAVINCI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_DAVINCI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_EP9X_TRUE}" && test -z "${GFX_EP9X_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_EP9X\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_EP9X\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_I810_TRUE}" && test -z "${GFX_I810_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_I810\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_I810\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_I830_TRUE}" && test -z "${GFX_I830_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_I830\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_I830\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_MACH64_TRUE}" && test -z "${GFX_MACH64_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_MACH64\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_MACH64\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_MATROX_TRUE}" && test -z "${GFX_MATROX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_MATROX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_MATROX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_NEOMAGIC_TRUE}" && test -z "${GFX_NEOMAGIC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_NEOMAGIC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_NEOMAGIC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_NSC_TRUE}" && test -z "${GFX_NSC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_NSC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_NSC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_NVIDIA_TRUE}" && test -z "${GFX_NVIDIA_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_NVIDIA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_NVIDIA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_OMAP_TRUE}" && test -z "${GFX_OMAP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_OMAP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_OMAP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_RADEON_TRUE}" && test -z "${GFX_RADEON_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_RADEON\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_RADEON\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_SAVAGE_TRUE}" && test -z "${GFX_SAVAGE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_SAVAGE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_SAVAGE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_SH772X_TRUE}" && test -z "${GFX_SH772X_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_SH772X\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_SH772X\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_SIS315_TRUE}" && test -z "${GFX_SIS315_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_SIS315\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_SIS315\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_TDFX_TRUE}" && test -z "${GFX_TDFX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_TDFX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_TDFX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_UNICHROME_TRUE}" && test -z "${GFX_UNICHROME_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_UNICHROME\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_UNICHROME\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GFX_VMWARE_TRUE}" && test -z "${GFX_VMWARE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GFX_VMWARE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GFX_VMWARE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DBOX2REMOTE_TRUE}" && test -z "${DBOX2REMOTE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DBOX2REMOTE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DBOX2REMOTE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DREAMBOXREMOTE_TRUE}" && test -z "${DREAMBOXREMOTE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DREAMBOXREMOTE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DREAMBOXREMOTE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DYNAPRO_INPUT_TRUE}" && test -z "${DYNAPRO_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DYNAPRO_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DYNAPRO_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ELO_INPUT_TRUE}" && test -z "${ELO_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ELO_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ELO_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GUNZE_INPUT_TRUE}" && test -z "${GUNZE_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GUNZE_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GUNZE_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${H3600_TS_TRUE}" && test -z "${H3600_TS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"H3600_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"H3600_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${JOYSTICK_INPUT_TRUE}" && test -z "${JOYSTICK_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"JOYSTICK_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"JOYSTICK_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${KEYBOARD_INPUT_TRUE}" && test -z "${KEYBOARD_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"KEYBOARD_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"KEYBOARD_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LINUX_INPUT_TRUE}" && test -z "${LINUX_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"LINUX_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"LINUX_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LIRC_INPUT_TRUE}" && test -z "${LIRC_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"LIRC_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"LIRC_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MUTOUCH_TS_TRUE}" && test -z "${MUTOUCH_TS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MUTOUCH_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MUTOUCH_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PENMOUNT_TS_TRUE}" && test -z "${PENMOUNT_TS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"PENMOUNT_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"PENMOUNT_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PS2MOUSE_INPUT_TRUE}" && test -z "${PS2MOUSE_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"PS2MOUSE_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"PS2MOUSE_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SERIAL_MOUSE_INPUT_TRUE}" && test -z "${SERIAL_MOUSE_INPUT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SERIAL_MOUSE_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SERIAL_MOUSE_INPUT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SONYPI_TRUE}" && test -z "${SONYPI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SONYPI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SONYPI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${TSLIB_TRUE}" && test -z "${TSLIB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"TSLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"TSLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${UCB1X00_TS_TRUE}" && test -z "${UCB1X00_TS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"UCB1X00_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"UCB1X00_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WM97XX_TS_TRUE}" && test -z "${WM97XX_TS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WM97XX_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WM97XX_TS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_TESTS_TRUE}" && test -z "${BUILD_TESTS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_TOOLS_TRUE}" && test -z "${BUILD_TOOLS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_TOOLS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_TOOLS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_SHARED_TRUE}" && test -z "${BUILD_SHARED_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_SHARED\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_SHARED\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_STATIC_TRUE}" && test -z "${BUILD_STATIC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "directfb-config") CONFIG_FILES="$CONFIG_FILES directfb-config" ;; "directfb.pc") CONFIG_FILES="$CONFIG_FILES directfb.pc" ;; "directfb-internal.pc") CONFIG_FILES="$CONFIG_FILES directfb-internal.pc" ;; "directfb.spec") CONFIG_FILES="$CONFIG_FILES directfb.spec" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/directfb_version.h") CONFIG_FILES="$CONFIG_FILES include/directfb_version.h" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/direct/Makefile") CONFIG_FILES="$CONFIG_FILES lib/direct/Makefile" ;; "lib/direct/build.h") CONFIG_FILES="$CONFIG_FILES lib/direct/build.h" ;; "lib/direct/direct.pc") CONFIG_FILES="$CONFIG_FILES lib/direct/direct.pc" ;; "lib/fusion/Makefile") CONFIG_FILES="$CONFIG_FILES lib/fusion/Makefile" ;; "lib/fusion/build.h") CONFIG_FILES="$CONFIG_FILES lib/fusion/build.h" ;; "lib/fusion/fusion.pc") CONFIG_FILES="$CONFIG_FILES lib/fusion/fusion.pc" ;; "lib/fusion/shm/Makefile") CONFIG_FILES="$CONFIG_FILES lib/fusion/shm/Makefile" ;; "lib/voodoo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/voodoo/Makefile" ;; "lib/voodoo/build.h") CONFIG_FILES="$CONFIG_FILES lib/voodoo/build.h" ;; "lib/voodoo/voodoo.pc") CONFIG_FILES="$CONFIG_FILES lib/voodoo/voodoo.pc" ;; "patches/Makefile") CONFIG_FILES="$CONFIG_FILES patches/Makefile" ;; "proxy/Makefile") CONFIG_FILES="$CONFIG_FILES proxy/Makefile" ;; "proxy/dispatcher/Makefile") CONFIG_FILES="$CONFIG_FILES proxy/dispatcher/Makefile" ;; "proxy/requestor/Makefile") CONFIG_FILES="$CONFIG_FILES proxy/requestor/Makefile" ;; "rules/Makefile") CONFIG_FILES="$CONFIG_FILES rules/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/core/Makefile") CONFIG_FILES="$CONFIG_FILES src/core/Makefile" ;; "src/display/Makefile") CONFIG_FILES="$CONFIG_FILES src/display/Makefile" ;; "src/gfx/Makefile") CONFIG_FILES="$CONFIG_FILES src/gfx/Makefile" ;; "src/gfx/generic/Makefile") CONFIG_FILES="$CONFIG_FILES src/gfx/generic/Makefile" ;; "src/input/Makefile") CONFIG_FILES="$CONFIG_FILES src/input/Makefile" ;; "src/media/Makefile") CONFIG_FILES="$CONFIG_FILES src/media/Makefile" ;; "src/misc/Makefile") CONFIG_FILES="$CONFIG_FILES src/misc/Makefile" ;; "src/windows/Makefile") CONFIG_FILES="$CONFIG_FILES src/windows/Makefile" ;; "systems/Makefile") CONFIG_FILES="$CONFIG_FILES systems/Makefile" ;; "systems/devmem/Makefile") CONFIG_FILES="$CONFIG_FILES systems/devmem/Makefile" ;; "systems/fbdev/Makefile") CONFIG_FILES="$CONFIG_FILES systems/fbdev/Makefile" ;; "systems/x11/Makefile") CONFIG_FILES="$CONFIG_FILES systems/x11/Makefile" ;; "systems/osx/Makefile") CONFIG_FILES="$CONFIG_FILES systems/osx/Makefile" ;; "systems/sdl/Makefile") CONFIG_FILES="$CONFIG_FILES systems/sdl/Makefile" ;; "systems/vnc/Makefile") CONFIG_FILES="$CONFIG_FILES systems/vnc/Makefile" ;; "wm/Makefile") CONFIG_FILES="$CONFIG_FILES wm/Makefile" ;; "wm/default/Makefile") CONFIG_FILES="$CONFIG_FILES wm/default/Makefile" ;; "wm/unique/Makefile") CONFIG_FILES="$CONFIG_FILES wm/unique/Makefile" ;; "wm/unique/classes/Makefile") CONFIG_FILES="$CONFIG_FILES wm/unique/classes/Makefile" ;; "wm/unique/data/Makefile") CONFIG_FILES="$CONFIG_FILES wm/unique/data/Makefile" ;; "wm/unique/devices/Makefile") CONFIG_FILES="$CONFIG_FILES wm/unique/devices/Makefile" ;; "gfxdrivers/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/Makefile" ;; "gfxdrivers/ati128/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/ati128/Makefile" ;; "gfxdrivers/cle266/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/cle266/Makefile" ;; "gfxdrivers/cyber5k/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/cyber5k/Makefile" ;; "gfxdrivers/davinci/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/davinci/Makefile" ;; "gfxdrivers/ep9x/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/ep9x/Makefile" ;; "gfxdrivers/i810/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/i810/Makefile" ;; "gfxdrivers/i830/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/i830/Makefile" ;; "gfxdrivers/mach64/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/mach64/Makefile" ;; "gfxdrivers/matrox/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/matrox/Makefile" ;; "gfxdrivers/neomagic/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/neomagic/Makefile" ;; "gfxdrivers/nsc/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/nsc/Makefile" ;; "gfxdrivers/nsc/include/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/nsc/include/Makefile" ;; "gfxdrivers/nvidia/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/nvidia/Makefile" ;; "gfxdrivers/omap/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/omap/Makefile" ;; "gfxdrivers/radeon/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/radeon/Makefile" ;; "gfxdrivers/savage/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/savage/Makefile" ;; "gfxdrivers/sh772x/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/sh772x/Makefile" ;; "gfxdrivers/sis315/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/sis315/Makefile" ;; "gfxdrivers/tdfx/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/tdfx/Makefile" ;; "gfxdrivers/unichrome/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/unichrome/Makefile" ;; "gfxdrivers/vmware/Makefile") CONFIG_FILES="$CONFIG_FILES gfxdrivers/vmware/Makefile" ;; "inputdrivers/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/Makefile" ;; "inputdrivers/dbox2remote/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/dbox2remote/Makefile" ;; "inputdrivers/dreamboxremote/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/dreamboxremote/Makefile" ;; "inputdrivers/dynapro/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/dynapro/Makefile" ;; "inputdrivers/elo/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/elo/Makefile" ;; "inputdrivers/gunze/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/gunze/Makefile" ;; "inputdrivers/h3600_ts/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/h3600_ts/Makefile" ;; "inputdrivers/joystick/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/joystick/Makefile" ;; "inputdrivers/keyboard/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/keyboard/Makefile" ;; "inputdrivers/linux_input/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/linux_input/Makefile" ;; "inputdrivers/lirc/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/lirc/Makefile" ;; "inputdrivers/mutouch/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/mutouch/Makefile" ;; "inputdrivers/penmount/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/penmount/Makefile" ;; "inputdrivers/ps2mouse/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/ps2mouse/Makefile" ;; "inputdrivers/serialmouse/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/serialmouse/Makefile" ;; "inputdrivers/sonypi/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/sonypi/Makefile" ;; "inputdrivers/tslib/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/tslib/Makefile" ;; "inputdrivers/ucb1x00_ts/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/ucb1x00_ts/Makefile" ;; "inputdrivers/wm97xx_ts/Makefile") CONFIG_FILES="$CONFIG_FILES inputdrivers/wm97xx_ts/Makefile" ;; "interfaces/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/Makefile" ;; "interfaces/IDirectFBFont/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBFont/Makefile" ;; "interfaces/IDirectFBImageProvider/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBImageProvider/Makefile" ;; "interfaces/IDirectFBVideoProvider/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/IDirectFBVideoProvider/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/dfbg.1") CONFIG_FILES="$CONFIG_FILES docs/dfbg.1" ;; "docs/directfb-csource.1") CONFIG_FILES="$CONFIG_FILES docs/directfb-csource.1" ;; "docs/directfbrc.5") CONFIG_FILES="$CONFIG_FILES docs/directfbrc.5" ;; "docs/html/Makefile") CONFIG_FILES="$CONFIG_FILES docs/html/Makefile" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim DIRECTFB_MAJOR_VERSION!$DIRECTFB_MAJOR_VERSION$ac_delim DIRECTFB_MINOR_VERSION!$DIRECTFB_MINOR_VERSION$ac_delim DIRECTFB_MICRO_VERSION!$DIRECTFB_MICRO_VERSION$ac_delim DIRECTFB_INTERFACE_AGE!$DIRECTFB_INTERFACE_AGE$ac_delim DIRECTFB_BINARY_AGE!$DIRECTFB_BINARY_AGE$ac_delim DIRECTFB_VERSION!$DIRECTFB_VERSION$ac_delim LT_RELEASE!$LT_RELEASE$ac_delim LT_CURRENT!$LT_CURRENT$ac_delim LT_BINARY!$LT_BINARY$ac_delim LT_REVISION!$LT_REVISION$ac_delim LT_AGE!$LT_AGE$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CCAS!$CCAS$ac_delim CCASFLAGS!$CCASFLAGS$ac_delim CCASDEPMODE!$CCASDEPMODE$ac_delim am__fastdepCCAS_TRUE!$am__fastdepCCAS_TRUE$ac_delim am__fastdepCCAS_FALSE!$am__fastdepCCAS_FALSE$ac_delim SED!$SED$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim DSYMUTIL!$DSYMUTIL$ac_delim NMEDIT!$NMEDIT$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim LD!$LD$ac_delim PERL!$PERL$ac_delim MAN2HTML!$MAN2HTML$ac_delim HAVE_MAN2HTML_TRUE!$HAVE_MAN2HTML_TRUE$ac_delim HAVE_MAN2HTML_FALSE!$HAVE_MAN2HTML_FALSE$ac_delim OSX_CORE_TRUE!$OSX_CORE_TRUE$ac_delim OSX_CORE_FALSE!$OSX_CORE_FALSE$ac_delim X11_CORE_TRUE!$X11_CORE_TRUE$ac_delim X11_CORE_FALSE!$X11_CORE_FALSE$ac_delim HAVE_LINUX_TRUE!$HAVE_LINUX_TRUE$ac_delim HAVE_LINUX_FALSE!$HAVE_LINUX_FALSE$ac_delim BUILDPPCASM_TRUE!$BUILDPPCASM_TRUE$ac_delim BUILDPPCASM_FALSE!$BUILDPPCASM_FALSE$ac_delim THREADFLAGS!$THREADFLAGS$ac_delim THREADLIB!$THREADLIB$ac_delim DYNLIB!$DYNLIB$ac_delim AS!$AS$ac_delim ASFLAGS!$ASFLAGS$ac_delim ENABLE_DEBUG_TRUE!$ENABLE_DEBUG_TRUE$ac_delim ENABLE_DEBUG_FALSE!$ENABLE_DEBUG_FALSE$ac_delim DIRECT_BUILD_DEBUG!$DIRECT_BUILD_DEBUG$ac_delim ENABLE_DEBUGS_TRUE!$ENABLE_DEBUGS_TRUE$ac_delim ENABLE_DEBUGS_FALSE!$ENABLE_DEBUGS_FALSE$ac_delim DIRECT_BUILD_DEBUGS!$DIRECT_BUILD_DEBUGS$ac_delim ENABLE_TRACE_TRUE!$ENABLE_TRACE_TRUE$ac_delim ENABLE_TRACE_FALSE!$ENABLE_TRACE_FALSE$ac_delim DIRECT_BUILD_TRACE!$DIRECT_BUILD_TRACE$ac_delim DIRECT_BUILD_TEXT!$DIRECT_BUILD_TEXT$ac_delim DIRECT_BUILD_GETTID!$DIRECT_BUILD_GETTID$ac_delim DIRECT_BUILD_NETWORK!$DIRECT_BUILD_NETWORK$ac_delim DIRECT_BUILD_STDBOOL!$DIRECT_BUILD_STDBOOL$ac_delim ENABLE_MULTI_TRUE!$ENABLE_MULTI_TRUE$ac_delim ENABLE_MULTI_FALSE!$ENABLE_MULTI_FALSE$ac_delim FUSION_BUILD_MULTI!$FUSION_BUILD_MULTI$ac_delim FUSION_BUILD_KERNEL!$FUSION_BUILD_KERNEL$ac_delim ENABLE_VOODOO_TRUE!$ENABLE_VOODOO_TRUE$ac_delim ENABLE_VOODOO_FALSE!$ENABLE_VOODOO_FALSE$ac_delim ENABLE_UNIQUE_TRUE!$ENABLE_UNIQUE_TRUE$ac_delim ENABLE_UNIQUE_FALSE!$ENABLE_UNIQUE_FALSE$ac_delim BUILDMMX_TRUE!$BUILDMMX_TRUE$ac_delim BUILDMMX_FALSE!$BUILDMMX_FALSE$ac_delim DEVMEM_CORE_TRUE!$DEVMEM_CORE_TRUE$ac_delim DEVMEM_CORE_FALSE!$DEVMEM_CORE_FALSE$ac_delim FBDEV_CORE_TRUE!$FBDEV_CORE_TRUE$ac_delim FBDEV_CORE_FALSE!$FBDEV_CORE_FALSE$ac_delim SDL_CFLAGS!$SDL_CFLAGS$ac_delim SDL_LIBS!$SDL_LIBS$ac_delim OSX_LIBS!$OSX_LIBS$ac_delim SDL_CORE_TRUE!$SDL_CORE_TRUE$ac_delim SDL_CORE_FALSE!$SDL_CORE_FALSE$ac_delim VNC_CONFIG!$VNC_CONFIG$ac_delim VNC_CORE_TRUE!$VNC_CORE_TRUE$ac_delim VNC_CORE_FALSE!$VNC_CORE_FALSE$ac_delim VNC_LIBS!$VNC_LIBS$ac_delim VNC_CFLAGS!$VNC_CFLAGS$ac_delim SYSFS_LIBS!$SYSFS_LIBS$ac_delim JPEG_PROVIDER_TRUE!$JPEG_PROVIDER_TRUE$ac_delim JPEG_PROVIDER_FALSE!$JPEG_PROVIDER_FALSE$ac_delim ZLIB_LIBS!$ZLIB_LIBS$ac_delim LIBPNG_CONFIG!$LIBPNG_CONFIG$ac_delim PNG_PROVIDER_TRUE!$PNG_PROVIDER_TRUE$ac_delim PNG_PROVIDER_FALSE!$PNG_PROVIDER_FALSE$ac_delim BUILD_DIRECTFB_CSOURCE_TRUE!$BUILD_DIRECTFB_CSOURCE_TRUE$ac_delim BUILD_DIRECTFB_CSOURCE_FALSE!$BUILD_DIRECTFB_CSOURCE_FALSE$ac_delim GIF_PROVIDER_TRUE!$GIF_PROVIDER_TRUE$ac_delim GIF_PROVIDER_FALSE!$GIF_PROVIDER_FALSE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF FREETYPE_CFLAGS!$FREETYPE_CFLAGS$ac_delim FREETYPE_LIBS!$FREETYPE_LIBS$ac_delim FREETYPE_PROVIDER_TRUE!$FREETYPE_PROVIDER_TRUE$ac_delim FREETYPE_PROVIDER_FALSE!$FREETYPE_PROVIDER_FALSE$ac_delim V4L_PROVIDER_TRUE!$V4L_PROVIDER_TRUE$ac_delim V4L_PROVIDER_FALSE!$V4L_PROVIDER_FALSE$ac_delim TSLIB_CFLAGS!$TSLIB_CFLAGS$ac_delim TSLIB_LIBS!$TSLIB_LIBS$ac_delim SOFTWARE_RENDERING_TRUE!$SOFTWARE_RENDERING_TRUE$ac_delim SOFTWARE_RENDERING_FALSE!$SOFTWARE_RENDERING_FALSE$ac_delim DFB_SMOOTH_SCALING!$DFB_SMOOTH_SCALING$ac_delim FUSION_MESSAGE_SIZE!$FUSION_MESSAGE_SIZE$ac_delim RUNTIME_SYSROOT!$RUNTIME_SYSROOT$ac_delim DIRECTFB_CSOURCE!$DIRECTFB_CSOURCE$ac_delim GFX_ATI128_TRUE!$GFX_ATI128_TRUE$ac_delim GFX_ATI128_FALSE!$GFX_ATI128_FALSE$ac_delim GFX_CLE266_TRUE!$GFX_CLE266_TRUE$ac_delim GFX_CLE266_FALSE!$GFX_CLE266_FALSE$ac_delim GFX_CYBER5K_TRUE!$GFX_CYBER5K_TRUE$ac_delim GFX_CYBER5K_FALSE!$GFX_CYBER5K_FALSE$ac_delim GFX_DAVINCI_TRUE!$GFX_DAVINCI_TRUE$ac_delim GFX_DAVINCI_FALSE!$GFX_DAVINCI_FALSE$ac_delim GFX_EP9X_TRUE!$GFX_EP9X_TRUE$ac_delim GFX_EP9X_FALSE!$GFX_EP9X_FALSE$ac_delim GFX_I810_TRUE!$GFX_I810_TRUE$ac_delim GFX_I810_FALSE!$GFX_I810_FALSE$ac_delim GFX_I830_TRUE!$GFX_I830_TRUE$ac_delim GFX_I830_FALSE!$GFX_I830_FALSE$ac_delim GFX_MACH64_TRUE!$GFX_MACH64_TRUE$ac_delim GFX_MACH64_FALSE!$GFX_MACH64_FALSE$ac_delim GFX_MATROX_TRUE!$GFX_MATROX_TRUE$ac_delim GFX_MATROX_FALSE!$GFX_MATROX_FALSE$ac_delim GFX_NEOMAGIC_TRUE!$GFX_NEOMAGIC_TRUE$ac_delim GFX_NEOMAGIC_FALSE!$GFX_NEOMAGIC_FALSE$ac_delim GFX_NSC_TRUE!$GFX_NSC_TRUE$ac_delim GFX_NSC_FALSE!$GFX_NSC_FALSE$ac_delim GFX_NVIDIA_TRUE!$GFX_NVIDIA_TRUE$ac_delim GFX_NVIDIA_FALSE!$GFX_NVIDIA_FALSE$ac_delim GFX_OMAP_TRUE!$GFX_OMAP_TRUE$ac_delim GFX_OMAP_FALSE!$GFX_OMAP_FALSE$ac_delim GFX_RADEON_TRUE!$GFX_RADEON_TRUE$ac_delim GFX_RADEON_FALSE!$GFX_RADEON_FALSE$ac_delim GFX_SAVAGE_TRUE!$GFX_SAVAGE_TRUE$ac_delim GFX_SAVAGE_FALSE!$GFX_SAVAGE_FALSE$ac_delim GFX_SH772X_TRUE!$GFX_SH772X_TRUE$ac_delim GFX_SH772X_FALSE!$GFX_SH772X_FALSE$ac_delim GFX_SIS315_TRUE!$GFX_SIS315_TRUE$ac_delim GFX_SIS315_FALSE!$GFX_SIS315_FALSE$ac_delim GFX_TDFX_TRUE!$GFX_TDFX_TRUE$ac_delim GFX_TDFX_FALSE!$GFX_TDFX_FALSE$ac_delim GFX_UNICHROME_TRUE!$GFX_UNICHROME_TRUE$ac_delim GFX_UNICHROME_FALSE!$GFX_UNICHROME_FALSE$ac_delim GFX_VMWARE_TRUE!$GFX_VMWARE_TRUE$ac_delim GFX_VMWARE_FALSE!$GFX_VMWARE_FALSE$ac_delim DBOX2REMOTE_TRUE!$DBOX2REMOTE_TRUE$ac_delim DBOX2REMOTE_FALSE!$DBOX2REMOTE_FALSE$ac_delim DREAMBOXREMOTE_TRUE!$DREAMBOXREMOTE_TRUE$ac_delim DREAMBOXREMOTE_FALSE!$DREAMBOXREMOTE_FALSE$ac_delim DYNAPRO_INPUT_TRUE!$DYNAPRO_INPUT_TRUE$ac_delim DYNAPRO_INPUT_FALSE!$DYNAPRO_INPUT_FALSE$ac_delim ELO_INPUT_TRUE!$ELO_INPUT_TRUE$ac_delim ELO_INPUT_FALSE!$ELO_INPUT_FALSE$ac_delim GUNZE_INPUT_TRUE!$GUNZE_INPUT_TRUE$ac_delim GUNZE_INPUT_FALSE!$GUNZE_INPUT_FALSE$ac_delim H3600_TS_TRUE!$H3600_TS_TRUE$ac_delim H3600_TS_FALSE!$H3600_TS_FALSE$ac_delim JOYSTICK_INPUT_TRUE!$JOYSTICK_INPUT_TRUE$ac_delim JOYSTICK_INPUT_FALSE!$JOYSTICK_INPUT_FALSE$ac_delim KEYBOARD_INPUT_TRUE!$KEYBOARD_INPUT_TRUE$ac_delim KEYBOARD_INPUT_FALSE!$KEYBOARD_INPUT_FALSE$ac_delim LINUX_INPUT_TRUE!$LINUX_INPUT_TRUE$ac_delim LINUX_INPUT_FALSE!$LINUX_INPUT_FALSE$ac_delim LIRC_INPUT_TRUE!$LIRC_INPUT_TRUE$ac_delim LIRC_INPUT_FALSE!$LIRC_INPUT_FALSE$ac_delim MUTOUCH_TS_TRUE!$MUTOUCH_TS_TRUE$ac_delim MUTOUCH_TS_FALSE!$MUTOUCH_TS_FALSE$ac_delim PENMOUNT_TS_TRUE!$PENMOUNT_TS_TRUE$ac_delim PENMOUNT_TS_FALSE!$PENMOUNT_TS_FALSE$ac_delim PS2MOUSE_INPUT_TRUE!$PS2MOUSE_INPUT_TRUE$ac_delim PS2MOUSE_INPUT_FALSE!$PS2MOUSE_INPUT_FALSE$ac_delim SERIAL_MOUSE_INPUT_TRUE!$SERIAL_MOUSE_INPUT_TRUE$ac_delim SERIAL_MOUSE_INPUT_FALSE!$SERIAL_MOUSE_INPUT_FALSE$ac_delim SONYPI_TRUE!$SONYPI_TRUE$ac_delim SONYPI_FALSE!$SONYPI_FALSE$ac_delim TSLIB_TRUE!$TSLIB_TRUE$ac_delim TSLIB_FALSE!$TSLIB_FALSE$ac_delim UCB1X00_TS_TRUE!$UCB1X00_TS_TRUE$ac_delim UCB1X00_TS_FALSE!$UCB1X00_TS_FALSE$ac_delim WM97XX_TS_TRUE!$WM97XX_TS_TRUE$ac_delim WM97XX_TS_FALSE!$WM97XX_TS_FALSE$ac_delim BUILD_TESTS_TRUE!$BUILD_TESTS_TRUE$ac_delim BUILD_TESTS_FALSE!$BUILD_TESTS_FALSE$ac_delim BUILD_TOOLS_TRUE!$BUILD_TOOLS_TRUE$ac_delim BUILD_TOOLS_FALSE!$BUILD_TOOLS_FALSE$ac_delim CROSS_COMPILING_TRUE!$CROSS_COMPILING_TRUE$ac_delim CROSS_COMPILING_FALSE!$CROSS_COMPILING_FALSE$ac_delim BUILD_SHARED_TRUE!$BUILD_SHARED_TRUE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF BUILD_SHARED_FALSE!$BUILD_SHARED_FALSE$ac_delim BUILD_STATIC_TRUE!$BUILD_STATIC_TRUE$ac_delim BUILD_STATIC_FALSE!$BUILD_STATIC_FALSE$ac_delim SOPATH!$SOPATH$ac_delim HAVE_LINUX!$HAVE_LINUX$ac_delim DFB_CFLAGS_OMIT_FRAME_POINTER!$DFB_CFLAGS_OMIT_FRAME_POINTER$ac_delim DFB_LDFLAGS!$DFB_LDFLAGS$ac_delim DFB_INTERNAL_CFLAGS!$DFB_INTERNAL_CFLAGS$ac_delim X11_CFLAGS!$X11_CFLAGS$ac_delim X11_LIBS!$X11_LIBS$ac_delim GIF_PROVIDER!$GIF_PROVIDER$ac_delim JPEG_PROVIDER!$JPEG_PROVIDER$ac_delim PNG_PROVIDER!$PNG_PROVIDER$ac_delim LIBJPEG!$LIBJPEG$ac_delim LIBPNG!$LIBPNG$ac_delim FREETYPE_PROVIDER!$FREETYPE_PROVIDER$ac_delim DATADIR!$DATADIR$ac_delim MODULEDIR!$MODULEDIR$ac_delim MODULEDIRNAME!$MODULEDIRNAME$ac_delim INCLUDEDIR!$INCLUDEDIR$ac_delim INTERNALINCLUDEDIR!$INTERNALINCLUDEDIR$ac_delim SYSCONFDIR!$SYSCONFDIR$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-4.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed -f "$tmp/subs-4.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "default":C) chmod +x directfb-config ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi { echo "$as_me:$LINENO: result: Build options: Version $VERSION Linux powered $have_linux Install prefix $prefix Config files in $SYSCONFDIR Build shared libs $enable_shared Build static libs $enable_static Module directory $MODULEDIR CPPFLAGS $CPPFLAGS CFLAGS $CFLAGS LDFLAGS $LDFLAGS LIBS $LIBS DYNLIB $DYNLIB THREADFLAGS $THREADFLAGS THREADLIBS $THREADLIBS Misc options: Multi Application Core $enable_multi Fusion Kernel Device $linux_fusion Fusion message size $with_message_size Voodoo (network support) $enable_voodoo Debug supported $enable_debug_support Debug enabled $enable_debug Trace support $enable_trace MMX support $enable_mmx SSE support $enable_sse Network support $enable_network Include all strings $enable_text Software Rendering $with_software Smooth SW Scaling $with_smooth_scaling zlib compression $use_zlib $ZLIB_LIBS sysfs support $use_sysfs $SYSFS_LIBS Building Tests $with_tests Building Tools $with_tools Building System Modules: Linux FBDev support $enable_fbdev Generic /dev/mem support $enable_devmem X11 support $enable_x11 $X11_CFLAGS $X11_LIBS OSX support $enable_osx $OSX_CFLAGS $OSX_LIBS SDL support $enable_sdl $SDL_CFLAGS $SDL_LIBS VNC support $enable_vnc $VNC_CFLAGS $VNC_LIBS Building Window Manager Modules: Default yes UniQuE $enable_unique Building Image Provider Modules: GIF $enable_gif JPEG $JPEG $LIBJPEG PNG $PNG $LIBPNG Building Video Provider Modules: GIF $enable_gif Video4Linux $V4L (v2: $V4L2) Building Font Modules: FreeType2 $FREETYPE $FREETYPE_CFLAGS $FREETYPE_LIBS Default font yes" >&5 echo "${ECHO_T} Build options: Version $VERSION Linux powered $have_linux Install prefix $prefix Config files in $SYSCONFDIR Build shared libs $enable_shared Build static libs $enable_static Module directory $MODULEDIR CPPFLAGS $CPPFLAGS CFLAGS $CFLAGS LDFLAGS $LDFLAGS LIBS $LIBS DYNLIB $DYNLIB THREADFLAGS $THREADFLAGS THREADLIBS $THREADLIBS Misc options: Multi Application Core $enable_multi Fusion Kernel Device $linux_fusion Fusion message size $with_message_size Voodoo (network support) $enable_voodoo Debug supported $enable_debug_support Debug enabled $enable_debug Trace support $enable_trace MMX support $enable_mmx SSE support $enable_sse Network support $enable_network Include all strings $enable_text Software Rendering $with_software Smooth SW Scaling $with_smooth_scaling zlib compression $use_zlib $ZLIB_LIBS sysfs support $use_sysfs $SYSFS_LIBS Building Tests $with_tests Building Tools $with_tools Building System Modules: Linux FBDev support $enable_fbdev Generic /dev/mem support $enable_devmem X11 support $enable_x11 $X11_CFLAGS $X11_LIBS OSX support $enable_osx $OSX_CFLAGS $OSX_LIBS SDL support $enable_sdl $SDL_CFLAGS $SDL_LIBS VNC support $enable_vnc $VNC_CFLAGS $VNC_LIBS Building Window Manager Modules: Default yes UniQuE $enable_unique Building Image Provider Modules: GIF $enable_gif JPEG $JPEG $LIBJPEG PNG $PNG $LIBPNG Building Video Provider Modules: GIF $enable_gif Video4Linux $V4L (v2: $V4L2) Building Font Modules: FreeType2 $FREETYPE $FREETYPE_CFLAGS $FREETYPE_LIBS Default font yes" >&6; }; if test "$have_linux" = "yes"; then { echo "$as_me:$LINENO: result: Building Graphics Drivers: 3Dfx Voodoo $tdfx ATI Mach64 $mach64 ATI Rage 128 $ati128 ATI Radeon $radeon Cirrus EP9X $ep9x Intel i810 $i810 Intel i830 $i830 Matrox $matrox NeoMagic $neomagic NSC Geode $nsc nVidia $nvidia Renesas SH7722/SH7723 $sh772x S3 Savage $savage SiS 315 $sis315 TI Davinci $davinci TI OMAP $omap TVIA CyberPro $cyber5k VIA CLE266 $cle266 VIA UniChrome $unichrome VMWare $vmware Building Input Drivers: DBox2 Remote $enable_dbox2remote DreamBox Remote $enable_dreamboxremote Dynapro Touchscreen $enable_dynapro_ts ELO Touchscreen $enable_elo_input Gunze Touchscreen $enable_gunze_input H3600 Touchscreen $enable_h3600_ts Joystick $enable_joystick Keyboard $enable_keyboard Linux Input $enable_linux_input LiRC $enable_lirc MuTouch touchscreen $enable_mutouch PS/2 Mouse $enable_ps2mouse Serial Mouse $enable_serial_mouse SonyPI Jogdial $enable_sonypi_jogdial tslib $enable_tslib $TSLIB_CFLAGS $TSLIB_LIBS ucb1x00 Touchscreen $enable_ucb1x00_ts WM97xx Touchscreen $enable_wm97xx_ts" >&5 echo "${ECHO_T} Building Graphics Drivers: 3Dfx Voodoo $tdfx ATI Mach64 $mach64 ATI Rage 128 $ati128 ATI Radeon $radeon Cirrus EP9X $ep9x Intel i810 $i810 Intel i830 $i830 Matrox $matrox NeoMagic $neomagic NSC Geode $nsc nVidia $nvidia Renesas SH7722/SH7723 $sh772x S3 Savage $savage SiS 315 $sis315 TI Davinci $davinci TI OMAP $omap TVIA CyberPro $cyber5k VIA CLE266 $cle266 VIA UniChrome $unichrome VMWare $vmware Building Input Drivers: DBox2 Remote $enable_dbox2remote DreamBox Remote $enable_dreamboxremote Dynapro Touchscreen $enable_dynapro_ts ELO Touchscreen $enable_elo_input Gunze Touchscreen $enable_gunze_input H3600 Touchscreen $enable_h3600_ts Joystick $enable_joystick Keyboard $enable_keyboard Linux Input $enable_linux_input LiRC $enable_lirc MuTouch touchscreen $enable_mutouch PS/2 Mouse $enable_ps2mouse Serial Mouse $enable_serial_mouse SonyPI Jogdial $enable_sonypi_jogdial tslib $enable_tslib $TSLIB_CFLAGS $TSLIB_LIBS ucb1x00 Touchscreen $enable_ucb1x00_ts WM97xx Touchscreen $enable_wm97xx_ts" >&6; }; fi { echo "$as_me:$LINENO: result: $fusion_warning $png_warning $jpeg_warning $freetype_warning " >&5 echo "${ECHO_T}$fusion_warning $png_warning $jpeg_warning $freetype_warning " >&6; }; DirectFB-1.2.10/depcomp0000755000175000017500000004271310753066007011526 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: DirectFB-1.2.10/AUTHORS0000644000175000017500000000240211164361026011204 00000000000000Main Developers --------------- Denis Oliver Kropp Andreas Hundt Sven Neumann Ville Syrjl Claudio Ciccani Helping Developers ------------------ Andreas Robinson (CLE266 gfx driver) Daniel Foesch (nVidia gfx driver) Michel Dnzer (Radeon gfx driver) Vadim Catana (Radeon overlay support) Sarma Kolluru (NSC Geode gfx driver) Oliver Schwartz (nVidia gfx driver) Alex Song (Savage gfx driver) Simon Ueng (MuTouch Touchscreen driver) Holger Wchtler (Linux Input driver) David Wood (Voodoo gfx driver) Liam Girdwood (WM97xx Touchscreen driver) Brandon M. Reynolds (ELO Touchscreen driver) Andreas Oberritter (SiS 315 gfx driver) Nathanael D. Noblet (Gunze Touchscreen driver) See also "Thanks To" section in README. DirectFB-1.2.10/src/0000777000175000017500000000000011307522565011017 500000000000000DirectFB-1.2.10/src/display/0000777000175000017500000000000011307522565012464 500000000000000DirectFB-1.2.10/src/display/idirectfbscreen.c0000644000175000017500000005276411245562152015712 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbscreen.h" /* * private data struct of IDirectFBScreen */ typedef struct { int ref; /* reference counter */ CoreScreen *screen; DFBScreenID id; DFBScreenDescription description; } IDirectFBScreen_data; /******************************************************************************/ static DFBResult PatchMixerConfig ( DFBScreenMixerConfig *patched, const DFBScreenMixerConfig *patch ); static DFBResult PatchEncoderConfig( DFBScreenEncoderConfig *patched, const DFBScreenEncoderConfig *patch ); static DFBResult PatchOutputConfig ( DFBScreenOutputConfig *patched, const DFBScreenOutputConfig *patch ); /******************************************************************************/ typedef struct { CoreScreen *screen; DFBDisplayLayerCallback callback; void *callback_ctx; } EnumDisplayLayers_Context; static DFBEnumerationResult EnumDisplayLayers_Callback( CoreLayer *layer, void *ctx ); /******************************************************************************/ static void IDirectFBScreen_Destruct( IDirectFBScreen *thiz ) { // IDirectFBScreen_data *data = (IDirectFBScreen_data*)thiz->priv; DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBScreen_AddRef( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) data->ref++; return DFB_OK; } static DirectResult IDirectFBScreen_Release( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (--data->ref == 0) IDirectFBScreen_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBScreen_GetID( IDirectFBScreen *thiz, DFBScreenID *id ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!id) return DFB_INVARG; *id = data->id; return DFB_OK; } static DFBResult IDirectFBScreen_GetDescription( IDirectFBScreen *thiz, DFBScreenDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!desc) return DFB_INVARG; *desc = data->description; return DFB_OK; } static DFBResult IDirectFBScreen_GetSize( IDirectFBScreen *thiz, int *ret_width, int *ret_height ) { DFBResult ret; int width = 0; int height = 0; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!ret_width && !ret_height) return DFB_INVARG; ret = dfb_screen_get_screen_size( data->screen, &width, &height ); if (ret_width) *ret_width = width; if (ret_height) *ret_height = height; return ret; } static DFBResult IDirectFBScreen_EnumDisplayLayers( IDirectFBScreen *thiz, DFBDisplayLayerCallback callbackfunc, void *callbackdata ) { EnumDisplayLayers_Context context; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!callbackfunc) return DFB_INVARG; context.screen = data->screen; context.callback = callbackfunc; context.callback_ctx = callbackdata; dfb_layers_enumerate( EnumDisplayLayers_Callback, &context ); return DFB_OK; } static DFBResult IDirectFBScreen_SetPowerMode( IDirectFBScreen *thiz, DFBScreenPowerMode mode ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) switch (mode) { case DSPM_ON: case DSPM_STANDBY: case DSPM_SUSPEND: case DSPM_OFF: break; default: return DFB_INVARG; } return dfb_screen_set_powermode( data->screen, mode ); } static DFBResult IDirectFBScreen_WaitForSync( IDirectFBScreen *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) return dfb_screen_wait_vsync( data->screen ); } static DFBResult IDirectFBScreen_GetMixerDescriptions( IDirectFBScreen *thiz, DFBScreenMixerDescription *descriptions ) { int i; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!descriptions) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_MIXERS)) return DFB_UNSUPPORTED; for (i=0; idescription.mixers; i++) dfb_screen_get_mixer_info( data->screen, i, &descriptions[i] ); return DFB_OK; } static DFBResult IDirectFBScreen_GetMixerConfiguration( IDirectFBScreen *thiz, int mixer, DFBScreenMixerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_MIXERS)) return DFB_UNSUPPORTED; if (mixer < 0 || mixer >= data->description.mixers) return DFB_INVARG; return dfb_screen_get_mixer_config( data->screen, mixer, config ); } static DFBResult IDirectFBScreen_TestMixerConfiguration( IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config, DFBScreenMixerConfigFlags *failed ) { DFBResult ret; DFBScreenMixerConfig patched; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config || (config->flags & ~DSMCONF_ALL)) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_MIXERS)) return DFB_UNSUPPORTED; if (mixer < 0 || mixer >= data->description.mixers) return DFB_INVARG; /* Get the current configuration. */ ret = dfb_screen_get_mixer_config( data->screen, mixer, &patched ); if (ret) return ret; /* Patch the configuration. */ ret = PatchMixerConfig( &patched, config ); if (ret) return ret; /* Test the patched configuration. */ return dfb_screen_test_mixer_config( data->screen, mixer, &patched, failed ); } static DFBResult IDirectFBScreen_SetMixerConfiguration( IDirectFBScreen *thiz, int mixer, const DFBScreenMixerConfig *config ) { DFBResult ret; DFBScreenMixerConfig patched; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config || (config->flags & ~DSMCONF_ALL)) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_MIXERS)) return DFB_UNSUPPORTED; if (mixer < 0 || mixer >= data->description.mixers) return DFB_INVARG; /* Get the current configuration. */ ret = dfb_screen_get_mixer_config( data->screen, mixer, &patched ); if (ret) return ret; /* Patch the configuration. */ ret = PatchMixerConfig( &patched, config ); if (ret) return ret; /* Set the patched configuration. */ return dfb_screen_set_mixer_config( data->screen, mixer, &patched ); } static DFBResult IDirectFBScreen_GetEncoderDescriptions( IDirectFBScreen *thiz, DFBScreenEncoderDescription *descriptions ) { int i; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!descriptions) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_ENCODERS)) return DFB_UNSUPPORTED; for (i=0; idescription.encoders; i++) dfb_screen_get_encoder_info( data->screen, i, &descriptions[i] ); return DFB_OK; } static DFBResult IDirectFBScreen_GetEncoderConfiguration( IDirectFBScreen *thiz, int encoder, DFBScreenEncoderConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_ENCODERS)) return DFB_UNSUPPORTED; if (encoder < 0 || encoder >= data->description.encoders) return DFB_INVARG; return dfb_screen_get_encoder_config( data->screen, encoder, config ); } static DFBResult IDirectFBScreen_TestEncoderConfiguration( IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config, DFBScreenEncoderConfigFlags *failed ) { DFBResult ret; DFBScreenEncoderConfig patched; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config || (config->flags & ~DSECONF_ALL)) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_ENCODERS)) return DFB_UNSUPPORTED; if (encoder < 0 || encoder >= data->description.encoders) return DFB_INVARG; /* Get the current configuration. */ ret = dfb_screen_get_encoder_config( data->screen, encoder, &patched ); if (ret) return ret; /* Patch the configuration. */ ret = PatchEncoderConfig( &patched, config ); if (ret) return ret; /* Test the patched configuration. */ return dfb_screen_test_encoder_config( data->screen, encoder, &patched, failed ); } static DFBResult IDirectFBScreen_SetEncoderConfiguration( IDirectFBScreen *thiz, int encoder, const DFBScreenEncoderConfig *config ) { DFBResult ret; DFBScreenEncoderConfig patched; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config || (config->flags & ~DSECONF_ALL)) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_ENCODERS)) return DFB_UNSUPPORTED; if (encoder < 0 || encoder >= data->description.encoders) return DFB_INVARG; /* Get the current configuration. */ ret = dfb_screen_get_encoder_config( data->screen, encoder, &patched ); if (ret) return ret; /* Patch the configuration. */ ret = PatchEncoderConfig( &patched, config ); if (ret) return ret; /* Set the patched configuration. */ return dfb_screen_set_encoder_config( data->screen, encoder, &patched ); } static DFBResult IDirectFBScreen_GetOutputDescriptions( IDirectFBScreen *thiz, DFBScreenOutputDescription *descriptions ) { int i; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!descriptions) return DFB_INVARG; if (!data->description.caps & DSCCAPS_OUTPUTS) return DFB_UNSUPPORTED; for (i=0; idescription.outputs; i++) dfb_screen_get_output_info( data->screen, i, &descriptions[i] ); return DFB_OK; } static DFBResult IDirectFBScreen_GetOutputConfiguration( IDirectFBScreen *thiz, int output, DFBScreenOutputConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_OUTPUTS)) return DFB_UNSUPPORTED; if (output < 0 || output >= data->description.outputs) return DFB_INVARG; return dfb_screen_get_output_config( data->screen, output, config ); } static DFBResult IDirectFBScreen_TestOutputConfiguration( IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config, DFBScreenOutputConfigFlags *failed ) { DFBResult ret; DFBScreenOutputConfig patched; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config || (config->flags & ~DSOCONF_ALL)) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_OUTPUTS)) return DFB_UNSUPPORTED; if (output < 0 || output >= data->description.outputs) return DFB_INVARG; /* Get the current configuration. */ ret = dfb_screen_get_output_config( data->screen, output, &patched ); if (ret) return ret; /* Patch the configuration. */ ret = PatchOutputConfig( &patched, config ); if (ret) return ret; /* Test the patched configuration. */ return dfb_screen_test_output_config( data->screen, output, &patched, failed ); } static DFBResult IDirectFBScreen_SetOutputConfiguration( IDirectFBScreen *thiz, int output, const DFBScreenOutputConfig *config ) { DFBResult ret; DFBScreenOutputConfig patched; DIRECT_INTERFACE_GET_DATA(IDirectFBScreen) if (!config || (config->flags & ~DSOCONF_ALL)) return DFB_INVARG; if (! (data->description.caps & DSCCAPS_OUTPUTS)) return DFB_UNSUPPORTED; if (output < 0 || output >= data->description.outputs) return DFB_INVARG; /* Get the current configuration. */ ret = dfb_screen_get_output_config( data->screen, output, &patched ); if (ret) return ret; /* Patch the configuration. */ ret = PatchOutputConfig( &patched, config ); if (ret) return ret; /* Set the patched configuration. */ return dfb_screen_set_output_config( data->screen, output, &patched ); } /******************************************************************************/ DFBResult IDirectFBScreen_Construct( IDirectFBScreen *thiz, CoreScreen *screen ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBScreen) data->ref = 1; data->screen = screen; dfb_screen_get_info( screen, NULL, &data->description ); data->id = dfb_screen_id_translated( data->screen ); thiz->AddRef = IDirectFBScreen_AddRef; thiz->Release = IDirectFBScreen_Release; thiz->GetID = IDirectFBScreen_GetID; thiz->GetDescription = IDirectFBScreen_GetDescription; thiz->GetSize = IDirectFBScreen_GetSize; thiz->EnumDisplayLayers = IDirectFBScreen_EnumDisplayLayers; thiz->SetPowerMode = IDirectFBScreen_SetPowerMode; thiz->WaitForSync = IDirectFBScreen_WaitForSync; thiz->GetMixerDescriptions = IDirectFBScreen_GetMixerDescriptions; thiz->GetMixerConfiguration = IDirectFBScreen_GetMixerConfiguration; thiz->TestMixerConfiguration = IDirectFBScreen_TestMixerConfiguration; thiz->SetMixerConfiguration = IDirectFBScreen_SetMixerConfiguration; thiz->GetEncoderDescriptions = IDirectFBScreen_GetEncoderDescriptions; thiz->GetEncoderConfiguration = IDirectFBScreen_GetEncoderConfiguration; thiz->TestEncoderConfiguration = IDirectFBScreen_TestEncoderConfiguration; thiz->SetEncoderConfiguration = IDirectFBScreen_SetEncoderConfiguration; thiz->GetOutputDescriptions = IDirectFBScreen_GetOutputDescriptions; thiz->GetOutputConfiguration = IDirectFBScreen_GetOutputConfiguration; thiz->TestOutputConfiguration = IDirectFBScreen_TestOutputConfiguration; thiz->SetOutputConfiguration = IDirectFBScreen_SetOutputConfiguration; return DFB_OK; } /******************************************************************************/ static DFBResult PatchMixerConfig( DFBScreenMixerConfig *patched, const DFBScreenMixerConfig *patch ) { /* Check for unsupported flags. */ if (patch->flags & ~patched->flags) return DFB_UNSUPPORTED; if (patch->flags & DSMCONF_TREE) patched->tree = patch->tree; if (patch->flags & DSMCONF_LEVEL) patched->level = patch->level; if (patch->flags & DSMCONF_LAYERS) patched->layers = patch->layers; if (patch->flags & DSMCONF_BACKGROUND) patched->background = patch->background; return DFB_OK; } static DFBResult PatchEncoderConfig( DFBScreenEncoderConfig *patched, const DFBScreenEncoderConfig *patch ) { /* Check for unsupported flags. */ if (patch->flags & ~patched->flags) return DFB_UNSUPPORTED; if (patch->flags & DSECONF_RESOLUTION) patched->resolution = patch->resolution; if (patch->flags & DSECONF_FREQUENCY) patched->frequency = patch->frequency; /** * Need to be backwards compatible with these so that * they specify resolution and frequency as well. * If you have set a TV_STANDARD * (and set the flag) it will override the resolution and * frequency chosen above.*/ if (patch->flags & DSECONF_TV_STANDARD) { patched->tv_standard = patch->tv_standard; switch (patched->tv_standard) { case DSETV_PAL: case DSETV_PAL_BG: case DSETV_PAL_I: case DSETV_PAL_N: case DSETV_PAL_NC: patched->resolution = DSOR_720_576; patched->frequency = DSEF_50HZ; break; case DSETV_PAL_60: case DSETV_PAL_M: patched->resolution = DSOR_720_480; patched->frequency = DSEF_60HZ; break; case DSETV_SECAM: patched->resolution = DSOR_720_576; patched->frequency = DSEF_50HZ; break; case DSETV_NTSC: case DSETV_NTSC_M_JPN: patched->resolution = DSOR_720_480; patched->frequency = DSEF_60HZ; break; default: break; } } if (patch->flags & DSECONF_TEST_PICTURE) patched->test_picture = patch->test_picture; if (patch->flags & DSECONF_MIXER) patched->mixer = patch->mixer; if (patch->flags & DSECONF_OUT_SIGNALS) patched->out_signals = patch->out_signals; if (patch->flags & DSECONF_SCANMODE) patched->scanmode = patch->scanmode; if (patch->flags & DSECONF_ADJUSTMENT) patched->adjustment = patch->adjustment; if (patch->flags & DSECONF_CONNECTORS) patched->out_connectors = patch->out_connectors; if (patch->flags & DSECONF_SLOW_BLANKING) patched->slow_blanking = patch->slow_blanking; return DFB_OK; } static DFBResult PatchOutputConfig( DFBScreenOutputConfig *patched, const DFBScreenOutputConfig *patch ) { /* Check for unsupported flags. */ if (patch->flags & ~patched->flags) return DFB_UNSUPPORTED; if (patch->flags & DSOCONF_RESOLUTION) patched->resolution = patch->resolution; if (patch->flags & DSOCONF_ENCODER) patched->encoder = patch->encoder; if (patch->flags & DSOCONF_SIGNALS) patched->out_signals = patch->out_signals; if (patch->flags & DSOCONF_CONNECTORS) patched->out_connectors = patch->out_connectors; if (patch->flags & DSOCONF_SLOW_BLANKING) patched->slow_blanking = patch->slow_blanking; return DFB_OK; } static DFBEnumerationResult EnumDisplayLayers_Callback( CoreLayer *layer, void *ctx ) { DFBDisplayLayerDescription desc; DFBDisplayLayerID id; EnumDisplayLayers_Context *context = (EnumDisplayLayers_Context*) ctx; if (dfb_layer_screen( layer ) != context->screen) return DFENUM_OK; id = dfb_layer_id_translated( layer ); if (dfb_config->primary_only && id != DLID_PRIMARY) return DFENUM_OK; dfb_layer_get_description( layer, &desc ); return context->callback( id, desc, context->callback_ctx ); } DirectFB-1.2.10/src/display/idirectfbsurface_window.h0000644000175000017500000000366711245562152017455 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECTFBSURFACE_WINDOW_H__ #define __DIRECTFBSURFACE_WINDOW_H__ #include #include /* * calls base classes IDirectFBSurface_Construct, * reallocates private data and overloads functions of the interface */ DFBResult IDirectFBSurface_Window_Construct( IDirectFBSurface *thiz, IDirectFBSurface *parent, DFBRectangle *req_rect, DFBRectangle *clip_rect, CoreWindow *window, DFBSurfaceCapabilities caps, CoreDFB *core ); #endif DirectFB-1.2.10/src/display/Makefile.am0000644000175000017500000000121211164361026014422 00000000000000## Makefile.am for DirectFB/src/display INCLUDES = \ -I$(top_builddir)/lib \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src internalincludedir = $(INTERNALINCLUDEDIR)/display internalinclude_HEADERS = \ idirectfbpalette.h \ idirectfbsurface.h \ idirectfbsurface_layer.h \ idirectfbsurface_window.h \ idirectfbdisplaylayer.h \ idirectfbscreen.h noinst_LTLIBRARIES = libdirectfb_display.la libdirectfb_display_la_SOURCES = \ idirectfbpalette.c \ idirectfbsurface.c \ idirectfbsurface_layer.c \ idirectfbsurface_window.c \ idirectfbdisplaylayer.c \ idirectfbscreen.c DirectFB-1.2.10/src/display/Makefile.in0000644000175000017500000004316411307521505014446 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/display DIST_COMMON = $(internalinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libdirectfb_display_la_LIBADD = am_libdirectfb_display_la_OBJECTS = idirectfbpalette.lo \ idirectfbsurface.lo idirectfbsurface_layer.lo \ idirectfbsurface_window.lo idirectfbdisplaylayer.lo \ idirectfbscreen.lo libdirectfb_display_la_OBJECTS = $(am_libdirectfb_display_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libdirectfb_display_la_SOURCES) DIST_SOURCES = $(libdirectfb_display_la_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(internalincludedir)" internalincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(internalinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/lib \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src internalincludedir = $(INTERNALINCLUDEDIR)/display internalinclude_HEADERS = \ idirectfbpalette.h \ idirectfbsurface.h \ idirectfbsurface_layer.h \ idirectfbsurface_window.h \ idirectfbdisplaylayer.h \ idirectfbscreen.h noinst_LTLIBRARIES = libdirectfb_display.la libdirectfb_display_la_SOURCES = \ idirectfbpalette.c \ idirectfbsurface.c \ idirectfbsurface_layer.c \ idirectfbsurface_window.c \ idirectfbdisplaylayer.c \ idirectfbscreen.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/display/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/display/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libdirectfb_display.la: $(libdirectfb_display_la_OBJECTS) $(libdirectfb_display_la_DEPENDENCIES) $(LINK) $(libdirectfb_display_la_OBJECTS) $(libdirectfb_display_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbdisplaylayer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbpalette.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbscreen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbsurface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbsurface_layer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbsurface_window.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-internalincludeHEADERS: $(internalinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(internalincludedir)" || $(MKDIR_P) "$(DESTDIR)$(internalincludedir)" @list='$(internalinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(internalincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(internalincludedir)/$$f'"; \ $(internalincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(internalincludedir)/$$f"; \ done uninstall-internalincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(internalinclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(internalincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(internalincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(internalincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-internalincludeHEADERS install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-internalincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-internalincludeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-internalincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/src/display/idirectfbscreen.h0000644000175000017500000000270311245562152015703 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBSCREEN_H__ #define __IDIRECTFBSCREEN_H__ #include #include /* * initializes interface struct and private data */ DFBResult IDirectFBScreen_Construct( IDirectFBScreen *thiz, CoreScreen *screen ); #endif DirectFB-1.2.10/src/display/idirectfbpalette.c0000644000175000017500000002322211245562152016054 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbpalette.h" static void IDirectFBPalette_Destruct( IDirectFBPalette *thiz ) { IDirectFBPalette_data *data = (IDirectFBPalette_data*)thiz->priv; if (data->palette) dfb_palette_unref( data->palette ); DIRECT_DEALLOCATE_INTERFACE( thiz ); } static DirectResult IDirectFBPalette_AddRef( IDirectFBPalette *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) data->ref++; return DFB_OK; } static DirectResult IDirectFBPalette_Release( IDirectFBPalette *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) if (--data->ref == 0) IDirectFBPalette_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBPalette_GetCapabilities( IDirectFBPalette *thiz, DFBPaletteCapabilities *caps ) { CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) palette = data->palette; if (!palette) return DFB_DESTROYED; if (!caps) return DFB_INVARG; /* FIXME: no caps yet */ *caps = DPCAPS_NONE; return DFB_OK; } static DFBResult IDirectFBPalette_GetSize( IDirectFBPalette *thiz, unsigned int *size ) { CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) palette = data->palette; if (!palette) return DFB_DESTROYED; if (!size) return DFB_INVARG; *size = palette->num_entries; return DFB_OK; } static DFBResult IDirectFBPalette_SetEntries( IDirectFBPalette *thiz, const DFBColor *entries, unsigned int num_entries, unsigned int offset ) { int i; CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) palette = data->palette; if (!palette) return DFB_DESTROYED; if (!entries || offset + num_entries > palette->num_entries) return DFB_INVARG; if (num_entries) { direct_memcpy( palette->entries + offset, entries, num_entries * sizeof(DFBColor)); for (i=offset; ientries_yuv[i].a = palette->entries[i].a; RGB_TO_YCBCR( palette->entries[i].r, palette->entries[i].g, palette->entries[i].b, palette->entries_yuv[i].y, palette->entries_yuv[i].u, palette->entries_yuv[i].v ); } dfb_palette_update( palette, offset, offset + num_entries - 1 ); } return DFB_OK; } static DFBResult IDirectFBPalette_GetEntries( IDirectFBPalette *thiz, DFBColor *entries, unsigned int num_entries, unsigned int offset ) { CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) palette = data->palette; if (!palette) return DFB_DESTROYED; if (!entries || offset + num_entries > palette->num_entries) return DFB_INVARG; direct_memcpy( entries, palette->entries + offset, num_entries * sizeof(DFBColor)); return DFB_OK; } static DFBResult IDirectFBPalette_FindBestMatch( IDirectFBPalette *thiz, u8 r, u8 g, u8 b, u8 a, unsigned int *index ) { CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) if (!index) return DFB_INVARG; palette = data->palette; if (!palette) return DFB_DESTROYED; *index = dfb_palette_search( palette, r, g, b, a ); return DFB_OK; } static DFBResult IDirectFBPalette_CreateCopy( IDirectFBPalette *thiz, IDirectFBPalette **interface ) { DFBResult ret; IDirectFBPalette *iface; CorePalette *palette = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) if (!data->palette) return DFB_DESTROYED; if (!interface) return DFB_INVARG; ret = dfb_palette_create( NULL, /* FIXME */ data->palette->num_entries, &palette ); if (ret) return ret; direct_memcpy( palette->entries, data->palette->entries, palette->num_entries * sizeof(DFBColor)); dfb_palette_update( palette, 0, palette->num_entries - 1 ); DIRECT_ALLOCATE_INTERFACE( iface, IDirectFBPalette ); ret = IDirectFBPalette_Construct( iface, palette ); dfb_palette_unref( palette ); if (!ret) *interface = iface; return ret; } static DFBResult IDirectFBPalette_SetEntriesYUV( IDirectFBPalette *thiz, const DFBColorYUV *entries, unsigned int num_entries, unsigned int offset ) { int i; CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) palette = data->palette; if (!palette) return DFB_DESTROYED; if (!entries || offset + num_entries > palette->num_entries) return DFB_INVARG; if (num_entries) { direct_memcpy( palette->entries_yuv + offset, entries, num_entries * sizeof(DFBColorYUV)); for (i=offset; ientries[i].a = palette->entries_yuv[i].a; YCBCR_TO_RGB( palette->entries_yuv[i].y, palette->entries_yuv[i].u, palette->entries_yuv[i].v, palette->entries[i].r, palette->entries[i].g, palette->entries[i].b ); } dfb_palette_update( palette, offset, offset + num_entries - 1 ); } return DFB_OK; } static DFBResult IDirectFBPalette_GetEntriesYUV( IDirectFBPalette *thiz, DFBColorYUV *ret_entries, unsigned int num_entries, unsigned int offset ) { CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) palette = data->palette; if (!palette) return DFB_DESTROYED; if (!ret_entries || offset + num_entries > palette->num_entries) return DFB_INVARG; direct_memcpy( ret_entries, palette->entries_yuv + offset, num_entries * sizeof(DFBColorYUV)); return DFB_OK; } static DFBResult IDirectFBPalette_FindBestMatchYUV( IDirectFBPalette *thiz, u8 y, u8 u, u8 v, u8 a, unsigned int *ret_index ) { int r, g, b; CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBPalette) if (!ret_index) return DFB_INVARG; palette = data->palette; if (!palette) return DFB_DESTROYED; YCBCR_TO_RGB( y, u, v, r, g, b ); *ret_index = dfb_palette_search( palette, r, g, b, a ); return DFB_OK; } /******/ DFBResult IDirectFBPalette_Construct( IDirectFBPalette *thiz, CorePalette *palette ) { DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBPalette) if (dfb_palette_ref( palette )) { DIRECT_DEALLOCATE_INTERFACE(thiz); return DFB_FAILURE; } data->ref = 1; data->palette = palette; thiz->AddRef = IDirectFBPalette_AddRef; thiz->Release = IDirectFBPalette_Release; thiz->GetCapabilities = IDirectFBPalette_GetCapabilities; thiz->GetSize = IDirectFBPalette_GetSize; thiz->SetEntries = IDirectFBPalette_SetEntries; thiz->GetEntries = IDirectFBPalette_GetEntries; thiz->FindBestMatch = IDirectFBPalette_FindBestMatch; thiz->CreateCopy = IDirectFBPalette_CreateCopy; thiz->SetEntriesYUV = IDirectFBPalette_SetEntriesYUV; thiz->GetEntriesYUV = IDirectFBPalette_GetEntriesYUV; thiz->FindBestMatchYUV = IDirectFBPalette_FindBestMatchYUV; return DFB_OK; } DirectFB-1.2.10/src/display/idirectfbsurface_layer.c0000644000175000017500000001660411245562152017250 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "idirectfbsurface.h" #include "idirectfbsurface_layer.h" #include #include #include #include D_DEBUG_DOMAIN( Surface, "IDirectFBSurfaceL", "IDirectFBSurface_Layer Interface" ); /**********************************************************************************************************************/ static void IDirectFBSurface_Layer_Destruct( IDirectFBSurface *thiz ) { IDirectFBSurface_Layer_data *data = (IDirectFBSurface_Layer_data*) thiz->priv; D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); dfb_layer_region_unref( data->region ); IDirectFBSurface_Destruct( thiz ); } static DirectResult IDirectFBSurface_Layer_Release( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Layer) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (--data->base.ref == 0) IDirectFBSurface_Layer_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBSurface_Layer_Flip( IDirectFBSurface *thiz, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { DFBRegion reg; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Layer) D_DEBUG_AT( Surface, "%s( %p, %p, 0x%08x )\n", __FUNCTION__, thiz, region, flags ); if (!data->base.surface) return DFB_DESTROYED; if (data->base.locked) return DFB_LOCKED; if (!data->base.area.current.w || !data->base.area.current.h || (region && (region->x1 > region->x2 || region->y1 > region->y2))) return DFB_INVAREA; IDirectFBSurface_StopAll( &data->base ); if (data->base.parent) { IDirectFBSurface_data *parent_data; DIRECT_INTERFACE_GET_DATA_FROM( data->base.parent, parent_data, IDirectFBSurface ); /* Signal end of sequence of operations. */ dfb_state_lock( &parent_data->state ); dfb_state_stop_drawing( &parent_data->state ); dfb_state_unlock( &parent_data->state ); } dfb_region_from_rectangle( ®, &data->base.area.current ); if (region) { DFBRegion clip = DFB_REGION_INIT_TRANSLATED( region, data->base.area.wanted.x, data->base.area.wanted.y ); if (!dfb_region_region_intersect( ®, &clip )) return DFB_INVAREA; } D_DEBUG_AT( Surface, " -> FLIP %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION( ® ) ); return dfb_layer_region_flip_update( data->region, ®, flags ); } static DFBResult IDirectFBSurface_Layer_GetSubSurface( IDirectFBSurface *thiz, const DFBRectangle *rect, IDirectFBSurface **surface ) { DFBResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Layer) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); /* Check arguments */ if (!data->base.surface) return DFB_DESTROYED; if (!surface) return DFB_INVARG; /* Allocate interface */ DIRECT_ALLOCATE_INTERFACE( *surface, IDirectFBSurface ); if (rect || data->base.limit_set) { DFBRectangle wanted, granted; /* Compute wanted rectangle */ if (rect) { wanted = *rect; wanted.x += data->base.area.wanted.x; wanted.y += data->base.area.wanted.y; if (wanted.w <= 0 || wanted.h <= 0) { wanted.w = 0; wanted.h = 0; } } else { wanted = data->base.area.wanted; } /* Compute granted rectangle */ granted = wanted; dfb_rectangle_intersect( &granted, &data->base.area.granted ); /* Construct */ ret = IDirectFBSurface_Layer_Construct( *surface, thiz, &wanted, &granted, data->region, data->base.caps | DSCAPS_SUBSURFACE, data->base.core ); } else { /* Construct */ ret = IDirectFBSurface_Layer_Construct( *surface, thiz, NULL, NULL, data->region, data->base.caps | DSCAPS_SUBSURFACE, data->base.core ); } return ret; } DFBResult IDirectFBSurface_Layer_Construct( IDirectFBSurface *thiz, IDirectFBSurface *parent, DFBRectangle *wanted, DFBRectangle *granted, CoreLayerRegion *region, DFBSurfaceCapabilities caps, CoreDFB *core ) { DFBResult ret; CoreSurface *surface; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBSurface_Layer); D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (dfb_layer_region_ref( region )) return DFB_FUSION; ret = dfb_layer_region_get_surface( region, &surface ); if (ret) { dfb_layer_region_unref( region ); DIRECT_DEALLOCATE_INTERFACE(thiz); return ret; } ret = IDirectFBSurface_Construct( thiz, parent, wanted, granted, NULL, surface, surface->config.caps | caps, core ); if (ret) { dfb_surface_unref( surface ); dfb_layer_region_unref( region ); return ret; } dfb_surface_unref( surface ); data->region = region; thiz->Release = IDirectFBSurface_Layer_Release; thiz->Flip = IDirectFBSurface_Layer_Flip; thiz->GetSubSurface = IDirectFBSurface_Layer_GetSubSurface; return DFB_OK; } DirectFB-1.2.10/src/display/idirectfbdisplaylayer.h0000644000175000017500000000305611245562152017130 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBDISPLAYLAYER_H__ #define __IDIRECTFBDISPLAYLAYER_H__ #include #include /* * initializes interface struct and private data */ DFBResult IDirectFBDisplayLayer_Construct( IDirectFBDisplayLayer *thiz, CoreLayer *layer, CoreDFB *core ); #endif DirectFB-1.2.10/src/display/idirectfbsurface_layer.h0000644000175000017500000000433111245562152017247 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __DIRECTFBSURFACE_LAYER_H__ #define __DIRECTFBSURFACE_LAYER_H__ #include #include /* * private data struct of IDirectFBSurface_Layer */ typedef struct { IDirectFBSurface_data base; /* base Surface implementation */ CoreLayerRegion *region; /* the region this surface belongs to */ } IDirectFBSurface_Layer_data; /* * sets buffer mode according to capabilities, calls base classes * IDirectFBSurface_Construct, reallocates private data and * overloads functions of the interface */ DFBResult IDirectFBSurface_Layer_Construct( IDirectFBSurface *thiz, IDirectFBSurface *parent, DFBRectangle *req_rect, DFBRectangle *clip_rect, CoreLayerRegion *region, DFBSurfaceCapabilities caps, CoreDFB *core ); #endif DirectFB-1.2.10/src/display/idirectfbdisplaylayer.c0000644000175000017500000007405011245562152017125 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Layer, "IDirectFBDisplayLayer", "Display Layer Interface" ); /* * private data struct of IDirectFB */ typedef struct { int ref; /* reference counter */ DFBDisplayLayerDescription desc; /* description of the layer's caps */ DFBDisplayLayerCooperativeLevel level; /* current cooperative level */ CoreScreen *screen; /* layer's screen */ CoreLayer *layer; /* core layer data */ CoreLayerContext *context; /* shared or exclusive context */ CoreLayerRegion *region; /* primary region of the context */ CoreWindowStack *stack; /* stack of shared context */ DFBBoolean switch_exclusive; /* switch to exclusive context after creation? */ CoreDFB *core; } IDirectFBDisplayLayer_data; static void IDirectFBDisplayLayer_Destruct( IDirectFBDisplayLayer *thiz ) { IDirectFBDisplayLayer_data *data = (IDirectFBDisplayLayer_data*)thiz->priv; D_DEBUG_AT( Layer, "IDirectFBDisplayLayer_Destruct()\n" ); D_DEBUG_AT( Layer, " -> unref region...\n" ); dfb_layer_region_unref( data->region ); D_DEBUG_AT( Layer, " -> unref context...\n" ); dfb_layer_context_unref( data->context ); DIRECT_DEALLOCATE_INTERFACE( thiz ); D_DEBUG_AT( Layer, " -> done.\n" ); } static DirectResult IDirectFBDisplayLayer_AddRef( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) data->ref++; return DFB_OK; } static DirectResult IDirectFBDisplayLayer_Release( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (--data->ref == 0) IDirectFBDisplayLayer_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBDisplayLayer_GetID( IDirectFBDisplayLayer *thiz, DFBDisplayLayerID *id ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!id) return DFB_INVARG; *id = dfb_layer_id_translated( data->layer ); return DFB_OK; } static DFBResult IDirectFBDisplayLayer_GetDescription( IDirectFBDisplayLayer *thiz, DFBDisplayLayerDescription *desc ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!desc) return DFB_INVARG; *desc = data->desc; return DFB_OK; } static DFBResult IDirectFBDisplayLayer_GetSurface( IDirectFBDisplayLayer *thiz, IDirectFBSurface **interface ) { DFBResult ret; CoreLayerRegion *region; IDirectFBSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!interface) return DFB_INVARG; if (data->level == DLSCL_SHARED) { D_WARN( "letting unprivileged IDirectFBDisplayLayer::GetSurface() " "call pass until cooperative level handling is finished" ); } ret = dfb_layer_context_get_primary_region( data->context, true, ®ion ); if (ret) return ret; DIRECT_ALLOCATE_INTERFACE( surface, IDirectFBSurface ); ret = IDirectFBSurface_Layer_Construct( surface, NULL, NULL, NULL, region, DSCAPS_NONE, data->core ); if (region->config.buffermode == DLBM_FRONTONLY && data->level == DLSCL_EXCLUSIVE) { surface->Clear( surface, 0, 0, 0, 0 ); dfb_layer_region_flip_update( region, NULL, DSFLIP_NONE ); } *interface = ret ? NULL : surface; dfb_layer_region_unref( region ); return ret; } static DFBResult IDirectFBDisplayLayer_GetScreen( IDirectFBDisplayLayer *thiz, IDirectFBScreen **interface ) { DFBResult ret; IDirectFBScreen *screen; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!interface) return DFB_INVARG; DIRECT_ALLOCATE_INTERFACE( screen, IDirectFBScreen ); ret = IDirectFBScreen_Construct( screen, data->screen ); *interface = ret ? NULL : screen; return ret; } static DFBResult IDirectFBDisplayLayer_SetCooperativeLevel( IDirectFBDisplayLayer *thiz, DFBDisplayLayerCooperativeLevel level ) { DFBResult ret; CoreLayerContext *context; CoreLayerRegion *region; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == level) return DFB_OK; switch (level) { case DLSCL_SHARED: case DLSCL_ADMINISTRATIVE: if (data->level == DLSCL_EXCLUSIVE) { ret = dfb_layer_get_primary_context( data->layer, false, &context ); if (ret) return ret; ret = dfb_layer_context_get_primary_region( context, true, ®ion ); if (ret) { dfb_layer_context_unref( context ); return ret; } dfb_layer_region_unref( data->region ); dfb_layer_context_unref( data->context ); data->context = context; data->region = region; data->stack = dfb_layer_context_windowstack( data->context ); } break; case DLSCL_EXCLUSIVE: ret = dfb_layer_create_context( data->layer, &context ); if (ret) return ret; if (data->switch_exclusive) { ret = dfb_layer_activate_context( data->layer, context ); if (ret) { dfb_layer_context_unref( context ); return ret; } } ret = dfb_layer_context_get_primary_region( context, true, ®ion ); if (ret) { dfb_layer_context_unref( context ); return ret; } dfb_layer_region_unref( data->region ); dfb_layer_context_unref( data->context ); data->context = context; data->region = region; data->stack = dfb_layer_context_windowstack( data->context ); break; default: return DFB_INVARG; } data->level = level; return DFB_OK; } static DFBResult IDirectFBDisplayLayer_SetOpacity( IDirectFBDisplayLayer *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_opacity( data->context, opacity ); } static DFBResult IDirectFBDisplayLayer_GetCurrentOutputField( IDirectFBDisplayLayer *thiz, int *field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) return dfb_layer_get_current_output_field( data->layer, field ); } static DFBResult IDirectFBDisplayLayer_SetFieldParity( IDirectFBDisplayLayer *thiz, int field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level != DLSCL_EXCLUSIVE) return DFB_ACCESSDENIED; return dfb_layer_context_set_field_parity( data->context, field ); } static DFBResult IDirectFBDisplayLayer_SetClipRegions( IDirectFBDisplayLayer *thiz, const DFBRegion *regions, int num_regions, DFBBoolean positive ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!regions || num_regions < 1) return DFB_INVARG; if (num_regions > data->desc.clip_regions) return DFB_UNSUPPORTED; if (data->level != DLSCL_EXCLUSIVE) return DFB_ACCESSDENIED; return dfb_layer_context_set_clip_regions( data->context, regions, num_regions, positive ); } static DFBResult IDirectFBDisplayLayer_SetSourceRectangle( IDirectFBDisplayLayer *thiz, int x, int y, int width, int height ) { DFBRectangle source = { x, y, width, height }; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (x < 0 || y < 0 || width <= 0 || height <= 0) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_sourcerectangle( data->context, &source ); } static DFBResult IDirectFBDisplayLayer_SetScreenLocation( IDirectFBDisplayLayer *thiz, float x, float y, float width, float height ) { DFBLocation location = { x, y, width, height }; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (! D_FLAGS_IS_SET( data->desc.caps, DLCAPS_SCREEN_LOCATION )) return DFB_UNSUPPORTED; if (width <= 0 || height <= 0) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_screenlocation( data->context, &location ); } static DFBResult IDirectFBDisplayLayer_SetScreenPosition( IDirectFBDisplayLayer *thiz, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (! D_FLAGS_IS_SET( data->desc.caps, DLCAPS_SCREEN_POSITION )) return DFB_UNSUPPORTED; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_screenposition( data->context, x, y ); } static DFBResult IDirectFBDisplayLayer_SetScreenRectangle( IDirectFBDisplayLayer *thiz, int x, int y, int width, int height ) { DFBRectangle rect = { x, y, width, height }; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (! D_FLAGS_IS_SET( data->desc.caps, DLCAPS_SCREEN_LOCATION )) return DFB_UNSUPPORTED; if (width <= 0 || height <= 0) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_screenrectangle( data->context, &rect ); } static DFBResult IDirectFBDisplayLayer_SetSrcColorKey( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_src_colorkey( data->context, r, g, b, -1 ); } static DFBResult IDirectFBDisplayLayer_SetDstColorKey( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_dst_colorkey( data->context, r, g, b, -1 ); } static DFBResult IDirectFBDisplayLayer_GetLevel( IDirectFBDisplayLayer *thiz, int *level ) { DFBResult ret; int lvl; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!level) return DFB_INVARG; ret = dfb_layer_get_level( data->layer, &lvl ); if (ret) return ret; *level = lvl; return DFB_OK; } static DFBResult IDirectFBDisplayLayer_SetLevel( IDirectFBDisplayLayer *thiz, int level ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (! D_FLAGS_IS_SET( data->desc.caps, DLCAPS_LEVELS )) return DFB_UNSUPPORTED; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_set_level( data->layer, level ); } static DFBResult IDirectFBDisplayLayer_GetConfiguration( IDirectFBDisplayLayer *thiz, DFBDisplayLayerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!config) return DFB_INVARG; return dfb_layer_context_get_configuration( data->context, config ); } static DFBResult IDirectFBDisplayLayer_TestConfiguration( IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config, DFBDisplayLayerConfigFlags *failed ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!config) return DFB_INVARG; if (((config->flags & DLCONF_WIDTH) && (config->width < 0)) || ((config->flags & DLCONF_HEIGHT) && (config->height < 0))) return DFB_INVARG; return dfb_layer_context_test_configuration( data->context, config, failed ); } static DFBResult IDirectFBDisplayLayer_SetConfiguration( IDirectFBDisplayLayer *thiz, const DFBDisplayLayerConfig *config ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!config) return DFB_INVARG; if (((config->flags & DLCONF_WIDTH) && (config->width < 0)) || ((config->flags & DLCONF_HEIGHT) && (config->height < 0))) return DFB_INVARG; switch (data->level) { case DLSCL_EXCLUSIVE: case DLSCL_ADMINISTRATIVE: return dfb_layer_context_set_configuration( data->context, config ); default: break; } return DFB_ACCESSDENIED; } static DFBResult IDirectFBDisplayLayer_SetBackgroundMode( IDirectFBDisplayLayer *thiz, DFBDisplayLayerBackgroundMode background_mode ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; switch (background_mode) { case DLBM_DONTCARE: case DLBM_COLOR: case DLBM_IMAGE: case DLBM_TILE: break; default: return DFB_INVARG; } return dfb_windowstack_set_background_mode( data->stack, background_mode ); } static DFBResult IDirectFBDisplayLayer_SetBackgroundImage( IDirectFBDisplayLayer *thiz, IDirectFBSurface *surface ) { IDirectFBSurface_data *surface_data; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!surface) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; surface_data = (IDirectFBSurface_data*)surface->priv; if (!surface_data) return DFB_DEAD; if (!surface_data->surface) return DFB_DESTROYED; return dfb_windowstack_set_background_image( data->stack, surface_data->surface ); } static DFBResult IDirectFBDisplayLayer_SetBackgroundColor( IDirectFBDisplayLayer *thiz, u8 r, u8 g, u8 b, u8 a ) { DFBColor color = { a: a, r: r, g: g, b: b }; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_windowstack_set_background_color( data->stack, &color ); } static DFBResult IDirectFBDisplayLayer_CreateWindow( IDirectFBDisplayLayer *thiz, const DFBWindowDescription *desc, IDirectFBWindow **window ) { CoreWindow *w; DFBResult ret; DFBWindowDescription wd; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) memset( &wd, 0, sizeof(wd) ); wd.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY | DWDESC_PIXELFORMAT | DWDESC_SURFACE_CAPS | DWDESC_CAPS; wd.width = (desc->flags & DWDESC_WIDTH) ? desc->width : 480; wd.height = (desc->flags & DWDESC_HEIGHT) ? desc->height : 300; wd.posx = (desc->flags & DWDESC_POSX) ? desc->posx : 100; wd.posy = (desc->flags & DWDESC_POSY) ? desc->posy : 100; D_DEBUG_AT( Layer, "CreateWindow() <- %d,%d - %dx%d )\n", wd.posx, wd.posy, wd.width, wd.height ); if (desc->flags & DWDESC_CAPS) wd.caps = desc->caps; if (desc->flags & DWDESC_PIXELFORMAT) wd.pixelformat = desc->pixelformat; if (desc->flags & DWDESC_SURFACE_CAPS) wd.surface_caps = desc->surface_caps; if (desc->flags & DWDESC_PARENT) { wd.flags |= DWDESC_PARENT; wd.parent_id = desc->parent_id; } if (desc->flags & DWDESC_OPTIONS) { wd.flags |= DWDESC_OPTIONS; wd.options = desc->options; } if (desc->flags & DWDESC_STACKING) { wd.flags |= DWDESC_STACKING; wd.stacking = desc->stacking; } if (desc->flags & DWDESC_RESOURCE_ID) { wd.flags |= DWDESC_RESOURCE_ID; wd.resource_id = desc->resource_id; } if ((wd.caps & ~DWCAPS_ALL) || !window) return DFB_INVARG; if (wd.width < 1 || wd.width > 4096 || wd.height < 1 || wd.height > 4096) return DFB_INVARG; ret = dfb_layer_context_create_window( data->core, data->context, &wd, &w ); if (ret) return ret; DIRECT_ALLOCATE_INTERFACE( *window, IDirectFBWindow ); return IDirectFBWindow_Construct( *window, w, data->layer, data->core ); } static DFBResult IDirectFBDisplayLayer_GetWindow( IDirectFBDisplayLayer *thiz, DFBWindowID id, IDirectFBWindow **window ) { CoreWindow *w; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!window) return DFB_INVARG; //remove for now //if (data->level == DLSCL_SHARED) // return DFB_ACCESSDENIED; w = dfb_layer_context_find_window( data->context, id ); if (!w) return DFB_IDNOTFOUND; DIRECT_ALLOCATE_INTERFACE( *window, IDirectFBWindow ); return IDirectFBWindow_Construct( *window, w, data->layer, data->core ); } static DFBResult IDirectFBDisplayLayer_EnableCursor( IDirectFBDisplayLayer *thiz, int enable ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_windowstack_cursor_enable( data->core, data->stack, enable ); } static DFBResult IDirectFBDisplayLayer_GetCursorPosition( IDirectFBDisplayLayer *thiz, int *x, int *y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!x && !y) return DFB_INVARG; return dfb_windowstack_get_cursor_position( data->stack, x, y ); } static DFBResult IDirectFBDisplayLayer_WarpCursor( IDirectFBDisplayLayer *thiz, int x, int y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_windowstack_cursor_warp( data->stack, x, y ); } static DFBResult IDirectFBDisplayLayer_SetCursorAcceleration( IDirectFBDisplayLayer *thiz, int numerator, int denominator, int threshold ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (numerator < 0 || denominator < 1 || threshold < 0) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_windowstack_cursor_set_acceleration( data->stack, numerator, denominator, threshold ); } static DFBResult IDirectFBDisplayLayer_SetCursorShape( IDirectFBDisplayLayer *thiz, IDirectFBSurface *shape, int hot_x, int hot_y ) { IDirectFBSurface_data *shape_data; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!shape) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; shape_data = (IDirectFBSurface_data*)shape->priv; if (hot_x < 0 || hot_y < 0 || hot_x >= shape_data->surface->config.size.w || hot_y >= shape_data->surface->config.size.h) return DFB_INVARG; return dfb_windowstack_cursor_set_shape( data->stack, shape_data->surface, hot_x, hot_y ); } static DFBResult IDirectFBDisplayLayer_SetCursorOpacity( IDirectFBDisplayLayer *thiz, u8 opacity ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_windowstack_cursor_set_opacity( data->stack, opacity ); } static DFBResult IDirectFBDisplayLayer_GetColorAdjustment( IDirectFBDisplayLayer *thiz, DFBColorAdjustment *adj ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!adj) return DFB_INVARG; return dfb_layer_context_get_coloradjustment( data->context, adj ); } static DFBResult IDirectFBDisplayLayer_SetColorAdjustment( IDirectFBDisplayLayer *thiz, const DFBColorAdjustment *adj ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!adj || (adj->flags & ~DCAF_ALL)) return DFB_INVARG; if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; if (!adj->flags) return DFB_OK; return dfb_layer_context_set_coloradjustment( data->context, adj ); } static DFBResult IDirectFBDisplayLayer_WaitForSync( IDirectFBDisplayLayer *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) return dfb_layer_wait_vsync( data->layer ); } static DFBResult IDirectFBDisplayLayer_GetSourceDescriptions( IDirectFBDisplayLayer *thiz, DFBDisplayLayerSourceDescription *ret_descriptions ) { int i; DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!ret_descriptions) return DFB_INVARG; if (! D_FLAGS_IS_SET( data->desc.caps, DLCAPS_SOURCES )) return DFB_UNSUPPORTED; for (i=0; idesc.sources; i++) dfb_layer_get_source_info( data->layer, i, &ret_descriptions[i] ); return DFB_OK; } static DFBResult IDirectFBDisplayLayer_SwitchContext( IDirectFBDisplayLayer *thiz, DFBBoolean exclusive ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (!exclusive && data->level == DLSCL_EXCLUSIVE) { DFBResult ret; CoreLayerContext *context; ret = dfb_layer_get_primary_context( data->layer, false, &context ); if (ret) return ret; dfb_layer_activate_context( data->layer, context ); dfb_layer_context_unref( context ); } else dfb_layer_activate_context( data->layer, data->context ); data->switch_exclusive = exclusive; return DFB_OK; } static DFBResult IDirectFBDisplayLayer_SetRotation( IDirectFBDisplayLayer *thiz, int rotation ) { DIRECT_INTERFACE_GET_DATA(IDirectFBDisplayLayer) if (data->level == DLSCL_SHARED) return DFB_ACCESSDENIED; return dfb_layer_context_set_rotation( data->context, rotation ); } DFBResult IDirectFBDisplayLayer_Construct( IDirectFBDisplayLayer *thiz, CoreLayer *layer, CoreDFB *core ) { DFBResult ret; CoreLayerContext *context; CoreLayerRegion *region; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBDisplayLayer) ret = dfb_layer_get_primary_context( layer, true, &context ); if (ret) { DIRECT_DEALLOCATE_INTERFACE( thiz ) return ret; } ret = dfb_layer_context_get_primary_region( context, true, ®ion ); if (ret) { dfb_layer_context_unref( context ); DIRECT_DEALLOCATE_INTERFACE( thiz ) return ret; } data->ref = 1; data->core = core; data->screen = dfb_layer_screen( layer ); data->layer = layer; data->context = context; data->region = region; data->stack = dfb_layer_context_windowstack( context ); data->switch_exclusive = DFB_TRUE; dfb_layer_get_description( data->layer, &data->desc ); thiz->AddRef = IDirectFBDisplayLayer_AddRef; thiz->Release = IDirectFBDisplayLayer_Release; thiz->GetID = IDirectFBDisplayLayer_GetID; thiz->GetDescription = IDirectFBDisplayLayer_GetDescription; thiz->GetSurface = IDirectFBDisplayLayer_GetSurface; thiz->GetScreen = IDirectFBDisplayLayer_GetScreen; thiz->SetCooperativeLevel = IDirectFBDisplayLayer_SetCooperativeLevel; thiz->SetOpacity = IDirectFBDisplayLayer_SetOpacity; thiz->GetCurrentOutputField = IDirectFBDisplayLayer_GetCurrentOutputField; thiz->SetSourceRectangle = IDirectFBDisplayLayer_SetSourceRectangle; thiz->SetScreenLocation = IDirectFBDisplayLayer_SetScreenLocation; thiz->SetSrcColorKey = IDirectFBDisplayLayer_SetSrcColorKey; thiz->SetDstColorKey = IDirectFBDisplayLayer_SetDstColorKey; thiz->GetLevel = IDirectFBDisplayLayer_GetLevel; thiz->SetLevel = IDirectFBDisplayLayer_SetLevel; thiz->GetConfiguration = IDirectFBDisplayLayer_GetConfiguration; thiz->TestConfiguration = IDirectFBDisplayLayer_TestConfiguration; thiz->SetConfiguration = IDirectFBDisplayLayer_SetConfiguration; thiz->SetBackgroundMode = IDirectFBDisplayLayer_SetBackgroundMode; thiz->SetBackgroundColor = IDirectFBDisplayLayer_SetBackgroundColor; thiz->SetBackgroundImage = IDirectFBDisplayLayer_SetBackgroundImage; thiz->GetColorAdjustment = IDirectFBDisplayLayer_GetColorAdjustment; thiz->SetColorAdjustment = IDirectFBDisplayLayer_SetColorAdjustment; thiz->CreateWindow = IDirectFBDisplayLayer_CreateWindow; thiz->GetWindow = IDirectFBDisplayLayer_GetWindow; thiz->WarpCursor = IDirectFBDisplayLayer_WarpCursor; thiz->SetCursorAcceleration = IDirectFBDisplayLayer_SetCursorAcceleration; thiz->EnableCursor = IDirectFBDisplayLayer_EnableCursor; thiz->GetCursorPosition = IDirectFBDisplayLayer_GetCursorPosition; thiz->SetCursorShape = IDirectFBDisplayLayer_SetCursorShape; thiz->SetCursorOpacity = IDirectFBDisplayLayer_SetCursorOpacity; thiz->SetFieldParity = IDirectFBDisplayLayer_SetFieldParity; thiz->SetClipRegions = IDirectFBDisplayLayer_SetClipRegions; thiz->WaitForSync = IDirectFBDisplayLayer_WaitForSync; thiz->GetSourceDescriptions = IDirectFBDisplayLayer_GetSourceDescriptions; thiz->SetScreenPosition = IDirectFBDisplayLayer_SetScreenPosition; thiz->SetScreenRectangle = IDirectFBDisplayLayer_SetScreenRectangle; thiz->SwitchContext = IDirectFBDisplayLayer_SwitchContext; thiz->SetRotation = IDirectFBDisplayLayer_SetRotation; return DFB_OK; } DirectFB-1.2.10/src/display/idirectfbsurface_window.c0000644000175000017500000002532511245562152017443 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* FIXME */ #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Surface, "IDirectFBSurfaceW", "IDirectFBSurface_Window Interface" ); /**********************************************************************************************************************/ /* * private data struct of IDirectFBSurface_Window */ typedef struct { IDirectFBSurface_data base; /* base Surface implementation */ CoreWindow *window; /* pointer to core data */ pthread_t flip_thread; /* thread for non-flipping primary surfaces, to make changes visible */ // CoreGraphicsSerial serial; } IDirectFBSurface_Window_data; /**********************************************************************************************************************/ static void *Flipping_Thread( void *arg ); /**********************************************************************************************************************/ static void IDirectFBSurface_Window_Destruct( IDirectFBSurface *thiz ) { IDirectFBSurface_Window_data *data; D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); D_ASSERT( thiz != NULL ); data = thiz->priv; if ((int) data->flip_thread != -1) { pthread_cancel( data->flip_thread ); pthread_join( data->flip_thread, NULL ); } dfb_window_unref( data->window ); IDirectFBSurface_Destruct( thiz ); } static DirectResult IDirectFBSurface_Window_Release( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Window) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (--data->base.ref == 0) IDirectFBSurface_Window_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBSurface_Window_Flip( IDirectFBSurface *thiz, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { DFBResult ret; DFBRegion reg; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Window) D_DEBUG_AT( Surface, "%s( %p, %p, 0x%08x )\n", __FUNCTION__, thiz, region, flags ); if (!data->base.surface) return DFB_DESTROYED; if (data->base.locked) return DFB_LOCKED; if (!data->base.area.current.w || !data->base.area.current.h || (region && (region->x1 > region->x2 || region->y1 > region->y2))) return DFB_INVAREA; IDirectFBSurface_StopAll( &data->base ); if (data->base.parent) { IDirectFBSurface_data *parent_data; DIRECT_INTERFACE_GET_DATA_FROM( data->base.parent, parent_data, IDirectFBSurface ); /* Signal end of sequence of operations. */ dfb_state_lock( &parent_data->state ); dfb_state_stop_drawing( &parent_data->state ); dfb_state_unlock( &parent_data->state ); } dfb_region_from_rectangle( ®, &data->base.area.current ); if (region) { DFBRegion clip = DFB_REGION_INIT_TRANSLATED( region, data->base.area.wanted.x, data->base.area.wanted.y ); if (!dfb_region_region_intersect( ®, &clip )) return DFB_INVAREA; } D_DEBUG_AT( Surface, " -> FLIP %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION( ® ) ); if (flags & DSFLIP_PIPELINE) { dfb_gfxcard_wait_serial( &data->window->serial2 ); data->window->serial2 = data->window->serial1; dfb_state_get_serial( &data->base.state, &data->window->serial1 ); } if (data->window->region) { dfb_layer_region_flip_update( data->window->region, ®, flags ); } else { if (data->base.surface->config.caps & DSCAPS_FLIPPING) { if (!(flags & DSFLIP_BLIT) && reg.x1 == 0 && reg.y1 == 0 && reg.x2 == data->base.surface->config.size.w - 1 && reg.y2 == data->base.surface->config.size.h - 1) { ret = dfb_surface_lock( data->base.surface ); if (ret) return ret; dfb_surface_flip( data->base.surface, false ); dfb_surface_unlock( data->base.surface ); } else dfb_back_to_front_copy( data->base.surface, ® ); } dfb_window_repaint( data->window, ®, flags ); } if (!data->window->config.opacity && data->base.caps & DSCAPS_PRIMARY) dfb_window_set_opacity( data->window, 0xff ); return DFB_OK; } static DFBResult IDirectFBSurface_Window_GetSubSurface( IDirectFBSurface *thiz, const DFBRectangle *rect, IDirectFBSurface **surface ) { DFBResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Window) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); /* Check arguments */ if (!data->base.surface || !data->window || !data->window->surface) return DFB_DESTROYED; if (!surface) return DFB_INVARG; /* Allocate interface */ DIRECT_ALLOCATE_INTERFACE( *surface, IDirectFBSurface ); if (rect || data->base.limit_set) { DFBRectangle wanted, granted; /* Compute wanted rectangle */ if (rect) { wanted = *rect; wanted.x += data->base.area.wanted.x; wanted.y += data->base.area.wanted.y; if (wanted.w <= 0 || wanted.h <= 0) { wanted.w = 0; wanted.h = 0; } } else { wanted = data->base.area.wanted; } /* Compute granted rectangle */ granted = wanted; dfb_rectangle_intersect( &granted, &data->base.area.granted ); /* Construct */ ret = IDirectFBSurface_Window_Construct( *surface, thiz, &wanted, &granted, data->window, data->base.caps | DSCAPS_SUBSURFACE, data->base.core ); } else { /* Construct */ ret = IDirectFBSurface_Window_Construct( *surface, thiz, NULL, NULL, data->window, data->base.caps | DSCAPS_SUBSURFACE, data->base.core ); } return ret; } DFBResult IDirectFBSurface_Window_Construct( IDirectFBSurface *thiz, IDirectFBSurface *parent, DFBRectangle *wanted, DFBRectangle *granted, CoreWindow *window, DFBSurfaceCapabilities caps, CoreDFB *core ) { DFBResult ret; DFBInsets insets; CoreWindowStack *stack; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBSurface_Window) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); stack = window->stack; D_MAGIC_ASSERT( stack, CoreWindowStack ); dfb_layer_context_lock( stack->context ); dfb_wm_get_insets( stack, window, &insets ); dfb_layer_context_unlock( stack->context ); ret = IDirectFBSurface_Construct( thiz, parent, wanted, granted, &insets, window->surface, caps, core ); if (ret) return ret; if (dfb_window_ref( window )) { IDirectFBSurface_Destruct( thiz ); return DFB_FAILURE; } data->window = window; data->flip_thread = (pthread_t) -1; /* * Create an auto flipping thread if the application * requested a (primary) surface that doesn't need to be flipped. * Window surfaces even need to be flipped when they are single buffered. */ if (!(caps & DSCAPS_FLIPPING) && !(caps & DSCAPS_SUBSURFACE)) { if (dfb_config->autoflip_window) pthread_create( &data->flip_thread, NULL, Flipping_Thread, thiz ); else D_WARN( "Non-flipping window surface and no 'autoflip-window' option used" ); } thiz->Release = IDirectFBSurface_Window_Release; thiz->Flip = IDirectFBSurface_Window_Flip; thiz->GetSubSurface = IDirectFBSurface_Window_GetSubSurface; return DFB_OK; } /* file internal */ static void * Flipping_Thread( void *arg ) { IDirectFBSurface *thiz = (IDirectFBSurface*) arg; IDirectFBSurface_Window_data *data = (IDirectFBSurface_Window_data*) thiz->priv; D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); while (data->base.surface && data->window->surface) { pthread_testcancel(); /* * OPTIMIZE: only call if surface has been touched in the meantime */ thiz->Flip( thiz, NULL, 0 ); usleep(40000); } return NULL; } DirectFB-1.2.10/src/display/idirectfbsurface.h0000644000175000017500000001116711245562152016060 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBSURFACE_H__ #define __IDIRECTFBSURFACE_H__ #include #include #include #include #include /* * private data struct of IDirectFBSurface */ typedef struct { DirectLink link; int ref; /* reference counter */ DFBSurfaceCapabilities caps; /* capabilities */ struct { DFBRectangle wanted; /* passed to GetSubSurface */ DFBRectangle granted; /* clipped by parent on creation */ DFBRectangle current; /* currently available area */ DFBInsets insets; /* actually set by the window manager */ } area; bool limit_set; /* greanted rectangle set? (GetSubSurface called with rect != NULL) */ bool clip_set; /* fixed clip set? (SetClip called with clip != NULL) */ DFBRegion clip_wanted; /* last region passed to SetClip intersected by wanted area, only valid if clip_set != 0 */ CoreSurface *surface; /* buffer to show */ bool locked; /* which buffer is locked? */ CoreSurfaceBufferLock lock; IDirectFBFont *font; /* font to use */ CardState state; /* render state to use */ DFBTextEncodingID encoding; /* text encoding */ struct { u8 r; /* red component */ u8 g; /* green component */ u8 b; /* blue component */ u32 value; /* r/g/b in surface's format */ } src_key; /* src key for blitting from this surface */ struct { u8 r; /* red component */ u8 g; /* green component */ u8 b; /* blue component */ u32 value; /* r/g/b in surface's format */ } dst_key; /* dst key for blitting to this surface */ Reaction reaction; CoreDFB *core; IDirectFBSurface *parent; DirectLink *children_data; pthread_mutex_t children_lock; } IDirectFBSurface_data; /* * initializes interface struct and private data */ DFBResult IDirectFBSurface_Construct( IDirectFBSurface *thiz, IDirectFBSurface *parent, DFBRectangle *req_rect, DFBRectangle *clip_rect, DFBInsets *insets, CoreSurface *surface, DFBSurfaceCapabilities caps, CoreDFB *core ); /* * destroys surface(s) and frees private data */ void IDirectFBSurface_Destruct( IDirectFBSurface *thiz ); /* * internal */ void IDirectFBSurface_StopAll( IDirectFBSurface_data *data ); #endif DirectFB-1.2.10/src/display/idirectfbsurface.c0000644000175000017500000023157611245562152016063 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include D_DEBUG_DOMAIN( Surface, "IDirectFBSurface", "IDirectFBSurface Interface" ); /**********************************************************************************************************************/ static ReactionResult IDirectFBSurface_listener( const void *msg_data, void *ctx ); /**********************************************************************************************************************/ void IDirectFBSurface_Destruct( IDirectFBSurface *thiz ) { IDirectFBSurface_data *data; IDirectFBSurface *parent; D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); D_ASSERT( thiz != NULL ); data = thiz->priv; D_ASSERT( data != NULL ); D_ASSERT( data->children_data == NULL ); parent = data->parent; if (parent) { IDirectFBSurface_data *parent_data; D_MAGIC_ASSERT( (IAny*) parent, DirectInterface ); parent_data = parent->priv; D_ASSERT( parent_data != NULL ); pthread_mutex_lock( &parent_data->children_lock ); direct_list_remove( &parent_data->children_data, &data->link ); pthread_mutex_unlock( &parent_data->children_lock ); } if (data->surface) dfb_surface_detach( data->surface, &data->reaction ); dfb_state_stop_drawing( &data->state ); dfb_state_set_destination( &data->state, NULL ); dfb_state_set_source( &data->state, NULL ); dfb_state_set_source_mask( &data->state, NULL ); dfb_state_destroy( &data->state ); if (data->font) { IDirectFBFont *font = data->font; IDirectFBFont_data *font_data = font->priv; if (font_data) { if (data->surface) dfb_font_drop_destination( font_data->font, data->surface ); font->Release( font ); } else D_WARN( "font dead?" ); } if (data->surface) { if (data->locked) dfb_surface_unlock_buffer( data->surface, &data->lock ); dfb_surface_unref( data->surface ); } pthread_mutex_destroy( &data->children_lock ); DIRECT_DEALLOCATE_INTERFACE( thiz ); if (parent) parent->Release( parent ); } static DirectResult IDirectFBSurface_AddRef( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); data->ref++; return DFB_OK; } static DirectResult IDirectFBSurface_Release( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (--data->ref == 0) IDirectFBSurface_Destruct( thiz ); return DFB_OK; } static DFBResult IDirectFBSurface_GetPixelFormat( IDirectFBSurface *thiz, DFBSurfacePixelFormat *format ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!format) return DFB_INVARG; *format = data->surface->config.format; return DFB_OK; } static DFBResult IDirectFBSurface_GetAccelerationMask( IDirectFBSurface *thiz, IDirectFBSurface *source, DFBAccelerationMask *mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!mask) return DFB_INVARG; dfb_gfxcard_state_check( &data->state, DFXL_FILLRECTANGLE ); dfb_gfxcard_state_check( &data->state, DFXL_DRAWRECTANGLE ); dfb_gfxcard_state_check( &data->state, DFXL_DRAWLINE ); dfb_gfxcard_state_check( &data->state, DFXL_FILLTRIANGLE ); if (source) { IDirectFBSurface_data *src_data = source->priv; dfb_state_set_source( &data->state, src_data->surface ); dfb_gfxcard_state_check( &data->state, DFXL_BLIT ); dfb_gfxcard_state_check( &data->state, DFXL_STRETCHBLIT ); dfb_gfxcard_state_check( &data->state, DFXL_TEXTRIANGLES ); } if (data->font) { IDirectFBFont_data *font_data = data->font->priv; dfb_gfxcard_drawstring_check_state( font_data->font, &data->state ); } *mask = data->state.accel; return DFB_OK; } static DFBResult IDirectFBSurface_GetPosition( IDirectFBSurface *thiz, int *x, int *y ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!x && !y) return DFB_INVARG; if (x) *x = data->area.wanted.x; if (y) *y = data->area.wanted.y; return DFB_OK; } static DFBResult IDirectFBSurface_GetSize( IDirectFBSurface *thiz, int *width, int *height ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!width && !height) return DFB_INVARG; if (width) *width = data->area.wanted.w; if (height) *height = data->area.wanted.h; return DFB_OK; } static DFBResult IDirectFBSurface_GetVisibleRectangle( IDirectFBSurface *thiz, DFBRectangle *rect ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!rect) return DFB_INVARG; rect->x = data->area.current.x - data->area.wanted.x; rect->y = data->area.current.y - data->area.wanted.y; rect->w = data->area.current.w; rect->h = data->area.current.h; return DFB_OK; } static DFBResult IDirectFBSurface_GetCapabilities( IDirectFBSurface *thiz, DFBSurfaceCapabilities *caps ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!caps) return DFB_INVARG; *caps = data->caps; return DFB_OK; } static DFBResult IDirectFBSurface_GetPalette( IDirectFBSurface *thiz, IDirectFBPalette **interface ) { DFBResult ret; CoreSurface *surface; IDirectFBPalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (!surface->palette) return DFB_UNSUPPORTED; if (!interface) return DFB_INVARG; DIRECT_ALLOCATE_INTERFACE( palette, IDirectFBPalette ); ret = IDirectFBPalette_Construct( palette, surface->palette ); if (ret) return ret; *interface = palette; return DFB_OK; } static DFBResult IDirectFBSurface_SetPalette( IDirectFBSurface *thiz, IDirectFBPalette *palette ) { CoreSurface *surface; IDirectFBPalette_data *palette_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (!palette) return DFB_INVARG; if (! DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) return DFB_UNSUPPORTED; palette_data = (IDirectFBPalette_data*) palette->priv; if (!palette_data) return DFB_DEAD; if (!palette_data->palette) return DFB_DESTROYED; dfb_surface_set_palette( surface, palette_data->palette ); return DFB_OK; } static DFBResult IDirectFBSurface_SetAlphaRamp( IDirectFBSurface *thiz, u8 a0, u8 a1, u8 a2, u8 a3 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; dfb_surface_set_alpha_ramp( data->surface, a0, a1, a2, a3 ); return DFB_OK; } static DFBResult IDirectFBSurface_Lock( IDirectFBSurface *thiz, DFBSurfaceLockFlags flags, void **ret_ptr, int *ret_pitch ) { DFBResult ret; CoreSurfaceBufferRole role = CSBR_FRONT; CoreSurfaceAccessFlags access = CSAF_NONE; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (data->locked) return DFB_LOCKED; if (!flags || !ret_ptr || !ret_pitch) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (flags & DSLF_READ) access |= CSAF_CPU_READ; if (flags & DSLF_WRITE) { access |= CSAF_CPU_WRITE; role = CSBR_BACK; } ret = dfb_surface_lock_buffer( data->surface, role, access, &data->lock ); if (ret) return ret; data->locked = true; *ret_ptr = data->lock.addr + data->lock.pitch * data->area.current.y + DFB_BYTES_PER_LINE( data->surface->config.format, data->area.current.x ); *ret_pitch = data->lock.pitch; return DFB_OK; } static DFBResult IDirectFBSurface_GetFramebufferOffset( IDirectFBSurface *thiz, int *offset ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) if (!data->surface) return DFB_DESTROYED; if (!offset) return DFB_INVARG; if (!data->locked) return DFB_ACCESSDENIED; if (!data->lock.phys) { /* The surface is probably in a system buffer if there's no physical address. */ return DFB_UNSUPPORTED; } *offset = data->lock.offset; return DFB_OK; } static DFBResult IDirectFBSurface_Unlock( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (data->locked) { dfb_surface_unlock_buffer( data->surface, &data->lock ); data->locked = false; } return DFB_OK; } static DFBResult IDirectFBSurface_Write( IDirectFBSurface *thiz, const DFBRectangle *rect, const void *ptr, int pitch ) { CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p, %p [%d] )\n", __FUNCTION__, thiz, rect, ptr, pitch ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (!rect || !ptr || pitch < DFB_BYTES_PER_LINE(surface->config.format,rect->w ) ) return DFB_INVARG; if (data->locked) return DFB_LOCKED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; D_DEBUG_AT( Surface, " -> %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS( rect ) ); //FIXME: check rectangle return dfb_surface_write_buffer( data->surface, CSBR_BACK, ptr, pitch, rect ); } static DFBResult IDirectFBSurface_Read( IDirectFBSurface *thiz, const DFBRectangle *rect, void *ptr, int pitch ) { CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p, %p [%d] )\n", __FUNCTION__, thiz, rect, ptr, pitch ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (!rect || !ptr || pitch < DFB_BYTES_PER_LINE(surface->config.format,rect->w ) ) return DFB_INVARG; if (data->locked) return DFB_LOCKED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; D_DEBUG_AT( Surface, " -> %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS( rect ) ); //FIXME: check rectangle return dfb_surface_read_buffer( data->surface, CSBR_FRONT, ptr, pitch, rect ); } static DFBResult IDirectFBSurface_Flip( IDirectFBSurface *thiz, const DFBRegion *region, DFBSurfaceFlipFlags flags ) { DFBResult ret; DFBRegion reg; CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p, 0x%08x )\n", __FUNCTION__, thiz, region, flags ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (data->locked) return DFB_LOCKED; if (!(surface->config.caps & DSCAPS_FLIPPING)) return DFB_UNSUPPORTED; if (!data->area.current.w || !data->area.current.h || (region && (region->x1 > region->x2 || region->y1 > region->y2))) return DFB_INVAREA; IDirectFBSurface_StopAll( data ); /* FIXME: This is a temporary workaround for LiTE. */ if (data->parent) { IDirectFBSurface_data *parent_data; DIRECT_INTERFACE_GET_DATA_FROM( data->parent, parent_data, IDirectFBSurface ); /* Signal end of sequence of operations. */ dfb_state_lock( &parent_data->state ); dfb_state_stop_drawing( &parent_data->state ); dfb_state_unlock( &parent_data->state ); } dfb_region_from_rectangle( ®, &data->area.current ); if (region) { DFBRegion clip = DFB_REGION_INIT_TRANSLATED( region, data->area.wanted.x, data->area.wanted.y ); if (!dfb_region_region_intersect( ®, &clip )) return DFB_INVAREA; } D_DEBUG_AT( Surface, " -> %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION( ® ) ); if (!(flags & DSFLIP_BLIT) && reg.x1 == 0 && reg.y1 == 0 && reg.x2 == surface->config.size.w - 1 && reg.y2 == surface->config.size.h - 1) { ret = dfb_surface_lock( data->surface ); if (ret) return ret; dfb_surface_flip( data->surface, false ); dfb_surface_unlock( data->surface ); } else dfb_back_to_front_copy( data->surface, ® ); return DFB_OK; } static DFBResult IDirectFBSurface_SetField( IDirectFBSurface *thiz, int field ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!(data->surface->config.caps & DSCAPS_INTERLACED)) return DFB_UNSUPPORTED; if (field < 0 || field > 1) return DFB_INVARG; dfb_surface_set_field( data->surface, field ); return DFB_OK; } static DFBResult IDirectFBSurface_Clear( IDirectFBSurface *thiz, u8 r, u8 g, u8 b, u8 a ) { DFBColor old_color; unsigned int old_index; DFBSurfaceDrawingFlags old_flags; DFBSurfaceRenderOptions old_options; CoreSurface *surface; DFBColor color = { a, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, 0x%08x )\n", __FUNCTION__, thiz, PIXEL_ARGB(a,r,g,b) ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; /* save current color and drawing flags */ old_color = data->state.color; old_index = data->state.color_index; old_flags = data->state.drawingflags; old_options = data->state.render_options; /* set drawing flags */ dfb_state_set_drawing_flags( &data->state, DSDRAW_NOFX ); /* set render options */ dfb_state_set_render_options( &data->state, DSRO_NONE ); /* set color */ if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) dfb_state_set_color_index( &data->state, dfb_palette_search( surface->palette, r, g, b, a ) ); dfb_state_set_color( &data->state, &color ); /* fill the visible rectangle */ dfb_gfxcard_fillrectangles( &data->area.current, 1, &data->state ); /* clear the depth buffer */ if (data->caps & DSCAPS_DEPTH) dfb_clear_depth( data->surface, &data->state.clip ); /* restore drawing flags */ dfb_state_set_drawing_flags( &data->state, old_flags ); /* restore render options */ dfb_state_set_render_options( &data->state, old_options ); /* restore color */ if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) dfb_state_set_color_index( &data->state, old_index ); dfb_state_set_color( &data->state, &old_color ); return DFB_OK; } static DFBResult IDirectFBSurface_SetClip( IDirectFBSurface *thiz, const DFBRegion *clip ) { DFBRegion newclip; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p )\n", __FUNCTION__, thiz, clip ); if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (clip) { newclip = DFB_REGION_INIT_TRANSLATED( clip, data->area.wanted.x, data->area.wanted.y ); D_DEBUG_AT( Surface, " <- %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION(&newclip) ); if (!dfb_unsafe_region_rectangle_intersect( &newclip, &data->area.wanted )) return DFB_INVARG; D_DEBUG_AT( Surface, " -> %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION(&newclip) ); data->clip_set = true; data->clip_wanted = newclip; if (!dfb_region_rectangle_intersect( &newclip, &data->area.current )) return DFB_INVAREA; } else { dfb_region_from_rectangle( &newclip, &data->area.current ); data->clip_set = false; } D_DEBUG_AT( Surface, " => CLIP %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION(&newclip) ); dfb_state_set_clip( &data->state, &newclip ); return DFB_OK; } static DFBResult IDirectFBSurface_GetClip( IDirectFBSurface *thiz, DFBRegion *ret_clip ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!ret_clip) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; *ret_clip = DFB_REGION_INIT_TRANSLATED( &data->state.clip, -data->area.wanted.x, -data->area.wanted.y ); D_DEBUG_AT( Surface, " -> %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS_FROM_REGION(ret_clip) ); return DFB_OK; } static DFBResult IDirectFBSurface_SetColor( IDirectFBSurface *thiz, u8 r, u8 g, u8 b, u8 a ) { CoreSurface *surface; DFBColor color = { a, r, g, b }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, COLOR 0x%08x )\n", __FUNCTION__, thiz, PIXEL_ARGB(a, r, g, b) ); surface = data->surface; if (!surface) return DFB_DESTROYED; dfb_state_set_color( &data->state, &color ); if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) dfb_state_set_color_index( &data->state, dfb_palette_search( surface->palette, r, g, b, a ) ); return DFB_OK; } static DFBResult IDirectFBSurface_SetColorIndex( IDirectFBSurface *thiz, unsigned int index ) { CoreSurface *surface; CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, COLOR INDEX %3u )\n", __FUNCTION__, thiz, index ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (! DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) return DFB_UNSUPPORTED; palette = surface->palette; if (!palette) return DFB_UNSUPPORTED; if (index > palette->num_entries) return DFB_INVARG; dfb_state_set_color( &data->state, &palette->entries[index] ); dfb_state_set_color_index( &data->state, index ); return DFB_OK; } static DFBResult IDirectFBSurface_SetSrcBlendFunction( IDirectFBSurface *thiz, DFBSurfaceBlendFunction src ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %d )\n", __FUNCTION__, thiz, src ); switch (src) { case DSBF_ZERO: case DSBF_ONE: case DSBF_SRCCOLOR: case DSBF_INVSRCCOLOR: case DSBF_SRCALPHA: case DSBF_INVSRCALPHA: case DSBF_DESTALPHA: case DSBF_INVDESTALPHA: case DSBF_DESTCOLOR: case DSBF_INVDESTCOLOR: case DSBF_SRCALPHASAT: dfb_state_set_src_blend( &data->state, src ); return DFB_OK; default: break; } return DFB_INVARG; } static DFBResult IDirectFBSurface_SetDstBlendFunction( IDirectFBSurface *thiz, DFBSurfaceBlendFunction dst ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %d )\n", __FUNCTION__, thiz, dst ); switch (dst) { case DSBF_ZERO: case DSBF_ONE: case DSBF_SRCCOLOR: case DSBF_INVSRCCOLOR: case DSBF_SRCALPHA: case DSBF_INVSRCALPHA: case DSBF_DESTALPHA: case DSBF_INVDESTALPHA: case DSBF_DESTCOLOR: case DSBF_INVDESTCOLOR: case DSBF_SRCALPHASAT: dfb_state_set_dst_blend( &data->state, dst ); return DFB_OK; default: break; } return DFB_INVARG; } static DFBResult IDirectFBSurface_SetPorterDuff( IDirectFBSurface *thiz, DFBSurfacePorterDuffRule rule ) { DFBSurfaceBlendFunction src; DFBSurfaceBlendFunction dst; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %d )\n", __FUNCTION__, thiz, rule ); switch (rule) { case DSPD_NONE: src = DSBF_SRCALPHA; dst = DSBF_INVSRCALPHA; break; case DSPD_CLEAR: src = DSBF_ZERO; dst = DSBF_ZERO; break; case DSPD_SRC: src = DSBF_ONE; dst = DSBF_ZERO; break; case DSPD_SRC_OVER: src = DSBF_ONE; dst = DSBF_INVSRCALPHA; break; case DSPD_DST_OVER: src = DSBF_INVDESTALPHA; dst = DSBF_ONE; break; case DSPD_SRC_IN: src = DSBF_DESTALPHA; dst = DSBF_ZERO; break; case DSPD_DST_IN: src = DSBF_ZERO; dst = DSBF_SRCALPHA; break; case DSPD_SRC_OUT: src = DSBF_INVDESTALPHA; dst = DSBF_ZERO; break; case DSPD_DST_OUT: src = DSBF_ZERO; dst = DSBF_INVSRCALPHA; break; case DSPD_SRC_ATOP: src = DSBF_DESTALPHA; dst = DSBF_INVSRCALPHA; break; case DSPD_DST_ATOP: src = DSBF_INVDESTALPHA; dst = DSBF_SRCALPHA; break; case DSPD_ADD: src = DSBF_ONE; dst = DSBF_ONE; break; case DSPD_XOR: src = DSBF_INVDESTALPHA; dst = DSBF_INVSRCALPHA; break; case DSPD_DST: src = DSBF_ZERO; dst = DSBF_ONE; break; default: return DFB_INVARG; } dfb_state_set_src_blend( &data->state, src ); dfb_state_set_dst_blend( &data->state, dst ); return DFB_OK; } static DFBResult IDirectFBSurface_SetSrcColorKey( IDirectFBSurface *thiz, u8 r, u8 g, u8 b ) { CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); surface = data->surface; if (!surface) return DFB_DESTROYED; data->src_key.r = r; data->src_key.g = g; data->src_key.b = b; if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) data->src_key.value = dfb_palette_search( surface->palette, r, g, b, 0x80 ); else data->src_key.value = dfb_color_to_pixel( surface->config.format, r, g, b ); /* The new key won't be applied to this surface's state. The key will be taken by the destination surface to apply it to its state when source color keying is used. */ return DFB_OK; } static DFBResult IDirectFBSurface_SetSrcColorKeyIndex( IDirectFBSurface *thiz, unsigned int index ) { CoreSurface *surface; CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (! DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) return DFB_UNSUPPORTED; palette = surface->palette; if (!palette) return DFB_UNSUPPORTED; if (index > palette->num_entries) return DFB_INVARG; data->src_key.r = palette->entries[index].r; data->src_key.g = palette->entries[index].g; data->src_key.b = palette->entries[index].b; data->src_key.value = index; /* The new key won't be applied to this surface's state. The key will be taken by the destination surface to apply it to its state when source color keying is used. */ return DFB_OK; } static DFBResult IDirectFBSurface_SetDstColorKey( IDirectFBSurface *thiz, u8 r, u8 g, u8 b ) { CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); surface = data->surface; if (!surface) return DFB_DESTROYED; data->dst_key.r = r; data->dst_key.g = g; data->dst_key.b = b; if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) data->dst_key.value = dfb_palette_search( surface->palette, r, g, b, 0x80 ); else data->dst_key.value = dfb_color_to_pixel( surface->config.format, r, g, b ); dfb_state_set_dst_colorkey( &data->state, data->dst_key.value ); return DFB_OK; } static DFBResult IDirectFBSurface_SetDstColorKeyIndex( IDirectFBSurface *thiz, unsigned int index ) { CoreSurface *surface; CorePalette *palette; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); surface = data->surface; if (!surface) return DFB_DESTROYED; if (! DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) return DFB_UNSUPPORTED; palette = surface->palette; if (!palette) return DFB_UNSUPPORTED; if (index > palette->num_entries) return DFB_INVARG; data->dst_key.r = palette->entries[index].r; data->dst_key.g = palette->entries[index].g; data->dst_key.b = palette->entries[index].b; data->dst_key.value = index; dfb_state_set_dst_colorkey( &data->state, data->dst_key.value ); return DFB_OK; } static DFBResult IDirectFBSurface_SetIndexTranslation( IDirectFBSurface *thiz, const int *indices, int num_indices ) { CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) surface = data->surface; if (!surface) return DFB_DESTROYED; if (! DFB_PIXELFORMAT_IS_INDEXED( surface->config.format )) return DFB_UNSUPPORTED; if (!indices && num_indices > 0) return DFB_INVAREA; if (num_indices < 0 || num_indices > 256) return DFB_INVARG; return dfb_state_set_index_translation( &data->state, indices, num_indices ); } static DFBResult IDirectFBSurface_SetFont( IDirectFBSurface *thiz, IDirectFBFont *font ) { DFBResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p )\n", __FUNCTION__, thiz, font ); if (data->font != font) { if (font) { IDirectFBFont_data *font_data; ret = font->AddRef( font ); if (ret) return ret; DIRECT_INTERFACE_GET_DATA_FROM( font, font_data, IDirectFBFont ); data->encoding = font_data->encoding; } if (data->font) { IDirectFBFont_data *old_data; IDirectFBFont *old = data->font; DIRECT_INTERFACE_GET_DATA_FROM( old, old_data, IDirectFBFont ); dfb_font_drop_destination( old_data->font, data->surface ); old->Release( old ); } data->font = font; } return DFB_OK; } static DFBResult IDirectFBSurface_GetFont( IDirectFBSurface *thiz, IDirectFBFont **ret_font ) { DFBResult ret; IDirectFBFont *font; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!ret_font) return DFB_INVARG; font = data->font; if (!font) { *ret_font = NULL; return DFB_MISSINGFONT; } ret = font->AddRef( font ); if (ret) return ret; *ret_font = font; return DFB_OK; } static DFBResult IDirectFBSurface_SetDrawingFlags( IDirectFBSurface *thiz, DFBSurfaceDrawingFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, 0x%08x )\n", __FUNCTION__, thiz, flags ); dfb_state_set_drawing_flags( &data->state, flags ); return DFB_OK; } static DFBResult IDirectFBSurface_FillRectangle( IDirectFBSurface *thiz, int x, int y, int w, int h ) { DFBRectangle rect = { x, y, w, h }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); D_DEBUG_AT( Surface, " -> [%2d] %4d,%4d-%4dx%4d\n", 0, x, y, w, h ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (w<=0 || h<=0) return DFB_INVARG; rect.x += data->area.wanted.x; rect.y += data->area.wanted.y; dfb_gfxcard_fillrectangles( &rect, 1, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_DrawLine( IDirectFBSurface *thiz, int x1, int y1, int x2, int y2 ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); D_DEBUG_AT( Surface, " -> [%2d] %4d,%4d-%4d,%4d\n", 0, x1, y1, x2, y2 ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if ((x1 == x2 || y1 == y2) && !(data->state.render_options & DSRO_MATRIX)) { DFBRectangle rect; if (x1 <= x2) { rect.x = x1; rect.w = x2 - x1 + 1; } else { rect.x = x2; rect.w = x1 - x2 + 1; } if (y1 <= y2) { rect.y = y1; rect.h = y2 - y1 + 1; } else { rect.y = y2; rect.h = y1 - y2 + 1; } rect.x += data->area.wanted.x; rect.y += data->area.wanted.y; dfb_gfxcard_fillrectangles( &rect, 1, &data->state ); } else { DFBRegion line = { x1, y1, x2, y2 }; line.x1 += data->area.wanted.x; line.x2 += data->area.wanted.x; line.y1 += data->area.wanted.y; line.y2 += data->area.wanted.y; dfb_gfxcard_drawlines( &line, 1, &data->state ); } return DFB_OK; } static DFBResult IDirectFBSurface_DrawLines( IDirectFBSurface *thiz, const DFBRegion *lines, unsigned int num_lines ) { unsigned int i; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p [%d] )\n", __FUNCTION__, thiz, lines, num_lines ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!lines || !num_lines) return DFB_INVARG; /* Check if all lines are either horizontal or vertical */ for (i=0; iarea.wanted.x || data->area.wanted.y) { for (i=0; iarea.wanted.x; local_lines[i].x2 = lines[i].x2 + data->area.wanted.x; local_lines[i].y1 = lines[i].y1 + data->area.wanted.y; local_lines[i].y2 = lines[i].y2 + data->area.wanted.y; } } else /* clipping may modify lines, so we copy them */ direct_memcpy( local_lines, lines, sizeof(DFBRegion) * num_lines ); dfb_gfxcard_drawlines( local_lines, num_lines, &data->state ); } /* Optimized rectangle drawing */ else { DFBRectangle *local_rects = alloca(sizeof(DFBRectangle) * num_lines); for (i=0; iarea.wanted.x + lines[i].x1; local_rects[i].y = data->area.wanted.y + MIN( lines[i].y1, lines[i].y2 ); local_rects[i].w = 1; local_rects[i].h = ABS( lines[i].y2 - lines[i].y1 ) + 1; } /* Horizontal line */ else { local_rects[i].x = data->area.wanted.x + MIN( lines[i].x1, lines[i].x2 ); local_rects[i].y = data->area.wanted.y + lines[i].y1; local_rects[i].w = ABS( lines[i].x2 - lines[i].x1 ) + 1; local_rects[i].h = 1; } } dfb_gfxcard_fillrectangles( local_rects, num_lines, &data->state ); } return DFB_OK; } static DFBResult IDirectFBSurface_DrawRectangle( IDirectFBSurface *thiz, int x, int y, int w, int h ) { DFBRectangle rect = { x, y, w, h }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); D_DEBUG_AT( Surface, " -> [%2d] %4d,%4d-%4dx%4d\n", 0, x, y, w, h ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (w<=0 || h<=0) return DFB_INVARG; rect.x += data->area.wanted.x; rect.y += data->area.wanted.y; dfb_gfxcard_drawrectangle( &rect, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_FillTriangle( IDirectFBSurface *thiz, int x1, int y1, int x2, int y2, int x3, int y3 ) { DFBTriangle tri = { x1, y1, x2, y2, x3, y3 }; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); D_DEBUG_AT( Surface, " -> [%2d] %4d,%4d-%4d,%4d-%4d,%4d\n", 0, x1, y1, x2, y2, x3, y3 ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; tri.x1 += data->area.wanted.x; tri.y1 += data->area.wanted.y; tri.x2 += data->area.wanted.x; tri.y2 += data->area.wanted.y; tri.x3 += data->area.wanted.x; tri.y3 += data->area.wanted.y; dfb_gfxcard_filltriangles( &tri, 1, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_FillRectangles( IDirectFBSurface *thiz, const DFBRectangle *rects, unsigned int num_rects ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p [%d] )\n", __FUNCTION__, thiz, rects, num_rects ); DFB_RECTANGLES_DEBUG_AT( Surface, rects, num_rects ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!rects || !num_rects) return DFB_INVARG; if (data->area.wanted.x || data->area.wanted.y) { unsigned int i; DFBRectangle *local_rects; bool malloced = (num_rects > 256); if (malloced) local_rects = D_MALLOC( sizeof(DFBRectangle) * num_rects ); else local_rects = alloca( sizeof(DFBRectangle) * num_rects ); for (i=0; iarea.wanted.x; local_rects[i].y = rects[i].y + data->area.wanted.y; local_rects[i].w = rects[i].w; local_rects[i].h = rects[i].h; } dfb_gfxcard_fillrectangles( local_rects, num_rects, &data->state ); if (malloced) D_FREE( local_rects ); } else dfb_gfxcard_fillrectangles( rects, num_rects, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_FillSpans( IDirectFBSurface *thiz, int y, const DFBSpan *spans, unsigned int num_spans ) { DFBSpan *local_spans = alloca(sizeof(DFBSpan) * num_spans); DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!spans || !num_spans) return DFB_INVARG; if (data->area.wanted.x || data->area.wanted.y) { unsigned int i; for (i=0; iarea.wanted.x; local_spans[i].w = spans[i].w; } } else /* clipping may modify spans, so we copy them */ direct_memcpy( local_spans, spans, sizeof(DFBSpan) * num_spans ); dfb_gfxcard_fillspans( y + data->area.wanted.y, local_spans, num_spans, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_FillTriangles( IDirectFBSurface *thiz, const DFBTriangle *tris, unsigned int num_tris ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!tris || !num_tris) return DFB_INVARG; if (data->area.wanted.x || data->area.wanted.y) { unsigned int i; DFBTriangle *local_tris; bool malloced = (num_tris > 170); if (malloced) local_tris = D_MALLOC( sizeof(DFBTriangle) * num_tris ); else local_tris = alloca( sizeof(DFBTriangle) * num_tris ); for (i=0; iarea.wanted.x; local_tris[i].y1 = tris[i].y1 + data->area.wanted.y; local_tris[i].x2 = tris[i].x2 + data->area.wanted.x; local_tris[i].y2 = tris[i].y2 + data->area.wanted.y; local_tris[i].x3 = tris[i].x3 + data->area.wanted.x; local_tris[i].y3 = tris[i].y3 + data->area.wanted.y; } dfb_gfxcard_filltriangles( local_tris, num_tris, &data->state ); if (malloced) D_FREE( local_tris ); } else dfb_gfxcard_filltriangles( tris, num_tris, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_SetBlittingFlags( IDirectFBSurface *thiz, DFBSurfaceBlittingFlags flags ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); dfb_state_set_blitting_flags( &data->state, flags ); return DFB_OK; } static DFBResult IDirectFBSurface_Blit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *sr, int dx, int dy ) { DFBRectangle srect; IDirectFBSurface_data *src_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (sr) D_DEBUG_AT( Surface, " -> [%2d] %4d,%4d-%4dx%4d <- %4d,%4d\n", 0, dx, dy, sr->w, sr->h, sr->x, sr->y ); if (!data->surface) return DFB_DESTROYED; if (!source) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; src_data = (IDirectFBSurface_data*)source->priv; if (!src_data->area.current.w || !src_data->area.current.h) return DFB_INVAREA; if (sr) { if (sr->w < 1 || sr->h < 1) return DFB_OK; srect = *sr; srect.x += src_data->area.wanted.x; srect.y += src_data->area.wanted.y; if (!dfb_rectangle_intersect( &srect, &src_data->area.current )) return DFB_INVAREA; dx += srect.x - (sr->x + src_data->area.wanted.x); dy += srect.y - (sr->y + src_data->area.wanted.y); } else { srect = src_data->area.current; dx += srect.x - src_data->area.wanted.x; dy += srect.y - src_data->area.wanted.y; } dfb_state_set_source( &data->state, src_data->surface ); /* fetch the source color key from the source if necessary */ if (data->state.blittingflags & DSBLIT_SRC_COLORKEY) dfb_state_set_src_colorkey( &data->state, src_data->src_key.value ); dfb_gfxcard_blit( &srect, data->area.wanted.x + dx, data->area.wanted.y + dy, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_TileBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *sr, int dx, int dy ) { DFBRectangle srect; IDirectFBSurface_data *src_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (sr) D_DEBUG_AT( Surface, " -> [%2d] %4d,%4d-%4dx%4d <- %4d,%4d\n", 0, dx, dy, sr->w, sr->h, sr->x, sr->y ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!source) return DFB_INVARG; src_data = (IDirectFBSurface_data*)source->priv; if (!src_data->area.current.w || !src_data->area.current.h) return DFB_INVAREA; if (sr) { if (sr->w < 1 || sr->h < 1) return DFB_OK; srect = *sr; srect.x += src_data->area.wanted.x; srect.y += src_data->area.wanted.y; if (!dfb_rectangle_intersect( &srect, &src_data->area.current )) return DFB_INVAREA; dx += srect.x - (sr->x + src_data->area.wanted.x); dy += srect.y - (sr->y + src_data->area.wanted.y); } else { srect = src_data->area.current; dx += srect.x - src_data->area.wanted.x; dy += srect.y - src_data->area.wanted.y; } dfb_state_set_source( &data->state, src_data->surface ); /* fetch the source color key from the source if necessary */ if (data->state.blittingflags & DSBLIT_SRC_COLORKEY) dfb_state_set_src_colorkey( &data->state, src_data->src_key.value ); dx %= srect.w; if (dx > 0) dx -= srect.w; dy %= srect.h; if (dy > 0) dy -= srect.h; dx += data->area.wanted.x; dy += data->area.wanted.y; dfb_gfxcard_tileblit( &srect, dx, dy, dx + data->area.wanted.w + srect.w - 1, dy + data->area.wanted.h + srect.h - 1, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_BatchBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rects, const DFBPoint *dest_points, int num ) { int i, dx, dy, sx, sy; DFBRectangle *rects; DFBPoint *points; IDirectFBSurface_data *src_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!source || !source_rects || !dest_points || num < 1) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; src_data = (IDirectFBSurface_data*)source->priv; if (!src_data->area.current.w || !src_data->area.current.h) return DFB_INVAREA; dx = data->area.wanted.x; dy = data->area.wanted.y; sx = src_data->area.wanted.x; sy = src_data->area.wanted.y; rects = alloca( sizeof(DFBRectangle) * num ); points = alloca( sizeof(DFBPoint) * num ); direct_memcpy( rects, source_rects, sizeof(DFBRectangle) * num ); direct_memcpy( points, dest_points, sizeof(DFBPoint) * num ); for (i=0; iarea.current )) rects[i].w = rects[i].h = 0; points[i].x += rects[i].x - (source_rects[i].x + sx); points[i].y += rects[i].y - (source_rects[i].y + sy); } dfb_state_set_source( &data->state, src_data->surface ); /* fetch the source color key from the source if necessary */ if (data->state.blittingflags & DSBLIT_SRC_COLORKEY) dfb_state_set_src_colorkey( &data->state, src_data->src_key.value ); dfb_gfxcard_batchblit( rects, points, num, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_StretchBlit( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBRectangle *source_rect, const DFBRectangle *destination_rect ) { DFBRectangle srect, drect; IDirectFBSurface_data *src_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!source) return DFB_INVARG; src_data = (IDirectFBSurface_data*)source->priv; if (!src_data->area.current.w || !src_data->area.current.h) return DFB_INVAREA; /* do destination rectangle */ if (destination_rect) { if (destination_rect->w < 1 || destination_rect->h < 1) return DFB_INVARG; drect = *destination_rect; drect.x += data->area.wanted.x; drect.y += data->area.wanted.y; } else drect = data->area.wanted; /* do source rectangle */ if (source_rect) { if (source_rect->w < 1 || source_rect->h < 1) return DFB_INVARG; srect = *source_rect; srect.x += src_data->area.wanted.x; srect.y += src_data->area.wanted.y; } else srect = src_data->area.wanted; /* clipping of the source rectangle must be applied to the destination */ { DFBRectangle orig_src = srect; if (!dfb_rectangle_intersect( &srect, &src_data->area.current )) return DFB_INVAREA; if (srect.x != orig_src.x) drect.x += (int)( (srect.x - orig_src.x) * (drect.w / (float)orig_src.w) + 0.5f); if (srect.y != orig_src.y) drect.y += (int)( (srect.y - orig_src.y) * (drect.h / (float)orig_src.h) + 0.5f); if (srect.w != orig_src.w) drect.w = D_ICEIL(drect.w * (srect.w / (float)orig_src.w)); if (srect.h != orig_src.h) drect.h = D_ICEIL(drect.h * (srect.h / (float)orig_src.h)); } dfb_state_set_source( &data->state, src_data->surface ); /* fetch the source color key from the source if necessary */ if (data->state.blittingflags & DSBLIT_SRC_COLORKEY) dfb_state_set_src_colorkey( &data->state, src_data->src_key.value ); dfb_gfxcard_stretchblit( &srect, &drect, &data->state ); return DFB_OK; } #define SET_VERTEX(v,X,Y,Z,W,S,T) \ do { \ (v)->x = X; \ (v)->y = Y; \ (v)->z = Z; \ (v)->w = W; \ (v)->s = S; \ (v)->t = T; \ } while (0) static DFBResult IDirectFBSurface_TextureTriangles( IDirectFBSurface *thiz, IDirectFBSurface *source, const DFBVertex *vertices, const int *indices, int num, DFBTriangleFormation formation ) { int i; DFBVertex *translated; IDirectFBSurface_data *src_data; bool src_sub; float x0 = 0; float y0 = 0; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!source || !vertices || num < 3) return DFB_INVARG; src_data = (IDirectFBSurface_data*)source->priv; if ((src_sub = (src_data->caps & DSCAPS_SUBSURFACE))) { D_ONCE( "sub surface texture not fully working with 'repeated' mapping" ); x0 = data->area.wanted.x; y0 = data->area.wanted.y; } switch (formation) { case DTTF_LIST: if (num % 3) return DFB_INVARG; break; case DTTF_STRIP: case DTTF_FAN: break; default: return DFB_INVARG; } translated = alloca( num * sizeof(DFBVertex) ); if (!translated) return DFB_NOSYSTEMMEMORY; /* TODO: pass indices through to driver */ if (src_sub) { float oowidth = 1.0f / src_data->surface->config.size.w; float ooheight = 1.0f / src_data->surface->config.size.h; float s0 = src_data->area.wanted.x * oowidth; float t0 = src_data->area.wanted.y * ooheight; float fs = src_data->area.wanted.w * oowidth; float ft = src_data->area.wanted.h * ooheight; for (i=0; ix, y0 + in->y, in->z, in->w, s0 + fs * in->s, t0 + ft * in->t ); } } else { if (indices) { for (i=0; ix, y0 + in->y, in->z, in->w, in->s, in->t ); } } else { direct_memcpy( translated, vertices, num * sizeof(DFBVertex) ); for (i=0; istate, src_data->surface ); /* fetch the source color key from the source if necessary */ if (data->state.blittingflags & DSBLIT_SRC_COLORKEY) dfb_state_set_src_colorkey( &data->state, src_data->src_key.value ); dfb_gfxcard_texture_triangles( translated, num, formation, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_DrawString( IDirectFBSurface *thiz, const char *text, int bytes, int x, int y, DFBSurfaceTextFlags flags ) { DFBResult ret; IDirectFBFont *font; IDirectFBFont_data *font_data; CoreFont *core_font; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!text) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!data->font) return DFB_MISSINGFONT; if (bytes < 0) bytes = strlen (text); if (bytes == 0) return DFB_OK; font = data->font; DIRECT_INTERFACE_GET_DATA_FROM( font, font_data, IDirectFBFont ); core_font = font_data->font; if (!(flags & DSTF_TOP)) { y -= core_font->ascender; if (flags & DSTF_BOTTOM) y += core_font->descender; } if (flags & (DSTF_RIGHT | DSTF_CENTER)) { int i, num, kx; int width = 0; unsigned int prev = 0; unsigned int indices[bytes]; /* FIXME: Avoid double locking and decoding. */ dfb_font_lock( core_font ); /* Decode string to character indices. */ ret = dfb_font_decode_text( core_font, data->encoding, text, bytes, indices, &num ); if (ret) { dfb_font_unlock( core_font ); return ret; } /* Calculate string width. */ for (i=0; iadvance; if (prev && core_font->GetKerning && core_font->GetKerning( core_font, prev, current, &kx, NULL ) == DFB_OK) width += kx; } prev = current; } dfb_font_unlock( core_font ); /* Justify. */ if (flags & DSTF_RIGHT) x -= width; else if (flags & DSTF_CENTER) x -= width >> 1; } dfb_gfxcard_drawstring( (const unsigned char*) text, bytes, data->encoding, data->area.wanted.x + x, data->area.wanted.y + y, core_font, &data->state ); return DFB_OK; } static DFBResult IDirectFBSurface_DrawGlyph( IDirectFBSurface *thiz, unsigned int character, int x, int y, DFBSurfaceTextFlags flags ) { DFBResult ret; IDirectFBFont *font; IDirectFBFont_data *font_data; CoreFont *core_font; unsigned int index; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, 0x%x, %d,%d, 0x%x )\n", __FUNCTION__, thiz, character, x, y, flags ); if (!data->surface) return DFB_DESTROYED; if (!character) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->locked) return DFB_LOCKED; if (!data->font) return DFB_MISSINGFONT; font = data->font; DIRECT_INTERFACE_GET_DATA_FROM( font, font_data, IDirectFBFont ); core_font = font_data->font; /* FIXME: Avoid double locking. */ dfb_font_lock( core_font ); ret = dfb_font_decode_character( core_font, data->encoding, character, &index ); if (ret) { dfb_font_unlock( core_font ); return ret; } if (!(flags & DSTF_TOP)) { y -= core_font->ascender; if (flags & DSTF_BOTTOM) y += core_font->descender; } if (flags & (DSTF_RIGHT | DSTF_CENTER)) { CoreGlyphData *glyph; ret = dfb_font_get_glyph_data( core_font, index, &glyph ); if (ret) { dfb_font_unlock( core_font ); return ret; } if (flags & DSTF_RIGHT) x -= glyph->advance; else if (flags & DSTF_CENTER) x -= glyph->advance >> 1; } dfb_gfxcard_drawglyph( index, data->area.wanted.x + x, data->area.wanted.y + y, core_font, &data->state ); dfb_font_unlock( core_font ); return DFB_OK; } static DFBResult IDirectFBSurface_SetEncoding( IDirectFBSurface *thiz, DFBTextEncodingID encoding ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %d )\n", __FUNCTION__, thiz, encoding ); /* TODO: check for support or fail later? */ data->encoding = encoding; return DFB_OK; } static DFBResult IDirectFBSurface_GetSubSurface( IDirectFBSurface *thiz, const DFBRectangle *rect, IDirectFBSurface **surface ) { DFBResult ret; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); /* Check arguments */ if (!data->surface) return DFB_DESTROYED; if (!surface) return DFB_INVARG; /* Allocate interface */ DIRECT_ALLOCATE_INTERFACE( *surface, IDirectFBSurface ); if (rect || data->limit_set) { DFBRectangle wanted, granted; /* Compute wanted rectangle */ if (rect) { wanted = *rect; wanted.x += data->area.wanted.x; wanted.y += data->area.wanted.y; if (wanted.w <= 0 || wanted.h <= 0) { wanted.w = 0; wanted.h = 0; } } else { wanted = data->area.wanted; } /* Compute granted rectangle */ granted = wanted; dfb_rectangle_intersect( &granted, &data->area.granted ); /* Construct */ ret = IDirectFBSurface_Construct( *surface, thiz, &wanted, &granted, &data->area.insets, data->surface, data->caps | DSCAPS_SUBSURFACE, data->core ); } else { /* Construct */ ret = IDirectFBSurface_Construct( *surface, thiz, NULL, NULL, &data->area.insets, data->surface, data->caps | DSCAPS_SUBSURFACE, data->core ); } return ret; } static DFBResult IDirectFBSurface_MakeSubSurface( IDirectFBSurface *thiz, IDirectFBSurface *from, const DFBRectangle *rect ) { CoreSurface *surface; DFBRectangle wanted, granted; DFBRectangle full_rect; IDirectFBSurface_data *from_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); /* Check arguments */ if (!from) return DFB_INVARG; surface = data->surface; if (!surface) return DFB_DESTROYED; DIRECT_INTERFACE_GET_DATA_FROM(from, from_data, IDirectFBSurface); /* Check if CoreSurface is the same */ if (from_data->surface != surface) return DFB_UNSUPPORTED; full_rect.x = 0; full_rect.y = 0; full_rect.w = surface->config.size.w; full_rect.h = surface->config.size.h; if (rect || from_data->limit_set) { /* Compute wanted rectangle */ if (rect) { wanted = *rect; wanted.x += from_data->area.wanted.x; wanted.y += from_data->area.wanted.y; if (wanted.w <= 0 || wanted.h <= 0) { wanted.w = 0; wanted.h = 0; } } else { wanted = from_data->area.wanted; } /* Compute granted rectangle */ granted = wanted; dfb_rectangle_intersect( &granted, &from_data->area.granted ); } else { wanted = full_rect; granted = full_rect; } data->caps |= DSCAPS_SUBSURFACE; data->area.wanted = wanted; data->area.granted = granted; data->area.current = data->area.granted; dfb_rectangle_intersect( &data->area.current, &full_rect ); data->state.clip.x1 = data->area.current.x; data->state.clip.y1 = data->area.current.y; data->state.clip.x2 = data->area.current.x + (data->area.current.w ? : 1) - 1; data->state.clip.y2 = data->area.current.y + (data->area.current.h ? : 1) - 1; data->state.modified |= SMF_CLIP; return DFB_OK; } static DFBResult IDirectFBSurface_GetGL( IDirectFBSurface *thiz, IDirectFBGL **interface ) { DFBResult ret; DirectInterfaceFuncs *funcs = NULL; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!data->surface) return DFB_DESTROYED; if (!interface) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; ret = DirectGetInterface( &funcs, "IDirectFBGL", NULL, DirectProbeInterface, thiz ); if (ret) return ret; ret = funcs->Allocate( (void**)interface ); if (ret) return ret; ret = funcs->Construct( *interface, thiz ); if (ret) *interface = NULL; return ret; } static DFBResult IDirectFBSurface_Dump( IDirectFBSurface *thiz, const char *directory, const char *prefix ) { CoreSurface *surface; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (!directory) return DFB_INVARG; if (!data->area.current.w || !data->area.current.h) return DFB_INVAREA; if (data->caps & DSCAPS_SUBSURFACE) { D_ONCE( "sub surface dumping not supported yet" ); return DFB_UNSUPPORTED; } surface = data->surface; if (!surface) return DFB_DESTROYED; return dfb_surface_dump_buffer( surface, CSBR_FRONT, directory, prefix ); } static DFBResult IDirectFBSurface_DisableAcceleration( IDirectFBSurface *thiz, DFBAccelerationMask mask ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); if (D_FLAGS_INVALID( mask, DFXL_ALL )) return DFB_INVARG; data->state.disabled = mask; return DFB_OK; } static DFBResult IDirectFBSurface_ReleaseSource( IDirectFBSurface *thiz ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); dfb_state_set_source( &data->state, NULL ); dfb_state_set_source_mask( &data->state, NULL ); return DFB_OK; } static DFBResult IDirectFBSurface_SetRenderOptions( IDirectFBSurface *thiz, DFBSurfaceRenderOptions options ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); dfb_state_set_render_options( &data->state, options ); return DFB_OK; } static DFBResult IDirectFBSurface_SetMatrix( IDirectFBSurface *thiz, const s32 *matrix ) { DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p )\n", __FUNCTION__, thiz, matrix ); if (!matrix) return DFB_INVARG; dfb_state_set_matrix( &data->state, matrix ); return DFB_OK; } static DFBResult IDirectFBSurface_SetSourceMask( IDirectFBSurface *thiz, IDirectFBSurface *mask, int x, int y, DFBSurfaceMaskFlags flags ) { DFBResult ret; DFBPoint offset = { x, y }; IDirectFBSurface_data *mask_data; DIRECT_INTERFACE_GET_DATA(IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p, %p, %d,%d, 0x%04x )\n", __FUNCTION__, thiz, mask, x, y, flags ); if (!mask || flags & ~DSMF_ALL) return DFB_INVARG; DIRECT_INTERFACE_GET_DATA_FROM(mask, mask_data, IDirectFBSurface); if (!mask_data->surface) return DFB_DESTROYED; ret = dfb_state_set_source_mask( &data->state, mask_data->surface ); if (ret) return ret; dfb_state_set_source_mask_vals( &data->state, &offset, flags ); return DFB_OK; } /******/ DFBResult IDirectFBSurface_Construct( IDirectFBSurface *thiz, IDirectFBSurface *parent, DFBRectangle *wanted, DFBRectangle *granted, DFBInsets *insets, CoreSurface *surface, DFBSurfaceCapabilities caps, CoreDFB *core ) { DFBRectangle rect = { 0, 0, surface->config.size.w, surface->config.size.h }; DIRECT_ALLOCATE_INTERFACE_DATA(thiz, IDirectFBSurface) D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz ); data->ref = 1; data->caps = caps | surface->config.caps; data->core = core; if (dfb_surface_ref( surface )) { DIRECT_DEALLOCATE_INTERFACE(thiz); return DFB_FAILURE; } if (parent && dfb_config->startstop) { IDirectFBSurface_data *parent_data; if (parent->AddRef( parent )) { dfb_surface_unref( surface ); DIRECT_DEALLOCATE_INTERFACE(thiz); return DFB_FAILURE; } DIRECT_INTERFACE_GET_DATA_FROM( parent, parent_data, IDirectFBSurface ); pthread_mutex_lock( &parent_data->children_lock ); direct_list_append( &parent_data->children_data, &data->link ); pthread_mutex_unlock( &parent_data->children_lock ); data->parent = parent; } pthread_mutex_init( &data->children_lock, NULL ); /* The area insets */ if (insets) { data->area.insets = *insets; dfb_rectangle_subtract( &rect, insets ); } /* The area that was requested */ if (wanted) data->area.wanted = *wanted; else data->area.wanted = rect; /* The area that will never be exceeded */ if (granted) data->area.granted = *granted; else data->area.granted = data->area.wanted; /* The currently accessible rectangle */ data->area.current = data->area.granted; dfb_rectangle_intersect( &data->area.current, &rect ); /* Whether granted rectangle is meaningful */ data->limit_set = (granted != NULL); data->surface = surface; dfb_state_init( &data->state, NULL ); dfb_state_set_destination( &data->state, surface ); data->state.clip.x1 = data->area.current.x; data->state.clip.y1 = data->area.current.y; data->state.clip.x2 = data->area.current.x + (data->area.current.w ? : 1) - 1; data->state.clip.y2 = data->area.current.y + (data->area.current.h ? : 1) - 1; data->state.modified = SMF_ALL; thiz->AddRef = IDirectFBSurface_AddRef; thiz->Release = IDirectFBSurface_Release; thiz->GetCapabilities = IDirectFBSurface_GetCapabilities; thiz->GetPosition = IDirectFBSurface_GetPosition; thiz->GetSize = IDirectFBSurface_GetSize; thiz->GetVisibleRectangle = IDirectFBSurface_GetVisibleRectangle; thiz->GetPixelFormat = IDirectFBSurface_GetPixelFormat; thiz->GetAccelerationMask = IDirectFBSurface_GetAccelerationMask; thiz->GetPalette = IDirectFBSurface_GetPalette; thiz->SetPalette = IDirectFBSurface_SetPalette; thiz->SetAlphaRamp = IDirectFBSurface_SetAlphaRamp; thiz->Lock = IDirectFBSurface_Lock; thiz->GetFramebufferOffset = IDirectFBSurface_GetFramebufferOffset; thiz->Unlock = IDirectFBSurface_Unlock; thiz->Flip = IDirectFBSurface_Flip; thiz->SetField = IDirectFBSurface_SetField; thiz->Clear = IDirectFBSurface_Clear; thiz->SetClip = IDirectFBSurface_SetClip; thiz->GetClip = IDirectFBSurface_GetClip; thiz->SetColor = IDirectFBSurface_SetColor; thiz->SetColorIndex = IDirectFBSurface_SetColorIndex; thiz->SetSrcBlendFunction = IDirectFBSurface_SetSrcBlendFunction; thiz->SetDstBlendFunction = IDirectFBSurface_SetDstBlendFunction; thiz->SetPorterDuff = IDirectFBSurface_SetPorterDuff; thiz->SetSrcColorKey = IDirectFBSurface_SetSrcColorKey; thiz->SetSrcColorKeyIndex = IDirectFBSurface_SetSrcColorKeyIndex; thiz->SetDstColorKey = IDirectFBSurface_SetDstColorKey; thiz->SetDstColorKeyIndex = IDirectFBSurface_SetDstColorKeyIndex; thiz->SetIndexTranslation = IDirectFBSurface_SetIndexTranslation; thiz->SetBlittingFlags = IDirectFBSurface_SetBlittingFlags; thiz->Blit = IDirectFBSurface_Blit; thiz->TileBlit = IDirectFBSurface_TileBlit; thiz->BatchBlit = IDirectFBSurface_BatchBlit; thiz->StretchBlit = IDirectFBSurface_StretchBlit; thiz->TextureTriangles = IDirectFBSurface_TextureTriangles; thiz->SetDrawingFlags = IDirectFBSurface_SetDrawingFlags; thiz->FillRectangle = IDirectFBSurface_FillRectangle; thiz->DrawLine = IDirectFBSurface_DrawLine; thiz->DrawLines = IDirectFBSurface_DrawLines; thiz->DrawRectangle = IDirectFBSurface_DrawRectangle; thiz->FillTriangle = IDirectFBSurface_FillTriangle; thiz->FillRectangles = IDirectFBSurface_FillRectangles; thiz->FillSpans = IDirectFBSurface_FillSpans; thiz->FillTriangles = IDirectFBSurface_FillTriangles; thiz->SetFont = IDirectFBSurface_SetFont; thiz->GetFont = IDirectFBSurface_GetFont; thiz->DrawString = IDirectFBSurface_DrawString; thiz->DrawGlyph = IDirectFBSurface_DrawGlyph; thiz->SetEncoding = IDirectFBSurface_SetEncoding; thiz->GetSubSurface = IDirectFBSurface_GetSubSurface; thiz->GetGL = IDirectFBSurface_GetGL; thiz->Dump = IDirectFBSurface_Dump; thiz->DisableAcceleration = IDirectFBSurface_DisableAcceleration; thiz->ReleaseSource = IDirectFBSurface_ReleaseSource; thiz->SetRenderOptions = IDirectFBSurface_SetRenderOptions; thiz->SetMatrix = IDirectFBSurface_SetMatrix; thiz->SetSourceMask = IDirectFBSurface_SetSourceMask; thiz->MakeSubSurface = IDirectFBSurface_MakeSubSurface; thiz->Write = IDirectFBSurface_Write; thiz->Read = IDirectFBSurface_Read; dfb_surface_attach( surface, IDirectFBSurface_listener, thiz, &data->reaction ); return DFB_OK; } /* internal */ static ReactionResult IDirectFBSurface_listener( const void *msg_data, void *ctx ) { const CoreSurfaceNotification *notification = msg_data; IDirectFBSurface *thiz = ctx; IDirectFBSurface_data *data = thiz->priv; CoreSurface *surface = data->surface; D_DEBUG_AT( Surface, "%s( %p, %p )\n", __FUNCTION__, msg_data, ctx ); if (notification->flags & CSNF_DESTROY) { if (data->surface) { data->surface = NULL; dfb_surface_unref( surface ); } return RS_REMOVE; } if (notification->flags & CSNF_SIZEFORMAT) { DFBRectangle rect = { 0, 0, surface->config.size.w, surface->config.size.h }; dfb_rectangle_subtract( &rect, &data->area.insets ); if (data->limit_set) { data->area.current = data->area.granted; dfb_rectangle_intersect( &data->area.current, &rect ); } else data->area.wanted = data->area.granted = data->area.current = rect; /* Reset clip to avoid crashes caused by drawing out of bounds. */ if (data->clip_set) thiz->SetClip( thiz, &data->clip_wanted ); else thiz->SetClip( thiz, NULL ); } return RS_OK; } void IDirectFBSurface_StopAll( IDirectFBSurface_data *data ) { if (!dfb_config->startstop) return; if (data->children_data) { IDirectFBSurface_data *child; pthread_mutex_lock( &data->children_lock ); direct_list_foreach (child, data->children_data) IDirectFBSurface_StopAll( child ); pthread_mutex_unlock( &data->children_lock ); } /* Signal end of sequence of operations. */ dfb_state_lock( &data->state ); dfb_state_stop_drawing( &data->state ); dfb_state_unlock( &data->state ); } DirectFB-1.2.10/src/display/idirectfbpalette.h0000644000175000017500000000326311245562152016064 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __IDIRECTFBPALETTE_H__ #define __IDIRECTFBPALETTE_H__ #include #include /* * private data struct of IDirectFBPalette */ typedef struct { int ref; /* reference counter */ CorePalette *palette; /* the palette object */ } IDirectFBPalette_data; /* * initializes interface struct and private data */ DFBResult IDirectFBPalette_Construct( IDirectFBPalette *thiz, CorePalette *palette ); #endif DirectFB-1.2.10/src/misc/0000777000175000017500000000000011307522565011752 500000000000000DirectFB-1.2.10/src/misc/conf.c0000644000175000017500000017367611245562152013000 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include DFBConfig *dfb_config = NULL; static const char *config_usage = "DirectFB version " DIRECTFB_VERSION "\n" "\n" " --dfb-help Output DirectFB usage information and exit\n" " --dfb:

\n", "

\n", "

$title

\n", " \n"; foreach $key (sort keys %list) { print INDEX " \n"; } print INDEX "
\n", " $key\n", " \n", " $list{$key}\n", "
\n", "

\n"; } sub substitute_links ($) { local (*str) = @_; # Interface Methods $str =~ s/(I\w+)\:\:(\w+)\(\)/\\1\:\:\2\(\)\<\/a\>/g; # Automatic type links $str =~ s/(\s)([A-Z][A-Z][A-Z][A-Z]?[a-z][a-z][a-z]?[\w0-9]+)/\1\\2\<\/a\>/g; # Automatic type links $str =~ s/(\s)($PROJECT[\w0-9]+)/\1\\2\<\/a\>/g; # Explicit type links $str =~ s/(\s)\@\_(\w[\w0-9]+)/\1\\2\<\/a\>/g; } sub type_link ($) { my ($type) = @_; trim( \$type ); if (defined($type_list{$type})) { return "$type"; } elsif (defined($interfaces{$type})) { return "$type"; } return "$type"; } ######################################################################################################################## ## Generic parsers # sub parse_comment ($$$$) { local (*head, *body, *options, $inithead) = @_; local $headline_mode = 1; local $list_open = 0; $head = "\n"; $body = "\n"; if ($inithead ne "") { $headline_mode = 0; $head .= " $inithead\n"; } %options = (); while (<>) { chomp; last if /^\s*\*+\/\s*$/; # Prepend asterisk if first non-whitespace isn't an asterisk s/^\s*([^\*\s])/\* $1/; # In head line mode append to $head if ($headline_mode == 1) { if (/^\s*\*+\s*$/) { $headline_mode = 0; } elsif (/^\s*\*+\s*@(\w+)\s*=?\s*(.*)$/) { $options{$1} = $2; } elsif (/^\s*\*+\s*(.+)\*\/\s*$/) { $head .= " $1\n"; last; } elsif (/^\s*\*+\s*(.+)$/) { $head .= " $1\n"; } } else # Otherwise append to $body { if (/^\s*\*+\s*(.+)\*\/\s*$/) { $body .= " $1\n"; last; } elsif (/^\s*\*+\s*$/) { $body .= "

\n"; } elsif (/^\s*\*+\s\-\s(.+)$/) { if ($list_open == 0) { $list_open = 1; $body .= "

  • \n"; } else { $body .= "
  • \n"; } $body .= " $1\n"; } elsif (/^\s*\*+\s\s(.+)$/) { $body .= " $1\n"; } elsif (/^\s*\*+\s(.+)$/) { if ($list_open == 1) { $list_open = 0; $body .= "
\n"; } $body .= " $1\n"; } } } if ($list_open == 1) { $body .= " \n"; } substitute_links (\$head); substitute_links (\$body); } # # Reads stdin until the end of the parameter list is reached. # Returns list of parameter records. # # TODO: Add full comment support and use it for function types as well. # sub parse_params () { local @entries; while (<>) { chomp; last if /^\s*\)\;\s*$/; if ( /^\s*(const )?\s*([\w\ ]+)\s+(\**)(\w+,?)\s*$/ ) { local $const = $1; local $type = $2; local $ptr = $3; local $name = $4; local $rec = { TYPE => $const . type_link( $type ), PTR => $ptr, NAME => $name }; push (@entries, $rec); } } return @entries; } ######################################################################################################################## ## Type parsers # # # Reads stdin until the end of the interface is reached. # Writes formatted HTML to one file for the interface and one file per method. # Parameter is the interface name. # sub parse_interface ($) { local ($interface) = @_; local $section; trim( \$interface ); if (!defined ($interfaces{$interface})) { print "WARNING: Interface definition '$interface' has no declaration!\n" } html_create( INTERFACE, "$interface.html", "" . " $PROJECT Interfaces" . "", $interface, $interface ); print INTERFACE "

\n", " $headline\n", " $detailed\n", "

"; print INTERFACE "

\n", "

\n"; print INTERFACE " \n"; print INTERFACE " \n"; print INTERFACE " \n"; print INTERFACE " \n"; while (<>) { chomp; last if /^\s*\)\s*$/; if ( /^\s*\/\*\*\s*(.+)\s*\*\*\/\s*$/ ) { $section = $1; } elsif ( /^\s*(\w+)\s*\(\s*\*\s*(\w+)\s*\)\s*\(?\s*$/ ) { print INTERFACE " \n"; html_create( FUNCTION, "${interface}_$2.html", "" . " $interface" . "", $2, "$interface - $2" ); print FUNCTION "

$headline

\n", "
Methods of $interface
\n", " $section\n", " \n", " ", " $2\n", " \n", " $headline\n", "
\n", " \n"; local @params = parse_params(); local $param; for $param (@params) { print FUNCTION " \n"; } print FUNCTION " \n", "
$1 $2 (
\n", "  \n", " \n", " $param->{TYPE}\n", "  \n", " $param->{PTR}\n", " \n", " $param->{NAME}\n", "
);
\n", "

\n"; print FUNCTION "

$detailed

\n"; $headline = ""; $detailed = ""; $section = ""; html_close( FUNCTION ); } elsif ( /^\s*\/\*\s*$/ ) { parse_comment( \$headline, \$detailed, \$options, "" ); } } print INTERFACE " \n"; print INTERFACE "
\n", "

\n"; html_close( INTERFACE ); } # # Reads stdin until the end of the enum is reached. # Writes formatted HTML to "types.html". # sub parse_enum { local %entries; local @list; local $pre; while (<>) { chomp; local $entry; # entry with assignment (complete comment) if ( /^\s*(\w+)\s*=\s*([\w\d\(\)\,\|\!\s]+[^\,\s])\s*,?\s*\/\*\s*(.+)\s*\*\/\s*$/ ) { $entry = $1; $values{ $entry } = $2; $entries{ $entry } = $3; } # entry with assignment (opening comment) elsif ( /^\s*(\w+)\s*=\s*([\w\d\(\)\,\|\!\s]+[^\,\s])\s*,?\s*\/\*\s*(.+)\s*$/ ) { $entry = $1; $values{ $entry } = $2; parse_comment( \$t1, \$t2, \$opt, $3 ); $entries{ $entry } = $t1.$t2; } # entry with assignment (none or preceding comment) elsif ( /^\s*(\w+)\s*=\s*([\w\d\(\)\,\|\!\s]+[^\,\s])\s*,?\s*$/ ) { $entry = $1; $values{ $entry } = $2; $entries{ $entry } = $pre; } # entry without assignment (complete comment) elsif ( /^\s*(\w+)\s*,?\s*\/\*\s*(.+)\s*\*\/\s*$/ ) { $entry = $1; $entries{ $entry } = $2; } # entry without assignment (opening comment) elsif ( /^\s*(\w+)\s*,?\s*\/\*\s*(.+)\s*$/ ) { $entry = $1; parse_comment( \$t1, \$t2, \$opt, $2 ); $entries{ $entry } = $t1.$t2; } # entry without assignment (none or preceding comment) elsif ( /^\s*(\w+)\s*,?\s*$/ ) { $entry = $1; $entries{ $entry } = $pre; } # preceding comment (complete) elsif ( /^\s*\/\*\s*(.+)\s*\*\/\s*$/ ) { $pre = $1; } # preceding comment (opening) elsif ( /^\s*\/\*\s*(.+)\s*$/ ) { parse_comment( \$t1, \$t2, \$opt, $1 ); $pre = $t1.$t2; } # end of enum elsif ( /^\s*\}\s*(\w+)\s*\;\s*$/ ) { $enum = $1; trim( \$enum ); $enum_list{$enum} = $headline; $type_list{$enum} = $headline; last; } # blank line? else { $pre = ""; } if ($entry ne "") { push (@list, $entry); } } if (scalar @list > 0) { print TYPES "

\n", " \n", "

$enum

\n", " \n", "

$headline

\n", " \n"; foreach $key (@list) { substitute_links (\$entries{$key}); print TYPES " \n"; } print TYPES "
 \n", " $key\n", "  \n", " $values{$key}\n", "  \n", " $entries{$key}\n", "
\n", "

\n", " $detailed\n", "


\n"; } } # # Reads stdin until the end of the enum is reached. # Writes formatted HTML to "types.html". # sub parse_struct { local @entries; local %entries_params; local %entries_types; local %entries_ptrs; while (<>) { chomp; local $entry; # without comment if ( /^\s*(const )?\s*([\w ]+)\s+(\**)([\w\d\+\[\]]+)(\s*:\s*\d+)?;\s*$/ ) { $const = $1; $type = $2; $ptr = $3; $entry = $4.$5; $text = ""; } # complete one line entry elsif ( /^\s*(const )?\s*([\w ]+)\s+(\**)([\w\d\+\[\]]+)(\s*:\s*\d+)?;\s*\/\*\s*(.+)\*\/\s*$/ ) { $const = $1; $type = $2; $ptr = $3; $entry = $4.$5; $text = $6; } # with comment opening elsif ( /^\s*(const )?\s*([\w ]+)\s+(\**)([\w\d\+\[\]]+)(\s*:\s*\d+)?;\s*\/\*\s*(.+)\s*$/ ) { $const = $1; $type = $2; $ptr = $3; $entry = $4.$5; parse_comment( \$t1, \$t2, \$opt, $6 ); $text = $t1.$t2; } elsif ( /^\s*\}\s*(\w+)\s*\;\s*$/ ) { $struct = $1; trim( \$struct ); $struct_list{$struct} = $headline; $type_list{$struct} = $headline; last; } if ($entry ne "") { # TODO: Use structure $entries_types{$entry} = $const . type_link( $type ); $entries_ptrs{$entry} = $ptr; $entries_params{$entry} = $text; push (@entries, $entry); } } if (scalar @entries > 0) { print TYPES "

", " \n", "

$struct

\n", " \n", "

$headline

\n", " \n"; foreach $key (@entries) { substitute_links (\$entries_params{$key}); print TYPES " \n"; } print TYPES "
 \n", " $entries_types{$key}\n", "  \n", " $entries_ptrs{$key}\n", " \n", " $key\n", "  \n", " $entries_params{$key}\n", "
\n", "

\n", " $detailed\n", "


\n"; } } # # Reads stdin until the end of the function type is reached. # Writes formatted HTML to "types.html". # Parameters are the return type and function type name. # sub parse_func ($$) { local ($rtype, $name) = @_; local @entries; local %entries_params; local %entries_types; local %entries_ptrs; trim( \$rtype ); trim( \$name ); while (<>) { chomp; local $entry; # without comment if ( /^\s*(const )?\s*([\w ]+)\s+(\**)([\w\d\+\[\]]+)(\s*:\s*\d+)?,?\s*$/ ) { $const = $1; $type = $2; $ptr = $3; $entry = $4.$5; $text = ""; } # complete one line entry elsif ( /^\s*(const )?\s*([\w ]+)\s+(\**)([\w\d\+\[\]]+)(\s*:\s*\d+)?,?\s*\/\*\s*(.+)\*\/\s*$/ ) { $const = $1; $type = $2; $ptr = $3; $entry = $4.$5; $text = $6; } # with comment opening elsif ( /^\s*(const )?\s*([\w ]+)\s+(\**)([\w\d\+\[\]]+)(\s*:\s*\d+)?,?\s*\/\*\s*(.+)\s*$/ ) { $const = $1; $type = $2; $ptr = $3; $entry = $4.$5; parse_comment( \$t1, \$t2, \$opt, $6 ); $text = $t1.$t2; } elsif ( /^\s*\)\;\s*$/ ) { $func_list{$name} = $headline; $type_list{$name} = $headline; last; } if ($entry ne "") { # TODO: Use structure $entries_types{$entry} = $const . type_link( $type ); $entries_ptrs{$entry} = $ptr; $entries_params{$entry} = $text; push (@entries, $entry); } } $rtype = type_link( $rtype ); if (scalar @entries > 0) { print TYPES "

", " \n", "

$name

\n", " \n", "

$headline

\n", " \n", " \n"; foreach $key (@entries) { print TYPES " \n"; } print TYPES " \n", "
\n", " $rtype (*$name) (\n", "
\n", "  \n", " \n", " $entries_types{$key}\n", "  \n", " $entries_ptrs{$key}\n", " \n", " $key\n", "  \n", " $entries_params{$key}\n", "
);
\n", "

\n", " $detailed\n", "


\n"; } } # # Reads stdin until the end of the macro is reached. # Writes formatted HTML to "types.html". # Parameters are the macro name, parameters and value. # sub parse_macro ($$$) { local ($macro, $params, $value) = @_; trim( \$macro ); trim( \$params ); trim( \$value ); while (<>) { chomp; last unless /\\$/; } if (!defined ($options{"internal"}) && $value ne "") { $macro_list{$macro} = $headline; $type_list{$macro} = $headline; $value =~ s/^\s*\\\s*$//; print TYPES "

\n", " \n", "

\n", " $macro\n", " $params\n", "

\n", " \n", "

$headline

\n", " $value\n", "

\n", " $detailed\n", "


\n"; } } ######################################################################################################################## ## HTML Files # sub html_create ($$$$$) { local ($FILE, $filename, $title, $subtitle, $singletitle) = @_; open( $FILE, ">$filename" ) or die ("*** Can not open '$filename' for writing:\n*** $!"); print $FILE "\n", "\n", "\n", "\n", " $singletitle [$PROJECT Reference Manual]\n", "\n", "\n", "\n", "\n", " \n", " \n", "
\n", " \n", " \n", "   ", " Reference Manual - $VERSION\n", "
\n"; if ($subtitle) { print $FILE " \n", " \n", "
\n", " $title \n", " \n", "  $subtitle\n", "
\n"; } else { print $FILE " $title\n"; } print $FILE "
\n", "\n"; } sub html_close ($) { local ($FILE) = @_; print $FILE "\n", "\n", " \n", "
\n", " ", " \"Creative", " ", " \n", " This work is licensed under a", " ", " Creative Commons Attribution-Share Alike 3.0 License", "
\n", "\n", "\n"; close( $FILE ); } ######################################################################################################################## ## Main Function # sub gen_doc ($$) { local ($project, $version) = @_; trim( \$project ); trim( \$version ); html_create( INDEX, "index.html", "$PROJECT Reference", "API Overview", "Index" ); html_create( TYPES, "types.html", "$PROJECT Reference", "Type Definitions", "Types" ); print INDEX "

\n", "

\n", "

Interfaces

\n", " \n"; while (<>) { chomp; if ( /^\s*DECLARE_INTERFACE\s*\(\s*(\w+)\s\)\s*$/ ) { $interface = $1; trim( \$interface ); if (!defined ($interfaces{$interface})) { print INDEX " \n"; $interfaces{$interface} = "$headline $detailed"; } } elsif ( /^\s*DEFINE_INTERFACE\s*\(\s*(\w+),\s*$/ ) { parse_interface( $1 ); } elsif ( /^\s*typedef\s+enum\s*\{?\s*$/ ) { parse_enum(); } elsif ( /^\s*typedef\s+(struct|union)\s*\{?\s*$/ ) { parse_struct(); } elsif ( /^\s*typedef\s+(\w+)\s+\(\*(\w+)\)\s*\(\s*$/ ) { parse_func( $1, $2 ); } elsif ( /^\s*#define\s+([^\(\s]+)(\([^\)]*\))?\s*(.*)/ ) { parse_macro( $1, $2, $3 ); } elsif ( /^\s*\/\*\s*$/ ) { parse_comment( \$headline, \$detailed, \$options, "" ); } else { $headline = ""; $detailed = ""; %options = (); } } print INDEX "
\n", " $1\n", " \n", " $headline $detailed\n", "
\n", "

\n"; print_list( \%func_list, "Function Types" ); print_list( \%enum_list, "Enumerated Types" ); print_list( \%struct_list, "Structured Types" ); print_list( \%macro_list, "Definitions" ); html_close( INDEX ); html_close( TYPES ); } DirectFB-1.2.10/tools/dfbdump.c0000644000175000017500000006316111245562152013075 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static DirectFBPixelFormatNames( format_names ); /**********************************************************************************************************************/ typedef struct { int video; int system; int presys; } MemoryUsage; /**********************************************************************************************************************/ static IDirectFB *dfb; static MemoryUsage mem; static bool show_shm; static bool show_pools; static bool show_allocs; static int dump_layer; /* ref or -1 (all) or 0 (none) */ static int dump_surface; /* ref or -1 (all) or 0 (none) */ /**********************************************************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ); /**********************************************************************************************************************/ static inline int buffer_size( CoreSurface *surface, CoreSurfaceBuffer *buffer, bool video ) { int i, mem = 0; CoreSurfaceAllocation *allocation; fusion_vector_foreach (allocation, i, buffer->allocs) { int size = allocation->size; if (allocation->flags & CSALF_ONEFORALL) size /= surface->num_buffers; if (video) { if (allocation->access & (CSAF_GPU_READ | CSAF_GPU_WRITE)) mem += size; } else if (!(allocation->access & (CSAF_GPU_READ | CSAF_GPU_WRITE))) mem += size; } return mem; } static int buffer_sizes( CoreSurface *surface, bool video ) { int i, mem = 0; for (i=0; inum_buffers; i++) { CoreSurfaceBuffer *buffer = surface->buffers[i]; mem += buffer_size( surface, buffer, video ); } return mem; } static int buffer_locks( CoreSurface *surface, bool video ) { int i, locks = 0; for (i=0; inum_buffers; i++) { CoreSurfaceBuffer *buffer = surface->buffers[i]; locks += buffer->locked; } return locks; } static bool surface_callback( FusionObjectPool *pool, FusionObject *object, void *ctx ) { DirectResult ret; int i; int refs; CoreSurface *surface = (CoreSurface*) object; MemoryUsage *mem = ctx; int vmem; int smem; if (object->state != FOS_ACTIVE) return true; ret = fusion_ref_stat( &object->ref, &refs ); if (ret) { printf( "Fusion error %d!\n", ret ); return false; } if (dump_surface && ((dump_surface < 0 && surface->type & CSTF_SHARED) || (dump_surface == object->ref.multi.id)) && surface->num_buffers) { char buf[32]; snprintf( buf, sizeof(buf), "dfb_surface_0x%08x", object->ref.multi.id ); dfb_surface_dump_buffer( surface, CSBR_FRONT, ".", buf ); } #if FUSION_BUILD_MULTI printf( "0x%08x [%3lx] : ", object->ref.multi.id, object->ref.multi.creator ); #else printf( "N/A : " ); #endif printf( "%3d ", refs ); printf( "%4d x %4d ", surface->config.size.w, surface->config.size.h ); for (i=0; format_names[i].format; i++) { if (surface->config.format == format_names[i].format) printf( "%8s ", format_names[i].name ); } vmem = buffer_sizes( surface, true ); smem = buffer_sizes( surface, false ); mem->video += vmem; /* FIXME: assumes all buffers have this flag (or none) */ /*if (surface->front_buffer->flags & SBF_FOREIGN_SYSTEM) mem->presys += smem; else*/ mem->system += smem; if (vmem && vmem < 1024) vmem = 1024; if (smem && smem < 1024) smem = 1024; printf( "%5dk%c ", vmem >> 10, buffer_locks( surface, true ) ? '*' : ' ' ); printf( "%5dk%c ", smem >> 10, buffer_locks( surface, false ) ? '*' : ' ' ); /* FIXME: assumes all buffers have this flag (or none) */ // if (surface->front_buffer->flags & SBF_FOREIGN_SYSTEM) // printf( "preallocated " ); if (surface->config.caps & DSCAPS_SYSTEMONLY) printf( "system only " ); if (surface->config.caps & DSCAPS_VIDEOONLY) printf( "video only " ); if (surface->config.caps & DSCAPS_INTERLACED) printf( "interlaced " ); if (surface->config.caps & DSCAPS_DOUBLE) printf( "double " ); if (surface->config.caps & DSCAPS_TRIPLE) printf( "triple " ); if (surface->config.caps & DSCAPS_PREMULTIPLIED) printf( "premultiplied" ); printf( "\n" ); return true; } static void dump_surfaces( void ) { printf( "\n" "-----------------------------[ Surfaces ]-------------------------------------\n" ); printf( "Reference FID . Refs Width Height Format Video System Capabilities\n" ); printf( "------------------------------------------------------------------------------\n" ); dfb_core_enum_surfaces( NULL, surface_callback, &mem ); printf( " ------ ------\n" ); printf( " %6dk %6dk -> %dk total\n", mem.video >> 10, (mem.system + mem.presys) >> 10, (mem.video + mem.system + mem.presys) >> 10); } /**********************************************************************************************************************/ static DFBEnumerationResult alloc_callback( CoreSurfaceAllocation *alloc, void *ctx ) { int i, index; CoreSurface *surface; CoreSurfaceBuffer *buffer; D_MAGIC_ASSERT( alloc, CoreSurfaceAllocation ); buffer = alloc->buffer; D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); surface = buffer->surface; D_MAGIC_ASSERT( surface, CoreSurface ); printf( "%9lu %8d ", alloc->offset, alloc->size ); printf( "%4d x %4d ", surface->config.size.w, surface->config.size.h ); for (i=0; format_names[i].format; i++) { if (surface->config.format == format_names[i].format) printf( "%8s ", format_names[i].name ); } index = dfb_surface_buffer_index( alloc->buffer ); printf( " %-5s ", (dfb_surface_get_buffer( surface, CSBR_FRONT ) == buffer) ? "front" : (dfb_surface_get_buffer( surface, CSBR_BACK ) == buffer) ? "back" : (dfb_surface_get_buffer( surface, CSBR_IDLE ) == buffer) ? "idle" : "" ); printf( direct_serial_check(&alloc->serial, &buffer->serial) ? " * " : " " ); printf( "%d %2lu ", fusion_vector_size( &buffer->allocs ), surface->resource_id ); if (surface->type & CSTF_SHARED) printf( "SHARED " ); else printf( "PRIVATE " ); if (surface->type & CSTF_LAYER) printf( "LAYER " ); if (surface->type & CSTF_WINDOW) printf( "WINDOW " ); if (surface->type & CSTF_CURSOR) printf( "CURSOR " ); if (surface->type & CSTF_FONT) printf( "FONT " ); printf( " " ); if (surface->type & CSTF_INTERNAL) printf( "INTERNAL " ); if (surface->type & CSTF_EXTERNAL) printf( "EXTERNAL " ); printf( " " ); if (surface->config.caps & DSCAPS_SYSTEMONLY) printf( "system only " ); if (surface->config.caps & DSCAPS_VIDEOONLY) printf( "video only " ); if (surface->config.caps & DSCAPS_INTERLACED) printf( "interlaced " ); if (surface->config.caps & DSCAPS_DOUBLE) printf( "double " ); if (surface->config.caps & DSCAPS_TRIPLE) printf( "triple " ); if (surface->config.caps & DSCAPS_PREMULTIPLIED) printf( "premultiplied" ); printf( "\n" ); return DFENUM_OK; } static DFBEnumerationResult surface_pool_callback( CoreSurfacePool *pool, void *ctx ) { int length; printf( "\n" ); printf( "--------------------[ Surface Buffer Allocations in %s ]-------------------%n\n", pool->desc.name, &length ); printf( "Offset Length Width Height Format Role Up nA ID Usage Type / Storage / Caps\n" ); while (length--) putc( '-', stdout ); printf( "\n" ); dfb_surface_pool_enumerate( pool, alloc_callback, NULL ); return DFENUM_OK; } static void dump_surface_pools( void ) { dfb_surface_pools_enumerate( surface_pool_callback, NULL ); } /**********************************************************************************************************************/ static DFBEnumerationResult surface_pool_info_callback( CoreSurfacePool *pool, void *ctx ) { int i; unsigned long total = 0; CoreSurfaceAllocation *alloc; fusion_vector_foreach (alloc, i, pool->allocs) total += alloc->size; printf( "%-20s ", pool->desc.name ); switch (pool->desc.priority) { case CSPP_DEFAULT: printf( "DEFAULT " ); break; case CSPP_PREFERED: printf( "PREFERED " ); break; case CSPP_ULTIMATE: printf( "ULTIMATE " ); break; default: printf( "unknown " ); break; } printf( " %c %c %c %c %c ", (pool->desc.access & CSAF_CPU_READ) ? '*' : ' ', (pool->desc.access & CSAF_CPU_WRITE) ? '*' : ' ', (pool->desc.access & CSAF_GPU_READ) ? '*' : ' ', (pool->desc.access & CSAF_GPU_WRITE) ? '*' : ' ', (pool->desc.access & CSAF_SHARED) ? '*' : ' ' ); printf( "%6lu/%6luk ", total / 1024, pool->desc.size / 1024 ); if (pool->desc.types & CSTF_SHARED) printf( "SHARED " ); else printf( " " ); if (pool->desc.types & CSTF_INTERNAL) printf( "INTERNAL " ); if (pool->desc.types & CSTF_EXTERNAL) printf( "EXTERNAL " ); if (!(pool->desc.types & (CSTF_INTERNAL | CSTF_EXTERNAL))) printf( " " ); if (pool->desc.types & CSTF_LAYER) printf( "LAYER " ); if (pool->desc.types & CSTF_WINDOW) printf( "WINDOW " ); if (pool->desc.types & CSTF_CURSOR) printf( "CURSOR " ); if (pool->desc.types & CSTF_FONT) printf( "FONT " ); printf( "\n" ); return DFENUM_OK; } static void dump_surface_pool_info( void ) { printf( "\n" ); printf( "-------------------------------------[ Surface Buffer Pools ]------------------------------------\n" ); printf( "Name Priority CrCw GrGw Sh Used/Capacity Usage Storage Resource Types\n" ); printf( "-------------------------------------------------------------------------------------------------\n" ); dfb_surface_pools_enumerate( surface_pool_info_callback, NULL ); } /**********************************************************************************************************************/ static bool context_callback( FusionObjectPool *pool, FusionObject *object, void *ctx ) { DirectResult ret; int i; int refs; int level; CoreLayer *layer = (CoreLayer*) ctx; CoreLayerContext *context = (CoreLayerContext*) object; CoreLayerRegion *region = NULL; CoreSurface *surface = NULL; if (object->state != FOS_ACTIVE) return true; if (context->layer_id != dfb_layer_id( layer )) return true; ret = fusion_ref_stat( &object->ref, &refs ); if (ret) { printf( "Fusion error %d!\n", ret ); return false; } if (dump_layer && (dump_layer < 0 || dump_layer == object->ref.multi.id)) { if (dfb_layer_context_get_primary_region( context, false, ®ion ) == DFB_OK) { if (dfb_layer_region_get_surface( region, &surface ) == DFB_OK) { if (surface->num_buffers) { char buf[32]; snprintf( buf, sizeof(buf), "dfb_layer_context_0x%08x", object->ref.multi.id ); dfb_surface_dump_buffer( surface, CSBR_FRONT, ".", buf ); } dfb_surface_unref( surface ); } } } #if FUSION_BUILD_MULTI printf( "0x%08x [%3lx] : ", object->ref.multi.id, object->ref.multi.creator ); #else printf( "N/A : " ); #endif printf( "%3d ", refs ); printf( "%4d x %4d ", context->config.width, context->config.height ); for (i=0; format_names[i].format; i++) { if (context->config.pixelformat == format_names[i].format) { printf( "%-8s ", format_names[i].name ); break; } } if (!format_names[i].format) printf( "unknown " ); printf( "%.1f, %.1f -> %.1f, %.1f ", context->screen.location.x, context->screen.location.y, context->screen.location.x + context->screen.location.w, context->screen.location.y + context->screen.location.h ); printf( "%2d ", fusion_vector_size( &context->regions ) ); printf( context->active ? "(*) " : " " ); if (context == layer->shared->contexts.primary) printf( "SHARED " ); else printf( "PRIVATE " ); if (dfb_layer_get_level( layer, &level )) printf( "N/A" ); else printf( "%3d", level ); printf( "\n" ); return true; } static void dump_contexts( CoreLayer *layer ) { if (fusion_vector_size( &layer->shared->contexts.stack ) == 0) return; printf( "\n" "----------------------------------[ Contexts of Layer %d ]----------------------------------------\n", dfb_layer_id( layer )); printf( "Reference FID . Refs Width Height Format Location on screen Regions Active Info Level\n" ); printf( "-------------------------------------------------------------------------------------------------\n" ); dfb_core_enum_layer_contexts( NULL, context_callback, layer ); } static DFBEnumerationResult window_callback( CoreWindow *window, void *ctx ) { DirectResult ret; int refs; CoreWindowConfig *config = &window->config; DFBRectangle *bounds = &config->bounds; ret = fusion_ref_stat( &window->object.ref, &refs ); if (ret) { printf( "Fusion error %d!\n", ret ); return DFENUM_OK; } #if FUSION_BUILD_MULTI printf( "0x%08x [%3lx] : ", window->object.ref.multi.id, window->object.ref.multi.creator ); #else printf( "N/A : " ); #endif printf( "%3d ", refs ); printf( "%4d, %4d ", bounds->x, bounds->y ); printf( "%4d x %4d ", bounds->w, bounds->h ); printf( "0x%02x ", config->opacity ); printf( "%5d ", window->id ); switch (config->stacking) { case DWSC_UPPER: printf( "^ " ); break; case DWSC_MIDDLE: printf( "- " ); break; case DWSC_LOWER: printf( "v " ); break; default: printf( "? " ); break; } if (window->caps & DWCAPS_ALPHACHANNEL) printf( "alphachannel " ); if (window->caps & DWCAPS_INPUTONLY) printf( "input only " ); if (window->caps & DWCAPS_DOUBLEBUFFER) printf( "double buffer " ); if (config->options & DWOP_GHOST) printf( "GHOST " ); if (DFB_WINDOW_FOCUSED( window )) printf( "FOCUSED " ); if (DFB_WINDOW_DESTROYED( window )) printf( "DESTROYED " ); printf( "\n" ); return DFENUM_OK; } static void dump_windows( CoreLayer *layer ) { DFBResult ret; CoreLayerShared *shared; CoreLayerContext *context; CoreWindowStack *stack; shared = layer->shared; ret = fusion_skirmish_prevail( &shared->lock ); if (ret) { D_DERROR( ret, "DirectFB/Dump: Could not lock the shared layer data!\n" ); return; } context = layer->shared->contexts.primary; if (!context) { fusion_skirmish_dismiss( &shared->lock ); return; } stack = dfb_layer_context_windowstack( context ); if (!stack) { fusion_skirmish_dismiss( &shared->lock ); return; } dfb_windowstack_lock( stack ); if (stack->num) { printf( "\n" "-----------------------------------[ Windows of Layer %d ]-----------------------------------------\n", dfb_layer_id( layer ) ); printf( "Reference FID . Refs X Y Width Height Opacity ID Capabilities State & Options\n" ); printf( "--------------------------------------------------------------------------------------------------\n" ); dfb_wm_enum_windows( stack, window_callback, NULL ); } dfb_windowstack_unlock( stack ); fusion_skirmish_dismiss( &shared->lock ); } static DFBEnumerationResult layer_callback( CoreLayer *layer, void *ctx) { dump_windows( layer ); dump_contexts( layer ); return DFENUM_OK; } static void dump_layers( void ) { dfb_layers_enumerate( layer_callback, NULL ); } /**********************************************************************************************************************/ #if FUSION_BUILD_MULTI static DirectEnumerationResult dump_shmpool( FusionSHMPool *pool, void *ctx ) { DFBResult ret; SHMemDesc *desc; unsigned int total = 0; int length; FusionSHMPoolShared *shared = pool->shared; printf( "\n" ); printf( "----------------------------[ Shared Memory in %s ]----------------------------%n\n", shared->name, &length ); printf( " Size Address Offset Function FusionID\n" ); while (length--) putc( '-', stdout ); putc( '\n', stdout ); ret = fusion_skirmish_prevail( &shared->lock ); if (ret) { D_DERROR( ret, "Could not lock shared memory pool!\n" ); return DFENUM_OK; } if (shared->allocs) { direct_list_foreach (desc, shared->allocs) { printf( " %9zu bytes at %p [%8lu] in %-30s [%3lx] (%s: %u)\n", desc->bytes, desc->mem, (ulong)desc->mem - (ulong)shared->heap, desc->func, desc->fid, desc->file, desc->line ); total += desc->bytes; } printf( " -------\n %7dk total\n", total >> 10 ); } printf( "\nShared memory file size: %dk\n", shared->heap->size >> 10 ); fusion_skirmish_dismiss( &shared->lock ); return DFENUM_OK; } static void dump_shmpools( void ) { fusion_shm_enum_pools( dfb_core_world(NULL), dump_shmpool, NULL ); } #endif /**********************************************************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; long long millis; long int seconds, minutes, hours, days; char *buffer = malloc( 0x100000 ); setvbuf( stdout, buffer, _IOFBF, 0x100000 ); /* Initialize DirectFB. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { DirectFBError( "DirectFBCreate", ret ); return -3; } millis = direct_clock_get_millis(); seconds = millis / 1000; millis %= 1000; minutes = seconds / 60; seconds %= 60; hours = minutes / 60; minutes %= 60; days = hours / 24; hours %= 24; switch (days) { case 0: printf( "\nDirectFB uptime: %02ld:%02ld:%02ld\n", hours, minutes, seconds ); break; case 1: printf( "\nDirectFB uptime: %ld day, %02ld:%02ld:%02ld\n", days, hours, minutes, seconds ); break; default: printf( "\nDirectFB uptime: %ld days, %02ld:%02ld:%02ld\n", days, hours, minutes, seconds ); break; } dump_surfaces(); dump_layers(); #if FUSION_BUILD_MULTI if (show_shm) { printf( "\n" ); dump_shmpools(); } #endif if (show_pools) { printf( "\n" ); dump_surface_pool_info(); } if (show_allocs) { printf( "\n" ); dump_surface_pools(); } printf( "\n" ); /* DirectFB deinitialization. */ if (dfb) dfb->Release( dfb ); return ret; } /**********************************************************************************************************************/ static void print_usage (const char *prg_name) { fprintf (stderr, "\nDirectFB Dump (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options]\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -s, --shm Show shared memory pool content (if debug enabled)\n"); fprintf (stderr, " -p, --pools Show information about surface pools\n"); fprintf (stderr, " -a, --allocs Show surface buffer allocations in surface pools\n"); fprintf (stderr, " -dl, --dumplayer Dump surfaces of layer contexts into files (dfb_layer_context_REFID...)\n"); fprintf (stderr, " -ds, --dumpsurface Dump surfaces (front buffers) into files (dfb_surface_REFID...)\n"); fprintf (stderr, " -h, --help Show this help message\n"); fprintf (stderr, " -v, --version Print version information\n"); fprintf (stderr, "\n"); } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; for (n = 1; n < argc; n++) { const char *arg = argv[n]; if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) { print_usage (argv[0]); return DFB_FALSE; } if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) { fprintf (stderr, "dfbdump version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } if (strcmp (arg, "-s") == 0 || strcmp (arg, "--shm") == 0) { show_shm = true; continue; } if (strcmp (arg, "-p") == 0 || strcmp (arg, "--pools") == 0) { show_pools = true; continue; } if (strcmp (arg, "-a") == 0 || strcmp (arg, "--allocs") == 0) { show_allocs = true; continue; } if (strcmp (arg, "-dl") == 0 || strcmp (arg, "--dumplayer") == 0) { dump_layer = -1; continue; } if (strcmp (arg, "-ds") == 0 || strcmp (arg, "--dumpsurface") == 0) { dump_surface = -1; continue; } print_usage (argv[0]); return DFB_FALSE; } return DFB_TRUE; } DirectFB-1.2.10/tools/raw16toraw24.c0000644000175000017500000000406611245562152013636 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include int main( void ) { unsigned char byt; unsigned short wrd; do { fread (&wrd, 2, 1, stdin); #ifdef WORDS_BIGENDIAN swab (&wrd, &wrd, 2); #endif byt = (wrd & 0xf800) >> 8; fwrite (&byt, 1, 1, stdout); byt = (wrd & 0x07E0) >> 3; fwrite (&byt, 1, 1, stdout); byt = (wrd & 0x001F) << 3; fwrite (&byt, 1, 1, stdout); } while (!feof (stdin)); return 0; } DirectFB-1.2.10/tools/dfbg.c0000644000175000017500000002076311245562152012357 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include /*****************************************************************************/ static IDirectFB *dfb = NULL; static IDirectFBDisplayLayer *layer = NULL; static const char *filename = NULL; static DFBBoolean color = DFB_FALSE; static DFBBoolean tiled = DFB_FALSE; /*****************************************************************************/ static DFBBoolean parse_command_line ( int argc, char *argv[] ); static void set_background_color ( void ); static void set_background_image ( void ); /*****************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; DirectFBSetOption( "bg-none", NULL ); DirectFBSetOption( "no-cursor", NULL ); /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { DirectFBError( "DirectFBCreate() failed", ret ); return -3; } /* Get the primary display layer. */ ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer ); if (ret) { DirectFBError( "IDirectFB::GetDisplayLayer() failed", ret ); dfb->Release( dfb ); return -4; } /* Acquire administrative cooperative level. */ ret = layer->SetCooperativeLevel( layer, DLSCL_ADMINISTRATIVE ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret ); layer->Release( layer ); dfb->Release( dfb ); return -5; } /* Set the background according to the users wishes. */ if (color) set_background_color(); else set_background_image(); /* Release the display layer. */ layer->Release( layer ); /* Release the super interface. */ dfb->Release( dfb ); return EXIT_SUCCESS; } /*****************************************************************************/ static void print_usage (const char *prg_name) { fprintf (stderr, "\nDirectFB Desktop Background Configuration (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options] |\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -c, --color Set in AARRGGBB format (hexadecimal).\n"); fprintf (stderr, " -t, --tile Set tiled mode.\n"); fprintf (stderr, " -h, --help Show this help message\n"); fprintf (stderr, " -v, --version Print version information\n"); fprintf (stderr, "\n"); } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; for (n = 1; n < argc; n++) { const char *a = argv[n]; if (*a != '-') { if (!filename) { filename = a; continue; } else { print_usage (argv[0]); return DFB_FALSE; } } if (strcmp (a, "-h") == 0 || strcmp (a, "--help") == 0) { print_usage (argv[0]); return DFB_FALSE; } if (strcmp (a, "-v") == 0 || strcmp (a, "--version") == 0) { fprintf (stderr, "dfbg version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } if (strcmp (a, "-c") == 0 || strcmp (a, "--color") == 0) { color = DFB_TRUE; continue; } if (strcmp (a, "-t") == 0 || strcmp (a, "--tile") == 0) { tiled = DFB_TRUE; continue; } } if (!filename) { print_usage (argv[0]); return DFB_FALSE; } return DFB_TRUE; } static void set_background_color( void ) { DFBResult ret; char *error; u32 argb; if (*filename == '#') filename++; argb = strtoul( filename, &error, 16 ); if (*error) { fprintf( stderr, "Invalid characters in color string: '%s'\n", error ); return; } ret = layer->SetBackgroundColor( layer, (argb & 0xFF0000) >> 16, (argb & 0xFF00) >> 8, (argb & 0xFF) >> 0, (argb & 0xFF000000) >> 24 ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::SetBackgroundColor() failed", ret ); return; } ret = layer->SetBackgroundMode( layer, DLBM_COLOR ); if (ret) DirectFBError( "IDirectFBDisplayLayer::SetBackgroundMode() failed", ret ); } static void set_background_image( void ) { DFBResult ret; DFBSurfaceDescription desc; IDirectFBSurface *surface; IDirectFBImageProvider *provider; ret = dfb->CreateImageProvider( dfb, filename, &provider ); if (ret) { DirectFBError( "IDirectFB::CreateImageProvider() failed", ret ); return; } ret = provider->GetSurfaceDescription( provider, &desc ); if (ret) { DirectFBError( "IDirectFBImageProvider::GetSurfaceDescription() failed", ret ); provider->Release( provider ); return; } desc.flags |= DSDESC_CAPS; desc.caps = DSCAPS_SHARED; if (!tiled) { DFBDisplayLayerConfig config; ret = layer->GetConfiguration( layer, &config ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::GetConfiguration() failed", ret ); provider->Release( provider ); return; } desc.width = config.width; desc.height = config.height; } ret = dfb->CreateSurface( dfb, &desc, &surface ); if (ret) { DirectFBError( "IDirectFB::CreateSurface() failed", ret ); provider->Release( provider ); return; } ret = provider->RenderTo( provider, surface, NULL ); if (ret) { DirectFBError( "IDirectFBImageProvider::RenderTo() failed", ret ); surface->Release( surface ); provider->Release( provider ); return; } ret = layer->SetBackgroundImage( layer, surface ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::SetBackgroundImage() failed", ret ); surface->Release( surface ); provider->Release( provider ); return; } ret = layer->SetBackgroundMode( layer, tiled ? DLBM_TILE : DLBM_IMAGE ); if (ret) DirectFBError( "IDirectFBDisplayLayer::SetBackgroundMode() failed", ret ); surface->Release( surface ); provider->Release( provider ); } DirectFB-1.2.10/tools/Makefile.am0000644000175000017500000000504011245562152013334 00000000000000## Makefile.am for DirectFB/tools INCLUDES = \ -I$(top_builddir)/lib \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src AM_CPPFLAGS = -DDATADIR=\"@DATADIR@\" AM_CFLAGS = $(FREETYPE_CFLAGS) if BUILD_DIRECTFB_CSOURCE DFB_CSOURCE = directfb-csource directfb_csource_SOURCES = directfb-csource.c directfb_csource_LDADD = $(LIBPNG) endif if HAVE_LINUX LINUXONLY_TOOLS = \ fusion_bench \ raw15toraw24 \ raw16toraw24 \ raw32toraw24 endif if ENABLE_VOODOO VOODOO_PROGS = dfbproxy endif if PNG_PROVIDER PNG_PROGS = mkdfiff endif if FREETYPE_PROVIDER FREETYPE_PROGS = mkdgiff endif bin_PROGRAMS = $(DFB_CSOURCE) \ dfbdump dfbfx dfbg dfbinfo dfbinput dfbinspector dfblayer \ dfbmaster dfbscreen dfbpenmount $(PNG_PROGS) $(FREETYPE_PROGS) $(VOODOO_PROGS) noinst_PROGRAMS = $(LINUXONLY_TOOLS) libdirectfb = ../src/libdirectfb.la libfusion = ../lib/fusion/libfusion.la libdirect = ../lib/direct/libdirect.la libvoodoo = ../lib/voodoo/libvoodoo.la dfbdump_SOURCES = dfbdump.c dfbdump_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbg_SOURCES = dfbg.c dfbg_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbinfo_SOURCES = dfbinfo.c dfbinfo_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbinput_SOURCES = dfbinput.c dfbinput_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbinspector_SOURCES = dfbinspector.c dfbinspector_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfblayer_SOURCES = dfblayer.c dfblayer_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbmaster_SOURCES = dfbmaster.c dfbmaster_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbproxy_SOURCES = dfbproxy.c dfbproxy_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(libvoodoo) dfbscreen_SOURCES = dfbscreen.c dfbscreen_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) #dfbsummon_SOURCES = dfbsummon.c #dfbsummon_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbpenmount_SOURCES = dfbpenmount.c dfbpenmount_LDADD = $(libdirectfb) $(libfusion) $(libdirect) mkdfiff_SOURCES = mkdfiff.c mkdfiff_LDADD = $(LIBPNG) $(libdirect) mkdgiff_SOURCES = mkdgiff.c mkdgiff_LDADD = $(FREETYPE_LIBS) $(libdirect) fusion_bench_SOURCES = fusion_bench.c fusion_bench_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbfx_SOURCES = dfbfx.c dfbfx_LDADD = $(libdirect) raw15toraw24_SOURCES = raw15toraw24.c raw16toraw24_SOURCES = raw16toraw24.c raw32toraw24_SOURCES = raw32toraw24.c EXTRA_DIST = \ README \ gendoc.pl \ mknames.sh DirectFB-1.2.10/tools/Makefile.in0000644000175000017500000006511311307521507013352 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = $(am__EXEEXT_1) dfbdump$(EXEEXT) dfbfx$(EXEEXT) \ dfbg$(EXEEXT) dfbinfo$(EXEEXT) dfbinput$(EXEEXT) \ dfbinspector$(EXEEXT) dfblayer$(EXEEXT) dfbmaster$(EXEEXT) \ dfbscreen$(EXEEXT) dfbpenmount$(EXEEXT) $(am__EXEEXT_2) \ $(am__EXEEXT_3) $(am__EXEEXT_4) noinst_PROGRAMS = $(am__EXEEXT_5) subdir = tools DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @BUILD_DIRECTFB_CSOURCE_TRUE@am__EXEEXT_1 = directfb-csource$(EXEEXT) @PNG_PROVIDER_TRUE@am__EXEEXT_2 = mkdfiff$(EXEEXT) @FREETYPE_PROVIDER_TRUE@am__EXEEXT_3 = mkdgiff$(EXEEXT) @ENABLE_VOODOO_TRUE@am__EXEEXT_4 = dfbproxy$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) @HAVE_LINUX_TRUE@am__EXEEXT_5 = fusion_bench$(EXEEXT) \ @HAVE_LINUX_TRUE@ raw15toraw24$(EXEEXT) raw16toraw24$(EXEEXT) \ @HAVE_LINUX_TRUE@ raw32toraw24$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_dfbdump_OBJECTS = dfbdump.$(OBJEXT) dfbdump_OBJECTS = $(am_dfbdump_OBJECTS) dfbdump_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_dfbfx_OBJECTS = dfbfx.$(OBJEXT) dfbfx_OBJECTS = $(am_dfbfx_OBJECTS) dfbfx_DEPENDENCIES = $(libdirect) am_dfbg_OBJECTS = dfbg.$(OBJEXT) dfbg_OBJECTS = $(am_dfbg_OBJECTS) am__DEPENDENCIES_1 = dfbg_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am_dfbinfo_OBJECTS = dfbinfo.$(OBJEXT) dfbinfo_OBJECTS = $(am_dfbinfo_OBJECTS) dfbinfo_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am_dfbinput_OBJECTS = dfbinput.$(OBJEXT) dfbinput_OBJECTS = $(am_dfbinput_OBJECTS) dfbinput_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am_dfbinspector_OBJECTS = dfbinspector.$(OBJEXT) dfbinspector_OBJECTS = $(am_dfbinspector_OBJECTS) dfbinspector_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am_dfblayer_OBJECTS = dfblayer.$(OBJEXT) dfblayer_OBJECTS = $(am_dfblayer_OBJECTS) dfblayer_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am_dfbmaster_OBJECTS = dfbmaster.$(OBJEXT) dfbmaster_OBJECTS = $(am_dfbmaster_OBJECTS) dfbmaster_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am_dfbpenmount_OBJECTS = dfbpenmount.$(OBJEXT) dfbpenmount_OBJECTS = $(am_dfbpenmount_OBJECTS) dfbpenmount_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_dfbproxy_OBJECTS = dfbproxy.$(OBJEXT) dfbproxy_OBJECTS = $(am_dfbproxy_OBJECTS) dfbproxy_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(libvoodoo) am_dfbscreen_OBJECTS = dfbscreen.$(OBJEXT) dfbscreen_OBJECTS = $(am_dfbscreen_OBJECTS) dfbscreen_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) \ $(am__DEPENDENCIES_1) am__directfb_csource_SOURCES_DIST = directfb-csource.c @BUILD_DIRECTFB_CSOURCE_TRUE@am_directfb_csource_OBJECTS = \ @BUILD_DIRECTFB_CSOURCE_TRUE@ directfb-csource.$(OBJEXT) directfb_csource_OBJECTS = $(am_directfb_csource_OBJECTS) @BUILD_DIRECTFB_CSOURCE_TRUE@directfb_csource_DEPENDENCIES = \ @BUILD_DIRECTFB_CSOURCE_TRUE@ $(am__DEPENDENCIES_1) am_fusion_bench_OBJECTS = fusion_bench.$(OBJEXT) fusion_bench_OBJECTS = $(am_fusion_bench_OBJECTS) fusion_bench_DEPENDENCIES = $(libdirectfb) $(libfusion) $(libdirect) am_mkdfiff_OBJECTS = mkdfiff.$(OBJEXT) mkdfiff_OBJECTS = $(am_mkdfiff_OBJECTS) mkdfiff_DEPENDENCIES = $(am__DEPENDENCIES_1) $(libdirect) am_mkdgiff_OBJECTS = mkdgiff.$(OBJEXT) mkdgiff_OBJECTS = $(am_mkdgiff_OBJECTS) mkdgiff_DEPENDENCIES = $(am__DEPENDENCIES_1) $(libdirect) am_raw15toraw24_OBJECTS = raw15toraw24.$(OBJEXT) raw15toraw24_OBJECTS = $(am_raw15toraw24_OBJECTS) raw15toraw24_LDADD = $(LDADD) am_raw16toraw24_OBJECTS = raw16toraw24.$(OBJEXT) raw16toraw24_OBJECTS = $(am_raw16toraw24_OBJECTS) raw16toraw24_LDADD = $(LDADD) am_raw32toraw24_OBJECTS = raw32toraw24.$(OBJEXT) raw32toraw24_OBJECTS = $(am_raw32toraw24_OBJECTS) raw32toraw24_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dfbdump_SOURCES) $(dfbfx_SOURCES) $(dfbg_SOURCES) \ $(dfbinfo_SOURCES) $(dfbinput_SOURCES) $(dfbinspector_SOURCES) \ $(dfblayer_SOURCES) $(dfbmaster_SOURCES) \ $(dfbpenmount_SOURCES) $(dfbproxy_SOURCES) \ $(dfbscreen_SOURCES) $(directfb_csource_SOURCES) \ $(fusion_bench_SOURCES) $(mkdfiff_SOURCES) $(mkdgiff_SOURCES) \ $(raw15toraw24_SOURCES) $(raw16toraw24_SOURCES) \ $(raw32toraw24_SOURCES) DIST_SOURCES = $(dfbdump_SOURCES) $(dfbfx_SOURCES) $(dfbg_SOURCES) \ $(dfbinfo_SOURCES) $(dfbinput_SOURCES) $(dfbinspector_SOURCES) \ $(dfblayer_SOURCES) $(dfbmaster_SOURCES) \ $(dfbpenmount_SOURCES) $(dfbproxy_SOURCES) \ $(dfbscreen_SOURCES) $(am__directfb_csource_SOURCES_DIST) \ $(fusion_bench_SOURCES) $(mkdfiff_SOURCES) $(mkdgiff_SOURCES) \ $(raw15toraw24_SOURCES) $(raw16toraw24_SOURCES) \ $(raw32toraw24_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_builddir)/lib \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/src AM_CPPFLAGS = -DDATADIR=\"@DATADIR@\" AM_CFLAGS = $(FREETYPE_CFLAGS) @BUILD_DIRECTFB_CSOURCE_TRUE@DFB_CSOURCE = directfb-csource @BUILD_DIRECTFB_CSOURCE_TRUE@directfb_csource_SOURCES = directfb-csource.c @BUILD_DIRECTFB_CSOURCE_TRUE@directfb_csource_LDADD = $(LIBPNG) @HAVE_LINUX_TRUE@LINUXONLY_TOOLS = \ @HAVE_LINUX_TRUE@ fusion_bench \ @HAVE_LINUX_TRUE@ raw15toraw24 \ @HAVE_LINUX_TRUE@ raw16toraw24 \ @HAVE_LINUX_TRUE@ raw32toraw24 @ENABLE_VOODOO_TRUE@VOODOO_PROGS = dfbproxy @PNG_PROVIDER_TRUE@PNG_PROGS = mkdfiff @FREETYPE_PROVIDER_TRUE@FREETYPE_PROGS = mkdgiff libdirectfb = ../src/libdirectfb.la libfusion = ../lib/fusion/libfusion.la libdirect = ../lib/direct/libdirect.la libvoodoo = ../lib/voodoo/libvoodoo.la dfbdump_SOURCES = dfbdump.c dfbdump_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbg_SOURCES = dfbg.c dfbg_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbinfo_SOURCES = dfbinfo.c dfbinfo_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbinput_SOURCES = dfbinput.c dfbinput_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbinspector_SOURCES = dfbinspector.c dfbinspector_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfblayer_SOURCES = dfblayer.c dfblayer_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbmaster_SOURCES = dfbmaster.c dfbmaster_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) dfbproxy_SOURCES = dfbproxy.c dfbproxy_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(libvoodoo) dfbscreen_SOURCES = dfbscreen.c dfbscreen_LDADD = $(libdirectfb) $(libfusion) $(libdirect) $(OSX_LIBS) #dfbsummon_SOURCES = dfbsummon.c #dfbsummon_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbpenmount_SOURCES = dfbpenmount.c dfbpenmount_LDADD = $(libdirectfb) $(libfusion) $(libdirect) mkdfiff_SOURCES = mkdfiff.c mkdfiff_LDADD = $(LIBPNG) $(libdirect) mkdgiff_SOURCES = mkdgiff.c mkdgiff_LDADD = $(FREETYPE_LIBS) $(libdirect) fusion_bench_SOURCES = fusion_bench.c fusion_bench_LDADD = $(libdirectfb) $(libfusion) $(libdirect) dfbfx_SOURCES = dfbfx.c dfbfx_LDADD = $(libdirect) raw15toraw24_SOURCES = raw15toraw24.c raw16toraw24_SOURCES = raw16toraw24.c raw32toraw24_SOURCES = raw32toraw24.c EXTRA_DIST = \ README \ gendoc.pl \ mknames.sh all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done dfbdump$(EXEEXT): $(dfbdump_OBJECTS) $(dfbdump_DEPENDENCIES) @rm -f dfbdump$(EXEEXT) $(LINK) $(dfbdump_OBJECTS) $(dfbdump_LDADD) $(LIBS) dfbfx$(EXEEXT): $(dfbfx_OBJECTS) $(dfbfx_DEPENDENCIES) @rm -f dfbfx$(EXEEXT) $(LINK) $(dfbfx_OBJECTS) $(dfbfx_LDADD) $(LIBS) dfbg$(EXEEXT): $(dfbg_OBJECTS) $(dfbg_DEPENDENCIES) @rm -f dfbg$(EXEEXT) $(LINK) $(dfbg_OBJECTS) $(dfbg_LDADD) $(LIBS) dfbinfo$(EXEEXT): $(dfbinfo_OBJECTS) $(dfbinfo_DEPENDENCIES) @rm -f dfbinfo$(EXEEXT) $(LINK) $(dfbinfo_OBJECTS) $(dfbinfo_LDADD) $(LIBS) dfbinput$(EXEEXT): $(dfbinput_OBJECTS) $(dfbinput_DEPENDENCIES) @rm -f dfbinput$(EXEEXT) $(LINK) $(dfbinput_OBJECTS) $(dfbinput_LDADD) $(LIBS) dfbinspector$(EXEEXT): $(dfbinspector_OBJECTS) $(dfbinspector_DEPENDENCIES) @rm -f dfbinspector$(EXEEXT) $(LINK) $(dfbinspector_OBJECTS) $(dfbinspector_LDADD) $(LIBS) dfblayer$(EXEEXT): $(dfblayer_OBJECTS) $(dfblayer_DEPENDENCIES) @rm -f dfblayer$(EXEEXT) $(LINK) $(dfblayer_OBJECTS) $(dfblayer_LDADD) $(LIBS) dfbmaster$(EXEEXT): $(dfbmaster_OBJECTS) $(dfbmaster_DEPENDENCIES) @rm -f dfbmaster$(EXEEXT) $(LINK) $(dfbmaster_OBJECTS) $(dfbmaster_LDADD) $(LIBS) dfbpenmount$(EXEEXT): $(dfbpenmount_OBJECTS) $(dfbpenmount_DEPENDENCIES) @rm -f dfbpenmount$(EXEEXT) $(LINK) $(dfbpenmount_OBJECTS) $(dfbpenmount_LDADD) $(LIBS) dfbproxy$(EXEEXT): $(dfbproxy_OBJECTS) $(dfbproxy_DEPENDENCIES) @rm -f dfbproxy$(EXEEXT) $(LINK) $(dfbproxy_OBJECTS) $(dfbproxy_LDADD) $(LIBS) dfbscreen$(EXEEXT): $(dfbscreen_OBJECTS) $(dfbscreen_DEPENDENCIES) @rm -f dfbscreen$(EXEEXT) $(LINK) $(dfbscreen_OBJECTS) $(dfbscreen_LDADD) $(LIBS) directfb-csource$(EXEEXT): $(directfb_csource_OBJECTS) $(directfb_csource_DEPENDENCIES) @rm -f directfb-csource$(EXEEXT) $(LINK) $(directfb_csource_OBJECTS) $(directfb_csource_LDADD) $(LIBS) fusion_bench$(EXEEXT): $(fusion_bench_OBJECTS) $(fusion_bench_DEPENDENCIES) @rm -f fusion_bench$(EXEEXT) $(LINK) $(fusion_bench_OBJECTS) $(fusion_bench_LDADD) $(LIBS) mkdfiff$(EXEEXT): $(mkdfiff_OBJECTS) $(mkdfiff_DEPENDENCIES) @rm -f mkdfiff$(EXEEXT) $(LINK) $(mkdfiff_OBJECTS) $(mkdfiff_LDADD) $(LIBS) mkdgiff$(EXEEXT): $(mkdgiff_OBJECTS) $(mkdgiff_DEPENDENCIES) @rm -f mkdgiff$(EXEEXT) $(LINK) $(mkdgiff_OBJECTS) $(mkdgiff_LDADD) $(LIBS) raw15toraw24$(EXEEXT): $(raw15toraw24_OBJECTS) $(raw15toraw24_DEPENDENCIES) @rm -f raw15toraw24$(EXEEXT) $(LINK) $(raw15toraw24_OBJECTS) $(raw15toraw24_LDADD) $(LIBS) raw16toraw24$(EXEEXT): $(raw16toraw24_OBJECTS) $(raw16toraw24_DEPENDENCIES) @rm -f raw16toraw24$(EXEEXT) $(LINK) $(raw16toraw24_OBJECTS) $(raw16toraw24_LDADD) $(LIBS) raw32toraw24$(EXEEXT): $(raw32toraw24_OBJECTS) $(raw32toraw24_DEPENDENCIES) @rm -f raw32toraw24$(EXEEXT) $(LINK) $(raw32toraw24_OBJECTS) $(raw32toraw24_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbdump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbfx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbinput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbinspector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfblayer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbmaster.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbpenmount.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbproxy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfbscreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directfb-csource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fusion_bench.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdfiff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdgiff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw15toraw24.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw16toraw24.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw32toraw24.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/tools/dfbscreen.c0000644000175000017500000004541511245562152013411 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include static const DirectFBScreenMixerTreeNames( tree_names ); static const DirectFBScreenEncoderScanModeNames( scan_mode_names ); static const DirectFBScreenEncoderTestPictureNames( test_picture_names ); static const DirectFBScreenEncoderTVStandardsNames( tv_standard_names ); static const DirectFBScreenOutputSignalsNames( signal_names ); /**************************************************************************************************/ static IDirectFB *dfb; static IDirectFBScreen *screen; static DFBScreenDescription desc; /**************************************************************************************************/ static DFBScreenID id = DSCID_PRIMARY; static int mixer = 0; static int encoder = 0; static int output = 0; /**************************************************************************************************/ static DFBScreenMixerConfig mixer_config; static DFBScreenEncoderConfig encoder_config; static DFBScreenOutputConfig output_config; /**************************************************************************************************/ static bool parse_command_line( int argc, char *argv[] ); /**************************************************************************************************/ static void dump_mixer_config ( const DFBScreenMixerConfig *config ); static void dump_encoder_config( const DFBScreenEncoderConfig *config ); /**************************************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { D_DERROR( ret, "Tools/Screen: DirectFBInit() failed!\n" ); goto error; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) goto error; /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { D_DERROR( ret, "Tools/Screen: DirectFBCreate() failed!\n" ); goto error; } /* Get the primary display screen. */ ret = dfb->GetScreen( dfb, id, &screen ); if (ret) { if (ret == DFB_IDNOTFOUND) fprintf (stderr, "\nUnknown screen id, check 'dfbinfo' for valid values.\n\n"); else D_DERROR( ret, "Tools/Screen: IDirectFB::GetScreen() failed!\n" ); goto error; } /* Get a description of the screen. */ ret = screen->GetDescription( screen, &desc ); if (ret) { D_DERROR( ret, "Tools/Screen: IDirectFBScreen::GetDescription() failed!\n" ); goto error; } /* Check arguments. */ if (mixer_config.flags && (mixer < 0 || mixer >= desc.mixers)) { fprintf (stderr, "\nUnknown mixer (%d), check 'dfbinfo' for valid values.\n\n", mixer); goto error; } if (encoder_config.flags && (encoder < 0 || encoder >= desc.encoders)) { fprintf (stderr, "\nUnknown encoder (%d), check 'dfbinfo' for valid values.\n\n", encoder); goto error; } if (output_config.flags && (output < 0 || output >= desc.outputs)) { fprintf (stderr, "\nUnknown output (%d), check 'dfbinfo' for valid values.\n\n", output); goto error; } printf( "\n" ); /* Do mixer. */ if (mixer < desc.mixers && mixer >= 0) { DFBScreenMixerConfig config; printf( "\nMixer %d\n", mixer ); if (mixer_config.flags) { ret = screen->SetMixerConfiguration( screen, mixer, &mixer_config ); if (ret) { D_DERROR( ret, "Tools/Screen: " "IDirectFBScreen::SetMixerConfiguration(%d) failed!\n", mixer ); goto error; } } ret = screen->GetMixerConfiguration( screen, mixer, &config ); if (ret) { D_DERROR( ret, "Tools/Screen: " "IDirectFBScreen::GetMixerConfiguration(%d) failed!\n", mixer ); goto error; } dump_mixer_config( &config ); } /* Do encoder. */ if (encoder < desc.encoders && encoder >= 0) { DFBScreenEncoderConfig config; printf( "\nEncoder %d\n", encoder ); if (encoder_config.flags) { ret = screen->SetEncoderConfiguration( screen, encoder, &encoder_config ); if (ret) { D_DERROR( ret, "Tools/Screen: " "IDirectFBScreen::SetEncoderConfiguration(%d) failed!\n", encoder ); goto error; } } ret = screen->GetEncoderConfiguration( screen, encoder, &config ); if (ret) { D_DERROR( ret, "Tools/Screen: " "IDirectFBScreen::GetEncoderConfiguration(%d) failed!\n", mixer ); goto error; } dump_encoder_config( &config ); } error: /* Release the display screen. */ if (screen) screen->Release( screen ); /* Release the super interface. */ if (dfb) dfb->Release( dfb ); return ret; } /**************************************************************************************************/ typedef struct __AnyOption AnyOption; typedef bool (*ParseFunc)( const AnyOption *option, const char *arg ); struct __AnyOption { const char *short_name; const char *long_name; const char *arg_name; const char *arg_desc; void *value; unsigned int *flags; unsigned int flag; ParseFunc parse; const void *data; }; typedef struct { int value; const char *name; } ValueName; /**************************************************************************************************/ static bool parse_int ( const AnyOption *option, const char *arg ); static bool parse_enum ( const AnyOption *option, const char *arg ); static bool parse_ids ( const AnyOption *option, const char *arg ); static bool parse_color( const AnyOption *option, const char *arg ); /**************************************************************************************************/ static const AnyOption options[] = { { "-s", "--screen", "", "ID of screen to use", &id, NULL, 0, parse_int, NULL }, { "-m", "--mixer", "", "Index of mixer to use", &mixer, NULL, 0, parse_int, NULL }, { "-mt", "--tree", "", "Set (sub) tree mode", &mixer_config.tree, &mixer_config.flags, DSMCONF_TREE, parse_enum, tree_names }, { "-mm", "--max-level", "", "Set maximum level for SUB_LEVEL mode", &mixer_config.level, &mixer_config.flags, DSMCONF_LEVEL, parse_int, NULL }, { "-ml", "--layers", "", "Select layers for SUB_LAYERS mode", &mixer_config.layers, &mixer_config.flags, DSMCONF_LAYERS, parse_ids, NULL }, { "-mb", "--background", "", "Set background color (hex)", &mixer_config.background, &mixer_config.flags, DSMCONF_BACKGROUND, parse_color, NULL }, { "-e", "--encoder", "", "Index of encoder to use", &encoder, NULL, 0, parse_int, NULL }, { "-et", "--tv-standard", "", "Set TV standard", &encoder_config.tv_standard, &encoder_config.flags, DSECONF_TV_STANDARD, parse_enum, tv_standard_names }, { "-ep", "--test-picture", "", "Set test picture mode", &encoder_config.test_picture, &encoder_config.flags, DSECONF_TEST_PICTURE, parse_enum, test_picture_names }, { "-em", "--sel-mixer", "", "Select mixer for input", &encoder_config.mixer, &encoder_config.flags, DSECONF_MIXER, parse_int, NULL }, { "-es", "--encode-sigs", "", "Select signal(s) to encode", &encoder_config.out_signals, &encoder_config.flags, DSECONF_OUT_SIGNALS, parse_enum, signal_names }, { "-ec", "--scan-mode", "", "Set scan mode", &encoder_config.scanmode, &encoder_config.flags, DSECONF_SCANMODE, parse_enum, scan_mode_names }, { "-o", "--output", "", "Index of output to use", &output, NULL, 0, parse_int, NULL } }; static void print_usage (const char *prg_name) { int i; fprintf (stderr, "\nDirectFB Screen Configuration (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options]\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -h --help Show this help message\n"); fprintf (stderr, " -v --version Print version information\n"); for (i=0; ishort_name, option->long_name, option->arg_name, option->arg_desc ); } fprintf (stderr, "\n"); } static bool parse_int( const AnyOption *option, const char *arg ) { int ret; char *end; ret = strtoul( arg, &end, option->data ? (unsigned long) option->data : 10 ); if (*end || ret < 0) { fprintf( stderr, "\nInvalid argument to '%s' or '%s' specified!\n\n", option->short_name, option->long_name ); return false; } *((int*)option->value) = ret; return true; } static bool parse_enum( const AnyOption *option, const char *arg ) { int val = 0; if (! strcasecmp( arg, "help" )) { const ValueName *vn = option->data; fprintf( stderr, "\nPossible arguments to '%s' or '%s':\n", option->short_name, option->long_name ); do { fprintf( stderr, " %s\n", vn->name ); } while (vn++->value); fprintf (stderr, "\n"); return false; } while (arg[0] == ',') arg++; while (arg[0]) { char *p; int len; int vc = 0; bool ok = false; const ValueName *vn = option->data; p = strchr( arg, ',' ); if (p) len = p - arg; else len = strlen( arg ); do { int vlen = strlen(vn->name); if (strncasecmp( vn->name, arg, len )) continue; vc = vn->value; ok = true; if (vlen == len) break; } while (vn++->value); if (ok) val |= vc; else { fprintf( stderr, "\nInvalid argument to '%s' or '%s' specified, " "pass 'help' for a list!\n\n", option->short_name, option->long_name ); return false; } arg += len; while (arg[0] == ',') arg++; } *((int*)option->value) = val; return true; } static bool parse_ids( const AnyOption *option, const char *arg ) { u32 val = 0; int alen = strlen( arg ); char *abuf = alloca( alen + 1 ); memcpy( abuf, arg, alen + 1 ); if (! strcasecmp( arg, "help" )) { fprintf( stderr, "\nCheck 'dfbinfo' for valid values.\n\n" ); return false; } while (abuf[0] == ',') abuf++; while (abuf[0]) { char *p; int len; int ret; p = strchr( abuf, ',' ); if (p) { len = p - abuf; abuf[len++] = 0; } else len = strlen( abuf ); ret = strtoul( abuf, &p, 10 ); if (*p || ret < 0) { fprintf( stderr, "\nInvalid argument (%s) to '%s' or '%s' specified!\n\n", p, option->short_name, option->long_name ); return false; } val |= (1 << ret); abuf += len; while (abuf[0] == ',') abuf++; } *((u32*)option->value) = val; return true; } static bool parse_color( const AnyOption *option, const char *arg ) { unsigned long ret; char *end; DFBColor *color = option->value; ret = strtoul( arg, &end, 16 ); if (*end) { fprintf( stderr, "\nInvalid argument (%s) to '%s' or '%s' specified!\n\n", end, option->short_name, option->long_name ); return false; } color->a = (ret >> 24) & 0xff; color->r = (ret >> 16) & 0xff; color->g = (ret >> 8) & 0xff; color->b = (ret ) & 0xff; return true; } static bool parse_option( const AnyOption *option, const char *arg ) { if (!option->parse( option, arg )) return false; if (option->flags) *option->flags |= option->flag; return true; } static bool parse_command_line( int argc, char *argv[] ) { int i, n; for (n = 1; n < argc; n++) { bool ok = false; const char *arg = argv[n]; if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) { print_usage (argv[0]); return false; } if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) { fprintf (stderr, "dfbscreen version %s\n", DIRECTFB_VERSION); return false; } for (i=0; ishort_name) || !strcmp (arg, opt->long_name)) { if (++n == argc) { print_usage (argv[0]); return false; } if (!parse_option( opt, argv[n] )) return false; ok = true; break; } } if (!ok) { print_usage (argv[0]); return false; } } return true; } /**************************************************************************************************/ static const char * tree_name( DFBScreenMixerTree tree ) { int i; for (i=0; i"; } static void dump_mixer_config( const DFBScreenMixerConfig *config ) { int n; printf( "\n" ); if (config->flags & DSMCONF_TREE) printf( "Tree: %s\n", tree_name( config->tree ) ); if (config->flags & DSMCONF_LEVEL) printf( "Level: %d\n", config->level ); if (config->flags & DSMCONF_LAYERS) { printf( "Layers: " ); for (n=0; nlayers, n )) printf( "(%02x) ", n ); } printf( "\n" ); } if (config->flags & DSMCONF_BACKGROUND) printf( "Background: 0x%02x, 0x%02x, 0x%02x (RGB)\n", config->background.r, config->background.g, config->background.b ); printf( "\n" ); } /**************************************************************************************************/ static const char * test_picture_name( DFBScreenEncoderTestPicture test_picture ) { int i; for (i=0; i"; } static const char * scan_mode_name( DFBScreenEncoderTestPicture scan_mode ) { int i; for (i=0; i"; } static void dump_encoder_config( const DFBScreenEncoderConfig *config ) { int i; printf( "\n" ); if (config->flags & DSECONF_TV_STANDARD) { printf( "TV Standard: " ); for (i=0; itv_standard & tv_standard_names[i].standard) printf( "%s ", tv_standard_names[i].name ); } printf( "\n" ); } if (config->flags & DSECONF_TEST_PICTURE) printf( "Test Picture: %s\n", test_picture_name( config->test_picture ) ); if (config->flags & DSECONF_MIXER) printf( "Mixer: %d\n", config->mixer ); if (config->flags & DSECONF_OUT_SIGNALS) { printf( "Signals: " ); for (i=0; iout_signals & signal_names[i].signal) printf( "%s ", signal_names[i].name ); } printf( "\n" ); } if (config->flags & DSECONF_SCANMODE) printf( "Scan Mode: %s\n", scan_mode_name( config->scanmode ) ); printf( "\n" ); } DirectFB-1.2.10/tools/dfbinspector.c0000644000175000017500000002140711245562152014133 00000000000000#include #include #include #include #include #include #include #include /**********************************************************************************************************************/ static const DirectFBPixelFormatNames(format_names); static const DirectFBSurfaceBlittingFlagsNames(blittingflags_names); static const DirectFBSurfaceDrawingFlagsNames(drawingflags_names); static const DirectFBAccelerationMaskNames(accelerationmask_names); /**********************************************************************************************************************/ typedef enum { NONE = 0x00000000, CREATE_FILES = 0x00000001 } Options; typedef struct { IDirectFB *dfb; IDirectFBFont *font; Options options; const char *directory; struct { FILE *formats; } files; bool device_drawstring; } Inspector; /**********************************************************************************************************************/ static DFBResult Inspector_Init( Inspector *inspector, int argc, char *argv[] ) { int i; DFBResult ret; DFBFontDescription desc; memset( inspector, 0, sizeof(Inspector) ); for (i=1; idirectory = argv[i]; inspector->options |= CREATE_FILES; } } ret = DirectFBCreate( &inspector->dfb ); if (ret) { D_DERROR( ret, "Inspector/Init: DirectFBCreate() failed!\n" ); return ret; } desc.flags = DFDESC_HEIGHT; desc.height = 24; ret = inspector->dfb->CreateFont( inspector->dfb, DATADIR"/decker.ttf", &desc, &inspector->font ); if (ret) { D_DERROR( ret, "Inspector/Init: Could not load font '%s'!\n", DATADIR"/decker.ttf" ); return ret; } return DFB_OK; } static DFBResult Inspector_Run( Inspector *inspector ) { static const DFBSurfacePixelFormat formats[] = { DSPF_LUT8, DSPF_ALUT44, DSPF_RGB332, DSPF_RGB16, DSPF_RGB24, DSPF_RGB32, DSPF_ARGB1555, DSPF_ARGB2554, DSPF_ARGB4444, DSPF_ARGB, DSPF_AiRGB, DSPF_A1, DSPF_A8, DSPF_YUY2, DSPF_UYVY, DSPF_I420, DSPF_YV12, DSPF_NV12, DSPF_NV21, DSPF_NV16, DSPF_AYUV }; int i, j, n; DFBResult ret; DFBSurfaceDescription desc; IDirectFBSurface *surfaces[D_ARRAY_SIZE(formats)]; char buf[strlen( inspector->directory ? : "" ) + 23]; if (inspector->options & CREATE_FILES) { /* Create the directory. */ if (mkdir( inspector->directory, 0755 ) < 0 && errno != EEXIST) { D_PERROR( "Inspector/Init: Could not create directory '%s'!\n", inspector->directory ); return DFB_INIT; } /* Open file for writing supported format conversions (blitting). */ snprintf( buf, sizeof(buf), "%s/blit.formats", inspector->directory ); inspector->files.formats = fopen( buf, "w" ); if (!inspector->files.formats) { D_PERROR( "Inspector/Init: Could not open file '%s' for writing!\n", buf ); return DFB_INIT; } } desc.flags = (DFBSurfaceDescriptionFlags)(DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT); desc.width = 64; desc.height = 64; for (i=0; idfb->CreateSurface( inspector->dfb, &desc, &surfaces[i] ); if (ret) { D_DERROR( ret, "Inspector/Init: Could not create %s surface!\n", format_names[DFB_PIXELFORMAT_INDEX(formats[i])].name ); while (i--) surfaces[i]->Release( surfaces[i] ); return ret; } surfaces[i]->SetFont( surfaces[i], inspector->font ); if (inspector->files.formats) fprintf( inspector->files.formats, "%s%s", i ? "," : "", format_names[DFB_PIXELFORMAT_INDEX(formats[i])].name ); } if (inspector->files.formats) fprintf( inspector->files.formats, "\n" ); printf("\n"); printf("source ->"); for (i=0; iGetAccelerationMask( surfaces[i], surfaces[j], &mask ); if (mask & DFXL_DRAWSTRING) inspector->device_drawstring = true; printf( "%9s", (mask & DFXL_BLIT) ? "X" : "" ); if (inspector->files.formats) fputc( (mask & DFXL_BLIT) ? '1' : '0', inspector->files.formats ); } printf( " %s", format_names[DFB_PIXELFORMAT_INDEX(formats[i])].name ); printf("\n"); if (inspector->files.formats) fprintf( inspector->files.formats, "\n" ); } for (i=0; iRelease( surfaces[i] ); if (inspector->options & CREATE_FILES) { FILE *f; DFBGraphicsDeviceDescription desc; if (inspector->files.formats) fclose( inspector->files.formats ); /* Query device and driver information. */ inspector->dfb->GetDeviceDescription( inspector->dfb, &desc ); if (inspector->device_drawstring) desc.acceleration_mask = (DFBAccelerationMask)(desc.acceleration_mask | DFXL_DRAWSTRING); /* Write device info to a file. */ snprintf( buf, sizeof(buf), "%s/device.info", inspector->directory ); f = fopen( buf, "w" ); if (!f) { D_PERROR( "Inspector/Init: Could not open file '%s' for writing!\n", buf ); return DFB_FAILURE; } fprintf( f, "name = %s\n", desc.name ); fprintf( f, "vendor = %s\n", desc.vendor ); fprintf( f, "acceleration_mask = " ); for (i=0, n=0; accelerationmask_names[i].mask; i++) { if (desc.acceleration_mask & accelerationmask_names[i].mask) fprintf( f, "%s%s", n++ ? "," : "", accelerationmask_names[i].name ); } fprintf( f, "\n" ); fprintf( f, "blitting_flags = " ); for (i=0, n=0; blittingflags_names[i].flag; i++) { if (desc.blitting_flags & blittingflags_names[i].flag) fprintf( f, "%s%s", n++ ? "," : "", blittingflags_names[i].name ); } fprintf( f, "\n" ); fprintf( f, "drawing_flags = " ); for (i=0, n=0; drawingflags_names[i].flag; i++) { if (desc.drawing_flags & drawingflags_names[i].flag) fprintf( f, "%s%s", n++ ? "," : "", drawingflags_names[i].name ); } fprintf( f, "\n" ); fclose( f ); /* Write driver info to a file. */ snprintf( buf, sizeof(buf), "%s/driver.info", inspector->directory ); f = fopen( buf, "w" ); if (!f) { D_PERROR( "Inspector/Init: Could not open file '%s' for writing!\n", buf ); return DFB_FAILURE; } fprintf( f, "name = %s\n", desc.driver.name ); fprintf( f, "vendor = %s\n", desc.driver.vendor ); fprintf( f, "version = %d.%d\n", desc.driver.major, desc.driver.minor ); fclose( f ); } return DFB_OK; } /**********************************************************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; Inspector inspector; ret = DirectFBInit( &argc, &argv ); if (ret) { D_DERROR( ret, "Inspector/Init: DirectFBInit() failed!\n" ); return ret; } ret = Inspector_Init( &inspector, argc, argv ); if (ret) return ret; return Inspector_Run( &inspector ); } DirectFB-1.2.10/tools/dfbfx.c0000644000175000017500000005043011245562152012540 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include static DirectFBSurfaceBlittingFlagsNames( m_bflags ); static DirectFBSurfaceBlendFunctionNames( m_bfuncs ); #define MODULATE(a,b) do { (a) = (((int)(a) * ((int)(b) + 1)) >> 8); } while (0) static DFBColor blit_pixel( CardState *state, DFBColor src, DFBColor dst ) { /* Scratch for blending stage. */ DFBColor x; /* * Input => short circuit to Output? (simple blits) */ /* Without any flag the source is simply copied. */ if (!state->blittingflags) return src; /* Source color keying is the 2nd simplest operation. */ if (state->blittingflags & DSBLIT_SRC_COLORKEY) { /* If the source matches the color key, keep the destination. */ if (PIXEL_RGB32(src.r,src.g,src.b) == state->src_colorkey) return dst; } /* Destination color keying already requires reading the destination. */ if (state->blittingflags & DSBLIT_DST_COLORKEY) { /* If the destination does not match the color key, keep the destination. */ if (PIXEL_RGB32(dst.r,dst.g,dst.b) != state->dst_colorkey) return dst; } /* * Modulation stage */ /* Modulate source alpha value with global alpha factor? */ if (state->blittingflags & DSBLIT_BLEND_COLORALPHA) { /* Combine with source alpha value... */ if (state->blittingflags & DSBLIT_BLEND_ALPHACHANNEL) MODULATE( src.a, state->color.a ); else /* ...or replace it. */ src.a = state->color.a; } /* Modulate source colors with global color factors? */ if (state->blittingflags & DSBLIT_COLORIZE) { MODULATE( src.r, state->color.r ); MODULATE( src.g, state->color.g ); MODULATE( src.b, state->color.b ); } /* * Premultiplication stage */ /* Premultiply source colors with (modulated) source alpha value? */ if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) { MODULATE( src.r, src.a ); MODULATE( src.g, src.a ); MODULATE( src.b, src.a ); } /* Premultiply source colors with global alpha factor only? */ if (state->blittingflags & DSBLIT_SRC_PREMULTCOLOR) { MODULATE( src.r, state->color.a ); MODULATE( src.g, state->color.a ); MODULATE( src.b, state->color.a ); } /* Premultiply destination colors with destination alpha value? */ if (state->blittingflags & DSBLIT_DST_PREMULTIPLY) { MODULATE( dst.r, dst.a ); MODULATE( dst.g, dst.a ); MODULATE( dst.b, dst.a ); } /* * XOR comes right before blending, after load, modulate and premultiply. */ if (state->blittingflags & DSBLIT_XOR) { src.a ^= dst.a; src.r ^= dst.r; src.g ^= dst.g; src.b ^= dst.b; } /* * Blending stage */ /* Initialize scratch with source values, modify the copy according to the source blend function. Could be done better by writing to the scratch only once after the calculation. */ x = src; /* Blend scratch (source copy) and destination values accordingly. */ if (state->blittingflags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) { /* Apply the source blend function to the scratch. */ switch (state->src_blend) { /* Sargb *= 0.0 */ case DSBF_ZERO: x.a = x.r = x.g = x.b = 0; break; /* Sargb *= 1.0 */ case DSBF_ONE: break; /* Sargb *= Sargb */ case DSBF_SRCCOLOR: MODULATE( x.a, src.a ); MODULATE( x.r, src.r ); MODULATE( x.g, src.g ); MODULATE( x.b, src.b ); break; /* Sargb *= 1.0 - Sargb */ case DSBF_INVSRCCOLOR: MODULATE( x.a, src.a ^ 0xff ); MODULATE( x.r, src.r ^ 0xff ); MODULATE( x.g, src.g ^ 0xff ); MODULATE( x.b, src.b ^ 0xff ); break; /* Sargb *= Saaaa */ case DSBF_SRCALPHA: MODULATE( x.a, src.a ); MODULATE( x.r, src.a ); MODULATE( x.g, src.a ); MODULATE( x.b, src.a ); break; /* Sargb *= 1.0 - Saaaa */ case DSBF_INVSRCALPHA: MODULATE( x.a, src.a ^ 0xff ); MODULATE( x.r, src.a ^ 0xff ); MODULATE( x.g, src.a ^ 0xff ); MODULATE( x.b, src.a ^ 0xff ); break; /* Sargb *= Daaaa */ case DSBF_DESTALPHA: MODULATE( x.a, dst.a ); MODULATE( x.r, dst.a ); MODULATE( x.g, dst.a ); MODULATE( x.b, dst.a ); break; /* Sargb *= 1.0 - Daaaa */ case DSBF_INVDESTALPHA: MODULATE( x.a, dst.a ^ 0xff ); MODULATE( x.r, dst.a ^ 0xff ); MODULATE( x.g, dst.a ^ 0xff ); MODULATE( x.b, dst.a ^ 0xff ); break; /* Sargb *= Dargb */ case DSBF_DESTCOLOR: MODULATE( x.a, dst.a ); MODULATE( x.r, dst.r ); MODULATE( x.g, dst.g ); MODULATE( x.b, dst.b ); break; /* Sargb *= 1.0 - Dargb */ case DSBF_INVDESTCOLOR: MODULATE( x.a, dst.a ^ 0xff ); MODULATE( x.r, dst.r ^ 0xff ); MODULATE( x.g, dst.g ^ 0xff ); MODULATE( x.b, dst.b ^ 0xff ); break; /* ??? */ case DSBF_SRCALPHASAT: D_UNIMPLEMENTED(); break; default: D_BUG( "unknown blend function %d", state->src_blend ); } /* Apply the destination blend function. */ switch (state->dst_blend) { /* Dargb *= 0.0 */ case DSBF_ZERO: dst.a = dst.r = dst.g = dst.b = 0; break; /* Dargb *= 1.0 */ case DSBF_ONE: break; /* Dargb *= Sargb */ case DSBF_SRCCOLOR: MODULATE( dst.a, src.a ); MODULATE( dst.r, src.r ); MODULATE( dst.g, src.g ); MODULATE( dst.b, src.b ); break; /* Dargb *= 1.0 - Sargb */ case DSBF_INVSRCCOLOR: MODULATE( dst.a, src.a ^ 0xff ); MODULATE( dst.r, src.r ^ 0xff ); MODULATE( dst.g, src.g ^ 0xff ); MODULATE( dst.b, src.b ^ 0xff ); break; /* Dargb *= Saaaa */ case DSBF_SRCALPHA: MODULATE( dst.a, src.a ); MODULATE( dst.r, src.a ); MODULATE( dst.g, src.a ); MODULATE( dst.b, src.a ); break; /* Dargb *= 1.0 - Saaaa */ case DSBF_INVSRCALPHA: MODULATE( dst.a, src.a ^ 0xff ); MODULATE( dst.r, src.a ^ 0xff ); MODULATE( dst.g, src.a ^ 0xff ); MODULATE( dst.b, src.a ^ 0xff ); break; /* Dargb *= Daaaa */ case DSBF_DESTALPHA: MODULATE( dst.r, dst.a ); MODULATE( dst.g, dst.a ); MODULATE( dst.b, dst.a ); MODULATE( dst.a, dst.a ); // break; /* Dargb *= 1.0 - Daaaa */ case DSBF_INVDESTALPHA: MODULATE( dst.r, dst.a ^ 0xff ); MODULATE( dst.g, dst.a ^ 0xff ); MODULATE( dst.b, dst.a ^ 0xff ); MODULATE( dst.a, dst.a ^ 0xff ); // break; /* Dargb *= Dargb */ case DSBF_DESTCOLOR: MODULATE( dst.r, dst.r ); MODULATE( dst.g, dst.g ); MODULATE( dst.b, dst.b ); MODULATE( dst.a, dst.a ); // break; /* Dargb *= 1.0 - Dargb */ case DSBF_INVDESTCOLOR: MODULATE( dst.r, dst.r ^ 0xff ); MODULATE( dst.g, dst.g ^ 0xff ); MODULATE( dst.b, dst.b ^ 0xff ); MODULATE( dst.a, dst.a ^ 0xff ); // break; /* ??? */ case DSBF_SRCALPHASAT: D_UNIMPLEMENTED(); break; default: D_BUG( "unknown blend function %d", state->dst_blend ); } /* * Add blended destination values to the scratch. */ x.a += dst.a; x.r += dst.r; x.g += dst.g; x.b += dst.b; } /* Better not use the conversion from premultiplied to non-premultiplied! */ if (state->blittingflags & DSBLIT_DEMULTIPLY) { x.r = ((int)x.r << 8) / ((int)x.a + 1); x.g = ((int)x.g << 8) / ((int)x.a + 1); x.b = ((int)x.b << 8) / ((int)x.a + 1); } /* * Output */ return x; } /**********************************************************************************************************************/ static const char * blend_to_string( DFBSurfaceBlendFunction func ) { int i; for (i=0; i"; } /**********************************************************************************************************************/ static void parse_flags( const char *arg, DFBSurfaceBlittingFlags *ret_flags ) { int i; *ret_flags = DSBLIT_NOFX; for (i=0; ia = argb >> 24; ret_color->r = (argb & 0xFF0000) >> 16; ret_color->g = (argb & 0xFF00) >> 8; ret_color->b = argb & 0xFF; return true; } static bool parse_blend_func( const char *arg, DFBSurfaceBlendFunction *ret_func ) { int i; for (i=0; i[,] Set blitting flags\n" " -D, --destination <0xAARRGGBB> Set destination value (ARGB32 in hex)\n" " -S, --source <0xAARRGGBB> Set source value (ARGB32 in hex)\n" " -c, --color <0xAARRGGBB> Set color (ARGB32 in hex)\n" " -s, --srcblend Set source blend function\n" " -d, --dstblend Set destination blend function\n" "\n" "Blitting flags:\n", DIRECTFB_VERSION, prg_name ); for (i=0; iblittingflags ); continue; } if (strcmp (arg, "-D") == 0 || strcmp (arg, "--destination") == 0) { if (++i == argc) { print_usage (argv[0]); return DFB_FALSE; } if (parse_color( argv[i], dest )) continue; } if (strcmp (arg, "-S") == 0 || strcmp (arg, "--source") == 0) { if (++i == argc) { print_usage (argv[0]); return DFB_FALSE; } if (parse_color( argv[i], source )) continue; } if (strcmp (arg, "-c") == 0 || strcmp (arg, "--color") == 0) { if (++i == argc) { print_usage (argv[0]); return DFB_FALSE; } if (parse_color( argv[i], &state->color )) continue; } if (strcmp (arg, "-s") == 0 || strcmp (arg, "--srcblend") == 0) { if (++i == argc) { print_usage (argv[0]); return DFB_FALSE; } if (parse_blend_func( argv[i], &state->src_blend )) continue; } if (strcmp (arg, "-d") == 0 || strcmp (arg, "--dstblend") == 0) { if (++i == argc) { print_usage (argv[0]); return DFB_FALSE; } if (parse_blend_func( argv[i], &state->dst_blend )) continue; } print_usage (argv[0]); return DFB_FALSE; } return DFB_TRUE; } /**********************************************************************************************************************/ int main( int argc, char *argv[] ) { int i; CardState state = { .blittingflags = DSBLIT_NOFX }; DFBColor result; /* Initialize sample source and destination values. */ //DFBColor src = { 0x93, 0x93, 0x93, 0x93 }; DFBColor dst = { 0xf0, 0xe0, 0xe0, 0xe0 }; #define DRAWSTRING_PREMULT_FONT 1 /* Initialize default rendering state. */ #if DRAWSTRING_PREMULT_FONT /* Initialize sample source and destination values. */ DFBColor src = { 0x93, 0x93, 0x93, 0x93 }; state.blittingflags = DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_COLORIZE; state.src_blend = DSBF_ONE; state.dst_blend = DSBF_INVSRCALPHA; state.color.a = 0x81; state.color.r = 0xff; state.color.g = 0x80; state.color.b = 0x23; #elif DRAWSTRING_NONPREMULT_ALPHADROP /* Initialize sample source and destination values. */ DFBColor src = { 0x93, 0xff, 0xff, 0xff }; state.blittingflags = DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_COLORIZE; state.src_blend = DSBF_SRCALPHA; state.dst_blend = DSBF_INVSRCALPHA; state.color.a = 0x81; state.color.r = 0xff; state.color.g = 0x80; state.color.b = 0x23; #endif /* Startup the blitting FX demonstrator. */ printf( "\ndfbfx v" DIRECTFB_VERSION "\n\n" ); if (!parse_command_line( argc, argv, &state, &dst, &src )) return -1; /* Show blitting flags being used. */ printf( " blit_flags: " ); for (i=0; i> 16, (state.src_colorkey >> 8) & 0xff, state.src_colorkey & 0xff ); /* Show original destination values. */ printf( " dst: %02x %02x %02x %02x\n", dst.a, dst.r, dst.g, dst.b ); /* Show destination color key. */ if (state.blittingflags & DSBLIT_DST_COLORKEY) printf( " dst_key: %02x %02x %02x\n", state.dst_colorkey >> 16, (state.dst_colorkey >> 8) & 0xff, state.dst_colorkey & 0xff ); /* Do magic... */ result = blit_pixel( &state, src, dst ); /* Show resulting values. */ printf( " result: %02x %02x %02x %02x\n", result.a, result.r, result.g, result.b ); return 0; } DirectFB-1.2.10/tools/raw15toraw24.c0000644000175000017500000000406611245562152013635 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include int main( void ) { unsigned char byt; unsigned short wrd; do { fread (&wrd, 2, 1, stdin); #ifdef WORDS_BIGENDIAN swab (&wrd, &wrd, 2); #endif byt = (wrd & 0x7800) >> 7; fwrite (&byt, 1, 1, stdout); byt = (wrd & 0x03E0) >> 2; fwrite (&byt, 1, 1, stdout); byt = (wrd & 0x001F) << 3; fwrite (&byt, 1, 1, stdout); } while (!feof (stdin)); return 0; } DirectFB-1.2.10/tools/dfbproxy.c0000644000175000017500000001035411245562152013305 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include /*****************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ); static DFBResult server_run(); /*****************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Run the server. */ return server_run(); } /*****************************************************************************/ static DirectResult ConstructDispatcher( VoodooServer *server, VoodooManager *manager, const char *name, void *ctx, VoodooInstanceID *ret_instance ) { DirectResult ret; DirectInterfaceFuncs *funcs; void *interface; VoodooInstanceID instance; D_ASSERT( server != NULL ); D_ASSERT( manager != NULL ); D_ASSERT( name != NULL ); D_ASSERT( ret_instance != NULL ); ret = DirectGetInterface( &funcs, name, "Dispatcher", NULL, NULL ); if (ret) return ret; ret = funcs->Allocate( &interface ); if (ret) return ret; ret = funcs->Construct( interface, manager, &instance ); if (ret) return ret; *ret_instance = instance; return DFB_OK; } /*****************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ) { return DFB_TRUE; } static DFBResult server_run() { DFBResult ret; VoodooServer *server; ret = voodoo_server_create( &server ); if (ret) { D_ERROR( "Voodoo/Proxy: Could not create the server (%s)!\n", DirectFBErrorString(ret) ); return ret; } ret = voodoo_server_register( server, "IDirectFB", ConstructDispatcher, NULL ); if (ret) { D_ERROR( "Voodoo/Proxy: Could not register super interface 'IDirectFB'!\n" ); voodoo_server_destroy( server ); return ret; } ret = voodoo_server_run( server ); if (ret) D_ERROR( "Voodoo/Proxy: Server exiting with error (%s)!\n", DirectFBErrorString(ret) ); voodoo_server_destroy( server ); return DFB_OK; } DirectFB-1.2.10/tools/mknames.sh0000755000175000017500000000121711164361026013271 00000000000000#!/bin/sh if test -z "$6"; then echo "Usage: $0
" echo "Example: $0 DFBSurfacePixelFormat DSPF UNKNOWN PixelFormat format directfb.h" exit 1 fi ENUM=$1 PREFIX=$2 NULL=$3 NAME=$4 VALUE=$5 HEADER=$6 cat << EOF struct DFB${NAME}Name { ${ENUM} ${VALUE}; const char *name; }; #define DirectFB${NAME}Names(Identifier) struct DFB${NAME}Name Identifier[] = { \\ EOF egrep "^ +${PREFIX}_[0-9A-Za-z_]+[ ,]" $HEADER | grep -v ${PREFIX}_${NULL} | perl -p -e "s/^\\s*(${PREFIX}_)([\\w_]+)[ ,].*/ \\{ \\1\\2, \\\"\\2\\\" \\}, \\\\/" cat << EOF { ${PREFIX}_${NULL}, "${NULL}" } \\ }; EOF DirectFB-1.2.10/tools/dfbpenmount.c0000755000175000017500000001622411245562152013776 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Nikita Egorov Calibration utility for PenMount's touchscreen panel. Run the program and touch to center of left/top cross ( active cross is blinked ). Then touch to right/bottom cross. The program will create four values for penmout's driver. The values will be printed to the console. This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include static IDirectFB *dfb; static IDirectFBSurface *primary; static IDirectFBEventBuffer *buffer; static int sx,sy; int main( int argc, char *argv[] ) { int quit = 0; DFBResult err; DFBGraphicsDeviceDescription gdesc; char init_str[64]; const char* dev = "/dev/ttyS0"; char buf[4096]={0}; char *home = getenv( "HOME" ); int file; int leftx, topy, rightx, bottomy, ofs; int mouse_x, mouse_y, tx1, ty1; int touch, count, color; struct timespec rqtp,rmtp; if(home) sprintf(init_str,"%s/.directfbrc",home); else strcpy(init_str,"root/.directfbrc"); file = open ( init_str, O_RDONLY ); if ( file != -1 ){ char *pos, *pos2; read(file, buf, sizeof(buf)); close(file); pos = strstr( buf, "penmount-device" ); if(pos){ pos = strchr(pos,'='); if(pos){ *pos++ = '\0'; if( (pos2=strchr(pos,':'))||(pos2=strchr(pos,'\n')) ) *pos2 = '\0'; dev = pos; } } } printf( "penmount device '%s'\n", dev ); sprintf( init_str,"--dfb:penmount-device=%s:raw", dev); argv[argc++] = init_str; if (DirectFBInit( &argc, &argv ) != DFB_OK) return 1; if (DirectFBCreate( &dfb ) != DFB_OK) return 1; dfb->GetDeviceDescription( dfb, &gdesc ); err = dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN ); if (err != DFB_OK) DirectFBError( "Failed requesting exclusive access", err ); err = dfb->CreateInputEventBuffer( dfb, DICAPS_ALL, DFB_FALSE, &buffer ); if (err != DFB_OK) { DirectFBError( "CreateInputEventBuffer failed", err ); dfb->Release( dfb ); return 1; } { DFBSurfaceDescription dsc; dsc.flags = DSDESC_CAPS; dsc.caps = (gdesc.drawing_flags & DSDRAW_BLEND) ? DSCAPS_PRIMARY | DSCAPS_FLIPPING : DSCAPS_PRIMARY | DSCAPS_FLIPPING | DSCAPS_SYSTEMONLY; err = dfb->CreateSurface( dfb, &dsc, &primary ); if (err != DFB_OK) { DirectFBError( "Failed creating primary surface", err ); buffer->Release( buffer ); dfb->Release( dfb ); return 1; } primary->GetSize( primary, &sx, &sy ); } primary->Clear( primary, 0x0, 0x0, 0x0, 0xFF ); leftx = sx/10; topy = sy/10; rightx = sx*9/10; bottomy = sy*9/10; ofs = 10; primary->SetColor( primary,0xFF,0,0,0xFF ); primary->DrawLine( primary,rightx-ofs,bottomy,rightx+ofs,bottomy ); primary->DrawLine( primary,rightx,bottomy-ofs,rightx,bottomy+ofs ); err = primary->Flip( primary, NULL, 0 ); if (err != DFB_OK) { DirectFBError( "Failed flipping the primary surface", err ); primary->Release( primary ); buffer->Release( buffer ); dfb->Release( dfb ); return 1; } mouse_x=0,mouse_y=0,tx1=0,ty1=0; touch=0,count=0,color=0; while (!quit) { DFBInputEvent evt; rqtp.tv_nsec = 10000; rqtp.tv_sec = 0; nanosleep( &rqtp,&rmtp ); if (count++ >= 30){ count = 0; color = !color; if (color) primary->SetColor( primary,0x00,0xFF,0,0xFF ); else primary->SetColor( primary,0xFF,0x00,0,0xFF ); switch(touch){ case 0: primary->DrawLine( primary,leftx-ofs,topy,leftx+ofs,topy ); primary->DrawLine( primary,leftx,topy-ofs,leftx,topy+ofs ); break; case 1: primary->DrawLine( primary,rightx-ofs,bottomy,rightx+ofs,bottomy ); primary->DrawLine( primary,rightx,bottomy-ofs,rightx,bottomy+ofs ); break; } primary->Flip( primary, NULL, 0 ); } while (buffer->GetEvent( buffer, DFB_EVENT(&evt) ) == DFB_OK) { if ( evt.type == DIET_AXISMOTION){ if (evt.flags & DIEF_AXISABS) { switch (evt.axis) { case DIAI_X: mouse_x = evt.axisabs; break; case DIAI_Y: mouse_y = evt.axisabs; break; default: break; } } } if ( evt.type == DIET_BUTTONPRESS ){ switch(++touch){ case 1: //save first touchscreen position tx1=mouse_x; ty1=mouse_y; break; case 2://build new calibration values and quit { float dx = ((float)mouse_x-tx1)/(rightx-leftx); float dy = ((float)mouse_y-ty1)/(bottomy-topy); printf( "Insert followed values into source code of penmount's driver\n'inputdrivers/penmount/penmount.c:96,99' and rebuild:\n" ); printf( "min_x=%d min_y=%d\n",(int)(tx1-leftx*dx+.5),(int)(ty1-topy*dy+.5)); printf( "max_x=%d max_y=%d\n",(int)(mouse_x+leftx*dx+.5),(int)(mouse_y+topy*dy+.5)); quit = 1; break; } } } if (evt.type == DIET_KEYPRESS && evt.key_id == DIKI_ESCAPE) quit = 1; } } primary->Release( primary ); buffer->Release( buffer ); dfb->Release( dfb ); return 0; } DirectFB-1.2.10/tools/dfbinput.c0000644000175000017500000002251111245562152013261 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include /**************************************************************************************************/ static const DirectFBKeySymbolNames( symbol_names ); static const char * symbol_name( DFBInputDeviceKeySymbol symbol ) { int i; static char buf[64]; for (i=0; i", symbol ); return buf; } /**************************************************************************************************/ static IDirectFB *dfb; static IDirectFBInputDevice *device; static DFBInputDeviceDescription desc; /**************************************************************************************************/ static DFBInputDeviceID id = DIDID_KEYBOARD; static unsigned int reload = false; static unsigned int dump = false; /**************************************************************************************************/ static bool parse_command_line( int argc, char *argv[] ); /**************************************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { D_DERROR( ret, "Tools/Input: DirectFBInit() failed!\n" ); goto error; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) goto error; /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { D_DERROR( ret, "Tools/Input: DirectFBCreate() failed!\n" ); goto error; } /* Get the input device. */ ret = dfb->GetInputDevice( dfb, id, &device ); if (ret) { if (ret == DFB_IDNOTFOUND) fprintf (stderr, "\nUnknown device id, check 'dfbinfo' for valid values.\n\n"); else D_DERROR( ret, "Tools/Input: IDirectFB::GetInputDevice() failed!\n" ); goto error; } /* Get a description of the device. */ ret = device->GetDescription( device, &desc ); if (ret) { D_DERROR( ret, "Tools/Input: IDirectFBInputDevice::GetDescription() failed!\n" ); goto error; } /* Reload the keymap. FIXME: Make public API? */ if (reload) { ret = dfb_input_device_reload_keymap( dfb_input_device_at( id ) ); if (ret) { D_DERROR( ret, "Tools/Input: Reloading the keymap failed!\n" ); goto error; } } /* Dump the keymap. */ if (dump) { int i; printf( "\n" ); for (i=desc.min_keycode; i<=desc.max_keycode; i++) { DFBInputDeviceKeymapEntry entry; ret = device->GetKeymapEntry( device, i, &entry ); if (ret) { D_DERROR( ret, "Tools/Input: IDirectFBInputDevice::GetKeymapEntry( %d ) failed!\n", i ); goto error; } printf( "%3d: %-16s %-16s %-16s %-16s\n", i, symbol_name(entry.symbols[DIKSI_BASE]), symbol_name(entry.symbols[DIKSI_BASE_SHIFT]), symbol_name(entry.symbols[DIKSI_ALT]), symbol_name(entry.symbols[DIKSI_ALT_SHIFT]) ); } printf( "\n" ); } error: /* Release the device. */ if (device) device->Release( device ); /* Release the super interface. */ if (dfb) dfb->Release( dfb ); return ret; } /**************************************************************************************************/ typedef struct __AnyOption AnyOption; typedef bool (*ParseFunc)( const AnyOption *option, const char *arg ); struct __AnyOption { const char *short_name; const char *long_name; const char *arg_name; const char *arg_desc; void *value; unsigned int *flags; unsigned int flag; ParseFunc parse; const void *data; }; typedef struct { int value; const char *name; } ValueName; /**************************************************************************************************/ static bool parse_int( const AnyOption *option, const char *arg ) { int ret; char *end; ret = strtoul( arg, &end, option->data ? (unsigned long) option->data : 10 ); if (*end || ret < 0) { fprintf( stderr, "\nInvalid argument to '%s' or '%s' specified!\n\n", option->short_name, option->long_name ); return false; } *((int*)option->value) = ret; return true; } /**************************************************************************************************/ static const AnyOption options[] = { { "-d", "--device", "", "ID of device to use", &id, NULL, 0, parse_int, NULL }, { "-r", "--reload", "", "Reload the keymap", NULL, &reload, true, NULL, NULL }, { "-k", "--keymap", "", "Show the keymap", NULL, &dump, true, NULL, NULL }, }; /**************************************************************************************************/ static void print_usage (const char *prg_name) { int i; fprintf (stderr, "\nDirectFB Input Device Configuration (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options]\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -h --help Show this help message\n"); fprintf (stderr, " -v --version Print version information\n"); for (i=0; ishort_name, option->long_name, option->arg_name, option->arg_desc ); } fprintf (stderr, "\n"); } /**************************************************************************************************/ static bool parse_option( const AnyOption *option, const char *arg ) { if (option->parse && !option->parse( option, arg )) return false; if (option->flags) *option->flags |= option->flag; return true; } static bool parse_command_line( int argc, char *argv[] ) { int i, n; for (n = 1; n < argc; n++) { bool ok = false; const char *arg = argv[n]; if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) { print_usage (argv[0]); return false; } if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) { fprintf (stderr, "dfbinput version %s\n", DIRECTFB_VERSION); return false; } for (i=0; ishort_name) || !strcmp (arg, opt->long_name)) { if (opt->parse && ++n == argc) { print_usage (argv[0]); return false; } if (!parse_option( opt, argv[n] )) return false; ok = true; break; } } if (!ok) { print_usage (argv[0]); return false; } } return true; } DirectFB-1.2.10/tools/dfblayer.c0000644000175000017500000004565511245562152013254 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include static DirectFBPixelFormatNames( format_names ); /*****************************************************************************/ static IDirectFB *dfb; static IDirectFBDisplayLayer *layer; static DFBDisplayLayerDescription desc; /*****************************************************************************/ static DFBDisplayLayerID id = DLID_PRIMARY; static int width = 0; static int height = 0; static DFBSurfacePixelFormat format = DSPF_UNKNOWN; static DFBDisplayLayerBufferMode buffermode = -1; static int opacity = -1; static int level = 0; static DFBBoolean set_level = DFB_FALSE; static int rotation = 0; static DFBBoolean set_rotation = DFB_FALSE; static DFBSurfaceLockFlags test_lock = 0; /*****************************************************************************/ static DFBBoolean parse_command_line( int argc, char *argv[] ); static void set_configuration ( void ); /*****************************************************************************/ int main( int argc, char *argv[] ) { DFBResult ret; /* Initialize DirectFB including command line parsing. */ ret = DirectFBInit( &argc, &argv ); if (ret) { DirectFBError( "DirectFBInit() failed", ret ); return -1; } /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -2; /* Create the super interface. */ ret = DirectFBCreate( &dfb ); if (ret) { DirectFBError( "DirectFBCreate() failed", ret ); return -3; } /* Get the primary display layer. */ ret = dfb->GetDisplayLayer( dfb, id, &layer ); if (ret) { if (ret == DFB_IDNOTFOUND) fprintf (stderr, "\nUnknown layer id, check 'dfbinfo' for valid values.\n\n"); else DirectFBError( "IDirectFB::GetDisplayLayer() failed", ret ); dfb->Release( dfb ); return -4; } /* Get a description of the layer. */ ret = layer->GetDescription( layer, &desc ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::GetDescription() failed", ret ); layer->Release( layer ); dfb->Release( dfb ); return -5; } /* Acquire administrative cooperative level. */ ret = layer->SetCooperativeLevel( layer, DLSCL_ADMINISTRATIVE ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret ); layer->Release( layer ); dfb->Release( dfb ); return -6; } /* Show/change the configuration. */ set_configuration(); /* Test Lock() on layer surface? */ if (test_lock) { IDirectFBSurface *surface; fprintf( stderr, "\nGetting layer surface...\n" ); ret = layer->GetSurface( layer, &surface ); if (ret) DirectFBError( "IDirectFBDisplayLayer::GetSurface() failed", ret ); else { void *data; int pitch; fprintf( stderr, "\nTesting Lock( %s ) on layer surface...\n", test_lock == DSLF_READ ? "read only" : test_lock == DSLF_WRITE ? "write only" : "read/write" ); ret = surface->Lock( surface, test_lock, &data, &pitch ); if (ret) DirectFBError( "IDirectFBSurface::Lock() failed", ret ); else fprintf( stderr, " => OK\n\n" ); surface->Release( surface ); } } /* Release the display layer. */ layer->Release( layer ); /* Release the super interface. */ dfb->Release( dfb ); return EXIT_SUCCESS; } /*****************************************************************************/ static void print_usage (const char *prg_name) { int i = 0; fprintf (stderr, "\nDirectFB Layer Configuration (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options]\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -l, --layer Use the specified layer, default is primary\n"); fprintf (stderr, " -m, --mode x Change the resolution (pixels)\n"); fprintf (stderr, " -f, --format Change the pixel format\n"); fprintf (stderr, " -b, --buffer Change the buffer mode (single/video/system)\n"); fprintf (stderr, " -o, --opacity Change the layer's opacity (0-255)\n"); fprintf (stderr, " -L, --level Change the layer's level\n"); fprintf (stderr, " -R, --rotate Change the layer rotation\n"); fprintf (stderr, " -t, --test-lock Get layer surface and Lock() it (read/write)\n"); fprintf (stderr, " -tr, --test-lock-read Get layer surface and Lock() it (read only)\n"); fprintf (stderr, " -tw, --test-lock-write Get layer surface and Lock() it (write only)\n"); fprintf (stderr, " -h, --help Show this help message\n"); fprintf (stderr, " -v, --version Print version information\n"); fprintf (stderr, "\n"); fprintf (stderr, "Known pixel formats:\n"); while (format_names[i].format != DSPF_UNKNOWN) { DFBSurfacePixelFormat format = format_names[i].format; fprintf (stderr, " %-10s %2d bits, %d bytes", format_names[i].name, DFB_BITS_PER_PIXEL(format), DFB_BYTES_PER_PIXEL(format)); if (DFB_PIXELFORMAT_HAS_ALPHA(format)) fprintf (stderr, " ALPHA"); if (DFB_PIXELFORMAT_IS_INDEXED(format)) fprintf (stderr, " INDEXED"); if (DFB_PLANAR_PIXELFORMAT(format)) { int planes = DFB_PLANE_MULTIPLY(format, 1000); fprintf (stderr, " PLANAR (x%d.%03d)", planes / 1000, planes % 1000); } fprintf (stderr, "\n"); ++i; } fprintf (stderr, "\n"); fprintf (stderr, "Valid buffer modes:\n"); fprintf (stderr, " FRONTONLY or 'single'\n"); fprintf (stderr, " BACKVIDEO or 'video'\n"); fprintf (stderr, " BACKSYSTEM or 'system'\n"); fprintf (stderr, " TRIPLE\n"); fprintf (stderr, " WINDOWS\n"); fprintf (stderr, "\n"); fprintf (stderr, "Specifying neither mode nor format just displays the current configuration.\n"); fprintf (stderr, "\n"); } static DFBBoolean parse_layer( const char *arg ) { if (sscanf( arg, "%d", &id ) != 1 || id < 0) { fprintf (stderr, "\n" "Invalid layer id specified!\n" "Check 'dfbinfo' for valid values.\n\n"); return DFB_FALSE; } return DFB_TRUE; } static DFBBoolean parse_mode( const char *arg ) { if (sscanf( arg, "%dx%d", &width, &height ) != 2 || width < 1 || height < 1) { fprintf (stderr, "\nInvalid mode specified!\n\n" ); return DFB_FALSE; } return DFB_TRUE; } static DFBBoolean parse_format( const char *arg ) { int i = 0; while (format_names[i].format != DSPF_UNKNOWN) { if (!strcasecmp( arg, format_names[i].name )) { format = format_names[i].format; return DFB_TRUE; } ++i; } fprintf (stderr, "\nInvalid format specified!\n\n" ); return DFB_FALSE; } static DFBBoolean parse_buffermode( const char *arg ) { if (!strcasecmp( arg, "single" ) || !strcasecmp( arg, "frontonly" )) buffermode = DLBM_FRONTONLY; else if (!strcasecmp( arg, "system" ) || !strcasecmp( arg, "backsystem" )) buffermode = DLBM_BACKSYSTEM; else if (!strcasecmp( arg, "video" ) || !strcasecmp( arg, "backvideo" )) buffermode = DLBM_BACKVIDEO; else if (!strcasecmp( arg, "triple" )) buffermode = DLBM_TRIPLE; else if (!strcasecmp( arg, "windows" )) buffermode = DLBM_WINDOWS; else { fprintf (stderr, "\nInvalid buffer mode specified!\n\n" ); return DFB_FALSE; } return DFB_TRUE; } static DFBBoolean parse_opacity( const char *arg ) { if (sscanf( arg, "%d", &opacity ) != 1 || opacity < 0 || opacity > 255) { fprintf (stderr, "\nInvalid opacity value specified!\n\n"); return DFB_FALSE; } return DFB_TRUE; } static DFBBoolean parse_level( const char *arg ) { if (sscanf( arg, "%d", &level ) != 1) { fprintf (stderr, "\nInvalid level specified!\n\n"); return DFB_FALSE; } set_level = DFB_TRUE; return DFB_TRUE; } static DFBBoolean parse_rotation( const char *arg ) { if (sscanf( arg, "%d", &rotation ) != 1) { fprintf (stderr, "\nInvalid rotation specified!\n\n"); return DFB_FALSE; } set_rotation = DFB_TRUE; return DFB_TRUE; } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; for (n = 1; n < argc; n++) { const char *arg = argv[n]; if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) { print_usage (argv[0]); return DFB_FALSE; } if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) { fprintf (stderr, "dfbg version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } if (strcmp (arg, "-l") == 0 || strcmp (arg, "--layer") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_layer( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-m") == 0 || strcmp (arg, "--mode") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_mode( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-f") == 0 || strcmp (arg, "--format") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_format( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-b") == 0 || strcmp (arg, "--buffer") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_buffermode( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-o") == 0 || strcmp (arg, "--opacity") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_opacity( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-L") == 0 || strcmp (arg, "--level") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_level( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-R") == 0 || strcmp (arg, "--rotate") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_rotation( argv[n] )) return DFB_FALSE; continue; } if (strcmp (arg, "-t") == 0 || strcmp (arg, "--test-lock") == 0) { test_lock = DSLF_READ | DSLF_WRITE; continue; } if (strcmp (arg, "-tr") == 0 || strcmp (arg, "--test-lock-read") == 0) { test_lock = DSLF_READ; continue; } if (strcmp (arg, "-tw") == 0 || strcmp (arg, "--test-lock-write") == 0) { test_lock = DSLF_WRITE; continue; } print_usage (argv[0]); return DFB_FALSE; } return DFB_TRUE; } static void set_configuration( void ) { DFBResult ret; DFBDisplayLayerConfig config; printf( "\n" ); printf( "%s\n", desc.name ); printf( "\n" ); config.flags = DLCONF_NONE; if (width) { config.flags |= DLCONF_WIDTH; config.width = width; } if (height) { config.flags |= DLCONF_HEIGHT; config.height = height; } if (format != DSPF_UNKNOWN) { config.flags |= DLCONF_PIXELFORMAT; config.pixelformat = format; } if (buffermode != -1) { config.flags |= DLCONF_BUFFERMODE; config.buffermode = buffermode; } /* Set the configuration if anything changed. */ if (config.flags) { ret = layer->TestConfiguration( layer, &config, NULL ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::TestConfiguration() failed", ret ); return; } ret = layer->SetConfiguration( layer, &config ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::SetConfiguration() failed", ret ); return; } } /* Get and show the current (new) configuration. */ ret = layer->GetConfiguration( layer, &config ); if (ret) { DirectFBError( "IDirectFBDisplayLayer::GetConfiguration() failed", ret ); return; } /* Set the opacity if requested. */ if (opacity != -1) { ret = layer->SetOpacity( layer, opacity ); if (ret == DFB_UNSUPPORTED) fprintf( stderr, "Opacity value (%d) not supported!\n\n", opacity ); else if (ret) DirectFBError( "IDirectFBDisplayLayer::SetOpacity() failed", ret ); } /* Set the level if requested. */ if (set_level) { ret = layer->SetLevel( layer, level ); if (ret == DFB_UNSUPPORTED) fprintf( stderr, "Level (%d) not supported!\n\n", level ); else if (ret) DirectFBError( "IDirectFBDisplayLayer::SetLevel() failed", ret ); } /* Set the rotation if requested. */ if (set_rotation) { ret = layer->SetRotation( layer, rotation ); if (ret == DFB_UNSUPPORTED) fprintf( stderr, "Rotation (%d) not supported!\n\n", level ); else if (ret) DirectFBError( "IDirectFBDisplayLayer::SetRotation() failed", ret ); } if (config.flags & DLCONF_WIDTH) printf( "Width %d\n", config.width ); if (config.flags & DLCONF_HEIGHT) printf( "Height %d\n", config.height ); if (config.flags & DLCONF_PIXELFORMAT) printf( "Format %s\n", format_names[DFB_PIXELFORMAT_INDEX(config.pixelformat)].name ); if (config.flags & DLCONF_BUFFERMODE) { printf( "Buffermode " ); switch (config.buffermode) { case DLBM_FRONTONLY: printf( "FRONTONLY\n" ); break; case DLBM_BACKVIDEO: printf( "BACKVIDEO\n" ); break; case DLBM_BACKSYSTEM: printf( "BACKSYSTEM\n" ); break; case DLBM_TRIPLE: printf( "TRIPLE\n" ); break; case DLBM_WINDOWS: printf( "WINDOWS\n" ); break; default: printf( "unknown!\n" ); break; } } if (config.flags & DLCONF_OPTIONS) { printf( "Options " ); if (config.options == DLOP_NONE) { printf( "none\n" ); } else { if (config.options & DLOP_ALPHACHANNEL) printf( "ALPHA CHANNEL " ); if (config.options & DLOP_DEINTERLACING) printf( "DEINTERLACING " ); if (config.options & DLOP_DST_COLORKEY) printf( "DST COLOR KEY " ); if (config.options & DLOP_FIELD_PARITY) printf( "FIELD PARITY " ); if (config.options & DLOP_FLICKER_FILTERING) printf( "FLICKER FILTERING " ); if (config.options & DLOP_OPACITY) printf( "OPACITY " ); if (config.options & DLOP_SRC_COLORKEY) printf( "SRC COLOR KEY " ); printf( "\n" ); } } /* Query current level. */ if (desc.caps & DLCAPS_LEVELS) { int l; ret = layer->GetLevel( layer, &l ); if (ret) DirectFBError( "IDirectFBDisplayLayer::GetLevel() failed", ret ); else printf( "Level %d\n", l ); } printf( "\n" ); } DirectFB-1.2.10/tools/mkdgiff.c0000644000175000017500000004754511245562152013073 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #undef SIZEOF_LONG #include #include FT_GLYPH_H #define MAX_SIZE_COUNT 256 #define MAX_ROW_WIDTH 2047 D_DEBUG_DOMAIN( mkdgiff, "mkdgiff", "DirectFB Glyph Image File Format Tool" ); static DirectFBPixelFormatNames( format_names ); static const char *filename; static int face_index; static DFBSurfacePixelFormat format = DSPF_A8; static int size_count; static int face_sizes[MAX_SIZE_COUNT]; /**********************************************************************************************************************/ static void print_usage (const char *prg_name) { int i = 0; fprintf (stderr, "\nDirectFB Glyph Image File Format Tool (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options]\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -f, --format Choose the pixel format (default A8)\n"); fprintf (stderr, " -s, --sizes [,s2...] Choose sizes to generate glyph images for\n"); fprintf (stderr, " -h, --help Show this help message\n"); fprintf (stderr, " -v, --version Print version information\n"); fprintf (stderr, "\n"); fprintf (stderr, "Known pixel formats with alpha:\n"); while (format_names[i].format != DSPF_UNKNOWN) { DFBSurfacePixelFormat format = format_names[i].format; if (DFB_PIXELFORMAT_HAS_ALPHA(format)) { fprintf (stderr, " %-10s %2d bits, %d bytes", format_names[i].name, DFB_BITS_PER_PIXEL(format), DFB_BYTES_PER_PIXEL(format)); if (DFB_PIXELFORMAT_IS_INDEXED(format)) fprintf (stderr, " INDEXED"); if (DFB_PLANAR_PIXELFORMAT(format)) { int planes = DFB_PLANE_MULTIPLY(format, 1000); fprintf (stderr, " PLANAR (x%d.%03d)", planes / 1000, planes % 1000); } fprintf (stderr, "\n"); } ++i; } fprintf (stderr, "\n"); } static DFBBoolean parse_format( const char *arg, DFBSurfacePixelFormat *ret_format ) { int i = 0; while (format_names[i].format != DSPF_UNKNOWN) { if (!strcasecmp( arg, format_names[i].name )) { *ret_format = format_names[i].format; return DFB_TRUE; } ++i; } fprintf (stderr, "\nInvalid format specified!\n\n" ); return DFB_FALSE; } static DFBBoolean parse_sizes( const char *arg ) { int i = 0; int size = 0; for (i=0; arg[i]; i++) { switch (arg[i]) { case '0' ... '9': if (size_count == MAX_SIZE_COUNT) { fprintf (stderr, "\nMaximum number of sizes (%d) exceeded!\n\n", MAX_SIZE_COUNT ); return DFB_FALSE; } size = size * 10 + arg[i] - '0'; break; case ',': if (size) { face_sizes[size_count++] = size; size = 0; } break; default: fprintf (stderr, "\nInvalid character used in sizes argument!\n\n" ); return DFB_FALSE; } } if (size) face_sizes[size_count++] = size; return DFB_TRUE; } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; for (n = 1; n < argc; n++) { const char *arg = argv[n]; if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) { print_usage (argv[0]); return DFB_FALSE; } if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) { fprintf (stderr, "mkdgiff version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } if (strcmp (arg, "-f") == 0 || strcmp (arg, "--format") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_format( argv[n], &format )) return DFB_FALSE; continue; } if (strcmp (arg, "-s") == 0 || strcmp (arg, "--sizes") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_sizes( argv[n] )) return DFB_FALSE; continue; } if (filename || access( arg, R_OK )) { print_usage (argv[0]); return DFB_FALSE; } filename = arg; } if (!filename) { print_usage (argv[0]); return DFB_FALSE; } return DFB_TRUE; } /**********************************************************************************************************************/ static void write_glyph( DGIFFGlyphInfo *glyph, FT_GlyphSlot slot, void *dst, int pitch ) { int y; u8 *src = slot->bitmap.buffer; D_DEBUG_AT( mkdgiff, "%s( %p, %p, %p, %d ) <- width %d\n", __FUNCTION__, glyph, slot, dst, pitch, glyph->width ); for (y=0; y < glyph->height; y++) { int i, j, n; u8 *dst8 = dst; u16 *dst16 = dst; u32 *dst32 = dst; switch (slot->bitmap.pixel_mode) { case ft_pixel_mode_grays: switch (format) { case DSPF_ARGB: if (0){//FIXME thiz->surface_caps & DSCAPS_PREMULTIPLIED) { for (i=0; iwidth; i++) dst32[i] = ((src[i] << 24) | (src[i] << 16) | (src[i] << 8) | src[i]); } else for (i=0; iwidth; i++) dst32[i] = (src[i] << 24) | 0xFFFFFF; break; case DSPF_AiRGB: for (i=0; iwidth; i++) dst32[i] = ((src[i] ^ 0xFF) << 24) | 0xFFFFFF; break; case DSPF_ARGB4444: for (i=0; iwidth; i++) dst16[i] = (src[i] << 8) | 0xFFF; break; case DSPF_ARGB2554: for (i=0; iwidth; i++) dst16[i] = (src[i] << 8) | 0x3FFF; break; case DSPF_ARGB1555: for (i=0; iwidth; i++) dst16[i] = (src[i] << 8) | 0x7FFF; break; case DSPF_A8: direct_memcpy( dst, src, glyph->width ); break; case DSPF_A4: for (i=0, j=0; iwidth; i+=2, j++) dst8[j] = (src[i] & 0xF0) | (src[i+1] >> 4); break; case DSPF_A1: for (i=0, j=0; i < glyph->width; ++j) { register u8 p = 0; for (n=0; n<8 && iwidth; ++i, ++n) p |= (src[i] & 0x80) >> n; dst8[j] = p; } break; default: break; } break; case ft_pixel_mode_mono: switch (format) { case DSPF_ARGB: for (i=0; iwidth; i++) dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0xFF : 0x00) << 24) | 0xFFFFFF; break; case DSPF_AiRGB: for (i=0; iwidth; i++) dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0x00 : 0xFF) << 24) | 0xFFFFFF; break; case DSPF_ARGB4444: for (i=0; iwidth; i++) dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0xF : 0x0) << 12) | 0xFFF; break; case DSPF_ARGB2554: for (i=0; iwidth; i++) dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0x3 : 0x0) << 14) | 0x3FFF; break; case DSPF_ARGB1555: for (i=0; iwidth; i++) dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? 0x1 : 0x0) << 15) | 0x7FFF; break; case DSPF_A8: for (i=0; iwidth; i++) dst8[i] = (src[i>>3] & (1<<(7-(i%8)))) ? 0xFF : 0x00; break; case DSPF_A4: for (i=0, j=0; iwidth; i+=2, j++) dst8[j] = ((src[i>>3] & (1<<(7-(i%8)))) ? 0xF0 : 0x00) | ((src[(i+1)>>3] & (1<<(7-((i+1)%8)))) ? 0x0F : 0x00); break; case DSPF_A1: direct_memcpy( dst, src, DFB_BYTES_PER_LINE(DSPF_A1, glyph->width) ); break; default: break; } break; default: break; } src += slot->bitmap.pitch; dst += pitch; } } static int do_face( FT_Face face, int size ) { int i, ret; int align = DFB_PIXELFORMAT_ALIGNMENT( format ); int num_glyphs = 0; int num_rows = 1; int row_index = 0; int row_offset = 0; int next_face = sizeof(DGIFFFaceHeader); int total_height = 0; FT_ULong code; FT_UInt index; DGIFFFaceHeader header; DGIFFGlyphInfo *glyphs; DGIFFGlyphRow *rows; void **row_data; D_DEBUG_AT( mkdgiff, "%s( %p, %d ) <- %ld glyphs\n", __FUNCTION__, face, size, face->num_glyphs ); /* Clear to not leak any data into file. */ memset( &header, 0, sizeof(header) ); /* Set the desired size. */ ret = FT_Set_Char_Size( face, 0, size << 6, 0, 0 ); if (ret) { D_ERROR( "Could not set pixel size to %d!\n", size ); return ret; } /* Allocate glyph info array. */ glyphs = D_CALLOC( face->num_glyphs, sizeof(DGIFFGlyphInfo) ); rows = D_CALLOC( face->num_glyphs, sizeof(DGIFFGlyphRow) ); /* WORST case :) */ row_data = D_CALLOC( face->num_glyphs, sizeof(void*) ); /* WORST case :) */ for (code = FT_Get_First_Char( face, &index ); index; code = FT_Get_Next_Char( face, code, &index )) { FT_GlyphSlot slot; DGIFFGlyphInfo *glyph = &glyphs[num_glyphs]; DGIFFGlyphRow *row = &rows[num_rows - 1]; D_DEBUG_AT( mkdgiff, " -> code %3lu - index %3u\n", code, index ); if (num_glyphs == face->num_glyphs) { D_ERROR( "Actual number of characters is bigger than number of glyphs!\n" ); break; } ret = FT_Load_Glyph( face, index, FT_LOAD_RENDER ); if (ret) { D_ERROR( "Could not render glyph for character index %d!\n", index ); goto out; } slot = face->glyph; glyph->unicode = code; glyph->width = slot->bitmap.width; glyph->height = slot->bitmap.rows; glyph->left = slot->bitmap_left; glyph->top = (face->size->metrics.ascender >> 6) - slot->bitmap_top; glyph->advance = slot->advance.x >> 6; num_glyphs++; if (row->width > 0 && row->width + glyph->width > MAX_ROW_WIDTH) { num_rows++; row++; } row->width += (glyph->width + align) & ~align; if (row->height < glyph->height) row->height = glyph->height; } for (i=0; i row %d, width %d, height %d\n", i, row->width, row->height ); total_height += row->height; row->pitch = (DFB_BYTES_PER_LINE( format, row->width ) + 7) & ~7; row_data[i] = D_CALLOC( row->height, row->pitch ); next_face += row->height * row->pitch; } D_DEBUG_AT( mkdgiff, " -> %d glyphs, %d rows, total height %d\n", num_glyphs, num_rows, total_height ); next_face += num_glyphs * sizeof(DGIFFGlyphInfo); next_face += num_rows * sizeof(DGIFFGlyphRow); for (i=0; i reloading character 0x%x (%d)\n", glyph->unicode, i ); ret = FT_Load_Char( face, glyph->unicode, FT_LOAD_RENDER ); if (ret) { D_ERROR( "Could not render glyph for unicode character 0x%x!\n", glyph->unicode ); goto out; } if (row_offset > 0 && row_offset + glyph->width > MAX_ROW_WIDTH) { row_index++; row_offset = 0; } D_DEBUG_AT( mkdgiff, " -> row offset %d\n", row_offset ); write_glyph( glyph, face->glyph, row_data[row_index] + DFB_BYTES_PER_LINE( format, row_offset ), rows[row_index].pitch ); glyph->row = row_index; glyph->offset = row_offset; row_offset += (glyph->width + align) & ~align; } D_ASSERT( row_index == num_rows - 1 ); header.next_face = next_face; header.size = size; header.ascender = face->size->metrics.ascender >> 6; header.descender = face->size->metrics.descender >> 6; header.height = header.ascender - header.descender + 1; header.max_advance = face->size->metrics.max_advance >> 6; header.pixelformat = format; header.num_glyphs = num_glyphs; header.num_rows = num_rows; D_DEBUG_AT( mkdgiff, " -> ascender %d, descender %d\n", header.ascender, header.descender ); D_DEBUG_AT( mkdgiff, " -> height %d, max advance %d\n", header.height, header.max_advance ); fwrite( &header, sizeof(header), 1, stdout ); fwrite( glyphs, sizeof(*glyphs), num_glyphs, stdout ); for (i=0; ipitch, row->height, stdout ); } out: for (i=0; idebug = true; direct_config->debugmem = true; /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -1; if (!size_count) { fprintf( stderr, "\n\nUsing default sizes 8, 10, 12, 16, 22, 32\n" ); size_count = 6; face_sizes[0] = 8; face_sizes[1] = 10; face_sizes[2] = 12; face_sizes[3] = 16; face_sizes[4] = 22; face_sizes[5] = 32; } header.num_faces = size_count; ret = FT_Init_FreeType( &library ); if (ret) { D_ERROR( "Initialization of the FreeType2 library failed!\n" ); goto out; } ret = FT_New_Face( library, filename, face_index, &face ); if (ret) { if (ret == FT_Err_Unknown_File_Format) D_ERROR( "Unsupported font format in file `%s'!\n", filename ); else D_ERROR( "Failed loading face %d from font file `%s'!\n", face_index, filename ); goto out; } ret = FT_Select_Charmap( face, ft_encoding_unicode ); if (ret) { D_ERROR( "Couldn't select Unicode encoding, falling back to Latin1.\n" ); ret = FT_Select_Charmap( face, ft_encoding_latin_1 ); if (ret) D_ERROR( "Couldn't even select Latin1 encoding!\n" ); } fwrite( &header, sizeof(header), 1, stdout ); for (i=0; i, Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include "dfb_types.h" int main( void ) { u8 byt; u32 pixel32; do { fread (&pixel32, 4, 1, stdin); #ifdef WORDS_BIGENDIAN pixel32 = (pixel32 << 16) | (pixel32 >> 16); #endif byt = (pixel32 & 0xff0000) >> 16; fwrite (&byt, 1, 1, stdout); byt = (pixel32 & 0x00ff00) >> 8; fwrite (&byt, 1, 1, stdout); byt = (pixel32 & 0x0000ff); fwrite (&byt, 1, 1, stdout); } while (!feof (stdin)); return 0; } DirectFB-1.2.10/tools/mkdfiff.c0000644000175000017500000003252511245562152013062 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include static DirectFBPixelFormatNames( format_names ); static const char *filename; static DFBSurfacePixelFormat format = DSPF_UNKNOWN; static DFBSurfacePixelFormat rgbformat = DSPF_UNKNOWN; /**********************************************************************************************************************/ static DFBResult load_image (const char *filename, DFBSurfaceDescription *desc) { DFBSurfacePixelFormat dest_format; DFBSurfacePixelFormat src_format; FILE *fp; png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_uint_32 width, height; unsigned char *data = NULL; int type; char header[8]; int bytes, pitch; dest_format = (desc->flags & DSDESC_PIXELFORMAT) ? desc->pixelformat : DSPF_UNKNOWN; desc->flags = 0; desc->preallocated[0].data = NULL; if (!(fp = fopen (filename, "rb"))) { fprintf (stderr, "Failed to open file '%s': %s.\n", filename, strerror (errno)); goto cleanup; } bytes = fread (header, 1, sizeof(header), fp); if (png_sig_cmp ((unsigned char*) header, 0, bytes)) { fprintf (stderr, "File '%s' doesn't seem to be a PNG image file.\n", filename); goto cleanup; } png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_ptr) goto cleanup; if (setjmp (png_ptr->jmpbuf)) { if (desc->preallocated[0].data) { free (desc->preallocated[0].data); desc->preallocated[0].data = NULL; } /* data might have been clobbered, set it to NULL and leak instead of crashing */ data = NULL; goto cleanup; } info_ptr = png_create_info_struct (png_ptr); if (!info_ptr) goto cleanup; png_init_io (png_ptr, fp); png_set_sig_bytes (png_ptr, bytes); png_read_info (png_ptr, info_ptr); png_get_IHDR (png_ptr, info_ptr, &width, &height, &bytes, &type, NULL, NULL, NULL); if (bytes == 16) png_set_strip_16 (png_ptr); #ifdef WORDS_BIGENDIAN png_set_swap_alpha (png_ptr); #else png_set_bgr (png_ptr); #endif src_format = (type & PNG_COLOR_MASK_ALPHA) ? DSPF_ARGB : DSPF_RGB32; switch (type) { case PNG_COLOR_TYPE_GRAY: if (dest_format == DSPF_A8) { src_format = DSPF_A8; break; } /* fallthru */ case PNG_COLOR_TYPE_GRAY_ALPHA: png_set_gray_to_rgb (png_ptr); if (rgbformat) dest_format = rgbformat; break; case PNG_COLOR_TYPE_PALETTE: png_set_palette_to_rgb (png_ptr); /* fallthru */ case PNG_COLOR_TYPE_RGB: if (rgbformat) dest_format = rgbformat; case PNG_COLOR_TYPE_RGB_ALPHA: if (dest_format == DSPF_RGB24) { png_set_strip_alpha (png_ptr); src_format = DSPF_RGB24; } break; } switch (src_format) { case DSPF_RGB32: png_set_filler (png_ptr, 0xFF, #ifdef WORDS_BIGENDIAN PNG_FILLER_BEFORE #else PNG_FILLER_AFTER #endif ); break; case DSPF_ARGB: case DSPF_A8: if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha (png_ptr); break; default: break; } pitch = (DFB_BYTES_PER_LINE( src_format, width ) + 7) & ~7; data = malloc (height * pitch); if (!data) { fprintf (stderr, "Failed to allocate %ld bytes.\n", height * pitch); goto cleanup; } { unsigned int i; png_bytep bptrs[height]; for (i = 0; i < height; i++) bptrs[i] = data + i * pitch; png_read_image (png_ptr, bptrs); } if (!dest_format) dest_format = src_format; if (DFB_BYTES_PER_PIXEL(src_format) != DFB_BYTES_PER_PIXEL(dest_format)) { unsigned char *s, *d, *dest; int d_pitch, h; D_ASSERT( DFB_BYTES_PER_PIXEL(src_format) == 4 ); d_pitch = (DFB_BYTES_PER_LINE(dest_format, width) + 7) & ~7; dest = malloc (height * d_pitch); if (!dest) { fprintf (stderr, "Failed to allocate %ld bytes.\n", height * d_pitch); goto cleanup; } h = height; switch (dest_format) { case DSPF_RGB16: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_rgb16 ((u32 *) s, (u16 *) d, width); break; case DSPF_ARGB1555: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_argb1555 ((u32 *) s, (u16 *) d, width); break; case DSPF_ARGB2554: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_argb2554 ((u32 *) s, (u16 *) d, width); break; case DSPF_ARGB4444: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_argb4444 ((u32 *) s, (u16 *) d, width); break; case DSPF_RGB332: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_rgb332 ((u32 *) s, (u8 *) d, width); break; case DSPF_A8: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_a8 ((u32 *) s, (u8 *) d, width); break; default: fprintf (stderr, "Sorry, unsupported format conversion.\n"); goto cleanup; } free (data); data = dest; pitch = d_pitch; } desc->flags = (DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED); desc->width = width; desc->height = height; desc->pixelformat = dest_format; desc->preallocated[0].pitch = pitch; desc->preallocated[0].data = data; data = NULL; cleanup: if (fp) fclose (fp); if (png_ptr) png_destroy_read_struct (&png_ptr, &info_ptr, NULL); if (data) free (data); return ((desc->flags) ? DFB_OK : DFB_FAILURE); } /**********************************************************************************************************************/ static void print_usage (const char *prg_name) { int i = 0; fprintf (stderr, "\nDirectFB Fast Image File Format Tool (version %s)\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options]\n\n", prg_name); fprintf (stderr, "Options:\n"); fprintf (stderr, " -f, --format Choose the pixel format (in all cases)\n"); fprintf (stderr, " -r, --rgbformat Choose the pixel format (in case of RGB)\n"); fprintf (stderr, " -h, --help Show this help message\n"); fprintf (stderr, " -v, --version Print version information\n"); fprintf (stderr, "\n"); fprintf (stderr, "Known pixel formats:\n"); while (format_names[i].format != DSPF_UNKNOWN) { DFBSurfacePixelFormat format = format_names[i].format; fprintf (stderr, " %-10s %2d bits, %d bytes", format_names[i].name, DFB_BITS_PER_PIXEL(format), DFB_BYTES_PER_PIXEL(format)); if (DFB_PIXELFORMAT_HAS_ALPHA(format)) fprintf (stderr, " ALPHA"); if (DFB_PIXELFORMAT_IS_INDEXED(format)) fprintf (stderr, " INDEXED"); if (DFB_PLANAR_PIXELFORMAT(format)) { int planes = DFB_PLANE_MULTIPLY(format, 1000); fprintf (stderr, " PLANAR (x%d.%03d)", planes / 1000, planes % 1000); } fprintf (stderr, "\n"); ++i; } fprintf (stderr, "\n"); } static DFBBoolean parse_format( const char *arg, DFBSurfacePixelFormat *ret_format ) { int i = 0; while (format_names[i].format != DSPF_UNKNOWN) { if (!strcasecmp( arg, format_names[i].name )) { *ret_format = format_names[i].format; return DFB_TRUE; } ++i; } fprintf (stderr, "\nInvalid format specified!\n\n" ); return DFB_FALSE; } static DFBBoolean parse_command_line( int argc, char *argv[] ) { int n; for (n = 1; n < argc; n++) { const char *arg = argv[n]; if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) { print_usage (argv[0]); return DFB_FALSE; } if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) { fprintf (stderr, "mkdfiff version %s\n", DIRECTFB_VERSION); return DFB_FALSE; } if (strcmp (arg, "-f") == 0 || strcmp (arg, "--format") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_format( argv[n], &format )) return DFB_FALSE; continue; } if (strcmp (arg, "-r") == 0 || strcmp (arg, "--rgbformat") == 0) { if (++n == argc) { print_usage (argv[0]); return DFB_FALSE; } if (!parse_format( argv[n], &rgbformat )) return DFB_FALSE; continue; } if (filename || access( arg, R_OK )) { print_usage (argv[0]); return DFB_FALSE; } filename = arg; } if (!filename) { print_usage (argv[0]); return DFB_FALSE; } return DFB_TRUE; } /**********************************************************************************************************************/ static DFIFFHeader header = { magic: { 'D', 'F', 'I', 'F', 'F' }, major: 0, minor: 0, flags: DFIFF_FLAG_LITTLE_ENDIAN }; int main( int argc, char *argv[] ) { int i; DFBSurfaceDescription desc = { flags: DSDESC_NONE }; /* Parse the command line. */ if (!parse_command_line( argc, argv )) return -1; if (format != DSPF_UNKNOWN) { desc.flags |= DSDESC_PIXELFORMAT; desc.pixelformat = format; } if (load_image( filename, &desc )) return -2; for (i=0; i, Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . directfb-csource is based on gdk-pixbuf-csource, a GdkPixbuf based image CSource generator Copyright (C) 1999, 2001 Tim Janik This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include static struct { DFBSurfacePixelFormat format; const char *name; } pixelformats[] = { { DSPF_ARGB, "ARGB" }, { DSPF_ARGB1555, "ARGB1555" }, { DSPF_ARGB2554, "ARGB2554" }, { DSPF_ARGB4444, "ARGB4444" }, { DSPF_RGB32, "RGB32" }, { DSPF_RGB24, "RGB24" }, { DSPF_RGB16, "RGB16" }, { DSPF_RGB332, "RGB332" }, { DSPF_A8, "A8" }, { DSPF_LUT8, "LUT8" } }; static int n_pixelformats = D_ARRAY_SIZE( pixelformats ); static void print_usage (const char *prg_name); static DFBResult load_image (const char *filename, DFBSurfaceDescription *desc, DFBColor *palette, int *palette_size, DFBSurfacePixelFormat rgbformat); static DFBResult merge_images (DFBSurfaceDescription *images, int num_images, DFBSurfaceDescription *dest, DFBRectangle *rectangles); static DFBResult dump_raw_data (const char *name, const unsigned char *data, unsigned int len); static DFBResult dump_image (const char *name, DFBSurfaceDescription *desc, DFBColor *palette, int palette_size); static DFBResult dump_rectangles (const char *name, DFBRectangle *rectangles, const char **names, int num_rects); static char * variable_name (const char *name); static char * base_name (const char *name); int main (int argc, const char *argv[]) { DFBSurfaceDescription desc = { flags: 0 }; DFBSurfacePixelFormat format = DSPF_UNKNOWN; DFBSurfacePixelFormat rgbformat = DSPF_UNKNOWN; DFBColor palette[256]; const char *filename[argc]; const char *name = NULL; int palette_size = 0; int num_images = 0; int i, n; int rawmode = 0; /* parse command line */ for (n = 1; n < argc; n++) { if (strncmp (argv[n], "--", 2) == 0) { const char *arg = argv[n] + 2; if (strcmp (arg, "help") == 0) { print_usage (argv[0]); return EXIT_SUCCESS; } if (strcmp (arg, "version") == 0) { fprintf (stderr, "directfb-csource version %s\n", DIRECTFB_VERSION); return EXIT_SUCCESS; } if (strcmp (arg, "raw") == 0) { rawmode = 1; continue; } if (strncmp (arg, "format=", 7) == 0 && !format) { for (i = 0; i < n_pixelformats && !format; i++) if (!strcasecmp (pixelformats[i].name, arg + 7)) format = pixelformats[i].format; if (format) continue; } if (strncmp (arg, "rgbformat=", 10) == 0 && !rgbformat) { for (i = 0; i < n_pixelformats && !rgbformat; i++) if (!strcasecmp (pixelformats[i].name, arg + 10)) rgbformat = pixelformats[i].format; if (rgbformat) continue; } if (strncmp (arg, "name=", 5) == 0 && !name) { name = arg + 5; if (*name) continue; } print_usage (argv[0]); return EXIT_FAILURE; } filename[num_images++] = argv[n]; } /* check parameters */ if (! num_images) { print_usage (argv[0]); return EXIT_FAILURE; } if (num_images > 1 && rawmode) { fprintf (stderr, "Multiple input files not allowed in raw mode.\n"); return EXIT_FAILURE; } if (num_images > 1 && !name) { fprintf (stderr, "You must specify a variable name when using multiple images.\n"); return EXIT_FAILURE; } /* load the first image */ if (rawmode) { struct stat statbuf; if (0 == stat(filename[0], &statbuf)) { FILE *f; unsigned char *data = alloca(statbuf.st_size); memset(data, 0, statbuf.st_size); f = fopen(filename[0], "r"); if (f) { fread(data, statbuf.st_size, 1, f); fclose(f); } return dump_raw_data(name ? : strrchr (filename[0], '/') ? : filename[0], data, statbuf.st_size); } } else { if (format) { desc.flags = DSDESC_PIXELFORMAT; desc.pixelformat = format; } if (load_image (filename[0], &desc, palette, &palette_size, rgbformat) != DFB_OK) return EXIT_FAILURE; /* dump it and quit if this is the only image on the command line */ if (num_images == 1) return dump_image (name ? : strrchr (filename[0], '/') ? : filename[0], &desc, palette, palette_size); } /* merge multiple images into one surface */ { DFBSurfaceDescription image[num_images]; DFBRectangle rect[num_images]; DFBColor foo[256]; int foo_size; image[0] = desc; for (i = 1; i < num_images; i++) { image[i].flags = DSDESC_PIXELFORMAT; image[i].pixelformat = desc.pixelformat; if (load_image (filename[i], image + i, foo, &foo_size, rgbformat) != DFB_OK) return EXIT_FAILURE; } if (merge_images (image, num_images, &desc, rect) != DFB_OK) return EXIT_FAILURE; /* dump the rectangles, then the surface */ if (dump_rectangles (name, rect, filename, num_images) != DFB_OK) return EXIT_FAILURE; return dump_image (name, &desc, palette, palette_size); } } static void print_usage (const char *prg_name) { fprintf (stderr, "directfb-csource version %s\n\n", DIRECTFB_VERSION); fprintf (stderr, "Usage: %s [options] \n", prg_name); fprintf (stderr, " --name= specifies variable name\n"); fprintf (stderr, " --format= specifies surface format\n"); fprintf (stderr, " --rgbformat= specifies format for non-alpha images\n"); fprintf (stderr, " --multi multiple images\n"); fprintf (stderr, " --raw dump a single file directly to header\n"); fprintf (stderr, " --help show this help message\n"); fprintf (stderr, " --version print version information\n"); fprintf (stderr, "\n"); fprintf (stderr, "See the directfb-csource(1) man-page for more information.\n"); fprintf (stderr, "\n"); } static DFBResult load_image (const char *filename, DFBSurfaceDescription *desc, DFBColor *palette, int *palette_size, DFBSurfacePixelFormat rgbformat) { DFBSurfacePixelFormat dest_format; DFBSurfacePixelFormat src_format; FILE *fp; png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_uint_32 width, height; unsigned char *data = NULL; int type; char header[8]; int bytes, pitch; dest_format = (desc->flags & DSDESC_PIXELFORMAT) ? desc->pixelformat : DSPF_UNKNOWN; desc->flags = 0; desc->preallocated[0].data = NULL; if (!(fp = fopen (filename, "rb"))) { fprintf (stderr, "Failed to open file '%s': %s.\n", filename, strerror (errno)); goto cleanup; } bytes = fread (header, 1, sizeof(header), fp); if (png_sig_cmp ((unsigned char*) header, 0, bytes)) { fprintf (stderr, "File '%s' doesn't seem to be a PNG image file.\n", filename); goto cleanup; } png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_ptr) goto cleanup; if (setjmp (png_ptr->jmpbuf)) { if (desc->preallocated[0].data) { free (desc->preallocated[0].data); desc->preallocated[0].data = NULL; } /* data might have been clobbered, set it to NULL and leak instead of crashing */ data = NULL; goto cleanup; } info_ptr = png_create_info_struct (png_ptr); if (!info_ptr) goto cleanup; png_init_io (png_ptr, fp); png_set_sig_bytes (png_ptr, bytes); png_read_info (png_ptr, info_ptr); png_get_IHDR (png_ptr, info_ptr, &width, &height, &bytes, &type, NULL, NULL, NULL); if (bytes == 16) png_set_strip_16 (png_ptr); #ifdef WORDS_BIGENDIAN png_set_swap_alpha (png_ptr); #else png_set_bgr (png_ptr); #endif src_format = (type & PNG_COLOR_MASK_ALPHA) ? DSPF_ARGB : DSPF_RGB32; switch (type) { case PNG_COLOR_TYPE_GRAY: if (dest_format == DSPF_A8) { src_format = DSPF_A8; break; } /* fallthru */ case PNG_COLOR_TYPE_GRAY_ALPHA: png_set_gray_to_rgb (png_ptr); if (rgbformat) dest_format = rgbformat; break; case PNG_COLOR_TYPE_PALETTE: if (dest_format == DSPF_LUT8) { src_format = DSPF_LUT8; break; } png_set_palette_to_rgb (png_ptr); /* fallthru */ case PNG_COLOR_TYPE_RGB: if (rgbformat) dest_format = rgbformat; case PNG_COLOR_TYPE_RGB_ALPHA: if (dest_format == DSPF_RGB24) { png_set_strip_alpha (png_ptr); src_format = DSPF_RGB24; } break; } switch (src_format) { case DSPF_LUT8: if (info_ptr->num_palette) { png_byte *alpha; int i, num; *palette_size = MIN (info_ptr->num_palette, 256); for (i = 0; i < *palette_size; i++) { palette[i].a = 0xFF; palette[i].r = info_ptr->palette[i].red; palette[i].g = info_ptr->palette[i].green; palette[i].b = info_ptr->palette[i].blue; } if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) { png_get_tRNS (png_ptr, info_ptr, &alpha, &num, NULL); for (i = 0; i < MIN (num, *palette_size); i++) palette[i].a = alpha[i]; } } break; case DSPF_RGB32: png_set_filler (png_ptr, 0xFF, #ifdef WORDS_BIGENDIAN PNG_FILLER_BEFORE #else PNG_FILLER_AFTER #endif ); break; case DSPF_ARGB: case DSPF_A8: if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha (png_ptr); break; default: break; } pitch = width * DFB_BYTES_PER_PIXEL (src_format); if (pitch & 3) pitch += 4 - (pitch & 3); data = malloc (height * pitch); if (!data) { fprintf (stderr, "Failed to allocate %ld bytes.\n", height * pitch); goto cleanup; } { unsigned int i; png_bytep bptrs[height]; for (i = 0; i < height; i++) bptrs[i] = data + i * pitch; png_read_image (png_ptr, bptrs); } if (!dest_format) dest_format = src_format; if (DFB_BYTES_PER_PIXEL(src_format) != DFB_BYTES_PER_PIXEL(dest_format)) { unsigned char *s, *d, *dest; int d_pitch, h; assert (DFB_BYTES_PER_PIXEL (src_format) == 4); d_pitch = width * DFB_BYTES_PER_PIXEL (dest_format); if (d_pitch & 3) d_pitch += 4 - (d_pitch & 3); dest = malloc (height * d_pitch); if (!dest) { fprintf (stderr, "Failed to allocate %ld bytes.\n", height * d_pitch); goto cleanup; } h = height; switch (dest_format) { case DSPF_RGB16: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_rgb16 ((u32 *) s, (u16 *) d, width); break; case DSPF_ARGB1555: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_argb1555 ((u32 *) s, (u16 *) d, width); break; case DSPF_ARGB2554: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_argb2554 ((u32 *) s, (u16 *) d, width); break; case DSPF_ARGB4444: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_argb4444 ((u32 *) s, (u16 *) d, width); break; case DSPF_RGB332: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_rgb332 ((u32 *) s, (u8 *) d, width); break; case DSPF_A8: for (s = data, d = dest; h; h--, s += pitch, d += d_pitch) dfb_argb_to_a8 ((u32 *) s, (u8 *) d, width); break; default: fprintf (stderr, "Sorry, unsupported format conversion.\n"); goto cleanup; } free (data); data = dest; pitch = d_pitch; } desc->flags = (DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED); desc->width = width; desc->height = height; desc->pixelformat = dest_format; desc->preallocated[0].pitch = pitch; desc->preallocated[0].data = data; data = NULL; cleanup: if (fp) fclose (fp); if (png_ptr) png_destroy_read_struct (&png_ptr, &info_ptr, NULL); if (data) free (data); return ((desc->flags) ? DFB_OK : DFB_FAILURE); } static DFBResult merge_images (DFBSurfaceDescription *images, int num_images, DFBSurfaceDescription *dest, DFBRectangle *rectangles) { DFBSurfaceDescription *image = images; DFBRectangle *rect = rectangles; unsigned char *data; int bpp; int pitch, i; rect->x = 0; rect->y = 0; rect->w = image->width; rect->h = image->height; dest->flags = (DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED); dest->pixelformat = image->pixelformat; bpp = DFB_BYTES_PER_PIXEL (dest->pixelformat); if (bpp == 1) dest->width = (rect->w + 3) & ~3; else dest->width = rect->w; dest->height = rect->h; for (i = 1; i < num_images; i++) { image++; rect++; if (image->pixelformat != dest->pixelformat) return DFB_INVARG; rect->x = dest->width; rect->y = 0; rect->w = image->width; rect->h = image->height; if (bpp == 1) dest->width += (rect->w + 3) & ~3; else dest->width += rect->w; if (dest->height < rect->h) dest->height = rect->h; } pitch = (dest->width * bpp + 3) &~ 3; data = malloc (dest->height * pitch); if (!data) { fprintf (stderr, "Failed to allocate %ld bytes.\n", (long) dest->height * pitch); return DFB_FAILURE; } for (i = 0, image = images, rect = rectangles; i < num_images; i++, image++, rect++) { unsigned char *dest = data + rect->x * bpp; unsigned char *src = image->preallocated[0].data; int height = rect->h; do { memcpy (dest, src, rect->w * bpp); src += image->preallocated[0].pitch; dest += pitch; } while (--height); } dest->preallocated[0].pitch = pitch; dest->preallocated[0].data = data; return DFB_OK; } typedef struct { FILE *fp; int pos; bool pad; } CSourceData; static inline void save_uchar (CSourceData *csource, unsigned char d) { if (csource->pos > 70) { fprintf (csource->fp, "\"\n \""); csource->pos = 3; csource->pad = false; } if (d < 33 || d > 126) { fprintf (csource->fp, "\\%o", d); csource->pos += 1 + 1 + (d > 7) + (d > 63); csource->pad = d < 64; return; } if (d == '\\') { fprintf (csource->fp, "\\\\"); csource->pos += 2; } else if (d == '"') { fprintf (csource->fp, "\\\""); csource->pos += 2; } else if (csource->pad && d >= '0' && d <= '9') { fprintf (csource->fp, "\"\"%c", d); csource->pos += 3; } else { fputc (d, csource->fp); csource->pos += 1; } csource->pad = false; return; } static void dump_data(CSourceData *csource, const char *name, const unsigned char *data, unsigned int len) { fprintf (csource->fp, "static const unsigned char %s_data[] =\n", name); fprintf (csource->fp, " \""); csource->pos = 3; do save_uchar (csource, *data++); while (--len); fprintf (csource->fp, "\";\n\n"); } static DFBResult dump_raw_data(const char *name, const unsigned char *data, unsigned int len) { CSourceData csource = { stdout, 0, 0 }; char *vname = variable_name (name); if (!data || !len) return DFB_INVARG; fprintf (csource.fp, "/* DirectFB raw data dump created by directfb-csource %s */\n\n", DIRECTFB_VERSION); dump_data(&csource, vname, data, len); free (vname); return DFB_OK; } static DFBResult dump_image (const char *name, DFBSurfaceDescription *desc, DFBColor *palette, int palette_size) { CSourceData csource = { stdout, 0, 0 }; const char *format = NULL; char *vname = variable_name (name); unsigned char *data; unsigned long len; int i; if (desc && desc->flags != (DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED)) return DFB_INVARG; for (i = 0; i < n_pixelformats && !format; i++) if (pixelformats[i].format == desc->pixelformat) format = pixelformats[i].name; if (!format) return DFB_INVARG; data = (unsigned char *) desc->preallocated[0].data; len = desc->height * desc->preallocated[0].pitch; if (!len) return DFB_INVARG; /* dump comment */ fprintf (csource.fp, "/* DirectFB surface dump created by directfb-csource %s */\n\n", DIRECTFB_VERSION); /* dump data */ dump_data(&csource, vname, data, len); /* dump palette */ if (palette_size > 0) { fprintf (csource.fp, "static const DFBColor %s_palette[%d] = {\n", vname, palette_size); for (i = 0; i < palette_size; i++) fprintf (csource.fp, " { 0x%02x, 0x%02x, 0x%02x, 0x%02x }%c\n", palette[i].a, palette[i].r, palette[i].g, palette[i].b, i+1 < palette_size ? ',' : ' '); fprintf (csource.fp, "};\n\n"); } /* dump description */ fprintf (csource.fp, "static const DFBSurfaceDescription %s_desc = {\n", vname); fprintf (csource.fp, " flags : DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT |\n" " DSDESC_PREALLOCATED"); if (palette_size > 0) fprintf (csource.fp, " | DSDESC_PALETTE"); fprintf (csource.fp, ",\n"); fprintf (csource.fp, " width : %d,\n", desc->width); fprintf (csource.fp, " height : %d,\n", desc->height); fprintf (csource.fp, " pixelformat : DSPF_%s,\n", format); fprintf (csource.fp, " preallocated : {{ data : (void *) %s_data,\n", vname); fprintf (csource.fp, " pitch : %d }}", desc->preallocated[0].pitch); if (palette_size > 0) { fprintf (csource.fp, ",\n"); fprintf (csource.fp, " palette : { entries : %s_palette,\n", vname); fprintf (csource.fp, " size : %d }", palette_size); } fprintf (csource.fp, "\n};\n\n"); free (vname); return DFB_OK; } static DFBResult dump_rectangles (const char *name, DFBRectangle *rectangles, const char **names, int num_rects) { DFBRectangle *rect; const char *blanks = " "; char *vname = variable_name (name); FILE *fp = stdout; int len, i; if (num_rects < 1) return DFB_INVARG; fprintf (fp, "/* DirectFB multi-surface dump created by directfb-csource %s */\n\n", DIRECTFB_VERSION); fprintf (fp, "static const struct {\n" " const char *name;\n" " DFBRectangle rect;\n" "} %s[] = {\n", vname); for (i = 0, len = 0; i < num_rects; i++) len = MAX (len, strlen (names[i])); len = len + 4 - strlen (blanks); for (i = 0, rect = rectangles; i < num_rects; i++, rect++) { char *v = base_name (names[i]); if (i) fprintf (fp, ",\n"); if (len < 0) { int l = fprintf (fp, " { \"%s\", ", v); fprintf (fp, blanks - len + l); fprintf (fp, "{ x : %4d, y : %4d, w : %4d, h : %4d } }", rect->x, rect->y, rect->w, rect->h); } else { fprintf (fp, " { \"%s\",\n" " { x : %4d, y : %4d, w : %4d, h : %4d } }", v, rect->x, rect->y, rect->w, rect->h); } free (v); } fprintf (fp, "\n};\n\n"); free (vname); return DFB_OK; } static char * variable_name (const char *name) { char *vname = strdup (name); char *v = vname; while (DFB_TRUE) { switch (*v) { case 0: return vname; case 'a'...'z': case 'A'...'Z': case '0'...'9': case '_': break; default: *v = '_'; } v++; } } static char * base_name (const char *name) { char *vname = strdup (name); char *v = vname; while (DFB_TRUE) { switch (*v) { case '.': *v = 0; case 0: return vname; default: break; } v++; } } DirectFB-1.2.10/tools/fusion_bench.c0000644000175000017500000002757011245562152014122 00000000000000/* (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp , Andreas Hundt , Sven Neumann , Ville Syrjälä and Claudio Ciccani . This file is subject to the terms and conditions of the MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static long long t1, t2; static unsigned int loops; static FusionWorld *world; #define BENCH_START() do { sync(); usleep(100000); sync(); t1 = direct_clock_get_millis(); loops = 0; } while (0) #define BENCH_STOP() do { t2 = direct_clock_get_millis(); } while (0) #define BENCH_LOOP() while ((++loops & 0xfff) || (direct_clock_get_millis() - t1 < 1000)) #define BENCH_RESULT() (loops / (float)(t2 - t1)) #define BENCH_RESULT_BY(x) ((loops * x) / (float)(t2 - t1)) static ReactionResult reaction_callback (const void *msg_data, void *ctx) { return RS_OK; } static void bench_reactor( void ) { FusionReactor *reactor; Reaction reaction; Reaction reaction2; GlobalReaction global_reaction; reactor = fusion_reactor_new( 16, "Benchmark", world ); if (!reactor) { fprintf( stderr, "Fusion Error\n" ); return; } /* reactor attach/detach */ BENCH_START(); BENCH_LOOP() { fusion_reactor_attach( reactor, reaction_callback, NULL, &reaction ); fusion_reactor_detach( reactor, &reaction ); } BENCH_STOP(); printf( "reactor attach/detach -> %8.2f k/sec\n", BENCH_RESULT() ); /* reactor attach/detach (2nd) */ fusion_reactor_attach( reactor, reaction_callback, NULL, &reaction ); BENCH_START(); BENCH_LOOP() { fusion_reactor_attach( reactor, reaction_callback, NULL, &reaction2 ); fusion_reactor_detach( reactor, &reaction2 ); } BENCH_STOP(); fusion_reactor_detach( reactor, &reaction ); printf( "reactor attach/detach (2nd) -> %8.2f k/sec\n", BENCH_RESULT() ); /* reactor attach/detach (global) */ fusion_reactor_attach( reactor, reaction_callback, NULL, &reaction ); BENCH_START(); BENCH_LOOP() { fusion_reactor_attach_global( reactor, 0, NULL, &global_reaction ); fusion_reactor_detach_global( reactor, &global_reaction ); } BENCH_STOP(); fusion_reactor_detach( reactor, &reaction ); printf( "reactor attach/detach (global) -> %8.2f k/sec\n", BENCH_RESULT() ); /* reactor dispatch */ fusion_reactor_attach( reactor, reaction_callback, NULL, &reaction ); BENCH_START(); BENCH_LOOP() { char msg[16]; fusion_reactor_dispatch( reactor, msg, true, NULL ); } BENCH_STOP(); printf( "reactor dispatch -> %8.2f k/sec\n", BENCH_RESULT() ); fusion_reactor_detach( reactor, &reaction ); fusion_reactor_free( reactor ); printf( "\n" ); } static void bench_ref( void ) { DirectResult ret; FusionRef ref; ret = fusion_ref_init( &ref, "Benchmark", world ); if (ret) { fprintf( stderr, "Fusion Error %d\n", ret ); return; } /* ref up/down (local) */ BENCH_START(); BENCH_LOOP() { fusion_ref_up( &ref, false ); fusion_ref_down( &ref, false ); } BENCH_STOP(); printf( "ref up/down (local) -> %8.2f k/sec\n", BENCH_RESULT() ); /* ref up/down (global) */ BENCH_START(); BENCH_LOOP() { fusion_ref_up( &ref, true ); fusion_ref_down( &ref, true ); } BENCH_STOP(); printf( "ref up/down (global) -> %8.2f k/sec\n", BENCH_RESULT() ); fusion_ref_destroy( &ref ); printf( "\n" ); } static void bench_property( void ) { DirectResult ret; FusionProperty property; ret = fusion_property_init( &property, world ); if (ret) { fprintf( stderr, "Fusion Error %d\n", ret ); return; } /* property lease/cede */ BENCH_START(); BENCH_LOOP() { fusion_property_lease( &property ); fusion_property_cede( &property ); } BENCH_STOP(); printf( "property lease/cede -> %8.2f k/sec\n", BENCH_RESULT() ); fusion_property_destroy( &property ); printf( "\n" ); } static void bench_skirmish( void ) { DirectResult ret; FusionSkirmish skirmish; ret = fusion_skirmish_init( &skirmish, "Benchmark", world ); if (ret) { fprintf( stderr, "Fusion Error %d\n", ret ); return; } /* skirmish prevail/dismiss */ BENCH_START(); BENCH_LOOP() { fusion_skirmish_prevail( &skirmish ); fusion_skirmish_dismiss( &skirmish ); } BENCH_STOP(); printf( "skirmish prevail/dismiss -> %8.2f k/sec\n", BENCH_RESULT() ); fusion_skirmish_destroy( &skirmish ); printf( "\n" ); } static void * prevail_dismiss_loop( void *arg ) { FusionSkirmish *skirmish = (FusionSkirmish *) arg; BENCH_LOOP() { fusion_skirmish_prevail( skirmish ); fusion_skirmish_dismiss( skirmish ); } return NULL; } static void bench_skirmish_threaded( void ) { int i; DirectResult ret; FusionSkirmish skirmish; ret = fusion_skirmish_init( &skirmish, "Threaded Benchmark", world ); if (ret) { fprintf( stderr, "Fusion Error %d\n", ret ); return; } /* skirmish prevail/dismiss (2-5 threads) */ for (i=2; i<=5; i++) { int t; pthread_t threads[i]; BENCH_START(); for (t=0; t %8.2f k/sec\n", i, BENCH_RESULT() ); } fusion_skirmish_destroy( &skirmish ); printf( "\n" ); } static void * mutex_lock_unlock_loop( void *arg ) { pthread_mutex_t *lock = (pthread_mutex_t *) arg; BENCH_LOOP() { pthread_mutex_lock( lock ); pthread_mutex_unlock( lock ); } return NULL; } static void bench_mutex_threaded( void ) { int i; pthread_mutex_t lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; /* mutex lock/unlock (2-5 threads) */ for (i=2; i<=5; i++) { int t; pthread_t threads[i]; BENCH_START(); for (t=0; t %8.2f k/sec\n", i, BENCH_RESULT() ); } pthread_mutex_destroy( &lock ); printf( "\n" ); } static void bench_mutex( void ) { pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t rmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; /* pthread_mutex lock/unlock */ BENCH_START(); BENCH_LOOP() { pthread_mutex_lock( &mutex ); pthread_mutex_unlock( &mutex ); } BENCH_STOP(); printf( "mutex lock/unlock -> %8.2f k/sec\n", BENCH_RESULT() ); /* pthread_mutex lock/unlock */ BENCH_START(); BENCH_LOOP() { pthread_mutex_lock( &rmutex ); pthread_mutex_unlock( &rmutex ); } BENCH_STOP(); printf( "mutex lock/unlock (recursive) -> %8.2f k/sec\n", BENCH_RESULT() ); pthread_mutex_destroy( &mutex ); pthread_mutex_destroy( &rmutex ); printf( "\n" ); } static void bench_flock( void ) { int fd; FILE *tmp; tmp = tmpfile(); if (!tmp) { perror( "tmpfile()" ); return; } fd = fileno( tmp ); if (fd < 0) { perror( "fileno()" ); fclose( tmp ); return; } BENCH_START(); BENCH_LOOP() { flock( fd, LOCK_EX ); flock( fd, LOCK_UN ); } BENCH_STOP(); printf( "flock lock/unlock -> %8.2f k/sec\n", BENCH_RESULT() ); printf( "\n" ); fclose( tmp ); } static void bench_shmpool( bool debug ) { DirectResult ret; void *mem[256]; const int sizes[8] = { 12, 36, 200, 120, 39, 3082, 8, 1040 }; FusionSHMPoolShared *pool; ret = fusion_shm_pool_create( world, "Benchmark Pool", 524288, debug, &pool ); if (ret) { DirectFBError( "fusion_shm_pool_create() failed", ret ); return; } BENCH_START(); BENCH_LOOP() { int i; for (i=0; i<128; i++) mem[i] = SHMALLOC( pool, sizes[i&7] ); for (i=0; i<64; i++) SHFREE( pool, mem[i] ); for (i=128; i<192; i++) mem[i] = SHMALLOC( pool, sizes[i&7] ); for (i=64; i<128; i++) SHFREE( pool, mem[i] ); for (i=192; i<256; i++) mem[i] = SHMALLOC( pool, sizes[i&7] ); for (i=128; i<256; i++) SHFREE( pool, mem[i] ); } BENCH_STOP(); printf( "shm pool alloc/free %s -> %8.2f k/sec\n", debug ? "(debug)" : " ", BENCH_RESULT_BY(256) ); fusion_shm_pool_destroy( world, pool ); } int main( int argc, char *argv[] ) { DirectResult ret; /* Initialize DirectFB. */ ret = DirectFBInit( &argc, &argv ); if (ret) return DirectFBError( "DirectFBInit()", ret ); dfb_system_lookup(); ret = fusion_enter( -1, 0, FER_MASTER, &world ); if (ret) return DirectFBError( "fusion_enter()", ret ); printf( "\n" ); #if FUSION_BUILD_MULTI printf( "Fusion Benchmark (Multi Application Core)\n" ); #else printf( "Fusion Benchmark (Single Application Core)\n" ); #endif printf( "\n" ); bench_flock(); bench_mutex(); bench_mutex_threaded(); bench_skirmish(); bench_skirmish_threaded(); //bench_spinlock_threaded(); bench_property(); bench_ref(); bench_reactor(); bench_shmpool( false ); bench_shmpool( true ); printf( "\n" ); fusion_exit( world, false ); return 0; } DirectFB-1.2.10/config.sub0000755000175000017500000007772410707444443012151 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: DirectFB-1.2.10/configure.in0000644000175000017500000012725111307521345012460 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(include/directfb.h) AC_PREREQ(2.52) # # Making releases: # DIRECTFB_MICRO_VERSION += 1; # DIRECTFB_INTERFACE_AGE += 1; # DIRECTFB_BINARY_AGE += 1; # if any functions have been added, set DIRECTFB_INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set DIRECTFB_BINARY_AGE and DIRECTFB_INTERFACE_AGE to 0. # # DIRECTFB_MAJOR_VERSION=1 DIRECTFB_MINOR_VERSION=2 DIRECTFB_MICRO_VERSION=10 DIRECTFB_INTERFACE_AGE=1 DIRECTFB_BINARY_AGE=1 DIRECTFB_VERSION=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION.$DIRECTFB_MICRO_VERSION AC_SUBST(DIRECTFB_MAJOR_VERSION) AC_SUBST(DIRECTFB_MINOR_VERSION) AC_SUBST(DIRECTFB_MICRO_VERSION) AC_SUBST(DIRECTFB_INTERFACE_AGE) AC_SUBST(DIRECTFB_BINARY_AGE) AC_SUBST(DIRECTFB_VERSION) AC_DEFINE_UNQUOTED(DIRECTFB_VERSION,"$DIRECTFB_VERSION",[The DirectFB version]) # libtool versioning LT_RELEASE=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION LT_CURRENT=`expr $DIRECTFB_MICRO_VERSION - $DIRECTFB_INTERFACE_AGE` LT_BINARY=`expr $DIRECTFB_MICRO_VERSION - $DIRECTFB_BINARY_AGE` LT_REVISION=$DIRECTFB_INTERFACE_AGE LT_AGE=`expr $DIRECTFB_BINARY_AGE - $DIRECTFB_INTERFACE_AGE` AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_BINARY) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) # The earliest version that this release has binary compatibility with. # This is used for module locations. BINARY_VERSION=$DIRECTFB_MAJOR_VERSION.$DIRECTFB_MINOR_VERSION-$LT_BINARY VERSION=$DIRECTFB_VERSION PACKAGE=DirectFB AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) PKG_PROG_PKG_CONFIG AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_DISABLE_STATIC case x"$target" in xNONE | x) target_or_host="$host" ;; *) target_or_host="$target" ;; esac case "$target_or_host" in *-cygwin) dnl AC_ENABLE_STATIC dnl AC_DISABLE_SHARED ;; esac AC_PROG_CC AM_PROG_CC_C_O ifdef([AM_PROG_AS],[AM_PROG_AS],[]) AM_PROG_LIBTOOL AM_SANITY_CHECK AC_SUBST(LD) AC_ISC_POSIX AC_PROG_INSTALL AC_PROG_MAKE_SET AC_HEADER_STDC AC_C_BIGENDIAN AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) ## Work around libstuhl during cross build... if test "$host" != "$build"; then sys_lib_dlsearch_path_spec="" sys_lib_search_path_spec="" fi AC_PATH_PROGS(PERL, perl5 perl) AC_PATH_PROG(MAN2HTML, man2html, no) AC_SUBST(MAN2HTML) AM_CONDITIONAL(HAVE_MAN2HTML, test "$MAN2HTML" != "no") dnl Test for OSX AC_ARG_ENABLE(osx, [ --enable-osx build with Mac OS X support [[default=auto]]],, enable_osx=yes) if test "$enable_osx" = "yes"; then AC_CHECK_HEADER(Carbon/Carbon.h, osx_found=yes, osx_found=no) if test "$osx_found" = no; then enable_osx=no AC_MSG_WARN([ *** no Carbon/Carbon.h found -- building without Mac OS X support.]) else OSX_LIBS="-framework Carbon" fi fi AM_CONDITIONAL(OSX_CORE, test "$enable_osx" = "yes") dnl Test for X11 AC_ARG_ENABLE(x11, [ --enable-x11 build with X11 support [[default=auto]]],, enable_x11=yes) if test "$enable_x11" = "yes"; then CFLAGS_saved="$CFLAGS" CFLAGS="$CFLAGS -I/usr/X11R6/include" AC_CHECK_HEADER(X11/X.h, x11_found=yes, x11_found=no) CFLAGS="$CFLAGS_saved" if test "$x11_found" = no; then enable_x11=no AC_MSG_WARN([ *** no X11/X.h found -- building without X11 support.]) else X11_LIBS="-L/usr/X11R6/lib -lX11 -lXext" X11_CFLAGS="-I/usr/X11R6/include" fi fi AM_CONDITIONAL(X11_CORE, test "$enable_x11" = "yes") AC_CHECK_HEADERS(linux/compiler.h linux/unistd.h asm/page.h) dnl Clear default CFLAGS if test x"$CFLAGS" = x"-g -O2"; then CFLAGS= fi CFLAGS="-O3 -ffast-math -pipe $CFLAGS" DFB_INTERNAL_CFLAGS="-D_GNU_SOURCE $DFB_INTERNAL_CFLAGS" AC_ARG_ENABLE(extra-warnings, [ --enable-extra-warnings enable extra warnings [[default=no]]],, enable_extra_warnings=no) if test "$enable_extra_warnings" = "yes"; then CFLAGS="-W -Wno-sign-compare -Wno-unused-parameter -Wundef -Wcast-qual -Wcast-align -Waggregate-return -Wmissing-declarations -Winline $CFLAGS" fi # FIXME #if test "$GCC" = "yes"; then # CFLAGS="-Wall -Wno-strict-aliasing $CFLAGS" #fi # # check target architecture # have_x86=no have_x86_64=no have_arm=no have_ppc=no have_sh4=no case "$target_or_host" in i*86-*-*) have_x86=yes AC_DEFINE(ARCH_X86,1,[Define to 1 if you are compiling for ix86.]) ;; x86_64-*) have_x86=yes have_x86_64=yes AC_DEFINE(ARCH_X86_64,1,[Define to 1 if you are compiling for AMD64.]) ;; *arm*) have_arm=yes ;; ppc-*-linux* | powerpc-*) have_ppc=yes AC_DEFINE(ARCH_PPC,1,[Define to 1 if you are compiling for PowerPC.]) ;; sh4-* | sh3-*) have_sh4=yes AC_DEFINE(ARCH_SH4,1,[Define to 1 if you are compiling for SH4.]) ;; *) ;; esac have_linux=no have_cygwin=no have_kos=no need_libc_r=no need_libdl=yes want_ppcasm=yes case "$target_or_host" in *-linux*) have_linux=yes ;; *-cygwin) have_cygwin=yes need_libdl=no ;; *-freebsd*) need_libc_r=yes need_libdl=no want_ppcasm=yes CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; *-openbsd*) need_libc_r=yes need_libdl=no want_ppcasm=no CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; *-netbsd*) need_libc_r=no need_libdl=no want_ppcasm=yes CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -L/usr/pkg/lib" ;; *-darwin*) need_libc_r=no need_libdl=yes want_ppcasm=no CPPFLAGS="$CPPFLAGS -I/sw/include" LDFLAGS="$LDFLAGS -L/sw/lib" ;; sh-*-elf) if test "$CC" = "kos-cc"; then need_libc_r=no need_libdl=no have_kos=yes fi ;; esac AM_CONDITIONAL(HAVE_LINUX, test "$have_linux" = "yes") AM_CONDITIONAL(BUILDPPCASM, test "$have_ppc" = "yes" && test "$want_ppcasm" = "yes") if test "$have_ppc" = "yes" && test "$want_ppcasm" = "yes"; then AC_DEFINE(USE_PPCASM,1,[Define to 1 if ppc assembly is available.]) fi if test "$have_kos" = "yes"; then AC_DEFINE(USE_KOS,1,[Define to 1 if compiling on KallistiOS.]) fi dnl Threads THREADFLAGS="-D_REENTRANT" if test "$have_kos" = "no"; then if test "$need_libc_r" = "yes"; then AC_CHECK_LIB(c_r, pthread_attr_init, , AC_MSG_ERROR([ *** DirectFB requires phtreads in libc_r.])) THREADLIB="-lc_r" else AC_CHECK_LIB(pthread, pthread_attr_init, , AC_MSG_ERROR([ *** DirectFB requires libpthread.])) THREADLIB="-lpthread" fi fi AC_CHECK_DECLS(PTHREAD_MUTEX_RECURSIVE,, AC_MSG_WARN([ *** PTHREAD_MUTEX_RECURSIVE is not defined! Dead locks might occur!]), [ #define _GNU_SOURCE #include ]) AC_CHECK_DECLS(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,, AC_MSG_WARN([ *** PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not defined! Dead locks might occur!]), [ #define _GNU_SOURCE #include ]) AC_SUBST(THREADFLAGS) AC_SUBST(THREADLIB) CPPFLAGS="$THREADFLAGS $CPPFLAGS" dnl Dynamic Linker DYNLIB="" if test "$need_libdl" = "yes"; then if test "$enable_shared" = "yes"; then AC_CHECK_LIB(dl, dlopen, , AC_MSG_ERROR([ *** DirectFB requires libdl.])) DYNLIB="-ldl" fi fi AC_SUBST(DYNLIB) if test "$have_x86" = "yes"; then ## ## HACK HACK HACK automake uses @AS@ like a gcc ## AS=$CC ASFLAGS=$CFLAGS AC_SUBST(AS) AC_SUBST(ASFLAGS) AC_DEFINE(HAVE_INB_OUTB_IOPL,1, [Define to 1 if inb, outb and iopl are available.]) AC_MSG_CHECKING([for sys/io.h]) AC_TRY_COMPILE([#include ], [char x = inb(0); (void)x;], AC_DEFINE(HAVE_SYSIO,1, [Define to 1 if you have the header file.]) have_sysio=yes AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) else have_sysio=no fi AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling support [[default=no]]],, enable_profiling=no) if test "$enable_profiling" = "yes"; then CFLAGS="$CFLAGS -pg -g3" else DFB_CFLAGS_OMIT_FRAME_POINTER="-fomit-frame-pointer" fi AC_ARG_ENABLE(debug, [ --enable-debug enable debugging [[default=no]]],, enable_debug=no) if test "$enable_debug" = "yes"; then CFLAGS="$CFLAGS -g3 -fno-inline -Wno-inline" DIRECT_BUILD_DEBUG=1 else DIRECT_BUILD_DEBUG=0 fi AM_CONDITIONAL(ENABLE_DEBUG, test "$enable_debug" = "yes") AC_SUBST(DIRECT_BUILD_DEBUG) AC_ARG_ENABLE(debug-support, [ --enable-debug-support enable debugging support [[default=yes]]],, enable_debug_support=yes) if test "$enable_debug_support" = "yes" || test "$enable_debug" = "yes"; then enable_debug_support=yes DIRECT_BUILD_DEBUGS=1 else DIRECT_BUILD_DEBUGS=0 fi AM_CONDITIONAL(ENABLE_DEBUGS, test "$enable_debug_support" = "yes") AC_SUBST(DIRECT_BUILD_DEBUGS) AC_ARG_ENABLE(trace, [ --enable-trace enable call tracing [[default=no]]],, enable_trace=no) if test "$enable_trace" = "yes"; then DFB_INTERNAL_CFLAGS="$DFB_INTERNAL_CFLAGS -finstrument-functions" DIRECT_BUILD_TRACE=1 else DIRECT_BUILD_TRACE=0 fi AM_CONDITIONAL(ENABLE_TRACE, test "$enable_trace" = "yes") AC_SUBST(DIRECT_BUILD_TRACE) AC_ARG_ENABLE(text, [ --enable-text enable text output [[default=yes]]],, enable_text=yes) if test "$enable_text" = "no"; then DIRECT_BUILD_TEXT=0 else DIRECT_BUILD_TEXT=1 fi AC_SUBST(DIRECT_BUILD_TEXT) AC_ARG_ENABLE(gettid, [ --enable-gettid enable usage of gettid() [[default=yes]]],, enable_gettid=yes) if test "$enable_gettid" = "no"; then DIRECT_BUILD_GETTID=0 else DIRECT_BUILD_GETTID=1 fi AC_SUBST(DIRECT_BUILD_GETTID) AC_ARG_ENABLE(network, [ --enable-network enable network support [[default=yes]]],, enable_network=yes) if test "$enable_network" = "no"; then DIRECT_BUILD_NETWORK=0 else DIRECT_BUILD_NETWORK=1 fi AC_SUBST(DIRECT_BUILD_NETWORK) AC_CHECK_HEADER(stdbool.h, DIRECT_BUILD_STDBOOL=1, DIRECT_BUILD_STDBOOL=0) AC_SUBST(DIRECT_BUILD_STDBOOL) linux_fusion="N/A" AC_ARG_ENABLE(multi, [ --enable-multi enable multi application core [[default=no]]],, enable_multi=no) if test "$enable_multi" = "yes"; then dnl Test for Fusion Kernel Device linux_fusion=yes AC_CHECK_HEADER( [linux/fusion.h],, linux_fusion=no) if test "$linux_fusion" = "yes"; then FUSION_BUILD_KERNEL=1 else fusion_warning=" Linux-Fusion header not found. Using EXPERIMENTAL Builtin Multi application core!" AC_MSG_WARN([*** $fusion_warning *** ]) FUSION_BUILD_KERNEL=0 fi FUSION_BUILD_MULTI=1 else FUSION_BUILD_MULTI=0 FUSION_BUILD_KERNEL=0 fi AM_CONDITIONAL(ENABLE_MULTI, test "$enable_multi" = "yes") AC_SUBST(FUSION_BUILD_MULTI) AC_SUBST(FUSION_BUILD_KERNEL) AC_ARG_ENABLE(voodoo, [ --enable-voodoo enable Voodoo (network support) [[default=no]]],, enable_voodoo=no) AM_CONDITIONAL(ENABLE_VOODOO, test "$enable_voodoo" = "yes") AC_ARG_ENABLE(unique, [ --enable-unique enable Unique (WM Module) [[default=no]]],, enable_unique=no) AM_CONDITIONAL(ENABLE_UNIQUE, test "$enable_unique" = "yes") AC_ARG_ENABLE(mmx, [ --enable-mmx enable MMX support [[default=auto]]],, enable_mmx=$have_x86) AC_ARG_ENABLE(sse, [ --enable-sse enable SSE support [[default=auto]]],, enable_sse=$have_x86) if test "$enable_mmx" = "yes"; then dnl Necessary for assembler sources save_ac_ext="$ac_ext" ac_ext=S AC_MSG_CHECKING(whether the binutils support MMX) echo " movq 0, %mm0" > conftest.S if AC_TRY_EVAL(ac_compile); then AC_DEFINE(USE_MMX,1,[Define to 1 if MMX assembly is available.]) AC_MSG_RESULT(yes) if test "$enable_sse" = "yes"; then AC_MSG_CHECKING(whether the binutils support SSE) echo " movntps %xmm0, 0" > conftest.S if AC_TRY_EVAL(ac_compile); then AC_DEFINE(USE_SSE,1,[Define to 1 if SSE assembly is available.]) AC_MSG_RESULT(yes) else enable_sse=no AC_MSG_RESULT(no) AC_MSG_WARN([ **************************************************************** The installed assembler does not supports the SSE command set. Update your binutils package, if you want to compile SSE code. ****************************************************************]) fi fi else enable_mmx=no AC_MSG_RESULT(no) AC_MSG_WARN([ **************************************************************** The installed assembler does not supports the MMX command set. Update your binutils package, if you want to compile MMX code. ****************************************************************]) fi rm conftest* ac_ext="$save_ac_ext" else enable_sse=no fi AM_CONDITIONAL(BUILDMMX, test "$enable_mmx" = "yes") dnl Test for DevMem system AC_ARG_ENABLE(devmem, [ --enable-devmem build with generic /dev/mem support [[default=yes]]],, enable_devmem=yes) AM_CONDITIONAL(DEVMEM_CORE, test "$enable_devmem" = "yes") dnl Test for Linux frame buffer device AC_ARG_ENABLE(fbdev, [ --enable-fbdev build with linux fbdev support [[default=auto]]],, enable_fbdev=yes) if test "$have_linux" = "no"; then enable_fbdev=no AC_MSG_WARN([ *** no linux kernel -- building without linux fbdev support.]) fi if test "$enable_fbdev" = "yes"; then AC_DEFINE(LINUX_INPUT_USE_FBDEV,1,[Define to 1 if Linux Input driver should use FBDev system module for console keymap queries.]) fi AM_CONDITIONAL(FBDEV_CORE, test "$enable_fbdev" = "yes") dnl Test for SDL AC_ARG_ENABLE(sdl, [ --enable-sdl build with SDL support [[default=no]]],, enable_sdl=no) if test "$enable_sdl" = "yes"; then if test "$enable_osx" = "yes"; then AC_MSG_WARN([ *** SDL is now unsupported on OSX.]) enable_sdl=no else PKG_CHECK_MODULES([SDL], [sdl], enable_sdl=yes, [enable_sdl=no, AC_MSG_WARN([*** no sdl -- building without SDL support.])]) fi fi AC_SUBST(OSX_LIBS) AM_CONDITIONAL(SDL_CORE, test "$enable_sdl" = "yes") dnl Test for VNC AC_ARG_ENABLE(vnc, [ --enable-vnc build with VNC support [[default=auto]]],, enable_vnc=yes) if test "$enable_vnc" = "yes"; then AC_PATH_PROG(VNC_CONFIG, libvncserver-config, no) if test "$VNC_CONFIG" = "no"; then enable_vnc=no AC_MSG_WARN([ *** libvncserver-config not found -- building without VNC support. See http://libvncserver.sourceforge.net]) else VNC_CFLAGS=`$VNC_CONFIG --cflags` VNC_LIBS=`$VNC_CONFIG --libs` fi fi AM_CONDITIONAL(VNC_CORE, test "$enable_vnc" = "yes") AC_SUBST(VNC_LIBS) AC_SUBST(VNC_CFLAGS) dnl Test for libsysfs AC_ARG_ENABLE(sysfs, [ --enable-sysfs build with sysfs support [[default=auto]]],, enable_sysfs=yes) use_sysfs=no SYSFS_LIBS= if test "$enable_sysfs" = "yes"; then AC_CHECK_LIB(sysfs, sysfs_get_mnt_path, [ AC_CHECK_HEADER(sysfs/libsysfs.h, use_sysfs=yes AC_DEFINE(USE_SYSFS,1,[Define to 1 to build with sysfs support.]) SYSFS_LIBS='-lsysfs', AC_MSG_WARN([ *** libsysfs header files not found -- Building without sysfs support.])) ],[ AC_MSG_WARN([ *** libsysfs not found -- Building without sysfs support.]) ]) fi AC_SUBST(SYSFS_LIBS) dnl Test for libjpeg JPEG=no AC_ARG_ENABLE(jpeg, [ --enable-jpeg build JPEG image provider [[default=yes]]], enable_jpeg="$enableval", enable_jpeg=yes) if test "$enable_jpeg" = "yes"; then if test -z "$LIBJPEG"; then AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no) if test "$jpeg_ok" = yes; then AC_CHECK_HEADER(jpeglib.h, jpeg_ok=yes, jpeg_ok=no) if test "$jpeg_ok" = yes; then JPEG=yes LIBJPEG='-ljpeg' else JPEG=no AC_MSG_WARN([ *** JPEG header files not found. JPEG image provider will not be built.]) fi else JPEG=no AC_MSG_WARN([ *** JPEG library not found. JPEG image provider will not be built.]) fi else JPEG=yes fi fi AM_CONDITIONAL(JPEG_PROVIDER, test "$JPEG" = "yes") if test "$enable_jpeg" != "no" && test "$JPEG" != "yes"; then jpeg_warning=" JPEG support is missing - many applications won't work correctly!" fi AC_ARG_ENABLE(zlib, [ --enable-zlib use zlib, e.g. for screen shots [[default=no]]], enable_zlib="$enableval", enable_zlib=no) use_zlib=no ZLIB_LIBS= if test "$enable_zlib" = "yes"; then dnl Test for libz AC_CHECK_LIB(z, gzsetparams, [ AC_CHECK_HEADER(zlib.h, use_zlib=yes AC_DEFINE(USE_ZLIB,1,[Define to 1 to build with zlib compression.]) ZLIB_LIBS='-lz', AC_MSG_ERROR([ *** libz header files not found.])) ],[ AC_MSG_ERROR([ *** libz not found.]) ]) fi AC_SUBST(ZLIB_LIBS) dnl Test for libpng and libz PNG=no AC_ARG_ENABLE(png, [ --enable-png build PNG image provider [[default=yes]]], enable_png="$enableval", enable_png=yes) if test "$enable_png" = "yes"; then dnl Test for libz if test -z "$ZLIB_LIBS"; then AC_CHECK_LIB(z, gzsetparams, [ AC_CHECK_HEADER(zlib.h, ZLIB_LIBS='-lz', AC_MSG_WARN([ *** libz header files not found. PNG image provider will not be built.])) ],[ AC_MSG_WARN([ *** libz not found. PNG image provider will not be built.]) ]) fi AC_PATH_PROG(LIBPNG_CONFIG, libpng-config, no) if test "$LIBPNG_CONFIG" = no; then PNG=no AC_MSG_WARN([ *** libpng-config not found ]) else PNG=yes LIBPNG=`$LIBPNG_CONFIG --libs` fi dnl Test for libpng if test -z "$LIBPNG" && test -n "$ZLIB_LIBS"; then AC_CHECK_LIB(png, png_read_info, [ AC_CHECK_HEADER(png.h, png_ok=yes, AC_MSG_WARN([ *** PNG header files not found. PNG image provider will not be built.])) ],[ AC_MSG_WARN([ *** PNG library not found. PNG image provider will not be built.]) ], $ZLIB_LIBS -lm) if test "$png_ok" = yes; then AC_MSG_CHECKING([for png_structp in png.h]) AC_TRY_COMPILE([#include ], [png_structp pp; png_infop info; png_colorp cmap; (void)png_create_read_struct; (void)pp; (void)info; (void)cmap;], png_ok=yes, png_ok=no) AC_MSG_RESULT($png_ok) if test "$png_ok" = yes; then PNG=yes LIBPNG="-lpng $ZLIB_LIBS -lm" else PNG=no AC_MSG_WARN([ *** PNG library is too old. PNG image provider will not be built.]) fi else PNG=no fi fi fi AM_CONDITIONAL(PNG_PROVIDER, test "$PNG" = "yes") AM_CONDITIONAL(BUILD_DIRECTFB_CSOURCE, test "$PNG" = "yes") if test "$enable_png" != "no" && test "$PNG" != "yes"; then png_warning=" PNG support is missing - many applications won't work correctly!" fi dnl Allow to disable GIF support AC_ARG_ENABLE(gif, [ --enable-gif build GIF image/video provider [[default=yes]]], enable_gif="$enableval", enable_gif=yes) AM_CONDITIONAL(GIF_PROVIDER, test "$enable_gif" = "yes") dnl Test for freetype AC_ARG_ENABLE(freetype, [ --enable-freetype build FreeType2 font provider [[default=yes]]], enable_freetype="$enableval", enable_freetype=yes) if test "$enable_freetype" = "yes"; then PKG_CHECK_MODULES(FREETYPE, freetype2, FREETYPE="yes", [FREETYPE="no", AC_MSG_WARN([*** no freetype -- FreeType font provider will not be built.])]) fi AM_CONDITIONAL(FREETYPE_PROVIDER, test "$FREETYPE" = "yes") if test "$enable_freetype" != "no" && test "$FREETYPE" != "yes"; then freetype_warning=" FreeType2 support is missing - many applications won't work correctly!" fi dnl Test for video4linux V4L=no if test "$have_linux" = "yes"; then AC_ARG_ENABLE(video4linux, [ --enable-video4linux build Video4Linux video provider [[default=yes]]], enable_v4l="$enableval", enable_v4l=yes) if test "$enable_v4l" = "yes"; then V4L=yes fi fi AM_CONDITIONAL(V4L_PROVIDER, test "$V4L" = "yes") dnl Test for video4linux V4L2=no if test "$V4L" = "yes"; then AC_ARG_ENABLE(video4linux2, [ --enable-video4linux2 build with Video4Linux2 support [[default=no]]], enable_v4l2="$enableval", enable_v4l2=no) if test "$enable_v4l2" = "yes"; then V4L2=yes AC_DEFINE( DFB_HAVE_V4L2, 1, [Define to 1 if Video4Linux 2 is supported.] ) fi fi dnl check which gfxdrivers to build ati128=no cle266=no cyber5k=no davinci=no ep9x=no i810=no i830=no mach64=no matrox=no neomagic=no nsc=no nvidia=no omap=no radeon=no savage=no sh772x=no sis315=no tdfx=no unichrome=no vmware=no if test "$have_linux" = "yes"; then AC_MSG_CHECKING(which gfxdrivers should be built) AC_ARG_WITH(gfxdrivers, [ --with-gfxdrivers= compile gfxdrivers in ] [ gfxdrivers may be comma separated ] [ 'all' builds all drivers (default), 'none' builds none ] [ Possible gfxdrivers are: ] [ ati128, cle266, cyber5k, davinci, ep9x, i810, i830, mach64,] [ matrox, neomagic, nsc, nvidia, omap, radeon, savage, sh772x,] [ sis315, tdfx, unichrome, vmware], gfxdrivers="$withval",[gfxdrivers="all"]) if test "$gfxdrivers" = "all"; then checkfor_ati128=yes checkfor_cle266=no checkfor_cyber5k=yes checkfor_davinci="$have_arm" checkfor_ep9x=yes checkfor_i810=yes checkfor_i830=yes checkfor_mach64=yes checkfor_matrox=yes checkfor_neomagic=yes checkfor_nsc=yes checkfor_nvidia=yes checkfor_omap="$have_arm" checkfor_radeon=yes checkfor_savage=yes checkfor_sh772x=yes checkfor_sis315=yes checkfor_tdfx=yes checkfor_unichrome=yes checkfor_vmware=yes AC_MSG_RESULT(all) else if test "$gfxdrivers" != "none"; then gfxdrivers=`echo $gfxdrivers | sed 's/,/ /g'` for gfxdriver in $gfxdrivers do case "$gfxdriver" in ati128) checkfor_ati128=yes ;; cle266) checkfor_cle266=yes ;; cyber5k) checkfor_cyber5k=yes ;; davinci) checkfor_davinci=yes ;; ep9x) checkfor_ep9x=yes ;; i810) checkfor_i810=yes ;; i830) checkfor_i830=yes ;; mach64) checkfor_mach64=yes ;; matrox) checkfor_matrox=yes ;; neomagic) checkfor_neomagic=yes ;; nsc) checkfor_nsc=yes ;; nvidia) checkfor_nvidia=yes ;; omap) checkfor_omap=yes ;; radeon) checkfor_radeon=yes ;; savage) checkfor_savage=yes ;; sh772x) checkfor_sh772x=yes ;; sis315) checkfor_sis315=yes ;; tdfx) checkfor_tdfx=yes ;; unichrome) checkfor_unichrome=yes ;; vmware) checkfor_vmware=yes ;; *) echo "Unknown gfxdriver $gfxdriver, exiting!" exit 1 ;; esac done AC_MSG_RESULT($gfxdrivers) fi fi if test "$checkfor_ati128" = "yes"; then ati128=yes fi if test "$checkfor_cle266" = "yes" && test "$have_sysio" = "yes"; then cle266=yes fi if test "$checkfor_cyber5k" = "yes"; then cyber5k=yes fi if test "$checkfor_davinci" = "yes"; then davinci=yes fi if test "$checkfor_ep9x" = "yes"; then ep9x=yes fi if test "$checkfor_i810" = "yes" && test "$have_sysio" = "yes"; then i810=yes fi if test "$checkfor_i830" = "yes" && test "$have_sysio" = "yes"; then i830=yes fi if test "$checkfor_mach64" = "yes"; then mach64=yes fi if test "$checkfor_matrox" = "yes"; then matrox=yes fi if test "$checkfor_neomagic" = "yes" && test "$have_sysio" = "yes"; then neomagic=yes fi if test "$checkfor_nsc" = "yes"; then nsc=yes fi if test "$checkfor_nvidia" = "yes"; then nvidia=yes fi if test "$checkfor_omap" = "yes"; then omap=yes fi if test "$checkfor_radeon" = "yes"; then radeon=yes fi if test "$checkfor_savage" = "yes" && test "$have_sysio" = "yes"; then savage=yes fi if test "$checkfor_sh772x" = "yes" && test "$have_sh4" = "yes"; then sh772x=yes fi if test "$checkfor_sis315" = "yes"; then sis315=yes fi if test "$checkfor_tdfx" = "yes"; then tdfx=yes fi if test "$checkfor_unichrome" = "yes" && test "$have_sysio" = "yes"; then unichrome=yes fi if test "$checkfor_vmware" = "yes"; then vmware=yes fi # lets check for input driver checkfor_dbox2remote=no checkfor_dreamboxremote=no checkfor_dynapro=no checkfor_elo=no checkfor_gunze=no checkfor_h3600ts=no checkfor_joystick=no checkfor_keyboard=no checkfor_linux_input=no checkfor_lirc=no checkfor_mutouch=no checkfor_penmount=no checkfor_ps2mouse=no checkfor_serialmouse=no checkfor_sonypijogdial=no checkfor_tslib=no checkfor_ucb1x00=no checkfor_wm97xx=no AC_MSG_CHECKING(which inputdrivers should be built) AC_ARG_WITH(inputdrivers, [ --with-inputdrivers= compile inputdrivers in ] [ inputdrivers may be comma separated ] [ 'all' builds all drivers (default), 'none' builds none ] [ Possible inputdrivers are: ] [ dbox2remote, dreamboxremote, dynapro, elo-input, gunze, h3600_ts, ] [ joystick, keyboard, linuxinput, lirc, mutouch, penmount, ps2mouse, ] [ serialmouse, sonypijogdial, tslib, ucb1x00, wm97xx], inputdrivers="$withval",[inputdrivers="all"]) if test "$inputdrivers" = "all"; then checkfor_dbox2remote=yes checkfor_dreamboxremote=yes checkfor_dynapro=no checkfor_elo=no checkfor_gunze=no checkfor_h3600ts=yes checkfor_joystick=yes checkfor_keyboard=yes checkfor_linux_input=yes checkfor_lirc=yes checkfor_mutouch=yes checkfor_penmount=yes checkfor_ps2mouse=yes checkfor_serialmouse=yes checkfor_sonypijogdial=yes checkfor_tslib=yes checkfor_ucb1x00="$have_arm" checkfor_wm97xx=yes AC_MSG_RESULT(all) else if test "$inputdrivers" != "none"; then inputdrivers=`echo $inputdrivers | sed 's/,/ /g'` for inputdriver in $inputdrivers do case "$inputdriver" in dbox2remote) checkfor_dbox2remote=yes ;; dreamboxremote) checkfor_dreamboxremote=yes ;; dynapro) checkfor_dynapro=yes ;; elo-input) checkfor_elo=yes ;; gunze) checkfor_gunze=yes ;; h3600_ts) checkfor_h3600ts=yes ;; joystick) checkfor_joystick=yes ;; keyboard) checkfor_keyboard=yes ;; linuxinput) checkfor_linux_input=yes ;; lirc) checkfor_lirc=yes ;; mutouch) checkfor_mutouch=yes ;; penmount) checkfor_penmount=yes ;; ps2mouse) checkfor_ps2mouse=yes ;; serialmouse) checkfor_serialmouse=yes ;; sonypijogdial) checkfor_sonypijogdial=yes ;; tslib) checkfor_tslib=yes ;; ucb1x00) checkfor_ucb1x00=yes ;; wm97xx) checkfor_wm97xx=yes ;; *) echo "Unknown inputdriver $inputdriver, exiting!" exit 1 ;; esac done AC_MSG_RESULT($inputdrivers) fi fi enable_dbox2remote=no if test "$checkfor_dbox2remote" = "yes"; then dnl Test for dbox2 remote support in the kernel AC_CHECK_HEADER( [dbox/fp.h], enable_dbox2remote=yes, enable_dbox2remote=no AC_MSG_WARN([*** DBox2 Remote input driver will not be built.])) fi enable_dreamboxremote=no if test "$checkfor_dreamboxremote" = "yes"; then dnl Test for dreambox remote support in the kernel AC_CHECK_HEADER( [dbox/fp.h], enable_dreamboxremote=yes, enable_dreamboxremote=no AC_MSG_WARN([*** DreamBox Remote input driver will not be built.])) fi enable_dynapro_ts=no if test "$checkfor_dynapro" = "yes"; then dnl Test for Dynapro Touchscreen support enable_dynapro_ts=yes fi enable_elo_input=no if test "$checkfor_elo" = "yes"; then dnl Test for ELO Touchscreen support enable_elo_input=yes fi enable_gunze_input=no if test "$checkfor_gunze" = "yes"; then dnl Test for Gunze Touchscreen support enable_gunze_input=yes fi enable_h3600_ts=no if test "$checkfor_h3600ts" = "yes"; then dnl Test for H3600 Touchscreen support AC_CHECK_HEADER( [linux/h3600_ts.h], enable_h3600_ts=yes, enable_h3600_ts=no AC_MSG_WARN([*** H3600 Touchscreen driver will not be built.])) fi enable_joystick=no if test "$checkfor_joystick" = "yes"; then dnl Test for linux/joystick.h in the kernel AC_CHECK_HEADER([linux/joystick.h], enable_joystick=yes, enable_joystick=no AC_MSG_WARN([*** no linux/joystick.h -- Joystick driver will not be built.])) fi enable_keyboard=no if test "$checkfor_keyboard" = "yes"; then enable_keyboard=yes fi enable_linux_input=no if test "$checkfor_linux_input" = "yes"; then AC_CHECK_HEADER([linux/input.h], enable_linux_input=yes, enable_linux_input=no AC_MSG_WARN([*** no linux/input.h -- Linux Input driver will not be built.])) if test "$enable_linux_input" = "yes"; then AC_MSG_CHECKING([for struct input_absinfo in linux/input.h]) AC_TRY_COMPILE([#include ], [struct input_absinfo x; (void)x;], AC_DEFINE(HAVE_INPUT_ABSINFO,1, [Define to 1 if struct input_absinfo is defined in linux/input.h.]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) fi fi enable_lirc=no if test "$checkfor_lirc" = "yes"; then enable_lirc=yes fi enable_mutouch=no if test "$checkfor_mutouch" = "yes"; then dnl Allow to enable driver for Microtouch serial touchscreen dnl This driver is not built by default since it needs to be configured dnl by changing some defines in the source. enable_mutouch=yes fi enable_penmount=no if test "$checkfor_penmount" = "yes"; then enable_penmount=yes fi enable_ps2mouse=no if test "$checkfor_ps2mouse" = "yes"; then enable_ps2mouse=yes fi enable_serial_mouse=no if test "$checkfor_serialmouse" = "yes"; then dnl Test for linux/serial.h in the kernel AC_CHECK_HEADER([linux/serial.h], enable_serial_mouse=yes, enable_serial_mouse=no AC_MSG_WARN([*** no linux/serial.h -- serial mouse driver will not be built.])) fi enable_sonypi_jogdial=no if test "$checkfor_sonypijogdial" = "yes"; then dnl Test for SonyPI Jogdial support AC_CHECK_HEADER([linux/sonypi.h], enable_sonypi_jogdial=yes, enable_sonypi_jogdial=no AC_MSG_WARN([*** no linux/sonypi.h -- SonyPI Jogdial driver will not be built.])) fi enable_tslib=no if test "$checkfor_tslib" = "yes"; then PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [enable_tslib=yes], [enable_tslib=no, AC_MSG_WARN([*** no tslib -- tslib driver will not be built.])]) fi enable_ucb1x00_ts=no if test "$checkfor_ucb1x00" = "yes"; then dnl Test for UCB1x00 Touchscreen support enable_ucb1x00_ts=yes fi enable_wm97xx_ts=no if test "$checkfor_wm97xx" = "yes"; then dnl Test for WM97xx Touchscreen support enable_wm97xx_ts=yes fi dnl *** end of if $testlinux *** fi AC_ARG_WITH(software, [ --without-software build without software rendering (can decrease binary size by >100k)]) if test "$with_software" != "no"; then with_software=yes fi AM_CONDITIONAL(SOFTWARE_RENDERING, test "$with_software" != "no") AC_ARG_WITH(smooth-scaling, [ --with-smooth-scaling build with smooth software scaling code (can increase binary size by >100k)]) if test "$with_smooth_scaling" != "yes" -o "$with_software" != "yes"; then with_smooth_scaling=no else AC_DEFINE(DFB_SMOOTH_SCALING,1,[Define to 1 if smooth scaling code should be built.]) fi AC_SUBST(DFB_SMOOTH_SCALING) AC_ARG_WITH(tests, [ --with-tests build test programs]) if test "$with_tests" != "yes"; then with_tests=no fi # How big of a buffer fusion uses to read messages from the fusion device AC_ARG_WITH(message-size, [ --with-message-size=SIZE allow fusion messages up to SIZE bytes [[default=1024]]], [ ], [with_message_size=no]) test x"$with_message_size" = x"no" && with_message_size=1024 FUSION_MESSAGE_SIZE=$with_message_size AC_SUBST(FUSION_MESSAGE_SIZE) # Build tools? AC_ARG_WITH(tools, [ --without-tools do not build any tools]) if test "$with_tools" != "no"; then with_tools=yes fi # Sysroot used for runtime module loading, etc. AC_ARG_WITH(sysroot, [ --with-sysroot=DIR search for lib/share et al within DIR at runtime] [ (e.g. when loading modules)], [ RUNTIME_SYSROOT="$withval" ], [ RUNTIME_SYSROOT= ] ) test x"$RUNTIME_SYSROOT" = x"no" && RUNTIME_SYSROOT= AC_SUBST(RUNTIME_SYSROOT) dnl *** Look for directfb-csource in PATH if we are cross-compiling *** if test "$enable_unique" = "yes"; then if test "$cross_compiling" = "yes" || test "$with_tools" = "no"; then AC_PATH_PROG(DIRECTFB_CSOURCE, directfb-csource, no) if test "x$DIRECTFB_CSOURCE" = "xno"; then AC_MSG_ERROR(Could not find a directfb-csource in your PATH) fi fi fi AM_CONDITIONAL(GFX_ATI128, test "$ati128" = "yes") AM_CONDITIONAL(GFX_CLE266, test "$cle266" = "yes") AM_CONDITIONAL(GFX_CYBER5K, test "$cyber5k" = "yes") AM_CONDITIONAL(GFX_DAVINCI, test "$davinci" = "yes") AM_CONDITIONAL(GFX_EP9X, test "$ep9x" = "yes") AM_CONDITIONAL(GFX_I810, test "$i810" = "yes") AM_CONDITIONAL(GFX_I830, test "$i830" = "yes") AM_CONDITIONAL(GFX_MACH64, test "$mach64" = "yes") AM_CONDITIONAL(GFX_MATROX, test "$matrox" = "yes") AM_CONDITIONAL(GFX_NEOMAGIC, test "$neomagic" = "yes") AM_CONDITIONAL(GFX_NSC, test "$nsc" = "yes") AM_CONDITIONAL(GFX_NVIDIA, test "$nvidia" = "yes") AM_CONDITIONAL(GFX_OMAP, test "$omap" = "yes") AM_CONDITIONAL(GFX_RADEON, test "$radeon" = "yes") AM_CONDITIONAL(GFX_SAVAGE, test "$savage" = "yes") AM_CONDITIONAL(GFX_SH772X, test "$sh772x" = "yes") AM_CONDITIONAL(GFX_SIS315, test "$sis315" = "yes") AM_CONDITIONAL(GFX_TDFX, test "$tdfx" = "yes") AM_CONDITIONAL(GFX_UNICHROME, test "$unichrome" = "yes") AM_CONDITIONAL(GFX_VMWARE, test "$vmware" = "yes") AM_CONDITIONAL(DBOX2REMOTE, test "$enable_dbox2remote" = "yes") AM_CONDITIONAL(DREAMBOXREMOTE, test "$enable_dreamboxremote" = "yes") AM_CONDITIONAL(DYNAPRO_INPUT, test "$enable_dynapro_ts" = "yes") AM_CONDITIONAL(ELO_INPUT, test "$enable_elo_input" = "yes") AM_CONDITIONAL(GUNZE_INPUT, test "$enable_gunze_input" = "yes") AM_CONDITIONAL(H3600_TS, test "$enable_h3600_ts" = "yes") AM_CONDITIONAL(JOYSTICK_INPUT, test "$enable_joystick" = "yes") AM_CONDITIONAL(KEYBOARD_INPUT, test "$enable_keyboard" = "yes") AM_CONDITIONAL(LINUX_INPUT, test "$enable_linux_input" = "yes") AM_CONDITIONAL(LIRC_INPUT, test "$enable_lirc" = "yes") AM_CONDITIONAL(MUTOUCH_TS, test "$enable_mutouch" = "yes") AM_CONDITIONAL(PENMOUNT_TS, test "$enable_penmount" = "yes" ) AM_CONDITIONAL(PS2MOUSE_INPUT, test "$enable_ps2mouse" = "yes") AM_CONDITIONAL(SERIAL_MOUSE_INPUT, test "$enable_serial_mouse" = "yes") AM_CONDITIONAL(SONYPI, test "$enable_sonypi_jogdial" = "yes") AM_CONDITIONAL(TSLIB, test "$enable_tslib" = "yes") AM_CONDITIONAL(UCB1X00_TS, test "$enable_ucb1x00_ts" = "yes") AM_CONDITIONAL(WM97XX_TS, test "$enable_wm97xx_ts" = "yes") AM_CONDITIONAL(BUILD_TESTS, test "$with_tests" = "yes") AM_CONDITIONAL(BUILD_TOOLS, test "$with_tools" = "yes") AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes") CFLAGS="$CFLAGS $DFB_INTERNAL_CFLAGS" DFB_LDFLAGS="$LDFLAGS $ZLIB_LIBS" # Honor aclocal flags ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" AM_CONDITIONAL(BUILD_SHARED, test "$enable_shared" = "yes") AM_CONDITIONAL(BUILD_STATIC, test "$enable_static" = "yes") # Change the module directory only for builds that don't *support* debug if test "$enable_debug_support" = "no"; then MODULEDIRNAME=directfb-$BINARY_VERSION-pure else MODULEDIRNAME=directfb-$BINARY_VERSION fi MODULEDIR=$libdir/$MODULEDIRNAME DATADIR=$datadir/directfb-$VERSION INCLUDEDIR=$includedir/directfb INTERNALINCLUDEDIR=$includedir/directfb-internal SOPATH=$libdir/libdirectfb-$LT_RELEASE.so.$LT_CURRENT AC_SUBST(SOPATH) AC_SUBST(HAVE_LINUX) AC_SUBST(DFB_CFLAGS_OMIT_FRAME_POINTER) AC_SUBST(DFB_LDFLAGS) AC_SUBST(DFB_INTERNAL_CFLAGS) AC_SUBST(X11_CFLAGS) AC_SUBST(X11_LIBS) AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) AC_SUBST(TSLIB_CFLAGS) AC_SUBST(TSLIB_LIBS) AC_SUBST(ZLIB_LIBS) AC_SUBST(GIF_PROVIDER) AC_SUBST(JPEG_PROVIDER) AC_SUBST(PNG_PROVIDER) AC_SUBST(LIBJPEG) AC_SUBST(LIBPNG) AC_SUBST(FREETYPE_PROVIDER) AC_SUBST(FREETYPE_CFLAGS) AC_SUBST(FREETYPE_LIBS) AC_SUBST(DATADIR) AC_SUBST(MODULEDIR) AC_SUBST(MODULEDIRNAME) AC_SUBST(INCLUDEDIR) AC_SUBST(INTERNALINCLUDEDIR) AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) CFLAGS="$CFLAGS -Werror-implicit-function-declaration" AC_OUTPUT([ directfb-config directfb.pc directfb-internal.pc directfb.spec Makefile include/Makefile include/directfb_version.h lib/Makefile lib/direct/Makefile lib/direct/build.h lib/direct/direct.pc lib/fusion/Makefile lib/fusion/build.h lib/fusion/fusion.pc lib/fusion/shm/Makefile lib/voodoo/Makefile lib/voodoo/build.h lib/voodoo/voodoo.pc patches/Makefile proxy/Makefile proxy/dispatcher/Makefile proxy/requestor/Makefile rules/Makefile src/Makefile src/core/Makefile src/display/Makefile src/gfx/Makefile src/gfx/generic/Makefile src/input/Makefile src/media/Makefile src/misc/Makefile src/windows/Makefile systems/Makefile systems/devmem/Makefile systems/fbdev/Makefile systems/x11/Makefile systems/osx/Makefile systems/sdl/Makefile systems/vnc/Makefile wm/Makefile wm/default/Makefile wm/unique/Makefile wm/unique/classes/Makefile wm/unique/data/Makefile wm/unique/devices/Makefile gfxdrivers/Makefile gfxdrivers/ati128/Makefile gfxdrivers/cle266/Makefile gfxdrivers/cyber5k/Makefile gfxdrivers/davinci/Makefile gfxdrivers/ep9x/Makefile gfxdrivers/i810/Makefile gfxdrivers/i830/Makefile gfxdrivers/mach64/Makefile gfxdrivers/matrox/Makefile gfxdrivers/neomagic/Makefile gfxdrivers/nsc/Makefile gfxdrivers/nsc/include/Makefile gfxdrivers/nvidia/Makefile gfxdrivers/omap/Makefile gfxdrivers/radeon/Makefile gfxdrivers/savage/Makefile gfxdrivers/sh772x/Makefile gfxdrivers/sis315/Makefile gfxdrivers/tdfx/Makefile gfxdrivers/unichrome/Makefile gfxdrivers/vmware/Makefile inputdrivers/Makefile inputdrivers/dbox2remote/Makefile inputdrivers/dreamboxremote/Makefile inputdrivers/dynapro/Makefile inputdrivers/elo/Makefile inputdrivers/gunze/Makefile inputdrivers/h3600_ts/Makefile inputdrivers/joystick/Makefile inputdrivers/keyboard/Makefile inputdrivers/linux_input/Makefile inputdrivers/lirc/Makefile inputdrivers/mutouch/Makefile inputdrivers/penmount/Makefile inputdrivers/ps2mouse/Makefile inputdrivers/serialmouse/Makefile inputdrivers/sonypi/Makefile inputdrivers/tslib/Makefile inputdrivers/ucb1x00_ts/Makefile inputdrivers/wm97xx_ts/Makefile interfaces/Makefile interfaces/IDirectFBFont/Makefile interfaces/IDirectFBImageProvider/Makefile interfaces/IDirectFBVideoProvider/Makefile data/Makefile tests/Makefile tools/Makefile docs/Makefile docs/dfbg.1 docs/directfb-csource.1 docs/directfbrc.5 docs/html/Makefile ], [chmod +x directfb-config]) AC_MSG_RESULT([ Build options: Version $VERSION Linux powered $have_linux Install prefix $prefix Config files in $SYSCONFDIR Build shared libs $enable_shared Build static libs $enable_static Module directory $MODULEDIR CPPFLAGS $CPPFLAGS CFLAGS $CFLAGS LDFLAGS $LDFLAGS LIBS $LIBS DYNLIB $DYNLIB THREADFLAGS $THREADFLAGS THREADLIBS $THREADLIBS Misc options: Multi Application Core $enable_multi Fusion Kernel Device $linux_fusion Fusion message size $with_message_size Voodoo (network support) $enable_voodoo Debug supported $enable_debug_support Debug enabled $enable_debug Trace support $enable_trace MMX support $enable_mmx SSE support $enable_sse Network support $enable_network Include all strings $enable_text Software Rendering $with_software Smooth SW Scaling $with_smooth_scaling zlib compression $use_zlib $ZLIB_LIBS sysfs support $use_sysfs $SYSFS_LIBS Building Tests $with_tests Building Tools $with_tools Building System Modules: Linux FBDev support $enable_fbdev Generic /dev/mem support $enable_devmem X11 support $enable_x11 $X11_CFLAGS $X11_LIBS OSX support $enable_osx $OSX_CFLAGS $OSX_LIBS SDL support $enable_sdl $SDL_CFLAGS $SDL_LIBS VNC support $enable_vnc $VNC_CFLAGS $VNC_LIBS Building Window Manager Modules: Default yes UniQuE $enable_unique Building Image Provider Modules: GIF $enable_gif JPEG $JPEG $LIBJPEG PNG $PNG $LIBPNG Building Video Provider Modules: GIF $enable_gif Video4Linux $V4L (v2: $V4L2) Building Font Modules: FreeType2 $FREETYPE $FREETYPE_CFLAGS $FREETYPE_LIBS Default font yes]); if test "$have_linux" = "yes"; then AC_MSG_RESULT([ Building Graphics Drivers: 3Dfx Voodoo $tdfx ATI Mach64 $mach64 ATI Rage 128 $ati128 ATI Radeon $radeon Cirrus EP9X $ep9x Intel i810 $i810 Intel i830 $i830 Matrox $matrox NeoMagic $neomagic NSC Geode $nsc nVidia $nvidia Renesas SH7722/SH7723 $sh772x S3 Savage $savage SiS 315 $sis315 TI Davinci $davinci TI OMAP $omap TVIA CyberPro $cyber5k VIA CLE266 $cle266 VIA UniChrome $unichrome VMWare $vmware Building Input Drivers: DBox2 Remote $enable_dbox2remote DreamBox Remote $enable_dreamboxremote Dynapro Touchscreen $enable_dynapro_ts ELO Touchscreen $enable_elo_input Gunze Touchscreen $enable_gunze_input H3600 Touchscreen $enable_h3600_ts Joystick $enable_joystick Keyboard $enable_keyboard Linux Input $enable_linux_input LiRC $enable_lirc MuTouch touchscreen $enable_mutouch PS/2 Mouse $enable_ps2mouse Serial Mouse $enable_serial_mouse SonyPI Jogdial $enable_sonypi_jogdial tslib $enable_tslib $TSLIB_CFLAGS $TSLIB_LIBS ucb1x00 Touchscreen $enable_ucb1x00_ts WM97xx Touchscreen $enable_wm97xx_ts]); fi AC_MSG_RESULT([$fusion_warning $png_warning $jpeg_warning $freetype_warning ]); DirectFB-1.2.10/fb.modes0000644000175000017500000000337311245562152011567 00000000000000# # DirectFB video modes, should be placed into "/etc" # mode "640x480 75Hz 16bit" # D: 31.50 MHz, H: 37.500 kHz, V: 75.00 Hz geometry 640 480 640 480 16 timings 31747 120 16 16 1 64 3 endmode mode "720x576 50Hz 16bit" geometry 720 576 720 576 16 timings 31208 144 40 32 10 128 3 endmode mode "768x576 75Hz 16bit" # D: 49.188 MHz, H: 46.580 kHz, V: 75.008 Hz geometry 768 576 768 576 16 timings 20330 128 32 32 8 128 5 endmode mode "800x600 75Hz 16bit" # D: 49.50 MHz, H: 46.875 kHz, V: 75.00 Hz geometry 800 600 800 600 16 timings 20203 160 16 21 1 80 3 hsync high vsync high endmode mode "1024x768 72Hz 16bit" # D: 75.00 MHz, H: 58.230 kHz, V: 72.245 Hz geometry 1024 768 1024 768 16 timings 13334 104 24 29 3 136 6 endmode mode "1280x1024-75" # D: 134.880 MHz, H: 79.905 kHz, V: 74.958 Hz geometry 1280 1024 1280 3264 16 timings 7414 232 64 38 1 112 3 hsync high vsync high endmode mode "1280x1024 60Hz 16bit" # D: 108.00 MHz, H: 63.981 kHz, V: 60.02 Hz geometry 1280 1024 1280 1024 16 timings 9260 248 48 38 1 112 3 hsync high vsync high endmode mode "1600x1200 60Hz 16bit" # D: 156.00 MHz, H: 76.200 kHz, V: 60.00 Hz geometry 1600 1200 1600 1200 16 timings 6411 256 32 52 10 160 8 endmode mode "640x400 93Hz 16bit" geometry 640 400 640 400 16 timings 28272 48 32 17 22 128 12 endmode mode "400x300 100Hz 16bit" geometry 400 300 400 300 16 timings 31747 40 16 16 1 40 3 double true endmode mode "320x240 85Hz 16bit" geometry 320 240 320 240 16 timings 51383 32 32 20 4 48 1 double true endmode mode "320x200 85Hz 16bit" geometry 320 200 320 200 16 timings 60440 32 32 20 4 48 1 double true endmode DirectFB-1.2.10/rules/0000777000175000017500000000000011307522571011357 500000000000000DirectFB-1.2.10/rules/nmfile.make0000644000175000017500000000041111245562146013403 00000000000000if BUILD_SHARED if ENABLE_TRACE LIBTONM = $(LTLIBRARIES:.la=-$(LT_RELEASE).so.$(LT_BINARY)) install-data-local: install-libLTLIBRARIES mkdir -p -- "$(DESTDIR)$(libdir)" nm -n "$(DESTDIR)$(libdir)/$(LIBTONM)" > "$(DESTDIR)$(libdir)/nm-n.$(LIBTONM)" endif endif DirectFB-1.2.10/rules/Makefile.am0000644000175000017500000000003411164361026013321 00000000000000EXTRA_DIST = libobject.make DirectFB-1.2.10/rules/Makefile.in0000644000175000017500000002535411307521505013345 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = rules DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = libobject.make all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu rules/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu rules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/rules/libobject.make0000644000175000017500000000034311164361026014064 00000000000000%.o: .libs/%.a %.la rm -f $<.tmp/*.o if test -d $<.tmp; then rmdir $<.tmp; fi mkdir $<.tmp (cd $<.tmp && $(AR) x ../../$<) $(LD) -o $@ -r $<.tmp/*.o rm -f $<.tmp/*.o && rmdir $<.tmp .PHONY: $(LTLIBRARIES:%.la=.libs/%.a) DirectFB-1.2.10/docs/0000777000175000017500000000000011307522564011157 500000000000000DirectFB-1.2.10/docs/directfb-csource.1.in0000644000175000017500000000406411245562152015007 00000000000000.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This man page is Copyright (C) 2002-2003 Sven Neumann .TH DIRECTFB-CSOURCE 1 "24 Oct 2003" "Version @DIRECTFB_VERSION@" "DirectFB Manual Pages" .SH NAME directfb-csource \- C code generation utility for DirectFB surfaces .SH SYNOPSIS \fBdirectfb-csource\fP [\fIoptions\fP] <\fIimagefiles\fP> .SH DESCRIPTION \fBdirectfb-csource\fP is a small utility that reads PNG (Portable Network Graphics) image files and generates C code that can be used to compile an image into a DirectFB application. Below is a simple example to illustrate this. If multiple PNG image files are passed to \fBdirectfb-csource\fP, they are combined into a single surface. The different images can then be blitted from this surface using the array of rectangles that is also dumped. This can be useful for example for icons or sprites. .SH OPTIONS .TP .B --name=identifier Specifies the identifier name (prefix) for the generated variables. If this option is not used, the identifier is generated from the filename. You have to specify an identifer name when processing multiple images. .TP .B --format=pixelformat Specifies the pixel-format of the generated inline surface. Possible values are ARGB, RGB32, RGB24, RGB16, RGB15, RGB332, A8 and LUT8. By default the format is ARGB if the PNG image has an alpha channel or RGB32 otherwise. .TP .B --version Output version information. .TP .B --help Print brief help and exit. .SH EXAMPLE Generate a header file from a PNG image file: directfb-csource --name=foo foo.png > foo.h Include the generated header in your application and create a surface using the surface description from the header file: #include #include "foo.h" IDirectFB *dfb; IDirectFBSurface *surface; ... dfb->CreateSurface( dfb, &foo_desc, &surface ); .SH OTHER INFO \fBdirectfb-csource\fP was inspired by and uses code from \fBgdk-pixbuf-csource\fP, a similar program written by Tim Janik. The canonical place to find informations about DirectFB is at http://www.directfb.org/. DirectFB-1.2.10/docs/Makefile.am0000644000175000017500000000071611164361026013126 00000000000000## Makefile.am for DirectFB/docs SUBDIRS = html if BUILD_DIRECTFB_CSOURCE csource_mans = directfb-csource.1 endif man_MANS = \ $(csource_mans) \ dfbg.1 \ directfbrc.5 HTMLMANS = $(patsubst %,%.html,$(man_MANS)) if HAVE_MAN2HTML all-local: $(HTMLMANS) clean-local: rm -f $(HTMLMANS) %.html: % $(MAN2HTML) $* > $@ else all-local: clean-local: endif EXTRA_DIST = \ README.screenshots \ dfbg.1.in \ directfbrc.5.in \ directfb-csource.1.in DirectFB-1.2.10/docs/Makefile.in0000644000175000017500000005110711307521476013145 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/dfbg.1.in $(srcdir)/directfb-csource.1.in \ $(srcdir)/directfbrc.5.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = dfbg.1 directfb-csource.1 directfbrc.5 SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" man5dir = $(mandir)/man5 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = html @BUILD_DIRECTFB_CSOURCE_TRUE@csource_mans = directfb-csource.1 man_MANS = \ $(csource_mans) \ dfbg.1 \ directfbrc.5 HTMLMANS = $(patsubst %,%.html,$(man_MANS)) EXTRA_DIST = \ README.screenshots \ dfbg.1.in \ directfbrc.5.in \ directfb-csource.1.in all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh dfbg.1: $(top_builddir)/config.status $(srcdir)/dfbg.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ directfb-csource.1: $(top_builddir)/config.status $(srcdir)/directfb-csource.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ directfbrc.5: $(top_builddir)/config.status $(srcdir)/directfbrc.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.5*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 5*) ;; \ *) ext='5' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(MANS) all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-man1 install-man5 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man5 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local ctags ctags-recursive distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-man5 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-man uninstall-man1 \ uninstall-man5 @HAVE_MAN2HTML_TRUE@all-local: $(HTMLMANS) @HAVE_MAN2HTML_TRUE@clean-local: @HAVE_MAN2HTML_TRUE@ rm -f $(HTMLMANS) @HAVE_MAN2HTML_TRUE@%.html: % @HAVE_MAN2HTML_TRUE@ $(MAN2HTML) $* > $@ @HAVE_MAN2HTML_FALSE@all-local: @HAVE_MAN2HTML_FALSE@clean-local: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/docs/directfbrc.5.in0000644000175000017500000004006511245562152013700 00000000000000.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This man page is Copyright (C) 2002 Sven Neumann .TH DIRECTFBRC 5 "03 Mar 2007" "Version @DIRECTFB_VERSION@" "DirectFB Manual Pages" .SH NAME directfbrc \- DirectFB configuration file .SH DESCRIPTION The .B directfbrc file is a configuration file read by all DirectFB applications on startup. There are two of these: a system-wide one stored in .I @SYSCONFDIR@/directfbrc and a per-user .I \fB$HOME\fP/.directfbrc which may override system settings. Further customization is available per executable (basename of argv[0]): .I @SYSCONFDIR@/directfbrc.$0 and a per-user .I \fB$HOME\fP/.directfbrc.$0 After config files, the environment variable DFBARGS is parsed. The same parameters that can be used in the .B directfbrc file can be passed via this variable or on the command-line by prefixing them with .BR --dfb: separated each with a comma. .SH SYNTAX The .B directfbrc file contains one parameter per line. Comments are introduced by a hash sign (#), and continue until the end of the line. Blank lines are ignored. Most parameters are switches that turn certain features on or off. These switches have a no- variant that disables the feature. This man-page describes the positive variant and will also note which setting is the compiled-in default. .SH PARAMETERS The following parameters may be specified in the .B directfbrc file: .TP .BI system= Specifies the graphics system to use. The default is to use the Linux frame buffer (fbdev) but you can also run DirectFB applications on SDL (sdl). Other systems might be added in the future. .TP .BI fbdev= Opens the given frame buffer device instead of /dev/fb0. .TP .BI busid= Specify the bus location of the card. The option is only used if DirectFB doesn't have sysfs support and if unspecified 1:0:0 will be assumed. Use this option if the driver fails to detect (or incorrectly detects) your card. .TP .BI mode=x Sets the default screen resolution. If unspecified DirectFB will use the first mode from .I /etc/fb.modes Some frame buffer devices (namely vesafb) don't support mode switches and can only be used in the resolution that is set on boot time. .TP .BI scaled=x Scale the window to this size for 'force-windowed' apps. .TP .BI depth= Sets the default pixel depth in bits per pixel. If unspecified DirectFB will use the depth specified in the first mode from .I /etc/fb.modes DirectFB supports color depths of 8, 15, 16, 24 and 32. Which values are available depends on the frame buffer device you are using. Some frame buffer devices (namely vesafb) don't support mode switches at all and can only be used in the pixel depth that is set at boot time. .TP .BI pixelformat= Sets the default pixel format. This is similar to the depth parameter described above but allows more fine-grained control. Possible values for pixelformat are LUT8, RGB332, RGB16, RGB24 and RGB32. Some drivers may also support the more exotic pixel formats A8, ALUT44, ARGB, ARGB1555, I420, UYVY, YUY2 and YV12. .TP .BI session= Selects the multi application world which is joined or created. Starting with zero, negative values force creation of a new world using the lowest unused session number. This will override the environment variable "DIRECTFB_SESSION". .TP .BI force-slave Always enter as a slave, waiting for the master, if not there. .TP .BI remote=[:] Select the remote session to connect to. .TP .BI tmpfs= Uses the given directory (tmpfs mount point) for creation of the shared memory file in multi application mode. This option is only useful if the automatic detection fails or if non-tmpfs storage is desired. .TP .BI shmfile-group= Group that owns shared memory files. .TP .BI memcpy= With this option the probing of memcpy() routines can be skipped, saving a lot of startup time. Pass "help" for a list of possible values. .TP .BI primary-layer= Selects which layer is the "primary layer", default is the first. Check 'dfbinfo' for a list of layers supported by your hardware. .TP .BI primary-only Tell application only about the primary layer. .TP .BI quiet Suppresses console output from DirectFB. Only error messages will be displayed. .TP .BI [no-]banner Enables the output of the DirectFB banner at startup. This is on by default. .TP .BI [no-]debug Enables debug output. This is on by default but you won't see any debug output unless you compiled DirectFB with debugging support. .TP .BI [no-]debugmem Enable memory allocation tracking. .TP .BI [no-]debugshm Enable shared memory allocation tracking. .TP .BI [no-]trace Enable stack trace support. This is on by default but you won't see any trcae output unless you compiled DirectFB with trace support. .TP .BI log-file= Write all messages to the specified file. .TP .BI log-udp=: Send all messages via UDP to the specified host and port. .TP .BI fatal-level= Abort on NONE, ASSERT (default) or ASSUME (incl. assert) .TP .BI force-windowed Forces the primary surface to be a window. This allows to run applications that were written to do full-screen access in a window. .TP .BI force-desktop Forces the primary surface to be the background surface of the desktop. .TP .BI [no-]hardware Turns hardware acceleration on. By default hardware acceleration is auto-detected. If you disable hardware acceleration, the driver for your graphics card will still be loaded and used to access additional display layers (if there are any), but all graphics operations will be performed by the software renderer. .TP .BI [no-]software This option allows to disable software fallbacks. .TP .BI [no-]dma Turns DMA acceleration on, if supported by the driver. By default DMA acceleration is off. .TP .BI [no-]sync Flushes all disk buffers before initializing DirectFB. This can be useful if you working with experimental device drivers and expect crashes. The default is not to sync. .TP .BI [no-]mmx The no-mmx options allows to disable the use of MMX routines even if support for MMX was detected. By default MMX is used if is available and support for MMX was compiled in. .TP .BI [no-]agp[=mode] Turns AGP memory support on. The option enables DirectFB using the AGP memory to extend the amount of video memory available. You can specify the AGP mode to use (e.g. 1, 2, 4, 8 or 0 to disable agp). By default AGP memory support is off. .TP .BI [no-]thrifty-surface-buffers Free sysmem instance on xfer to video memory. .TP .BI font-format= Specify the font format to use. Possible values are A1, A8, ARGB, ARGB1555, ARGB2554, ARGB4444, AiRGB. The default font format is A8 because it is the only format that ensures high quality, fast rendering and low memory consumption at the same time. Use this option only if your fonts looks strange or if font rendering is too slow. .TP .BI [no-]sighandler By default DirectFB installs a signal handler for a number of signals that cause an application to exit. This signal handler tries to deinitialize the DirectFB engine before quitting the application. Use this option to enable/disable this feature. .TP .BI dont-catch=[[,]...] As described with the .B sighandler option, DirectFB installs a signal handler for a number of signals. By using this option you may specify a list of signals that shouldn't be handled this way. .TP .BI [no-]deinit-check By default DirectFB checks if the application has released all allocated resources on exit. If it didn't, it will clean up after the application. This option allows to switch this feature on or off. .TP .BI block-all-signals This option activates blocking of all signals, useful for DirectFB daemons (a DirectFB master application that does nothing except being the master). .TP .BI [no-]vt-switch By default DirectFB allocates a new virtual terminal and switches to it. .TP .BI vt-num= Use given VT instead of current/new one. .TP .BI [no-]vt-switching Allow to switch virtual terminals using ++. This is an experimental feature that is usually disabled; use at your own risk. .TP .BI [no-]graphics-vt Puts the virtual terminal into graphics mode. This has the advantage that kernel messages won't show up on your screen while the DirectFB application is running. .TP .BI [no-]vt Use VT handling code at all? .TP .BI mouse-source= Specify the serial mouse device. .TP .BI [no-]mouse-gpm-source Enables using GPM as mouse input repeater. .TP .BI [no-]motion-compression Usually DirectFB compresses mouse motion events. This means that subsequent mouse motions are delivered to the application as a single mouse motion event. This leads to a more responsive but less exact mouse handling. .TP .BI mouse-protocol= Specifies the mouse protocol to use. The following protocols are supported: .BI MS Two button mouse using the Microsoft mouse protocol. .BI MS3 Three button mouse using an extended Microsoft mouse protocol. .BI MouseMan Three button mouse using a different extension to the Microsoft mouse protocol introduced by Logitech. .BI MouseSystems The most commonly used protocol for three button mice. .BI PS/2 Two/three button mice of the PS/2 series. .BI IMPS/2 Two/three button USB mice with scrolling wheel using the Microsoft Intellimouse protocol. The different protocols for serial mice are described in more detail in mouse(4). .TP .BI [no-]lefty Swaps left and right mouse buttons. Useful for left-handers. .TP .BI [no-]capslock-meta Map the CapsLock key to Meta. Useful for users of the builtin WM without a Meta key on the keyboard (e.g. Window key). .TP .BI linux-input-ir-only Ignore all non-IR Linux Input devices. .TP .BI [no-]linux-input-grab Grab Linux Input devices. When a device is grabbed only DirectFB will receive events from it. The default is to grab. .TP .BI [no-]cursor By default DirectFB shows a mouse cursor when an application makes use of windows. This option allows to switch the cursor off permanently. Applications cannot enable it explicitly. .TP .BI wm= Specify the window manager to use. .TP .BI bg-none Completely disables background handling. Doesn't make much sense since the mouse and moving windows will leave ugly traces on the background. .TP .BI bg-color=AARRGGBB Controls the color of the background. The color is specified in hexadecimal notation. The alpha value defaults to full opacity and may be omitted. For example to choose a bright magenta background, you'd use bg-color=FF00FF. .TP .BI bg-image= Fills the background with the given image from file. The image is stretched to fit to the screen dimensions. .TP .BI bg-tile= Like .B bg-image but tiles the image to fit to the screen dimensions instead of stretching it. .TP .BI [no-]translucent-windows By default DirectFB windows may be translucent. If you disable this feature, windows are forced to be either fully opaque or fully transparent. This is useful if your graphics card doesn't support alpha-transparent blits. .TP .BI [no-]decorations Enables window decorations if supported by the window manager. .TP .BI videoram-limit= Limits the amount of Video RAM used by DirectFB. The amount of Video RAM is specified in Kilobytes. .TP .BI agpmem-limit= Limits the amount if AGP memory used by DirectFB. The amount of AGP memory is specified in Kilobytes. .TP .BI screenshot-dir= If specified DirectFB will dump the screen contents in PPM format into this directory when the key gets pressed. .TP .BI disable-module= Suppress loading of this module. The module name is the filename without the \fBlibdirectfb_\fP prefix and without extension (for example \fBkeyboard\fP to disable loading of the keyboard input module). .TP .BI [no-]matrox-sgram Some older Matrox G400 cards have SGRAM and a number of graphics operations are considerably faster on these cards if this feature is enabled. Don't try to enable it if your card doesn't have SGRAM! Otherwise you'd have to reboot. .TP .BI [no-]matrox-crtc2 If you have a dual head G400/G450/G550 you can use this option to enable additional layers using the second head. .TP .BI matrox-tv-standard=[pal|ntsc] Controls the signal produced by the TV output of Matrox cards. .TP .BI matrox-cable-type=(composite|scart-rgb|scart-composite) Matrox cable type (default=composite). .TP .BI h3600-device= Use this device for the H3600 TS driver. .TP .BI mut-device= Use this device for the MuTouch driver. .TP .BI penmount-device= Use this device for the PenMount driver. .TP .BI linux-input-devices=[[,]...] Use these devices for the Linux Input driver. .TP .BI tslib-devices=[[,]...] Use these devices for the tslib driver. .TP .BI unichrome-revision= Override the hardware revision number used by the Unichrome driver. .TP .BI i8xx_overlay_pipe_b Redirect videolayer to pixelpipe B. .TP .BI window-surface-policy= Allows to control where window surfaces are stored. Supported values for are: .BI auto DirectFB decides depending on hardware capabilities. This is the default. .BI videohigh Swapping system/video with high priority. .BI videolow Swapping system/video with low priority. .BI systemonly Window surfaces are stored in system memory. .BI videoonly Window surfaces are stored in video memory. .TP .BI desktop-buffer-mode= Allows to control the desktop buffer mode. Whenever a window is moved, opened, closed, resized or its contents change DirectFB recomposites the window stack at the affected region. This is done by blitting the windows together that are visible within that region. Opaque windows are blitted directly while translucent windows are blitted using alpha blending or color keying. If there's a back buffer the recomposition is not visible since only the final result is copied into the front buffer. Without a back buffer each step of the recomposition is visible. This causes noticeable flicker unless all windows are opaque. Supported values for are: .BI auto DirectFB decides depending on hardware capabilities. This is the default. DirectFB chooses a back buffer in video memory if the hardware supports simple blitting (copying from back to front buffer). If there's no acceleration at all the back buffer is allocated in system memory since that gives much better performance for alpha blended recomposition in software and avoids reading from the video memory when the result is copied to the front buffer. .BI backsystem The back buffer is allocated in system memory. This is the recommend choice if your hardware supports simple blitting but no alpha blending and you are going to have many alpha blended windows. .BI backvideo Front and back buffer are allocated in video memory. It's not required to set this mode explicitly because the 'auto' mode chooses it if blits are accelerated. Without accelerated blits this mode is not recommended. .BI triple Like backvideo except the surface is triple buffered. .BI frontonly There is no back buffer. This is the best choice if you are using opaque windows only and don't use any color keying. .BI windows Special mode with window buffers directly displayed. This mode requires special hardware support. .TP .BI vsync-after Wait for the vertical retrace after flipping. The default is to wait before doing the flip. .TP .BI vsync-none Disables polling for vertical retrace. .SH EXAMPLES Here are some examples that demonstrates how the parameters described above are passed to DirectFB application on the command-line. .TP .B df_neo --dfb:no-hardware Starts df_neo without hardware acceleration. .TP .B df_neo --dfb:help Lists the DirectFB options that can be passed to df_neo. .SH OTHER INFO The canonical place to find informations about DirectFB is at http://www.directfb.org/. Here you can find the FAQ, tutorials, mailing list archives, the CVS tree and can download the latest version of the DirectFB library as well as a number of applications. .SH FILES .TP .I @SYSCONFDIR@/directfbrc system-wide DirectFB configuration file .TP .I $HOME/.directfbrc per-user DirectFB configuration file .TP .I /etc/fb.modes frame buffer modes file .SH SEE ALSO .BR fb.modes (5), .BR fbset (8), .BR mouse (4), .BR ppm (5) DirectFB-1.2.10/docs/README.screenshots0000644000175000017500000000406111164361026014306 00000000000000How to make DirectFB screenshots -------------------------------- There are two ways to generate DirectFB screenshots. The easy way is to set the "screenshot-dir" parameter in the DirectFB configuration file directfbrc or to pass it as a command-line option. See the directfbrc man-page for more details. You can then generate screen dumps in the PPM format by pressing the PrintScreen key. The PPM files can easily be converted to others formats using for example the netpbm tools. The hard way to do screenshots is to read directly from the frame buffer device. This works for all applications that use the frame buffer device, not only for DirectFB applications. The resulting data is then converted to a more convenient format using the netpbm graphics conversion tools. If the frame buffer is not running at 24 bit depth, the data has to be propagated to 24bit RGB before netpbm can handle it. The tools directory contains the source for two small utilities that do just this: raw16toraw24 is a small tool that reads 16bit RGB565 data from stdin, converts to 24bit RGB888 data and writes it to stdout. raw15toraw24 is a small tool that reads 15bit RGB555 data from stdin, converts to 24bit RGB888 data and writes it to stdout. raw32toraw24 is a small tool that reads 32bit ARGB data from stdin, converts to 24bit RGB888 data and writes it to stdout. The following steps have to be performed to take screenshots: Step 1 - Log in from another computer using ssh or telnet. Start your application and stop it by pressing Ctrl+C in the remote terminal. Step 2 - Read data from /dev/fb0 and write it to a file. examples: [15bit] raw15toraw24 < /dev/fb0 > raw24.tmp [16bit] raw16toraw24 < /dev/fb0 > raw24.tmp [24bit] cat /dev/fb0 > raw24.tmp [32bit] raw32toraw24 < /dev/fb0 > raw24.tmp Step 2 - Convert data to ppm using rawtoppm and specify the resolution of the frame buffer. example: rawtoppm 800 600 raw24.tmp > ppm24.tmp Step 3 - Convert ppm to png using pnmtopng. example : pnmtopng screenshot.png Thats it! DirectFB-1.2.10/docs/html/0000777000175000017500000000000011307522564012123 500000000000000DirectFB-1.2.10/docs/html/Makefile.am0000644000175000017500000000070011164361026014063 00000000000000EXTRA_DIST = dfb_logo-alpha.png docs_headers = \ $(top_srcdir)/include/directfb.h \ $(top_srcdir)/include/directfb_keyboard.h \ $(top_srcdir)/include/directfbgl.h all-local: stamp-docs stamp-docs: $(top_srcdir)/tools/gendoc.pl $(docs_headers) Makefile.am rootme=`pwd`; \ $(PERL) $(top_srcdir)/tools/gendoc.pl DirectFB $(DIRECTFB_VERSION) $(docs_headers) \ && echo timestamp > $$rootme/stamp-docs distclean-local: rm -f *.html stamp-docs DirectFB-1.2.10/docs/html/Makefile.in0000644000175000017500000002632311307521476014113 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = docs/html DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = dfb_logo-alpha.png docs_headers = \ $(top_srcdir)/include/directfb.h \ $(top_srcdir)/include/directfb_keyboard.h \ $(top_srcdir)/include/directfbgl.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/html/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/html/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am all-local: stamp-docs stamp-docs: $(top_srcdir)/tools/gendoc.pl $(docs_headers) Makefile.am rootme=`pwd`; \ $(PERL) $(top_srcdir)/tools/gendoc.pl DirectFB $(DIRECTFB_VERSION) $(docs_headers) \ && echo timestamp > $$rootme/stamp-docs distclean-local: rm -f *.html stamp-docs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/docs/html/dfb_logo-alpha.png0000644000175000017500000003116711164361026015406 00000000000000PNG  IHDR(3$asRGBbKGD pHYs  tIMEa) IDATx}wx\ՙ)44$[Ʋ\(6`Ж5$f!&<`Xef Y1n @B PbYZML䂫ܭ.MӴ{\Q%>\@qL[7$Az%o˓g-Na Nz"5(X&K5H3ل&XK"n"AU*&qnAZH]ԏRwí#i(rHa4QAsM`/i"p:rB @@9)P=qNц `=$ׅ&,4 I! gl\4(vU@3MTS/ vikOҊG+H)(#`vY7RzROa۸v fO㢋 *b.p%r ٱ ;_=1̼43GI6o>Q6\Cl9I< lGy~f33]>T8~cpEɬkR{ڍ +^39ݓRꀞ`v\oP90&8M8,1*acI L[_Gv$UJ~SS1uZ7+zŇ )eք|G/t_1DWNGJs U| )#hsnoʝ6f .4+f"PJЯB`' .Xgq&H >Qk&A?EТtH (pyOLE%Þ)mvV٢Ha,`4Rh2mfئ\J>&S_Z7 NG&S QzeopW6."x2l'fE:.)  qu8NVSnN~NIsj|zFC& ";_C),yR칭d2iZVPr*VcrQa,W;2H22GoJ>jS~!L9B'_%1ٮDwņG.#3HrţVW*2Q*7;mdZG86;[%'gNm`2mQkm^aZu׆/.8 M1%R=^ l Ɏ=lt6y ݪ:,s7! r, PM_ 2 mk1d~24CIK86 WJ?hp;9;6@%9krxyx~ϯ{.R)^TCW#8 #ijà  +&ř3UNBp8@qpXTcaY b$foʹBև.ZĊOvճ&>ѨZѥT@"Ɯk\. `DZc'MPq]mh|qEv<gEz@1;* @i :m@j? 2砍ƺr"fӻZi H۽9KUT90U(MPGUf9/t!ѱs0"zzqqesV Ѵ8C&IxA~E Tv7$UU(U;j G[L6V c$@LWlj3rQJX P]}  Jk,fd=Ve$њvdJw,4=GL]h`|$4fom{-b} ̋c7rS@Ov?4ϯ?m:GNJ0)&dzRʜhJT_\Avv@\QUC JtSiNn]CA$}g:zJ2?& Lp^aO[Ϩ?<&G{+di=z.j6'n[_)k'ec+N4[rY>"Ϩ \UUA|&y/+{w=O;aߙHy0cA3h&pΞv, { ͫ{u dDJMu~Jm' &%ݫ.q=º9n̮-J +\K[x-?| ̌X_93fS?|d {mRׁ58K.izYg4ٍnh~N!66cK6'韢 @U!S d:UEײ7nb2Mg 9ݮ2KE iy9Ok)&[oӯH =B8\HړǩEuTzl Sۖ6m؀ddaIP܎V-׆0h6Y)$f 0W+5Aţ$B2àbMpz4ՄWI7@jw&⺖7ͮCy/R"))w&k2-d0-2#ϬG{.-phajjUE5Lpv{&4F y@TyYkf)AB` [Z\~q?u7+[Fz՞~}cyBwe.Q;Gŏy~/iiUk.=[WB#pHI#{]gjE#ʹaWf~i-p`\% .̤+%oWww1Cd(98W \LYL0?RG쳇d y?NZ}PV{GjL0{+jya'34,(r Z),T{/bx;|{ 5PfH2mJEࠁg 1H]gv09Yyq!4MCiBbَ>ý_L, n&z5'CUՄz _m$d 0])~ `)GО` PUu '(ߗDt}G+ldCn9ʦvfY=ؓxPyKfo\T\_|?^yΞ0\0bLeV37 P}M(X+F`њtHLᖭQ6ͳt;Є+{wD t$ PwiA85trR؁ˎYPIӲe/;̽fÄOLC fWVL "m>c^ROF0$m!/B3栨smw 4JM69* ^} /{ͷk\uUsK! ?gF|8rzfHZ^gw6# hz#+]y ĞSki{n.}էB8H#~+޾ zmL{`+[2qHT%k3>:'!κrdrKh+@W&` +̲q(U  | u5p<R ]U'UIsa&$P}r,&AeMMN4s6+вyiJW{wJY=w/EEInR(3 TiuxU _QBsCcm)IPlOqaa(S8ʯ썂w%s;]]mc&wW/.b4GJ)LJK\pXYӲNdtJ;99ł"foon_fu0r2{@iUkN#3#@ڢ%sfLT Hځ҃G7uΨzƥ~$/҉u4yT[;i_|Rpq]5@go@CV{[aNLڏ[ι,5 KRahH+Yn|lgL 2D9Rݓѱfn Z@]EKrNKi>xJ4@w`TA`|N n7iq_ :7Ǵ.]KCvcs20ﴷ3-TN L]@m{  ]f<\j?uDT蒋06 8$ ouIch笩"ͩkZ>lNV]B@$vK %b3S Q솦UN?t@H }`~@>pQrK*= }{{5irķg^z&[(Txq%OϝP#r8h)4bB $c=ҭo035i糨֝Ab\J:"Q w"u[`Ԩ]9mL`Ң,Q $Mm$ڢ E}WdĨϊNPE`bhbh(!sM;'[fWNӽ"wXhUݚ,*W]}fn__O`hҷp7`^ŵ1qN.8)L~|[u 6tN(pM|ӯ/n:{I)'a%vM`XLE2̭3#Gy&u0R4s/Nj\w򂿳 (s9e36~+fIZP]=de1$zwYʍY:׽U4n*EHtB&Wcјp @Q_B9`"F29'US;[SI IW v!ĆXt7]7#`!v/xL;1 19K-=xdSgL D_%|f)J?6⡄YY"[ xjMXi/N=&#uLV,&eV36%VU5YhYP)ӧGt]4gjTla>Wa늫2) 0eNX_ zf^{qt]+ {brw#7'_Z|$6},V׺w1o'.m½B5{ϵi[Ğ٧|%+OV>'1Ns5":P)] J91IцXtEv0#}LZ^oRq٥><]fiR(M],Pv744Y!Y5O kڮ[&ɷ㏽xc}b ?D;L4O0SyA9e|+uy~}i: ֯~@sw+",u(߅0}?iㄙSSu•Jm#v`vz2a19+`,rWj\l"=ĞH#jh 80)K+R~1٦* 34ÎɰVmT=[)ʴhdQ:%!2~"006>DKw\oc1״S9w/[tMhiI7sv-. rc$r"ݓCoG*?P}E|fXVΓp/M^zweeх&2kd$b:/-mdrv~O$ (`<43JWIgˁbNnô{\]$_fn)؂Q#Q故\L2*(U;s'GrD85gi8W%* '' \f{9Nq}dJ]NR&o * 5 . UO߆7@Mq\ȭNP$0~^5)ut_ۨ Z>fO4+ڛaYW폫 r$x, \W)30驈*lAnѲŭL'"ަBӳ o~H5bPVU{vZEj#rۙm;SX5}0?tG*Fn cT ЙIfje)oVԕ ΒmXM]LP7cILiv_3Z -9 dpc[^8 oYsg*!`e0+xh%w3g~,8fzƌY^}^ CPx1fR]bA@Ry]R{Ng}1X6+f|´vg]QBi/Y:u 44ߋ? NcT`Zf`}G]v>Ȧ@,jNIh +smlILaC,ݗlIDAT @=vǍ61,rQ^7& _48$"iCI.IU~84fIST?55av K,Ī0<=A#y򬪣USl}>b|EϽ|Y%e\ɧ1ò9U0D5en^Vw\뙾,^93iLRbkQGa֝ 3N3,txWx,ZE~5O#AȔJ#i=v2fdB y0ľ*n ~6#{FnRi̽QJ21?ôܴS)$Tj;փ/xD^%w5Jff:"dZOe(²K˺#u^/&Y]n`J 9`c t hh> h˧.no@Ѭ~yqiSX4ۓXl8 3/2DbP g'Mn=×Kd>xW}`fGjs0Ǎ5ƛ'0i}Mw:Q-YKqo })T5,>۽u@G/Gs,R(hO̹ 5govz*Q%S`STͅu6^b-b21i;AYuW FS =ӽnxhF|CiPDQ,jVpzpo6(^2 EnGN ;}MvdZWiP7z78-cpZ 1[ēL~y r2L\x9tS\]'ekB 5 +ݸܻ߫%*X>@C‰مh=Ӈ`a@,uu .Ϛsv6Iip>vki7N9t_{='Ŗ-?sM?JJzr1S#ZӴ3vHR$Ng`VtЦ0riOzZP}Esne\t }+fL799B08` -x&2m ӈs&֋e觛@KsHpFC{{`/zCE̴$iލ$xqf՟?L;HsL7VYZWXv6n CvrFsSQ N4 S(~CEEa+F% ϧӄ@}z^o y;{%OE_ BROI)j]2SδFdN Ph@:Ӵ[-k'#OcUx,L1Ӹ)08MY3bRYMT46jc<40kAMrbw𜩃JBa__ó roUKIGLnmw7ڽM/lL;yuf361՟;G^1V)9)Oi ;#$KI5bw/!`=@Z3^tr]XM?~̘s̤:חe{?`p[t9UݳT4{_KkmH%ʎܲY_>(vkO0}aymZDL߄3)^)uqVW@Ujp5U2sAJ|JcsE3 (%y8 @O+ؔ-g+;x'twIgyX]^OfM0^2׏ʀ6%%3MvV T]zI4(_`,fSݚ#kc~ہ$:Zt{]B"7wȆ`бn,g ۅw1s+ `#DL:^[!A- x%aQNNú,TNfVaœ#= # [TM2Ad-] ΓϟZAiPVNE .(oD fU' (NTЮTۻ. '|4ˋR'ث"f 0>"1_wr`<٪Bq5 PŊ jz7ɗhMT9ghKxyΟb6{'[l08[bDͬɼJPz0>x1ף洁CU!5Pr‰: >r5zWDsV8m#yHc)tڍǸk uBHt ]6ؕ/pv+O:#0fU4ŲGSt&:Oo|mY'^;?$n8'y6tu(4 9L0s<: ڢ t2O ^銬#03H%*5J:4 \4a>.u=qܲz:ib n1uS?i]խXϬ7GWvN1I_]Ρvʜ)d~®.mA\z/xZv‹(NߎsOv .0\@ [VŰyeGяh2?E}`G/k}J?aLr߷ }o?vE63-p9egCfD2֋ܶFV#aڍmDA > i3;tTŅ4&[@c%_B|߇Ys YKlJxco8sFbBvHBJ<lqB̊=I;~lfI;ցHUI/)Ԅ g[,QGq{4?79lh n\ks ǷYڰ_lyg?L#~v فɭgV6PǯeS]F2'c[ }#G/`2X:. 5ߺl4mh0yn})^Z a? 3i~? 4'@* %lgαXс7֝8ο@hN@8`=AG7= ̔^R4q'+BV4hQoFƛE`0V¸)柉РL6V)5*FBtqN b^@J <9 KfQ|Fa<80ksB0jy+ЩJ#ScB26=Sy:ѮdJXT󉪱f,Uɏ]{=0(,ߞFsyYo2iKcYvHZ,WQ򣒁r\@JL1!LfDUGn'DTJ0i܇ܜ"~rL7mh4=0S=lQ*-N6&kTL`>(hq#@gB^Q^iPjL?RizUUއ} @nYb=tia\չ6QҚp.}(W";a6n]z7R`h:閧&Xϼ?k$->{ЧNt*pRI2 1̼A>?>Ycچ} /ߋ|ON'-3?kPFp j#awX2__KYHq|28qQѬñS1LZ0 ![ gZ9Qn(kMoi dl]6DL#7Eow?5aU"F4q D>7q9\_`#v]ͲPSy"vͮ:q a>I ?X&zn`>AyêKXݧ[xya8+FQÀp}۳{Viʰܟ:*Kb9L>q*H`{&Fs>%EqC1f,vV&&t!~XLN@fq`: 7#{n2exOXRG9؍WcDZs,/:9!Dh~0!rAg .TH DFBG 1 "9 Jul 2003" "Version @DIRECTFB_VERSION@" "DirectFB Manual Pages" .SH NAME dfbg \- DirectFB background configuration tool .SH SYNOPSIS \fBdfbg\fP [\fIoptions\fP] <\fIfilename\fP>| .SH DESCRIPTION \fBdfbg\fP is a small utility to configure the background of the DirectFB desktop. It loads the specified image and sets it as background image. \fBdfbg\fP requires DirectFB with the multi-application core enabled. .SH OPTIONS .TP .B -c, --color Set color fill mode using in AARRGGBB format (hexadecimal). The alpha component can be omitted in most configurations. .TP .B -t, --tile Set tiled mode instead of scaling the image to fit the screen size. .TP .B -v, --version Output version information. .TP .B -h, --help Print brief help and exit. .SH EXAMPLES Set background color to DirectFB's default color dfbg -c ff107ce8 Set image stretched to fit the screen dfbg bg.png Set image tiled dfbg -t bg.png .SH OTHER INFO The canonical place to find informations about DirectFB is at http://www.directfb.org/. DirectFB-1.2.10/config.guess0000755000175000017500000012706110707444443012474 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: DirectFB-1.2.10/install-sh0000755000175000017500000003246410753066007012157 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: DirectFB-1.2.10/autogen.sh0000755000175000017500000000710111245562152012141 00000000000000#!/bin/sh # This script does all the magic calls to automake/autoconf and # friends that are needed to configure a cvs checkout. You need a # couple of extra development tools to run this script successfully. # # If you are compiling from a released tarball you don't need these # tools and you shouldn't use this script. Just call ./configure # directly. PROJECT="DirectFB" TEST_TYPE=-f FILE=include/directfb.h LIBTOOL_REQUIRED_VERSION=1.3.4 AUTOCONF_REQUIRED_VERSION=2.13 AUTOMAKE_REQUIRED_VERSION=1.4 srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir make_version () { major=`echo $1 | cut -d '.' -f 1` minor=`echo $1 | cut -d '.' -f 2` micro=`echo $1 | cut -d '.' -f 3` expr $major \* 65536 + $minor \* 256 + $micro } check_version () { ver=`make_version $1.0.0` req=`make_version $2.0.0` if test $ver -ge $req; then echo "yes (version $1)" else echo "Too old (found version $1)!" DIE=1 fi } echo echo "I am testing that you have the required versions of libtool, autoconf," echo "and automake." echo DIE=0 echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... " if (libtoolize --version) < /dev/null > /dev/null 2>&1; then VER=`libtoolize --version \ | grep libtool | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"` check_version $VER $LIBTOOL_REQUIRED_VERSION else echo echo " You must have libtool installed to compile $PROJECT." echo " Install the appropriate package for your distribution," echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1; fi echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... " if (autoconf --version) < /dev/null > /dev/null 2>&1; then VER=`autoconf --version \ | head -n1 | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"` check_version $VER $AUTOCONF_REQUIRED_VERSION else echo echo " You must have autoconf installed to compile $PROJECT." echo " Download the appropriate package for your distribution," echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1; fi echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... " if (automake --version) < /dev/null > /dev/null 2>&1; then VER=`automake --version \ | grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"` check_version $VER $AUTOMAKE_REQUIRED_VERSION else echo echo " You must have automake installed to compile $PROJECT." echo " Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.4p1.tar.gz" echo " (or a newer version if it is available)" DIE=1 fi if test "$DIE" -eq 1; then echo echo "Please install/upgrade the missing tools and call me again." echo exit 1 fi test $TEST_TYPE $FILE || { echo echo "You must run this script in the top-level $PROJECT directory." echo exit 1 } if test -z "$*"; then echo echo "I am going to run ./configure with no arguments - if you wish " echo "to pass any to it, please specify them on the $0 command line." echo fi case $CC in *xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps ;; esac echo echo echo Running aclocal ... aclocal -I m4 $ACLOCAL_FLAGS echo Running libtoolize ... libtoolize --automake echo Running autoconf ... autoconf # optionally feature autoheader (autoheader --version) < /dev/null > /dev/null 2>&1 && echo Running autoheader... && autoheader echo Running automake ... automake --add-missing $am_opt cd $ORIGDIR echo Running configure --enable-maintainer-mode "$@" ... $srcdir/configure --enable-maintainer-mode "$@" || exit 1 echo "Now type 'make' to compile $PROJECT." DirectFB-1.2.10/data/0000777000175000017500000000000011307522564011140 500000000000000DirectFB-1.2.10/data/Makefile.am0000644000175000017500000000016611164361026013106 00000000000000## Makefile.am for DirectFB/data miscdatadir = $(DATADIR) miscdata_DATA = cursor.dat EXTRA_DIST = $(miscdata_DATA) DirectFB-1.2.10/data/cursor.dat0000644000175000017500000001440011164361026013055 00000000000000@ Q# V% g[( Dٱb- 6xi0 *Nܴh/ 9g, -S_)  !u}|ywtrpm5  0~~~Q}|ywtspnl/ $;k}|zwusqnme#  .yyyJց}|ywusqomkS !7^~|{ywusqomkh9 *wwwBq~|{ywtsqomkiW 2uuuN|~}|zxvtsqomkib2 #7V{}|{ywutrpnmkid= '~~~9wwwTrzxvttrpnmkh^=  (7fffIbptsqomljcO4!  $1mmm=fffIV^aa^WJ}}}9*  &/{{{4lll8kkk:nnn:qqq6xxx0)!  "#"    DirectFB-1.2.10/data/Makefile.in0000644000175000017500000002766111307521476013136 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = data DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(miscdatadir)" miscdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(miscdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ ASFLAGS = @ASFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ DFB_LDFLAGS = @DFB_LDFLAGS@ DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ DIRECTFB_VERSION = @DIRECTFB_VERSION@ DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ DSYMUTIL = @DSYMUTIL@ DYNLIB = @DYNLIB@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ GIF_PROVIDER = @GIF_PROVIDER@ GREP = @GREP@ HAVE_LINUX = @HAVE_LINUX@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ JPEG_PROVIDER = @JPEG_PROVIDER@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBJPEG = @LIBJPEG@ LIBOBJS = @LIBOBJS@ LIBPNG = @LIBPNG@ LIBPNG_CONFIG = @LIBPNG_CONFIG@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_BINARY = @LT_BINARY@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN2HTML = @MAN2HTML@ MKDIR_P = @MKDIR_P@ MODULEDIR = @MODULEDIR@ MODULEDIRNAME = @MODULEDIRNAME@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ OSX_LIBS = @OSX_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PNG_PROVIDER = @PNG_PROVIDER@ RANLIB = @RANLIB@ RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_LIBS = @SDL_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SOPATH = @SOPATH@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSFS_LIBS = @SYSFS_LIBS@ THREADFLAGS = @THREADFLAGS@ THREADLIB = @THREADLIB@ TSLIB_CFLAGS = @TSLIB_CFLAGS@ TSLIB_LIBS = @TSLIB_LIBS@ VERSION = @VERSION@ VNC_CFLAGS = @VNC_CFLAGS@ VNC_CONFIG = @VNC_CONFIG@ VNC_LIBS = @VNC_LIBS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ miscdatadir = $(DATADIR) miscdata_DATA = cursor.dat EXTRA_DIST = $(miscdata_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-miscdataDATA: $(miscdata_DATA) @$(NORMAL_INSTALL) test -z "$(miscdatadir)" || $(MKDIR_P) "$(DESTDIR)$(miscdatadir)" @list='$(miscdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(miscdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(miscdatadir)/$$f'"; \ $(miscdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(miscdatadir)/$$f"; \ done uninstall-miscdataDATA: @$(NORMAL_UNINSTALL) @list='$(miscdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(miscdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(miscdatadir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(miscdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-miscdataDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-miscdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-miscdataDATA \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-miscdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: DirectFB-1.2.10/directfb.spec0000644000175000017500000000634211307521521012576 00000000000000%define name directfb %define version 1.2.10 %define oname DirectFB %define libname lib%name Summary: Hardware graphics acceleration library Name: %name Version: %version Release: 1 License: LGPL Group: System/Libraries Source0: http://www.directfb.org/download/%{name}/%{oname}-%{version}.tar.gz URL: http://www.directfb.org/ BuildRequires: libpng-devel >= 1.2.0 BuildRequires: zlib-devel >= 1.1.3 BuildRequires: libjpeg-devel >= 6b BuildRequires: freetype2-devel >= 2.0.2 BuildRoot: %{_tmppath}/%{name}-%{version} %description %oname - A hardware-accelerated graphics library on top of the Linux frame buffer device. %package -n %libname Summary: Shared library part of %oname Group: System/Libraries %description -n %libname %oname - A hardware-accelerated graphics library on top of the Linux frame buffer device. %oname is a thin library that provides developers with hardware graphics acceleration, input device handling and abstraction, an integrated windowing system with support for translucent windows and multiple display layers on top of the Linux frame buffer device. It is a complete hardware abstraction layer with software fallbacks for every graphics operation that is not supported by the underlying hardware. %package -n %libname-devel Group: Development/C Summary: Header files for compiling %oname applications Requires: %{libname} = %{version}-%release Provides: lib%name-devel = %version-%release Provides: %oname-devel = %version-%release %description -n %libname-devel %oname header files needed for building applications based on %oname. %package doc Summary: %oname documentation Group: Development/Other %description doc %oname documentation in html format. %prep %setup -q -n %oname-%version %build %configure \ --enable-fbdev \ --disable-maintainer-mode \ --enable-shared \ --disable-fast-install \ --disable-debug \ --program-transform-name="" # is this hack needed? %make %install rm -rf $RPM_BUILD_ROOT %makeinstall_std %clean rm -rf $RPM_BUILD_ROOT %post -n %libname -p /sbin/ldconfig %postun -n %libname -p /sbin/ldconfig %files -n %libname %defattr(644,root,root,755) %doc README* AUTHORS ChangeLog NEWS TODO %attr(755,root,root) %{_libdir}/lib*.so.* %{_libdir}/directfb-%version %{_datadir}/directfb-%version %{_mandir}/man5/*directfbrc.5* %files -n %libname-devel %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/*directfb-config %attr(755,root,root) %{_bindir}/*directfb-csource %attr(755,root,root) %{_bindir}/*dfbg %{_includedir}/directfb %{_includedir}/directfb-internal %{_mandir}/man1/*directfb-csource.1* %{_mandir}/man1/*dfbg.1* %{_libdir}/pkgconfig/* %{_libdir}/*.la %{_libdir}/*.so %files doc %defattr(644,root,root,755) %doc docs/html/* %changelog * Mon Jan 13 2003 Sven Neumann 0.9.16 - removed reference to avifile - added rules for dfbg and its man-page %changelog * Sun Oct 27 2002 Sven Neumann 0.9.14 - added this file as directfb.spec.in to the DirectFB source tree - moved directfbrc manpage to the main package * Fri Aug 23 2002 Gtz Waschk 0.9.13-1mdk - add directfb-csource and man page - 0.9.13 * Thu Jul 11 2002 Gtz Waschk 0.9.12-1mdk - initial package based on PLD effort DirectFB-1.2.10/ChangeLog0000644000175000017500000470301011307522346011720 00000000000000commit 76266326d6259bb9c00d726a9124d857b8dcaf94 Author: Niels Roest Date: Tue Dec 8 20:03:56 2009 +0100 API: changes to make 1.2.x DirectFB branch SaWMan 1.4.3 compatible commit df2d83515db77e3ed5f005d135c4383374730b83 Author: Niels Roest Date: Thu Aug 27 21:50:44 2009 +0200 release: DirectFB 1.2.9 commit e7f7189a085ca43c30e33596f41a597c1764b964 Author: Niels Roest Date: Thu Aug 27 15:17:42 2009 +0200 Makefile: remove armasm_memcpy files from EXTRA_DIST undoes cherry-pick f838144c6ff9b430fada849e436e997ecf2bf924 armasm_memcpy was not in 1.2.x branch yet commit e0b9219b0b6b86a727a436520450b3ee8175d9c3 Author: Niels Roest Date: Thu Jul 2 21:34:00 2009 +0200 [API] add application_id to a window Addition of: IDirectFBWindow_SetApplicationID IDirectFBWindow_GetApplicationID These functions set and get a free-to-use application ID. Any change, i.e. any call to the setter will inform the window manager. Currently, only SaWMan implements this callback as a callback to the SaWMan manager. commit d3e308e3ed206410ce32da57790c69a8047b0b87 Author: Niels Roest Date: Tue Jun 23 22:35:10 2009 +0200 [window] add resource ID also to window structure, if window has no surface commit a8ad614c1ebdd40e19386c90b97012156d828441 Author: Denis Oliver Kropp Date: Wed Jun 17 14:31:18 2009 +0200 [IDirectFBWindow] Dynamic window association via IDirectFBWindow::SetAssociation(). This patch adds dynamic association of windows, as opposed to the static initialization done via the window description. commit b5c3c2bbe32ecca3ab82264f29c1e6570c43943f Author: Niels Roest Date: Thu Jul 2 21:36:57 2009 +0200 [colorize windows] allow the window config value "color" to colorize the window If you do IDirectFBWindow::SetColor on a window without DSCAPS_COLOR: a color with a non-nul alpha value will multiply the window content with this color. Only supported by SaWMan, currently. For other WMs this call has no effect. commit 4648cf1c1399eefe02351e026cf31744b3679fa8 Author: Sven Neumann Date: Fri May 22 09:30:45 2009 +0200 Removed const qualifier from destination pointer The recently introduced IDirectFBSurface::Read method had a const qualifier for the pointer to the destination memory. Removed this qualifier as the method writes to this memory. commit 6592275550792539ffcbc76057b4eaa20e7859db Author: Niels Roest Date: Wed Aug 26 15:17:54 2009 +0200 [window] support for DWCAPS_COLOR fix fix for commit 15c90e1f81e425bf03eaaf7eb3066ed6b3c7fa56 to make it compile on the 1.2.x branch commit 15c90e1f81e425bf03eaaf7eb3066ed6b3c7fa56 Author: Niels Roest Date: Thu Jun 18 12:16:33 2009 +0200 [window] support for DWCAPS_COLOR when you specifiy DWCAPS_COLOR, the window will have a solid color only. A surface will not be created, so window->surface is 0. The color can be specified with Window::SetColor(r,g,b,a). This is always a "normal" color, NOT premultiplied, so DSCAPS_PREMULTIPLIED has no effect here. Currently, this option is only supported by the SaWMan window manager. commit f8665f6d396b9c99530df136d23d6472f8ae28a2 Author: Niels Roest Date: Tue Aug 25 13:05:04 2009 +0200 fbdev: Fixed RGB fields sizes in dfb_fbdev_set_gamma_ramp. thanks to Stanislav Bezzubtcev commit b231da614df57625e1544823f3c6e9cf598b204f Author: Niels Roest Date: Tue Aug 25 13:02:54 2009 +0200 gfx: Bugs in pixel format convertion fixed. Formats ARGB1555 and RGB555 were incorretly converted to RGB16. G component extended from 5 to 6 bit by coping of the last one. Now low bit of G component is a copy of upper one. Format RGB16 was incorretly converted to RGB32, ARGB. G component extended from 6 to 8 bit by coping 4,3 bits to 1,0. Now 1,0 bits of G component are copies of 5,4. thanks to Stanislav Bezzubtcev commit 352f783b50393bfc422daa35bcb00f14b751ab00 Author: André Draszik Date: Sat Jul 25 13:41:50 2009 +0100 [rgb32] PIXEL_RGB32() sets alpha to ff now Signed-off-by: André Draszik commit 68bf99d62fbf7e258459747534bfbdcfa69e42cc Author: André Draszik Date: Wed Jul 29 14:54:33 2009 +0100 [surface] add support for the DESTINATION Porter/Duff rule Signed-off-by: André Draszik commit 0f65b40d25f22e25cda3ba95aef3d9e61e0edfab Author: André Draszik Date: Wed Jul 22 02:06:49 2009 +0100 [software rasterizer] buffer unlocking fixes in error paths Signed-off-by: André Draszik commit 53e9842f21053e2dbdf03b4bf436332607af718d Author: Niels Roest Date: Fri Jun 26 21:16:19 2009 +0200 [fbdev] fix for BGR555 in conjunction with fbdev systems commit cad5e9f5d60e11e6b86c21e5d6457c42b30d7b9b Author: Denis Oliver Kropp Date: Fri Jun 12 23:37:58 2009 +0200 [configure] Fixed missing JPEG=yes setting in configure when LIBJPEG is set manually. LIBJPEG can be set to something like "-L/path -ljpeg" when running configure. commit 6bcb6f60a125ea2d02522e5c3d6ea89fc51d9513 Author: Niels Roest Date: Thu Jun 11 17:51:31 2009 +0200 [trace] fix so trace will also print static funcs in stack dump commit 9cf5c890628ff6e97565bfe5fcd69858d890d929 Author: Niels Roest Date: Thu Jun 11 17:47:13 2009 +0200 [vt switching] timing problems when vt-switching. doing graphic operations while DirectFB is suspended (due to vt-switching) caused asserts and problems - fixed thanks to Jacques Luder. commit 01481ede69501979b3a3cc78c356c9eb07dae6f7 Author: Niels Roest Date: Mon May 25 14:20:16 2009 +0200 [layer] Bug when switching source from surface to surfaceless (video). The bug is caused by the destruction of the region surface before the active buffer is unlocked (lock being held by layer). Thanks to Sorin Otescu for the patch. commit 000c11c62830d426f77a40a18de52a78c8670e80 Author: Niels Roest Date: Mon May 25 14:09:09 2009 +0200 [build] fix for commit 5a941ac479883bef11bd9ada65b07fafafff2ad1 INCLUDES were in the wrong order. Thanks Andre. commit 5b9032ea89256ca959bfa709992499c2ade35e01 Author: Ville Syrjala Date: Sat May 16 00:31:45 2009 +0300 layers: Prevent deadlock when destroying context A deadlock can happen between the input device shared reactor global lock and the layer context lock if the layer context destruction and input even processing happen at the same time since the code paths acquire the locks in different order. Fix the problem by detaching the input devices from the windowstack before taking the layer context lock in the context destruction path. Nothing ever modifies the windowstack's device list so AFAICS it should be safe to do this without holding the layer context lock. This is a backtrace of the deadlock: Thread 13 (Thread 0x436a7950 (LWP 6158)): 0 0x00007f23b8125117 in ioctl () from /lib/libc.so.6 1 0x00007f23b95982ee in fusion_skirmish_prevail () from /usr/local/lib/libfusion-1.3.so.0 2 0x00007f23b9846604 in dfb_layer_context_lock () from /usr/local/lib/libdirectfb-1.3.so.0 3 0x00007f23b985690e in _dfb_windowstack_inputdevice_listener () from /usr/local/lib/libdirectfb-1.3.so.0 4 0x00007f23b959a12c in fusion_reactor_dispatch_channel () from /usr/local/lib/libfusion-1.3.so.0 5 0x00007f23b9843dff in dfb_input_dispatch () from /usr/local/lib/libdirectfb-1.3.so.0 6 0x00007f23b5a4b1f6 in linux_input_EventThread () from /usr/local/lib/directfb-1.3-0/inputdrivers/libdirectfb_linux_input.so 7 0x00007f23b9387ec6 in direct_thread_main () from /usr/local/lib/libdirect-1.3.so.0 8 0x00007f23b904e087 in start_thread () from /lib/libpthread.so.0 9 0x00007f23b812bccd in clone () from /lib/libc.so.6 10 0x0000000000000000 in ?? () Thread 18 (Thread 0x40832950 (LWP 6153)): 0 0x00007f23b8125117 in ioctl () from /lib/libc.so.6 1 0x00007f23b95982ee in fusion_skirmish_prevail () from /usr/local/lib/libfusion-1.3.so.0 2 0x00007f23b959944a in fusion_reactor_detach_global () from /usr/local/lib/libfusion-1.3.so.0 3 0x00007f23b98574cd in dfb_windowstack_destroy () from /usr/local/lib/libdirectfb-1.3.so.0 4 0x00007f23b98476f8 in context_destructor () from /usr/local/lib/libdirectfb-1.3.so.0 5 0x00007f23b959900e in object_reference_watcher () from /usr/local/lib/libfusion-1.3.so.0 6 0x00007f23b9595026 in _fusion_call_process () from /usr/local/lib/libfusion-1.3.so.0 7 0x00007f23b9596d5a in fusion_dispatch_loop () from /usr/local/lib/libfusion-1.3.so.0 8 0x00007f23b9387ec6 in direct_thread_main () from /usr/local/lib/libdirect-1.3.so.0 9 0x00007f23b904e087 in start_thread () from /lib/libpthread.so.0 10 0x00007f23b812bccd in clone () from /lib/libc.so.6 11 0x0000000000000000 in ?? () commit 84c166fd91fea899cf5ca43c73f3d77f677bb6ed Author: Niels Roest Date: Thu May 14 20:27:33 2009 +0200 [input] fix for shutdown crash reproducible with "splashy" boot screen commit 7ad4b4775f9931a4379ac68c95abba998743bf4d Author: Niels Roest Date: Wed May 13 21:46:31 2009 +0200 [jpeg] plug mem leak on file read error commit a204d81bfe578bd8aef4a2c9937c238dc12e00e4 Author: Niels Roest Date: Wed May 13 21:45:58 2009 +0200 [matrox] add #ifdef to prevent wrong asm on non-X86 build commit 3dcb90e868fdd464d7eaa5f3cc4c20bd624eaeb5 Author: Niels Roest Date: Wed May 13 21:45:28 2009 +0200 [build] add missing include path for builddir != srcdir reshuffle makefiles to make changes easier and shorter commit 53503673d1dfb0dbf6552e581ed87d42705a8386 Author: Sven Neumann Date: Tue May 12 14:41:56 2009 +0200 Consistently use doubles to calculate the inverse scale factors Use of floats here triggered a bug in the gcc 4.3 soft-float code. Since we are already using 1.0/scale in some places, it seems OK to make this consistent. commit 2244cd24fdaae2b1b95e9239cf89449dbce026be Author: Ville Syrjala Date: Tue May 5 22:07:20 2009 +0300 .surface: Fix back<->front swap Wrong back and front buffer indices were used when performing the back<->front buffer swap which caused the the application render into the wrong buffer. commit e4d56472f4c6c897d87f15e1622915793fd0a9dc Author: Sven Neumann Date: Thu May 7 21:27:13 2009 +0200 input: no need to set min and max for the touchpad, it doesn't deliver absolute events; check that minimum or maximum is != 0 commit 309d2e70e76cc21c400d17cf53a1ecaf69aa68c7 Author: Sven Neumann Date: Thu May 7 11:34:52 2009 +0200 input: Implement driver_get_axis_info() in the linux-input driver commit f838144c6ff9b430fada849e436e997ecf2bf924 Author: Sven Neumann Date: Fri May 1 09:49:18 2009 +0200 Makefile: include armasm_memcpy files in EXTRA_DIST Include the recently added optimized memcpy implementation for the ARM platform in EXTRA_DIST so that the files end up in the release tarball. commit c383be626e0605b5cd9ec0ab12b6c8695ac69dde Author: Ville Syrjala Date: Wed Apr 29 23:04:22 2009 +0300 modules: Don't touch the module entry after dlclose() When a module was unloaded with dlclose() the destructor function (direct_modules_unregister() for the input drivers) was called. The dtor freed the module entry but the code calling dlclose() proceeded to fiddle with the already freed entry afterwards. Reorganize the code slightly to avoid the problem and add a few comments to remind people what may happen when dlclose() is called. The problem sometimes manifested itself as a segfault when loading the modules. Suppressing all but the required input modules was an effective workaround for the problem. commit 235ea6378558f26158e37ceeace474cd00a7d89d Author: Niels Roest Date: Tue Mar 31 14:38:09 2009 +0200 [release] 1.2.8 commit 66c7f10d2ee9bbeda6c08cfedb6d61a4588eddfc Author: Niels Roest Date: Tue Mar 31 14:29:42 2009 +0200 [surfaces] local pool clean-up was too greedy; fixed commit b2562326a950092fe6a01eb11f71c74ea5474dfd Author: Niels Roest Date: Tue Mar 31 11:27:07 2009 +0200 [surface] add Write/Read commit 64bbd35ec356f0ae39d2e8193574e23303f3c53b Author: Niels Roest Date: Mon Mar 30 20:26:15 2009 +0200 [fusion] changes for Fusion 0.8.1, forgotten this. commit f2044600fe4509fa73b78d38b6a92f4a0302bf80 Author: Niels Roest Date: Thu Mar 12 21:54:31 2009 +0100 [fusion] changes for Fusion 0.8.1 commit c25a8bada418260ca689b5b626cef2f9d6327b75 Author: Niels Roest Date: Tue Jan 20 12:32:53 2009 +0100 Updated for 1.2.7. commit ad6a2489b7e121eaa90039744d7068845b29dd7c Author: Niels Roest Date: Mon Jan 19 16:14:11 2009 +0100 [surfaces] clean-up local pool on 'leave' and 'destroy' Fixes issue when deallocates are initiated too close to IDirectFB Release. commit e80db8d373d7a34a971953b57d2affcaf644bc4b Author: Niels Roest Date: Fri Jan 9 18:09:56 2009 +0100 [core] typo in debug msg commit 99287b5fb6c0816c7d95854232d0a29b486e8be3 Author: Niels Roest Date: Tue Dec 23 18:37:38 2008 +0100 [NEWS] Updated for 1.2.7. commit 34a1725198fcc6cf138025b97e0304ee79ddcbc0 Author: Niels Roest Date: Tue Dec 23 18:37:03 2008 +0100 [version] 1.2.7 commit f818feb423742234307cb3b60b9b35e299e986f7 Author: Niels Roest Date: Mon Dec 1 17:33:19 2008 +0100 [sh772x] namespace conformance commit fec930355974a005ea820c854cd5e1aa2c46ea17 Author: Niels Roest Date: Mon Dec 1 15:34:21 2008 +0100 [sh772x] changes: - obtain LCD parameters via linux/fbdev - BEU byte swapping removed (not needed with current fbdev/LCDC settings) - JPU temporarily disabled due to conflicts commit 887fad282740e1cf74d22deea5d6cc582f07c921 Author: Niels Roest Date: Mon Dec 1 12:45:43 2008 +0100 [devmem] fix the displayed-by-dfbdump devmem pool size. The internal size was not broken. commit 102e250634df2bc431e2fc77c616d5d81761b9ac Author: Ville Syrjala Date: Mon Dec 1 07:46:22 2008 +0200 surface_pool: Fix debug print commit 1d69f2e92a5798eaa73959f06e99b24271f2aad0 Author: Ville Syrjala Date: Mon Dec 1 07:33:33 2008 +0200 prealloc_surface_pool: Add CSTF_INTERNAL to types commit 72d10707517a342949676bc7ec08d036ffcf0027 Author: Ville Syrjala Date: Sat Nov 29 11:11:01 2008 +0200 surface_pool: Show CSTF_PREALLOCATED in the debug output commit 0e9873a591200e85fbcd6c5b56f5ba00cd9264cc Author: Ville Syrjala Date: Tue Nov 18 17:04:56 2008 +0200 directfb.h: Document the blend functions commit cc88fba323663088a3559ead5d31244294bfa587 Author: Ville Syrjala Date: Sat Nov 8 21:59:40 2008 +0200 unichrome/cle266: Make the files non-executable commit d33c7bce9e65b9414908643c5ba1051f4b253683 Author: Ville Syrjala Date: Sat Nov 8 16:53:32 2008 +0200 unichrome/cle266: Drop useless inline keywords The functions are never inlined since they are defined in another translation unit to the one where they are called. commit 99d178c8723b8bf2467570afe2739be0544ff8f5 Author: Ville Syrjala Date: Sat Nov 8 16:34:49 2008 +0200 modules: Add some constness commit dcc8a71903bb40e1147cde359da1d35cc33cb132 Author: Ville Syrjala Date: Sat Nov 8 13:10:27 2008 +0200 Silence compiler warnings commit eb8d81025cada03e84593ce5c6c1c3b3a765c8ef Author: Ville Syrjala Date: Sat Nov 8 14:02:22 2008 +0200 Convert to C99 initializers commit e2f81d01f99d047727f7b1446c2926e1e0107c87 Author: Ville Syrjala Date: Sat Nov 8 14:00:50 2008 +0200 core_parts: Fix prototypes and convert to C99 initializers commit 54ad3c8a2195952802ebb54dd29beaf1d781f0dd Author: Ville Syrjala Date: Mon Nov 3 13:52:45 2008 +0200 Check allocation results commit 638849520bab4aa0e9ab4796e96849e04f252346 Author: Ville Syrjala Date: Mon Nov 3 00:43:14 2008 +0200 linuxinput: Include linux/input.h before using the defines from it commit 4cb2e813612be62c35a8f5df07e8959e2946f6ec Author: Ville Syrjala Date: Mon Nov 3 01:17:22 2008 +0200 cle266: Linking needs -lm commit eeea500b3c4c40c1ce595e3f0d6571c99813f0e7 Author: Ville Syrjala Date: Sat Nov 1 17:21:24 2008 +0200 linuxinput: Fix LED handling commit fe2d6e91c2a46e44e924258068e8ce205bcabcd7 Author: Ville Syrjala Date: Sat Nov 1 17:24:02 2008 +0200 linuxinput: Zero-initialize DFBInputEvents commit d3eca3b90ffa3ac992cf837cc635ab1ae3b0c610 Author: Ville Syrjala Date: Sat Nov 1 15:07:53 2008 +0200 fbdev: Nuke trailing whitespace commit 0eee9430142a1779e838de11ee2e93b411eb86a9 Author: Ville Syrjala Date: Wed Oct 22 01:01:07 2008 +0300 fbdev: Fix pan & zoom functionality commit ddbc444d72fc0922dceb2fd7171ddb069a1e084c Author: Ville Syrjala Date: Wed Oct 22 00:53:24 2008 +0300 fbdev: Cleanups for the panning code commit de4fdae183c82a14ec6192092264c720a783ebdc Author: Niels Roest Date: Fri Oct 24 11:21:17 2008 +0200 [modules] fix for static linking (module unload not available then) commit 0909a9c56dee2b7858fad63c5c1798c0d5e6a7af Author: Niels Roest Date: Wed Oct 22 16:03:30 2008 +0200 [modules] add option to specify module dir. You have to specify the base-dir, so the dir that contains the drivers/systems/wm directories commit a5a8704084baa4aa9c406537c17c30b643016aad Author: Ville Syrjala Date: Wed Oct 22 00:19:41 2008 +0300 directfbrc.5: Document triple and windows desktop-buffer-mode options. commit 210ad1f558e54a2c2f6ce8ba32bbba6c4b50b944 Author: Ville Syrjala Date: Wed Oct 22 00:19:11 2008 +0300 dfbdump: Deal with CSALF_ONEFORALL commit 2ddbebbafbd116ea15fc823dfb09a89313d08e58 Author: Ville Syrjala Date: Wed Oct 22 00:09:11 2008 +0300 v4l: Clean up the oddball coding style in the v4l2 code. commit 3a1301fc22011598717c7fa64cd003444556746a Author: Niels Roest Date: Mon Dec 22 17:00:32 2008 +0100 [v4l] Fix for Fix v4l2 build. Different lock interface on 1.2.x commit 0d168b477b16a5fe4fb65345c0429bc46d528e12 Author: Ville Syrjala Date: Tue Oct 21 01:13:03 2008 +0300 v4l: Fix v4l2 build. Untested. commit 76c033296b448c8a301283e6862e0257f6be521a Author: Ville Syrjala Date: Tue Oct 21 16:30:51 2008 +0300 matrox: Wrong chroma plane offset was being used with deinterlace blits. commit 41f386002f144621e7e4f0439dd37ad485f77953 Author: Ville Syrjala Date: Tue Oct 21 04:43:21 2008 +0300 inputdrivers: Fix possible array overruns commit 8eb8638ccab163335b3e9101543d3087a657fd10 Author: Ville Syrjala Date: Tue Oct 21 04:38:25 2008 +0300 linuxinput: Use proper sizes for the bitmaps. commit a1586efc8065d0ff1f6bcd16e0398f02e5842009 Author: Ville Syrjala Date: Tue Oct 21 04:35:53 2008 +0300 linuxinput: Count KEY_M commit b2f531062fdaa9f0cd17e6a84d97b1947e00301f Author: Ville Syrjala Date: Tue Oct 21 04:13:37 2008 +0300 dynapro: Fix warning dynapro.c:124: warning: control reaches end of non-void function commit 8384feb98c739a821a65e114d8a63eb445f71b7f Author: Ville Syrjala Date: Tue Oct 21 04:13:05 2008 +0300 omap: Fix warning omap.c:63: warning: no return statement in function returning non-void commit fd91812d436c012ab6ddfe5490b4164f9a6c527f Author: Ville Syrjala Date: Tue Oct 21 04:09:39 2008 +0300 Function prototype cleanups. commit bc622699d5c6acfa04c6b9432a341ed0b96a32a3 Author: Ville Syrjala Date: Tue Oct 21 02:19:28 2008 +0300 Constness cleanups. commit 8714695873ba9d1e75535e94d953db399e940d73 Author: Ville Syrjala Date: Tue Oct 21 01:51:54 2008 +0300 Fix build with LDFLAGS="-Wl,-no-undefined". commit 98eadd775c6695a7b7548cb840fc7ca22f209379 Author: Ville Syrjala Date: Tue Oct 21 01:36:38 2008 +0300 Fix build when srcdir != builddir. commit 78c31fb39eef064ecb347fe0a37d2bb384b929d4 Author: Ville Syrjala Date: Tue Oct 21 01:18:27 2008 +0300 configure: Use -Wno-inline with -fno-inline. commit 9eed680c14a67c2dd14ca764c1c67d2fb397ae72 Author: Niels Roest Date: Tue Oct 21 15:08:52 2008 +0200 [sh772x] allow revisions of sh7722 and sh7723 to be detected commit 04c4b27b9e7bb1ff8fe50a7810709f28e13894a2 Author: Denis Oliver Kropp Date: Sat Oct 18 07:49:40 2008 +0200 [input] In init_devices() use direct_list_foreach_safe() instead of direct_list_foreach(). commit 4492035a8584d24b76211ceddd7b2be832105584 Author: Denis Oliver Kropp Date: Sat Oct 18 07:48:21 2008 +0200 [input] Use direct_modules_unregister() in destructor of input driver modules. commit 91a7270565522d5d3e0ca5927142914fcd014333 Author: Denis Oliver Kropp Date: Sat Oct 18 07:47:25 2008 +0200 [direct] Added direct_modules_unregister()...... commit 9354a6a31e58ebf47cd2cf5c9bca63bae67f50e7 Merge: c2142cd... 54260df... Author: Niels Roest Date: Mon Dec 22 13:54:12 2008 +0100 Merge branch 'release_1_2_x' of git+ssh://git.directfb.org/git/directfb/core/DirectFB into release_1_2_x commit c2142cd444bf3498e32aeb38c315238479e9f712 Author: Niels Roest Date: Wed Oct 15 15:47:18 2008 +0200 [sh7722] jpegtool.c - fix commit a3a39892faa973ad8112852fc15a2a513ab3abfe Author: Niels Roest Date: Tue Oct 14 19:33:28 2008 +0200 [fbdev] use directfbrc for initial screen size, if specified. suggestion and patch by Stefan Lucke. commit 48cf83c76f6227e2c10058e04875139d23830e1e Author: Niels Roest Date: Tue Oct 14 18:44:43 2008 +0200 [sh772x] JPEG writeback improvements - correct handling of colour of NV12 and NV16 input in line mode - recorrect not-scaled NV12 and NV16 input (jpeg_writing = 2) - handle odd input sizes - handle error condition, on tmp-storage request failure, properly commit 8b9c5b68d4858d517c3a0968d8958084d0c0f79a Author: Niels Roest Date: Fri Oct 10 21:14:51 2008 +0200 [sh772x] jpeg intermediate buffer creation commit 54260df6f07bffda4c3aaefe1a03a7ee0b53bdde Author: Denis Oliver Kropp Date: Tue Dec 16 07:53:08 2008 +0100 [v4l] Fixed warning (unused variables). commit dc2df128290fcd7d7c7d44730093e4be003981d2 Author: Denis Oliver Kropp Date: Tue Dec 16 07:52:10 2008 +0100 [conf] Fixed warning (unused variable). commit 4d2ddca43d3649a54e9ad122c7caba28285282fc Author: Niels Roest Date: Fri Dec 12 11:36:47 2008 +0100 [surface] follow policy changes.. fix forgot DLBM_FRONTONLY handling. commit 022d58d2a75b847c9d9a8adccbf6453d37939da9 Author: Niels Roest Date: Fri Dec 12 10:28:09 2008 +0100 [surface] follow policy changes commit 80b51ce682a5bd022565c14b4b68bea72f93bbd8 Author: Niels Roest Date: Thu Nov 27 16:40:48 2008 +0100 [conf] read /proc/self/cmdline if DirectFBInit() does not receive argv/argc. commit 12c0ad1f79029d2f5398cae16f9daacf4dde1a27 Author: Niels Roest Date: Thu Nov 27 11:49:55 2008 +0100 [devmem] fix the displayed-by-dfbdump buffer size for certain formats. The internal size was not broken. commit 6c192ad078f4a76edd2e0fc7b5b843d5fe7fc558 Merge: 7c1e1ab... 4bce451... Author: Niels Roest Date: Wed Nov 26 19:20:40 2008 +0100 Merge branch 'release_1_2_x' of git+ssh://git.directfb.org/git/directfb/core/DirectFB into origin/release_1_2_x commit 7c1e1ab700369cf04c45f1d7977aabaeddde3767 Author: Niels Roest Date: Wed Nov 26 19:15:22 2008 +0100 [palette] when setting a YUV Palette alpha is not discarded anymore. commit 4b4dcb26ae6608b2f85002dc051cb1166a908804 Author: Niels Roest Date: Wed Nov 26 19:12:05 2008 +0100 [v4l] make v4l code build. Not tested. commit 4bce45129a06dc980372b3b570ca5a07e04dafd8 Author: Denis Oliver Kropp Date: Sat Oct 18 03:34:23 2008 +0200 [fusion] Don't return calls with zero serial, avoiding overhead when kernel calls or FCEF_ONEWAY is used. commit 6a5202be8b4333592ad737d326e297a87873a740 Author: Niels Roest Date: Tue Nov 11 19:33:15 2008 +0100 [fusion] skirmish wait argument not taken as msec but usec commit c6cf3ea724ef21a70bb3b9c0dde02164e5d662a7 Author: Niels Roest Date: Tue Nov 11 19:33:15 2008 +0100 [fusion] skirmish wait argument not taken as msec but usec commit f87a074dd2bfc6f6488d40dee8c0031a1b619e42 Author: Niels Roest Date: Thu Oct 9 18:44:15 2008 +0200 [SH772X] adjust makefiles to rename commit c7ce78b604790f9a2adbb84f0a744c5a5fc3fbb1 Author: Niels Roest Date: Thu Oct 9 18:42:23 2008 +0200 [SH772X] rename driver commit 73b4b7118800c93accc9ce22fa0beddff991f54c Author: Niels Roest Date: Thu Oct 9 14:48:00 2008 +0200 [sh772x] added display power on, + other stuff: - include display power-on in sh772x kernel module so we don't need the fb driver from the kernel, current implementation limited to sh7723. - limit pitch alignment to 16 bytes, more currently not needed - extend JPEG encode with tmpphys; will be used to store intermediate between BEU and JPU, to prevent 16-line-chunk-scaling issues. commit 52062fe35034a55942b456b76d1408edf46724c7 Author: Niels Roest Date: Wed Oct 8 15:04:09 2008 +0200 [v4l] conform v4l to new surface core architecture commit 41f1c7e6a0d3a6649bb8a7fbc748fdf053875c92 Author: Niels Roest Date: Wed Oct 8 12:03:42 2008 +0200 [v4l] v4l sources were not part of distro. fixed. commit ba76f989f04fbb29def690514ddd42892efc2da8 Author: Denis Oliver Kropp Date: Thu Oct 2 04:00:19 2008 +0200 [omap] Added omapfb.h to SOURCES. commit f3d97293a42b948f09b8066a0bc3b0f6336403de Author: Denis Oliver Kropp Date: Wed Oct 1 00:43:55 2008 +0200 [default font] Support premultiplied font formats. commit db2fb26752a8381c01acada1202daea175d6be23 Author: Denis Oliver Kropp Date: Mon Sep 29 16:37:58 2008 +0200 [sh7722] Fixed wrong number of arguments in JPEG test program. commit 42e03021991904dffe186b930903d74d2619be4c Author: Denis Oliver Kropp Date: Mon Sep 29 11:58:46 2008 +0200 Updated for 1.2.6. commit 728bb7dc160c4ee27c6d425abff062b81d281977 Author: Denis Oliver Kropp Date: Mon Sep 29 11:58:13 2008 +0200 [NEWS] Updated for 1.2.6. commit e9c7abb2684241fb5366053423e7b42f47cbb3f6 Author: Denis Oliver Kropp Date: Mon Sep 29 11:57:59 2008 +0200 [version] 1.2.6 commit a81749f9407670ea5822cecdc9f05a072711d4ca Author: Denis Oliver Kropp Date: Sun Sep 28 23:54:05 2008 +0200 [dispatcher] Use direct_thread_lock()/unlock() in dispatcher and stopping function to fix remaining issues. commit ff34733b1f91d1bbd94c85b53c63cbe05117e95e Author: Denis Oliver Kropp Date: Sun Sep 28 23:33:19 2008 +0200 [x11] Evil error handling... commit 0b946cf40a7cd115eb41b1f079c8e22b4e1f55ee Author: Denis Oliver Kropp Date: Sun Sep 28 23:32:22 2008 +0200 [x11] Fixed remaining crash with expose events that ran into a NULL window. commit c63edd253187aedefc6c78f1f1b12510376f427e Author: Denis Oliver Kropp Date: Sun Sep 28 23:31:25 2008 +0200 [wm] Lots of useful debug messages. [merged from master] commit 401f6b64cd9a2f9f162f21c0622f033eb60e40a9 Author: Denis Oliver Kropp Date: Sun Sep 28 23:30:39 2008 +0200 [core] Call fusion_stop_dispatcher() before destroying pools to fix lots of shutdown issues. commit 76851f05484a25a138a0eb8e5d9a83668fce2f75 Author: Denis Oliver Kropp Date: Sun Sep 28 23:29:45 2008 +0200 [fusion] Added fusion_stop_dispatcher() to be called before destroying pools etc... fixing lots of shutdown issues! commit 627ea99c088a75f74e2439491e4b7991ddbdefdf Author: Denis Oliver Kropp Date: Sun Sep 28 21:25:38 2008 +0200 [interfaces] Added some debug messages to DirectInterface code. commit a6bfcfb32615221435c329c2678d74de9fc2f2bc Author: Denis Oliver Kropp Date: Sun Sep 28 21:24:47 2008 +0200 [util] Added dfb_updates_get_rectangles() for convenience, doing bounding box trade off etc... commit 6043ec23987e980285ab62cce6ad9e03ad73a4fb Author: Denis Oliver Kropp Date: Sun Sep 28 14:04:20 2008 +0200 [thread] Added direct_thread_wait() / _notify(), _lock(), _unlock() and _terminate(). commit ed0faa8c4263da0024808bc7eac461bf54d8eb1f Author: Denis Oliver Kropp Date: Fri Sep 26 21:39:40 2008 +0200 ignore commit 5c0e84d48f67ddb3ab2c5862e6f99281fdc68ea0 Author: Denis Oliver Kropp Date: Thu Sep 25 19:42:16 2008 +0200 Updated for 1.2.5. commit 300486b5d2c50e9ddd55ad67322d85eddd1387e0 Author: Nikita Egorov Date: Thu Sep 25 13:52:52 2008 +0400 Set glyph alignment of 8 bytes for all font formats commit 530cd73caaf5370aef526559de5cea5e815054ae Merge: dbbdfef... afdfe4f... Author: Niels Roest Date: Thu Sep 25 19:35:04 2008 +0200 Merge branch 'release_1_2_x' of git+ssh://git.directfb.org/git/directfb/core/DirectFB into release_1_2_x commit dbbdfef062e86b47fa50013424665f9ac0ba962f Author: Niels Roest Date: Thu Sep 25 19:34:40 2008 +0200 [sh772x] for JPEG encoding: horz/vert up/downscaling + offset scaling is without n-line mode, so there are artefacts visible vertically (since there operation is handled in 16-pixel steps) todo: if enough memory is available, perform full-picture malloc and scale in 1 step commit afdfe4f8af5056e62dfb4018b1ff6541874606df Author: Denis Oliver Kropp Date: Thu Sep 25 01:19:18 2008 +0200 [version] 1.2.5 commit df44a12abc0faa117e85815b09fb3553a3897996 Author: Denis Oliver Kropp Date: Thu Sep 25 01:10:20 2008 +0200 [fonts] Fixed alignment on eight byte boundary, thanks to Nikita Egorov for spotting! commit 0eff2e254ec75d3a9cb86c58cd6e67e74853605b Author: Nikita Egorov Date: Mon Sep 22 15:41:00 2008 +0400 Don't switch to fill rectangle in DrawLine() if matrix is used. commit fb5c29272ccfa704658f1ff4209a4abb830623aa Merge: 64492c3... 1fe9b65... Author: Niels Roest Date: Mon Sep 22 20:08:54 2008 +0200 Merge branch 'release_1_2_x' of git+ssh://git.directfb.org/git/directfb/core/DirectFB into release_1_2_x commit 64492c38e44dd1f32de90bd6679298b9b039943f Author: Niels Roest Date: Mon Sep 22 20:06:12 2008 +0200 [sh772x] fix JPEG encoding. n-line mode impossible because destination addresses of VEU cannot be updated intermediately. current implementation generates ints every 16 lines to reprogram VEU. Disadvantage: phase is lost when scaling. (scaling not tested yet) commit 1fe9b65237a8240cbcaab6346caa88e5dcb7fd6a Author: Denis Oliver Kropp Date: Fri Sep 19 04:06:55 2008 +0200 Updated ChangeLog for 1.2.4 release. commit 71eb77b278f81dd9258f268506408acd89dc039c Author: Denis Oliver Kropp Date: Fri Sep 19 04:04:48 2008 +0200 [x11] Fixed missing x11types.h in SOURCES definition. commit 2e93ab1d81788e74c830eeae17a8af61de171f68 Author: Denis Oliver Kropp Date: Fri Sep 19 04:03:06 2008 +0200 [sh7722] Fixed EXTRA_DIST. commit 0d0e1a36732372c5e7dbed7b7da56198925baebf Author: Denis Oliver Kropp Date: Thu Sep 18 22:49:56 2008 +0200 Updated NEWS for 1.2.4... commit 1e46e17d9a68d0b22281683517a2f5e9251121f8 Author: Denis Oliver Kropp Date: Thu Sep 18 21:27:18 2008 +0200 [x11] When update goes directly from XShmImage without copy/convert (single buffer layer), do an XSync()! commit ffebbdb24e53239d47e2b07ebca004dc7139b5f7 Author: Denis Oliver Kropp Date: Thu Sep 18 21:26:50 2008 +0200 [x11] Hotfix missing update queue... commit 6c62c11070ce58b54df511034bb57301a974c5db Author: Denis Oliver Kropp Date: Thu Sep 18 21:01:02 2008 +0200 [x11] Lookup visual in master where XShmCreateImage is actually called. commit 80101b8b840e37de646b6b563797a776c41b2ad0 Author: Denis Oliver Kropp Date: Thu Sep 18 19:43:30 2008 +0200 [windowstack] Set background mode of new contexts to DLBM_DONTCARE. commit 18bb4352ddf8a066aaf30c5ef778ee51fef2b1f7 Author: Denis Oliver Kropp Date: Thu Sep 18 19:11:46 2008 +0200 [x11] Added missing header file from update with cleaned up code from 1.3.x. commit 0db513fa12a4b1da7c36ce1a6d74fbed7abcd6e6 Author: Denis Oliver Kropp Date: Thu Sep 18 19:10:57 2008 +0200 [thread] Fixed missing magic value in thread structure created for non-direct threads. commit 7918e5933899e4a8029f709eaddb8a92ac9d0ef6 Author: Denis Oliver Kropp Date: Thu Sep 18 19:08:51 2008 +0200 [x11] Update X11 system module with cleaned up code from 1.3.x. commit 0d760d1a2d9f3e97271b97c659a653f3df73c946 Author: Denis Oliver Kropp Date: Thu Sep 18 19:02:27 2008 +0200 [layers] Fixed unlocking of destroyed skirmish in context destructor. commit 7cc2c9e3de81867745988498e690f2525ffcbf21 Author: Denis Oliver Kropp Date: Wed Sep 17 23:55:27 2008 +0200 [dfbtest_blit] Added option "-R" to rerender image to surface before every blit (benchmark). commit 60a5e3a35385fa581a018b2fc29a726922f1c263 Author: Niels Roest Date: Wed Sep 17 19:08:48 2008 +0200 [core] check and handle return value of get_layer_dimension(). Can go wrong with davinci driver without GET_TIMING patches. commit 4e655537005796e9ce7c87e4c6c10f83671508cb Author: Niels Roest Date: Wed Sep 17 19:06:07 2008 +0200 [davinci] param missing in debug print commit eb3fabc1e786dced2ae59e708a02c1e7fccc76b9 Author: Niels Roest Date: Wed Sep 17 19:05:19 2008 +0200 [x11 input] possible lock at shutdown due to thread trying to kill itself commit d7556f90afc92aa4bfd1a61f8aec72ba782296e2 Author: Denis Oliver Kropp Date: Wed Sep 17 18:25:06 2008 +0200 [surfaces] Assert that pitch is != 0 only if virtual or physical address is present. commit 1752d74e0ad393466b9a3b9fd72a95c499c68565 Author: Denis Oliver Kropp Date: Wed Sep 17 16:11:12 2008 +0200 [davinci] Workaround broken DSP cache invalidation function. commit c29121ed626a7bc71e33b0e10c046970d105ba1d Merge: 1a0f8c1... cf66dfc... Author: Denis Oliver Kropp Date: Wed Sep 17 12:19:48 2008 +0200 Merge branch 'release_1_2_x' of git+ssh://git.directfb.org/git/directfb/core/DirectFB into release_1_2_x commit 1a0f8c16daa141fd9b9062b8985de60ff1df3c1f Author: Denis Oliver Kropp Date: Wed Sep 17 12:16:49 2008 +0200 [davinci] Raise OSD surface pool priority to allocate in frame buffer rather than /dev/mem. commit cf66dfc43b3af72882eabf178e1cc97d2760edfb Author: Denis Oliver Kropp Date: Sun Sep 14 05:35:40 2008 +0200 [call] Added debug messages. commit 214f020f8c0bc04b5426aeb18830f2af331141e8 Author: Denis Oliver Kropp Date: Wed Sep 17 12:05:43 2008 +0200 [trace] Fixed static build. commit fea3ed60216fc9a0034ddde759e4a156cba6d3c6 Author: Denis Oliver Kropp Date: Sat Sep 13 20:53:37 2008 +0200 [options] Fixed pixel format parsing code, first check for exact, then for partial matches. commit 21e735d129d56967f4743f35276f3fcaf37966a5 Author: Denis Oliver Kropp Date: Sat Sep 13 20:49:22 2008 +0200 [graphics] Only have DSRO_MATRIX be mandatory for now. Other flags no longer prohibit acceleration. Worst case was when DSRO_SMOOTH_UP/DOWNSCALE was turned on globally via "smooth-upscale" or "smooth-downscale" runtime option which caused all operations to use software fallbacks, not only StretchBlit()! commit 8800da81aff0cdbdbd5e0a3510d0136d325c8175 Author: Denis Oliver Kropp Date: Thu Sep 11 02:41:22 2008 +0200 [generic] Added optimized Bop_argb_blend_alphachannel_one_invsrc_Aop_argb() -> 6x speed commit bda8c8e278268d9f82d6b60ad4fca77a1ded0d16 Author: Denis Oliver Kropp Date: Wed Sep 10 22:11:03 2008 +0200 [SH7722] Follow device name change in JPEG code, too. commit 4866c2a67484516b5ea0dfbe6974d548cfea203e Author: Denis Oliver Kropp Date: Wed Sep 10 21:38:14 2008 +0200 ignore commit c5325bd61b698d99d25a97d3248b27afc93b09a0 Author: Denis Oliver Kropp Date: Wed Sep 10 21:33:30 2008 +0200 [SH7723] Added support for SH7723 to SH7722 driver and kernel module. (*) DirectFB/Graphics: Renesas SH7723 0.9 (Denis & Janine Kropp) (*) DirectFB/Core/WM: SaWMan 0.2 (directfb.org) (*) SaWMan/Config: Parsing config file '/etc/sawmanrc'. (*) SaWMan: Initializing stack 0x432078 for tier 0x431a48, 0x0, layer 0, context 0x431e78 [1]... (*) SaWMan/Init: Layer 0: 800x480, RGB16, options: 1 (*) SaWMan/Init: Border 0: 800x480, RGB16, options: 8 (*) Direct/Interface: Using 'PNG' implementation of 'IDirectFBImageProvider'. (*) Direct/Interface: Using 'FT2' implementation of 'IDirectFBFont'. (*) Direct/Interface: Using 'GIF' implementation of 'IDirectFBImageProvider'. Benchmarking 256x256 on 800x464 RGB16 (16bit)... Fill Rectangle 5.350 secs (* 200.895 MPixel/sec) [ 3.9%] Fill Rectangle (blend) 8.590 secs (* 78.582 MPixel/sec) [ 1.7%] Fill Rectangles [10] 5.226 secs (* 200.646 MPixel/sec) [ 1.1%] Fill Rectangles [10] (blend) 11.699 secs (* 78.425 MPixel/sec) [ 0.3%] Fill Triangles 14.254 secs (* 26.436 MPixel/sec) [ 1.1%] Fill Triangles (blend) 26.657 secs (* 8.727 MPixel/sec) [ 0.4%] Draw Rectangle 3.127 secs (* 30.444 KRects/sec) [ 44.8%] Draw Lines [10] 3.062 secs (* 122.468 KLines/sec) [ 35.9%] Fill Spans 3.013 secs (* 147.907 MPixel/sec) [ 73.4%] Fill Spans (blend) 3.037 secs (* 73.369 MPixel/sec) [ 27.0%] Blit 11.698 secs (* 56.023 MPixel/sec) [ 1.4%] Blit colorkeyed 8.376 secs (* 59.464 MPixel/sec) [ 1.6%] TODO: more acceleration work... commit f9de3db7281a978e309a91693044f6dce180e9e4 Author: Denis Oliver Kropp Date: Wed Sep 10 13:39:32 2008 +0200 [SH7722] Fixed missing update of rendering destination buffer. commit d8a068a04b832f9415eb9c2c9fa28e68a2db3362 Author: Denis Oliver Kropp Date: Wed Sep 10 11:07:57 2008 +0200 [SH7722] Fixed software fallback for JPEG decoding to unsupported formats. commit 2b0062bbf0c29b33969891a09f2cdcffcff121bd Author: Denis Oliver Kropp Date: Wed Sep 10 10:38:48 2008 +0200 [trace] Added missing dummies of new lookup functions for non-trace builds. commit 7968dcbf2767a8a6c13479e501a689b288e6a1e0 Author: Denis Oliver Kropp Date: Wed Sep 10 10:24:22 2008 +0200 [util] Added exported dfb_pixelformat_names[] and replaced relevant code. commit 56df57f902260a60f11ca2a241973780201e4cd2 Author: Denis Oliver Kropp Date: Wed Sep 10 10:22:42 2008 +0200 [mknames] Generate separate declaration of value/name pair structures. commit ac68c2c4cf2c53b5f8544478780c3cb1774aad1e Author: Denis Oliver Kropp Date: Wed Sep 10 09:30:32 2008 +0200 [generic] Get rid of YUV tables saving 5k binary size! commit 9e87cc1be7b6f12234bce4c9434991199483a631 Author: Denis Oliver Kropp Date: Wed Sep 10 09:05:37 2008 +0200 [header] tab->space commit 5e6b93f695c96c684c268cac9b7898ffb1f672f8 Author: Denis Oliver Kropp Date: Wed Sep 10 09:04:21 2008 +0200 [SDL] Replaced code in commented section by using dfb_convert_to_rgb16(). commit e998566fbcb7b69428f6f9035990f1adb4c5b374 Author: Denis Oliver Kropp Date: Wed Sep 10 09:03:07 2008 +0200 [formats] Fixed many NV12, NV16 and NV21 code areas, mostly for big endian. commit 408b396f31fd5caf5e6ca53824badbdaa7539d9e Author: Denis Oliver Kropp Date: Wed Sep 10 08:59:59 2008 +0200 [JPEG] Fix direct decoding to NV16 (no to+from RGB) for little endian. commit c8135a6b38b179ee6dbec9424fbe09c0361df214 Author: Denis Oliver Kropp Date: Wed Sep 10 08:59:18 2008 +0200 [formats] Clarify definition of NV12, NV16 and NV21. commit 98595b27c770f7e46651c5312235ba92e821b372 Author: Denis Oliver Kropp Date: Wed Sep 10 06:46:45 2008 +0200 [dfbtest_blit] Added test program for (Stretch)Blit with an image from file. Options: -h, --help Show this help message -v, --version Print version information -s, --source Source pixel format -d, --dest Destination pixel format -r, --resize Set destination from source size -b, --benchmark Enable benchmarking mode commit 1c4ea214f8f6fe9e634277b933a25e5a5b817fca Author: Denis Oliver Kropp Date: Wed Sep 10 06:45:03 2008 +0200 [generic] Rewrote Dacc_RGB_to_YCbCr_C and Dacc_YCbCr_to_RGB_C using Duff's device with macros. Conversion also supports 4:4:4 by this change, not optimizing for 4:2:x cases. commit a735f98d97d17dc060c1a3bb5c24e5cc068ce7f2 Author: Denis Oliver Kropp Date: Wed Sep 10 06:42:51 2008 +0200 [convert] Fix missing parentheses around macro parameters in YCBCR_TO_RGB(). commit ad97e6f5e9ad560b7ed7702234d73f9516d8b6e5 Author: Denis Oliver Kropp Date: Wed Sep 10 06:35:15 2008 +0200 [convert] Rewrote YCbCr<->RGB conversion routines without lookups which are much more expensive on embedded devices. commit dd24e44f7f83c5fa166c260f7ef5e2877ba6c73d Author: Denis Oliver Kropp Date: Wed Sep 10 03:26:18 2008 +0200 [options] New option "[no-]software-trace" to show every stage of the software rendering pipeline. commit 1ab3633fba1a8693f31f5d2f8fee052a603d68d8 Author: Denis Oliver Kropp Date: Wed Sep 10 03:24:30 2008 +0200 [direct] Added file and symbol lookup functions to trace code for external usage. New functions are direct_trace_lookup_file(), direct_trace_lookup_symbol() and a convenience function combining the above called direct_trace_lookup_symbol_at(). commit fe36a5d4b37de3eedc406daa7421405a7f74cb58 Author: Denis Oliver Kropp Date: Thu Sep 4 01:02:36 2008 +0900 [README] Added some packages for autofoo... commit 97ac5ea290a6bb882c57aa8cbf550a1bf53432ff Author: Denis Oliver Kropp Date: Sun Aug 24 21:24:06 2008 +0200 [default wm] Fixed crash with DWCAPS_NOFOCUS implementation. commit a007cc5d5b39f9c44c26f15a28125a12d80f4bf6 Author: Denis Oliver Kropp Date: Sun Aug 24 17:10:45 2008 +0200 [default wm] Implemented DWCAPS_NOFOCUS. commit 394071df1cca0f86d63e4f49c0a09de451899ef2 Author: Denis Oliver Kropp Date: Sun Aug 24 17:10:19 2008 +0200 [IDirectFBWindow] Added DWCAPS_NOFOCUS: window will never get focus or receive key events, unless it grabs them. [merged from master] commit 2aa0a12cc2b8a2439e818571123b55b38ddaabfc Author: Denis Oliver Kropp Date: Sat Aug 23 13:58:10 2008 +0200 [configure] Switch to pkg-config for SDL and FreeType2, thanks to Keith Mok! commit e24833a86b8fcb590876cc038561369b6c232bb7 Author: Denis Oliver Kropp Date: Fri Aug 22 20:32:30 2008 +0200 [input] Fixed boundary check for axis info array access. commit 4f66438dae66beddea99889a0b2dfc9e7cacdb74 Author: Denis Oliver Kropp Date: Fri Aug 22 20:01:45 2008 +0200 [sh7722] Build only for SH4. commit 45c1c3a317f7771e068902e0d5d0c057e1d9eca3 Author: Denis Oliver Kropp Date: Fri Aug 22 19:46:45 2008 +0200 [default wm] Use min/max values from absolute axis motion events if present. commit a9e61781cb742409a696f944282d6968498a19bc Author: Denis Oliver Kropp Date: Fri Aug 22 19:46:05 2008 +0200 [input] Query axis information from driver and put it into events. commit 1307a3c5dea711cb67be9c9b2df45018f8f1a9a7 Author: Denis Oliver Kropp Date: Fri Aug 22 19:41:40 2008 +0200 [IDirectFBInputDevice] Added DIEF_MIN/MAX and min/max to DFBInputEvent, e.g. for axis boundaries. commit 40a992360f4a19da7d3d459d6dc2e75e43f75aeb Author: Denis Oliver Kropp Date: Fri Aug 22 16:44:26 2008 +0200 [input] Added GetAxisInfo() to InputDriverFuncs to query information about one axis. Make use of it in input_driver.h only if driver has defined DFB_INPUTDRIVER_HAS_AXIS_INFO to avoid having to change all input drivers. commit 706b177ae3eda101955e5e0d60e9dbb6fb6552e9 Author: Denis Oliver Kropp Date: Fri Aug 22 16:44:10 2008 +0200 [IDirectFBInputDevice] Added DFBInputDeviceAxisInfo(Flags) with DIAIF_ABS_MIN/MAX flags and abs_min/max fields. commit 36ab1898b94ae0be0066d788fb98cf92dce9539b Author: Niels Roest Date: Thu Aug 21 17:27:34 2008 +0200 [davinci] In ARGB OSD dithering use task buffer and add missing locks. commit 3d8c2e03525c1791f8a2cb9291ae57353acd3f61 Author: Denis Oliver Kropp Date: Thu Aug 21 11:36:59 2008 +0200 1.2.4 at the door commit 1344ce16b033146da1cb17fac6cddcc53b9b9a41 Author: Denis Oliver Kropp Date: Thu Aug 21 11:34:08 2008 +0200 [sh7722] Fixes for JPEG encoding with conversion, cleanups... commit 9eba069a68ef1afe00da08a5d5a4be5cfb15654c Author: Denis Oliver Kropp Date: Thu Aug 21 08:21:34 2008 +0200 [interfaces] Important fix for having multiple interface implementations in one module. commit 9dd40feabec9ad2cb58f014378c31ec2185c7863 Author: Denis Oliver Kropp Date: Tue Aug 19 11:27:39 2008 +0200 Updated NEWS and ChangeLog for 1.2.3 commit eb1abad3968236ddfdd8714bb1615dc1b2983bd0 Author: Denis Oliver Kropp Date: Tue Aug 19 11:26:10 2008 +0200 [version] 1.2.3 commit b811f2bdc95894562646043afe9c6819acdf0fad Author: Denis Oliver Kropp Date: Sat Aug 16 01:57:03 2008 +0200 [x11] Fixed new bug with reopening X11 window when layer resizes. commit 8566b955d91b3d84d591a6087a31aa5222e6face Author: Denis Oliver Kropp Date: Fri Aug 15 21:23:04 2008 +0200 [version] Forgot to increase binary age... commit 2e138f31fe4858509f051d7f1f689d6541c3412b Author: Denis Oliver Kropp Date: Fri Aug 15 21:11:59 2008 +0200 [NEWS] minor adjustments commit 47b959fba1ba8acd689c8a5fe4a207e3b83007c1 Author: Denis Oliver Kropp Date: Fri Aug 15 21:02:26 2008 +0200 Updated for 1.2.2 release :) commit 0172f9a200f1002a44d763d4e5a3c7d9f4e5243f Author: Denis Oliver Kropp Date: Fri Aug 15 21:00:04 2008 +0200 [strings] Generate name/value pairs for DFBWindowOptions. commit 373df01467c8da421967ed5bba5ff6c999701da5 Author: Denis Oliver Kropp Date: Fri Aug 15 21:01:13 2008 +0200 [version] Bump to 1.2.2. commit 30e8e357f2db8e60d2664ef35675eaf223461f5e Author: Niels Roest Date: Fri Aug 15 20:09:50 2008 +0200 [x11] improve shutdown behaviour of X11 module. Certain race conditions at shutdown prevented, leading to lock or crash. x11input and x11 modules combined into 1. commit 9254527c0c98bcee0f9bb7358627c68bf9b1fd5e Author: Denis Oliver Kropp Date: Fri Aug 15 18:54:59 2008 +0200 [interfaces] Fix previous commit for unregistering interfaces, removing the proto type which had the old name. commit 7daac4ab3dc87c405c1f999480f7a88556eeb245 Author: Denis Oliver Kropp Date: Fri Aug 15 18:31:34 2008 +0200 [interfaces] Added DirectUnregisterInterface() and destructor to call it. Added magic value to interface implementation structure and use D_CALLOC/D_FREE. commit b3802912fe9f47e262f62e51de388692a968def2 Author: Denis Oliver Kropp Date: Wed Aug 13 19:08:55 2008 +0200 [dfbmaster] Added very simple dedicated master for safety, stability or enhanced testing pleasure. commit f9b65693d2872b5c0c2c3384044d3847612664e7 Author: Denis Oliver Kropp Date: Wed Aug 13 06:14:49 2008 +0200 [default wm] Build fix for previous commit that reduces recursion. commit bf266ffd6ff5f18bfbf14079a482323561905ab1 Author: Denis Oliver Kropp Date: Wed Aug 13 06:05:55 2008 +0200 [default wm] Make sure window has a surface before restoring its size when disabling scaling. commit 7c4bcf746f59b6e5d28bafbae0a31d87d56a0e99 Author: Denis Oliver Kropp Date: Wed Aug 13 06:05:02 2008 +0200 [strings] Generate name/value pairs for DFBWindowCapabilities. commit 7db90a8127fd00f07bbd9b40e2d4b816a643bde2 Author: Denis Oliver Kropp Date: Wed Aug 13 05:07:11 2008 +0200 [x11] Implemented primaryRemoveRegion() with a new call to destroy the X11 window. Also cleaned up name of window creation call (set_video_mode -> create_window). commit 5522fb50aa128f66783c9597f20e19483f461595 Author: Denis Oliver Kropp Date: Wed Aug 13 03:27:54 2008 +0200 [default wm] Avoid most of the recursive calls of wind_of_change(). commit 1a713bfc4ccfb93d3097c7c95b62740b94e115b4 Author: Denis Oliver Kropp Date: Wed Aug 13 00:55:38 2008 +0200 [x11] Fixed race condition and X error when switching resolution quickly. commit 83ee17843cc6273a8503e52022ae3586facf6de9 Author: Denis Oliver Kropp Date: Tue Aug 12 14:25:28 2008 +0200 [x11] More X locking and checks for input thread exit... still not satisfied... commit ff8bd3ef078eff538cebac111a2256168e694e5d Author: Denis Oliver Kropp Date: Tue Aug 12 14:14:46 2008 +0200 [windows] Added missing locks around direct dfb_wm_... calls... commit 378cf314eb1ad197bca969e8b813bfe1022cc844 Author: Denis Oliver Kropp Date: Fri Aug 8 16:39:50 2008 +0200 updated TODO commit b1767f930d9c4b3dcadbb722ea9dfe0aad90ada6 Author: Denis Oliver Kropp Date: Tue Aug 12 10:56:35 2008 +0200 [layers] Added debug message to print context being returned by dfb_layer_get_active_context(). commit e075ec35c293ba8487f5e6826a95f8c7cb17e694 Author: Denis Oliver Kropp Date: Tue Aug 12 10:47:03 2008 +0200 [IDirectFBSurface_Window] Added missing layer context locking around dfb_wm_get_insets() in IDirectFBSurface_Window_Construct(). commit f7dfda097e2fe02703647142dfd6b2d68eea8bb5 Author: Denis Oliver Kropp Date: Tue Aug 12 10:20:27 2008 +0200 [layers] Fixed failing context lock assertion in dfb_wm_close_stack() by locking in context destructor. commit c0823fb5bbaec92d823846c5e6abf3a6c2a8010a Author: Denis Oliver Kropp Date: Tue Aug 12 10:15:21 2008 +0200 [fusion] Fixed single app skirmish lock counting (copy'n'paste bug). commit 47511ddacdef45a1a3c7442da40ecc746a385b78 Author: Denis Oliver Kropp Date: Tue Aug 12 10:08:15 2008 +0200 [windows] In dfb_wm_close_all_stacks() lock each context and temporarily ref it for following unlock. (1.2 only) commit 8e093b63f9d297f8202b5e397a31bf8b84cc4941 Author: Denis Oliver Kropp Date: Tue Aug 12 09:46:36 2008 +0200 [windows] Fixed crash in window destructor caused by (un)locking the stack. [1.2 only] commit cad7f7f28a5aca9a045b6be6db8a8b539bf3398d Author: Denis Oliver Kropp Date: Tue Aug 12 08:27:39 2008 +0200 [windows] Avoid recursive dfb_wm_close_stack() caused by SaWMan's CloseStack() unref on the layer region. This issue happens only in single app build, where the layer region constructor gets called synchronously and destroys the window stack structure before the dfb_wm_close_stack() has finished. Fixed by calling CloseStack() at the end dfb_wm_close_stack(), moving the list removal and flag clearing before the call and freeing the stack data in dfb_windowstack_destroy() or recurring dfb_wm_init_stack(). commit 857a85bbde61157f0c9a567a868e00f6b106c87d Author: Denis Oliver Kropp Date: Fri Aug 8 16:00:31 2008 +0200 updated ChangeLog commit d9c8b82f87a171821d6e4fc3916d9ca40ffd5611 Author: Denis Oliver Kropp Date: Fri Aug 8 15:59:01 2008 +0200 Updated NEWS for 1.2.1 release commit 881103787a32c4d0bf0edf392c83966465c2573a Author: Denis Oliver Kropp Date: Fri Aug 8 15:56:00 2008 +0200 [keyboard] Only become active if FBDev or DevMem is used to avoid grabbing keyboard from X11 for example. commit 691004d1ffa274f85c0df2005033b2642ad1022c Author: Denis Oliver Kropp Date: Fri Aug 8 15:47:42 2008 +0200 [fbdev] Update surface manager code from X11 virtual physical testing pool. commit 4690e2b6fd9da362b3bb025a278c928a54099f5e Author: Denis Oliver Kropp Date: Fri Aug 8 15:47:05 2008 +0200 [devmem] Update surface manager code from X11 virtual physical testing pool. commit cf02445dc365b0296a32e477dd1c2cadd5a5781a Author: Denis Oliver Kropp Date: Fri Aug 8 14:59:18 2008 +0200 [x11] Set buffer lock offset in fallback mode to satisfy assumption in surface core. commit 414b9517a536c96cef4ecb0b8fc53035db54553a Author: Denis Oliver Kropp Date: Fri Aug 8 14:58:15 2008 +0200 [surfaces] Cleanup buffer initialization and reset with two new convenience functions. commit 491f6b541d3bf4b91296b3b4a9c4c717ac5d3229 Author: Denis Oliver Kropp Date: Fri Aug 8 11:34:04 2008 +0200 [IDirectFBSurface] Fix Lock() on layer surfaces with system memory back buffer. This reverts commit 4cc82baddbc3a9849c2ff6c4979a65bcfb6ba96b and fixes GetFramebufferOffset() properly by not adding CSAF_GPU_READ in Lock(), but checking if there's a physical address provided by the surface pool via the buffer lock in GetFramebufferOffset(). commit 48ded2684b6e272cfd1cff1b6e86bcf12bfe2982 Author: Denis Oliver Kropp Date: Fri Aug 8 11:33:36 2008 +0200 [dfblayer] Add testing Lock() with read/write, read only or write only. commit d788593157ffe1ca84643c115c2aa45655bb7fda Author: Denis Oliver Kropp Date: Tue Jul 29 05:44:41 2008 +0200 [sh7722] Build fix (link against libdirectfb for dfb_pixelformat_name). commit ec0cacfbaefa379236dbe14a872b006c16ab9514 Author: Denis Oliver Kropp Date: Tue Jul 29 05:37:54 2008 +0200 [sh7722] JPEG encoding, code moved into library, JPEG lock and buffer allocation in kernel commit 415c15207af106bd7f440694c3423d8204660422 Author: Denis Oliver Kropp Date: Tue Jul 29 04:35:01 2008 +0200 [IDirectFBImageProvider] Added simple WriteBack() method for encoding surface data. commit ffdb559985deab2588c6e02a94f539f573a47454 Author: Denis Oliver Kropp Date: Tue Jul 29 04:34:36 2008 +0200 [options] Fixed warning. commit d9bd9e38830e1c94ab21db40928034dcad3ee3c5 Author: Denis Oliver Kropp Date: Tue Jul 29 00:26:56 2008 +0200 [x11] Return accelerator as set in config. commit 7f85e4b6062e88ee1ba028aed80ecf1a3b3a1879 Author: Denis Oliver Kropp Date: Fri Jul 25 16:56:56 2008 +0200 [config] Allocate palette on demand saving 16kB of the 60kB allocated until after DirectFBCreate(). commit bb740a7db83eb4ae52def560d8311d282dba1b45 Author: Denis Oliver Kropp Date: Fri Jul 25 16:42:12 2008 +0200 [options] Added "keep-accumulators = " to allow freeing of accumulators above the limit. Setting -1 never frees accumulators until the state is destroyed (previous behaviour). The default is 1024 which already means up to 16kB are kept! commit 0151578e0639c982c0b932b2ee3087b5de8aacf7 Author: Denis Oliver Kropp Date: Fri Jul 25 16:06:41 2008 +0200 [surface] Use fusion_ref_set_name() to show the same info as with the skirmish. TODO: Update information on both when surface is reconfigured! commit b058cdd7744df29fce86a0fa890c9d7b11401329 Author: Denis Oliver Kropp Date: Fri Jul 25 16:06:04 2008 +0200 [fusion] Added fusion_ref_set_name(), e.g. for better debug information on object references. commit 014743ed7f0ff995ec997336118dab7127ebd2f2 Author: Denis Oliver Kropp Date: Fri Jul 25 16:00:48 2008 +0200 [options] New option "warn=" to print warnings on surface/window creation or surface buffer allocations. Example: warn = allocate-buffer:300x300 Prints a warning for every surface buffer allocation made with both width and height of 300 or above. commit d4b688c1cbc031d2d47bd3631a0c5b16a2a491e6 Author: Denis Oliver Kropp Date: Wed Jul 23 15:53:22 2008 +0200 [x11] Build fix. commit 57a512da8aea5b8ba2e606b456f65f53acf21fe7 Author: Denis Oliver Kropp Date: Wed Jul 23 11:05:29 2008 +0200 [x11] Enhance surface manager to find the best matching group of allocations to muck out. This is the first time multiple smaller allocations can be mucked out for a bigger one. The code that determines these allocations is still O(1) and finds the best matching group within all possible combinations. commit 7e130c7dd72cf3f32e7f4ffacc60f1ad63be8e23 Author: Denis Oliver Kropp Date: Wed Jul 23 11:03:46 2008 +0200 [surfaces] Fixes for mucking out multiple allocations. Cleanups. commit 8217cb7e7992a9e74e7495e7dc7e2b43a4f35942 Author: Denis Oliver Kropp Date: Mon Jul 21 18:17:16 2008 +0200 [x11] Enhancements to surface manager code and fixes for old behaviour (without virtual physical surface pool). Extend dfb_surfacemanager_displace() to check policies, reimplement toleration code and take free space before and after an occupied chunk into account. Cleanup dfb_surfacemanager_allocate() to only check for free chunks. Always initialize x11(Shm)Image surface pool, regardless of virtual physical surface pool being enabled. Never fail in x11TestConfig() if virtual physical surface pool is not enabled, but use Fusion shared memory allocations as a fallback (previous behaviour). Update allocation size from chunk length which is usually bigger (at least 16 bytes of safety area). commit 6398f0d97e263d48119231e9c24f2a9f67b46ac5 Author: Denis Oliver Kropp Date: Mon Jul 21 18:07:07 2008 +0200 [surfaces] Enhanced backup strategy when mucking out allocations. First check if any of the existing allocations is up to date, otherwise try to update one of the existing allocations. Enforce same order of joining pools as of initializing them. Fixed invalid 'buffer->written' allocation pointer when using "thrifty-surface-buffers" option. Fixed wrong order of joining surface pools in slaves. Other fixes and enhanced debugging output. commit 8a746f8f30c395fc2365eff8c3aa93e810135caa Author: Denis Oliver Kropp Date: Mon Jul 21 13:35:05 2008 +0200 [x11] XShm fixes and new virtual physical surface pool for development and testing. Specifying 'video-length = ' option will create a shared memory block of that size and initialize a surface pool with a surface manager supporting the new MuckOut() call. Changed x11(Shm)Image pool to only allow allocations for supported visuals (no fallback shared memory allocations) when the new option is used. Return accelerator ID 51 for testing with the virtual acceleration (currently called vmware). Make usage of XShmQueryVersion() to check for XShm support. Other cleanups and fixes. commit b8c62eeece437f139348110eaf18f0835d2ea2cd Author: Denis Oliver Kropp Date: Mon Jul 21 13:33:24 2008 +0200 [surfaces] Implemented strategy for surface allocations when pools are out of memory. Extended dfb_surface_pools_negotiate() to return a list of capable pools order by priority including pools out of memory at the end of the list. Added MuckOut() to the surface pool API to tag all allocations for removal to free up memory for a new allocation. If not provided by the pool, a fallback implementation will do the job, but that's not implemented yet. Added dfb_surface_pool_displace() to muck out and backup allocations and do the new allocation. Moved allocate_buffer() from surface buffer to surface pool code as dfb_surface_pools_allocate() with extended negotiation using a list of possible pools and with ability to muck out allocations. Changed static update_allocation() to exported dfb_surface_allocation_update(). Added dfb_surface_trylock() for a fusion_skirmish_swoop() on the surface lock. Call dfb_surface_lock() and dfb_surface_unlock() in surface_destructor(). Moved surface core initialization before system module to have generic pools always at the same position (with the same pool IDs). Keep an ordered list of surface pool IDs based on priority. Have a pointer to a backup pool in every pool which is set to the shared memory surface pool by default. commit 5103a43e4a9477cb9b12c2adf6745d9111756b2b Author: Denis Oliver Kropp Date: Wed Jul 23 15:28:23 2008 +0200 [x11] Build fix. commit 03e85a64f9bb8746a99d574d675a10fd191d0a0a Author: Denis Oliver Kropp Date: Wed Jul 23 15:24:47 2008 +0200 [version] Also increase binary age (don't think compatibility is broken). commit a7615d722bc879382ac9370626bae95ce6f40227 Author: Denis Oliver Kropp Date: Mon Jul 21 18:00:21 2008 +0200 [misc] Bumped version to 1.2.1 and did forgotten increase of the core ABI. commit 3f8e7f07c33c843de9c514ad83e9a042ea5a6e6a Author: Denis Oliver Kropp Date: Mon Jul 21 12:57:00 2008 +0200 [surfaces] Use convenience functions where possible, e.g. dfb_surface_lock_buffer() instead of dfb_surface_get_buffer() and dfb_surface_buffer_lock() etc. commit 4cbc53a99699a0060313d9f16008dbf0fad5345c Author: Denis Oliver Kropp Date: Mon Jul 21 12:57:00 2008 +0200 [surfaces] Use convenience functions where possible, e.g. dfb_surface_lock_buffer() instead of dfb_surface_get_buffer() and dfb_surface_buffer_lock() etc. commit b2a5cc54c281de5408d0bfa589b8bc12eb0ccd8a Author: Denis Oliver Kropp Date: Mon Jul 21 12:56:08 2008 +0200 [windows] Shutdown fixes in the window management and new flags for the state of the stack. Added CoreWindowStackFlags with CWSF_INITIALIZED and CWSF_ACTIVATED to CoreWindowStack. In dfb_wm_close_all_stacks() simply call dfb_wm_close_stack() for any stack with CWSF_INITIALIZED set. The previous code did only half of it, just clearing context->stack pointer and clearing the magic value resulting in the notification handler for the background image accessing a stack structure without magic. In dfb_wm_close_stack() first deactivate the stack if CWSF_ACTIVATED is set. Safe state handling in dfb_wm_set_active(). Moved magic value set/clear from wm.c to windowstack.c where the structure is allocated and freed. Check return value of dfb_wm_init_stack(). commit bd97b7c44b998499b9d473cb39327e10b069c2f3 Author: Denis Oliver Kropp Date: Sun Jul 20 15:13:21 2008 +0200 [x11] Output ARGB when depth is 32, support AYUV input (layer format). commit 831321b34244fca072ca7744117abf41f746bd75 Author: Denis Oliver Kropp Date: Sun Jul 20 15:03:15 2008 +0200 [dfbdump] Show capacity in pool info (with "-p") and only dump shared or explicitly specified surfaces to avoid crashes. commit 2c37602197d94ede04514f0043d7120a1d5bb607 Author: Denis Oliver Kropp Date: Sun Jul 20 15:00:08 2008 +0200 [convert] Added conversion to RGB555 and from AYUV (added to all conversion functions). commit c4a1fec5bf0112531309b4d859e529eefdace210 Author: Denis Oliver Kropp Date: Sun Jul 20 14:59:26 2008 +0200 [surfaces] A bit more debug when locking buffers. commit 384f0e7b487f41fefb7a36d3cae9d9dfb4a9578f Author: Denis Oliver Kropp Date: Sun Jul 20 14:58:31 2008 +0200 [virtual2d] Fixed copy'n'paste bug in virtual driver. commit 19c0e662c27b49b9649d272c3af8e3216b492633 Author: Denis Oliver Kropp Date: Sun Jul 20 14:57:39 2008 +0200 [surfaces] Cleanup complex assertions, no CORE_SURFACE_ALLOCATION_ASSERT within CORE_SURFACE_BUFFER_LOCK_ASSERT, only D_ASSERTs. commit f3f4765fc1ca106fc7c5aee4d45ffea90205063c Author: Denis Oliver Kropp Date: Sun Jul 20 01:06:48 2008 +0200 [layers] Fix failing assertion due to recent code cleanup. commit fc9a14ecd816e9d23fb83aabaae783545c4cab3e Author: Denis Oliver Kropp Date: Sun Jul 20 01:05:28 2008 +0200 [fusion] Clear object list (pointer to NULL) after cleanup for safety. commit 192f48130cdc4e69ea91730533117e4febca9f8e Author: Denis Oliver Kropp Date: Sun Jul 20 01:02:17 2008 +0200 [fusion] Print warning for FUSION_CALL_RETURN if caller could not receive result due to a signal. commit 2d4df4cd890d2ce76499a64e25789cde56fbbf59 Author: Denis Oliver Kropp Date: Tue Nov 21 04:56:02 2028 +0100 [x11] Fixed bytes per pixel and pitch calculation for fallback XCreateImage() when no XShm is available. commit 03abd8613efc7cf8765be534a4f12c6d8a864205 Author: Denis Oliver Kropp Date: Tue Nov 21 04:55:54 2028 +0100 [x11] Take first matching visual for each format instead of last and handle RGB32 and ARGB separately (depth 24 and 32). commit d86102053be641c61929c4aef58718aaf7b6c4a6 Author: Denis Oliver Kropp Date: Tue Nov 21 04:55:37 2028 +0100 [fusion] Fixed dead lock with references in single app mode. fusion_ref_zero_lock() no longer leaves the mutex locked. Turned 'waiting' into 'locked' to keep size for binary compatibility. commit fd5cf46992572d694b8451273930d923a123db9a Author: Denis Oliver Kropp Date: Mon Jul 14 02:45:07 2008 +0200 [IDirectFBSurface] Added MakeSubSurface() to make this surface a sub surface or adjust the rectangle of this sub surface. commit 34d2f05d5a29302a614e5f054dbe85642fa12c69 Author: Denis Oliver Kropp Date: Sat Jul 19 04:52:11 2008 +0200 [devmem] Partially reverted cleanup of surface manager code. The workaround for the surface manager creation happening before graphics driver initialization with possible dfb_gfxcard_reserve_memory() calls is still required. commit dac4a5fe8c43205ca9854f48183134325e8897c8 Author: Denis Oliver Kropp Date: Sun Jul 13 16:28:43 2008 +0200 updated once more commit 7cb19857f5e3feb6d6daf43bffbc52ce28ddd2ff Author: Denis Oliver Kropp Date: Sun Jul 13 16:28:06 2008 +0200 1.2.0 commit 7bbab526840d15886dbdbe62ab8691f9b40df1e2 Author: Denis Oliver Kropp Date: Sun Jul 13 16:25:25 2008 +0200 [IDirectFB] Don't check for input device caps in CreateEventBuffer_Callback() which are checked already. This also fixes missing events from devices without caps. commit 14ddb08b822effda0884155353d30ec8f65c890d Author: Denis Oliver Kropp Date: Sun Jul 13 15:55:30 2008 +0200 [x11] Don't use XShm for offscreen surfaces, but always use Fusion SHM. Other cleanups and input thread cancellation fixes. commit bf9272493b021d4b4b4b32d81b5306e667a10e2a Author: Denis Oliver Kropp Date: Sun Jul 13 13:34:14 2008 +0200 [x11] Make visual info just debug messages, better error message on XOpenDisplay() failure. commit 02779f1f765085f6e54c517593f9fd9c5567255d Author: Denis Oliver Kropp Date: Sun Jul 13 13:33:39 2008 +0200 [core] Call dfb_wm_close_all_stacks() only if already initialized. commit 2c111d0071809171482554f412ea43bdc3ad9740 Author: Denis Oliver Kropp Date: Fri Jul 11 17:02:06 2008 +0200 [util] Optimized dfb_updates_add() incl. usage of dfb_region_region_extends() to combine adjacent regions. commit ae3258c3c457a12de52b59ed515d5513e915fb71 Author: Denis Oliver Kropp Date: Fri Jul 11 17:00:03 2008 +0200 [util] Added dfb_region_region_extends() returning true if both regions' number of pixels added equals to number of pixels of their bounding box. commit b4102221ad64904f414bc90464b02a2df6f444bf Author: Denis Oliver Kropp Date: Thu Jul 10 01:25:08 2008 +0200 [input] If a device has no caps at all, let it match with any caps being requested. commit 1f5c911d6fb78100b8558180244582b13351bd7d Author: Denis Oliver Kropp Date: Thu Jul 10 01:07:36 2008 +0200 [option] New runtime option "thread-priority-scale=<100th>" to apply a scaling factor on thread type based priorities. commit 5a0efaa2c12ba5eb260401e552718de71b07e475 Merge: 111cd2d... 568cff6... Author: Denis Oliver Kropp Date: Thu Jul 10 00:14:43 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 111cd2dba120b89c05206ca7656c253dfe94f1fb Author: Denis Oliver Kropp Date: Thu Jul 10 00:14:09 2008 +0200 [core] Only suspend the input core during shutdown if it has been initialized already. commit 568cff642107feb98c8a9b4ad3e057745811058a Merge: a6dcfee... 7490602... Author: Denis Oliver Kropp Date: Thu Jul 10 00:13:05 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit a6dcfee1f13b9cfccf5c71114714cc175411c154 Author: Denis Oliver Kropp Date: Thu Jul 10 00:01:36 2008 +0200 [wm] Keep a list of window stacks, added dfb_wm_close_all_stacks() called early during core shutdown. Fixes shutdown misbehaviour. Added D_MAGIC_ASSERT() for CoreWindowStack functions. commit 16afac667b5927bba5637fbb5d71983a8e4ad09c Author: Denis Oliver Kropp Date: Wed Jul 9 23:54:54 2008 +0200 [interfaces] Turn error from missing interface directories into a debug message. commit 7490602e83e5e3b6a9af0aa90fa151f60e4e1920 Author: Denis Oliver Kropp Date: Wed Jul 9 20:42:39 2008 +0200 [nvidia] Indicate CCF_RENDEROPTS (render options support). commit 01558be062fbbf0c210382f80f7cda34a31e5783 Author: Denis Oliver Kropp Date: Wed Jul 9 20:42:23 2008 +0200 [radeon] Indicate CCF_RENDEROPTS (render options support). commit 930bdad51885bc118bda98cab5655ab926b1459d Author: Denis Oliver Kropp Date: Wed Jul 9 20:41:54 2008 +0200 [sh7722] Indicate CCF_RENDEROPTS (render options support). commit d12c253cbac831940334f5fcbccc8eddd3e505c3 Author: Denis Oliver Kropp Date: Wed Jul 9 20:40:31 2008 +0200 [graphics] Added CCF_RENDEROPTS that needs to be set by the driver to allow acceleration when != DSRO_NONE. commit 4491f78d48bf268e72b9aebedeb2cfac14199727 Author: Denis Oliver Kropp Date: Wed Jul 9 20:28:31 2008 +0200 [vnc] Builds, runs again, but looks wrong... commit f990c1afe695d188d086851902147ac80b996ffc Author: Denis Oliver Kropp Date: Wed Jul 9 20:27:39 2008 +0200 [layers] Check if region surface is system only and avoid using CSAF_GPU_READ which would fail. commit 3f09498bd5a57e33334242cd6c187b288c55b53e Author: Denis Oliver Kropp Date: Wed Jul 9 19:25:30 2008 +0200 [sdl] Small fix using mod_hw instead of modified. commit 406e279d55aeb22009dd5e8ebb7b5ef7bc099ff0 Author: Denis Oliver Kropp Date: Wed Jul 9 18:33:29 2008 +0200 [CirrusLogic] New EP9xx driver, thanks to Brian Austin! commit 56279c0acf016858a180fa4bbd405df53bb39b88 Author: Denis Oliver Kropp Date: Wed Jul 9 07:28:31 2008 +0200 [test] Added reinitialization test program. commit d697b7310b3bddb4c649f437f8b0ac0c02ca2ff9 Author: Denis Oliver Kropp Date: Wed Jul 9 06:53:15 2008 +0200 [mem] Doh! ...doh! .....Dooooh! Actual realloc() was missing in runtime-disabled debug mode. commit 8d262f21b2eb83dda14f73370ea53c62f4ec2122 Author: Denis Oliver Kropp Date: Tue Jul 8 20:15:27 2008 +0200 [gfxutil] Changed dfb_convert_to_*() functions from static inline to non-inline. commit 9cd095ba55897a2431c9e07b7da4c72c1e82ac86 Author: Denis Oliver Kropp Date: Tue Jul 8 20:11:09 2008 +0200 [x11] Added missing check of layer pixel format based on conversion routines available. commit 2298104d1af5ea8736e75287e77ddc4db9731ad3 Author: Denis Oliver Kropp Date: Tue Jul 8 19:50:57 2008 +0200 [linux_input] Thanks to Phil Endecott for adding F13 to F24 support! commit 32adbf9ba07da09927e84c7bc5c973b131d5b176 Merge: eaea0e3... ef9efd7... Author: Denis Oliver Kropp Date: Tue Jul 8 19:31:13 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit eaea0e34702b7bcb8839b6df0397cbe313d4dd7f Author: Denis Oliver Kropp Date: Tue Jul 8 19:30:32 2008 +0200 [pixelformats] This patch adds BGR555 as a new pixel format, thanks to GARDET Guillaume! commit ef9efd7e9179cb7bb3a1528437aa752831e7c781 Merge: 22c876f... c8255c8... Author: Denis Oliver Kropp Date: Tue Jul 8 14:34:31 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit c8255c8d85f608c5e6a4573689e993530c17004d Merge: d00dbd4... 701bf91... Author: Denis Oliver Kropp Date: Tue Jul 8 14:34:22 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit d00dbd4512f9caf29e0768cc33e0e10a66adb2ce Author: Denis Oliver Kropp Date: Tue Jul 8 12:52:38 2008 +0200 [IDirectFBFont] Bug fixes in GetStringBreak(), thanks to Keith Mok! 1.) The ret_next_line is not initialized, so if the initial string is too long without delimiter, "if (*ret_next_line == NULL)" will not run. 2.) If the initial string is too long without delimiter, the return string should be minus one character since the width had already longer than the input width. Should keep the width within input width unless only one character. 3.) The return length should not minus one when whole string is within input width, otherwise one character is cropped. commit 22c876fcc30d48920ebe47856cff79c889b11165 Author: Denis Oliver Kropp Date: Tue Jul 8 11:54:22 2008 +0200 [windows] Fixed missing return value. commit 0c90ba1bd190da49b9e957dea0820e4c17962315 Author: Denis Oliver Kropp Date: Tue Jul 8 11:54:06 2008 +0200 [layers] Fixed warning in non-debug mode. commit 89bb501307b4904cf3c45f24a09c3da3e286b196 Author: Denis Oliver Kropp Date: Tue Jul 8 11:53:00 2008 +0200 [IDirectFBVideoProvider] Fixed copy'n'paste(?) bug in SetStreamAttributes() argument. The argument was DFBStreamDescription, but obviously should be DFBStreamAttributes. commit 701bf9100f84f44b894661799b455e67c4fd2158 Author: Denis Oliver Kropp Date: Mon Jul 7 10:33:48 2008 +0200 [fbdev] Ignore panning errors as before. commit 80d913df4165389dc06767548420813784f6052f Author: Denis Oliver Kropp Date: Mon Jun 30 15:32:17 2008 +0200 [davinci] Added local task buffer for preparing a list of commands and send at once. This avoids overhead due to uncached task control structure being accessed for every task that is added. A new function will emit all tasks at once using memcpy() that allows write combining on the uncached area. Changed all 2D rendering to use new functions for preparing tasks reducing CPU load in DrawString(), FillSpans() etc. Benchmarking 256x256 on 800x580 ARGB (32bit)... Anti-aliased Text 3.085 secs (* 208.881 KChars/sec) [ 87.9%] Anti-aliased Text (blend) 3.084 secs (* 208.949 KChars/sec) [ 89.6%] Fill Rectangle 27.189 secs (* 44.351 MPixel/sec) [ 2.5%] Fill Rectangle (blend) 27.334 secs (* 44.355 MPixel/sec) [ 2.3%] Fill Rectangles [10] 28.063 secs (* 44.371 MPixel/sec) [ 0.8%] Fill Rectangles [10] (blend) 28.065 secs (* 44.367 MPixel/sec) [ 0.6%] Fill Spans 3.115 secs (* 35.766 MPixel/sec) [ 25.4%] Fill Spans (blend) 3.117 secs (* 35.743 MPixel/sec) [ 20.9%] Blit 40.124 secs (* 28.910 MPixel/sec) [ 1.6%] Blit colorkeyed 36.324 secs (* 32.295 MPixel/sec) [ 2.0%] Blit from 32bit (blend) 38.073 secs (* 30.639 MPixel/sec) [ 1.9%] Blit from 32bit (blend) with colorizing 38.065 secs (* 30.646 MPixel/sec) [ 2.2%] Stretch Blit 105.843 secs (* 16.893 MPixel/sec) [ 0.6%] commit 19699fb58779a3a46f53a9820b4b5c68ad21c734 Author: Denis Oliver Kropp Date: Mon Jun 30 15:30:01 2008 +0200 [davinci] Set address back from 0x86000000 to 0x8e000000 for using the uncached window at 0x8f000000. The address wraps around when 128MB are available instead of 256MB. commit 028288dcd22009d2060755256cd857579592692e Author: Denis Oliver Kropp Date: Mon Jun 30 15:10:18 2008 +0200 [layers] Added CLRCF_FREEZE for dfb_layer_region_set_configuration() to set CLRSF_FROZEN. Changes are not applied until dfb_layer_region_flip_update() is called. commit bd8749232bd22df253a3e99c02a230f54f12e089 Author: Denis Oliver Kropp Date: Tue Jun 24 16:49:32 2008 +0200 [davinci] Fixed timeout detection in DAVINCI_IOCTL_WAIT_LOW. - reduced polling frequency from 1/HZ sec to 1/50 sec with an allowed total of almost one second while still running the same command (DSP stuck) - or timeout immediately (after 1/50 sec) if idle counter changed (DSP felt idle) - enhanced queue dump on timeout - disabled user space write combine on control structure (just one member written) commit 1640375755e5bab96a21be1a697fb65c18b4e5a3 Author: Denis Oliver Kropp Date: Tue Jun 24 05:09:45 2008 +0200 [davinci] Added scaling support to video layer using the Davinci Resizer. Surface buffers must be allocated in devmem as the fb memory of the layer is used to store the resized data. Applications can set source and destination rectangles as with other scaled layers, but a Flip() is always required to show updates even in a single buffer mode. Minor fixes and cleanups. commit 7f861b88953fd1d064acb77ada8d51fd2a44fa75 Author: Denis Oliver Kropp Date: Tue Jun 24 03:54:58 2008 +0200 [davinci] Commented out davinci_c64x_write_back_all() in EngineSync() which is still not working properly anyhow. commit 20ce5efe7bbc98b0c3e89570c42d641a31cd44e3 Author: Denis Oliver Kropp Date: Tue Jun 24 03:43:07 2008 +0200 added fixme note commit 20716634b6bd361d1851111c9a771618cea8a722 Author: Denis Oliver Kropp Date: Tue Jun 24 03:31:59 2008 +0200 [devmem] Minor cleanup removing the unneeded heap offset adjustment. commit f48943cf555b72f249d3f75a94390bc5ea4c38b7 Author: Denis Oliver Kropp Date: Sun Jun 22 02:57:31 2008 +0200 [convert] Removed D_CONST_FUNC from dfb_pixel_to_color() and dfb_pixel_from_color(). commit 059a4fdad664c60ce8c2e50d32b1ef265c981e12 Author: Denis Oliver Kropp Date: Sun Jun 22 02:56:35 2008 +0200 [surfaces] Fixed return type of dfb_surface_lock/unlock() for C++. commit 857c82cd4563e12ca50e57110108245d1e920149 Merge: 4ed64ec... 399266a... Author: Denis Oliver Kropp Date: Sun Jun 22 02:16:45 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 4ed64ec5d5ce68a02f526459d8e7d3cfea7d40cd Author: Denis Oliver Kropp Date: Sun Jun 22 02:16:09 2008 +0200 [IDirectFBSurface] Extended debugging messages, mostly coordinates of rendering operations. commit f8cbbf52d7e4bc9e8d1c5f3e7041d362ef267182 Author: Denis Oliver Kropp Date: Sun Jun 22 02:14:40 2008 +0200 [util] Added DFB_RECTANGLES_DEBUG_AT() to dump one or more rectangles. commit 1e48f64765f02e403d29a74970d7e500a9ba806e Author: Denis Oliver Kropp Date: Sun Jun 22 02:13:54 2008 +0200 [IDirectFBWindow] Added basic debug message to each method. commit 399266add735534c4c2722726332b04f8f0be830 Author: Denis Oliver Kropp Date: Sat Jun 21 14:22:27 2008 +0200 [davinci] Moved call to set buffer start address to videoUpdateRegion(). Also made videoSetRegion() very lightweight, e.g. when only the surface is changed. commit ea47bd8c24e4c8b260cc8c3a676551cf385d74a8 Author: Denis Oliver Kropp Date: Sat Jun 21 12:04:40 2008 +0200 [IDirectFBSurface] Optimized DrawLines() to use rectangle filling if all lines are horizontal/vertical. This allows hardware acceleration to be used, e.g. in GTK+ using gdk_directfb_draw_segments() a lot with only horizontal and vertical lines for widgets. commit b00372c5f6af1a749c1e13bb95fe9552c0e45318 Author: Denis Oliver Kropp Date: Sat Jun 21 03:22:19 2008 +0200 [davinci] Replaced all hard coded addressing of 32MB DSP working area by DAVINCI_C64X_MEM. DAVINCI_C64X_MEM is defined in to be 0x86000000 if not defined from outside. FIXME: We could save probably most of the 32MB... commit 2f5c21a288e4111ecd079a68f9f63d647b5436a5 Author: Denis Oliver Kropp Date: Sat Jun 21 03:19:18 2008 +0200 [graphics] Removed dfb_gfxcard_sync() call from slave leaving procedure. commit fea27e5d2e5e359658cbcb182805c6eba8e98531 Author: Denis Oliver Kropp Date: Sat Jun 21 03:14:36 2008 +0200 [IDirectFB] Added sanity limit of 20480x20480 to CreateSurface(). This way further calculations like 20480*20480*4 still work and buffer allocations can be made (rather rejected) as there's no wrap around with 31 or 32 bit numbers. commit 884c9d9e1a2f8a5aa33e5d0a29be87505be7389e Author: Denis Oliver Kropp Date: Sat Jun 21 03:06:45 2008 +0200 [keyboard] Make driver usable without fbdev/vt just for the sake of a keymap. If the FBDev system module is not used, e.g. using DevMem system module, try opening /dev/tty0 just to be able to register a keyboard device with a keymap. GTK+-DirectFB still does not work without it... commit 2d2eb9803277ab5f8f749374b37a73a7fbb788a1 Author: Denis Oliver Kropp Date: Fri Jun 20 11:38:55 2008 +0200 [generic] Dacc_premultiply_color_alpha() also needs Cacc.a to be set, thanks to Mandy Wu for spotting! When only DSBLIT_SRC_PREMULTCOLOR was used, the Cacc.RGB.a value was not set at all. This was only done in conjunction with DSBLIT_BLEND_COLORALPHA or DSBLIT_COLORIZE. commit b1ff8418ed52127a7735b610b723934957c6cef5 Author: Denis Oliver Kropp Date: Fri Jun 20 11:19:54 2008 +0200 [davinci] Added lots of debug messages to 2D acceleration, set StretchBlit() hook statically. As there's no other implementation than for 32 bit at the moment, assign the function pointer for StretchBlit once during driver initialization to save (very minimal) overhead. commit 706d0542ecfe318a99d75a881ea5baddf457c356 Author: Denis Oliver Kropp Date: Fri Jun 20 11:16:55 2008 +0200 [davinci] Allow external definition of DAVINCI_C64X_IDLE_MAX for c64xdump tool. commit 29700e4d2a04f213710dae7c10e759ff36622a98 Author: Denis Oliver Kropp Date: Fri Jun 20 11:16:27 2008 +0200 [util] Added DFB_COLORKEY_VALS(). commit b1f15d73e55225c656ca5f2a208202b11fa2930c Author: Denis Oliver Kropp Date: Fri Jun 20 11:15:30 2008 +0200 [layers] Enhanced debugging output for layer regions. commit 9dff083726ddefb6d773697af1958e3070cc850c Author: Denis Oliver Kropp Date: Fri Jun 20 11:14:38 2008 +0200 [layers] Added DFB_CORE_LAYER_REGION_CONFIG_DEBUG_AT() to dump a configuration. commit 99a2fea3f71be631629d6ddc921ff79c9d364f8b Author: Denis Oliver Kropp Date: Fri Jun 20 11:13:41 2008 +0200 [IDirectFBSurface_Layer] Moved interface data structure definition to header file. commit eec017753d1e32ccf6c6f1ecebfdaeca9ee0b8cb Author: Denis Oliver Kropp Date: Mon Jun 16 09:19:01 2008 +0200 [davinci] Update allocations during Lock(). commit 08d636baa4399f63d78b1e96127855b55d20c27f Author: Denis Oliver Kropp Date: Mon Jun 16 09:18:02 2008 +0200 [davinci] Updated kernel module. commit 432c828da55b829adff0dca888d519c42c3e6aef Author: Denis Oliver Kropp Date: Mon Jun 16 09:07:23 2008 +0200 [davinci] Build libdavinci_c64x.la and install headers. commit e456cdc058546a19d405d18ab88f9dabbdd568b7 Author: Denis Oliver Kropp Date: Mon Jun 16 09:04:14 2008 +0200 [tslib] Include . commit d261c76eb8c8a53bc8e2132f6b8905b58a01340d Author: Denis Oliver Kropp Date: Sat Jun 14 10:10:07 2008 +0200 [davinci] Use FBIO_GET_TIMING to query screen size. commit 87943754c47067a2d88ea791d3144607792315bb Author: Denis Oliver Kropp Date: Thu Jun 12 09:34:07 2008 +0200 [davinci] Remove sizeof() from ioctl definitions. Thanks to Eric Nelson! commit 7c1d09bb5e1e76d69af33af2e14ac4418485d7bb Merge: ef6be22... 1c605ad... Author: Denis Oliver Kropp Date: Thu Jun 12 09:16:42 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit ef6be22899e343dfa84e3df822b43a8544c7adcc Author: Denis Oliver Kropp Date: Thu Jun 12 09:15:19 2008 +0200 [convert] Added dfb_pixel_from_color() for full ARGB version of dfb_color_to_pixel(). The latter is still there for compatibility, but calling dfb_pixel_from_color() with alpha = 0. commit 65c355244ce1a2e00197a1113ef1a420a1029c68 Author: Denis Oliver Kropp Date: Thu Jun 12 09:12:00 2008 +0200 [davinci] Temporary workaround for getting the screen size. Thanks to Eric Nelson! commit 1c605ade7e377ff3cdcea67669692e7530a9cf1e Author: Denis Oliver Kropp Date: Wed Jun 11 23:57:19 2008 +0200 [davinci] Use KCPPFLAGS and set CROSS_COMPILE_PREFIX. commit 62e92a111de85dc720521bef7388b8aa94d791a7 Author: Denis Oliver Kropp Date: Wed Jun 11 04:14:07 2008 +0200 [options] Added "[no-]cursor-updates" to never show a cursor, but still handle it. commit efab271d361fa8981416180347bc94d020801b09 Author: Denis Oliver Kropp Date: Tue Jun 10 11:31:25 2008 +0200 [x11] Fixed double wheel events by discarding ButtonUps. commit 94e9fc75aa7cc83eea759f7fb00e0ec0c9aa5b88 Author: Denis Oliver Kropp Date: Mon Jun 9 21:15:54 2008 +0200 [IDirectFBSurface] Don't build hierarchy of sub surfaces if start-stop is not used. commit 0752af54638978b49045817a30e9e473a9b29f20 Author: Denis Oliver Kropp Date: Mon Jun 9 19:16:15 2008 +0200 fixed png filename commit 44c85a885e88fce2ed43a0bb5dcb7a8095ff82b0 Merge: a420a6c... e554901... Author: Denis Oliver Kropp Date: Mon Jun 9 02:44:39 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit a420a6c70c056e8dfb88d64c51d737fe0ea74381 Author: Denis Oliver Kropp Date: Mon Jun 9 02:41:57 2008 +0200 [list] Remove check on element in direct_list_contains_element_EXPENSIVE() used for debugging. When checking for existence in a list, avoid crashes due to already freed elements being passed in as a pointer and checked for existence in a list. commit e554901f69e726397f29c8480a71ed28d70a530a Author: Denis Oliver Kropp Date: Thu Jun 5 09:32:20 2008 +0200 This patches teaches directfb-config about SYSROOT and removes -L/usr/X11R6/lib Signed-off-by: Marc Kleine-Budde commit c59be091ecbd83bfcc1535c934bbaf1305b5feac Author: Denis Oliver Kropp Date: Wed Jun 4 23:00:39 2008 +0200 [dgiff] Revival of the DGIFF (DirectFB Glyph Image File Format). Thanks to Vaclav Slavik! commit 28207ee35af6157032ca3059fc723ec2eefd757a Author: Denis Oliver Kropp Date: Tue Jun 3 11:08:07 2008 +0200 [gendoc] Adjusted page top and added better logo image. commit 483c9a336355c9bdbfa12ac6329bd39e583d2438 Author: Denis Oliver Kropp Date: Mon Jun 2 21:10:01 2008 +0200 [NEWS] Updated for 1.2.0-rc1. commit 4e7313e6e15d9a00203a864532b43618460a1683 Author: Denis Oliver Kropp Date: Mon Jun 2 11:12:11 2008 +0200 [x11] Use XNextEvent() again instead of usleep() based polling after fixes. Pull up to 100 events per round, i.e. until accumulated motion events are flushed and thread exit status is checked. Send ClientMessage to wake up thread from blocking XNextEvent(). NOTE: Assuming XNextEvent() is thread safe by itself and does not require to use XLock/UnlockDisplay(), because using it blocks all other threads while XNextEvent() is blocking... commit c040e8b5baa2b748b08efb7b6cf8bdcfe4b9ef82 Author: Denis Oliver Kropp Date: Mon Jun 2 10:31:35 2008 +0200 [x11] Missed one Xlib actor site not enclosed by XLock/UnlockDisplay(). commit ab863f2ab71453bdc1a1574bb862a7891d3c5d00 Author: Denis Oliver Kropp Date: Mon Jun 2 10:18:07 2008 +0200 [IDirectFBSurface_Layer] Added debug domain IDirectFBSurfaceL with messages as in IDirectFBSurfaceW. commit c64fe7d7aa06114cc91b005f5b9045e57995ef45 Author: Denis Oliver Kropp Date: Mon Jun 2 10:17:20 2008 +0200 [surface_core] Changed debug domain name from Core/Surface to Core/SurfaceCore. commit c54118cc9ed7eae4a6df417a8c9613a07fc0dc3e Author: Denis Oliver Kropp Date: Mon Jun 2 10:15:42 2008 +0200 [x11] Fixed threading issues using XLock/UnlockDisplay(), reduced invisible 16x16 cursor to 1x1, minor cleanups. commit f59e9e8d861ca7156ff1d0ffd2104290da608efe Author: Denis Oliver Kropp Date: Mon Jun 2 08:22:42 2008 +0200 [IDirectFBVideoProvider] Applied patch from Daniel Laird adding buffer threshold control/notifications. Thanks! commit 18552ace2ccfd852fac90016844cd30027b432aa Author: Denis Oliver Kropp Date: Sun Jun 1 15:03:11 2008 +0200 [fbdev] The big fix[tm] Still not working again is support for virtual resolutions with panning, not double/triple buffering which works. commit ba01767fcdaa91b00ae739e82ca270c5f810b74f Author: Denis Oliver Kropp Date: Sat May 31 18:13:08 2008 +0200 [copyright] Update copyright headers. commit 3b52479e932f1ba951778283fee10351903b2350 Author: Denis Oliver Kropp Date: Sat May 31 18:08:26 2008 +0200 1.2.0-rc1 commit 504fcd5fa51fb67bcd8f2eb0dfea59cebb7f8875 Merge: e02436f... 5b83790... Author: Denis Oliver Kropp Date: Sat May 31 17:36:43 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit e02436f38eb1bee6e9312ee3a4ffaeeb76d681a6 Author: Denis Oliver Kropp Date: Sat May 31 17:26:22 2008 +0200 [interfaces] Fixed assignments of invalid pointer type. AddRef/Release return DirectResult now. commit ebca2537c452aac57fae113c1359051620b0c3bf Author: Denis Oliver Kropp Date: Sat May 31 17:20:34 2008 +0200 [clip] Fixed bogus gcc-4.1 warning. commit 5b837903a083655800970fcbfee7dfe6a5e28310 Author: Denis Oliver Kropp Date: Sat May 31 16:28:08 2008 +0200 [dfbdump] Show sum of buffers' "locked" value. commit 2dd15de3123d80105b06bc11a605cf0db3f902a7 Author: Denis Oliver Kropp Date: Sat May 31 16:05:26 2008 +0200 [README] Elaborate requirements, use Debian package names. commit 0d395ea7a4618dace405c9bc66909bc5d0450b9d Author: Denis Oliver Kropp Date: Fri May 30 13:48:47 2008 +0200 [SDL] Fix mode switching/surface creation, having working accelerated SDL backend again. commit 0f05533015beea8847bcc56c6188a02f96ae0dd4 Author: Denis Oliver Kropp Date: Fri May 30 13:47:59 2008 +0200 [surface] Commented out annoying assumption for now. commit a08511ae755464e93f05fd66bb6da6a0320f240c Author: Denis Oliver Kropp Date: Wed May 28 08:15:38 2008 +0200 ignore all SlickEdit project/workspace files commit 703f622980d497b85541c4501ceea2844c9050ee Author: Denis Oliver Kropp Date: Wed May 28 08:12:59 2008 +0200 Revert "[input] Patch to reopen console if zero length byte is read" Fails in the usual case, but works when run through strace. This reverts commit cb9e767d7a829801a53952e3a34eb770fd8bfff4. commit c2c776002794e6793867ed9a2138ab02915a73cd Merge: 9c357f6... c291ee5... Author: Denis Oliver Kropp Date: Tue May 27 08:13:04 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 9c357f658c967d8b93d90c39cff691a8bcaddc06 Author: Denis Oliver Kropp Date: Tue May 27 08:12:45 2008 +0200 [graphics] Added dfb_gfxcard_get_primary(). commit c291ee57abd3d9149e9f3a8ed4a82e4ee69a9f0e Author: Denis Oliver Kropp Date: Wed May 21 00:16:42 2008 +0200 [davinci] Allow layers up to 1920x1080 instead of the bogus limit I added before. The original patch did not include any limit at all. commit 0ac0d24980d2f2d4b1d1a238d78f29658c23197d Author: Denis Oliver Kropp Date: Tue May 20 19:15:24 2008 +0200 [davinci] build fix commit 575de8b0d56bd26a0e4191d99a25f360d865cd01 Author: Denis Oliver Kropp Date: Tue May 20 19:10:50 2008 +0200 [davinci] More changes for HD support, thanks to Eric Nelson! commit 1384d02151c248dba0a200ad73c624a7e56b5255 Merge: 82fa12f... c65ed1d... Author: Denis Oliver Kropp Date: Tue May 20 18:44:53 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 82fa12f125e41619ed772b02ac39fa149eab2a83 Author: Denis Oliver Kropp Date: Tue May 20 18:41:58 2008 +0200 [davinci] Patch from Eric Nelson to support HD OSD planes. commit c65ed1da33a374047a62d62310c6ab971b5a9ccc Author: Claudio Ciccani Date: Tue May 20 12:04:04 2008 +0200 [radeon] Implemented DSBLIT_SRC_PREMULTIPLY (R100/R200 only). commit 8eeb64fc9564d804e01548659f5807049b54afa8 Merge: cb9e767... 449e86d... Author: Denis Oliver Kropp Date: Sat May 17 23:36:19 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit cb9e767d7a829801a53952e3a34eb770fd8bfff4 Author: Denis Oliver Kropp Date: Sat May 17 23:15:31 2008 +0200 [input] Patch to reopen console if zero length byte is read As reported by John Hughes on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=462626, Splashy is a small boot splash program that starts from initramfs during early boot on Linux. While Splashy is running, the contents of root (/) gets umounted and cleaned up loosing access to the devices when the system started. Using the following patch, when libdirectfb detects zero length reads, it attempts to reopen the console (possibly from a newly mounted root tree). This was the same solution that was suggested to us by Dennis a few months ago. John arrived to the same conclusion independently (and submitted a patch!) commit 449e86d519e98cd1d189ac07e97229841250ebe6 Author: Denis Oliver Kropp Date: Wed May 14 07:04:34 2008 +0200 [options] New runtime option "quiet=" to disable only certain message types. Thanks to Niels Roest! [merged from b2007ph1] commit 991d8ff7d13d1ad84cc33d1390a962b6bb63d4c6 Author: Denis Oliver Kropp Date: Mon May 5 01:02:31 2008 +0200 [tests] Smooth indexed -> ARGB scaling test. commit b79c72198361748528f7ff0e6426784a8647bed9 Author: Denis Oliver Kropp Date: Mon May 5 00:47:23 2008 +0200 [generic] Fixed dumb mistake in premultiplication of alpha during smooth scaling. commit 749f21a25614a01cce60804792af9ddba6a7fb5f Author: Denis Oliver Kropp Date: Sun Apr 27 14:00:44 2008 +0200 [generic] Allow DSBLIT_SRC_PREMULTIPLY while scaling from indexed to alpha formats. Scaling an image which has alpha values != 255 (non-premultiplied) now produces premultiplied output (smooth scaling only). Support for non-indexed sources still needs to be added. commit ff8d4e51c6d09efef9448d1dd282f8225ba7dcb5 Author: Claudio Ciccani Date: Thu Apr 17 15:38:06 2008 +0200 [radeon] Follow changes. commit 5e81db40d3dc93b7f467336e872656a4ba2b9680 Author: Claudio Ciccani Date: Thu Apr 17 15:36:44 2008 +0200 Entering version 1.2. commit 34356075fe7910e6974c8528deac5eb6c2797919 Author: Claudio Ciccani Date: Thu Apr 17 15:35:44 2008 +0200 IDirectFBSurface API changes. Added IDirectFBSurface::FillTriangles(). IDirectFBSurface::SetMatrix() takes a 3x3 matrix. commit e0f615d069d267bcd6e1e6c2bb62ce8ff23d246b Author: Denis Oliver Kropp Date: Fri Apr 11 19:17:30 2008 +0200 [davinci] Work around missing alpha plane pitch setting (when differing from RGB plane). The DSP function needs to be extended to fix it properly. commit 4c1b8080a3e2b1abb55428b8b668332d2f93d2ae Author: Denis Oliver Kropp Date: Fri Apr 11 18:10:27 2008 +0200 [davinci] In c64xdump do 4 instead of 10 updates/sec and switch to automatic idle_max. You should measure your idle_max once with an idle system and set the IDLE_MAX macro accordingly. commit ff8d40c4520de2dfe140da777166d5b9993abc6e Author: Denis Oliver Kropp Date: Fri Apr 11 18:00:50 2008 +0200 [davinci] Fix double error message. commit dd272a04d4f9ed177fbcbe67e6f0329d71554380 Author: Denis Oliver Kropp Date: Fri Apr 11 17:58:40 2008 +0200 [davinci] Further DSP interface updates and cleanups. commit e648a4d07251a7d1c3ca5db13ea6c35f1b433b5f Author: Denis Oliver Kropp Date: Fri Apr 11 17:57:31 2008 +0200 [davinci] Added small tool for showing DSP status. commit 1d67f2e5451fbbebe5ea5ab75bbd3c98073c456f Author: Denis Oliver Kropp Date: Fri Apr 11 17:51:54 2008 +0200 ignore commit 3d9890e79aa10c9e00f4b710ae3189e94bcd182d Merge: 9dd3fd8... 468b12e... Author: Denis Oliver Kropp Date: Fri Apr 11 17:39:30 2008 +0200 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 9dd3fd82fb5c3bbe382e915923bd5265f01f4bde Author: Denis Oliver Kropp Date: Fri Apr 11 17:39:19 2008 +0200 [davinci] Task handling fixes. commit 468b12e10db3d55d918a7c254ea9e720efb273ff Author: Denis Oliver Kropp Date: Fri Apr 11 16:34:37 2008 +0200 [IDirectFB] Added more debug messages to IDirectFB::CreateSurface(). commit 21cebe19e4db44858bf457da535971f588683fac Author: Denis Oliver Kropp Date: Fri Apr 11 16:33:57 2008 +0200 [davinci] Fixed kernel module for more recent kernels. commit da483de031e5b603ddf3e53ce81839424408435b Author: Denis Oliver Kropp Date: Fri Apr 11 16:32:38 2008 +0200 [davinci] Suppress errors of custom ioctls for now. commit b18878562fb8f8b14bcfac77e9a4d4e81b9dcdb2 Author: Denis Oliver Kropp Date: Fri Apr 11 16:31:49 2008 +0200 [davinci] Allow explicit driver usage without probing by setting accelerator id to 6400. system = devmem accelerator = 6400 video-phys = 86000000 video-length = 8388608 commit ebb40f5c738f359d645ab6ee8db049ea3079bd58 Author: Denis Oliver Kropp Date: Fri Apr 11 16:30:04 2008 +0200 [davinci] Fixed double error message. commit 9edf2a0a09b7c6fa0ceffd380975d66fb496ea9b Author: Denis Oliver Kropp Date: Fri Apr 11 16:29:44 2008 +0200 [davinci] Set default kernel source location to be "linux-davinci-2.6" next to "DirectFB". commit 243705777c7b280e61de721433bafb136ee93022 Author: Denis Oliver Kropp Date: Fri Apr 11 16:29:01 2008 +0200 [configure] Fixed typo in X11 detection. commit e78501238b28f6bb318b89532743b91cece1c5b3 Author: Denis Oliver Kropp Date: Wed Mar 19 14:08:29 2008 +0100 [util] Added DFB_TRIANGLE_VALS(t) commit c469e1004ed4544fd7e2896c1fe3e83d04b8063e Author: Denis Oliver Kropp Date: Mon Mar 17 19:54:06 2008 +0100 [docs] Changes to gendoc.pl to fix missing character after newline. Other changes: - Ignore redeclarations of interfaces (no double items in index) - Warn about interface definitions without a declaration (not indexed) - Indention... commit c386f912febdf7ca7b7d264e701ab98a9d65fb26 Author: Denis Oliver Kropp Date: Mon Mar 17 15:35:50 2008 +0100 warmer... commit becaa3e3533b1dbb2f9faa94c0cb3acea49fc98c Author: Denis Oliver Kropp Date: Sun Mar 16 18:35:00 2008 +0100 [docs] Made color equal on most systems (RGB16 did differ before). commit bb71cad3e17fb8f9a068ffa94e66473186c4e3e7 Author: Denis Oliver Kropp Date: Fri Mar 14 02:13:34 2008 +0100 [docs] Update version. commit 6cc35d5d1d0bc2a1a5129aa7e0f6c312d0e2aada Author: Ville Syrjala Date: Tue Mar 11 02:41:07 2008 +0200 surface core: Fix a potential problem with deallocating buffers. dfb_surface_buffer_lock() walks the buffer allocations with fusion_vector_foreach (alloc, i, buffer->allocs) and if it doesn't find a suitable allocation it will allocate one. It then tests alloc against NULL in the error paths to determine if the allocation was performed. If there are only unsuitable allocations alloc will not be NULL even though a new allocation was made. So use other means to keep track if allocation was made. In the name of keeping the code more readable give dfb_surface_buffer_write() the same treatment even though it's not actually necessary there. commit db3a591846f12c1b284a71e2d2346c45d94a85a0 Author: Ville Syrjala Date: Mon Sep 17 22:21:52 2007 +0300 Don't access FusionVector members directly. Surface core seems to test FusionVector::elements against NULL to determine if the vector is empty. That won't work when the vector has contained some data but has since become empty (since elements is not deallocated/set to NULL). AFAICS that could happen eg. when dfb_surface_buffer_write() would do the first allocation and update_allocation() would then fail which would lead to deallocation in the error path. The next dfb_surface_buffer_write() would then fail to detect that there are no allocations and would not try to make a new allocation. There are several other places where FusionVector members are accessed directly. AFAICS nothing that could cause bugs but I decided to clean them up at the same time. commit 9f693ab58d17a4a3cb235956a2b754d0122dc2b2 Author: Ville Syrjala Date: Tue Mar 11 18:11:04 2008 +0200 dfbinfo: Show min/max keycodes. commit cb71d1da5ac1f31d70404de4bfcf62cd62faf2f0 Author: Ville Syrjala Date: Tue Mar 11 18:12:51 2008 +0200 fbdev: Eliminate floats. commit 45db5ded04afcaa4a015efd9670d57f2fe5f4eac Author: Ville Syrjala Date: Tue Mar 11 18:12:40 2008 +0200 fbdev: Use CLAMP(). commit 9a3abe8781628d994f7ecf7bab3b49b61d259834 Author: Ville Syrjala Date: Tue Mar 11 18:14:47 2008 +0200 jpeg: Use #ifdef WORDS_BIGENDIAN instead of #if WORDS_BIGENDIAN commit 552ab7a4ce5829b3f81254002b516617d3656419 Author: Claudio Ciccani Date: Tue Mar 11 12:21:59 2008 +0100 [fusion] Added fusion_world_get_fork_action() and fusion_world_set_fork_callback(). fusion_world_set_fork_callback() allows to register a callback called during the different states of fork() (prepare, parent, child) and before the actual fork action is performed. Useful to free local resources when fork action is FFA_CLOSE. commit 886be63179ed680f52ba30577bc6ceb7eedf8be6 Author: Denis Oliver Kropp Date: Thu Mar 6 17:08:26 2008 +0100 [docs] Fixed reference to SetSourceMask(). commit 3bd7cf172c17edb17794b6942790bbc4fa50dbe7 Author: Ville Syrjala Date: Thu Mar 6 12:33:32 2008 +0200 fbdev: Initialize primary layer config width and height primaryInitLayer() forgot to initialize the config width and height that were passed to dfb_fbdev_set_mode(). Also memset() the config to 0 for good measure. commit a4968c5e842271b9e37edda1fe2e4f7585d2e385 Author: Claudio Ciccani Date: Mon Mar 3 18:33:34 2008 +0100 Added support for affine transformations to dfb_gfxcard_draw_string(). Actually this is done by using gStretchBlit. Direct glyph transformation (done by the font provider) would be better. commit dd3f1f2cc6b9b5066c68f0cf8b9ade53ca50091f Author: Claudio Ciccani Date: Mon Mar 3 18:30:58 2008 +0100 [radeon] Emit transformed rectangle using TRIANGLE_LIST instead of TRIANGLE_FAN. Because of vertex buffering, TRIANGLE_FAN leds to incorrect result when drawing multiple rectangles. commit 5ffa438d0872695bcac73f48fbe3856416d47202 Author: Claudio Ciccani Date: Sun Mar 2 15:57:23 2008 +0100 Started implementing affine transformations in software. Also fixed incorrect clipping when DSRO_MATRIX is set. commit bfad60cbd3269aa33ea360aad843bb266046ad88 Author: Claudio Ciccani Date: Sun Mar 2 15:55:42 2008 +0100 Implemented triangle clipping. commit e5448dff452407df4d1d28acb402650c0e75f8f4 Author: Claudio Ciccani Date: Sun Mar 2 15:55:01 2008 +0100 Added dfb_line_segment_intersect(). Gets the intersection point between a line and segment within the given segment. commit 5081997bbf0e59d2f4a70148f37e1d2acc267504 Author: Claudio Ciccani Date: Sun Mar 2 13:27:07 2008 +0100 [nvidia] Fixed buggy vertices formation in TextureTriangles. commit 01d772a3741b5865ad4758d98bb3f1d82cb278cf Author: Claudio Ciccani Date: Fri Feb 29 16:15:01 2008 +0100 [direct] Fixed a prototype. commit 73cd5a4f3c578bf0d8d9d5f16fac5a72aa628d56 Author: Claudio Ciccani Date: Fri Feb 29 15:25:00 2008 +0100 [nvidia] Cleanup overlay code. Enbale using NV12 (requires NV30 or newer). commit 83d555be5f3f22be050e854d9c132277c3edc57c Author: Claudio Ciccani Date: Fri Feb 29 15:23:28 2008 +0100 [nvidia] In case of unsupported arch (NV40), skip objects and fifo setup. commit 72e8be27b38ad21d9e55819d2c6bbdee25630798 Author: Denis Oliver Kropp Date: Thu Feb 28 14:53:48 2008 +0100 [dfbdump] Build fix. commit 5997403179ffb774e40cd7ad9c0313025e077dbf Author: Denis Oliver Kropp Date: Thu Feb 28 13:36:17 2008 +0100 [fusion] Fix multi app core build. commit c89ee26379d95b7297c4b419efbf44221bc2f180 Merge: 16d886a... 14b09af... Author: Denis Oliver Kropp Date: Wed Feb 27 04:25:03 2008 +0100 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 16d886addf8386d5c8e0a268d33cdba5d9845828 Author: Denis Oliver Kropp Date: Wed Feb 27 04:24:49 2008 +0100 [DirectResult] Added extensible result codes and made other fixes to ban from libdirect and others. Made DirectResult the primary type for result codes. Added D_RESULT_TYPE_BASE, D_RESULT_TYPE_MAX and D_RESULT_TYPE_IS for extended result codes. Changed most of DFB_ codes to be assigned the corresponding DR_ code. Three DirectFB specific codes remain, after DFB__RESULT_OFFSET defined as D_RESULT_TYPE_BASE('D','F','B'). Added DirectEnumerationResult. Moved DECLARE_INTERFACE and DEFINE_INTERFACE to . NOTE: Need type changes of all AddRef/Release implementations from return type DFBResult to DirectResult! No more inclusion of outside of DirectFB! commit 14b09af2a288f71f90dee1cfd508033969e55e42 Merge: 8fb7df8... ca24167... Author: Claudio Ciccani Date: Tue Feb 26 19:07:01 2008 +0100 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 8fb7df82d8ee14859b809c49f00350808df407c8 Author: Claudio Ciccani Date: Tue Feb 26 18:58:59 2008 +0100 NVIDIA: Implemented affine transformations. commit ca241672be0b4bd9bdd92629d2d96e3e83f581c7 Author: Denis Oliver Kropp Date: Tue Feb 26 17:13:01 2008 +0100 [docs] Fixed broken interface description, only IDirectFB had one. commit 2d934900ae4ef394bafb3b26d1415acda5966477 Author: Denis Oliver Kropp Date: Tue Feb 26 16:41:45 2008 +0100 [tests] Fixed warning due to a stupid mixup of void/char. commit 055a18e3d069a86b01aa8081ba769075279d2c3a Author: Denis Oliver Kropp Date: Tue Feb 26 16:28:05 2008 +0100 [docs] Fixed missing new argument to gendoc.pl call. commit 774d0b4c86bf1ebe75c356f9162c014ea2c91b91 Merge: 3d9759e... b933f4a... Author: Denis Oliver Kropp Date: Tue Feb 26 16:25:52 2008 +0100 Merge branch 'master' of ssh://directfb.org/git/directfb/core/DirectFB commit 3d9759ef23e517557d3a475df5cb66aa50de07e2 Author: Denis Oliver Kropp Date: Tue Feb 26 16:15:53 2008 +0100 [docs] Improved generated documentation to include more and look better. commit 4b6b14ef9e9422d88c5de5dcbfba015d9cefb827 Author: Denis Oliver Kropp Date: Tue Feb 26 16:21:12 2008 +0100 [util] Added macro to determine the first set bit of a 32 bit constant at compile time. commit 60f1b19e2aef15ba1a4c5bb47970b4ec1543ac5e Author: Denis Oliver Kropp Date: Sat Feb 23 16:48:03 2008 +0100 [surface] Allow second string (prefix) in Dump() to be NULL to dump without numbering. commit b933f4a4bb38a00b770ec8241f3df46ca003303d Author: Claudio Ciccani Date: Mon Feb 25 17:40:22 2008 +0100 RADEON: Implemented DSPF_DSTALPHA/INVDSTALPHA for A8. commit 21b739036416c96de21db34ae5395970bec19aeb Author: Claudio Ciccani Date: Sun Feb 24 21:24:40 2008 +0100 Specify that alphablend must be enabled for antialiasing. commit c8060ca4e611716e46e0c9f2577db28d17f52a2c Author: Claudio Ciccani Date: Sun Feb 24 21:23:41 2008 +0100 RADEON: Implemented antialiasing (R100 and R200 only). Fixed conversion+blend with A8 destination. Use LINE primitive for transformed DrawRectangle. Use POINT primitive for 1x1 rectangles. commit b417724db62384eba84c481c6c7f670f4347a295 Author: Denis Oliver Kropp Date: Fri Feb 22 21:08:59 2008 +0100 [surface core] Hotfix failing assumption that flags would still be set when unlocking. While locking the surface and managing interlocks, only clear access flags when the buffer has not been locked before. Probably we should have an allocation lock counter. But it needs to be protected anyhow, e.g. using FusionRef, but I'd like to avoid overhead and instead add an allocation manager per Fusionee. This one would just have one FusionRef, e.g. as a FusionObject, and a list of locked allocations. The destructor handles them all. Another important job for the local allocation manager would be to remember allocations that have been attached to locally, e.g. mapped, and require to be detached by everyone when destroyed. The XShmImages in the X11 backend are currently only shmat()ed by slave processes :-P commit 7decf9233c0c0b753bad72ace4959862e4d53027 Author: Denis Oliver Kropp Date: Fri Feb 22 21:43:31 2008 +0100 [deinit] Fix crashes during shutdown by suspending the input core before shutting down anything. The input core is shutdown almost at last. Lots of shutdown happens before, which could collide with input threads doing fancy stuff like handling expose events :) With this change the input core is suspended before any other shutdown. This closes all input threads to avoid crashes or other misbehaviour. Made the input core allow shutdown during suspended state. Added debug messages, assertions... commit 4f957b6ccbe0f108c448dad7572c885d34b94e2c Author: Denis Oliver Kropp Date: Fri Feb 22 20:37:46 2008 +0100 [deinit] Fix deinitialization order in IDirectFB_Destruct(). This fixes an assertion happening when drop_window() enables the cursor of the context that has been destroyed (unrefed) just before. commit 09c35c9c27783cceb3446079dd8b67fc63c866c5 Author: Claudio Ciccani Date: Thu Feb 21 18:45:50 2008 +0100 Added missing definition of DATADIR. commit 942c98ba5385060a4dcb9f3d9e88f90354370563 Author: Denis Oliver Kropp Date: Wed Feb 20 15:12:58 2008 +0100 [tests] oops, forgot the source. commit ac760580de6bcaf0b8087d7949c161bfd64a96a7 Author: Denis Oliver Kropp Date: Wed Feb 20 01:12:00 2008 +0100 [x11] Bring in line with 1.0 features, expose handler, format conversion, shm, smp... commit 2bb6bfccfd7d35d0fa299f6829456e1970ca49b9 Merge: 4d12462... aec6c55... Author: Denis Oliver Kropp Date: Wed Feb 20 00:14:37 2008 +0100 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 4d12462cf000758748bc808d469121251c1dca97 Author: Denis Oliver Kropp Date: Wed Feb 20 00:14:27 2008 +0100 [software] Have two stages of software fallback warnings. If software fallbacks are disabled, just print a brief message as before, otherwise print a detailed message in the specific functions. commit 287af30cd2679d70a8a97016b9090156aeec9ae6 Author: Denis Oliver Kropp Date: Tue Feb 19 23:58:37 2008 +0100 [surfac core] Added more debug and an assumption with a FIXME. commit aec6c554d8fa99f72edaa1b9819740a6dfdf8c78 Author: Denis Oliver Kropp Date: Tue Feb 19 23:31:44 2008 +0100 [tools] Added dfbinspector as a small C app. commit f9137c2e57b78e6a1d28ae27a3d70a4b400238ae Merge: f648447... 25fbe5a... Author: Denis Oliver Kropp Date: Tue Feb 19 23:23:47 2008 +0100 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit f64844754cab020c11e88b210329372e15ac67c2 Author: Denis Oliver Kropp Date: Tue Feb 19 23:23:36 2008 +0100 [fusion] Implemented lock counter in single app Fusion. commit 4b245174e0253343a43ec1e8a4bf786c534bfa0f Author: Denis Oliver Kropp Date: Tue Feb 19 23:22:38 2008 +0100 [threads] Added debug messages. commit 69465c68c3fa3cdfbb64f5f3a328562b91b9ce77 Author: Denis Oliver Kropp Date: Tue Feb 19 23:21:55 2008 +0100 [graphics/font] Fixed state handling bug causing wrong acceleration masks. Added special graphics state debug messages in domain "Core/GfxState". Added separate blittingflags member to the font as the one in the state will be modified. commit d71d8a0f6d2e6c74f0c6172a7068501c5d2aba96 Author: Denis Oliver Kropp Date: Tue Feb 19 18:07:11 2008 +0100 [core] Late increase of ABI version after adding pool size to the description. commit ee0a49e338a8c712e2c67357b319189c2df0bc9f Author: Denis Oliver Kropp Date: Tue Feb 19 18:04:13 2008 +0100 [tests] Small restructuring, new test writing data retrieved from an URL to stdout. commit 25fbe5a187e3b9a9e910985ee57e0cf2668ea876 Author: Denis Oliver Kropp Date: Tue Feb 19 15:29:55 2008 +0100 [fusion] Support resume of interrupted wait on a skirmish. commit da996c99b1686f91ae6829388f188d60a64b1883 Author: Denis Oliver Kropp Date: Tue Feb 19 15:20:41 2008 +0100 [mem] Fixed allocation debugging always being used when available. commit 875dea04fe7291afa8cb53206ded0d6c4ebb5b68 Author: Denis Oliver Kropp Date: Tue Feb 19 14:57:59 2008 +0100 Test skirmish wait timeout. commit 94479dccd2d9f11ff44f4fca658be9f56b53fe9a Author: Denis Oliver Kropp Date: Sun Feb 17 16:24:36 2008 +0100 [surface core] Added CORE_SURFACE_BUFFER_LOCK_ASSERT(lock) and CORE_SURFACE_ALLOCATION_ASSERT(lock). These two macros are consisting of assertions for all they could check. commit 03e4ee39816a3179f6013e9eabfd9a63a948627d Author: Denis Oliver Kropp Date: Sun Feb 17 16:19:54 2008 +0100 [fbdev] Added DSPF_ARGB6666 to formats checked at depth 24. commit 85c5b5961d0f98a42d39f2158bce91ba3531b299 Author: Denis Oliver Kropp Date: Sun Feb 17 16:17:50 2008 +0100 [surface pools] added size field to description for pools with a defined maximum. commit 86ce96319e81052b0ee8e60401ccc6a19a379a33 Author: Denis Oliver Kropp Date: Sun Feb 17 16:16:04 2008 +0100 ignore commit 77919e759c7f1cc3738f07fe0419d4b94970b348 Author: Denis Oliver Kropp Date: Sun Feb 17 16:14:22 2008 +0100 [config] strip off "lt-" at the beginning of a program name. commit 93d6dc2d2fd5dad1fe84d9829c6f9c08c6c7fecb Author: Claudio Ciccani Date: Thu Feb 14 18:40:16 2008 +0100 Ported radeonfb patch to linux-2.6.22. commit 9eba76a734d6937932c11a764a1c215999d93848 Author: Claudio Ciccani Date: Thu Feb 14 18:38:45 2008 +0100 RADEON: Implemented affine transformation (all cards) and source masking (R100/R200 only). Switched to version 1.1.2. commit e64f23f7425322d9514a84166f0bb07f232f6301 Merge: d8114d4... 974cc71... Author: Denis Oliver Kropp Date: Mon Feb 11 23:36:43 2008 +0100 Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB commit 974cc710f1bd92707278a6622bfa7ea14f68c43d Author: Denis Oliver Kropp Date: Mon Feb 11 23:35:58 2008 +0100 SH7722: Remove a temporary printf and two commented out. commit 99bc47070b386fbd2df4731711ccd2364f262bf8 Author: Denis Oliver Kropp Date: Mon Feb 11 23:29:40 2008 +0100 SH7722: Implemented DSBLIT_SRC_MASK_ALPHA, cleaned up and optimized state handling. commit fe25a2d4bbbecc4abfa474098d9e0d3bca4ae2cd Author: Denis Oliver Kropp Date: Mon Feb 11 23:26:30 2008 +0100 RENDER: Added IDirectFBSurface::SetSourceMask() - yes, a third blitting operand :) Added DSBLIT_SRC_MASK_ALPHA to modulate source alpha channel with alpha channel from source mask. Added DSBLIT_SRC_MASK_COLOR to modulate source color channels with color channels from source mask. Added IDirectFBSurface::SetSourceMask() with a surface argument plus x/y offset and flags. Added DFBSurfaceMaskFlags with DSMF_STENCIL to make x/y offset absolute and always start at a fixed position in the mask, otherwise x/y from the Blit() are added. Implemented interface and core code for the new API, adding some new core functions and flags, mostly state handling, e.g. dfb_state_set_source_mask(). Added DFB_POINT_EQUAL(a,b). Added DFXL_ALL_DRAW and DFXL_ALL_BLIT. Did some cleanup... commit 63a5ee545b5d96616b4cdd1115a35bab28175b4d Author: Denis Oliver Kropp Date: Mon Feb 11 23:14:44 2008 +0100 CLOCK: Moving includes solved a build issue here. commit d16c5807c105abf2dd7f8894b1bdf4f27a86fe87 Author: Denis Oliver Kropp Date: Mon Feb 11 23:12:07 2008 +0100 SH7722: Use RGB16 in LCD buffer again. NV16 did flicker. commit d8114d40845168aa563ad572bbe864c22ea34eb7 Author: Denis Oliver Kropp Date: Mon Feb 11 20:24:44 2008 +0100 UTIL: Added dfb_window_event_type_name(). commit 4f1de5ecd83b25b7cea5d777780b5e33774151c5 Author: Denis Oliver Kropp Date: Sun Feb 10 17:50:03 2008 +0100 GENDOC: Preserve preceding spaces and line breaks in comments, e.g. to use
.

commit 70f7977c9812df8276c520f3dccb80f2e12b0bca
Merge: 35b3ba2... 4d7dec6...
Author: Denis Oliver Kropp 
Date:   Sun Feb 10 13:12:37 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 4d7dec6d68edbeeb085e5c59b716a16677dd640c
Author: Denis Oliver Kropp 
Date:   Sun Feb 10 11:38:46 2008 +0100

    SH7722: Implemented XOR for drawing and blitting. Version 0.8 now.

commit 35b3ba298131e69328240593195757ef4fce8b87
Author: Denis Oliver Kropp 
Date:   Sat Feb 2 17:35:25 2008 +0100

    [DirectLog] The default/fallback instance is no longer allocated dynamically,
    but still initialized on demand.

commit f3e472e86198b5c32d3899f5ec7dbe9df1235f9e
Author: Denis Oliver Kropp 
Date:   Sat Feb 2 17:32:14 2008 +0100

    EVENTBUFFER: Don't allow posting of universal events bigger than DFBEvent.
    
    This avoids crashes when GetEvent() has been called with just a DFBEvent
    as a buffer. Sometimes you don't know.
    
    Added missing newlines to debug messages.

commit 880a47b5212c1f17e796e7b622d8ddf7a7667de5
Author: Ville Syrjala 
Date:   Wed Jan 30 13:22:51 2008 +0200

    fbdev: Don't pan at all when it's not supported by the device

commit 170dd0cfeb4d46dd914a701c1a33e035d7262358
Author: Ville Syrjala 
Date:   Wed Jan 30 22:44:18 2008 +0200

    direct/thread.h needs direct/conf.h

commit ed62a4a5e830dbdabb6004bd91d8d6a244d6b39d
Author: Claudio Ciccani 
Date:   Tue Jan 29 12:35:58 2008 +0100

    TESTS: Reset the fork action to FFA_CLOSE after forking.

commit f576123a36f4a6ef0b8854e0095242db3f23e79a
Author: Claudio Ciccani 
Date:   Tue Jan 29 12:31:18 2008 +0100

    BUILTIN-FUSION: Stop other threads from killing fusion_skirmish_wait() when timeout is expired.

commit 0bba7d29e2a61d475bee10178515c5261c479de8
Author: Claudio Ciccani 
Date:   Tue Jan 29 12:26:51 2008 +0100

    FUSION: Finally solved the master-forks problem.
    
    This is done by adding a reference counter to FusionWorldShared, increased by the master on fork().
    Shared memory gets deinitialized only when the counter reaches 0.

commit ab4530bdbb9a1d75e4cf82940ecb8d1cca4a7e2a
Merge: 1c7c5c6... c80e5c7...
Author: Denis Oliver Kropp 
Date:   Mon Jan 28 22:34:54 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 1c7c5c609b23c53299e1844308a72b2c036aa634
Author: Denis Oliver Kropp 
Date:   Mon Jan 28 22:30:16 2008 +0100

    DAVINCI: Real IRQ based synchronization, optimization for opaque filled rectangles.
    
    Added C64X_FLAG_INTERRUPT to get an interrupt when the command is finished.
    
    Function zero is NOP now, e.g. to generate an interrupt at the end of the queue,
    without setting the interrupt generation bit in already queued commands.
    
    davinci_c64x_wait_low() no longer does a usleep() leading to big performance loss,
    when it's called often with almost nothing on the queue. If synchronization needs
    to be done, it queues a NOP with Interrupt flag and calls C64X_IOCTL_WAIT_LOW to
    wait inside the kernel for the end of the queue, and continue without a huge latency.
    
    Because blended rectangles are much faster, use the blending function on DSP also
    for non-blended filling if possible, i.e. alpha = 0xff.
    
    Updated tests. Cleanups.

commit c80e5c712943c5774396f10479dd046eb64a290d
Author: Claudio Ciccani 
Date:   Mon Jan 28 21:45:53 2008 +0100

    DIRECT-STREAM: Fixed HTTP Content-Type parsing (mimetype might be followed by a charset).

commit e36b34847dbffddb4ec3b796018d707b14801320
Merge: 7e032d9... be5597c...
Author: Denis Oliver Kropp 
Date:   Sat Jan 26 12:53:00 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 7e032d95f71442b42c821e874a26099112f4917b
Author: Denis Oliver Kropp 
Date:   Sat Jan 26 12:29:37 2008 +0100

    MODULES: Use standard syntax for initialization of struct members in headers.
    
    Thanks to Daniel J. Laird!

commit e443b848e3459bb8cfd23f891cf8a51f57f4e1f9
Author: Denis Oliver Kropp 
Date:   Sat Jan 26 12:26:43 2008 +0100

    INPUT: Fix debug message in core.

commit 174f6fa683d4bbb141fd3230723b1df49d845b6a
Author: Denis Oliver Kropp 
Date:   Sat Jan 26 09:02:16 2008 +0100

    More info in configure output.

commit be5597c601f6364c35b7bea554d25560e36353f6
Author: Denis Oliver Kropp 
Date:   Sat Jan 26 07:18:01 2008 +0100

    THREAD: Added options to set default priority, policy and stack size for threads.
    
    Initialize attributes before creating the thread.

commit 4a4c6496109cf818378a2ddc012b1275f13e403d
Author: Denis Oliver Kropp 
Date:   Mon Jan 14 15:12:29 2008 +0100

    CONFIG: Added option "surface-shmpool-size=" to set the size of the shared memory pool
    used for shared system memory surfaces.
    
    [merged from b2007ph1]

commit cc014b4447eafc2505e9b2f55b73b6ad7fb0695a
Author: Denis Oliver Kropp 
Date:   Tue Jan 22 06:57:52 2008 +0100

    IDirectFBVideoProvider: New events and SetAudioDelay().
    
    Thanks to Daniel J Laird!

commit ec7a8323889e06379220d92bbe68a1a51bf6f867
Author: Claudio Ciccani 
Date:   Mon Jan 21 14:41:05 2008 +0100

    BUILTIN-FUSION: Flush pending signals before re-acquiring the lock in fusion_skirmish_wait().

commit 0321bd2d2a81c4a73d22a7cfdcc3daccd888a883
Merge: f763b52... 14b96b6...
Author: Denis Oliver Kropp 
Date:   Fri Jan 18 20:13:00 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit f763b520dc525c1f6b7fa6ddf6a60a5efdb657a8
Author: Denis Oliver Kropp 
Date:   Fri Jan 18 20:12:50 2008 +0100

    IMAGEPROVIDER: Include .

commit 14b96b6a9019a296011db914eac5b666e93dace7
Author: Denis Oliver Kropp 
Date:   Fri Jan 18 12:06:08 2008 +0100

    DAVINCI: Better support for blended FillRectangle(), cleanups...

commit 059e7d5e61a50752d66983b050efb86d280e5d72
Author: Denis Oliver Kropp 
Date:   Wed Jan 16 16:49:58 2008 +0100

    JPEG: Fix broken merge (merged but not ported).
    
    aea0bea25384584c6f30e2967d369be8116a6a5d
        JPEG: Implemented directly loading to NV16 surfaces staying in YCbCr space.

commit 58c282e03f7cd2cdffdad2015bd55812422723d9
Merge: 783ce73... 3fbbd91...
Author: Denis Oliver Kropp 
Date:   Wed Jan 16 16:45:37 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 3fbbd911976ac59ce37c366631bce63d85da6a09
Author: Denis Oliver Kropp 
Date:   Wed Jan 16 12:46:47 2008 +0100

    SURFACE: Support NV16 in dfb_surface_dump() and so IDirectFBSurface::Dump().
    
    [merged from old-surface-core-1.1]

commit aea0bea25384584c6f30e2967d369be8116a6a5d
Author: Denis Oliver Kropp 
Date:   Wed Jan 16 12:45:16 2008 +0100

    JPEG: Implemented directly loading to NV16 surfaces staying in YCbCr space.
    
    No offsets, clipping or scaling supported.
    
    In my test (df_dok --load-image wood_andi.jpg) NV16 had a 34% advantage
    over RGB16 with this change. It has been the other way around before.
    
    [merged from old-surface-core-1.1]

commit 783ce73133ade984952daa169180246cb15dd986
Author: Denis Oliver Kropp 
Date:   Tue Jan 15 23:18:52 2008 +0100

    DAVINCI: StretchBlit() fix, FillRectangle() blended, progress on the caching front
    and more work behind the DVA (DirectFB Accelerated Video) scenes.

commit 9c07e574535db5d86ef11bda0bbe7a18e2a2f306
Author: Denis Oliver Kropp 
Date:   Tue Jan 15 23:04:57 2008 +0100

    CONFIG: Added option "[no-]software-warn" to show warnings when doing/dropping software operations.
    
    No longer print a warning when software fallbacks are disabled. Use the new option!

commit aa1f5ffc61fcb99a2e64ad9750fcc1e666f73595
Author: Denis Oliver Kropp 
Date:   Tue Jan 15 23:03:50 2008 +0100

    Cleanup .gitignore files.

commit 5d6d2a89d90233297a5f3f0b468ea80bd4d86334
Author: Denis Oliver Kropp 
Date:   Tue Jan 15 12:47:55 2008 +0100

    HEADER: Don't define inline conversion functions due to void* arithmetic if C++ is used.

commit 213517ebfa140ac3a2d6ece256c4ec96b3906712
Author: Denis Oliver Kropp 
Date:   Tue Jan 15 12:38:15 2008 +0100

    DFBFX: Fixed copy'n'paste bug.

commit 4d72b6c01ee44dfeb97f0dc0fb99ca3acfe1d4a4
Author: Denis Oliver Kropp 
Date:   Tue Jan 15 12:37:51 2008 +0100

    HEADERS: C++ fixes.

commit 18b15a9003153b4c9e604888f080a8a2cd2df666
Author: Claudio Ciccani 
Date:   Tue Jan 15 08:29:11 2008 +0100

    [builtin-fusion] Cleanup socket directory and shm files on exit.
    Return DFB_FUSION instead of DFB_DEAD if the recipient is unreachable.

commit 3f726505d53b68f4f506fe30b39436b3adac848a
Author: Denis Oliver Kropp 
Date:   Sun Jan 13 14:11:09 2008 +0100

    SH7722: Step back to RGB as default input color space until we can
    switch dynamically and maybe automatically. This means all Inputs
    (3 Layers) and Windows on MultiWindow Layer (4th) can be (A)RGB,
    only Input 1 can be configured to NV12/NV16...
    
    Many cleanups, new macros etc.

commit 6abd2846eebb06a1744fbc9515f95237b8587b04
Author: Denis Oliver Kropp 
Date:   Sun Jan 13 11:02:05 2008 +0100

    Cleaned up LCD Buffer Setup Code. A variable for selecting between RGB16 and NV16 is in the code.
    
    Clear LCD Buffer after allocation with black using memset, one for RGB16 and two for NV16.

commit 890f8bb71477aaba7d2621cdc6605863cb4b3018
Merge: 0eca8a2... bd08a3e...
Author: Denis Oliver Kropp 
Date:   Thu Jan 10 04:25:41 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 0eca8a246c4ed8df3f5b1b94ce2067b559f27eaa
Author: Denis Oliver Kropp 
Date:   Thu Jan 10 04:25:33 2008 +0100

    INPUT: Added dfb_input_event_type_name() and event debug at Core/Input/Evt.

commit ef3dcdaf776d204519dd171adf9292db57da8813
Author: Denis Oliver Kropp 
Date:   Thu Jan 10 04:24:40 2008 +0100

    DEFAULTWM: Combine multiple x and/or y motion events before sending events or updating the cursor.
    
    This is a better way as opposed to have the driver do the work,
    otherwise there was too much cursor acceleration in such a case.

commit d63edceff38d3ba40dad7588faf04b83f689c632
Author: Denis Oliver Kropp 
Date:   Thu Jan 10 04:16:23 2008 +0100

    LINUX-INPUT: Set DIEF_FOLLOW on all events known not to be the last.

commit a37b95f3d6a7dd1c3723244a08e23081f9e818d1
Author: Denis Oliver Kropp 
Date:   Thu Jan 10 04:03:56 2008 +0100

    CORE: A bit late ABI++ after last clipping feature in gfxcard.c.

commit bd08a3e3edb113a9f360e6ac73c432c15d1d92b6
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 23:38:32 2008 +0100

    DAVINCI: Fixed sub directory used by wrapper Makefile.kernel.

commit d699b968396c9c8e494b2cf06eff74718f7abe9f
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 10:54:12 2008 +0100

    CONFIG: Don't enable mouse motion compression at input drivers by default.

commit 47658336e8fb38f259af9d60e110671c07769ed0
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 10:52:36 2008 +0100

    IDirectFBImageProvider: Don't fail if PeekData() is not supported, same behaviour as video providers...
    
    Thanks to Daniel J Laird!
    
    I also added clearing the context struct for safety,
    especially regarding the header data which might not be read in completely.

commit f9dfac2d159229fd57fcebb6ba87b15b79c7c6d8
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 06:17:28 2008 +0100

    DIRECT: Move default log instantiation into DirectLog code.

commit e5d3a344e30efbf5f0fd8ac6741155cdf2bdf788
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 06:15:06 2008 +0100

    DAVINCI: Added experimental ioctl similar to the flip ioctl,
    just testing, could not find the original flip ioctl so far.
    
    Arguments are:
    - byte offset from frame buffer device base OR a physical address
    - optional target sync count when to show the frame
    - returns sync count of actual setting or 0 if pending

commit 54bbd5beb8e324fd9c38357b5f2cc0836404fee3
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 05:22:15 2008 +0100

    DAVINCI: Fixed recently broken blend and new colorize.

commit bc2506ff29f855df43af096758c065c98784f289
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 05:21:36 2008 +0100

    DAVINCI: Minor cleanup.

commit 64ecce22f31da6f88dc140ad6177c7fdc8f6e89e
Author: Denis Oliver Kropp 
Date:   Wed Jan 9 01:30:03 2008 +0100

    DAVINCI: Added colorizing support to blend functions. No additional cycles in DSP :)

commit 484b3777238cf2b49c5d4fc51e66016eba21a5b7
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 12:30:58 2008 +0100

    DIRECT: Fixed missing declaration of debug functions when debug support is enabled, but no debug active.

commit 7a15814e056c9411b7269eb5c6649cd43521b71a
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 07:08:42 2008 +0100

    DAVINCI: Fixed incomplete header file update.

commit cb1a784ac6ce868176a98ec71dc02c27726d6c9b
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 07:01:58 2008 +0100

    DAVINCI: More acceleration (StretchBlit for ARGB, ARGB/RGB32->RGB16 conversion) and fixes.
    
    Added properly clipped (phases!) StretchBlit() for ARGB and RGB32 without any blitting flags.
    
    Added ARGB/RGB32 conversion to RGB16 without any flags (currently writing alpha data to scratch area).
    
    Fixed color calculation for filling/drawing to UYVY.
    
    Moved write back from EngineSync() to EmitCommands() as there's no guarantee for EngineSync() to be called :(
    
    More tests for DSP internal MPEG2 functions.
    
    Only run DSP test code if C64X_TEST is exported.

commit 45b8a0975257cdcee16b92dc161107754b2c02f9
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 06:36:10 2008 +0100

    DAVINCI: Added davinci_c64x_write_back_all() after davinci_c64x_dither_argb() for OSD updates.

commit 88e33559fe7521794f37fabfe1103a23ae6d3ea1
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 06:28:28 2008 +0100

    DIRECT: Fixed 'log-file' and 'log-udp' option.

commit 322f0fe1dd9aeb538e675a4137a5c80e8668fa9c
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 06:20:53 2008 +0100

    FONTS: Added minimum glyph alignment of 8 bytes.

commit fd3a4151a9b9e0ec8fe94d93d06da364e04a3013
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 06:16:24 2008 +0100

    GFXCORE: Added mask of clipped functions to internal CardCapabilities (gfx drivers).
    
    Instead of providing clipping for none or for all functions (CCF_CLIPPING) a driver
    can set individual functions to be hardware clipped, e.g. DFXL_STRETCHBLIT where
    clipping is crucial.

commit 2c7096c217f15136cf9e5e3a4f36709fb1fc55fe
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 06:02:53 2008 +0100

    LAYERS: Only sync with accelerator in dfb_layer_region_flip_update() when DSFLIP_PIPELINE is not set.

commit df15f4ba6ad4d7dd964d61b85ea3b651168ceb1a
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 06:00:39 2008 +0100

    GENERIC: Print blend funcs in warning caused by 'no-software'.

commit 5b2fb854ee2a57408059778d1bdd88e063d085a6
Author: Denis Oliver Kropp 
Date:   Tue Jan 8 05:59:41 2008 +0100

    Added option "-ds" for dumping surfaces.

commit 98f761d339c6cd7e6f8c37e3e32b2f617eec8013
Author: Denis Oliver Kropp 
Date:   Thu Jan 3 21:09:11 2008 +0100

    SH7722: Use VEU for scaling and format conversion of JPEG decoded data (line buffer mode).
    
    Support 4:2:0 and 4:2:2 to
    - NV12
    - NV16
    - RGB16
    - RGB24
    - RGB32
    
    Allocate two line buffers (2560x16 pixels). Let JPU decode into line buffers. Each line
    buffer (16 lines) will be converted by VEU to destination surface. CPU, JPU and VEU can
    work in parallel (loading coded data to reload buffer 0/1, decoding data to line buffer 0/1,
    converting from line buffer 0/1 to destination). Conversion is enable using one the new
    flags: SH7722_JPEG_FLAG_CONVERT.
    
    Less overhead for smaller JPEGs. Only request further reloads if data is available, i.e. if
    any GetData() returns less than SH7722_JPEG_RELOAD_SIZE, clear SH7722_JPEG_FLAG_RELOAD.
    
    Cleanups.

commit 93136ba54a7b7d0ce835526e5e9c5a12e2aaab56
Author: Denis Oliver Kropp 
Date:   Thu Jan 3 20:40:46 2008 +0100

    DEBUG: Cleanup header.

commit 04a16a088f0b8af2754109e9e949359401a83a82
Author: Denis Oliver Kropp 
Date:   Thu Jan 3 11:01:39 2008 +0100

    MPEG2: Removed MPEG2 I-Frame Imageprovider. Patch by Daniel J Laird - daniel.j.laird _ nxp.c0m

commit 32673352738ecfb030181fc689e8a537a205bd29
Author: Denis Oliver Kropp 
Date:   Thu Jan 3 10:51:13 2008 +0100

    ignore

commit c23c88c7f76e9f7a2ffa12a0d87979f8bea8a8b7
Merge: ff62e5a... 0825352...
Author: Denis Oliver Kropp 
Date:   Thu Jan 3 10:04:33 2008 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit ff62e5a349bd043152ff014f767456be7fc8dfce
Author: Denis Oliver Kropp 
Date:   Thu Jan 3 10:04:23 2008 +0100

    SH//22: Kernel based state machine for less overhead and latencies.
    
    After filling the first reload buffer, execution enters the kernel
    which starts the decoder and only returns to user space for
      - end of decoding
      - error in decoding
      - less than two buffers loaded or in use (reload)

commit 0825352a4de6e3d8abaf41a6105ceaa5df43b518
Author: Claudio Ciccani 
Date:   Wed Jan 2 14:20:21 2008 +0100

    [builtin-fusion] Replaced usage of getpid() by direct_gettid().

commit 561c4a9099115bdf921c2b5ea7d95e8c4cb45fa7
Author: Claudio Ciccani 
Date:   Wed Jan 2 12:49:19 2008 +0100

    Handle option [no-]thread_block_signals in direct_config_set().

commit a5d3346339b9fe3197fb216447e42c87b7fe19f8
Author: Claudio Ciccani 
Date:   Wed Jan 2 11:45:14 2008 +0100

    Check whether mount point is writable in find_tmpfs().

commit 7818ff8c8b5578de135c61389c43f87ff7e1747b
Author: Claudio Ciccani 
Date:   Wed Jan 2 11:37:35 2008 +0100

    Include directfb_util.h (defines dfb_pixelformat_name()).

commit 3a36cc5ae838fb012a0d63943f92dde5244359b6
Author: Denis Oliver Kropp 
Date:   Fri Dec 28 23:27:51 2007 +0100

    fbdev: Fixed missing include.

commit 69f61b2cc7b4b22f490895953a8b58454398096c
Author: Denis Oliver Kropp 
Date:   Fri Dec 28 23:25:48 2007 +0100

    IDirectFBInputBuffer: I thought I built this code already...

commit 2a41f52a00240644a49f65dfb6f7e02b21210c4e
Author: Denis Oliver Kropp 
Date:   Fri Dec 28 23:25:14 2007 +0100

    libdirect: Fixed warnings.

commit 19f3486f6b14a573dc6c9d1ffd43f5edb270ddbd
Author: Denis Oliver Kropp 
Date:   Wed Dec 26 04:08:07 2007 +0100

    SH7722: JPEG enhancements
    
    - Decode header in Construct()
    - Utilize reload buffers properly (fill one while hw reads the other)
    - Support NV12 and NV16 (4:2:0 and 4:2:2 images)
    - Added locking for JPU usage

commit 8f1ac453e7bc13b78ad8ac87a3ed6e680c6954f8
Author: Denis Oliver Kropp 
Date:   Wed Dec 26 04:00:57 2007 +0100

    DEBUG: Missed one line in last commit (adding debug messages).

commit f23610b51e7d099bd129afa4a9b802133316dc99
Author: Denis Oliver Kropp 
Date:   Mon Dec 24 04:28:23 2007 +0100

    DEBUG: Further cleanup of debugging code. New minimal debug mode
    to support D_DEBUG_AT, D_ASSERT and D_ASSUME when debug support is
    disabled, but DIRECT_ENABLE_DEBUG or DIRECT_FORCE_DEBUG have been
    defined. No domain filters, just formatted output (all or nothing).

commit f3fdc7435788346515d993651abc3640d05d4db6
Merge: 75dd9d7... 3afd652...
Author: Denis Oliver Kropp 
Date:   Mon Dec 24 02:45:51 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 75dd9d767f1e0a0317c251aafe257a00e58ee697
Author: Denis Oliver Kropp 
Date:   Mon Dec 24 02:45:29 2007 +0100

    LINUX-INPUT: Fix redefinitions by moving up kernel headers.

commit 3afd652d8be162b15ec2fbfd6921af95f48de763
Author: Denis Oliver Kropp 
Date:   Sun Dec 23 16:11:30 2007 +0100

    SH7722: Experimental JPEG decoding (first working version) and other enhancements and fixes.
    
    Changed the LCD buffer from RGB16 to NV16 to improve image quality with same amount of data.
    BEU generates YCbCr 4:2:2 content, LCDC converts and sends RGB18 data to the display (at least on AP325).
    
    Switched BEU to YCbCr input by default, thus allowing only the first layer to be (A)RGB.
    Implemented LUT8 support for the third layer. Added lock for BEU code called for different layers.
    Automatic parent input system selection and other fixes, allowing to run df_fire on third and df_dok
    with alpha channel on first layer.
    
    Fixed byte swapping issues, e.g. no more swapping between BEU and LCDC, correct swapping of BEU input
    depending on number of bytes per pixel.
    
    Added experimental first working version of hardware JPEG decoding:
    
         /*
          * FIRST WORKING VERSION [tm]
          *
          * Almost user space based only. To NOT USE usleep() & friends and loose throughput (sleep) or
          * CPU resources (busyloop), I added an ioctl that waits for the next interrupt to occur.
          *
          * With a 128x128 image (23k coded data) being loaded in a loop, this temporary mechanism is
          * achieving almost the same throughput as a busyloop, but with only half the CPU load.
          *
          * TODO
          * - prefetch image info with a state machine used by Construct(), GetSurfaceDescription() and RenderTo().
          * - utilize both reload buffers properly (pipelining)
          * - implement clipping, scaling and format conversion via VEU (needs line buffer mode)
          * - add locking and/or move more code into the kernel module (multiple contexts with queueing?)
          */
    
    Kernel Module
    - Added SH7722GFX_IOCTL_WAIT_JPEG to wait for the next interrupt.
    - Added JPU IRQ handler: save interrupt status in shared memory, clear interrupt and wake up waiter.

commit 65040dc9d34566454f94be4d1b1f47f57dd9a7c0
Merge: 1c82251... 5a3d3e3...
Author: Denis Oliver Kropp 
Date:   Sun Dec 23 13:22:13 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 1c82251e77e13038ee4c4c94401efef8361165e9
Author: Denis Oliver Kropp 
Date:   Sun Dec 23 13:22:03 2007 +0100

    DEBUG: Added "[no-]fatal-break", d_debug_at() and direct_debug_at_always().
    
    The new runtime option was added to enable/disable the trap in D_BREAK().
    
    Even without debug support (but text) in libdirect, changing one D_DEBUG_AT()
    to d_debug_at() - which is a single shortcut in my SlickEdit - will bypass the
    check for the domain or any debug macros and directly print out the message.
    
    The new function direct_debug_at_always() is called by the new d_debug_at() macro
    unless text support is completely disabled, e.g. configured with "--disable-text".
    
    Added static inline debug_domain_vprintf() to clean up debug message printing code
    a bit and optimize it, saving two intermediate printfs, one for "%s:" (domain name)
    and the other for the final format string.
    
    Domain less D_DEBUG() messages are using the same format/function now (domain "- - ").

commit 5a3d3e31a74db36395cdeba13a4fed83198fb1f5
Author: Denis Oliver Kropp 
Date:   Sun Dec 23 06:58:48 2007 +0100

    CONFIGURE: Show $SYSCONFDIR in summary.

commit 154f272eb2173a41f5a2289e3e92c019ac47a6d9
Author: Denis Oliver Kropp 
Date:   Sun Dec 23 06:58:10 2007 +0100

    DIRECT: Added MODULEDIR to direct.pc, until this becomes configurable for each package.

commit 81316724cab757636ac25361ceba312f86cc733f
Author: Marc Kleine-Budde 
Date:   Fri Dec 21 09:50:08 2007 +0100

    add AC_SUBST(LD) to configure.in
    
    $(LD) is used in Makefile.am, but when using libtool $(LD) sems not to
    substituted automatically. This patch adds the missing AC_SUBST().
    
    Signed-off-by: Marc Kleine-Budde 
    Signed-off-by: Denis Oliver Kropp 

commit f683452e5227b1cd4934b700b0a79c24d71060f6
Author: Denis Oliver Kropp 
Date:   Mon Dec 17 18:13:14 2007 +0100

    Fix unconditional use of SA_SIGINFO, thanks to Samuel Thibault!

commit 5551b51ff8dfb0b4f4c5cf287a34ec20d5247b1b
Author: Denis Oliver Kropp 
Date:   Mon Dec 17 18:10:02 2007 +0100

    MAKE: Clean autogenerated header files on distclean, thanks to Tobias Grimm (now really).

commit 60e5be4e3122cdc219898caaac92d61be8806e60
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 19:01:54 2007 +0100

    BUILD-OPTIONS: Set smooth scaling to 'no' if software rendering already is.

commit dbb7b400a84b1579a9e6193eed59f3a5bfbaedfe
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 18:56:20 2007 +0100

    BUILD-OPTIONS: Added "--without-software" to save 100k+ binary size if really not needed.

commit d30a1839d517612fdfbd806f206517375193a2ff
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 18:33:51 2007 +0100

    DIRECT: Fixed warnings for building with DIRECT_BUILD_TEXT set to 0.

commit 3e6f6e2be975a9abee6d2d9321917192fbcb13b0
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 16:38:49 2007 +0100

    Generated ChangeLog for 1.1.1.

commit c3a7068532972d18feaf0efd82aef2db04bd96d7
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 16:31:05 2007 +0100

    Updated NEWS for 1.1.1.

commit d361c4dc7adb7b255655d31574f282348695d65d
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 16:25:15 2007 +0100

    Do not use PAGE_SIZE at all on Linux, thanks to Guillem Jover.

commit a206e44a9a7067f2deec0e09323b4176f51268b4
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 16:24:52 2007 +0100

    Use  instead of __, thanks to Guillem Jover.

commit a27f1df63f3718d3ebcc2ede5cbf10b758a2ebea
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 16:24:16 2007 +0100

    Add missing libsysfs when statically linking, thanks to Guillem Jover.

commit 793e98018bb03505a74b906830e4e375fabc63de
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 16:23:52 2007 +0100

    Do not leak private labraries for dynamic, thanks to Guillem Jover.

commit e6490162e1938988e4149b2a4e2946cbc3eb0b6d
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 14:21:27 2007 +0100

    RUNTIME-OPTIONS: Added "[no-]autoflip-window" to automatically flip non-flipping windowed primary surfaces.
    
    Previously, the default was to automatically Flip() in a thread. Now it's not.

commit 9a8e201d180d2b170e1d3b01180b538aac796d4d
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 14:08:51 2007 +0100

    BUILD-OPTIONS: Added "--with-smooth-scaling", turned off by default to avoid 100k+ binary size increase.

commit 220dc9c20ed8aad4437b14df62ee9cc518bd9621
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 13:47:37 2007 +0100

    SOFTWARE-RENDER: Added missing header files in Makefile.am.

commit 004fde4d425b936a8496be90f263f6156c1e4103
Author: Denis Oliver Kropp 
Date:   Sat Dec 15 13:47:06 2007 +0100

    DAVINCI: Added missing kernel module Makefiles.

commit 5e3e18881b83c0ded4296523eb585d02928a33fb
Author: Denis Oliver Kropp 
Date:   Thu Nov 29 13:53:34 2007 +0100

    IDIRECTFBDISPLAYLAYER: Pass down resource id (DWDESC_RESOURCE_ID) in CreateWindow().

commit 33f6701408c0790cd1341b5ee5a664d438a63dde
Author: Claudio Ciccani 
Date:   Tue Dec 11 19:36:29 2007 +0100

    Optimized pixel premultiplication.

commit 6cffc100034190a068b4fa2efb67ab96e01fbdfd
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 22:17:18 2007 +0100

    SURFACE-CORE: Added CSALF_VOLATILE and CSALF_PREALLOCATED. Reimplemented "thrifty-surface-buffers".
    
    The "thrifty-surface-buffers" option is implemented by iterating through all allocations at the end of
    an update_allocation() and deallocate all other allocations, unless they have the CSALF_PREALLOCATED
    flag. In the latter case it would not be a benefit, but the disadvantage of losing an allocation that
    is still up to date and would probably be faster (CPU read) than others.
    => The 'preallocated' surface pool sets CSALF_PREALLOCATED upon allocation.
    
    Another flag CSALF_VOLATILE has been introduced. In case of a write access to one allocation, any other
    allocation is deallocated if it has the flag. This is independent of the "thrifty-surface-buffers" option.
    => The 'local', 'shared' and 'preallocated' surface pools set CSALF_VOLATILE upon allocation.
    
    That means the preallocated surface buffers are kept as long as they're still up to date with other
    allocations (copies of them), e.g. an image resource loaded into accelerator memory, never written to,
    but read from by GPU as well as CPU. As soon as one of the allocations has been written to, the
    preallocated buffer becomes useless, if we cannot write back to it (which we don't as there's not yet
    a way to specify read/write permissions when creating preallocated surfaces).

commit f33f1333a34f92faeadbd1c604506de81d499edd
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 15:02:38 2007 +0100

    DAVINCI: Use D_PERROR() if FBIO_GET_TIMING fails.

commit 0c40638344664973b66e1760edede0a812fd796b
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 14:55:56 2007 +0100

    DAVINCI: Revert header changes made to fix build on newer kernels.
    
    Instead workaround it without changing the resulting ioctl number.

commit b037a96795eb528ac451047eae2cd39ff295b758
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 10:27:57 2007 +0100

    SH7722: Fixed debug build.

commit a58ecc1c555a181957af2bc78a37f0b3da3b541c
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 10:27:32 2007 +0100

    UNICHROME: Fixed a warning.

commit 443a095ed4ab72aa1bf735b28e2e086312f279bc
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 10:27:01 2007 +0100

    DAVINCI: Build fixes.

commit b1b8bed6448c8d06d819a2319e7caf566cd5a766
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 10:15:52 2007 +0100

    DAVINCI: Removed junk from Makefile.

commit 89d526030502850095cdb611b43ce1011a15413e
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 10:06:14 2007 +0100

    DAVINCI: Hardware acceleration using the DSP with a special firmware and kernel module.
    
    The DSP runs an ~8k firmware (in L1 cache) and provides different functions. These
    are called by writing a command packet into the 512k command queue in memory. Each
    function can have up to seven 32 bit arguments, up to eight flags and a sub function
    index of 8 bit.
    
    There's a low and high priority queue, but only one is implemented at the moment. The
    idea is that the high priority queue can preempt the low priority queue at any time when
    a command is added. The low priority queue can only continue when the high priority queue
    is empty.
    
    There are no interrupts from DSP nor to it so far. Waiting for a free queue entry or for
    an empty queue uses usleep() at the moment, but it's working quite well. An interrupt handler
    and a few ioctls() should be added.
    
    Text rendering is just white at the moment. Blended rectangle filling will be implemented.
    
    Graphics Layer updates from ARGB to RGB16/A3 (dithered) planes are done by the DSP, very fast.
    
    We're mainly working on MPEG2 at the moment...
    
    Benchmarking with 256x256 in 16bit mode... (16bit)
    
    Fill Rectangle                                20.936 secs (*  59.788 MPixel/sec) [  7.4%]
    Fill Rectangles [10]                          23.168 secs (*  61.383 MPixel/sec) [  0.3%]
    Fill Spans                                     3.136 secs (*  45.975 MPixel/sec) [  1.2%]
    Blit                                          25.328 secs (*  48.127 MPixel/sec) [  9.0%]
    Blit colorkeyed                               25.542 secs (*  47.724 MPixel/sec) [  8.8%]
    
    Benchmarking with 256x256 in 24bit mode... (32bit)
    
    Anti-aliased Text                              3.020 secs (* 138.278 KChars/sec) [ 99.3%]
    Anti-aliased Text (blend)                      3.040 secs (* 139.736 KChars/sec) [ 99.3%]
    Fill Rectangle                                31.360 secs (*  37.825 MPixel/sec) [  4.7%]
    Fill Rectangles [10]                          32.120 secs (*  37.950 MPixel/sec) [  0.1%]
    Fill Spans                                     3.270 secs (*  32.066 MPixel/sec) [  0.9%]
    Blit                                          39.580 secs (*  29.307 MPixel/sec) [  5.3%]
    Blit colorkeyed                               35.560 secs (*  32.989 MPixel/sec) [  6.0%]
    Blit with colorizing                          39.600 secs (*  29.292 MPixel/sec) [  5.7%]
    Blit from 32bit (blend)                       36.960 secs (*  31.562 MPixel/sec) [  6.0%]
    Blit from 32bit (blend) with colorizing       36.960 secs (*  31.562 MPixel/sec) [  6.3%]

commit 6f65946fe5387834ec996e8ba7426237337bc1cd
Merge: b840827... c426dac...
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 06:12:25 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit b840827a900828b5c17d66ca279da0d3f319ef20
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 06:11:02 2007 +0100

    FUSION-SHM: Added "ramfs" to possible types during mount point probing.

commit 83ae918134e0c4a696f6a43f2d3903da5caff42b
Author: Denis Oliver Kropp 
Date:   Sun Dec 9 06:08:41 2007 +0100

    DEBUG: Added checks if debug support is disabled.
    
    If DIRECT_ENABLE_DEBUG is defined, silently undefine it.
    
    If DIRECT_FORCE_DEBUG is define, show a warning and undefine it.

commit c426dace42831c7a2fb96801d00e86fcd2d8223b
Author: Denis Oliver Kropp 
Date:   Thu Dec 6 16:53:39 2007 +0100

    GRAPHICS: Skip prechecking clip in FillRectangles() if DSRO_MATRIX is used.
    
    Other functions are also affected, but not fixed.

commit 32ed166b03bf2d0dc33fb65562788b1e3e22eceb
Author: Denis Oliver Kropp 
Date:   Thu Dec 6 14:05:28 2007 +0100

    SH7722: Implemented DSRO_ANTIALIAS for all drawing operations.
    
    The hardware provides "anti-aliased" lines by drawing a line
    with doubled pixel width (minor axis). This should be drawn with
    a transparency factor. Finally the original line is drawn on top
    of this.
    
    For filled rectangles and triangles, only the double width line is
    drawn and then the shape is filled.
    
    Fixed off-by-one in rectangle outlines.

commit 992ed320a16aa7c804873aab95a9acdf0617849c
Author: Denis Oliver Kropp 
Date:   Thu Dec 6 13:30:08 2007 +0100

    API: Added DSRO_ANTIALIAS to enable anti-aliasing for edges, lines...

commit 9285afb3671ffab0048fdf2308be5db08621a95b
Author: Denis Oliver Kropp 
Date:   Thu Dec 6 13:29:18 2007 +0100

    FONT: Fixed "no-font-premult" option.

commit 35ccb45aecdebd6b7f3d5993967fa38777a561e0
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 16:31:24 2007 +0100

    SH7722: Need to transform coordinates in DrawRectangle() and DrawLine() in software.

commit 4814087e8b95e4710c031a3b049c1af80a5d671e
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 16:30:20 2007 +0100

    IDirectFBSurface: Changed matrix entities from u32 to s32.

commit 60e32cc311099ddc56b75ddc16cd7e170de17948
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 15:25:40 2007 +0100

    IDirectFBSurface: Set render options temporarily to DSRO_NONE in Clear().

commit 8e283719a15f726558df0c8a962f7f77b4ae7075
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 13:46:19 2007 +0100

    FUSION: Fixed warning about unused pGroupInfo.

commit f0b84341906c5033c1b33c3311a39a972bdba4f4
Merge: f00efe8... 127ec41...
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 13:34:54 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit f00efe82b5f1c01f9b27201432835093651d824a
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 13:34:47 2007 +0100

    SH7722: Implemented 3x2 transformation for drawing and blitting.
    
    Use hardware 3x2 matrix to implement DSRO_MATRIX.
    
    Cleanups. Flush cache in ISR, not every EmitCommands().

commit 07208f80501755476cd50e2b1d31da6bc82eff7c
Author: Denis Oliver Kropp 
Date:   Wed Dec 5 13:32:27 2007 +0100

    IDirectFBSurface: Added 3x2 transformation for all drawing and blitting.
    
    Added render option DSRO_MATRIX and IDirectFBSurface::SetMatrix().
    
    The matrix consists of 3x2 fixed point 16.16 values.
    The order in the array is from left to right and from top to bottom.
    
    All drawing and blitting will be transformed:
    
    X' = X * v0 + Y * v1 + v2
    Y' = X * v3 + Y * v4 + v5

commit 127ec410b49e105163fca186e3335c8d9fe2490d
Author: Claudio Ciccani 
Date:   Sun Dec 2 14:26:06 2007 +0100

    BULTIN-FUSION: chown() the sockets directory according to "shmfile-group".

commit 9347510b5210fad8d9eb3c5bef2393257a6882ed
Author: Denis Oliver Kropp 
Date:   Sun Dec 2 09:13:01 2007 +0100

    SOFTWARE-RENDER: Fast RGB32/ARGB to RGB16 conversion (little endian).

commit 130dbc483c09c858eb27988fa9a50720810336ae
Author: Denis Oliver Kropp 
Date:   Sun Dec 2 08:59:25 2007 +0100

    TSLIB-INPUT: Check the device in $TSLIB_TSDEVICE when guessing (no option given).

commit 51a848f4bcbb454b0579758d26719f38791f7d81
Author: Denis Oliver Kropp 
Date:   Sun Dec 2 08:57:29 2007 +0100

    LINUX-INPUT: Ignore input devices matching the TSLIB_TSDEVICE environment variable.

commit 2b5aad59838538682ab06dc405ed37a49d386e59
Merge: 5241ef1... 63a2d8e...
Author: Denis Oliver Kropp 
Date:   Sun Dec 2 08:25:45 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 5241ef1027caac77535253f72bdb70a2c4add454
Author: Denis Oliver Kropp 
Date:   Sun Dec 2 08:25:14 2007 +0100

    WM-DEFAULT: Added WM key combo - to redraw the whole window stack.

commit 63a2d8e8363adc7acc8dd78e9b9e784652dbb421
Author: Claudio Ciccani 
Date:   Sat Dec 1 15:56:26 2007 +0100

    [Builting Fusion]
    Moved socket directory from "/tmp/fusion.#" to "/tmp/.fusion-#".
    Change socket ownership according to shmfile group.
    Speed up fusion_call_execute(FCEF_ONEWAY) by not creating a new socket.

commit fb5a9c5cac676c51c04bc340c7921ef17fa8d5f4
Author: Claudio Ciccani 
Date:   Sat Dec 1 15:52:18 2007 +0100

    (Pre)Parse shmfile group in fusion_config_set().

commit 9fa548c28b76a667c3425f603695e365f92b8483
Author: Claudio Ciccani 
Date:   Sat Dec 1 12:37:29 2007 +0100

    [Builtin Fusion]
    Enable sleeping in fusion_property_lease()/purchase().

commit f50e96923f50c9430d33e8e3d2b979b74803d99c
Author: Claudio Ciccani 
Date:   Sat Dec 1 12:36:10 2007 +0100

    [Builtin Fusion]
    Fail in fusion_skirmish_notify() if playback was destroyed.
    Sleep for at least 10ms in fusion_skirmish_prevail().

commit b5898ff1d5c8d01ab6fd8e8872d4edc9d98c9685
Author: Denis Oliver Kropp 
Date:   Fri Nov 30 15:10:03 2007 +0100

    DIRECT: Use direct_log_lock()/unlock() to ensure stack traces are one contiguous block.

commit 084bc400befc0c03a115deaca1e196b25217c4f5
Author: Denis Oliver Kropp 
Date:   Fri Nov 30 15:08:34 2007 +0100

    DIRECT: Added direct_log_lock()/unlock() for ensuring multiple prints are not mixed with others.

commit 93befe97085f492be31534e019f4417863755334
Author: Denis Oliver Kropp 
Date:   Fri Nov 30 15:07:34 2007 +0100

    DIRECT: Create default log object.

commit 96869c86a02a9cf99a4ac5170a4c49fd316eab25
Author: Denis Oliver Kropp 
Date:   Wed Nov 21 10:30:33 2007 +0100

    SH7722: Added missing Makefile and .gitignore file.

commit 94bd42fab1a1c3dd30df8bd9fb7567f9d9b731e4
Author: Denis Oliver Kropp 
Date:   Wed Nov 21 02:56:10 2007 +0100

    Fixed warnings and added more safety in generic rasterizer about blend functions being array indices.

commit 0d04944ae20ebed62ca0fa3b53b316e64c83581e
Merge: 5bb065a... 0b83ac2...
Author: Denis Oliver Kropp 
Date:   Wed Nov 21 02:22:25 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 5bb065a3469a4a2479d35f54a6dd5ae3605e29e0
Author: Denis Oliver Kropp 
Date:   Wed Nov 21 02:22:14 2007 +0100

    API: Added DSBF_UNKNOWN for mknames.sh's sake.

commit afb035127e738f3cb94cab19485d32a9239b702a
Author: Denis Oliver Kropp 
Date:   Wed Nov 21 02:19:49 2007 +0100

    MKNAMES: Reverted change that made mknames.sh output '0' instead of the identifier for it.
    
    C++ doesn't like it and it's too bad for working around enums without a null identifier.

commit 0b83ac212dd46f69fd75adf180e951695a61d07c
Author: Claudio Ciccani 
Date:   Tue Nov 20 19:05:49 2007 +0100

    [Builtin Fusion]
    Implemented fusion_reactor_set_dispatch_callback().

commit 3a86b35b9222eb987744a5737366b9ecc430c138
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 12:44:45 2007 +0100

    CONF: Fixed warning in config_values_parse(), check for D_STRDUP() result with D_OOM() in case of failure.

commit a00d8d052a042c0abdce48d3d86444bcdbe039d6
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 03:52:04 2007 +0100

    GFXCORE: When resetting the 'checked' flags also reset the same in 'accel' flags.

commit 7d693457a0019c1d85ca2d774502a1f20495408f
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 02:06:54 2007 +0100

    MKNAMES: Made it output '0' instead of an identifier for termination.

commit 9b2a22be5939de079fc6a216b4cf5c8321abc8dc
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 02:05:03 2007 +0100

    DFBFX: Added more options: source, destination, color, srcblend, dstblend.

commit c8a35841d38b650bb999973b4621365bb86b6356
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 02:03:57 2007 +0100

    MKNAMES: Moved mknames.sh to the 'tools' top level sub directory.
    
    Made it output '0' instead of an identifier for termination.
    
    Added DFBSurfaceBlendFlags.

commit eff7d38d602c8b6a518b20b0a40d72586b521837
Merge: abe3853... 77e2a1c...
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 00:01:16 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit abe3853c06859b53185df2fe54f871c52024687c
Author: Denis Oliver Kropp 
Date:   Tue Nov 20 00:01:09 2007 +0100

    Fixed warning.

commit 77e2a1cabccad357cb3b3be58efe37e244137b72
Merge: 0de9e90... beba5ac...
Author: Claudio Ciccani 
Date:   Mon Nov 19 16:01:15 2007 +0100

    Merge branch 'master' of git+ssh://directfb.org/git/directfb/core/DirectFB

commit 0de9e90ad729bef0141e4d7e4ecea36500b67c2c
Author: Claudio Ciccani 
Date:   Mon Nov 19 15:59:41 2007 +0100

    [Builtin Fusion]
    Honor FCEF_ONEWAY in fusion_call_execute().
    
    Execute ref watcher with the FCEF_ONEWAY flag.
    
    Avoid blocking in _fusion_check_locals():
    instead of removing dead references while iterating the list of fusionees,
    build a local list of references that must be removed and process them later.

commit beba5ac47474e45b821362444fb31978a7183e17
Merge: 51a97f4... d7b6ca4...
Author: Denis Oliver Kropp 
Date:   Mon Nov 19 15:51:15 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 51a97f42b4a0c3c62a7fd064c02aca0c5d3e4c35
Author: Denis Oliver Kropp 
Date:   Mon Nov 19 15:50:45 2007 +0100

    DIRECT: Call DEFINE_INTERFACE() for IAny properly, i.e. with a comma at least.

commit d7b6ca4e98a40932517e6a166bb2f4d5c28ecf79
Author: Denis Oliver Kropp 
Date:   Sun Nov 18 11:17:34 2007 +0100

    DFBFX: Provide two example states, the new premultiplied font rendering and the old broken (for dstalpha) one.

commit ea07fe7128ee5f482e8705c7c19c078d6abf068f
Author: Denis Oliver Kropp 
Date:   Sun Nov 18 02:42:31 2007 +0100

    fx is replaced by dfbfx and gets installed. Documented code. Ongoing command line parsing...

commit 289295be51a0077e11e7ef0e72fe650363395df9
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 21:18:59 2007 +0100

    VERSION: 1.1.1 (same binary age)

commit 409d3389070a147f06b4cc3159724161e718e2ed
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 20:58:47 2007 +0100

    RC: Moved new 'linux_input_grab' member in the DFBConfig structure to the end
    for binary compatibility with DirectFB 1.1.0 release.

commit 6f9aec1af1844463fc64193330de3b6c246874d2
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 19:49:11 2007 +0100

    Fixed type issues (at least with 2.6.24-rc3) by moving  further up.

commit 975798d0b0977408000c42fc8892b8294835f344
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 19:41:19 2007 +0100

    Output "Fusion Kernel Device" flag in configure output.
    
    Also print a warning at the end if builtin Fusion is used.

commit 0ee6ee9619117e87f278d18078c51cdb20f5db8a
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 17:26:21 2007 +0100

    Fixed warnings.

commit f793e0660c552e0eea66d05507b5754749af5699
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 15:36:57 2007 +0100

    Fix format issues because of varying u64 definitions, use "%llu" again and cast to unsigned long long.

commit 34406baa244ed31c37ce3bbd8b96832f2eba3e05
Author: Denis Oliver Kropp 
Date:   Thu Nov 15 18:01:56 2007 +0100

    Fixed warnings.

commit fc2a43d08af2352c2a7e1cd18e486229139ee55e
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 15:25:13 2007 +0100

    Added "-dl" or "--dumplayer" for dumping the front buffer of each active contexts' primary region.

commit df4b2cbde8a6d2d76f3b2be1eb7cdcd74f72fbc6
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 15:09:19 2007 +0100

    Added convenience function dfb_surface_dump_buffer().

commit 6c44ce8cf2aa9292972cd8ee8c485082e227576e
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 09:13:40 2007 +0100

    Added "[no-]thread-block-signals" and cleaned up config code.
    
    Moved direct and fusion option parsing into direct_config_set() and fusion_config_set().
    
    Call these from higher level config code.
    
    Added direct_config_usage and fusion_config_usage and use it the same way.

commit af67337836291ae86a98e3c916de51b45ecb4d0a
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 09:11:14 2007 +0100

    Fixed debug message.

commit 8b7d1920aa554559299847e58a8812f78dfc6f68
Merge: 4cc82ba... c678f5c...
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 09:09:56 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 4cc82baddbc3a9849c2ff6c4979a65bcfb6ba96b
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 08:22:55 2007 +0100

    Fixed GetFramebufferOffset() by adding CSAF_GPU_READ when Lock() is called on a DSCAPS_VIDEOONLY surface.

commit c678f5c042b60b2dd2e00fe0945711ade703451a
Author: Denis Oliver Kropp 
Date:   Thu Oct 18 15:57:41 2007 +0200

    Added debug and error messsages to dfb_layer_context_set_configuration().

commit ba7c645417dd2d7c72a87f18dff2509031ab99ef
Author: Denis Oliver Kropp 
Date:   Thu Nov 15 22:13:39 2007 +0100

    Added fusion_reactor_set_name() to change the name of a reactor after its creation.

commit 8427e5add8addf5a66098fbd667f70031c434670
Author: Denis Oliver Kropp 
Date:   Thu Nov 15 18:57:36 2007 +0100

    Added "Core/GraphicsOps" debug domain with a message per graphics operation.

commit 6eef50dacf42907e53e7b236ce4393753dd27a74
Author: Denis Oliver Kropp 
Date:   Thu Nov 15 18:09:49 2007 +0100

    When switching to an indexed layer format, use dfb_surface_init_palette() if no palette exists already.

commit f05de1d313d84e5f1e989b30c4e8605e79b2a0b2
Author: Denis Oliver Kropp 
Date:   Thu Nov 15 17:17:25 2007 +0100

    Moved surface palette creation from dfb_surface_create() into new dfb_surface_init_palette().

commit 237efd2ec9cd30fada65d9437d05f2ce121a313b
Author: Denis Oliver Kropp 
Date:   Thu Oct 18 15:57:41 2007 +0200

    Added debug and error messsages to dfb_layer_context_set_configuration().

commit 01536af1b96f7212d4c55566caea1c9c8984ba68
Merge: 619d813... 7fb1cb2...
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 08:18:30 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 619d813b9a6568e027140e20306f06aac221d87a
Author: Denis Oliver Kropp 
Date:   Sat Nov 17 08:16:24 2007 +0100

    Use SO_REUSEADDR in case of multicast.

commit 7fb1cb229068b9ebf9e9b5f7bb5ff68b0dbc9261
Author: Claudio Ciccani 
Date:   Thu Nov 15 10:46:03 2007 +0100

    Added new URI fd:/.
    Used to create a DirectStream from an already opened file descriptor.

commit d5c44b9f46505792d65cafc91479662248b3dcd6
Author: Claudio Ciccani 
Date:   Wed Nov 7 14:57:52 2007 +0100

    [Builtin Fusion]
    Check for dead property purchaser, too.

commit 428a5be29271ba1098c5d2253225c7306d0f999a
Author: Claudio Ciccani 
Date:   Wed Nov 7 14:56:26 2007 +0100

    [Builtin Fusion]
    In fusion_ref_zerolock(): check local references before entering the loop.

commit 1b2b598b8c6c8d45d01618ce4ca85583268694b5
Author: Claudio Ciccani 
Date:   Tue Nov 6 10:13:28 2007 +0100

    Sleep for 10 usec in WaitVSync loop.

commit f5bbbf1e7c3ec13d9eb24e0fb50ede1415f45ea1
Author: Claudio Ciccani 
Date:   Mon Nov 5 12:26:57 2007 +0100

    [Builtin Fusion]
    Use fusion_skirmish_wait() instead of usleep() in fusion_ref_zerolock().

commit e1805a4018dccbdc5749c867fa962e14e3449e84
Author: Claudio Ciccani 
Date:   Sun Nov 4 12:55:03 2007 +0100

    Added a couple of videoprovider events:
     - DVPET_FINISHED, sent when playback is finished
     - DVPET_SURFACECHANGE, sent when size/format change

commit b84e090292684cf1f9d60ea35d0c506c8cb9ce2c
Author: Denis Oliver Kropp 
Date:   Fri Nov 2 14:40:52 2007 +0100

    Added missing DSCCAPS_VSYNC flag to indicate support for WaitForSync().

commit 4fcb711d661e3d9b8541b08eb3c043c2df759c60
Merge: ef9942b... 2022577...
Author: Denis Oliver Kropp 
Date:   Fri Nov 2 14:10:20 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit ef9942b04dd30e05683e106095def32087699a97
Author: Denis Oliver Kropp 
Date:   Fri Nov 2 14:06:47 2007 +0100

    Added patch for davincifb to support triple buffering on OSD.

commit 20225771508792b4511550d83e3af4ad9c697309
Author: Denis Oliver Kropp 
Date:   Fri Nov 2 13:33:21 2007 +0100

    Set driver vendor for TI Davinci.

commit 5b2d53ba81a83ab7d2d89d29aec251622ed6f9b8
Author: Denis Oliver Kropp 
Date:   Fri Nov 2 12:25:28 2007 +0100

    Added TI Davinci driver.
    
    Supports OSD and Video with positioning, color key, opacity and alpha channel.
    
    The driver uses the devmem system and opens all frame buffer devices itself.
    This is required for extended ioctls like setting the OSD position, but also to
    support alpha channels which are stored in a different frame buffer device. In
    case of ARGB for the OSD, the alpha channel (3 bit!) is dithered during conversion.
    
    Implemented surface pools for OSD and Video layer. This enables direct usage
    of the frame buffers in case of RGB16 for OSD and UYVY for Video.

commit 8528a2076e3c3639a025f1a02fb2ca4aa107b30f
Author: Denis Oliver Kropp 
Date:   Fri Nov 2 11:04:19 2007 +0100

    Fixed allocation size for planar formats in FBDev Surface Pool.

commit 32897684d0b6f6bcda0c1056ea1783853b01cb58
Merge: 7816a30... e906b75...
Author: Denis Oliver Kropp 
Date:   Wed Oct 31 10:46:05 2007 +0100

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 7816a304a37a5dc8be620ce59d6877e50814e9be
Author: Denis Oliver Kropp 
Date:   Wed Oct 31 10:45:08 2007 +0100

    Moved IDirectFBDataBuffer_File_data to header file.

commit e906b757451e61d18eaec42f9c5e7f69c1ab6a68
Author: Ville Syrjala 
Date:   Mon Oct 29 20:27:52 2007 +0200

    Fix a pointer buglet.
    
    The pfetch pointer was compared/set instead of the value to which it pointed.

commit 5b8a374d114f86814ce8fdfcd514319e477584c5
Author: Ville Syrjala 
Date:   Mon Oct 29 20:18:37 2007 +0200

    Build the nvidia driver with gfxdrivers=all.

commit 36c7777b9440c9b9b6117672e4193df1dfb45d9c
Author: Ville Syrjala 
Date:   Mon Oct 29 20:17:55 2007 +0200

    Port unichrome to the new surface core. Only compile tested.

commit e77bf93bfbc450f756c07316b36ec08549223450
Author: Ville Syrjala 
Date:   Mon Oct 29 20:17:40 2007 +0200

    Port tdfx to the new surface core. Only compile tested.

commit 42e7d212b311b7a1452e102b43c80e86bbcab264
Author: Ville Syrjala 
Date:   Mon Oct 29 20:17:28 2007 +0200

    Port sis315 to the new surface core. Only compile tested.

commit 093134120e7f66773c30565679ac944c7f117ca8
Author: Ville Syrjala 
Date:   Mon Oct 29 20:17:06 2007 +0200

    Port savage to the new surface core. Only compile tested.

commit 50558df00a6ca857c942ded9ab1334dd508db5ab
Author: Ville Syrjala 
Date:   Mon Oct 29 20:16:43 2007 +0200

    Port nsc to the new surface core. Only compile tested.

commit a21757e38bef58948b2863ba07e2d3fed276af1e
Author: Ville Syrjala 
Date:   Mon Oct 29 20:16:25 2007 +0200

    Port neomagic to the new surface core. Only compile tested.

commit 71bbcc90bdf32dab81d9341d2874b4b7acd44991
Author: Ville Syrjala 
Date:   Mon Oct 29 20:14:57 2007 +0200

    Port i830 to the new surface core. Only compile tested.

commit 12c5dbb1675ca5fdfecd26dbc308da595f6f0ad3
Author: Ville Syrjala 
Date:   Mon Oct 29 20:14:39 2007 +0200

    Port i810 to the new surface core. Only compile tested.

commit 4cb0627e7b8a71d51dbe21a038ed00fd7191312a
Author: Ville Syrjala 
Date:   Mon Oct 29 20:14:24 2007 +0200

    Port cyber5k to the new surface core. Only compile tested.

commit 030a19a4dc8764b85b2801773e8d06c87e2ada99
Author: Ville Syrjala 
Date:   Mon Oct 29 20:14:11 2007 +0200

    Port cle266 to the new surface core. Only compile tested.

commit 7775f860ff39b818f8fc0a8af918907a1e245421
Author: Ville Syrjala 
Date:   Mon Oct 29 20:13:53 2007 +0200

    Port ati128 to the new surface core. Only compile tested.

commit 963e73a8dfcec4a3475110b06745f7c05e15ccab
Author: Denis Oliver Kropp 
Date:   Thu Oct 25 16:47:31 2007 +0200

    Reallocate layer region surfaces on context activation.

commit 0dbccefb4af1e271453276f0755da329626fca29
Merge: 19683c1... 6ffb80f...
Author: Denis Oliver Kropp 
Date:   Thu Oct 25 13:32:23 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 19683c1e1ea3de951c6cd4ae0e2ecfec259d6847
Author: Denis Oliver Kropp 
Date:   Thu Oct 25 13:32:15 2007 +0200

    Join multicast group if family is AF_INET and IN_MULTICAST is true.
    
    Use bind() instead of connect() for receiving UDP data.

commit 6ffb80f98c2190616509207ab3c4710380fb9e64
Merge: bfaf34f... 57e5c3e...
Author: Denis Oliver Kropp 
Date:   Sat Oct 20 15:51:06 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit bfaf34f83b2594a2d37b0703aeb69ef56d8ea442
Author: Denis Oliver Kropp 
Date:   Sat Oct 20 15:50:02 2007 +0200

    Changed assertion into a check, in case of a failure, unrealize_region() can
    be called with the surface not being locked.

commit 57e5c3e8988bf7b3136cb3a03a769c2c08aab054
Author: Denis Oliver Kropp 
Date:   Thu Oct 18 15:58:01 2007 +0200

    Added debug message to dfb_surface_reconfig().

commit fba8b289dd576989fdf9a18a71581ce5616ae232
Author: Denis Oliver Kropp 
Date:   Thu Oct 18 15:57:41 2007 +0200

    Added debug and error messsages to dfb_layer_context_set_configuration().

commit fcb10e2f939a01dd9252880b74de0193ed7014b7
Author: Denis Oliver Kropp 
Date:   Thu Oct 18 15:50:13 2007 +0200

    If alpha is zero, still check for RGB when looking up the index.

commit d6985e88eb3de5ae9f32e2f7480086aaba14a873
Author: Denis Oliver Kropp 
Date:   Mon Oct 15 08:47:32 2007 +0200

    Sleep 2ms when read returns 0, to avoid CPU hogging.
    
    Thanks to Luis Mondesi lemsx1 gmail.

commit bcd261d167587a87db3a6377836e74a24f3193a2
Merge: 40f5795... 50297fc...
Author: Denis Oliver Kropp 
Date:   Sun Oct 14 18:27:57 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 40f579579ff6a7a15ab919ac765398062a898dd7
Author: Denis Oliver Kropp 
Date:   Sun Oct 14 18:27:48 2007 +0200

    Fixed alignment issues by applying VOODOO_MSG_ALIGN() on each message block.

commit b5ce8fca87d885269239aefb42e8e33e33677410
Author: Denis Oliver Kropp 
Date:   Sun Oct 14 18:26:56 2007 +0200

    Initialize libdirect in DirectFBCreate() already.

commit 50297fc3e1655ded4717d5fb6db9cf3e5646d41c
Merge: 6a364bd... 0c58770...
Author: Denis Oliver Kropp 
Date:   Sun Oct 14 17:37:57 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 6a364bd5196d3de87a92c731eedf76a96d6bf8e0
Author: Denis Oliver Kropp 
Date:   Sun Oct 14 17:37:41 2007 +0200

    Implemented some more requestor/dispatcher methods.

commit 0c587702a603fe93a96009a983b2350d9e839c0f
Author: Claudio Ciccani 
Date:   Sun Oct 14 17:31:19 2007 +0200

    Fixed possible deadlock in IDirectFBDataBuffer_File_WaitForDataWithTimeout().

commit 1c8ef7b8b6970d6e91294dc15b08b304a110b6a4
Merge: eb2825d... a8f1402...
Author: Claudio Ciccani 
Date:   Sun Oct 14 16:11:02 2007 +0200

    Merge branch 'master' of git+ssh://directfb.org/git/directfb/core/DirectFB

commit eb2825d945fd2f9893f6acbf83d52166b36cedf5
Author: Claudio Ciccani 
Date:   Sun Oct 14 16:10:32 2007 +0200

    usleep(0) -> usleep(1)

commit a8f1402edb9b21acab4344af00760528400e1a4c
Author: Denis Oliver Kropp 
Date:   Sun Oct 14 16:09:30 2007 +0200

    Workaround redefinition of SIZEOF_LONG in FT2 headers.

commit 6a9128fdb0187ec7c9a99bb6b88c6c369eaa49a6
Author: Claudio Ciccani 
Date:   Sun Oct 14 14:44:25 2007 +0200

    [builtin-fusion]
    SHMPool:
     - Return DFB_NOSHAREDMEMORY if reaquested allocation exceeds the maximum address of the pool.
    
    Ref:
     - Added _fusion_ref_change() (implements fusion_ref_up/down())
     - When local references must be dropped, do not modify the FusionRef directly, use _fusion_ref_change() instead.
    
    Skirmish:
     - When fusion_skirmish_wait() gets called with a timeout value, check whether the timeout expired *before* sleeping.

commit 6850da1757bc6b8a32859ed131b7289317f1e87c
Author: Denis Oliver Kropp 
Date:   Sat Oct 13 01:00:40 2007 +0200

    Translate characters to indices in IDirectFBFont::GetKerning().

commit e7f2fd5ff297cd459be3d7227899c42dbf67426f
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 20:46:15 2007 +0200

    The source rectangle 'rect' argument to dfb_gfx_copy() and dfb_gfx_copy_to() is const now.

commit 00a94f55d4426d12dae777526484648d6862ee14
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 07:54:38 2007 +0200

    In GetSurface() for exclusive single buffer layer call dfb_layer_region_flip_update()
    after clearing the surface.

commit ee7b5a24f01b0f77e5f4520e84a54759f7505175
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 00:55:25 2007 +0200

    Clear stacking class flags before parsing layer-stacking option.

commit 049c9c93bb574aed8b8927b507610965472b0503
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 00:46:11 2007 +0200

    Added "no-init-layer [= ]" option to disable initialization of layers.
    
    Primary layer is initialized by default, use this option to avoid that.

commit a9c1a7d8192c7730445c24ca096675834d8aaf41
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 00:32:28 2007 +0200

    Set default stacking classes for primary layer.
    
    This fixes the need to set "layer-stacking" in the directfbrc.

commit fc1df58d400bf9e3845024a198b1920b075ceb12
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 00:06:28 2007 +0200

    Made unrealize in disable/deactivate depend on CLRSF_REALIZED.

commit 116096a84f8453d34544c0bc0e1b42acc32c87a7
Author: Denis Oliver Kropp 
Date:   Fri Oct 12 00:00:27 2007 +0200

    Fix debug build.

commit 1f6003afb2d2549b98b411a4c7d1e5ddab20d2c9
Author: Denis Oliver Kropp 
Date:   Thu Oct 11 13:00:57 2007 +0200

    Implemented defered region realization by adding CLRSF_FROZEN
    which is set initially on every region that is created.
    
    As long as CLRSF_FROZEN is set, all SetRegion() calls to the
    driver (and buffer allocations due to it) are simply discarded.
    
    Only when dfb_layer_region_flip_update() is called and the region
    is enabled and active, the flag is removed and the region is either
    realized or the config is just set if it was already/still realized.
    
    That means from a driver's point of view: AddRegion(), SetRegion()
    and either FlipRegion() or UpdateRegion() are called in a row for
    the first time, with a buffer that is already initialized with the
    proper content.
    
    However, the driver should still not show the region in SetRegion(),
    but in FlipRegion() or UpdateRegion(). This is because between the
    SetRegion() and the FlipRegion() call, the locked buffer changes to
    the correct one (only for multi buffer modes).
    
    NOTE: This needs more testing, especially single buffered exclusive
    contexts where the application might never call dfb_layer_region_flip_update().

commit df154b87b4cf7f7dc2707ae9f31201c3497cf02f
Author: Denis Oliver Kropp 
Date:   Thu Oct 11 12:01:34 2007 +0200

    Ignore files.

commit e3e13042b565b5efddb50aaf1f1bca2b91045073
Author: Denis Oliver Kropp 
Date:   Tue Oct 9 03:46:06 2007 +0200

    Made argument to fusion_skirmish_lock_count() const.
    
    Added unimplemented fusion_skirmish_lock_count() for single app.

commit 6e753d283215db8743876880d3871c0dd9a02bf5
Merge: 3a39545... cc5cff7...
Author: Denis Oliver Kropp 
Date:   Thu Oct 11 16:08:02 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 3a395457e642b41f9718716f2116734f4d454859
Author: Denis Oliver Kropp 
Date:   Thu Oct 11 16:07:54 2007 +0200

    Added dfb_gfxcard_get_driver_data().

commit cc5cff7ca6637a32ffe06c4880befc7df68a4a4b
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 23:37:22 2007 +0200

    Make DFIFF fast for the standard case again (60->483 MPixel/sec).
    
    Added support for sub surfaces with proper clipping/offset.
    
    Check for unscaled and unclipped loading without format conversion
    and just use dfb_surface_write_buffer().

commit 94106005540286080edcfb0eeebd0fb5ed42e2a7
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 23:34:50 2007 +0200

    Added convenience functions dfb_surface_read/write_buffer().

commit 1e264d5a0e6348d901cbd476bae94118487255f3
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 11:16:28 2007 +0200

    Fixed missing error return in IDirectFB_CreateDataBuffer().

commit 7c570d664d212eef5210c4c1025c30031c60c6ed
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 11:15:50 2007 +0200

    Improved debug messages in thread code.
    
    Added "Direct/Thread/Init" domain to watch creation, wait,
    startup, initialization, notification ...

commit 0bd6594f819cec774a43c203da4e147d980e1bbb
Author: Denis Oliver Kropp 
Date:   Sun Oct 7 19:55:40 2007 +0200

    Big smooth scaler restructuring and cleanup. Added DSBLIT_COLORKEY_PROTECT to
    prohibit writing the color that the destination surface uses as a source color key.
    
    This is used internally at the moment.
    
    Removed messages from non-debug mode.

commit e5d3101bcb67bacb8a8772f222729dc4dc692b3a
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 10:35:32 2007 +0200

    Made smooth scaling support source rectangles not starting at 0,0.

commit bbc638f3392549718d3047209a8b20d57ec3ac0d
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 11:58:40 2007 +0200

    Fixed illness in processing read data in serial driver and fixed error path. (2)

commit 3df393e8ec53c54af2ba94e7cb3b59aae299028b
Merge: 82e1d70... a047bd9...
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 11:55:02 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 82e1d70612cd58f2d3cded4c7baf60ae3d5432e5
Author: Denis Oliver Kropp 
Date:   Mon Oct 8 11:54:47 2007 +0200

    Fixed illness in processing read data in serial driver and fixed error path.

commit a047bd9c0bf9e6a2852915d8d32b4a9c5c03dd7f
Author: Claudio Ciccani 
Date:   Mon Oct 8 11:42:59 2007 +0200

    Check for dead local references in fusion_ref_zero_lock()/trylock().

commit 18cac729a47d2cbe637d78d90441e7305be063b5
Author: Claudio Ciccani 
Date:   Mon Oct 8 11:20:29 2007 +0200

    Fixed lock+reconfig bug: fail when trying to reconfig a locked surface.

commit 7c861f6d153e428cc649f47671b8e7b164d36f80
Author: Claudio Ciccani 
Date:   Mon Oct 8 11:18:28 2007 +0200

    Fixed missing DSCAPS_SHARED.

commit 5532c78bba32e1c5c3dc54894b1d4825cd6b6290
Author: Denis Oliver Kropp 
Date:   Fri Oct 5 12:36:55 2007 +0200

    Added dfb_convert_to_uyvy() and dfb_convert_to_yuy2(), only copy supported yet.

commit c57cc4e28da2726ba185babfb7b14f8a9fc1c552
Author: Denis Oliver Kropp 
Date:   Fri Oct 5 12:36:15 2007 +0200

    Made DisplayLayerFuncs const when being passed or used.

commit 05525befa49b2ef2239e536854380e3e1b962011
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 23:10:58 2007 +0200

    Added dfb_convert_to_a4() and added RGB32/ARGB support to dfb_convert_to_rgb16().

commit 33d8c704ad09eecd37e034a3127880ddc48467a3
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 17:33:31 2007 +0200

    Added CORE_TI_CMEM.

commit da5c817392e3caa2ad225f2dc3305cc6beb594a0
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 17:29:52 2007 +0200

    Refuse to set non-shared surfaces as a background image for a window stack.

commit 20aa428fc8bdf482a22b5267460c0cd8eb6a5fb8
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 17:29:09 2007 +0200

    Added DSCAPS_SHARED for creating shared surfaces, not using local (malloced) memory pool.

commit ef26fc5c15468c17cd417a954e10c01a01f391e9
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 13:54:36 2007 +0200

    Fix usage of hardcoded /dev/mem while the error message was already using DEV_MEM macro.

commit 5754b68d8c62e9a1e1e3116f583011f25a9e2432
Merge: 303e4c7... d95d532...
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 13:51:56 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 303e4c7da3ba3c23b8f02cd908a6a3a793d175a7
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 13:51:01 2007 +0200

    Fix redefinition of MIN by including  earlier.

commit de20d5e0b57e2210261e33a7f5317ee1ea72020b
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 13:50:13 2007 +0200

    Fix surface pool name in DevMem system.

commit 7ab218745a0fbac3c9a19c3a84d81eef5ac9f6be
Author: Denis Oliver Kropp 
Date:   Thu Oct 4 13:49:14 2007 +0200

    Fix redefinition of HAVE_STDLIB_H in jconf.h by undefing it before including jpeglib.h as last.

commit d95d5329e34b012f8a247ffa1a18ed9fbf39c79e
Author: Denis Oliver Kropp 
Date:   Wed Oct 3 00:49:53 2007 +0200

    Added mutex and condition for thread initialization and revert recent priority initialization via pthread_attr_t.
    
    No more DIRECT_THREAD_WAIT_CREATE.
    No more sched_yield().

commit 0dd046043497678a3f344f80b263d4bf842a8793
Author: Claudio Ciccani 
Date:   Tue Oct 2 18:39:36 2007 +0200

    Enable using premultiplied ARGB4444, too.

commit 4853800fe95c1a19988adcf9a7e9f896402012a5
Author: Claudio Ciccani 
Date:   Tue Oct 2 18:37:41 2007 +0200

    Instead of emitting vertices instantly, store them in a buffer that is submitted on EmitCommands() (this way DrawString() is about 45% faster with my 9200SE).
    
    R100/R200: Dropped some blend functions when destination format is A8 ((INV)DEST alpha never worked because A8 isn't really supported as dest format).
    
    R300: Implemented BLEND_COLORALPHA, COLORIZE, PREMULTCOLOR with some limitations (source must be premultiplied and COLORALPHA+ALPHABLEND isn't supported at all).
    
    Switch to version 1.1

commit 4ad84d63cdf29742f8ec8e3726b7e30c9beff773
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 16:12:56 2007 +0200

    Initialize scheduling priority & co right away via pthread_attr_t.

commit 10cc8e482accc24404dc1c8d4e916a14baed57d9
Author: Ville Syrjala 
Date:   Thu Sep 27 22:04:35 2007 +0300

    Add linux-input-devices and tslib-devices options
    
    These options can be used to specify a list of devices to use. If these
    are specified the normal probing using standard device names is not
    performed.

commit b53b207b93669649942cadb75d5e5caaf7f526ba
Author: Ville Syrjala 
Date:   Thu Sep 27 14:58:58 2007 +0300

    Add a new option [no-]linux-input-grab.
    
    [no-]linux-input-grab will control whether linux_input will grab the
    devices. This is useful in cases where multiple processes want to receive
    input events.

commit 5cf85082ae56fa9879aaa1dad6cc086fda054501
Author: Ville Syrjala 
Date:   Thu Sep 27 22:15:55 2007 +0300

    Fix compilation with zlib.

commit c4692d94256e865070eb0db37c15dd0896fa1557
Author: Denis Oliver Kropp 
Date:   Thu Sep 27 19:32:10 2007 +0200

    Fixed DevMem system for multi app.

commit b76f7b0606f4d338d8766a878fa4026b1c282023
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 13:30:27 2007 +0200

    Implemented DSBLIT_BLEND_COLORALPHA on SH7722.
    
    Does not work in conjunction with DSBLIT_BLEND_ALPHACHANNEL, yet :(

commit f46381f1dba1685bd892458fa0b406c4fd91c392
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 12:49:59 2007 +0200

    Added ClanBomber2 at 800x600 with 48 fps and 46% load to SH7722 README.

commit 43547a4e959cbd966b1699b9d08b477a9e109e15
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 12:48:14 2007 +0200

    Clip SH7722 layer (only width/height yet, x/y set to 0 if <0).

commit 2cc3f22838977ab1208dd57a835ecf0dc74a588e
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 12:20:14 2007 +0200

    Updated SH7722 README.

commit f30b7d2d05e3bd917ce89497a21cce32834ac018
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 12:19:07 2007 +0200

    Accelerate DSBLIT_COLORIZE on SH7722 only for font surfaces! Check for CSTF_FONT :)

commit c5717d0b436c850182e0a3e7cada34b90520c33e
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 12:09:22 2007 +0200

    Implemented DrawString() for SH7722.
    
    It's using color change frmo 0xffffff to the text color,
    i.e. any other colorizing blit with non-white pixels is
    not correct at the moment.
    
    Anti-aliased Text                              3.056 secs (*  98.952 KChars/sec) [ 46%]

commit 3e057e7fe1bbcfc092ada83a29ce86d26e2c55b5
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 12:06:19 2007 +0200

    Added option "[no-]font-premult" for premultiplication in case of ARGB glyph images. Default is enabled.

commit 8388ad4feff94e7a4515426e846acc33e80a5347
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 10:49:07 2007 +0200

    Updated SH7722 results in README.

commit 1c35ccc706ca693c06a3d16ffc8b90c7d918740d
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 10:32:28 2007 +0200

    Implemented DSBLIT_ROTATE180 for SH7722.

commit ec118fe86657723aec9688e7322d9b3d715384a5
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 10:26:49 2007 +0200

    Don't use page flipping, but blitting, if rotation is active.

commit 52df55b9879869764908b214fe532624b1fefddc
Author: Denis Oliver Kropp 
Date:   Tue Sep 25 09:35:59 2007 +0200

    Implemented triangle filling on SH7722.
    
    Indicate hardware clipping, other minor cleanup.
    
    Benchmarking with 256x256 in 16bit mode... (16bit)
                                                                                    CPU load
    Fill Rectangle                                 5.736 secs (*  69.694 MPixel/sec) [  3%]
    Fill Rectangle (blend)                        11.576 secs (*  22.079 MPixel/sec) [  1%]
    Fill Triangles                                 4.175 secs (*  62.004 MPixel/sec) [  6%]
    Fill Triangles (blend)                         8.134 secs (*  21.754 MPixel/sec) [  2%]
    
    (*) SH7722/BLT: 37 starts, 37 done, 37 interrupts, 9 wait_idle, 11 wait_next, 16 idle
    (*) SH7722/BLT: 351922 words, 9511 words/start, 21995 words/idle, 2 starts/idle

commit 3e5797b41f93a7a02be20f21585fc3fe59304e46
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 18:40:04 2007 +0200

    more ignores

commit bb9fefe9a4bf702d5acf2c323f7ea28f6e464e0c
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 14:32:57 2007 +0200

    Removed "Benchmarking with..." line in case study.

commit cc3a850db1456c41c934a7d1d7e460b34b75ded5
Merge: 495b733... f573fb7...
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 14:27:53 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 495b733dce6dc8089cb2a3e2957f95d1c2bf80ad
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 06:04:29 2007 +0200

    Added 127.79 BogoMIPS to the figure, yeah that's true, just 127.79 and only 14% CPU load with df_andi running 800x480 at 28.1 fps :)

commit f9601806b03aa9d7ad111a27c8c4e6c8ad71456b
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 06:00:28 2007 +0200

    Fixed DrawRectangle() for 1xN and Nx1 cases.

commit f573fb781400ca68129261ee014b64f825c429f8
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 05:17:13 2007 +0200

    Added dfb_surface_buffer_dump() implementation.

commit 44be56c9d7c8e9ada5115c99ea971751b8683f81
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 05:11:10 2007 +0200

    Fixed missing color key flags when only index is set via config file.

commit 88789f729eabcd0e7393e8281afe353da3d7582b
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 05:00:57 2007 +0200

    Added gitignore file.

commit 7ba48e5ab16a044d8c6966224fdd76ac992b3d72
Merge: 3952674... 9066689...
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 04:58:23 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 9066689be79d9498b04a5c7009a90a8ef88bfe08
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 03:42:25 2007 +0200

    Renesas SH7722 graphics driver
    ==============================
    
    This driver supports the SH7722 SoC from Renesas Solutions Corp. controlling
    - LCDC (LCD Controller) for display
    - BEU (Blit Engine Unit) for blending of planes
    - TDG (2D Graphics) for accelerated operations
    
    It's using a kernel device called sh7722gfx which mainly does interrupt handling.
    
    The 2D Graphics unit supports display lists in RAM and reads them via DMA. These
    lists consist of double word entries, first word designates a register, second
    word contains the data to write. Once a list has been completely processed, the
    hardware generates an interrupt to start the next list.
    
    The kernel module allocates a ring buffer for usage as a display list. The user
    space prepares a block of commands and puts it into the ring buffer. If the hardware
    is idle, it's started directly from user space. When a DMA completion interrupt
    is received, the next block of commands is started from kernel space. If the
    hardware is still running the previous block, new commands are appended to the
    next one. The driver is designed to run without any locking or system calls. Only
    a few interrupts happen over time depending on the operations. The hardware is not
    getting idle, while commands are being sent to keep it busy. There's just a minimal
    gap which is the interrupt handler setting the new start address and kicking the
    hardware again.
    
    To build the kernel module use "make -f Makefile.kernel". You might want to set
    the variables KERNEL_SOURCE, KERNEL_BUILD (if != KERNEL_SOURCE), KERNEL_VERSION
    and DESTDIR.
    
    To run the driver you need the DevMem system module using the directfbrc.sh7722
    file (renamed to directfbrc in $prefix/etc).
    
    Performance (as of 2007-09-20, multi app)
    -----------------------------------------
    
    Benchmarking with 256x256 in 16bit mode... (16bit)
                                                                                    CPU load
    Anti-aliased Text                              3.020 secs (   41.721 KChars/sec) [100%]
    Anti-aliased Text (blend)                      3.328 secs (   10.817 KChars/sec) [100%]
    Fill Rectangle                                 5.549 secs (*  69.681 MPixel/sec) [  3%]
    Fill Rectangle (blend)                        11.873 secs (*  22.079 MPixel/sec) [  1%]
    Fill Rectangles [10]                           9.384 secs (*  69.838 MPixel/sec) [  0%]
    Fill Rectangles [10] (blend)                  14.836 secs (*  22.086 MPixel/sec) [  0%]
    Fill Triangles                                 3.024 secs (+  50.929 MPixel/sec) [ 40%]
    Fill Triangles (blend)                         3.064 secs (+  20.319 MPixel/sec) [  8%]
    Draw Rectangle                                 3.284 secs (*   6.942 KRects/sec) [ 26%]
    Draw Rectangle (blend)                         3.302 secs (*   6.268 KRects/sec) [ 25%]
    Draw Lines [10]                                3.238 secs (*  28.103 KLines/sec) [ 20%]
    Draw Lines [10] (blend)                        3.198 secs (*  27.829 KLines/sec) [ 19%]
    Fill Spans                                     3.092 secs (*  61.466 MPixel/sec) [ 33%]
    Fill Spans (blend)                             3.094 secs (*  21.181 MPixel/sec) [ 11%]
    Blit                                          10.436 secs (*  30.143 MPixel/sec) [  2%]
    Blit colorkeyed                                9.333 secs (*  32.301 MPixel/sec) [  2%]
    Blit destination colorkeyed                    3.763 secs (    6.966 MPixel/sec) [ 99%]
    Blit with format conversion                   13.369 secs (*  22.549 MPixel/sec) [  1%]
    Blit with colorizing                           4.419 secs (    2.966 MPixel/sec) [100%]
    Blit from 32bit (blend)                       21.973 secs (*  13.123 MPixel/sec) [  1%]
    Blit from 32bit (blend) with colorizing        5.129 secs (    1.277 MPixel/sec) [100%]
    Stretch Blit                                  10.271 secs (*  33.463 MPixel/sec) [  3%]
    Stretch Blit colorkeyed                        7.895 secs (*  35.159 MPixel/sec) [  3%]
    
    (*) SH7722/BLT: 940 starts, 940 done, 940 interrupts, 43 wait_idle, 780 wait_next, 89 idle
    (*) SH7722/BLT: 24700744 words, 26277 words/start, 277536 words/idle, 10 starts/idle
    
    * = accelerated
    + = half way accelerated
    
    Statistics
    ----------
    
    The statistics at the end are more valuable when looking at one case at a time:
    
    Fill Rectangle                                 5.834 secs (*  69.647 MPixel/sec) [  4%]
    
    (*) SH7722/BLT: 16 starts, 16 done, 16 interrupts, 4 wait_idle, 2 wait_next, 11 idle
    (*) SH7722/BLT: 74840 words, 4677 words/start, 6803 words/idle, 1 starts/idle
    
    This means that while the FillRectangle() benchmark was running, the hardware
    didn't get idle, which is obvious when running the benchmark for just 10 ms:
    
    Benchmarking with 256x256 in 16bit mode... (16bit)
    
    Fill Rectangle                                 0.191 secs (*  68.624 MPixel/sec) [ 10%]
    
    (*) SH7722/BLT: 13 starts, 13 done, 13 interrupts, 4 wait_idle, 0 wait_next, 11 idle
    (*) SH7722/BLT: 2840 words, 218 words/start, 258 words/idle, 1 starts/idle
    
    See? The same number of times becoming idle, but a few less interrupts. Don't
    worry about the 191 ms the benchmark needed to complete, after 10 ms of stuffing
    the display list, we need to wait until the hardware is done before measuring
    the time it took and calculating the result.
    
    Here's FillSpans() which as opposed to FillRectangle() does a lot of small commands:
    
    Fill Spans                                     3.028 secs (*  61.467 MPixel/sec) [ 34%]
    
    (*) SH7722/BLT: 245 starts, 245 done, 245 interrupts, 3 wait_idle, 185 wait_next, 22 idle
    (*) SH7722/BLT: 5828128 words, 23788 words/start, 264914 words/idle, 11 starts/idle
    
    Example kernel log (debug mode)
    -------------------------------
    
    0.549.014 - sh7722_reset     : Resetting hardware...
    0.549.046 - sh7722_reset     : Initializing shared area...
    0.549.748 - sh7722_reset     : Clearing interrupts...
    0.549.770 - sh7722_reset     : Ready        (   idle, hw     0-    0, next     0-    0, invalid, HC 0000000, INT 000000)
    0.568.700 - sh7722_wait      : Waiting..... (running, hw     0-   54, next    56-   56, invalid, HC 1010111, INT 000000)
    0.573.339 - sh7722_tdg_irq   : -Interrupt   (running, hw     0-   54, next    56-   56, invalid, HC 0000000, INT 100100)
    0.573.397 - sh7722_tdg_irq   :  '-> Idle.   (running, hw     0-   54, next    56-   56, invalid, HC 0000000, INT 000000)
    0.573.480 - sh7722_wait      : ........done (   idle, hw     0-   54, next    56-   56, invalid, HC 0000000, INT 000000)
    0.583.575 - sh7722_wait      : Waiting..... (running, hw    56-   78, next    80-   80, invalid, HC 1010111, INT 000000)
    0.588.414 - sh7722_tdg_irq   : -Interrupt   (running, hw    56-   78, next    80-   80, invalid, HC 0000000, INT 100100)
    0.588.470 - sh7722_tdg_irq   :  '-> Idle.   (running, hw    56-   78, next    80-   80, invalid, HC 0000000, INT 000000)
    0.588.544 - sh7722_wait      : ........done (   idle, hw    56-   78, next    80-   80, invalid, HC 0000000, INT 000000)
    0.601.336 - sh7722_tdg_irq   : -Interrupt   (running, hw    80-  102, next   104-  104, invalid, HC 0000000, INT 100100)
    0.601.420 - sh7722_tdg_irq   :  '-> Idle.   (running, hw    80-  102, next   104-  104, invalid, HC 0000000, INT 000000)
    0.700.117 - sh7722_tdg_irq   : -Interrupt   (running, hw   104-  124, next   128-  128, invalid, HC 0000000, INT 100100)
    0.700.205 - sh7722_tdg_irq   :  '-> Idle.   (running, hw   104-  124, next   128-  128, invalid, HC 0000000, INT 000000)
    3.115.419 - sh7722_tdg_irq   : -Interrupt   (running, hw   128-  220, next   224-  224, invalid, HC 0000000, INT 100100)
    3.115.506 - sh7722_tdg_irq   :  '-> Idle.   (running, hw   128-  220, next   224-  224, invalid, HC 0000000, INT 000000)
    3.151.700 - sh7722_tdg_irq   : -Interrupt   (running, hw   224-  324, next   328-  328, invalid, HC 0000000, INT 100100)
    3.151.788 - sh7722_tdg_irq   :  '-> Idle.   (running, hw   224-  324, next   328-  328, invalid, HC 0000000, INT 000000)
    3.159.160 - sh7722_wait      : Waiting..... (running, hw   328-  444, next   448-12994,   valid, HC 1010111, INT 000100)
    3.161.783 - sh7722_tdg_irq   : -Interrupt   (running, hw   328-  444, next   448-12994,   valid, HC 0000000, INT 100100)
    3.161.839 - sh7722_tdg_irq   :  '-> Start!  (running, hw   448-12994, next 12996-12996, invalid, HC 0000000, INT 000000)
    4.316.367 - sh7722_tdg_irq   : -Interrupt   (running, hw   448-12994, next 12996-12996, invalid, HC 0000000, INT 100100)
    4.316.434 - sh7722_tdg_irq   :  '-> Idle.   (running, hw   448-12994, next 12996-12996, invalid, HC 0000000, INT 000000)
    4.316.505 - sh7722_wait      : ........done (   idle, hw   448-12994, next 12996-12996, invalid, HC 0000000, INT 000000)

commit f7c9d102b178c355582992ad7a3ec22466f19649
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 02:19:55 2007 +0200

    Added direct_page_align().

commit b9e6eafc18de87413cd0de7b6204c4d2c803bb3f
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 01:34:26 2007 +0200

    Use sysconf() if PAGE_SIZE is not defined, though we were able to include .

commit 0925df1ae92832eaebd4698352ce1a80165823fe
Author: Denis Oliver Kropp 
Date:   Fri Sep 21 01:18:46 2007 +0200

    Fix missing fusion_shm_enum_pools() for single app core.

commit 9043fb3df3c07554875a21b2391de41971202678
Author: Denis Oliver Kropp 
Date:   Thu Sep 20 14:23:37 2007 +0200

    Ignore object files.

commit a98732d61c03a7dd34cf2f53ef6839a56a4d8244
Author: Denis Oliver Kropp 
Date:   Thu Sep 20 13:28:12 2007 +0200

    Make bound_windows a DirectLink like usual, fixes aliasing warnings.

commit a019e74d2cc65f3273467b94b1e28d919e4a0b1e
Author: Denis Oliver Kropp 
Date:   Thu Sep 20 13:27:16 2007 +0200

    Fixed warning.

commit ff601e69189cce0b6465e57bd112829498bfa64e
Author: Denis Oliver Kropp 
Date:   Thu Sep 20 13:26:43 2007 +0200

    Fixed uninitialized warnings.

commit 7373e87d2cc9fc60c3658334577bf65fbbffedc1
Author: Claudio Ciccani 
Date:   Wed Sep 19 18:30:34 2007 +0200

    Removed 'HACK FIXME_SC_2 ALLOCATE/SETMODE TWIST' (commit cf4de7cf3677a6252d667342f425f99d8d232043) in primarySetRegion():
    it was causing DirectFB to not restore the previous video mode when an application exits from fullscreen mode.

commit 3952674f9c7940ce0c3ef24e0702ab5693679403
Author: Denis Oliver Kropp 
Date:   Wed Sep 19 08:54:30 2007 +0200

    Added debug message to dfb_layer_set_src_colorkey().

commit 6cf19f1e3a3d13cff8b518b0a92de44502fd87c6
Author: Denis Oliver Kropp 
Date:   Mon Sep 10 13:42:29 2007 +0200

    Deallocate layer region surface buffers if the region is being unrealized.

commit c971f839f93c867f17e45264d000572e87f1782a
Author: Denis Oliver Kropp 
Date:   Mon Sep 10 13:41:57 2007 +0200

    Added resource_id to DFBWindowDescription and DWDESC_RESOURCE_ID to
    specify the resource id to use for window surface creation, rather
    than using the window id for that.

commit ecc8106c6d2ec79b61181e8c8817d0c1848b030e
Author: Denis Oliver Kropp 
Date:   Wed Sep 19 08:53:14 2007 +0200

    Fix background color index support.

commit ea8b81988bad68f38bb791d3ab2f1c0d61185bd6
Author: Ville Syrjala 
Date:   Mon Sep 17 22:34:34 2007 +0300

    Add TI OMAP gfxdriver.
    
    No video layer or other fancy stuff yet.
    Enough to run XDirectFB on the Nokia N800 though.

commit 024c436d75e8936cb11b974ce8df58cbffc3eab5
Author: Denis Oliver Kropp 
Date:   Tue Sep 18 21:35:34 2007 +0200

    If no mixer is showing the layer, use the first one which would support it.
    
    Still not the best solution.

commit 05c2b9f22bc829ddb925ef6c3b144b003b31a973
Author: Denis Oliver Kropp 
Date:   Mon Sep 17 03:30:01 2007 +0200

    Fix crash in shutdown of /dev/mem system.

commit f7df7fbc8548593fd7e930b7e8ffcdc2ed763b21
Author: Denis Oliver Kropp 
Date:   Mon Sep 17 03:00:05 2007 +0200

    Finalize /dev/mem system for new surface core.
    
    - Implement surface pool using surface manager.
    - Added local/shared system data.
    - Added configure.in and Makefile.am parts.
    - Cleanups.

commit 0982b02735b76e636d840cffa02a3e8643e18d43
Author: Denis Oliver Kropp 
Date:   Sun Sep 16 22:18:39 2007 +0200

    Added LUT8 -> ARGB4444 smooth scaling.

commit 1317af26ea1fb28a762b331f65df566053050e93
Author: Denis Oliver Kropp 
Date:   Fri Sep 7 14:57:16 2007 +0200

    Commented out auto center.

commit aa723971a08ecad42dd4ee8cd8a1d4c15fc8ba99
Author: Denis Oliver Kropp 
Date:   Fri Sep 7 14:56:53 2007 +0200

    Fixed wheel direction.

commit 9e37f4d7fd4f96237ba3d6c58cda63be74f46b73
Author: Denis Oliver Kropp 
Date:   Fri Sep 7 12:52:52 2007 +0200

    Build fixes for Voodoo and Unique on new surface core.

commit 91a28279e8490ba47e217cf038dfe4fb879a86b2
Author: Denis Oliver Kropp 
Date:   Fri Sep 7 12:52:23 2007 +0200

    Follow API change in DirectHash.

commit 8c04bfefec14ac83e7cb191b7a17e76973f8b8c2
Author: Claudio Ciccani 
Date:   Fri Sep 7 11:09:57 2007 +0200

    Print an alert message when using builtin implementation of fusion.

commit d5023923233e4823077255a922492fe97a9f1f37
Author: Claudio Ciccani 
Date:   Fri Sep 7 11:08:08 2007 +0200

    Always free resources allocated in builtin implementation of fusion_skirmish_wait(), either if the skirmish was destroyed.

commit a4c8aedf8fc09ded54f40c9194cefbc818b9ba23
Merge: 6978e3e... ace1b81...
Author: Denis Oliver Kropp 
Date:   Wed Sep 5 08:18:16 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 6978e3ef0dbdec1c9963d24c16e963413d437eb0
Author: Denis Oliver Kropp 
Date:   Wed Sep 5 08:17:27 2007 +0200

    Build fixes.

commit ace1b81011cf8c1dd45413786217b729fe19053c
Author: Kieran Bingham 
Date:   Tue Sep 4 22:02:58 2007 +0300

    Fix SetMode / Panning Bug
    
    When a graphics driver has its own primary layer hooks implementation, and
    then defers to fbdev for primarySetRegion(), dfb_fbdev_set_mode() is called
    unnecessarily.
    
    The original implementation in DFB1.0.0 would only call dfb_fbdev_set_mode()
    if a flag indicated a change, however now that dfb_fbdev_set_mode() is in
    the default case of a switch statement, it is always called regardless. This
    has the side effect of resetting the panning, when features implemented in
    the graphics driver are called such as setting opacity.

commit c788839b5b00ad278687d52efac2391f357ca76c
Author: Claudio Ciccani 
Date:   Sun Sep 2 11:39:58 2007 +0200

    Builtin Multi: provided a REAL implementation of fusion_skirmish_wait/notify().

commit d08e95b65d460c92a8cf4a866fc0bcb85ab1dce8
Author: Denis Oliver Kropp 
Date:   Sat Sep 1 19:27:53 2007 +0200

    Added capabilities for display layer sources.
    
    Added DFBDisplayLayerSourceCaps featuring DDLSCAPS_SURFACE.
    
    Check source capabilities if present when determining
    whether to allocate a surface for a layer region.
    
    This allows to add layer sources in addition to DLSID_SURFACE
    that have a surface without using DLCAPS_SURFACE which enables
    surfaces for all sources.

commit 256ec4d9e47d2de09b16f01134973055a9a0854a
Author: Denis Oliver Kropp 
Date:   Sat Sep 1 17:02:02 2007 +0200

    Added GetMixerState() to screen driver API and dfb_screen_get_layer_dimension() to be used instead of the deprecated dfb_screen_get_screen_size().
    
    New function looks up mixer belonging to layer and queries its state containing
    the coordinate space for layers. Use it in layer core to center layers or calculate
    pixel coordinates from normalized values.

commit ec79ff33dbcc966976835d6120dd9da8cdc63405
Author: Claudio Ciccani 
Date:   Wed Aug 29 12:09:20 2007 +0200

    Fixed texture uploading: use the current surface lock instead of locking again.
    
    Replaced state->modified by state->mod_hw.
    
    Disabled some features not working with the new surface core, including:
     - Host to Video memory blits
     - Support for planar formats (YV12/I420) in the overlay

commit 1bce6d23d76a03e13928bc4ba158a96e4c351c5e
Author: Ville Syrjala 
Date:   Tue Aug 28 22:42:32 2007 +0300

    Fix directfbrc location in the manual page.
    
    Document the actual directfbrc location in the manual page. This requires
    expansion of $sysconfdir so borrow the AS_AC_EXPAND m4 macro from GStreamer.

commit 4a88acc6bd41abbf4ae4d3ce4a5e3bdd52fdc4ad
Author: Ville Syrjala 
Date:   Tue Aug 28 21:23:46 2007 +0300

    Revert "Flush the read cache only when a CPU read access is requested."
    
    This reverts commit fd596f8f4c906d78ebbf1d710448aaef01cfb208.
    
    If a CPU write access is requested but nothing is actually written to the
    framebuffer the hardware will not flush the cache. The next CPU read access
    will fail to explicitly flush since the GPU write flag has already been
    cleared. So simply flush the read cache even on CPU write access.

commit 7e57933a7a375c357d5f2c398768f674c24edbf7
Author: Claudio Ciccani 
Date:   Tue Aug 28 15:41:14 2007 +0200

    Added direct_cleanup_handler_{add/remove} to install a cleanup handler called upon exit.

commit 0d9188ce2911c3aba09f9c4a5ea174ef7f9d2b33
Author: Ville Syrjala 
Date:   Mon Aug 27 23:13:22 2007 +0300

    Avoid unnecessary dfb_gfxcard_sync().
    
    Avoid waiting for idle accelerator twice by clearing the GPU read
    access flag when handling GPU write access.

commit 22ac13e66da5409ff1b0b28bb6477aa144f9955d
Author: Ville Syrjala 
Date:   Mon Aug 27 23:10:45 2007 +0300

    Fix CPU read/write access confusion.
    
    CPU read access after GPU read does not need any handling. CPU write after
    a GPU read needs a sync. Flushing the texture cache is not needed.

commit fd596f8f4c906d78ebbf1d710448aaef01cfb208
Author: Ville Syrjala 
Date:   Mon Aug 27 23:06:42 2007 +0300

    Flush the read cache only when a CPU read access is requested.

commit be631ba93675435d95d109c7bf360a3dab3a04b6
Author: Ville Syrjala 
Date:   Mon Aug 27 22:38:37 2007 +0300

    Silence a compiler warning.

commit 59657b0dd2d5bb525ec1a78944c0823f9270d4ef
Author: Ville Syrjala 
Date:   Mon Aug 27 22:01:51 2007 +0300

    Constify linux_input.c.

commit 38488b8c3b2807c4a1fbb102b95421243241ffbe
Author: Ville Syrjala 
Date:   Mon Aug 27 21:47:45 2007 +0300

    Boolify linux_input.c.

commit f7a5d10bb03ad28b28155c21a30ac7eac97f5bd5
Author: Ville Syrjala 
Date:   Mon Aug 27 21:24:24 2007 +0300

    s/ati/ati128

commit 2e263c6205c676f4c61ef5148b9a5c1730a2b3a3
Author: Ville Syrjala 
Date:   Sun Aug 26 17:38:06 2007 +0300

    Sort inputdrivers alphabetically.

commit debca9536998c6d1a4bfc32a889eb73589926a53
Author: Ville Syrjala 
Date:   Sun Aug 26 17:25:12 2007 +0300

    Sort gfxdrivers alphabetically.

commit 722f2b9c2149213e3041aaeeb7f2a83457d012d9
Author: Claudio Ciccani 
Date:   Mon Aug 27 22:28:10 2007 +0200

    Builds again.

commit 127de279f23cf21f6dcf285acb824121a5b5b7d6
Author: Claudio Ciccani 
Date:   Mon Aug 27 21:01:52 2007 +0200

    Fixed build on big endian machines.

commit 06179dc659519dc65d97550ce0faf0b87e354447
Merge: 82812b3... 32d3d68...
Author: Claudio Ciccani 
Date:   Mon Aug 27 16:03:09 2007 +0200

    Merge branch 'master' of git+ssh://directfb.org/git/directfb/core/DirectFB

commit 82812b37302a179ab2f89f0eb77338d6b88391b3
Author: Claudio Ciccani 
Date:   Mon Aug 27 16:02:19 2007 +0200

    Moved FUSION_ID_MASTER definition to types.h.

commit 32d3d681fbaf27118fbbd1f60bb9038a9d29c2f0
Author: Denis Oliver Kropp 
Date:   Mon Aug 27 13:08:13 2007 +0200

    updated

commit 434fab3f9c28b0873148259a02d64684dd57dd49
Author: Denis Oliver Kropp 
Date:   Mon Aug 27 13:06:58 2007 +0200

    Fixed single app core built.

commit 1c7e7614fa1ac1d5702afd794d5905f65ba67b7e
Author: Denis Oliver Kropp 
Date:   Mon Aug 27 11:36:08 2007 +0200

    Moved call to dfb_core_activate() after call to dfb_wm_post_init().
    
    Consistent with 1.0 branch now.

commit c41515f07dc5e448672cebd4bac6e4599dabfde6
Author: Denis Oliver Kropp 
Date:   Mon Aug 27 11:18:08 2007 +0200

    Updated for 1.1.0

commit 5d3daaf93f240abe1433bf976251a9e27b40b890
Author: Denis Oliver Kropp 
Date:   Mon Aug 20 10:19:10 2007 +0200

    Use a Skirmish to synchronize slaves with the master's post core initialization.
    
    The new function dfb_core_activate() will allow other processes to join.

commit 2c863355342f471cfdc44c051cab3bf1de4a3491
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 19:56:33 2007 +0200

    Debug and error messages for window creation.

commit 9871bba44cfea47ba1fac4e2bb9322746f482b80
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 19:56:05 2007 +0200

    Compatibility and warning for drivers still using state->modified.
    
    Every SetState() call will be made with modified = SMF_ALL. Afterwards
    the value is checked (warn if changed) and reset to 0.

commit d5a01a4ca067b75dfbc5f153e998ca12faa1036a
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 19:54:27 2007 +0200

    Idea is to have a Flip() with multiple regions passed in.

commit 4d65f87a41b2a4a3b7ac2ce42a13dd3cf017290b
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 16:15:20 2007 +0200

    Don't print any error at all if pool negotiation fails.
    
    Enhanced debug messages.
    
    Added TODO about preallocated surfaces.

commit db9161c5edf9d6bd494d902f35c744b39c066910
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 13:57:23 2007 +0200

    Fixed uninitialized result in dfb_fbdev_pan().

commit 3be32aaf85a40fa7d46ce5f91ceb839716a3da8c
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 13:54:26 2007 +0200

    Fixed unitialized values in scaling code.

commit 05ea285c5f963fecf80eff262b8b71c08e550fad
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 13:08:15 2007 +0200

    Fix warnings and indention.

commit d96503f371880bc0c5a3d7d9ee346d05e5c24734
Merge: 4abe5ca... 29dd8f3...
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 13:01:57 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 4abe5cae85d57d66593967c3f19047995cb33f76
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 13:01:46 2007 +0200

    Fix warnings.

commit 898cbe97a80c88bf082805f39d49535ce27e5672
Author: Denis Oliver Kropp 
Date:   Wed Aug 15 13:01:28 2007 +0200

    Calculate binary version from micro-binary age.

commit 23079760c28d2e228da8829782071474b99a6de5
Author: Denis Oliver Kropp 
Date:   Tue Aug 14 20:20:48 2007 +0200

    Format fixes in Voodoo.

commit 29dd8f3790d6ace7ed534c4d52d0328fa0703ff2
Author: Mike Crowe 
Date:   Wed Aug 15 00:34:46 2007 +0300

    Fix potential SEGV in linux_input
    
    I've managed to provoke a segfault in DirectFB by unplugging a USB
    input device.
    
    linux_input_EventThread divides the result of reading from the input
    device by sizeof(levt) prior to checking for error. Because the type
    of sizeof may be unsigned the int result of read is promoted
    to unsigned prior to the division. This means that a read error will
    cause readlen to contain a number larger than the size of the array
    causing the following loop to exceed its bounds.
    
    This patch defers the division until the value is known to be positive.

commit f52c0c4236a0571e7f7fd550202343ca23239b7a
Author: Ville Syrjala 
Date:   Mon Aug 13 22:18:29 2007 +0300

    Silence some automake warnings.

commit 1223551c76cb94e1ceadad0439f7ffa88cf9170c
Author: Ville Syrjala 
Date:   Tue Aug 14 23:53:03 2007 +0300

    Reset besvcnt to 0 prior to disabling the backend scaler.
    
    Sometimes the BES would not turn off with just BESCTL. It seems besvcnt
    not being programmed to zero has something to do with it since resetting
    BESGLOBCTL before BESCTL seems to help.

commit 310477a4caf88878df38365bce8cd9f629a05097
Author: Ville Syrjala 
Date:   Mon Aug 13 22:13:15 2007 +0300

    Port mach64 to the new surface core.

commit 1b097dd4188819b828a7542ef6e9efe1e51a27b6
Author: Ville Syrjala 
Date:   Tue Aug 14 09:33:45 2007 +0300

    Port matrox to the new surface core.

commit 125aa35304d9b125b67c2a683a5bdf447eb24285
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 18:50:04 2007 -0700

    Fusion 7.0: Messages are aligned on a 4 byte boundary now.

commit 7d5bd536ae8efb0bdacc064d99c0537d9af09812
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 18:07:44 2007 +0200

    Rearrange locks to avoid dead locks in certain circumstances.

commit 2089ff70b727b8bdbab33f3b03d62a246d506543
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 17:37:23 2007 +0200

    Added universal resource id (unsigned long) that belongs to each surface,
    e.g. the layer id or window id. General purpose surfaces can be given an
    id by using the new flag DSDESC_RESOURCE_ID and setting the resource_id field.
    
    Fixed surface allocation for additional layers. Next to the flag CSTF_LAYER
    the resource id belonging to the surface needs to be DLID_PRIMARY.

commit cd465ade0d737ef4a1e8bce2fc9d798fb83ea91d
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 16:20:40 2007 +0200

    Do FBIOPAN_DISPLAY ioctls directly.

commit 061313442046a44af3dd64cb74670f6b392bf102
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 16:07:36 2007 +0200

    Fix transfer of errno from master to slaves when doing ioctls.

commit 6a0e6404c77a6f11d4bfc946b2d4e5ac0fe553b1
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 02:36:48 2007 +0200

    Fix 64bit implementations of RGB32 source and destination color keying.

commit 7184b00ffe01756f9a025e9f3bafd79ccdc4edc3
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 02:20:04 2007 +0200

    Disable SDL backend by default, enable X11 backend by default.
    
    Support 15 and 16 bit depth server (RGB555 and RGB16).

commit 152474391fd2046e80d1a84dddb870d033402b99
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 02:03:33 2007 +0200

    Revived DSCAPS_STATIC_ALLOC, but not tested.

commit 8c01aa7a757623ee5777499cec4b665207080234
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 01:41:09 2007 +0200

    Negotiation prefers up to date buffers, e.g. do not update
    the system memory from the video memory allocation, but use
    the video memory allocation directly.
    
    Debug messages, minor cleanup.

commit 297b67d655325fd61514b77945dcb973b57a3d5a
Author: Denis Oliver Kropp 
Date:   Mon Aug 13 01:38:10 2007 +0200

    Fix includes.

commit cf4de7cf3677a6252d667342f425f99d8d232043
Author: Denis Oliver Kropp 
Date:   Sun Aug 12 22:11:26 2007 +0200

    MERGE of branch surface_core into master!
    
    The new surface core is stable enough, still not
    completely implemented and tested, but I can run my
    working environment.
    
    See TODO for next action items.

commit 02e75aff72362c4a1f299da068f9e18c868fe48c
Author: Denis Oliver Kropp 
Date:   Fri Aug 10 19:18:16 2007 +0200

    Hotfix single app build.

commit ddc79a29d3ba9546559d1610b6ff7510b0a7431a
Author: Denis Oliver Kropp 
Date:   Fri Aug 10 02:27:07 2007 +0200

    Fix potential dead lock in dfb_layer_context_get_primary_region().

commit 73a8dc87fa1a833b10f672b9910cb2f586a3a8d8
Author: Denis Oliver Kropp 
Date:   Fri Aug 10 02:26:01 2007 +0200

    Fix potential dead lock in layer context initialization.

commit f2d1bc51c8ed5db5e0e151b056913f9d2762323a
Author: Denis Oliver Kropp 
Date:   Fri Aug 10 02:24:42 2007 +0200

    Added fusion_reactor_set_lock_only() which does not lock and
    use it in fusion_object_set_lock() as this is called during
    object initialization.

commit 50fee612fadaa3a9534cff99a136192c767e0139
Author: Denis Oliver Kropp 
Date:   Fri Aug 10 02:19:10 2007 +0200

    Fix lock order in fusion_shm_pool_destroy().

commit 13f42cb5535512e47e4a54835f7c60e75c260dbd
Merge: c0802f7... 77b5640...
Author: Denis Oliver Kropp 
Date:   Tue Aug 7 21:31:07 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit c0802f7058b32509ac003c0c7e111e124ccb3c1b
Author: Denis Oliver Kropp 
Date:   Tue Aug 7 21:28:30 2007 +0200

    Fix size_t printf format.

commit 77b564072b8b4afc5aca9107f1ba075f4acf8a98
Author: Denis Oliver Kropp 
Date:   Tue Aug 7 11:49:22 2007 +0200

    Fix size_t/sizeof format correctly with "%zu".

commit 7295da6c9aa8143e526a21f86ce6598a6003d901
Author: Claudio Ciccani 
Date:   Tue Aug 7 11:34:07 2007 +0200

    Removed volatile keyword from structures.
    Added some asm() code raising memory barrier in critical points.

commit 6f8cd393c54849a1e029de68e16c8d30fe70f6fd
Author: Denis Oliver Kropp 
Date:   Mon Aug 6 13:14:26 2007 +0200

    Follow API change in DirectHash.

commit d1c7a2c7836029dfa2dce24ba507a3f9e7fca7d8
Author: Denis Oliver Kropp 
Date:   Mon Aug 6 13:13:18 2007 +0200

    Added direct_serial_check() returning true if the target serial is not higher.

commit bcab4383e5eff57aba0e76b0f99b0568ee883082
Merge: 4eb2645... 0bfa945...
Author: Denis Oliver Kropp 
Date:   Mon Aug 6 13:11:41 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 4eb2645d17dc3126b02b03a79da3ba16805d1aa3
Author: Denis Oliver Kropp 
Date:   Mon Aug 6 13:07:54 2007 +0200

    Changed DirectHash's u32 key to be unsigned long. This allows to use pointers.

commit 0bfa945e3aee20759afabd9fd6041a58bfbeab70
Author: Denis Oliver Kropp 
Date:   Thu Aug 2 14:27:41 2007 +0200

    Added dfb_pixel_to_color( format, pixel, ret_color ) using proper expansion.

commit e88e7a81ffbf05a40c0eb180986c42caa3c6e045
Author: Denis Oliver Kropp 
Date:   Thu Aug 2 00:34:34 2007 +0200

    Added generic /dev/mem based system module.
    
    There's no screen or layer registered, a graphics driver is required.
    
    Added options for the module:
      video-phys=        Physical start of video memory
      video-length=           Length of video memory
      mmio-phys=         Physical start of MMIO area
      mmio-length=            Length of MMIO area
      accelerator=               Accelerator ID selecting graphics driver

commit 8ec0f1c3759f6200883c8ca3f0837a12643223d9
Author: Denis Oliver Kropp 
Date:   Wed Aug 1 22:47:12 2007 +0200

    Print an error and return if no layers are available.

commit 1e3143ddaab9a6deee8d0abf2fce3b808a059889
Merge: e5b17bb... 781d713...
Author: Denis Oliver Kropp 
Date:   Wed Aug 1 22:43:41 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit e5b17bbbe91c4db3c38e06337196b2f6a1d74ff1
Author: Denis Oliver Kropp 
Date:   Wed Aug 1 22:35:53 2007 +0200

    Readded "%.nm" as an alternative to "nm-n.%".

commit 781d713b48d87485a6809d771be7f4c3f052a5a3
Author: Denis Oliver Kropp 
Date:   Sun Jul 29 14:25:42 2007 +0200

    Fixed different bugs/crashes in the scaling code.
    
    Added RGB32 smooth scaling.

commit 774c84357f99c8119df9303a871980767c56dbb5
Author: Denis Oliver Kropp 
Date:   Wed Jul 25 15:23:08 2007 +0200

    Fixed warnings.

commit 3a3577147d1f1185906d64abdeb34997e3e1ff68
Author: Denis Oliver Kropp 
Date:   Wed Jul 25 15:08:39 2007 +0200

    Follow DFBColorKey change in layer API.

commit 94c59f30479ffacc3aaa3aa04fe3048141caa542
Author: Denis Oliver Kropp 
Date:   Wed Jul 25 13:27:56 2007 +0200

    Added copyright footer.

commit 313623224d91258e3fdbee90da2ba6ee447b48c8
Merge: 19461c2... 2e28cc7...
Author: Denis Oliver Kropp 
Date:   Wed Jul 25 13:27:29 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 19461c27471d602daa21ebe2360fce028d82699a
Author: Denis Oliver Kropp 
Date:   Wed Jul 25 13:27:24 2007 +0200

    Added direct_list_foreach_reverse().

commit 2e28cc7ff1127118e136fd5f5a83b44ff5da2761
Author: Denis Oliver Kropp 
Date:   Wed Jul 25 11:51:52 2007 +0200

    Added option "layer-src-key-index".
    
    Added DFBColorKey which is binary compatible with DFBColor for RGB, but
    has an 8 bit color index instead of the alpha value.
    
    Use DFBColorKey instead of DFBColor in the CoreLayerRegionConfig.
    
    Added index argument to core layer configuration functions.

commit 7e6800088fa0c087164cf530d9ac2cf161609997
Author: Denis Oliver Kropp 
Date:   Wed Jul 18 21:16:20 2007 +0200

    Few more debug messages.

commit 6863d69d88569a690909c4767a1687bdf3c08b2d
Author: Denis Oliver Kropp 
Date:   Mon Jul 23 13:19:58 2007 +0200

    Added source color keying and destination color key protection in 16 bit scaling template.

commit 85b80ad3917d3de1cc2a8d69d27cf4b44895610d
Author: Denis Oliver Kropp 
Date:   Mon Jul 23 13:20:17 2007 +0200

    Fix warnings.

commit c98eadab4c446c28a19852d39ffb227b9b3c0bb6
Author: Denis Oliver Kropp 
Date:   Mon Jul 23 13:22:32 2007 +0200

    Don't bail out with other system modules if LINUX_INPUT_USE_FBDEV is not set.

commit f65acb0fd1a06f3b694d25273b7531ab1d97c982
Author: Denis Oliver Kropp 
Date:   Wed Jul 18 20:36:19 2007 +0200

    Added debug messages.

commit 73f20c57998159710eeb609e166122b10581cb24
Author: Denis Oliver Kropp 
Date:   Wed Jul 18 20:36:01 2007 +0200

    Raise max number of shm pools to 16.

commit ec4e5ed6e363b3793d8e90e6fbadd4c4ed6ded3f
Merge: aed1290... 8f28528...
Author: Denis Oliver Kropp 
Date:   Tue Jul 17 01:09:06 2007 +0200

    Merge branch 'master' of ssh+git://git.directfb.org/git/directfb/core/DirectFB

commit aed1290039fd229db3e735b84e9947ef1175cb45
Author: Denis Oliver Kropp 
Date:   Tue Jul 17 01:08:47 2007 +0200

    Added direct_list_foreach_reverse().

commit 8f285284dd14c5c0bb53d85ba3b9fded5c7fd635
Author: Denis Oliver Kropp 
Date:   Tue Jul 17 00:57:30 2007 +0200

    build fixed

commit 4f0f00961139e9c59ab97efd6fa87216fce83a9f
Author: Denis Oliver Kropp 
Date:   Mon Jul 16 18:44:15 2007 +0200

    HD extensions, thanks to Daniel J Laird!

commit 826d7ae1aea550a7cf8312848f26d8111232d609
Merge: cc04f11... fd6854f...
Author: Denis Oliver Kropp 
Date:   Mon Jul 16 10:27:16 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit cc04f11f830991c812f77a9e9261a1fb5dd96203
Author: Denis Oliver Kropp 
Date:   Mon Jul 16 10:22:05 2007 +0200

    Extended video provider capabilities, thanks to Daniel J Laird!

commit fd6854fe1b77bf3a9621b098c82f4c36ed2a96c5
Author: Claudio Ciccani 
Date:   Thu Jul 12 12:36:08 2007 +0200

    Declare some structs 'volatile' to prevent bad assumptions by the compiler.
    
    Provided 'builtin-multi' end 'single' implementations of fusion_skirmish_wait() and fusion_skirmish_notify().
    
    Check for a dead owner in FusionProperty too.

commit d9f96a4daa43683e17bb5b90f453a2be762e169b
Author: Denis Oliver Kropp 
Date:   Tue Jul 10 16:47:15 2007 +0200

    Provide the original timestamps from the X events.
    
    Use DIEF_FOLLOW for x/y motion.

commit 7633e99995f0d90d3edd825d71a5e12b2bede278
Author: Denis Oliver Kropp 
Date:   Tue Jul 10 16:30:49 2007 +0200

    Work around a strange issue where XNextEvent() blocks on the
    last event until a newer one is received.
    
    Any X expert who can explain the error to me?

commit 74e90cb10a2627fb58aaca2593105c31fd795537
Merge: ad16899... ddc3298...
Author: Denis Oliver Kropp 
Date:   Tue Jul 10 15:51:12 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit ad16899fd45e40fd17d45a9f14afe7aabbf8afc8
Author: Denis Oliver Kropp 
Date:   Tue Jul 10 15:50:38 2007 +0200

    Added true keymap support to X11 input driver.
    
    Read the X11 keymap entries properly and translate to identifier and symbols.
    
    Only send key code in events.
    
    X KeySym to DFBInputDeviceKeySymbol translation might not be complete for everyone.

commit ddc3298c0a0665ba0041b1877ebf8c66752fb67d
Author: Claudio Ciccani 
Date:   Tue Jul 10 12:11:19 2007 +0200

    Implemented DSBLIT_ROTATE180.

commit 1cd3b70ca91715b396c1d361db1647d4e0e38c66
Author: Claudio Ciccani 
Date:   Tue Jul 10 11:25:51 2007 +0200

    Override umask when making directories and sockets.

commit 17132f3fceee231bdd3196b1d3451d6872447b71
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 22:05:09 2007 +0200

    Fix 3/4 byte issue for partial updates.

commit b96e94467bf956a33c11605ef485d8ab47da0936
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 21:50:57 2007 +0200

    Use an ShmImage with twice the height of the output.
    
    Alternate between bottom and top image and
    do XSync() BEFORE doing the next XShmPutImage().
    
    Only call XShmPutImage() for the updated region.
    
    Removed XFlush() call.
    
    Runs nicely on dual core now.

commit d468b0e68105d494c7799f54feb933887c48f379
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 21:09:09 2007 +0200

    Minor optimization in 555->565.

commit 5d77a01e94016f979f373bc5ccf21b80b26dc5c6
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 21:07:24 2007 +0200

    Support conversion from 32 to 16 bit.

commit f6d5eda0164895d2be6c55355f871a81587f064f
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 21:05:04 2007 +0200

    Added dfb_convert_to_rgb32().
    
    Support 32 bit (depth 24) displays in SDL and X11 backend.

commit b8649c8cae7eb9db2f8f2bfb8ed29c0dc8e5f7a8
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 20:32:07 2007 +0200

    Added dfb_convert_to_rgb16().
    
    Use it in SDL system.
    
    Cleaned up X11 system a bit and made it use dfb_convert_to_rgb16().

commit 4e96b36727571ee0c70fe620d178b4c8b318ef99
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 15:45:51 2007 +0200

    Added IDirectFBDisplayLayer::SetRotation().
    
    Added option "-R " to dfblayer.

commit 121e8a229f4be2909bdbde8e7be2520a1d090d33
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 15:09:15 2007 +0200

    Added dfb_gfx_back_to_front_copy_180().
    
    Added runtime option "layer-rotate = " with 0 and 180 supported.
    
    Try it with desktop-buffer-mode=backsystem until graphics drivers support the flag.
    
    I'm committing this with my screen content rotated by 180 degree but not the screen itself.
    Typing and reading is fine, but editing text, especiallusing y del/backspace, is horrible.

commit 7c6330ce36593169e5e740b2bd98ad81c230b461
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 14:40:57 2007 +0200

    Added DSBLIT_ROTATE180 with a basic software implementation.

commit 1f73f307dbcd5272ebad51a78c9c652c4b638f14
Author: Denis Oliver Kropp 
Date:   Mon Jul 9 13:00:45 2007 +0200

    Finalized ARGB4444 smooth scaling support.

commit d8276f7799e60009650e28888e9fcbc024bb7253
Merge: 977ec21... 2b48aaa...
Author: Denis Oliver Kropp 
Date:   Sat Jul 7 21:17:28 2007 +0200

    Merge branch 'master' of git+ssh://git.directfb.org/git/directfb/core/DirectFB

commit 2b48aaa07cbcfe1d2bea3182ffcbaf02269729f6
Author: Denis Oliver Kropp 
Date:   Fri Jul 6 15:27:22 2007 +0200

    Added multifunctional color configuration function dfb_state_set_color_or_index().
    Always tries to set both color and index. If color index is -1, color is used and
    searched in palette of destination surface if present. If color index is valid the
    color is looked up in palette if present.
    
    Added option "layer-bg-color-index = n".

commit 0c01366a6f5b37a1dd00b513e6c62b1056b910b8
Merge: 14ba567... 098b862...
Author: Denis Oliver Kropp 
Date:   Fri Jul 6 14:40:23 2007 +0200

    Merge branch 'master' of ssh+git://git.directfb.org/git/directfb/core/DirectFB

commit 14ba567e3b00d273f063d0e97f64f00e02aa756c
Author: Denis Oliver Kropp 
Date:   Fri Jul 6 14:38:51 2007 +0200

    no-force-slave

commit 977ec21feffd47b27e365e594e0e66c27f342c25
Author: Denis Oliver Kropp 
Date:   Fri Jul 6 13:31:36 2007 +0200

    Big progress on the scaling front.

commit d8d9f23b914c07c3e69680980c4425beeae92634
Author: Denis Oliver Kropp 
Date:   Thu Jul 5 23:31:40 2007 +0200

    Added support for ARGB4444, RGB444 and NV16 on a 16 bit RGB16 SDL window.

commit 098b862938c4f577879059f6e0c8e4a17049a45f
Author: Claudio Ciccani 
Date:   Mon Jul 2 12:03:11 2007 +0200

    Added FusionLeave, a message sent from a slave in emergency mode to notify the master
    that local refs belonging to the sender must be removed.

commit 0a2f0b3af5a3f0e0f498e47d55c4d5ddb610242b
Author: Claudio Ciccani 
Date:   Mon Jul 2 11:57:19 2007 +0200

    Forgot a newline.

commit 4160d212709952ae06316a54474e46810b3d8492
Author: Claudio Ciccani 
Date:   Sun Jul 1 17:19:43 2007 +0200

    Actually fail if a parent window for the newly created one was specified.

commit a5040250b5523b7d0e2464690d158d604517d335
Author: Claudio Ciccani 
Date:   Sun Jul 1 16:03:33 2007 +0200

    Use fprintf() instead of direct_log_printf() to print config_usage.

commit e206b97ff745eb58824b0eb91997c49eb44adbe5
Author: Claudio Ciccani 
Date:   Sat Jun 30 14:56:42 2007 +0200

    dfb_surface_reformat() no longer fails immediatly if the surface is locked, instead it waits for 3 loops before doing it.

commit 0f7dd53285a56bbf38a02b82b47a7f2ee85a1f09
Author: Claudio Ciccani 
Date:   Sat Jun 30 14:54:52 2007 +0200

    When using the builtin IPC implementation, chose a pool allocation base address that won't collide
    with those used by other worlds, i.e. the pool base of world N starts 128M after the pool baseof world N-1.
    As a consequence of this the maximum amount of shared memory allocatable by a world is limited to 128M.

commit dcf2a2b7089fd02105f68bba5da3130c1d72f42c
Author: Claudio Ciccani 
Date:   Fri Jun 29 14:48:28 2007 +0200

    Added a new Fusion/IPC implementation using standard system calls:
    
     - Skirmish gets implemented by using sched_yield()+usleep, exactly like linuxthreads does with pthread mutexes,
       but it's also capable of automatically unlocking whether the owner process died without doing it.
    
     - Property works like Skirmish, but it doesn't sleep and it doesn't check for a dead owner.
    
     - Dispatching and co. make use of raw unix sockets: there is a local address specific to each fusionee
       (/tmp/fusion.@WORLD_INDEX@/@HEX_FUSION_ID@) and each call (/tmp/fusion.@WORLD_INDEX@/call.@HEX_CALL_ID@.@HEX_CALL_SERIAL@),
       and messages are sent directly from the generator to the socket of the listeners.
       From a network point of view, this is similar to UDP Multicast (e.g. conference or meeting).
    
    The new implementation gets build when --enable-bulti is specified but no usable linux/fusion.h was found
    (however you can edit fusion/build.h to force building it).

commit 21bb8adc7377b8a5be57e9e1a092513ed8cb0da6
Author: Claudio Ciccani 
Date:   Fri Jun 29 14:31:18 2007 +0200

    Open log file with mode 0664.
    Automatically flush stderr.

commit 90a53ee2da89805844cd364c52379089d16acc80
Author: Claudio Ciccani 
Date:   Fri Jun 29 14:30:00 2007 +0200

    Added direct_sched_yield().

commit 8f02626a2434d6fd3fbfd14331c72b1450620c62
Author: Denis Oliver Kropp 
Date:   Wed Jun 27 00:15:53 2007 +0200

    Fix 64 bit symbol address parsing in trace code.
    
    Fix missing target directory for nm-n files.

commit beab80191a61967d5b1a75e9a468f11265f40d15
Author: Ville Syrjala 
Date:   Fri Jun 22 10:45:15 2007 +0300

    Also make sure fix.ypanstep is not zero before using it.

commit 6447b0f8ae8ad7212a8a74e9596f5c19870f7a48
Author: Ville Syrjala 
Date:   Wed Jun 20 23:12:37 2007 +0300

    Make sure fix.xpanstep is not zero before using it.

commit da50bb89855497db778d4fe5c8c951d3a74fb07b
Author: Ville Syrjala 
Date:   Sun Jun 17 13:25:24 2007 +0300

    Eliminate libsysfs dependency from i2c detection.
    
    Recent changes in sysfs layout broke the i2c detection. Fix the problem
    and remove the dependency on libsysfs. Use of libsysfs is no longer
    recommended by the kernel developers.

commit 1a0ac5594506b71189346be53e84615f09820ac8
Author: Denis Oliver Kropp 
Date:   Fri Jun 15 16:19:45 2007 +0200

    Thanks to Daniel Laird for Video Provider Events!

commit 66d8693e2b45db7c26c7d22c70781dce2e2fdbab
Author: Denis Oliver Kropp 
Date:   Mon Jun 4 13:39:01 2007 +0200

    Implemented StartDrawing/StopDrawing() for states.
    
    When a surface is being rendered to, its graphics
    state is set to DRAWING. Upon Flip() the state is
    flushed.
    
    Each sub surface interface has a reference to its
    parent and a list of its children.
    
    The new mechanism needs to be enabled via "startstop"
    option.
    
    StartDrawing/StopDrawing() can be implemented by the
    graphics driver. e.g. to keep track dirty surfaces
    and defer flipping if it would reveal other's drawing.

commit b630f7539003e04a21d6d7e44023461ecf0e2143
Author: Ben Combee 
Date:   Fri Jun 15 05:01:59 2007 +0200

    Add --raw option to directfb-csource to allow encoding data files in headers
    
    
    via git-CVS emulator

commit 6987c883a18be767085d55e22638520a7d80fbc6
Author: Denis Oliver Kropp 
Date:   Tue Jun 12 19:39:30 2007 +0200

    Eek, disable smooth scaling until code supports big endian as well.

commit 58c1d37bad0e6dc50db4cac3d650caf6bb07722d
Author: Denis Oliver Kropp 
Date:   Tue Jun 12 19:34:23 2007 +0200

    Fix hi/lo mixup for big/little endian in 32 bit wise 16 bit color keying code.

commit c0142f6bf506d09449cdf9d2ca0250dcb05cf7fc
Merge: 14f3aef... 8bba6d9...
Author: Denis Oliver Kropp 
Date:   Tue Jun 12 18:57:41 2007 +0200

    Merge branch 'master' of ssh+git://git.directfb.org/git/directfb/core/DirectFB

commit 14f3aef4d4d9fc3f075209a9543b1022f8588493
Author: Denis Oliver Kropp 
Date:   Tue Jun 12 17:52:39 2007 +0200

    Added layer palette initialization via "layer-palette- = " option.

commit 97c631660fe977d6d8bb5d4ddf86e1ca1d4e8001
Author: Denis Oliver Kropp 
Date:   Tue Jun 12 17:49:43 2007 +0200

    If no alignment is specified (0), default to 8 bytes offset and pitch alignment.
    
    To disable alignment, simply set to 1.

commit 8bba6d96df16e3cd11445995cb6704676151e7c3
Author: Ville Syrjala 
Date:   Sat Jun 2 22:19:14 2007 +0300

    Check fbdev pan/wrap capabilities for double/triple buffering.

commit 68d8b7ac45293dfc1b03e984a7e5a7b183382313
Author: Ville Syrjala 
Date:   Mon Jun 11 00:58:09 2007 +0300

    Fix fbdev_ioctl_call_handler() return value.

commit fa628067a16af972a70cec416ce7b88f9c1bda5f
Author: Ville Syrjala 
Date:   Sat Jun 2 22:05:18 2007 +0300

    More uses for D_ARRAY_SIZE().

commit aba1f2a73f4870e1bfc0384a06e49c2acb66d884
Author: Claudio Ciccani 
Date:   Fri Jun 8 15:08:39 2007 +0200

    Use a preallocated surface to render the image
    (this should fix support for destinations that are premultiplied, separated, and co.).

commit 00a47324bb5988fbc5d368f4730a1fc9ab935636
Author: Denis Oliver Kropp 
Date:   Sun Jun 3 19:08:39 2007 +0200

    Removed bogus assert.

commit d44cb34fa00fede36e757238f02be6e953855c5a
Author: Denis Oliver Kropp 
Date:   Sun Jun 3 18:32:59 2007 +0200

    Use sysconfdir.

commit 69cf22cc7a65ee4251e5d98f505e473490f35536
Author: Denis Oliver Kropp 
Date:   Sat Jun 2 21:46:07 2007 +0200

    Added YUV palette support.
    
    CorePalette has a second array for YUV entries.
    
    Added IDirectFBPalette::SetEntriesYUV(), GetEntriesYUV() and FindBestMatchYUV().
    
    Either of the APIs can be used, both arrays are kept synchronized.
    
    Drivers can choose.

commit 9c484e1679bdfa922d90d1d5feebc6b0106fdf89
Author: Denis Oliver Kropp 
Date:   Sat Jun 2 21:43:34 2007 +0200

    ARGB4444_TO_RGB32(pixel)

commit 92eb83fc571dc67d8994c58cb7b8efb18ad32b2f
Author: Denis Oliver Kropp 
Date:   Sat Jun 2 09:27:45 2007 +0200

    Fixed _fusion_reactor_process_message()'s usage of FUSION_REACTOR_DETACH.

commit b1037357aacd70152895826c4b7ed48ea192a1ce
Author: Denis Oliver Kropp 
Date:   Fri Jun 1 11:54:40 2007 +0200

    Single app core build fixes.

commit 40bb22a6fa39999074cb5d8b635ab6353c66f23d
Author: Denis Oliver Kropp 
Date:   Fri Jun 1 09:55:46 2007 +0200

    Added timeout to fusion_skirmish_wait(), 0 means unlimited.

commit 269df8137fd06a51f4b388432bc8e395265bd1fa
Author: Denis Oliver Kropp 
Date:   Thu May 31 17:24:47 2007 +0200

    Replaced dfb_wm_start_desktop() by dfb_wm_post_init().
    
    Removed StartDesktop which had no context pointers from WM API
    and added PostInit with proper context pointers.

commit 988f0e78899cd5b88983f3460436740c45f12f39
Author: Denis Oliver Kropp 
Date:   Wed May 30 18:07:55 2007 +0200

    Added DWOP_KEEP_ABOVE and DWOP_KEEP_UNDER.

commit ee262b3fca03b5aafefbd789b698181dd732f619
Merge: 41e5c47... 0d71e41...
Author: Denis Oliver Kropp 
Date:   Wed May 30 10:01:58 2007 +0200

    Merge branch 'master' of ssh+git://git.directfb.org/git/directfb/core/DirectFB

commit 41e5c4767107a8cd965617c680ad2c8cd3d9f498
Author: Denis Oliver Kropp 
Date:   Wed May 30 09:58:51 2007 +0200

    Export dfb_config_parse_pixelformat().

commit 0e9eba57d87a1e8d0f446de2daa65fc84617e879
Author: Denis Oliver Kropp 
Date:   Tue May 29 23:21:30 2007 +0200

    Extend list of custom keys.

commit 0d71e415412bbb21e6bed49bd41e32d421b254ca
Author: Denis Oliver Kropp 
Date:   Tue May 29 23:10:23 2007 +0200

    Fixes for grayscale PNGs.

commit 67350f49d39c9c168575384279b1a92484c6e6f7
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:52:08 2007 +0200

    Added DFFA_FIXEDCLIP that can be used in addition to fixed advance
    and cuts off glyphs if they are wider than that.

commit bbbd47a34281d756218e6decea0a61844c0a97ea
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:50:28 2007 +0200

    Use direct_list_foreach_safe() for links as well.

commit d25b01b3a74021ba4ecf56219695c3251f4ea76f
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:48:16 2007 +0200

    Check for NULL type earlier.

commit dde7fa2a3bef0143334450641a5c11d524f75337
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:47:40 2007 +0200

    Added "[no-]madv-remove" to get around the auto detection.

commit 1f312b1091a5ef85089f685dfd0fcd7c56ada8ea
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:47:11 2007 +0200

    Added DFB_INCOMPLETE to stringification.

commit c90cd950116b20eb4dcdd0e60352cc91f8df0467
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:45:26 2007 +0200

    Avoid "unused warning" if debug domains are declared, but not used.

commit fb76d8e75e86a194e5b03a377950a33380c79850
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:44:03 2007 +0200

    Added DFB_INCOMPLETE and return it from image providers
    if rendering has been aborted by the render callback.

commit 8218b2a254a0fd4705fc47af35d0be41d73cd19c
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:36:26 2007 +0200

    Image providers et al can access memory of memory based data buffers directly now.

commit 8e185ff671d3cd745e66c443c8a658e5d82e9936
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:35:13 2007 +0200

    Use CSLF_FORCE to lock a surface for software StretchBlit().
    
    Check CSLF_FORCE when locking "video-low" surface buffers for
    CPU access and pull buffer into system memory if set.

commit 8646db00b0c5cc7df8fc6430fd8a26660dc7c62a
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:29:22 2007 +0200

    Cast to ulong, not u32, to align pointers.

commit 8fc54bcffcdb1dae57a878e1b9b735b336713170
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:24:59 2007 +0200

    Added IDirectFBSurface::SetRenderOptions() as a new state element, but not
    mandatory for graphics drivers. At the moment it's used by the software
    driver to choose smooth or standard scaling.
    
    Added smooth up/down scaling for RGB16.
    
    Added "smooth-upscale" and "smooth-downscale" options to choose a default.

commit 52bb513a1d63912bf67d28caebd97f5b2d888475
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:16:37 2007 +0200

    New option "surface-sentinel" to enable surface sentinels at the end of chunks in video memory.

commit 464e40e8feb90ead4eab2168252f644d71fb53f1
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:07:58 2007 +0200

    List buffers in video memory if "-s" is passed.

commit 48e8de5a110010b4656fc402edf0b18ffa518090
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:06:08 2007 +0200

    Explicit shutdown order of core parts and pools.

commit 8a8141d41681cacbed1eb667ad88ba07d842a660
Author: Denis Oliver Kropp 
Date:   Tue May 29 22:01:55 2007 +0200

    Use a FusionRef as a lock counter.

commit 7982b09b68f45182d2b98ead917f8c9a831da31a
Author: Denis Oliver Kropp 
Date:   Mon May 28 22:52:58 2007 +0200

    Added missing  include.

commit 0496e6e3a38e01aa5b0fc07472a60776de9d0ffd
Author: Denis Oliver Kropp 
Date:   Mon May 28 22:08:17 2007 +0200

    Added direct_thread_get_tid().

commit 1a80a3bad8b8cbba34f8004fb67759b878483c5c
Author: Denis Oliver Kropp 
Date:   Mon May 28 22:08:34 2007 +0200

    Added fusion_dispatcher_tid().

commit eea7bfaf9bc0cad1660ed6dea4989c1774f08564
Author: Denis Oliver Kropp 
Date:   Mon May 28 19:49:49 2007 +0200

    Added fusion_skirmish_wait() and fusion_skirmish_notify().
    
    When you hold the lock you can wait until you get notified,
    where others can get the lock while you're waiting.
    
    At the moment it requires the notifier to acquire the lock.

commit a5f613e79af04a098f03b0d9614b9e2fbfe5f0ff
Author: Denis Oliver Kropp 
Date:   Mon May 28 18:08:52 2007 +0200

    API break!
    
    Support destructor context pointer.
    
    Added "ctx" argument to fusion_object_pool_create().
    Added "ctx" argument to FusionObjectDestructor.

commit 5984bb10163cff00318939c01251e9f5c3acd196
Author: Denis Oliver Kropp 
Date:   Mon May 28 17:06:04 2007 +0200

    Keeps API compatibility.
    
    Added fusion_reactor_attach/dispatch_channel() with the older
    calls using channel zero.

commit 626ad855b335426e44da22f52a70f1c82a6a266b
Author: Denis Oliver Kropp 
Date:   Mon May 28 14:33:51 2007 +0200

    Removed call_arg option from dispatch callback. It will be used for something else.

commit 4ba4f45f8db7e8b7a6145562e0ebfb9d08b3ed10
Author: Denis Oliver Kropp 
Date:   Mon May 28 11:48:18 2007 +0200

    Follow FusionCall API changes.

commit 259d8890d3103da98c31b39499f6ee22930da9fa
Author: Denis Oliver Kropp 
Date:   Mon May 28 10:46:00 2007 +0200

    API break!
    
    Changed call handler function type.
    
    +typedef enum {
    +     FCHR_RETURN,
    +     FCHR_RETAIN
    +} FusionCallHandlerResult;
    +
    +typedef FusionCallHandlerResult (*FusionCallHandler) (int           caller,   /* fusion id of the caller */
    +                                                      int           call_arg, /* optional call parameter */
    +                                                      void         *call_ptr, /* optional call parameter */
    +                                                      void         *ctx,      /* optional handler context */
    +                                                      unsigned int  serial,
    +                                                      int          *ret_val );
    
    The return value defines the library's behaviour after exiting from the handler.
    To return a value immediately, write to *ret_val and return FCHR_RETURN.
    
    If you want to make a call later on to fusion_call_return() yourself, use FCHR_RETAIN.
    
    The new serial value allows to have more than one call pending while calls can
    be returned in any order. The caller is still blocked on its single call, of course.
    
    +DirectResult fusion_call_return ( FusionCall          *call,
    +                                  unsigned int         serial,
    +                                  int                  val );

commit 04d8bd665987909eb07b37e77f51ff2361dc172a
Author: Denis Oliver Kropp 
Date:   Mon May 28 10:36:00 2007 +0200

    Additionally check if SOPATH is defined when checking for DFB_DYNAMIC_LINKING
    to do a strange workaround which was needed at some point, but I don't remember
    and plan to remove this.

commit e1d40d341a808bdd9112a4fad06f69bd58b5f14b
Author: Denis Oliver Kropp 
Date:   Sun May 27 12:05:45 2007 +0200

    Added fusion_reactor_set_dispatch_callback() with a test.

commit 98020fc92d03026bde70772bfe01634b8bce9e3b
Author: Denis Oliver Kropp 
Date:   Sun May 27 12:05:27 2007 +0200

    Fix zero FusionID in forked process by entering the world after reopening it.

commit 4b253a59842f91db228924d579423594258e0950
Author: Claudio Ciccani 
Date:   Sun May 27 10:07:44 2007 +0200

    Removed limit of 8x8 surfaces:
    apparently it comes from the Rage128 driver but it doesn't apply to Radeon(s).

commit 8a1f12ee0e8273a36db3b8825edc5cf56fb2f3bc
Author: Ville Syrjala 
Date:   Wed May 23 23:16:08 2007 +0300

    matrox: Add RGB444 and RGB555 support.

commit e467eba04f4776ada3c95888b094cde04876f87d
Author: Ville Syrjala 
Date:   Wed May 23 22:23:36 2007 +0300

    mach64: Add RGB444 and RGB555 support.

commit dfb1d44c61e614974725b48470a3920092d5b1eb
Author: Ville Syrjala 
Date:   Wed May 23 22:30:29 2007 +0300

    Plug a memory leak in the PNG image provider.
    
    Thanks to Eugene Everson.

commit f33776a36ad561d40ede15bb565f91468f05007c
Author: Denis Oliver Kropp 
Date:   Tue May 22 22:50:13 2007 +0200

    Fix code that controls single/double buffer window
    
    creation for primary surfaces in windowed mode. If
    DSCAPS_FLIPPING is set, it uses one buffer which
    already requires a Flip due to the window. Only if
    DOUBLE is set explicitly, create two buffers.

commit c91b87c6cab9e6071b9d7fe7cce0d3399acb2e18
Author: Claudio Ciccani 
Date:   Tue May 22 17:54:17 2007 +0200

    Reverted default border mode to CLAMP_LAST.

commit 1822b835b992367da001d2c4292b0f3c15ee72fa
Author: Denis Oliver Kropp 
Date:   Tue May 22 13:02:12 2007 +0200

    Added advanced window geometry for positioning and scaling of windows
    relative to their own bounds, with ability derive from parent geometry.
    
    DFBWindowGeometryMode: DWGM_DEFAULT, DWGM_FOLLOW, DWGM_RECTANGLE, DWGM_LOCATION.
    DFBWindowGeometry: mode, rectangle, location.
    
    IDirectFBWindow::SetSrcGeometry() and IDirectFBWindow::SetDstGeometry().
    
    Added generic dfb_window_set_config() for simplifying core code and moving
    config handling into interfaces.

commit d82a8e129b09a38e6cc8f966bdd6e2baf2709303
Author: Denis Oliver Kropp 
Date:   Tue May 22 12:49:55 2007 +0200

    New layer configuration system, staying compatible with older options:
    
      init-layer=                Initialize layer with ID (following layer- options apply)
      layer-size=x    Set the pixel resolution
      layer-format=     Set the pixel format
      layer-depth=       Set the pixel depth
      layer-buffer-mode=(auto|triple|backvideo|backsystem|frontonly|windows)
      layer-bg-none                  Disable background clear
      layer-bg-color=AARRGGBB        Use background color (hex)
      layer-bg-image=      Use background image
      layer-bg-tile=       Use tiled background image
      layer-src-key=AARRGGBB         Enable color keying (hex)

commit cd983756cf48cc5adc54eeaf17a5ca606c4ec4fb
Author: Denis Oliver Kropp 
Date:   Tue May 22 12:34:42 2007 +0200

    igittigit

commit 8f5294201ad2e15c566563dfd544816bef601378
Author: Claudio Ciccani 
Date:   Mon May 21 21:16:44 2007 +0200

    Set texture border mode to CLAMP_TO_BORDER when using TextureTriangles()
    (for compatibility with Xrender/Cairo).

commit 05b15944eb91f14a7dacdc37fc6eed13e3e2983a
Author: Claudio Ciccani 
Date:   Sat May 19 10:44:12 2007 +0200

    RGB555 support.

commit 0ab0c8406252846113496a0ed4fcc75f6eccdde5
Author: Claudio Ciccani 
Date:   Tue May 15 21:24:28 2007 +0200

    Workaround to make forked processes work with fusion:
    if the master forks, release shared memory only when the child exits.

commit 130e091f281f290d10a7117a0bb6c512e611bf82
Author: Claudio Ciccani 
Date:   Mon May 14 17:26:33 2007 +0200

    Support RGB555 and RGB444.

commit 4edc1b1e122742d9b764ef92de97b4cbed014356
Author: Claudio Ciccani 
Date:   Mon May 14 14:59:43 2007 +0200

    Optimizations again.

commit 6dccd0b712e9e8aef9e8acbf786231a0e02fe951
Author: Claudio Ciccani 
Date:   Sun May 13 19:17:51 2007 +0200

    Fixed previous commit (missing some switches).

commit 7b95216119505437aee894b15a76ee065405f822
Author: Claudio Ciccani 
Date:   Sun May 13 19:12:59 2007 +0200

    Added support for RGB555.

commit 175996969fa3d1c159d81f3d297691ea78e98b03
Author: Claudio Ciccani 
Date:   Sun May 13 18:49:23 2007 +0200

    Made DisableAcceleration( DFXL_DRAWSTRING ) work.

commit a949dea3a711e26bd16bdaf1b60e7a66f675a57e
Author: Claudio Ciccani 
Date:   Sun May 13 17:27:07 2007 +0200

    Still optimizations.

commit 79dba40188d55587dee815b29fbc8aecd72d6b6b
Author: Claudio Ciccani 
Date:   Sun May 13 16:28:02 2007 +0200

    Optimizations.

commit 7dfb4e14a2235945e4fbe1f54e722f925a521591
Author: Claudio Ciccani 
Date:   Sun May 13 15:27:07 2007 +0200

    Optimizations and cleanup.

commit 6f1c7ee42abeb6c341bf294d4da8fa74f9d1e62e
Author: Claudio Ciccani 
Date:   Sun May 13 11:25:51 2007 +0200

    Fixed support for premultiplied surfaces.
    Dropped down blits from system memory on the NV20 (crashes on Xbox).

commit d6ec7e5f66faec146df5c279ab6f2e0a66acce13
Author: Denis Oliver Kropp 
Date:   Tue May 8 22:58:44 2007 +0200

    Added DWDESC_OPTIONS and DWDESC_STACKING to give initial values in the
    DFBWindowDescription using the new fields 'options' and 'stacking'.
    
    Added DWDESC_PARENT to DFBWindowDescriptionFlags and 'parent_id' to
    DFBWindowDescription. This can be used to associate a window to another,
    but it's up to the WM to implement it. In SaWMan this makes the window
    cover exactly the area of the parent window including scaling if needed.
    Associated windows do not get focus or events themselves, but their parent.
    
    Added IDirectFBWindow::SetKeySelection() that selects a mode for filtering
    keys while being focused. The selection defines whether all, none or a
    specific set (list) of keys is selected.
    
    Added DFBWindowKeySelection featuring DWKS_ALL, DWKS_NONE and DWKS_LIST.
    
    Added IDirectFBWindow::GrabUnselectedKeys() and UngrabUnselectedKeys()
    to have a key collector window receiving all keys that the focused
    window did not select.
    
    Added DFBWindowEventFlags featuring DWEF_RETURNED so far, which means that
    the event has been returned, i.e. has not been consumed by the original
    recipient. The DFBWindowEvent field 'flags' has also been added.
    
    Simplified internal dfb_layer_context_create_window() and dfb_window_create()
    and replaced dfb_window_*grab*() by dfb_window_change_grab().
    
    Changed IDirectFB::CreateSurface() behaviour: For primary surfaces in
    windowed mode, only create a window with two buffers if DSCAPS_DOUBLE
    is set, but not DSCAPS_FLIPPING.
    
    Added DWDESC_PARENT to DFBWindowDescriptionFlags and 'parent_id' to
    DFBWindowDescription. This can be used to associate a window to another,
    but it's up to the WM to implement it. In SaWMan this makes the window
    cover exactly the area of the parent window including scaling if needed.

commit 1fa85033db594e51e811307775ceaa4b1eee882a
Author: Denis Oliver Kropp 
Date:   Tue May 8 19:46:09 2007 +0200

    Only use FBDev systme module data in linux input driver if system is built.

commit 24b48dad33f667887addf612238f446012f05b54
Author: Denis Oliver Kropp 
Date:   Tue May 8 17:52:13 2007 +0200

    gcc 2.95 fixes

commit d22702f8fb2b31fd67e6586022a7b00bee5625b3
Author: Denis Oliver Kropp 
Date:   Tue May 8 17:37:06 2007 +0200

    Sorted format_strings[].

commit 33bf1df595d7392e626cc30bcdd531dbc7173b16
Author: Denis Oliver Kropp 
Date:   Tue May 8 17:21:56 2007 +0200

    RGB444 and RGB555, thanks to Daniel J Laird!

commit bbc5ef93f0fb97e7a9df9bf29c5b04d6cff5d890
Author: Denis Oliver Kropp 
Date:   Tue May 8 16:51:50 2007 +0200

    gcc-2.95 fix

commit 5bd55fa674304859b9dade0849ec0cc6cfb708d3
Author: Denis Oliver Kropp 
Date:   Tue May 8 16:48:07 2007 +0200

    Removed obsolete warning.

commit 692d8f9ffa334f41b28bd27c81e7daaf50da40ea
Author: Denis Oliver Kropp 
Date:   Tue May 8 16:06:31 2007 +0200

    1.1.0

commit 2797c2cc4b15e0e94b9dbab6221f9c536b175ac5
Author: Ville Syrjala 
Date:   Tue May 8 03:01:31 2007 +0300

    Pan the layer to follow the mouse cursor (aka. virtual resolution).

commit 6cde04843dfdbe77b09bc4bc5b56305140b6687c
Author: Ville Syrjala 
Date:   Tue May 8 02:59:18 2007 +0300

    Add source rectangle support to fbdev layer.

commit 9d6fa50384abdce554d4ae54d548865f74b9f2f1
Author: Claudio Ciccani 
Date:   Tue Apr 24 17:11:58 2007 +0200

    Fixed a segfault when freeing reactor nodes.

commit 6904ef61213633cbbc3b789bbe8fcdca4c2ff87c
Author: Claudio Ciccani 
Date:   Mon Apr 23 19:03:29 2007 +0200

    Clarified some aspects about the behaviour of IDirectFBWindow::Bind().

commit f7abc96cc2fcee72fd35e7ec4220f05a389b9fd4
Author: Claudio Ciccani 
Date:   Mon Apr 23 16:45:32 2007 +0200

    Implemented IDirectFBWindow::Bind()/Unbind(). :)
    
    The change is backward and binary compatible.

commit 2735a9544c999369a5000324dbdd550c7c276268
Author: Ville Syrjala 
Date:   Sun Apr 8 02:09:39 2007 +0300

    Use D_ARRAY_SIZE() macro where appropriate.

commit 47d97462a08240236683b4cc3aa77c66bd8ca241
Author: Ville Syrjala 
Date:   Thu Apr 12 02:49:39 2007 +0300

    Fix evdev ioctl() parameters.

commit a7d95847288c8c490c4ea4d60e973e2838e5ac2c
Author: Denis Oliver Kropp 
Date:   Wed Apr 11 16:13:42 2007 +0200

    Previously, in dfb_thread_destroy() if a thread is neither
    detached not joined, it was just canceled and the struct was
    freed, magic cleared etc.
    
    To avoid an assertion in the cleanup handler of the thread,
    detach it before canceling, don't free its struct etc.

commit db515696b39af71bea30e09d2fd48a1040addd0b
Author: Denis Oliver Kropp 
Date:   Wed Apr 11 16:04:37 2007 +0200

    Misc debug messages.

commit 6299a9a345d38f9b94e6b82d415dbd4554745e15
Author: Denis Oliver Kropp 
Date:   Wed Apr 11 16:02:01 2007 +0200

    Fix copy'n'paste error that caused values to be freed if keys should be.

commit f76465a11cd72af4dfbbe48f1ed9ec4abc67b045
Author: Denis Oliver Kropp 
Date:   Wed Apr 11 16:00:12 2007 +0200

    Fix (un)locking.

commit e286be1d7ff4149e6ee6b710e6f26d9077182a95
Author: Denis Oliver Kropp 
Date:   Mon Apr 2 09:31:33 2007 +0200

    Fixed false assertions...

commit 7796a5e3a8b1235f1e78fae540837198858acbcd
Author: Denis Oliver Kropp 
Date:   Sun Apr 1 15:32:40 2007 +0200

    Validate clip in dfb_state_update() also if destination
    was just set manually, not via dfb_state_set_destination().

commit d44db9c74b717ae9b7edb51cfd684dc4b88d5c15
Author: Denis Oliver Kropp 
Date:   Sat Mar 31 16:36:06 2007 +0200

    Thanks to Thanks to sridewa #sridewa gmail.com#!

commit 2645d66bd67746e970741839f9d4ec11a9c2c5a6
Author: Denis Oliver Kropp 
Date:   Wed Mar 28 12:07:42 2007 +0200

    Clear header structure before (partially) filling it,
    to avoid leaking data from stack into file.
    
    Turn on memory allocation debugging.

commit c569762cef58f40fbee123fd5b7ddbd64a813a07
Author: Denis Oliver Kropp 
Date:   Sat Mar 24 22:35:31 2007 +0100

    Added missing pthread_rwlock_destroy().

commit 330450df944b491bef4d0c49f8567f8f3cc41be9
Author: Denis Oliver Kropp 
Date:   Sat Mar 24 12:25:11 2007 +0100

    Fix general dead lock problem with reactors.
    
    - Replace mutex by read/write lock.
    - Write lock during attach/detach()
    - Read lock during dispatch()
    - Only remove reactions from node if write lock is held.
    - Don't link reactions into the node, but allocate an extra link structure, to avoid accessing foreign and probably deallocated memory.
    - In dispatch() if reaction returns RS_REMOVE, just mark the link as dead and don't write to reaction structure, which might be deallocated by the reaction handler.
    - More changes, even more details...

commit fcc80bc32ebf455329130d648e70336e3f3d9b5a
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 16:21:44 2007 +0100

    Use FusionHash for arena fields.
    
    Avoids multiple fields with the same name and just replaces the value.
    
    Should also be a faster for arenas with more than three or four fields.
    
    Minor code cleanup in lock_arena().
    
    Added debug domain and messages.

commit 7711a22301ebf93904fb3997cba09f5b5e6fe7e8
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 16:18:02 2007 +0100

    Added fusion_hash_set_autofree() to enable/disable
    automatic freeing of values and/or keys.

commit 3663b176f629e2487bc32095dc3c3a9591a1f681
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 16:11:41 2007 +0100

    Reinitialize entries in static pool array properly.
    
    Added debug domain and messages to SHMALLOC and friends.

commit 0a6c3fd384db48d679f274b31f21fb03db08812e
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 15:54:42 2007 +0100

    Fix typo in error message.

commit c3b24b2df174cdb029d50485c9aed75a62555736
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 15:46:30 2007 +0100

    Close file descriptor of shared memory files and be happy with just the
    static mmap() and the filename for using truncate() instead of ftruncate().
    
    
    via git-CVS emulator

commit d3a576aef5806c82576abdd8ec936dd0f6832d29
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 15:40:11 2007 +0100

    Added direct_thread_detach() and direct_thread_is_detached().
    
    Use pthread cleanup to free the DirectThread structure etc.
    
    
    via git-CVS emulator

commit 3fcc94f1f0964fc19d5e228ba4df8a67d1501090
Author: Denis Oliver Kropp 
Date:   Fri Mar 23 15:03:59 2007 +0100

    Fix ARGB on RGB16 blending. Use Duff's Device and optimize for 0% and 100% opaque.
    
    
    via git-CVS emulator

commit 8ce787dedf27a17394b73e94a9e0c832593b3260
Author: Denis Oliver Kropp 
Date:   Thu Mar 22 11:31:20 2007 +0100

    Fixed RGB24 to RGB16 conversion.
    
    
    via git-CVS emulator

commit 848cfefef00b738d736ceac287001da1141de9a5
Author: Denis Oliver Kropp 
Date:   Wed Mar 21 00:36:28 2007 +0100

    Use setjmp() before having libpng trying the longjmp().
    This avoids the unwanted abort().
    
    
    via git-CVS emulator

commit 22779946a4f70a31f8d79be3bac96b635ad5d338
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 18:30:21 2007 +0100

    Test
    
    via git-CVS emulator

commit d2038767ceaab5c746d73c2ff31d753a632f9bd3
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 18:18:55 2007 +0100

    test

commit e1d02c08381e753e2c15106f492f166fe0c525c6
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 18:16:27 2007 +0100

    test

commit 0c7afb4c46387e001cebc9bd68a085965f1d2f29
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 18:12:25 2007 +0100

    test

commit 175927a7e63be7d6e111fa1677fb88f12704ca6b
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 18:10:08 2007 +0100

    Test

commit c70d1312b75d47991e9aeab733aa98b645e67ff7
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 18:02:47 2007 +0100

    test

commit 70f47b5508245a501487fe194d3149d6a924b014
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 17:52:43 2007 +0100

    Test

commit f511fe426936a2131835d7efc7c48fb33b372f88
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 17:43:58 2007 +0100

    Test
    
    via git-CVS emulator

commit 8f03a4f0485a1f1160b014fcc7ac4357b46189fa
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 17:42:24 2007 +0100

    Test
    
    via git-CVS emulator

commit bd60a241b6a71be7f7649d8531b7be10a4e77c65
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 17:40:36 2007 +0100

    Test
    
    via git-CVS emulator

commit ddb706580c35327cabdaeae85850c0287694ca16
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 17:38:47 2007 +0100

    Test
    
    via git-CVS emulator

commit 5132c7082d36e19ade81cc9b2fc6874947dd125b
Author: Denis Oliver Kropp 
Date:   Tue Mar 20 17:34:33 2007 +0100

    Test
    
    via git-CVS emulator

commit 7750c66985bc64958e10055245d662777f61b6e6
Author: Denis Oliver Kropp 
Date:   Sat Mar 17 00:02:28 2007 +0100

    Revert to old format.

commit be496f6044188236a2b52859f3d0cccabb96dd4b
Author: Mark Adams 
Date:   Wed Mar 7 10:39:49 2007 +0000

    Fix blitting of planar surfaces (YV12/I420) when a source rectangle is used
    or the source and destination surfaces are different sizes.

commit e7d1e212ec250cd9f8ae43fc2c79b904f6208278
Author: Denis Oliver Kropp 
Date:   Sun Mar 4 01:05:28 2007 +0000

    hotfix

commit 8fbcdaeb947cd5fac4d09e3a76ce2a5322210586
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 23:08:04 2007 +0000

    updated

commit affa1214d3097c2834a4407e98e71c908751fbf8
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 22:46:13 2007 +0000

    1.0.0

commit b595995119c8fa9fca93c278cc3c90a837f44546
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 21:53:44 2007 +0000

    Fix type punn-ishment.

commit e46da95536009730b0d26c8462f0c322efd918df
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 20:53:51 2007 +0000

    Updated copyright information.

commit f873d6cc66e68df4056c36e9a42fe0f5377a264c
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 20:06:47 2007 +0000

    |     =======================|  DirectFB 1.0.0-rc5  |=======================
    |          (c) 2001-2007  The DirectFB Organization (directfb.org)
    |          (c) 2000-2004  Convergence (integrated media) GmbH
    |        ----------------------------------------------------------------
    
    
    comments?

commit 5dea556e582cc510cad0556df3247b4a6438faf7
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 19:57:30 2007 +0000

    Thanks to Ben Combee for adding DIEF_FOLLOW support to SDL Input!

commit d6440af4b9a9538dbf1a2c5f32fa5b2022f93bd6
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 19:35:03 2007 +0000

    ignore

commit 67852690cb18711f2605bcc9e523c8f43e53ca64
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 19:33:34 2007 +0000

    Use local memory (D_MALLOC instead of SHMALLOC) if pool is NULL.

commit 273e33c9f02e985865526b2713acf4d036fadd95
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 19:32:17 2007 +0000

    typo

commit 78e6f0d83458c51eeb3fd28b7b390d9389870b83
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 19:00:51 2007 +0000

    Wuah...

commit db8a2db9657b9629e9c4df7a3ae21ac8e8461a88
Author: Denis Oliver Kropp 
Date:   Sat Mar 3 11:01:46 2007 +0000

    align output

commit 1a563fcbba64619b2f2a6def77c59a433740d9f5
Author: Denis Oliver Kropp 
Date:   Fri Mar 2 20:39:29 2007 +0000

    Updated.
    
    TODOs for 1.0.0 added, feel free to extend this list :)

commit 8f9e8cac1c4836bceef7355309d0fc326cad559a
Author: Denis Oliver Kropp 
Date:   Fri Mar 2 20:14:44 2007 +0000

    New option "vt-num=" to use given VT instead of current/new one.

commit 2db3166fb667897a7cb838fc64b0cb2deec6fe88
Author: Denis Oliver Kropp 
Date:   Fri Mar 2 19:51:01 2007 +0000

    RC5

commit 490e2a5924847cc6a06c177eb1bcbc48bac5bebb
Author: Denis Oliver Kropp 
Date:   Fri Mar 2 19:48:20 2007 +0000

    Implemented 1 and 2 bit indexed PNG support.

commit 7bf75e3cc78a0b358f863efea7fe10138fc43230
Author: Denis Oliver Kropp 
Date:   Fri Mar 2 17:44:44 2007 +0000

    Show creator of references.

commit c3d599f8b31bd9afe856b94223f0933142c42e58
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 21:12:23 2007 +0000

    Don't abort if an unsupported option is found, but give a fat warning.

commit c39131aa31bcc2bf1b3920a02ab414744e61342f
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:59:57 2007 +0000

    Don't deallocate locked buffers on suspend.

commit 280e77614e48406f14df21e7a52f81dea35981e0
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:54:56 2007 +0000

    Free previous string when shmfile-group is overridden.
    Don't set a default group.

commit bc86cf3350fed27d8f5a4d2381a3af3bab99d6c3
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:47:10 2007 +0000

    typo :(

commit c5d20401633e1c9385366320af1966c1fb00ef3c
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:45:29 2007 +0000

    Surface manager always deallocates all auto video instances when suspending.
    This has the nice side effect of free space being defragmented after resume :)
    
    Added option "[no-]thrifty-surface-buffers" to free sysmem instance on xfer to video memory.

commit 606aeb4bb55672bd5f51932cf1b06ca5f3b10f1a
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:23:18 2007 +0000

    Added fast RGB24 to RGB16 conversion (little endian only).

commit a4fc36250c63e5f0e79b19d0ddd9ae74d3e57654
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:13:28 2007 +0000

    Added keypad equal support.

commit e841d7c455b9bfce6be4c0a2b2e2d4251f4817be
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 20:07:47 2007 +0000

    New option "shmfile-group=" to set the group that owns shared memory files.

commit 78a849cf6a1f4b1d8e1503c3a6d6ce3c06af9e78
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 19:59:51 2007 +0000

    This patch adds '--with-message-size=SIZE' to allow fusion messages up to SIZE bytes (default is 1024).

commit b50ddd5b53d12900ee837afa7a69942e0e1334c0
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 19:56:29 2007 +0000

    This patch sets FD_CLOEXEC on the frame buffer device file descriptor.

commit d6a296f82431342e75627b33e8064048223db751
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 19:49:56 2007 +0000

    Don't notify WM if cursor opacity didn't actually change.

commit 26eac7159fc79e061b4a712b5b3d614de4a8ecc4
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 19:48:54 2007 +0000

    This fixes unconditional access to conditionally allocated data, thanks to Ben Combee!

commit cf8d109b1d6c23c9761d370a1d2d1e924b6e5f1d
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 19:44:46 2007 +0000

    Added dfb_gfxcard_get_device_data().

commit ab497c32f62c4e0e7c1df7396fdabf7169013ea1
Author: Denis Oliver Kropp 
Date:   Sat Feb 24 19:40:33 2007 +0000

    Improved robustness of VT switching, e.g. for rapidly switching back and forth.

commit 5ed9b956381cbeeea463e2bac37fcee88682de7f
Author: Claudio Ciccani 
Date:   Fri Feb 23 16:10:46 2007 +0000

    Finally found the way to embed MPEG streams within the RMF container.
    Dropped down RTSP seekability (never worked fine).

commit 0253831e77c81ff7cf46b59f56a849b1338507a5
Author: Claudio Ciccani 
Date:   Wed Feb 21 11:05:21 2007 +0000

    Another (binary compatible) API change: added DVSTATE_BUFFERING.

commit 919995193f17be8c217f7ece366ff867903eb0f8
Author: Denis Oliver Kropp 
Date:   Mon Feb 12 11:55:35 2007 +0000

    Just another test app.

commit 32e5459170f2a9e4ef9f8dfb7d441ccbe03c9379
Author: Denis Oliver Kropp 
Date:   Sat Feb 10 23:22:10 2007 +0000

    Thanks to Philip Jägenstedt :philipj 0pera c0m: for fixing the H3600 check!

commit 255c93750d1b2d4c17c51ab4aee803edc4c4cb33
Author: Mark Adams 
Date:   Fri Feb 9 14:57:03 2007 +0000

    Attempt to fix problems with redefinition of s64, u64 types.

commit d113ba23bedf936ad37115d1f83b3dc0be99fee4
Author: Mark Adams 
Date:   Fri Feb 9 12:16:54 2007 +0000

    Attempt to fix problems with redefinition of s64, u64 types.

commit 66d84298ec6153da512be376b7394602171701c5
Author: Claudio Ciccani 
Date:   Fri Feb 9 11:32:15 2007 +0000

    Converted old dfb types to new types.

commit 807ce0aff857ac99042ddd08005ea925e2193459
Author: Denis Oliver Kropp 
Date:   Fri Feb 9 01:44:20 2007 +0000

    The uncommitten...

commit eafaa77fd598efb2e8cdd3111ef8a142e87af1ff
Author: Ville Syrjala 
Date:   Wed Feb 7 22:45:43 2007 +0000

    Including linux/unistd.h appears to be unnecessary.

commit 12a5f5a7f4983122a6189a21e36c73e67c4faed2
Author: Ville Syrjala 
Date:   Tue Feb 6 21:27:12 2007 +0000

    Don't try to read() if select() returned with EINTR.

commit ba381d1cc20bce277041ee9fee27e1e0a20609df
Author: Ville Syrjala 
Date:   Tue Feb 6 21:21:20 2007 +0000

    Make CODING_STYLE actually follow it's own recommendations ;)

commit 13a840994684a8975fa3316da05ac26b4a2dbe76
Author: Mark Adams 
Date:   Tue Feb 6 14:46:00 2007 +0000

    Fix video layer flicker when layer is positioned partially off screen.
    Also improve positioning accuracy in this situation (but with a little more
    masking at the screen edge).

commit b82c237a827fa1b5a8a0c60bc73210aceffa1b74
Author: Ville Syrjala 
Date:   Mon Feb 5 21:50:14 2007 +0000

    Add a configure check for struct input_absinfo.

commit 7ea7063ac7a1270d554a3c3ca0c90b0e82f3d7c1
Author: Denis Oliver Kropp 
Date:   Mon Feb 5 11:48:52 2007 +0000

    Many thanks to Vaclav Slavik for these many fixes :-)
    
    * Previously, the process attached itself to a new controlling TTY
    only if vt_switch option was on. This patch changes it to always
    (unless VT handling is completely disabled, of course) attach the
    process to the TTY being used by the app as the new controlling TTY.
    This is because we always need some controlling TTY, without it, there
    could be SIGHUP/SIGCONT signals (see e.g. my post about re-adding
    setpgid() call). Note that the patch moves TIOCSCTTY call outside
    of "if vt-switch" branch, but completely removes TIOCNOTTY - - that's
    because the latter is not needed, setsid() already detached the
    process from controlling TTY. So "vt-switch" now only
    controls "physical" change of the currently active console.
    
    * /dev/tty? files are opened with O_NOCTTY. Linux kernel has a feature
    that if a process without controlling TTY opens a TTY device, it's
    made its controlling TTY, unless you use O_NOCTTY, so this change
    ensure that we only attach to the desired TTY explicitly using
    TIOCSCTTY.
    
    * Moved TIOCSCTTY before KBSETMODE use, otherwise non-root users get
    EPERM from KBSETMODE ioctl(), because you can't do that operation on
    anything other than your controlling TTY normally.
    
    * Removed setpgid() calls, because they interfered with setsid() later
    and weren't really necessary now that other cTTY problems were fixed.
    Ditto for the removed dfb_vt_detach() call (I couldn't find any
    information about why it was there in the first place, but everything
    works without it as far as I can tell).

commit 1f63064d4fa2ef81f1388a852277ff66c416dafb
Author: Claudio Ciccani 
Date:   Sat Feb 3 11:54:58 2007 +0000

    Avoid cutting away the last pixel of a planar yuv row.

commit 121d7ca0a14569dbc971865fdf3356cc76c3a004
Author: Claudio Ciccani 
Date:   Sat Feb 3 11:36:33 2007 +0000

    Changed my email address.

commit 90bf0a5075d84286580525889e0a61ff064c8e0d
Author: Claudio Ciccani 
Date:   Sat Feb 3 11:35:45 2007 +0000

    Distribute autogen.sh.

commit e83cc57ed68f395f853d15315b6eb41be508144e
Author: Denis Oliver Kropp 
Date:   Fri Feb 2 23:10:43 2007 +0000

    Add new lines to work around nested structs being taken by the doc generator.

commit 00ad661e60b8a4de0ac3b9ae44b635ea4576d94c
Author: Claudio Ciccani 
Date:   Fri Feb 2 18:30:41 2007 +0000

    Display my new email address (the old one may not work in future).

commit b548b38e012ca1011a4a016b2931278dee5a431a
Author: Mark Adams 
Date:   Thu Feb 1 18:42:44 2007 +0000

    Allow for improved timing of video layer flips when the FIELD_PARITY option
    is in use.  The improvement is only possible if the kernel framebuffer
    supports it.  If not, we do the best we can but occasional glitches may
    occur under high processor load.

commit 833344e2caa02f416446e6e8ad45a08d162ee1be
Author: Denis Oliver Kropp 
Date:   Mon Jan 29 20:28:50 2007 +0000

    updated for RC3

commit b87c1df32781e8159ff6b9dee04e1a28ff1137e2
Author: Denis Oliver Kropp 
Date:   Mon Jan 29 20:27:21 2007 +0000

    Argh, reading the NEWS I recognized I forgot to change the ambiguous
    fusion_reactor_sync() into fusion_reactor_direct() to make it more clear:
    
    Specify whether local message handlers (reactions) should be called directly.

commit bddb52854e01fe4305086c10194ca260e2d8ddaf
Author: Denis Oliver Kropp 
Date:   Mon Jan 29 15:47:57 2007 +0000

    updated

commit d60c89ecf9cfe07a605657bc16ac8ea0718daabb
Author: Denis Oliver Kropp 
Date:   Mon Jan 29 04:13:29 2007 +0000

    We should "Support vga16, i.e. add DSPF_LUT4."

commit 4b923dfec340950ebd29acd6f52fb2d59d758220
Author: Denis Oliver Kropp 
Date:   Mon Jan 29 01:00:45 2007 +0000

    In drivers including  do that before  gets in.

commit d55bc774043e5ece1d6c2b1efd85bcfe975ac5ce
Author: Denis Oliver Kropp 
Date:   Mon Jan 29 01:00:01 2007 +0000

    Include  before  is included somehow.
    
    This works around the 64bit type clash between  and  (used by dfb_types.h).
    
    Any help for proper fixes or some explanation would be appreciated!

commit 6d6a481e8b42f3a60c01e09061082773ec172b0e
Author: Denis Oliver Kropp 
Date:   Sun Jan 28 21:24:44 2007 +0000

    In dfb_gfxcard_reserve_memory() show sizes in warning about too less memory,
    also align the requested size according to byte offset alignment or warn if
    that's not specified, yet.

commit 6428590ce4a688bc0ecc8441bd03e0bbdc74c2d0
Author: Denis Oliver Kropp 
Date:   Sat Jan 27 18:03:23 2007 +0000

    Fix fusion_sync() timeout during XDirectFB shutdown.
    
    Apart from other small changes, fusion_sync() returns DFB_OK in case
    the select() call was interrupted (EINTR). Continuously sent signals
    could have cause these timeouts, but I don't know if and why they would
    be there.
    
    It's still a hot fix, as it could be that the call is interrupted with
    data available, couldn't it?
    
    A proper solution could be to support fsync(fusion_fd), but what about
    the timeout?

commit ba6b67234d44eea9c580bf8e9f919f67b670a6d7
Author: Denis Oliver Kropp 
Date:   Sat Jan 27 15:23:48 2007 +0000

    Further minimize impact of a shutdown issue which only seems to happen with
    XDirectFB, e.g. on Ctrl-Alt-BackSpace. The problem is that waiting for the
    dispatcher to process pending messages fails, or at least the detection is
    broken whether there are any pending messages.
    
    Only call fusion_sync() if the pool that is to be destroyed has objects.

commit b8bc3b706492a4dabca1b5801c534fc192351598
Author: Denis Oliver Kropp 
Date:   Fri Jan 26 23:32:24 2007 +0000

    Added -lm for sin().

commit 16f4e0f72494d8479e1c867066c8ab86b137c06a
Author: Ville Syrjala 
Date:   Fri Jan 26 08:24:38 2007 +0000

    Revert the previous AiRGB change. Not sure what I was thinking...

commit ad60e033b6c3b35a3e05f9468386ed297bece1ba
Author: Ville Syrjala 
Date:   Thu Jan 25 21:21:21 2007 +0000

    Source color alpha value wasn't always correctly inverted for AiRGB.

commit 6a1089a0ae9b1693d1cf6b7b26813e67be22dcfc
Author: Denis Oliver Kropp 
Date:   Thu Jan 25 02:52:44 2007 +0000

    Use DFBUpdates to manage an update queue and do optimizations like taking
    the bounding box instead of multiple smaller regions if the number of pixels
    in the bounding box is not much higher than the total of the smaller ones.
    
    Even this takes the number of smaller regions into account, because of the
    increasing overhead per region.
    
    Next to performance, the visual experience is enhanced by coalesced updates.
    
    Another advantage is that when multiple regions are updated, first it renders
    all regions and then it flips all regions. Previously, each time the flip was
    done immediately for each rendered region.

commit 5606d17f9ecc4d06b019151198eaacf349ebc7fd
Author: Denis Oliver Kropp 
Date:   Thu Jan 25 01:34:23 2007 +0000

    Fixed missing bounding box update when a newly added update is merged with an existing.

commit cf76229662140c451c6e6cc39dcfa52bece16444
Author: Ville Syrjala 
Date:   Wed Jan 24 23:48:21 2007 +0000

    Fixed a bug in dfb_gfxcard_tileblit(). It first removes all completely
    clipped tiles, but then forgets the new dx1 coordinate and starts
    blitting from the original dx1 position.

commit 97bd3995fb662cfc9933a6fb8ed8505a4423446b
Author: Ville Syrjala 
Date:   Wed Jan 24 22:10:56 2007 +0000

    SMF_CLIP was ignored.

commit 86519ba74b49e52284a611956de71dce43f18618
Author: Denis Oliver Kropp 
Date:   Wed Jan 24 03:56:32 2007 +0000

    Cleanup, reorder, rephrase, ...

commit 1d5e207f835aec6d8527b387797d718033b5c4c3
Author: Denis Oliver Kropp 
Date:   Wed Jan 24 03:12:35 2007 +0000

    Added fusion_shm_attach_unattached() to attach to pools that have been
    created AFTER fusion_shm_init() attached to pools during fusion_enter().
    
    This can happen easily when starting a number of processes with the new
    "force-slave" option. They'll all block at fusion_enter() until the master
    has completed its fusion_enter().
    
    DirectFB shared memory pools are created by the master after fusion_enter(),
    but during fusion_arena_enter(). Slaves will block at this point again, until
    the master has finished the rest of the setup and returns from entering the
    arena.
    
    When others actually join the arena, right after acquiring the lock for it,
    the new function fusion_shm_attach_unattached() is called to attach to any
    pools created by the master while entering (initializing) the arena.

commit 216286888dab1ba8eb54edce240f446e4f745531
Author: Denis Oliver Kropp 
Date:   Wed Jan 24 02:04:00 2007 +0000

    Added runtime option "force-slave" to always enter as a slave, waiting for
    the master, if not already there. This feature only works with recent kernel
    module.

commit 144e3ef3691c013bcc2abd2f891ee16b5db69ce6
Author: Denis Oliver Kropp 
Date:   Wed Jan 24 01:22:53 2007 +0000

    Read DIRECTFB_SESSION variable after reading all files and DFBARGS,
    so only the command line can override the current session.
    
    Still thinking though, if DFBARGS should override DIRECTFB_SESSION...

commit 79c52e6bdf260d86f09b0f7289c744819aaf3002
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 23:00:07 2007 +0000

    If trace support and shared libraries are enabled, for each library to install,
    also generate a file containing the output of "nm -n ".
    
    That's the command that is used at runtime via popen().
    
    Now the code first checks if it can fopen() a file with the same name as the
    one passed to "nm -n", but with an "nm-n." prefix.
    
    This is both a performance improvement and a nice solution for (embedded) targets
    without 'nm' being available or fast enough.

commit 18585f0743fda2c7a42fc0dbf6d2bf336f212546
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 20:56:04 2007 +0000

    Made direct_snputs() static inline.
    
    Removed assertion 'n > 0', instead return NULL if destination can't
    even hold the zero termination character.

commit 19efc71ab311496ef3b8b839d26470740c7cca80
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 20:49:38 2007 +0000

    Removed  include.

commit 457a0207f9cc43be2d581a7726b2f5cfb6290d94
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 20:48:51 2007 +0000

    Added missing  includes.

commit 91239996d0714ac8c1c3e9a450da37f789397826
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 20:26:54 2007 +0000

    Easy part, replacing strncpy() by direct_snputs().
    
    Replacing all relevant snprintf() will be harder...

commit d2624a70c937219f802e15e09c573cbb374a2086
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 18:47:09 2007 +0000

    Added direct_snputs(s,d,n) to set a string with a maximum size including the
    zero termination. This acts like a strncpy(d,s,n), but always terminates the
    string like snprintf(d,n,"%s",s) which is more or less slower.

commit 3d2abfc029117b398d12fc718d656739cb05e007
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 16:46:55 2007 +0000

    When Meta-P is pressed, only show/enable the cursor if it has ever been set.
    
    This fixes the cursor showing up on my Xv enabled Xawtv window (cursor on video layer :).

commit 6a5910d4c94d700f47a58af5fbe53cd09c665ab6
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 16:33:38 2007 +0000

    Fixed DIKT_UNICODE detection in DFB_KEY_TYPE(symbol) for values > 255.

commit 0f779e4e1ec96f75c560e37b231072ce8d682214
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 16:26:04 2007 +0000

    Do the same as for surfaces recently: revert to direct local reaction calls.
    Fixes rare glitches in heavy window resizing in LiTE.

commit 9a172ce84938ee90f606331e54911af3a78b2fc1
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 16:22:39 2007 +0000

    Reduce timeout in fusion_sync().
    
    At the moment it always seems to fail, but this should be fixed asap.

commit fef7dc8fc21d33a5350058bd94c274ca25c52c53
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 16:21:23 2007 +0000

    Already fixed.

commit 21c5562661535de95b640943fef2004e4e12fd39
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 16:11:30 2007 +0000

    Commented out recent change until it's fixed.

commit de6989fbe17e2f3864589bfefa129c0c4b2b434c
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 13:14:54 2007 +0000

    Use direct_list_move_to_front() in lock_node() as the list could be long
    in case an application attaches to a lot of reactors, most probably its own,
    e.g. using a lot of small surfaces.

commit c08e629fb6817d006a9a9082fff12bda1fe08fc3
Author: Denis Oliver Kropp 
Date:   Tue Jan 23 13:11:46 2007 +0000

    Added direct_list_move_to_front( **list, *link ).

commit 70ca7950f9b3225744e356c6426bd545981ab07d
Author: Ville Syrjala 
Date:   Mon Jan 22 21:31:48 2007 +0000

    Eliminate bashism (function keyword).

commit 7329e0b5a4e973f6daf92008ce9703f84d73d71d
Author: Ville Syrjala 
Date:   Mon Jan 22 21:26:11 2007 +0000

    Fix ALUT44 Clear() by calling dfb_state_set_color().

commit 8969c27479e55c1ed5e599495d9d47fb4afb5ab7
Author: Ville Syrjala 
Date:   Mon Jan 22 21:20:18 2007 +0000

    Fix glyph rendering to indexed formats by calling dfb_state_set_color().

commit 67de5e89280d2b264f71d9e2dfcf2fa7b28c134c
Author: Denis Oliver Kropp 
Date:   Mon Jan 22 19:54:29 2007 +0000

    Only use MADV_REMOVE if kernel version is 2.6.19.2 or higher.
    
    Print info message during startup.
    
    Use fallback definition for MADV_REMOVE (9) if headers don't have it. This
    is ok for now, as we're only using it with 2.6.19.2 or higher anyways. It
    would be bad if this feature was unused just because of the headers at build
    time...

commit 38d27ad4f188a6ee1a4ba62290df6c5974722f1f
Author: Ville Syrjala 
Date:   Mon Jan 22 19:25:54 2007 +0000

    Use cpp templates for 16bpp and 32bpp code.
    - Removes duplicated code.
    - Implements some missing gfx funcs.
    - Fixes missing EXPAND() calls in some acc funcs.
    - Fixes blit direction handling in some 16bpp blit funcs.

commit f3eaefc0cc9fcfe83ae52fd6a87a61790fc7ad16
Author: Denis Oliver Kropp 
Date:   Mon Jan 22 03:06:11 2007 +0000

    That's birthday and christmas at once: Glorious MADV_REMOVE! I found you!
    
    If available, the code for freeing blocks in the heap uses
    
    	madvise( ADDRESS(block), blocks * BLOCKSIZE, MADV_REMOVE )
    
    to punch a whole in the tmpfs file (loosing the data) to really free
    the associated physical RAM.
    
    
    You can see the difference in 'ls -l' and 'df'.

commit 66dd3e6aa38f591f146d904cc23a21978b8af132
Author: Denis Oliver Kropp 
Date:   Mon Jan 22 02:38:50 2007 +0000

    Good bye shared memory segfault cure handler :)
    
    It'd been so easy. Simply mmap() the whole address range once and
    only ftruncate() for resizing the heap.
    
    No more dynamic remapping, no more pending remap messages...

commit 037867173da06f66f683ff5a4ff745b58dadbb95
Author: Denis Oliver Kropp 
Date:   Mon Jan 22 01:24:16 2007 +0000

    Not needed here.

commit 243628484072c7c6070cb58e3d4f62047c79c1ce
Author: Denis Oliver Kropp 
Date:   Mon Jan 22 01:21:27 2007 +0000

    Replaced 'unlink before (re)open or memset' by a simple O_TRUNC, doooh...

commit cabc30e828a060cf06ad2b2bda7087e841c77556
Author: Ville Syrjala 
Date:   Sun Jan 21 22:39:09 2007 +0000

    Fix version check for automake-1.10.

commit d6c7ad84ad54362771c37a8ab167c4d908dd6ed7
Author: Denis Oliver Kropp 
Date:   Sun Jan 21 22:11:25 2007 +0000

    Added a few more formats that make the windowed primary use DWCAPS_ALPHACHANNEL.

commit 4005425cc796a538505f689e8653001dfd3182af
Author: Denis Oliver Kropp 
Date:   Sat Jan 20 04:04:13 2007 +0000

    Use O_APPEND for FER_SLAVE.

commit 9248605c594822d331733bb57d3028a514ae45fa
Author: Denis Oliver Kropp 
Date:   Sun Jan 14 21:06:45 2007 +0000

    Change minimum pool size (without info table) to 8192 (from 16384).
    A value of 4096 didn't work somehow.

commit d87e5a6e1950f28530d85ee6d7f7c76d0307ae4e
Author: Denis Oliver Kropp 
Date:   Sun Jan 14 21:03:34 2007 +0000

    Call dfb_windowstack_resize() and dfb_windowstack_repaint_all() later, i.e.
    after the new settings have been written back into the context's config structure.

commit b14f63813c9fc5dee7737b6ce9986da8bee12f34
Author: Denis Oliver Kropp 
Date:   Sun Jan 14 21:02:11 2007 +0000

    Added FCEF_NODIRECT which forces execution of the call in the Fusion
    Dispatch thread even if it's the calling process' own call.

commit 3f64ddc4f1e2ba8a2526b00a8fb09ceacd6975a3
Author: Andreas Hundt 
Date:   Thu Jan 11 18:05:24 2007 +0000

    - include 
    - -framework CoreGraphics is obsolete in OSX 10.4, use ApplicationServices instead

commit 3549796556d79b5040fef7684a880d25b3925772
Author: Ville Syrjala 
Date:   Wed Jan 10 18:18:24 2007 +0000

    Some stretch ops didn't start at Xphase.

commit 2140dddeea2784c95f63f247badcfe42a424353e
Author: Ville Syrjala 
Date:   Wed Jan 10 18:06:39 2007 +0000

    Fix bugs in RGB18/ARGB1666/ARGB6666 support,
    and eliminate unnecessary gfx functions.

commit 2ffb553edcb8c89c52142bcedfd73356724ff5b5
Author: Claudio Ciccani 
Date:   Wed Jan 10 10:06:36 2007 +0000

    Removed check for sisfb.h.

commit 18c76b3613ac42a9a1e79dafb8d648851c994097
Author: Denis Oliver Kropp 
Date:   Wed Jan 10 01:57:37 2007 +0000

    Replaced "#ifndef input_absinfo" which doesn't work
    by "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)".

commit b17fb847a5a8a8955eec0ed6c2b7863fa670bcc8
Author: Denis Oliver Kropp 
Date:   Tue Jan 9 23:33:25 2007 +0000

    Make cursor area backing store surface same format as layer.

commit 0bde50377717522ef56e6d05587e55161657d699
Author: Marcel Siegert 
Date:   Tue Jan 9 18:34:13 2007 +0000

    added compat defines for touchpad linux input support for
    kernels before 2.6.x;
    should break nothing for now - hopefully :)

commit 875df126b0076169d0ad96d5670e8a93b2169c05
Author: Ville Syrjala 
Date:   Tue Jan 9 17:24:34 2007 +0000

    Cosmetics.

commit 03d0e7c2cfe1c44ddeb766167c9e9bff9f9d9030
Author: Ville Syrjala 
Date:   Sun Jan 7 22:49:14 2007 +0000

    Don't corrupt the return interface pointer in API methods,
    ie. only set the pointer if the method succeeds.

commit 606026c2b82c22f2bd9bb8a7777c1eaf89b9666a
Author: Ville Syrjala 
Date:   Sun Jan 7 22:46:03 2007 +0000

    Fix a memory leak.

commit 8b164dcd977c3f55e4d88bf1c1785b356dfbf211
Author: Ville Syrjala 
Date:   Sat Jan 6 18:09:10 2007 +0000

    Remove a misplaced semicolon.

commit 34526a3fe61f50f72753325361655f5943a71f9c
Author: Denis Oliver Kropp 
Date:   Fri Jan 5 17:55:08 2007 +0000

    Nicer shared memory allocation info as in dfbdump.

commit e4f5ecc8f753993b2130079020f8ce47655af681
Author: Denis Oliver Kropp 
Date:   Fri Jan 5 17:54:51 2007 +0000

    Print shared memory leaks on pool shutdown (debug mode and 'debugshm' option).

commit c5ed38aab5e1b9c94862baf454e3acba27e26ec9
Author: Denis Oliver Kropp 
Date:   Fri Jan 5 17:53:29 2007 +0000

    Free fake modes on shutdown.

commit 7f44a10a1856ccb742179baae47f8968e325edde
Author: Denis Oliver Kropp 
Date:   Fri Jan 5 17:52:59 2007 +0000

    Added some basic update region management.

commit ba098e2f65d6b902676b25e63a0ce289d26e62c3
Author: Mark Adams 
Date:   Wed Jan 3 10:42:13 2007 +0000

    Document recommended changes in overlay and AiRGB usage.

commit 30546551f38405578eaa90ff9cf15fac13beccdc
Author: Mark Adams 
Date:   Tue Jan 2 17:46:19 2007 +0000

    Remove redundant comment.

commit 98504be4d8ff16240f0baaff610cbf8235c09138
Author: Mark Adams 
Date:   Tue Jan 2 17:45:58 2007 +0000

    Implemented acceleration for blits involving the AiRGB pixel format.
    
    DSPF_AiRGB is now supported as a source format for most blits and stretch
    blits.  Blits _to_ AiRGB surfaces are also accelerated provided they don't
    require blending.

commit d57ecf551b50302b09e5abaf9d3a12038ef9ca66
Author: Ville Syrjala 
Date:   Sat Dec 30 18:26:36 2006 +0000

    Improve touchpad support:
    - Detect touchpads in init.
    - Read min/max coordinates from the device.
    - Add drag support.
    - Clean up the code.

commit cbc098d1f241feecfd3a511bc86ef3ff159c8fb7
Author: Ville Syrjala 
Date:   Fri Dec 29 20:31:20 2006 +0000

    Fix some incorrect key mappings. Patch from Stefan Lucke.

commit ee675c1efae5b265dff5fb084fcafa017f5b89ad
Author: Claudio Ciccani 
Date:   Thu Dec 28 11:19:25 2006 +0000

    In IDirectFBSurface_FillRectangles():
    use D_MALLOC/D_FREE instead of malloc/free (thanks to Kamijo Takashi ).

commit 3f1e06d97b9f0f2539bfcc028e17a1aa90ca133a
Author: Claudio Ciccani 
Date:   Sun Dec 24 14:23:01 2006 +0000

    Avoid locking in HasData().

commit 5ee4aed4a5076543f4706c140de0cdcf10f005f0
Author: Denis Oliver Kropp 
Date:   Fri Dec 22 19:14:42 2006 +0000

    Check bit depth in case of an indexed PNG. Don't assume 8 bit. Added 4 bit
    support.

commit 2e2dd0d00e032a6519538fc26dfe99c1d7e83903
Author: Denis Oliver Kropp 
Date:   Wed Dec 20 02:05:32 2006 +0000

    Support DLBM_BACKSYSTEM as a default.

commit b35bc079cca2c6f27857cc65a59e166222eb9605
Author: Denis Oliver Kropp 
Date:   Wed Dec 20 02:04:07 2006 +0000

    Fall back to /dev/shm if no mount point could be determined.

commit 2bb5e7aab54fc6fd2647aff9c7fa515af10fb8e8
Author: Denis Oliver Kropp 
Date:   Wed Dec 20 02:03:04 2006 +0000

    Turn warning into debug.

commit 8baa6c6a3b35ba5ee1676104660b633167a9384a
Author: Denis Oliver Kropp 
Date:   Thu Dec 14 09:44:22 2006 +0000

    Allow read access to "owned" surfaces.

commit 356c9c2b9029109a08bbc8d0f36dad669b907ae5
Author: Claudio Ciccani 
Date:   Wed Dec 13 18:16:30 2006 +0000

    Initialize pointsize register.

commit b34b0f24afe593a81cd4624d7576f390e4a42c94
Author: Claudio Ciccani 
Date:   Wed Dec 13 18:15:22 2006 +0000

    Must adjust point coordinates by +1.

commit 620aebc3869d625cf5455c572fe195564eedbec7
Author: Claudio Ciccani 
Date:   Tue Dec 12 20:36:06 2006 +0000

    Check pixelformat when enabling alphachannel (it should be AiRGB, I think).

commit f64cf8956260a94dc917689a3b6d4fecafa8e6a5
Author: Claudio Ciccani 
Date:   Mon Dec 11 14:44:25 2006 +0000

    Set RTSP connection type to Close.

commit e8d8c7b7e59c069c463e6e711ce5d665cabedcbb
Author: Claudio Ciccani 
Date:   Mon Dec 11 13:56:49 2006 +0000

    Implemented seekability over RTSP.

commit 72304713577dbef90a1d586145b6d67a3b42358a
Author: Denis Oliver Kropp 
Date:   Sun Dec 10 00:01:30 2006 +0000

    Fix fusion_hash_iterate() to support a nested fusion_hash_remove() on the
    current item (or others, except the next).

commit c00c96c4f0501036d65eb4f044af7f85a4f729d1
Author: Denis Oliver Kropp 
Date:   Sat Dec 9 15:35:18 2006 +0000

    Added missing prototype of fusion_hash_size().

commit fba1263a10ed786e2ee3684ed67848f47f2b02e1
Author: Denis Oliver Kropp 
Date:   Sat Dec 9 14:47:39 2006 +0000

    Fixed fusion_hash_create() that was not passing the pool pointer to the
    internal function.

commit fb8637bf1ed5abb3dd77dfd3d6c9fee98244f149
Author: Claudio Ciccani 
Date:   Sat Dec 9 11:27:28 2006 +0000

    Autodetect clock skew.

commit 4d308b35b0572eb05c1da403f6a8d9fca400c6fd
Author: Claudio Ciccani 
Date:   Fri Dec 8 12:16:39 2006 +0000

    Fixed a wrong comparison.

commit 9acb2361e7e2c057d67cfecc4d28f5fc830913b5
Author: Claudio Ciccani 
Date:   Fri Dec 8 12:15:33 2006 +0000

    Added radeonInvalidateState().

commit ab02ecc45130368d8de4ff6c27dfc026d3670e06
Author: Claudio Ciccani 
Date:   Fri Dec 8 12:14:37 2006 +0000

    Added GraphicsDeviceFuncs::InvalidateState(): notify the driver that
    the current rendering state is no longer valid.

commit e74fe32d7a028bfdec3e34f0175cb3c8ec09f8e9
Author: Claudio Ciccani 
Date:   Wed Dec 6 14:10:13 2006 +0000

    Dispatch surface's notifications asynchronously.
    
    This change fixes an assertion failure that happens in the following case:
    1. Resize (Downsize) Surface
    ... and immediatly after ...
    2. Blit to Surface

commit a27ab3ff0fd81de547cbccecfb8686f72bfae70a
Author: Claudio Ciccani 
Date:   Wed Dec 6 14:05:13 2006 +0000

    Added fusion_reactor_sync(bool) to specify whether message dispacthing to
    local reactions must be synchronized with global reactions or not
    (i.e. fusion_reactor_sync(false) makes notifications happen immediatly in the dispatcher process).

commit e5a3616361f0a3b03dc7c6d0aa6ae0b96b3cdb0e
Author: Claudio Ciccani 
Date:   Wed Dec 6 14:00:27 2006 +0000

    Provided a return value to radeon_waitfifo() and radeon_waitidle().

commit cdccba6ec52c1b5eb1eeeb89aecb713736877b83
Author: Denis Oliver Kropp 
Date:   Mon Dec 4 22:52:38 2006 +0000

    Thanks to Vaclav Slavik for fixing loading of mono-only fonts.

commit 911c44afa750cd93af20717437e1e73ba709994f
Author: Claudio Ciccani 
Date:   Mon Dec 4 17:49:53 2006 +0000

    R300 supports 3D Colorkeying. :)

commit 91103de9ca26c63125eda9c978915e13d97fdaa8
Author: Claudio Ciccani 
Date:   Mon Dec 4 11:35:26 2006 +0000

    Implemented r300Blit3D_420, R300StretchBlit_420 and r300TextureTrinangles_420.

commit 1a8122316b26f53e5fd4a932a21ef13e0eb92408
Author: Claudio Ciccani 
Date:   Sun Dec 3 19:02:05 2006 +0000

    Implemented
     - StretchBlit
     - TextureTriangles
     - Alphablend
     - Deinterlacing
    for the R300 chipset family (thanks to Timon ).

commit d9c0b1c9475280480f48e4ad3a0061ab3880d238
Author: Claudio Ciccani 
Date:   Sat Dec 2 09:07:59 2006 +0000

    Allow the DirectFBGL module to Probe the destination surface.

commit f9433b8dba5b677ca8936f036d483cbd9cf3591e
Author: Claudio Ciccani 
Date:   Sat Dec 2 09:06:46 2006 +0000

    Workaround for a repeated char (0) within the glyphs table.

commit 420a0afc6b71acf2a046c0f59663f4421d69313d
Author: Claudio Ciccani 
Date:   Fri Dec 1 17:35:44 2006 +0000

    Check for stdbool.h presence during configuration and define DIRECT_BUILD_STDBOOL accordingly.

commit 4e6f98284583bba353127dc869c2073142b83af0
Author: Claudio Ciccani 
Date:   Fri Dec 1 14:06:18 2006 +0000

    Added IDirectFBGL::GetProcAddress(), get the address of on OpenGL function
    (required to avoid hard dependency and allow portability between different environments).
    
    Added definition DIRECTFBGL_INTERFACE_VERSION to check interface compatibility.

commit 13d1392ed1e0e24c803e54b213666eae3bd261e7
Author: Claudio Ciccani 
Date:   Fri Dec 1 10:43:34 2006 +0000

    Implemented GetID, GetDescription, GetSize, SetPowerMode and WaitForSync.

commit e0d89b6dd42eaec32a951809b53692185534a9db
Author: Claudio Ciccani 
Date:   Fri Dec 1 10:42:27 2006 +0000

    Implemented GetPosition and GetSize.

commit b436407dfc07df577c7156771ce8e9fd9ca89738
Author: Claudio Ciccani 
Date:   Thu Nov 30 17:08:00 2006 +0000

    Added missing methods.

commit 611b595471da9fc5f007c19f83289bfd260188e9
Author: Claudio Ciccani 
Date:   Thu Nov 30 14:57:49 2006 +0000

    Added missing methods.

commit 8c344d1fdd92d7be456d6465aef070112bffb285
Author: Denis Oliver Kropp 
Date:   Wed Nov 29 11:38:07 2006 +0000

    Added Bop_argb_blend_alphachannel_src_invsrc_Aop_PFI[] as a fast path
    for blending from ARGB with SRCALPHA / INVSRCALPHA.
    Implemented for RGB16 and RGB32 so far.

commit 5641b56573b2e5eedbf998aa6bd6c150d7e72e65
Author: Claudio Ciccani 
Date:   Wed Nov 29 09:32:25 2006 +0000

    C++ fix.

commit d36e6023a877717c86c359b93914472a01b3d475
Author: Claudio Ciccani 
Date:   Tue Nov 28 18:30:19 2006 +0000

    Removed 2.6.18-rc2, added 2.6.18.

commit 50589388c8a9b66637efba874c70e7f19f4d86a3
Author: Claudio Ciccani 
Date:   Tue Nov 28 10:53:42 2006 +0000

    Removed sisfb.h. Put the declarations in sis315_compact.h.

commit 2454efb92d71fff78af7d3c2804f09a9e64d1bd2
Author: Claudio Ciccani 
Date:   Sun Nov 26 14:01:26 2006 +0000

    Compare bytes instead of bits when checking for pixelformat compatibility.

commit 20682a6a72f91f385a21d66f91edc077b6a78979
Author: Claudio Ciccani 
Date:   Sun Nov 26 14:00:02 2006 +0000

    Allow to wait() on a RTSP stream.

commit 080185adf29bc2c3be8e68d934fca3a4c88841c4
Author: Claudio Ciccani 
Date:   Sun Nov 26 13:58:58 2006 +0000

    Be more precise about the behaviour of IDirectFBSurface::Flip().

commit 01c575483b9858703db51d929d61608396ee45d5
Author: Ville Syrjala 
Date:   Fri Nov 24 23:53:55 2006 +0000

    tslib input driver by Shane Volpe . Thanks!
    Support for multiple devices and some coding style cleanups by me.

commit aed99e3a1e99b997aaa6166185b30fc8b01b156c
Author: Marcel Siegert 
Date:   Fri Nov 24 16:16:09 2006 +0000

    add some personal stuff in .cvsignore
    e.g. kdevelop project files

commit 594b43580f6bbed705c88de53b09585667e729bb
Author: Marcel Siegert 
Date:   Fri Nov 24 16:10:14 2006 +0000

    add .cvsignore

commit 2bf905595a2999b896b79d61360c2385a07e537e
Author: Marcel Siegert 
Date:   Fri Nov 24 16:09:02 2006 +0000

    add cvsignore

commit 18573a6e1c699d9fa0db336375c7c005658bded2
Author: Denis Oliver Kropp 
Date:   Fri Nov 24 14:02:55 2006 +0000

    Thanks a lot to Attilio Fiandrotti for adding touchpad support!

commit ef443a2d5b45b5451b53edf94ada9525ae93d824
Author: Denis Oliver Kropp 
Date:   Fri Nov 24 00:08:14 2006 +0000

    Readded setpgid(0,0) also in system_join().

commit 765669036f0299d38820dc3101a12faec40bca9e
Author: Denis Oliver Kropp 
Date:   Thu Nov 23 10:26:13 2006 +0000

    Readded setpgid(0,0) in system_initialize().

commit 80d78094120294ef382023c37072f621af8a4afd
Author: Claudio Ciccani 
Date:   Tue Nov 21 16:03:46 2006 +0000

    Need sisfb.h to build.
    Either if sisfb.h is in the include path (i.e. headers come form linux-2.4)
    the driver should not rely on that header because linux-2.6 may be running
    instead and 2.4 and 2.6 versions of sisfb_info are incompatible.

commit 47d476067194f68435ad01c9cc979a73fd0e204f
Author: Claudio Ciccani 
Date:   Tue Nov 21 14:55:40 2006 +0000

    Fixed warnings (on x86_64).

commit d5b5b463b0ff6e97d1b543f5eba235b9e3467aaa
Author: Claudio Ciccani 
Date:   Tue Nov 21 14:36:36 2006 +0000

    Cosmetics.

commit bd49dc56fb590599aff402b0fb13c99c951a2341
Author: Claudio Ciccani 
Date:   Tue Nov 21 13:19:35 2006 +0000

    Enable DWOP_SCALE by default for windowed primary surfaces.

commit e03598c8de76abe339be67ab46dfa83efb0cf1cc
Author: Claudio Ciccani 
Date:   Tue Nov 21 13:18:11 2006 +0000

    In dfb_gfxcard_stretchblit():
    be smart and execute dfb_gfxcard_blit when possible.

commit e54ce388ad0cc5ccd8de3d3008371b0fd648a47b
Author: Ville Syrjala 
Date:   Mon Nov 20 22:04:44 2006 +0000

    Don't try to immediately allocate the new video instance when reallocating
    a buffer (unless the policy is CSP_VIDEOONLY). Fixes corruption problems
    in XDirectFB caused by window resize failing.

commit 0cd7483fae6316eb10da67a4f51c2dadd8a0c9b4
Author: Ville Syrjala 
Date:   Mon Nov 20 20:52:29 2006 +0000

    v4l2 code still used dfb_surface_soft_lock() without the CoreDFB argument.

commit 682a9fa560f2aa2676e22e031f0e8cdbd97538b1
Author: Denis Oliver Kropp 
Date:   Mon Nov 20 11:40:13 2006 +0000

    Readded generic64_memcpy().

commit 052e2ad9dfbfda4d31dd8c4c59a4add6d0605100
Author: Denis Oliver Kropp 
Date:   Sun Nov 19 11:41:44 2006 +0000

    Fix array stride mismatch in FindColorKey(), thanks to Ben Combee!

commit a1e3d13351d026897e388f32eff73b48a8c8170a
Author: Claudio Ciccani 
Date:   Sat Nov 18 11:54:13 2006 +0000

    Fixed incorrect frame delay computation.
    Do not use variadic arguments.

commit dc692efba341d3dd7060d7822e6da3ebd58739eb
Author: Claudio Ciccani 
Date:   Sat Nov 18 11:08:41 2006 +0000

    Enable passing the actual CoreDFB to all external interfaces
    (excluding DirectFBGL that gets its own IDirectFBSurface).

commit 9495ae70670c12631f5f170d08f08c81db4fb3a9
Author: Denis Oliver Kropp 
Date:   Sat Nov 18 10:45:14 2006 +0000

    Added option "no-software" to disable software fallbacks. This is mainly for
    debugging/profiling purpose. It will print out a warning with the operation
    and flags each time a fallback would occur.

commit 70cdce08db7f11e40a83923ddc971d76ebe69696
Author: Claudio Ciccani 
Date:   Fri Nov 17 17:28:02 2006 +0000

    Workaround to follow recent API changes (that shouldn't happen between release candidates!!).

commit aa47c8c6bd7d76fafcb4daec9692f1db0e0543ca
Author: Claudio Ciccani 
Date:   Fri Nov 17 17:25:49 2006 +0000

    Attempt to make acceleration work on ppc:
    enable acceleration only for formats that have the same pixel size
    as the primary layer (to avoid changing the byte swapper).

commit 909a3befdce44240d6a4bfe238b3c4f6b348af48
Author: Denis Oliver Kropp 
Date:   Wed Nov 15 02:12:48 2006 +0000

    round 2

commit 2d0fb5e39cd98888f417100c89319ce5c2d74041
Author: Denis Oliver Kropp 
Date:   Mon Nov 13 21:42:28 2006 +0000

    Fix SHCALLOC and friends, i.e follow API change.
    
    Can't test myself.

commit 811f7e113a0c33ea34d88bd017b0c9c0f1682a41
Author: Denis Oliver Kropp 
Date:   Sun Nov 12 12:19:54 2006 +0000

    Added support for scaled windows.
    
    New window option DWOP_SCALE prevents the surface from being resized when the window
    size on screen changes, i.e. via IDirectFBWindow::Resize() or SetBounds().
    
    The surface can be resized separately using IDirectFBWindow::ResizeSurface() if needed.
    
    New runtime option "scaled=x" scales the window to the specified size
    for 'force-windowed' apps. The surface size will not be affected, still set via "mode=".
    
    
    Try "df_andi --dfb:force-windowed,mode=640x480,scaled=800x600" in a running session!
    
    Also enjoy resizing the window (just scaling differently) using Meta-Ctrl-MouseMotion :)

commit 51e8d6c3b2280fab29de5ecac3e6f9f01cd5f41d
Author: Denis Oliver Kropp 
Date:   Sun Nov 12 11:33:37 2006 +0000

    Added IDirectFBWindow::SetBounds() to do a move and resize in one step.
    
    Internally this will use existing the WM API that allows changing any
    combination of items in the window configuration. Due to historical reasons
    there has only been one item changed at a time. Now it can happen that both
    flags CWCF_POSITION and CWCF_SIZE are set when calling wm_set_window_config().
    
    The default window manager module got a special function to implement the
    combined move/resize in this case. The older separate move and resize functions
    could be replaced by calling the new function, but that's not done, yet.

commit 3fab1f8192e5c4c838e2f83e0214778b2705866a
Author: Denis Oliver Kropp 
Date:   Sun Nov 12 09:54:04 2006 +0000

    Fixed prototype.

commit aeea8d7b2192174bc90bc84d0aa889764916b1b4
Author: Claudio Ciccani 
Date:   Sat Nov 11 09:29:48 2006 +0000

    Skip MMX test on AMD64.

commit d6a4884c465dc7152a1cfebc8dd5d386405280ab
Author: Denis Oliver Kropp 
Date:   Fri Nov 10 21:34:10 2006 +0000

    Support loading of indexed PNG files directly to LUT8 surface.
    
    Provide palette of image via GetSurfaceDescription().

commit cd4c579761c653322422caf32e8b95f015cdf6a1
Author: Denis Oliver Kropp 
Date:   Fri Nov 10 13:13:30 2006 +0000

    Fixed warning.

commit bfe3a678d3399911927b50623eebc6d6315697be
Author: Denis Oliver Kropp 
Date:   Fri Nov 10 13:06:25 2006 +0000

    #include 

commit 4893a9b7179e7a676d4e51bc696ade21f5316600
Author: Denis Oliver Kropp 
Date:   Thu Nov 9 10:59:30 2006 +0000

    Added ability to let only one Fusionee write to a surface,
    set via owner field of CoreSurface.
    
    Had to add CoreDFB* parameter to dfb_surface_software_lock() and
    dfb_surface_hardware_lock() where the owner is being checked.

commit e7da8d24a58774b43821302ddf54ab115e2b247c
Author: Denis Oliver Kropp 
Date:   Thu Nov 9 10:54:33 2006 +0000

    Removed "Unknown key pressed" message which can happen on supported (via symbol) keys.

commit 1e238abcec4aa702384b80a0ea498e17a34d5518
Author: Denis Oliver Kropp 
Date:   Sun Nov 5 19:40:45 2006 +0000

    Fix single app build.

commit b8b42d3aa866513ea35c3ea746161a8b8c44c1c0
Author: Denis Oliver Kropp 
Date:   Sat Nov 4 13:25:47 2006 +0000

    Give the WM a chance to provide its own surface.
    
    The WM may link a surface to the window in the PreConfigureWindow() call.

commit 1d0967541bf94330595e4dc7b5b6c4409af08798
Author: Denis Oliver Kropp 
Date:   Sat Nov 4 13:21:29 2006 +0000

    Removed more.

commit 96dd89fd03f84c0cdb91ed8af87df2831e668453
Author: Denis Oliver Kropp 
Date:   Sat Nov 4 13:04:09 2006 +0000

    Removed some obsolete crap.

commit 8ae92c06ddd3fa95551fb02194ad08acc63bedf3
Author: Denis Oliver Kropp 
Date:   Fri Nov 3 00:19:24 2006 +0000

    That was enough for RC3.

commit e630981153c0c76f88237f37560dcd3e99588198
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 23:56:15 2006 +0000

    Increase row width.

commit 74f36bfa187ac689ddb0744a98b8fc4385b3c975
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 23:44:54 2006 +0000

    Fixed wrong pixel format index of LUT2.

commit 559d5759faec519a3956ec8fccc2d5b713e2944b
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 23:24:57 2006 +0000

    Make shared memory allocation output use direct_log_printf as for local memory.
    
    Print list of allocations if maximum heap size has been reached.

commit d781a544bb60eb3291ff74567333ddb9befcba47
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 23:06:06 2006 +0000

    Show allocations in both DirectFB shared memory pools with option "-s".
    
    Show FusionID and offset within file/heap.

commit 30edbe51bfb9de91d18a8bc9c282e4f61aa1ce0b
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 22:45:10 2006 +0000

    Let "debugmem" option only influence output of allocations, but always track
    them in debug enabled builds.

commit edc68dcb060bf63c3c67faf14ab1c5e84900b17b
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 22:34:47 2006 +0000

    Added options "debugmem" and "debugshm" to turn on local/shared memory allocation
    debugging separately from "debug" option.

commit d97ef8adc3ca4d4fa1e48e004acc615c6f111648
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 22:32:38 2006 +0000

    Fixed crash with symbol table lookup code when filename is NULL.

commit 480000cbe4c3b27c3d543165a3a706a26beced4c
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 22:25:10 2006 +0000

    Use direct_memmove() here, too.

commit 567660bed608f07d07f0480b04218278ee0af73d
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 21:58:50 2006 +0000

    Use memmove() in any overlapping case, don't allow moving downward, because
    the read/write block size of the memcpy() is not known and the difference
    between from and to area is often only a few bytes, e.g. moving trailing items
    after removing an item from an array.

commit ea7c39df84ae0cd9efd46f79a8cb1d3b08b2bf1d
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 21:25:04 2006 +0000

    Include Fusion ID of allocator in debug info.

commit c0ab69c76ae0c637b7d3c863f71f0e483cc2fd86
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 21:10:07 2006 +0000

    Just for debugging I added the option "-p" to pause() dfbdump.
    
    One could run it as a master and look at the foot print or other
    things that are there before any application specific stuff happens.

commit c6f22948a08317259b5d1ada8cd6c0d8a2ba6673
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 21:06:26 2006 +0000

    Initialize the heap info table to serve for the maximum pool size specified
    at creation of the pool. Previously, the initial table served for 4 MB heap.
    If there were more allocations, the heap info table was reallocated at the
    end of the heap, i.e. at 4 MB making it impossible to ever go back below
    the 4 MB heap size. Next barrier was 8 MB, 16 MB ...these are gone.
    
    Unlink potentially remaining file from a previous session before creating
    the shared memory file in tmpfs.
    
    Removed memset() on the initial heap to take advantage of the actual allocation
    of the pages happening when first accessed. If it's a new file, which it is
    now, it will be zeroed anyways.
    
    The maximum size specified during creation of a pool is now taken as an
    additional size after the heap info table. Previously, it could happen that
    the size was too small to host the fixed sized heap info table.

commit 057fc7fa22ac6e73c6b20ab75b7a9592f3e6cb33
Author: Denis Oliver Kropp 
Date:   Thu Nov 2 20:52:28 2006 +0000

    Fixed two messages not being debug messages.

commit aeb7f4003cb6a120aeb8894ef808df8383677ff3
Author: Claudio Ciccani 
Date:   Thu Nov 2 13:53:47 2006 +0000

    Fixed hundredths to microseconds conversion.

commit ba55457269f182f614e05d22d7ec709a495a8c98
Author: Claudio Ciccani 
Date:   Thu Nov 2 11:52:27 2006 +0000

    __inline__ instead of inline (same as typeof).

commit 6b028683917d91cc06221a062bffd75279ae2db1
Author: Claudio Ciccani 
Date:   Thu Nov 2 11:46:12 2006 +0000

    Use __typeof__ instead of typeof because the latter requires standard to be gnu89/gnu99.

commit 1f536276de06b0628637018ec09821a277fade5a
Author: Denis Oliver Kropp 
Date:   Wed Nov 1 09:00:12 2006 +0000

    type fixes

commit b661e583f6e88178367140e4e22f8ba294ee2d50
Author: Denis Oliver Kropp 
Date:   Tue Oct 31 11:26:32 2006 +0000

    This was missing from the recent LUT2 commit.
    
    It adds support for LUT2 fonts to the FT2 module.

commit a4abc1531310f4a99be0b482f1ac64bd05253150
Author: Denis Oliver Kropp 
Date:   Mon Oct 30 00:37:40 2006 +0000

    Added dgiff.h

commit c43ae3c827623e1f5cd1c934a12b789a56b9f234
Author: Denis Oliver Kropp 
Date:   Mon Oct 30 00:12:35 2006 +0000

    shine

commit b86be9e1819c26487826e45f396e61bcdc39aacf
Author: Denis Oliver Kropp 
Date:   Mon Oct 30 00:10:11 2006 +0000

    Let'em go...

commit 41e09f6592d9500783dd6c69346516d657eaee44
Author: Denis Oliver Kropp 
Date:   Sun Oct 29 23:26:42 2006 +0000

    Also actually include  now.

commit d0a2fd3a61f19ad054be917da489284a340a21c9
Author: Denis Oliver Kropp 
Date:   Sun Oct 29 23:24:50 2006 +0000

    Change license to LGPL.
    Remove kernel header.
    Build only if  is found.

commit 7c9f83c3d73516f05dd6375a3d5fc2cf62fc6dc6
Author: Denis Oliver Kropp 
Date:   Sun Oct 29 11:16:54 2006 +0000

    Removed GPLed header and made driver build with latest kernel i2c headers.
    
    How about older versions, is there something to be done differently?
    
    Maybe different header files to include?

commit 34cb23d069898dd800af7d1a7665475a49bb163c
Author: Denis Oliver Kropp 
Date:   Sun Oct 29 10:54:42 2006 +0000

    cosmetics

commit 1ae6b87fbf1c50508a5a69f9b461bab8f0af34b4
Author: Denis Oliver Kropp 
Date:   Sun Oct 29 10:53:55 2006 +0000

    Changed license to LGPL in these files, thanks to Paul Mackerras |paulus * s amba.org!

commit 0263ee03c27b67ee7e71c5ce38bb9de3ea5222f0
Author: Denis Oliver Kropp 
Date:   Sun Oct 29 10:48:35 2006 +0000

    Removed GPL code, mainly optimized x86 memcpy routines. libc seems fastest
    now anyways.

commit 794956b6aec1497c236021e40d9d0be1b636fe49
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 21:15:22 2006 +0000

    build fix

commit 39779d043bc74b0be92014d36fd1c8903d77736a
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 20:38:49 2006 +0000

    Breaking the API freeze, but keeping binary compatibility.
    
    This is something that I have forgotten to apply before freezing the API.
    
    Added DSPF_LUT2 being indexed 2 bit per pixel packed, i.e. four pixel in one byte.
    
    Added IDirectFBSurface::SetIndexTranslation() that sets a translation table used for
    fast indexed to indexed pixel format conversion. Negative or undefined values in the
    table will result in no pixel being written.
    
    Added DSBLIT_INDEX_TRANSLATION to do fast indexed to indexed translation, this flag
    is mutual exclusive with all others.
    
    
    So far only LUT2 to LUT8 is supported, used for fast anti-aliased text rendering
    to indexed format. The translation table contains "-1, 36, 37, 38" for example.
    First entry makes the background transparent and the other three are shaded versions
    of the text color.

commit c031ecd3059c82ba3f95681738282ad1ffadd28e
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 20:25:16 2006 +0000

    Fix Bop_a8_set_alphapixel_Aop_yuy2() for big endian.

commit 5da12d377c4ec971e345104e5b1c94af85f62667
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 20:23:09 2006 +0000

    In dfb_layer_context_get_primary_region() if increasing the ref count of the
    existing primary region fails, due it being destroyed, wait for a short time
    and try again, probably recreating the region.

commit d2ac0696581f9dbd70dfdfc0012c1ccb3357e205
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 20:20:15 2006 +0000

    Don't print an error if an object revived after it's ref count reached
    zero but got increased again before the destructor is called. That applies
    to the multi application core only. In the single application core the
    destructor is called synchronously.

commit fd87ebf9b2320a0a525c537e531aee9896e56432
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 18:47:34 2006 +0000

    No longer create a new process group in dfb_core_create().
    
    No longer use pthread_kill(KILL) which doesn't only kill the specified thread, use pthread_cancel().
    
    Let direct_assert() and others try raise(TRAP) first, then killpg(0,TRAP) and pthread_exit().
    
    At the end of the global signal handler no longer use killpg(0,KILL) but remove all handlers,
    raise(num), abort() and then exit( -num ). But the exit shouldn't be reached.
    
    Register signal handler with empty instead of full blocking mask and use SA_NODEFER except
    for SIGSEGV. Also no longer use SA_RESTART.
    
    Don't take certain locks in core shutdown functions if emergency is true.
    
    Use recursive mutexes in trace support if available.
    
    Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP in configure.

commit 73b008e4f20092c61aed03fc2db94722cb249e1c
Author: Denis Oliver Kropp 
Date:   Sat Oct 28 13:35:54 2006 +0000

    Use other signals than SIGUSR1/SIGUSR2, as defined at the top of the file.

commit 8ab76006de60ad761be1528e75f7e9898270c1f9
Author: Denis Oliver Kropp 
Date:   Mon Oct 23 09:16:16 2006 +0000

    Define compatibility macros for __ types unless DIRECTFB_NO_CRUFT is defined.

commit 8cce1d2523e84e57aed21d49aed43d78ec68c00e
Author: Denis Oliver Kropp 
Date:   Mon Oct 23 09:10:14 2006 +0000

    Don't depend on "debug" option when printing interface leakage at exit time.

commit 581797757fb1a966affb1681b19d7fc062397503
Author: Denis Oliver Kropp 
Date:   Thu Oct 19 01:22:21 2006 +0000

    Fix software access to chunk less video buffer, was just broken.

commit 595f125c7cabeddeb19ad7a16e7241c52633693b
Author: Denis Oliver Kropp 
Date:   Tue Oct 17 11:25:05 2006 +0000

    Print warning if object could not be created.

commit 6000cbfbe3bda148a91f1fe265040bcee4553c9c
Author: Denis Oliver Kropp 
Date:   Tue Oct 17 11:24:49 2006 +0000

    Added some D_OOSHM().

commit 1932030c078442763fe859e0966e4ac5c5966850
Author: Denis Oliver Kropp 
Date:   Tue Oct 17 09:55:52 2006 +0000

    Renamed CSS_SYSTEM to CSS_NONE.
    
    No longer change buffer storage when system memory instance is valid.
    
    Only set buffer storage once in occupy_chunk() and only clear it once in free_chunk().
    
    This fixes NULL pointer returned by an autovideo lock on video memory instance
    when storage had been set to CSS_SYSTEM while the video instance was still valid.
    In that case (storage != CSS_VIDEO) it returned the auxiliary memory.

commit 0602cf0b7a87d0ee380a8fdea0250555cbeade78
Author: Denis Oliver Kropp 
Date:   Tue Oct 17 09:52:26 2006 +0000

    Made DFFA_NOCHARMAP work again.
    
    If Unicode/Latin1 failed, try Symbol Encoding and do some 0xf000 magic.

commit bdd04791a1c6232f21668ab48306d0a86fba15c1
Author: Denis Oliver Kropp 
Date:   Sun Oct 15 21:40:43 2006 +0000

    Keep formats sorted!

commit 88bd62a8f93e0f039e63ca5c484f26287ce21e00
Author: Denis Oliver Kropp 
Date:   Sat Oct 14 13:05:36 2006 +0000

    Thanks to Guillem Jover for fixing the kernel type usage, replaces __u8 by u8 etc.

commit 676c74dea81f0e11f9ebebff375c676378f2b6f6
Author: Denis Oliver Kropp 
Date:   Thu Oct 12 20:58:07 2006 +0000

    Added missing unistd.h include, thanks to Shane !

commit dc3a14e04168539a4434ed53f24b3ed6cb11425f
Author: Denis Oliver Kropp 
Date:   Thu Oct 12 11:23:00 2006 +0000

    Build mkdfiff only if PNG support is enabled.

commit 17b8e8a124e4128694f33de95fee34507e14ca51
Author: Ville Syrjala 
Date:   Tue Oct 10 00:15:22 2006 +0000

    Don't include config.h in direct/types.h. Fix stdbool.h warnings.

commit c22e82ecfd58992193c6f42727dcdf976811309f
Author: Ville Syrjala 
Date:   Mon Oct 9 23:53:53 2006 +0000

    Silence a compiler warning.

commit f0701d7a62988f7d19d17407ba41fe7e59e18de1
Author: Ville Syrjala 
Date:   Mon Oct 9 23:53:15 2006 +0000

    Ignore repeat events for mouse buttons.

commit 10a4d8721196a0495d6326a2420fe72bb70e9e47
Author: Ville Syrjala 
Date:   Mon Oct 9 23:52:07 2006 +0000

    Disable dithering when doing alpha blended blits. Dithering it is applied
    even when the source pixels are completely transparent. This change makes
    the mouse cursor look sane.

commit 6e26969bcc7a7cae72654c60b316dc2fe41c3827
Author: Denis Oliver Kropp 
Date:   Mon Oct 9 20:24:37 2006 +0000

    Added D_WARN() in dfb_gfxcard_reserve_memory() for each case in which allocation fails.

commit f2546210359388095a1187e0cff9008be5d2c05f
Author: Denis Oliver Kropp 
Date:   Mon Oct 9 20:19:21 2006 +0000

    Yuck! The "tmpfs" option was ignored for quite some time.

commit 5e09ca1ddd900cdc99aa84a4031f8d05d2776591
Author: Denis Oliver Kropp 
Date:   Mon Oct 9 08:09:39 2006 +0000

    DGIFF - DirectFB Glyph Image File Format
    
    Added a new font module and a tool called mkdgiff to generate .dgiff from .ttf or other.
    
    Purpose of DGIFF is to offload as much as possible from runtime, especially during
    application startup when loading the default or system fonts. mkdgiff uses FreeType2
    to load the glyphs of the font and stores them in one or more ready to use font cache
    rows, up to 2047 pixels wide right now.
    
    The loader creates preallocated surfaces from the mmapped font file. The only copy ever
    made would be when the surface is transfered to video memory for acceleration.
    
    DGIFF supports different sizes of one face in a single file.
    
    You can specify these options on the mkdgiff command line:
    
       -f, --format       Choose the pixel format (default A8)
       -s, --sizes     [,s2...]    Choose sizes to generate glyph images for

commit 63607c8aa5ae4bedec39cfa0660f80587103d610
Author: Claudio Ciccani 
Date:   Fri Oct 6 12:09:53 2006 +0000

    readdir_r() instead of readdir().

commit 9f4e4519997401f934575699510ab7eb47a0e915
Author: Claudio Ciccani 
Date:   Thu Oct 5 12:27:51 2006 +0000

    Fixed username/password parsing.

commit 90b3c513b4ef08d66e61bea85b3f662b45c6afeb
Author: Denis Oliver Kropp 
Date:   Thu Oct 5 10:03:33 2006 +0000

    Plugged mem leak of AttachedWindow struct when DetachEventBuffer() happens
    after the window has been destroyed.

commit 2d564735169fc46eb91458b390cae7c393d74fe7
Author: Denis Oliver Kropp 
Date:   Thu Oct 5 07:06:09 2006 +0000

    Use libpng-config if present. Thanks to Gery !

commit 65819c113c1e6869a52edc12393c081f9c752b32
Author: Denis Oliver Kropp 
Date:   Wed Oct 4 11:44:48 2006 +0000

    Safely cycle through nodes while freeing them.

commit f5d3dd0d584d8684fbcca32c0c6bbcf3c15b6aa4
Author: Denis Oliver Kropp 
Date:   Wed Oct 4 10:14:01 2006 +0000

    typo

commit b30e5e41c01f9bebb4c6eea6456aaff7b8d4dd56
Author: Denis Oliver Kropp 
Date:   Wed Oct 4 10:12:43 2006 +0000

    Fix vendor strings.

commit cba26f9d02423522819ae8a324e922784dd75707
Author: Denis Oliver Kropp 
Date:   Wed Oct 4 10:05:40 2006 +0000

    Fixed vendor string.

commit 0e600cda403b1859a5084e67ddad67827bd2a846
Author: Denis Oliver Kropp 
Date:   Wed Oct 4 10:04:25 2006 +0000

    Fix vendor strings.

commit ac94b2ebc28cf6cc28c8c8357e48b9869c1501d9
Author: Claudio Ciccani 
Date:   Tue Oct 3 12:19:15 2006 +0000

    Use readdir_r() instead of readdir().

commit 784530e8a32a6074d637b04d8e6a9fe1ca029bd9
Author: Claudio Ciccani 
Date:   Mon Oct 2 15:18:56 2006 +0000

    Replaced the usage of setitimer()+recv() in net_peek() with a single call to select().

commit 829e04ca231c443b7b1606e9bf5d9350fdfe84ea
Author: Claudio Ciccani 
Date:   Mon Oct 2 12:18:39 2006 +0000

    Print only a debug message if palette could not be retrieved/restored.

commit c3f2b4b997f41e6ecc76ecc355cbd61867dc19d6
Author: Denis Oliver Kropp 
Date:   Mon Oct 2 06:38:06 2006 +0000

    Added option "primary-only" to tell applications only about the primary layer,
    pretending there are no others.

commit 7e8dd6149557eb8532bbf037d914b55ebd0505f8
Author: Denis Oliver Kropp 
Date:   Sun Oct 1 09:23:53 2006 +0000

    will

commit abecc74013c02f5d4c7f2beb855aafb706388a07
Author: Denis Oliver Kropp 
Date:   Sun Oct 1 07:13:19 2006 +0000

    Complete last fix.

commit 73d6d5fdcf3a6da56c7f0f2c0a0bb1003932a4c3
Author: Denis Oliver Kropp 
Date:   Sun Oct 1 07:11:37 2006 +0000

    Fix ARGB1555 color keyed blitting which dropped the alpha channel.

commit c07792b19ccb7f34d45c75e9e3e36f6ebf8d69df
Author: Denis Oliver Kropp 
Date:   Sun Oct 1 00:16:09 2006 +0000

    Fixed missing fusion_world_set_fork_action() in single app build.

commit 4e28d34acf7a2c2da117328350e11565f5dad915
Author: Denis Oliver Kropp 
Date:   Sun Oct 1 00:08:51 2006 +0000

    Patch from Stefan Lucke that adds IDirectFBSurface::GetFramebufferOffset().

commit e0c7700a5fe0fa279a5f0787dde8724e303fb270
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 23:36:31 2006 +0000

    Added IDirectFBDisplayLayer::SwitchContext() that switches between the shared
    and the exclusive context if present.

commit 08c9f3ddf541cf41bcd0d979aec60d244fea10dd
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 23:27:54 2006 +0000

    Patch from Daniel Laird to allow connectors to be selected at the encoders
    without the need to define outputs. Additionally, slow blanking has been added.

commit f2b1bb23e7148891e10a81cda7e85e3139e92f67
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 23:16:55 2006 +0000

    Added IDirectFBFont::GetStringBreak() to break a text line by line.
    
    Thanks to sridewa  for the initial patch!

commit f4bba0f41249b146adf0cc892971083882feb257
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 22:46:24 2006 +0000

    Disable hardware cursor in VIA_REG_CURSOR_MODE.
    
    Thanks to Michel van Noorloos !

commit fcd8ccf251bb42ecba4bb97b7e075572f067bdf9
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 21:17:43 2006 +0000

    New 3M DynaPro Touchscreen driver, thanks to Pr Degerman !

commit 45b09dd67452db159509d5d048dce0232014d007
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 21:16:08 2006 +0000

    Recent vararg patch was missing some of the necessary changes.

commit 569ad4481b1097247324c320a8f0bde4542fb424
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 20:16:14 2006 +0000

    This patch fixes inconsistency in usage of variable arguments.
    
    
    The function Construct is of type:
    typedef DirectResult (*DirectInterfaceGenericConstructFunc)( void *interface,
    .. );
    
    
    One possible implementation of the function looks like this:
    
    static DFBResult
    Construct( IDirectFBImageProvider *thiz,
               IDirectFBDataBuffer    *buffer )

commit f78f307aef017aa13a7fe6139c8f8001c67806f1
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 19:56:31 2006 +0000

    Made "Parsing config file..." a debug message.

commit da6484df4cde6564b887b25a4b6a2f84c0f26253
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 19:52:19 2006 +0000

    a bit more chiefly

commit c63049e0d47c0ae50549e47b485db96033201cd4
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 16:15:34 2006 +0000

    Thanks to Stefan Lucke for fixing overlay destination color keying for
    8/15/16 bit primary layer formats and adding a "i8xx_overlay_pipe_b" option!

commit 4976dd3363743f6416295b8ea3aecb42d664a1d4
Author: Denis Oliver Kropp 
Date:   Sat Sep 30 16:08:16 2006 +0000

    Rewrote one line interface descriptions.

commit 752fe9cd5951dfa4103e82ce43bb0e6a64ff3ad9
Author: Denis Oliver Kropp 
Date:   Fri Sep 29 11:50:25 2006 +0000

    Prepare for version 1.0.0-rc1!
    
    The overdone banner text is a placeholder :-)

commit d19b26cbcc7c64c2d3e3ef35c96a5fc8127d2252
Author: Denis Oliver Kropp 
Date:   Thu Sep 28 14:12:16 2006 +0000

    Fix pure release build.

commit 2bcb01589f2a037e9117c4d4e21c7fd73f12e9f0
Author: Denis Oliver Kropp 
Date:   Thu Sep 28 13:50:39 2006 +0000

    Fix warnings.

commit 4d73cf58a459cb626334b682855208143f9f4e17
Author: Denis Oliver Kropp 
Date:   Thu Sep 28 12:48:32 2006 +0000

    Detach from shm pools when leaving in fusion_shm_deinit().
    
    This fixes mremap errors after reentering a world.

commit 8b20b296996e9b75b4d8fdf3df7a7f56e63dabbd
Author: Denis Oliver Kropp 
Date:   Thu Sep 28 01:16:07 2006 +0000

    Hmm, seems the debug domain is required if DIRECT_BUILD_NETWORK is true.

commit 7c1aa30cbd307be0c8ddd16831bb5dc0ec52db0e
Author: Denis Oliver Kropp 
Date:   Thu Sep 28 01:11:13 2006 +0000

    Fixed warning about unused debug domain by commenting it out.

commit 589828e69ef3e438565a824489567f1fa5d61fc5
Author: Denis Oliver Kropp 
Date:   Thu Sep 28 00:35:51 2006 +0000

    Install internal headers.

commit d103c23abfd5b8e03c339592e9a29cc73ffdf611
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 22:22:16 2006 +0000

    Add stdbool.h to AC_CHECK_HEADERS.

commit 7474324986816306b116be02da6171bc1aa4b748
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 22:20:37 2006 +0000

    Include config.h if HAVE_CONFIG_H is defined and include stdbool.h if HAVE_STDBOOL_H is defined.
    
    If still no bool is declared after this, show a warning with instructions:
    
    "bool definition herein is not 100% compliant,
     add AC_CHECK_HEADERS(stdbool.h) to your configure.in
     or define HAVE_STDBOOL_H or NO_WARN_STDBOOL."

commit f129bd488dce35169972bd087ce9af14206d0212
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 21:46:47 2006 +0000

    No longer unref source after usage by Blit() & Co. This was a recent hotfix
    which dragged down performance and is now reverted.
    
    Instead I added ReleaseSource():
    
    "Release possible reference to source surface.
    
     For performance reasons the last surface that has been used for Blit() and others stays
     attached to the state of the destination surface to save the overhead of reprogramming
     the same values each time.
    
     That leads to the last source being still around regardless of it being released
     via its own interface. The worst case is generation of thumbnails using StretchBlit()
     from a huge surface to a small one. The small thumbnail surface keeps the big one alive,
     because no other blitting will be done to the small surface afterwards.
    
     To solve this, here's the method applications should use in such a case."

commit b65a672a1f7c7dbf383342b43dfbb4a997fba441
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 21:11:39 2006 +0000

    In addition to DIRECT_FORCE_DEBUG one can use DIRECT_ENABLE_DEBUG now.

commit 0827bec7e8c2204d5eade78160fca072244ad383
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 21:09:15 2006 +0000

    Only duplicate used portion of array in direct_trace_copy_buffer(), set limit from 256 to 200.

commit 5d3038ca4179c3b3c61e0e92108cb722c8eb35fe
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 20:17:04 2006 +0000

    Added global function pointer __DFB_CoreRegisterHook with __DFB_CoreRegisterHookCtx
    to allow application level layer (and screen) implementations building on top of
    existing layers.
    
    The callback happens during DirectFBCreate(), right after the driver's register
    calls, the application can call dfb_screens_register() and dfb_layers_register(),
    right before all registered implementations get activated.

commit 15d1b138554de065f15d99915ab28e0df97f36d7
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 19:42:36 2006 +0000

    Fix build when including header in C++ code.

commit 5534352f92b46262262d62c259d9cd5e489757ee
Author: Denis Oliver Kropp 
Date:   Tue Sep 26 19:41:28 2006 +0000

    Rework structure of wm_update_cursor() implementation, fixing a failing assertion.

commit 31473a446d3f1214cff1baf5164116cf2d24503b
Author: Claudio Ciccani 
Date:   Tue Sep 26 10:28:35 2006 +0000

    Fixed warnings about uninitialized variable.

commit 4be72123e955acf5898c82fd78bf53a00f38f8d4
Author: Claudio Ciccani 
Date:   Mon Sep 25 12:40:14 2006 +0000

    Faster response matching (use only sscanf()).

commit 3b7000cfd50009c13a1935123bcdb23fb97ac65a
Author: Claudio Ciccani 
Date:   Sun Sep 24 19:46:56 2006 +0000

    Fixed FTP response handling.

commit 53ae0ec80c73a0dacb247205626d730e79c4bf55
Author: Claudio Ciccani 
Date:   Sun Sep 24 17:53:14 2006 +0000

    Added:
     - BSWAP16 and BSWAP32 macros
     - direct_base64_encode (moved from Direct/Stream) and direct_base64_decode
     - direct_md5_sum

commit 5a748d95c9265d383f94712ff0d475605732724a
Author: Claudio Ciccani 
Date:   Sun Sep 24 17:51:13 2006 +0000

    Added option --enable-netork to enable/disable building network protocols handlers.
    
    Reworked Direct/Stream to gain more efficiency.
    
    Added rtsp:// protocol support to Direct/Stream.
    This implementation supports both Standard and RealMedia protocol.
    It works by outputting either raw packets (e.g. audio/mpeg stream) or
    a RMF (.rm) container stream.

commit fd3a08be1eaffd0b0c78122b225ceb098d849f8c
Author: Claudio Ciccani 
Date:   Fri Sep 22 08:17:20 2006 +0000

    In trim(): check if e > s.

commit e7b3cd88bd86ff5c2770fcb78ec1822f32601753
Author: Mike Emmel 
Date:   Wed Sep 20 16:03:17 2006 +0000

    Adding support for the 18bpp format family
    these have 6 bits per pixel and use 3 bytes.
    This format is used in  embedded platform lcd controllers.

commit 4c759e6f2649f78c2d628b048b9a33f5924dba15
Author: Claudio Ciccani 
Date:   Mon Sep 18 17:42:14 2006 +0000

    In trim(): clear to zero trailing spaces.

commit dbb8aed829ee1e85d0c80f44c8f3f79755528ca6
Author: Claudio Ciccani 
Date:   Mon Sep 18 13:51:48 2006 +0000

    unsv:// protocol support (acronymous for http://).

commit 1a35f3d6c2e5075406a125959218466d9e550d4a
Author: Claudio Ciccani 
Date:   Mon Sep 18 10:16:14 2006 +0000

    Treat http headers case-insensitive and accept any kind of spaces within them.

commit 36fc07b13d69d589fea3950e09ecfa787ef2b5cf
Author: Claudio Ciccani 
Date:   Mon Sep 18 09:32:33 2006 +0000

    Support Icecast protocol within http.

commit 803832c6588dc7b28cc434a0005ffd7a1021d5dd
Author: Claudio Ciccani 
Date:   Sun Sep 17 13:08:14 2006 +0000

    Added direct_stream_mime(): returns mime description of the stream.

commit 1881c7fa64e27dcc9359d54eb93ab8e97163d903
Author: Denis Oliver Kropp 
Date:   Thu Sep 14 16:45:55 2006 +0000

    Fix DrawLine() for horizontal and vertical lines in negative direction.

commit 590157b49e3bb76fd49cdfb50a693727d877ff03
Author: Ville Syrjala 
Date:   Wed Sep 13 21:35:43 2006 +0000

    Recalculate buffer offset when field blit mode changes.

commit 8c1195fb29618bdf92047a01e5b3b80a2e491fc9
Author: Denis Oliver Kropp 
Date:   Wed Sep 13 14:26:44 2006 +0000

    Removed false assertions.

commit 5d40076446d95bd07fa3a4f45d9e705fb8123e4f
Author: Denis Oliver Kropp 
Date:   Mon Sep 11 18:57:13 2006 +0000

    Fixed prototype.

commit 2a9ee4f0a54c07d9d840fc8da0e6136418b17eb9
Author: Denis Oliver Kropp 
Date:   Mon Sep 11 18:09:55 2006 +0000

    Eliminate need for linking against libdirectfb.

commit 40773ff57fc612c16be262df2a85443875661a6a
Author: Denis Oliver Kropp 
Date:   Mon Sep 11 17:17:23 2006 +0000

    Align pitch of system memory buffers to be a multiple of 8 instead 4.
    
    Add extra 16 bytes at the end of a buffer as a dummy area for optimized
    routines, e.g. to avoid segfaults due to prefetching.

commit cbe590f1452e64c2607ef302692a0f8f717e9b40
Author: Denis Oliver Kropp 
Date:   Mon Sep 11 15:40:24 2006 +0000

    Moved clipping from dfb_clip_stretchblit() to gStretchBlit() doing all
    clipping, phase and offset calculations in place, well, handling the phase
    of clipped stretching at all (initial .16 value for iteration) hasn't been
    there before.
    
    Before that, clipping suffered from rounding and off-by-one errors due to
    going back to integer in between.
    
    Accesses out of surface bounds and jumping images are gone. Jumping was
    visible when the same image was stretched with the same source and
    destination rectangle each time, but with randomly changing clip rectangles.

commit d5ffae06a16ca4fb8dac83c94ad7208c86454f7c
Author: Denis Oliver Kropp 
Date:   Mon Sep 11 15:04:56 2006 +0000

    First shot at DFIFF - DirectFB Fast Image File Format
    
    Includes mkdfiff tool and a very simple and fast image provider.
    
    Loading of a 32x32 icon, for example, was about six times faster
    than with the PNG loader.

commit 2d628eeb77b84c10dc736b89fbd6d0983652dac7
Author: Denis Oliver Kropp 
Date:   Mon Sep 11 15:01:25 2006 +0000

    New capabilities for setting destination size limit. If the rectangle is
    too big, first try clip, then try again and eventually fall back to software.

commit 820f76fed710224756a4aa070c327c825b08c937
Author: Denis Oliver Kropp 
Date:   Wed Sep 6 19:08:17 2006 +0000

    Just added some debug.

commit 6781895cd4e31a5a1d076cf55f5fa75e5df50d99
Author: Denis Oliver Kropp 
Date:   Wed Sep 6 19:08:05 2006 +0000

    Fixed problem with remaining layer context.

commit 027c5d8a5dd0ddaecb353941ca109239294a0627
Author: Denis Oliver Kropp 
Date:   Sun Sep 3 14:29:18 2006 +0000

    Speed up DrawString() by 7-10% (as seen so far) bypassing the hash table
    for indices < 128, storing them in a fast array.

commit 1ff295081aeed3488ef9a556775cc6bedbcee154
Author: Denis Oliver Kropp 
Date:   Sun Sep 3 12:11:58 2006 +0000

    Return RS_REMOVE in test reaction.

commit fab18c68d21b1c8a164957b22d9b148a62499e49
Author: Denis Oliver Kropp 
Date:   Sun Sep 3 12:11:26 2006 +0000

    Added fusion_reactor_destroy() like fusion_reactor_free() but without
    freeing the shared structure etc.
    
    No longer (need to) access the shared structure during local message
    processing in the Fusion dispatcher.
    
    Other cleanups.

commit 342a45e0e0db54869e31a0569372ac42c95ec8ab
Author: Denis Oliver Kropp 
Date:   Sun Sep 3 11:54:39 2006 +0000

    Small test for problem with pending messages from destroyed reactors.

commit bd892048bcc61267fa2a59831c21c98431cec355
Author: Denis Oliver Kropp 
Date:   Sat Aug 26 11:50:04 2006 +0000

    Patch adds fusion_skirmish_lock_count() to utilize the recently added ioctl.

commit d9deb140c0946c0ed64bdb9e2c3656d3e0838f41
Author: Denis Oliver Kropp 
Date:   Sat Aug 26 11:00:50 2006 +0000

    Added diaeresis dead key combinations.
    Cast all characters to unsigned ones.

commit 137d1ec812fc7d1a2de7b254aea20be0d3905a23
Author: Denis Oliver Kropp 
Date:   Sat Aug 26 10:39:29 2006 +0000

    Mask out alpha bits properly using 0x7FFF in 15bit color keyed blit.
    
    Also avoid crossing 32bit boundaries with one access in 16bit color keyed blit.

commit 34c9aaf5e1494cc9f9c18ada18ce3262d17d136c
Author: Denis Oliver Kropp 
Date:   Sat Aug 26 09:34:18 2006 +0000

    Added DFBResult return value to graphics driver's EngineSync() and WaitSerial()
    to be able to return DFB_TIMEDOUT or other errors. In these cases the core resets
    the accelerator via EngineReset() and takes care of state invalidation etc.
    
    dfb_gfxcard_sync() and dfb_gfxcard_waitserial() also lease the graphics property,
    i.e. there are no more concurrent calls to the driver, e.g. FillRectangle() along
    with EngineSync().

commit 1b1c2fde21ffdc0005bcf9eb8d0399d7e5be3019
Author: Denis Oliver Kropp 
Date:   Sat Aug 26 09:00:47 2006 +0000

    Added some D_ASSERTs checking for properly clipped coordinates.

commit 1e42184c518b0a711c26fbd773b0e0ca2175e0b7
Author: Denis Oliver Kropp 
Date:   Sat Aug 19 22:30:20 2006 +0000

    Removed call to dfb_gfxcard_sync() in dfb_fbdev_pan().
    
    The core takes care of that.

commit df0a87c357997c35df2b6d07ba30cbba2a4e8439
Author: Claudio Ciccani 
Date:   Sat Aug 19 13:02:15 2006 +0000

    Enable VC_32BIT_SWAP on big-endian machines.

commit 3ad326aeaba5fa93e7f75ac3fce527f918382293
Author: Claudio Ciccani 
Date:   Sat Aug 19 13:01:04 2006 +0000

    Use radeon_out32() to emit vertices.

commit 0e1b344147c0cae81a38902a2435a803b90a9551
Author: Denis Oliver Kropp 
Date:   Mon Aug 14 23:04:52 2006 +0000

    In case of no hardware clipping but rectangle filling, if in DrawRectangle()
    the whole rectangle outline was outside the clipping area, the clipping area
    was drawn in the software fallback code.

commit f59f89a64adf427d30cc247a211e58c5dd803d80
Author: Denis Oliver Kropp 
Date:   Mon Aug 14 09:19:32 2006 +0000

    Implemented experimental fork() handling in Fusion.
    
    Added FusionForkAction being FFA_CLOSE by default, which can be changed to
    FFA_FORK with a call to fusion_world_set_fork_action() for each Fusionee/World.
    
    Added test program "fusion_fork" to demonstrate and test the new feature.

commit ce1bd1db0ed2b6caf294da52575054d335753ad2
Author: Denis Oliver Kropp 
Date:   Mon Aug 14 09:05:53 2006 +0000

    Fixed warning.

commit fc4be0f1dadbd02495b86f7cc3e17ae9b72b7b55
Author: Denis Oliver Kropp 
Date:   Tue Aug 8 18:37:24 2006 +0000

    In dfb_surfacemanager_deallocate() make sure no hardware read or write
    access on the buffer is pending before freeing the chunk :-P

commit afe93525dd2c03adbb96cf253c5a773237610930
Author: Denis Oliver Kropp 
Date:   Mon Aug 7 11:39:50 2006 +0000

    Added DIEF_FOLLOW to DFBInputEventFlags which indicates that another event
    will follow immediately.
    
    In the mouse driver this is used to "link" the x/y axis motion events.
    
    The window manager no longer sends two motion events (x/0, 0/y) for
    one x/y mouse movement (x and y axis at once)!
    
    Zig-zag cursor/window movement and double event/update rate are gone :)

commit d9a11536a82666b67c2873a17f67feaf629f4391
Author: Denis Oliver Kropp 
Date:   Mon Aug 7 08:55:26 2006 +0000

    Clean up error handling in system_initialize() and fix bug with shared
    memory (de)allocation.

commit 4c2ad20ec72d985c98fb224a276b39b6ed7b0bc0
Author: Denis Oliver Kropp 
Date:   Mon Aug 7 08:52:26 2006 +0000

    Finally decided to catch horizontal/vertical lines in
    DrawLine() and optimize them using rectangle filling.

commit 1441f1e2e890e52453a9f534237f548e42275dd5
Author: Claudio Ciccani 
Date:   Sat Aug 5 13:41:55 2006 +0000

    Check for PTHREAD_MUTEX_RECURSIVE declaration.

commit 63b8dc4f3dc25e229187ba4f8adb7d65213bca66
Author: Denis Oliver Kropp 
Date:   Sat Aug 5 10:43:51 2006 +0000

    Fixed root cause for negative coordinates.
    
    Thought I committed that a few days ago...

commit f0053bacf7d8b6685b21903f86c6f61af511084c
Author: Claudio Ciccani 
Date:   Sat Aug 5 10:37:48 2006 +0000

    Made 'key' argument of IDirectFBWindow::*Property() constant.
    
    Cosmetics.

commit 32fc98f444b442d802e4777e62f8b0cfb9dd787c
Author: Claudio Ciccani 
Date:   Sat Aug 5 10:00:12 2006 +0000

    Workaround for (default) window manager passing negative rectangle to dfb_gfxcard_blit().

commit e80c9279635ed1dd16241201e28fc19c97fe6195
Author: Mike Emmel 
Date:   Sat Aug 5 01:59:11 2006 +0000

    /tmp/cvsIa7FG7

commit d239530a079a266a55ab22057f4dc70e153c5fd9
Author: Denis Oliver Kropp 
Date:   Fri Aug 4 21:05:09 2006 +0000

    Check if window is destroyed and return DFB_DESTROYED in all functions
    which would have called the WM, because a destroyed window is no longer
    known to the WM and the WM's window data structure is deallocated.

commit 4b7976bb244fae7eaaca7e5236219bfdd42a2f46
Author: Denis Oliver Kropp 
Date:   Fri Aug 4 16:29:19 2006 +0000

    Added "name" parameter to fusion_ref_init() like others already have.
    
    Gives nice debugging in /proc/fusion/../refs now :)

commit f23da51a0c291e976d524e6cbd98c81e0c5e849d
Author: Claudio Ciccani 
Date:   Thu Aug 3 17:57:56 2006 +0000

    Unref attached window on destroy event.

commit 70e3596f5ab2d22f146d1c6e0d4a0fbc83cad888
Author: Claudio Ciccani 
Date:   Thu Aug 3 17:20:00 2006 +0000

    This is my latest development version of the radeon driver.
    Main changes affect the R300, which now supports FillTriangles() and DSDRAW_BLEND.

commit 40da4bef4cdb8a674d2b3be8945f83229780e1f9
Author: Claudio Ciccani 
Date:   Thu Aug 3 17:03:49 2006 +0000

    No longer unref the window in IDirectFBWindow_React().

commit 097955a4b08aa174145e48aae46eed57db8da9aa
Author: Denis Oliver Kropp 
Date:   Thu Aug 3 16:49:07 2006 +0000

    Return DFB_LOCKED in fusion_ref_up() if EAGAIN is received (ref is zero locked).
    
    Added D_UNIMPLEMENTED() message to single app version of fusion_ref_inherit().

commit f45a2fdfc2194c59a10cef47085ce528ba8477b4
Author: Claudio Ciccani 
Date:   Thu Aug 3 13:48:23 2006 +0000

    Debug already destroyed windows in dfb_window_destroy().

commit 6b8aa0d5240f2af69ff4d71751ee137e5ddad8b2
Author: Claudio Ciccani 
Date:   Thu Aug 3 13:46:45 2006 +0000

    Undone last change: do not destroy the window, but always unref it (to destroy the fusion object).

commit d60d9cabb5c6f9c0cf0904831a45e2386aab37ea
Author: Claudio Ciccani 
Date:   Thu Aug 3 13:14:40 2006 +0000

    IDirectFBEventBuffer references attached windows and IDirectFBWindow always
    destroyes the window on release: this way releasing the event buffer before
    the window no longer causes an assertion failure.

commit 98ac58d1e6621c9bf4928637ed46a5e6e7bd3d93
Author: Claudio Ciccani 
Date:   Wed Aug 2 09:52:47 2006 +0000

    Implemented Bop_4_to_Aop and Sacc_to_Aop_a4.

commit 23fd8a929012e8d0827efafaa26c4f82f766b2cd
Author: Claudio Ciccani 
Date:   Wed Aug 2 09:51:00 2006 +0000

    DSPF_A8 and DSPF_RGB332 were writing (dx+len) pixels instead of (len).

commit fe3288451d6e3fe70c94233cabd6d01caf7c07f1
Author: Claudio Ciccani 
Date:   Tue Aug 1 13:46:39 2006 +0000

    Enable using recursive mutexes when PTHREAD_MUTEX_RECURSIVE || __USE_UNIX98 are defined.

commit 5e14aa5189b2be1ce47a6a6391ee343280323cca
Author: Claudio Ciccani 
Date:   Tue Aug 1 09:35:07 2006 +0000

    Fixed compilation failure with gcc-2.95.

commit f52a9b083cbbb60870e8b415802e3082c86800dd
Author: Claudio Ciccani 
Date:   Mon Jul 31 16:39:41 2006 +0000

    Handle NULL subsurface's rectangle.

commit 0a15bc4dab135cd06871adb799838042c1b3f65d
Author: Claudio Ciccani 
Date:   Mon Jul 31 11:12:41 2006 +0000

    Remember if a subsurface was created with a NULL rectangle, in this case
    treat it as normal surface in case of parent resizement.
    This is actually a workaround, because it won't work in the following situation:
      surface->GetSubSurface( rect, &surface1 );
      surface1->GetSubSurface( NULL, &surface2 );
      // surface2 won't fit surface1 on resizement
    
    
    Fixed window manager's isets stuff:
      IDirectFBSurface_Construct() takes a DFBInsets argument
      that will be used to compute the clipping rectangle for the current area.

commit fb3523ead498371e93718b6b7550220496fe092f
Author: Denis Oliver Kropp 
Date:   Mon Jul 31 10:59:38 2006 +0000

    If a channel has no bits, don't care about their position :)

commit d18117e7adb52a172af3f382a9489b8e1b6d51f5
Author: Claudio Ciccani 
Date:   Mon Jul 31 10:58:28 2006 +0000

    Added dfb_rectangle_subtract(): subtract insets to rectangle.

commit a697f328d93845c37642ab0ae55b6482c7802429
Author: Claudio Ciccani 
Date:   Sat Jul 29 10:27:34 2006 +0000

    Allocate the accumulator only if it will be used.

commit ee57c56d78e6ff64c6648039183e723933f67847
Author: Denis Oliver Kropp 
Date:   Thu Jul 27 22:07:04 2006 +0000

    Make sure pool is mapped properly before actually doing the malloc/realloc/free.
    
    Now the lock order "shm shared lock -> shm pool lock" should not be violated,
    because _fusion_shmalloc_cure() should not be called in a malloc/realloc/free
    context anymore.

commit ce3e45a6b8db169432f933bf2e545796ed11ce84
Author: Denis Oliver Kropp 
Date:   Thu Jul 27 21:04:33 2006 +0000

    Fix deadlock caused by lock twists.

commit 67e04b3abad99a5d8d11237505b544eebadcad66
Author: Mark Adams 
Date:   Thu Jul 27 15:36:18 2006 +0000

    Added PCI ID for CN700.

commit afa584564ab4296cd1b4f7d03c71c90c465a0c90
Author: Claudio Ciccani 
Date:   Thu Jul 27 13:00:48 2006 +0000

    Removed (erroneously set) flag VF_RADEON_MODE in r200DoDrawRectangle3D().

commit 3dbb6d54df8dc23f11a69c276292e7fb2240bc78
Author: Mark Adams 
Date:   Wed Jul 26 16:45:35 2006 +0000

    Now saves PCI ID for use elsewhere (comments said it did before but it
    didn't).

commit 84497be99cdfb491a9c26c61bde5b0df531cbf46
Author: Claudio Ciccani 
Date:   Mon Jul 24 10:43:47 2006 +0000

    Print device name all uppercase.

commit 46d0cc6874b598cf77df8dc177fbec4819a94054
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 16:49:35 2006 +0000

    Due to increasing amount of debug messages the default is "no-debug" now.
    
    It makes more sense to only enable wanted debug domains by hand, e.g. "debug=core/font".
    
    Otherwise, "debug" option still works, too.

commit 73556cd75075ce3c4e9555f126fbb7e72cbd9be5
Author: Claudio Ciccani 
Date:   Sun Jul 23 14:10:38 2006 +0000

    Store delayTime in microsecs and use gettimeofday() instead of ftime().

commit 2689ae02df370edf2fddf18a802c775fff73ed64
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 13:54:01 2006 +0000

    Include  only if present.

commit 406a3ad580bdf166726fc1845b3550d42b95bdbe
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 13:51:08 2006 +0000

    Fixed warning about unused debug domain by commenting it out.

commit ff5d776bf66d2bedffb38d5e762220e652a79844
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 13:11:08 2006 +0000

    Plug brand new leakage of glyph data.

commit 42ba63c0efeb91ab13923e41484fda863677ed9f
Author: Claudio Ciccani 
Date:   Sun Jul 23 12:46:42 2006 +0000

    Moved DirectFBGL header to the proper location.
    
    We need the header here since the DirectFBGL interface is strongly
    integrated within DirectFB and we want to support external implementations.

commit f09a398ba83aff7141df6851cebce4288756c534
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 12:46:21 2006 +0000

    Line length is 120 :)

commit 24adf00bb9d8037bffa34f4c213aa625752c0d4f
Author: Claudio Ciccani 
Date:   Sun Jul 23 12:24:45 2006 +0000

    First attempt to give some hints on the coding style.

commit 1ea4ceae0c1923cfb3832f2619389dd25424c7cd
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 11:38:59 2006 +0000

    Increased core ABI after recent changes in FusionObject.

commit 3175121fdc1b9ebeba9151f76815887fe3714f17
Author: Denis Oliver Kropp 
Date:   Sun Jul 23 11:01:06 2006 +0000

    Finalized code, not only cosmetics, fixed const/non-const, missing return
    values, suggested braces, assertions, complete error handling etc...

commit a647aec39a924cee7e7805e1118fa82df98ccb54
Author: Mike Emmel 
Date:   Sat Jul 22 20:24:28 2006 +0000

    New fusion hash and property support for object

commit 095175591a5ed516d60e9dd6a46e08613a5622e7
Author: Denis Oliver Kropp 
Date:   Sat Jul 22 18:46:29 2006 +0000

    Implemented font cache limit, currently hardcoded to five rows, each row
    stores a number of glyphs.
    
    When the maximum number is reached it will reuse the least recently used
    row, kicking out glyphs that have been on it.
    
    Doing that on a glyph basis would require some more work and has a greater overhead.

commit f46dce7c4f05e7415f7b4bbfa9806da1ecada242
Author: Claudio Ciccani 
Date:   Sat Jul 22 15:07:53 2006 +0000

    Added patch to radeonfb fixing support for R300 chipsets (it also adds new devices).

commit a922650a4ffc47ea5fba1369d798150c842818b6
Author: Denis Oliver Kropp 
Date:   Sat Jul 22 14:46:59 2006 +0000

    Fixed warnings.

commit 85e6caefe8c595a16dccd2e1d3e380945596cf7b
Author: Denis Oliver Kropp 
Date:   Sat Jul 22 11:19:09 2006 +0000

    Simply use a hash for glyph infos instead of a tree with an array for
    the first 127 keys (fast indices)...

commit 46b6f75bb024019d95c76d0146dd6e10c609af51
Author: Claudio Ciccani 
Date:   Fri Jul 21 20:50:23 2006 +0000

    Avoid writing to R300_TX_OFFSET_1, radeonfb must be patched before doing it.

commit b9d8aa6313893e0738b9694fbc5a6bc235b9450c
Author: Claudio Ciccani 
Date:   Fri Jul 21 20:13:44 2006 +0000

    Use different settings for R300 and non-R300 when setting MC_FB_LOCATION.

commit cea99f8a346ff1ba379cd5a9626b658577da28b3
Author: Claudio Ciccani 
Date:   Fri Jul 21 18:09:52 2006 +0000

    Need to set MC_FB_LOCATION at offset 0 to avoid crash with R300s.

commit 452c3817945dc530079e25137eb1b2db3f3b1135
Author: Claudio Ciccani 
Date:   Thu Jul 20 13:19:46 2006 +0000

    Replaced direct_stream_fopen() by direct_stream_fileno().
    Added direct_stream_dup() (increase stream's reference counter).

commit c13d5cea603f305f0e76300dff857d14cff44d29
Author: Claudio Ciccani 
Date:   Thu Jul 20 13:17:13 2006 +0000

    Dropped support for GIF87 (can't be animated).

commit 077f1ae89cf73f2171774b2469805c8c932514da
Author: Claudio Ciccani 
Date:   Wed Jul 19 12:28:40 2006 +0000

    Notify speed change to video thread.

commit e85c861bda261c169e5d2ffcd68c637a57d55c60
Author: Claudio Ciccani 
Date:   Wed Jul 19 10:10:32 2006 +0000

    Added Animated GIF video provider.
    (I put it here, instead of DirectFB-extra, because it may be usefull for animated cursors).

commit 9cc7558c5b6484a107fc231a7e5879927aa96905
Author: Denis Oliver Kropp 
Date:   Wed Jul 19 01:48:11 2006 +0000

    Local 'local reactions' are no longer processed
    before dispatching further via the kernel device.
    
    This causes all local reactions within each Fusionee to
    be called by the Fusion Dispatcher only, in chronological order.
    
    It's a fundamental change in runtime behaviour which might break
    some code that relies on the synchronous execution of some of the
    local reactions, the dispatcher's own.

commit e69ef63383b5f6d8536d568b23c5f4d15519a264
Author: Denis Oliver Kropp 
Date:   Tue Jul 18 17:05:08 2006 +0000

    Show which surfaces are preallocated.

commit 5cd415372b356750e72ab4d1c130dad622e9c07b
Author: Denis Oliver Kropp 
Date:   Tue Jul 18 01:07:13 2006 +0000

    Before every graphics operation, i.e. in dfb_gfxcard_state_check(),
    clip the state's clipping region to the destination surface dimension.
    
    In debug mode too big clipping regions will still show a failing D_ASSUME,
    while other errors like x1 > x2 or x < 0 will break with a failing D_ASSERT.

commit 52b0a995a642e3e5f14732f2fcc2e1e0773340e1
Author: Denis Oliver Kropp 
Date:   Mon Jul 17 23:13:29 2006 +0000

    Fix warning in non-debug build by putting an '#if D_DEBUG_ENABLED' around
    the static const table of strings used only in the debug message further below.

commit 524f9a21099d0037d4e28fa427d0feea63501d63
Author: Claudio Ciccani 
Date:   Mon Jul 17 13:12:21 2006 +0000

    Removed return value from DVFrameCallback.

commit 7ddb76e6dd224a85005d4ef6a6642ae4d9cf9196
Author: Claudio Ciccani 
Date:   Mon Jul 17 13:10:45 2006 +0000

    Declare PCI regs locally (avoid inclusion of ).

commit ac91f7c11b55222bcbf3a2f72eb5281dd1d59c61
Author: Denis Oliver Kropp 
Date:   Sun Jul 16 21:06:50 2006 +0000

    Added option --rgbformat which in contrast to the --format option
    only is effective if the image doesn't require an alpha channel.
    
    That's useful e.g. with RGB16 for opaque and ARGB for blended images,
    when the primary format will be RGB16.
    
    So far directfb-csource either used ARGB/RGB32 automatically,
    or it always used RGB16 or whatever you specified via --format.

commit 10c3e898329f470e7c35e05783bab5f335514c3b
Author: Denis Oliver Kropp 
Date:   Sun Jul 16 10:15:29 2006 +0000

    Rewritten cursor handling (software cursor) to use a surface instead of a window.
    
    The window manager module gets notified about all kinds of updates regarding the cursor.
    
    All window manager modules use the same code for now, using backing store for the region under
    the cursor. This avoids revealing window content that hasn't been commited via Flip(), yet.
    
    It should also be faster as it no longer depends on the windows that are covered by the cursor.

commit 1d3e3e027e01b77c61e51e5a320202225e04cc69
Author: Denis Oliver Kropp 
Date:   Sun Jul 16 10:15:00 2006 +0000

    Added some assertions to dfb_gfxcard_blit()
    checking for a properly clipped source rectangle.

commit 8a99e6e2825b17c27214ff9d87f1b226b1818509
Author: Ben Combee 
Date:   Sun Jul 16 08:29:43 2006 +0000

    Add DFB_RECTANGLE_CONTAINS_POINT and DFB_REGION_CONTAINS_POINT macros to directfb_util.h

commit d41c702d3967f667a78b69918bb3abe589405f22
Author: Denis Oliver Kropp 
Date:   Sun Jul 16 08:28:35 2006 +0000

    Added dfb_gfx_copy_to() as an extension of dfb_gfx_copy().
    
    The advantages are
    - destination offset can be different from source offset
    - blitting from the back buffer is available
    
    The latter was a must for the backing store based software cursor.

commit 8f90d901bef3bb9976a86db4cf2dd109448f1ca2
Author: Denis Oliver Kropp 
Date:   Sun Jul 16 08:25:47 2006 +0000

    Show base address of each file to allow offset calculation 'by hand' within
    dynamically loaded modules, i.e. where ldd doesn't help.

commit 27527bfaa451fe99444e11ad62915790f9f94a2c
Author: Claudio Ciccani 
Date:   Thu Jul 13 12:56:16 2006 +0000

    Handle driver's functions return value.

commit 6cbfd93bed9ced28a17c380eae4836e2913a3412
Author: Claudio Ciccani 
Date:   Thu Jul 13 10:59:49 2006 +0000

    Ignore callback result when rendering buffered image data.

commit ab1e80eaa80ebe6f8feec30dd02cba262a25c420
Author: Claudio Ciccani 
Date:   Wed Jul 12 16:37:31 2006 +0000

    Follow changes.
    
    Added support for streaming databuffers.

commit 01e59378c3a712a3336d44684f8d9fc487e080f4
Author: Claudio Ciccani 
Date:   Wed Jul 12 16:36:52 2006 +0000

    Follow changes.

commit ccd66054ff53b59bfadcd6f00c53bed4715931fa
Author: Claudio Ciccani 
Date:   Wed Jul 12 16:35:57 2006 +0000

    dfb_scale_linear_32() and dfb_copy_buffer_32() take a DFBRegion argument
    specifing the destination clipping region (passing a NULL region means that
    destination rectangle was already clipped).
    
    This change allow to render images on a portion of the surface preserving
    the original scale factor.

commit c11392025a92412d2510c32a6cf4c4243f9f0866
Author: Denis Oliver Kropp 
Date:   Mon Jul 10 22:39:57 2006 +0000

    After resizing the hash free old array.

commit b7f248610db8264cfdc3650737d8958c5e2d23f4
Author: Claudio Ciccani 
Date:   Mon Jul 10 09:38:11 2006 +0000

    Put AGP aperture start location after frambuffer memory location.

commit 1d9c363691a204b164e85982d305d74f20f2f4c4
Author: Ville Syrjala 
Date:   Mon Jul 10 08:46:22 2006 +0000

    Use CONFIG_APER_* to set MC_FB_LOCATION. Otherwise my M6 will hang when
    using the overlay.

commit 2178fb52619977f82aa360400e02c8bc7270530a
Author: Claudio Ciccani 
Date:   Sun Jul 9 15:40:16 2006 +0000

    DVPLAY_NORMAL renamed DVPLAY_NOFX.

commit 034b697ffda0627f4cfcf61ef3877071ad3338a2
Author: Ville Syrjala 
Date:   Sat Jul 8 19:47:48 2006 +0000

    Fixed planar data copy. Added more pixelformat for v4l2.

commit 74d1ca9bcfb57703fbf0ed718abb36c55346439b
Author: Ville Syrjala 
Date:   Sat Jul 8 19:31:45 2006 +0000

    Removed some useless code and made wait_for_buffer() static.

commit 4e4518f49d440e2f2969f88877184aa7fbc3553a
Author: Ville Syrjala 
Date:   Sat Jul 8 16:12:22 2006 +0000

    Reduced ifdef clutter.

commit 5f5a5ed7108fadcbd36ebbb1150418abe6a4e23d
Author: Denis Oliver Kropp 
Date:   Tue Jul 4 09:23:06 2006 +0000

    Moved modification of caps depending on policy into static inline helper
    function dfb_surface_caps_apply_policy(policy, &caps).

commit 7435837e15f1a86658a49b40c39b01ee7ae09bbc
Author: Denis Oliver Kropp 
Date:   Tue Jul 4 09:21:37 2006 +0000

    Removed another warning.

commit b6ded019dda2a19996a88d2c3c640dc6afb3f223
Author: Denis Oliver Kropp 
Date:   Tue Jul 4 09:11:44 2006 +0000

    Fixed failing assumptions due to late initialization of dfb_sdl_core after
    call to dfb_fbdev_read_modes() used for faking video modes, added recently.

commit 77abe4afdb0aa456f33c50c912b62a9bcb9c58e0
Author: Denis Oliver Kropp 
Date:   Mon Jul 3 16:40:40 2006 +0000

    Fixed warnings.

commit 9da576fcedb3294a9f5779deaf211f46f2598ae8
Author: Ben Combee 
Date:   Sun Jul 2 20:43:18 2006 +0000

    libdirect - fix memory leak that occured when creating a stream failed

commit 3f5e907d23e9977999e6a013656ec7ca9135d5a7
Author: Denis Oliver Kropp 
Date:   Thu Jun 29 16:55:38 2006 +0000

    Link libdirect into fx for debug.

commit 8ae52fa3aeb060410de61500139c8faad1c61083
Author: Claudio Ciccani 
Date:   Thu Jun 29 10:22:52 2006 +0000

    Dropped down YUV->RGB on the RV250.

commit 9eee9af41559b3645d4953b7b876a4ac5c8f495d
Author: Claudio Ciccani 
Date:   Thu Jun 29 09:55:51 2006 +0000

    Get the device id from the PCI config space.

commit 827e539061bb87b926f66908fea3fdaa57f6d840
Author: Claudio Ciccani 
Date:   Wed Jun 28 17:13:56 2006 +0000

    Avoid to set the overlay memory limit, it's already done by the kernel.

commit d7d018ac8c1d76281fa94f8f273ba9941c373b25
Author: Claudio Ciccani 
Date:   Wed Jun 28 17:12:58 2006 +0000

    Basic acceleration for ALUT44.
    Check for source and destination's palette equality.

commit 32699b0c8c5cdf40f4658e43173c7dec6cacbeea
Author: Ben Combee 
Date:   Wed Jun 28 16:46:54 2006 +0000

    Change another set of declarations to prototypes to avoid use-time warnings, this time in DFB's core

commit 59ea034507fa4bf4b59be66a87353d3777d1c405
Author: Denis Oliver Kropp 
Date:   Wed Jun 28 15:58:12 2006 +0000

    Use DFBSurfaceLockFlags instead of unsigned int flags in prototype of locking functions.
    
    Thanks to Nils Magnus Larsgard !

commit 521b092a58b42333ffd0b54b14cb382f0e0272a8
Author: Denis Oliver Kropp 
Date:   Wed Jun 28 15:53:59 2006 +0000

    Very basic program to emulate/illustrate the pixel pipeline, blitting flags etc.
    No 100% guarantee that itself is correct, but in the end it will serve as a
    verification for software/hardware driver.

commit 16bbc2a20be137f39891e849b41f67f2bbccc1b4
Author: Denis Oliver Kropp 
Date:   Wed Jun 28 15:50:32 2006 +0000

    Just a rough diagram (overview) I made a while back.
    
    While it lacks some explanations, it's a good help reading the code.

commit 57cb1d5d04c95f76b878395141bd1b16c0aaa414
Author: Ben Combee 
Date:   Wed Jun 28 08:29:41 2006 +0000

    Turn void function declarations into true prototypes in libdirect

commit d94635495570ce9ef975dc4f3f876f61bb1d1d6b
Author: Ville Syrjala 
Date:   Tue Jun 27 21:16:26 2006 +0000

    Applied a patch from Marko Mäkelä  fixing build
    problems with gcc (GCC) 4.1.2 20060613 (prerelease) (Debian 4.1.1-5).

commit d0cdeced1f24a031a7837cd365706421791f0309
Author: Claudio Ciccani 
Date:   Sun Jun 25 13:53:09 2006 +0000

    Fail if a blitting function between surfaces with different palettes is requested.

commit 02d5d94561490e4c81d4ad6c82241b9d3187d94c
Author: Claudio Ciccani 
Date:   Sun Jun 25 13:50:45 2006 +0000

    Check if palettes are equal when blitting indexed formats.

commit 3c98e7c650ced57002a39e97858f3f2f4a773dfc
Author: Claudio Ciccani 
Date:   Sun Jun 25 13:49:00 2006 +0000

    Added dfb_palette_equal(): check if two palettes are equal.

commit 2ecc8ab0ba278b27ce45961fbc50eb0153ef2f9c
Author: Denis Oliver Kropp 
Date:   Sat Jun 24 14:08:01 2006 +0000

    Made predefined palette entries in DFBSurfaceDescription const.

commit 472251c4955b2b5bde4c388306f5308f94e109a0
Author: Claudio Ciccani 
Date:   Sat Jun 24 12:50:02 2006 +0000

    Added IDirectFBVideoProvider::GetVolume() (for completeness).

commit 79e81a14355c6cead7c82ee56e05183976e8da14
Author: Claudio Ciccani 
Date:   Sat Jun 24 10:14:14 2006 +0000

    Added dfb_screens_at_translated() and dfb_screen_id_translated().
    Set the primary screen according to the primary layer.

commit 8edf62d2036ce4fea290f2b9e7838ed8f7b27bec
Author: Claudio Ciccani 
Date:   Sat Jun 24 10:10:38 2006 +0000

    Added IDirectFBVideoProvider::SetVolume().

commit afec34d3acfbcf78204dbe1e3d41cf81bb3349e5
Author: Claudio Ciccani 
Date:   Fri Jun 23 17:59:03 2006 +0000

    Added IDirectFBVideoProvider::SetPlaybackFlags(),
          IDirectFBVideoProvider::SetSpeed(),
          IDirectFBVideoProvider::GetSpeed() (preplace trick mode methods).
    
    Added IDirectFBScreen::GetSize(): fast way to detect screen size
    without the need of scanning layers in search of the underlay
    (usefull when working with overlays).

commit 435956a0f1c89b882d76d8ee41136d32805b4b98
Author: Claudio Ciccani 
Date:   Fri Jun 23 06:01:37 2006 +0000

    More Porter/Duff rules (SRC_ATOP,DST_ATOP,ADD,XOR).

commit e51000bc963406518d1132834e3f0ae05db5d17d
Author: Ville Syrjala 
Date:   Thu Jun 22 19:44:55 2006 +0000

    Increased bytepitch alignment to match field blitting requirements.

commit c9347d3778cf38bdaf1afd18c7420191849f5aa1
Author: Claudio Ciccani 
Date:   Thu Jun 22 12:31:35 2006 +0000

    Replaced tabs by spaces.

commit 3f9801f4f6df0256caa9ab3a3ae28032249ea41b
Author: Claudio Ciccani 
Date:   Thu Jun 22 12:30:39 2006 +0000

    When enabling DLOP_ALPHACHANNEL on the underlay, do not fail if the overlay
    level is still set to 1.

commit 0b0b9f37b5f5641ba2ba515d9530412443c6d601
Author: Ville Syrjala 
Date:   Thu Jun 22 00:36:11 2006 +0000

    Field based blitting.

commit cb767ad5712b10192ec421a0322e796202e7f3dd
Author: Ville Syrjala 
Date:   Thu Jun 22 00:04:23 2006 +0000

    Added DSCAPS_SEPARATED support to BES, CRTC2 and SPIC.

commit b8cf8d2a18c084121f3e18ad7640200339f24784
Author: Ville Syrjala 
Date:   Thu Jun 22 00:02:05 2006 +0000

    Fixed pixelpitch alignment for YUY2/UYVY.

commit 32723da73f98a9114389d5f4fa3ae6961597f2fb
Author: Claudio Ciccani 
Date:   Wed Jun 21 09:20:59 2006 +0000

    Treat fbdev format 8/16,8/8,8/0,0/0 as ARGB when ARGB was requested
    (that because framebuffer drivers generally ignore the alpha channel).

commit d239aec02d7d00dea64cbbe47c20f9d852652b62
Author: Ville Syrjala 
Date:   Tue Jun 20 19:34:51 2006 +0000

    PAL-60 support (or at least close enough for my TV).

commit d4ed9134426b8a23ea098eb36a5b8e5e65581c60
Author: Denis Oliver Kropp 
Date:   Tue Jun 20 12:10:21 2006 +0000

    Populating screen API a bit more, thanks to Daniel Laird !

commit f71d0dcd9c5eb88eb36a903b8479987c8ac039e0
Author: Denis Oliver Kropp 
Date:   Tue Jun 20 12:08:21 2006 +0000

    Trick modes thanks to Daniel Laird !

commit d888005e053ee8b7225cc0e1139fffb38fab572c
Author: Claudio Ciccani 
Date:   Tue Jun 20 10:11:58 2006 +0000

    Added the possibility to use the underlay as an OSD.
    It works exactly the same way as in the unichrome driver:
     - Set the overlay level to -1;
     - Enable DLOP_ALPHACHANNEL on the underlay.

commit 95f01e68149593bf2ecfb6f32d2f6e36ccf24a29
Author: Ville Syrjala 
Date:   Sun Jun 18 19:52:46 2006 +0000

    Cosmetics.

commit 9f3a968772b0679336908839619bdd1b86baac1d
Author: Ville Syrjala 
Date:   Sun Jun 18 19:52:19 2006 +0000

    Removed unnecessary headers and libs.

commit 9b52d2b4f9f07dac7243de54545f3c67eeed099a
Author: Ville Syrjala 
Date:   Sat Jun 17 16:21:24 2006 +0000

    Silenced some compiler warnings.

commit 7cdcda360372afe14227794900630e159ac62583
Author: Denis Oliver Kropp 
Date:   Thu Jun 15 18:59:17 2006 +0000

    Fixed prototypes.

commit f4153d9c676a31ec6c31954cbcfe6016bb17ee48
Author: Mike Emmel 
Date:   Wed Jun 14 18:52:55 2006 +0000

    Added the StartDesktop hook to run a advanced complex wm
    Note I made a change to unique it was not handing out the window for the cursor
    this broke code that thought with a valid id it would get a window
    it sets it to null and returns DFB_OK
    Denis you make want to check this but we don't want to return DFB_OK I think if
    we set the window to null

commit d96b3e16aba1b882bf5e4b4193728b7f38443959
Author: Denis Oliver Kropp 
Date:   Wed Jun 14 07:06:03 2006 +0000

    Some changes that decrease system memory usage for surface buffers,
    especially where graphics memory is available.
    
    
    Allocate system instance of auto-video buffers on first access,
    not immediately during creation of the surface.
    
    Deallocate system memory when buffer is written to in video memory.
    Reallocate it if the buffer is kicked out of video memory.
    
    Implemented "suspended" surface buffers, temporarily deallocated.
    No valid instance at all until it's resumed.
    
    Added dfb_surface_buffer_suspend/resume().
    Added SBF_SUSPENDED.
    
    Cleaned up some surface manager and surface locking functions.

commit 929f70068fb2cf45af8cc395ec593f848e90ae99
Author: Denis Oliver Kropp 
Date:   Tue Jun 13 14:13:17 2006 +0000

    Added DFB_SUSPENDED error meaning "The requested object is suspended!".

commit fd15a66f7da9452d396a93650433d5cf8860b298
Author: Denis Oliver Kropp 
Date:   Tue Jun 13 14:11:02 2006 +0000

    Fixed dfb_window_create(). Alpha blended windows have been broken due to
    wrong order of code segments.

commit 1eba7234aa3870fe44f1a77d4fb796f7b3c0c01a
Author: Denis Oliver Kropp 
Date:   Tue Jun 13 10:48:41 2006 +0000

    cosmetics

commit a906bc47e075c31eef9023f2ac1931eb56bce3f3
Author: Denis Oliver Kropp 
Date:   Tue Jun 13 10:47:18 2006 +0000

    Thanks Mike! Looks like I took the last but one diff that I made when taking
    over these changes...

commit a59198e49e6d71ff426091b95d74a2350ba57a8e
Author: Mike Emmel 
Date:   Mon Jun 12 21:35:19 2006 +0000

    Fixed unclosed comment that broke the build

commit 202dfb7eceefe5fa0d090dedb03467d38cdde943
Author: Denis Oliver Kropp 
Date:   Mon Jun 12 17:31:44 2006 +0000

    Added IDirectFBDisplayLayer::SetClipRegions().
    
    If supported, this method sets the clipping regions that are used to
    to enable or disable visibility of parts of the layer. The number of
    regions is stated in the display layer description. The layer will be
    shown only in these regions or except in these regions.

commit d6d31c32bb95b58d453acb9a999e72492225ddda
Author: Mike Emmel 
Date:   Sun Jun 11 20:29:59 2006 +0000

    Added GetPosition to Surface it was missing I needed it and
    it seems innocous and consistent.
    If there is a problem we can discuss on the list

commit d387aaea9a3705653792033fce76037a5fa3fb74
Author: Mike Emmel 
Date:   Sun Jun 11 18:23:09 2006 +0000

    Redid XServer to open display outside window
    and save it in the dfb_x11 main struct
    this gets rid of a lot of race conditions and problems
    also starts toward setting up the driver for optional rootless operation

commit dceff0bf9a18f0a0d44a1bef86877400a1639d98
Author: Claudio Ciccani 
Date:   Sun Jun 11 17:55:10 2006 +0000

    Disable writing to the R300_TX_CNTL register
    because radeonfb doesn't map that range of the mmio.

commit d8bdd086a1b7a40fde33c9c4392dfa4ea3c267a8
Author: Mike Emmel 
Date:   Sun Jun 11 16:44:34 2006 +0000

    Missed file

commit dd1fde38a5532d719a130c5555ba4a578b6cdbef
Author: Mike Emmel 
Date:   Sun Jun 11 16:33:00 2006 +0000

    /tmp/cvsRBHEMO

commit 4a68f1b26b0fc9c705e13cc65988564150bb7e07
Author: Ville Syrjala 
Date:   Sun Jun 4 20:34:04 2006 +0000

    Avoid negative array indices.

commit a0793d8fca9bf7c31b063f85c02fd08581d3e7d0
Author: Ville Syrjala 
Date:   Sun Jun 4 20:29:04 2006 +0000

    Silence warnings.

commit 8e02ad194ba004d9b37fe7e427b10aeed01cf1ec
Author: Ben Combee 
Date:   Sun Jun 4 17:53:42 2006 +0000

    Add accessor for debugging fusion ref-count problems

commit ac80ac727942d7e71b41c01b02132184ddcccd84
Author: Ben Combee 
Date:   Sun Jun 4 17:52:22 2006 +0000

    Update graphics ops to immediately unref source surfaces allowing quicker memory reuse

commit c4e66c057a1b06e644ed2153b3a34306a655d07d
Author: Ben Combee 
Date:   Sun Jun 4 17:51:20 2006 +0000

    Update SDL input handling to better emulate keymaps

commit 6c5862a82d94f3d27d1c968b3eec1a231beaf01f
Author: Ben Combee 
Date:   Sun Jun 4 17:50:10 2006 +0000

    new libdirect function to duplicate a file descriptor as needed, making sure new filedes isn't mapped to stdin, stdout, or stderr

commit 1263c28fd977a24a2dd45f146c5f9e7134485325
Author: Ben Combee 
Date:   Sun Jun 4 17:48:34 2006 +0000

    directfb-csource tool now makes strucs and bitmap data const, helps with use in shared libs

commit 082b950db08724dee40a1a80fefc07b92a08f4e4
Author: Ben Combee 
Date:   Sun Jun 4 17:47:54 2006 +0000

    Add ability to tell image provider to abort rendering

commit 051aa4f862d2e0fe1a6a4e0639c013a14b4a541d
Author: Ben Combee 
Date:   Sun Jun 4 17:47:01 2006 +0000

    Blit to misaligned surface fix

commit 1a7a4bb161cdb42c2ce4d5c96b9c782a45442aa9
Author: Mike Emmel 
Date:   Sat Jun 3 18:57:52 2006 +0000

    Both
    IDirectFB_GetDisplayLayer
    and
    IDirectFBDisplayLayer_SetConfiguration
    cause a xwindow to be created
    this causes the first window to be destroyed
    and a second to be created with the new configuration.
    There are a number of problems here and the code
    needs to be reworked to not create the window or at least not
    display it because were changing configurations or enumerating layers.
    There are several conceptual problems here.
    but at least we won't get two windows with one not used

commit 9c7848b6e84521b7a07e48f44e6290eecbd504a7
Author: Mike Emmel 
Date:   Fri Jun 2 17:50:31 2006 +0000

    Added some more checks for race condition between input and connecting to
    the display
    this should have a lock I think

commit 9915bb2814e5cb057b74a1a98212a978e72c27b1
Author: Mike Emmel 
Date:   Sun May 28 05:24:42 2006 +0000

    Added scrollwheel patch

commit c8cac4cace7c77ea25598e4b044c2418699745f6
Author: Claudio Ciccani 
Date:   Sat May 27 13:05:53 2006 +0000

    Applied patch by Christer Palm : fixes word swapping on PPC.

commit 045c214d2a5a91c5ea4b3bf8972533d809ef881e
Author: Denis Oliver Kropp 
Date:   Fri May 26 08:19:52 2006 +0000

    Added 4 bit packed alpha pixel format DSPF_A4, e.g. for fonts.

commit 714d543c30311d7466a99de9c13d1dabbec111ec
Author: Claudio Ciccani 
Date:   Thu May 18 15:26:17 2006 +0000

    Added IDirectFBInputDevice::DetachEventBuffer() and IDirectFBWindow::DetachEventBuffer() to
    detach an event buffer from an interface.

commit 29cf44cd57b81d4a6ed870d2bb687f6b0a66b552
Author: Ville Syrjala 
Date:   Tue May 16 18:55:07 2006 +0000

    Wait for correct amount of fifo entries.

commit c365ba8cf8822535607627af61a52062ba01aa1e
Author: Ville Syrjala 
Date:   Fri May 12 19:50:00 2006 +0000

    - Don't touch console blanking when using graphics-vt.
    - Disable cursor on startup.

commit 3a5cdbc71a905bba703ba6a148f4881eae0129f6
Author: Denis Oliver Kropp 
Date:   Sat May 6 23:59:43 2006 +0000

    Fake video modes by reading fb.modes, just like the fbdev backend.

commit 0e2795f29ae7c1009739243ff2c486dfcfd2e8d1
Author: Denis Oliver Kropp 
Date:   Sat May 6 23:44:19 2006 +0000

    Added new debug domain Core/Graphics.
    
    Added two debug messages to dfb_gfxcard_drawglyph().

commit dd2e0972d382568051958952f3a298a98b4192f4
Author: Denis Oliver Kropp 
Date:   Sat May 6 23:43:08 2006 +0000

    Fixed occasionally invisible DrawGlyph(), parameter and local variable name
    changes were not complete and an uninitialized local variable was checked
    instead of the parameter.

commit fe061852e95b8adefc335c66739c4ee90a67f1c3
Author: Denis Oliver Kropp 
Date:   Sat May 6 23:29:18 2006 +0000

    Fixed (serious) warnings.

commit df086edaac6a3e04cfa9c68760927b24594a19fd
Author: Denis Oliver Kropp 
Date:   Sat May 6 15:25:42 2006 +0000

    Welcome 0.9.26
    
    Added support for other encodings than UTF8. Encodings are (or can be) provided
    with each font implementation. This model reduces code sharing slightly, but
    allows higher efficiency via optimized combination of decoding and translation.
    
    Every encoding just has a name and an ID, where the name can be chosen freely,
    except for DTEID_UTF8 which is always available and has the name "UTF8".
    
    Added interface methods
    - IDirectFBFont::EnumEncodings() enumerates all provided encodings.
    - IDirectFBFont::FindEncoding() looks up an encoding directly by its name.
    - IDirectFBFont::SetEncoding() for local methods and as a default for surfaces.
    - IDirectFBSurface::SetEncoding() chooses an encoding for the text routines, will be
      overwritten by SetFont() which takes the default encoding of the new font.
    
    Reworked all loops dealing with strings, characters and glyph information.
    
    Implemented UTF8 and "Latin1" encoding in FT2 font loader. Nice demonstration how
    different encodings can be used, while still having a single glyph cache, which is
    no longer based on character codes, but on their raw indices.
    
    ---
    
    Added dfb_font_register_encoding( id, name, funcs ) that is called by the font
    module to register implementations. The 'id' can be DTEID_UTF8 or DTEID_OTHER,
    where in the latter case the actual id will be allocated dynamically.
    
    Added CoreEncodingFuncs only containing GetCharacterIndex() and DecodeText() to
    do character to index translation and text decoding (including translation).
    
    Other functions like GetGlyphInfo() or GetKerning() take raw indices instead
    of unicode character codes now.
    
    In the case of DTEID_UTF8 it's allowed in an implementation to
    just provide GetCharacterIndex() and let the core do the DecodeText(),
    but that would cause one GetCharacterIndex() call per decoded unicode
    character. So implementing both functions is advisable.
    
    If nothing is registered for DTEID_UTF8 at all, the core will
    pass the raw unicode characters to GetGlyphInfo(), RenderGlyph() etc.
    That's the old behaviour, fully compatible with old modules. It's
    also a good choice if you want to avoid the character translation,
    having an efficient font module which is based natively on unicode
    characters only.
    
    When registering an encoding implementation using DTEID_OTHER,
    both GetCharacterIndex() and DecodeText() must be provided.
    
    Added dfb_font_decode_character() to get the raw index of a single character
    and dfb_font_decode_text() which decodes an encoded sequence of characters,
    stores all their indices in the provided array and returns the amount.
    Both functions have a parameter to select the encoding for the operation.
    
    ---
    
    Changed DirectTree's fast key range from 32-128 to 0-128 as we are no longer
    having ASCII values but zero based glyph indices.
    
    Added some debug messages and domains, like Core/Font.
    
    Cleanups.

commit 4e3161e6c83d761e010f27de7b2cb5060fcfed66
Author: Denis Oliver Kropp 
Date:   Fri May 5 23:07:23 2006 +0000

    First and fully working implementation of dead key handling using static
    tables for mapping of dead keys and following symbols to the combined symbol.

commit a24387318b5601a03ed5be8767157d0cb17f2750
Author: Denis Oliver Kropp 
Date:   Fri May 5 23:04:08 2006 +0000

    Added support for dead keys.

commit 9622c691964ba82cd069fbc29f66511c67afe758
Author: Denis Oliver Kropp 
Date:   Fri May 5 23:01:45 2006 +0000

    Show hex values for symbols without an enum entry.

commit 53bea559fec69effbbaea2c8bfbbfa6ae17624df
Author: Claudio Ciccani 
Date:   Fri May 5 12:31:14 2006 +0000

    Disable host-to-video hardware blit for simple blits without format conversion.
    Added nvEngineReset().

commit c569028afb8cc3efd9b5a8836c9395f2fb2cc01c
Author: Denis Oliver Kropp 
Date:   Wed May 3 07:38:51 2006 +0000

    regenerated

commit 82f09f8eed7f95ad7634c7f31064fef0aefe845f
Author: Denis Oliver Kropp 
Date:   Wed May 3 07:37:05 2006 +0000

    Fix build problem by swapping two includes.

commit b18fae799efcbd5ed68b11d940e0752002a56ca4
Author: Denis Oliver Kropp 
Date:   Wed May 3 07:35:48 2006 +0000

    More EXTRA_DIST stuff.

commit f5e3029aa3f1ff17aa167f6249d6f0fcb291389e
Author: Denis Oliver Kropp 
Date:   Wed May 3 07:34:53 2006 +0000

    Added "fake.c" also to EXTRA_DIST...

commit 131e98d705e1d076c9bab9b3aef29f56c93602cc
Author: Denis Oliver Kropp 
Date:   Tue May 2 22:41:06 2006 +0000

    New changelog and news.

commit 66cc6b43047cb9943335853556d54201cad80845
Author: Denis Oliver Kropp 
Date:   Mon May 1 19:11:14 2006 +0000

    #include 

commit 74626c64f90d54d1e885a22a4a49c84a365da357
Author: Denis Oliver Kropp 
Date:   Mon May 1 19:09:28 2006 +0000

    This patch is similar in spirit as the v4l one. Includes the fb.h
    header into the sources so the definitions can be used freely.
    Also this would make the 'accelerators.h' file obsolete.

commit 72af467dd5112597fb5d1a3be31a61494a558388
Author: Denis Oliver Kropp 
Date:   Mon May 1 18:51:52 2006 +0000

    Thanks to Andreas Jochens  for this patch that "fixes
    a build failure on amd64 due to types clashing by including 'dfb_types.h'
    instead of 'asm/types.h' (needs to be applied after the fbdev one, or just
    ignore the error from the missing file)".

commit 7ee805737c46c557c0363218ee800ea90ac70d03
Author: Denis Oliver Kropp 
Date:   Mon May 1 18:44:20 2006 +0000

    This patch includes the V4L header files into the directfb sources, so
    it can use the features even when building on a kernel that does not
    support them. That at least makes life easier for distributions. It's
    also safer for the developers, because then you can use the
    definitions freely.

commit 84008f26a9f6033b0e579e1877c99e919bf6b682
Author: Denis Oliver Kropp 
Date:   Mon May 1 18:39:38 2006 +0000

    Thanks to Jeff Bailey  for this patch that "removes
    unneeded unconditonal  includes".

commit 193d22aaa28f3b6c83e1d6011a690cae7b1f1430
Author: Denis Oliver Kropp 
Date:   Mon May 1 18:37:58 2006 +0000

    Thanks to Jeff Bailey  for this patch that "fixes
    a build failure on ia64, by using syscall() instead of _syscall0
    as the later is not supported there".

commit 00487fa87bc6b9876d78d54b1406bf4d91d1464b
Author: Denis Oliver Kropp 
Date:   Mon May 1 18:34:21 2006 +0000

    Thanks to Colin Watson  and Guillem Jover 
    for this patch that "fixes the link dependencies for the plugins.
    So that stuff like library symbol reduction in debian-installer can
    work properly".

commit 3e1fb630755394a5925424dfb0b6a1da102e40c0
Author: Ville Syrjala 
Date:   Tue Apr 18 09:00:08 2006 +0000

    Return shifted symbols for DIKI_0-9 and DIKI_LESS_SIGN.

commit f57b308f0ef39b66415677346975431e11157211
Author: Claudio Ciccani 
Date:   Wed Apr 12 10:29:07 2006 +0000

    Updated the manual page.

commit bfd15b30f7ad17e44244d713cb0b2ef99b48ee3c
Author: Claudio Ciccani 
Date:   Sat Apr 8 13:21:57 2006 +0000

    Compute the Low Destination ColorKey taking int account a dithered color conversion.

commit d3f2b39dec3b2ad9a421b967cc7aabe5958f2ec5
Author: Claudio Ciccani 
Date:   Sat Apr 8 13:20:06 2006 +0000

    Fix: blitting A8 surfaces with colorization to AYUV is supported.

commit 738efe52d87657b942bc9efd6443b6233b69565f
Author: Denis Oliver Kropp 
Date:   Fri Apr 7 19:24:26 2006 +0000

    DIKI_ALTGR is gone. The key right to the space bar is the right alt key.
    No matter which map is loaded, the identifiers are just named hardware keys,
    where you really specify the physical entity on your keyboard. In this case
    it's always DIKI_ALT_R, no matter if it's mapped to DIKS_ALTGR or DIKS_ALT.
    On standard keyboards it's also always the same hardware key code, no matter
    if you by a German keyboard with AltGr or a U.$. one with Alt.
    
    Changed the input core logic for keeping track of modifiers. If DIKI_ALT_R
    is pressed, also look at the symbol to decide if DIMM_ALT or DIMM_ALTGR is
    to be added/removed.
    
    Now application developers don't need to check for both DIKI_ALTGR and
    DIKI_ALT_R if they want to check for the key right next to the space bar :)

commit 5932ee83906262524c3b029c8dfad42191a19d09
Author: Claudio Ciccani 
Date:   Fri Apr 7 15:10:28 2006 +0000

    Fixed Cb/Cr offset computation (height*pitch/4 is different from height/2*pitch/2 if height is odd).

commit bc988ff64737032f69d6ca95011850488e62abd5
Author: Claudio Ciccani 
Date:   Fri Apr 7 15:07:58 2006 +0000

    Fixed incorrect Cr offset computation in dfb_copy_buffer_32().

commit 39a4fe8ed0d50d287a425be7ac64296df6f77782
Author: Claudio Ciccani 
Date:   Fri Apr 7 12:29:13 2006 +0000

    Fixed memory leak: dfb_state_destroy() was still freeing gfxs->Aacc instead of gfxs->ABstart.

commit e1104068434774eb31cb2d7207172837a95e52f4
Author: Claudio Ciccani 
Date:   Fri Apr 7 09:39:15 2006 +0000

    Added acceleration for AYUV, but color conversion is not supported because
    radeon supports AVYU instead of AYUV.

commit 0494597af04300ddf93ec5b0e1b4ffe7833b3e78
Author: Denis Oliver Kropp 
Date:   Thu Apr 6 23:15:52 2006 +0000

    Added missing inputdrivers/penmount/Makefile.

commit ad0d296161775933eacca9dca67c792d0faa41d9
Author: Claudio Ciccani 
Date:   Thu Apr 6 17:46:14 2006 +0000

    Fixed a wrong pointer.

commit 05673fc0681e1df121c945d9029785d25d390ec0
Author: Claudio Ciccani 
Date:   Thu Apr 6 13:29:17 2006 +0000

    Almost completed AYUV support (lacks colorkeying).

commit 892c5099f3678b6cbad93cfbbd6969dd2fb6797f
Author: Claudio Ciccani 
Date:   Thu Apr 6 13:05:03 2006 +0000

    Fixed AYUV span writing.

commit 106e3d8bdd9e8d92d307d36f87b644c00ddb519b
Author: Claudio Ciccani 
Date:   Thu Apr 6 13:03:53 2006 +0000

    Check for penmount input driver.

commit 54ae63e6ff1bdddf3ff842074d3927730abd178a
Author: Claudio Ciccani 
Date:   Thu Apr 6 12:44:24 2006 +0000

    Replaced error message about access failed to /proc/bus/pci/devices with a debug message.

commit 861f5b0aed6bf2633d639d3c837032870d61c214
Author: Claudio Ciccani 
Date:   Thu Apr 6 12:42:59 2006 +0000

    Replaced freetype-config by $FREETYPE_CONFIG.

commit bf894a1471500feb5f39fbe34e8c2de59f91e8a5
Author: Denis Oliver Kropp 
Date:   Thu Apr 6 12:00:34 2006 +0000

    Added DSPF_AYUV, a 32bit packed AYUV format for graphics,
    being the counterpart of ARGB in the YUV color space.

commit 4868de1074f49c45eef191df4e8a129518f65eff
Author: Denis Oliver Kropp 
Date:   Wed Apr 5 23:34:29 2006 +0000

    Removed r100 and r200 driver in favor of the latest and greatest Radeon driver.

commit e4bd6e3b474b0b254e764bc535db7d084018e4dc
Author: Denis Oliver Kropp 
Date:   Wed Apr 5 23:29:01 2006 +0000

    Applied patch from Christian Krause  that allows
    usage of the option "mouse-source" without "mouse-gpm-source".

commit 59b321d5b167cb91c0c9e8780ddd46c9028e0697
Author: Nikita Egorov 
Date:   Tue Apr 4 15:01:43 2006 +0000

    Added input driver for PenMount 9509 serial touchscreen.

commit b1933e0cf278ec9d7f6a55b4d8eb593c67fb3cf1
Author: Ville Syrjala 
Date:   Tue Apr 4 05:26:58 2006 +0000

    Fix negative line width handling in fill_tri().

commit 84ba3971285041762e2af83e2d41d2e8d6d7332d
Author: Denis Oliver Kropp 
Date:   Sun Apr 2 12:50:38 2006 +0000

    Thanks to Andy Stewart for fixing the hash table reallocation which didn't
    check for collisions during reinsertion.

commit 7a5310428d8784285d32dc353177fea6ea9f4677
Author: Denis Oliver Kropp 
Date:   Sun Apr 2 12:40:53 2006 +0000

    Fix wrong signedness in IDirectFBSurface_GetClip().

commit 206274287105126859013256e3d7062d4a9a3520
Author: Denis Oliver Kropp 
Date:   Sun Apr 2 12:18:18 2006 +0000

    Fixed errors and warnings.

commit 844a82586f477151d58f8ae4f9c64d26e14c8021
Author: Denis Oliver Kropp 
Date:   Thu Mar 30 12:38:09 2006 +0000

    Fix errors given by including the header in a C++ code.

commit 5bebc73b6ea7094d9654220e0a349a4d8a7ab830
Author: Denis Oliver Kropp 
Date:   Sun Mar 26 14:27:00 2006 +0000

    Fixed bogus "fbdev driver possibly buggy" warning if the video memory is too
    small to set the mode properly, i.e. when vyres is clipped by the driver.

commit 4d5ae5061ea6c681969463c18a4d018f154442be
Author: Denis Oliver Kropp 
Date:   Sun Mar 26 11:45:48 2006 +0000

    Fixed (unused) macro EXPAND_7to8.

commit 11c9529d4b70281aa3790561d95e916627b861e0
Author: Denis Oliver Kropp 
Date:   Sun Mar 26 11:33:36 2006 +0000

    Read up to 64 events with one read().
    
    Combine motion events if they follow each other immediately and would
    cause a lag or buffer overrun otherwise.

commit 0e9a0ac8d78df9b666d065479e70e7a56c0370ca
Author: Claudio Ciccani 
Date:   Wed Mar 22 13:12:22 2006 +0000

    Try to get vendor/device id from mmio.

commit 217a73989ba858b1cdb47d6affa1925455a048e9
Author: Claudio Ciccani 
Date:   Wed Mar 22 10:38:09 2006 +0000

    Initialize interface pointers (loaded module may not be up to date with the interface version).

commit 163bd788abba21335958a90899edfe3e48415a9e
Author: Claudio Ciccani 
Date:   Wed Mar 22 10:35:42 2006 +0000

    Warn if the device id detection fails.

commit 2df87b81d3235fce9c162b2ba5ad4dbe88055d33
Author: Claudio Ciccani 
Date:   Tue Mar 21 11:41:45 2006 +0000

    Follow changes.

commit e96e2ae11a0cfa730d26bf9b2e1b9be4c3b677e1
Author: Claudio Ciccani 
Date:   Tue Mar 21 11:40:35 2006 +0000

    Centralized the selection of the default resolution/pixelformat.

commit 051ce5fc92328cb961534983083ce60351c84ef3
Author: Claudio Ciccani 
Date:   Mon Mar 20 14:27:21 2006 +0000

    Imported the new Unified Radeon driver, with a lot of improvements and new features:
     - supports smooth page flipping
     - supports seconday head output
     - supports overlay on secondary head
     - improved overlay RGB rendering
     - improved R100/R200 3d functions performance
     - fixed 2d/3d engines syncronization
    
    TODO:
     - 3d acceleration on R300 chipsets
     - TV output

commit a47cf485b09a9e92a892321bf225251ff5e0823f
Author: Claudio Ciccani 
Date:   Mon Mar 20 14:20:13 2006 +0000

    Added dfb_gfxcard_surface_{enter/leave}(), called when a software access to
    video memory begins/finishes.
    
    Needed by the Radeon driver to swap pixels on big-endian machines
    (actually the method doesn't work fine when surfaces are locked for long time).

commit cc555969fcb9ca6181fa53dfade137a23110982f
Author: Denis Oliver Kropp 
Date:   Mon Mar 20 01:26:50 2006 +0000

    Fix inverted module directory condition.

commit 5ca055496904f9edd97abb2fec7e9cb5c9cf2d98
Author: Denis Oliver Kropp 
Date:   Mon Mar 20 00:35:35 2006 +0000

    Manage UCB1x00 Touchscreen driver build as others, enabled by default on arm.

commit a0df9c7eb6fc447d5097c55cd8b6d1a8085b3996
Author: Denis Oliver Kropp 
Date:   Mon Mar 20 00:27:09 2006 +0000

    In case of an error in dfb_surface_dump() only release the palette if non-NULL.

commit 23596187016e9f002248814cd3b1015e946243ca
Author: Denis Oliver Kropp 
Date:   Mon Mar 20 00:19:59 2006 +0000

    Allow NULL argument in direct_free().

commit 5aa3fdb2dbdebbca51252e49af5546cfb41c8c5a
Author: Denis Oliver Kropp 
Date:   Sun Mar 19 21:44:13 2006 +0000

    Replaced the enum based bool definition by a typedef to __u8.
    Defined false and true via macros like stdbool.h does.
    
    Before that the sizeof bool didn't match the real one.

commit 221162d18d7702d649443ee757c59a5a14b5bb0f
Author: Denis Oliver Kropp 
Date:   Sun Mar 19 21:23:19 2006 +0000

    Don't return a bitmask but a real boolean value in dfb_gfxcard_state_check().

commit e1b6815022f8cabca6c67a87cd9f170ae6218ca1
Author: Denis Oliver Kropp 
Date:   Sun Mar 19 00:47:56 2006 +0000

    fixed

commit 34beea7207f699703952228d2081b89fcf39bfe8
Author: Denis Oliver Kropp 
Date:   Sun Mar 19 00:30:16 2006 +0000

    Change the module directory only for builds that don't *support* debug.

commit e2b9cf4522a3abaefb48a929c689d7b19a8f0e8a
Author: Denis Oliver Kropp 
Date:   Tue Mar 14 23:25:52 2006 +0000

    Include  only if it exists, otherwise include .

commit d235d766d95bc746fbd3e4d80f725561ac62a0de
Author: Denis Oliver Kropp 
Date:   Fri Mar 10 17:07:05 2006 +0000

    Added FusionCall to each input device for maintenance via master,
    driver calls etc. using new CoreInputDeviceCommand enum.
    
    Added dfb_input_device_reload_keymap() implemented via the new call passing
    the CIDC_RELOAD_KEYMAP command. The master will reload the whole keymap via
    driver API.
    
    Added debug domain "Core/Input" with some debug messages.
    
    Added a new tool called "dfbinput" which features keymap dump/reload so far.

commit c973fa3f2ef2dcdc1b7e4e3890f1b81d6ce35e9f
Author: Denis Oliver Kropp 
Date:   Fri Mar 10 12:58:03 2006 +0000

    Check for device->shared in dfb_input_dispatch() to catch early birds :)

commit 7a64e09458fbf660d631a1e130ad1f58529632dc
Author: Denis Oliver Kropp 
Date:   Fri Mar 10 12:39:07 2006 +0000

    Include  instead of .
    
    Fixes build for me. If it fails with older headers we need to add a check.

commit 7b2ccd9601870eb9ceb963bc6df2f2c5b503d9a5
Author: Denis Oliver Kropp 
Date:   Fri Mar 10 12:30:42 2006 +0000

    Fixed autoconf detection. Don't know exactly what, but I guess
    it got confused with the output of a newer wrapper script.

commit d1cc303f91368155d7c8a7ceab91cac2a0c8b075
Author: Denis Oliver Kropp 
Date:   Fri Mar 10 12:24:56 2006 +0000

    Allow pending reactions (in local dispatcher queue) to be executed
    after the shared reactor part has been destroyed. This fixes for example
    occasionally missing DWET_DESTROYED events.

commit ac26da5f8e1a8387031c80987788d46d54c38074
Author: Denis Oliver Kropp 
Date:   Wed Mar 1 04:23:11 2006 +0000

    Added FusionCallExecFlags parameter to fusion_call_execute().
    
    Use the flag FCEF_ONEWAY in the SDL backend to not wait for the
    call being executed, otherwise a deadlock could occur. The return
    value is meaningless anyways. Queued updates will be merged on the
    receiving side (master) to avoid a lag and improve performance.

commit c34a83b83c64a1866076b8a7cbfa02c9a45fe855
Author: Denis Oliver Kropp 
Date:   Wed Feb 22 08:27:02 2006 +0000

    Make compiler happy.

commit 61e157e0572a6bfc8adc457d9bea10db81782805
Author: Denis Oliver Kropp 
Date:   Wed Feb 15 16:17:27 2006 +0000

    Added a parameter to fusion_enter() - FusionEnterRole - to specify either
    FER_ANY, FER_MASTER or FER_SLAVE. If the world can't be entered playing the
    specified role, an error message is printed and DFB_UNSUPPORTED is returned.

commit 033c177bf046450e8d9e1b049c7d1b49abe5a0ef
Author: Denis Oliver Kropp 
Date:   Wed Feb 15 16:14:54 2006 +0000

    Added D_ASSERT( object->state != FOS_ACTIVE ) to fusion_object_destroy().
    
    Only objects in state FOS_INIT or FOS_DEINIT are allowed to be destroyed directly.

commit 7b69a56bfa1e86aa7de8be2f4d873afffc038c23
Author: Denis Oliver Kropp 
Date:   Sun Feb 12 03:44:35 2006 +0000

    Fixed build.

commit f78abae42ad90072ccab068ba005c32ea7c41d7d
Author: Denis Oliver Kropp 
Date:   Sat Feb 11 16:47:22 2006 +0000

    Fixed destination offset when no scaling is used, thanks to otokawa.

commit 5eab7d24de9bf791bc83ed56155afa1c36f48f68
Author: Denis Oliver Kropp 
Date:   Fri Feb 10 13:25:51 2006 +0000

    Added symbol resolving support for static binaries.

commit e7cf0a183f2b4ac619d68d834570fbb18f3d3366
Author: Denis Oliver Kropp 
Date:   Fri Feb 10 13:21:36 2006 +0000

    In Probe() call FT_Done_Face() only if FT_New_Face() succeeded, otherwise
    random segfaults can occur.

commit f51f94061e29da5048952d8631dfb36298bbc382
Author: Claudio Ciccani 
Date:   Tue Feb 7 15:47:59 2006 +0000

    When AGP support is enabled, turn off pci gart and turn on bus mastering.

commit 2a0c71a3c99b098569e151cef01ef15474b2381d
Author: Denis Oliver Kropp 
Date:   Tue Feb 7 12:17:14 2006 +0000

    Increased ABI version to avoid problems :)

commit b5334b8279ffbacd63b0c0ec2bcb0df454f755a4
Author: Claudio Ciccani 
Date:   Tue Feb 7 10:05:38 2006 +0000

    Check if dfb_agp_join() fails.

commit 550d0482ebf5324b5ad04e510dfb6f732ef17b73
Author: Claudio Ciccani 
Date:   Tue Feb 7 09:35:38 2006 +0000

    Follow API changes.

commit 51d7213d0c4f02f8371f9cc7a9210c201d34349b
Author: Claudio Ciccani 
Date:   Tue Feb 7 09:34:32 2006 +0000

    Added support for surfaces stored in AGP memory.

commit 5d67f5110cf61e0e3b1ec3abe1474cdb518022ec
Author: Claudio Ciccani 
Date:   Tue Feb 7 09:33:34 2006 +0000

    Use internal AGP access.

commit 759d3d256c7fe0cf840c83d04380b81f2b82fac5
Author: Claudio Ciccani 
Date:   Tue Feb 7 09:32:09 2006 +0000

    Added AGP support.

commit b4dbcde5d2c6251755ffb1abbdd7a1c53586ae70
Author: Claudio Ciccani 
Date:   Tue Feb 7 09:30:41 2006 +0000

    Added support for surfaces stored in auxiliray memory (PCI/AGP/PCIE).
    
    Added support for Surface Managers with a variable number of heaps.

commit b411dae7cec0c9065e2eba4e204085617e7810ee
Author: Denis Oliver Kropp 
Date:   Sun Feb 5 17:31:03 2006 +0000

    Install the new header file.

commit e39705caa934a584fe7101b1e8183d35ff2fbf63
Author: Denis Oliver Kropp 
Date:   Sun Feb 5 17:30:27 2006 +0000

    Moved misc/util.h to include/directfb_util.h to use it in applications.
    
    More to come :)

commit 27a505c4ed1d2ece73a0daf0b1863bcb0c68fc7c
Author: Denis Oliver Kropp 
Date:   Sun Feb 5 16:03:06 2006 +0000

    Added new runtime option:
    
    fatal-level=
      Abort on NONE, ASSERT (default) or ASSUME (incl. assert)
    
    
    Finally added documentation of "[no]-vt" :)

commit 0152edecf64afb473b5c297a2cebebeb5ce1f3ce
Author: Denis Oliver Kropp 
Date:   Sun Feb 5 16:00:04 2006 +0000

    Do the shmalloc benchmark once with debug and once without.

commit 2644c58611042a2c57cdbaa459767bf73b48c21e
Author: Denis Oliver Kropp 
Date:   Thu Feb 2 18:59:25 2006 +0000

    Made debug/release versions binary compatible, being able to link
    dynamically against both or even run in the same session.
    
    This enables single hybrid SDKs for debug and release platforms.
    
    To achieve this all "debug support code" is in the library, whether
    itself uses debug mechanisms or not.
    
    But the option "--disable-debug-support" builds a "pure release" lib
    to save a few kb in binary size, but basically no runtime overhead.
    
    The shared memory pools accept a new option at creation, that is
    whether to debug allocations. This is stored in the pool info and
    anyone joining the pool must follow it (for the pool).
    
    Except pure release versions which can't join debug enabled pools.
    
    Another limitation is that debug enabled applications cannot link
    against pure release libraries, but a debug enabled application
    can be linked statically against its debug/release library and run
    in a pure release session.
    
    There shouldn't be other limitations and you'll warnings/errors
    before anything crashes etc.
    
    The default for the "debug" option is true in debug enabled libs
    and false in release (debug disabled, but supported) libs. This
    option currently determines if shared memory pools are debug enabled.
    
    Happy mixing :)

commit 7e03efde3ab18d63eb23863e8eb6db6d0f1a2a41
Author: Denis Oliver Kropp 
Date:   Thu Feb 2 18:26:21 2006 +0000

    Use D_DEBUG_ENABLED instead of DIRECT_BUILD_DEBUG.

commit 2e3877f35ba6ca291562a4ce8cf119abf6fb36dc
Author: Denis Oliver Kropp 
Date:   Thu Feb 2 17:20:04 2006 +0000

    Fixed failing assertion due to a race condition between shutdown and update.
    
    Added debug domain "SDL/Updates" and lots of debugging messages.

commit e91706ef22d8ff39e7f04f4879a060ac3fe7390c
Author: Denis Oliver Kropp 
Date:   Wed Feb 1 23:10:13 2006 +0000

    Decoupled screen updates from Fusion Dispatcher.
    
    Updates are handled in a separate thread; they're accumulated rather than
    queued in case an update is already pending.

commit 241c6ecaed03c832de3b06dc1aebae0d3febee64
Author: Denis Oliver Kropp 
Date:   Wed Feb 1 18:57:23 2006 +0000

    Fixed warning (signedness).

commit d603b491aa02f25ecb3e457606af745e73a8fd98
Author: Denis Oliver Kropp 
Date:   Wed Feb 1 18:55:37 2006 +0000

    Workaround broken(?) 2.6.16 headers.

commit eebc3b866e5c7c10849da0e21c802fcb21a30c16
Author: Claudio Ciccani 
Date:   Wed Feb 1 13:39:25 2006 +0000

    Avoid sending s/t coordinates when drawing only shapes.

commit dfb96eae46811476f104847689c91976d4e4bb8f
Author: Claudio Ciccani 
Date:   Wed Feb 1 10:24:44 2006 +0000

    Add fb_offset to the dma offset.

commit e9c54218d3d26941a18fdb1830e706fc9dc605df
Author: Claudio Ciccani 
Date:   Wed Feb 1 09:35:12 2006 +0000

    No longer change the value of MC_FB_LOCATION unless an IGP chipset is used
    (old radeonfb doesn't set the register correctly on IGPs).

commit 8232568b4d550dfe3f6f7904f57e49a0dfaa27b6
Author: Claudio Ciccani 
Date:   Wed Feb 1 09:32:37 2006 +0000

    Imported the new R100 driver.

commit a1b1fd67e9739674e05ee02cfca29f98cab580a9
Author: Claudio Ciccani 
Date:   Sat Jan 28 11:41:29 2006 +0000

    Added a patch that allows to mmap AGP memory without root privileges.

commit f82fbb027f259719919c46bcbae0395efe91b2d5
Author: Claudio Ciccani 
Date:   Sat Jan 28 11:39:15 2006 +0000

    Open log file in append mode.

commit 2420e8994dc3b9d5ec10cd1241816028595bcc02
Author: Claudio Ciccani 
Date:   Sat Jan 28 11:38:13 2006 +0000

    Added option [no-]dma (disabled by default).

commit 8cef104e7238329be949e72b77c8412d87f80ddc
Author: Claudio Ciccani 
Date:   Sat Jan 28 11:36:56 2006 +0000

    Version 0.6 of the NVidia driver:
    - Added support for AGP
    - Added support for DMA using AGP or Framebuffer memory.
    
    Currently DMA is not faster than PIO, therefore it's disabled by default.

commit b7d7a76043950102126d000aaa24043ee8f3f7e0
Author: Claudio Ciccani 
Date:   Fri Jan 27 13:35:02 2006 +0000

    Check for integrated GPUs.

commit dff1a5effe84809feb612662a859b84a7714ee4a
Author: Claudio Ciccani 
Date:   Wed Jan 25 14:40:14 2006 +0000

    Reset MC_FB_LOCATION to avoid problems with X (thanks to Michel Danzer).

commit ec0ab004c4a40f8a07aa376da03bb65423ae0bfc
Author: Claudio Ciccani 
Date:   Mon Jan 23 21:19:23 2006 +0000

    Finally fixed the "random-crashes-when-blitting-from-system-memory" problem.

commit 0772894a73e146ef55a0f8c2dd19102993a572dc
Author: Claudio Ciccani 
Date:   Mon Jan 23 17:00:02 2006 +0000

    Print less cryptic debugging messages.

commit 9b4b1a0c0046a3c2d3b246ef2d35132014177f98
Author: Claudio Ciccani 
Date:   Mon Jan 23 11:35:33 2006 +0000

    Fixed a potential memleak.

commit 0ddf560300d58300b0dd8060c3d591992dab7e0a
Author: Claudio Ciccani 
Date:   Mon Jan 23 11:33:18 2006 +0000

    Fail during probe() if the framebuffer device doesn't provide access to MMIO.

commit 3fa3f80704f3067c04bd8afaf2528fde8e20728d
Author: Claudio Ciccani 
Date:   Mon Jan 23 11:32:00 2006 +0000

    Fixed a typo.

commit 3c4e3d1b45e4f452ea6ec69fe670b4bbedf19878
Author: Claudio Ciccani 
Date:   Mon Jan 23 11:31:17 2006 +0000

    Fixed wrong register in R200_SET_YUV422_COLOR().

commit 410aab6f33e6d132713657420d408372379f155c
Author: Mike Emmel 
Date:   Sun Jan 22 03:54:52 2006 +0000

    removed extra return

commit 0ebcf50d3c945a40bed265e548668df61a6f4eba
Author: Mike Emmel 
Date:   Sun Jan 22 03:54:12 2006 +0000

    copied shift fixed for id to char from sdl to x11 driver to fix symbols sent when shift is down

commit d3d032ff58dca4aa22ca023eb2b89f8a24485c39
Author: Denis Oliver Kropp 
Date:   Thu Jan 19 16:42:26 2006 +0000

    Fixed wrong enum names used (missing E in DVSTATE_).

commit 90500310dc14cc5747c4309c056085afbbf4f57b
Author: Claudio Ciccani 
Date:   Thu Jan 19 13:56:14 2006 +0000

    Speed up FillRectangle, Blit and StretchBlit by using the RECTANGLE_LIST primitive
    instead of QUAD_LIST [~15% faster]. :)

commit 4a1f56c517bb83655cb6340dbc2bfee4eb120a9f
Author: Claudio Ciccani 
Date:   Wed Jan 18 17:31:54 2006 +0000

    Use the POINT primitive to fill rectangles with size=1 (i.e. to draw points) [~60% faster].

commit 76c0abb70404bd03ece844054d67ec192acb2b33
Author: Claudio Ciccani 
Date:   Sun Jan 15 19:13:27 2006 +0000

    Follow API changes.

commit 4d123961453d876db72d881331f164a9cfdf1ba3
Author: Claudio Ciccani 
Date:   Sun Jan 15 19:12:11 2006 +0000

    Added IDirectFBVideoProvider::GetStatus() to get the status of the playback;
    this method replaces the previous end-of-playback detection method using GetPos().
    
    Be more explicit about the coordinates system used by IDirectFBVideoProvider::SendEvent().

commit 10064fbb3b81d8b3b1e313e494323d5743687e23
Author: Claudio Ciccani 
Date:   Sat Jan 14 15:14:00 2006 +0000

    Added IDirectFBVideoProvider::GetStreamDescription() to query informations about the stream.

commit 0045fc110a08f826cda49e5f5adc122aed23d97a
Author: Denis Oliver Kropp 
Date:   Sun Jan 8 06:42:52 2006 +0000

    Fixed disabling video4linux provider.

commit 460f44a2c1fa84ac8ef6aa811b598d65498daa2e
Author: Denis Oliver Kropp 
Date:   Sat Jan 7 15:08:13 2006 +0000

    Added DFBEventBufferStats containing various counters for the event queue,
    e.g. total number of events, number of window events, motion events etc.
    
    These reflect the current content of the queue, i.e. dequeueing decrements.
    
    Added IDirectFBEventBuffer::EnableStatistics() to enable/disable collection.
    
    Added IDirectFBEventBuffer::GetStatistics() to query current statistics.

commit 524844576fb90d9a10c521c61237e09e1c54c872
Author: Denis Oliver Kropp 
Date:   Fri Jan 6 19:57:38 2006 +0000

    Added IDirectFBSurface::GetClip().

commit 73ee7d922a2ed6c0a809e7bdca85e95d2178e864
Author: Mike Emmel 
Date:   Fri Jan 6 17:39:28 2006 +0000

    Added Alex Lau's patch

commit 9dccd6c4ea61bfe695151dca34de2751c6c86398
Author: Claudio Ciccani 
Date:   Fri Jan 6 11:26:02 2006 +0000

    Implemented IDirectFBDataBuffer::Finish().

commit 6a6d9324dd2086d0486bd66e561f8ecca4cf41d5
Author: Claudio Ciccani 
Date:   Thu Jan 5 18:50:30 2006 +0000

    Use getaddrinfo() to resolve hostname.

commit 796b4bff740d390138bf2dca28b3d3fcd0a19433
Author: Claudio Ciccani 
Date:   Thu Jan 5 18:31:18 2006 +0000

    Use getaddrinfo() to resolve host.

commit 2d68cdfd03b66feedf80f799e577c7f095ed9ca8
Author: Mike Emmel 
Date:   Thu Jan 5 15:08:23 2006 +0000

    Added fix for keyboard id conver from Alex Lau

commit 2fca19d866f2211c2a864b9a0df4fd33da4d997f
Author: Claudio Ciccani 
Date:   Thu Jan 5 12:04:45 2006 +0000

    Added UDP support.
    
    In parse_url(), use memcpy() instead of strncpy() and null-terminate the string
    (from strncpy manual page: "if there is no null byte among the first n bytes of src,
     the result will not be null-terminated").

commit a25bf8eff6583f2c487bb6c3a3abd5b1a44acfca
Author: Claudio Ciccani 
Date:   Wed Jan 4 12:02:44 2006 +0000

    Completed support for YCbCr formats.

commit 82f5dc648b10b60043430e08d2c47cf8f086e608
Author: Claudio Ciccani 
Date:   Mon Jan 2 11:36:59 2006 +0000

    Allow to control background and cursor in exclusive cooperative level.

commit 7fd998c896da7506f0736c382e2b313d11643de1
Author: Claudio Ciccani 
Date:   Sun Jan 1 11:49:04 2006 +0000

    If the surface is locked, dfb_surface_reformat() fails returning DFB_LOCKED to avoid deadlocks.

commit 55ebb159dbcc4672d8607e186899e5ed1bbd18a4
Author: Claudio Ciccani 
Date:   Sun Jan 1 11:01:01 2006 +0000

    Almost completed support for Planar YUV formats (lacks colorkeying).

commit a14abfd35a828f896a5a1239aa9964ad1e25b5c0
Author: Mike Emmel 
Date:   Fri Dec 30 18:41:52 2005 +0000

    Fixed a small bug in key translations

commit 98cc030ec67cf2efd759f39e65763879810e1996
Author: Mike Emmel 
Date:   Fri Dec 30 18:22:06 2005 +0000

    Changed key handling in SDL driver to match the X11 driver which seems correct

commit c70df84879a87b3e9ef3e237e244002034b39506
Author: Andreas Hundt 
Date:   Fri Dec 30 11:45:15 2005 +0000

    - replaced strdupa()/strndupa() by alloca() and strcpy()/strncpy()
    (avoid GNU extensions)

commit 9b06988bf6a133252be2e800f24f7d04102f5a0c
Author: Andreas Hundt 
Date:   Fri Dec 30 00:09:32 2005 +0000

    include , required for fstat on some OS

commit 068d9406127980d1477392361255ddd0e5ad13c3
Author: Denis Oliver Kropp 
Date:   Thu Dec 29 04:21:10 2005 +0000

    Lock surface manager in dfb_surface_unlock() to make lock counter
    decrement atomic! I'm not sure, but I think I just hit that one,
    because the lock counter was one for an unknown reason and resizing
    a window blocked.

commit 45f4421662ff4489500f35cdd719d18da4a3d198
Author: Denis Oliver Kropp 
Date:   Thu Dec 29 03:29:19 2005 +0000

    Implemented requestor/dispatcher FillSpans().

commit fdb690aca93b76297eca6d348992ec09129820b9
Author: Denis Oliver Kropp 
Date:   Thu Dec 29 03:14:29 2005 +0000

    Implemented requestor/dispatcher FillRectangles().

commit bb9bcb6be49309ae5e3267c952c07df73c8fb1ca
Author: Denis Oliver Kropp 
Date:   Thu Dec 29 02:35:19 2005 +0000

    Commented out -Wno-strict-aliasing for now. Need to add a check for the gcc version!

commit 54be67b7daf0d144a49ae32bb90e3a114f91c20d
Author: Denis Oliver Kropp 
Date:   Wed Dec 28 02:23:55 2005 +0000

    Added debug messages.

commit b3712b434f3c2a1438228931605cf638d7a7a61a
Author: Denis Oliver Kropp 
Date:   Wed Dec 28 02:22:44 2005 +0000

    Fixed warnings.

commit 95115bc9640e5d0bc5fb0a9e70e053b83d3b9c17
Author: Claudio Ciccani 
Date:   Tue Dec 27 13:58:33 2005 +0000

    typo.

commit 3e4475dc8c866b707f75c2d93c4c8dd03f52ea6b
Author: Claudio Ciccani 
Date:   Tue Dec 27 13:57:48 2005 +0000

    Removed GetScreenSize() hook.

commit 68d52235e70b7da723f22c0c7d021e9b078f76a4
Author: Claudio Ciccani 
Date:   Sat Dec 24 10:50:11 2005 +0000

    Use dfb_system_current_mode() instead of reading CRTC mode registers.

commit 7c349ff8afd7211f58dfee3a3a2d1e236602b499
Author: Claudio Ciccani 
Date:   Fri Dec 23 15:23:26 2005 +0000

    Ignore return value from IDirectFBDataBuffer::PeekData().

commit f564ee10a516fd7d120a64892d302072c744ebdc
Author: Denis Oliver Kropp 
Date:   Fri Dec 23 02:47:53 2005 +0000

    Set FD_CLOEXEC flag on Fusion device.

commit 4aa020538620c9e54566b07d76ff15bcf7d1674e
Author: Denis Oliver Kropp 
Date:   Fri Dec 23 01:03:18 2005 +0000

    Don't depend on pure existence of "freetype-config" if FREETYPE_CFLAGS
    and FREETYPE_LIBS are already exported prior to running configure.

commit 97416def2b6f522764dc8a0dbf278419ba451d14
Author: Denis Oliver Kropp 
Date:   Fri Dec 23 00:53:34 2005 +0000

    Don't just return DFB_OK to fake fusion_shm_pool_create().
    
    Allocate fake struct, do D_MAGIC stuff, count attach and assert in detach.
    
    
    Fixes the failing assertion in fbdev_shutdown() as the pool pointer was NULL.

commit 6dc3445519b6640562fa49e07602b7722b665fe8
Author: Denis Oliver Kropp 
Date:   Fri Dec 23 00:48:22 2005 +0000

    Let D_OOSHM() be defined to D_OOM() in non-multi app fusion again.

commit e2128019f581d2879b9400e47674c92cb94a5a58
Author: Denis Oliver Kropp 
Date:   Fri Dec 23 00:47:38 2005 +0000

    Fixed double D_OOSHM().

commit be95bcee0c74ee939c27452020db7fd24ebfcbfb
Author: Denis Oliver Kropp 
Date:   Sun Dec 18 14:01:36 2005 +0000

    Check if already locked and return DFB_LOCKED in Lock().
    
    Automatically unlock when fully released, i.e. in Destruct().

commit 3070e619d07331f30ad9b9adbf91f6d0c9dee3fe
Author: Denis Oliver Kropp 
Date:   Sun Dec 18 14:00:07 2005 +0000

    Added lots of debug messages.

commit 5d63e417f0a706b63a1ee7cb06859e9328854408
Author: Denis Oliver Kropp 
Date:   Sun Dec 18 12:54:35 2005 +0000

    Added DSDESC_NONE and DSDESC_ALL.

commit ef2121f762acb71491bf9ba891c5cfa8172de374
Author: Denis Oliver Kropp 
Date:   Sun Dec 18 02:03:32 2005 +0000

    Make handlers_lock a recursive mutex again to fix a deadlock during signal
    handling recently introduced. Pressing Ctrl-C works again.

commit 9b1afeb0bbf558b3c123ff9d05a043ef5e94d4e4
Author: Denis Oliver Kropp 
Date:   Sat Dec 17 05:38:56 2005 +0000

    Applied patch containing a hotfix for the "concurrent-render-resize" problem.
    Thanks to Ryan Burns !
    
    This is an intermediate (dirty) solution before the new surface core is finished.

commit 85cfc4f00e84be9dd141b218ae82a3d6e033d912
Author: Denis Oliver Kropp 
Date:   Sat Dec 17 05:35:42 2005 +0000

    Allow empty flags in IDirectFBDisplayLayer::SetColorAdjustment().
    
    Added DCAF_ALL.

commit b7e5ae27b0a81fbb51370232e6acf2ffefc1535d
Author: Claudio Ciccani 
Date:   Thu Dec 15 14:32:06 2005 +0000

    Replaced size_t by ssize_t.

commit a60888bdab8aef741387fdc2eb7729969f4ce05b
Author: Denis Oliver Kropp 
Date:   Wed Dec 14 15:55:43 2005 +0000

    Disable elo by default.

commit 823f9e457f69ffde4df0e874b5a913bcfff2217e
Author: Denis Oliver Kropp 
Date:   Tue Dec 13 16:30:03 2005 +0000

    Check mixer/encoder/output indices.

commit ab1ba46972ff484cd40457e0075eb6abb72ea5fa
Author: Denis Oliver Kropp 
Date:   Tue Dec 13 16:08:41 2005 +0000

    Show version number.
    
    Use  tag much better.

commit 4f369a3c1c7fa73de05b73ce04da53a550796131
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 10 16:56:16 2005 +0000

    Don't build gunze by default. It seems to miss proper detection code.

commit c54ca76b4857f2314228bfc55f021b29d145d128
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 10 16:00:54 2005 +0000

    Use a separate shared memory pool for surface buffer data.

commit 50ed492c997131277dddaee19d13d6f0e0a41fc0
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Dec 9 19:46:54 2005 +0000

    Delete trailing whitespace.

commit 350f73e37a19dd7007667a7596a15fa796efc012
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Dec 9 19:04:54 2005 +0000

    Added framework to support all colorkeying combinations.

commit 4d1359263ff409819439010012c29be0b22cfcab
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Dec 9 16:15:38 2005 +0000

    Removed duplicate Duff's device definitions.

commit f0b0aab3360605ad01a61888a9b80f1d2279f9f3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 15:43:44 2005 +0000

    This patch adds fusion_reactor_sized_dispatch():
    
    Dispatch a message to any attached reaction with a given size. Instead of
    using the size defined by the reactor, the caller can specify the size of
    the data.

commit 231ab3e06e8ddf09c5935275630b0f590defeb67
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 15:24:05 2005 +0000

    Another patch, this one brings D_DEBUG_ENTER and D_DEBUG_EXIT to ease debug
    messages for tracing function calls.

commit 866c04d5bb4a907ac0e1631d1d5c10fbbc9179c2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 15:15:09 2005 +0000

    If the domain being registered contains a slash, but didn't exactly match an entry
    in directfbrc, check to see if the domain is descended from an entry in directfbrc,
    e.g. 'ui/field/messages' matches 'ui' or 'ui/field'.

commit a8d04182e628a32420c696f491f68b248a995ae1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 15:00:11 2005 +0000

    Allow trailing comments.

commit f368d2e423efffdf8bdc2fae6c4c7d69ead13516
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 14:59:31 2005 +0000

    Use more D_OOSHM().

commit b460ee004020e1d02f092c4a71d8b3bec2814cff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 14:57:01 2005 +0000

    Fixed warnings.

commit 77eba9bae5ee19cb222c80be2c74028861ea214a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 14:55:39 2005 +0000

    Added -Wno-strict-aliasing.

commit e231543297cfea4d58101bbc4a52d557a9002b0e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 14:36:56 2005 +0000

    Don't toggle lock states repeatedly when holding a lock key.

commit 40c2c5d069aa7ef57d0f464fe113c637ccd92e79
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 9 14:33:01 2005 +0000

    Install internal headers for now.

commit 541da61289915f76a01d6eeba7b8bcde17ff37ff
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Dec 9 12:59:36 2005 +0000

    Use front_buffer in SetRegion() and back_buffer in FlipRegion().

commit fe4ff9bd077562ce36e92626cbaa87395790ece5
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Dec 9 12:40:52 2005 +0000

    G200 BES doesn't support color adjustments.

commit 354e60d06e53326bc5b3c93dbe7ae127625b2d17
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 8 21:46:30 2005 +0000

    Don't advertise DFXL_STRETCHBLIT when it hasn't been checked.

commit db5bc68d97a833872e6d5746b1d172c5bc62e17d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 8 20:36:27 2005 +0000

    Added missing DSPF_ARGB case.

commit b8b3b4328cb882a4c95cb252e07a3fc2c855b570
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 8 20:33:04 2005 +0000

    - Fixed color keying mask.
    - G100 doesn't have TEXCTL2 so TEXTRANS must be used to disable color keying.

commit 843fcd7be3f1280c170729e167e2b56d74eec3f1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 8 20:13:27 2005 +0000

    Fixed YUY2/UYVY and texture LUT state handling.

commit b84d51c57bd4619ba91e8d63714d8295264167ca
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 8 19:13:13 2005 +0000

    Fixed rectangle intersect functions.

commit b151b155b7f037384bf9533de525b3932cdaaca4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 7 19:19:55 2005 +0000

    test

commit 113e1bc1cf038619ccc14f371e97639fe96501fa
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Dec 6 02:32:02 2005 +0000

    Fixes for G100 with SDRAM.

commit fac82aaf020f2cddf4960982223e92e11982ce85
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 4 21:06:46 2005 +0000

    Added Gunze Touchscreen driver, thanks to Nathanael D. Noblet <nathanael@gnat.ca>!

commit 0085667e71a981a82656e0b2baf72d318e293cce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 1 18:55:12 2005 +0000

    cvs test

commit 54a05e7bf30a9644c37b261a785eb86bc51adfd3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 1 18:52:33 2005 +0000

    test2

commit 0662da8f5de561ff5b0344a95b1eddbfe63f7df0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 1 18:48:21 2005 +0000

    cvs test

commit a80b270fcadc6532254e4e07c5d45dfa0eb1753e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 12:58:42 2005 +0000

    Fixed a cut-and-paste bug.

commit 86a3bdfc78094bea23eb533b25c9dc2ae2e4b75d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 11:38:08 2005 +0000

    Limited support for DSBLIT_SRC_PREMULTIPLY.

commit c91d670c62da02987df268c5623b57c655a4cf07
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 11:07:33 2005 +0000

    Support for DSDRAW_SRC_PREMULTIPLY.

commit 2ccdb5f94dafcaaa820fabebef550e42d0b1ee42
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 10:52:50 2005 +0000

    Completely untested PPC support.

commit 8cc254dd99e2116e9171e542741fc08ee54baf00
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 10:41:37 2005 +0000

    Added support for DSDRAW_SRC_PREMULTIPLY and DSBLIT_SRC_PREMULTCOLOR.

commit 5b3d80ffe8c9d64551cdfaff54bba4f8e7e006ad
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 10:10:40 2005 +0000

    Use DITHER_EN and SCALE_PIX_EXPAND only when color bits < 24.

commit e01fb997733015324b158976df32cbf288ebbc8a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 10:08:40 2005 +0000

    Avoid chip lockups with destination color keying.

commit 24df2355bb907366b3dbd5d443badfc751aeb3ea
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 09:24:18 2005 +0000

    Enabled SCALE_Y2R_TEMP.

commit ad6fe6cc01b2bbb8dac1668e8b063d6de5337d7d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 09:22:05 2005 +0000

    OVERLAY_EXCLUSIVE registers aren't supported on rev. A chips.

commit 22efa76598be431fc82963a23b10d80ed87bcb46
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 09:17:47 2005 +0000

    Check the chip type in ovSetColorAdjustment().

commit 8ce0dae79b5991010300e09b111f4e67b9d03da4
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 09:13:51 2005 +0000

    Fixed color keying on 264VT2.

commit 4c168edd661a7af01e6a00fb8c73967628b03642
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Dec 1 08:59:46 2005 +0000

    Fixed surface size limits.

commit 2fb6bceccb5c74f6ad4956f6b9a2059fd617871f
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Nov 26 14:32:26 2005 +0000

    Don't overwrite the last char of info->desc.name with EVIOCGNAME.

commit 782df7dad8eae7f8d95dc106fcca75facab86250
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Nov 26 13:45:58 2005 +0000

    Minor cleanup.

commit 4dc2827318b27c3c4da6dab75c7dc14dc7b04019
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Nov 26 13:42:12 2005 +0000

    Fixed scaler/texture color key for chips < 3D Rage Pro.

commit a104f56c4f131d5efefbb14cb6303cfd6d54163f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 24 12:35:38 2005 +0000

    Added DIRECT_SIGNAL_ANY as a replacement for the magic -1.

commit 3223f341a7c0b81d6218a469f28c1fe54fee1907
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 23 17:18:53 2005 +0000

    test of new server

commit 939a5c784979d266f9f1324e73f7c59d760cebf0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 23 14:18:58 2005 +0000

    Removed dependency on -D_GNU_SOURCE when including <direct/util.h>:
    
    Made direct_util_recursive_pthread_mutex_init() non-static-inline.
    
    Removed DIRECT_UTIL_RECURSIVE_PTHREAD_MUTEX_INITIALIZER and replaced all
    of its occurences by PTHREAD_MUTEX_INITIALIZER. These didn't need to be
    recursive. If there's a recursive mutex required, you can still use the
    utility function direct_util_recursive_pthread_mutex_init().
    
    Removed -D_GNU_SOURCE from direct.pc and directfb-config.

commit fb2086a780330031274279555e7511b0a26e83f4
Author: Mark Adams <marka@directfb.org>
Date:   Tue Nov 15 16:00:47 2005 +0000

    Silence warning.

commit 5d615d198e095608edbb0f55cbb7c0fc6babce88
Author: Mark Adams <marka@directfb.org>
Date:   Tue Nov 15 15:51:15 2005 +0000

    Overhaul of LEVELS, OPACITY and primary ALPHACHANNEL features which were
    previously only partially implemented and did not work together.
    
    The video overlay and the primary layer now both support the OPACITY option
    and either can be on top.  The order is determined by the 'level' assigned
    to the video layer.  The primary also supports an alpha channel which is
    useful when the video layer is positioned behind.
    
    The old DFB_CLE266_UNDERLAY environment variable switch has been removed.

commit a4377c63d838ae49e81653600bf6e9d5639ecd91
Author: Mark Adams <marka@directfb.org>
Date:   Thu Nov 10 10:26:15 2005 +0000

    New acceleration:
    - ARGB4444 as source and destination pixel format for all supported
    operations.

commit f1ac90cc099d900d33645be4c185bde492b3eb11
Author: Mark Adams <marka@directfb.org>
Date:   Tue Nov 8 19:31:21 2005 +0000

    Added missing fifo space checks and corrected an excessive allocation.

commit f5ddab4126ee2d8bbfc056c6dc855aa927dfb92a
Author: Mark Adams <marka@directfb.org>
Date:   Tue Nov 8 19:29:11 2005 +0000

    Fix 'unexpected pixel format' errors.

commit dff7a5cbf96393921c6a18aed6337e6e72fbbe2b
Author: Mark Adams <marka@directfb.org>
Date:   Fri Nov 4 17:11:38 2005 +0000

    Documentation updated to reflect the features and limitations of the
    current code.

commit f41c1d5e9953fefaa0367c069a25608ed7b9989f
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 16:16:45 2005 +0000

    - Fixed Mystique vs. Mystique 220 detection.
    - Made device_info->name a bit more verbose.

commit ee2bc368905168d1141523553867199e126997af
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 16:13:13 2005 +0000

    Remove unused variable.

commit 9150ceaa6a75b17486b736c13a4256c3fe158be0
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 16:08:09 2005 +0000

    - Don't touch hardware in SetRegion() if nothing changed.
    - Separated spic_calc_buffer() out of spic_set_buffer().

commit 0d9335f3cfabba7c5c7d542ad974e8b4441973c3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 15:26:28 2005 +0000

    Setting VIDRST bits is pointless as the hardware ignores them.

commit a05184933fbd88a6c301f63fb879fe8fa0e71baf
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 15:11:14 2005 +0000

    Forgot to include misc/util.h for dfb_region_intersect().

commit bca23d880c5e4f13af6d167af82cab66e3bedf4c
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 15:08:46 2005 +0000

    - Disable BES if the destination region is completely off-screen.
    - Renamed current_mode to mode because it's shorter :)

commit 07222c75c9b465ec04cdb1d6daa13ba934fab806
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Nov 1 11:56:24 2005 +0000

    - Allow surface height up to 2048 with DLOP_DEINTERLACING.
    - Limit surface width with DLOP_DEINTERLACING to guarantee BESPITCH < 4096.
    - Disable vertical filtering when surface width > 1024.

commit d5b53c231dee836fc200e5169fb48238df337125
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Oct 31 11:41:23 2005 +0000

    Added SendEvent().

commit ff618c647fb60c799e6890e216fca27f41678304
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Oct 30 18:17:32 2005 +0000

    Added IDirectFBVideoProvider::SendEvent() to send a window or input event
    to video providers that supports interactivity (DVCAPS_INTERACTIVE).
    
    For cursor events, coordinates must be in the destination rectangle space.

commit 127b8c524353fe3197ff1a49deab248067a8739d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 02:20:54 2005 +0000

    Show "1k" again for '0 < bytes < 1024'.

commit cec48179f09d30197ddc61a09d48b9a9c775d771
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 02:12:06 2005 +0000

    Fixed warnings.

commit 6e510a6e2e7f2f8579c72664a10e907c5c1a8990
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 02:03:11 2005 +0000

    Fixed warnings.

commit 23c57785394db1b1f4be09e92efe66e2486ac175
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 01:57:17 2005 +0000

    Fixed warning: dereferencing type-punned pointer will break strict-aliasing rules

commit 114d8e1c738215497e7c66b3c2b2921a1217bd74
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 01:47:18 2005 +0000

    Avoid tons of warnings by using D_MAGIC_SET_ONLY instead of D_MAGIC_SET.

commit 321594863aa186845180a836149dcea9d01172c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 01:46:40 2005 +0000

    Added D_MAGIC_SET_ONLY which is D_MAGIC_SET without assuming that the magic
    hasn't been set already. Useful to avoid compiler warnings when acting on
    uninitialized structures on the stack.

commit 8b4d2210a9b6b5e4ea2937a83e08ca3fbabbb9b8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 29 00:40:56 2005 +0000

    0.9.25
    
    
    Using the new Fusion Kernel API 2.0
    - Parallel Fusion Worlds in one process via extended API
    - Multiple Shared Memory Pools in one world via new API
    - No race condition between (potential master) processes starting in parallel
    
    Fusion APIs have been extended to support different worlds and pools.
    
    Pass CoreDFB to graphics drivers as a new argument to driver_init_driver().

commit 562028d388d8e9f26cb2e5f4850e389ab74af5c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 28 21:09:21 2005 +0000

    Avoid division by zero if no video memory is available.

commit 9ab7016f71d61059f190afccd579414a45c07fdf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 28 21:06:46 2005 +0000

    Added D_OOM() message if thread structure can't be allocated.

commit e2c4691f4bb46223ae2ba42a90eed56de50320d1
Author: Mark Adams <marka@directfb.org>
Date:   Thu Oct 27 15:56:28 2005 +0000

    Added support for DLOP_FIELD_PARITY.  For this to work, the kernel
    framebuffer must support an extension of the WAITFORVSYNC ioctl that
    allows waiting for the top or bottom field.

commit faaa1555d999ee67338a5945d8b16aefef0f6c3d
Author: Mark Adams <marka@directfb.org>
Date:   Thu Oct 27 10:38:17 2005 +0000

    New accelerations:
    - YV12, I420, YUY2 and AiRGB simple blits
    - AiRGB 2D drawing

commit 3e6f19d3b6cd1d9b7f3b0880d0b8adf316ad6f03
Author: Mark Adams <marka@directfb.org>
Date:   Wed Oct 26 10:43:36 2005 +0000

    Disable broken SetColorAdjustment implementation (already partly disabled).
    Remove color keying diagnostic.

commit 5aa72ae237fea0b35e3a47806c007ae961eb3064
Author: Mark Adams <marka@directfb.org>
Date:   Wed Oct 26 10:37:45 2005 +0000

    Round to nearest when positioning up-scaled YV12/I420 video to reduce
    error.

commit 1c48072fcf7c9c2009863d893f00041b32f25b38
Author: Mark Adams <marka@directfb.org>
Date:   Wed Oct 26 10:34:55 2005 +0000

    Fix YV12/I420 video layer corruption on revision 0x11 hardware.

commit b8d2cfd4d1190de40980e7a167fb139639d977eb
Author: Mark Adams <marka@directfb.org>
Date:   Wed Oct 26 09:37:28 2005 +0000

    Fix bug setting SUBP_CONTROL_STRIDE register in uc_spic_set_buffer.  Sadly
    subpicture layer still doesn't work.

commit 6b95bde969c8ceb3389a1bf35fabf8aa6dd2d39c
Author: Mark Adams <marka@directfb.org>
Date:   Wed Oct 26 09:34:45 2005 +0000

    Fix hardware revision number detection and allow override via new config
    option unichrome-revision=<rev>.  The revision number can only be
    auto-detected if the process runs as root.
    
    Added simple script to determine revision number for addition to
    directfbrc.

commit c0c00a4b6f797dc976da1e23344f2d6831dc0f94
Author: Mark Adams <marka@directfb.org>
Date:   Wed Oct 26 09:26:44 2005 +0000

    Added config option unichrome-revision=<rev> to manually set the hardware
    revision number for the unichrome driver.  This cannot be determined
    automatically unless the process runs as root.

commit 2bdf900f76a13d528b9a838473587559b4f3a56a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 07:33:08 2005 +0000

    Silence compiler warning.

commit a93779d8d48a4e0f018dc836bb5e0177678cadc2
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 07:26:16 2005 +0000

    - Finally remove DLOP_FLICKER_FILTERING.
    - Don't reinitialize the whole TV encoder when changing field parity.
    - Misc. cleanups.

commit 4c0e111298a16efc15daefd3eb2134dec7d3c308
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 07:23:16 2005 +0000

    Allow DSPF_ARGB surface + misc. cleanups.

commit 53c13af3a58670b652798431656600a5ac34bec4
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 06:33:46 2005 +0000

    PCI device ID cleanup.

commit 58e392a7a1caff7f60e658ad12bba894fb63e8e3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 06:13:51 2005 +0000

    Prefer /dev/shm over other tmpfs mount points with the same size.

commit b74f892dbd0fe5ece7af3b35eb793772e3b1293e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 06:09:39 2005 +0000

    In dfb_surfacemanager_allocate() do dfb_gfxcard_sync() only if hardware has
    read from the buffer about to be kicked out. The call to
    dfb_surfacemanager_assure_system() should already take care of the hardware
    write case.
    
    Change dfb_surfacemanager_assure_system() to call dfb_gfxcard_wait_serial()
    instead of dfb_gfxcard_sync() since we're only interested whether the
    hardware has written to the buffer.

commit b1b36f59a95bd1fc321bf099bc8e3b9501f1f13f
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 26 05:38:38 2005 +0000

    Added FlushReadCache() to the graphics driver API.
    
    Used in the matrox driver to flush the direct access read cache.

commit 6cc6de1ded1ccec798424d205947b2eefba2d151
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 25 14:45:30 2005 +0000

    Include "libobject.make" for static builds in distribution.

commit e24732ab81e9244437c2159f2bd47572e4cef81d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 17:20:42 2005 +0000

    updated

commit 23fcd1ec07ffbb070855899fca9963674a5ef9a9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 17:11:53 2005 +0000

    0.9.24

commit c356add186f08cd9254417d42b453d3b4c8dc5bd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 17:11:42 2005 +0000

    Fixed warnings.

commit 86d310934852aad912f3333418c847446c5d04f0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 17:11:29 2005 +0000

    one more missing header added

commit ea39d94aa9635422ecc260dc56ac2068bb7ee8c3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 17:06:30 2005 +0000

    Fixed a warning.

commit f9bda56c9a1a63a44d8eaad1de046e3465d1f833
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 17:01:08 2005 +0000

    Removed all checks for FB_ACCEL_* as fallbacks are in core/accelerators.h now.
    
    Don't build cle266 by default as it's obsolete because of the unichrome driver.

commit b29482db505d6865c2e968f71e4165e0d483a725
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 16:58:19 2005 +0000

    Added missing includes of <core/accelerators.h>.

commit 050ef126dc428aac716ac37306034c2e591d39b3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 16:47:31 2005 +0000

    No need for linux/wm97xx.h anymore.

commit 2c115a96033a43f3450c216c665c7b031b23a3f8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 16:42:46 2005 +0000

    Don't use fusion_reactor_free() too early in case of an error in init_devices().
    
    Thanks to "Jakub Bogusz <qboosh@pld-linux.org>" for this and other patches.

commit 7afd787e8762a18e6a2fe6c6942237896512b194
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 16:40:46 2005 +0000

    Added missing headers to SOURCES.

commit f8c70edfcdbda3275c041d08d73a0fba5bf2d973
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 16:40:31 2005 +0000

    Added missing types.h to SOURCES.

commit 2ea2b5c32c37b046146e29710051536f41e2e15d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 24 16:40:14 2005 +0000

    Added sisfb.h to SOURCES. Removed check for sisfb.h.

commit d64523c0733df61bfeb0568477dfd366ec465984
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Oct 24 13:46:13 2005 +0000

    IDirectFBVideoProvider::GetPos() returns DFB_EOF to notify end-of-playback.
    After stream has reached the end, the next call to PlayTo() restarts playback from the beginning.

commit 409199cfa6eb957d5367b4ece165a9e1d940820f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 23:38:50 2005 +0000

    no more patches

commit d47823532f67be7a8ede71c45ceff60105751ecf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 22:54:48 2005 +0000

    Seems that sisfb.h is still required.

commit acbc6c626c79779ebfc0631ac7efa7228dcba126
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 18:01:07 2005 +0000

    New changelog and summary for 0.9.23 :)

commit 4efa1d4d6c4f14c84fb0559f5360a5c39a09bfb1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Oct 18 14:37:39 2005 +0000

    Plug a leak and add a comment about freetype bugs.

commit b0ee0b88ece091c7264ccb7c77f100d6c97bcadd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 10:57:32 2005 +0000

    Oops, somehow I managed to apply another patch with something already added :)

commit 241e7cafec1ba50600b5a63e7b2161c35ef82974
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 10:04:52 2005 +0000

    Added support for DSPF_ARGB4444.

commit 25e6a28ef699fbda53b1a5ea77cc3a0848f4c39b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 10:04:21 2005 +0000

    If during window creation the pixel format for windows with an alpha channel is
    unspecified, don't always take DSPF_ARGB, but the layer's format if it has alpha.

commit c7e0c35446f43ed0e1168649bee6e81ed2e2ca06
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 10:02:20 2005 +0000

    During flip using blitting, wait for pending writes to the back buffer
    before issuing the blit command from back to front buffer to avoid lags
    caused by too much queued commands.

commit 8c2c8492949a6c40466fbfafb5ec90faba13b65f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 10:00:27 2005 +0000

    For PNGs with alpha don't always suggest DSPF_ARGB, but the primary layer
    format if it has alpha.

commit bb4148c9341306abb40e85e56f54bf63524c685b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 09:59:30 2005 +0000

    Don't abort if checking for LEDs fails.

commit 134706f3b347f420d618a6a73446d2f05987d3a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 18 09:56:45 2005 +0000

    Simplified regex a bit.

commit e95a6dc94119fcc4cc1efb1e82d3e6c29a99448e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Oct 17 18:00:06 2005 +0000

    Fixed segmentation fault when loading OpenType fonts.

commit da18a5a083d72ce667707cccca33c43e368b93e4
Author: Mike Emmel <memmel@directfb.org>
Date:   Sun Oct 16 05:12:41 2005 +0000

    Removed the depth hard code to 24 and open the display in primary.c
    to get its real depth.  Note this needs to be done a cleaner way since
    we open close the display then reopen but its right.

commit 88c65e1f8bec846962a70e50e4520526752a702c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Oct 15 08:26:06 2005 +0000

    Ignore a return value of DFB_EOF from IDirectFBDataBuffer::PeekData().

commit b168dacec35907a42d732c7fd8aded89cc356f3a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Oct 12 08:46:49 2005 +0000

    Reduce probing context header to 64 bytes.

commit 096ffa1348773d66ab6b28084810a709d45c5516
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 28 20:24:47 2005 +0000

    Added Probe and Construct function pointer typedefs for casting to make g++ happy.

commit d99b70fe738a76be1ef2c2877d697b185d46fe52
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 28 19:00:42 2005 +0000

    Thanks to Damian Kowalewski <damian.kowalewski@mail.mcgill.ca> for fixing
    artifacts produced by clipped triangles.

commit 4c9f55bdeb484c5cec188a7ff5406c01d2fa71a6
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 26 14:04:51 2005 +0000

    Support streamed data buffers.

commit 5aabb8c117129096ace4c06af537ef987c593b4a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 26 10:40:11 2005 +0000

    Follow IDirectFBDataBuffer changes.

commit 01491e0f5126c49ae6447f855ea56a67c9c0cdf9
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 26 10:39:15 2005 +0000

    Added IDirectFBDataBuffer::Finish(): used to notify a streaming databuffer that
    the end-of-file has been reached.
    
    After the method has been called, PutData() fails with DFB_UNSUPPORTED
    while GetData() returns DFB_EOF unless there is still data to be fetched.

commit 391e596c93564cf9e9bdd9d9a597623962a77fdc
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 26 10:27:54 2005 +0000

    direct_stream_peek() and direct_stream_read() return DFB_BUFFEREMPTY if there is
    no data available.

commit 28c7cd7a6f055a0eab248301292c66c1c47eb51c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Sep 25 20:00:39 2005 +0000

    Applied patch from "Stefan Lucke <stefan@lucke.in-berlin.de>" for better
    touchscreen/smartpad detection.

commit 2088c11908d06f6aa5c2682fed700ca78621d57a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 24 15:53:31 2005 +0000

    In pipe_read(): decrement 'length' when reading from the cache.

commit e32905316fce51d6ad37c39f7676ed852334202f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 24 08:54:43 2005 +0000

    Lock the mutex before seeking.

commit d710d0c92f6e9a04ac84b0058fa65eb5699389d5
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 24 08:53:33 2005 +0000

    API change: direct_stream_seek() takes an absolute offset as argument instead of a relative one.

commit 6fd8dd70d1cf10d1ead2261278d976cf07a6f4fe
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 24 08:30:59 2005 +0000

    Return DFB_INVARG from direct_stream_seek() if absolute offset is negative.

commit 46b1feb847f4772643194ffad07396112da41b60
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Sep 23 13:44:00 2005 +0000

    Use nanosleep() instead of usleep().

commit d0fdd0b973f1969225d886da9a4857c28964e50a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Sep 23 13:42:53 2005 +0000

    Actually do no fail if IDirectFBDataBuffer::PeekData() returns DFB_BUFFEREMPTY,
    opened file could be a device (e.g. /dev/video).

commit 803a6227862c3217b76937318a10a5c1f3e52dbb
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Sep 23 09:47:54 2005 +0000

    Follow changes.

commit e8d7705fd6c2e06c182cfa8fe072fba556bd8197
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Sep 23 09:46:55 2005 +0000

    Create Video Providers from DataBuffers.
    
    Added IDirectFBDataBuffer::CreateVideoProvider().

commit cac69da8b6257148ea5b8601a7fdc7bf6856d060
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 22 16:37:24 2005 +0000

    Added priority to video mode definition.
    
    Search for mode with highest priority.

commit a2f07cf35b0463f1795072a219a949c5d42e0c88
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 22 15:11:30 2005 +0000

    Added CoreSystemCapabilities with one capability until now: CSCAPS_ACCELERATION.
    Probe for graphics drivers if this capability is set. Removed implicit version of
    this check (the check for the accelerator).

commit 23d1c3d515cfd36677a9fea1a98544b217e2e691
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 22 14:44:29 2005 +0000

    Support fractional font sizes in API and FreeType2 Font Loader.

commit ef3c4c8a1a61731be81df3f9ed571389a2633c03
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 22 13:44:32 2005 +0000

    Reverted change of bool until I found out why it breaks the R200 driver
    and possibly others (no hw blitting anymore).

commit 45caa29ae93df5b75f0319526a50da3dc329f211
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 22 12:59:35 2005 +0000

    Fix wrong size of bool.

commit fb784c0af2c563b7b57db6e914bcd551768ca3b1
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Sep 22 09:22:01 2005 +0000

    fbdev->shared->current_mode is now static and gets updated according to current var
    when the video mode changes.
    This way dfb_system_current_mode() always return the effective video mode.

commit a75f8d4fbf32a37e711fa93d789078e6a564493c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Sep 21 16:13:40 2005 +0000

    Use DirectStream.

commit 32d48a32a0203ad2624b8079f7f8ca69d2b6abbb
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Sep 21 16:10:11 2005 +0000

    Added DirectStream, a wrapper for accessing files locally and through network (http, ftp and generic tcp).
    The API is derived from the IDirectFBDataBuffer interface.

commit 6fe70d12cc3daeab6d463ff9cb1c2124d0591e35
Author: Martin Ltken <ml@directfb.org>
Date:   Mon Sep 19 22:48:27 2005 +0000

    Small change just to be able to get help from DFB people

commit a4c9b7fa573350905697dfe720aab3026eef0302
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 14 17:26:44 2005 +0000

    Another patch from Mark Adams <mark147m@gmail.com> removing the check for
    a real file name in CreateVideoProvider() to support Xine's MRLs.

commit 3ef6c7983ada2802909dbc20e6336941561a2898
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Sep 14 16:42:48 2005 +0000

    If the master application only accesses the BES layer, current VideoMode is NULL;
    in that case rely on the default VideoMode.

commit 8018e8cc61b997aa7ae08781bde8a4be8a38c42e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Sep 14 16:05:51 2005 +0000

    Dropped down YUV Source Colorkeying.

commit 18c3709af853431a53fb77d59866574242be4042
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 14 11:02:30 2005 +0000

    Applied patch from "Mark Adams <mark147m@gmail.com>" fixing a rare crash
    in the single application core. Thanks!

commit 318f510a4b0e57f316ae633013e4ace127e1e109
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 14 08:36:30 2005 +0000

    Added new input event flag DIEF_REPEAT indicating a repeated key or button press.
    
    Make usage of it in the linux_input driver.
    
    
    Thanks to "Marko Mkel <marko.makela@hut.fi>" for the initial version of the patch.

commit 3da874e2803d3271aac79eff7ac65443a5f9e6ab
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Sep 11 15:27:37 2005 +0000

    Planar YCbCr deinterlacing.

commit 8b592375042eeac3c2006e94889cea37cdaa9e73
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Sep 7 10:18:02 2005 +0000

    Fixed rendering to A8 surfaces (color must be replaced by alpha since the destination format is set to RGB8).
    
    Workaround to make byte-swapping work properly on big-endian machines (better than nothing for now).

commit 2ccdbf17b6d05c02e19a2c4c7c65b1405d40c09e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Sep 6 12:51:15 2005 +0000

    RGB24 byte swapping on big-endian hosts happened when the destination format was RGB32,
    probably because of a patch applied for a different revision of gfx_util.c.

commit 9836c81537583f27b45fdbe331b19d837777a961
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 3 10:41:58 2005 +0000

    New supported values for mouse-protocol: PS/2, IMPS/2.

commit 6c1a672d1e7773004e481db516e0f4a15c2e2983
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 3 10:40:07 2005 +0000

    Display help for the following options: mouse-source and mouse-gpm-source.

commit 89ceb472a2d785f60d21ccc18879549462c6dcae
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 3 10:38:47 2005 +0000

    Added GPM support.
    The moouse-protocol option specifies the protocol for
    the mice or the repeater (supported values: PS/2 and IMPS/2).

commit da3efadfd6ac7c7a26cd2c3f68117c6245a900cf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 2 20:09:11 2005 +0000

    Suppressed some debug.

commit d3dadc1b045cdc58d3c3b0b1ef6a28996353b8c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 2 19:59:56 2005 +0000

    Fixed an evil dead lock that only occured by moving a window with one of
    my new mice, having superior precision generating lots of events, thanks
    for spotting this bug, Logitech :)

commit 8af84ef7b2a96b0539099778701d0d59b0e8098b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 30 15:41:36 2005 +0000

    Added universal event class for custom usage with variable size.
    
    New structure DFBUniversalEvent has a 'clazz' and a 'size' member. The clazz
    is always DFEC_UNIVERSAL and the size is at least sizeof(DFBUniversalEvent).
    There are no other members, but any amount of additional data may follow
    according to the specified size. Best usage would be to derive from the struct.
    
    The pipe mode currently doesn't support universal events, because the event
    size (write()/read() block size) is fixed to sizeof(DFBEvent).

commit 2b2a778a7691fc737baea0b6974257f84b1f5f69
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 29 09:19:05 2005 +0000

    Added direct_thread_set_name() for setting the name of threads that haven't
    been created by direct_thread_create().
    
    Use direct_thread_set_name() in direct_initialize() setting "Main Thread"
    if direct_thread_self_name() returns NULL.

commit 9f07b205a7d81fb702fdd1a8431331a0ebcf13d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 29 09:17:06 2005 +0000

    Added duff's device for 8 bit color keying.

commit 23d409e357ecc5ebe63ed3760cbc5aa81ab831eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 29 09:15:52 2005 +0000

    Added RGB332 and LUT8 support to dfb_surface_dump().

commit 91492126ab383d76f9724199803207bd1d89fb8e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 29 09:15:03 2005 +0000

    Added 'const' to DFBPaletteDescription\'s entries.

commit 73255756d8d06eb95308ee9b67c5897f18ff3c57
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 27 15:08:04 2005 +0000

    Added low level logging abstraction.
    
    direct_log_create() is used to setup logging for the following types:
    - DLT_STDERR  writes all messages to stderr
    - DLT_FILE    writes all messages to a file
    - DLT_UDP     sends all messages via UDP to a specific host and port
    
    direct_log_destroy() is obvious :)
    
    direct_log_printf() is a printf fashioned funtion to write a message.
    
    direct_log_set_default() sets the default log that is used when
    no valid log is passed to direct_log_printf(), as done by all legacy
    code for now. If the default is also invalid, stderr is used.
    
    Added runtime options "log-file = <name>" and "log-udp = <host>:<port>"
    for configuring the default log.
    
    
    On the receiver side start e.g.: "netcat -l -p <port> -u"

commit 8ea8a38285bd3b9ede95baeb60cbc74db6a2178f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 27 14:07:48 2005 +0000

    Added missing include.

commit 67536932c229b35ae28c602acd335550a8987bb6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 27 14:05:03 2005 +0000

    Fixed a warning.

commit 8ca22f8333488c6a8c38b8b387dca245942d67d0
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Aug 26 10:02:30 2005 +0000

    Take into consideration DSDRAW_DST_COLORKEY and DSDRAW_XOR when drawing strings.

commit 440a3261fc1054fa01f1861c53ac8aba7d1fc52a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Aug 26 10:00:58 2005 +0000

    DSBLIT_XOR.

commit 1bceb7e2417646a1bfe720bdfa261371e3dc67d9
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Aug 26 09:59:31 2005 +0000

    Added DSBLIT_XOR.

commit 8ef2c046d6cadfa7acedf4009e73acefd4cf8d2e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 23 15:26:47 2005 +0000

    - FillTriangle,DrawRectangle,DrawLine (with Xor and Alpha Blend) on YUY2/UYVY/YV12/I420.
    - DrawString (A8 fonts) on YUY2/UYVY/YV12/I420.
    - Blit with Source Colorkey on YV12/I420.

commit e0dc4ad4951668639c47e0415c7cdd64b62e6787
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 23 15:25:20 2005 +0000

    dfb_color_to_pixel() returns (y@0, cb@8, cr@16) for I420/YV12.

commit 83f515d8a2441416f9083bb5e4e75bfe42e1311c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 22 21:08:11 2005 +0000

    Added fusion_object_get() that gets a pool and an object id and returns
    the appropriate object with a local reference added to it. If the object
    is not found DFB_IDNOTFOUND is returned, or any abnormal other error from
    locking or referencing.
    
    Added FusionObjectID to replace plain int usage.
    
    Added D_MAGIC_* to FusionObjectPool.
    
    Added more D_MAGIC_ASSERT for FusionObject.
    
    Simplified fusion_object_pool_enum() using direct_list_foreach().

commit 51677e66aeddb7258a5c49c484ff0aa0e860b7ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 18 13:20:00 2005 +0000

    Fixed build_clipped_rectangle_outlines() to handle special cases
    where width and/or height is/are one or two.

commit cc504446887022abd12e104d00b4954c9c3f1060
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 18 11:18:11 2005 +0000

    Added dfb_region_region_union().

commit 15739b12f389e38456ef802adce072111b6b7e99
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 18 11:13:43 2005 +0000

    Fixed a bug in direct_list_remove()!
    
    If the last item is removed while other items exist, the first
    item's "prev" pointer was not updated (pointing to the last element).
    
    
    Cast to (typeof(elem)) instead of (void*), to make C++ compiler happy.

commit ce858d75ccfbc9ad837faaa57f966fb98499e770
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Aug 15 13:40:54 2005 +0000

    Lot of improvements and new features.
    
    Engine:
      - Fixed all cache related problems.
      - No longer _exit if a timeout occurs, try a reset instead.
    
    Acceleration:
      - Added support for the following formats: LUT8, ALUT44, ARGB2554, AiRGB.
      - Speed up font rendering by bypassing the TCL.
    
    Overlay:
      - Fixed support for very high resolutions (dotclock >= 175Mhz).
    
    
    Switched to version 0.2.

commit 15eca8fd93a57335fc624f96e9897f64cf652e1c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Aug 12 11:03:15 2005 +0000

    Do not try to load the driver if the accelerator is -1.

commit fbf15dbbba6398850b54112ace094d019351a44a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Aug 12 11:00:56 2005 +0000

    system_get_accelerator() returns -1 if mmio memory lenght is 0.

commit 5c54a533eb0af58a23ea7e2cd3dac77c1b714828
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Aug 11 06:43:30 2005 +0000

    Fixed a typo.

commit 8caa3202616c1bb7ff9f497d4a99d3225717ab1f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Aug 11 06:42:52 2005 +0000

    Missing copyright.

commit a373338efcc3a3cc295e549891b0df2018e5642b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 9 13:15:42 2005 +0000

    Fixed bug due to negative coordinates when the overlay goes outside the top/left border of the screen.

commit 7c87cb4ce653263bcd8417cd649303abf820c696
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 9 08:17:28 2005 +0000

    - Re-enabled the CCF_READSYSMEM flag on NV5/NV10 only for TextureTriangles().
    - Made deinterlacing work properly with TextureTriangles().
    - Pay attention to the DSCAPS_SEPARATED flag.

commit e65a7482c140d3075755cdbc5456d06a3fef1365
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Aug 8 13:04:24 2005 +0000

    Fixed planar source cropping.

commit a8b9045c367c8f4341a142f1fd47a7523a75b9f5
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Aug 8 13:03:54 2005 +0000

    Pay attention to the DSCAPS_SEPARATED flag.

commit 0283d7888a6468b2aa51a6fa3dbb11726ebe8f5c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Aug 7 10:27:24 2005 +0000

    StretchBlit() improvements:
         When the suppplied blittingflags require to read from the destination,
         source is scaled to the accumulator on start, otherwise scaling happens
         when the pixels in the accumulator are written to the destination.
         This way StretchBlit() is faster if source has not to be blended togheter
         with the destination.

commit 61d13145259257f408fe12b82e755416518bfbcb
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Aug 6 08:26:17 2005 +0000

    Allow YV12/I420 deinterlacing.

commit 55a9c0172952261608a133571e7657a672ef057d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 4 20:45:28 2005 +0000

    Added -D_GNU_SOURCE as this script currently covers libdirect, too.

commit 34317d738cf3573ce0668050ad45ab962b3ee1c4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Aug 3 10:56:59 2005 +0000

    Option 'pci-id' renamed 'busid' (however 'pci-id' still works).

commit 1698125f7e2452378385a0c09da77150a76a8931
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Aug 3 10:01:18 2005 +0000

    If JFIF or Exif header detection failed, try detecting by filename extension.

commit 6d85625c8956224f67ac5afc7b17b5e2b8a68206
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Aug 3 09:21:41 2005 +0000

    Include <core/accelerators.h>.

commit 07d5f258209578ac1e0042ca66fee68758a7786e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Aug 3 09:14:56 2005 +0000

    Added a list of supported accelerators.
    This avoid relaying on <linux/fb.h>, that could be a very old header,
    and gives the possibility to add accelerators for other systems.

commit 0255ed695e5dbbe6c315cd2e2d67b6dce38491e5
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 2 20:54:46 2005 +0000

    If there is not enough video memory for textures buffer,
    do not fail returning DFB_NOVIDEOMEMORY but simply disabable 3D acceleration.

commit d9fd90296c25d0bb23e1130751748faaa3cf65e4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 2 17:00:01 2005 +0000

    Deinterlacing.

commit f17881a6b2aa4a136b1bfaa8238a248a491db8bb
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 2 14:06:08 2005 +0000

    Deinterlacing.

commit 564c13062a64164957b7b42c213b2650b228d2d5
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 2 09:04:15 2005 +0000

    Replaced dfb_screens_register_primary() by dfb_screens_hook_primary().

commit e497b8db39401cb53eea365f06ebf122733dad9d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 2 08:11:53 2005 +0000

    Dacc_xor() at 64bit.

commit 6664180f2be3869a20528a4101d70c3bca14a13e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Aug 1 07:39:23 2005 +0000

    Added some functions optimized for 64bit architectures.

commit e55c57064b29ebfa1869b013d89928b85330eda2
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jul 31 18:07:59 2005 +0000

    Optimizations on generic64_memcpy().

commit 81f6bc57b18a62d5202a42f497aff9531e59d959
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jul 31 14:42:51 2005 +0000

    Cast pointers to long instead of __u32.

commit 9267d12ac866903e7eef86fb8448a249dc62dc7b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jul 31 11:04:41 2005 +0000

    Fixed missing debugging symbols on AMD64.

commit 70aa8a73b99722f7d0cd5d8c1be89dbafac29ec6
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jul 31 09:34:22 2005 +0000

    MMX and SSE support on AMD64.

commit e98ffa98f573af7acd1ec242e695f1f6a5fd686f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jul 31 09:31:53 2005 +0000

    Ported to AMD64.

commit 48f53c73335d7889d1290d13fb56972fc8d9655b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Jul 30 16:53:46 2005 +0000

    Check if we are compiling for AMD64.

commit ba704c43aa62f6c7a25e35da3cf4d37fdba59f2c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Jul 30 16:52:32 2005 +0000

    Enable X86 memcpy()s on AMD64.
    Added a generic memcpy() for 64bit Architectures.

commit 50ffd957cba94eae6b88f88189653e64360eba7e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Jul 30 09:13:49 2005 +0000

    dfb_screens_hook_primary() instead of dfb_screen_register_primary().

commit e638f9948b39ac33fc8ba26a4745c26c84ee9c29
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Jul 30 09:11:55 2005 +0000

    Added dfb_screens_hook_primary().

commit 4a16d536c24c9952360ec4ca6d10558111860a33
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jul 28 12:30:44 2005 +0000

    call $(AR) not ar. Fixes nothing yet since AR is always ar, for some strange reason.

commit 153900c7f98b453c1d2c9b7e010914137d53aa03
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Jul 27 14:09:41 2005 +0000

    Use dfb_system_get_deviceid() instead of accessing FBDev system's private data.

commit c77022f1a3e26d008ac3a067fff46316a3537409
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Jul 27 14:07:04 2005 +0000

    Added dfb_system_get_busid() and dfb_system_get_deviceid().

commit bd2930fc462e706c5851e830319f206a3a6854d1
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Jul 27 14:05:09 2005 +0000

    Call pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ) when __USE_UNIX98 is defined
    (PTHREAD_MUTEX_RECURSIVE is not a definition in LinuxThreads).

commit ac59b8b44b21b9f17d39bb0c5e725d0c8307ff4d
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 26 21:30:11 2005 +0000

    On KallistiOS:
    - do not call killpg()
    - do not include dlfcn.h

commit bbb4a2e18a6899fa92064a28bb577a5ed784516b
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 26 21:07:08 2005 +0000

    - only call pthread_mutexattr_settype() when PTHREAD_MUTEX_RECURSIVE is defin is defined

commit feb728448e1fae2597921497a9f762f7eacf9380
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 26 20:58:50 2005 +0000

    when compiling for KallistiOS define __* types another way.

commit b80dab075edcbbf07734c9fdf7fe67845afa7878
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 26 16:47:15 2005 +0000

    - dont check for libpthread when compiling for KallistiOS

commit 2d0fd8679712ef7725205f0d21f7a5cad842f800
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 26 15:19:39 2005 +0000

    some more BSD compatibility for linking statically

commit e5736dc9c4a5c494790e009bc4e4289329a4b089
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 26 13:49:12 2005 +0000

    Added ARGB4444 support, untested.

commit c7ff8b2a5bad2917322bc643d007ecb2de948685
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 24 17:55:06 2005 +0000

    Fixed wrong signature of DirectFBInit() and dfb_config_init().
    
    -DirectFBInit( int *argc, char **argv[] )
    +DirectFBInit( int *argc, char *(*argv[]) )

commit 5c99371dbd110ce88404346988e19f72809f88a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 24 17:42:39 2005 +0000

    Was missing.

commit e8ca623d7526e68517fa5a06b1465fb7f4657d6d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 24 17:29:52 2005 +0000

    Replaced old code by using direct_try_open().
    
    Fixes double negative in error message.

commit d88a02e219cc1f076004123a4313f2f0567e4bbf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 24 17:09:40 2005 +0000

    Added translation of
    - KEY_FASTFORWARD
    - KEY_SOUND
    - KEY_QUESTION
    - KEY_EMAIL
    - KEY_CANCEL

commit 46a7ab8ba61d441aa851fb3d03195e63b9b602ea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 21 21:43:35 2005 +0000

    Protect against bogus siginfo_t pointer by checking if it's smaller than 0x100.

commit 8fada1177e1daadc52a085490c6f6bcadcfc0834
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 21 21:34:03 2005 +0000

    New configure option "--with-sysroot=DIR" lets you prepend a path to
    the runtime library/module paths.

commit ddcddb348a919152e81bbd8d67fc198fc415a013
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Jul 19 08:58:30 2005 +0000

    Oops, written fbdev->shared->device.model instead of fbdev->shared->device.vendor.

commit 87f5fa10efe469cc86d35cc3ca3c3c3e66bf25b0
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Jul 19 08:53:21 2005 +0000

    Applied patch by Vadim Catana <vcatana@registru.md> with some modifications due to last changes.

commit 69a08d4c0471ce53943864fdf0b57ac66d4348d2
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jul 18 19:07:19 2005 +0000

    - BSD compatibility: changed "cp -af" to "cp -pf"

commit 5dafc702460aff8b2895763f66ef3ba31e42a497
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jul 18 18:56:00 2005 +0000

    - specify path when calling "find", improves BSD compatibility when linking statically

commit 1d66c37a83b4d748ae848840ee0d7dbc89fd0be4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jul 18 16:28:19 2005 +0000

    No longer need to link against libsysfs.

commit 26ca622aa686781a088facd147ca50ced7dd5fbb
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jul 18 16:27:28 2005 +0000

    Use informations stored in FBDevShared to detect chipset architecture.

commit e96da2dc220a1b582368d6f74eb13fd2a81d0d67
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jul 18 16:26:21 2005 +0000

    Use informations stored in FBDevShared to detect chipset identifier.
    
    No longer need to link against libsysfs.

commit 4bbf6043c12d660353980d57c04a388961c57e2f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jul 18 16:24:38 2005 +0000

    Added option 'pci-id' to specify the graphics card bus id (unused if sysfs support is enabled).

commit 19aed80be4aa696d97ac3a170b05b4b8cacb6811
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jul 18 16:22:57 2005 +0000

    The FBDev system is now responsible of retrieving the PCI Bus, Card Vendor and Device identifiers.
    These informations are stored in the FBDevShared structure.

commit b7d88f51038bfee28999acbbd4488837657710a4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jul 18 09:35:56 2005 +0000

    Overlay supports deinterlacing.
    Enable Gouraud shading for TextureTriangles() by default.
    Rewritten chipset probe function (faster).

commit 66e7126ad6f6b80cc48d2549d9450ff3f6219ab8
Author: Mike Emmel <memmel@directfb.org>
Date:   Fri Jul 15 17:43:40 2005 +0000

    Added vncserver url http://libvncserver.sourceforge.net to config warning

commit 4b7b953d5643b18787aa6de11b6e15abf9f841ac
Author: Mike Emmel <memmel@directfb.org>
Date:   Fri Jul 15 17:33:10 2005 +0000

    Initial checkin of the vnc backend please let me know asap if I've broken anything.
    Known bugs: The cursor support is munged

commit 42ecca08e6e709f0b7224c451af0a2a926d133aa
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Jul 15 13:30:19 2005 +0000

    When a layer is re-configured for deinterlaing, the corresponding IDirectFBSurface's capabilities aren't updated to include DSCAPS_INTERLACED flag; therefore test for DSCAPS_INTERLACED flag on the wrapped CoreSurface's capabilities in SetField().

commit 2c6f8ba4b41a81b0f92ba3dd44de0c20963b0a2e
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Sun Jul 10 16:26:50 2005 +0000

    there's no more need to look for sisfb.h

commit 72e427039a3ca1363e5d8d88cdc9eb6ea6ffa3bb
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Sun Jul 10 16:25:41 2005 +0000

    compatibility stuff for newer fb driver versions

commit 5f051dfd18bc883ea1b02b0c15c52d48021f1841
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 10 00:11:37 2005 +0000

    Fixed another warning.

commit 12b84cd92ff27815878ba78b4a4b407fcc13ea60
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 10 00:06:40 2005 +0000

    Fixed signedness warning.

commit fd89d932c541d6f58071d74f6cec928eb021ce3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 8 06:33:44 2005 +0000

    Use "signed char" explicitly to fix kerning on PPC, thanks to Uli!

commit 9dc3b8ca38aa49ce6ad94a3a4e92ae065f443786
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 1 21:17:05 2005 +0000

    Added:
    
    #define D_FLAGS_ASSERT(flags,f)    D_ASSERT( D_FLAGS_ARE_IN(flags,f) )
    
    static inline int direct_util_align( int value, int alignment )

commit 4e2c8c2c55792002b9f2afffc00e6541b985dd03
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 1 21:15:33 2005 +0000

    Fixed direct_try_open() not always honoring error_msg parameter.

commit 1612a12f08391e0ba0544e550b4672eaf77694eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 24 09:19:59 2005 +0000

    Added "Claudio Ciccani <klan82@cheapnet.it>" to main authors,
    welcome number five and thanks for your appreciated work :-)

commit 5149df555c64d9eaff82be596ba3e7215ff13229
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jun 22 21:48:20 2005 +0000

    make w key work. it was missing in the translation code

commit 3d5830470cb937129c910d86646b01a245c8f256
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 20 20:13:58 2005 +0000

    Fixed warnings.

commit 26add1263a82c1e3afe26214e194a1614e83cd26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 17 00:20:01 2005 +0000

    Fixed mouse motion compression to eliminate massive input lag, e.g. cursor movement.

commit 37b2730d7f8eb85afee130cb7e547738da3a8387
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 17 00:10:57 2005 +0000

    Commented out locks as they shouldn't be needed, but cause a dead lock.

commit 5c9e7b15656acbb8eabe71c6deb84611ea4b09ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 16 22:13:43 2005 +0000

    Fixed typo.

commit 0ec583a0c98d4c54d1b20c2677cbf3349d44eebb
Author: Martin Ltken <ml@directfb.org>
Date:   Thu Jun 16 20:58:36 2005 +0000

    Disabled default X11 cursor

commit e181bb7b3f76f56fdcff2ce055a756d59b117618
Author: Martin Ltken <ml@directfb.org>
Date:   Thu Jun 16 20:18:53 2005 +0000

    Removed printf(ML: spam

commit ebdb54b2406dac2093fb1f56213add6b3f4e57c8
Author: Martin Ltken <ml@directfb.org>
Date:   Thu Jun 16 19:24:53 2005 +0000

    Fix input mask and missing input y-axis in mouse input

commit 1b08d287b092e90159a06fcf6c265c5aedc645d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 14 12:49:53 2005 +0000

    Fixed formatting.

commit e702230692348ed50c59808040db79f6e558848b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 14 08:31:11 2005 +0000

    Make sure that "dtest" is excluded from static lib.

commit e14e1dd7d70a4d7a5da9dd26a92acfb1afbba71a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 14 01:00:03 2005 +0000

    Option "-s" additionally shows the shared memory file size, now.

commit d28a12f0512ff8f1a810328262be6a60ef18e20e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 14 00:59:07 2005 +0000

    Put shared memory file size into heap structure for tracking.

commit 3924365b5ed08e5b4ec5a3926f22948e678647cb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 10 18:38:08 2005 +0000

    Limit number of weights to 64 in x and y direction for down scaling.
    Without this limitation down scaling to 1x1 or similar could take minutes
    on embedded platforms.

commit 43b15696735f1836f3572fa6b7d0e5d7c53af5b3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 10 08:23:46 2005 +0000

    Rendering A8 font onto A8 should be fixed now.

commit 10f1b356a0678fcacbbe4d5b0c189b86307de813
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 8 20:04:43 2005 +0000

    Removed Bop_8_Kto_Aop overkill.

commit 8a7d402bc0b709e0329da8f90f30dc8160b3616f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 8 18:26:48 2005 +0000

    Use double quotes if header is in same directory.

commit 11ab42ed3296a4cd698df888fa2f6817a24421a5
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jun 5 10:33:01 2005 +0000

    Rewrite of the nvidia driver.
    
    Driver structure:
    - Follows a common driver template (i.e. Matrox driver);
    - Added a basic list of registers.
    
    Hardware support:
    - Overlay supports Deinterlacing;
    - WaitForSync no longer burns the CPU (but actually requires a 2.6 kernel);
    - Decide texture buffer size according to available video memory
      (<= 16MB -> 512Kb; 32MB -> 1024Kb; >= 64MB -> 2048Kb).
    
    Switch to version 0.5.

commit 2c59b963d12aa4f43663c07385f6a73f0a90b14f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 2 18:27:18 2005 +0000

    Started work on the decoration framework.

commit 009dc5d39dc6c46118561f351c38089bdb76ab75
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 2 11:00:49 2005 +0000

    Applied path from Sylvain Meyer <sylvain.meyer@worldonline.fr>, thank you!
    
            Hi,
    
        I did a small patch to fix minor issues with i830 gfxdriver. Now the
    driver can more nicely live with the linux intelfb driver. Now it can be
    used even when intelfb has accel set to 1, just in configuring in
    /etc/fb.modes "accel false" to disable console acceleration when
    DirectFB is working. To work, the last intelfb patch is needed. I just
    sended it to linux-fbdev mailing list and Andrew Morton and it should be
    in the next mm series of linux kernels.
        I also fixed the ovlSetColorAdjustment function and now brightness,
    contrast and saturation settings are enabled.
    
    Regards
    Sylvain

commit 33081a8e6db1e587b54bcde5a6daa961ed726987
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 2 10:37:12 2005 +0000

    fixed warnings

commit 0c7a6efd8ec219e2996f62b40adbb1bbb648198d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 2 10:34:08 2005 +0000

    Fixed warnings.
    
    Changed statement with no effect (comparison) into an assignment.

commit f3ae3806a88b6adc71a09952f4f508430e993823
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 2 10:33:17 2005 +0000

    Temporarily add "-I/usr/X11R6/include" when checking for "X11/X.h".

commit 6d443af1c64d3123d81c8f52e3d4cdea69cf563b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 1 12:03:49 2005 +0000

    Fixed A8 font rendering onto areas that are not black.

commit 56d0ada371c14b9f249f447272fd36f4d1055f6d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Jun 1 09:45:27 2005 +0000

    Acceleration for YV12/I420:
      Drawing Functions:  FillRectangle
      Blitting Functions: Blit,StretchBlit,TextureTriangles
      Drawing Flags:      XOR
      Blitting Flags:     BLEND_COLOR_ALPHA

commit d31dd0add4e2cf5263bc719e9fd8dbcd7a23d28e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 31 07:02:18 2005 +0000

    Hot fix crash during initialization.

commit c2783ae43904e03b5f5f2c7bd29f1121a189c2f5
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 22:49:44 2005 +0000

    - now RGB16 really works (and ARGB1555)

commit 664a475dbe0d0cb449ae871555abfd26697fc78b
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 21:50:45 2005 +0000

    - support for pixelformats other than ARGB

commit a7e2d5564bfc2eea94cb0f8c95098ed03348e7e8
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 21:26:37 2005 +0000

    - added XInitThreads() call
    - added README
    - disable x11 system by default

commit f372777c73acd1a562a7def9e6b783527b8edce8
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 20:03:20 2005 +0000

    added -I/usr/X11R6/include to X11_CFLAGS

commit 2980dba3676336d8b2e5da460cbf5f609486c777
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 16:55:22 2005 +0000

    - fix to make separated input driver work

commit 41bcb86a5ce284b8d95ec32cd4215177f3d6659e
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 14:08:58 2005 +0000

    forgot $(X11_DIR)

commit 1ce7281f393d260f48669615e7b9b4d077c8301d
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 30 13:57:44 2005 +0000

    - added X11 system from Martin Luetken (nitram at lutken dot dk), thank you!
    TODO: add support for non-24bpp modes

commit 7610d5e0af22b232a5c9c1b156b646fd04069f0d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed May 25 09:40:44 2005 +0000

    Always flush cache when switching to 2d/3d engine.
    Disable 0-1 pixel clamp.
    Set framebuffer location according to rdev->fb_offset.

commit 759f598fa39811e0f805089886341e88f0c87189
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 22 20:56:46 2005 +0000

    Added "bool error_msg" parameter to direct_try_open(). Used to suppress
    the error messages when fusion_init() probes for a new world.

commit 7d1a353886b857e9915d6cf355768751af8a8dc0
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri May 20 16:48:01 2005 +0000

    Added errorcode DFB_EOF.

commit 61fd3505622e262051ddebcb275af1e6b0f883d5
Author: Mike Emmel <memmel@directfb.org>
Date:   Mon May 16 01:44:39 2005 +0000

    Changed fake keyboard mapping to actually work
    the old code was sending codes not unicode chars
    This is simpler but correct and lite works now
    so I am going ahead and checking in.

commit fa3bbf08c1890f971e62d66ac0445071ba61b597
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 15 00:27:27 2005 +0000

    Some fixes related to touchpads.

commit b658a4c972b4f817b730e499c7422cc78aefbcc0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 11 09:39:04 2005 +0000

    Merged back multi app fixed from i830 driver. Not tested! Compiles at least...

commit cb5b1fda6c5c39a01aa1365d9c0aca40e259f95a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 9 18:29:52 2005 +0000

    Use the window stack of new contexts.

commit 104772d2d3b422a3e274fa37cf22c686c9c234d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 9 18:19:49 2005 +0000

    It's allowed to create and use windows in exclusive mode,
    showing the own windows only, of course.
    
    Changed EnableCursor() to be allowed in exclusive mode, too.

commit d65695f814a21eeba45eb64e8fa0ff028091f33d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 6 11:04:49 2005 +0000

    test

commit 732497b3359f0dae5731c7ccfc8db2787bfd0a26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 6 11:02:22 2005 +0000

    test

commit f89763d7dd06fb39b8fb6a8ae0600c0a8eb23c12
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 5 11:18:42 2005 +0000

    Try old style device names, too.

commit 5e6750dce07d521e78c5113bc3e10bffcaa36c07
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 5 11:17:08 2005 +0000

    Fixed multi application support, but it only works with root privileges so far.

commit 78f1268876451d527107e987f9652841b793bffe
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu May 5 10:09:29 2005 +0000

    do not build i830 and savage driver if sys/io.h is not available

commit b0f8fffd3b3d8b830fc85c49df6e1c65e6bbff05
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed May 4 16:16:04 2005 +0000

    Improved Dacc_YCbCr_to_RGB_MMX.
    Cosmetics.

commit 8a2d5984b2cb204035b7d15ad3192011aef9f2ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 3 06:55:10 2005 +0000

    small fix

commit b43af50859f73e181393d470679bf5cf0d4ab795
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 3 06:48:33 2005 +0000

    Added options "--system=" and "--wm=".
    
    Enhanced help text.

commit f2d3d6d7dfb011c58dc6dc2c39b35c5d2025e411
Author: Marcel Siegert <mws@directfb.org>
Date:   Mon May 2 19:47:34 2005 +0000

    added 2 special keys for dm 500 remote-control;

commit 5af316dd5e494fe50d7529cb7cb8a25f77bd3431
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Apr 30 14:17:22 2005 +0000

    Use tables generated by yuvtbl-gen for YCbCr<->RGB conversion (essential for colorkeying).

commit efe1c9d3639d97791087c12564ea4ad09358690e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Apr 30 14:14:40 2005 +0000

    Completed support for YUV422:
    apart from Colorization, all blitting/drawing flags are supported
    and we can convert YUY2<->UYVY.
    
    RGB->YCbCr is supported, too.

commit b35609b62a21ad8f5470f34de23688b3578ace27
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 25 09:09:08 2005 +0000

    Commented out usage of DST_PREMUTIPLY and DEMULTIPLY for now.

commit 8d06837618e40a8bf3828db72f3d23d9a73c0e11
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Apr 22 15:34:30 2005 +0000

    Fixed YUV422 clipping and blitting coordinates.
    Simple blits with src colorkey.

commit 641cff3727a03c0b8aa21079861374d3a04bee40
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Apr 20 09:18:19 2005 +0000

    Fixed a bug in dfb_window_set_opaque (config.opaque.y1 instead of config.opaque.y2).
    SetOpaqueRegion works again now.

commit 065afbf721c52b45ea536915af6c0fab05635540
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Apr 19 17:45:16 2005 +0000

    Fixed 2d<->3d engine switching.

commit 22955115b0b1be536020b5b0ab45078bcde34424
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 12 14:18:59 2005 +0000

    Commented out checks that avoided hw state updates also when they're needed.

commit 852f0ca9dbbf988c2e9c7d1fe40e3b32560aa8b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 12 14:05:16 2005 +0000

    Use iopl(3) and check the return result before doing port IO.
    
    FIXME: Check out how setting via MMIO works.

commit 3b1dd3accd70bb2c430e4f7505a86f7b176dddf0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 12 13:45:17 2005 +0000

    Removed opacity from layer context, using opacity within region config only, fixes missing updates.

commit da974b0cb430b5141c414e21add1b119d8a72bd5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 12 13:39:16 2005 +0000

    Show max. axis and button if appropriate.
    linux_input currently reports wrong values (num-1 instead of the highest one).

commit bb4e9d0377ef3eabbbf46ae22f232b8275b42e14
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Apr 12 13:17:37 2005 +0000

    Modify surface's capabalities according to layer options after clearing them (not before!).

commit 241d650b3f13f7bc58765feb675e98faec1ec3ec
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Apr 9 09:42:58 2005 +0000

    DLOP_OPACITY.

commit 19d6e2152b49657c045ad9e5b2a671a698c5c0e2
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Apr 7 13:10:45 2005 +0000

    Sleep while waiting for vertical retrace.

commit 97efc5f68495a30da5b8321dc4b9d94b7c5a72a7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 7 07:09:30 2005 +0000

    Added DFBAccelerationMask to directfb_strings.h.

commit f0de4f581629674756c12ee4c78c4b57e04dd063
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 7 06:33:38 2005 +0000

    Added DFBSurfaceDrawingFlags to directfb_strings.h.

commit 67890d66a5266ea58787a0df069164a8610b30de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 6 21:39:18 2005 +0000

    Replaced driver vendor "convergence integrated media GmbH" by "directfb.org".

commit 30ddbe9d6368a95aa6dd91f2cdcb5571d9fa5574
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 6 20:52:35 2005 +0000

    Replaced IDirectFB::GetCardCapabilities() by GetDeviceDescription()
    and DFBCardCapabilities by DFBGraphicsDeviceDescription which contains
    additional information like device and driver name, version etc.

commit 41ed91edb7afeb274d679f120820e589829f0d37
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 6 18:23:48 2005 +0000

    Removed a pre-0.9.0 artifact: CardResult.

commit 2563d559165dd9dccbe49e7264e06315a7054ea4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Apr 6 17:50:39 2005 +0000

    Added support for ARGB1555,RGB16,RGB32 and ARGB.

commit 3ce4b48b4d6dcb259eace2372ce6783646261bb7
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Apr 6 12:35:50 2005 +0000

    ARGB4444 supported as destination format.
    DSBLIT_SRC_PREMULTCOLOR.
    Fiexd overlay coordinates for RV250 and newer (offset x by 8).

commit 6b7838034a93668e8fe83e1a40f72ad7189e3f33
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 6 05:33:35 2005 +0000

    D_ARRAY_SIZE() is a signed int now (for simplicity).

commit 18715d24665697ba1cdf69ba8566b6200830d229
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Apr 5 17:24:56 2005 +0000

    Dropped down RS200/RS250 chipsets (R100 based).
    Added RS300/RS350.

commit a2afb7f3712abfe799389641c9e37db83ed34f02
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Apr 5 10:37:08 2005 +0000

    Still on destination colorkey: green and blue were inverted.

commit f5c6c9c41902c93c6b8499aa18cbf31a5cccd393
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Apr 5 10:03:28 2005 +0000

    Fixed destination colorkey calculation.

commit a7d313bc62f7c4cbc32c40d8bcfc7711ef2ff7d9
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Apr 5 08:56:35 2005 +0000

    Removed DLCAPS_SRC_COLORKEY and DLCAPS_DEINTERLACING, they were tests.

commit 3e408bd2ba0b41f377c4aca6b3a9357fb03876e8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 5 08:29:33 2005 +0000

    Fixed minor typo (replaced "," by ";" in for statement).

commit 880393adf42681de7c1a2837396f84c2c5eb78d9
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Apr 4 20:30:49 2005 +0000

    New driver for ATI Radeon R200 based cards.
    
    Accelerates FillRectangle,FillTriangle,DrawRectangle,DrawLine,
                Blit,StretchBlit,TextureTriangles.
    Supported Drawing Flags: Blend, Xor.
    Supported Blitting Flags: Alphablend, Coloralpha, Colorize.
    
    Supported Destination Formats: A8, RGB332, ARGB1555, RGB16, RGB32, ARGB, YUY2, UYVY.
    Supported Source Formats: A8, RGB332, ARGB4444, ARGB1555, RGB16, RGB32, ARGB, YUY2, UYVY.
    
    Overlay supports YUY2/UYVY/YV12/I420 formats, color adjustments and DST_COLORKEY.

commit a821c072642d5e859140a6550761eb73f68b60f8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 2 21:22:11 2005 +0000

    If the font format is ARGB, use premultiplied font surfaces.
    Extracted common font state code into setup_font_state().

commit bc1a3eb661a1db8ca9efea45996bf35eb75538e0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 1 07:07:10 2005 +0000

    Use DECALDIS for A8 with colorizing though.

commit 5d4f5409ce683ef88fafe25b3a159c11735fff77
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 1 07:00:42 2005 +0000

    Implemented DSBLIT_SRC_PREMULTCOLOR using the Color ALU. If it's already
    used for colorizing, simply modulate the color values with the alpha,
    otherwise overwrite them.
    
    Set DECALDIS if and only if TMODULATE is NOT set.

commit 7a4f301c3be38cb9c512e8c63477b2f21a12fe68
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 21:24:36 2005 +0000

    If the destination has premultiplied alpha do real Porter/Duff SRC_OVER
    composition for glyphs.

commit 6fcbacbae9e210f2ae294b73aaba7b1cd485b430
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 21:10:30 2005 +0000

    Changed Bop_a8_set_alphapixel_Aop_argb() to be a fast path for real SRC_OVER
    DrawString() that uses DSBLIT_SRC_PREMULTIPLY and DSBLIT_BLEND_ALPHACHANNEL
    with SrcBlend = ONE and DstBlend = INVSRCALPHA. Other formats will follow.
    
    Fixed DSDRAW_SRC_PREMULTIPLY if used used without blending.
    
    Implemented DSBLIT_SRC_PREMULTCOLOR.
    
    Added optimization for drawing blended with Src = ONE, Dst = ZERO.

commit afce0acbceaeb08afdb8deb313b6050a489e8884
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 20:53:11 2005 +0000

    s/0/DSCAPS_NONE/

commit 8fce05739333086d0300c81733f51234c3ffa68c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 14:05:43 2005 +0000

    Take over DSCAPS_PREMULTIPLIED from the configuration.

commit 25dde4b7ecd26d7268184a3a3de1c60a58211cbb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 14:04:22 2005 +0000

    Use DLCONF_SURFACE_CAPS if DSCAPS_PREMULTIPLIED is
    requested for a fullscreen primary.

commit 5981ec02e12d608029257d95c1d13cc22f76830b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 13:24:37 2005 +0000

    Implement window opacity (Ac) for premultiplied windows
    by using DSBLIT_SRC_PREMULTCOLOR.

commit 349072fb98934ce246f7624b6a45b28cf439c4b7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 13:21:52 2005 +0000

    Added DSBLIT_SRC_PREMULTCOLOR which modulates the source color with the
    color alpha value only.

commit a9ea5dacf7a8a1f443e80fbf30b4e941bcdef4f0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 08:58:31 2005 +0000

    Changed an assertion in _fusion_reactor_process_message() to an assumption for now.

commit c1dde73d573555705119fd170174dc583b232e20
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 08:53:56 2005 +0000

    Added D_MAGIC_ASSUME.

commit 3742de423610c8c436d6904db29ac3c79b401648
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 08:26:52 2005 +0000

    Added notes about the coefficient 'Ac' not always working properly, yet.

commit 24178e5190498d0e1fc89894623a90af400a1fb3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 07:45:42 2005 +0000

    Support premultiplied cursor shapes.

commit 07c2da34296a12adc33fe89d5f20348487534579
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 31 07:43:13 2005 +0000

    Show 'premultiplied' surface capability.

commit 08b853e5cec53d1081702cdf879be8d976f65c8b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 30 16:31:47 2005 +0000

    Fixed recent 24bit fix. Maybe the patch applied at the wrong offset?

commit 5cc35122fda7bccfb294948ecc8ce308254c1ae3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 30 15:56:24 2005 +0000

    reverted (wrong file commited)

commit a06091abaae11be3cf935aabc1a2a89d2859c808
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 30 15:54:45 2005 +0000

    Premultiply image data when loading into premultiplied alpha surfaces.

commit 9434edc4676c577286f2cfa105c96b78bd49da60
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 30 12:39:16 2005 +0000

    Handle (non)premultiplied window and layer surfaces.
    Always use compliant Porter/Duff SRC_OVER.
    
    Different compositing methods are used depending on the destination format.
    
    
    DESTINATION WITH ALPHA
    
    /*
    Cd = destination color  (non-premultiplied)
    Ad = destination alpha
    
    Cs = source color       (non-premultiplied)
    As = source alpha
    
    Ac = color alpha
    
    cd = Cd * Ad            (premultiply destination)
    cs = Cs * As            (premultiply source)
    
    The full equation to calculate resulting color and alpha (premultiplied):
    
    cx = cd * (1-As*Ac) + cs * Ac
    ax = Ad * (1-As*Ac) + As * Ac
    */
    
    dfb_state_set_src_blend( state, DSBF_ONE );
    
    /* Need to premultiply source? */
    if (! (window->surface->caps & DSCAPS_PREMULTIPLIED))
    .     flags |= DSBLIT_SRC_PREMULTIPLY;
    
    /* Need to premultiply/demultiply destination? */
    if (! (state->destination->caps & DSCAPS_PREMULTIPLIED))
    .     flags |= DSBLIT_DST_PREMULTIPLY | DSBLIT_DEMULTIPLY;
    
    
    DESTINATION WITHOUT ALPHA
    
    /*
    We can avoid DSBLIT_SRC_PREMULTIPLY for destinations without an alpha channel
    by using another blending function, which is more likely that it's accelerated
    than premultiplication at this point in time.
    
    This way the resulting alpha (ax) doesn't comply with SRC_OVER,
    but as the destination doesn't have an alpha channel it's no problem.
    
    As the destination's alpha value is always 1.0 there's no need for
    premultiplication. The resulting alpha value will also be 1.0 without
    exceptions, therefore no need for demultiplication.
    
    cx = Cd * (1-As*Ac) + Cs * As*Ac  (still same effect as above)
    ax = Ad * (1-As*Ac) + As * As*Ac  (wrong, but discarded anyways)
    */
    
    if (window->surface->caps & DSCAPS_PREMULTIPLIED)
    .     dfb_state_set_src_blend( state, DSBF_ONE );
    else
    .     dfb_state_set_src_blend( state, DSBF_SRCALPHA );

commit 3ae97148f35c2c7b1b17227e4de5a779cfa96931
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 29 11:11:23 2005 +0000

    Added dfb_gfxcard_invalidate_state() which sets the state pointer to NULL
    and therefore forces a full SetState() before the next operation is executed.

commit 172da343256298842822cf5271e96712728e1ef2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 29 10:42:16 2005 +0000

    Fixed plane multiplier of NV16.

commit 236c0f4c2f7bf60392a757c05d43388fcb22ef85
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 27 19:33:45 2005 +0000

    Added DirectFBSurfaceBlittingFlagsNames.

commit 83b29735dff50a759a274f6cb55eb1a8e16c445c
Author: Marcel Siegert <mws@directfb.org>
Date:   Sun Mar 20 20:21:01 2005 +0000

    build fix for default wm
    __u8 p was declared at wrong place;

commit 0a4827266e63816c853634b3c1e7873aee7fc4e1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 20 13:08:04 2005 +0000

    Applied patch from Mark Salter <msalter@redhat.com> to fix 24bit support
    on big endian platforms. Thanks!

commit a3b664abec79c239ba78a7e1b6c65a2454dd777f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 20 13:02:51 2005 +0000

    Applied patch from Ivan Daniluk <ivan@shvydko.ua>:
    
    Hi!
    Recently I've got strange behavior with MuTouch input. The trouble was in
    packet reading routine - in some cases(very fast touch-untouch) packet was
    read in two passes and was interpeted as two events with wrong coordinates.
    In attached patch I've added filling packet with data until it's size grows to
    desired packet size.
    As well, added syncronization check for each packet - it will prevent some
    weird situations on misconfigured devices.
    
    Cheers,
    --
    Ivan Daniluk

commit 7f042827957f8ee4f17b768d6a49bc0c868e10ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 20 12:59:49 2005 +0000

    Maximum number of simultaneously pressed keys increased from 8 to 16.
    
    Thanks to Ivan Daniluk <ivan@shvydko.ua>.

commit 17894090d21ffcba620c4bf28b334ea56ec37d97
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 20 12:58:34 2005 +0000

    Use D_DEBUG_AT.

commit 6be13f5c78a9d646642585d78cb85474001a1d2e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 18 23:33:01 2005 +0000

    TODO
    
    Move config system to libdirect with more features.
    
    Write well documented driver skeletons.
    
    Add core cursor component with animated shape support and better integrated
    changes caused by entering different windows.

commit 3b32a47605451693ea0b5b4bd81210de9f954dec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 18 23:30:31 2005 +0000

    Hotfix to show the cursor after entering a window with a cursor that is made
    invisible by another application.

commit aa1a1b12f2171d5bf8c0686a36d5f1f1f00c6b99
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 17 10:28:40 2005 +0000

    Allow predefinition of FREETYPE_CFLAGS and FREETYPE_LIBS outside of configure.

commit c677d13005edbfcb3036cd7ccbc4a1bb9e87a0d7
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Mar 12 09:49:41 2005 +0000

    Added macros to convert ARGB1555,RGB16,RGB32 to ARGB2554,ARGB4444.

commit 0ba7ce64a05cbf8ef5521d928665d8f2232b3d21
Author: Mike Emmel <memmel@directfb.org>
Date:   Thu Mar 10 17:43:37 2005 +0000

    Hide the SDL cursor so DirectFB one shows

commit e11edb46b9308e4adfdba94b05114cd10e76c2fd
Author: Mike Emmel <memmel@directfb.org>
Date:   Wed Mar 9 17:57:39 2005 +0000

    Added support for fake scancodes this needs to probably move to a more generic layer so it can be used by backends that don't provide scancodes.

commit 41d3c4d990b121f04aeecb61d1b7438b5185fcbd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 9 15:21:55 2005 +0000

    Build driver only if FB_ACCEL_I830 is defined in <linux/fb.h>.
    
    Probe for FB_ACCEL_I830 in the driver.

commit d4c0b18ccae20b075efe11cbcc970588177ec176
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Mar 9 10:38:38 2005 +0000

    Made the driver work with the new nvidiafb framebuffer driver.
    StretchBlit() on A8,LUT8,RGB332 (>= NV20).

commit 4a48af0d9fae66b86b47a723b39704f8f735c209
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Mar 7 21:45:46 2005 +0000

    Cosmetics.

commit abb420e29a0f063d3ced3c78ed9d1f26f411878f
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Mar 7 21:37:49 2005 +0000

    Some mach64_waitfifo() calls were missing.

commit df07da0371b6a4ebc2a8cbbb9a6254a6b57d896c
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Mar 7 21:34:15 2005 +0000

    Reset HW_DEBUG in EngineReset().

commit 29aba4d3d46d404803741113392387735c1b00a9
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Mar 7 21:25:23 2005 +0000

    Reset otherwise unused registers in SetRegion() when CLRCF_ALL is set instead of InitLayer().

commit 4188f67e31d54c46f03c1759422639302d96a75b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Mar 4 14:25:56 2005 +0000

    FillRectangle(),DrawRectangle(),FillTriangle(),DrawLine(),Blit() on LUT8,RGB332 and A8.
    StretchBlit(),TextureTriangles(),[DrawString()],Alphablend and Colorize from A8 (>= NV10).
    Alphachannel blend for ARGB1555.

commit 02702315c30b0e29a450d1a6c82a9b220a7484d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 4 13:34:46 2005 +0000

    Implemented destination color keying.

commit 3ea54379117258e7781f218b7aa965fac848bc3a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 3 17:33:24 2005 +0000

    Fixed AltGr.

commit 65aca601076923a8f217664eb486c165dd1372ee
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Mar 3 11:07:00 2005 +0000

    Always use alphamode = ALPHACHANNEL.

commit b97fd4a79e6948bf83d3f28a23e82e0fa42dea3b
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Mar 2 23:36:17 2005 +0000

    Don't care about LOG_MAX_INC.

commit 8f0f3e61c75b11a8c012985ebfaf01c8706a5636
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Mar 2 21:10:49 2005 +0000

    Fixed pixelformat=NV21 option.

commit fad49386821bc431bc960e8f6571f9cce0b1a35c
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Mar 2 21:02:57 2005 +0000

    Fixed inverted YV12 colors.

commit 6440e30ed0457e09fdd8d20ac00ff562a5ad0193
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 2 12:45:57 2005 +0000

    Keep the original display offset if no mode has been set,
    e.g. just running "dfbinfo".

commit 73b9b419dbe9967fc982008aa38a386c4b12a089
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 2 12:42:16 2005 +0000

    When restoring the video mode during shutdown, set xoffset and yoffset to 0.
    
    This fixes wrong scroll offset after quitting a DirectFB master started as
    a normal user from a console.

commit fd83d2275755b7b9272f6c390ca73d89faeb0dc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 2 12:36:24 2005 +0000

    Improved description of required permissions to devices etc.

commit 8a0bc0d96394f13d0ba78edd3c5d8e3b67419349
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 1 15:53:42 2005 +0000

    Big acceleration code update:
    - Scaler/3D acceleration now works on older GT chips. Tested on Rage II+
      and IIC.
    - Splitted SetState() to GX/CT/VT and GT variants.
    - Added scaler source size check. Limits found empirically.
    - Removed explicit fast fill/block write code. Use the automatic feature
      found in 3D Rage Pro and newer chips instead.
    - ARGB4444 support for GT chips.

commit b9311e7a29e8ea613bf87d67cacc4459ba5be555
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 1 15:49:47 2005 +0000

    Big overlay code update:
    - 3D Rage and 264VT(2) apparently have somewhat different overlay/scaler
      registers. Details were taken from the XFree86 ati driver.
    - Improved surface size and format limitations. Limits were found
      empirically and since I don't have every mach64 chip in existence some
      limits may still be wrong.
    - Take ECP (scaler/overlay clock) diviver into account in horizontal
      scaling.
    - Added support for doublescanned and interlaced display modes.
    - Check updated flags in SetRegion() and try to update only the
      necessary registers.
    - Don't advertise DCAF_BRIGHTNESS and DCAF_SATURATION on older chips.
    - Added support for DLOP_DEINTERLACING.

commit 18fd75329b1eed28a7d48b0fc7f1ffa5936cd9d3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 1 15:46:01 2005 +0000

    Made LCD register access work on 3D Rage LT.

commit 6cc9ffff512c32b84fe3198b26e6d4a86431b8e6
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 1 15:44:50 2005 +0000

    Improved chip type detection.

commit 52321fdf56ba0c4c877ef8317b61e707f82fb2b1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 1 15:42:55 2005 +0000

    Cleaned up register definitions and added all known register names.

commit a8024d861d8cfad53c5c933064c14a74204357b6
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Feb 28 10:31:44 2005 +0000

    Added support for system to video memory blits.
    Improved TextureTriangles() performance.
    NV30 supports StretchBlit(), blit with format conversion, alphablend and colorize.
    Switch to version 0.4.

commit d4e3db4fdcec5ac5098a5766c93e40473a799969
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Feb 28 10:26:14 2005 +0000

    Added support for system to video memory blits in hardware.

commit fa6d3ad547ea5bf6d69144310b962e0522545eb9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 28 09:47:07 2005 +0000

    0.9.23 /o\

commit 54719ef051990718ddb5b002d38a49cf338d6588
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 28 09:40:58 2005 +0000

    Added IDirectFBSurface::DisableAcceleration( DFBAccelerationMask mask ):
    
    If any function in the mask is set, acceleration will not be used for it.
    Default is DFXL_NONE.
    
    
    Added D_FLAGS_INVALID to check if a flag set contains invalid flags.

commit c77446ff9485e5aec0f0acd15f58a63225420b4b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 28 09:11:59 2005 +0000

    Fixed D_FLAGS_ARE_IN.

commit f30c82bc7f789121f7041fe54a0c721edae33d93
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Feb 27 18:43:52 2005 +0000

    Added DLCAPS_LEVEL to layer capabilities,
    thanks to Stefan Lucke <stefan@lucke.in-berlin.de>.

commit e630e09d4d858f11cc5ceca7ad595f2b4a415481
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Feb 27 17:49:44 2005 +0000

    Updated to linux 2.6.10.

commit 3cc3d7af1229362fe15be04e9b746fc10ec17c59
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Feb 27 12:13:38 2005 +0000

    Updated patch.
    Fixed NV30 initialization.

commit 42327305b6ce45781f50c1de139c455ce237554d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Feb 27 10:57:01 2005 +0000

    Made DIKS_PRINT work.

commit a72ec467bf90d01037fd39a2973e130b188aae17
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Feb 27 10:43:44 2005 +0000

    Don't try to use already grabbed devices.

commit bf9f78dd373dfdafcc84ee9bef93505085adc53f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 24 14:52:00 2005 +0000

    Remove directfb_keynames.h and directfb_strings.h during "make fistclean".

commit 8d9e4b13fd5fd33d2de5ace53d4c41857db0e7c3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 24 14:35:30 2005 +0000

    Put all builddir includes in front of the srcdir includes.
    
    Still need to know if something like EXTRA_NODIST exists.

commit da4f0a83a314bafd31de8427f08406281edcd017
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 24 14:13:11 2005 +0000

    Use "$(top_srcdir)/include/" prefix to file argument of mknames.sh.
    
    Thanks to LUDER Jacques <JACQUES.LUDER@THALES-TRANSPORTSERVICES.COM>.

commit e33942c6deb94c490914593d362dda87cbef15e6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 24 14:05:05 2005 +0000

    Summarized changes for 0.9.22 and generated new ChangeLog.

commit 086837c7119bc3650dcb6b122da593808d853fe8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 24 14:03:44 2005 +0000

    Fixed EXTRA_DIST.

commit 073536ce77de3eedebd66d52b41346c958f900c1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 23 12:24:15 2005 +0000

    Show the correct device in error messages.

commit 9b5dad02d6fae560a2e7b9f746a7c9120ae915fc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 23 10:57:33 2005 +0000

    Added option "h3600-device", keeping the default of "/dev/ts".
    
    Added option "mut-device" which must be used to enable the driver.

commit 1c04008cf36c0689fe4ce15f745c3f6489302e3c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 23 10:09:20 2005 +0000

    Put this around bool enum declaration instead of #ifndef __cplusplus:
    
    #if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)

commit 3363495835d87a1316d6bbd23a797b5276d8dc28
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 23 10:06:14 2005 +0000

    Restore color adjustment when (re)activating a context.

commit 33286a9809a0b41bf2c92df8dae4bea6300148c7
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Feb 22 14:13:32 2005 +0000

    Swap video buffers in single buffermode, too.

commit 583bbb005a3a321a7cea9eece0e804a15503f4f1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 22 14:12:49 2005 +0000

    Activate the most recent context instead of the primary context when the current context is removed.

commit b3d08c2d1edc7138b92b2debabb2dacaee6ee872
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 22 12:57:05 2005 +0000

    Added IDirectFBDisplayLayer::SetScreenRectangle().
    
    Rearranged some function pointers in IDirectFBDisplayLayer.

commit 2630f8fee3791fe334322ade26f96c1c873843ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 22 12:28:39 2005 +0000

    Added DSECAPS_BRIGHTNESS, DSECAPS_CONTRAST, DSECAPS_HUE, DSECAPS_SATURATION.
    
    Added DSECONF_ADJUSTMENT to DFBScreenEncoderConfigFlags.
    Added 'DFBColorAdjustment adjustment' to DFBScreenEncoderConfig.

commit bc1710e8b12c7ad14e723e81a3cb4a92f5837668
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 22 12:26:05 2005 +0000

    Check capabilities in SetScreenLocation(), SetScreenPosition() and SetLevel().

commit c4e04163827fff873a12604f34e3aba023343312
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Feb 22 11:40:34 2005 +0000

    Do not round up X coordinate for 422 formats.

commit ac35fd91cc772169109e54502c5a333e07876d3c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 22 11:31:27 2005 +0000

    Fixed DLCAPS_ALL.

commit 244e11fced4d3996f6b45bf9bb7008fe6fc833a0
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 22 09:53:08 2005 +0000

    YUY2/UYVY FillRectangle(), Blit() and StretchBlit().

commit 87c020414496a5727e484b9055657b1a40b17af7
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Feb 21 21:07:03 2005 +0000

    Removed DrawRectangle(),FillTriangle(),DrawLine() for YUY2/UYVY (don't work properly).
    Added an hack to do StretchBlit() on YUV422 (result is almost acceptable).

commit a4a8f50ac360a9666a89d65e0c4614fc3627b30d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 21 13:36:36 2005 +0000

    Implemented hw window resizing.

commit 338a7e914999c16669ccfb80b4506dbc6e74acb1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 21 12:06:30 2005 +0000

    Propagate error to application if window movement failed.

commit 9913d1eb31b8b8562bf544ac8151fce835379174
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 21 11:36:01 2005 +0000

    Handle error if dfb_layer_region_set_configuration() failed to move a hw window.

commit 9137fccebf1fdb3afb3555c97dd815ad6fef612e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Feb 21 09:10:25 2005 +0000

    No longer return a surface stored in system memory for YUY2 and UYVY;
    return directly the video surface instead

commit 12d9d6dbc6e30545bf2b8035b937051694ac1788
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Feb 21 09:08:56 2005 +0000

    Added FillRectangle(),DrawRectangle(),FillTriangle(),DrawLine(),Blit()
    (without effects) for YUY2 and UYVY.

commit f510b808528b4184031b69927a87e38c36abf8c0
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Feb 21 09:07:09 2005 +0000

    Optimized Bop_yuy2_Sto_Aop() and Bop_uyvy_Sto_Aop().

commit 8b79c24cc4b81dc53e562f81399d328bfa71f9b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 21 00:22:05 2005 +0000

    Added DLCAPS_SCREEN_POSITION and DLCAPS_SCREEN_SIZE.
    These are set if DLCAPS_SCREEN_LOCATION is set and vice versa.
    
    Unscalable layers just have DLCAPS_SCREEN_POSITION.
    
    
    Store normalized and pixel based destination area
    in a layer context.
    
    Added CoreLayerLayoutMode which defines incorporation of
    configuration based size changes and destination area values.
    
    +     CLLM_LOCATION,      /* Keep normalized area. */
    +     CLLM_CENTER,        /* Center layer after resizing destination area. */
    +     CLLM_POSITION,      /* Keep pixel position, but resize area. */
    +     CLLM_RECTANGLE      /* Keep pixel based area. */
    
    
    Default for layers with DLCAPS_SCREEN_POSITION only is CENTER,
    otherwise it's LOCATION.
    
    After calling SetScreenPosition(), mode is POSITION.
    
    After calling SetScreenLocation(), mode is LOCATION.
    
    
    Moved core abi definition to header file.

commit e2b17de96abd7eb75375f10b07774d2653de1d6e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 18 22:08:39 2005 +0000

    - Dropped I420/YV12 support for old chips.
    - NV12/NV21 Blit() for >= G200.
    - NV12/NV21 StretchBlit() for >= G400.
    - Accelerated I420/YV12/NV12/NV21 FillRectangle().
    - Separated all planar stuff to their own functions.
    - Tried to make CheckState() functions a bit better looking.

commit 7e91278bbade3d3519ce180c79d36442045bd847
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 18 15:39:13 2005 +0000

    - Defined constants for CRTC2 register values.
    - Alpha ramp support for CRTC2.
    - Added support for progressive chroma on CRTC2.
    - Added support for progressive half-height sub-picture.

commit 8791331bdb4d1bfc72caf26f86ea29583ee3c6f6
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 18 15:25:26 2005 +0000

    Cosmetics.

commit 5d4d46263f1ecb76f63bda2a27f336284791a2ea
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 18 15:22:33 2005 +0000

    Added comment about flicker filter not working.

commit f69791a8182d9d74462d8b74fcdb3f571cc83108
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 18 13:33:56 2005 +0000

    init_region_config() forgot to initialize surface_caps.

commit 60f105be89e2a28314df9306c96791e9999ecea2
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 18 06:45:48 2005 +0000

    Replaced argb-font and a1-font options with a more flexible font-format option.

commit d14a396442960d201c97f50a7aa21c52aff99a8b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 17 12:59:10 2005 +0000

    Added IDirectFBSurface::FillRectangles().
    
    Generated new ChangeLog.

commit f9790702e9e429b27f3fe22156253420ee0b7e69
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 17 10:12:48 2005 +0000

    Take the largest one, if multiple tmpfs are found!

commit 2c6c2130401cca7230e8ea17ed74c677ad14e90f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 17 09:28:23 2005 +0000

    More than two months ago I made this progress with Unique. I wanted to make
    it usable again before commiting, but I think it's better not to wait any
    longer ;)
    
    These tons of changes are mostly implementation of things described in IDEAS.

commit 822d8f25a03e7cb3d7e5df3468e6e873544f3e67
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 17 09:09:27 2005 +0000

    Work around compiler error when building with trace support (gcc 3.3.5):
    
    generic_mmx.h: In function `Sop_argb_Sto_Dacc_MMX':
    generic_mmx.h:172: error: can't find a register in class `GENERAL_REGS' while reloading `asm'
    
    Added "__attribute__((no_instrument_function))" to that function.
    
    IIRC it didn't work with 3.4 or others.

commit 779679d4a12bcafc51d8d774ddc57e5056159519
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 17 08:47:48 2005 +0000

    Make "graphics-vt" the default.

commit fba207430411bfccf9c2b9e6d84c07bc94fa7ff9
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Feb 17 02:10:04 2005 +0000

    dfb_surface_reconfig() was still leaking video memory via depth buffer.

commit fabf5c26350b175f9b4754210757db7d7ef11f6a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Feb 16 08:45:31 2005 +0000

    Fixed YUV422 handling on big-endian architectures.

commit 4ba580227b8457295bd2a704326771727c57fc49
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Feb 15 09:16:03 2005 +0000

    Removed macro ARGB_TO_ARGB4444.

commit e11271add05790ad7c11c8f64bb0011b9680b17c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Feb 15 09:14:48 2005 +0000

    Fixed bug in Sop_yuy2_to_Dacc_MMX and Sop_uyvy_to_Dacc_MMX:
    forgot to check if counter is zero.

commit b3c480ae69985e965e6a95d9fa6963e143864ada
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 15 08:31:02 2005 +0000

    Added DLCAPS_PREMULTIPLIED indicating that a display layer
    can display surfaces with premultiplied alpha.
    
    Added DSCAPS_PREMULTIPLIED indicating that the surface has premultiplied alpha.
    
    Added DLCONF_SURFACE_CAPS and field 'surface_caps' to DFBDisplayLayerConfig
    to specify any combination of the flags: DSCAPS_INTERLACED, DSCAPS_SEPARATED
    or DSCAPS_PREMULTIPLIED.
    
    Added CLRCF_SURFACE_CAPS and field 'surface_caps' to CoreLayerRegionConfig in
    the display layer driver API.
    
    HW Windows created with DWDESC_SURFACE_CAPS and DSCAPS_PREMULTIPLIED
    in 'desc.surface_caps' are created as premultiplied layer regions.

commit 45b4f6a01032b5716f49e3fe3e77e27c5d8cfd4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 15 08:21:40 2005 +0000

    Implemented BatchBlit() on both sides.

commit 10ba719856cf2ffba8e33b14676122e276e1948f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 14 20:34:25 2005 +0000

    Hot fix cross compiling by commenting out rule for building "yuvtbl.h".

commit 606d97d421644d744ebe592766bc7fc9d48ff591
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 14 20:18:18 2005 +0000

    Changed CbCr to CrCb in the comment of DSPF_NV21.

commit 4f2611df876a499532e3d5fdbd37041a60d36b19
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Feb 14 20:06:18 2005 +0000

    Missed a few cases of NV21.

commit 20ccaace8712a2eae7f61e69f46af8935c719185
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 14 20:03:14 2005 +0000

    Hopefully fix cross compile by keeping yuvtbl.h in CVS and after make clean.

commit b30c3a48d2970d21d1c798f8da5cdb53f53b5157
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Feb 14 19:52:19 2005 +0000

    - Added NV12/NV21/NV16 blitting and rectangle filling.
    - Made YV12<->I420 blitting possible.
    - Round chroma width and height up. It seems better than rounding down.

commit be603c7972416523a77bdce3d9a28af5580745b5
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Feb 14 15:23:27 2005 +0000

    - DSPF_NV21 support.
    - G200 can handle NV12/NV21.
    - Check for odd width/height with YUV formats.

commit 2d1ccaecf430cbd55fa1ceb310a8119eb23e5684
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Feb 14 15:12:26 2005 +0000

    Added DSPF_NV21 and made dfb_surfacemanager_assure_*() handle NV?? formats.

commit e4f427c2034c821aeea17a41e6d0a9b38fcbbf84
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Feb 12 08:32:39 2005 +0000

    Remove legacy.

commit 25880f9fbd42b5a35ae608cf32a89ebeb7e7f7f8
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Feb 10 19:34:48 2005 +0000

    Disabled DH add-on detection since it doesn't always work.

commit 95754ac86ddeb704014757faee9374ce009d12f0
Author: Marcel Siegert <mws@directfb.org>
Date:   Thu Feb 10 16:39:31 2005 +0000

    added dreamboxremote directory
    added dreamboxremote driver mainly based on dbox2remote
    adjusted Makefile for inputdrivers

commit b0fb1c512362a778516c624092c67acc472a3e10
Author: Marcel Siegert <mws@directfb.org>
Date:   Thu Feb 10 16:09:08 2005 +0000

    added dreamboxremote configure option for inputdrivers

commit abdb26e42eb7cd2d42247bf75fec3f34c63554c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 10 15:37:46 2005 +0000

    Moved alpha ramp setting from DFBDisplayLayerConfig
    to IDirectFBSurface::SetAlphaRamp() for usage with hw windows.

commit 19509c3fc437e73e6ba4492be897a04f553e6352
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 10 13:45:47 2005 +0000

    More method link substitution (enum and struct entries).

commit 863c4efc22599044fc8318f5db1c2ae364f4dbe6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 10 13:39:45 2005 +0000

    Fixed parsing of DFBBoolean by allowing "!" in enum value assignment.

commit 80da068b80d8bef7b5b12cbb30f7acc5e8079b69
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 10 13:28:31 2005 +0000

    Fixed warnings due to unused debug domains depending on architecture.

commit 268f4f125b047e4cbdfeebdd6c3a3d945dabc54a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 10 12:02:58 2005 +0000

    Keep a list of all realized (added) regions to remove them during
    emergency shutdown, e.g. signal received or missing deinit of master app.
    
    Converted layer related debug messages to use debug domain "Core/Layers".

commit 4531cfb5e595c413e602ff497fd1585388a77898
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 10 12:00:35 2005 +0000

    Added i830 driver (overlay support only) for Servision Ltd.
    (http://www.servision.net/)
    
    Note, due to unsolved conflicts regarding ring buffer usage
    you have to load the "intelfb" module with the parameter "accel=0".

commit e4bdc6f4d7c26d2fa61e8bd59268aaf7144dfda0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 7 12:34:20 2005 +0000

    Perform additional check (returned phys. fb base) before considering the
    fb driver to be the one that it's expected to be.

commit 3b16b3f4b995de66a06e6c564bdfcd98c476487e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 4 12:56:59 2005 +0000

    Activate DWOP_ALPHACHANNEL for other non indexed alpha formats, too.

commit f4aa13bef0350c0a332bf0126d9eee7c24b01990
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 4 12:40:10 2005 +0000

    Honor DWCAPS_ALPHACHANNEL for creation of hw window.

commit bcd417d65a39dcac3a1403244430a457f102fe66
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 4 10:51:27 2005 +0000

    Added yuvtbl.h

commit f122362997cd7ccbeca815700e9a24e4ce0ab472
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 4 10:48:20 2005 +0000

    Create layer regions for hw windows in single buffered mode, unless
    explicitly configured using DSCAPS_DOUBLE/TRIPLE or DWCAPS_DOUBLEBUFFER.
    
    This is a preliminary solution, because by default a window surface should
    require a Flip() to make changes visible.

commit ee5a5de8a1c74b8ecfb317d59e9e15ae67b8eeae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 4 09:59:36 2005 +0000

    Removed an assumption.

commit cd86de7338e6edc894cc5be1bd6ad551e6960b61
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 3 18:38:03 2005 +0000

    Replaced spaces by tabs for indentation.

commit 39e46bc4c00cf7b93cd91ff7900f42abe85136ca
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 2 14:30:44 2005 +0000

    Added yuvtbl-gen.c to EXTRA_DIST.

commit 638fbcf88a88c59922e3c6093546d7fcb26ce763
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 2 12:18:29 2005 +0000

    Added generic.c's dependency on yuvtbl.h manually.
    
    Removed generated file from CVS.

commit 759573e7049736d0142b114d2b14506cca7b9994
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jan 26 10:53:13 2005 +0000

    - do not dispatch events if unknown or JS_EVENT_INIT are received. Fixes
      crash upon initialization under some conditions
    - added missing newline to debug output

commit 7e4710cdac97da4bef495d55493cf7e5fbc10727
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Jan 21 15:53:16 2005 +0000

    Fixed DH add-on detection code.

commit 6bc8e647b685b84459eb05f96927dcbba165ad92
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 19 21:30:14 2005 +0000

    Added IDirectFBDisplayLayer::SetScreenPosition( int x, int y ) which
    sets the position of the layer on the screen specified in pixels.

commit 71000ee9a0d4fe04b5bf5c6900abd7e020a04dec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 19 15:09:18 2005 +0000

    Don't choose between reallocation and allocation based on the region's state,
    but simply check if the region's surface pointer is non NULL.

commit cd76e79e2f61088e1dc2d8e06f0a7b3a6609e01a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 19 15:06:35 2005 +0000

    Write luma plane at least when loading images to YV12, I420, NV12 or NV16.

commit 8a837ebafad6ad57c263bacba81b09997bb3ecb2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 19 12:15:45 2005 +0000

    Fixed a video memory leak in dfb_surface_reconfig() that happened if a
    surface with multiple buffers is configured to have less, e.g. switching
    a layer from DLBM_TRIPLE to DLBM_FRONTONLY.

commit c11c96362685921426c3b2e029fece42a93df630
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 18 11:57:27 2005 +0000

    Reset the destination rectangle upon layer resizing, centered on the screen.

commit c642890d0645cb121527e79010a9a8c457dc1a83
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 18 09:38:22 2005 +0000

    During reallocation of the layer surface, disable automatic palette
    switching in the region surface listener. Otherwise the palette got
    set before the region is configured to indexed format.

commit 1b4c1dcb21cd69ae1ddd19ad2be1ba8c470695ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 18 09:36:39 2005 +0000

    Added debug message to dfb_surface_reformat().
    
    Generate RGB332 palette for LUT8 and RGB121 for ALUT44.

commit 65e714480cbbaa0c0583b0375c733afff305adad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 18 09:35:14 2005 +0000

    Added dfb_pixelformat_name(format) to be used for (debug) messages.

commit 5821777de0aa4b518cbf469b868220faf3d12911
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Jan 17 11:07:10 2005 +0000

    Fixed a logic bug which allowed CreateSurface() to succeed even though
    dfb_layer_context_set_configuration() returned an error.

commit b450e8b93bdccba17f4fa54bc573af4e1e2f0c89
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Jan 17 11:01:29 2005 +0000

    Cleaned up the way CreateSurface() determines the primary surface
    pixelformat and size. Previously the behavior varied depending on
    cooperative level and the force-desktop option.
    
    New behavior:
    1. DSDESC_{WIDTH,HEIGTH,PIXELFORMAT}
    2. SetVideoMode()
    3. mode= and pixelformat= options
    4. current layer config

commit e90fb3897677d60a1dc62477a0defbb0f27bc8c6
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jan 16 20:50:51 2005 +0000

    Added support for G400 dual head add-on.

commit 1c179e6e293f5790714371774e71a0891690a8ce
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jan 16 20:06:20 2005 +0000

    Reset PLNWT.

commit 2de23409a80df4261d95b2069ed574a4ec057b0c
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jan 16 20:00:59 2005 +0000

    Added ARGB4444 support.

commit 4a01d4cbe48648c6cb702c307c1246525b1c5593
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 16 17:19:05 2005 +0000

    Propagate horizontal destination coordinate to refine hack.

commit d7a6bab2b84089b3084cf0fc247e0351f2ae8a65
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 16 16:57:39 2005 +0000

    Force alignment to even coordinates if blitting YUY2 or UYVY.

commit 7d708e8315f4f33d74b1181f120eefe7cfd3b4de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 16 16:45:37 2005 +0000

    Added ugly hack to load images to YUY2 or UYVY surfaces.

commit 18d7324d91e92dfc93a31a93352b68b1aa1fc99b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jan 15 16:28:12 2005 +0000

    Set default alpha ramp in default layer configuration.

commit 83cd5e1cea60eccbb725cb7f7f67b855c2b5264e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jan 15 16:24:19 2005 +0000

    Added DLCAPS_ALPHA_RAMP:
    
    Alpha values for formats with one or two alpha bits
    can be chosen, i.e. using ARGB1555 or ARGB2554 the
    user can define the meaning of the two or four
    possibilities. In short, this feature provides a
    lookup table for the alpha of these formats.
    
    
    Added "__u8 alpha_ramp[4]" to DFBDisplayLayerConfig along
    with DLCONF_ALPHA_RAMP in DFBDisplayLayerConfigFlags:
    
    Alpha values for 1 or 2 bit lookup.
    See description of DLCAPS_ALPHA_RAMP.
    Either all four values or the first and the
    last one are used, depending on the format.
    Default values are: 0x00, 0x55, 0xaa, 0xff.

commit 8d3f1213a88f54528c879a34ec695d147d3cd196
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 14 21:47:15 2005 +0000

    Added missing case for ARGB2554 and ARGB4444 to dfb_color_to_pixel().

commit 1011a73c382ae5b896e83c4ca3edb78587eb0a09
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 14 21:46:45 2005 +0000

    Show the layer level if supported.

commit 962c3fdaee7d217543a4304a91f355dcdf56c3f0
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Jan 13 21:01:21 2005 +0000

    Additional small optimizations.

commit 87547d374baeef4bc41ed8d3bfbf66f5d3bb26e3
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Jan 13 14:43:20 2005 +0000

    Further optimizations: reset drawing/blitting operation only when operation mode changes.

commit 207587aaa1d6f59c91ef5093d52d501197ce9914
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 12 00:14:58 2005 +0000

    Forgot to mention in previous commit:
    
    Bumped version number to 0.9.22.

commit 02f01709a406fcad61a41c505883a30b8ec83710
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 12 00:10:14 2005 +0000

    Added ARGB2554 and ARGB4444.
    
    Implemented all mandatory software driver snippets for these formats
    and any conversion or image loading routines.
    
    Only the optimized A8 font rendering routine (optional) is
    unimplemented, i.e. Bop_a8_set_alphapixel_Aop_argb2554/4444.

commit 78b8f11d59443b0d0659924f677ad18f8f6ce123
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 11 15:17:02 2005 +0000

    Accept NV12 and NV16 in CreateSurface().

commit 6dd10e932f9b3bb17428b88c1affcf1166d5583e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 10 20:35:35 2005 +0000

    Copy definition of TS_EVENT like the ucb1x00 driver does.
    
    Please report if this fails with Linux 2.6 header files.

commit b2a9c88d27a9f080755ac2fdc9db92bc34ce1c4c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 10 20:33:06 2005 +0000

    Use tab instead of spaces.

commit 7e4e970c6ec323b9ed1a18a5e8a23c28afb5f95a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 10 20:32:38 2005 +0000

    Added yuvtbl-gen.

commit 8b6b9e3fa587b0465df01caa6642309372a2a88b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 10 20:32:13 2005 +0000

    Fixed typo to avoid rebuilding the sources every time.
    
    Added clean-local rule to remove the binary and the header file.

commit 21bf368ffcd4d5e358f06bab1603d448b53372c4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Jan 10 19:07:35 2005 +0000

    Fixed StretchBlit clipping.

commit 9ef873fbbf3cc6627b34165be982ec6f24e25f4e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jan 9 18:50:54 2005 +0000

    Enable dithering by default.

commit 6479022bd613e02cd31cd39795b4efee8683382e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jan 9 12:05:52 2005 +0000

    Added basic support for drawing with alphablend on NV20.
    Great performance improvements: it's possible to move a translucent window
    at 32bpp while the cpu stays idle.

commit 08d6d07342e676adbafdc8502c38013f937d4207
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jan 9 12:02:36 2005 +0000

    Killed a FIXME: detect screen resolution from registers.

commit 42947e6e73593e24b9f4b18cd3476ee13d9cb758
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Jan 6 20:48:04 2005 +0000

    YUV to YUV conversion is not supported.

commit 2e9c502f876c31f81e600e1aeef2141036c0710f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Jan 6 20:47:19 2005 +0000

    Removed an unused array.

commit 32821a45d84866210f85f3a9c4765e50ffbd9a2c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Jan 5 10:40:05 2005 +0000

    Added support for YUY2/UYVY->RGB conversion (with src colorkeying):
    we use four lookup tables generated at compilation time by yuvtbl-gen.
    Make sure accumulator is aligned to 8.

commit 3897203bcf29d4614bf9976d8047a6b939dc0d44
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 4 11:39:27 2005 +0000

    Try to fix kerning bug on PPC using explicit type casts.

commit 4ac5b602ed638e9791c3c51319b6056eda18acd8
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Jan 1 14:48:04 2005 +0000

    Found the way to make NVScaledImageFromMemory (used for StretchBlit, Alphablend, Color Conversion)
    work on NV20 chipset:
    it was another rivafb bug, therefore the rivafb-nv20fix-* patch is absolutely required.

commit 31ce60f3a312ff6fa9902f613d34e5cee050b58d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 29 14:33:40 2004 +0000

    Thanks to "Mws <mws@twisted-brains.org>" for this patch that adds a
    configure option "--with-inputdrivers=<...>"!

commit fa2805c536c7e8683993e115f45ea5f2831ca39f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Dec 29 10:38:07 2004 +0000

    Write objects configuration during device initialization and do not override rivafb objects.
    
    Added expertimental Alphablend support on Riva TNT.
    
    Fixed NV20 and GeForce3 Xbox support, Blit() should work on the latter now.
    
    Added experimental support for NV30 chipsets.
    
    General cleanup.

commit 306c69ae8b3af716607b4c487b1678c09d7e52ba
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Dec 22 10:26:59 2004 +0000

    2.4 kernels don't have EVIOCGLED.

commit e8aeaa0da4dbb72a0f57603a7ac86bd84a75c929
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 22 07:18:27 2004 +0000

    Changed date.

commit 8809181f7c68fdc396c065540d132a02cc615694
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Dec 22 01:53:29 2004 +0000

    Fixed a typo.

commit f3d055b0e96f18743023bd780ee597b287e769ae
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Dec 20 20:03:16 2004 +0000

    drop SDL support on osx, fix osx system for release. still in a very early
    stage, but working somehow.

commit f164f010e6ad38b7d2f7f565c517fad33b16647a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 13:21:43 2004 +0000

    Commented out two messages for release.

commit ecb877b6c296ec04bbb8d399b8486554ac1e43f3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 08:52:54 2004 +0000

    Updated instructions.

commit f005c736b8174b2c0acbe460d4e26835447afb6f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 08:48:39 2004 +0000

    New patches.

commit babf6a1a85a132a72b2838faa04ac234900a96cd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 07:53:43 2004 +0000

    Spelling, wording and phrasing fixes ;)

commit 57d3df846505acfa19b3a494d5be0710225ee871
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 07:32:20 2004 +0000

    Wrote "summary" of changes between 0.9.20 and 0.9.21 ;)

commit b5adab0b60a42f80359f9657fde5d4e07781a51d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 04:06:17 2004 +0000

    Added Andreas Oberritter <obi@tuxbox.org> (SiS 315 gfx driver).

commit e9ee6fb77ee88eefb6a1c45cbe4019e5279169b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 20 01:37:07 2004 +0000

    Readded ".o" files.

commit 2bdf35b538a9653eda5efd8f6f510f64bcdd7897
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Dec 20 00:40:49 2004 +0000

    compile fixes.

commit e18bb7a97ae20aeca1d7f26c8e4f8628b2272e52
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Dec 18 13:02:26 2004 +0000

    Rearranged a few keycodes to match reality.

commit d81a4f14f084aede935560b13d4f8aca5272b62a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Dec 18 10:49:58 2004 +0000

    - Support more axes
    - Invert Z axis

commit 85aca7a39c8f91918f3d968e164cd0e1fa7bb071
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Dec 18 10:42:47 2004 +0000

    Copied keymap support from the keyboard driver.

commit fd23182e7bc36203e2cc82f01d46432bec47d70a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Dec 18 10:00:46 2004 +0000

    Cosmetics.

commit d6f76fd50d532e3a1965eca6327966bc2c2465d4
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Dec 18 09:57:33 2004 +0000

    Added keyboard LED support.

commit 86ab20b6a430b2e9c40ac6d0df86c00618aa137e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Dec 14 15:47:27 2004 +0000

    Respect endianess when converting surface to texture.
    Fixed a typo.

commit d88c83301e090cec60c5b30eca3870d389362d2c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Dec 13 09:58:17 2004 +0000

    Separated GeForce3 XBox from common NV20 and disabled all blitting functions on this chipset.

commit 173d83c017024890b000afb095244b5244ba0a58
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 11 19:38:35 2004 +0000

    Reduced kerning cache size by 50% and slightly increased performance.

commit e61be81dad8b9f38830b9a66ed2bdc7addd872e7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 11 16:32:38 2004 +0000

    Fixed warnings.

commit aac195fdfdffb9e1ab7b3cf7fcd0feaf64cdfdd2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 11 16:16:53 2004 +0000

    Don't check for directfb-csource at all, if UniQuE is disabled.

commit 043d032fca661e82734265747b9fb4a886f7ac85
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Dec 10 22:21:58 2004 +0000

    Fixed segfault in Sop_argb_Sto_Dacc_MMX() when DirectFB is compiled with trace support:
    use edx instead of ebx.

commit 126e2434788b540bff2f33a69e7a1c6be02fa851
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Dec 10 11:12:55 2004 +0000

    Wait idle before setting alpha and color (Beta1 and Beta4).

commit 7186e37c3ed0de54551751a86e5701b0ee7271d7
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Dec 9 21:41:51 2004 +0000

    Avoid division by zero during performance monitoring report.

commit 9640bc762ed937d688fd1dafb3989380d62e5ead
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Dec 9 20:35:44 2004 +0000

    Set nv_waitidle() cycles limit to 10000000.
    No longer compile in unsed tables.

commit 619dd70ee965543aeb46907b951e9e958973b1da
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Dec 9 16:23:00 2004 +0000

    Added support for A8,YUY2 and UYVY surfaces in dfb_surface_dump().

commit 4e9adf954c6fb8152847521893e586e43b70a3db
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Dec 8 14:20:06 2004 +0000

    Use ScaledImageFromMemory 0x77 instead of 0x89 for NV10/NV20.

commit c02bb37a31a8eb1748d9d2c57ca84aa09a0d4cea
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Dec 8 10:42:15 2004 +0000

    Fixed bug when negative coordinates are passed to drawing/blitting functions.
    
    Fixed bug with ARGB destination surfaces: alpha component was not set correctly.
    
    Added Alphachannel Blend support (!!!!).

commit ab55bd5771567852c31356e07a1c837338295d6d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Dec 5 18:40:34 2004 +0000

    Revert to previous method in CheckState() and return if DFXL_TEXTRIANGLES is
    passed to nv20CheckState().

commit 9c3fd2e37db283bc0560d81259aec2f323fabd90
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Dec 5 18:15:46 2004 +0000

    Cleanup & some bugfixes:
    acceleration was not set correctly in CheckState().

commit 2c66f03231b16d2ce212c6090666ae0b3382f587
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Dec 5 17:58:33 2004 +0000

    DFXL_TEXTRIANGLES was not checked in IDirectFBSurface::GetAccelerationMask().

commit ac58751959db1eb9da1a358d2b984203bc33ac85
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Dec 5 11:02:41 2004 +0000

    Moved surface-to-texture conversion functions to nvidia_3d.c.
    
    Surface-to-texture conversion is now performed each time DFXL_TEXRIANGLES is acquired.
    
    Source and Destination Blend Functions were not set when DFXL_TEXTRIANGLES was acquired; fixed.

commit f5a467b3b0c6b755ba3331596ecb834dcfd13eea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 4 19:13:20 2004 +0000

    Added support for DSPF_NV12, untested.

commit 186294b2dac5ef47aaff287962da9af26c53cfab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 4 16:53:32 2004 +0000

    Stay with FourCC definitions and use NV12 for YC420.
    
    I used NV16 for YC422, but that was just a guess, because I didn't
    find any FourCC matching this format.

commit 8579792b7d763b436ec4028770c88d7a0c9e11ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 4 14:09:21 2004 +0000

    Hot fixed most annoying problems with device probing:
    
    - Just use one of "/dev/psaux" and "/dev/misc/psaux" if both are available.
    - Don't try them at all if uname() yields release "2.5.*" or "2.6.*".

commit 51dc3cc5c48a84f76a8b7ef5a03c6306205f9ca6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Dec 4 13:45:04 2004 +0000

    Added dummy functions for encoder and output configurations.

commit f55f49ebfe02e90301db52509f5d05a754e44ec3
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Dec 3 18:25:05 2004 +0000

    Reserve unusable memory at the of framebuffer during device initialization;
    kernel patches are no longer required.

commit edb6fc01c563e83203231d9a8a13655a92d6e15d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Dec 3 14:26:55 2004 +0000

    Set video buffers limit to avoid problems width old rivafb (2.4.x kernels).

commit 2a86c04dfaf373086725c1e38c3c5b0ed9965888
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 12:22:37 2004 +0000

    Added option "-L, --level <level>".

commit bcceb61c45ecf935e50853ace896d8e5520f9a8f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Dec 3 09:58:30 2004 +0000

    Giant cleanup and rewite of the objects configuration routines:
    we use runtime configuration istead of fixed tables now.

commit e74a1f75b442900607e433e08ae827e3d9da7b30
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 08:24:21 2004 +0000

    Added dfb_color_to_argb().
    
    Made dfb_color_to_aycbcr() and dfb_color_to_argb() static inline.

commit 3d9d2238259c1c2b8f01b1336ae977c9a350a7d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 08:10:32 2004 +0000

    Updated some comments.

commit 70b7becc5e692ff2faf394ed1a7789aa2d26185a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 08:00:51 2004 +0000

    Added comment to DFBSurfacePixelFormat.

commit 82e6a73123504b7f01b17043299d91acfd866e8c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 07:56:11 2004 +0000

    Show index of types and definitions on the index page.

commit a4cba0d3c143321acf7032538f6a495eb19f9224
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 07:15:15 2004 +0000

    Added two planar YUV formats:
    
    DSPF_YC420  8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane
    
    DSPF_YC422  8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane

commit 0926b621d6d71a85ee773081bbaec9b7c72f21eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 3 06:18:13 2004 +0000

    Updated.

commit 9a4fdb7b1c0c3952d021a2dc308da133442c578c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 1 08:51:08 2004 +0000

    Added DLCAPS_SOURCES which indicates that the layer supports multiple
    sources that can be selected, e.g. from frame buffer (surface) or from
    hardware decoders (using buffers outside of the frame buffer).
    
    Added DFBDisplayLayerSourceID with pre-defined DLSID_SURFACE.
    
    Added number of supported sources to DFBDisplayLayerDescription.
    
    Added DFBDisplayLayerSourceDescription containing the ID and a name.
    
    Added DLCONF_SOURCE along with a field in DFBDisplayLayerConfig to
    select the source to be used.
    
    Added IDirectFBDisplayLayer::GetSourceDescriptions().
    
    Added InitSource() to the layer driver API.
    
    Added source_id to CoreLayerRegionConfig
    and CLRCF_SOURCE_ID to CoreLayerRegionConfigFlags.
    
    Added layer sources to dfbinfo.

commit e497e3b0caeba1b6e3ef12389209d30376855489
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Nov 30 11:36:49 2004 +0000

    Fixed TextureTriangles() bug in desktop mode.

commit 0eba4f14bfd9f5001444f47e7158894e2314bbb9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 28 23:34:02 2004 +0000

    Code lifting.

commit b354ffaa08303d895ea7342e7f5ea743248066b7
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Nov 28 22:21:34 2004 +0000

    Depth buffer pitch was set wrong.

commit 491a26eedbaad62f4b1e01b807c749ad60095728
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 28 21:23:43 2004 +0000

    Missed a bit in DSECONF_ALL.

commit 9db390788d2815de7921c1a4faacfc19446f6914
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 28 21:09:14 2004 +0000

    Added assertions before calling Set*Config() during initialization.
    
    Hotfix missing functions in the Matrox driver.

commit 30cb8ed0d9837d8d571b0c22a1f019ba55ae2f42
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Nov 28 20:00:24 2004 +0000

    Forgot to add nvidia_mmio.h.

commit 102afe0c8c3e07de057b15d9fe0c375492460b7a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Nov 28 16:40:48 2004 +0000

    Added TextureTriangles(): it's very slow, texture size is limited
    to 512x512, it's somewhat buggy in desktop mode... but we have it!!
    
    Added nv_out8(), nv_out16(), nv_out32(), nv_in8(), nv_in16(), nv_in32().
    
    General cleanup.

commit 6a1e2e8aed45938713547ba18d9cc6ea5708010d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 05:58:45 2004 +0000

    Added "__u32 dfb_color_to_aycbcr( const DFBColor *color )".

commit aed78e08a49ca7639c95aeb81d1ff29b915f8607
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 05:56:40 2004 +0000

    Fixed two comments after name change.

commit 8577b27c798c1342da0b90b8332604b119e311d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 04:36:39 2004 +0000

    Fixed a warning.

commit 816fed6cf263be91949e2b77534d36d9198b5bae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 04:32:43 2004 +0000

    Changed all test picture mode names using shorter versions.

commit 37097b6cf718853682d465b76bc63b753345f95d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 04:15:27 2004 +0000

    Added 'test_color' to DFBScreenEncoderConfig.
    Added DSECONF_TEST_COLOR to DFBScreenEncoderConfigFlags.
    
    Added test picture mode DSETP_SINGLE_COLOR using color from configuration.

commit 52ae011519cce3a35ce8536ea92a0b90978bebc0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 03:47:04 2004 +0000

    Prefer full matches in enum parsing, e.g. always have "yc" be "DSOS_YC", but
    still allow "ycb" for "DSOS_YCBCR" or "m" for "DSETP_MULTI_COLOR".

commit 5405362fead1aaab8061ec777332837b1e61f9b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 27 03:13:35 2004 +0000

    Use D_DERROR instead of D_ERROR in two cases.

commit 331aed7a8763d3c3e19ec11d0221f2e8330ed140
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 26 22:23:51 2004 +0000

    Allow empty layer lists like "," to select no layer.

commit 61df803041a0aa635bffa651fe5a590791308399
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 26 22:20:58 2004 +0000

    Set each mixer's, encoder's or output's default configuration.

commit 32de10a3f5c32cd66384866d283e966274daa16b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 26 22:18:41 2004 +0000

    Changed DSOS_UNKNOWN to DSOS_NONE, e.g. for disabling the encoder.

commit 1de546246cffad4ae2d23bd478ccd04d1329921c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 25 22:55:05 2004 +0000

    Added "--enable-unique", disabled by default.

commit feb5b218670fa60c294d37854047587a54b30feb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 25 22:17:52 2004 +0000

    Fixed background color output format (printf).

commit 3de5c4432c2489686b80f85a959df7549ebcf21e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 25 21:16:25 2004 +0000

    ID mask is 32 bit.

commit 5f4133e3e7d95c40763689d616ee9cb0fb7990e1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 25 20:48:55 2004 +0000

    Added direct_util_count_bits(), slow version,
    but optimized for bit sets with lower bits set only.

commit d7060c3471b03b2de7028c929d3ab1a200c13121
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 25 18:33:30 2004 +0000

    Added mixer configuration options.

commit e9523a6d2c5a142b197b31347aeee4574e2564cf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 24 09:45:05 2004 +0000

    Fixed warning.

commit b723ae8b479ade002c1a3cb3eaa4aa11e2cefa91
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 24 09:42:06 2004 +0000

    Added configuration tool for mixers, encoders and outputs.

commit 385b378513d01dd81d86b411d7f2a59f45a10bb2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 24 04:36:45 2004 +0000

    Added 'name' to mixer, encoder and output description.
    
    Renamed 'num_layers' to 'sub_num'.

commit 7bdeb52ccb44cd80476740fc633c1181d5c9cf0a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 24 04:35:03 2004 +0000

    Handle recently added DSECONF_OUT_SIGNALS and DSECONF_SCANMODE.

commit ce2ab980906ba9b4e0e49ccba32fe6b3b7e79637
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 24 04:21:53 2004 +0000

    Added name generation for DFBScreenMixerTree,
    DFBScreenEncoderTestPicture and DFBScreenEncoderScanMode.

commit 518fbc02bbc97ed41c2cafc8ab9169b56416db34
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 23 19:11:43 2004 +0000

    Fixed warning.

commit 87eb53fc7272a8e3a67d3ac10243d4cd8603aaca
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 22 18:09:43 2004 +0000

    Segfault should be fixed now.

commit 1a6e108cd59262453be6a83e2cadb870bddff5f4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Nov 22 16:16:14 2004 +0000

    Limit waitfifo cycles to 65536.
    Yet some small optimizations.

commit 8c7e4a682e25a60ddf05350f2c25b2afbc7fdbd6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 22 06:35:46 2004 +0000

    Commented out an assertion.

commit 41a988541f9ce81c5de566727a8139bd79ba9197
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Nov 21 18:01:57 2004 +0000

    It seems that NVScreenBlit 0x5F doesn't support ARGB format;
    revert to NVScreenBlit 0x1F and use NVScaledImage to apply effects (ColorAlphaBlend, Colorize).

commit 9a77a18c4fe360c0681d09167e0f3c5eba8b1f64
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 20 23:57:54 2004 +0000

    Added a parameter to "fusion_skirmish_init()" and "fusion_reactor_init()" to
    set the name of the skirmish or reactor using the ioctl FUSION_ENTRY_SET_INFO.
    
    Use the new parameter for all skirmishs and reactors ever created.
    
    ---
    
    Don't create a skirmish for each reactor's global reactions, but use a single
    skirmish for all reactors which is created during Fusion's initialization.
    
    Added "fusion_reactor_set_lock()" to use another skirmish for the global
    reactions of the reactor.
    
    Added "fusion_object_set_lock()" to set the skirmish for the global reactions
    of the object's reactor, while default is the skirmish used to lock the pool.
    
    Use the skirmish of layer contexts and layer regions for their object reactors.
    
    ---
    
    Heavily cleaned up code of FusionReactor and added lots of debug messages and
    comments. You should add "no-debug = fusion/reactor" to disable these loads
    of debug messages, while still showing other messages if "debug" is used.
    
    Documented all functions in the FusionReactor header file.
    
    Cleaned up FusionObject code and debug messages.
    
    Added some assertions and assumptions to the shared memory code.
    
    Added debug domain for FusionReactor and FusionSkirmish.
    
    Renamed function type definition "React" to "ReactionFunc".
    
    ---
    
    Added "dfb_input_add_global()" and "dfb_input_set_global()" to register global
    reactions at run time, e.g. from another library or module in which case the
    static reaction table can't be initialized with the address of those functions.
    
    Cleaned up input core code, e.g. by replacing the "inlined" singly linked list
    code by using a "DirectLink" and the "direct_list_*()" functions, or by adding
    magic assertions etc.
    
    Removed InputDevice and replaced all remaining occurences by CoreInputDevice.
    
    ---
    
    Build all graphics drivers by default again.

commit 38bc8efde3f629608b716da8efcd5105ab41c79d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 20 22:00:13 2004 +0000

    Added debug domain.

commit 05c817cbdc3db176607b769708e4ce5fbf8d73bd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 20 21:52:43 2004 +0000

    Renamed "direct_list_contains()" to "direct_list_contains_element_EXPENSIVE()"
    to ensure that developers know that they shouldn't use it in non-debug code.
    
    Added "direct_list_count_elements_EXPENSIVE()".

commit 3bc0ed3ecf3e4f9e736a9b0c795382b900781309
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 20 21:40:53 2004 +0000

    Added TraceFlags to each frame, featuring TF_DEBUG which indicates that
    the function of the current frame wrote at least one debug message.
    
    Added "direct_trace_debug_indent()" which sets the flag TF_DEBUG for the
    current frame and returns the current debug message indention level by
    examining the stack, counting any upper frames that produced debug output.
    
    Increased maximum trace depth to 256.
    
    
    Here is an example:
    
    (-) [SDL Input  18.814] (18246) Fusion/Reactor:    fusion_reactor_dispatch( 0x20007ee0 [1], msg_data 0xbf5ffa54, self true, globals 0x400a1720)
    (-) [SDL Input  18.815] (18246) Fusion/Reactor:        fusion_reactor_dispatch( 0x20007c00 [17], msg_data 0xbf5ff814, self true, globals 0x4009f7d4)
    (-) [SDL Input  18.815] (18246) IDirectFBWindow:           IDirectFBWindow_React()
    (-) [  NO NAME  18.815] (18239) Core/Windows:      dfb_window_resize (0x2013db00) [  -2,  27 -  616x 460 -> 99x40]
    (-) [  NO NAME  18.815] (18239) WM/Default:            resize_window( 99, 40 )
    (-) [  NO NAME  18.815] (18239) Fusion/Reactor:            fusion_reactor_dispatch( 0x20007000 [0], msg_data 0x400c872c, self false, globals (nil))
    (-) [  NO NAME  18.815] (18239) Fusion/Reactor:            fusion_reactor_dispatch( 0x20007be0 [18], msg_data 0xbffff500, self true, globals 0x400a1880)
    (-) [  NO NAME  18.834] (18239) Fusion/Reactor:            fusion_reactor_dispatch( 0x20007c00 [17], msg_data 0xbffff5e0, self true, globals 0x4009f7d4)
    (-) [  NO NAME  18.834] (18239) IDirectFBWindow:               IDirectFBWindow_React()

commit bf254e5aca4a6e384c303a8a95021d43751a876c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 20 21:18:07 2004 +0000

    Added parameter "write_front" to dfb_surface_flip_buffers() which is useful
    for triple buffering. If true, the new back buffer will be the front buffer.
    Drivers should detect if the current front buffer is not being shown already,
    in which case the idle buffer might be still shown and should not be written
    to.

commit 758081449905c2bd7c1b5d758e3c23f866f10c9b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Nov 20 17:59:20 2004 +0000

    Added experimental support for Colorizing.

commit 0c934aa3bad7b03057e0d24aa64eb8ea227eb70d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Nov 20 10:45:28 2004 +0000

    Accidentally byteoffset_alignment was reset to 128.

commit 6d7fead382acb0673acd5794a9eb60cd7e28a75b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Nov 20 10:38:24 2004 +0000

    General clean-up and optimization.
    Use strict chipset/architecture detection.

commit 31ad26aeec0a381d401d19d25f38cc387b7f34ea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 19 23:38:58 2004 +0000

    Thanks to Stefan Lucke <stefan@lucke.in-berlin.de>:
    
    Hi,
    
    the follow patch enables reporting of destination colorkey capability.
    So apps (like vdr-softdevice) can test this in order to
    set layer options correct.

commit a09ec2f607336d1e02b05eb8e109f6486a150d54
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 18 05:36:34 2004 +0000

    Added DFBScreenEncoderScanMode for interlaced/progressive output.
    
    Added DSECAPS_SCANMODE and DSECONF_SCANMODE.

commit 7d7c2e49ff1ddb7102dd1ed15f0e9ba9c07c429a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 18 05:09:43 2004 +0000

    Added output signals to encoder caps and configuration.
    
    Added YCbCr to output signals.

commit 5fc17831e8a90389ddcb57bf51f0aa6b2e85ab58
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 14 10:20:44 2004 +0000

    Added "D_OOSHM()" which is the same as "D_OOM()" in single app build.
    
    Only in multi app build it prints the warning "out of shared memory"
    and gives DFB_NOSHAREDMEMORY if used as a (return) value.

commit 1b192843e225a0028afd4530aff47a8d795b72e4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 14 10:15:31 2004 +0000

    Added "D_OOM()" which prints the warning "out of memory".
    
    
    It can be used solely or with a return in front:
    
    :	D_OOM();
    :	return DFB_NOSYSTEMMEMORY;
    
    Can be written as:
    
    :	return D_OOM();

commit 939614a213f3a0ded84e7f75c0d853a8b0dc1544
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 14 10:13:24 2004 +0000

    Added "static inline bool direct_list_contains( list, link )".
    
    In direct_list_remove(): "D_ASSERT( direct_list_contains( *list, link ) )".

commit ac8807f8445134892619fc4fdb7d7d1b5c3d6ad3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 14 10:07:38 2004 +0000

    Added DFB_NOSHAREDMEMORY error code.

commit 7118e45b0cf532d473a7d670e473e3ec086c2302
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 13 04:53:30 2004 +0000

    Working on implementation of UniqueInputSwitch.

commit 076b2df147b991f13e99b33c46b28ec781ba8e55
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 13 02:17:46 2004 +0000

    Create an instance of each device class and
    connect sources matching certain capabilities.
    
    Added magic to WMShared.

commit 2368c36a52beccf37794ccbb45f6ff431515cbf9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 13 02:15:52 2004 +0000

    Added DFBInputDeviceCapabilities parameter to dfb_input_enumerate_devices().

commit b9ed525415145a6ffda4fce809f2e58181af4703
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 13 01:30:41 2004 +0000

    Wrote about UniqueInputSwitch and UniqueInputChannel. Updated UniqueCursor.

commit 489dd07038d10673255781c4d59e10b88bd9f9f3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 12 23:58:50 2004 +0000

    Increased lower domain field width from 16 to 18.

commit 5fc5e89aca1b8c4954c49ccc0c314b2b43e4342f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 12 23:53:50 2004 +0000

    Added debug domain "Core/SurfaceMgr".

commit 5f25f78470595462a1dd73587b311a8881096809
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 12 23:47:33 2004 +0000

    Added debug domain and a message in dfb_surface_create() including the
    name of the pixel format.

commit e54470da77b92d070825c434efb21d7aeb2e834c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 12 23:46:43 2004 +0000

    Added D_DEBUG_ENABLED which is defined depending on three other macros.
    It's defined to be 1, if the D_DEBUG* macros produce code. Useful for
    embracing code that it's just required for the debugging output.

commit 6512c128f47a3613af2405d8f16e0a9736dcf042
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 12 20:59:40 2004 +0000

    "make distcheck" works again.

commit 83adb9ad138de068b61ee13de5b81c34b4f7445b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 12 17:53:57 2004 +0000

    Worked on the design and began with its implementation.

commit 064c7d839e50c94f224f2ba91d07a69638b4b6c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 11 20:08:08 2004 +0000

    Comment out ".o" here.

commit 5ee75de3e1cc595c8e89b2b6529bb43a8cea96be
Author: Andreas Kotes <count@directfb.org>
Date:   Thu Nov 11 19:18:13 2004 +0000

    apply more fixes

commit ce1ca42ca9c15ef969b3c7a71252216deee9769b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 11 16:34:32 2004 +0000

    nother try

commit c1c84c8bea2615d43f4e43e1c131fc284da3d349
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 11 13:56:49 2004 +0000

    Commented out ".o" files here until build problems are fixed.

commit 9e0e490838b44d0eacc15709c6f631e5d94c9f14
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 10 23:34:54 2004 +0000

    Use core functions for the wm hack implementation to keep the core's opinion
    about the window configuration in sync with ours.
    This workaround will be obsolete soon.

commit f92df569d5ce6d3377e011b241c58b69c0e5ef29
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Nov 9 18:50:10 2004 +0000

    Fixed ram amount detection on Xbox (thanks to Oliver Schwartz).

commit 1e157c6042bc1fa46da166f1e975eefafd23643c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 09:39:39 2004 +0000

    Code cosmetics.

commit 8c6cb4e8a7a52a0a03c5015ff34fdef46a8cc4db
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 08:06:22 2004 +0000

    Use colorizing for the borders. The color can be changed with "test_color".
    
    Some fixes.

commit 0e1a7cd82b22d04bd8a6c2035f5194aea130e0a9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 07:37:56 2004 +0000

    Added debug domain.
    
    Added debug message in dfb_window_resize().

commit d1c71218d539f6f493926ecae5c3bf5d9b1e9a66
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 07:36:27 2004 +0000

    Fixed wrong assertions in dfb_region_from_rectangle().

commit 9fcd8bddb3965962e85e1048ed54b15d5f4be458
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 04:47:40 2004 +0000

    Removed obsolete Reaction structs from CardState.

commit eee48a56b8c74b19c499f56307771f37b50543f9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 04:21:36 2004 +0000

    Simplified Flip().

commit 0cf9dd0dc7a265e5efe30eaf909a0a53281325b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 04:03:14 2004 +0000

    Simplified Flip() here, too.
    
    Added "const" to the region parameter of dfb_window_repaint().

commit dc86a5b0b0aa47dcab63df5171922b24e2342891
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 03:54:47 2004 +0000

    Simplified Flip() a lot.

commit 64f4b8c62d5859359eb285ac7cf36ecaf56f890c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 03:36:40 2004 +0000

    Removed influence on layer context reference count which caused the
    cursor window reference count to be one greater in the output than
    the layer context reference count, because during window dump the
    context reference was increased.

commit 94b605ce88d584258a9823e94eb1b7c42da59537
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 03:22:52 2004 +0000

    Forgot dfb_font_drop_destination() in IDirectFBSurface_Destruct().

commit 7d0e56baf7a5c8b206c3e7aa8bbd2b9156ab816f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 03:05:39 2004 +0000

    Fixed invalid clipping region of sub surfaces
    created outside of the physical surface's area.
    
    Thanks to DFB_REGION_ASSERT() in dfb_state_lock()  :-)

commit f64144067fe8a2843ea8e1cafc71aa9a100ca5fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 02:35:16 2004 +0000

    Added -D_GNU_SOURCE.

commit 17ebdfb372b4b420be3e0c00f928845ad731e75b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 02:28:03 2004 +0000

    Use DirectSerial for CoreSurface, increased by dfb_surface_notify_listeners().
    
    Removed the surface listeners attached by dfb_state_set_destination() and
    dfb_state_set_source().
    
    Store the serial of the source and destination surface in each state.
    
    Added dfb_state_update() which does the work of the removed listeners
    if direct_serial_update() returns true. Updating the source is optional.
    Only surfaces set via dfb_state_set_*() are handled.
    
    Use dfb_state_update() in dfb_gfxcard_state_acquire() and gAcquire().
    
    Use dfb_state_set_destination() for the font's state to avoid setting up the
    accelerators destination settings for each DrawString().
    
    Added dfb_font_drop_destination() being called by IDirectFBSurface::SetFont()
    and IDirectFBSurface_Destruct() and unsets the font's state destination if it
    matches the specified surface. This avoids late deallocation of the surface
    when the font's state destination is changed for another reason.

commit 815aa7030956c56581aefc73dc3a8204be7a460e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 01:57:34 2004 +0000

    Added DirectSerial providing a 64 bit serial number
    while the implementation uses two unsigned 32 bit integers.
    
    Measurements have shown that (at least on my Athlon Thunderbird 1.33)
    emulating the 64 bit value myself is 50% to 100% faster
    than simply using the builtin 64 bit code of the compiler.
    
    The following static inline functions are defined:
    - direct_serial_init()      initialize serial to zero, set magic
    - direct_serial_deinit()    right now it only clears the magic
    - direct_serial_increase()  advance serial number by one
    - direct_serial_copy()      set serial to the value of another
    - direct_serial_update()    returns false if the serial is up to date
                                with another, otherwise returns true
                                after updating the serial

commit 11dd34edd2627c0ff8a01339c567828877589290
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 9 00:44:48 2004 +0000

    Added D_FLAGS_ARE_IN(flags,f) to check that any set flags are contained in 'f'.

commit e9b82464e93b2b11b2af088e089d10014abce543
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Nov 8 17:39:02 2004 +0000

    Work around on ram amount detection on Xbox.

commit bce285dde29a1bab7dc6dea9bee08742b4511d3e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Nov 8 14:13:20 2004 +0000

    Fixed offset mask calculation.

commit 60f54769167e9289a426620d6a13287a92ee5db8
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Nov 8 13:42:05 2004 +0000

    Memory alignment set to 64.
    Use offset mask according to the effective memory size.

commit ea6f27ec0621dc2653c955a11c2deabb58e31af5
Author: Michael Natterer <mitch@directfb.org>
Date:   Mon Nov 8 12:32:28 2004 +0000

    - link stret_test against $(top_builddir)/src/libdirectfb.la
    - removed trailing whitespace

commit 7b23fba83d9b3683c8865f69b4fdd2a4d5c12859
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 8 00:36:10 2004 +0000

    Hotfix missing fusion_ref_inherit() in single app fusion.

commit fead4b726fb52e5a0aef6aea465ef32c0a90cdea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 8 00:31:19 2004 +0000

    Fix compile error with single app core.

commit 5723501ac7c5cc6d755f727d71c0b19a1b3749a9
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Nov 7 16:12:47 2004 +0000

    Scan only devices on bus 1 and following (fixes wrong detection with nForce boards).

commit 99088b057afb83c2d58def1d4e89b41833784b3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 14:44:25 2004 +0000

    Optionally, stret_region_at() can look for a specific region class only.
    
    Added some safety to unique_context_window_at() in case other regions
    have SRF_INPUT set while not being UCI_WINDOW or UCI_FOO. It doesn't use
    the feature above, though.

commit 1a3d6fbee3b62af9c591871bf4ab8945351d43e9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 14:18:33 2004 +0000

    Fixed failing assumption due to missing stret_iteration_abort() in region_update().

commit d54cb26f75520e9bf00764ee767069005c884705
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 14:06:14 2004 +0000

    Added option "no-decorations".

commit 0a26336da079447f016ad12421ed0abad6a7dfbd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 13:29:19 2004 +0000

    Fixed update of frames with opaque content.

commit 68ec27cf94fe07d705a58fc3825db7ba3abc808e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 12:27:51 2004 +0000

    Fixed missing updates when undecorated windows are resized.

commit 48ab92e77d81a06140eae7a8491274c3ae6cf934
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 12:06:01 2004 +0000

    Added global reactions to be notified, when a context or window is destroyed.
    The reactions are in the wm module. Therefore wrapper functions had to be
    added in the wm library, to avoid linking the library against the module.
    The wrappers are using callbacks passed to the library during module init.

commit ae7302082ef95a9aef3cedf967c808462a89dbc7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 12:00:27 2004 +0000

    Unlink layer region in window_destructor(), not in dfb_window_destroy().

commit c3a2645ae7c41d1f4aff7f5da7def6e5a91711c2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 10:19:17 2004 +0000

    Show list of windows in uwmdump.

commit 19429a502d9b0cd3eee8c1141c22e7295a290fc0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 7 09:15:20 2004 +0000

    Use new Fusion API for entering the world.
    
    Added fusion_ref_inherit() using the new ioctl FUSION_REF_INHERIT.
    
    Added fusion_object_inherit() to inherit the local reference count
    from another object of any type.
    
    Fixed the global reference cycle "Layer Context, Layer Region,
    Cursor Window" by removing the global reference to the Cursor Window,
    which now inherits local references from the Layer Context, i.e. if the
    last application releases the stack, the cursor gets destroyed :-)
    
    Fixed the global reference cycle of "Layer Context, Layer Region,
    Unique Context" using the same technique.
    
    Added "docs/ReferenceMaps.txt" which explains references
    and visualizes different cases of inter object referencing.
    
    -
    
    Split unique window manager code into the objects UniqueContext
    and UniqueWindow. The wm module only uses the unique wm library,
    nothing is implemented in the module any longer. Moved all stuff
    from StackData and WindowData to UniqueContext and UniqueWindow
    respectively. Added methods to these new objects to implement
    the current functionality for now.
    
    Added the ability to create a StReT Region with multiple levels.
    Actually, there's a variable number of children vectors now. This
    eliminates the usage of invisible StReT Regions all having the same
    size to emulate the levels. Creation of a Region needs specification
    of the number of provided levels, now. Additionally, the level to
    be added to within the parent must be specified.
    
    The Root Region consists of these UniqueRootLevel's:
    - UNRL_DESKTOP     Icons, redirected fullscreen apps (force-desktop)
    - UNRL_USER        User windows (currently available stacking classes)
    - UNRL_SYSTEM      Dock/Panel, Glass, Expos, Clipboard, Virtual Keyboard, IMs
    - UNRL_CURSOR      Cursor shape and attached objects, e.g. Drag'N'Drop
    - UNRL_SCREEN      Display Locking, Screensaver
    
    The Frame Region consists of these UniqueFrameLevel's:
    - UNFL_BACKGROUND  Background for blended content, effects, decorations
    - UNFL_CONTENT     The actual DirectFB Window, i.e. its content
    - UNFL_FOREGROUND  Decorations, effects, any other content overlay
    
    Added "uwmdump" in the flavor of "dfbdump", but not showing much, yet.
    
    Added debug domain and messages to StReT Iteration code, along with support
    for the new level feature.
    
    Enhanced "stret_test" to check for correct implementation of multiple levels.
    
    -
    
    Added a CoreWindowConfig containing position, size, opacity, stacking,
    options, events, color key and opaque region.
    
    Added dfb_wm_set_window_config() to change any combination of the different
    settings with one call. Current implementations, however, simply iterate over
    each entry, e.g. still two window stack updates for changing position and size.
    
    Removed dfb_wm_move_window(), dfb_wm_resize_window(), dfb_wm_set_opacity()
    and dfb_wm_set_options().
    
    Added dfb_wm_set_active() to notify the window manager about layer context
    switches, e.g. switching to a full screen application.
    
    In dfb_layer_context_activate() and dfb_layer_context_deactivate(): replaced
    calls to dfb_windowstack_repaint_all() and dfb_wm_flush_keys()
    by dfb_wm_set_active().
    
    Replaced dfb_window_set_options() by dfb_window_change_options() which takes
    two bit masks: one for clearing bits and one for setting bits afterwards.
    
    Added dfb_window_change_events() in the same flavor.
    
    -
    
    Added debug domain to the main file of fusion.
    
    Minor API cleanups, e.g. adding return values (DFBResult).

commit 0c23dc54c9a9bc625ba821b90feeaeb8445f67b8
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Nov 6 13:33:39 2004 +0000

    Attempt to make the driver work with GeForce3/4 and XBox.

commit 61f28b7d386332698e1dab4df0bb43a0208d3430
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:16:31 2004 +0000

    Added DWET_NONE.
    
    Clarified two statements.

commit 66f665d11701633bc367af5c13070b92a71349a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:14:06 2004 +0000

    Added
    - DFB_RECTANGLE_VALS(r)
    - DFB_REGION_VALS(r)
    - DFB_REGION_VALS_FROM_RECTANGLE_VALS(x,y,w,h)
    - DFB_REGION_INIT_FROM_RECTANGLE_VALS(x,y,w,h)
    - dfb_rectangle_from_rectangle_plus_insets(dest,source,insets)
    - dfb_region_region_intersects(r1,r2)

commit fc227db2ca95117307b2f22ddd5df5ab3f23e1da
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:10:08 2004 +0000

    Some debug messages in Destruct().

commit 994af0398a72e7b0f9300abd6e1f963274039842
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:07:38 2004 +0000

    More debug messages during pool destruction.

commit dc6ea7a11c3294f0aadfe853a9aece51e99d7c4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:06:30 2004 +0000

    Send SIGKILL to the process group instead of the received signal at the
    end of the handler.

commit c7aec808f65ad07c39c09c9c885df31845b959d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:05:26 2004 +0000

    Fix endless recursion if warning about the number of frames
    is printed while printing a stack trace.

commit 9f56d78b1b1e4e9d09208c92773048154f3611d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 6 08:03:20 2004 +0000

    Added D_MAGIC_ASSERT_IF which doesn't fail if the pointer is NULL.

commit 66ce447fb6c36197cd002a34835280ecdcbee8b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 5 20:44:15 2004 +0000

    Build tools before wm.

commit 481c314144166b7b22174e4d42023bf558f334d4
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Nov 5 17:51:39 2004 +0000

    Partial rewrite of the nVidia driver:
         - all drawing blend functions are supported,
         - StretchBlit supports RGB16 now,
         - added a really fast Flip() function,
         - experimental WaitForSync() support.
    
    Switch to version 0.3.

commit db650aca44d4868d3de12d7eb747388e4d659a8c
Author: Michael Natterer <mitch@directfb.org>
Date:   Fri Nov 5 14:26:10 2004 +0000

    - renamed conditional DIRECTFB_CSOURCE to BUILD_DIRECTFB_CSOURCE
    - check for directfb-csource in PATH if we are cross compiling or
      building --without-tools
    - use the directfb-csource from PATH only in the above cases and use
      the one from $(top_builddir)/tools otherwise.

commit 0b04d88319b79642092304c728c4b3bf4fa4471f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 5 13:07:08 2004 +0000

    Use old allocation behaviour, but fix the static assignment of Sacc and Dacc.

commit 6f8a1aff2f008a6d5b53ec87b6f1b0f145aa397f
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Nov 5 11:04:08 2004 +0000

    BugFix:
    since gfxs->Sacc of gfxs->Dacc may point to gfxs->Aacc, allocate
    the accumulation buffer when the Swrast histance is created and use
    realloc to resize.

commit 92b71fd51b0490cc463666ef6d0b6307e1cd3c49
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 5 01:45:48 2004 +0000

    Removed FusionResult using DirectResult instead.

commit 367016d1af6378321c528f08c66ec17e2d55dfb1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Nov 4 15:35:21 2004 +0000

    Primary mouse should actually be a mouse.

commit 63291c3f80c39beecd0084379f33b26905bd8e6e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 4 05:46:21 2004 +0000

    Thanks to Bryce Nichols <bryce@bnichols.org> for reducing the hardware
    rounding errors in 16 bit mode by rendering the upper left and lower right
    triangle pair instead of the upper right and lower left.

commit 30bb86d7011b05b7fd6e6176c6ccd0fbe7d8a0e3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 2 16:12:38 2004 +0000

    Added missing includes.

commit 7c8473d0795aa5ef859d946303fada9a39056faf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 2 16:11:51 2004 +0000

    Moved D_FORMAT_PRINTF to <direct/messages.h> again.

commit f0d5db467127dfe01338ebcaf5e29ed2d8b519b8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 2 15:55:11 2004 +0000

    Renamed DIRECT_BUILD_NOTEXT to DIRECT_BUILD_TEXT.
    
    Exclude debug message functions from the library
    if DIRECT_BUILD_TEXT is false.
    
    Always enable magic handling macros, because
    - just setting and clearing the magic in non-debug mode doesn't hurt
    - DIRECT_FORCE_DEBUG works for magic assertions again
    
    Renamed all flag manipulation macros, using the prefix "D_FLAGS_" now.
    
    Moved D_FORMAT_PRINTF(n) and D_CONST_FUNC to <direct/util.h>.
    
    Added D_ARRAY_SIZE(array).

commit 74955c65a1b512a8a0cbd809f1cf65c862eaa570
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 23:09:12 2004 +0000

    Ensure minimum region sizes at least (1x1).

commit a55745305b000efb3d3fe1f70823e76119f6f7ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 22:49:29 2004 +0000

    Added dfb_window_set_options() which calls the new window manager function
    SetOptions() to keep track of and control changes.
    
    Update region flags when the window options are changed.
    
    Update window border region layout when the window is resized.

commit 57f946df5673e8a55501051c4ede1cd5c22b884a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 18:37:25 2004 +0000

    Fixed author parsing (did the cvs log format change?).

commit a351585cc9167aa6e2602dd86f8caab708930465
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Nov 1 16:57:29 2004 +0000

    If core/state.h includes gfx/generic/generic.h then generic.h must be
    installed.

commit 360070605ec1f6c2ad8193a706a32baad1984f84
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 10:13:41 2004 +0000

    Pass the CoreLayer to IDirectFBWindow_Construct() which
    doesn't require the internal layer header anymore, removed FIXME.

commit beda24ea9fa888264b1f6a38306a909fee53326c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 10:00:11 2004 +0000

    Allocate accumulators dynamically, removed FIXME.
    
    Accumulators are allocated upon first usage.
    Subsequent usage can only grow the accumulators.
    
    Sizes allocated are 256 at least, otherwise power of two. This should
    guarantee that there are very few (re)allocations, even in the worst case.

commit b27f104b1bfcf071554e5a9e89c2225453da5ce5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 09:13:31 2004 +0000

    Implemented Sacc_toK_Aop_rgb24() correctly, removed FIXME.

commit fcabef16dded69b6a5e4d08d33ed49fb8d64c54d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 09:06:59 2004 +0000

    Added Sop_rgb332_SKto_Dacc(), removed FIXME.

commit 1144015f65718c33dbd79086cc5832af738089de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 08:59:08 2004 +0000

    Killed another FIXME: Implement Bop_a8_set_alphapixel_Aop_rgb332() correctly.

commit e14006b2865d67eef93f607ad4b290de1e293fe5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 08:16:14 2004 +0000

    Removed a FIXME: Pass a valid core to dfb_core_is_master() and turn
    the assumption "core != NULL" into an assertion.

commit 6f9a2176b2c3aac4946381828adadecd679d88cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 07:55:59 2004 +0000

    Implemented software clipping for hardware accelerated DrawRectangle().
    
    Use hardware accelerated FillRectangle() if DrawRectangle() is not accelerated.

commit 0a5cfe68edceb68509b90c60ca36245f4495a5c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 07:01:45 2004 +0000

    Replace gDrawLine() usage by gFillRectangle() in
    software based rectangle outline drawing code.

commit 29cb9ae3a4b122dfc4c30796efaaec3a87df3a68
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 06:34:43 2004 +0000

    First version of builtin window borders implemented by the "foo" class.
    This is just for testing and will be replaced by a more flexible approach.
    
    Use *much* simpler and cleaner recursive code for stret_region_visible() and
    stret_region_update() by separating their linear components from the recursive.
    
    Added functions for StReT iteration using one struct to hold the current state.
    This code is the linear part of the recursive functions mentioned above.
    
    Added small test program for StReT iteration code.
    
    Added default StReT region class to be used for "containing-only" regions
    which don't have any input or output themselves (only their children).
    
    Added stret_region_at() used in window_at_pointer().
    
    Added stret_region_get_size() and stret_region_data().

commit 6298ace03112c3a6b5d5a11f715bf710553afa9c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 06:12:22 2004 +0000

    Added DWCAPS_NODECORATION, e.g. used for the cursor window.
    
    Preliminary and testing, might be changed.

commit 7cedf18f34f517c9e0fe992521efa7271f1eb1f1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 06:10:38 2004 +0000

    Replaced dfb_gfxcard_fillrectangle() by dfb_gfxcard_fillrectangles().

commit cd460b4a513ea758887f10b48d869c84160b72cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 1 05:53:09 2004 +0000

    Added dfb_rectangle_region_intersects().
    
    Added 'const' to dfb_region_intersects() parameter.
    
    Added some DFB_REGION_ASSERT where appropriate.

commit d7b3a6c73e52830617e085c532cf0ea696f79eb9
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Oct 31 14:33:51 2004 +0000

    Re-enable double/triple buffering.

commit 31b8cfbc1dfb0b84e61c8b53cf215257fb51027e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 30 20:02:46 2004 +0000

    Removed StReT stuff from default window manager module.
    
    Forked a new window manager module with the new StReT stuff.
    
    The new window manager consists of the wm module that is plugged into
    DirectFB and a library that contains the wm implementation. This library
    can be linked into programs, like in the "test_color" example which
    changes the global window border color. This test will be removed and
    replaced by a more sophisticated configuration system.

commit 5110b85cf2f58c5d686a14d078494c1edbfe4ab7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 30 19:52:05 2004 +0000

    Added fusion_object_globalize() doing the often used combination of
    fusion_object_link() and fusion_object_unref(), i.e. increasing the global
    reference counter and decreasing the local reference counter.

commit d4186985036bf3aac3fe22cfcd6dd70621463e8f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 30 19:50:45 2004 +0000

    Align debug output of domains.

commit 030682f88cc0bcb344cb007fff52281f1d2e40f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 30 19:50:12 2004 +0000

    Added debug domain.

commit eb3b21e5dcfcb66e2bcffb42af6c73118bcc6147
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 30 17:38:46 2004 +0000

    Commented out call to missing Gal_set_source_transparency().

commit 07993fffa1496b0d7b6bd2a1145ee378aa1ba941
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 28 01:32:17 2004 +0000

    Use RTLD_NOW to detect undefined symbols before the module is used at all.

commit f7a63c08fcba8c08b42eea1eedd6a9b12beed5fb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 27 23:40:31 2004 +0000

    No longer show MMX in core info line, but show debug / trace build.

commit 7a5d89ba08bd57b4763ce04b5fbf9b3641438247
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 27 23:33:33 2004 +0000

    Fixed missing MMX initialization in slaves, only the master used MMX before :O
    
    Fixed missing card capabilities in slaves with acceleration enabled,
    if the master has acceleration disabled.

commit 1aad6a601f842a1c58c276ce359bb9f27862a71c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 27 20:28:13 2004 +0000

    In shared memory summary also show the total amount without pixel buffers.

commit 001260835423a2df1763936666824fc0ec020283
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 27 17:49:49 2004 +0000

    Added DFB_VERSIONMISMATCH error code.
    
    Added DFBInsets specifying a distance from each
    edge of a rectangle: left, top, right, bottom.

commit 9eb68b9b08579e8fab6b6b2ee099aa79eeecbe56
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 27 17:46:51 2004 +0000

    More convenience:
    
    DFB_RECTANGLE_ASSERT(r) and DFB_REGION_ASSERT(r) fail if 'r' is NULL
    or if the coordinates are illegal, e.g. negative width or x1 > x2 etc.
    
    DFB_RECTANGLE_ASSERT_IF(r) and DFB_REGION_ASSERT_IF(r) don't fail
    if 'r' is NULL, but fail if 'r' is set with illegal coordinates.
    
    DFB_REGION_VALS_TRANSLATED(r,x,y)  (r)->x1 + x, (r)->y1 + y, (r)->x2 + x, (r)->y2 + y
    DFB_REGION_INIT_TRANSLATED(r,x,y)  { DFB_REGION_VALS_TRANSLATED(r,x,y) }
    
    DFB_REGION_VALS_INTERSECTED(r,X1,Y1,X2,Y2) in addition to
    the existing DFB_REGION_INIT_INTERSECTED(r,X1,Y1,X2,Y2).

commit 9a5ec2cfebc9ca9591abf645d17a6528c6030086
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 27 17:38:00 2004 +0000

    Exclude D_MAGIC_ASSERT & Co from DIRECT_FORCE_DEBUG enabled macros,
    because the magic value might not be set by other code compiled without
    debug macros.

commit c1613c8ddfa4d3c15618d9e0e7f1ad1e2ea4d84e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 27 03:31:30 2004 +0000

    Fixed typo: DSOS_YC -> DSOC_YC.

commit fbde562b5c4e094f6d103e07a49f5d008106b64f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 16:10:33 2004 +0000

    Rewrote the recursive window stack update code in a reusable form.
    
    Those regions of the window stack being transparent, opaque, shaped etc.
    had been each window itself, but the new code allows to have a complete
    hierarchie of those regions.
    
    Therefore, the new code is all about the 'StReT', the Stack Region Tree.
    
    Right now, there's one StReT Region for each Window, but window borders
    are coming soon and each Window's StReT Region will be embedded into the
    border's StReT Region, either as a child or a sibling.
    
    Currently, DWOP_OPAQUE_REGION is not working. The complicated code for
    opaque sub parts has been removed. Instead another StReT Region has to
    be created as an opaque child region of the transparent.

commit f8fe6ebbdb53e84cfc0bc3cc651eab0b181819b0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:49:14 2004 +0000

    Added some macros and static inline functions for convenience:
    
    DFB_RECTANGLE_VALS_FROM_REGION(r)   (r)->x1, (r)->y1, (r)->x2-(r)->x1+1, (r)->y2-(r)->y1+1
    DFB_RECTANGLE_INIT_FROM_REGION(r)   { DFB_RECTANGLE_VALS_FROM_REGION(r) }
    
    DFB_REGION_VALS_FROM_RECTANGLE(r)   (r)->x, (r)->y, (r)->x+(r)->w-1, (r)->y+(r)->h-1
    DFB_REGION_INIT_FROM_RECTANGLE(r)   { DFB_REGION_VALS_FROM_RECTANGLE(r) }
    
    DFB_REGION_INIT_INTERSECTED(r,X1,Y1,X2,Y2)  {
    (r)->x1 > (X1) ? (r)->x1 : (X1),  (r)->y1 > (Y1) ? (r)->y1 : (Y1),
    (r)->x2 < (X2) ? (r)->x2 : (X2),  (r)->y2 < (Y2) ? (r)->y2 : (Y2)
    }
    
    dfb_rectangle_translate(), dfb_region_translate(), dfb_rectangle_resize(),
    dfb_region_resize(), dfb_region_intersects(), dfb_region_clip().
    
    Removed obsolete dfb_get_millis() and dfb_get_micros().

commit 2b8dac1f42e36f8f4422c5c8b8319117da90115c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:44:20 2004 +0000

    Cleaned up tile blitting a bit.
    
    Two steps added for performance:
    - Check if anything is drawn at all before looping through tiles.
    - Modify coordinates to exclude fully clipped tiles from loops.

commit b7b651e02dbd72bd8e22b7a7edab0f86d7594b38
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:41:02 2004 +0000

    Follow const change.

commit 67077e82fee78226644eba2ddd639f3a8e047603
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:40:26 2004 +0000

    Added "const" to UpdateRegion()'s "region" parameter.

commit 53795be1d6baff38e9630887ba5b441c980de171
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:37:20 2004 +0000

    Use direct_clock_get_millis() instead of dfb_get_millis().

commit de8b5719dbda68c5c52fc2ce4ecb03bd96120183
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:33:05 2004 +0000

    Added an assumption to D_MAGIC_SET that the magic value is not set already.

commit 583f014cf9de90e08d72958a6e7d08970afb0bab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 26 15:31:43 2004 +0000

    Added D_DERROR(ret,message) which acts like D_PERROR(message), but takes
    a DirectResult (DFBResult) instead of using errno.

commit dc498e8cd3020a4482113a9c718ce7aad4909ca1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 23 16:37:10 2004 +0000

    Hopefully fix single buffered window updates again.

commit f58308d86655010799c6c17c0220a0df659d02ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 23 14:52:00 2004 +0000

    Create regions with opacity 0.
    
    Implement SetOpacity using DLOP_OPACITY, if available.

commit 6a4ce6fbbe9d584744b07775e918d8ed939ea370
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 23 14:04:09 2004 +0000

    Inherit DLOP_ALPHACHANNEL from layer context config only if the region that
    is to be created for the window has a pixelformat with alpha.

commit d0caaac3324667bc72f89b58024c04021d4d751e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 23 13:08:06 2004 +0000

    Starting revival of DLBM_WINDOWS.
    
    A layer regions is now created for each window in the desired size and
    pixel format.
    
    Moving windows (regions) around is working, too.
    
    Flipping the window surface flips the layer region.

commit cb9c07f7c7c33f70f972bca573b0443035061c0c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 23 01:19:11 2004 +0000

    Use debug domains.

commit 2eb33ae1e66d5fbeb9c3465b9be99ed7b783ab41
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 20 20:02:18 2004 +0000

    Added texture LUT support and some other 8bpp improvements.

commit 7429ea957c5408f66f5201cad7eaeabaab2387d8
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 20 18:48:01 2004 +0000

    The fb.offset trick should only be used on G400/G450/G550.

commit 62e4c3d7165350c6fa67cb958392becbeaba4691
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 20 16:30:18 2004 +0000

    FIxed mixup of true and false for DIRECT_BUILD_GETTID.

commit 3679007f7faf73df5e14620276b48b3343c93f41
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 16 02:17:05 2004 +0000

    Removed newline.

commit 49711caa4aea6e445a119680b8163509d7a900c8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 16 01:54:59 2004 +0000

    Made bug messages much more verbose.

commit 23d3e3acd74dd88da8754d773165e1750a90bc54
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 16 00:44:11 2004 +0000

    With "--disable-gettid" one can enforce usage of getpid(),
    e.g. on broken systems where gettid() simply segfaults,
    though the system call is in <linux/unistd.h>.

commit 21b0e45b5959b29cac98314059461549a2058fa4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 16 00:12:46 2004 +0000

    Forgot to increment core abi.

commit d1187d5755d900a5ccf5a8c67312aed120e7edce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 16 00:11:30 2004 +0000

    Changed color hash size from 2777 to 823.

commit 4e52452ae9e46ca2faa6abbfc8c760acf8d2d559
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 22:51:20 2004 +0000

    Old debug messages (D_DEBUG) should be grouped in domains (D_DEBUG_AT).

commit 99081b0c02f8acf9739b81b4c0c3ab48459ac7d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 14:38:09 2004 +0000

    Wait for only the last write operation queued for a buffer,
    if the software needs to access it.

commit 83942cc150d57499d696687054011c49714bf708
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 14:05:56 2004 +0000

    Show TV Standards only if supported.

commit 764ef719755c598af031a8e0cec8017949b9c66a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 13:53:53 2004 +0000

    Store the serial of the most recent accelerated graphics operation that has
    been queued for writing to a surface buffer.
    
    dfb_layer_region_flip_update() is no longer waiting for an idle accelerator,
    if the buffer that is becoming the front has or had a write operation queued.
    
    Instead it waits exactly for the last operation that is or was about to write
    to this buffer ;)
    
    If WaitSerial() is not supported by the driver and/or hardware, the fallback,
    of course, is to wait for each and every operation to finish.

commit 3da67648121d97caa3f40efa6fa04f09f3bfa4f0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 01:13:52 2004 +0000

    Fixed a newline.

commit af632aedeac24b708d976f7471960e34aacecec2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 00:59:26 2004 +0000

    Added supported output signals to encoder description.

commit 12f8d877abc8afd008522d87eabbd7bf8ffcb451
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 00:38:05 2004 +0000

    Minor fix to mixer info.

commit a361ac0c9162a9b72262dec4ca44a99999e9f03e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 00:35:52 2004 +0000

    Added DFB_DISPLAYLAYER_IDS_MAX.

commit ba69d611e30c10ea39a8592a743ca66cb195e132
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 15 00:31:14 2004 +0000

    Added some notes about --enable-multi, --enable-debug and --enable-trace.

commit 4d14d1e65213338b35a481cee9a73fa277aedfab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 14 23:52:10 2004 +0000

    Fixed segfault during cleanup in single app core.

commit 84878f5474de957f4c3762867e38a4cb89b372e0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 14 22:56:57 2004 +0000

    Reduced layer id mask from 64 to 32 bit.

commit 97471a2f2a1b9530f56f2f047220e69e43203737
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 14 22:56:42 2004 +0000

    I thought I already removed that...

commit f64f088f9f8a644d553eac192117f8f83bb8f4a4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 14 22:51:39 2004 +0000

    Removed superfluous argument.

commit 53089c1b9f0296def114871821183e0dfb341bef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 14 22:38:36 2004 +0000

    Show mixers, too.

commit fad9dd12d34b948b843b0babd27f9439ab1e4009
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 14 21:58:33 2004 +0000

    Fixed DSECAPS_MIXER_SEL.

commit 5d6e2dafb08197bbdd3c76b5cd9a54d48f335a61
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 13 17:12:04 2004 +0000

    Added DirectFBScreenMixerCapabilitiesNames.

commit f516b416953109ff1bdb56f53b63f7bca9918968
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 13 16:26:30 2004 +0000

    Clear description on the stack.

commit 6313a485a793a94544854261708035571ccbfc7f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 13 16:20:57 2004 +0000

    Added some assumptions about the combination of capabilities and number
    of mixers, encoders and outputs.

commit 535918aa3386a1b5808d194fa26f9515ceea5e83
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 13 13:09:23 2004 +0000

    Added an assertion.

commit 4dcea3a508d6774ee5c06f2f83f71e6dd196c9b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 13 02:49:58 2004 +0000

    Applied patch from "Oskar Liljeblad <oskar@osk.mine.nu>"
    which adds the configure option "--disable-sonypi-jogdial".

commit ca58ee9095009ba221522a60e1186c40280097c7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 10 08:51:49 2004 +0000

    Thanks to "Tom Bridgwater <genuss@gmail.com>" for pointing out a
    memory leak during vector resizing.

commit dd6c4be9f9d1fc4988189fd4195f0e9c0734a916
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 10 05:17:29 2004 +0000

    Added "nowrap" to title.

commit 85f75711418b5624f472cf34b5d26f8d69a1d5b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 9 02:28:43 2004 +0000

    Fixed missing "-ldl".

commit fbfe7ebb2bdd109a6767c56152628170151f94dc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 9 02:26:26 2004 +0000

    Commented out static/shared settings for Cygwin. For a strange reason
    the settings are always made.

commit 864eb8f86c833a0efc1a8a6b685c5b822efa5f73
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 9 00:55:16 2004 +0000

    Use strrchr() instead of basename(), because <libgen.h> is not present in Cygwin.

commit a3bddc90e844a0a9acd7832e01af061587ebc0c3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 9 00:53:21 2004 +0000

    Removed apparently unused <sys/user.h> which is not present in Cygwin.

commit f3d1da4c340f9dbfe6864a72780213095c4061fb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 9 00:13:49 2004 +0000

    Added ".o" support.

commit 47bd8332625db0d9c44429463e7d474ea859f1f2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 9 00:00:44 2004 +0000

    Added ".o" support for gfxdrivers.

commit d147ceb5b907a65deb98c3b59de55cc47f29bdb2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 23:51:42 2004 +0000

    Added missing ".o" for OSX.
    
    Added missing "if BUILD_STATIC" to SDL.

commit 56a1c5e824903c7492c7d5d800e5d732f38bb8b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 23:39:23 2004 +0000

    Use new ".o" versions for all modules except input and graphics, which
    don't have ".o" versions, yet.
    
    New option "--voodoo" prints out all modules for statically linking in Voodoo.

commit b38bb6323c2862d448f2c9c10294918a9a4cf755
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 23:10:36 2004 +0000

    Added ".o" versions here, too.

commit f0c5bb5211e8f8c68173875a424489d4693f1a47
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 23:01:56 2004 +0000

    In static build mode, add an ".o" version of the ".a" module file.
    
    Applications can link statically against the ".o" files without having
    to specify an extra linker option for each module, e.g. "-Wl,-udirectfb_sdl".
    
    The same support will follow for gfxdriver, inputdrivers and proxy modules.

commit d897f15b75a3f9275511ed91d7fa2ff12be91e40
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 22:40:22 2004 +0000

    Detect cygwin, default to static builds and don't require libdl.

commit f72307ea5869a4ed49ed305d9a53ddd1ae2d19fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 21:17:47 2004 +0000

    Include <linux/compiler.h> to fix compilation of 2.6.8.1 <linux/videodev.h>.

commit 2258eaf46d681cea4cf7dc647859bdcefd13d329
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 8 20:58:58 2004 +0000

    When specified use the pixelformat of the surface description
    to create a windowed primary surface.

commit 26d39894366afee2d5faffbb1f10fb1b492519f8
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Oct 6 16:51:30 2004 +0000

    Added sysfs support.

commit 94520969d3e0659c23e7e1c4432b47b9f87ac100
Author: Andreas Kotes <count@directfb.org>
Date:   Mon Sep 27 13:22:24 2004 +0000

    revise accidental commits

commit 0bee6d2d618c8255f9e74b4925769f24ca351534
Author: Andreas Kotes <count@directfb.org>
Date:   Mon Sep 27 13:21:12 2004 +0000

    input device stuff

commit d05e9f6175c229a3e7f9e40c2cf445673c1fa417
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 27 13:00:44 2004 +0000

    Removed two obsolete entries.

commit 847e473ed1f5b603392c223368669b2911d277b0
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 27 08:35:15 2004 +0000

    Added nvidia_tables.h.

commit 92f123078c92f0888bae19a0d2b5de2fe31e0fbc
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Sep 24 07:08:33 2004 +0000

    Fixed PVIDEO limit (maximum memory offset is 0x07FFFFC0).

commit 048ace6341f78ec00d3490efeac15e9add447911
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 23 06:54:18 2004 +0000

    State handling hot-fixed and optimized.
    
    Corrected all pixel format settings in the tables, but StretchBlit()
    still doesn't seem to work with RGB16.

commit 7e75f79353cdcf719b9a3c1c6d143a958422a431
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 22 10:22:12 2004 +0000

    Added "<Meta>-<BackSpace>" debugging shortcut for
    dumping the stack of each thread of the master process.

commit 4d40e2d7bdc5ed0729ef341e0526298153611eb5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 22 10:19:47 2004 +0000

    Show file descriptor debug messages only if heavy debug mode is on.

commit 2e3cffdf684c454b69185c12cb83af37374e7726
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 20 07:58:05 2004 +0000

    Always update alpha value when blitting/drawing flags are set.

commit 0695114645cc9d8e3eb7843f088404eed9d8554c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 11 12:00:32 2004 +0000

    SetSourceRectangle works now.

commit 316c5021c6edf470689ef3fa9e6a20a577c54326
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Sep 9 18:00:26 2004 +0000

    Small adjustments.

commit 9c4891499c8e092ab62ee83ec343b398d32210ac
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Sep 9 14:14:58 2004 +0000

    Added support for Destination ColorKey.

commit 12330221f61b86dc1305f02951f1ae495bcdb0bf
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Sep 9 09:15:35 2004 +0000

    Many corrections.

commit d7b01e0701dac8e42c4162c715816c5bb152c623
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Sep 7 12:43:29 2004 +0000

    Added README for rivafb-smemlen patch.

commit a3ca961253036221a8f4fc1ba9b97f3adde13008
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 6 11:09:38 2004 +0000

    Still on StretchBlit source point: not the best way, but works.

commit eb5392f197b9d4e5c1cca466289f95c2d677f405
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 6 10:29:34 2004 +0000

    Workaround on StretchBlit source point.

commit 9c77c849c96cf509974ea62780f1a92c691373ed
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Sep 6 08:46:36 2004 +0000

    Added missing ';'.

commit 495b05375e7364fedb16a30117a4a977e3a3cdf1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 6 02:05:50 2004 +0000

    Fixed Sop_argb1555_to_Dacc() which didn't evaluate the alpha bit.
    
    This should fix blending and other effects from and/or to ARGB1555.

commit 386bff2285fe26efb285b23761a58499e460e1ae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 6 01:06:57 2004 +0000

    Fixed destination color keying for RGB16. Two pixels are compared at once,
    but if only one pixel matched, it wasn't written.
    
    Implemented destination color keying for ARGB1555.

commit 34986942f75ee05a60049d4dc3e03f01188956d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 6 00:37:15 2004 +0000

    Fixed Bop_rgb15_SKto_Aop(), that's in english:
    
    StretchBlit with color keying from ARGB1555 to ARGB1555 dropped the alpha bit!

commit b057d533c103acde02df60c4900df90828bbb967
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sat Sep 4 11:11:59 2004 +0000

    Small fixes.

commit 9540a7fd004bc635d1f9b0a11dcacaed755f9013
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Sep 4 03:15:02 2004 +0000

    Thanks to "Tom Bridgwater <genuss@gmail.com>" for this nice patch that
    adds support for SDL wheel events translated to relative Z axis motion
    events (like all drivers with wheel support).

commit 51dc332295490261709738df409957714a01b4c7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 3 16:36:27 2004 +0000

    Added 'Claudio Ciccani <klan82@cheapnet.it>' to "Thanks To" section
    and "Helping Developers" for the nVidia driver. Keep up the good work ;)

commit 092fb9dd484fdc1deb50593542260da97e37ad58
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Sep 3 15:19:20 2004 +0000

    Set alpha value only when using transparency.

commit cdc5232f68567f946586b338f566319cb8acfb4c
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Sep 1 17:07:58 2004 +0000

    Implemented alphablending (coloralpha for blitting and srcalpha/invsrcalpha for drawing).

commit 8e6c64b05387e80d91a7ea51964d32506a354c1b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 31 07:40:10 2004 +0000

    Perform PVIDEO initialization.

commit 3286a4b852ac735f90f1a8eee0c855ced2b6f36e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Tue Aug 31 07:39:02 2004 +0000

    Added UpdateRegion and support for adjusting Brightness, Contrast, Saturation and Hue.

commit 854e7343e20b617e46f775567fb0454cc8e459e1
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Aug 30 15:56:46 2004 +0000

    This patch fixes a bug in rivafb:
    the driver returns all videoram as usable memory while 128 Kb at the end are not usable.

commit f2fa8d46fd669926f2078028d04d7fbd32be0f04
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Aug 27 06:31:45 2004 +0000

    Disable draw/blending until we have more.

commit 93041ba7e24756812419e73e47eb986428062f6a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Aug 26 17:17:42 2004 +0000

    Added support for YUY2 and UYVY on primary layer.

commit ccfb3c37aac2436519f26f830c75ce4a369b5c21
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Aug 26 14:13:29 2004 +0000

    StretchBlit supports ARGB1555 now.
    Added support for blit with conversion (ARGB1555,RGB32,ARGB to all).

commit 825dd975904d25d3c21d64982702faace6004376
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Aug 25 21:24:32 2004 +0000

    Now StretchBlit works at least at 32bpp.
    Initial support for blending functions (only DSBF_ZERO).
    Some fixes and clean-up.

commit 08cdc18274eccc65c8978908c72fbfec81aac32d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 23 11:29:48 2004 +0000

    Removed debug printf().

commit b7ec3e8259c0a499e940cf4fc539183ad549813a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 23 10:06:48 2004 +0000

    Start with object ID '1' to reserve '0'.

commit 0764135cdef22742ebe01a1cd70bb4eba300569b
Author: Claudio Ciccani <klan@directfb.org>
Date:   Mon Aug 23 08:47:27 2004 +0000

    Added support for ARGB1555, RGB32 and ARGB.

commit 903b1915fb87581a85c22101b5fae4d5edccbfab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 22 22:26:51 2004 +0000

    Added CLRCF_SURFACE and CLRCF_PALETTE to avoid setting the video mode each time the palette is changed, especially with df_palette example.

commit 0501dfb8e54e86c2b3732c6ffea3257b1ab37860
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 22 22:18:51 2004 +0000

    Added some D_ASSUME to check the clipping region in dfb_gfxcard_state_check().

commit 114ba86e1c64c8cdb4321caf740568391b16fcc9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 22 22:16:58 2004 +0000

    Show stack trace upon timeout waiting for empty read buffer.

commit 87932454370e833e1305721add6b802057494aa6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 22 22:15:36 2004 +0000

    Use CoreLayerRegionConfigFlags instead of DFBDisplayLayerConfigFlags.

commit 5d379c4b61874dc3f6ded589c8f9c2e860ce85bd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 22 22:10:10 2004 +0000

    Removed empty besAddRegion(). It's not required.

commit 51aacaa25a47346a09a8d137f483f1018dde0642
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 22 22:06:22 2004 +0000

    Ported to new driver API.

commit ee528e1c29f18791f4eb5c7d82adc93ee98d3dc7
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Aug 19 15:42:09 2004 +0000

    - support for cursor keys

commit 616cad7dda601c2a20a75ef774ecefb518db4d6b
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Aug 19 14:29:05 2004 +0000

    - support for key repeat
    - support for the left mouse button (no mouse motion)

commit 171919f4ca0ddb0f05e4aebb3821f97bfc8750ec
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Aug 19 13:55:10 2004 +0000

    - allocate four more bytes for images beeing loaded and scaled, this is
      a workaround for a longstanding off-by-one bug in the scaling code
      in src/misc/gfx_util.c which seems to tap one pixel behind the allocated
      memory. this fixes problems on darwin/osx which has obviously more preceise
      memory protection.

commit 5a1548653580114cb0f005833a34c280ced7605f
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Aug 18 17:04:46 2004 +0000

    just assign the charCodeMask to the key symbol for now.

commit 7c7229870507c287ef18806c2d985b2b452d62fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 18 16:01:25 2004 +0000

    Added shmalloc/shfree benchmark.

commit 8f78bc8cd09a3316fbf950e1f094a3cb1d73761f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 18 15:59:25 2004 +0000

    Added direct_pagesize() which returns the value from <asm/page.h> if present,
    otherwise it falls back to sysconf() which is not suitable for cross compiling.
    
    Use direct_pagesize() in fbdev code and reenable the new mmio code.

commit bd892091fca1549bf4bedcb09933c61735982094
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Aug 18 15:19:34 2004 +0000

    added support for FRONTONLY primary surfaces. this writes directly to the framebuffer. (df_dok works somehow now)

commit 86127909ee3fb059eaf1f9d965b65b2520a6d123
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 17 19:58:03 2004 +0000

    A small debug printf, sorry.

commit 9e64bb54c068f6060616297f8dde82794d845fd0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 17 17:02:07 2004 +0000

    Better style of using references.

commit 8cd0f1851f1ddc01e7456a45ffc0a08dbe891758
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Aug 17 11:24:34 2004 +0000

    forgot this file

commit cbe9cfd0446bfa8c6fcd18b7cbc805566eec9b5d
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Aug 17 11:23:54 2004 +0000

    - added native osx system. yes osx support without SDL.
    
    what works:
    - fullscreen
    - mode switching
    - keyboard (keys a-z only)
    
    TODO:
    - make all keys working
    - support frontonly modes
    - cleanups
    - joystick support
    - mouse support
    - window mode

commit dd69544f332c1d05c9d6859942ddf12e395d0af5
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Aug 17 11:20:43 2004 +0000

    fixed typo

commit 9f90b6afdf794932392ff9a506bef4c18c68c3ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 16 15:35:44 2004 +0000

    Temporarily comment out mmio alignment patch for debugging.

commit 5234526f633b1fc1eb0e78ae794aa23ea0265db8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 16 15:13:59 2004 +0000

    Added parentheses to conditional statement in system_map_mmio() to be sure.

commit 0ea07c711878b7711671da189b48eff2bc2fb2c4
Author: Andreas Kotes <count@directfb.org>
Date:   Sun Aug 15 13:35:48 2004 +0000

    fix message

commit 54a2b593e44cb9801a85532e174fe4a993e05f66
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Aug 13 13:12:25 2004 +0000

    do not report unknown event for JS_EVENT_INIT. print note about calibrating
    the joystick using 'jscal' instead.

commit 4aac0769b2702918e60818b1fb54b6a318d41e78
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 13 10:37:41 2004 +0000

    Why has dfbsummon been in non-installed LINUX_ONLY_TOOLS?

commit e34adb81a0e92aaa47471e3c376e5bdd2b5fecc4
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Aug 13 08:53:26 2004 +0000

    Fix for mmio alignment on mach64.

commit 28eb2c80f4f10ee9afaaf726a2f7f0178caefdb8
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Aug 13 04:37:09 2004 +0000

    Open /dev/tty and /dev/tty0 as read-only.
    
    dfb_vt->fd wasn't being closed with no-vt-switch.

commit d5ca83dec701550826dc8adc5037f8fbb1064c9f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 10 10:10:29 2004 +0000

    Fixed NULL pointer check in dfb_gfxcard_wait_serial().

commit ff188ec45bd74ca2ec2396452aec6a6fdef47434
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 9 18:36:35 2004 +0000

    Added crtc2GetScreenSize().

commit 1c1ea4d1d9938d1889b086c56e0fd3b00592ced6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 9 18:34:21 2004 +0000

    Added GetScreenSize() to the screen API to get rid off the "no video
    mode set yet" warning.

commit 2e3efaeb9f93b4c4abf58963e7a7f6f5f12d3c63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 9 16:19:52 2004 +0000

    Added new drawing function "FillSpans" which gets an y start value and
    an array of "DFBSpan"s containing 'x' and 'width' of each span.
    
    It's implemented in the core right now, using FillRectangle() of the
    drivers. For maximum performance we could add a FillSpans() function
    to the drivers.

commit f9fdf1bda973bd8c7e3272c1d951b1ecf0e3787d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 9 10:25:24 2004 +0000

    Wait for the accelerator earlier, i.e. at the beginning of Flip(),
    but wait for the one before the previous one.

commit 57f6b5975a3adbd64f3d3492efd2cd644404a01b
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Aug 8 19:53:03 2004 +0000

    More cropping fixes.

commit 63afd5369435f37da08a7f58853fc797620daf13
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 6 19:26:30 2004 +0000

    Moved storage of serial to window temporarily.

commit fd878fc3d7cc5efaf0bb483e1c8957b6e9a45cf7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 6 14:50:31 2004 +0000

    Added DSFLIP_PIPELINE for advanced synchronization with the accelerator,
    currently implemented for Flip() on window surfaces.
    
    This feature is especially for accelerators with a command buffer that
    can store more graphics operations than required to render one frame.
    
    
    Behind the scenes:
    
    Added CoreGraphicsSerial which stores the "serial" of a certain graphics
    operation and the "generation" of serials to handle more than 4 Giga Ops
    in one session.
    
    Added GetSerial() and WaitSerial() to the graphics driver API.
    
    GetSerial() returns the serial of the last queued graphics operation.
    
    WaitSerial() waits until the operation with the specified serial is finished.
    
    Added CoreGraphicsSerial to CardState. It's updated by dfb_gfxcard_unlock(),
    i.e. after issuing an operation using this state.
    
    At the end of Flip() the current graphics serial is stored and
    the previously stored serial is being waited for.

commit 2ebecce1eb1d7ba026bb604c67d234719e2c4606
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 5 12:50:43 2004 +0000

    Removed "-Wno-strict-aliasing" until a check for the gcc version is added.

commit 5aba21cfed1871d077bee1cdc70bc7c83555b429
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 5 12:42:31 2004 +0000

    Delegate writes to the file descriptor to a new thread called 'EventBufferFeed'
    to avoid dead locks in case the write() blocks.

commit ec6bcdc9473997b48ce68f0e2b3cbd5175f0e702
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Aug 5 10:28:51 2004 +0000

    describe workaround, better do not read it.

commit 1e9966fcc8de3bac17eaa860f58a8c19481b9b38
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Aug 5 10:26:31 2004 +0000

    found out why input is not working on OSX, added the following to
    README.OSX:
    
       You will notice that input does not work, that's because it seems to be
       neccessary to process input events in the thread that set the video mode.
       (under linux it works anyway but we seem to violate the specs)
    
       see http://www.libsdl.org/pipermail/sdl/2004-February/060190.html

commit b422f914168d70077f97cfc6292c86e86456c0da
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 5 08:16:37 2004 +0000

    Added "-Wno-strict-aliasing".

commit efce9da93639ec6162c56270e6e01ecfbac34602
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 5 08:05:35 2004 +0000

    Fixed gcc 3.4 warnings due to missing "const".

commit b3c2d6becb841d0773266d095754c08a376c25c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 5 08:05:13 2004 +0000

    Remove "--force" again, because it removes the file "COPYING".

commit 32e337f1b5d34393984ee127e6718f7c86cdcc88
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 5 07:51:00 2004 +0000

    Added "--force" to automake arguments for easier version hopping.

commit 4e2130a673ed7c9c6bc8a0153f75960c48a54cfa
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Aug 4 16:28:19 2004 +0000

    added some hacks for better OSX/SDL compatibility
    - added sdl libs to directfb.pc for OSX
    - added dirty "#define main SDL_main" to directfb.h for OSX, this suck because
      i have to undef it again in libdirect headers where directfb.h is still
      included.
    - added README.OSX containing instructions how to compile DirectFB on OSX
    - updated README regarding OSX support

commit d5b07a6e386e7bd5ce07b6e905c6ed87c0f9c1dd
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Aug 4 00:32:32 2004 +0000

    Screen registration was missing from system_join().

commit b6e454e10e9ddeda8b6ec801f68c78ca46b7cba4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 3 20:56:03 2004 +0000

    Don't use this driver if "no-vt" option is used.

commit 9cfca31df635281553ca167bdbe337dc42302be0
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Aug 1 21:44:18 2004 +0000

    Fixed vertical cropping.

commit 7eac2cfeff2e132884c8eb6b1a993b110b6c46d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 30 14:22:30 2004 +0000

    Added all missing va_end().

commit a612dd72d1914f5ee3702b23ca6dfbf607773175
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 18:37:49 2004 +0000

    Added (disabled) debug messages before and after write().

commit a4c7cfd9b29f3a52bf9f6a25361d08409ff314ef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 18:21:34 2004 +0000

    Fixed debug messages.

commit fc5609928469c137dd65f9eee999fb9c5916abac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 17:44:22 2004 +0000

    Don't wait for Fusion Dispatch Thread during emergency shutdown.

commit ca092ab16f19a58ac0464ab1e6e9a470d6c639eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 17:35:23 2004 +0000

    Added DSFLIP_NONE and enhanced documentation of all other DFBSurfaceFlipFlags.

commit c300b97da974cd23d7b0e7e976b76c8b0dbea8fd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 16:06:44 2004 +0000

    PostEvent() is the only method that is functional in pipe mode.

commit 535163f993d7ec106daab4ddc9eac47a3dd43dcf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 15:59:56 2004 +0000

    Added much text to CreateFileDescriptor() documentation.
    
    Made CreateFileDescriptor() turn the IDirectFBEventBuffer in pipe-only mode
    in which all other methods return DFB_UNSUPPORTED.

commit 411f56f725c7e251f64ee1d7f33d19f1081321f1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 15:11:10 2004 +0000

    Use socketpair() instead of pipe() to allow bigger buffers.

commit a3098043441927ae0c5bf6b36da277cfc701d16c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 28 09:28:10 2004 +0000

    While in WM mode pass through all keys except WM keys again.

commit 6eeeea6785d6f1434e0d6c8449dd667006ca3b4a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 27 17:24:18 2004 +0000

    Fixed sticky WM mode if Alt or Ctrl are released before Meta.

commit 7d0e1d74789c65fc6bc90ede0d284452b69e1fe8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 27 15:50:21 2004 +0000

    Support OpenGL on sub surfaces ;)

commit e2bdb6b2a5bc23af565650ad759f89bbfde01770
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 26 12:52:46 2004 +0000

    Thanks a lot to Ed Millard <emillard@direcway.com> for this patch:
    
    DIRECTFB PATCH
    
    The DirectFB patch implements hardware blitting on  GX1 graphics though
    it is constrained, by hardware, to only blit surfaces whose width
    matches the stride of the frame buffer.  In other cases it reverts to
    the generic software blit.  The current driver in CVS only implements
    hardware blit on GX2 graphics which doesn't  have this stride
    limitation.
    
    The hardware accelerated functions for line, rectangle and fill have
    been modified to honor  dst_offset for Y so they work properly with
    double buffering.  In the current CVS version these don't honor
    dst_offset and are working on the wrong buffer in double buffered mode
    half the time.  X offset is not currently implemented in this patch
    which is focused on making double buffering work.
    
    GEODE COMPRESSION BUFFER
    
    The patch is disabling the Geode's compression buffer when the DirectFB
    nsc driver is initialized.  This may be a potential drag on performance
    since it increases memory traffic on the video memory during refresh.
    The compression buffer is very problematic for DirectFB since it is
    unaware of it location in video memory.  For example at 1024x768 the
    compression buffer is mapped right at the start of the second buffer.
    You will see display artifacts if its not disabled and you will usually
    crash the box as DirectFB overwrites the compression buffer with
    randomness. In the future the compression buffer could be moved to the
    end of video memory and video ram could be limited to prevent it from
    overwriting it.
    
    VIDEO HARDWARE INTERACTION
    
    Moving the compression buffer to the end of video RAM can result in
    conflicts if you are using video hardware since the geode_v driver in
    geode_v4l2-2.3.2  also uses video memory.  In fact geode_v is currently
    putting its video buffers in video memory in an area that will also
    overlap the second buffer in double buffered mode at 1024x768.  This
    problem can be remedied by changing geodedrv.c memory buffer offset to:
    
    #define MULTIBUFF_OFFSET          0x0
    
    This puts the video buffer at the very end of video memory.  It is
    currently offset from the end of video memory by approximately 512K
    which causes it to interfere with DirectFB double buffering at
    1024x768.
    
    If you set MULTIBUFF_OFFSET  to 0, shut off the compression buffer and
    limit DirectFB video ram to 3 MB you can run DirectFB double buffered
    at 1024x768 and play video at the same time.
    
    -- Ed Millard

commit 629403203197b163a4d010ef71b81023eeffe2c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 19 11:08:17 2004 +0000

    Fixed usage of DIRECT_UTF8_SKIP in GetStringWidth.

commit 4550b673f89f1e32ffeda84dc132a51861110790
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 14 09:08:29 2004 +0000

    Added prefix "ret_" to all output parameters.
    
    Added "const" where appropriate.

commit 8d5b0c2defe380aa6eb0f70ca1b9bb6779b6d850
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 14 07:16:16 2004 +0000

    Use DirectList for events.

commit b668d0db33012cc44bc24a54f5e4ad4b1b772d4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 14 04:48:28 2004 +0000

    Automatically generate links if comments include function names,
    e.g.: "... IDirectFB::GetDisplayLayer() ..."
    
    Minor code cleanup.

commit aee2cfce4fdddba5e7afb756eaa01ecc2eedb060
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 14 00:58:06 2004 +0000

    Added callback definitions to types page.
    
    Added css for removing the underline from links.
    
    Fixed margin for interface abstracts.

commit f0064d59d0eae23167386a724754f88dfed4ddd2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 13 22:42:58 2004 +0000

    Clear key code if CapsLock has been changed to Meta.

commit 2532c69c99dc33474fa8e78bbeb46cd06174835d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 13 22:25:47 2004 +0000

    Fixed capslock-meta which is a bit more complicated to implement in the core.

commit 2c5dab220baaf5e23835355202f31b0855b00454
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 13 15:34:37 2004 +0000

    Moved handling of "capslock-meta" to the input core.

commit d4e98ec9f5f8f042d203851a27f00a0a73f10d35
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 13 11:12:39 2004 +0000

    Added option "no-vt" which disables usage of VT code completely.

commit ab796a5028b54b71a1dba10d6ad1637ea380c0fd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 12 21:15:25 2004 +0000

    Simplified direct_list_foreach usage.

commit a818de8efaff52c9d742a8ce9900a24928547558
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 17:38:24 2004 +0000

    Put keyboard types to the end of the types page by moving the filename to
    the end of the gendoc.pl command line.

commit f64f7821758317cdc0b2b6d484e67d8c04ef8de5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 17:31:12 2004 +0000

    Suppress some macros by using "@internal" within the comment.
    
    Added comments to DFB_DISPLAYLAYER_IDS_* macros.

commit 1449be0c1cc185819b504589d8242b19dd8ad6b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 17:30:16 2004 +0000

    Improved comment parsing: options can be embedded via "@<name>[=<value>]" at
    the beginning of a line (after the asterisk though).
    
    Suppress some macros by using "@internal" within the comment.

commit fa099ed411ca2986d818325ffe96fd2861858b4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 16:37:28 2004 +0000

    Improved layout of types page.
    Added macros to types page.

commit cedf45ffe7a41d53d3885c0d3070a3f3f4ac7f41
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 15:47:31 2004 +0000

    Fixed hyper link generation for "const" parameters.

commit 8f60a8d6793ad0a98b0ab00f02ebff2c46951b86
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 14:45:54 2004 +0000

    Allow sub surfaces to be used a texture by adjusting the texture coordinates.

commit 1859f8c8c84bfa7a011837412f14808ae82601da
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 9 12:45:01 2004 +0000

    "vt-switching" is true by default now.

commit 89180c26ea827653942657cc1d42dc524a6ee6d1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jun 27 23:52:01 2004 +0000

    Corrected a mishap from RGB_TO_YCBCR() change.

commit 547114fd6731429a535b809cb2de0880736e8a25
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jun 27 15:15:33 2004 +0000

    Increment trapezoid trailing edge x coordinates.

commit 89c233a306acdeb24b3f335709a21aca1a02e904
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jun 27 15:06:50 2004 +0000

    Call dfb_gfxcard_sync() before FlipRegion() only if hardware has written to the back buffer.

commit a36337ccaeb5483c61e97da55163b850b65973cb
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jun 27 14:55:32 2004 +0000

    Made RGB <-> YCbCr conversion use integer arithmetic.

commit f49b0750c11e31b67d0f931d55d4cf84c89f1c1a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Thu Jun 24 08:13:35 2004 +0000

    Save some instructions in YUY2/UYVY scaling functions.

commit c140da1858423e2f4684a3fb2f09a2595891530d
Author: Claudio Ciccani <klan@directfb.org>
Date:   Wed Jun 23 16:33:31 2004 +0000

    Blit 32 bits at once when scaling YUV4:2:0.

commit 3e8b52f63c1b39f5330d03d70535b2f6eb0dc516
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 22 19:08:09 2004 +0000

    Added IDirectFBDisplayLayer::SetSourceRectangle() to configure layer source
    cropping. Includes the relevant changes to mach64 and matrox drivers.

commit 10e0c896caf5ec281355144d9ae462cf7b0be993
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 22 07:51:59 2004 +0000

    Added convenience macros and inline functions for setting state members.

commit 4db272c7c57c68a178155c91ba1fd6df1c25a9c2
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jun 21 22:17:22 2004 +0000

    include <sys/signal.h> for sigset_t on non-linux systems.
    (needed by darwin)

commit 772eb702f5340cb8c2193ea595d343ed6c84334d
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 17 14:02:15 2004 +0000

    shut up CVS

commit 1a54a1f320f081e5860d45b8606034ca50a9f955
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jun 16 14:17:22 2004 +0000

    removed compiled module, remove windows-style <CR><LF> in Readme.txt

commit d5807ce153d02febe4c646186a0d9527ee1b115a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Jun 14 23:45:24 2004 +0000

    Bresenham line parameters must be calculated differently for the 2D and 3D engines.

commit 6bd147d69849b232285e4b3eb2de71fbb6d58a81
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 14 14:47:57 2004 +0000

    typo

commit 344c1378aa7193cc2b59335dd7f8db484278c698
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 14 14:46:44 2004 +0000

    Update source rectangle in region config accordingly.

commit bf2c03472904994e6da4067a3244013fc19ca363
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 14 13:37:52 2004 +0000

    Show module name in error message if file name is (null) due to static linkage.

commit c1aeb277c13ad5d4f6e2768bfc9e29f6aac2f660
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 14 12:21:04 2004 +0000

    Thanks to "Antonino A. Daplas" <adaplas@pol.net> for porting the driver
    according to internal API changes.

commit 95f4735ee883bec7156f5c084fff054c51f09b5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 14 12:05:05 2004 +0000

    Include C++ symbols in "nm" parsing code.

commit eeacea40bef656d3d348449bed46ab625814d19d
Author: Andreas Robinson <andors@directfb.org>
Date:   Mon Jun 14 12:04:33 2004 +0000

    VIA Unichrome driver added.

commit 25253d8547f20e451da7ae94e7bb142610582f1e
Author: Andreas Robinson <andors@directfb.org>
Date:   Mon Jun 14 11:56:25 2004 +0000

    Unichrome directory added.

commit 2ad75b36b5d9945cb55f28e19e096629c4a82e8d
Author: Andreas Robinson <andors@directfb.org>
Date:   Mon Jun 14 11:53:35 2004 +0000

    Initial import of the renamed CLE266 driver. New features: support for multiple north bridges, the DVD subpicture layer and destination color keying in the video layer

commit 02a39fcf81219512ebc7d14da990737e420cdfe3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jun 13 20:47:14 2004 +0000

    Forgot to initialize a variable.

commit e509c705cfc62378c144eed5393a97135dd95a65
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Jun 13 20:35:56 2004 +0000

    Fixed yet another alpha channel problem. Non-blended scaler/texture blits
    didn't copy the alpha channel.

commit 69248e96d7dae4a058f1bc4cb8001fe3724ec78e
Author: Claudio Ciccani <klan@directfb.org>
Date:   Sun Jun 13 09:39:48 2004 +0000

    Some improvements in YUV scaling functions.

commit 6b9783f7705f437c600cfe94b54f4294f03a0a6a
Author: Claudio Ciccani <klan@directfb.org>
Date:   Fri Jun 11 19:55:26 2004 +0000

    Implemented stretchblitting for YUV.

commit 260d8c2362d2929ab25db3a86fb9bf6673ecd7fb
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Jun 10 01:43:20 2004 +0000

    Wrong alpha value was being written to the destination.
    
    Bumped driver version to 0.13.

commit 10dd6ee2ec0f246289e506755dc2dd47ccaa458d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Jun 9 18:39:46 2004 +0000

    Added support for power-of-two pitch allocations.
    
    Enabled mach64 texture engine code.

commit e1aceff61c244dc646f432b1873c10339624ab6d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 9 15:31:31 2004 +0000

    Added "#ifndef __cplusplus" around bool declaration.

commit a27a27a1a94a9e4335c4676f19df6f1d4e237213
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 9 14:42:49 2004 +0000

    Fix non-debug builds.

commit b99118a46014e21c7ee7c3f1e3c2f558e2b596f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 9 12:02:14 2004 +0000

    Added option "[no-]trace".

commit 81f0f838c513d9538fbf8247cd4b179bebdeed59
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 9 11:19:11 2004 +0000

    Implemented debug domains which can be enabled/disabled separately.
    
    But still a lot of code has to be changed to use domains!
    
    The new macro "D_DEBUG_DOMAIN (identifier, name, description)" is used to
    define a debug domain which is used via "D_DEBUG_AT (identifier, ...)".
    
    The user can select debug output now, e.g.:
    
    no-debug
    debug = direct
    no-debug = direct/memcpy
    
    This disables debug messages in general,
    but enables all "Direct/" messages except "Direct/Memcpy".
    
    The other way around:
    
    debug
    no-debug = direct
    debug = direct/memcpy
    
    This enables debug messages in general,
    but disables all "Direct/" messages except "Direct/Memcpy".

commit b14e0ec540bfdbdda959a344789f0d01d22810a2
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Jun 9 00:52:59 2004 +0000

    Added texture engine blitting code. The texture engine requires a power of two source pitch so the code is still disabled.

commit 8b1b25dfab1e51b20537d601242dcaef81e2c9b3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 8 23:01:33 2004 +0000

    Mask x and y coordinate values. Fixes problems with negative coordinates.

commit 7fe49524155576faa3eacef7dd07fe7aaa746ed3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 8 22:52:42 2004 +0000

    Some cleanups, mainly cosmetic.

commit 605276fb0dc30ec2b464d977780e7cb78ed4bd4a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 8 22:48:05 2004 +0000

    Fixed GetAccelerationMask( DFXL_DRAWSTRING ).

commit e61b9126c67d07090e62c35934be56503d2f8483
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 8 19:00:29 2004 +0000

    Implemented missing blending modes.

commit 6b381d4ee31f2bbc9705a04753253da4685c2a8a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 8 18:51:01 2004 +0000

    Check for illegal blending modes in ati128, mach64 and matrox drivers.

commit dce4be52d3af6916d554022a8e136d45043069f0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 10:26:26 2004 +0000

    Another tiny fix.

commit ff294df8db6d9717fbc238673f5ceb16c1888dd9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 10:16:34 2004 +0000

    Minor fixes.

commit 6803f282d6b488d60dd7216a70d4bd3d9e9f3a5d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 09:42:35 2004 +0000

    Moved fusion_reactor_attach() after ABI version check to fix the failing
    D_MAGIC_ASSERT() and print the default ABI version error instead.

commit ce00db0008ae037f6946365c31f6590e4c76b8d4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 09:30:56 2004 +0000

    If the file passed to load_symbols() is not existent, lookup the full
    executable path via "/proc/self/exe" and compare its basename with the
    file name of the object for which the symbol table should be loaded.
    
    Avoid recursive (most probably endless) calls to direct_trace_print_stack().

commit 3a99032c58e37451d9ccdc2567f9a36e68d11259
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 08:38:11 2004 +0000

    Fixed format strings.

commit 52fb37e5bdfe27a85dc0fc52dae0d545ebb39ef1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 08:22:43 2004 +0000

    Apply format & argument checking to message & logging functions.

commit 664521f07fc248cacc6e845c2e54edb6a93705f7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 07:56:22 2004 +0000

    When building shared AND static, filter out ".libs" for static libraries with newer libtool.

commit 97086ad9e7474a4ca1f3da911f9fb2b62eb4489d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 06:54:31 2004 +0000

    Replaced double with float.

commit 684f705cabbb41354e2c633c5071b560668aa58b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 06:35:21 2004 +0000

    Cosmetics.

commit 5ee8d3241d7980284b2d488ff2cb4cd3ebd6a237
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 8 05:59:02 2004 +0000

    Corrected CLRCF_ALL.

commit 33180cea6683bae181fc0bab5eabf30dae3d3515
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jun 8 00:07:55 2004 +0000

    Fixed triple buffering.

commit 9f376b09b3f99800b01ce551065da1777c125ddb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 4 11:38:15 2004 +0000

    Initialize addrlen.

commit ed5881be57ae35c3475206983175f1f973e39311
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 4 11:07:17 2004 +0000

    Code moved to wm.

commit 94c0b384cf29380074db0ffb76c1063fb70d78dd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 3 15:47:19 2004 +0000

    Fix scope of y.

commit 8f42360aea036d8a37409ebc5dc62ce1d19fdda2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 3 04:32:19 2004 +0000

    Over 20% of all added code lines ("+..." in this diff) are "D_ASSERT(...)"  ;)
    
    
    Finished first version of modularized window management including the WM API.
    
    All wm specific stuff from the core has been moved to the "default" wm module.
    The refactored code is heavily cleaned up and easier to overview or understand.
    
    Some parts are much simpler now, e.g. using a single fusion_vector_*() line
    instead of several lines of code dealing with (re)allocation, moving etc.
    
    Another example is the merge of all seven restacking function implementations,
    being a single function now that uses fusion_vector_move() after calculating
    the new index based on different combinations of its three parameters that all
    seven cases can be mapped to.
    
    Changed parameter order of fusion_vector_foreach() to "element, index, vector".
    
    Added fusion_vector_foreach_reverse() processing the elements in reversed order.
    
    Changed fusion_vector_index_of() to return "INT_MIN >> 2" instead of "-1"
    if the element wasn't found. In case the return value isn't checked by the
    caller, this will most likely generate a bad address at least.
    
    Added fusion_vector_has_elements() as a more
    readable alternative to !fusion_vector_is_empty().
    
    Added fusion_vector_move() to move an element from one index to another.
    
    Added DFB_ITEMNOTFOUND with string "Appropriate item not found!".
    
    Added magic to DirectLink being asserted whenever possible in direct_list_*().
    
    Changed direct_list_foreach*() to allow variables that are no DirectLink*:
    
    Foo *foo;
    direct_list_foreach( foo, list ) {
    }
    
    versus:
    
    DirectLink *l;
    direct_list_foreach( l, list ) {
         Foo *foo = (Foo*) l;
    }

commit 5a196b611d1a72a7d4dafd3e152bbb2d4268cdaa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 2 17:06:49 2004 +0000

    Implemented SetRenderCallback().

commit fcc9698bfb052820db5f21ff5be21bbc0afc0b57
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 1 23:09:31 2004 +0000

    First step towards pluggable window management:
    
    Added wm module framework as a new core part similar to core systems.
    Added option "wm=<wm>" to select the window manager module to use.
    
    Moved input event handling to wm module.
    
    Everything should work as before.
    The "default" wm module implements the recent behaviour.

commit 51685c17447a6b40adc1aa925af71a610ba3f819
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 1 21:49:17 2004 +0000

    Use repeat mode for power-of-two textures.

commit 82d72d044a6d965aa17013eef32faf132800e888
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 1 21:48:06 2004 +0000

    Removed outdated script, use directfb-config instead.

commit d01b432155b48829ce156d08639d7165b38a717b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 1 11:14:18 2004 +0000

    Implemented TextureTriangles().

commit 97630b619dd1caeae52903ae7a6ee13b8ac1aebf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 1 11:03:50 2004 +0000

    Fixed missing buffer format in dfb_surface_create_preallocated().

commit c8e98c239062a130a90145ae6167c57a48dca59f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 27 08:39:51 2004 +0000

    Added optional 'indices' parameter to TextureTriangles() for indexed setup.
    
    Added method documentation:
    
    Maps a <b>texture</b> onto triangles being built
    from <b>vertices</b> according to the chosen <b>formation</b>.
    
    Optional <b>indices</b> can be used to avoid rearrangement of vertex lists,
    otherwise the vertex list is processed consecutively, i.e. as if <b>indices</b>
    contains ascending numbers starting at zero.
    
    The number of <b>indices</b> (if non NULL) or the number of <b>vertices</b> is
    specified by <b>num</b> and has to be three at least. If the chosen <b>formation</b>
    is DTTF_LIST it also has to be a multiple of three.

commit e5de307b0c1531a004a7796ffd654cc4fe9f5993
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 26 23:53:57 2004 +0000

    Fixed __NR_gettid related preprocessor conditions.

commit 342f9b61b4969c187f16206f342d54a6b6be7313
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 26 10:38:46 2004 +0000

    Honor $(DESTDIR) when removing old header files, thanks to
    Kristof Pelckmans <kristof.pelckmans@antwerpen.be> for spotting.

commit ca0fbd7ff3b25d7b77105e8fc12fdefc6cf70536
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 26 05:06:29 2004 +0000

    Some fixes.

commit 1ab80e24df984fd77e6d7e4833b81da146bb4988
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 25 18:17:04 2004 +0000

    Changed HAVE_V4L2 to DFB_HAVE_V4L2.

commit 0a5534411d38008aaad6cbcc1055dfa317389e84
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 25 14:21:08 2004 +0000

    Fixed bug with Z buffer bits != RGB bits.

commit 3beaf31b84bff8eb9b04a18121db1fb82c3f011d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 25 14:08:31 2004 +0000

    Fixed dfb_surface_reconfig().

commit 05098202905db122564265a5b96729aaa65d209e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 25 13:57:34 2004 +0000

    Changed include order.

commit 8890d5131ef1ce1c1d75d0f1522647ee5151dd83
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 25 12:48:05 2004 +0000

    Clear depth buffer with all bits set.
    
    Use z compare function LTE instead of GT.
    
    Multiply Z value by 65535.0f in the driver.
    
    Remove Z value offset.
    
    Added correct InvWScale for a nearVal of 1.0f.

commit 35fc3a37e603988c4cc26f531ee934c6ec7ee684
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 24 11:56:23 2004 +0000

    Fix off by one that caused a segfault.

commit 8492716849b66718e63287f571fa3863eefa2d90
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 24 10:44:02 2004 +0000

    V4L2 has to be enabled explicitly via "--enable-video4linux2".

commit 0de45b1a5a4398aeb8476eb3aa9957c6f77bb2bb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 21 09:33:28 2004 +0000

    Preliminary depth buffer support.
    
    Specify DSCAPS_DEPTH to have a depth buffer allocated and used,
    currently hard coded to 16 bit.
    
    Some cleanups.

commit 42f6c0331fa5e610c1baf6e264d811059fe003fb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 19 11:31:28 2004 +0000

    Added pc file.

commit dcf71b630b6eeae724f02dd1d4c0e0622d5829dc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 19 11:30:56 2004 +0000

    Don't allow GetWindow() on the cursor window.
    
    Added more "$(top_builddir)/lib".

commit 869921f4a15f31c4e34a3e2d837cb0e6fd9cc28b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 19 11:25:24 2004 +0000

    Moved new stuff into separate file.

commit 753db174215c1c9632ca7c7d19f460ab4c4af932
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Wed May 19 10:52:03 2004 +0000

    changed argument of SISFB_SET_AUTOMAXIMIZE from unsigned long to unsigned int

commit 89bc6aa53001df78979448dd1f9f216322480e42
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 19 10:46:53 2004 +0000

    Got textured triangles fully working.
    
    Fractional bits of Q are now 20 instead of 16, so the driver
    version is not run time compatible with previous versions.
    
    Finally have a working mga_log2() again.
    
    Adjusted card limitations, added byte pitch alignment.
    
    Added some safety to calculation of register values (use masks etc.).
    
    Cleanups and optimizations, a few assertions added.

commit a2fa0d5605327c5cb5503b41049d351b1176afb8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 19 03:25:33 2004 +0000

    Corrected scaling of NPOT textures.

commit 0e7bf78c415059b27cde21a1de4344024c0654df
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 19 03:21:38 2004 +0000

    Enabled anisotropic filtering in TextureTriangles().
    
    Removed NOPERSPECTIVE flag, adjusted mga_log2().
    
    NPOT textures still have wrong scaling.

commit ff19077eda60deac44402a15894b951b586ba820
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 18 22:42:52 2004 +0000

    Implemented matroxTextureTriangles().

commit 2606be70cd5f0bdc239c18763afb8534dde1c5df
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 18 14:40:55 2004 +0000

    Moved Voodoo headers to public directory.
    
    Remove old include directories during "make install"
    (directfb-internal/direct or /fusion or /voodoo).
    I know that's evil, but...

commit 418bd2b4bd3143147da5bd46722ee2dda3960198
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 18 01:11:55 2004 +0000

    Include shmalloc in SUBDIRS for single app, too.
    This is to clean the directory via "make clean" after switching from
    multi to single app.

commit 2871c0321683c87643946130e536c6fa3ff6e74d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 17 08:02:00 2004 +0000

    Implemented GetID(), GetDescription() and GetKeymapEntry().

commit 2626e4824d622af2af5221ab7489ef6143804eb5
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat May 15 17:38:25 2004 +0000

    Updated matroxfb patches for linux-2.6.6.

commit ca169d37a174d9950bcfe2eb4e447b3723702709
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 19:48:08 2004 +0000

    Applied patch from Henning Glawe <glaweh@physik.fu-berlin.de>:
    
    - fix the 'Makefile.am's to include $(top_builddir)/lib, so the
      construct 'mkdir blah; cd blah; ../configure; make ' works again
    
    - include the rest of the tools in libdirectfb-bin

commit 4141bc3d519ca8f2b34ce93e4500f0fdf4ee8d2e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 18:05:21 2004 +0000

    Fixed debug messages.
    
    Added direct_initialize() and direct_shutdown() calls to the test program.

commit b9d01dfbf01b7f80857b6683057960b70a69a206
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 17:47:34 2004 +0000

    Increased read size for header and data, adjusted loop.
    
    Added some debug messages.

commit f2c70b6f72d0e68eb1b313dccfc46ca5759ada19
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 17:45:47 2004 +0000

    Fixed streaming buffer which was broken by the list structure change.
    It uses direct_list_append() and direct_list_foreach_safe() now.

commit 1994b6bf3699eaa3ca101a5bdf2db7712e99adc1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 16:48:49 2004 +0000

    Moved signal handling to libdirect.

commit 8951f8859fec145a1d91d0a9f0e03b075b1f330c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 16:36:14 2004 +0000

    Added <Meta>-<Escape> description:
    
    Press Escape to return from fullscreen mode to the desktop.
    (currently not advisable if the fullscreen app is still flipping)

commit 6cef9e240831e46afca9895d0279227ef507c877
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 12:16:02 2004 +0000

    Implemented IDirectFB::GetInputDevice().
    
    Added Dispatcher and Requestor for IDirectFBInputDevice and
    implemented CreateEventBuffer() and AttachEventBuffer().
    
    Replaced some old copyright headers.

commit a5d7a35dcab5560d49014e28ec57423058ae563e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 10:27:10 2004 +0000

    Link against libvoodoo and libdirect.

commit a68ffc843b64a8cda6c5351e5ae86ba200ad309d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 10:12:19 2004 +0000

    Implemented all remaining IDirectFBFont methods.

commit 579f6ac7da39a5f49517ced5c84a35ae4fa94d1e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 14 08:43:42 2004 +0000

    Implemented GetAscender().

commit b40d72aa3f92b25d57cbd90dbc17de84e6f24b70
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 13 20:58:50 2004 +0000

    Implemented IDirectFBSurface::GetVisibleRectangle().

commit 131d5d361128fa2e571dbe149f995f769dd37e7e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 13 19:03:05 2004 +0000

    Implemented IDirectFB::CreateEventBuffer()
    and IDirectFBWindow::AttachEventBuffer(), phew... ;)
    
    Renamed voodoo_manager_register() to voodoo_manager_register_local()
    and voodoo_manager_lookup() to voodoo_manager_lookup_local().
    
    Added voodoo_manager_register_remote() and voodoo_manager_lookup_remote().

commit 9d07571c402debbb3e24963283537b8ba962cce1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 13 19:00:33 2004 +0000

    Forgot to commit the description of <Meta>-'S'.

commit 1f191e8d43c43e068370e7169609a74c252b50e1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 11 12:03:36 2004 +0000

    Allow per file debug mode forcing via definition of DIRECT_FORCE_DEBUG.

commit 00854ecc0aa9ee8a8e8d9c615205332bf17ccccd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 11 04:21:18 2004 +0000

    Changed <Meta>-'S' to raise the lowest window, e.g. to revert a <Meta>-'A'.

commit bab7379a565a586d792b1e7bac2a1ca3b6f93ef0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 11 03:51:16 2004 +0000

    Added DFXL_DRAWSTRING that is set by dfb_gfxcard_drawstring_check_state() when
    it is called by IDirectFBSurface::GetAccelerationMask() for the current font.

commit e65890898b0e10e2edfa0b6a3d34799349c7e774
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 9 23:38:05 2004 +0000

    Added #ifndef around ABS and SIGN.

commit d832fca05530f36776848b1a272122b46359486c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 9 21:48:23 2004 +0000

    Wrong variable name.

commit 5ac7f9c109d32ae9d2ac188eb68fcfab9164df2a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 9 19:31:31 2004 +0000

    Added pkg-config files for libdirect and libfusion.
    
    direct/ and fusion/ headers are installed to the public include directory, now.
    
    Added a simple figure of the DirectList's structure.

commit 5f1e8b422f714148cb079a239d29cf4668e05f05
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 6 04:42:07 2004 +0000

    Even nicer.

commit 23cc3a2e3c17b8c9637366ecf0274ccb9e80adc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 6 04:30:34 2004 +0000

    Print error message if the given mode (via "mode=" option) is not supported.

commit 1c1b08ad535b9b7c7fbb16991d4e41309b08b996
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 21:28:36 2004 +0000

    Added message "DSDESC_PALETTE and DSDESC_PREALLOCATED not supported yet".

commit 97752cc3a01c49ca818a4ca25b5e8166934fa840
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 20:56:10 2004 +0000

    Increased color hash size.

commit ec74d4066d9b8f1dc9209ec616999024f8b626a6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 19:55:00 2004 +0000

    Migrated module management.

commit 894b2e4787ca0556e2f3b75a06bf171a3bad89b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 19:02:49 2004 +0000

    Added direct_list_append() and changed the list structure to have
    the first element's 'prev' pointing to the last element of the list ;)
    
    Made direct_list_*() functions static inline.
    
    Added DirectThreadInitHandler which can be installed/uninstalled using
    direct_thread_add_init_handler() and direct_thread_remove_init_handler().
    The registered init handler function is called at the beginning of new threads.
    
    Use DirectThread all over the place.
    Install init handler that calls dfb_system_thread_init().

commit 19793d56446fbd7500c941dd0405ecfdd3e1befc
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 5 17:54:30 2004 +0000

    no longer include <linux/cache.h> and define __KERNEL__ which led to problems with some kernels, define cache size macros ourserlves.

commit e8a985fec62da49df5c9aaecb363d357241f43ca
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 5 16:54:21 2004 +0000

    remove unneccessary #includes

commit 42b58de2e5b82826a48dad1c41c21a5754cd867d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 08:07:30 2004 +0000

    Removed obsolete stuff.

commit dae42f97a074efc2418a6e118dabf1bba7ceedab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 02:04:37 2004 +0000

    Implemented SetVideoMode().

commit 63bdca7dd126c4a0f0c9e2766ef5f5d5fedef952
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 5 00:46:24 2004 +0000

    Flush output buffer automatically after waiting 50 ms for explicit flush.

commit d697db2f759215dda1c7b08ce4607c5c51fdab74
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 23:31:48 2004 +0000

    Wait for response in Flip() if flags contain DSFLIP_WAIT.

commit 6e2128e172c179cab8089c9cf377c27cbac7cb5d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 23:23:03 2004 +0000

    Don't use VREQ_QUEUE for Flip().

commit 01a2da6b309059c1a98b0be541c23cacb6a89af6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 23:14:24 2004 +0000

    Added flag VREQ_QUEUE which has the effect that voodoo_manager_request()
    doesn't wake up the output flushing thread. It's used for all drawing related
    requests to increase the rendering throughput by avoiding small send()s.
    
    Experimentally using IPTOS_LOWDELAY.

commit b210ce7ae2f3b7e6df8667586d82b5c243c7eb75
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 18:05:08 2004 +0000

    Added interface instance tracking in debug mode,
    showing remaining instances at exit time (like it's done for allocated memory).
    
    Added DIRECT_UTIL_RECURSIVE_PTHREAD_MUTEX_INITIALIZER.

commit b5438f94a2ab7f3e5774fd66e6d9013c4607b5c0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 16:38:50 2004 +0000

    Link executables against libfusion and libdirect explicitly.

commit 86bcba1e00ed0e615d90add6401d49f68e60cbdb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 16:25:51 2004 +0000

    Added thread names to debug output, stack traces etc.
    
    Added direct_thread_self(), direct_thread_get_name(thread)
    and direct_thread_self_name().

commit f001b12fba0e4f740dd96a0e3563a4bee77ec610
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 14:05:02 2004 +0000

    Added configure option "--enable-voodoo", default is no.

commit 55f6903bb0007a20357b37034ad2a1f83f755f16
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 12:53:02 2004 +0000

    Implemented GetOpacity().

commit dd6f6012e196f231cc0e9a903c2ba2d108251954
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 12:30:24 2004 +0000

    Further implementation.

commit e18d3829ea6cb399cae7f4054e86080e0a9f30b5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 12:28:54 2004 +0000

    Use TCP_NODELAY, increased buffer and max. message size.

commit 191ef7eb9935f9ce75d15e286add59c54567e6e1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 4 12:27:33 2004 +0000

    Implemented hash table resizing.

commit 6efcdc4da28ecb44dd9e8284fafdf9de69a619d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 3 14:59:08 2004 +0000

    Ongoing Voodoo... got DFBTerm running.

commit a2744e73568d7b1475fd7146c8f91ed5d6d6db76
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 3 10:53:34 2004 +0000

    Argh.

commit 333f553eeac0e1dde6982a2a6b95c74ea4bdc225
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 3 10:36:21 2004 +0000

    Added requestor template.

commit c6e9685ae1f0205cfda025e447e13fb259c99cff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 3 10:32:21 2004 +0000

    Added more cancelation points to event buffer feeding thread.

commit 2ca894baedf945849e1e5a2f751b65f843c48a44
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 3 10:31:31 2004 +0000

    Start debug output with upper case.

commit 2ca51d1e4ff5981fd998a0944f2b328d556b8884
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 3 10:30:50 2004 +0000

    Link against libfusion.

commit 0ba4c4ac1fc2c918b1310188930e68605cdbe959
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 30 02:25:12 2004 +0000

    Improved and cleaned up thread loops, resulting in better performance.

commit 4adb447e964d75fd2adb2d13a27ac313122a6d30
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Apr 29 23:12:11 2004 +0000

    if we do not have <linux/unistd.h> include <unistd.h> for getpid

commit ebe125822d3450a82a9d30843641fbd91480b6d9
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Apr 29 23:08:57 2004 +0000

    include pthread.h which is required for pthread_sigmask() on BSD

commit 4def0b9f0497bc400a81a5874ab52c46e142b1b7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 21:50:11 2004 +0000

    Fix gcc 2.95 build.

commit 675d78194aa08c849a0f3015f95bf7441cc5a333
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 19:08:35 2004 +0000

    VOODOO
    
    Added network transparency to DirectFB ;)
    
    The concept is quite simple and working great. Each interface has two
    new implementations: "Requestor" on client side and "Dispatcher" on
    server side. Between them is a very small libvoodoo which manages network
    connections and provides fast and powerful message encoding and decoding.
    
    Each Dispatcher instance gets an ID which is also managed by libvoodoo.
    The Requestor sends a request message for each method call, specifying the
    remote instance ID and the method that is to be called. Parameters are appended
    to that message before it gets sent to the server. On the server side the
    Dispatcher interface is looked up in a hash table using the instance ID.
    After fetching the parameters from the message without copying any data
    except for some rare cases, the Dispatcher calls the "real" implementation.
    
    Some requests have a corresponding response and some don't, e.g. all drawing
    related methods return immediately after sending out the request. Methods
    that require a response block until the response is received. Each response
    contains at least the result (DFBResult). Further response data is appended
    to the response message and returned to the application after being processed
    by the Requestor.
    
    Not every Dispatcher is server side and not every Requestor is client side.
    IDirectFBEventBuffer and IDirectFBDataBuffer have a client side Dispatcher
    and a server side Requestor. The server has to send events to the client side
    by making a PostEvent request (without response). It also has to fetch data
    via requests to the client side data buffer (with response), e.g. while
    it is dispatching a RenderTo request. The client will send its compressed
    data (PNG for example) over network to the server ;)
    
    Another advantage is that existing applications can be used without changes.
    
    The setup is quite simple: There's a new program called "dfbproxy" which
    just waits for incoming connections (currently port 2323). It doesn't even
    call DirectFBCreate() before clients request that.
    
    Running applications via the proxy is done by passing "--dfb:remote=<host>".
    
    Notes about performance: If DirectFB is built with debug mode disabled,
    df_dok produces nearly the same results over ethernet. Running both the
    client and the server on the same machine is slightly slower right now.
    
    Notes about the implementation status: A lot of Requestor and Dispatcher
    methods are not implemented yet, but many demos are running already.
    IDirectFBDisplayLayer, IDirectFBWindow and IDirectFBInputDevice are missing
    completely so far. IDirectFBFont has to be changed to use data buffers, too.
    Currently the filename is transmitted over network and the font file is
    loaded from the file system of the server.
    
    
    OTHER CHANGES
    
    Print a warning message in dfb_screen_rectangle()
    when dfb_system_current_mode() returns NULL, e.g. during initialization.
    
    Moved fbdev and sdl modules from src/core/ to systems/.
    
    Added a magic to public interface structs,
    i.e. use D_MAGIC_SET/ASSERT/CLEAR to detect life cycle problems.
    
    Added "const" to some parameters in the public API.
    
    Added a minimalistic hash table implementation for usage with IDs as keys.
    
    Added direct_clock_set_start() that is called by Fusion's initialization
    to synchronize time stamps of debug messages.
    
    Changed D_MAGIC to enable spells with less than eight characters;
    this macro generates a magic based on the string (spell) passed to it.
    
    Added DirectResult which is the DFBResult outside of DirectFB.
    
    Added message macro D_UNIMPLEMENTED which prints a warning once.
    
    Added a name argument to direct_thread_create(),
    printed during creation and termination of threads.
    
    Moved fusion_pthread_recursive_mutex_init() to libdirect,
    being called direct_util_recursive_pthread_mutex_init().

commit b16bb03632ba78e661f4c0ac52a4897a550f637d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 14:57:56 2004 +0000

    Great thanks to "Vadim Catana <vcatana@registru.md>" for this
    patch fixing several issues with the overlay on Radeon9200!

commit 707a3102d74726f00bd81e2e7a410bada8767b1f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 05:54:54 2004 +0000

    Allow kern_x or kern_y to be NULL.

commit 28b98a461ec9312078dd49d473cbf848a8772aef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 03:58:34 2004 +0000

    Follow UTF8 code changes.

commit b65a2f1940c5e04072f6d21dd966ce2f7d188ee9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 03:57:35 2004 +0000

    Wrote a highly optimized version of "IDirectFBFont_GetStringWidth()".
    The previous version used the bloated "IDirectFBFont_GetStringExtents()".

commit 413823c2c1aa4518eaa376f5fda7d22aa4c8bbb8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 03:53:21 2004 +0000

    Replaced 256 entries lookup table "direct_utf8_skip"
    by the macro "DIRECT_UTF8_SKIP" and a 64 entries lookup table
    which is statically defined in the header again.
    
    Replaced the non-inlined function "direct_utf8_get_char()"
    by the macro "DIRECT_UTF8_GET_CHAR" which uses a much smaller
    and inlined function for non-ascii cases.

commit bfb0dbeeff67354fb11f3155c5dd16fb8fe9626c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 29 01:42:44 2004 +0000

    If "__NR_gettid" is still not defined after including <linux/unistd.h>,
    print a warning and use getpid instead of gettid.

commit 315df6985af6cf99afe9fe1b1b3a79bedbc4bd46
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 28 03:25:35 2004 +0000

    Work around libstuhl's sys_lib_??search_path_spec during cross builds (untested).

commit afec3553f325e9d6ad9009c33754a6a00d155850
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 27 06:15:20 2004 +0000

    Added internal documentation, mostly diagrams.

commit 1e7fd7dda91dee85372c5c391281f0ab56c83bd5
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Apr 22 15:49:59 2004 +0000

    Fixed field parity option.

commit 084564e29cead69c896834729c154edb74d98b18
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Apr 21 14:21:23 2004 +0000

    updated savagefb patch for 2.4.26

commit 6f84fca7e84bb2ee193bd9cadb21570556742a59
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Apr 21 13:50:37 2004 +0000

    - compile fixes
    - disable overlay support

commit 7a8869e366b93b60d2cb82a885a683096a60aa30
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Apr 15 15:50:28 2004 +0000

    -optimized version of rgb16 blitting with destination color keying
    -support for rgb32 blitting with destination color keying

commit 35e00c9e7e36cabde22292e96127a21331c7b65f
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Apr 14 18:17:56 2004 +0000

    unoptimized implemetation of rgb16 to rgb16 destination color keying for testing purposes.

commit 856de6055c24ca9058ff3bc96c8e86f8715f2bb1
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Apr 13 22:33:12 2004 +0000

    minor cleanup

commit 144be84f594841e2796c58019f5b4ecaa0a2f321
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Apr 13 20:08:44 2004 +0000

    build neomagic driver

commit fc6ebe75205c032cbd8bbfdca64d3bbcbead8022
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Apr 13 20:08:26 2004 +0000

    port driver to DirectFB 0.9.21 internals

commit ca4e31f1aadb91e70376d6a4bac878a16931c8d5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 8 12:02:55 2004 +0000

    Fix single app core build.

commit 931dc2843055f679b3176a9a10a0976a86bb39e8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 8 11:22:46 2004 +0000

    include errno.h

commit ce584f6609ccdc97acd8ba13cee9a38e6ea2b8d6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 8 10:25:27 2004 +0000

    Fix assertion caused by double destruction of the core
    when applying the configuration fails.

commit 7527482b1c8a9222f211e0af7622e556de842bf5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 8 09:14:18 2004 +0000

    Force CPPFLAGS to be included for compiling dtest.

commit fd0cc4dd01780c5a9ab47bdc5d2cd3fde576e755
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Apr 7 15:09:34 2004 +0000

    - increase minor version (0.2)
    - applied overlay patch from Vadim Catana (thanks!)
    looks good, needs testing (no radeon here to test)

commit f48b4bac7d6b9d490ae111240347e34679437615
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 5 12:27:56 2004 +0000

    Moved interface handling to libdirect.

commit 649540bcd8afa16e139aa55f7b988d437525c1af
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 5 10:35:19 2004 +0000

    Cleanup includes.

commit 9d55931f5ca7cef5a8a456d624f70111e863e612
Author: Andreas Kotes <count@directfb.org>
Date:   Fri Apr 2 12:34:38 2004 +0000

    compare errno instead of ret with EINVAL - fixes linux_input on 2.4

commit c3b29d306934ffbb7169c3f024dae253af03e7bb
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Apr 1 18:41:50 2004 +0000

    Use EVIOCGRAB ioctl to grab the device.

commit fcb650ef87b167d5eaa49f1e272928b03d0ef237
Author: hunold <hunold>
Date:   Wed Mar 31 10:13:30 2004 +0000

    - fix unknown reference to MAX by includeing <direct/util.h>

commit 2b5bafc3f14dd9b34e7115187a8ac686cd664875
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 23:42:36 2004 +0000

    Further migration.

commit b742b1cee162ee36d81781ecccee973461bbaa11
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 22:51:33 2004 +0000

    Migrating tree *creak*

commit b92f364bf157c52d4466db6efc9b52633ef7c02a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 21:38:37 2004 +0000

    Migration.

commit 9c424317a8c7e65892068456c44958c202bd5c50
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 19:48:08 2004 +0000

    One more include was missing.
    
    Remove accidently added file.

commit dcd1e2edf6ac5030c5270c9bc78c10bec412f50e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 19:37:11 2004 +0000

    Fix Makefile.am for static builds, copy'n'paste broke it.

commit 9e0b23a846e2a394346ac1efca2cb724258884d1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 19:13:39 2004 +0000

    Added missing includes.

commit 943227457616cf3c9c04c249a3c756acc37400c5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 18:35:08 2004 +0000

    Giant cleanup and restructuring.
    
    There are three libraries now: libdirect, libfusion and libdirectfb.

commit a5b43ba63b828190794208c46be861d41af9d36a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 13:27:19 2004 +0000

    Fix non-debug build.

commit 115b24243e7de219d80237f74c94a969027bf45e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 12:03:36 2004 +0000

    Fixed warnings.

commit a548edfedf927f3cae542924b1481f3bc9a0b6ac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 10:31:27 2004 +0000

    Added DIRECT_BUILD_TRACE and DIRECT_BUILD_NOTEXT.

commit 51ae67bcfdd5428f37a7450f632c3a258573fe7a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 10:12:58 2004 +0000

    Generate and install a header file containing some defines like DIRECT_BUILD_DEBUG.

commit b9035dbe990697ca3b72ecae6530a2a82297a5b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 30 09:31:13 2004 +0000

    Migrating base functionality to libdirect.

commit 9e6d496157d58194ea7c47cb80b01970117bb20a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 30 05:25:46 2004 +0000

    Use better constants for black/white level calculation on G450/G550.

commit 43fd328e78d9b7ed8fdff92f9a8687fbe5869608
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 26 18:33:26 2004 +0000

    Added missing break in WaitForDataWithTimeout() to return upon timeout instead
    of busy looping.

commit cdb8309a90477700abb0a126ab0ea77e932321da
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 24 12:26:07 2004 +0000

    Return DFB_DESTROYED in IDirectFBSurface_Window_GetSubSurface() if the
    surface of the window is NULL, e.g. after destroying the window.

commit 671918392e4fa14d61b292dfe00e9b219cbb4269
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 24 07:26:39 2004 +0000

    Show total number of bytes allocated.

commit 9bcb4d6eb278efff00fc3ba1ff49e6977cd6d624
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 24 07:16:14 2004 +0000

    Rewrote shared memory allocation debug list handling
    using capacity based list reallocation like FusionVector does.
    
    No longer store local pointers to file and function names within the shared
    memory list entry *sigh*, but copy the strings into the list entry which stores
    function names with up to 48 characters and file names with up to 24 characters.
    
    Added option "-s" to dfbdump to show this list of all shared memory allocations.

commit 0e9e6b734048b22228c35fe138ccc9725687cb47
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 24 03:25:47 2004 +0000

    Show the reference id of new objects in debug message.

commit b1567802b3e34acfdcafd4c536917649c31f5907
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 23 21:28:27 2004 +0000

    Fix collision of "signals" with Qt headers.

commit e69a4701dc2046d8860409ffefb48f097bc85ca0
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Mar 22 01:04:08 2004 +0000

    Workaround for segfault due to dfb_system_current_mode() returning NULL.

commit c64d36e5d4ae80cdb0de30fd119fb05219da6c91
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Mar 19 10:46:17 2004 +0000

    mga_waitidle() should wait for idle DMA.

commit 4951d56d2aef27a9d88e527323d45c7f4701d5ef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 16 14:47:09 2004 +0000

    Resolve more symbols.

commit 6559b36053961aa29c5fb03f1b17bb98b43daf59
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 15 18:34:13 2004 +0000

    Fixed and used fusion_list_foreach_safe.

commit dc9f26632de2db1866fb69b751e5182cba6be822
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 15 18:33:41 2004 +0000

    Print full object path in stack trace.

commit b9b95e4b8962f0e02c410b4267f31b44206351eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 8 11:50:29 2004 +0000

    Turn AC_MSG_ERROR into AC_MSG_WARN.

commit 26fab30bf10f416cbc77e952c02d2defd1fde912
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Mar 8 06:38:23 2004 +0000

    Added sysfs support to matrox i2c detection code. Now it works on 2.6 kernels.

commit ce2812c501dfee69f1d964ed7d17096bb9604b98
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 2 23:59:32 2004 +0000

    Millennium I doesn't support source color keying.

commit d56ae483e01fe63ae8b4d67b3eef7d64b50a69bd
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 2 23:51:41 2004 +0000

    Don't try to find the PCI device unless it's actually needed. The
    framebuffer address check can actually fail with Millennium I/II because
    matroxfb lies about the address.

commit 2a5a5d22812a27619a69318fca127ebefcb7802e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 2 19:33:41 2004 +0000

    Added SGRAM autodetection for mach64.
    
    Removed [no-]mach64-sgram options.

commit f617549fb705e1ea3def2bc76e7e2b6f3dae8db1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Mar 2 16:17:13 2004 +0000

    SGRAM auto-detection via /proc/bus/pci.
    
    Verify that we have found the correct entry in /proc/bus/pci by checking against the
    physical frambuffer address.
    
    Tried to make /proc/bus/pci code better looking :)
    
    Moved mdrv->g450 to mdev->g450_matrox and added device_data pointer to driver_data.
    
    Removed "#ifdef FB_ACCEL_MATROX_MGAG400" stuff. Not all instances were covered anyway.

commit 295588832f120d590457d52fa999eebe6545a1a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 27 16:17:40 2004 +0000

    Remove accidently commited test of "__attribute__((const))".

commit 9e632b5def17fb91074fc3659b1503ab99289120
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 27 11:28:14 2004 +0000

    Switch to color keyed cursor if shape doesn't have alpha or if translucent
    windows are disabled.
    
    Color key is hard coded to 0xff 0x00 0xff. This will change upon introduction
    of real cursor objects in the core.

commit b0ca6c15ed3873b410f31937b4f04796ef3176af
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 27 10:43:20 2004 +0000

    Fixed redefinitions of _GNU_SOURCE.

commit 458a61d13665b8aeb1500e2939128a94140dc884
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 27 08:48:43 2004 +0000

    Fixed failing assumption upon window destruction, i.e. assume that
    either the window is not destroyed or the event is DWET_DESTROYED in
    dfb_window_post_event().

commit 47a931d734f265f3eeb1bf31ed9b3bbbb016b66c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 27 08:44:25 2004 +0000

    Added DFB_MAGIC stuff to arena.

commit 55fb47d38adcb2a6124dae687e5da05cd443ade3
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 27 05:31:29 2004 +0000

    Added SGRAM block write support to mach64 driver.
    Bumped mach64 driver version to 0.12.

commit e457bfae62455f53bb62accc3dd566881a9a3b49
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 27 04:58:06 2004 +0000

    Added detection for Rage Pro chips.

commit 531bc44bc40274bf067ebf7e74c9a0b5a8502fb2
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 27 04:44:40 2004 +0000

    Fixed blending once more. Some 3D registers aren't accessible unless
    SCALE_3D_FCN is set.

commit 22ddbb31a72d8ee753b5fbd3ee3a7d9049ccd4bc
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Feb 25 13:21:07 2004 +0000

    Re-enabled 2x horizontal zoom with RGB32 on G400. The problem was that
    BESHISCAL wasn't doubled when 2x zoom was enabled.

commit b71d409302e1dc8737bd9daeafdd61865f6fa5bb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 25 03:15:13 2004 +0000

    Add "-D_GNU_SOURCE" to DFB_INTERNAL_CFLAGS instead of CPPFLAGS
    to have it exported via directfb-internal.pc making external modules
    much more convenient.

commit 3319099f98e4964ee1515cb76a53537771d42089
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 24 09:23:12 2004 +0000

    Renamed DSCAPS_FLIPPPING to DSCAPS_DOUBLE.

commit f7f3ceb88b3df242385f264bd1d4f19b138a2349
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 24 04:07:36 2004 +0000

    2x horizontal zoom doesn't work right on G400 with RGB32. It doubles the
    image width and if you move the image to the right so that over half of it
    gets cropped the whole image disappears. Without hzoom enabled things seem
    to work just fine even with the pixel clock running at > 200 MHz.

commit fd10e00bc33c9d48c74a048e95774bf7c81a6a28
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 24 02:09:12 2004 +0000

    Matrox BES overhaul:
    - Moved G450/G550 detection out of CRTC2 specific code because BES needs it too.
    - Max source width is 2048 for G450/G550.
    - 2x horizontal zoom pixel clock limit is 234 MHz for G450/G550 (from XFree86 source).
    - Handle destination cropping.
    - On G400 all horizontal parameters need to be doubled for RGB32.
    - G450/G550 can handle RGB32 without scaling limitation.
    - Bumped driver version to 0.7.

commit bba9cd1250e9b13feb0690cc5565c1ab106b4ab8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 23 22:44:44 2004 +0000

    Fixed Bop_a8_set_alphapixel_Aop_airgb(), i.e. render opaque pixels of
    glyphs correctly onto AiRGB surfaces.

commit d3de90207dc5c9153f06a66b11b7acfe2d246291
Author: Andreas Robinson <andors@directfb.org>
Date:   Mon Feb 23 09:05:14 2004 +0000

    Long standing I420 video bug (trashed display) fixed.

commit b58dc796f21ec8d682c0ba88641896dc94abc880
Author: Andreas Robinson <andors@directfb.org>
Date:   Mon Feb 23 08:58:13 2004 +0000

    Added color adjustment code. It is disabled for now - the DFB->HW mapping is not
    yet producing correct results.

commit 6e6ae0ebe8e576b3b5e93b6a3eab67e68bda68c7
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Feb 21 04:28:31 2004 +0000

    Oops.

commit 08ccb946c95f34498c000c5aefb11c7e8a6bd5f6
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Feb 21 04:25:58 2004 +0000

    Destructor forgot to use dfb_layer_region_unref().

commit 7371f807f041c1cec16fa927f1eb4da848c6280e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 20 22:58:23 2004 +0000

    Fixed long standing typo: gAquire() -> gAcquire().

commit a55c4c9625af7abafb821fe990a216f7e779935b
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Feb 19 22:43:43 2004 +0000

    Added support for format conversion blits and DSBLIT_BLEND_COLORALPHA.
    DSBLIT_BLEND_ALPHACHANNEL, DSBLIT_COLORIZE and TextureTriangle() would
    require using the texture engine. Unfortunately texture pitch must be a
    power of two value so this would require changes to the memory allocator :(
    
    Changed alignment limits to match hardware capabilities (hopefully).
    
    Reset SCALE_3D_CNTL and OVERLAY_SCALE_CNTL driver_close_device().
    
    Bumped driver version to 0.11.

commit deb1d1bf019469a5de6a66f8bd1771b09131fac2
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Feb 16 15:45:18 2004 +0000

    Changed License field to LGPL.

commit 134ab65fe5ac7015cc6b57b96babb9f59ccd1858
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Feb 14 20:58:48 2004 +0000

    dfb_layer_context_set_configuration() used old data for window stack
    update which eventually caused a segfault in gFillRectangle().

commit 1bdb1a10c6cdd2a8188ce812e9d7baaca713b34a
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 13 15:50:09 2004 +0000

    Initialize ALPHA_TEST_CNTL in mach64EngineReset(). Fixes blending.
    
    Bumped driver version 0.10.

commit c7d03fce9f1ffef992887b93e8b50bacf1eaee70
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 13 01:26:18 2004 +0000

    Added DSDRAW_BLEND support for GT chips.
    
    Added mach64EngineReset() and initialized some registers just in case.
    
    Divided mach64CheckState() to GT and non-GT variants.
    
    DST_BRES_LNTH was written too early which broke blended lines. Strangely enough non-blended
    lines were fine without this change.
    
    Reduced top trapezoid height by one in FillTriangle(). The line in the middle was being
    drawn twice which looked bad with blending.
    
    Bumped driver version to 0.9.

commit 8f7a2d5fd10ae2626e647f9d6f895e6fa29fe766
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Feb 12 17:06:01 2004 +0000

    Bumped driver version to 0.8.

commit 71761cffc62f8b79bdda330b86c0ac9c91f55e79
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Feb 12 17:04:34 2004 +0000

    Added FillTriangle() support for GT chips.

commit eb9ca3734c67d1ffe623961a53ec53b3f470ceda
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Feb 11 10:44:46 2004 +0000

    Only GT models have front end scaler -> no StretchBlit() for older models.
    
    Only set DST_LAST_PEL bit for bresenham lines. It doesn't affect antyhing else.
    
    Overlay source size is limited to 720x1024. It's actually 768x1024 for 3D Rage (LT) Pro but we can't tell the difference
    from the accelerator ID :(
    
    Fixed overlay source color keying.
    
    Fixed overlay source cropping for planar formats.
    
    Bumped driver version to 0.7.

commit 9a6545e8e81429a68a2b1b23149488b6b895e043
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 11 05:41:02 2004 +0000

    Fixed segfault during destruction of input only windows,
    e.g. when closing the context menu of an entry in gtk+-directfb.
    
    Added utility function fusion_pthread_recursive_mutex_init() which
    is used everywhere now instead of several pthread_mutexattr_*foo() calls.
    
    Moved DWET_DESTROYED notification to the end of dfb_window_destroy().
    
    Increased safety of single app core version of fusion_ref_down(),
    i.e. move the reference watcher call into the locked code section.
    
    Moved "-D_REENTRANT" from CFLAGS to CPPFLAGS.
    Added "-D_GNU_SOURCE" to CPPFLAGS.

commit d873c7184ad462fe74df150927230bdf9ccbb277
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 11 05:17:58 2004 +0000

    In DFB_MAGIC_ASSERT(obj,magic) do DFB_ASSERT(obj!=NULL) first.

commit 31063039e29e3c2b020a65ebf58af000a4ae372c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 11 04:39:20 2004 +0000

    Removed annoying surface listener debug output.

commit 9e5c4b6a5b4b2a7de27e7f8b010d5835688be986
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 10 12:43:17 2004 +0000

    Reset input field to zero upon Flip().
    
    Don't wait for previous settings to be loaded when setting new ones.
    
    Use correct vertical zoom again, green line at bottom is from decoder.

commit 0fddb092efae0454e3b98013159ada59b8ff77d6
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 10 11:45:11 2004 +0000

    Added stretch blitting support.
    Bumped driver version to 0.6.

commit 46e5334ceb0fea0d94d2df74b657e50ded8aeee0
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Feb 9 19:07:13 2004 +0000

    - support for powerpc (handle mmio reads and writes correctly)

commit 90d96c8f8d054ee291f7dcf48fa73deb2d305648
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Feb 9 09:02:57 2004 +0000

    Added source and destination color keying to the overlay layer.
    Fixed drawing/blitting color keying bugs.
    No need to replicate bits to fill whole DP_FRGD_CLR register.
    Removed a DSPF_RGB24 case that was left in accidentally.
    Bumped driver version to 0.5.

commit cd532f73b7781d027a30e45b0f47314f2bc15d28
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 6 18:07:07 2004 +0000

    Added DLOP_DEINTERLACING support to video layer.

commit 34e921cc7e41f7ebc95caef8cce18550db073228
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Feb 6 14:06:18 2004 +0000

    shut up CVS

commit 5aed191fc82c78cd644535c5f9237b9e29568ed9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 6 13:53:57 2004 +0000

    Commented out annoying assumption in dfb_core_is_master().

commit 0a80ea3e036187f47b2c5e6aef10b527ecfcb0a2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 6 13:50:34 2004 +0000

    Replaced all 'x$foo = xyes' by '"$foo" = "yes"' etc.

commit bddff63b33c38c5cd76c1c0e07cacc94d01eade4
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Feb 6 11:56:15 2004 +0000

    Initialize SCALER_H_COEFF registers.
    Bumped driver version to 0.4.

commit 0d1f448a5c13b408293aed32a5970ccdd8145a9d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Feb 5 11:54:33 2004 +0000

    Added overlay support.
    Bumped driver version to 0.3.

commit b28ff9f69c42d5c6756c50ee558420d58cc19045
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Feb 4 14:11:46 2004 +0000

    Fixed state handling.
    Bumped driver version to 0.2.

commit 359ea62ac8754978d9190e7d484ae2ebe09595d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 4 07:47:55 2004 +0000

    Some optimizations.

commit 4a463d3c6ed006d772d10d73b9abf69fac3fc427
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 4 05:18:29 2004 +0000

    Rewrote symbol lookup used by stack trace dumping code.
    
    The symbol list is no longer generated at build time for libdirectfb.
    
    Use popen("nm -n ...") to load symbols of any module on demand.
    
    Produce gdb like stack dumps (output formatting).

commit 104d42e5c792f7ae7f467494123a17ae74e06d97
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 23:07:14 2004 +0000

    Removed all "non-static inline" for now.

commit d5b60341429292bd11b6c42e8918bb202a2cd6d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 23:05:58 2004 +0000

    Added DFBDisplayLayerBufferMode to the auto generated
    "enum value / name string" mappings in "directfb_strings.h".
    
    Added DLBM_UNKNOWN for null termination of the map.
    
    Removed top level indention of "directfb_keyboard.h".

commit 2173c24d57b786186f497beba4c4a43d8f992947
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 17:15:22 2004 +0000

    Put DFB_DEBUG into config.h, too.

commit 1304629fb2e6d966866fca7d993ab053b933ff07
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 3 14:08:30 2004 +0000

    Fixed cosmetic copy-paste error.

commit 7faf2adef1603907f4ffa9e69a3cd2883fdc426d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Feb 3 12:57:36 2004 +0000

    Added ATI Mach64 driver.

commit 7908d7f1790fd27e42624734398f495eebc2211d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 04:02:59 2004 +0000

    Check for timeout more often (every 16384 th iteration, was every 65536 th before).

commit 344f1068e072c445c070247dd57fee37d53fbd22
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 03:54:57 2004 +0000

    Added benchmarking macros.
    
    Each benchmark runs for one second now.

commit b2f63d65392a676f93209228268598c767b0e7b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 03:16:13 2004 +0000

    Use recursive mutexes in threaded mutex benchmark.

commit 1a85345b7bfb4f56b9df63ef2705659f80b42b4a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 3 02:56:20 2004 +0000

    Replaced getpid() reference benchmark with an flock(2) benchmark.

commit e3ea9127a481d3bc9839474e77bfb3d5f14e89ea
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Feb 2 20:52:15 2004 +0000

    - set default overlay mode to YV12 instead of RGB16 (just testing)

commit 02ac1ef679c119ca9d7062829a858f1ef78ef41b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 2 20:49:53 2004 +0000

    Added configure option "--enable-zlib" that activates gzipped screen shots etc.

commit cb1458c01f68c68fab416e51ec1f735e55963bd0
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Feb 2 19:48:51 2004 +0000

    - if the environment variable DFB_CLE266_UNDERLAY is set, the videolayer
      is treated as underlay. primary layer hooks will be installed, so that
      the transparency of the overlay cat be set by using the primary layer
      interface.
    
    the GetLevel/SetLevel stuff might act strange now. will be fixed later.

commit 8bd1780423c751fdd1c281b946e6c055b1a70c67
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 30 16:34:12 2004 +0000

    Fixed an error handler.

commit 30b3f1d25c058f3ca8ca6e27a15a98ae88de5bce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 30 15:08:35 2004 +0000

    Forgot to decrement num_buffers in buffer_destroy().

commit 5a5077d6e8b8f7bbcdf13c1b79c1de33ecf7f8fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 30 14:57:34 2004 +0000

    Add -finstrument-functions to internal flags if enabled.

commit b40f2a64c048f750f789e3220cb4c8dcf5843f04
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 29 15:18:08 2004 +0000

    Enforce realization of layer region upon GetDisplayLayer()
    and SetCooperativeLevel() again to fix e.g. SetScreenLocation() for
    layers without a surface.

commit 19fe0bc3474d075e339b413f155fd90c39ec0cba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 28 17:32:35 2004 +0000

    Show layer levels.

commit 7a43f301c0e2b223901b337a2f1723035254503c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 28 17:17:11 2004 +0000

    Print "unknown" if pixel format of context is unknown.

commit fc1a25296fe1324f7baa57285ed9e0cce9a2bf67
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 28 08:33:38 2004 +0000

    Dump contexts.

commit e5de11210b19b571a47ff3c00004d8ed2b48ce02
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 28 07:44:39 2004 +0000

    Avoid multiple dumps of local memory leaks at exit time.

commit 2979c927f785fc79c55084ec746fc2ec156af0d6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 28 07:28:28 2004 +0000

    Further finalization of the new layer code.
    
    The primary region of a layer is no longer created and activated
    during creation of the context.
    
    IDirectFB::GetDisplayLayer() no longer causes the layer to be shown or
    its surface to be created. Even IDirectFBDisplayLayer::SetCoooperativeLevel()
    and IDirectFBDisplayLayer::SetConfiguration() no longer cause that.
    
    A layer is allocated and shown upon:
    1) IDirectFBDisplayLayer::CreateWindow()
    2) IDirectFBDisplayLayer::GetSurface()
    3) IDirectFB::CreateSurface() <- if primary & fullscreen
    
    Fixed failing assumption for exclusive access to additional layers.
    Fixed missing context and region destruction after releasing the layer.

commit f153145ac8711da92e4b239ea2c1d1f77f47e300
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jan 27 22:27:58 2004 +0000

    Re-added CRTC2 sub-picture opacity handling.
    Don't touch sup-picture bits of C2DATACTL in CRTC2 code.
    Removed mcrtc2->enabled.

commit e435f5cfa515eccb42cca5c7004784d5ec6f157d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 26 14:41:52 2004 +0000

    Decided to use floats in DFBVertex instead of fixed point.

commit 38c8f414f0cd14bcb669a33e581d8fd38d0365c1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 26 14:36:41 2004 +0000

    Fix sanity check for DTTF_STRIP.

commit a60fd1a4fafdc87574ee7752864c93606abbba4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 26 14:25:47 2004 +0000

    Initialize pthread key.

commit ca5cdd584ab32b16be51f9266edd827b088e5ae1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Jan 23 18:49:50 2004 +0000

    Use DFB_COLOR_BITS_PER_PIXEL() to calculate surface palette size.

commit b545132b89b811a127676300a808e1c1bd2e5efd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 22 17:15:06 2004 +0000

    Added IDirectFBSurface::BatchBlit() which increases pixel throughput
    of many small blits with same source and destination, e.g. custom font
    rendering like GTK+-DirectFB does.
    
    Benchmarks (P3 800 MHz, G450 AGP, 1280x1024, 16bit)
    
    Size.......Blit...BatchBlit (10 blits at once)
    8x8..........9.....35
    16x16.......36....138
    32x32......144....259
    64x64......326....327
    128x128....363....367
    256x256....386....390              in MPixels/sec

commit 708bae68c06eb7fc38910c711215fb5bf9c27e84
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 21 22:00:16 2004 +0000

    Fix build for gcc 2.95.

commit 31084e7aa9ca07bbf4a50bf2cbf53e0803506f57
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 21 18:41:16 2004 +0000

    Fixed option "linux-input-ir-only".

commit 88f30c57c6ce95487f86c0109a7577858c4e38f8
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Jan 20 22:09:26 2004 +0000

    Store default color adjustment into layer context.

commit 1d9ecac807dfd2606164ef588ea842f817925c3d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 20 19:36:39 2004 +0000

    Added option "linux-input-ir-only" which tells the linux input driver
    to ignore all non-IR Linux Input devices.

commit 6ba9f68f786ed958cd757d3301919ee84937b190
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 20 02:24:14 2004 +0000

    Implemented DTTF_STRIP and DTTF_LIST, too.

commit e24979c34a8b5079d87f972fb51b28f7339d6b36
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 20 02:21:00 2004 +0000

    Fix doc for DFBTriangleFormation.

commit eefb37cb8a3c8ddc3206d240f004d0a5c2e42d6e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 19 17:31:31 2004 +0000

    Take linux input code as hardware keycode.

commit 87de49babbb52e72116f278697ce5adb3ae06d54
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 19 14:09:54 2004 +0000

    dist fixes

commit 86a349cf91e7218bb6cda8ccead1d3275d0039df
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 16 20:27:47 2004 +0000

    Use CSLF_FORCE, fixes failing PlayTo() on a fresh surface.

commit 1f7264083e7d5c8bf334cb7c6d9d2754b7e3728b
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Jan 16 17:54:08 2004 +0000

    do not use uc_ovl_setup_fifo(), it does not work as expected and causes display errors.

commit 2e78810414fb82a3f70408877cb8026d3b25d9e5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 16 17:42:59 2004 +0000

    Fix a8 font rendering for argb1555, i.e. remove alpha pits around glyphs.

commit ecea51abf206a2112017158f22386699ed3c490d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 16 06:35:04 2004 +0000

    Added DFB_MAGIC handling to surface manager and state functions.

commit 50c5949636f540ae507df515ef5fc54808a4092f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 16 06:10:04 2004 +0000

    Added DFB_MAGIC handling to CoreFont functions.
    
    Reduced minimum spell length to eight (including null character).

commit e07223db3674d2dd5e6b966370c7c10235110eff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 16 05:27:20 2004 +0000

    #include <errno.h>

commit c315940a773940ffa21fb797acb0128ce6d19e78
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 16 05:03:20 2004 +0000

    Initial version of the screen mixer/encoder/output APIs.
    
    An output is connected to an encoder which is connected to a mixer which
    combines selected display layers ;)
    
    Added a lot of types for description and configuration of these components.

commit b46a812e8f597505839f7e716892da083807d33a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 15 17:14:01 2004 +0000

    Renamed DFBScreenEncoderTVNorms to DFBScreenEncoderTVStandards.

commit 841a4e6f610b4c15fba8291ec1e358f3aba8e848
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 15 15:26:29 2004 +0000

    Initial support for encoders and outputs.
    
    Added IDirectFBScreen::GetEncoderDescriptions() and GetOutputDescriptions().
    
    Added all new types to the auto generated "directfb_strings.h" and dfbinfo.

commit f8118c235c8150e3b27a7040803995dccb4277cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 15 13:38:45 2004 +0000

    Set stack->cursor.window = NULL in window_destructor() if the cursor window
    is being destroyed, e.g. during shutdown.

commit 972cef2f5778d120ad6d52c3f73900fba54eedab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 15 13:19:02 2004 +0000

    Ooops.

commit 02298a10df1efad7a4ce66dcf6d4b3e88903a160
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 15 13:17:16 2004 +0000

    Set keys[i].code = -1 in window_withdraw().

commit bb9aa1b5dbb241985aa643b7ed6ecb9225c83f8f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 15 13:13:27 2004 +0000

    #include <pthread.h>

commit 492d994f87a3d6f9efd56df54b910a2ac6ec28db
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 14 14:53:37 2004 +0000

    Fix plane multiplier for YV12 and I420.

commit 7a4142f6b790b6348aab85720f1d75418039673d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 13 23:54:48 2004 +0000

    Moved write() call after the unlock.

commit 734014b8868a23628ad943259bcdaba7a2f3931d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 13 19:09:48 2004 +0000

    Use flags for dfb_gfxcard_lock() instead of four booleans.

commit 8889d1087b0ff77834699a3d911a14044bbed72f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 13 19:08:53 2004 +0000

    Argh, move magic behind link header.

commit 856b3cb3b2dfc06b3989518fabf9dcaed4750371
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 13 17:44:58 2004 +0000

    Use DFB_MAGIC_SET/ASSERT/CLEAR for FusionObject and FusionReactor.

commit ca4faa96434e501e910e111a6ae4dfc674fc4cfd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 12 20:34:12 2004 +0000

    Readded IDirectFBDisplayLayer::WaitForSync() for convenience.

commit 0896b5ed31cdabe4db1ddf4f5bff68aa6b8fb723
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 12 15:28:29 2004 +0000

    Added a missing lock/unlock pair.

commit 49ad2ee6c6138875587bbc7be40f982cfa097111
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 12 12:44:47 2004 +0000

    Speed up builtin stack trace support a lot
    by using thread specific data instead of gettid().

commit 3d6ad2a20f03b8d10b0843ee5409a674de926efc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 9 11:14:51 2004 +0000

    Quick solution for middle mouse button emulation:
    Press <Meta>-<Ctrl> + Left/Right Click generates 3rd/4th button event.

commit 583397b66a7d9d790e80facdeb5f23980863c91b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 9 10:32:28 2004 +0000

    Fix Makefile for newer automake.

commit 9b666f3515bc4fead73a1dcf3e2f4f9006ad3f01
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 8 19:49:55 2004 +0000

    Added IDirectFBSurface::TextureTriangles() which takes a source surface
    as the texture, a pointer to a DFBVertex array, the array size and the
    DFBTriangleFormation which can be DTTF_LIST, DTTF_STRIP or DTTF_FAN.
    
    Each DFBVertex contains transformed x, y, z, w, s and t coordinates
    using some fixed point integers.
    
    The set blitting flags are used.
    
    Implemented textured triangles for CLE266 (only DTTF_FAN yet).
    
    Started a Matrox implementation, but don't know how to calculate
    perspective coordinates for the trapezoids (s, t and q).
    
    The added code is very small, but applications can now render full
    3D scenes with alpha blending, color modulation (for lighting) etc. ;)
    
    But be aware of the missing Z buffer...

commit b2a89e2a76bfb47a42512e4e3edd616db1ec1f8e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 8 19:26:44 2004 +0000

    Introduce IDirectFBScreen:
    - Display encoder and output connector settings,
    - input device assignment in multi head environments,
    - power management, synchronization.
    
    Added DFBScreenCapabilities with DSCCAPS_VSYNC,
    DSCCAPS_TV_ENCODER and DSCCAPS_POWER_MANAGEMENT for now.
    
    Added DFBScreenDescription with the caps and a screen name.
    
    Added IDirectFB::EnumScreens() and GetScreen().
    
    Added IDirectFBScreen::GetID(), GetDescription()
    and EnumDisplayLayers() limited to the layers on the screen.
    
    Added IDirectFBDisplayLayer::GetScreen().
    
    Moved IDirectFBDisplayLayer::SetScreenPowerMode()
    to IDirectFBScreen, called SetPowerMode().
    
    Moved IDirectFBDisplayLayer::WaitForSync() to IDirectFBScreen, too.
    
    Added Matrox CRTC2 screen.
    
    Added more types to the auto generated "directfb_strings.h".
    
    Added screen information to 'dfbinfo'.
    
    Added CoreScreen and ScreenFuncs.
    
    dfb_screens_register() returns the CoreScreen pointer to the driver.
    
    dfb_layers_register() takes a CoreScreen pointer as its first argument now
    and returns the CoreLayer.
    
    Added dfb_gfxcard_sync() call in front of the driver's FlipRegion() call.
    
    Moved WaitVSync() and SetScreenPowerMode() from LayerFuncs to ScreenFuncs.

commit 714b6483110071d09102fa2e8592312586677064
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 8 18:20:17 2004 +0000

    GPM repeater support by Micha Nelissen <micha@neli.hopto.org>.

commit f12c38992b4ac64878b29623d499efa39fe36103
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jan 8 15:08:15 2004 +0000

    updated section about BSD

commit 538a4ffa3a3ed25c212230bf0a003f298f29a893
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jan 8 13:48:13 2004 +0000

    remove (__compar_fn_t) typecast, this is not available on FreeBSD and others

commit 77b9447ae9756c5fcb299d2ff3a19a32fbd015f8
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jan 8 13:43:33 2004 +0000

    also define __s32 for non-linux platforms

commit 70b784d64298005614b4b971fe9ed64d07f8c4a9
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jan 8 00:01:39 2004 +0000

    put #ifdefs around si_codes, not every platform defines all of them.

commit 30badb490ea3445c3b5e40eb4acc9e47ead4f1bb
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jan 7 23:33:06 2004 +0000

    make platforms without PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP happy.
    (reviving FreeBSD support)

commit ee1bee0316ea6dfbaff5d71cde8f179947d10d63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 6 09:27:54 2004 +0000

    Cosmetics.

commit f69169267319da728586d5c62fb914721549a3bb
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 5 15:27:31 2004 +0000

    order the default set of gfx drivers alphabetically

commit 26a1a960de923bfc5c570e200bfe6e542a002f0b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 5 14:27:41 2004 +0000

    Use gettid() instead of getpid() if available.

commit 6d086443ffe430cbcd4ac52d8fa642d7a147c4cd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 5 13:36:18 2004 +0000

    Don't enable ELO input driver by default. It blocks during probe.

commit 2fb01242b944bb5244d3f2d747dc575b9db994fc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 28 09:19:52 2003 +0000

    Clip opaque region to window boundaries.
    
    Minor cleanups.

commit 7891d5625b0d26ca5506e42eca974aded4a68076
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 28 03:08:07 2003 +0000

    Added IDirectFBEventBuffer::CreateFileDescriptor() that returns a file
    descriptor that can be read from including support for select().
    If only the file descriptor is used the buffer still needs to be flushed
    via IDirectFBEventBuffer::Reset().
    
    Reduced reference up/down in window stacking code.

commit 9421c92d391feac85e2ccc9e45435758247a38e5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 19 20:35:21 2003 +0000

    Fixed recognition of "a1-font" option when no attributes are specified.

commit 3dbe49b124c5ec7c9df42812fb75c8b86a98972f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 19 12:47:03 2003 +0000

    ELO Touchscreen driver, thanks to Brandon M. Reynolds <breynolds@comtime.com>!

commit 0b56002fdf16c481a076428d3e227475cc8a8426
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 19 12:01:08 2003 +0000

    Added /dev/misc/psaux.

commit 327ca686a48e958d00e772da39d4e70485957bb7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 18 15:42:30 2003 +0000

    Added "a1-font" and did some updates.

commit da6336529b63b4862254c5a46061ecdf05560a13
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 18 15:26:51 2003 +0000

    Added "a1-font" option.

commit de20f813f6cf1af872bb43b078a53b9127e22575
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 18 15:11:42 2003 +0000

    Implemented all Bop_a1_set_alphapixel_Aop.

commit dd03d03ba33fdacbab242d2e11177048d13e0eb7
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Dec 18 13:10:42 2003 +0000

    - fix segfault, overlay still does not work for me (never did?)
    - remove XBOX specific code for now.

commit 5e8ec08b08ae862fabca7e47c03fdc724925bb2d
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Dec 17 20:24:06 2003 +0000

    build nvidia driver by default

commit 964953e44c9f71ccd0a388c45de01d04af6f9071
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Dec 17 20:19:26 2003 +0000

    updated nvidia driver (follow internal layer/region api changes).
    I couldn't test if it still works, at least it compiles.

commit 0a739673580b257c9dd0da9688a5bcd99943af5e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 17 03:14:18 2003 +0000

    Speed up kerning cache.

commit faf9876dfc07754067aecf54771a320db9571731
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 17 01:02:19 2003 +0000

    Align the surface width to be a multiple of eight pixels.

commit b5fefd537696597c49b26a5169f2646b60dabae8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 17 00:10:47 2003 +0000

    Rubbish.

commit b9465d4cd089eb9c295d2d3203678be91e4477ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 16 23:41:44 2003 +0000

    Drivers can choose between byte/pixel pitch alignment, or even use both.

commit ae630e568666412bf865c354f16d6422b2968818
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 16 22:58:56 2003 +0000

    Preliminary DSPF_A1 support.
    
    Added DFB_PIXELFORMAT_ALIGNMENT(format) which is non-zero if alignment
    is required to do byte aligned access, e.g. 7 for DSPF_A1.
    
    Added DSPF_A1 support to FreeType2 font implementation.
    
    Implemented Bop_a1_set_alphapixel_rgb16(), "df_dok --mono" works using A1.

commit e91fac3f6eff151676d2e02ae79b94b633b1a9c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 16 22:30:16 2003 +0000

    Optimized glyph info prefetching code,
    speeds up DrawString in df_dok by ~10% on my Matrox G450 (P3 800E).

commit 7b8ecee801e19525c4d0720f732428d9ef1d4570
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 16 20:49:32 2003 +0000

    Don't rely on correct kernel headers.

commit 09975184a1d4f99ece54e8a2748f3306783cb66c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 16 06:51:34 2003 +0000

    Readded missing call to dfb_windowstack_flush_keys() during context switch.
    
    E.g. pressing Return in an xterm to start a fullscreen app didn't send the
    corresponding release event, because the fullscreen app was already running
    during the real release of the key.

commit 1d581b0ab1bc8fb4864ba5728080e7048fa271d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 16 02:44:26 2003 +0000

    Fix failing assertion [stack->cursor.window != NULL] in windowstack.c:350.
    It was triggered by setting the cursor opacity to zero.

commit b599e240e9b099360e90e328e72b30b7e547f048
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 11 02:25:27 2003 +0000

    Added DFB_PIXELFORMAT_INV_ALPHA(format).

commit 714d832a8dfcffe5da54fe6299e685a32e9e681b
Author: Andreas Kotes <count@directfb.org>
Date:   Wed Dec 10 21:17:25 2003 +0000

    revert strange side-commit

commit 787abb9a3d46f86e4c0a38e3b9e3aee8819fa4ea
Author: Andreas Kotes <count@directfb.org>
Date:   Wed Dec 10 21:15:48 2003 +0000

    repeat a liiittle later

commit f9cb70c2f01b591e0a568d528025880cf100c1d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 19:56:29 2003 +0000

    Use DSBF_ONE for destination alpha if DSBF_INVSRCALPHA is used.

commit 0f1b805c87f0ecc2d68f1e282ab95305578e73de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 19:01:25 2003 +0000

    Fix format conversion blits from non-alpha to alpha surfaces
    by enabling alpha channel writes and fixing uc_map_blitflags().

commit a8150942177a97d17f21158bad06de57c388816b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 17:59:52 2003 +0000

    Finally remove DSPF_RGB15.
    
    Fixed enum name generation for constants with lower case characters.

commit 91a55500cae447fe181676f916dbc0a67c531141
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 16:04:00 2003 +0000

    Reset repeat counter only if symbols differ.

commit 838fa2ad266c7c4796d73d856d536458cb6fab5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 15:49:03 2003 +0000

    Fix copy'n'paste bug.

commit 7d68a53a5a2a74d5e25d5a879f69dcd61efba8a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 14:14:09 2003 +0000

    Reset repeat counter.

commit d3a0e089a392a7ce6f57d561403c34234e506f1a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 10 13:50:40 2003 +0000

    Fixed assumptions.

commit 57f3a7c73214356098357224a235b8673c0424ef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 9 21:24:31 2003 +0000

    Use software fallback for broken blitting from non-alpha to alpha surfaces.

commit 2f8cce6b7aba0cf99586e7cc5dcb83ce27a3b6d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 9 20:28:07 2003 +0000

    Hopefully fixed blitting of surfaces with an alpha channel, but without
    using DSBLIT_BLEND_ALPHACHANNEL.

commit 779a098c1f43c772fc1751619af43580e675ca0b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 9 20:25:34 2003 +0000

    Emulate keyboard like key repeat behaviour using select() with timeout
    and a counter to drop the first two repeats.

commit ef44d77b322f12e97f5d2576648f993263498bab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 9 15:46:45 2003 +0000

    Added diagonal cursor keys.

commit 45b1cbcdae7f128e29b7d1dc94d113fc14ff844d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 9 14:57:14 2003 +0000

    Don't destroy object pools during emergency shutdown.

commit 49d9a0b9533947ae71b6b98587d2dd8565de105f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 9 14:51:41 2003 +0000

    Added support for DSPF_AiRGB.

commit d7aa86cec7793327a751c6ba290f207aeb0ce9a4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 8 20:55:32 2003 +0000

    Color bug seems to have reappeared after I readded the W component.
    Enabled dithering again ;(

commit 85e483fe7dae0e68d1382f6592c4793c113ed63a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 8 18:28:19 2003 +0000

    Added new pixel format DSPF_AiRGB, i.e. DSPF_ARGB with inverted alpha channel.

commit f31738c706e139cf5e9ff126ae1da4e0e2aedeb9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 5 15:13:56 2003 +0000

    Added debug message after module registration.

commit 681a7be9e7b5bb69ec0fa9c1ca63aa1befbd3a1d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 5 13:42:34 2003 +0000

    Corrected to DFB_GRAPHICS_DRIVER(cle266) to match library name.

commit 097bac636f36b2b384d0aac80caa707766675ec3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 5 12:19:56 2003 +0000

    Added DSBLIT_DEINTERLACE support to gBlit.

commit 14188ad426b7327c2013619a08ff6f378061452c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 5 05:49:01 2003 +0000

    Set 64k stdout buffer.

commit ce912964c1359817e316c8ffa784f82de27e8b67
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 5 04:01:06 2003 +0000

    Updated copyright header.

commit dbcfd6214db52610e1ac1ebcd2ae5dd7c3ba9bf1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 5 00:17:44 2003 +0000

    Added DFB_MAGIC_SET, DFB_MAGIC_ASSERT and DFB_MAGIC_CLEAR.

commit f163a2f73b9784232a99d1b9cc18d90fe645e3d6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 4 20:43:45 2003 +0000

    Add local reference to primary region of primary context.

commit 21de00a5d5fc61bec4a371daaa2d764c3344b55b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 4 19:15:24 2003 +0000

    Show layer name in debug message of destructor.

commit c1a059d6b23cb4bd2b93e9ddefd40985bf5d6c1f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 4 18:07:04 2003 +0000

    Link the primary region into the window to fix the destruction order of objects.

commit 9e083274e418151cf10f3adcbfcd8e4b6be9c651
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 4 18:05:02 2003 +0000

    Added timeout to fusion_sync().

commit 7df0d946fae81874d010d4394b40ee985820fcbf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 4 17:20:49 2003 +0000

    Clear the stack pointer after destruction.

commit c6c466f75310662ea5bb06e0f10651e24c962e03
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 4 15:43:07 2003 +0000

    Added call to dfb_system_lookup() to fix initialization.

commit bd562f76d999828ca7c26d9df042e5af7ee5ef62
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Dec 4 12:32:57 2003 +0000

    Do not build the wm97xx driver by default.
    The kernel header seems broken and until this is fixed, you will have
    to enable the build explicitely.

commit e26839d242693efd1a158018aae0e7d2d4185c70
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 19:08:26 2003 +0000

    Added "bcast true" support to fb.modes parser.

commit 5fee2d09c8cf2154d5c615d057f3319275c261c5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 19:07:41 2003 +0000

    Added another sched_yield().

commit a582c66f7712cb1bda026b870c3dd0d63f722c52
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 18:47:31 2003 +0000

    Back to local uc_fifo ;(

commit 7e59edf3764175cd0553d622c07fd418137b9244
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 18:33:11 2003 +0000

    Made struct uc_fifo volatile.

commit cb3c02bfdc9eb0610813d8d20cff716da745f120
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 16:57:24 2003 +0000

    Removed function pointer from shared memory.

commit 7f43a7d5d26d455b4f25762228970125b13372e3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 16:51:40 2003 +0000

    Increase surface reference counter in grabbing thread.

commit db49c9782324ec733767b8b5b4ebfc368fffeef3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 13:55:06 2003 +0000

    Use +0.5f/-0.5f instead of +0.6f/-0.6f for vertical field alignment on the
    destination when DSBLIT_DEINTERLACE is used.

commit bd86f4f44f704c0e5fef0ab473fc7d024fd9305d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 13:51:53 2003 +0000

    Added deinterlacing support for grabbing mode,
    i.e. added dfb_surface_set_field() calls to grabbing thread and added
    second frame callback to the loop (to make 50Hz out of the 25Hz of v4l).
    
    Made grabbing thread CTT_INPUT (with nice value -10 having the same
    priority as input threads).
    
    Made grab mode surface listener be aware of video memory surfaces.

commit 755acf026fcde72c5b675183b32ddf6772a6d8e6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 3 13:04:52 2003 +0000

    Added option to disable WM97xx driver.

commit e51ffea956af5a95c3499d6fede86344b04ab85c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 08:44:03 2003 +0000

    Fix screen location.

commit c868a1c9b499f11d08dacacb652a2ce2ecccbada
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 06:18:18 2003 +0000

    Beautifications.

commit 73f43162c74557d5f3279874a2f45c383edd939e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 05:36:04 2003 +0000

    Optimizations and cleanups.

commit aa48f0af5db23d12971ce8dca0f3ae9c0d11d3d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 04:28:44 2003 +0000

    Remember clipping region and only update hardware if the clip changed.

commit c925940e3a36b3303a6e8ec22eb2814e03ca81cb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 04:16:36 2003 +0000

    Added state (in)validation for color2d and colorkey2d,
    invalidating each other during validation.

commit db6f08e9ad704a6fb935d87cf343954c70843a27
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 03:39:43 2003 +0000

    Use one set of flags instead of several booleans for state validation.

commit 839a36e01a6b7d1a7436429d392dfdbe0bff8d00
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 03:25:55 2003 +0000

    Use one uc_fifo struct for all processes.

commit 949f717f6271bae8e856e2c84ea5496503c23481
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 02:55:49 2003 +0000

    Minimize state changes during text drawing.

commit 1b4d59d640150b606058c61b9f83cb6c2ef72cf8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 2 01:26:01 2003 +0000

    Define FBIO_WAITFORVSYNC ourself if it's not defined by <linux/fb.h>.

commit 17569cbb0eb1ccbf593445a154fd247fea26872f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 1 18:41:29 2003 +0000

    Readded W.

commit 346fe69aba1e2b86fc1587671039f33e8b85c7bb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 28 16:59:13 2003 +0000

    Implemented DSBLIT_DEINTERLACE.

commit aa1d26ed9b8825c344973560a93073800e031600
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 28 06:06:14 2003 +0000

    Disabled dithering again...
    
    ... because: I fixed the triangle (rectangle) color bug! ;-]  *jump* *jump*
    
    Use HC_HShading_FlatC instead of HC_HShading_FlatA, so the hardware takes the
    color value from vertex C which is the only vertex being written twice, i.e.
    once for each triangle. It seems that the hardware (which got the color via
    vertex A only once for both triangles) kept an RGB16 version of the color
    and used that for the second triangle...
    
    To clarify this in the code even more, vertex A and vertex B have a '0' instead
    of 'ucdev->color3d' written to the FIFO.
    
    I also changed uc_fill_rectangle_3d() to use the "HC_HVCycle_AA, HC_HVCycle_BB,
    HC_HVCycle_NewC" sequence to use HC_HShading_FlatC instead of HC_HShading_FlatA.
    
    
    Heavy DMA problems with v4l overlay capture some to be gone! ;-]  *jump* *jump*
    
    Still some minor glitches are noticable under huge GPU load.
    But these appear just for one frame. There are no dead regions
    (bunch of lines which can't be written to for several seconds) anymore.
    
    The fix seemed to be setting 'ucdev->must_wait = 1' after flushing the FIFO
    in uc_emit_commands(), it was never set to 1 at all before.
    
    
    Fixed the broken fonts problem! ;-]  *jump* *jump*
    
    Added uc_flush_texture_cache() which simply writes four entries to the FIFO.
    These entries were written in uc_set_source3d() before my changes...
    
    Use correct state invalidation now,
    e.g. no longer set 'v_source3d = 0' if the source wasn't changed ;)
    
    
    Removed UC_FIFO_FLUSH(fifo) from uc_set_state() again :-}
    
    Use UC_FIFO_PAD_EVEN(fifo) at all places where 'cmdA_End' was replicated before,
    doesn't give any performance improvement though...
    
    Changed the FIFO depth from 2000 to 4096 entries to finish a complete string
    without intermediate flushing, even if the string has more than ~70 characters.
    
    Added timeout error message to uc_waitcmd() and uc_engine_sync().
    
    Fixed passing of the destination format to uc_map_blending_fn().

commit eba7584a163c14ebdd85a459c007a8986d919a06
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 28 01:14:39 2003 +0000

    Fixed removing an active context while the session is suspended.

commit f1a8923dc6a4499e0bb24814e3e251753850043b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 28 01:12:48 2003 +0000

    If a dlopen()'ed module did not register itself, try to dlsym() and call
    the default contructor (filename without "lib_" and ".so").

commit 02c5dbd24431dc9489c72155089affe65b61c009
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 27 11:12:07 2003 +0000

    Readded the FIFO flush and HC_SubA_HPixGC setting,
    text rendering was suddenly broken, though I tested it before the commit.

commit d1c8456af0f340ee57c21c8b166bf8ca115789f9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 27 10:55:38 2003 +0000

    Added some comments to guess meanings of HC_Hen*_MASK.
    
    Andreas Robinson, please check those, thanks.

commit a43e0ac46ecd2c57113607996bc77d487a19d0f4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 27 10:48:31 2003 +0000

    Use HC_HenDT_MASK to enable dithering, triangle color bug almost invisible now.
    
    Added UC_FIFO_ADD_XYCST, don't send W coords, saving four FIFO entries per blit.
    
    Invalidate texenv also if source changed (texenv depends on the source format).
    
    Don't set HC_SubA_HPixGC. DRI does it, but we don't seem to need that.
    
    Don't flush the FIFO in uc_set_state(), it's flushed shortly after anyways.

commit 4f7523ba01efee8a4897eeee731ad51270fd0927
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 27 06:50:51 2003 +0000

    Call iopl(3) in each waitretrace(), not just once.

commit 7324e6ab0fe13dac35fc9d83baf91553525e2a0d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 27 01:04:45 2003 +0000

    Use fbdev to map registers, obsoletes cle266vgaio!
    
    Code still works with cle266vgaio for vesafb users...
    
    Made all register pointers volatile.

commit 32d8bf490131f1c9e3a99627b34d62bd75fc8190
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 26 13:14:28 2003 +0000

    Forgot to add CLRCF_DEST to CLRCF_ALL.

commit 6b60c3be92cd724a2026aaadff8128b4748d3996
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Nov 26 13:12:25 2003 +0000

    fix some layer specific stuff

commit 8f50421259290c0514a6863a60282815522a0451
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 26 13:07:39 2003 +0000

    Forgot to add that.

commit dcac37122f80c8184c474959bbb6d41b956c011f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 23:09:18 2003 +0000

    Option "force-desktop" supports stretching now, e.g. using "mode=".

commit ef2ac0adeb2f0f57d2491696a4d22f1d933663ea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 22:53:42 2003 +0000

    Install symbol map for dynamic library if --enable-trace is used.
    
    Shows static symbols in stack traces now.

commit 3ae7aec7743c85d927ce5f529c89e9fecbc471bf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 21:55:02 2003 +0000

    Allow --enable-static and --enable-trace at the same time.

commit 85f6db10a0019c6c0d6c72e4fb9770692be08bd1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 17:03:27 2003 +0000

    Fixed VT switching.

commit c9361b0aa96b76e4176ddbbc4a2a2a5481264b72
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 16:12:22 2003 +0000

    Set hardware palette in region surface listener only if the region is realized.

commit 7df2baa067ae385521970b74b20c26bea6bcda31
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 15:35:16 2003 +0000

    Fix width and height of primary surface as set by SetVideoMode().

commit 1da80e7698efa86752f83d82ba8a5a1cb0674a35
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 15:28:22 2003 +0000

    Use negative ABI versions for debug enabled builds.

commit 8a0e5f631660c401148c9527a275384b9d227c73
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 13:11:01 2003 +0000

    Added DFBLocation which is like DFBRectangle but has normalized coordinates.
    
    Added macros to compare rectangles, regions and locations.
    
    Added preliminary dfb_screen_rectangle() which behaves like the removed
    dfb_primary_layer_rectangle(). The final version of this function will
    be done upon introduction of screens.

commit a16b9e42fe5c87803e808185c17032aa6d0226f4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 12:19:25 2003 +0000

    Be aware of layers without DLCAPS_SURFACE.

commit f1af06ff3b0ebb8b2619bc5310087c3fa53b4aba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 25 12:11:10 2003 +0000

    Fixed usage of layers without configuring them.

commit 599988f97b57535d7c482c9049fb7c3496e8eb2e
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Tue Nov 25 10:57:30 2003 +0000

    added two more header files to make "make dist" happy again

commit 7249619191a1aba73a6f49a5ac86b58829385cfc
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Tue Nov 25 10:53:48 2003 +0000

    - divided driver into multiple source files.
    - removed stretchblit (not supported by hardware).
    - added some more compatibility definitions, so a driver built with and old
      sisfb.h can use the features of new sisfb versions.
    - cleaned up sisfb version check.
    - set state->accel = 0 for DFXL_FILLTRIANGLE. makes it a lot faster, but
      I don't know why, because this function is not supported anyway.
    - added "xabre" to supported fb accel ids (SiS 330).

commit f3158e5df082608dc847163128dfeeb1c2b745d6
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Nov 24 18:52:01 2003 +0000

    don't generate trailing whitespace

commit 6c3eb929b030bd26883f12cb2305cc434eb89601
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 24 18:24:27 2003 +0000

    forgot to port uc_ovl_disable

commit 42abc000fa7a84e82fa84ff3a6ff8eaf259ebc21
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 24 17:55:41 2003 +0000

    Added boolean to dfb_layer_get_primary_context() to activate the context
    if no other context is already active.

commit 723ffe33fedaefab2cad17a5afbbcf2ac0a9ddc8
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 24 17:15:14 2003 +0000

    build cle266 driver by default

commit aadfe5ac8a0580f4ea83e3ba0bee58c9e0c8347c
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 24 17:09:33 2003 +0000

    ported to new internal layer/region api

commit 9848bb5f939bba6be889b4ee501881b8019af3ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 24 16:49:35 2003 +0000

    Fixed shared window palettes.

commit 6db29052d2c0db950ff12395382ed9b4aac0728d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 24 13:08:30 2003 +0000

    Refactored display layer core. Added contexts and regions allocated
    within a context. Drivers are only aware of regions now. Usually a driver
    supports one region per layer. Hardware windows are implemented via regions.
    
    Not yet compiling drivers are disabled in configure.in
    (default of --with-gfxdrivers contains ported drivers only).
    
    Sorry for the driver API driver change, but it's much cleaner now.
    
    Added DFB_COLOR_BITS_PER_PIXEL and DFB_ALPHA_BITS_PER_PIXEL,
    pixel format constants changed, too.
    
    Some other changes and improvements.

commit 814009fb7faa6377862d7dc2074467e18c887ecb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 21 15:07:36 2003 +0000

    If CheckState() reports other functions than the requested one as supported,
    don't ask for them again.

commit 50c4767be94b54cac58ac65c3264001235ef77d4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 21 14:58:54 2003 +0000

    Reject format conversion blits which are unsupported.
    
    Minor state handling fix.

commit aa44468092464b0b5f5229f65385a84bea6fd486
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 21 14:00:43 2003 +0000

    Parse preceding comments in enums.

commit 01724602af1373b1fa7bf4f788480464259c6672
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 20 14:30:59 2003 +0000

    fixed make dist

commit 2f49ac11e807fb5b13f31d9a3cff3cc498d5e4ef
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 20 14:28:02 2003 +0000

    removed non existant sisfb patch

commit f45dda572a20b62f86a8b48625021e2f60abaa69
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 20 13:09:29 2003 +0000

    compatibility definitions

commit 53980785f92e97b4059cd43910ff7561a62181a9
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 20 10:39:46 2003 +0000

    removed obsolete patch. please use sisfb 1.6.23 or above.

commit c7e50e5a6d66bc187e307465c4a6763867c65c0d
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 20 10:38:37 2003 +0000

    - use 32 bit access only
    - configure sisfb so that it does not always maximize vyres
      (requires version 1.6.23 of sisfb)
    - added destination color keying

commit 498f8d98a90661106fc8a9ce1f99bc81efb1c029
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 20 10:33:18 2003 +0000

    require <linux/sisfb.h> for sis315 gfxdriver

commit 5d7ed91179ac2cd73003c1ff9c8e066aef30afb8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 18 22:45:18 2003 +0000

    Removed AC_C_CONST which defined "const" to nothing if -Werror was used, argh!

commit 6129fcb53475bffd6c9899f59ada0ce9fbbaa20d
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 17 20:32:44 2003 +0000

    added hack for forcing grab mode if environment variable DFB_VL4_GRAB is set. (this is for broken hardware with broken busmastering)

commit 9440abb22bd202bbd14796cf52f22a20c6a80c39
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Nov 17 11:02:54 2003 +0000

    Use the recommened way to include freetype headers.

commit feeb770ee07dbad6ac4f7dc8e167c828a4a42ffc
Author: Andreas Robinson <andors@directfb.org>
Date:   Thu Nov 13 13:43:37 2003 +0000

    Added video underlay mode. Updated Readme.txt

commit 3f46eb7e83ffc266455d74d990bb4d51efc6664d
Author: Andreas Robinson <andors@directfb.org>
Date:   Thu Nov 13 12:41:51 2003 +0000

    Print error message on startup if cle266vgaio module can not be accessed.

commit 5970a1600f540b42b1e815fc6f851ebae4250634
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 10 16:53:06 2003 +0000

    - remove libmpeg3 video provider, it has been moved to DirectFB-extra
      and includes FusionSound support.

commit f597aeb3bc878451e078630becc933ab45c0f091
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Fri Nov 7 05:00:31 2003 +0000

    include sisfb patch in extra dist

commit f033956fd415a4db7db6802a6c64fa62ba84f39b
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Fri Nov 7 04:11:30 2003 +0000

    sisfb does always set vyres to the maximum. this patch allows to set custom
    vyres resolutions and therefore makes directfb's accelerated blit working.

commit b3237924252b09b18ee64f0fc9c526593f888656
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Fri Nov 7 04:04:27 2003 +0000

    - added drawing of rectangles
    - added source colorkeyed blits
    - fixed clipping
    - refuse blit with color format conversion

commit 0adff149f2aeeacb1fc92e9a4b4a23ff61ebc675
Author: Andreas Oberritter <oberritter@directfb.org>
Date:   Thu Nov 6 18:50:11 2003 +0000

    new driver for SiS315 chipset with line drawing, rectangle filling in 8, 16 and 32 bpp, blit in 8 and 16 bpp, clipping

commit b52450602059f7b65b48d9764d61f30220e6c5b1
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Nov 6 15:56:53 2003 +0000

    Removed the notice about multi-image powers.
    Not needed any longer now that the version number has been increased.

commit 3bf11e77561e2db1461aeb25a1ea87fa674e76ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 5 23:55:28 2003 +0000

    Don't pause() after kill().

commit 881c6c1a4eb4786e80ec9eb53fc7f20ee4ac3acf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 5 16:24:58 2003 +0000

    No need to SetOpacity() before RequestFocus() for input only windows.

commit 014d792936f01f05bef661396ac6b3fcc8d86d5c
Author: Andreas Robinson <andors@directfb.org>
Date:   Wed Nov 5 13:39:17 2003 +0000

    Define UC_ENABLE_3D. (I forgot to restore it after testing.)

commit 55b5b7c345a65009eea74c319b72386d28318724
Author: Andreas Robinson <andors@directfb.org>
Date:   Wed Nov 5 13:36:23 2003 +0000

    The driver can now be made to avoid the 3D engine by undefining UC_ENABLE_3D in unichrome.h

commit aafe251418f54f1ad6cd141756c4468c4350af61
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 4 22:01:05 2003 +0000

    usleep(20000) -> usleep(10000), much smoother input

commit 145ac49c488752486bf8e712f8342e3485375287
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 4 21:55:13 2003 +0000

    Restore file content.

commit bdac023a0ba082c77195ab723170c7d7f0160e3d
Author: Andreas Robinson <andors@directfb.org>
Date:   Tue Nov 4 08:43:57 2003 +0000

    Added devfs-free compilation options. Minor cleanups.

commit a760fb19ecb6bce5e3077b946cd24706fbfacab0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 1 03:14:44 2003 +0000

    Major code cleanup.
    Introduce new structure "CoreDFB".
    Nearly rewrote src/core/core.[ch] in the way of FusionSound's core.

commit 0a9066211cb54c04fa9b1cfaa2edee8fc6e834fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 29 18:32:54 2003 +0000

    Added option "force-desktop" ;)

commit 4891a5b88caa183fb6d1624ded58e9373313d7c1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 29 16:59:43 2003 +0000

    0.9.21

commit 10a6b8872855da5f52b38d001463a189877a7c8a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 29 16:59:02 2003 +0000

    All <object>_unlink() functions take a pointer to the object pointer now
    and write a NULL into this location themself.
    
    Fixed warnings.

commit 2bf0b10263ce2383004b3723f606f498ab852093
Author: Andreas Robinson <andors@directfb.org>
Date:   Wed Oct 29 13:37:10 2003 +0000

    Benchmarks updated. Minor cleanups.

commit c937d39055eef2807ea29b6cfaa8d7f7de1abe68
Author: Andreas Robinson <andors@directfb.org>
Date:   Wed Oct 29 12:44:42 2003 +0000

    Performs userspace PCI-bus probing and memory mapping.
    Depends on /proc/bus/pci/devices and /dev/mem.

commit 8b7ba2909e0aa7aaeeea65d06da3720f7a6a5a09
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 29 01:48:44 2003 +0000

    Removed an assertion.

commit 92e9ccc7fe03ef33390301ce574720fed6b3c830
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 29 00:03:07 2003 +0000

    DisplayLayer is now called CoreLayer.
    
    Indention fixes.

commit 723aa1dee06266439a6a8fc91cbeceda87d76b0e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 28 21:36:06 2003 +0000

    Set default screen location back to fullscreen.

commit e1e1d4ed744f1c4b2de202fa6abf59401930247e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 28 21:31:11 2003 +0000

    Increase the reference counter in dfb_layer_enable() if it's already enabled.

commit 8120a2db671e34b1958a34bb50f237be119099bc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 28 21:25:51 2003 +0000

    Introduced new object for allocation of hardware regions within layers.
    
    Work in progress, behaviour is still the same,
    but automatic deallocation of layers (disable) is already working.
    
    Test with: "dfblayer -l 1" (should show the overlay for a really short time)

commit b3cfbc1659873a451da8bc5f726cc441eab3aab0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 28 20:48:02 2003 +0000

    Added global ABI version for shared memory.

commit 4c7d26d446d7b2d4c904e99b33be2167545da296
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 28 18:47:44 2003 +0000

    +#include <config.h>

commit d249eec0c3964b3238b9ef82df9e830a869b3957
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 28 16:33:16 2003 +0000

    Added functions for DFB_ASSERT and DFB_ASSUME to save binary size in debug mode.

commit 7cd990d09885d20ab91ee1460a68bd7da947abc6
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Oct 24 23:38:44 2003 +0000

    Mention the multi-image functionality in the usage string.

commit b40555f2ae6e5054fe0e87639f7cc8180aed727e
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Oct 24 18:49:53 2003 +0000

    Tweaked name mangling routines.

commit 04a520acde92e0dd8bd2735870575bc3954f27ec
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Oct 24 18:21:39 2003 +0000

    Do variable name translation for the case of multiple images as well.

commit c3b15976a2c89f5a5c9a4cad4ce957941fe9e049
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Oct 24 16:16:35 2003 +0000

    Dump an array of names and rectangles when processing multiple images.
    Document the new feature.

commit 4860226fb2863977073bd3e77f6471bdf6284e11
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Oct 24 13:46:46 2003 +0000

    Started to add support for combining multiple images into one surface.
    Lacks a few minor features still but shouldn't change the existing
    behaviour.

commit 1a6bb6c5ef0ab781a62800c659b675340cab29ea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 24 04:36:04 2003 +0000

    Added option "--fusionsound" for statically linking with fusion sound.

commit a6695a466e1658b28bcf064462f9ea8452f8691a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 23 16:32:12 2003 +0000

    regenerated

commit 7d9e53cb891e934504d42b204ee81af5002d47ec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 23 16:30:55 2003 +0000

    readd with executable flag

commit e99cf70d2187c19d967bb9459d812b976f319fdb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 23 16:30:32 2003 +0000

    temp. remove

commit a0dc28df72b8257818c831dc7daf9990eef97548
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Oct 23 16:23:54 2003 +0000

    changed andros email address

commit 049616da2bd03dbcab874f79f804afe9c803ba8c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 23 16:01:07 2003 +0000

    Updated.

commit aacf5d4520c6ef04be7f2ac72d300a00e081e35b
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Oct 23 14:12:00 2003 +0000

    minor code formatting changes

commit 5f2dce31898b6945116c1edfdbbb3dfbdfbc9e5a
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Oct 22 09:01:14 2003 +0000

    added Andreas Robinson <andro134 at student.liu.se>

commit b654880727c4709c95f4a9c581054ca73bdb49ac
Author: Andreas Robinson <andors@directfb.org>
Date:   Tue Oct 21 23:24:10 2003 +0000

    Updated changelog for v0.3.0

commit 5f481a40e34079d6d74db83acaae30cbce529376
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 21 15:30:03 2003 +0000

    - version number = 0.3
    - imrovements to state handling
    - workaround for font rendering in some applications

commit b4e22eb8a01b8e6fc97a0d23330cae9ea8237cc9
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 21 13:56:31 2003 +0000

    another state handling fix.

commit e4c656cb8df311fb6db09c9cc9c05345adbd5313
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 21 13:19:32 2003 +0000

    COMPILE WITH GCC 2.95!!!

commit 924de35c6c6c19c29be5bbc822337cb9421e865a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 20 20:04:32 2003 +0000

    Compile with gcc 2.95.

commit 8497262cc2d34cae2b8d710e7ac5b17ebcacf1ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 20 13:39:30 2003 +0000

    Fixed warning.

commit 3fcbdf1fb7bdf5a19d26729b66f5fb47aa1ce320
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 20 13:39:14 2003 +0000

    Added missing ranlib call.

commit e02bf2c3cb58ba92d4bd15c059d693fdf3c0bf3a
Author: Andreas Robinson <andors@directfb.org>
Date:   Sun Oct 19 22:49:56 2003 +0000

    Added AfterSetVar() function. May help with VIA-drivers crash bug.

commit 76b933ae5b41d7948986da541c3fd30babdecf3a
Author: Andreas Robinson <andors@directfb.org>
Date:   Sun Oct 19 22:44:20 2003 +0000

    Fixed some compiler warnings.

commit 72d1f1682c9335ba3b2ff71e1bc03531e7279500
Author: Andreas Robinson <andors@directfb.org>
Date:   Sun Oct 19 22:39:31 2003 +0000

    Print debug msg before writing to hardware register.

commit e7fd0fbdb44022543badc0303082057c4566acd3
Author: Andreas Robinson <andors@directfb.org>
Date:   Sat Oct 18 11:51:41 2003 +0000

    Made the driver use EmitCommands().

commit 45d6d92927dc92ac1fc8478a2b13ddd8868bc5ba
Author: Andreas Robinson <andors@directfb.org>
Date:   Sat Oct 18 11:50:01 2003 +0000

    Removed an unused variable.

commit 562c4f918dd6f6a47e89e4c9ec205754cb6cc54e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 17 16:12:18 2003 +0000

    Fixed warnings.

commit 43d56afae8ddc8d84c495ce4273b7dea678a7928
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 17 16:09:25 2003 +0000

    Added graphics driver function EmitCommands().
    
    It's called when a state is released. Drivers can flush or emit any kind of
    command buffer. This is an advantage over flushing after each command,
    especially for dfb_gfxcard_draw_string() and dfb_gfxcard_fill_triangle() with
    semi acceleration.
    
    Made dfb_clip_blit_precheck() static inline.

commit 2bd54e3f72512e52f59ccc2a63a235f248c7cdf0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 17 05:34:55 2003 +0000

    Updated, too.

commit 239a4965630d9e02a294a62a3e52ea934d30f1f1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 17 05:32:02 2003 +0000

    Added getpid() benchmark as a reference value for system calls.

commit ba4d5f186b126a74b477cdefe0d913de2d4a7966
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 15 21:41:49 2003 +0000

    Added error checking to IDirectFBSurface_Window_Construct().

commit 8aeb95838c0572f30af4d285c54476aa0af6de18
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 15 21:07:19 2003 +0000

    - sync/sleep before each test
    - use simple version for mutex/skirmish with one thread
    - added recursive mutex benchmark
    - added reactor_attach/detach_global() benchmark

commit 283a996ea772a288002d554a33696e4aba6cfe51
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 15 17:01:29 2003 +0000

    Use dfb_surface_data_offset() in dfb_surface_dump() to support DSCAPS_SEPARATED.

commit a86ea87a041bd6f5add62297dd7bb97025a58bfb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 15 16:41:17 2003 +0000

    Added dfb_surface_data_offset() which calculates the data pointer for a
    given coordinate (x/y) based on the pointer and pitch passed to it.
    
    It also handles DSCAPS_SEPARATED depending on the surface which is passed, too.

commit 1c85042724e8b733e0f427584635a34d8d9a24e5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 14 07:59:00 2003 +0000

    Updated.

commit 019fc07ab06906f4a464649a55936a85e4a34c1e
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 13 17:15:50 2003 +0000

    fix state handling

commit c5e8b10aab4e3ab1a415b6227c781284964d2f82
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 13 04:08:16 2003 +0000

    Don't attach the font state to the destination to avoid increasing its
    reference count until the font is destroyed or used on another surface.
    
    Lock original state, too.

commit 9ffde3df5ae0769d999dfb60ed32a4c6571be8dd
Author: Andreas Robinson <andors@directfb.org>
Date:   Sat Oct 11 11:22:11 2003 +0000

    Increased pixelpitch alignment from 16 to 32 to overcome a limitation in
    the video overlay hardware.

commit d3031d2ebafb6081d8432641084865a1d8f5af9d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 10 19:35:46 2003 +0000

    Higher video priority buffers always kick out lower priority buffers.

commit 8433220f469d2fd61e1a98b144cbfb387d702dbb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 10 19:16:40 2003 +0000

    Indicate locked buffers.

commit e3fec9a655c7462d5583e6084230fff2a8a88ca9
Author: Andreas Robinson <andors@directfb.org>
Date:   Fri Oct 10 16:11:52 2003 +0000

    viafb problem workaround rollback - it worked once, but not twice. :-/

commit 0e65489ee6b8c3a6357c846d7d208068ea7ca199
Author: Andreas Robinson <andors@directfb.org>
Date:   Fri Oct 10 15:26:52 2003 +0000

    Worked around the problem which hangs the computer hard if e.g viafb is installed.
    I don't know why VIA's own drivers don't need the same fix ...

commit af5c3cc162f5cf1607e2e06d20d616d1672ca0f4
Author: Andreas Robinson <andors@directfb.org>
Date:   Thu Oct 9 17:17:28 2003 +0000

    Made DSBLIT_COLORIZE and DSBLIT_BLEND_COLORALPHA work in df_neo and df_dok.

commit ec5ccd43f39e51a85d6b20741c10c0ba2c60420c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 14:00:22 2003 +0000

    Small fix.

commit 68dcd5ca801bcd184f59713467347a5e30ae601e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 13:57:17 2003 +0000

    Improved output.

commit e21d5f94950f8238b27d6b42ca306a516aa51503
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 13:37:34 2003 +0000

    Show window id.

commit 5a83bc9115286373039442e86c4c56d818f6c8d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 12:59:39 2003 +0000

    Print "DESTROYED" if window is destroyed explicitly but object is still alive.
    
    Show reference ids for further investigation via /proc/fusion.
    
    Added table header to surface list.

commit 6f372207d30b0272eb66421b51b5251b8e7c8e74
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 12:57:37 2003 +0000

    Don't remove the window from the stack in dfb_window_destroy(),
    but in the window destructor (object finalizer) after remaining
    references went off.
    
    This way dfbdump can show (not fully) destroyed windows.

commit b0ec0e30491543f143e8c81dc3a608ad3e806a56
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 02:13:16 2003 +0000

    Print "GHOST" for ghost windows.

commit 1267fc18565416505f0bb9378074c74d04ed2bc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 9 02:09:06 2003 +0000

    Silently mask out DWOP_ALPHACHANNEL instead of failing in SetOption()
    if it's not supported.

commit c873b06ebfe9aeb1fb78638ab561caf11c04f4b4
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Oct 8 17:08:55 2003 +0000

    fix off by one bug for blended filled rectangles

commit 2a9513faf71efcdf9fce08c858bb50ae6bdb18bd
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Oct 8 16:50:43 2003 +0000

    - correct pixelpitch and byteoffset alignment for surfaces
    - fix off by one error for 3d clipping
    - reenable 3d blitting

commit 3efd2530401af6d01ec8eb143e5106506e6fedb9
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Oct 8 16:13:44 2003 +0000

    fix off by one bug in uc_stretch_blit()

commit 862b5965b7b73ad526572eb06a4fff12fb11d835
Author: Andreas Robinson <andors@directfb.org>
Date:   Wed Oct 8 15:23:31 2003 +0000

    Partial fix for 3D-blitting size problem. Blitting arbitrary (non 2^n) sizes
    works much better now, but there is still a one-pixel-off error in df_window.

commit 2af2bd3d65b835bf01eca618d63338461c855ac1
Author: Andreas Robinson <andors@directfb.org>
Date:   Wed Oct 8 14:00:55 2003 +0000

    Fixed LUT8 blit bug. The driver erroneously tried to do a LUT8->LUT8 stretch
    blit, which isn't supported.

commit 485126ab97e797826ebaeef5b4ef5bb8408f8c2b
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 7 16:54:06 2003 +0000

    remove check for VIDEOONLY surfaces, disable blit_3d stuff because it
    is broken.

commit 5a8ce171861b0eda510e2eb6ad0ff6dd8f6d6c2c
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Oct 7 12:14:47 2003 +0000

    Added DSFLIP_ONSYNC support to fbdev layer.

commit 13c94ded77477363f01f06d702ef97db9ce31a7a
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 7 11:17:32 2003 +0000

    fixed optimized 8bit colorkeying for little endian. disable it on x86
    since it is much slower. have to test on my little endian arm machine.

commit 1a8d500ba8eda04b28a85a2753331a34941b0b37
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 7 10:09:27 2003 +0000

    removed my stupid debug message

commit e7acfd4be08e50f51660c41d862ce8cc80f9989a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 7 10:00:17 2003 +0000

    Removed evil artifact.

commit 29d3c0334d0cb4a3451d92994a52ab7aa483e924
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 7 09:52:58 2003 +0000

    enable dok's 8 bit colorkeying optimization for all big endian architecures
    
    PowerBook G3 400Mhz
    
    df_dok --dfb:pixelformat=LUT8 --blit-colorkeyed
    
    before: 13.16
    after 42.70(!)

commit ea35317ab285ad9bf8ddf29b6e8bc432b9ec7e27
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 7 07:56:55 2003 +0000

    Added null pointer check.

commit 1dc1312bfe281addce79ffbe429e19b4d10a570e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 7 07:53:59 2003 +0000

    Fixed segfault.

commit 72eef2f506f36a5fc23097c9aacf17552053273b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 7 07:13:55 2003 +0000

    Wrote two complex 8 bit color keying implementations optimized for alignment,
    currently only enabled for MIPS Big Endian for testing.
    
    1) (sx & 3) != (dx & 3) ->  30% boost
    2) (sx & 3) == (dx & 3) -> 120% boost
    
    Should be tested on other platforms. Little Endian is not supported by 1), yet.

commit f88d3a3f8dd5435b67aa5e863ab6086401027e06
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 6 21:45:25 2003 +0000

    Start with 0x00000001 in DFBDisplayLayerBufferMode which can be used as flags.
    
    Sorry for binary incompatibility.

commit d548d69994d024b7137f7ef4b451e1ce4314e085
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 6 19:29:29 2003 +0000

    Fixed 'for' condition.

commit 6fa41938153b2815cb953101fd071384d8c85b6c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 6 19:18:59 2003 +0000

    Clean up dfb_scale_linear_32() and dfb_copy_buffer_32() parameters.
    
    Destination offset is now handled by these functions,
    fixing rendering to field separated surfaces with an offset != 0, 0.

commit 0d4d2dba153e4ea79211c011ad6a00d7be4ac471
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 6 17:53:15 2003 +0000

    fixes for multi-application support
    
    - move vq stuff from driver_data to device_data
    - allow cle266vgaio device to be opened more than once

commit 2ac36d3e587002ff96cca0b827de565b98fb8baf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 6 09:42:17 2003 +0000

    Added some keys to id_to_symbol().

commit 7b024144488e57826f394251b6fa00b287ff340e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 6 09:41:44 2003 +0000

    Minor simplification.

commit cf72b56db892497c6672fbf96744d3e215113ffc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 6 09:38:37 2003 +0000

    Added DFB_KEY_INDEX macro.

commit 8a4c7d1be28586c2b09cfe420f102f447fd89b2f
Author: Andreas Robinson <andors@directfb.org>
Date:   Sun Oct 5 11:59:27 2003 +0000

    YUV planar mode bugfix. U and V planes were not set up correctly and did not look right.

commit aa1c81f7f81f26c978b6023d14327703c0ff8ef1
Author: Andreas Robinson <andors@directfb.org>
Date:   Sun Oct 5 11:33:11 2003 +0000

    Added WaitVSync() to video overlay.

commit 561d695d2bf7ecec8e8095166c4b52a447cd077f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 4 19:30:53 2003 +0000

    New version for VMware Workstation 4.0, supports switching of bits per pixel
    at run time, can disable acceleration at run time. Also fixed palette mode.

commit 4aaae87c1b9572853df7397a2553d496de5487b5
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Oct 2 17:54:14 2003 +0000

    fix FillTriangle() for non 32bit modes

commit b9a6e63dcbb0542cbf563ad50319aab265881f64
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Oct 2 16:44:19 2003 +0000

    bugfix for blended FillRectangle(), DrawRectangle() and DrawLine()
    in non 32-bit modes.
    
    (while performing 3d operations, the source color is always 32 bit ARGB,
    not in the destinations's pixelformat)

commit d769aa4937bdf54641e75c3a2e3025b505f67d26
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Oct 2 15:42:48 2003 +0000

    - removed surface allocation for vc buffer,
      use dfb_gfxcard_reserve_memory() instead.
    - added note about vram command line boot parameter
    - removed bug note about wrong driver announcement

commit 0040a5698a575787a2331e305efd921395c988ae
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 1 20:41:25 2003 +0000

    Fix for CONFIG_FB_MATROX_MULTIHEAD.

commit ceafba96eef8161909930b8169b12597aff3487d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Oct 1 17:32:36 2003 +0000

    Patch to set the clocks on a G400 to proper values.

commit 26e24bd633adf79e4ca4af942ba6560bf46d11ec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 12:28:35 2003 +0000

    Commented out assertion.

commit 45cf404c12027db827c1b17a976938256ce255c3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 12:03:49 2003 +0000

    Fixed dfb_colorhash_invalidate() which did not invalidate the first entry.

commit 9236c4548c7b9d27e0b631adcfd7db9e557a3a72
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 12:02:18 2003 +0000

    Removed debugging artifacts.

commit d73a23fa09b57f18b727cb60fde34df8a1ee342c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 12:00:32 2003 +0000

    Forgot to add that.

commit 20d4cf1a29b166b373428ea4e755ec5b610bcb18
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 11:59:58 2003 +0000

    Removed bogus flag.

commit eb7796df28e8c762ffed4485e9388b7e3cf2bf52
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 11:40:14 2003 +0000

    Added new display layer buffer mode DLBM_WINDOWS where the layer itself
    has no surface, but the hardware is aware of each window and displays the
    window stack.
    
    Added DLCAPS_WINDOWS and three display layer driver calls to add, update
    and remove windows.

commit 1a0a2e4f1b505b1abb20c9e50c21cc2c7f2bdac8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 11:25:21 2003 +0000

    Pass real alpha value to conversion routine.

commit c7dbd0e4656b042ee1b086076f624e325c96c821
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 1 11:20:34 2003 +0000

    Added "void *device_data" to InitDriver().
    
    Drivers can store a pointer to the shared device data in the local driver data,
    e.g. to access the device data in display layer functions which only get the
    driver data passed.

commit bd189db4e963eb4509ea1620ace896d2d313d80e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 30 14:59:54 2003 +0000

    Don't blend pixels with black when loading images with alpha to non-alpha formats.

commit 0cd1d62c5fed01a9670d4d16862ea40d730cdc21
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 29 14:37:12 2003 +0000

    Fix for v4l2.

commit 66e5423fcdc5c14da59502982a1aa652a3083079
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 29 13:42:36 2003 +0000

    Video4Linux 2 support by Michael Hunold <hunold@convergence.de>, thanks!

commit d37b5d90a0f278fa4bf805e80727ef1a67bd52ce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 25 06:35:12 2003 +0000

    Creating a fullscreen primary with a pixel format set in the description
    took the pixel format specified via "pixelformat=" option if the current
    pixel format already was the pixel format set in the description.
    
    Make sure the "primary-layer=" option used for slaves enables the display
    layer before usage.

commit b916326e4eeafde64c422adb50a5ddc57e937abc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 25 05:23:58 2003 +0000

    Include <sys/io.h>.
    
    Build CLE266 driver on platforms with sys/io.h only.

commit a07f1f0272ebfd8e68703ccc063b22e0fae9d683
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 25 05:21:41 2003 +0000

    Compile fixes for 2.95

commit 7b76b469d759d8d833b4e12648644bac3dfb80ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 25 04:30:57 2003 +0000

    CLE266 driver by Andreas Robinson <andro134 at student.liu.se>, thank you!

commit ca271e02747c86c00e88aff7cb45821d08acdb3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 23 20:35:22 2003 +0000

    Added "LL" suffix to constants of multiplication to preserve long long type.
    
    Otherwise the session uptime turns negative after about 25 days,
    e.g. using dfbdump to display it.
    
    Yes, my working session is up for "29 days, 10:02:37" now ;)
    
    My secondary session (dedicated to XDirectFB + streamtuner + xmms)
    is up for "36 days, 05:48:40" !!!

commit bd288a776bc69d170e8dfd459bca993c23548378
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 23 14:38:27 2003 +0000

    Don't set alpha value of color key palette index to 0xff.

commit a42b6759c6f3b29a577ca81855d731da3d9920ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 23 13:11:30 2003 +0000

    Simplified Bop_a8_set_alphapixel_Aop_lut8 for monochrome fonts.

commit d4118854c73912a533bbeb4de439d2c86f697081
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 22 20:25:29 2003 +0000

    Ignore r, g and b difference if alpha is zero.

commit 2b49dc202687883cc1f00d658a4086f0066cc3e1
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri Sep 19 01:17:21 2003 +0000

    PIXEL_RGB24 is gone, use PIXEL_RGB32.

commit 184090db8eb237002bb4cfd925a5aeacf840160a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 12 21:41:16 2003 +0000

    Remember and compare the Fusion ID of the last state's owner.
    
    Fixes cases where state pointers equal but don't belong to the
    same application.
    
    I wondered for a long time why two instances of e.g. df_andi
    running windowed mixed up their blits.

commit 8e7b5602dc9b3f4ee45826406d762546be9ef8a5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 10 08:17:45 2003 +0000

    Show actually allocated bytes for each surface (video + system).

commit 87733c28aa29cee2cffff1f4d09cc3243f460ea8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 10 02:14:32 2003 +0000

    Less weight for alpha.

commit 54c0a89735543499f7dba2a7d24a7e8e5b95389f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 9 18:33:25 2003 +0000

    Multi app related stuff.

commit ecfede23d0e9550b24ce7da5cff8a05a4b994892
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 5 12:19:08 2003 +0000

    Restore KD_GRAPHICS after switching back to DirectFB.

commit 7bd63a145351bad21587fd1fec75ddafcaac68f6
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Sep 1 11:44:48 2003 +0000

    Enable dithering and filtering for RGB modes instead of YUV modes.

commit 23e412b8ce9c6fc86d8aa4c3d33f24f265290148
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 28 17:32:01 2003 +0000

    Use the generic conversion routines for surfaces with DSCAPS_SEPARATED.

commit c1db9e241e3701dd738c89254208973bf928c6b8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 27 17:43:25 2003 +0000

    Call driver's SetOpacity() only if the opacity changed.

commit b73abf5d2d7ba256cb3a457393b490efd8a0e786
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 27 17:42:00 2003 +0000

    Call driver's SetScreenLocation() only if the location changed.

commit 292839add3bac966386165e8d40539242f9b1cb5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 27 17:39:15 2003 +0000

    Don't call dfb_window_init() for each IDirectFBWindow_Construct(),
    but only for the first time.

commit 67fb4661bb6704e9d54536bf1ac5b83eb3e99b72
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 27 16:38:55 2003 +0000

    Commented out assumption.

commit ed6c1bf5292a2098b125eabd7001becbe6ae20c3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 26 16:32:57 2003 +0000

    Added some more exit points to the grabbing thread.

commit d9482155ef4f59f552c74e30b32a12d7cfaf82b8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 26 16:29:12 2003 +0000

    Don't support A8 destination on a G200. It doesn't support it as a source, too.

commit 1bb2c3e3ebab26a3d25f571255032d24e40e9eef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 25 17:37:11 2003 +0000

    Align glyph offsets to a multiple of four.

commit 0063479f433f7bdb1cfbc47c652a279d15c9c13e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 25 17:27:37 2003 +0000

    10% DrawString() boost by changing __u16 to __u32.

commit d689e99d3068c243173b7cf11770af49419b2cab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 25 16:40:45 2003 +0000

    Lookup color index for layer's background color.

commit 2f697d6f809a9d555b062e8e33b03da455ff395e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 25 15:13:30 2003 +0000

    Support DSCAPS_SEPARATED in dfb_copy_buffer_32(), too.

commit d1b95d9d25e369eaa48a60346fdee2302c2b8820
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 25 14:43:00 2003 +0000

    Support DSCAPS_SEPARATED in dfb_scale_linear_32().

commit 4ff8d5fcf2327fccfb5439a01bc04914b9f48fd5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 21 17:57:41 2003 +0000

    Don't optimize repaints for restacking.

commit c4ff4c86f8c3f6ccf845ba3c726ff60026a1ae9e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 21 15:12:07 2003 +0000

    Translate DIKI_KP_0-9 to DIKS_0-9 instead of DIKS_HOME etc.

commit 1413fa17c1fae2534d3b457d90316fce3631b7cd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 20 07:38:53 2003 +0000

    Added support for color keyed PNGs.
    
    Instead of converting an 8 bit palette PNG (with tRNS) to ARGB,
    convert it to RGB and generate a color key.

commit af70e6a23abec16acfc4e3b8c82677692828891e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 20 00:16:20 2003 +0000

    Applied a great patch from Maurizio Monge <monge@sns.it>.
    
    When repainting the stack due to a window update, e.g. a Flip(),
    skip those regions which are hidden by opaque windows above the window
    that changed.
    
    This increases performance and reduces artifacts.
    
    Example: Terminal with tons of debug messages under opaque window caused
    the opaque window to be updated, too, within the intersection of both windows.
    
    Another example: Run a fullscreen app in windowed mode, e.g. df_andi, and
    see how frame rate increases as more of df_andi is hidden by opaque windows ;)

commit 73f0ad283a03ed088557ebd556361317c421dceb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 19 18:25:19 2003 +0000

    Fix warning for builds without MMX.

commit d85ceab93ecd4827c81ccc4197844bf9897a756b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 19 10:45:49 2003 +0000

    Set SBF_WRITTEN if hardware writes, too.
    
    Fixes garbage after VT switching (in case the surface has never been written
    to in system memory and therefor was not properly restored).

commit 9fafe00f378080fe74ecf779479b72179e986c28
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 19 01:15:51 2003 +0000

    Fixed warning.

commit 67785b48226cf23afc156c919777d612d5ba84a2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 18 20:15:44 2003 +0000

    Don't automatically flip in SetOptions().

commit 1d5052a2fb100c0f1781fc9d102e541ea6daca4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 18 17:27:30 2003 +0000

    Added IDirectFBSurface::Dump(), e.g. for debugging.

commit 7fdf409cd2f23d1f8a386e8caa1b049cf58edee5
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Aug 18 14:35:12 2003 +0000

    PIXEL_RGB24 is gone, use PIXEL_RGB32. memset() needs string.h.

commit 748d8bf79a3d5a693f495d9087bd9ce3582b90c6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 18 12:40:14 2003 +0000

    Added "-lm" to libmpeg3 module.

commit e014db19a718da18743cb336e3a36a43be2a8bd3
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Aug 17 09:29:25 2003 +0000

    use -module flag, which causes libtool to create mach-o "bundles" on darwin/osx
    instead of dynamic libraries which cannot be dlopen()ed

commit 1a30be08ea5c1c37fe8f1c339f64f029d5d753fb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 18:22:31 2003 +0000

    non-debug apps in a debug session break shared memory assertions

commit fa81c6583daf14c848e720ed5fc47614413fcf63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 15:58:30 2003 +0000

    Updated.

commit e44c645719565c4fd24ba0ab6369be46b6c1d12d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 15:56:05 2003 +0000

    Enable key repeat.

commit adced8db12eb1795865343bf22576d4b90f565ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 15:11:00 2003 +0000

    Added the obligatory "other bug fixes" line ;)

commit 34855e0345f501b223958db584a6610eacb95f49
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 13:48:05 2003 +0000

    Updated.

commit 15b67b79834af201cb81ceea477639e1eff80f9a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 13:04:46 2003 +0000

    Added WM97XX Touchscreen driver,
    thanks to Liam Girdwood <liam.girdwood@wolfsonmicro.com>!

commit f487f74e1e8ca28ddcc66568b35994b3fb107196
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 11:59:12 2003 +0000

    Increased timeout from 100 to 200 ms.

commit 6817712e18fe545e8f47d01ede8681185ac29b06
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 11:57:10 2003 +0000

    oops

commit 39b0c525540d88b5ee89304d529186e50e1e2e63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 15 11:39:13 2003 +0000

    Call tracing has to be enabled via "--enable-trace" now.
    
    Show stack trace of all threads when a signal is received.
    
    Include <config.h> everywhere.

commit 66eeb5c72ef3af8baa306b3c2c5409774e5626bf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 14 16:06:57 2003 +0000

    Fixed warning.

commit b7b2a52cf15b74424e5b2d88f847df4a0029eb8d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 14 16:06:09 2003 +0000

    Allow signal handler in slaves again.

commit c667284cd84485ef00fdae1578dc39822ab81807
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 14 16:04:23 2003 +0000

    Added new debugging method "dfb_debug_print_stack()" that dumps the current
    stack trace. But it just includes functions that are compiled with the gcc
    option "-finstrument-functions", currently all of DirectFB when --enable-debug
    is used.

commit 10b10d22a96e1b833f8f08f0be0e77ff00be3da3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 14 14:54:26 2003 +0000

    Include <config.h> at least in all files depending on FUSION_FAKE.
    
    Switching single/multi app between builds should be working now.

commit b40c289d517bd59fecb7add77f662869a81e9c4c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 14 00:42:18 2003 +0000

    <Meta>-<Print> now stores the alpha channel of the window, too.
    It's a pgm and is stored with the same file name except the extension.
    
    To convert from ppm/pgm to png do:
    
    pnmtopng -alpha dfb_window_0000.pgm dfb_window_0000.ppm > dfb_window_0000.png
    
    
    Minor debug changes.

commit 595818cdb1ec763cd075de26006883c7668463a7
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Aug 13 17:39:42 2003 +0000

    build pixelformat conversion utilities only on linux systems.

commit 3390dcb2a4d10b96c20737c7591eb7619b300b69
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Aug 13 17:34:49 2003 +0000

    use setpgid() instead of setpgrp() to restore darwin and probably other BSD compatibility.

commit 0afa6eb90431402d6024c8e23b07da46e9626687
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 12 12:10:36 2003 +0000

    Added another lock check.

commit 92907473feeefb43e5cc5601d59899150090f658
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 12 12:09:24 2003 +0000

    Added a lot of necessary locks.
    
    IDirectFBDisplayLayer::GetWindow() is safe now, too. Was an urgent fixme.

commit 70934ac3d6a89da84cfe5a59922127e66b93effc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 16:49:51 2003 +0000

    Skip copying from system to video memory during auto video buffer upload
    if the buffer has never been locked for write access.
    
    Enable upload of auto video buffers for write only GPU access, too.
    
    Speeds up surface create/clear/release cycles, nearly as fast as for video
    only surfaces.

commit 27dcc549b52e0bfffa377e65cf420abbce2d89c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 16:09:56 2003 +0000

    Indicate if segfault has been cured.

commit 4b9be667e85bb8e17a59b02a1383f05646ea3667
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 15:59:31 2003 +0000

    Hot fixed rare segfaults which occur if a valid shared memory pointer is
    derefenced but the address lies in a new region which hasn't been mapped
    locally yet.
    
    Added "bool fusion_shmalloc_cure( const void *ptr )" which is called by the
    signal handler to recover such segfaults by remapping the file immediately.
    It returns true if the segfault is cured and the signal handler may drop it.
    
    This is a hack until there's a better solution, maybe via Fusion Kernel Device.

commit bcb98df83ec26b6f85c3893fbbe40a78f42b025a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 13:23:33 2003 +0000

    Show faulting address in case of SIGSEGV.

commit c2d57d6eed7b5f2acda053760463f366951dcbc9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 13:22:49 2003 +0000

    Converted assertion to assumption, added another assumption.

commit db8969b35610232046ae1389f454eb5215705d56
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 13:20:04 2003 +0000

    Added debug messages to __shmalloc_brk() and __shmalloc_react().

commit 50afa6f82552d29fc7a7573c375015614af65045
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 11 10:19:35 2003 +0000

    Fixed button events, thanks to Tim Wright <tim.wright@iosystems.co.uk>.

commit 960473810e39d9ba24233454e2a444edcd266cf3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 23:17:03 2003 +0000

    Removed a caution message.

commit 1a4895b0ec854bc41b4318c04686a47ee5760beb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 23:10:58 2003 +0000

    Block signals in slave threads and fusion read (master & slave) thread, too.
    
    Enhanced debug, minor cleanup.

commit 92855f15661bd23324283d377c4d8bbe2e9fb8a6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 21:52:49 2003 +0000

    Cleanup, enhanced debugging and safety.

commit 8683c48420d5f20b39cd649c1c16eb80552764b3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 19:39:29 2003 +0000

    Waiting for pthread_create is required, but it's done later now.

commit ec9ec6272838f49a8fb4fe01b7fd70329fb73b3c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 19:10:27 2003 +0000

    Create a new process group early during initialization.
    
    Send SIGTRAP to process group leader instead of the calling process
    in DFB_ASSERT and DFB_BREAK. Otherwise the signal would be blocked
    if the assertion or break happens in a thread, e.g. an input thread.
    
    Call pause() after sending the signal, otherwise execution continues
    until the signal is caught.

commit 1453745874d5e9d62ff78baa5d7acdb082c60171
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 18:16:47 2003 +0000

    Use pid instead of pthread id in debug messages.

commit fd7080b1a71f7d435547a2a6ce3607eb6d7a7ab4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 8 18:10:16 2003 +0000

    Added DFB_ASSUME which is like DFB_ASSERT, but doesn't send SIGTRAP and
    has "(?)" instead of "(!)" at the beginning of the debug message.
    Failing assumptions are not fatal. They can be used to unveil unusual
    behaviour, e.g. dfb_thread_join() called while already joining/joined.
    
    Optimized creation of new threads by not waiting for pthread_create completion
    in spawned threads. Also don't enter the main routine after initialization if
    another is already joining. This is useful if DirectFB is initialized, but
    deinitialized shortly after. In this case the fusion_read_loop() is not entered.
    
    
    On a P3 800E with only fbdev (systems) and matrox (gfxdrivers) installed I did
    
    "while true; do dfb_init_deinit &> /dev/null; done"
    
    where 'dfb_init_deinit' (slave) just calls DirectFBInit/Create/Release.
    This results in about 170 iterations per second and looks like 5.8 ms for a
    complete init/deinit for slaves, but bash is consuming a lot of CPU, too.
    
    Debug messages show that a complete DirectFBInit/Create/Release (as a slave)
    takes 3-4 ms ;)

commit 93a3e94a69897239f4610b5cb399bf14b4f4a470
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 7 16:46:19 2003 +0000

    Check desc.width and desc.height for being positive in CreateFont().

commit 640d8d255bdbce4bb39a8d83abe9f171123cde4d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 7 16:42:11 2003 +0000

    Added error handling to glyph surface creation.

commit cf85555e82c93ec26ec51a7d78057aa9a62c3b0d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 7 16:26:38 2003 +0000

    Added some assertions and argument checking.

commit 4c26f3dcaa8242afbe4d770bb2171bcf634e864f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 7 16:05:27 2003 +0000

    Don't filter all print keys.

commit 5ee697e6b0e59f961abf7e47bf8acbcf0a40081e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 7 16:00:20 2003 +0000

    Added <Meta>-<Print> hot key to make a screenshot of the focused window ;)
    
    Added dfb_surface_dump() which is used for screenshots now, replaces static
    function dump_screen() and will store the alpha channel to an extra pgm soon.

commit 7bf4f7ad0f405e98e85afa9c998a249448043eac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 7 00:46:50 2003 +0000

    Check if the font is already set in IDirectFBSurface::SetFont(),
    saves just a few CPU cycles though.

commit 05de94bd9be5d4d52306f3fe7d22420d453fa236
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 6 17:52:20 2003 +0000

    New environment variable "DFBARGS" is now parsed
    like everything after "--dfb:" on the command line.
    
    New order:
    
    system       /etc/directfbrc
    user         <home>/.directfbrc
    system/app   /etc/directfbrc.<app>
    user/app     <home>/.directfbrc.<app>
    
    environment  $DFBARGS
    
    command line

commit e3137b83b254ddfc8740cada13b01159bc3ee8b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 4 19:09:28 2003 +0000

    Need long long.

commit 6fd06aa07fc046fa25b2db1ad87f29f969a2e519
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 4 19:00:13 2003 +0000

    Reject very large surface creations (> 4096*4096 pixels).

commit 39368f0436ec7267eae8432c1d482a8340a507fc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 4 18:39:03 2003 +0000

    DWOP_SHAPED support for color keyed windows,
    thanks to Maurizio Monge <monge@sns.it>.

commit cd5c4b8b34b3f15bf314648a56ce7e206b13fa0a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 2 19:35:40 2003 +0000

    Added IDirectFBEventBuffer::WakeUp().
    
    Wakes up any thread waiting for events in this buffer.
    This method causes any WaitForEvent() or WaitForEventWithTimeout() call
    to return with DFB_INTERRUPTED.
    This method should be used rather than sending wake up messages which
    may pollute the queue and consume lots of CPU and memory compared to
    this 'single code line method'.

commit c1282ad0a2dc5613d67c9f0b5546245c542d7cfd
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 29 13:05:13 2003 +0000

    version number 0.9.19+0.9.20WIP-1

commit 771162e2b83d0079f21f1a7d773301d7067f8946
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 29 04:00:11 2003 +0000

    Fixed non-x86/ppc builds.

commit c85bc934af9604c65f01c7bb9a4218a91bea4822
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 29 03:46:37 2003 +0000

    Don't segfault in slaves if no graphics driver is used by the master.

commit dc421ed0b976aa61d92892f8a36ef8caf18d59cb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 20:53:13 2003 +0000

    Added "memcpy = <method>" option to save a lot of startup time.
    "time dfbinfo" went from 0.080 secs to < 0.010 secs!

commit b849e25a6475473a4691f61caa1acc979a15b485
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 19:36:47 2003 +0000

    0.9.20 looks fine.
    
    Updated copyright in banner.

commit 5d39a6da0a02907f568d141ba93a1687ca23879a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 18:44:16 2003 +0000

    Include URL http://www.linuxbase.org/spec/gLSB/gLSB/libpthread.html

commit 5edaaaf1ff9290a45229b1c12cc88b9b51f1d1a1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 18:40:26 2003 +0000

    Added:
    
    
    LSB violations (from http://www.opengroup.org/personal/ajosey/tr28-07-2003.txt)
    -------------------------------------------------------------------------------
    
    215 Applications must disconnect from the controlling tty before calling
    216 pthread_create.
    
    225 Threaded applications cannot use SIGUSR1 or SIGUSR2.

commit 351431ada9916c90ba680432f31fa36e2a04f5cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 14:21:52 2003 +0000

    Added DWOP_SHAPED that adds shape support to cursor movements,
    i.e. ignore the window if alpha is zero at the cursor location.
    
    This is based on a patch by Monge Maurizio <monge@linuz.sns.it>, thanks!

commit 2f729c9cc1ba11c4c43f4af7b666e4d2a594a347
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 13:47:39 2003 +0000

    Restore layer opacity during resume.
    
    This way one can switch to the linux console and do "dfblayer -l 1 -o 0"
    to disable the Matrox BES or any other overlay if it covers the whole
    screen and makes the session unusable. But "fbset -accel false" might
    be needed on that console.

commit 7d312dd530d5a89a54dd51f835d0250c758abfc2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 28 12:01:54 2003 +0000

    Fixed undeclared "dfb_fbdev" for builds with FBIO_WAITFORVSYNC defined.

commit fab9fef07740ea23371d0f773057db10a99b1f32
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 25 12:47:23 2003 +0000

    Have fusion-full-linux-2.60-test1.patch.bz2 in EXTRA_DIST.
    
    Remove old and broken patch.

commit 753862e12a9f518226b74fdcfe5eafc0304a3928
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jul 24 11:44:48 2003 +0000

    working patch for 2.6.0-test1 (support new internal devfs api)

commit def4946a0eb8339166c9cd2d706946a72f911a7e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 23 14:36:19 2003 +0000

    Don't show "make" message if configure failed.

commit a90237e4f3803c59884ddc4969cc86f5893119c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 21 12:00:02 2003 +0000

    Updated.

commit a1927e4e9551046da4a21d326feae196d2931381
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 21 11:24:21 2003 +0000

    Removed automake -ldl issue.

commit f8679858acf44b8551051952dfeb972f4720efe9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 21 10:57:10 2003 +0000

    Do not cover the whole screen by default.

commit 571c2c1a9150fd8f67281911a868d008f4f92e20
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 21 10:55:02 2003 +0000

    Added parameter for opacity changes. Also useful to disable an overlay.
    
    Show layer options in configuration dump.

commit 13e834b74cb35711dc071beaa5e48001cb757fed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 16 16:28:05 2003 +0000

    Moved min_toleration to shared manager data.

commit a88097485ec3cbbe0fd5bac5fc3bbe91f9241fc6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 16 03:55:06 2003 +0000

    Cleaned up debug messages.

commit 931bf8281416b9050e94f624f4f6c9fba7aef853
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 16 03:05:44 2003 +0000

    Removed "soft lock" hack that just increased the lock counter.
    
    Use dfb_surface_hardware_lock() now as we can maintain the lock until
    the video is stopped.

commit 6061bc28321bb1c29af3067791061c99b5108da8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 16 02:49:09 2003 +0000

    Removed front and back buffer locks from surface.
    Locking is provided by the embracing surface manager lock.
    
    This saves two system calls per drawing operation and even four system
    calls per blitting operation.
    
    Locking a surface won't block anymore. Currently any number of
    concurrent read/write accesses by cpu/gpu are allowed.
    Locking is a way of pinning the surface buffer to a pool.
    The hardware lock fails if the system memory instance is locked.
    
    
    Check the benchmarks, some values nearly doubled ;)
    
    BEFORE
    
    Benchmarking with 1x1 in 16bit mode... (16bit)
    
    Anti-aliased Text                              3.00 secs (  626.97 KChars/sec)
    Anti-aliased Text (blend)                      3.00 secs (  633.18 KChars/sec)
    Fill Rectangles                                3.00 secs (    0.14 MPixel/sec)
    Fill Rectangles (blend)                        3.00 secs (    0.13 MPixel/sec)
    Fill Triangles                                 3.00 secs (    0.06 MPixel/sec)
    Fill Triangles (blend)                         3.00 secs (    0.06 MPixel/sec)
    Draw Rectangles                                3.00 secs (  128.37 KRects/sec)
    Draw Rectangles (blend)                        3.00 secs (  125.77 KRects/sec)
    Draw Lines                                     3.00 secs (  737.33 KLines/sec)
    Draw Lines (blend)                             3.00 secs (  718.00 KLines/sec)
    Blit                                           3.00 secs (    0.10 MPixel/sec)
    Blit colorkeyed                                3.00 secs (    0.10 MPixel/sec)
    Blit with format conversion                    3.00 secs (    0.12 MPixel/sec)
    Blit from 32bit (alphachannel blend)           3.00 secs (    0.09 MPixel/sec)
    Blit from 8bit palette                         3.00 secs (    0.11 MPixel/sec)
    Blit from 8bit palette (alphachannel blend)    3.00 secs (    0.09 MPixel/sec)
    Stretch Blit                                   3.24 secs (   99.88 MPixel/sec)
    Stretch Blit colorkeyed                        3.23 secs (  100.16 MPixel/sec)
    
    
    AFTER
    
    Benchmarking with 1x1 in 16bit mode... (16bit)
    
    Anti-aliased Text                              3.00 secs (  675.60 KChars/sec)
    Anti-aliased Text (blend)                      3.00 secs (  677.32 KChars/sec)
    Fill Rectangles                                3.00 secs (    0.17 MPixel/sec)
    Fill Rectangles (blend)                        3.00 secs (    0.16 MPixel/sec)
    Fill Triangles                                 3.00 secs (    0.07 MPixel/sec)
    Fill Triangles (blend)                         3.00 secs (    0.07 MPixel/sec)
    Draw Rectangles                                3.00 secs (  168.70 KRects/sec)
    Draw Rectangles (blend)                        3.00 secs (  159.00 KRects/sec)
    Draw Lines                                     3.00 secs (  833.00 KLines/sec)
    Draw Lines (blend)                             3.00 secs (  809.33 KLines/sec)
    Blit                                           3.00 secs (    0.15 MPixel/sec)
    Blit colorkeyed                                3.00 secs (    0.15 MPixel/sec)
    Blit with format conversion                    3.00 secs (    0.21 MPixel/sec)
    Blit from 32bit (alphachannel blend)           3.00 secs (    0.16 MPixel/sec)
    Blit from 8bit palette                         3.00 secs (    0.20 MPixel/sec)
    Blit from 8bit palette (alphachannel blend)    3.00 secs (    0.15 MPixel/sec)
    Stretch Blit                                   4.41 secs (  110.36 MPixel/sec)
    Stretch Blit colorkeyed                        3.14 secs (  103.09 MPixel/sec)

commit 0031ed38aaa3079dc9648cc37489a7e842120699
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 16 02:11:27 2003 +0000

    Removed dfb_surface_destroy() from exported API. Destroy surfaces
    in the destructor only. Saves a skirmish and some code.

commit b602b630a2749a338dabcd6ffd2054bb7adfa3e3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 15 05:28:10 2003 +0000

    Wrote generic enum to string table conversion script used for key symbols,
    key identifiers and pixel formats.

commit 4175cb431e34036df58414464efb308f640ff9f8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 15 01:49:51 2003 +0000

    Added buffer mode changing.

commit 4a114eb6b92f3ecae88f421c9decd586d231e92c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 14 17:22:18 2003 +0000

    Added "dfblayer", a display layer configuration tool.
    
    Added generation of pixel format names into the new directfb_strings.h header.

commit 93e88d3ca68130bbf54a8c375253fa90bda685ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 14 16:18:02 2003 +0000

    Added DLCONF_NONE = 0.

commit 7aa02fba8d0ed92e0016e62588cac69683fc1c1d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 14 15:19:55 2003 +0000

    Fixed "primary-layer" option for the master.

commit b93ef403fb0387279c661aa43c1442bc5e1c48a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 13 22:26:17 2003 +0000

    Platform independent radeonWaitVSync() by Michel Dnzer <michel@daenzer.net>.

commit ef14c095e2af8824530bcc61534ea4f427da93d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jul 12 17:34:09 2003 +0000

    This is the initial version of a Radeon acceleration driver by
    Michel Dnzer <michel@daenzer.net>, great thanks!
    
    <quote>
    I've tested the driver on an M9 in a PowerBook and a Radeon 7200 in a
    Cube. It's based on the ati128 driver, but has only basic acceleration
    so far.
    </quote>

commit 62f285f9e40991ca984e995654819ba7c0f2da37
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 11 20:24:43 2003 +0000

    Fixed "primary-layer" option for fullscreen applications.

commit b9a943d05406e69078055a48664a459597af002c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 11 20:15:25 2003 +0000

    Added option "primary-layer=<id>":
    
    Selects which layer is the "primary layer", default is the first.
    Check 'dfbinfo' for a list of layers supported by your hardware.
    
    All fullscreen and windowed applications should run with this,
    for the application the first and the primary layer are swapped.

commit 2c99152e4f2b48b38421ce7f26d19da4fa9cc03b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 11 18:57:28 2003 +0000

    Fixed dead lock due to thread safetiness added recently.

commit f92302138cc8726e1b877b680f4bb93df2ce7b80
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 11 16:57:06 2003 +0000

    Made implementation thread safe.
    
    Fixes assertion when implicit (by surface listener) and explicit (by ::Stop())
    v4l_stop() calls are running simultaneously.

commit 01d13bf2b53fb8dc8b1d74b448708e601e46d4e0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 11 15:07:39 2003 +0000

    Don't handle enter/leave/focus while the builtin wm hack is active
    (e.g. during resize via <Meta>-<Ctrl> and mouse).

commit 03e750905ebf6478524b8331e169bada0f9f7eb5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 10 17:37:30 2003 +0000

    Work around a bug in the DVB kernel driver (more likely) or the DVB hardware.
    When using buffers with a pitch much higher than the width suggests (e.g. using
    DSCAPS_STATIC_ALLOC and downsizing), the lower part of the video is cut off.
    
    -          b.width = surface->width;
    +          b.width = buffer->video.pitch / ((bpp + 7) / 8);

commit 44cec7458b19ae60f2e3f66630cc85ec4d01e6ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 10 17:11:28 2003 +0000

    Stop the video playback if the size or format of the surface changed.
    
    Fixed dead lock between overlay thread and surface listener calling v4l_stop()
    by adding additional break points to the overlay thread. Only 99.999% safe,
    but the v4l code should be rewritten anyway.

commit 676e3197fe73b8f6bab9587aa0018f872107cd5a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 10 09:36:53 2003 +0000

    Don't include "-ldl" if linking statically.

commit 7ffbd9c84fc4a6d53f287016200a18d66d633f81
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 10 00:22:18 2003 +0000

    New patches.

commit d9843e7ae2518bc8e69d8acbef9f76647572a71a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 10 00:17:35 2003 +0000

    Drop bone collector threads completely, which have been three per session.
    
    Use new fusion_ref_watch() instead of creating a bone collector thread for each
    object pool where each thread polled all references ten times per second:
    
    1) Create a FusionCall in fusion_object_pool_create() with the pool being the
    call context pointer.
    
    2) Call fusion_ref_watch() in fusion_object_create() after increasing the
    reference counter to one. Specify the call created with the pool, pass the
    object id as the call argument.
    
    When the call handler is executed (in the pool owner's messaging thread) upon
    zero reference, it gets its pointer to the pool (call context) and the id of
    the object (call argument). The handler looks for this id and calls the object
    destructor if the id has been found and the reference counter is still zero.
    
    
    This has several advantages for single and multi app core:
    
    - Removed three threads from master (window, surface and palette pool).
    - No more polling of each object's reference counter ten times per second.
    - Objects are destructed nearly immediately (even a direct call in single app).
    - Less shutdown time (100-200 ms or more waiting for sleeping bone collectors).
    
    The same applies to FusionSound with two object pools (buffer and playback).
    
    
    Commented out debug message for key events.

commit 3cee608af1af0107e1d47268670558e23ff9f321
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 9 15:43:08 2003 +0000

    Added missing free of root data (allocated once per session).
    Moved shared memory leak dump into shared memory deinitialization to
    show leaks after the our last free, no leaks left ;)

commit bfb471d66ac0d188a2aa14192a2388e0f854d219
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 9 15:14:57 2003 +0000

    Do not cancel the fusion read loop thread, but send ourself a message.

commit 718f76451604ca6a7d25059093fbde0d77daf856
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 9 14:59:09 2003 +0000

    fixed a typo

commit 8ddbc32997b728307b1a4185e1733ec8d8378138
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 21:05:06 2003 +0000

    Fixed multiple free during destruction of the window stack (grabbed keys).

commit 1415a628c01d2cffd7b9674e9bf192123b6144c0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 20:37:57 2003 +0000

    Added the same debugging facility for shared memory as for local memory.
    The master shows during shutdown which chunks in the shared memory are
    still allocated.

commit 75d0bbe326639e275101a113b5ed7213b87d174a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 20:28:20 2003 +0000

    Fixed typo for single app.

commit 356521bf569414139db3d9ed9c6c83256276728e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 20:10:19 2003 +0000

    Removed invalid assertion.

commit b779d782d321bf4cb922efaa79dc7121a1889638
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 17:54:55 2003 +0000

    Use ERRORMSG instead of DEBUGMSG before sending SIGTRAP.

commit 3d61a1b89664562a0c7bb9b5add5952c58d1e4f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 17:54:38 2003 +0000

    Added many assertions, most of them for the fusion file descriptor.

commit ec5b7967bb614dc81d31f50ee95c4e2996ba7c7e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 17:14:13 2003 +0000

    Removed obsolete prototype.

commit 82cdf8f03ad44c0203b653d1040b0d3a6edb3219
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 16:55:30 2003 +0000

    Use dfb_memmove() and dfb_memcpy().

commit 84935169e85b57bc10ae4892ec0d5b4a84e48cb4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 16:37:23 2003 +0000

    Cleaned up pixel conversion stuff.

commit 4f6663a446bb42617e395c7b7c9b8bb58f19890c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 15:37:04 2003 +0000

    Show number of bytes allocated for each chunk in final allocation debug output.
    
    We don't need PAGE_SIZE.
    
    Cleaned up some includes.

commit 976469d99c64a05aadd686c64964e064eb09a00f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 15:09:46 2003 +0000

    Use dfb_memcpy() everywhere.

commit 3d10bd92dd701a04336c88037ed3d4abc2ed8a55
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 14:41:29 2003 +0000

    Documented clipping header.
    Use DFBBoolean instead of int.
    Use DFBEdgeFlags instead of unsigned int.
    Split up dfb_clip_rectangle() into dfb_clip_edges() and a simpler
    version still named dfb_clip_rectangle().

commit cd671a1f0793aad1c5cdf432c20a6abe61a03e54
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 8 13:48:26 2003 +0000

    Right patches now.

commit e2017f228fa55337c9612d1f2a432f692f2daa17
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 18:04:25 2003 +0000

    FusionCallHandler is always declared here, now.
    
    Update linux/fusion.h or get multiple definitions.

commit 67ba3f518c778f64f2426b11fe6db8b1afe4b8c1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 17:44:07 2003 +0000

    Made mutexes used by fake mode (single app) recursive.

commit f3002fc75d18091d4b3e7d9cb967c86cc22d761f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 17:25:36 2003 +0000

    Further single/multi compatibility.

commit d1db40d82a3316591120c378ceaf3a2267641e63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 17:07:26 2003 +0000

    Forgot fusion_is_shared() in single app core.

commit 80b45479703a84ddf14a98c8f3e4d7d9b6e1774b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 16:37:53 2003 +0000

    Made single/multi app core binary compatible for drivers and other modules,
    in addition to the single/multi app binary compatibility for applications.
    Running a multi app libdirectfb with single app modules and vice versa is
    possible, now.

commit f4c1d67ef479952a702a0644bfb4824d58f16fb6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 14:50:31 2003 +0000

    First entry sounds nicer now.

commit f776a3b1e3850940c01af54654ad461b5d0d7672
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 14:48:16 2003 +0000

    Wrote summary for 0.9.19 which looks like a major multi app enhancement.

commit e07394060fba47f7a7b0209ffca46633ee94b4be
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 7 13:24:02 2003 +0000

    Set DWOP_ALPHACHANNEL automatically upon window creation only for DSPF_ARGB.

commit a3ddb36051d2b450dfebeda71c77231cf0997ce3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 4 17:30:22 2003 +0000

    Added "moduledirname" to pc file which is "moduledir" without libdir.

commit bec28d3924041b915795718091f5c2dc661f3803
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jul 4 12:49:23 2003 +0000

    respect --disable-sse and skip checks for SSE support

commit 2cdd96d14ee5ffab10bc74847f776282488c4ae1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 16:36:13 2003 +0000

    Fixed many warnings produced using "-std=gnu99 -pedantic".

commit e2bd9aef0b206016ada6701fa9ac6d35bfe2bb45
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 15:11:51 2003 +0000

    Reverted making a function static that really should be exported.

commit a9698c2989d802508a96cb9e0ccc4aea7cbd9300
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 07:35:49 2003 +0000

    Added "-ffast-math".

commit 97d178b9fa211e19bff30f30f654330fc47161ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 05:00:39 2003 +0000

    Avoid discarding qualifiers.

commit 7119afe4e809b57f2793abcf72ab9a8ecb887d49
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 04:54:37 2003 +0000

    Removed option to disable RGB332 support, it has no impact anymore
    and having such a switch for one format only looks odd.

commit c0c3c1b4d4e71a9d4ef597278a64bc4214db3e87
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 04:40:24 2003 +0000

    Added configure option "--enable-extra-warnings" adding:
    
    -W -Wno-sign-compare -Wno-unused-parameter -Wundef -Wcast-qual
    -Wcast-align -Waggregate-return -Wmissing-declarations -Winline
    
    
    Fixed tons of warnings, most of them were related to qualifiers,
    some were aggregate returns, some other...

commit 61af1ed23be541abfd94c5e826bb1ae3796b1111
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 02:13:38 2003 +0000

    Don't discard qualifier in cast.

commit c7cb0d6c89dd55fd5ac796b331132c07a6d672cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 2 00:15:02 2003 +0000

    Destroy CoreThread structure after joining.

commit c98305f3bc3cf66148d7d3514b95aded71ee0819
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 19:48:02 2003 +0000

    On <Meta>-X do not only switch the focus but also leave the window under
    the cursor if it's not the focused one. This is the behaviour of RequestFocus()
    and causes the focus to return to the window under the cursor on any cursor
    move or window resize.

commit 8b9de1d286d6b83f88c2ab759146b327a31837b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 19:40:07 2003 +0000

    Simplified forward declaration macro for interfaces.

commit e85c552ce04c14313b56952f0887fbb2ae955905
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 04:39:44 2003 +0000

    Honor opaque region even if opacity is < 0xff or color keying is used
    (just turn off alpha channel blend for that region but keep other things).

commit 8dc875c6cd540f9266dbc11afaa09dad87fe3511
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 02:54:10 2003 +0000

    Do not probe graphics drivers as a slave, but load the running one.

commit 1557811458c0156dcd30696553f37a0380fb3f79
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 01:58:38 2003 +0000

    IDirectAudio -> IFusionSound

commit 1fe6d2b1eb039780713a3de5b22921f38d23b038
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 01:01:35 2003 +0000

    Added "tmpfs" option.

commit 734802002d1f1b2b7aead9ba78cfed98e2c301e6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 1 00:31:32 2003 +0000

    Reject tmpfs mount points with less than 4 MB of free space.

commit b442a1603099e08716399f3d894d6eb8c3c04cbf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 30 23:54:22 2003 +0000

    Moved all global variables of the software driver to a new struct called
    GenefxState. Genefx (pron. 'genie facts') is the new name for the virtual
    GPU being emulated.
    
    For each CardState a GenefxState is allocated the first time the software
    driver is used with this state. It gets freed when the CardState is destroyed.
    
    Removed global software driver mutex, doubles software driver performance
    when multiple threads are rendering on an SMP machine.
    
    The pipeline parts are called GenefxFunc instead GFunc now. These functions
    get a pointer to a GenefxState now. Nothing else outside is referenced.
    
    Surprisingly or not, the software only got faster though much dereferencing
    of GenefxState pointers is done. I guess removing the mutex and avoiding
    the global offset table made it faster.
    
    FillRectangle(1x1) throughput got increased by ~16% on my P3 800 E.
    
    This change was necessary to modularize pixel formats.

commit 51f88eca40a0736b544cfd975b0634eb50d54619
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 30 16:44:33 2003 +0000

    Fixed patches.

commit 19a8cbbc323f2537ef467d4eaecb297e364f80b8
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Jun 27 22:25:06 2003 +0000

    cleanups for cvs debian packages, removed udeb stuff

commit 2b63a3b8a60f138739e8c89ae1a6ab9cd3a56170
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 20:40:33 2003 +0000

    Handle enter/leave/focus if a window is resized.

commit 9de75b23b9cec2df1d593bce05e50fd4f56d9a2b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 19:44:29 2003 +0000

    Don't focus the window under the cursor when releasing caps-lock or meta.

commit 074712388568fe3b8225de34a1408b2d8e9df62c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 17:19:46 2003 +0000

    Added timestamp to window events.

commit 7a818974ae41b46a305ae308ede8eaf880832afa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 14:28:49 2003 +0000

    #define _GNU_SOURCE

commit f37ad7a97be2971bc262b9a8b51fc7ab9a660c6a
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 27 13:46:51 2003 +0000

    cleaned up include order

commit 274695f487a9a87709093010ec64d8fb2cc43234
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 13:11:23 2003 +0000

    Added 720x576 50Hz.

commit 71f13cb17d8c82a876f890ad2292dde4d5d96e68
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 12:36:45 2003 +0000

    Fixed -Werror-implicit-function-declaration[s] <- removed this character

commit 065e83f29fae9e0966f0dedd7acf8c5b6d982272
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 27 11:15:56 2003 +0000

    Added "-lm".

commit 51f316eb6cb6182bd5160ce6a607d7d9a1f27e15
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 26 15:48:15 2003 +0000

    Made fusion debug/error messages look like DirectFB's again.

commit 19d8455284d2416faf96daec35503f3d81b20e3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 26 13:49:43 2003 +0000

    Added DFB_BUFFERTOOLARGE.

commit 1d0e29c6481811281fa87403b490245b51da17e7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 25 13:30:57 2003 +0000

    Fixed static gif provider linking if specified as lowercase.

commit 6cac8fb729f8e12610d0ba41b25a36bc0d718ba1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 25 13:10:30 2003 +0000

    Fixed static-only builds with -j2 or higher.

commit 8e4fb0c0f6d54084fc1aaf6ddf7d5bec04b1f5c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 24 14:41:12 2003 +0000

    Don't cancel the v4l thread, but just indicate it should stop after this frame.
    
    This avoids dead locks caused when the thread is canceled while it's calling
    the frame callback.

commit 7d390bf0f73d15fa47a9af4e9cb0af628ee4c374
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 20 10:42:54 2003 +0000

    Changed James Su's email address to suzhe@turbolinux.com.cn.

commit c7ba3c60b803dfecc3fb51485aeb96400907a101
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 19 19:08:56 2003 +0000

    Added "fake arena" for single app builds of DirectFBGL and DirectAudio.

commit 47b6160ee4d39249ba09788c915d9c38378f5c5e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 18 15:08:26 2003 +0000

    If fusion_arena_exit() is called without a pointer to a leave method,
    it refuses to leave the arena and return an error instead.
    This way a master can wait for slaves to leave before shutting down.

commit a70e3123c09e731071b6e82f36a768f1a549690c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 18 14:05:56 2003 +0000

    Added dfb_get_micros().

commit 1efc92da25a2f446b5537bea4b67b9b9458e26e2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 18 10:45:39 2003 +0000

    Added IDirectFB::GetInterface() that loads interface modules not starting with
    "IDirectFB". This is a preliminary way of loading extensions and other Fusion
    based libraries, e.g. "IDirectAudio" offering another bunch of new interfaces.
    
    Removed "object methods" fusion_object_ref(), _unref(), _link(), _unlink(),
    _attach(), _detach(), _attach_global(), detach_global() and _dispatch().
    
    Added an "object methods" template macro using a special object type and
    method prefix, e.g. "dfb_surface_ref( CoreSurface *object )" etc.
    
    Replaced "object methods" dfb_surface_*, dfb_window_* and dfb_palette_* by
    FUSION_OBJECT_METHODS(CoreSurface, dfb_surface) etc.
    
    Added fusion_list_foreach_safe() acting like fusion_list_foreach()
    but allowing to remove or free the current element.

commit a9f66e8ffc7dc04c0d8e3704ad285eb9d3a93a0c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 17 15:05:36 2003 +0000

    Added window manager key 'E' to focus the window under the mouse cursor.
    
    Useful in this situation:
    - Have an X11 window under the cursor.
    - Have a DFBTerm on top of the X11 window.
    - Switch to the DFBTerm via <Meta>-X.
    - Switch back to the X11 window via <Meta>-E instead of abandoning (lower)
      the DFBTerm via <Meta>-A or moving the mouse out of and back into the
      X11 window.

commit 3e4bf767e2153dfbb7fdf9fa71aa9b971d936180
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 16 21:33:12 2003 +0000

    Don't fill background of primary layer with the background color if a
    background image is loaded anyways. Nicer startup of new sessions with bg-image.
    
    Display session uptime in dfbdump.

commit 3de42c762771012049b4b98fa97577dfe8523307
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 16 20:03:38 2003 +0000

    Automatically unset SDL_VIDEODRIVER if it's "directfb",
    which doesn't work if DirectFB is running on SDL itself.

commit 7c8e91812940c7b0605deb880a37bff9eae43af5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 16 19:21:05 2003 +0000

    Fixed "make clean" if man2html is not present.

commit 8400a00da3ee848115888245d0fef78fb19f5cc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 16 17:50:33 2003 +0000

    Updated, too.

commit 39dae2efce95e3683a85a7d2948ecd0ffe9e3248
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 16 17:47:05 2003 +0000

    Added support for multiple multi application worlds.
    
    Added option "session=<num>":
    Selects the multi application world which is joined or created.
    Starting with zero, negative values force creation of a new
    world using the lowest unused session number. This will override
    the environment variable "DIRECTFB_SESSION".
    
    Shared memory initialization looking for "tmpfs" looks for "shmfs", too, now.

commit 57523553df09eadb177da0d3b8c696f02b4ae0ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 12 20:01:16 2003 +0000

    Lock surface manager before software driver lock to avoid dead locks
    when gAcquire() is entered with the surface manager lock already held,
    e.g. each dfb_back_to_front_copy().

commit 02c63c94b91dd4a714f74df730c8b3fd6821386b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 12 18:23:39 2003 +0000

    Don't ungrab explicitly grabbed keys of a window when its opacity gets zero.

commit 01b41de31054a58f4d5e9ac89ab45deee06e2e96
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 12 15:40:58 2003 +0000

    Added note about font sharing and run time single/multi app core selection.

commit b07d99b86e5b7b44005fe810014ab221a4aa0eb6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 12 13:44:48 2003 +0000

    Don't switch cursor on during close of keyboard device, but during shutdown.
    
    This results in better looking VT switching.

commit 1934c853ec9cdf2146f1046f38f50a552e708f89
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 21:55:29 2003 +0000

    Print a warning when a video only buffer is locked by software during suspend.
    
    Call dfb_surfacemanager_assure_video() in dfb_surface_hardware_lock() for
    video only surfaces, too. To have it fail during suspend.

commit 4572ea45a16ea42a8535cabaf1d86a74d7bbdfb9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 20:53:58 2003 +0000

    Got rid off global variables exported by modules (dfb_fbdev, dfb_vt, dfb_sdl).

commit 26e65b865faba5e7b3231720ae101b2e6f7013db
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 20:03:47 2003 +0000

    Updated modification time.

commit b729cecd32d1ce2cfebaf6a3bd83b492f96ce751
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 20:00:15 2003 +0000

    Updated dfbg man page and usage information printing.
    
    Changed default background color.

commit 98cda8f84369b6170d3c9e9ad5cef957320ea55a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 18:45:15 2003 +0000

    Must implement switching support during exclusive access to a layer.

commit 5085ccbbd766a0811c407e1b13c1c36ba321f95f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 18:36:52 2003 +0000

    Do not restore auto-video buffers while DirectFB is suspended.

commit 5f40d6b8ee99ab51ecd41f49e18e08b8181cdd71
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 18:07:38 2003 +0000

    Bumped version number to 0.9.19.
    
    Core systems (currently FBDev and SDL) are no longer builtin modules by default.
    
    Generate html versions of the man pages if man2html is present.
    
    Fixed bug message during deinitialization if prior initialization failed.

commit 7cb87ee73b38ada2e2fce0e71fc3fb78b322cae1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 13:46:32 2003 +0000

    Minor change.

commit 2108f9e516c2bf1b9cf773e43575d180db53212e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 13:44:11 2003 +0000

    Major update.

commit bbea70f6ad204a6ee92b7edc4e9b7da68737e65a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 11 12:56:16 2003 +0000

    Made size of duffs device configurable (2, 4, 8 or 16), kept default of 8.
    
    Implemented last missing one of five key event fixup cases.

commit ededb0cbd83435a1bea3d11fd0e5b22a780efcd9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 10 20:10:24 2003 +0000

    Pressed modifier keys are now released during switch from DirectFB.
    
    VT switching with XDirectFB plus native applications seems to work fine,
    though XDirectFB may continue writing to the video memory.
    
    Implemented key code & symbol lookup from key identifier for devices with a map.

commit f3291be5e2c24a4f0975d45cd5730efeea7c64a7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 10 18:19:34 2003 +0000

    First working version of vt switching support for single and multi
    application core.
    
    Still unhandled are video only surfaces and other buffers stick to
    video memory due to locking.
    
    Try (with --dfb:vt-switching)
    - start df_window as the master
    - switch to the previous console by pressing <Ctrl>-<Alt>-<Fn>
    - start df_andi
    - switch back to the DirectFB console
    - you see df_window again with df_andi running in a window (due to vt switch)
    
    Applications are not blocked at any time during "switch off".
    So in the example above df_andi consumes all of your CPU rendering
    to the window back buffer (in system memory) with the software driver.
    
    I haven't tried XDirectFB, yet. Will do so now. Most probably the permanent
    locking of the window surfaces causes a problem.

commit ca7e36f8e9e1ea581c1b1fe9cf4a563e5e1b06c1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 5 14:51:45 2003 +0000

    Applied fix by J.P. Delport <jpdelport@csir.co.za>:
    
    Replace hardcoded default size of 768x576 by the values queried earlier
    from the capture driver.

commit 5cef9f3ab4b327f9663cc1de04cbbb5ad5f849dc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 4 19:09:39 2003 +0000

    Before shutdown the master now sends a SIGTERM to all slaves with a timeout
    of 5 seconds, after that it sends SIGKILL.
    
    It looks cool quitting X (my master) while having several DFBTerms still
    running. The terminals disappear one after the other before shutdown.
    
    To use this feature you must update Fusion including the header,
    otherwise the feature will be silently disabled. This automation will
    be removed before the next release, forcing an update then.
    
    It uses this new function (intermediate solution):
    
    FusionResult fusion_kill( int fusion_id, int signal, int timeout_ms );
    
    Sends a signal to one or more fusionees and optionally waits
    for their processes to terminate.
    
    A fusion_id of zero means all fusionees but the calling one.
    A timeout of zero means infinite waiting while a negative value
    means no waiting at all.

commit d3cf68f75bff721df78a4a295e213f26b2e59158
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 4 16:03:53 2003 +0000

    Fixed error checking at the end of fusion_read_loop().

commit 5319d9e9818ac11dc5d108d6aa1d644f0c7f024a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 4 14:42:47 2003 +0000

    Move "--libs" output to the end, fixes undefined references in static build.

commit 8f4ebc6f579785a2a5e6212a7ba22a5acee7f3f6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 4 14:10:46 2003 +0000

    Use one cpuid macro for both PIC and non-PIC.

commit 3fe59c16a2ea2cf08c8cf6264e740f727bcd61d3
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 3 00:13:01 2003 +0000

    Everyone seems to be starting the Description field with an upper-case
    letter, now we do so as well.

commit ae0fb423a41814a5bd28620231c8a59541d065e2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 17:13:59 2003 +0000

    EXTRA_DIST fixes, updated patches.

commit 500f538aea1769a1077ff1126245d4ac9d077c5f
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jun 2 17:11:21 2003 +0000

    fix compilation on ppc

commit b59c635fcdc1242c3dbed85a3cf4362d9fc1fba7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 16:58:41 2003 +0000

    Updated for 0.9.18 ;)

commit e75e23cbe0cca617e1fef732009b62ebefb39e8f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 15:33:52 2003 +0000

    Major namespace/static cleanup.

commit 7721709cdba1a65b3c25e6feed7b3c7c561372f1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 15:08:18 2003 +0000

    Fixed namespace for global "pfuncs" and "pdriver_data".

commit af378d81577e40e8e058b620f70ab3447f4dee6f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 14:47:32 2003 +0000

    Underscores for "fusion_shared".

commit e03726f5e8f3c27284e81377297e7881761e1d5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 14:44:51 2003 +0000

    Added underscores to internal global variables fusion_id and fusion_fd.

commit 29c98be5225d8b0a57cf0276dc259e9dddffcf18
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 14:43:12 2003 +0000

    Made remaining items (GFunc arrays) static.

commit 7dbfeacf6f00566f07df2e6686ed712f69944012
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 14:42:12 2003 +0000

    Renamed global variable "mmio_base" to "cyber_mmio", should be fixed anyway.

commit 6a3c0285927b91c01af83ac44ac8730b7b583f24
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 14:19:36 2003 +0000

    Everything static.

commit 66884830cf4bc767ee33b6ee66d0602f453efaf4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 14:18:57 2003 +0000

    MMX routines are included now as a header.
    
    No global variables anymore.

commit e9604f0f30bc469b3ab72a2c2a0718a414ae2bb7
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jun 2 12:17:35 2003 +0000

    - fixed state handling
    - version = 0.2

commit 640f1ee7cb0086d10c4ce7b6b2187421f9d241a7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 2 11:58:38 2003 +0000

    Added missing call to fusion_object_activate(), fixes CAUTION message.

commit f3abf93be5cd6e8ae13ca20d1733dc278d368f25
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat May 31 15:01:58 2003 +0000

    - added support for RGB332
    - fixed strechblit bug in ARGB1555 mode

commit f0b559a64dec03e29ec2ee2c8cfb34bcd3dee983
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat May 31 14:01:25 2003 +0000

    ppc inline assembler is now asm volatile(...)
    
    gcc-3.x broke the code when compiling with -O2 or higher.

commit 85cf240a6e60a629416c6d6d070f2917295a4c7b
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri May 30 15:45:29 2003 +0000

    fix for line drawing (invisible lines in df_dok).

commit 12fd28529ff022fb6d0657f21aea6b3901f82255
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 30 15:20:38 2003 +0000

    Forgot to add Florian <florian.fernandez2@wanadoo.fr>.

commit 5d58fc31df459be26051b41f7ccd6cd27ea08be8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 30 15:14:05 2003 +0000

    nVidia Overlay support by Oliver Schwartz <Oliver.Schwartz@gmx.de>:
    
    The driver contains a XBox specific register setting which is
    necessary because of the shared memory architecture on XBox. For
    plain NVidia graphics adapter you need to change line 618ff of
    nvidia_overlay.c (uncomment line 618, comment out line 620). This
    will hopefully be unneccessary once the xbox can be identified by the
    driver.
    
    Readded surface manager's optimizations due to them being fixed with this patch.

commit d6c917b5752f896851efe2296a5a8532ab0df08c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 30 14:56:32 2003 +0000

    Updated savage patch, didn't test it,
    thanks to Florian <florian.fernandez2@wanadoo.fr>.

commit 2d26dfffe389e50cede5e29fbf1c95e9c632c58c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 28 20:06:56 2003 +0000

    Added IDirectFB::GetClipboardTimeStamp().
    Added optional time stamp return value to SetClipboardData().

commit 8ab6a0474a6bd020c6fcfd54d04d2cc2944bacf7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 26 20:08:31 2003 +0000

    Leave the entered window if focus is explicitly requested by another window.

commit d72041ba3040d066c19ec4d2dd65b244a307e344
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 21 19:33:57 2003 +0000

    Changed while to for loop in RUN_PIPELINE.

commit 4b33e99d8c388cc06913a5fff1da0abdc30ec608
Author: holger <holger>
Date:   Wed May 21 15:10:43 2003 +0000

    try to improve primary input device detection

commit a019d0250d19a5ccf1ee3866884648c45f1adc5e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 21 14:48:11 2003 +0000

    Force DICAPS_ALPHACHANNEL if PNG is indexed because the palette may contain
    transparent pixels. FIXME: Add detection if transparent entries exist.

commit e0b7ebcd1fdc2d50dc7df264e6cfcb6be4b90055
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 21 12:51:04 2003 +0000

    Don't call destructor on incomplete objects but print a caution message.
    
    Incomplete objects exist if a process dies between the object creation and
    its activation, e.g. during dfb_surface_create() or dfb_window_create().

commit b7b25626ad691b6ff2ef9039be1ce377c9e34f2f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 21 12:25:14 2003 +0000

    Removed an assertion in dfb_layer_update_region(), region is allowed to be NULL!
    
    Thanks to Johannes Stezenbach <js@convergence.de> for pointing it out.

commit 10da285ef8f674a5a107ac2e5de835ce84bfee8b
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun May 18 19:40:12 2003 +0000

    replaced hallon at debian dot org's email address with mine, don't want
    him to receive emails, because of my broken packages.

commit e4040df569666650ed786897e8277091c11b390c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 16 13:07:12 2003 +0000

    Use font->height+1 as glyph surface height as debug messages showed that
    glyph bitmaps are sometimes larger.

commit 98364c73d3dfe080ec0a6e9af8cc190cf8de2658
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 16 12:55:33 2003 +0000

    Fixed glyph surface height calculation. Ascender + Descender was not enough,
    had to add 1 for glyphs reaching from ascender to descender.

commit 9350f55a5697f553e5c48ae99dee86af8ed6af36
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 13 20:48:27 2003 +0000

    Fixed dead lock in layer configuration recovery.
    
    Cleanly destroy arena if its initialize method failed.

commit 80b7c6956aeda9e465aed107bafb3202da34c6ce
Author: leitner <leitner>
Date:   Tue May 13 20:01:19 2003 +0000

    remove gcc 3 prototype kludgery from string.h

commit b38239102c53d8b07d72c0984728cda0fd4e949a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 13 18:01:10 2003 +0000

    Reverted dead lock fix. It probably introduced insafetiness and is
    obsolete anyway.

commit f9976c0ef2dcec721e7b22e1bb0f41855499b105
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 12 16:19:25 2003 +0000

    Set byte offset alignment to 512 to make ZORG happy.
    Have to add support for different alignments.

commit 8c8e53fac1fd8f42a5ed8a538d606f2758490e09
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 12 14:07:08 2003 +0000

    Added note about reducing sched_yield() usage.

commit 06b9c7cd4c7fece8a3f14dfb38d973de3af73712
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 11 18:08:18 2003 +0000

    Reverted ref/unref as it currently causes that windows are not destroyed
    unless the event buffer is released, too.

commit 6b20f84bfa1472dc90874223c9e5e09027f66abb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 11 15:42:41 2003 +0000

    Fixed cursor/blank off in master.

commit defa4efa4f43781f3185ad2d8cf10091441b2210
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 11 13:25:06 2003 +0000

    Ref/unref attached windows, avoids fusion error if window is released before
    event buffer.

commit ed3ece1c3651c5a5ebdbb008c1393ae55b4c0964
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Fri May 9 23:37:34 2003 +0000

    Fixed reversed CRTC2 SetFieldParity().

commit c2f08f1be4d32c62deb9baec6ebb7905d8f7fc44
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 9 14:51:34 2003 +0000

    New mga memory patch:
    
    1. Don't touch maxdisplayable, but use len instead of len_usable in get_fix.
    Fixes too high virtual resolution resulting in garbage after scrolling a lot
    in the console.
    
    2. Disable hw cursor by default, otherwise matroxfb writes the cursor image
    into DirectFB's memory and the cursor appears (blinking) as soon as DirectFB
    overwrites it.

commit 9b909787a7288929f8dbbe0cfde7ce31a4c11a29
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 9 12:55:44 2003 +0000

    Fixed two evil brain bugs in lock/unlock with flags.
    Removed flag execution from unlock() again, works well now.

commit 6b16c1f9d0ab7b4ec563d8cc70c809c3e8dd5f69
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 8 17:47:39 2003 +0000

    Fixed dead lock in dfb_back_to_front_copy(). Unlock surface manager earlier.
    
    Do engine reset and state invalidation to dfb_gfxcard_unlock() again but
    keep the cleanup in dfb_gfxcard_lock().

commit c01763408ee7229539b5518a197a6439d008d8ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 8 13:33:34 2003 +0000

    Fixed bug introduced yesterday.

commit bee62177bb620488eee6622f7647cd6bf46423ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 7 23:36:52 2003 +0000

    Added DFB_KEY_IS_ASCII.
    
    Disable cursor and console blank each time a mode is set.
    
    Show cursor on escape during auto grab mode (not the ideal solution yet).
    
    Also holdup graphics card property on Ctrl-Alt-Break.

commit 52041116368be9153374a259677a2da945506fd7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 7 12:16:57 2003 +0000

    Added a new option for windows with an alpha channel: DWOP_OPAQUE_REGION.
    
    Along with IDirectFBWindow::SetOpaqueRegion(x1, y1, x2, y2):
          *
          * Disable alpha channel blending for one region of the window.
          *
          * If DWOP_ALPHACHANNEL and DWOP_OPAQUE_REGION are set but not DWOP_COLORKEYING
          * and the opacity of the window is 255 the window gets rendered
          * without alpha blending within the specified region.
          *
          * This is extremely useful for alpha blended window decorations while
          * the main content stays opaque and gets rendered faster.
          *

commit cd3d35592f2c9820296472b8f24207c123292260
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 6 17:59:08 2003 +0000

    Fixed dead lock in write to stderr ;)
    
    Scenario: OpenGL app locked the graphics card to do OpenGL stuff and
    writes debugging messages to stdout or stderr. The DFBTerm it's running
    in reads these debug messages and starts to render them waiting for the
    garphics card lock. But if the io buffer in the kernel is full the write
    of the OpenGL app blocks while it doesn't allow the DFBTerm to acquire the
    lock.
    
    Solution: Made graphics card lock a Fusion Property, like the lock for
    display layers (shared/exclusive access). DirectFB graphics operations
    are handled by the software driver now if an OpenGL context is locked.
    That's not the best solution yet, but at least the dead lock is dead.
    
    Fortunately moving a window over an OpenGL window always uses the hardware
    because the lock is synchronized via the blocking surface buffer locks.
    If a window is moved not touching the OpenGL window it gets slow ;(

commit 0fd471733b9fb74556f3cea48522555f8fce2259
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 6 17:13:55 2003 +0000

    Moved state invalidation and engine reset from dfb_gfxcard_unlock() to
    dfb_gfxcard_lock() by setting flags for the next lock. This is for the case
    that the process that locks the hardware dies.
    
    Alwass blit from top to bottom if source and destination buffers differ
    in the software driver.

commit a188d3bb0de0f0ebab14400efa971231f1772e40
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 3 23:05:03 2003 +0000

    Pass the CoreSurface to the Constructor of IDirectFBGL.

commit 085f9271d27bc380bff1d0fb68c5b440e3f9eac9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 29 19:37:26 2003 +0000

    Added DFB_FORCE_DEBUG which can be defined before including coredefs.h in
    order to enable debug messages for specific files if overall debug is disabled.
    
    Accept zero length as an automatic value for MMIO mapping, too.
    
    Print an error if an orphaned arena is being entered.
    
    Nicer debug output (show time in seconds with three digits after the comma).
    
    Added DFB_BREAK which acts like a failing assertion.
    
    Send signal to current process only, not to the group.
    
    Cosmetic changes.

commit 072182f5a65ed4e5dee38047e038403178adc3c2
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Tue Apr 29 06:08:13 2003 +0000

    Return DFB_UNSUPPORTED if pixelformat isn't supported.

commit bef0c9a458eaf4dfd4eaa901bfa6df49fb47d911
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 28 16:51:23 2003 +0000

    Added GraphicsDeviceFunc 'EngineReset()':
    
    +      * Called after driver->InitDevice() and during dfb_gfxcard_unlock( , true ).
    +      * The driver should do the one time initialization of the engine,
    +      * e.g. writing some registers that are supposed to have a fixed value.
    +      *
    +      * This happens after mode switching or after returning from
    +      * OpenGL state (e.g. DRI driver).
    
    Moved one time register writes from InitDevice() to new matroxEngineReset().

commit c3736101ccb2d36976fe6d7197b17e4f88bc5834
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 28 16:05:12 2003 +0000

    Synchronize the content of the front and back buffer of the window stack
    before entering fullscreen mode. Otherwise old window stack content is
    shown if the application does not clear immediately (and maybe even then).
    
    Added dfb_gfxcard_sync() to dfb_gfxcard_lock().

commit cd51543873c406bfd42b77d9f17e9bf154eddc82
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 28 15:50:49 2003 +0000

    Fixed automatic mouse grabbing for button events.

commit cc4541e55f883dafede4f9edbff503b5f37fd3ac
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Apr 26 11:09:09 2003 +0000

    Added Matrox TV output cable type selection.

commit 93f032f19ee2e7aa3377dcf420d069c1f5d5a98d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Apr 24 08:56:29 2003 +0000

    Reorganized matrox blit code:
    - Moved TEXORG & co. back to matrox_state.c. DrawString() gained some speed.
    - Did the same for SRCORG in the name of symmetry :)
    - Made DSBLIT_DEINTERLACE work with DSCAPS_SEPARATED.
    - TW8A and BYPASS332 are G400 only so planar TMU blits can only work on G400. Looks like 2D blitter on G400 doesn't care
    about BYPASS332 so planar 2D blits have a chance of working on older chips too. I doubt anyone has tested this since
    older cards can't output planar YUV :)

commit b6940c1e9dd3a9a3f87bf610a96d07b5272ebf32
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Apr 24 07:03:07 2003 +0000

    Made nsc driver respect --with-gfxdrivers.

commit e6d39a7ccb62c0209d9f173640c1eb713f4cd76e
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Apr 23 19:28:16 2003 +0000

    Fixed G200 automatic argb-font for multi-app.

commit 72b866c1787c4234126f8d8f7af62882143f402d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 22 13:49:08 2003 +0000

    One more item (at the end).

commit cb352b1d67e04baeaf962ee728ab6e2656ffb0d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 22 12:31:33 2003 +0000

    Fix segfault in MPEG2 image provider by avoiding alloca.

commit d6b18c6a61525087a6c99857c693010c763a4e5e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 22 11:46:25 2003 +0000

    Do not probe graphics drivers if DirectFB is running on non fbdev systems.

commit d227ffcec8a4efcb6ffaa1dfd9c1230162b4be9f
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Apr 22 10:31:16 2003 +0000

    extra null pointer check. fixes segfault when probing driver while using SDL.
    
    we really shouldnt probe gfxdrivers when using SDL.

commit 959d612c0f782679aa6523410e7498a0b92fb764
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 22 08:11:01 2003 +0000

    Fixed fix.

commit 884b3c9c750ce4a1158ef32905e75e783b48bfc4
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Apr 21 14:32:23 2003 +0000

    debianized. based on the official 0.9.17 debian packages

commit 26bbf1a3805feacb8e24e7ec1b0f07711f2ccb3c
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Apr 21 14:18:20 2003 +0000

    build fixes if top_srcdir != top_builddir

commit 51ffc9371712808a8944f93915c094393daf6f1e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 18 20:22:04 2003 +0000

    Add support for running multiple multi app core instances (fusion worlds).

commit 69c441c6d7533c5d727237a1c543fc57bf707922
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 18 17:54:57 2003 +0000

    Fixed PNG and sys/io.h check when configuring with CFLAGS="-Werror".

commit 7d08237522aea87f61ddb2e531d989fe17451ffb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 17 12:27:09 2003 +0000

    Added -Werror-implicit-function-declarations.

commit c1cbb1d8d3cda0683441be070df4d4a82facbdab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 17 11:14:37 2003 +0000

    Removed DFB_CFLAGS, instead prepend to CFLAGS directly, much simpler.
    
    Prerequire autoconf 2.52.

commit c65bf6a6faf6b75558a907d4725873dd16443d6d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 17 10:38:52 2003 +0000

    Set cmap.len before calling the fb driver.

commit a50cfa843556208d74b9b2149bcb1cf88594b48b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 17 10:11:46 2003 +0000

    Do dfb_gfxcard_sync() before swapping a buffer back from video to system
    memory if the hardware wrote to it.

commit 96ebec3ad895b2ba897f8f377778adf12e2a4035
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Apr 16 22:00:18 2003 +0000

    fixed extremely stupid bug, which resulted in black screens with some framebuffer drivers and was presend since 0.9.16.

commit 8d84339b5faa4d9ca64eeb275c3d0cbe5e8605e7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 16 16:47:26 2003 +0000

    Adopted changes from Sarma Kolluru <Sarma.Kolluru@nsc.com>.

commit a6251b758f5e95d73697d27483914e1cccc56b45
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 16 14:56:13 2003 +0000

    Few more warnings fixed.

commit 72642fc6d40042b74f0a222ad16d686b2dde476b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 16 14:50:09 2003 +0000

    Be able to configure even if CFLAGS is exported containing "-Werror".

commit fe0a2627fc691265c72ee03bf6a8d6dfe278e905
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 16 14:22:02 2003 +0000

    Fixed tons of signed/unsigned warnings produced with -Wall and gcc 3.3.
    
    Made all unsigned width, height in the API signed.
    
    Fixed many other warnings. DirectFB compiles with gcc-3.3 -Wall -Werror.

commit eef0cba18d7b17fdec8409db12b7d3860e2dd567
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 16 11:34:16 2003 +0000

    The cursor is no longer enabled during DirectFBCreate().
    
    It gets enabled automatically when the first window is created
    unless the cursor wasn't enabled/disabled before.
    
    Option "no-cursor" now forces the cursor to be disabled forever.
    No window resource is created.

commit 08a0fdb0800f065efb56e3562d383c7e9cf202fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 15 08:50:49 2003 +0000

    Moved into docs/.

commit dcf4dcd30cf7bf6cf9d97b20c37c4c89d768d4b0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 14 13:54:56 2003 +0000

    Applied license header patch from Sarma Kolluru <Sarma.Kolluru@nsc.com>.

commit 46af1c988458bed7b59f64c10192cf5c28b627ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 14 12:05:58 2003 +0000

    Made data pointer of memory based data buffer "const".

commit 434487d86868de5ea898dfc99172cbb9e5f86d78
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 14 11:49:15 2003 +0000

    Let "argb_font" override "no-argb-font" ;)

commit 0ce4d7c94d0663cd83b2f8cdb0a021ee41cca3b9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 14 11:44:24 2003 +0000

    Made node mutex recursive.

commit 31e0780998c503356a694ec9d25f181ab21cef56
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 14 11:15:42 2003 +0000

    Made "no-argb-font" work for G200 (where argb-font is set after config loading).
    
    Reenabled the optimization in repaint_stack() which flips the layer's surface's
    buffers if the whole screen is updated (instead of blitting the whole buffer).

commit 4d049ae507fd527fb7a3fcff91d32cdccd5cf910
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Mon Apr 14 07:44:29 2003 +0000

    Restore interrupts after soft reset.

commit 74c27faace5513e966f4d57b21fd3b2ff0421877
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 13 23:25:29 2003 +0000

    Assign the destination surface to the window stack render state each
    time repaint_stack() is called instead of attaching a listener to the surface.
    This saves CPU usage in each slave by not getting notifications anymore
    (for each flip etc.).
    
    df_flip (slave using RPC for flipping) went from ~22000 to ~53000 FPS.
    Running df_flip as the master (no RPC) results in ~144000 FPS.

commit 9c25655a4b90fec7b99bcf4c764ebb8fb4521d46
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 13 22:44:04 2003 +0000

    Do soft reset on G200 only. It trashes my screen until reboot on G550.

commit f033dc226924b89e9835353a2f30175b79dad0f5
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Apr 13 10:31:58 2003 +0000

    Bumped version number to 0.9.18

commit 2fb1a91569915fdee79cf6de5abc4aee31ff04c7
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Apr 13 10:03:53 2003 +0000

    Added DPMS support via IDirectFBDisplayLayer::SetScreenPowerMode().

commit cad61261aee656c4b53554c9efb97560c4b2b240
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 12 10:59:24 2003 +0000

    use AM_CFLAGS instead of CFLAGS (thanks to obi for the hint)

commit c49b0d632651e338bed60f2e51b01da2c651c87d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 11 16:59:46 2003 +0000

    Simplified surface manager chunk loop in dfb_surfacemanager_allocate().
    
    Added restriction that 'video low' surfaces are not allowed to kick out
    'video high' surfaces.
    
    Create font surfaces as 'video low' instead of 'video high'.

commit 2de275bae6954dab81d5c439293e6868b17180c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 11 16:17:21 2003 +0000

    Added workaround for a strange TMU read offset bug on G200.
    See matroxSetState() for more information about the bug.
    
    Added soft reset to driver_init_device() in case the workaround doesn't
    work (unlikely).

commit ca583b051bb496ef4c47cc7697eabcc8ce289d65
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Apr 11 00:22:50 2003 +0000

    i don't believe that they belong here...

commit 00b2c796e7be7bf0601effc08faf61f3d2b137bc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 10 15:39:55 2003 +0000

    National Semiconductors Geode driver by Sarma Kolluru <Sarma.Kolluru@nsc.com>.
    Great thanks to NSC for their support!!!

commit 4212b252b435d12c4f680eda4557f720f81ffd6c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 8 13:42:07 2003 +0000

    Forgot one more printf.

commit 15350c5a5bb7114451d50e82cd29f8885f5c2346
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 8 13:36:22 2003 +0000

    Create grabbing thread with default priority.

commit 37431805c1a3447f2d7c31a27fd45bd4b6c38a92
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 8 13:30:21 2003 +0000

    Removed debug printfs.

commit eac7475ab3735919b927eb35aa5c88a20478f33d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 8 13:25:44 2003 +0000

    Forgot to add the handler to the switch.

commit 099812d3afd8f015300dce765346deba9cf1b3af
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 8 13:12:43 2003 +0000

    Fixed two bugs causing video playback to system only window surfaces to fail.

commit 3ca8019f2a5697a1d24769e4de5b15b8258c7f55
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 8 12:47:39 2003 +0000

    Finished SDL multi app support by adding RPC palette changes.

commit 16778d879dbd2db3cc77534be41c4d278f1b8dce
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Apr 8 09:22:53 2003 +0000

    fixed broken --dfb:help output. vt-switch was not mentioned, others had wrong descriptions.

commit 32813818554e77785a57bd26d6675a8aa51c7ad1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 7 16:58:34 2003 +0000

    Added multi app support to SDL backend.
    TODO: palette mode.

commit 747d963190282ac25c3fce6f7c41e9c996b1bbdf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 7 13:21:25 2003 +0000

    Added Ville to main developers (not doing drivers only).

commit 2c4912a9c8d81241d3687d322928eed847d15542
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 7 13:10:47 2003 +0000

    Updated 2.4 patches.

commit 98ce3e4005d7f7922850e3d862de19c00db7d198
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Apr 7 12:47:20 2003 +0000

    Added username <-> realname/email mapping for Ville.

commit c818b97381a192ce7e0f65d59431b1ba734efe85
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Apr 6 15:55:53 2003 +0000

    Fixed matroxfb 32mb patch.

commit 2006e7369fee19c6fe20d8a42d3724874234350c
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Apr 6 15:41:22 2003 +0000

    Added README describing Matrox TV-out functionality.

commit f1a6d6cb34037d124eb994f2f88fbe70a8fa53c8
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sun Apr 6 15:14:47 2003 +0000

    Made text drawing honor DSDRAW_BLEND flag.

commit 959e7692f2824d8d5c8cf560b6cc3670e61327dc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 6 00:22:49 2003 +0000

    Updated patches.

commit 83c83594df4941986eedd336cede4d2d43547160
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Sat Apr 5 21:04:23 2003 +0000

    Improved matroxfb vsync patch.
    
    - Move wait queues to the matrox_fb_info struct. Should allow more than
      one card to work at the same time.
    - Enable irq only when /dev/fbX is opened. I think this should eliminate
      XFree86 hanging on startup.
    - Use vline interrupt on the first head simply because it's easier to
      turn on/off than the vsync interrupt. It's programmed to trigger on
      vblank start.
    - Check card type before trying to use the c2vline interrupt.

commit 4f5029495285e157b7ec54681167843b76f2c1a9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 5 02:52:25 2003 +0000

    Small single app fix.

commit dc54be529bce28d67091dc4c095452e12b3b19dc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 5 02:48:27 2003 +0000

    Use new FusionCall for RPC based fbdev ioctl.

commit c50b8ee81e70b769c04ddb97a0666ccaf2de809d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Thu Apr 3 18:35:00 2003 +0000

    Splitted DSFLIP_WAITFORSYNC into DSFLIP_WAIT and DSFLIP_ONSYNC.

commit 126ffdc5f43602c167119dbb5c575f72388e996d
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Apr 2 23:17:40 2003 +0000

    Fixed DSCAPS_SEPARATED with planar formats.

commit ad30d652bc2d892e80b0b32c97aab2ec31595ff0
Author: Ville Syrjala <syrjala@directfb.org>
Date:   Wed Apr 2 17:56:47 2003 +0000

    Fixed a typo.

commit a15f400beedf167ff5e873999aa577366efd3c94
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 1 19:09:08 2003 +0000

    Fixed cursor reference counting (inc. global, dec. local after creating),
    now slaves enable a display layer correctly without trashing it via exit.
    
    Repaint window stack if the layer configuration is set in administrative mode.

commit 14557ea4623d236812f7e6c6d31654f6b6c9a2a9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 27 14:19:50 2003 +0000

    Allow IDirectFBSurface::SetFont() while surface is locked.

commit 622103f2e74d57c41a44b93d1d16ad3a014b9209
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Mar 27 00:08:37 2003 +0000

    applied patch by Antonino Daplas <adaplas at users.sourceforge.net> which improves error handling.

commit e83068fef8841cfdcc5fbaccead49d4e6ffb5432
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Mar 26 17:22:29 2003 +0000

    replaced dfb_system_wait_vsync() with dfb_layer_wait_vsync()

commit 448408368f76bbbf77a483504ccff25edf4ee860
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Mar 26 17:10:52 2003 +0000

    dont build i810 driver if <sys/io.h> is not present.

commit b62c3e11cbc8a48c62ab72e7a53a4e494f2ffcfb
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Mar 26 16:51:13 2003 +0000

    - added Intel i810 driver from Tony Daplas < adaplas at users.sourceforge.net >
      please see i810fb.sf.net for more information

commit 587065b4a3dd84de7e790e4f35dc852a91b5d1a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 24 13:39:09 2003 +0000

    Fixed panning, division of byte offset by pitch was missing
    (dfb_fbdev_pan() takes y offset, not byte offset).

commit 7b532173a68ca94e83a8230491ff3509c5d43d6d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 24 10:12:23 2003 +0000

    Palette size fix from Ville Syrjala <syrjala@sci.fi>.

commit ae8270db46a35f8cd4393d057f8f83a1fef35a07
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 24 01:27:11 2003 +0000

    Applied patch from Ville Syrjala <syrjala@sci.fi> adding triple buffering
    support, many many great thanks ;)

commit 4a71db2190387263831c985613a7dca2730f8b8f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 20 16:35:24 2003 +0000

    Applied patch from Ville Syrjala <syrjala@sci.fi> adding DSPF_ALUT44.
    This is a new pixel format having 4 bits of alpha and 4 bits being an
    index to a color lookup table.
    
    Great thanks!

commit 246a265d6c16203e63e10ceec976c3c67c6d8c94
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 19 16:42:20 2003 +0000

    Sop_lut8_to_Dacc() speedup, thanks to Ville Syrjala <syrjala@sci.fi>.

commit e67cb29538dd8302d159080f4c27edfee4265438
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 19 14:07:10 2003 +0000

    Sop_lut8_Kto_Dacc() and Sop_lut8_SKto_Dacc()
    implemented by Ville Syrjala <syrjala@sci.fi>, thanks!

commit 7fd85d37f1fe650890d3d2aeaa44643d523284aa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Mar 19 14:05:08 2003 +0000

    Naming fix, thanks to Ville.

commit 8ee3c737dc1114526040b36f694d891363bb934c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 14 16:16:35 2003 +0000

    Fixed tiled background image bug (clip wasn't set and resulted in invisible
    parts of overlapping transparent windows).

commit 19ffe9a53ff0ae4976cb4970b655d7e60cbf57f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 14 15:27:31 2003 +0000

    The window needs to be refed in GetWindow() because IDirectFBWindow_Construct
    doesn't do that.

commit 9b270f6b6e28396744a22bb880498359b14ee32b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 14 12:49:33 2003 +0000

    Disable layer normally even during emergency shutdown, because the global
    reaction of the surface has to be detached.

commit 9185037f40f5ade94dec6c6b2a8edc5d94cf6d7d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 11 15:37:31 2003 +0000

    Added James Su <suzhe@gnuchina.org>.

commit 643babead9ee1ffa25a86a418696f628f009d130
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Mar 11 13:30:34 2003 +0000

    Applied a modified version of a patch from James Su <suzhe@gnuchina.org>
    that fixes a potential problem with PS2 mouse initialization.

commit 10d488cac9448f5bb185446d787f6c194608782c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 10 12:39:09 2003 +0000

    Reverted an optimization, just a guess.

commit 78eae1b6f2f8db1e0d3500ec2ff2496794f78687
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Mar 7 12:00:28 2003 +0000

    fixed a typo

commit 4808e7b6b3f95eb211981f4c3320fbc752e1dbb1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 6 13:59:44 2003 +0000

    Avoid writing to the original message data.

commit 9d6a4b70c0cebc40fe60e3e11fad78e2f8b4c11d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 4 21:04:57 2003 +0000

    Added DFBInputEventFlag:
    .     DIEF_GLOBAL         = 0x200    /* Only for event buffers creates by
    .                                       IDirectFB::CreateInputEventBuffer()
    .                                       with global events enabled.
    .                                       Indicates that the event would have been
    .                                       filtered if the buffer hadn't been
    .                                       global. */

commit 89458a1bed734755336648f97a8a73daeeebf656
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 4 16:11:27 2003 +0000

    Non global input event buffers now also get events if any window of the
    application is focused.

commit 6917028685c2dbc36525dacc02b614db8fd2b2d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 4 11:39:33 2003 +0000

    Added extra checks for *argc and *argv being non NULL. Thanks to
    Sebastian Ley <sebastian.ley@mmweg.rwth-aachen.de> for pointing out this bug.

commit 00393231230df60d437aa865d90ca3c87d9de617
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 4 10:24:19 2003 +0000

    Install directfb_version.h, too.

commit 10305776ad6bbf270dda96f4a87d14bb9fed5679
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 28 20:18:55 2003 +0000

    Updates for 0.9.17 release.
    vmwarefb patch for older kernels.

commit 4ebbdeb74a1fd0b7c237559eea617cef2d51664d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 28 20:11:29 2003 +0000

    Fixed blitting within one buffer by using late software fallback.

commit fab5042adc68b8e8188ae04b5a368b42d4a65795
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 28 19:59:24 2003 +0000

    New patches.

commit 708f92fdc975c27c568fec6e0f04336ec5570a50
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Feb 27 00:16:41 2003 +0000

    various build fixes for non linux systems
    - disable ppc asm on darwin and openbsd
    - do not build dfbsummon and fusion_bench on non linux systems
    - add -I/sw/include to CPPFLAGS on darwin (for fink)
    - add -L/sw/lib to LDFLAGS on darwin (for fink)

commit 956ba30e4c3d447d778c37a558987019f8e356f1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 26 15:09:46 2003 +0000

    Eliminated all strcpy, strcat and sprintf usage.

commit 0344e781f46db2d4684c9fd82ea30bce94740ee5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 25 19:02:15 2003 +0000

    Reject YUV modes, thanks to Jiri Svoboda for pointing out this bug.

commit a4dd565b6379b4a6a6046ac383f703b4ea10cadb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 21 22:26:05 2003 +0000

    Readded DSPF_RGB15 (= DSPF_ARGB1555).

commit 9c364f5a1d829af73de2a294e6a25cd44bd6205d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 20 21:30:37 2003 +0000

    Print GetSurface() warning only if DLSCL_SHARED is set.
    Beautified the output of dfbdump.
    Install dfbdump.

commit f5adaad0d29d82f29f82142d9c8e666be220ac1a
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Feb 19 21:53:06 2003 +0000

    fix for neomagic check

commit f76f6764df7c8b7b1901c02373dd41183e9206a2
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Feb 19 21:43:23 2003 +0000

    --with-gfxdrivers=none builds no gfxdrivers

commit ae3d89678b39e31f6349ba7611a49db970e46e94
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 19 21:34:13 2003 +0000

    Beautified output.

commit 88a0f94dec5a6a3a6181404bfafd0039a941ee9c
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Feb 19 21:15:59 2003 +0000

    it is finally possible to specify which gfxdrivers should be built.
    ./configure --with-gfxdrivers=<list>
    
    list is comma separated, all compiles all drivers (default)

commit c14184e30fb10267c2253cb9873ec2f773b2da2b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 18 21:57:15 2003 +0000

    Commented out two assertions.

commit 3decb592a4da32861d973c565fa02b7a6882b306
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 18 20:49:03 2003 +0000

    Added tons of assertions.

commit 2709a9b4c312eb763f27912f3a2d6def112446fc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 18 17:38:21 2003 +0000

    Added cooperative level restrictions to many functions.
    In short: cursor and background changes only in ADMINISTRATIVE,
    configuration and appearance in ADMINISTRATIVE and EXCLUSIVE.
    SetFieldParity() is allowed with EXCLUSIVE only.
    GetSurface() will be restricted to EXCLUSIVE soon.

commit 67a157227064b428cf987ddd98ae6cdeba0b3f95
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Feb 16 13:29:18 2003 +0000

    Fixed destination color keying for blended drawing.

commit 0d1e5c4a8f6fa04bcc506e25cd6613721b42888f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 14 12:43:38 2003 +0000

    Sorted functions a bit.

commit a1a217246b4b7b4c128bbcf8d14fb02a6b048de6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 21:14:37 2003 +0000

    Muted some often appearing debug messages.

commit 10ad1e07b0d47dd5c9ad2719a46f09fb5b61fddc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 18:20:43 2003 +0000

    Various bug fixes.

commit 55d71aca197ed227be33962c1063e0a7cee6c4e8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 17:35:47 2003 +0000

    Small fix from Ville.

commit 50ed9d7601c1311bde2c82a28d4e0a6d2ec944d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 15:56:00 2003 +0000

    Even field -> top field.
    Odd field -> bottom field.

commit a74482f2d7c7b5221a6908425e4eaf2b44aeeb93
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 15:47:56 2003 +0000

    Another patch from Ville Syrjala <syrjala@sci.fi>:
    
    I just stumbled on DLOP_OPACITY and DLOP_ALPHACHANNEL and thought that the
    CRTC2 sub-picture layer should honor these. So here's a patch to do just
    that.

commit 7268ed86f1f46b1fe3fa240e4c1e2027a18844ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 15:32:19 2003 +0000

    Applied patch from Ville Syrjala <syrjala@sci.fi>:
    
    I'm sure everyone remembers Brian's CRTC2 troubles. Well I think we
    managed to fix it off list some time ago. The problem was caused by
    displaying the fields in the wrong order.
    
    Here's a patch with the solution I came up with. It adds a new method
    IDirectFBDisplayLayer::SetFieldParity() to select which field is displayed
    first after a Flip(). This behaviour isn't always the best choice so I
    added {DLCAPS,DLOP}_FIELD_PARITY flags.

commit 6b49e441ee9cf85dce9531fb3f6a4c8cf0189755
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 13 15:23:56 2003 +0000

    Added FIXME note.

commit 2e6183326b48db5c826ccb86b855473c71ba55ce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 12 19:44:21 2003 +0000

    Added 'bool' return values to all acceleration functions.
    Implemented 'late software fallback' for FillRectangle, DrawRectangle,
    Blit and StretchBlit.
    
    Graphics drivers are now able to return false in these functions to
    trigger a software fallback. Useful if blitting direction cannot be
    configured.

commit b5a7d158bbe102a2b58e6f12390119b14029d12d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 12 15:53:20 2003 +0000

    Moved core part handling code from core.c to core_parts.c adding four
    new functions: dfb_core_part_(initialize|join|shutdown|leave).
    Added some debug messages.

commit 59e7e902ed86344a7b54e2f60b4101bb4581baa6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 12 14:50:11 2003 +0000

    Added 'core parts' being the gladiators entering the arena.
    Each core part has an init, join, shutdown, leave, suspend, resume
    and information about the local and shared data size.
    Core parts are system, input, gfxcard, layers and colorhash.
    Moved colorhash core part to core directory.
    Moved clipboard code from core.c into extra core part.

commit fa93548698fc65b4cbe82bc7e9cfc7bee23a8127
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Feb 9 22:13:13 2003 +0000

    Made memcpy benchmark more 'blitter like'.

commit fc0e42031e3d86928332e401b0a285deda087f45
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 5 13:41:45 2003 +0000

    Added Scott Brumbaugh <scottb.lists@verizon.net> to the ThanksTo section.

commit 11c2209547ccfec0906df72e03f799373ce59588
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 4 20:11:55 2003 +0000

    Commented out recently added cleanup of local reactor nodes (crashes sometimes
    and produces a bug message).

commit 661f8b7c54ea038b73ce9d0d32ecf1ee9798ea3d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 4 17:15:01 2003 +0000

    Lock the node list in _reactor_free_all().

commit e2882d384c598154b95e79ff358b9388f9512d5d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 3 19:23:53 2003 +0000

    More cleanups and comments.

commit 361190234249fa3fff3c52d0c359e23b06860539
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 3 18:19:45 2003 +0000

    Completely commented.

commit b8f1133c58efcc3736ef65720e30801627f49a4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 3 12:36:06 2003 +0000

    Code cleanup, minor optimization in dfb_gfxcard_state_check().

commit bc50cdd7e2b2bdd8dee077a1949624b85586f6f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 31 18:43:36 2003 +0000

    Use dfb_layer_wait_vsync() now.

commit fef80277b99d283c5bc5753ce1042ff2e84952f6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 31 18:40:29 2003 +0000

    Removed dfb_system_wait_vsync().
    IDirectFB::WaitForSync() uses the primary layer's WaitVSync().
    The FBDev primary layer's WaitVSync() is now implemented.

commit dbe698a70c7e8c03adea1f22dbdead96beca39e2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 30 20:42:41 2003 +0000

    Fixed input device ID unification.
    Added recursive helper function make_id(prefered).

commit 68ab1cebbce5cca6d31a2d27dcfd50ff96cce2de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 29 18:11:11 2003 +0000

    Input devices still get same IDs sometimes.

commit 560d631bc151b8f89dea26e54e23a73c1fcac101
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 29 15:41:45 2003 +0000

    Added "FBDev" and "SDL" to primary layer names.

commit f508d8ad1247891d8c800999f48c56f011d4e9dd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 29 15:39:41 2003 +0000

    Added enumeration of display layers.

commit b0f9841a3a6127a0c12c19c9db7b006ad9e03c46
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 29 13:23:58 2003 +0000

    Moved input device name and vendor to DFBInputDeviceDescription.
    Added new tool "dfbinfo" which currently enumerates input devices,
    but needs some beautified output.

commit 24d8c48c898a5271d6fc942029c0a7ab1b942185
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 29 13:19:13 2003 +0000

    Added special thanks for Ville.

commit 8a6c41b2d87f3b41adf3ad787375817d73494477
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jan 29 12:33:53 2003 +0000

    Added input driver for Microtouch serial touchscreens.
    Since this driver has to be configured by adjusting a couple of defines
    in the source code, it is not build by default. Enable it using the
    --enable-mutouch configure option.

commit 3138e94cd4751250eaa98a25d489567f1796d9ce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 24 19:19:18 2003 +0000

    Fix for planar formats by Ville Syrjala <syrjala@sci.fi>.

commit 2b07efc4a20db64448dd30604720c861e2725f32
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 23 21:12:53 2003 +0000

    Reverted change to use FusionLink.

commit 2c2b947299c5e93bebedf9a810274c57123946fd
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jan 23 20:11:05 2003 +0000

    Return DFB_OK from load_default_cursor() if the file was missing and
    created an empty cursor.

commit 618f381302c88f041ffc2a5e0cebf2a32b280402
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 23 17:00:16 2003 +0000

    Fixed segfaulkt during shutdown.

commit 45e8fac66223c3d2cf4980fa7badb15546c12e99
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jan 23 15:59:08 2003 +0000

    Compile the default font into the default font provider.
    Don't install font.data any longer.

commit 17b9fd1455c76ee736b1c8527bcbc8e30e595dc4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 23 15:37:21 2003 +0000

    Hold the surface manager lock during the whole dfb_back_to_front_copy() work.
    Use FusionLink for local list of input devices.

commit 646e76b9e55579caa5df8c4d81820f07e1c3b40f
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jan 23 15:11:32 2003 +0000

    Initialize the cursor window as empty in case the cursor file can not
    be opened or is smaller than the expected size.

commit 6615dbbed032201d181f3bae79cc774dff0ab441
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jan 21 20:04:16 2003 +0000

    Check that fb_dev is not NULL before trying to release it in system_leave().

commit cc8e5c008dafbf1e5668acdfba29c3e31d70e0ae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 21 15:25:33 2003 +0000

    Started to write an overview of the initialization process.

commit 09a908f03ef5d9ec9c3deedb16349bce9ef7d279
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 21 15:17:19 2003 +0000

    Fix "could not adjust heap offset message" if the primary layer surface
    consumes the whole video memory (thanks to Ville Syrjala).

commit d8d74b686b0c3df3b192fe6250fbeba8e86327fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 21 15:15:35 2003 +0000

    Don't segfault in dfb_core_get_clip() if no clip is set.

commit 566eee41028bdce57dbdc86a666bbc8db7a335ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 20 19:48:20 2003 +0000

    Minor code cleanup.

commit 8cf9f02a926b9b9a5dd64de386379502511bf59c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 20 19:05:17 2003 +0000

    Open framebuffer device before initializing the vt.
    Don't open extra framebuffer device in vt code.

commit 97f7ce3b86fd8b5984ac06afd8891d190362e103
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 20 17:42:43 2003 +0000

    Removed obsolete usage of shcalloc.

commit 32b074d9be0a02cbfb6c3f84113a32f8583389fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 20 17:13:54 2003 +0000

    Use dfb_gfxcard_lock() in dfb_gfxcard_shutdown(). Removed workaround that
    was needed because of lacking support for recursive locks.

commit 2f7528b1a3781c307efa885ef8fec0f009afdd9a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 16 15:22:17 2003 +0000

    Added minimalistic clipboard functionality via IDirectFB::Set/GetClipboardData()
    including mime type. This is an intermediate solution that will be replaced.

commit 545b308ffdf4532042740c1e87becd2817c65541
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 15 13:09:05 2003 +0000

    Added PPC sources to EXTRA_DIST.

commit 6fb3ca80481b63237871ac4a534335e8623f524f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 15 12:58:29 2003 +0000

    Added 1280x1024 at 75 Hz.

commit 4fc792524165b88b290824e02810b1ca9c43805c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 14 16:33:41 2003 +0000

    Added patch.

commit 86e8644dd58aed35ab3946718c9c4fe6404242fd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 14 16:31:26 2003 +0000

    Updated ChangeLog and NEWS for release.
    Added comment to arena code.

commit bb37a7488ecea81235b56e27295601b8b92db24b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 14 15:16:36 2003 +0000

    Updated patch.

commit 45a8c42ce04fceca9d593919572fad8813f8c5bd
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 13 19:29:05 2003 +0000

    set data to NULL in case of error to avoid a possible crash

commit 5c5d0ec9a7dba121bebf25ee029229dcd389ad3d
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 13 13:18:42 2003 +0000

    Updated the spec file (added dfbg and its man-page).

commit f4b5e4954f4d3ad6b5283636c5e597a1207173ad
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 13 12:57:20 2003 +0000

    Removed the avifile and flash video providers. They are now part of
    the DirectFB-extra package.

commit 961aef164df4770bf86f731bc09d10bde775c52c
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jan 10 15:20:04 2003 +0000

    Reverted my latest change since they need autoconf > 2.13.
    Will instead move this code to DirectFB-extra and do it correctly there.

commit c3294591a682cdb522a0c953876287a3840946b2
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jan 9 16:46:24 2003 +0000

    Fixed a typo and separated the comon from the exotic pixel formats.

commit 0b568d8423ebd372f131a44b1106b835f42d6135
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jan 8 15:47:01 2003 +0000

    AC_LANG_PUSH C++ before checking for libflash, AC_LANG_POP afterwards.

commit 216339a89a5584fa861dbe43316ebfe7773c569a
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Jan 4 21:25:20 2003 +0000

    - moved ppcasm_memcpy and ppcasm_memcpy_cachable into two seperate files
    - ppcasm_memcpy_cachable is only built on linux
    
    TODO: do not build ppcasm_memcpy_cachabe by defaut since this will create
    machine specific code.

commit 9e3ec006c8ddd38e6f29751d07f8f66251101e8d
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Jan 4 20:46:41 2003 +0000

    removed hardcoded CACHELINE_BYTES, uses values from <asm/cache.h> instead

commit 5eb1521913af7efd34ea04a24b72b689c8865895
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Jan 4 20:18:40 2003 +0000

    - dont call AC_PROG_CC twice

commit a993647941ae448a596a4b5108365d060773c901
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Jan 4 20:10:37 2003 +0000

    - fix build problems with automake 1.5 when compiling assembler source
    - removed AM_PROG_CC_STDC macro which is obsolete, use AC_PROG_CC instead
    
    "This macro is a relic from the time Autoconf didn't offer such a feature.
    AM_PROG_CC_STDC's logic has now been merged into Autoconf's AC_PROG_CC
    macro, therefore you should use the latter instead. Chances are you are
    already using AC_PROG_CC, so you can simply remove the AM_PROG_CC_STDC call
    and turn all occurrences of $am_cv_prog_cc_stdc into $ac_cv_prog_cc_stdc.
    AM_PROG_CC_STDC will be marked as obsolete (in the Autoconf sense) in
    Automake 1.8."

commit ed0bbe9cb8acc904f5b4e19cea58000f0997dc64
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Jan 4 19:58:56 2003 +0000

    - bugfix for ARGB primary. someone did copy&paste from RGB16 values...

commit 4d5bd2f637fd765bb1e6bb9ad412f62ac4aa0a3b
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Dec 29 17:50:03 2002 +0000

    fixed fix

commit 5ce552989be8de0c6af67fce53a81574c4073bbd
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Dec 29 17:39:23 2002 +0000

    fix handling of palette alpha values

commit dd2c8f1708323db1c653083ef7f2b5dd9205881a
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Dec 28 19:36:54 2002 +0000

    bugfix for ARGB1555 pixelformat

commit f05157464edb933b825d25eff19e4df03f09e5d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 27 21:25:35 2002 +0000

    Removed some debug code.

commit b4f2a5926f9260dcda3cf747d070579f7a3dba11
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 27 20:58:42 2002 +0000

    Fixed 15bit color keyed blitting.

commit afd3ce2d8f5b43400c8d972fe4b4c2bf2b1ceb14
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Dec 27 19:41:19 2002 +0000

    integrated optimized ppc memcopy from xine
    
    this is evil and breaks at least compilation under OSX. should be disabled by default.

commit 08828669d5a73fac34e427b9441e82ea25bc512a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 27 19:39:12 2002 +0000

    Added enums for indices of global reactions, removes some FIXMEs.

commit fcf9fd7ba39fe2edfcc3554b870ac08b26e8d84f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 27 17:50:08 2002 +0000

    Changed DSPF_RGB15 to DSPF_ARGB1555, untested.

commit 212f2740b401634bcd2978b9b66a615d4d0de038
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Dec 27 17:42:51 2002 +0000

    small compile fix (follow changes to layer naming)

commit 74c66befbe9cd47f1f5d467d1e15b267828f695d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 27 05:26:36 2002 +0000

    SetVideoMode() resizes the window of windowed fullscreen applications, untested.

commit 792c4b56cd934f6110595c6a7078389ec1a603cb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 27 03:39:28 2002 +0000

    Made summarize for upcoming 0.9.16 release.

commit 83468fe052e2a6947507fe240a1a5a2fd10434bd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 19 20:53:37 2002 +0000

    Ville Syrjala moved the layer name into the layer description and removed
    IDirectFBDisplayLayer::GetName(). Thanks!

commit 52ec3c16c3c9b704bca40ece400fcca16773aa67
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 19 19:07:02 2002 +0000

    Applied patch from Ville Syrjala <syrjala@sci.fi> that adds TV-Out and
    sub picture layer support for G450 and possibly G550, too. Thanks!
    
    Fixed two bugs related to (de)initialization of additional display layers
    by slave applications.

commit f2fd1fba857fed54e46d87fcc277f02c8e78b83a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 18 21:34:52 2002 +0000

    Focus the window under the cursor after abandoning a window with Meta-A.

commit 519361d3a02c496cc1a5098bbd59f9f33cbf85eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 18 17:53:44 2002 +0000

    Don't send SIGTRAP if shared memory limit would be exceeded, return NULL.

commit 8ae7ee99015471795ab02fa547937bd674e06566
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 17 20:55:14 2002 +0000

    Added FusionObjectState enum and fusion_object_activate().

commit 5ca7111d2859cf5fcc01c084f8960c341bc569d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 17 19:53:45 2002 +0000

    Added dfb_gfxcard_lock() and dfb_gfxcard_unlock(bool invalidate_state).
    It's used by dfb_fbdev_set_mode() to workaround accelerator register
    writes by the framebuffer driver during FBIOPUT_VSCREENINFO.

commit 65179acc9e172f98fc6edb935af9dd165ae12255
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 17 19:51:27 2002 +0000

    Force SDL disabled if multi application core is enabled.

commit be52dde2c9f0c058dab8b24fc9f83bd0e3bf81de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 16 14:13:56 2002 +0000

    Removed unnecessary newline.

commit bc67490469b502ed82a83b9524417de9eb8bf078
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 16 12:24:59 2002 +0000

    Forgot to update this one, too.

commit 075ab0173bb882d7fc708629e9867af321c42f8d
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Dec 15 21:54:58 2002 +0000

    Only check for a working C++ compiler if the avifile provider is going
    to be built.

commit 33d235cda9926c3e90ca83890514267659467f02
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Dec 15 13:59:45 2002 +0000

    if PAGE_SIZE and _SC_PAGE_SIZE (for sysconf()) are undefined, theni still guess page size.

commit 3ba3594eebc2d61745ded78f73d452f8bef60df5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 13 18:36:17 2002 +0000

    Added "block-all-signals".

commit a5b1e845db316181528c71d391c16ca712d07be6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 13 17:57:44 2002 +0000

    Don't guess page size if PAGE_SIZE is not defined, use POSIX sysconf(3).

commit 76328b6d9a06540372401ac3bd03fbedfd608c5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 13 17:24:23 2002 +0000

    In multi application core Ctrl-Alt-Break sends a SIGKILL to the process
    that has exclusive access to the primary layer. No need to login from
    network or kill everything if a fullscreen app hangs.

commit fa39fbf10307ae5acef119a472abe5aecbf63b3a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 13 16:48:07 2002 +0000

    Added threaded mutex and spinlock benchmark.

commit be35d3eda8dd3b320ad4b343d506e54a909f5850
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 12 19:01:38 2002 +0000

    Use first system found as a fallback if the requested system hasn't been found.

commit 45d92cabb9b60f6425bc2cb2bd4513cadb30f1dd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 12 18:43:12 2002 +0000

    Added DFB_COLOR_EQUAL macro.

commit 621dd8f003f2f67b137ebb71d161a0112c7e29ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 12 16:41:14 2002 +0000

    Include strings.h.

commit b607f7b663bdeba2d9793fdce3fbdd5d90592390
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 11 16:50:13 2002 +0000

    Added missing <linux/fb.h> includes for accelerator ids.
    Removed ifdefs because configure already checks for the definition.

commit eeb2800b84589f8ff95a397f248b2bdddfdda3aa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 11 16:45:12 2002 +0000

    Added "\n" to debug message.

commit 07968a837c74faad3f326178d4ab7027d06685b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 10 19:03:33 2002 +0000

    Added new cshortcut.

commit 704ae6c4bce276900277b5fd203f888b7eddfe9f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 10 19:02:31 2002 +0000

    Added <Meta>-P shortcut that enables the cursor and sets the opacity to 0xff.

commit 11b292f8c3bbb81d6d9563a4e2c5db7a66700c1c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 10 18:56:20 2002 +0000

    (Temporarily) set DWET_POSITION_SIZE in window event flags to avoid endless waiting.

commit b4217b59537575c21b6f469221b85b17390b0834
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 10 18:10:15 2002 +0000

    Check return value of WaitForData() to avoid endless looping on unexpected EOF.

commit 2ae9ee500bb7fec08f4a89b489d76d3f854b2c07
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 9 18:14:59 2002 +0000

    Added a dfb_thread_testcancel().

commit 6547a1a375185db87a2458efdc53f7bc9fca2092
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 9 14:57:08 2002 +0000

    Always default to fbdev system.

commit 9b228e9766f694246b4a30d85092394f069bc201
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Dec 6 19:17:18 2002 +0000

    try to workaround a crash in the OverlayThread

commit 99f157275b74fb50b17b5803673dc90cfcac6ad5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 18:22:47 2002 +0000

    Don't set window->stack to NULL in window_remove().

commit bf9094b4c6d056ec65bb6a4804fdde937634865d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 17:51:44 2002 +0000

    Open fusion device in non-blocking mode and use select(),
    fixes blocking in valgrind.

commit 4d0565ef50e996f2c07cf8f7c0c257a7ccb9758e
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Dec 5 17:48:35 2002 +0000

    Added configure option --without-tools that allows to disable the build
    of the tools. Useful for cross-compilation.

commit f4a6612437b981c16fb113484a3def13e143c47e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 16:43:36 2002 +0000

    Removed a bit debug.

commit 68f4e63effd9a2bf73de4d561ab3d8ec0008f0d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 16:42:07 2002 +0000

    Added some debug output.

commit 43bb3f3ced220200b6e096d920845862de52ed1f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 12:00:52 2002 +0000

    Some experimental code from Ville Syrjala to avoid tearing.

commit 0dac28d8292ed1a8371c051559da86c96e931c5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 12:00:06 2002 +0000

    Patch from Ville Syrjala adds IDirectFBDisplayLayer::GetName().

commit bd7fd946619dad739fd3b0d4fe8a865f5d8fb01a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 5 11:57:34 2002 +0000

    Added IDirectFBWindow::GrabKey() and UngrabKey() which take a key symbol
    and a modifier mask, useful for panels etc.

commit 6f271e78f27ffc314ac5159571829bd0bcfe4fce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 3 20:14:16 2002 +0000

    Added all required locks that were missing
    because recursive locks were unsupported.

commit 7130b58967bfb5d6d1204a49ad6d2390860e0721
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 3 19:20:03 2002 +0000

    Added configure option "--disable-text" which reduces the stripped library
    size by ~20k on my system by removing all init, debug or error messages.

commit 9b170df039e0c474cb2688ee9d59103d7c8ff29a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 3 18:06:33 2002 +0000

    Removed obsolete fbdebug code.

commit b9a38b67852e81519e115be1d9372e010e3b57c7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 2 18:26:24 2002 +0000

    Fixed some error handling code that infinitly looped.
    Fixed reactor related reinitialization bug.

commit 0ab8188aa76c1886250ad8a0d261b2330574f844
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 2 17:05:18 2002 +0000

    Fixed two reinitialization bugs.

commit fde50bffa2b6bcc26f916cdf8bfbfadd63d9796b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 29 20:09:02 2002 +0000

    Detach global reaction from layer background surface before unlinking it.

commit df2b6313330bd8839c9fe5baa0fdd3992c8bdcfb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 29 20:02:32 2002 +0000

    Slave processes on a real VT have to detach the thread going to mmap the
    MMIO regions.

commit 40b783025ffb2383bcaef36650121f7085b6f137
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 29 19:20:09 2002 +0000

    If graphics-vt is disabled (default) at least temporarily switch to KD_GRAPHICS
    during FBIO_PUTVSCREENINFO to avoid redraw (clear & text) of the text console
    when fullscreen apps start.

commit fd483259d0efa015afd42b97b9a66ce0b15d3eb7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 29 18:57:28 2002 +0000

    Added RPC mechanism to let fbdev ioctls be executed by the master only.
    DirectFB now only detaches from its tty if it's a real VT and only if
    vt switching is enabled. This looks like a clean and working solution.
    
    The only limitation left is that the master must not call DirectFB
    functions that do fbdev ioctls within a thread that was created by the
    application, but only if the application created any thread before DirectFB
    got initialized. And of course this only applies to master processes started
    from a real VT.
    
    Added fusion_is_shared(void*) which returns true if the pointer specified
    points to shared memory.

commit a4991722c3718c8d282ef2feb10b18141be153ca
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 29 12:40:39 2002 +0000

    Updated vmwarefb patch.

commit 34f6b2fe27b6a6fbcf5971c98b15628b4197cefa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 29 12:23:18 2002 +0000

    Clear a layer (dfb_windowstack_repaint_all) after enabling it.

commit b9b9cc4169eb5d6679168ee0ff416e10291a63eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 27 19:48:49 2002 +0000

    Added setsid() call, to slave init.

commit 6b77fc1c0815363a37bdb4b0e92b3f2387406114
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 27 17:20:13 2002 +0000

    Added output of stacking class.
    Window order is now the real one.

commit 0a58ddd84782549459d4de0acbe1aaddb08d22aa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 27 17:19:45 2002 +0000

    Fixed three bugs related to stacking class.

commit 618ba23ec81a228a8c3c78fc9ff165199d3dda76
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 27 01:42:09 2002 +0000

    Moved dfb_system_lookup() call to dfb_core_init(), fixes fusion_bench segfault.
    Wait for a thread's initialization to be completed after creating it.

commit 904f9d90dcec6854d8fce60686f86b0218dda495
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 27 00:12:13 2002 +0000

    Detach slaves from their terminal, too. Disabling console acceleration
    (which resulted in a kernel side card programming) in slaves is not necessary
    anymore. Also fbdev ioctls are ensured to act directly on the global state
    instead of the tty bound one. Not all threads get detached yet, if the
    application created a thread before initializing DirectFB.

commit 9f536f80adc619fc9f5a77482331e19c4b6ccee3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 26 22:49:39 2002 +0000

    Modified the glyph surface width calculation to use 8192/font->height.

commit a10827cc91a1ea395469e4266a62c128b3937467
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 25 15:23:55 2002 +0000

    Made dynamic code safe for binaries with statically linked in interfaces.

commit 6ce52601bc1dd44113d3ed0a772527a0876f3016
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 22 21:36:17 2002 +0000

    Input device listeners installed by the windowstack construction code
    are global reactions now. Additional layers can now be used in windowed
    mode even after the process that enabled the layer exits.
    Remaining TODO is to auto-disable layers via reference counting.

commit 08a9fbb8ce08d8cdb91f255ec2354cc81f9e0249
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 22 21:22:51 2002 +0000

    Fixed warning.

commit df237a220e754751134c302251aa99600c3f7491
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 22 21:18:00 2002 +0000

    Implemented the ability to attach "global reactions" to a reactor.
    A global reaction will always be called directly by reactor_dispatch().
    Global reactions can be attached/detached by any process. Global reactions
    don't die if the process that attached it exits.
    Made layer_surface_listener, layer_bgsurface_listener and
    surface_palette_listener global reactions.
    
    Removed layer palette workaround removal TODO.

commit 09c2b41b2c44358b8014fa1487550314b05610ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 22 18:13:56 2002 +0000

    Minor updates.

commit 740a730765aa01cdc84a0890f213f574135df0f1
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Nov 22 11:26:13 2002 +0000

    Use DFBBoolean instead of defining true and false. Updated tools README.

commit 9f3fe39c806df2cfe7ba778d5ba0c051481cfc9c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 21 21:23:24 2002 +0000

    Minor fix by Antonino.

commit 418d6efb9c6f32f24d7e00ff64a244d44e05f173
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 21 19:06:59 2002 +0000

    Color adjustment support on primary layer (via gamma ramp in direct color mode)
    by Antonino Daplas <adaplas@pol.net>.

commit a69bf2db7bd3af559781d5d9b1bce378a9c5f3d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 21 18:21:46 2002 +0000

    Check for reactions != NULL, fixes default font.

commit 3892db68dfcf841019e95e129e2f767e31f0034c
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Nov 21 15:50:53 2002 +0000

    Allow to unset a surface's font by calling SetFont() with a NULL.

commit 5b28b8bedc82517f01bf563248f68db2453e0c95
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 20 20:31:39 2002 +0000

    Dump windows of all layers.

commit becf487f04235894673f48e46c585a1ab4b14d38
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 20 17:40:15 2002 +0000

    Support direct color visual, thanks to Antonino Daplas <adaplas@pol.net>.

commit 5a3d3bf783644dd81fe0419b0e363bf72cf73b52
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 20 17:38:36 2002 +0000

    Forgot "-Wl,-udirectfb_fbdev".

commit 519453c9e7f3e52323ca986003861e72f487be65
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 19 18:03:10 2002 +0000

    Some focus behaviour fixes, especially for non-cursor mode.
    Link layer surface to layer while layer is enabled.

commit 872749aa2fd32eb735d83c9668b69722e8575103
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 19 16:41:47 2002 +0000

    Default background mode of new layers is DLBM_COLOR (0, 0, 0, 0) now.

commit ce62d80b1326bc3f34415ff1996134c9a50cd9b8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 18 21:59:39 2002 +0000

    Allow passing NULL to unbind a shape and release its surface.

commit 307dd9d9b3c266a0d88b28e68fd3d03eea12cb4b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 18 21:46:08 2002 +0000

    Added IDirectFBWindow::SetCursorShape(), untested.

commit be8c1e770850774d92af650a268277027a5a6aa0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 18 20:54:14 2002 +0000

    Added options "--input=foo,bar", "--graphics=foo,bar" etc. that will output
    all required flags for statically linking the specified drivers or modules.

commit a9555c23398542209386bf9f3d998073959e9dcc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 18 18:42:43 2002 +0000

    IDirectFBDisplayLayer::WaitForSync() added by Ville Syrjala.

commit 12c71534a6a76fd5ec547f7dc3a3d8bec38a3083
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 22:36:06 2002 +0000

    Added IDirectFBWindow::SetColorKeyIndex().
    Made IDirectFBWindow::SetColorKey() lookup the index if the format is indexed.
    Fixed warnings.
    
    Bumped version number to 0.9.16.

commit 21ba790dc6f73367fe783f2d3f27718833e7c4ca
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 22:06:05 2002 +0000

    No need to do DirectFBCreate(), just DirectFBInit() and fusion_init() ;)

commit c26660ce132bbab3bee21f1f2ded158d813bb7e9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 22:05:11 2002 +0000

    Made memory allocation messages a HEAVYDEBUGMSG.

commit 506c29cb1282ede678a634a968ae284baec73bc4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 19:56:48 2002 +0000

    Patch for using the whole 32MB of Matrox G400 etc.

commit 38b54fb58755215b1b2fc8edeb8944767644998a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 18:56:54 2002 +0000

    Divide squared alpha diff by 16 to have it less weighted in color decision.

commit d7e673e0d7376e0e648f9669d614da4417bbc24b
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Nov 14 15:34:24 2002 +0000

    a more reasonable algorithm to find a good color match

commit 9a9eee0672f48e1907abd3a6c596ed5a66f43ffa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 03:55:01 2002 +0000

    Don't do cursor magic if app is not running windowed.

commit 23e39aeeb8e09ecb14aba8f1c4e9608d94d0a592
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 03:48:29 2002 +0000

    Don't disable cursor on escape.

commit c28cbd1eb0dea7af5a45b46f96ce134035bac92f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 03:27:30 2002 +0000

    Pressing a button or a key while a windowed primary is focused
    disables the cursor to achieve a vmware-like grabbing for fullscreen
    apps running windowed that need raw mouse events (e.g. df_knuckles).
    The cursor is released (shown) if Meta is pressed.

commit 4a5ca7793b11fbcfafcc6706b8c393da8e7dd68f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 01:25:58 2002 +0000

    Added 640x400 mode.

commit cb69e068ea2d35648e411d23f44eaa23eee00491
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 01:19:41 2002 +0000

    Minor speed improvement.

commit ed07a3e324acdda11fc520de082354b82e527f8e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 00:56:32 2002 +0000

    Added 320x200 mode, fixed 320x240 mode.

commit d6825770eb79342043146f6728d0a3e9622a4566
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 14 00:28:42 2002 +0000

    Pre render glyphs before rendering string to avoid a rare deadlock.

commit 866ec65ff18265c23d0ff48ee74e3d7e22e63096
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 23:38:11 2002 +0000

    Added dfbsummon, a surface manager debugging monitor.

commit 0f7b274455becbde060a6f156f0b6ef22f35bcca
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 21:22:20 2002 +0000

    Added some layer palette/surface related TODOs.

commit 28833e44ed8fb1edf4c07ee516d56074f5d8ea6b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 21:13:45 2002 +0000

    Fixed layer palette updates in multi app core (a bit workaroundish).

commit f5e340a3ed06a34e794faea629a2ec277d837552
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 19:17:26 2002 +0000

    Commented out last change.

commit a9605c63212e7849d3bf13dd9fec5e2069d9b656
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 16:59:31 2002 +0000

    Correctly blit from LUT8 to LUT8 even if source and destination palette are
    different.

commit 6b1c7efe82d49ac4e683482c4b43af6b7b65db84
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 01:26:12 2002 +0000

    Added *.diff.

commit 0cf3aed594dec2a25bd7b43f9997bd0fbde7d71a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 13 00:21:06 2002 +0000

    regenerated

commit 90285f8243765ec87c8fb25ce08deb5f7e897ee2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 23:59:01 2002 +0000

    Added Fusion patch again, we don't need an extra tar ball for it.

commit 4c43eb2ebde39e8ac6b7bf55ed9d6b6ea7806e88
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 23:26:20 2002 +0000

    Good bye, ipc_cleanup, you've been a nice friend, but your time is over...

commit 75aafdf700bb206555a160e59c4d971ae29d24ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 23:23:23 2002 +0000

    Updated for 0.9.15.

commit 420f489edf9876d68a94f831953f434f9e40251a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 22:56:07 2002 +0000

    Moved description of Linux Fusion prior to how to build with multi app,
    because users maybe don't read further before doing that.

commit 35200ab40b90c9ef838907ede84e60dd0bbd60ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 22:46:31 2002 +0000

    Vsync fix from Ville Syrjala.

commit 46e4d1afbe4535331af9e2e51e69d2574c7c98db
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 22:19:29 2002 +0000

    Improved ioctl error handling (EINTR, EINVAL etc.).

commit f45d573f7a71592bf3724f6d6564f702c75f89be
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 21:19:55 2002 +0000

    Some bug fixes.

commit 6b4a455c176b3be912426f38b1927e45beecfe32
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 20:48:45 2002 +0000

    Rewrote FusionArena code using shmalloc and linked lists.
    
    No remaining bit of SysV IPC! There isn't even any SysV IPC header included.

commit ae6e3e9d4d125e2ff283660accb47aca7cb40b59
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 19:17:30 2002 +0000

    Fixed DLBM_TILE : DLBM_IMAGE order.

commit 44d52ca252ebb662ea5e589ca88f53ecd783cbdc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 18:50:54 2002 +0000

    Check layer->shared->stack before repainting.

commit 4c0c4366521d10c0af710512a2adccfeec34223d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Nov 12 15:11:16 2002 +0000

    Added --color option to dfbg.

commit 57a9fe8647ee28d49fdf292619a0474b570eb68c
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Nov 12 14:22:36 2002 +0000

    Added a man-page for dfbg.

commit 2f50cbf1a1714d961ffb38e80de006939efad064
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Nov 12 14:08:11 2002 +0000

    Added --tile command-line option to dfbg.

commit b326bf1dbc57cd286f2e62a8eac1a7c2dd45940e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 12 02:42:17 2002 +0000

    Added background configuration tool.
    
    Updated ipc_cleanup.

commit f240d3714138f220f03e6d00e5477b1a19ae7225
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 11 17:33:55 2002 +0000

    Updated vsync irq patch from Ville Syrjala.

commit 09cbc66c3e7e8610d263999cd1a1de3b2b1c96bb
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Nov 11 15:32:30 2002 +0000

    check prog != NULL before calling strlen() on it

commit 3fb48318ed7c8da924adcf84a9fde4d99d87a244
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 11 15:01:54 2002 +0000

    Made dfb_back_to_front_copy() thread safe as skirmish is now a recursive lock.

commit a95d4a3e8eab447bb2397a1d073b3e604f48ce6e
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Nov 11 15:00:29 2002 +0000

    Fixed some spelling errors and documented the new behaviour of 'no-hardware'.

commit 325293ec542a85884bf7e4c7f44856023c35bff3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 11 05:33:09 2002 +0000

    Use hardware key code for auto grabbing pressed keys (using the symbol
    was buggy because of modifiers being changed while a key is pressed).

commit 375631844924fa5395c6bfb25c9e5fe8fe201ef9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 11 05:16:41 2002 +0000

    Check return value of iopl() instead of segfaulting.

commit 3ac73664a0e7c5e76655ed8a8f39f885a7de3b4f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 11 03:58:51 2002 +0000

    Rewrote multi app reactor code, *much* simpler and cleaner now.
    Improved performance and stability. No message queues anymore.
    
    Old version via message queue:
    
    reactor attach/detach                 ->     8.03 k/sec
    reactor attach/detach (2nd)           ->   323.21 k/sec
    reactor dispatch                      ->   333.33 k/sec  (100% arrived)
    
    New version via Fusion Kernel Device:
    
    reactor attach/detach                 ->   375.09 k/sec
    reactor attach/detach (2nd)           ->   403.88 k/sec
    reactor dispatch                      ->   754.15 k/sec  (100% arrived)
    
    Now the master is the only DirectFB application with more than one
    additional thread.
    
    Only one single SysV IPC resource is left (shm segment of arena).
    Everything else is already handled by the Fusion Kernel Device.
    
    Support for multi app without kernel device is dropped.

commit eae999f9dc3e97489484c2eb145a8bb939f0f284
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 10 19:40:05 2002 +0000

    Don't block signals in DirectFB threads of slaves.

commit a89f93d02ea728e3ba4519afb88168823991d4f9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 9 01:20:19 2002 +0000

    df_dok related bugs are fixed.

commit 607229177b623f2ea434b190ce4de7096b9422f4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 9 01:18:15 2002 +0000

    32 was the old value, not 16.

commit b634e78a91ea36379e27e13648f8eb17ec5e7dc6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 8 23:15:23 2002 +0000

    If multiple arguments are passed,
    use the first one for output and others for input.

commit 188b5b4956edb2e6585e78bf3f3f398491418a44
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 8 22:57:08 2002 +0000

    Attach listener to glyph surfaces to have at least one listener attached.
    Set glyph surface size back to the old value (maxadvance * 32).

commit 2b70c8359757d7ee5bb7e29ffac7725aa4f980d4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 8 21:33:08 2002 +0000

    Fixed off-by-one bug in image loading code (multiplication by alpha).
    Fixes broken color keyed blits in df_dok.

commit c7c12eeef97a64551aa8c4916db361ec10020721
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 8 21:09:01 2002 +0000

    Fullscreen applications not calling SetVideoMode() and not setting the format in
    the surface description of the primary take care of the "pixelformat=" option.

commit d246298a82f99242fd0a20835678aaf6706406a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 8 20:16:20 2002 +0000

    Fullscreen applications that are started with the "mode=" option and don't
    call SetVideoMode() now switch to the mode specified with the option.

commit 1f4080147391a9f588b5a701b4c5ecd00bbe6d46
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 8 17:41:22 2002 +0000

    Implemented additional config file loading for each application.
    
    E.g. running "df_dok" or "/foo/bar/df_dok" will look for config files
    "/etc/directfbrc.df_dok" and "~/.directfbrc.df_dok".
    
    'no-hardware' now only disables acceleration, but driver is loaded and
    additional layers are used.

commit 0e3cd6173ea63e0a9e45934c0e31b8c4a76e4fdd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 7 23:41:34 2002 +0000

    Check for desc != NULL.

commit 872447f29a179f361489e3cc1a237d1e8c69ae33
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 7 22:17:24 2002 +0000

    Check for NULL.

commit 115efd890d566c1e01629aeb9acfa2a1440bf0c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 7 22:00:58 2002 +0000

    Added system hook ThreadInit() that is called at the beginning of new threads.
    The fbdev system detaches the thread from the controlling tty.
    Otherwise mode restoring done by input threads (if layer is orphaned) goes
    to the tty the app has been started from. The main thread has been detached
    eversince.

commit c30f9fa5a6b4d831fcdf354f1b0d32d4e8487cf9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 7 21:40:40 2002 +0000

    Fix deadlock during lease of orphaned layer.

commit 98beff28a9eb3a6cf77f0f4eabc9cb2914d19934
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 5 22:57:44 2002 +0000

    Show window of windowed fullscreen apps on first Flip.

commit 6423f0879866238b21eb0e3cded47b598c2f4fe0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 5 22:49:04 2002 +0000

    Commented out state locking in listeners to avoid a deadlock between
    state/reactor lock (locked in different order by two threads).

commit 7a964df9c394d8d90241ebf993a8e6cd7d7eed56
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 5 17:10:14 2002 +0000

    Interpret EINVAL like EIDRM in receiver.

commit 17260aea820fecff16159b2df560b68a08049cd0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 5 14:48:56 2002 +0000

    Made skirmish recursive mutex in single app core. Multi app skirmish
    has to be made recursive, too.

commit e19241a150340c1fc6c19d33e4a92cda25c28d12
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Nov 4 19:19:25 2002 +0000

    check if the window has a surface before trying to access its palette

commit c9c136115ce00f789bf74848f2528364aae6a1f2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 4 19:04:11 2002 +0000

    devfs support

commit 75b3fa0ccd7ec1f2b07762406317e6591b5c875d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 4 17:40:16 2002 +0000

    Added state locking to dfb_state_set_source/destination() and the installed
    listeners. References to the surfaces are now increased/decreased.
    More stable now, but had to use Unix98 recursive mutex.

commit 5f84191c2212d32feb8e414fa2a69ab8ac3b2eb5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 4 16:42:21 2002 +0000

    Use new in-kernel fusion property.

commit f2382dfb9c86c805c98def6f73aca9b648950700
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 2 05:20:21 2002 +0000

    dfb_surface_attach() was called too early.

commit decdaac99fda82242008b175f60db0c1f72dea34
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 2 01:44:40 2002 +0000

    Use Fusion Kernel Device.

commit b76ce0bb04ae3a79ae22e88bcf45b29d1d5ac66b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 1 23:06:35 2002 +0000

    Added DFBBoolean.
    
    DFBWindowEvent fields cx, cy, buttons, locks and modifiers
    are always set now (except for DWET_DESTROYED).
    
    API change
    ----------
    
    IDirectFB::CreateEventBuffer() no longer attaches input devices and doesn't
    take input capabilities.
    
    IDirectFB::CreateInputEventBuffer() implements the old behaviour with an
    additional argument "global". If global is DFB_FALSE events will only be
    delivered if this instance of IDirectFB has a focused primary (either running
    fullscreen or running in windowed mode with the window being focused).
    
    Version is 0.9.15 now.

commit 58dabf0cde6d5cef26e5e18dc31efb7bcecd27b2
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Nov 1 22:37:42 2002 +0000

    Don't write out of bounds if the default cursor is loaded into a non-ARGB
    surface (--dfb:no-translucent-windows).
    
    Switch the display layer palette to the one of the focused
    window. Added TODO item since this needs more changes.

commit 263b1549e5baccfa6ca6f4dcd7fa7bf2cf0a4999
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Nov 1 21:38:20 2002 +0000

    notify listeners about a palette change in dfb_surface_set_palette()

commit c024e49791e449a68ba291570993d8bb6921f022
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Nov 1 21:37:44 2002 +0000

    Use the size of the palette in dfb_palette_generate_rgb332_map() instead
    of assuming 256 entries.

commit 54d03df4f5000d31d01b1135b822cbf8604c6a1d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 1 17:26:09 2002 +0000

    Implemented implicit grabbing of keys when they are pressed.
    Subsequent events of this key are sent to the owner.
    Releasing a key ungrabs it. If a window is closed while grabbing a
    key, the window gets a pseudo release event. If fullscreen mode is
    entered all keys are flushed (ungrabbed sending release events).

commit b5b77ad5daf033e8afc32c5aa6da3fade4c305e0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 1 13:38:21 2002 +0000

    Added threaded skirmish benchmark.

commit fb1a3fae3aa6bc5e4f63eabae2088bb76c1159e4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 19:45:42 2002 +0000

    Number of reactor_dispatch() calls depends on single/multi app config.

commit 7f00497df6498388739fb5733d531d07fa97afc6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 19:40:01 2002 +0000

    oops

commit f81fa71a1c29a91a4b360bdf209189360b0b2d71
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 19:39:11 2002 +0000

    Added reactor_dispatch() benchmark.

commit 5634a44dd5f686e95cc4aeeaf037ca890cb806cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 19:17:14 2002 +0000

    Added reactor attach/detach benchmark.

commit 22e0df5bba69b00bc8aca3badb017d200cadbaea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 18:12:23 2002 +0000

    Forgot initialisation of waiting counter.

commit 8702a216f37bd91b0db2bba34621bb99355ae9f9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 17:57:23 2002 +0000

    Only call pthread_cond_broadcast() if someone is waiting.

commit bc7223328c94a52f302d2b9da17a9cc3a1e75ff0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 17:52:38 2002 +0000

    Added missing pthread_cond_init.

commit e2c4accb665b8b418999f7553ec2ee42961f7713
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 17:38:42 2002 +0000

    Added Fusion benchmark application.

commit d5a7f93d5c22680bd11aa839f33074d8e8a978b0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 30 14:25:24 2002 +0000

    Use stderr for the banner, like all other messages.

commit cac8cc70c0925b84539afcd6701caa2bdfe2ea6f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 29 18:39:31 2002 +0000

    Don't interpret negative ref count as a negative errno until ref counter
    bug is fixed.

commit cb125aeb7f14f3a6d4f7b8e528b67dcb4178a74b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 29 15:10:46 2002 +0000

    last commit before 0.9.14 release

commit ff4a9571567ba135ea37ab175dbbf9d717aa0ad8
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Oct 29 14:54:56 2002 +0000

    added a note about dfbdump

commit a6985f74f977fbee3b012a5f11c0d8bbd1672cc9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 29 14:41:18 2002 +0000

    updated

commit bee14a47b118b0683aa4a6c267dc13a0cbd719f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 29 14:40:45 2002 +0000

    Has an extra CVS module now.

commit f8f052ebf67f216bca5f99983a375bf7016896cc
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Oct 29 13:57:58 2002 +0000

    Added support for DFDESC_FIXEDADVANCE.

commit 3ac041050e8e7edabec80b042f3959f706528615
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 29 13:42:43 2002 +0000

    Added DFDESC_FIXEDADVANCE as a workaround for using proportional fonts fixed.
    
    Added DFFA_NONE.

commit 7743e4f9d1e5048677ff5e235c2411bd06afa230
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 19:50:21 2002 +0000

    Assure that glyphs with an empty bitmap are inserted into the glyph cache
    with zero width and height. Simplifies some checks performed when rendering.

commit c4c24b2fa8c940cdb2357110ac3c02d30f173bff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 19:28:48 2002 +0000

    Use larger glyph surfaces to reduce expensive switching
    (caused by reactor attach/detach).

commit 04c4d41e7f2865137ac09dee0d5f03a5685ae523
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 19:22:49 2002 +0000

    Use CoreThread with new type CTT_MESSAGING.

commit e38d92cb96684744b3c69e9abecb5d93d31f14dc
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 19:19:18 2002 +0000

    indentation

commit 7cd55fd06ea3e8f15e156455ecc7d9461e4209a8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 18:58:00 2002 +0000

    Check x too in simple pre clipping of dfb_gfxcard_drawstring().

commit 08f9ed3458ca32158a17e7b067018024495acb0d
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 18:27:04 2002 +0000

    Added a description of the builtin "window manager".

commit bcae600e798df938ed707c84238b19f24c91ac7d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 18:23:08 2002 +0000

    DFB_CFLAGS are behind CFLAGS again. Otherwise "-g -O2" may override the
    debugging/optimization options of DirectFB's configure script.

commit c7e6ec291924706f7ed314591cb0d4866b4d4e5d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 17:43:00 2002 +0000

    Multi app related.

commit 3b4a858beb388ee96a05e7987154a2e1ba3fe7ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 17:36:16 2002 +0000

    SetOpacity() for sub picture layer fix by Ville Syrjala <syrjala@sci.fi>.

commit 37f63b342a9097a61e08e3e9217587c7477150ba
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 28 17:22:21 2002 +0000

    - added OpenBSD to the list of supported operating systems

commit 29afc314c55bf34bbc097384249693c808a23ab7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 17:19:28 2002 +0000

    The linux-fusion module doesn't only give performance, but also more stability.

commit 9c03ef46e49da0fec24b0f496067da91f9d3bea9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 28 16:01:27 2002 +0000

    Fixed fusion_object_destroy() for calls outside the object destructor.

commit 1999736ad9e82c8701762e1716fc39b8ae2e0458
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 15:24:26 2002 +0000

    Added sdl.h to SOURCES.

commit 8c8b5823b00e9bd53d2ab1aec8d903542ee2ad7f
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 15:12:19 2002 +0000

    added more ifdefs around MMX and SSE code

commit 18b9e85a2e9d84fd900780c5260e140137ffa302
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 13:31:57 2002 +0000

    Updates.

commit 258b63376e4b5772f45e0ffd9b8f8428a5c92c97
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 13:20:41 2002 +0000

    Check if binutils support SSE assembly and compile the SSE code
    conditionally.

commit f003aa5a6ee0ebf9a6280d983cacc100f5580d4f
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 12:39:41 2002 +0000

    oops

commit 1c21bf783d340a7f83a9743cc10c80c9ae45b59a
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 12:35:53 2002 +0000

    Simplified the configure tests for MMX, fbdev and sdl.
    Set SDL_CFLAGS and SDL_LIBS using $SDL_CONFIG so that people can specify
    which sdl-config to use.
    Use SDL_CFLAGS and SDL_LIBS in the Makefile.

commit 3ae8eb618ea4cf5fbbf87e46cc1af8ba1815eaad
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 12:07:17 2002 +0000

    Corrected spelling of frame buffer.

commit a16602230461339fa699e365b4e4dc6677306a53
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 11:56:52 2002 +0000

    moved some lines around

commit c0fc87b3421f3edb0a56c21fc2bd6ab9bb23a257
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 11:32:27 2002 +0000

    Don't build MMX code if MMX was disabled by configure.

commit e265759961a68b279a082770bbf8a7821327fda0
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 11:13:24 2002 +0000

    Reformatted some comments; no changes.

commit e1a64a38820371f443ab8df8593bff476e63941e
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 11:03:20 2002 +0000

    Document the new pixelformat parameter in directfbrc.

commit 8976c0c9c472c650cc32c999e75c8b26994a658f
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Oct 28 10:37:59 2002 +0000

    Fixed obvious typo which caused --dfb:depth to fail.

commit 29a90abc9ded81ee43b2a0b566cf1145196f0508
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 18:17:16 2002 +0000

    Improvements to the spec file by Till Adam.

commit e57466f9f7b8bc1f8a3916b0687b8af2925dca59
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 16:56:26 2002 +0000

    Include the generated spec file in the tarball as well to make it
    possible to build RPMs directly from the tarball.

commit a951621daa198a0b3a3e994b03addcf9c2f054f6
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 13:19:44 2002 +0000

    code cleanup, no changes

commit 524ecb10f1bb0c2d0960acf15cedd8583ebf7b20
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 13:01:29 2002 +0000

    Explain how to use the multi-application core.

commit 972e1e3df8fa40b495e5f024672c52b9d50e39c9
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 11:18:22 2002 +0000

    Removed cflags_set hack from configure.in. We don't need it any longer
    since we don't touch CFLAGS.

commit 23179f711ba2a49249a85496037a540b1ec54ee2
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 11:12:00 2002 +0000

    Applied patches from Andreas Oberritter <obi@tuxbox.org>:
    
    Call libtoolize from autogen.sh since newer automake versions don't do
    this for us anymore.
    Use AM_CFLAGS instead of CFLAGS, which is a user variable.
    Check for C++ compiler in configure.

commit f517047ea3bbf6b70f02dac8a6743ebc93051019
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Oct 27 10:58:39 2002 +0000

    Added directfb.spec.in based on a spec file provided
    by Till Adam <till@adam-lilienthal.de>.

commit a8ae81b36e401fd22beab07fdd14a7b29b7dbee1
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 26 19:21:53 2002 +0000

    - dont use RTLD_GLOBAL if it is undefined (compilation fix for OpenBSD)

commit 60dc872a9ac579bcb794ddc7d1b0993c6f05beb2
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 26 19:15:58 2002 +0000

    - dont use RTLD_GLOBAL if it is undefined (compilation fix for OpenBSD)

commit 3351b0d9caaca1cdf5446da51c868766d361d38f
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 26 19:10:42 2002 +0000

    - fixed typo, mention OpenBSD
    - initial OpenBSD support (incomplete)

commit 28b8a259425b9ab1f8e278e72c24f4b84e3b2fc0
Author: Sven Neumann <neo@directfb.org>
Date:   Sat Oct 26 18:20:16 2002 +0000

    reformatted

commit 67081316cacf6b2ba70a3038ee6f7c159a42b07b
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 26 16:01:15 2002 +0000

    - added section on supported operating systems

commit 42ccf3f0defbbdffa7a0f48859fce5f5b02e0b3f
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 26 12:58:51 2002 +0000

    - NetBSD compile fix: only use ENOTSUP if it is defined (missing in NetBSD)

commit 4b253770636b4c1ee26434ec2ac8920d9d3e3c37
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 26 12:53:41 2002 +0000

    - added support for NetBSD (tested on NetBSD-1.6)

commit cef20e49dbb89402adcdea4ad219e36f6c1232bc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 25 17:14:55 2002 +0000

    The option "pixelformat=" does work with windowed fullscreen apps, too.
    If ARGB is specified, the window will be alpha blended.

commit 2e3ef3019acdcea1fa3798cb732eb3b6851ef8de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 25 16:30:04 2002 +0000

    Windowed fullscreen apps can now be given a window size via the mode= option.

commit 1a6fb8b5e2bf280805986de654d637e4ed0c6e8a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 25 14:51:53 2002 +0000

    Whuuuhuuu, Cyber Pro DirectFB driver release in 0.9.14 ;)

commit 55daa6697a2c11d83e4b9db00e12a0d692c3cd70
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 25 14:25:01 2002 +0000

    Moved all static variables into instance struct to make GIF loader thread safe.

commit 21cd89150883ecef5096503e034be0692286a9c8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 25 13:52:14 2002 +0000

    Fixed evil bug: wrong parameter order to qsort resulted in unsorted color
    map in FindColorKey. Fixes color keying of a very few GIFs.

commit bc722f3b1d4756c8e1af6d0211555a14e7376c9b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 25 13:12:56 2002 +0000

    Applied patch from Johannes Stezenbach <js@convergence.de> fixing some keys.

commit 97693660e424e0fe94b97178ba30f5d2fc553f18
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Oct 24 11:32:30 2002 +0000

    improved README

commit 21efc94ad9c3f112d0e5f96043324a6650d3392f
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 16:59:30 2002 +0000

    updates

commit ddd9be0ad6762aaf5e4825aab77b1d238c1f3ae3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 23 16:00:18 2002 +0000

    Use thread functions for bone collector loop.
    Added thread type CTT_CLEANUP with priority -15.

commit 43afcb8e384b3f9b32ef5893842e22f92c8f0ed0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 23 15:59:30 2002 +0000

    Update from Ville, return -EFAULT if argument is not a valid pointer.

commit 273424f5ccd7110bf537a126b3a7018f94b74fae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 23 15:58:22 2002 +0000

    YUV 4:2:0 chroma plane setup fix from Ville Syrjala <syrjala@sci.fi>.

commit c27a0f5888137aee0f9ad608811a99cb8e8d9686
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 23 15:23:38 2002 +0000

    Use 0x20000000 instead of 0x70000000 as the shared memory base address
    to avoid collision with stack on MIPS.

commit 67c32e53e6dad75b18206f86b4b894b4fab6d2c2
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 14:56:19 2002 +0000

    Reverted my changes regarding the primary surface for NORMAL mode.
    The old behaviour made more sense actually.

commit 353101270b380302f63ad0feae474b4bab9388de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 23 13:12:17 2002 +0000

    Changed WM keys a bit:
    A (abandon)  - lower focused window to bottom
    S (show)     - raise focused window to top
    X (eXchange) - cycle through windows (not having DWOP_KEEP_STACKING set).

commit e24814f174308e07a3c989eac48cbbacd8e6f8f2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 23 12:49:59 2002 +0000

    Don't try to destroy dead reference.
    Default to graphics-vt only if vt-switch is disabled.

commit b80ffa4425abf25a669e5485da28881c2e4c91e5
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 12:14:18 2002 +0000

    Defined THREADFLAGS=-D_REENTRANT and added it to the cflags given by
    pkg-config and directfb-config.

commit 983de2c37dbc97fcfa49c9f3dd35ced97d97f2d5
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 11:10:50 2002 +0000

    some cleanup

commit 3fc31acf47a714fa30971a362a19307e3acf1102
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 10:55:54 2002 +0000

    beautified configure output

commit 8ab677b03021b1bd283b13c0f967ae0959da54a8
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 10:02:41 2002 +0000

    Creating a primary surface in normal mode will now result in a fullscreen
    window with options set to KEEP_POSITION, KEEP_SIZE and INDESTRUCTIBLE
    which is probably what people expect.

commit edd7eba3955e6565ec65a74aa647ed758c2d0dfc
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 23 09:50:04 2002 +0000

    Initialize the primary width, height and bpp from the primary layer
    instead of using some arbitrary values. Ignore width and height from
    the surface description when creating a primary surface in NORMAL mode
    since we do that for the other modes as well.

commit 157efe371863ede34d0e8bc78525487efa158be5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 21:56:35 2002 +0000

    Windows can now be cycled via WM-S (to front, focus).
    Pressing WM-X puts the focused window to the back.

commit 0d638b263d576dc119830123d2ac0bdc4af52fab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 20:33:20 2002 +0000

    Null pad opacity.

commit 280be9e01d5f314c6f978d03e5cf9e6b69cc1a57
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 20:29:07 2002 +0000

    Added "[no]capslock-meta" enabling mapping of CapsLock to Meta on keymap level.

commit 67faba53f021b270eef1d677d1b4e66534299112
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 19:54:03 2002 +0000

    Ensure a focused window in dfb_window_set_opacity() only if window disappeared.

commit aa9d20bd77e2832431d98b0f2cff0b2776be6522
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 19:48:12 2002 +0000

    Use base level symbol if shift level symbol is null.
    Fixed debug message new lines.

commit 9dddaa6153e64d1250345b73894b19eec089073a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 17:36:05 2002 +0000

    Add "0" argument to vsync ioctl.

commit 2ecb93bb3e9f1c06313a08dee8738b6d86a01ce9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 17:31:33 2002 +0000

    Don't detach bg image listener manually, keep the reaction in local memory.

commit d803ac00b111179d85e774c9aabb7c800b7b9deb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 16:34:37 2002 +0000

    Fixed crash when a foreign reaction is removed.
    Foreign reactions are now disabled during detach, but removed during
    the foreigners reaction loop.
    Relase background image surface after setting it.

commit 073787201ff1a9311f8012e2e8241e19e4574a17
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 16:08:37 2002 +0000

    Accidently committed signal change in DFB_ASSERT.

commit dcecf047f713bb23ee1c79f94fddc768fe46cf97
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Oct 22 16:07:09 2002 +0000

    some updated to the NEWS file

commit c83a20bf14a2837301d4bb14a1da76a67e8fecc8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 16:00:12 2002 +0000

    Reverted change that seems to break mode switching if started via suid root
    from console.

commit b82fd384bb6614f59e0b3888d57d92b5d1196e2a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 15:56:04 2002 +0000

    Use LUT8 if depth is 8 (e.g. default mode or SetVideoMode()).

commit 86cecb5e6e638cf5267d055583532b0c446bff21
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 22 15:34:45 2002 +0000

    New vsync irq patch from Ville Syrjala <syrjala@sci.fi> with support for
    the second head.

commit 5de8f80d3a8bf20cfcf778900545c2477b11d4a0
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 22 15:21:25 2002 +0000

    enable RGB332 support by default.

commit cc92d4fd013877198e30867c2f2fc3a03ee9464e
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Oct 22 15:12:33 2002 +0000

    minor code cleanup

commit 50aa6a28f8e3a6287a4363c23bdc97791f509539
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 22 15:08:18 2002 +0000

    declare ModuleDirectory as extern to fix linking problems on darwin

commit c7528e751c171aa5631cedbaffe1a560476d599d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Oct 22 14:37:26 2002 +0000

    Fixed --dfb-help output.
    Documented the directfbrc parameter matrox-tv-standard.

commit da118317b4ebd1a45ac6d25c9faf1601ba6ec395
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 22 14:22:53 2002 +0000

    - fixes for automake 1.6x on non-linux platforms

commit dbc5d38f0c1c1c668221d7c32076a02bc01aed3e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 21 19:37:54 2002 +0000

    Use graphics-vt by default.
    Use no-vt-switch by default if started without root privileges.
    Open mouse device O_EXCL.
    DirectFB now works while gpm is still running.

commit af51d4a6c01a7b84b08580029c19a5b70827e67e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 21 18:31:16 2002 +0000

    Fixed crash in debug mode after shutdown.

commit cd6a7c3b69ec4481942d516599ccd52ce42a9a2c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 21 15:57:15 2002 +0000

    Fixed memory corruption caused by a too early free.
    Really use fusion_get_millis() now for debug output.

commit bdf40ade4c6245239c5f26eba72adf126032819d
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Oct 20 13:11:22 2002 +0000

    - applied patch by Till Adam <till@adam-lilienthal.de> which fixes build
      on MDK9.
    
    (This also fixes problems with autoconf-2.53 and 2.54)

commit 0064f922863ee6f0371581807ffb55a2048c5d5f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 18 19:27:20 2002 +0000

    Fixed segfault in IDirectFBSurface_Window_Flip() if window is destroyed
    before its surface.
    Removed unnecessary fusion_ref_zero_lock() in reactor_free().

commit e609a4b877308b57729d7418546cb16e8ab19117
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 18 17:34:03 2002 +0000

    For a windowed primary surface, accept setting of width and height in the
    surface description as a second way to set the size (first is SetVideoMode).

commit c68333c1e784b3255b85e844db15be81773006d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 18 15:49:09 2002 +0000

    Assertion message shows pid and milli seconds now.
    
    Added more safety and debug output to window destruction code.
    
    Added fusion_get_millis(), debug messages of all fusionees
    have a synchronized milli second counter now.
    
    Added some safety and assertions to reactor code.

commit 5e61fc4a42ed3e606af86c20d8bb477e2b8c35fd
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Oct 17 08:55:54 2002 +0000

    Set the button mask in DWET_MOTION events.

commit 0291fdc6a92cd8ae54cdda6dfbaf2c1f2d4d9c90
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 16 12:48:22 2002 +0000

    Added quick guide.

commit bb60470edc0519ca071aad8928bab7cdbec7245c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 16 12:43:09 2002 +0000

    Added experimental kernel device for a much better implementation of
    the fusion concepts. For now FusionRef is implemented in kernel space.
    The old implementation using semaphores doesn't work properly because
    undo counters are hold per process id. But the reference should be valid
    for all threads (processes with the same fusion id).
    
    You have to apply the patch to test it, configure checks for linux/fusion.h
    and uses the old implementation if the header isn't found.
    
    The patch is here for quick testing. Will add a new cvs module with all
    new files directly checked in and a patch for the modified.
    
    The new implementation should be even faster as there is only one system
    call per fusion_ref_* user space library call.
    
    The undo stuff is working as supposed now (per fusion id),
    but fusion_ref_zero_lock() is not implemented in kernel space yet.

commit 5da2f4330b9fd8e8795d974c12f150c5fa656639
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 16 11:43:09 2002 +0000

    No inlines if debug is enabled.

commit 9737b15b1e871f2c6df87cddf0b53b757e46bd6f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 15 21:05:36 2002 +0000

    Better error handling.

commit 92baa32be41ec4cc7348a71778b6b0254be156fb
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 15 19:42:59 2002 +0000

    include missing signal.h, fixes compilation on freebsd 4.7

commit 82b18f908609d7c80a44bd8f5865ad19768d7e88
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 15 18:30:54 2002 +0000

    Fixed blocking in fusion_ref_down() if reference counter is already zero.
    Prints an error message and returns FUSION_BUG now.
    
    Improved debug and error output.

commit bf9351e5f3c05178562c2253938fd2fb7dabe729
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 15 16:55:18 2002 +0000

    Added magic value for debugging memory corruption related stuff.

commit 50ee35079a508d3e7c34a6cb711c26db65d00df1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 14 20:49:28 2002 +0000

    Decode first picture only.

commit 4387733d8fb6b4eec8dfd76bddbc2dfa73c6bcc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 14 18:57:34 2002 +0000

    Moved all global variables into instance struct.
    Removed some more unneeded stuff, got MPEG2 code < 5000 lines of code.

commit 5aae3239b2c5f6b0a7b1dc88be1b19e807e5ccab
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 12 17:19:06 2002 +0000

    added filter for incoming events, much smoother now

commit bd126091806f94ff89e838a8d5cd553590b82f71
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 12 15:17:05 2002 +0000

    added driver for ucb1x00 based touchscreens (used in the "tuxscreen"
    device).
    
    TODO:
      - do not hardcode touchscreen config (read from config file)
      - filter incoming events, there is too much noise

commit 8d9fa5242bc5de866b9ae1d09686b113d7cdc764
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 11 18:36:10 2002 +0000

    Added prefix to all non-static methods.

commit 3f5ee601c25bdbb1f32175f330f28d0669c54c3b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 11 17:49:51 2002 +0000

    Fix crash due to static variables.

commit a6b7a26447917aac963215c0b9a42732822cceaf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 11 16:02:53 2002 +0000

    Added MPEG2 I-Frame image provider derived from mpeg2decode (mpeg.org).
    
    Need to move global variables into instance struct.

commit 5ab7e6ca2f9cfcd5f094aef528f07ad027ba69dd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 11 16:00:35 2002 +0000

    Fixed keyboard handler for screen dump and sending SIGINT.
    Fixed debug messages (newline).

commit a80459a3e0b3d46bf14802dac661bd61569baf5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 11 15:59:09 2002 +0000

    Added simple test if flipping (updating) a window is necessary.

commit b44edec5e5ab6ea4aead2e2f5ea87837ace8b1e1
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Oct 11 01:38:59 2002 +0000

    updated driver to compile again

commit 80670ec105ccae04ee6e88a7dc8cd8cd5c85ca8f
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Oct 10 16:27:27 2002 +0000

    if the video mode was tested/set successfully, check if there is enough
    video ram (this is for broken framebuffer drivers). maked DirectFB work of tuxscreen.

commit 617ca157470464dcad0290a6fdfaa367cbe4d963
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 10 16:01:30 2002 +0000

    A '|' too much.

commit 12c8b2b46330d958f11c6e5fad8e82996ffcf88f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 10 16:00:39 2002 +0000

    Fixed system back buffer fallback.

commit ab21f925b728c4ef8db05782c75f283f17cad5f2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 10 13:40:15 2002 +0000

    Minor change in focus handling. Leaving a window unfocuses it.

commit 48b3b54cd5df4eb25a7ea74621e67ae4e034ce25
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 9 19:32:42 2002 +0000

    Return NULL in window_at_pointer() if cursor is disabled
    reulting in the top most window getting focus.

commit 633f508e9b1f72b102fce6a91c6f84a18de36d78
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 9 18:28:47 2002 +0000

    Added -lm to the linker flags for libpng.
    Don't install dfbdump.

commit b5071efa0f26623825e06ffb87678c4817c128e6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 9 17:22:38 2002 +0000

    Fixed RequestFocus.
    Added window opacity to dfbdump output.

commit dc65bfd87a3b23507e99e1bd15472d1c1e378529
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Oct 9 13:09:16 2002 +0000

    fixed typo in a comment

commit 21dc6579b799ff1f38759b0a5fb7327dbbd99d1f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 8 19:38:38 2002 +0000

    Invisible windows are not allowed to request the focus.

commit ae00cfa7b389194cf0d523096dd89d3555f6a0a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 8 17:38:49 2002 +0000

    fixed bug message

commit d268c462861674375caeb42ec4221617ec8ce050
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 8 16:09:32 2002 +0000

    removed debug line

commit 0261a9e78bb8dcf406a3fbaf05fcfaed6adcb6fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 8 16:02:03 2002 +0000

    Fixed joining, got broken an hour ago.
    Added assertions.
    Lock/unlock fix in arena code.

commit 41b7ab030a33b163f4cca24ccf69ba4fec9df8ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 8 15:02:49 2002 +0000

    same for single app

commit 0b1f25c4e1095de06a48fc65e7a223baed526344
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 8 15:00:21 2002 +0000

    Better error handling in init code.

commit ee0cb85b717770d68e8b2dc18d4ab2d201835308
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 2 19:37:23 2002 +0000

    Moved layer config stuff from IDirectFBDisplayLayer_Construct to IDirectFB.

commit d7f6738c5f4f18ac58b6edfe8fa380023104c34e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 2 18:37:15 2002 +0000

    Cleanup of DirectFBCreate.

commit a67bf6c0af13261e28361dd104270fe0c5e71569
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 2 17:42:03 2002 +0000

    Speed up reactor_attach/detach by writing reaction information to a
    provided memory location which is also passed to reactor_detach.
    Check depth specified in the configuration.

commit 286d23436e30c0f489dfb5aa51b84ac0a3b498fb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 2 14:48:22 2002 +0000

    Don't detach reactor threads.

commit ce761a54fc883f879bde627e5fa99bb56dbc62c7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 30 17:09:10 2002 +0000

    arg, ref/unref typo

commit 7c0901730957d2bdc8c3a0b63a5806f19e87de65
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 18:31:15 2002 +0000

    Event buffers created by "IDirectFB::CreateEventBuffer" will discard raw input
    events until the application is fullscreen or has a focused window (primary).
    Buffers that always get input events can be created via IDirectFBInputDevice.

commit ab05499e6350551acf23245f93a56101d648a56d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 17:23:54 2002 +0000

    oops

commit 925b248798fa7627ee278033710b078b9d0a6f61
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 17:02:21 2002 +0000

    Removed more unused stuff.

commit bcc7c4c604663ec248a43d9502f5581b818d392d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 16:50:21 2002 +0000

    minor optimization

commit ff53e701d4fe411f5346e9d89567f35ce2cc092e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 15:52:49 2002 +0000

    Fixed copy'n'paste error.
    Don't print error message if opening /proc/... failed.

commit aa0037716dbe73b529afce119f3fba732cc09165
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 14:16:27 2002 +0000

    Fixed MMX test.

commit d2ff259de54af8f675fc0459b8c0267ff475da29
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 14:15:02 2002 +0000

    minor fix

commit a3437ed8163af1d42278896800f6f039b4a25265
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 13:54:43 2002 +0000

    Assembler routines converted to inline assembler,
    thanks to Johannes Stezenbach <js@convergence.de>.

commit 12013430c0a1b9ea8f8389af1b7a124f00cde2ec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 12:51:04 2002 +0000

    Added Billy Biggs <vektor@dumbterm.net>.

commit 444e10319e0a456a2e26bb478632cede3a679c61
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 12:50:50 2002 +0000

    Applied patch from Billy Biggs <vektor@dumbterm.net> adding
    IDirectFBDisplayLayer::GetCurrentOutputField(), experimental and may change.

commit b05256f758d208a246c04e4783689b45fa92a67a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 27 12:37:45 2002 +0000

    Destroy windows only in IDIrectFBWindow::Destroy(), do unref otherwise.

commit 1d003c191c32b7444af01724ad6dce8adf6bbb8a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 26 16:25:14 2002 +0000

    Use new module handling for core systems.
    Added fusion_ref_stat() for debugging.
    dfbdump now displays the number of references in front.

commit c755b5b071e46d2170b0297542db96f891bf1692
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 25 14:54:39 2002 +0000

    Fixed multi app build.

commit 2bca0eca6df894ed0738fd848ff9feb7e623a22b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 25 11:18:42 2002 +0000

    Graphics drivers are handled via new module functions now.
    Removed obsolete abi version stuff from graphics and input code.

commit 6cd3eff8809dbb17f9b84c75cccca3c77b85a313
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 25 10:21:16 2002 +0000

    Added the ability to change a window's opacity by holding Alt while holding
    CapsLock or Meta moving the cursor on the x axis (for wheel less mice).

commit 764a9d32fc1308f5be2ac6ca13c775921e664cb8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 24 17:38:02 2002 +0000

    Added another assertion.

commit 0115d9cd04d3ad572063a82570a6ac3a4118d09b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 24 17:35:21 2002 +0000

    Added new module management functions featuring module references/unloading.
    Input driver modules are already handled this way.

commit 96a06c05c51ac94ccc4420461c0d4602ed112d46
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 23 15:22:21 2002 +0000

    Implemented Bop_a8_Kto_Aop, Bop_a8_SKto_Aop, Sop_a8_Kto_Dacc, Sop_a8_SKto_Dacc and Sacc_to_Aop_a8.

commit 5d09bfa1218a4834624f91aba72ad74fd32923c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 23 14:57:11 2002 +0000

    Add "-ldl" and "-lpthread" or "-lc_r" conditionally.

commit a0abdc42925f10673c191765bb76f69e9970ef26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 23 13:58:09 2002 +0000

    Updated static build script including support for sdl.
    Uses pkg-config now to determine prefix and module directory.

commit 57cffccd07db9f49b755a389f86839b94c4a6852
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 23 12:48:24 2002 +0000

    Added required quotes for test in case CFLAGS have been set.

commit f55e050dad82d7f20c46ff3b56168c4b53824f74
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Sep 23 11:47:55 2002 +0000

    icheck for target host type before libdl and pthreads

commit dc4e00d3462a9a33d500c5684c8413781677a860
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Sep 23 11:42:01 2002 +0000

    do not check for libdl on freebsd, check for phreads in libc_r on freebsd.

commit d6894a2b896630203468087a2b98baaef5bc676e
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Sep 21 22:12:43 2002 +0000

    FreeBSD sync: include <sys/param.h> before <sys/user.h>

commit b4ee07d00c228782a402791aa2766029cfb39378
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Sep 16 22:51:46 2002 +0000

    only include asm/page.h on linux

commit 08df666a07b796ec5a3b29a5e22963f5eda4bf87
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Sep 16 22:35:32 2002 +0000

    do not build arena.c fusion.c lock.c util.c and fusion_shmalloc.c when
    compiling without single application core

commit a3cb2a8364949d437e326659acd8ca28b80ce5ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 13 14:26:18 2002 +0000

    Fixed flag definitions.

commit 520ded2cd03d47f5c174730f679839f47a7a8b08
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Sep 11 23:54:23 2002 +0000

    build tools on non-linux platforms. do not use <asm/byteorder.h> in raw32toraw24.c

commit 9778c03696eae28a3023634f1ec8a868532a6889
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Sep 11 23:29:51 2002 +0000

    include <sys/types.h> because darwins <sys/mman.h> depends on it and doesnt include it by itself...

commit 2d1242ef5fbac23888819deb83d59670f61b56d2
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Sep 11 23:26:15 2002 +0000

    - added extern to declaration of dfb_memcpy() to avoid problems with
      non-gnu linkers.
    - only include <asm/page.h> on linux, guess PAGE_SIZE = 4096 on other platforms
      (bad)
    - only define MIN and MAX when undefined (fixes problem on darwin)

commit a3e333635ec5288e50730f8cd52b735e695a4a4b
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Sep 11 23:14:59 2002 +0000

    only build gfxdrivers, tools, inputdrivers and v4l provider on linux

commit 09d0632730c73e25b8d439e9e92005adfd42107a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 11 15:58:05 2002 +0000

    Avoid naming conflict of log2 with tgmath.

commit c7be5e5e9e0353d74801dfd3a20a654b5ba5f15c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 11 13:08:32 2002 +0000

    updated

commit 1af2113e9e73a05d6c0b5335c92c1a3818541c32
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 11 12:39:16 2002 +0000

    Color hash is multi app ready now, palette seems broken though.

commit a64ab7f3a8176a2d78bac873076ba172e48eb561
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 11 11:05:47 2002 +0000

    Force window creation without alpha channel if "no-translucent-windows" option
    is used.

commit 61dded44f448fc905496631e591b4750cc0ce55c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 11 10:47:07 2002 +0000

    Added debugging tool dumping information about existing windows and surfaces.

commit 35886fb6038458ce6a3bcccdbfc0ed064d351c98
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 11 10:29:37 2002 +0000

    Send CSNF_SIZEFORMAT notification.

commit 40cbab080dc1cdc82a271d98e5c6e8ea77295cb0
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Sep 10 23:37:54 2002 +0000

    use AC_C_BIGENDIAN (AFAIK even works when cross-compiling with automake2.53)
    no longer include <endian.h> which seems to be linux specific,
    use #ifdef WORDS_BIGENDIAN instead of #if __BYTE_ORDER == __BIG_ENDIAN

commit 3a8011e9fa9d7c67952598fc06218da178a89def
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Sep 10 21:47:33 2002 +0000

    oops

commit 919cdb0e376407c0a4961bbf4d50a91c1fde5a85
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Sep 10 21:42:03 2002 +0000

    do not include <asm/types.h> directly. added dfb_types.h which includes <asm/types.h> on linux and <sys/types.h> on other platforms

commit 96fda3c1457333c488030c69f399852233832ebd
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Sep 10 20:31:35 2002 +0000

    added AC_CANONICAL_HOST and AC_CANONICAL_TARGET to avoid this problem with libtool on darwin
    
    ltconfig: you must specify a host type if you use `--no-verify'
    Try `ltconfig --help' for more information.
    configure: error: libtool configure failed

commit 3a41798d38f2c7ae0802ba49e522a774925e7e6a
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Sep 10 18:18:13 2002 +0000

    s/dfb_fbdev_wait_vsync/dfb_system_wait_vsync/
    Include <linux/fb.h> in order to get FB_ACCEL_* defines.

commit 96bf6f9ca3f3dc3dbb460409263ab1f60ad8b691
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Sep 10 16:35:53 2002 +0000

    no longer include malloc.h
    (sync from my OSX tree)

commit bcc976d9e6b01c6ceeea8ad81396d0cbfc5ef1a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 10 16:14:25 2002 +0000

    Use high priority for video threads, detach from surface correctly.

commit a736f041db97604f9d0a7b87d7ef485fdefd3f38
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Sep 10 15:41:13 2002 +0000

    support for building DirectFB without fbdev support. (first sync from my OSX tree)

commit f710f1c66046b74292b9deccb17f5ea9dc711d9b
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Sep 10 15:22:30 2002 +0000

    Assign new width, height and format before checking if a reallocation
    is necessary in dfb_surface_reformat().

commit 8bf89978ba0f5d06aadafad5f56c2e6cb26e52e4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 10 14:50:39 2002 +0000

    Finished key translation.

commit b2173c135469c60fb0bde12851ff2f274220221d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 10 12:51:56 2002 +0000

    Two 0.9.14 TODOs.

commit e331cf4233bb67c7176a36e12ff4286d95fd94ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 17:30:04 2002 +0000

    color hash for multi app is broken

commit 67ec8a0a4c7bce83d3457d09bf54ce37efcf493e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 17:01:23 2002 +0000

    minor clarification

commit 3e1bd82ffd032c2ecc02e633f08732f129bccb92
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 17:00:06 2002 +0000

    update

commit e72de04277ef69d5b3ff1570e8989db15edde11e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 16:43:33 2002 +0000

    updated

commit 638246a87dffcfe28714998de7072f198a5b3826
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 16:25:15 2002 +0000

    debug output adjusted

commit 9c2968f24bd1c13124bc82b93ac723e0e4b33bab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 16:15:08 2002 +0000

    Added orphan detection to FusionProperty.
    
    The window stack and video mode are now restored even if a fullscreen
    application simply exits or gets killed by any signal.

commit afeddd49f3de304f18dac8f7329c9196ae614e9e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 14:26:50 2002 +0000

    Added function for retrieving the window pool from a layer.

commit 922bdddf1329438b7ce364b91e4838d44d3ff697
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 14:02:04 2002 +0000

    Added fusion_object_pool_enum() for enumeration of all objects.

commit 6e61a6d7145d77e4351ae2201b8d09050afa7e2d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 11:30:56 2002 +0000

    Now half line, not half texture ;)

commit 218e7d9bf46545b95592b928fa34a0ef2f177872
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 9 11:21:28 2002 +0000

    Half line adjustment for deinterlace blits.

commit c6fcfb79e8959db86c4a4525efeddaba6e805521
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 6 17:25:54 2002 +0000

    Fixed CreateWindow with DWDESC_SURFACE_CAPS.

commit d5a1b39097f4c4a0c37a4a4967c2ef46aae9824b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 17:41:11 2002 +0000

    Made black RGB332 entry transparent for testing.

commit e72f93259400b7d15c43ea3d075bbc56e51f476c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 17:29:08 2002 +0000

    Reexported "dfb_fbdev" as a hot fix to have the Matrox driver compile again.

commit 770d2be4f271e94721e4ad74589f53b479b2a9f4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 17:00:38 2002 +0000

    Changed LED behaviour.

commit 6790cbb35db0b4e4959c7e1de861a09aa2e5caa4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 15:55:59 2002 +0000

    Added Meta (or Windows) key to wm hack.

commit e7a587a7c2dc46af3a8d251a589e15cb35e3dd4c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 15:52:40 2002 +0000

    Don't generate RGB332 entries if palette already existed.
    Generate RGB332 entries after creation of layer palettes.

commit bea25135f76724ebab6c97401dc5e663bf510327
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 13:12:11 2002 +0000

    Added IDirectFB::CreatePalette().
    Added IDirectFBSurface::SetPalette().
    Added IDirectFBPalette::GetCapabilities().
    Added IDirectFBPalette::CreateCopy().

commit 464d69698dc88a05f75d7795bb8e081764e9a07d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 12:07:41 2002 +0000

    Fixed warning in "layers.c".
    Small fix in SDL input driver.

commit ca19ddcf64082a77de4ad79b95848fa93ce40694
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 11:54:46 2002 +0000

    Fixed summary (SDL support yes/no).

commit 85046c9a5fa5cee34f65e7bf1af40312a0546ae1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 11:48:03 2002 +0000

    Another patch from Ville Syrjala <syrjala@sci.fi> adding planar YUV blitting.
    
    - DoBlit2D_Old(), DoBlit2d and DoBlitTMU() initiate the blits
    - The are called from Blit2D_Old(), Blit2D() and BlitTMU().
    - StretchBlit() and Blit3D() simply call BlitTMU() with proper arguments.
    - Clipping registers are updated for chroma planes also.
    - Register programming is not done in validate_source() or
    validate_Source() anymore. All source related programming is done from the
    blit functions.
    - I changed the code for all cards. Only tested on G400 as I've misplaced
    my G200 smewhere and I don't own any other cards.
    
    Added him to "helping developers" in AUTHORS.

commit 049818eeb139dd3be40004d9ef8ac2bc841a79f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 5 11:36:22 2002 +0000

    Second head support via additional layers by Ville Syrjala <syrjala@sci.fi>.
    New option "matrox-crtc2" to activate this.

commit 9d2818c7e55378becc82458963d4bd7fa9073e35
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 4 16:12:32 2002 +0000

    This patch from Ville Syrjala <syrjala@sci.fi> adds YUV rectangle filling
    support for planar and non-planar formats.

commit 0d92ecb0e0981497266c5061fdca6fd48325fa05
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 4 16:03:57 2002 +0000

    Millenium -> Millennium (thanks to Ville Syrjala <syrjala@sci.fi>).

commit dd9e7f1be8c679261ac82432385a37265b8f5bdd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 4 16:01:17 2002 +0000

    Added Matrox CLUT as a todo item.
    Set DSCAPS_INTERLACED in the surface description of the v4l provider.

commit ed5a3c19fc16ffff7bf2ab437d07e375d1656ffd
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Sep 3 11:37:19 2002 +0000

    Document the new system parameter.

commit 80bdc5efafe2112b63cba1986dd3e976a443e7a4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 30 19:12:12 2002 +0000

    Fixed crash with debug mode (with linked in modules).
    Fixed multi app core system init.

commit f91075b320fa153ab2c36fe542ce19a051fd3dac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 30 17:49:58 2002 +0000

    Started abstraction of the "core system" featuring the "fbdev" system like before
    and a new experimental "sdl" system. Yepp, DirectFB running on SDL.
    
    Use "--dfb:system=sdl" to run applications under X.

commit 185253fa0ad89db0a22e48399dfcfeb32f8e332e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 30 11:55:58 2002 +0000

    Fixed driver, compiles again.

commit a8c23dc40331d408849a3cb7cd963e49d94d0bfa
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 29 00:45:09 2002 +0000

    Removed a spurious space that broke the build.

commit 7bad83c881a1031968398c6df4c73d0796ab3b9f
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Aug 28 21:34:58 2002 +0000

    - fix for big endian hosts, driver should work now
    - wait for 4 instead of 3 fifo slots for line drawing ( this fixes crashing
      of df_dok on my Geforce 2MX

commit cb4da84f482cc299b913e12dc700cefc77070907
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 27 17:41:18 2002 +0000

    Outlined some inlines.

commit 5ab3a02ac4447f3adb354c005ba8d91aa0c3a3a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 27 17:23:30 2002 +0000

    Added missing call to colorhash_detach().

commit a95aee429967f857320ebf3e1e7a1fa1df915e40
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 27 14:03:26 2002 +0000

    Added IDirectFBSurface::SetSrcColorKeyIndex() and SetDstColorKeyIndex().
    
    Added LUT8 and RGB332 acceleration to NeoMagic driver (now version 0.3).
    
    Added referencing of the window to IDirectFBSurface_Window implementation.
    
    Increased version number to 0.9.14.

commit f91bc0287a4d1ce34a21386b3fad74be840c42e7
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Aug 26 22:28:30 2002 +0000

    Call 'libtoolize --version' instead of libtool.

commit 79387cf9eb15a0a75c956cc68257ea323c819919
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 26 19:21:01 2002 +0000

    DSCAPS_SEPERATED -> DSCAPS_SEPARATED

commit fae6fe5a85ec5f1ecfdd10287bba2c31bebdc140
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 26 17:47:24 2002 +0000

    Use DSBLIT_DEINTERLACE if window surface has DSCAPS_INTERLACED.

commit 3594fdfd39c7cd05412fb2cfec8d2869975602fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 26 17:44:55 2002 +0000

    Added experimental blitting flag DSBLIT_DEINTERLACE and implemented it in
    the Matrox driver, not tested yet.

commit 70af58bfedcc544f3bc7cf0cbd283b85860831a7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 26 17:13:17 2002 +0000

    Added CSNF_FIELD as a notification causing the 'source modified' bit to be set.

commit 24b6def8cb65fdae3bb486dd9e79a736454bb267
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 26 15:42:39 2002 +0000

    minor update

commit 393bf59b86600d972e4eab00946d023a78b351ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 18:26:45 2002 +0000

    removed field switching todo

commit 15d62cd593c9424aca239e01d7e956fc70db0baf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 18:26:14 2002 +0000

    Added IDirectFBSurface::SetField() which enables applications to manually
    control the deinterlacing of layer surfaces (with DLOP_DEINTERLACE enabled).

commit 1b30e86ad024a0bbfa4b51d53c5121694859d248
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 18:00:37 2002 +0000

    Keep alloc_list after debug outputting it to avoid crash by further deinits.

commit 6a767de7c231201423e523c5d3cb39f5b3530539
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 15:24:50 2002 +0000

    fixed init/deinit related things

commit cf397cbfc473d6cbdeb3621c00569828f8b47130
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 14:06:27 2002 +0000

    Fixed two mem leaks (two unreachable blocks after exit).
    Don't reload input and graphics modules.

commit 025f1e9aa100648d2a97e514537e2992140489fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 13:12:55 2002 +0000

    Use shcalloc instead of shmalloc.

commit 3c57dc9c6e1fff87d7da306fb58c1fefe0750901
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 12:43:49 2002 +0000

    Added "-g" to non-debug mode to have line numbers in gdb without
    enabling the DirectFB debugging code.

commit 8412ba96ea13a6f9f8e9a5713769f903214da545
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 23 12:24:28 2002 +0000

    Added missing closedir().

commit 8021d6a6052398970beb5b8c9bff903ec0f1f622
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 22:40:23 2002 +0000

    updated

commit fbaa2571aeca3f609074639a70e7113f766cf217
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 22 22:20:54 2002 +0000

    Updated NEWS.
    Forced directfb.h into 80 columns.

commit 1e6912e025a98cad83cc0e11f4d4913f8a0a6a41
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 22:19:51 2002 +0000

    cheating ;)

commit 5b8032be7084b3d73354916fc6416bd472ab5321
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 22:15:23 2002 +0000

    Do a skirmish_prevail during shutdown if it's no emergency instead of the
    skirmish_swoop loop.

commit 0721c8ac02489be35c7f83da99acbb0bbdeac45a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 22:05:44 2002 +0000

    Added "do { ... } while (0)" to debug macros.
    
    Don't print an error if message queue id is removed, but print a debug message.

commit 775c31d6da41285c7adbee2d683c00c2f7139204
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 22 21:58:22 2002 +0000

    Made init_modes a static function again.
    
    Call the original InitLayer function and modify the configuration
    instead of doing the whole setup in savagePrimaryInitLayer().

commit 7350fc81c933e9216f450042184f68f3583473d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 21:54:52 2002 +0000

    Shutdown input core before anything else to stop input threads early enough.
    
    Don't create a palette for non indexed surfaces by default.
    Create it on demand during surface reformation.
    
    Fixed missing initialization of semop flags regarding global references.

commit 5e42308883cae850a859769aad3a53a58be6295f
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 22 21:06:45 2002 +0000

    Made the GIF provider less verbose.

commit ab757525907413bc0b5907d0737b66d44ea50bb3
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 22 20:42:37 2002 +0000

    Added a global (per process) color hash table to speedup palette lookups.

commit c034bcefff925a68b344af7d9818c2584bb4ba55
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 19:03:20 2002 +0000

    Added core functions for thread management
    to have input drivers pthread independent for easier porting.
    
    Input threads get a higher priority now.

commit bbb5370ee7fe5f5918358f25900a2d7c9fbe7f85
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 22 17:48:40 2002 +0000

    Fixed dead lock in recently implemented FusionProperty (multi app).

commit abcf5116e02a4cca965b298598becfbcb30cc419
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 22 12:28:11 2002 +0000

    Applied a patch from Alex Song <alexsong@comports.com> that add
    flipping support to the secondary layer.
    
    Export former internal function init_modes() as dfb_fbdev_init_modes().

commit ea8e281f9cfa108c94067f02cb1410134772bb30
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 19:55:00 2002 +0000

    Modules are installed to ".../lib/directfb-0...-debug/" if debug is enabled
    to avoid dynamic linker errors.

commit d9c50ab9a6711c3714f78f03f00ca47db5eaee31
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 19:35:23 2002 +0000

    minor update

commit c03e159f4f8dd4b83724bbe3990b3b04fb31a486
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 19:10:48 2002 +0000

    Added malloc/calloc/strdup debug output.
    Beautified debug output and made fusion debug output like the core's DEBUGMSG.

commit 2eea56839bceeb5b4e79c4a178b6019ab2822eef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 17:53:13 2002 +0000

    Surfaces can now be created (in core) using the palette of another surface.
    Window surfaces are now created with the layer's palette (real reference).

commit 0cb47ba756fc6afdc1a9a3f1dd302424842113f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 17:24:46 2002 +0000

    Removed locking recently added.

commit 55d9933c1f47c29c866f88477118fc81aa8059c6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 17:15:59 2002 +0000

    IDirectFBPalette is now completely independent from surfaces.
    Added palette notification for entry modifications and palette destruction.
    Attach a palette listener to a surface's palette to notify surface listeners.

commit f7cf8de3688b55999d1f76dbf2cc7fd4eb2245ef
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 16:10:54 2002 +0000

    Unref surface after linking it instead of unref during window destruction.

commit c5f8f0cb485dae882dd9aee76cbcd6b1834c4a61
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 20 16:04:28 2002 +0000

    CorePalette is a FusionObject now with its own pool.
    Currently each surface creation causes the creation of a palette object,
    it's then linked to the surface object and unref'ed.

commit 39e43e392ea00ff5415b827819adc286bc6c0eeb
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Aug 19 18:21:54 2002 +0000

    Indentation.

commit 45ac939ffaabe063fd492c55e2da7a5d52512fe6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 19 16:23:48 2002 +0000

    Provide shmalloc/shfree debugging for single app core.
    Avoid calling shfree() with NULL.

commit e53e5064410475b75c2b10514df2f1d4f34b3dee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 19 13:29:45 2002 +0000

    Fixed cursor alpha blending.
    Added 'CAUTION' messages to unimplemented cases of surface heap adjustment.
    Added locking to window stack cursor handling.

commit 7adca67032e6b45a2ef7e66036cac3a11ca66804
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 19 13:03:37 2002 +0000

    removed obsolete entries, sorted entries by priority

commit 637a1c2a91010da804144b984f936df427986c1c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 19 12:49:15 2002 +0000

    Added DWOP_ALPHACHANNEL to enable/disable per-pixel blending after creation.
    Only supported by windows with the capability DWCAPS_ALPHACHANNEL, which have
    it enabled by default.

commit a4ae71f2965f220dd4f3a58664a3690f8a09d834
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Aug 19 11:35:29 2002 +0000

    Removed bashism (function keyword).

commit 6ba55f17c2726496cf3ec73b192ff18b63b25c0d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 18:40:19 2002 +0000

    minor simplification

commit cb271c77b697b8e5ae75b94c29059a9ce6a11576
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 14:14:43 2002 +0000

    Added DSCAPS_STATIC_ALLOC and DWDESC_SURFACE_CAPS.

commit 573c565430aaea152529f6617e76a13df5972533
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 13:15:51 2002 +0000

    Fixed bug introduced last night.

commit 692a4ca293f77c5559e5a9fcf0381f640abca197
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 12:15:15 2002 +0000

    Don't lock/unlock buffers during surface destruction.

commit 007b6cb06f50cb93cdae116c6922a22ffa9620c4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 08:32:28 2002 +0000

    Framebuffer is now mapped by 'fbdev' instead of 'gfxcard'.
    Reordered initialization/shutdown/join/leave calls in 'core'.

commit 205d8a423ad8b88727f14d5dacba2b0aaf8c8545
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 03:45:06 2002 +0000

    EnumVideoModes handles bpp again.

commit 1cc3c5bb941d63b1a528cf7ecf756ac5af251e00
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 16 02:51:00 2002 +0000

    Implemented FusionProperty in multi application mode (via three semaphores).
    Implemented backup/restore of the layer configuration before/after excl. access.

commit 0b876569e2a03127085453ca679b0df4501cf7fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 15 21:46:48 2002 +0000

    A bit work on cooperative levels.

commit c5b9b7a560bcdf95267f8df5da6e80eba330e7ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 15 21:00:29 2002 +0000

    Avoid endless waiting during deallocation.

commit 9476e636625bf940cc4abac0a6e86121c6b1afe6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 15 18:53:55 2002 +0000

    DirectFBError() and DirectFBErrorFatal() return the error code now for easier
    code (e.g. return DirectFBError(...)).

commit 0a6360eca46118222722c00c5546638bf668e667
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 13 19:10:13 2002 +0000

    Made debug message an error message (background surface vanished).

commit 765824aadf41a59cc9a4185e737153f784f414d4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 13 17:49:42 2002 +0000

    Background image is now persistent (application can exit after setting it).

commit 2db3eb090023731bb02304da690a1512202c2c19
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 13 17:08:49 2002 +0000

    Fusion debug messages are printed only if debugging is enabled at runtime.

commit d00b2894c7e5cfc20187afd47e979ff6d24e835f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Aug 13 16:43:20 2002 +0000

    Updated the Makefile accordingly.

commit 683b0e1dec31d9c09d4f6653e32141c327151c9d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Aug 13 16:42:23 2002 +0000

    Updated savagefb-0.4.0 patch based on a patch from Alex Song.

commit 0b50ef53fed7af34cb559d40d8c5e4eea12dafb7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 13 16:32:12 2002 +0000

    Implemented ovlFlipBuffers().

commit 0819e441f1ab8742ba466f3eb52a20611930b515
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 13 15:15:50 2002 +0000

    CardState is a local resource now, using a mutex instead of a skirmish.
    The state for window stack updates is now located in the local layer data.
    Added deinitialization of the surface manager.
    
    No resource leak by starting/exitting a small application.

commit 15d59c025572010ba2b150608a59426bee4e3617
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Aug 13 11:56:04 2002 +0000

    Implemented Sop_lut8_Sto_Dacc() and Sop_a8_Sto_Dacc().

commit f4c64bd77fbe45721c84d13d13b8aa88e38822f3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 13 11:01:39 2002 +0000

    more compile fixes

commit 21d0351157a148d08a34a91d9184e0d1f3b6ba9e
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Aug 12 23:58:50 2002 +0000

    cleanup

commit f3d3f9a5034c2ac644a659d9e49a6399e261777c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 20:42:25 2002 +0000

    Hopefully compiles again.

commit c6b0d63024ff3035c8350269872d47106a051eb5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 19:30:44 2002 +0000

    Another TODO item: synchronous messages

commit a224317c241dee4211c410bfd82a4cc9193fe8ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 19:27:53 2002 +0000

    Added TODO item for making CardState local only.

commit aa3eac47031a78975bbf88f160921641a3582355
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 19:11:33 2002 +0000

    Don't install signal handler for slaves.

commit 3ee5854577d2637ac153aba2d61e89865480da7f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 18:59:36 2002 +0000

    Made CoreWindow a FusionObject.

commit 0c132f42a0428211e79bf0b227410f8b6eaf2df9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 17:43:57 2002 +0000

    Each object pool has a name now.
    
    Added shstrdup().

commit 27cd209d227a378d111a36116351b7f2568338ce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 16:41:22 2002 +0000

    Added FusionObject which is currently used for surfaces and will be used for
    windows (dynamic resource) or static resources like layers, input devices...
    
    Each FusionObject has a reference counter which is automatically decreased
    if the process dies that increased it. Added bone collector thread that checks
    for dead objects (zero reference) and calls the destructor (master only).
    
    Replaced dfb_surface_destroy() calls with dfb_surface_unref() calls.
    
    Each IDirectFBSurface instance increases the reference counter, so be careful
    to release all sub surfaces.

commit fe6adfc2f803a4e42d6043ddceaef84e478ba5ac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 12 14:44:26 2002 +0000

    cleanup

commit d435c45f6bd3258204b92b579a6973b05456eaa1
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Aug 11 14:32:37 2002 +0000

    Reverted my last change since the compiler seems to like the old code better.

commit 865739f917f90a015d616ca5186af037d2d4e110
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Aug 11 14:26:15 2002 +0000

    Cleaned up Bop_a8_set_alphapixel_Aop_rgb24().

commit cef004a1e1012adc965bc1306badc2b1034517e9
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Aug 11 13:30:45 2002 +0000

    Removed unused locking code.

commit e62f8d8890ed55e9e0a02bb68f68094443603c6d
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Aug 11 12:52:18 2002 +0000

    Aligned configure output.
    Don't use duffs device for Bop_a8_set_alphapixel_Aop_lut8().

commit 55116b98bd235597303c3eb82705e33e34f743da
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Aug 9 17:35:43 2002 +0000

    A better implementation of Bop_a8_set_alphapixel_Aop_lut8(). Much slower
    but correct for AA glyphs and reasonably fast for monochrome ones.

commit bbae4fac76aa45eca8a9d9e4ba9291c7b81e24b0
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Aug 9 14:18:34 2002 +0000

    Reuse Bop_a8_set_alphapixel_Aop_lut8() for RGB332; it's the same code.

commit dc0d6fb4d5a0221acbc22dc742a6b055eb442548
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Aug 9 13:37:08 2002 +0000

    Set the color_index in the font_state as well.
    
    Added a simple implementation for Bop_a8_set_alphapixel_Aop_lut8().

commit b53dbe488c331539f20647af966b33a5aabbe6e8
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Aug 9 12:05:09 2002 +0000

    Document the disable-module directfbrc option.

commit 26e472e21974e588f0f9bbd4828ed881c82936b7
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Aug 9 10:37:10 2002 +0000

    Introduced an enum for the stage to improve code readability.
    Check if we reached our final stage in the inner loop of
    push_data_until_stage(). PNG images load again :-)

commit dd8f99b316f90ec1b72d5a783542b6fb7895fcfc
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Aug 9 09:46:34 2002 +0000

    Check that png_ptr is not NULL before calling png_destroy_read_struct().

commit 43ccc81580cbcd1eb2d7a65e29e125df9e51eb00
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 20:02:42 2002 +0000

    Added inline function span_rgb32_to_rgb332().
    Added support for RGB332 surfaces to directfb-csource.

commit 9acbe1c2e4d6b87f980900bc09e4cee5fdeb824a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 17:28:03 2002 +0000

    Added a bool "global" to fusion_ref_up/down(). A global reference is not bound
    to any fusionee (anonymous reference) and won't be automatically decreased if
    the fusionee that increased it dies. This will be useful for resource cleanup
    if a core object is linked to another one (e.g. surface linked to window).

commit 5bfc541847eb4acc18655fead9577879c4f61a79
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 16:56:59 2002 +0000

    Removed unnecessary include of core/fbdev.h from savage3d.c.
    Include core/fbdev/fbdev.h from savage_streams_old.c :-(

commit 6cf60a8c12a1e163947ff68398473c03c607c1b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 16:41:45 2002 +0000

    Moved framebuffer device specific files to "src/core/fbdev/".
    Only "gfxcard.c" still contains a bit fbdev code.
    
    Other files modified depend on the fbdev code which has to be fixed.

commit d451b6e9ef650b709639756cd869fcfc3f7c8c84
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 16:00:34 2002 +0000

    A filename is now contained in the common private data of data buffers.
    It is set if the databuffer is created for a file. Image providers that do
    not support data streaming can use it as a fallback.

commit 51562d51675db2919e39071d4308ebb6cb6a0d0a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 15:32:42 2002 +0000

    minor cleanup

commit 85970d7ad115511529a8e293bcc2aa764c14e8a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 15:14:01 2002 +0000

    Abort data streaming if error is detected.

commit 79d3a8429918c26e882b3926e98e666e10222d6d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 15:06:21 2002 +0000

    Added DFB_UNIMPLEMENTED returning methods for SetRenderCallback().
    Forgot to add a "return" if no system memory could be allocated.
    Started implementing the render callback for PNGs, not working yet.

commit a559d31a2d2f5a54529dbf9713158fe224887bcb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 14:58:07 2002 +0000

    signed/unsigned switch

commit 5dad1d33a9136df54cd843c6c11b7785b16469b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 14:57:50 2002 +0000

    Added WaitForData() call before peeking 32 bytes.

commit 10fe1a06206d1af286f4f48df6632e5391a75715
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 14:54:22 2002 +0000

    Added another format conversion by reordering the switch statement :-)
    Put palette info into the DFBSurfaceDescription.

commit ef7fa845ee1619693b8e19352db183e891b7394a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 8 14:42:42 2002 +0000

    Added DSDESC_PALETTE which can be used to initialize the surface's palette.
    
    Added IDirectFBImageProvider::SetRenderCallback() that is not implemented yet.

commit db62c19693b6244ce47b8343603966cd17b256cc
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 14:20:09 2002 +0000

    the final touch

commit 73ba2b01f0a827d04d27c67a115f8a5a09780bff
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 12:02:35 2002 +0000

    Updated NEWS and ChangeLog.
    Mention the current problem with EnumVideoModes() in BUGS.

commit 99c8913d591b49b19d55c9422c1682ffaf1a0d6d
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 11:45:05 2002 +0000

    Also dump the number of palette entries.

commit 476d933abfa7013925a3a7a1fffdf3a1369343d6
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 11:19:22 2002 +0000

    Dump palette from PNG file when the destination format is LUT8.

commit a67a726305bd708d751968c3779d9f50ce27b033
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 10:16:55 2002 +0000

    Allow to create LUT8 surfaces from indexed PNGs (need to add a way to
    dump the palette).

commit 014977573bb22b48f2fea83205d61439c4b9cc86
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Aug 8 08:50:30 2002 +0000

    Align the pitch to multiples of 4.

commit 697a81750023e7b16b0a8e28959bf297eafd9f1c
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Aug 7 23:14:19 2002 +0000

    Fixed loading of grayscale PNGs into A8 and added support
    for loading RGB PNGs w/o alpha-channel into RGB24.

commit d99866bae096916a55aa37d94a17e9f90dbc2e1c
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Aug 7 22:23:31 2002 +0000

    Added two Makefile rules that might be useful to build only parts of
    the DirectFB package:
      'html' creates the HTML docs
      'directfb-csource' compiles the directfb-csource utility

commit b3d34a58c70d3429ce08a45484b7bd3ec8bb38e6
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Aug 7 22:00:00 2002 +0000

    Added a man-page for directfb-csource.

commit b1fb60939273bb8f13370ff7f9d1f16d61d17e12
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Aug 7 19:07:12 2002 +0000

    Added span_argb_to_a8().
    Added Tim Janik to the list of contributors since I used some of
    his gdk-pixbuf-csource code for directfb-csource.

commit a140b2eb4cc5668e05dfa9bef341bbf6c2cc0902
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Aug 7 18:57:32 2002 +0000

    Allow to specify the destination format on the command-line.

commit 0e22f4b9c5946ad2a0caeff533d6eaa0fd7e79aa
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Aug 7 15:48:37 2002 +0000

    Added directfb-csource, a tool that creates a C header file from
    a PNG image that can included in a DirectFB application.
    Based on gdk-pixbuf-csource.

commit 1bb6971b3b94a48e1b395d998ef8086b294cd56a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 6 19:12:05 2002 +0000

    Forgot to lock/unlock during Flush().

commit f6ebe1e474522ceb18d80509dfbf082882f2ce55
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 6 19:11:05 2002 +0000

    Completely implemented streamed data buffer, completely untested.

commit b7d1c486fb79cb161823209f83fb013061f20ea3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 6 17:14:06 2002 +0000

    cleanup

commit e42871e1398fd46e73242b24c262768a713da5b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 6 16:25:03 2002 +0000

    Return DFB_BUFFEREMPTY in PeekData() instead of blocking forever.

commit 81b53a34e438ac68937820f7fde5844e4658bc66
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 6 16:02:21 2002 +0000

    Image providers now read data from an IDirectFBDataBuffer.
    JPEG and GIF providers cannot fully handle streamed buffers yet.
    
    IDirectFB::CreateImageProvider() implicitly creates a data buffer now.
    
    Added IDirectFBDataBuffer::CreateImageProvider().

commit 7cc036011c47758fb8be659619ba27337a3c920a
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Aug 6 13:27:35 2002 +0000

    typo

commit 4af91c64a409406da9a3cc95ddf56b9fc590917f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Aug 6 12:24:04 2002 +0000

    Call AC_INIT() with a sane value.

commit 43e618956375f7c456c62709f62d741023a26cc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 2 17:21:59 2002 +0000

    Don't reconfig front buffer if policy stays the same.

commit 88140b6dd11d5fa7f181765857e1e10a8596beae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 2 13:16:05 2002 +0000

    Implemented IDirectFBDataBuffer_File::PeekData().
    Made "offset" for PeekData() signed.

commit 9ff4d2a59ae55b08030eb9d0d4effffc33326c3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 2 12:53:05 2002 +0000

    Moved mode probing to primaryInitLayer().

commit 118d59bd6ea364c5bbd4aed1e9bd51070d4e6f26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 1 13:48:28 2002 +0000

    Reject RGB332 in IDirectFB::CreateSurface() if it's not compiled in.
    
    Initial work on data abstraction for image providers, etc.

commit 5837463f42095d16a5f9de80267057654003eea9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 1 13:36:29 2002 +0000

    Fixed typo, fixes a crash when blitting from LUT to RGB.

commit 49c17ad43b1b208f35be31fcba223c4038056148
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 31 13:13:56 2002 +0000

    Removed the version number from the README file for the
    matroxfb-vsync-irq-patch.

commit c4185e2f583680e5cbc97bd3064e5872b6f1baee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 29 22:47:18 2002 +0000

    Added IDirectFBPalette::FindBestMatch().

commit fdb4c8fd1c6f19e4f93bcb611671a45a4871286a
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 29 19:24:26 2002 +0000

    Removed unneeded calls to IDirectFBSurface::GetCapabilities from
    RenderTo() functions.

commit 140fbadf7729b41d0fad3106a5eeaa0c5654c87d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 29 17:24:03 2002 +0000

    Typo.

commit e069f47632a77d9b01bd57a0046c26a055b87c66
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 28 23:09:25 2002 +0000

    Added configure option "--enable-profiling".
    
    Added "alpha present" bit to LUT8, because the LUT has alpha values.
    
    Added LUT8 support to image providers.
    
    Added option "pixelformat" which overrides "depth" for the default mode.
    The value specified is e.g. "RGB332" or "LUT8".
    
    SetPalette() for display layers is now called by the core after setting
    a new configuration (for LUT8 only of course).
    
    Added dfb_palette_search() which (really slowly) looks for the best
    matching palette entry for a specific color.
    
    Generate a RGB332 like palette as default palette for LUT8.
    
    Allow other alpha supporting pixel formats than ARGB for alpha blended
    windows, too.
    
    IDirectFBSurface::Clear(), SetColor(), SetSrcColorKey() and SetDstColorKey()
    now lookup the right color index for indexed surfaces.
    
    Much more support for LUT8 in software driver.

commit 8e30c980ea8da61209b28b51718bd19bd2829e71
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 26 16:28:33 2002 +0000

    Fixed centering of primary surface window.
    Converted some unsigned ints to signed ones.

commit 932e6c2392867b7ded7122248e06298ddf3b3d83
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 26 15:32:58 2002 +0000

    two more bugs

commit 741aec12afe6989678bedfe62f5ad4f51639fa4c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 26 14:19:05 2002 +0000

    Added another bit to the pixel format definition indicating an indexed format.
    Added DFB_PIXELFORMAT_IS_INDEXED(format).
    Added IDirectFBSurface::SetColorIndex() for indexed pixel formats.
    Enabled drawing functions for DSPF_LUT8 in the software driver.

commit d1d08d8025d498195c72a637a14372b912295bdb
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jul 26 13:53:46 2002 +0000

    Declared the return value of DirectFBCheckVersion() as const.
    Assure that directfb.h fits into 80 columns.

commit a441f469a8bef417043e3cc8d1d9e4d8f8fe6952
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jul 26 10:59:35 2002 +0000

    some smaller README updates

commit 37fc8263fca8153ab353896e2f2a332868b26612
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jul 26 10:49:19 2002 +0000

    Updated ChangeLog and NEWS file.

commit fd89587733a4cc8480726e67032a2e49de9bf7da
Author: holger <holger>
Date:   Fri Jul 26 10:32:29 2002 +0000

    implemented direct glyph mapping without charmap, toggled by the DFFA_NOCHARMAP flag

commit 17e2e0d43832f40fb4863cb679b3c5ba252fb192
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 26 04:10:28 2002 +0000

    Forgot to increase the ABI version.

commit d20bdff707cd6f4100e8c9d3df9944bb8aeb934e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 26 04:06:33 2002 +0000

    Added SetField() to layer driver API, removed surface listener stuff
    from Matrox driver and implemented SetField().

commit a105b14d28c102df50ab58734eaf297cb992a02c
Author: holger <holger>
Date:   Thu Jul 25 15:33:02 2002 +0000

    fixed nasty off-by-one bug

commit 62ea6a0e9a0c8fe26b36ebfba8ee89a2f8863a35
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 25 14:54:31 2002 +0000

    Added DFBDisplayLayerTypeFlags for a basic classification of the layers'
    purpose a la DFBInputDeviceTypeFlags. Classification includes graphics,
    video, still picture and background usage.
    
    Added DFBDisplayLayerDescription containing capabilities and type for now.
    
    Display layer enumeration callback gets the layer's description now.
    
    Removed IDirectFBDisplayLayer::GetCapabilities() and added GetDescription().

commit 7b7f6668800158850f8f73cfca93ecac60863882
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jul 25 14:11:43 2002 +0000

    small cleanup

commit 08053094860209c41b56a277858c9b200d945d73
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jul 25 13:35:37 2002 +0000

    Implemented input_only windows (windows w/o a surface).

commit 67825aa7461002b2eb7a2889590b0f5b4547a617
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jul 25 08:24:28 2002 +0000

    Declared DFBRectangle and DFBRegion as const function parameters for
    all functions that don't change them. This documents the API better
    and keeps us from accidentally modifying the passed structs.

commit 74c46dce26053101cee895e4d46c60b17130b711
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 24 19:12:57 2002 +0000

    Declared name and value parameters of DirectFBSetOption as const.

commit 66f001333016e4e050b387747c42579829c3e31e
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 24 11:19:25 2002 +0000

    Updated email address.

commit 78b7263f99f680a8d3f281a9b34fefbbc92649ad
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jul 23 09:56:40 2002 +0000

    Applied a patch from Ville Syrjala <syrjala@sci.fi> that removes
    the unneeded call to dfb_surfacemanager_assure_system().

commit fbef7a03f099251f711b725ddb2d1ebb9822fd24
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 19 00:57:39 2002 +0000

    New patch for 2.4.19,
    thanks to Brian J. Murrell <a40e8119bbddbe7b3d281db117f19b32@interlinx.bc.ca>.

commit ef2469de1d75311ce10cdf2b1d62686925936ea6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 18 17:52:28 2002 +0000

    Applied patch from Ville Syrjala <syrjala@sci.fi> enabling acceleration
    for the second head of a dual head Matrox.

commit 1e7b46212c1476820dcec333b408909bfd0193b3
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 17 15:17:08 2002 +0000

    spell checking

commit f291216fc589551996884ad28658cea415a8ffc2
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 17 15:04:30 2002 +0000

    Replaced '\344' in Ville's name with a plain 'a' as he requested.

commit 01e7813aecbfef7689aa0252688b828fe8ff23b9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 17 14:23:51 2002 +0000

    Added Alex Song <alexsong@comports.com> to "Helping Developers" (Savage driver).

commit 985094acbe3df066be810f32acf0782a56121a34
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 17 14:09:13 2002 +0000

    Applied a patch from Alex Song <alexsong@comports.com> that completes
    support for the old streams engine as found in the Savage4 family.

commit 091a06c2c9b251c344e079d57afc207a981ab609
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 17 14:00:00 2002 +0000

    include <sys/time.h> for gettimeofday().

commit b23b194e7b54485d605429a12ed2dcfee551923c
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jul 17 13:52:33 2002 +0000

    Made the core fill in the InputEvent's timestamp field if it hasn't
    been set by the inputdriver.
    
    Reviewed all inputdrivers once more and removed some calls to
    gettimeofday() since dfb_input_dispatch() takes care of this now.

commit 8912f20a747bac1224832714cb326c158324055f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jul 16 14:50:42 2002 +0000

    Always set the flags field of the InputEvent before dispatching it.
    This is needed since the core modifies it, so we can't reuse the
    flags next time we use the event struct.
    
    Also made sure that all inputdrivers either always or never set the
    timestamp.
    
    Don't set the DIEF_BUTTONS flag in the linux_input driver, it is set
    by the core when the buttons field is calculated by fixup_button_event().

commit b828db4a9d4f620cdbb678283fea6f96bb22bef8
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jul 16 14:46:19 2002 +0000

    Also call fixup_button_event() for events of type DIET_AXISMOTION.
    Fixes the buttonmask for motion events (needs some fixes to the input
    drivers that I'll commit next).

commit fe3b99469d84781d8826ba2b31f2afd0fa8ab07d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jul 16 11:31:24 2002 +0000

    converted a C++ style comment to /* ... */

commit afddbad65bb48e811794c2c77b0b0dbb0ede098a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 15 13:05:06 2002 +0000

    Applied patch from Mike Pieper <mike@pieper-family.de> fixing locking
    of the surface buffers.

commit acc6b67a3185067d87a9a37a7e6cd0754390f007
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 15 12:28:51 2002 +0000

    Applied a patch from Alex Song that changes SetSrcColorKey() to
    accept r g b values instead of a 32bit key and sets the device pointer
    in dfb_layers_hook_primary() and dfb_layers_replace_primary().

commit 122c72f1310605c3cd2150b873ddba3e268b374e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 12 16:20:13 2002 +0000

    Added support for interlaced surfaces with seperate field buffers to all
    drawing and blitting functions.

commit fdc6032b759cd10d4d7988776979718675046325
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 12 13:41:22 2002 +0000

    Added DSDRAW_XOR ;)

commit d490bb40569b046d37731bad267c5d8e7334876e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 10 15:10:53 2002 +0000

    Added "dfb_layers_replace_primary" which acts like "dfb_layers_hook_primary",
    but replaces the complete function table allowing drivers to use the default
    methods for surface allocation by setting function pointers to NULL.

commit 44d10c689ff7caa8b55f5d5580dfcf3d9bb8a7f7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 10 13:40:09 2002 +0000

    Added DLOP_OPACITY which enables usage of the global alpha factor specified
    by SetOpacity(). This way drivers have the chance to forbid opacity changes
    during usage of the alpha channel or color keying.

commit b17c15b5c784e8f8a7a14d7fc24b8b59addd0368
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 10 10:35:53 2002 +0000

    Automatic grabbing mode for grab-only devices or flipped surfaces
    by Mike Pieper <mike@pieper-family.de>.

commit 1e7b2bc67c7d3b0dc7362fd7f6a91e7d4544cd32
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 10 10:33:05 2002 +0000

    Some cleanups by Ville Syrjala <syrjala@sci.fi>.

commit 04324b781b494484772b3b5b0e9fb64364f96e6f
Author: holger <holger>
Date:   Tue Jul 9 14:33:25 2002 +0000

    some more keydefinitions, use 16bit only for all keycodes

commit a25f7c9ec2117e30fdebe90a8839f574df445782
Author: holger <holger>
Date:   Tue Jul 9 11:23:58 2002 +0000

    - DIKI_XXXX are now Unicode keys in the private area
    - fixed GetKeyState table lookup

commit 51286d851119a07b5d659e433f373a0d51997467
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 8 14:53:06 2002 +0000

    Reverted Holger's change, because it breaks IDirectFBInputDevice::GetKeyState()
    and other things.

commit ac06883cc9c2758cc43cbf3a4f2940012e7e14ee
Author: holger <holger>
Date:   Mon Jul 8 08:50:54 2002 +0000

    Rewrote the linux input keyboard driver, key mapping is done
    via table lookup now. You can distinguish DIKI_XXX codes by
    testing (DFB_KEY_TYPE(key) == DIKT_IDENTIFIER). We still have
    to implement keymap handling...

commit a368c9884d18159094a457857912740636038a45
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jul 6 20:13:43 2002 +0000

    32bit destination color keying fills fixed by Ville Syrjala <syrjala@sci.fi>.

commit fd6e003ab7f80337b3f776b257b63f9c210ffe30
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 5 16:08:02 2002 +0000

    Another set of patches from Ville Syrj\344l\344 <syrjala@sci.fi> adding
    planar YUV support and some fixes to the grabbing code. Thanks.

commit 8052ecceb19f713dc19976b2ae10df79922131ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 4 13:56:22 2002 +0000

    Reset source surface pointer in window stack rendering state after blitting.

commit 32b0fc7b32f99a56d6895ec1e828e93a02214db7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 3 19:56:32 2002 +0000

    Enhanced documentation of DFBResult and DFBDisplayLayerCapabilities.
    Renamed DLCAPS_INTERLACED_VIDEO to DLCAPS_DEINTERLACING.
    Renamed DLOP_INTERLACED_VIDEO to DLOP_DEINTERLACING.

commit 90f48fee8dc25fa5115be5e17ca6c8c87c0aa4b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 3 16:16:47 2002 +0000

    Added new surface capability DSCAPS_SEPERATED for usage with DSCAPS_INTERLACED.
    
    Removed top level indention of directfb.h which looks strange but saves five
    characters that can be used for documentation of enum or struct entries.
    
    Minor documentation beautifications, started to write complete sentences with
    a capital letter at the beginning and a full stop at the end ;-P
    
    Removed "universe has collapsed..." print after "while(true)" loop.

commit 739733971a78b0d0aad47d29ee16975f70b64a79
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 3 13:22:00 2002 +0000

    Don't print an error message for EINTR.

commit 9e4902f0957c330835cdb295a50e06c42b338d5f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 17:03:01 2002 +0000

    Added macro DFB_ALLOCATE_INTERFACE_DATA saving 4-6 lines per file.
    Added freeing "thiz->priv" to DFB_DEALLOCATE_INTERFACE saving 2 lines per file.

commit 755bdad26908701dba84969652377ba79b93b296
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 16:21:10 2002 +0000

    Unlink shared memory file during shutdown.

commit 187e096b6f50329e7c78ac7e840cf51085a6592c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 15:22:53 2002 +0000

    Debug version compile fixes.

commit 6e677b80385bc75425372257413841b7220b36ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 15:13:28 2002 +0000

    Small fix for compiling without rgb332.

commit 4c539af7fa02bbd0f4408c87670ad2c3d3f62bf8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 15:10:45 2002 +0000

    If no depth is specified use 16bit if supported or keep current.

commit b4776f1c2fd413422225bf7da47152f19a2f228b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 15:05:38 2002 +0000

    Added surface notification for palette updates.
    Added display layer driver function "SetPalette" called by the surface
    listener of the display layer core listening to the layer's surface.

commit 47f01c07467cc37c6e67781ad489136b53acf1bf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 14:36:55 2002 +0000

    s/id/window_id/

commit e5d44019d412d1795e6c6e3dfcef866411e570c3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 13:58:15 2002 +0000

    Cleaned up vertical retrace handling by passing the flipping flags to the
    driver (with DSFLIP_WAITFORSYNC eventually set).

commit 53ea313fac073a01730ea38c8f7faa05700130db
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 2 09:45:38 2002 +0000

    More work on grabbing support by Ville Syrjala <syrjala@sci.fi>.

commit b4cb5939f8233b8e2567e313c36007693a00959f
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 1 16:46:16 2002 +0000

    Added input_fake.h to libdirectfb_linux_input_la_SOURCES.

commit e1777366e118f827fbd2a74787e8ec6cb3fddf66
Author: holger <holger>
Date:   Mon Jul 1 14:44:57 2002 +0000

    use <input_fake.h> for definitions missing in <linux/input.h>

commit 1096402a70953939d062e7bdf288095c86affa0e
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 1 11:51:57 2002 +0000

    updated copyright headers

commit 2920f8184686b643650d60b36d9d2fee7de1a66d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 30 22:06:19 2002 +0000

    Use flags instead of booleans for each state entity.

commit 512c7aa5aacdeda969a144a3ed4607ab5bac84bf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 29 23:40:30 2002 +0000

    fixed a typo

commit 578c4d1b5be71e53d39d5bdd810ebba7e3347d4d
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 28 16:57:47 2002 +0000

    Use one bit of DFBSurfacePixelFormat to indicate if the format has
    an alpha channel. Added new macro DFB_PIXEL_FORMAT_HAS_ALPHA().
    
    Use the new macro from the GIF ImageProvider.

commit 8e43429377afd90079d8dcba9599c6b48fe0f33c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 27 21:09:09 2002 +0000

    An own FrameThread implementation for each capturing method, thanks again.

commit 229e5b3a272c9bde22ff0d688ba7c2d51e2b98db
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 27 19:34:38 2002 +0000

    Video provider now detects system only surfaces and does grabbing.
    
    Thanks to Ville Syrj\344l\344 <syrjala@sci.fi>

commit e7f92f356d46d679ad545f4d35d377b30f182a03
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 27 14:46:14 2002 +0000

    Nicer (and slightly faster) rounding code that yields the same result.

commit 6f433462b372b9ca8a7e6d6187653b27ee8ab333
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 27 10:41:30 2002 +0000

    A better fix for the rounding errors on scaling.

commit fdff8497d30b16099577a7da465792c97f773407
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 26 23:04:03 2002 +0000

    Do the right thing when rendering to surfaces with alpha channel.
    More code cleanup.

commit d26669671de7e340f3c0d39674008ec15df84804
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 26 18:34:32 2002 +0000

    Initial version of color lookup table support.
    
    Added DSPF_LUT8.
    
    Added IDirectFBSurface::GetPalette().
    
    Added IDirectFBPalette with
    - GetSize()
    - SetEntries()
    - GetEntries()
    
    Support by the software driver is in a very early stage.
    
    Played around with the method table grids of generated interface pages.

commit 4c85141949cd3d15c62dec451207fc8abda594e6
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 26 17:46:40 2002 +0000

    Looks as if we had a rounding error in bilinear_make_fast_weights().
    This change seems to fix it but it needs more testing.

commit f9aac64e5771321b24ac463c04bcd82a9c86df01
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 26 17:09:38 2002 +0000

    Added a function that searches for a color that is not in the colormap
    and tries to pick one that is far from all used colors. Use it to find
    a suitable colorkey to use for the transparent pixels.

commit 71d7fbec1989578b603ed60b485816e9336f0d57
Author: holger <holger>
Date:   Wed Jun 26 15:27:16 2002 +0000

    build linux_input driver only when ./configure was called with --enable-linux-input

commit b78660ccc94064eec53805212ea0f7417ceb1340
Author: holger <holger>
Date:   Wed Jun 26 15:14:53 2002 +0000

    arrgh!

commit 2392285d826fa06f91812e8b9bd72e520a5904b1
Author: holger <holger>
Date:   Wed Jun 26 15:07:07 2002 +0000

    - input driver for /dev/input/eventX devices
    - you have to explicitly disable old keyboard and mouse input drivers
      using the disable-module option if you don't want to get these events twice...

commit f9a553be54c352df9eaef9fa168578008b0eec4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 26 14:18:59 2002 +0000

    Applied patch from Daniel Mack <daniel@convergence.de> to avoid usage
    information printed out.

commit 0dc5a0d1b8048efc149296613cefdd9958df409b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 26 13:08:27 2002 +0000

    reremoved

commit 49e497d0396a637f9f015d21360a19cc381ce607
Author: holger <holger>
Date:   Wed Jun 26 12:29:41 2002 +0000

    You can disable modules now by specifying disable-module=<modulename>.
    We need this for the generic linux /dev/input/eventX driver

commit f2b4974f87d3d5c6af01d796c350dfeec1a8b465
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 26 02:00:43 2002 +0000

    Handling DSFLIP_BLIT now.

commit 0b39a51b49d9b55ec218183d8215b93da0efea3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 24 18:50:49 2002 +0000

    last try...

commit f6f9e92c1c3a31ee1972b046337aa8c9276eee7f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 24 17:56:54 2002 +0000

    Trying to synchronize buffer deallocation and stopping of DMA.

commit cd26640af9a95ebf846e94d984f9a68715e2c30d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 24 17:36:50 2002 +0000

    Removed CSNF_VIDEO from flags causing the video to stop.

commit 17fe6402e7a13f523565f3f47178475afb77ad24
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 24 17:22:22 2002 +0000

    Use surface listener to stop DMA when surface is destroyed or resized.

commit 65c9973940884c23aba17d97a0c6e820969a2206
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 24 12:36:46 2002 +0000

    Use the values yes or no for $have_x86 in order to get $have_mmx
    defined correcly. Problem spotted by Wout Mertens <wmertens@cisco.com>.

commit 797aed0042e6e1302696e2e7c7d4d317328393e9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 23 22:16:29 2002 +0000

    Added sanity check to Resize().

commit a6276bfc85979173a3db6783d7c4153203ede637
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 23 20:31:56 2002 +0000

    Added pre/demultiplication to drawing functions.

commit 041e97f65cc1b52b5dc8237ba1b9153bbb212539
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 23 18:49:46 2002 +0000

    Destroy state during destruction of font, otherwise listeners will crash.

commit 922a647e9c35c1dfb770becdea92a122d79d4b79
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 21 00:02:03 2002 +0000

    Updated the copyright notice added by gendoc.

commit f010697781b94a719bafe5c75e21d489fdfd133b
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 20 15:57:30 2002 +0000

    Made DirectFB-Internal require the exact same version of DirectFB.

commit af1ae28608abd196151210d52b2cc32650bab56d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 20 15:30:45 2002 +0000

    Added IDirectFBDisplayLayer::GetWindow() returning an interface to an existing
    window identified by its window id.
    
    Increased version number to 0.9.13.

commit 33e49faeee121b1126081526575e7fa5d1bd084a
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 21:06:27 2002 +0000

    Added savage_bci.h to SOURCES.

commit db71c15f1ea76d24fe928ba47751e1d004d4bc20
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 20:58:40 2002 +0000

    Updated ChangeLog and NEWS for 0.9.12 release.

commit 6af05be6dabed2b29a0cbc871d56f4a1fe3dc744
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 20:26:44 2002 +0000

    Slightly improved description of IDirectFBFont API.
    
    Create glyph surfaces with with a height of ascender - descender
    instead of using font->height.
    
    Don't bail out if setting the encoding failed in the FreeType2 font
    provider. Users might want to use symbol fonts and should be allowed
    to do so (they just need to know what they're doing).

commit 296a2e151d8caef100b8ed9c28330af39cde5458
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 19:49:34 2002 +0000

    oops, one more place that needs to be adjusted

commit 89f719052bf7d4e83ae427cf171af23a7cd166da
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 19:41:07 2002 +0000

    Corrected my last commit: Set height to 24 (vertical offset to next line).
    Fix descender as well (it's supposed to be a negative value).

commit ffddb9426586f4034a8fd5a771c54ce749c7d40c
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 19:37:36 2002 +0000

    Set the font height to 24 for the default font. Font height is supposed
    to be the vertical advance to the next line.

commit a703012e1ca5e74a029baf55d262552dfab05cd9
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 17:46:01 2002 +0000

    Some smaller updates to the README.

commit d750221af9bc1afec84c9e711b6a209b2e3ebb9a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 19 16:53:04 2002 +0000

    Added Alex SONG <zzaleson@uqconnect.net>.

commit 7f53f9c90050d01952356adb038d8e8b79a16bcf
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 16:40:06 2002 +0000

    Removed global font_state and added state and pixel_format to the
    CoreFont.  Both are initialized to default values by dfb_font_create()
    but may be altered by the FontProvider. This gives the FontProviders
    control about glyph surface format and glyph blitting. This change
    makes it for example possible to write a FontProvider for ARGB fonts.

commit 69b1c2f3ed8471cf77f0ba1cea86590be9e2aaed
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 14:20:52 2002 +0000

    added DIKS_EXIT and DIKS_SETUP

commit 67299bff7bc399b36d594dc9020e760a44fed83d
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 12:51:50 2002 +0000

    Updated ChangeLog. Started to summarize changes in 0.9.12.

commit cf00f7adecd62842cf9106b4419a037a9651a8f2
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 19 12:34:39 2002 +0000

    Applied a patch from Alex SONG <zzaleson@uqconnect.net> that fixes
    savage4SetState() for src colorkeying.

commit 7495c15142fbc2e103c089f4e8e891aab2e34ec7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 19 03:12:46 2002 +0000

    Removed two bugs ;)

commit 5918c9b52046c38de5bd9cc0dbc33f8113c015e4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 19 02:34:19 2002 +0000

    Use diffused alpha if source format is RGB32 to force the alpha values to 0xff.

commit 93559c107b69919b8f237b2228f13f13f0aae367
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 17 23:25:21 2002 +0000

    Declared some local variables in inner loops as register variables.
    Declared local variables in SET_ALPHA_PIXEL_ARGB as __u32;

commit 710c5e5d41be5b8bd63638f8ad2ecd07381e6bd3
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 17 22:46:00 2002 +0000

    Added macro SET_ALPHA_PIXEL_DUFFS_DEVICE() which implements Duff's
    device with a depth of 8. Use it for all but the RGB24
    Bop_a8_set_alphapixel_Aop_* functions.
    
    Undefined the SET_ALPHA_PIXEL_* macros after usage and removed lots of
    unneeded brackets.

commit 91cd40d25b1f4c28883a5ece7dd6e864c5d972dd
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 17 21:54:01 2002 +0000

    More work on the Bop_a8_set_alphapixel_Aop_* functions. Use Cop instead
    of the color struct, cleanups.

commit b1a6474615cadee807f8a974afb7e78d9488c852
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 17 21:32:29 2002 +0000

    Cleaned up Bop_a8_set_alphapixel_Aop_rgb[15|24|32], register variables
    locally. Gives 7% speedup in the 32bit case.

commit ac1be09d195d3a657d75fec52b673d27e48e1090
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 17 19:30:40 2002 +0000

    Wait for initial DWET_POSITION_SIZE event in IDirectFBWindow_Construct().

commit 773d7d1720c017c6537cf6b65545cdca115b9fb2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 17 17:30:05 2002 +0000

    Fixed rendering pipeline setup for blended blitting for these cases:
    - destination blend is DSBF_ZERO, but source blend needs destination
    - destination blend is not DSBF_ONE and source blend needs destination

commit 9de43772ac66b749b8c4ed3ebf9b3f9aa49d8027
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 17 08:09:47 2002 +0000

    vsync handling during flip operations needs a cleanup/rework

commit 192f1a2f09f1504078e7624bb6d47de07cd41223
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 17 06:53:29 2002 +0000

    Fixed a bug in ALPHACTRL blitting setup, output alpha channel was wrong when
    blending was used with destination blend function DSPF_ZERO.
    
    Corrected ALPHACTRL drawing setup. Use diffused instead of texture alpha
    and select an alpha write mode other than FCOL. Doesn't fix a known bug
    but should be correct now for drawing with DSDRAW_BLEND to surfaces with
    an alphachannel.

commit 8afa70659ec02d87f1fefa110d8d3203529e1d45
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 15 19:55:31 2002 +0000

    Added 8 bit support to IDirectFB::SetVideoMode().

commit 06ed3ec73ac8d963d1bfd694d284bc281744072d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 14 14:49:02 2002 +0000

    Brutally optimized A8 font rendering for RGB16 ;-)
    
    P3 800E, G450 SDRAM, no-hardware, gcc-3.1
    
    59 -> 67 MChars/sec (video memory)
    275 -> 326 MChars/sec (system memory)
    
    
    Can be done for other formats as well.

commit 3f2880a855e3dac36df1e402bca6b2f5d291e99d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 14 13:32:16 2002 +0000

    Added DFB_NUM_PIXELFORMATS macro.
    Use it for the generic driver's function tables.

commit 2a7887e9415ca8c88785707a524e5788b5c5d94a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 14 13:11:24 2002 +0000

    Check source format in gAcquire().
    Use ONCE in rgba_to_dst_format() to avoid tons of error messages during
    image loading to unsupported destination formats.

commit cdd264bf25bd8f592db2a774c4f32a23a281285d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 14 12:58:02 2002 +0000

    Implemented planar YUV blitting support in software driver.
    Minor code cleanup, better support checks and cleanup fixes in gAcquire.
    "ONCE" messages are independent of debug mode now.

commit bc9fb0ef465c7af28dbfa0b8c6b15c53a0e33880
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 14 03:48:27 2002 +0000

    qsort needs an extra compare function getting two entries instead of
    a string and an entry, works now.

commit 8ae0e10070d8bdd8f1793c97e1010747639e1c8b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 14 00:31:14 2002 +0000

    Don't use videoalpha mode if dst_blend is zero.

commit 895c33deb178bce25f9cc2bad238114ecbade95f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 13 17:14:59 2002 +0000

    Fixed off by one bug in mmx version of Xacc_blend_invsrcalpha.
    Minor optimization in setup code.

commit c931dd09959a8f8cf0d6e6ff85598c0c9cbcb376
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 13 15:45:51 2002 +0000

    Fixed warnings if sighandler is disabled.

commit 39107fa8d2354aaf84902a1aaf285af445134592
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 13 15:06:42 2002 +0000

    Fixed concurrent destructions of windows.
    Added some debug output.

commit da9283bad05f41dca1bf08fcb8d5ef4d09ed1882
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 13 11:35:41 2002 +0000

    removed the voodoo1 workaround

commit aca038f4f159dd6538a5acd41ddc9ea011369d92
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 13 11:30:44 2002 +0000

    removed obsolete FIXME

commit fe251694a6b6c363769abc10b17adacba86a35ca
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 12 17:53:03 2002 +0000

    Fixed parameters for SetConfiguration call in dfb_layers_resume().

commit f5e9229723f7b930f272296c3a73c43cf7398f10
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 12 08:31:24 2002 +0000

    Implemented besFlipBuffers() which should have been implemented in 0.9.11 ;(

commit 4459aafac0685f25786ddd8af262049919e1406b
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 11 12:18:47 2002 +0000

    Include directfb_keynames.h instead of defining our own array.
    Sort the keynames array by names on first call of lirc_parse_line(),
    then use bsearch to lookup the name.

commit 30149f3dcdd02fc495674b0b1a19016b9988d1e8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 20:18:00 2002 +0000

    Replace currency sign (0xa4) by euro currency sign (0x20ac).

commit 6568d964303d4ad47736b6f8cdcec1de336cc556
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 10 18:59:38 2002 +0000

    Use unsigned int for Unicode glyph indices.
    Added DSFT_BOTTOM to DFBSurfaceTextFlags.
    Fixed bug in IDirectFBFont::GetGlyphExtents.
    Made IDirectFBFont::GetGlyphExtents() and IDirectFBFontGetKerning() fill
    in zero values if the glyph isn't found and return DFB_OK.

commit 927f074f82a97752c2934c45c38e0978ac2fb44e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 18:12:57 2002 +0000

    Added DIDID_ANY for devices not prefering a primary device id.

commit 77cd6fc61a9211cf5c023278d4a846874c0b15d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 18:08:56 2002 +0000

    Added DIDTF_VIRTUAL for virtual input devices.

commit 040fa6cc492f273d114c0232a011c2e4a5377efa
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 10 17:43:37 2002 +0000

    Added IDirectFBFont::GetKerning() and IDirectFBFont::GetGlyphExtents().
    Added IDirectFBSurface::DrawGlyph().
    This should enable users to implement their own simple text layout engine.

commit c2a82e85ef2947e0d2e6bcdecd9ec3fa67f58ba7
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 10 13:04:14 2002 +0000

    fixed typo in comment

commit 3da9e67a99cfe61a13ba0c757457b1a47b03ca32
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 10 12:42:18 2002 +0000

    Made configure warnings more visible. Added extra warnings if PNG, JPEG
    or FreeType2 support is missing.

commit 5fcf89a55de855f75c2e6f277f602f3aa3078c5c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 10:11:00 2002 +0000

    Added cross compiling notes by Scott A McConnell <samcconn@cotw.com>.

commit 48148e0fe011904df9b3c0455ef04f6f281bb292
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 09:04:16 2002 +0000

    Fixed modifier mask problems that occured if the left and right version
    of a modifier were both pressed.

commit e629e4bd67d551a3a581b3c1daa23441c3b10e69
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 08:06:08 2002 +0000

    Check for FUSION_FAKE instead of DFB_MULTI, could have caused problems
    with multi application core when slaves need to fetch a keymap entry.

commit cca6872f4e2b646699ea45ba3c23778db8d360a3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 10 07:13:35 2002 +0000

    Added structs DFBPoint and DFBDimension that are not used yet by DirectFB
    but are already useful for applications and libraries.

commit a723ad52aa46a64c9eb6cff26532bef76e91b650
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 9 04:43:39 2002 +0000

    Make sure DFB_IDNOTFOUND is returned if GetDisplayLayer() doesn't find the id.

commit bc7a7ce98686305ca0a85cecad19ff61eb2f99cd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 9 02:36:34 2002 +0000

    Added a mask of currently pressed buttons to input and window events.

commit 69c80a7514537d51811a3a6bef193fb2e2ea87c3
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 7 19:12:44 2002 +0000

    oops

commit 37ce6cc99310ae51fcd853b2f89ff6df8d4a7ac4
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 7 18:23:21 2002 +0000

    fixed dfb_utf8_next_char() (spotted by Holger Waechtler)

commit a9b803b27065a065822a646ed094570bbe7810cf
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 7 18:05:32 2002 +0000

    Added inline function dfb_utf8_prev_char().

commit 0be8e39b640f8b4cc08bcd434ce034eec86b97a6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 7 16:27:28 2002 +0000

    Use sigaction instead of signal.

commit 859145289eca4f23e8691b0b8c2d02e0c8a568cd
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 7 16:26:08 2002 +0000

    updated copyright

commit bb0e7a67b742f848747eef265212c23e18119230
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 7 15:57:44 2002 +0000

    Updated Joachim Steiger's e-mail address.

commit 1ffdcdfff1f2441931b2a1a59fa22aa60275e3be
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 7 15:00:33 2002 +0000

    Updated copyright notice in banner.

commit 9b22b03a41e941747c8c69af4841ab36aaa0fbc3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 7 12:17:36 2002 +0000

    Generate DFBKeyIdentifierNames, too.

commit cbabd2d840abdfeacd4cabad14a63e7e0a79ce62
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 7 10:54:16 2002 +0000

    Added experimental blitting flags DSBLIT_SRC_PREMULTIPLY, DSBLIT_DST_PREMULTIPLY
    and DSBLIT_DEMULTIPLY which can be used for complex blending operations which
    distinguish between premultiplied and non-premultiplied alpha channels.

commit c01d8a70c829d75cac874d01c54ed1d57f48014a
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 6 16:59:02 2002 +0000

    Forced comments into 80 columns.

commit 2b8263b1cf4789781469d0f7ab5b17fd663373b6
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 6 13:38:01 2002 +0000

    Improved description of IDirectFBFont::GetHeight().

commit 820d160de30061ef8cbd39a73daf1ccef7933761
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 6 11:40:02 2002 +0000

    Applied patch from Ville Syrjl <syrjala@sci.fi> that fixes
    IDirectFBInputDevice_GetXY().

commit a7f1cfdc15218b6c61f8da570bc964e21017b1d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 5 21:52:40 2002 +0000

    Added second windows key as META_R, made the menu key SUPER_R.

commit 36ac057b9f16dbfa5c9986fa28c7a40f466a864f
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 5 15:16:18 2002 +0000

    Bumped version number to 0.9.12.
    Added key identifiers for the remaining keys on a PC105 keyboard layout.

commit 68f7d98af8c25453e902de239af3b76f2966845e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 5 02:37:24 2002 +0000

    Once more a fresh ChangeLog

commit d381a03863eb683be374ae5701b8f551bfc17181
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 5 02:33:06 2002 +0000

    Added dfb_static_build_example and ipc_cleanup to EXTRA_DIST.
    Explained their purpose in the README.

commit 4a94d5c994497b0159f52c5c6e39319b6bc6a66d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 5 02:20:50 2002 +0000

    Use hash table with predefined real names and e-mail addresses for short names.

commit 0c865c1d17dd5f238c915070bc34b50d989ee1a8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 5 02:02:34 2002 +0000

    Removed 32bit modes that were copies of the 16bit modes.
    Fixed typo.

commit 310a6dbc6ceeeb55dc26315344354ed6ad52d756
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 5 01:47:06 2002 +0000

    - Fixed keypad decimal with NumLock active.
    - Updated NEWS and ChangeLog.

commit 43bdd1cf585bdaa1d35f7ac26d8d6c0658918fdc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 5 00:27:52 2002 +0000

    'directfb_keynames.h' will be generated and installed for applications.
    It's a mapping from a key symbol to its name.

commit c7ed7abb18e8da8c4fc7b69e7798e05512d799f8
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 4 22:50:20 2002 +0000

    Updated README.screenshots.
    Added ppm(5) to SEE ALSO section in directfbrc(5).

commit bc098287f833cc1525c7fd0f794daf62596b5cbc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 21:51:20 2002 +0000

    Added option "screenshot-dir=<directory>" that enables PPM screen dumps
    when the <Print> key is pressed.

commit 1c6439e83ac7aa4f99e20cf72f401f3f9821a109
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 4 19:30:35 2002 +0000

    slightly reordered key identifiers

commit 48ce588c03281884d72fcf28bf5586c8247ea29f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 19:10:05 2002 +0000

    Added Meta/Super/Hyper  key_id <-> key_symbol translation.

commit 22294ea18414d86f8dbbb009e794f74f69ab499d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 4 19:06:38 2002 +0000

    Renamed DIKS_*LOCK to DIKS_*_LOCK and DIKI_*LOCK to DIKI_*_LOCK.
    Renamed DIKI_CTRL_* to DIKI_CONTROL_*.
    Added left/right versions of DIKI_ALT, DIKI_META, DIKI_SUPER, DIKI_HYPER.

commit de228abbd5e6f1c3c03197585d8579e95c1e34d9
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 4 18:40:22 2002 +0000

    Cleaned up dfb_utf8_get_char(), make it use the dfb_utf8_skip table.
    Declare the dfb_utf8_skip table as const.

commit 704f62e0fc0b2103dda1964a036dcb4578ec4bdc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 17:58:16 2002 +0000

    Added support for left/right shift/control via identifiers.
    Added support for special pc105 keyboards (adding Meta and Super).
    Fixed warning in v4l provider with gcc 3.1.
    Removed commented out and finally obsolete line in generic driver.

commit de854a002943ae90171402dadd2c94e6c8337107
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 4 17:28:03 2002 +0000

    Added more dead keys as found in X11. Ordered dead keys alphabetically.

commit 1bfa5e752f74877040fc9da4c3098dbda0a6d27b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 16:37:37 2002 +0000

    some day CLUT/ALUT support would be nice

commit 3c9f633f2cf3cdb60d8ed16fba624d2474736d51
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 16:35:49 2002 +0000

    Removed keycode TODO.

commit 9b4e55edbc80c0dac5e0f9720d84141ded707fea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 08:30:15 2002 +0000

    Two minor changes that help a lot getting DirectFB running for everyone:
    - Always 8 bit modes to the mode list, too, depth of fb.modes is ignored anyway.
    - Default to 16 bit if no depth is specified and first mode in fb.modes is
      8 bit while RGB332 support is not compiled in.
    
    The only way to have it not running now is to explicitly set "depth = 8"
    in the configuration without support for RGB332.

commit 5eb53b405bfb39ec69b9959030823b67db743473
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 07:50:59 2002 +0000

    #if 0'ed old code, added 40ms sleep after shutdown vt switch, too.

commit 8b416cf5b2d688768a9b93f84829d3d700e7743b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 07:16:50 2002 +0000

    Commented out 'normal' errors at startup, VT rewrite after release ;(
    Added time and date when core.c got built to initialization output.

commit 7f70c92cb454da3f8e34c1db664cbe5da3b27a74
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 06:40:01 2002 +0000

    Little tweak for format conversion blits (163 -> 192 MPixel/sec on G550).

commit a23b23684c7327c00d80133d35c8983b9d12ff89
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 04:44:49 2002 +0000

    - Added DIKS_BREAK.
    - Ctrl+Alt+Break sends a SIGINT now (like Ctrl+Alt+BackSpace a while ago).

commit f1210f3b5df058ac640c292bf6eb2196e1d3fe16
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 4 00:09:20 2002 +0000

    Return DFB_UNSUPPORTED in PlayTo if destination is double buffered.
    Increase buffer's video instance locking counter,
    buffer is sticked to video memory then.

commit c360aecb50380536650365daeda7fc94d259da86
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 3 20:04:17 2002 +0000

    Store cached kerning values as 16:15:1. Shouldn't be relevant but makes
    more sense.
    Updated NEWS file.

commit 4203c0d4c3549ecf1e82efc39a23a09a00c13cb1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 3 19:07:25 2002 +0000

    Fixed alpha channel detection in GetImageDescription, libpng seems
    to want pointers to width, height and bpp, too.
    
    Do some more cycles for memcpy test.

commit e84e55b070e1ebd5b114ab059ca2cdc4d7a4c174
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 3 18:06:42 2002 +0000

    dfb_gfxcard_state_check(): Always check front and back buffer policies and
    set acceleration bits accordingly.

commit 43fc6183f421faa71d52a3fcaaf2d851b60cc5da
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 3 11:39:22 2002 +0000

    Need to set SMF_COLOR not SMF_DRAWING_FLAGS to indicate the color change
    in IDirectFBSurface_Clear().

commit 536c033b21015f815e8a52d05e302d7474c8910b
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 3 10:32:20 2002 +0000

    In IDirectFBSurface_Clear() pass a copy of data->area.current to
    dfb_gfxcard_fillrectangle() since the latter modifies the rectangle.
    
    Added more const statements to the internal clip API to make it easier
    to understand what the functions do.

commit 781064fbbe86bac3be740e35cbf93634992f7269
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 3 09:52:15 2002 +0000

    Declared parameters that are not changed as const. Might help the compiler,
    definitely helps the developers.

commit ed705564e385163d567569cca442e2c00ca51af3
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Jun 2 14:41:33 2002 +0000

    Check the dimensions of the rectangle passed to dfb_gfxcard_tileblit().
    If an invalid rectangle is passed, print a BUG warning and return instead
    of going into an endless loop.

commit 6972582189162a212bf4b4c649dd22caa2ed1ef4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 1 06:07:17 2002 +0000

    Added IDirectFBSurface::Clear(), see the documentation details.

commit 7361a808a015ccbf4eb4d2b5311f775239b0cf93
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 31 22:09:03 2002 +0000

    fixed warning

commit e29329b5eb6fbce7a588638ee2de90075f807fb2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 31 00:27:32 2002 +0000

    Added function by Antonino Daplas, changing the buffermode of layers may
    work now, untested.

commit 49c46156985e8a015c565c6a1404b671a53a4f16
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 30 15:06:48 2002 +0000

    Sacc_to_Aop_rgb16 does aligned writes now, gives 1-3% on my Intel machine.
    Please test "df_dok --fill-rect-blend", add "--dfb:no-mmx" on machines with MMX.
    Also try the difference in system memory with "--system".

commit d44c08e053dfc12c7b343d20ea6a516bf87b89a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 30 09:22:05 2002 +0000

    argb-font is no longer required on G400 and above!
    
    Fixed A8 font rendering by enabling "Inverted Decal information" for A8 ;)
    (by the time I get used to those lighting flow charts)
    
    If G200 is detected, argb-font is set automatically,
    there's no reason anymore to set it manually the configuration at all!
    
    Set proper minify/magnify threshold, irrelevant change, but be correct ;)
    
    Fixed log2 for values that are a power of two, didn't change anything though.

commit 1c50df52bdeacb0d4d9965ff04a1ac7dc9b8b86a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 30 05:24:19 2002 +0000

    Fixed Delete on keypad.

commit 0fe554fef16883121d722e0c274b02dd67701408
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 29 20:12:30 2002 +0000

    Added IDirectFBInputDevice::GetKeymapEntry() which fetches a
    DFBInputDeviceKeymapEntry for a specific hardware keycode.

commit 16cd676ee88cb877ab22bdfbc40e40494bce98a6
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 29 11:37:40 2002 +0000

    Added autom4te.cache to .cvsignore (for automake-2.5x).

commit e198b34077ecbd24774e2a477f95db1503dd69ed
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 29 11:19:17 2002 +0000

    Added 0.4.0 version of savagefb that is supposed to add acceleration for
    fills and blits. Unfortunately it doesn't yet work correctly. Don't use
    unless you want to work on it.

commit dc3ea7323b15821d90e77d435f4be204bb8bd76c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 29 03:54:58 2002 +0000

    Savage driver release, untested for a long time.

commit 0d0ce309854b44036308c5d13380d36ecbef6557
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 29 03:11:06 2002 +0000

    Added prototypes.

commit 23f977ef22cc0e18a06f331b8c3dbc9fbbacd936
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 29 03:00:12 2002 +0000

    Use shcalloc() for the keymap and retrieve all entries once during
    initialization if multi app core is used.

commit 5036c688b856bebe51c489ce3536787ce0fa2ea4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 28 23:48:22 2002 +0000

    Added keymap support to input core.
    
    Added a driver function to retrieve a complete keymap entry for a keycode.
    
    Keyboard driver event thread is much simpler now, it passes the hardware
    keycode and if it has been pressed or released to the input core via
    dfb_input_dispatch() and the input core looks up symbol and identifier and
    handles modifier/lock masks. The keyboard driver then simply writes back
    the lock state to the LEDs.
    
    Added DFBInputDeviceKeymapEntry that will soon be useful with some API calls.

commit 7f745d5d895b1701c77ef11f9537273fe8555afa
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 28 17:52:36 2002 +0000

    oops, we need to call aclocal of course.

commit 05bd4992c6eff42b5a02579e1bb978fe32c8a58f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 28 17:46:47 2002 +0000

    Cleaned up autogen.sh and improved its output in case of problems.

commit f9d9d70846e12cc2a90103a7563c5e44ec736df8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 28 01:36:11 2002 +0000

    Fixed directfb-config.
    Converted debug printf to DEBUGMSG.

commit 1e252e691ab04b2132e9b4ba35f59b6d5c478928
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 28 01:06:51 2002 +0000

    Use the third argument of AC_DEFINE to pass descriptions for our defines.
    Removed unneeded acconfig.h. Works without warnings with autoconf versions
    2.13 and 2.53 now.

commit 09ecf7769ee27630530fd7e857410cbc03a22c9b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 23:39:19 2002 +0000

    Last commit included key_id to key_symbol translation (id_to_symbol)
    and generic handling of modifier and lock mask.

commit a5e45a13c94bb602a2c17cc82a7e3efb02f5fcd7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 23:37:46 2002 +0000

    Added DIKS_BEGIN.
    
    Removed key pad identifiers that are physically the same key as the numbers.

commit 4dde74c3ec979a5d8536f5339333719897b95159
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 19:54:31 2002 +0000

    really fixed now

commit e34ab408d35e1e9e225a34b6159b399e95da8513
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 19:48:56 2002 +0000

    Fixed PageUp/Down, Insert, Delete.

commit 3c25277fa396148619205f5ec05840f788623005
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 19:26:33 2002 +0000

    Fixed backspace, why does the kernel return 0x7f for backspace?

commit 999ccc88f695dc34e4c4b04389b51a990adfcc37
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 19:04:26 2002 +0000

    DFB_LOWER/UPPER_CASE was wrong

commit 340ad928119b29e658a188327a8a5d2333cd19d9
Author: Sven Neumann <neo@directfb.org>
Date:   Mon May 27 17:42:13 2002 +0000

    Completed the PAGE_UP, PAGE_DOWN, ... changes.
    Removed DIKS_KP_* symbols and NUMPAD DeviceKeyType. The numpad keys
    should return the same symbols as the 'normal' keys they respond to.

commit 2c778488d3e7538d2ef76014eac21b4d962294b6
Author: Sven Neumann <neo@directfb.org>
Date:   Mon May 27 17:10:06 2002 +0000

    PAGEUP -> PAGE_UP, PAGEDOWN -> PAGE_DOWN.
    Same for VOLUME[UP|DOWN] and CHANNEL[UP|DOWN].

commit 4003e3e97b682476de5df792bafe1d9cf500d2e1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 17:00:28 2002 +0000

    fixed macro compilation

commit 4b6073867b22b03480be3ec328dd1d0b1d7eebdf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 16:58:44 2002 +0000

    Added DFB_LOWER_CASE and DFB_UPPER_CASE which can be wrapped around a symbol.

commit 553b2fe5250614b5f5620a881bd1e9317456c24c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 27 15:51:54 2002 +0000

    Adding sophisticated keycode/keysymbol handling to DirectFB for more
    sophisticated applications like XDirectFB and the new keymap stuff in GDK.
    Writing input drivers for keyboards will also be easier.
    
    There are to types of key mappings, a basic one (the one before) which is
    suited for games and an advanced one for applications which need full
    coverage of the Unicode 3.x character space and the ability to query the
    keyboard layout.
    
    The DFBInputDeviceKeyIdentifier is now contained in "event.key_id" instead
    of "event.keycode". "event.key_code" is the hardware keycode which is usually
    not of interest.
    
    A new enum DFBInputDeviceKeySymbol is a super-set of the Unicode 3.x character
    space which is compatible to Latin-1, so "key_ascii" has been removed in favor
    of "event.key_symbol".
    
    DirectFB header files (which include "directfb_keyboard.h" now) are installed
    to "$prefix/include/directfb/". Applications honoring the CFLAGS within the
    pkg-config file should have no problem with that.
    
    Updated all copyright headers.
    
    The keymap stuff is still work in progress, but the functionality to have
    all applications running again already exists.
    
    
    Short porting instructions:
    - Replace keycode by key_id and DIKC by DIKI
      and/or
      replace keycode by key_symbol and DIKC by DIKS
    - Note that the remote control keys have been removed from the
      basic mapping to reduce overhead
    - Note that the cursor keys in the advanced mapping have a DIKS_CURSOR prefix
    - Note that the letters have DIKS_SMALL and DIKS_CAPITAL prefixes

commit 71562b701e1cb46b0fd4deca5ec97a3ee2c47f78
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 26 00:51:34 2002 +0000

    Applied patch from Antonino Daplas <adaplas@users.sourceforge.net> checking
    for CGA/MDA emulation before polling for the vertical retrace.

commit 963818681a4bcf82832ded96555595991274f32c
Author: Sven Neumann <neo@directfb.org>
Date:   Fri May 24 11:22:45 2002 +0000

    More work on the man-page.
    
    Converted C++ style comments to classic C comments where appropriate.
    Searching for '//' should now only show parts of the code that need to
    be reviewed.

commit e338cadea8fec47a6227819a8720a63f4509b5c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 24 08:51:58 2002 +0000

    Splitted desktop-buffer-mode text moving parts of it to the different modes.

commit d4d505a816aa77320def44bc7f1813d8be0eae80
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 24 08:35:25 2002 +0000

    Added planar pixel format blitting bug and G550 blending to ARGB bug.

commit 9ff8ad46a3969044f4e10c44b03b493ef9b1ae04
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 24 08:26:12 2002 +0000

    Removed unnecessary AC_SUBST.
    Changed z axis delta for Jogdial to 1.

commit 038143ba0b5ec6939d95011ffb48920d3632a815
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 23 22:07:46 2002 +0000

    Added a text to desktop-buffer-mode.

commit 5a15a26f0871c2f73d92dff89029a00ee6361b48
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 23 20:27:12 2002 +0000

    more work on the man-page

commit b7b1565e091e9808ed025b12f55f9d8d9fb98f84
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 23 15:25:33 2002 +0000

    Declare boolean config variables as bool. Renamed some no-variables to
    their positive counterparts. Added the possibility to use no- with lots
    of config variables.
    
    Changed "no-window-opacity" option to "translucent-windows".
    
    Changed the man-page accordingly.

commit d8b5dd288f00aaa4f7c0f489edad38b1a48884dd
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 23 14:22:23 2002 +0000

    described more parameters

commit c86f15abf1fb96aebf6d684cdd05ef0377ffb37e
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 22 16:03:28 2002 +0000

    Added index field to FontDescription that allows to control which face is
    loaded from a font file that provides a collection of faces.

commit d4c70094c14253342fe0156658f963c2c9189957
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 20 22:19:24 2002 +0000

    Added IDirectFBWindow::EnableEvents(mask) and DisableEvents(mask).

commit 3bb5277e3a26520cda181c11cfa48fea1bf2de11
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 20 19:53:47 2002 +0000

    Added reallocate_surface() todo.

commit bb28f1d51f9431b40cfd0a007f7ba19e468edc9a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 20 19:47:04 2002 +0000

    Support DLBM_BACKVIDEO in generic allocate_surface() for layers.

commit a7be4dd57e6f49811e85bd3c9d4114b3bf6d6fa0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 19 10:02:13 2002 +0000

    Set event class in dfb_window_dispatch() and dfb_input_dispatch() to be sure.

commit 1b5cf5acb4256aa407e0bb1623479e1fc5e36425
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 19 09:50:53 2002 +0000

    Fixed IDirectFBWindow::Close() sending no event that got broken
    during introduction of IDirectFBEventBuffer.

commit 79816203f88adbd69d604be17751e007640472e5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 19 01:20:41 2002 +0000

    Console acceleration, fixes coexistence with X, removed VGA cruft (not needed).
    
    You need to add "video=vmware:noaccel" to use DirectFB and do a Power OFF,
    it's a bug in VMware which is fixed in the VMware that is not yet released ;)

commit 6bf35201295b093deb9763fc9bf2c1a542499c6a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 19 00:19:47 2002 +0000

    Align system memory back buffer pitch.

commit 936df5dc741669735310540b728d78f94d140b7d
Author: Sven Neumann <neo@directfb.org>
Date:   Sat May 18 02:10:12 2002 +0000

    documented more options

commit 99ad8431b5d6047060f3c856ba6f5d28838bbbad
Author: Sven Neumann <neo@directfb.org>
Date:   Fri May 17 20:15:22 2002 +0000

    Define BINARY_VERSION as the earliest version that this release has
    binary compatibility with. Use BINARY_VERSION in MODULEDIR. Don't a
    version number in INTERNALINCLUDEDIR.

commit 4d24b43fd00f12adf32525a810c51cbc2c491d45
Author: Sven Neumann <neo@directfb.org>
Date:   Fri May 17 18:36:55 2002 +0000

    First draft for a directfbrc(5) man page. Work in progress...

commit 569a7c798b6734242fe2b356078a6413a6223b8a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 17 15:56:57 2002 +0000

    s/gz/bz2/

commit 6d9887419bccf96b5b9c4b248e2aaca063596df6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 17 15:56:13 2002 +0000

    newer version

commit 7824736e64c8dc311af553f807e08698adef8af5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 17 15:54:11 2002 +0000

    Forgot to increase the graphics driver abi version.

commit 720dbf9d69034aa244a32eec996c4b1cbac8b511
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 17 15:52:48 2002 +0000

    Added IDirectFBDisplayLayer::GetLevel() and SetLevel() which can be used to
    query/change the z order of display layers. Added DLCAPS_LEVELS.

commit c0ec058507214793182246bdccb66efb558bd251
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 14 16:38:32 2002 +0000

    VMware SVGA framebuffer driver to have DirectFB running under X in a window ;)
    Or fullscreen with XDGA (nearly as fast as native).
    
    http://master.dyndns.tv/vmwarefb.png
    http://master.dyndns.tv/vmwaredfb.png

commit 760ed61cbdf762adb98944a653b06e6657a1c5f8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 11 22:49:42 2002 +0000

    If the desktop buffer mode is backsystem, create system only window surfaces.

commit 830b77cdb50465ac5c227d1b392c0ead9b8b08cb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 11 22:34:20 2002 +0000

    Use fix_screeninfo.line_length after setting the mode to get the byte pitch
    instead of using the virtual resolution which may differ.

commit c594073eb52a05255223d7187c0ab0c4b26627ce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 10 19:03:18 2002 +0000

    Append version number to directories (e.g. '/usr/local/lib/directfb-0.9.11').
    Thanks to Fredrik Hallenberg <hallon@lysator.liu.se>,
    the Debian package maintainer of DirectFB.

commit aba286523dac3a90eab267e8f9d6717e23f24c1b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 10 18:27:34 2002 +0000

    Avoid locks during emergency shutdown, just turn off layers.

commit 70b29a6ef063ad1e7262294fa770403f035660f4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 9 23:06:04 2002 +0000

    fixed segfault on startup when no fb device is available

commit d9218192036fb2b26aef157725b8b1c54b69d097
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 8 00:29:06 2002 +0000

    Added IDirectFBWindow::SetStackingClass(). The default stacking class
    DWSC_MIDDLE. There are DWSC_LOWER and DWSC_UPPER, too. A window cannot
    be outside of its stacking class, so DWSC_MIDDLE windows are always above
    DWSC_LOWER windows and so on...

commit 11b188756cf3763c4a3ea8664578357335361227
Author: Andreas Kotes <count@directfb.org>
Date:   Mon May 6 17:10:53 2002 +0000

    set _BSD_SOURCE when using dietlibc - required for <linux/videodev.h>

commit cec7dac163926ec54c9cc4b2339b35e5b011ef4b
Author: Andreas Kotes <count@directfb.org>
Date:   Mon May 6 16:36:08 2002 +0000

    added missing include - required to compile with dietlibc

commit dcd40a772072fc2594a659c4dcd23828046abbd3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 4 12:13:15 2002 +0000

    dfb_gfxcard_drawstring() uses an extra state now instead of modifying the
    original state. This gives more performance for hardware accelerated text.

commit fb8b6ed36d26fb96bd989a6714c4f7edaecc6de2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 4 05:40:21 2002 +0000

    Implemented FusionRef for single app core.
    Fixed warnings from last checkin (when compiling with single app core).

commit ce09bfd061ac17bf2aae6b767f631fdfd3e762b7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 4 04:46:36 2002 +0000

    Workaround works better now, fullscreen apps are now usable with multi app core.

commit 59eb109e958ac837b298a79235d434b034cf5e70
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 4 04:10:54 2002 +0000

    Added "dont-catch" to usage string.

commit 63d3e8eae2d749908376923dd50b01a90dba50ea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 4 04:06:16 2002 +0000

    Added option "dont-catch" followed by a comma seperated list of signals
    that won't be caught by DirectFB's signal handler.
    
    Removed all takeover/transfer stuff from arena.
    
    Added 'emergency' indicator to exit functions of arena.
    
    Added 'emergency' indicators to all deinit/leave functions.

commit 6c3cc8dc6dbb6340abd8dbe95f6d246a973abdd6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 2 19:08:39 2002 +0000

    Made all shmalloc functions internal _fusion_shmalloc functions.
    Added new public functions locking the heap and calling the internal functions.
    Cleaned up initialization.

commit aefb2067862c7d0be509d09509ce68ffdcd4fa2f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 28 20:18:16 2002 +0000

    Disable console acceleration when joining a session, the framebuffer
    configuration of fusionees attaching from another tty is different.
    
    A small "dfbd" running as root but with a user's group now makes it
    possible to run XDirectFB completely without root privileges.

commit f87127297fa0cd22dec0c455f4100eb4cb84e7de
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 28 19:57:35 2002 +0000

    Do chmod after creation because of umask.

commit 1d8a540d86487524f9e5fefff78091b6a9ee5a01
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 28 19:31:41 2002 +0000

    Create shared memory with permissions 0660 instead of 0600.

commit f60bfa1cf0a6614198e86ba57cfc1171ba60f81e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 28 19:25:46 2002 +0000

    Fixed thinko in recent addition.

commit 5ee855da43e17e3bb69a1d8997eadbe3832cba3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 28 18:58:41 2002 +0000

    New option "videoram-limit=<amount-in-kb>".
    Moved PAGE_ALIGN macro to 'misc/mem.h'.

commit f9e864fd21995fcb7a4362bd9a085cf3eb571ca0
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 27 21:31:37 2002 +0000

    devfs support for libmpeg3 provider (try to open /dev/sound/dsp )

commit d17caee3ec023e207da1fd7ebd62817e19009176
Author: Sven Neumann <neo@directfb.org>
Date:   Sat Apr 27 19:09:28 2002 +0000

    Allow to disable libmpeg3 and flash providers at configure time.
    Updated README.

commit 0e9f8b46a42978ea63fe59c485d9404d5f09a8e3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 27 18:35:35 2002 +0000

    added a table of all vesa modes

commit 799c98f37125f45ffe25952131829f06695b462b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 27 18:22:26 2002 +0000

    minor update

commit c3c406ab3acb9244c51e83c12d7a188bb959056e
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 27 18:07:30 2002 +0000

    bugfix: set correct audio format on big endian machines

commit 81e423baa41a48f8d29ddebd188f497aa26bb6a2
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 27 14:55:59 2002 +0000

    removed libmpeg3 build hack, since the latest versions build a shared library.

commit f0aae77e40aa1d0640da3499c21e06cf05903293
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 26 02:29:51 2002 +0000

    Added 'dfb_layers_hook_primary()' that allows drivers to wrap/extend/replace
    the implementation of the primary layer. The driver can provide an alternative
    implementation for one or more functions of the primary layer and gets the
    original content of the function table to use existing functionality.
    The alternation grade ranges from "i-can-set-the-opacity" to "what-is-fbdev".
    
    It's now allowed to return zero in LayerDataSize(),
    primaryLayerDataSize() does that now, it had pseudo data before.

commit 21a0939b8e6956921014ef32ddb3b117232fab90
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 25 22:06:13 2002 +0000

    Savage Framebuffer driver release.

commit f1b161393be35153b428419c434d04863fe1e1cb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 22 16:57:32 2002 +0000

    released

commit d4dff8f06aecdc733e22fe66ebe198662ff32668
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 22 02:38:58 2002 +0000

    Toggle sign of Z axis when converted to wheel event.
    Multiply wheel value by 7 instead 4 when changing a window opacity.
    
    My wheel mouse seems to always send Z axis values between 1 and -1.
    Is it normal? Do all wheel mice behave the same way? Is my mouse ill?
    Why are 4 bit used (5 including sign) for this axis if it never moves
    more than 1 or -1? This is my first day with a wheel mouse and I have
    no clue. The mouse isn't running fast enough to have the wheel produce
    electricity.

commit bad03ce919bcc2c8518beb353abd4ff86d2dee43
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 23:09:07 2002 +0000

    minor optical changes

commit 1dae002829cb6f0d909f2b95ef0709079c6b3aa7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 22:49:15 2002 +0000

    some more NULL pointer checks

commit 7b767c7bbbc7ae6252017a6981c7a2d2040d59ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 21:31:36 2002 +0000

    Finished documentational summary of IDirectFB.

commit d87e54fba1addbb523315eedda359b069f85dfa4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 19:18:24 2002 +0000

    Added information about the primary surface and the cooperative level.

commit f25b7b02c84f555f4dcf9270bd424f73c3608c11
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 20 18:37:56 2002 +0000

    align destination in color keyed blits, instead of source. this is much faster since the destination lies most likely in video ram.

commit b9e1709e0b40876459c8e898d7c97f26d54df094
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 18:11:35 2002 +0000

    Enhanced reference manual generation, wrote initial summary for IDirectFB.

commit 93772fc4328ce274d5e7b4479fe96ab4ddb4d1e3
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 20 15:12:03 2002 +0000

    tweaked recent code a bit, which further improves performance on intel with
    mtrr, all other benchmarks showed no difference, thats why they are not listed.
    
    df_dok --stretch-blit --dfb:no-hardware
    
    old new code
    PII-350     Matrox G400  MTRR on  : 61.46 MPixel/sec
    
    new new code
    PII-350     Matrox G400  MTRR on  : 68.13 MPixel/sec

commit 25a4aa160d95291d6ebb6721919fad019dbb3449
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Apr 20 14:30:49 2002 +0000

    optimized 16Bit StretchBlit in generic driver, see below for results:
    
    df_dok --stretch-blit --dfb:no-hardware
    
    old code:
    
    PII-350     Matrox G400  MTRR on : 60.09 MPixel/sec
    PII-350     Matrox G400  MTRR off:  9.93 MPixel/sec
    PPC G4-500  ATI Rage 128	 : 13.20 MPixel/sec
    
    new code:
    
    PII-350     Matrox G400  MTRR on  : 61.46 MPixel/sec
    PII-350     Matrox G400  MTRR off : 19.73 MPixel/sec
    PPC G4-500  ATI Rage 128          : 26.33 MPixel/sec

commit 72d9539448d50f6118ca7735575f022649b9255e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 07:45:33 2002 +0000

    Set reaction list pointer to NULL when freeing an orphaned node.

commit 1f18902bbc4ee2624e9443ebf89b479d6af65c40
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 05:10:08 2002 +0000

    Focus handling fixes and improvements in case a window appears/disappears.
    More code cleanup and documentation.

commit 0b45ebd3b9f36a18ecc16af52e432c5b2765ccdc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 20 03:49:11 2002 +0000

    Window stack code cleanups.
    Better stack locking.

commit 4fe3c5c11e6e39d67f627dac98909dfef506e4fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 19 20:55:20 2002 +0000

    Shared memory reinitialization has been done.

commit ef6fb401355ec3af42cb80a6a02ed742e6af8940
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 19 17:38:44 2002 +0000

    Free shared layer driver data in dfb_layers_shutdown().
    
    Changed fs type from "shm" to "tmpfs".
    
    Added temporary workaround for partly implemented FusionProperty
    in multi application core.

commit 174212f3dbd824a41acfebac25c8f5cf6d45db5d
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Apr 19 12:10:03 2002 +0000

    (dfb_layers_shutdown) return if no layersfield exists. Fixes the crash
    that occured when dfb_core_deinit_emergency() is called during initialization
    before dfb_layers_initialize() was called.

commit f4dda84294528ba7cd9149ff8b09910357b9f88c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 18 23:49:46 2002 +0000

    Fixed a very stupid code block moving error.

commit ba258b12e17d34a6c3cd88a1f8ca191eceaed55c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 18 20:48:59 2002 +0000

    Added more cleanup code, less IPC resource leakage after shutdown.
    Commented code in some functions.
    Added more assertions.

commit 804359958fec099238fa074d1f373a8eb5327a23
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 18 17:39:48 2002 +0000

    Added tmpfs mount point detection from Sebastian Klemke <packet@convergence.de>.
    
    The shared memory area is now reinitialized during startup if it already
    existed, but with no DirectFB apps running.
    
    Removed some unused code.

commit 1a2964dcdb6ef1407520e1c19220b000f567ec7c
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Apr 17 11:03:14 2002 +0000

    Changed internal functions dfb_copy_buffer_32() and dfb_scale_linear_32()
    to take the destination pitch instead of the difference between width and
    pitch.
    
    Added a destination rectangle to IDirectFBImageProvider::RenderTo().
    
    Added IDirectFBEventBuffer::HasEvent().

commit 48499cf48932698cee4032998f76628e89dc2669
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 17 05:10:33 2002 +0000

    Added missing incrementing of source pointer when doing alignment for
    colorkeyed blits. Made the source pointer the preferred aligned one.

commit 9c183cd594327f688b6ab8594198e75eedd2fc54
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 17 04:00:37 2002 +0000

    Added details about surface manager and multi app core.

commit 168c208e82b83f321a178eb0047447cf200613e2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 17 03:04:15 2002 +0000

    Compilation fixes for multi application core.
    
    Unimplemented multi app FusionProperty is currently mapped
    to FusionSkirmish, that is ok for non-fullscreen apps.

commit bf576dd984538ced1a23f8891932292a7e1b1534
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 17 02:34:18 2002 +0000

    Debug version compiles again.

commit cae5a9fe7d56492b69aebfd3eb748d1927ddd8db
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Apr 16 10:06:09 2002 +0000

    purely cosmetic change (indentation)

commit 6862454bbe235168756aefaac5798af1d388f5d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 15 15:19:04 2002 +0000

    Set width and height to zero if one of them is zero or less
    in dfb_rectangle_intersect and dfb_rectangle_intersect_by_unsafe_region.
    
    Added some comments.

commit e602b2eabb5c95886111a47095c1b84268c7b36d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 15 15:16:29 2002 +0000

    Be more tolerant in GetSubSurface. Allow width or height to be less than
    or equal to zero. The created sub surface will never do drawing/blitting.

commit d51012be152e5259c0a48f559b09ee0e63de3e21
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Apr 15 15:14:31 2002 +0000

    Let CapsLock key events through.

commit 163f1ef0fb7f10284e35f60acefb717ba61e0bb9
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Apr 15 10:12:45 2002 +0000

    Added missing includes and changed include order.

commit 9e76194b47fa3ee2cea1a63d75e82fa472a0fc51
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 22:37:25 2002 +0000

    Do not flash LEDs when holding Lock keys. Toggle once the key gets down.

commit 5bd7a1d5c842a58bc5004433e29d48300ac069c8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 21:22:56 2002 +0000

    Forgot a bit in DWOP_ALL.

commit ef6b0a2a51ed55bcbe99548786bf989d4631792f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 21:11:30 2002 +0000

    Added new window options to disable moving,
    resizing, stacking and destruction by wm hack.
    
    Added window option that turns the window into a passive
    output only window (DWOP_GHOST). It will never get the focus
    or any input events, clicks will go through. This is useful
    for status OSDs or subtitling via transparent windows.
    
    Added IDirectFBWindow::GetOptions().

commit ac1ec8789c0ea55def8b0058086a1578d1715a4a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 18:49:15 2002 +0000

    Bye bye probe context and font module probing TODOs.

commit c50ec36f8105fa6932e60a210f19cbc82347779d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 18:46:01 2002 +0000

    Added probe context structs for all interfaces loaded from modules.
    All parameters are stored in this struct giving more extendability.
    
    Added default probing function 'DFBProbeInterface' that can be used
    for 'DFBGetInterface' as the 'probe' function.
    It simply calls the implementation's Probe function with the given context.
    
    Reduced code size in IDirectFB, cleaned up and documented code.

commit d62bcdf03adc430088ac6a083aac9693b23a7b43
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 10:16:16 2002 +0000

    Added sanity checks.

commit cefa79f5ab81b813face8b0aa982ca5d9c006123
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 10:11:20 2002 +0000

    Added IDirectFBDisplayLayer::SetCursorAcceleration a la XChangePointerControl.
    Removed acceleration from PS/2 driver, new acceleration is done in window stack
    code. Reading from input devices directly will return unaccelerated movements.

commit f7fde954ebb427f98238e144a4a23b10f6e273fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 09:04:47 2002 +0000

    Added DIAI_LAST and DIBI_LAST.
    Added more argument checking in IDirectFBInputDevice,
    use new constants for array sizes.

commit 3a9d6162325c744474b72313ffd74976b32b83e5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 14 01:04:26 2002 +0000

    Fixed debug enabled builds.

commit 3edf00c03c1dd6b4de918d63d1109f243711bbb8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 13 22:22:50 2002 +0000

    Added DFB_DEALLOCATE_INTERFACE saving two lines of code in the
    Destruct method of each interface.
    
    Cleaned up deallocation of interfaces after Construct failed.
    Currently Construct methods have to call DFB_DEALLOCATE_INTERFACE
    before returning an error.

commit 8c70bf80dfac32f13ef6916c556e02f6d4d14c32
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 12 23:42:52 2002 +0000

    Reworked display layer driver handling.
    
    Core structure DisplayLayer is no longer exported.
    Added structures for driver functions and information.
    Drivers call 'dfb_layers_register' during initialization.
    
    Generalized surface creation/reallocation of display layers.
    Display layer drivers are cleaner now.
    
    Cleaned up layering code and added missing functions.
    
    Experimental mouse acceleration in PS/2 driver.
    
    Added options "mode=<width>x<height>" and "depth=<bpp>"
    which select the startup mode and bit depth.
    
    Bit depths of fb.modes entries are ignored now when looking
    for a requested mode. However, the default bit depth is the
    one of the first entry.
    
    Added new fusion primitive 'FusionProperty' which is a lock
    that automatically chooses between lock and try_lock behaviour.
    Two different locking methods can be used for short locks, e.g.
    window stack repaints, and long locks, e.g. exclusive layer access.
    Both methods wait if the property is 'leased' and fail if the property
    is 'purchased'. There's no implementation for the multi app core yet.

commit 0f475e2974c55ea822dbeb8776a771e274d18ed4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 11 01:51:01 2002 +0000

    Added missing unlocks in dfb_surface_reformat_surface().
    
    Return success in dfb_surface_reallocate_buffer() if video instance
    reallocation failed but a system instance exists.
    
    Window resizing deadlocks seem to have gone.

commit a1b4a53c699ad3950def100ff52c22f8b19d2b97
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 5 14:35:16 2002 +0000

    Small fix for multi app core compiling.

commit e0e69bf55dc09c73980678179b8babbf6aee5012
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 26 09:38:23 2002 +0000

    Tweaked surface buffer locking again, fixes the slow software stretch blit
    after hardware blitting the same surface. So it wasn't the missing '-O3'.

commit d6d72af7cccf193a5c7578e7f9ac08f8dc41c47e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 26 04:16:31 2002 +0000

    Added a 40ms sleep after switching VTs. It seems to fix mouse problems
    when starting applications from XFree. I know it's a hack, but it should
    go away after VT handling rewrite.

commit 99fae4937ac6311951f21cdf9cd27e0cda56bdc5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 26 04:03:11 2002 +0000

    Enable -O3 for debug mode, too. Stretched blits are REALLY slow without it (1-2 MPixel).

commit d26ef5e654fa37f879ba9e86a3722130c8709334
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 26 03:28:18 2002 +0000

    Moved a bit code from keyboard driver to vt handling where it belongs.

commit 9574856de3336520e8f3faaea5209b9f99aa6720
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Mar 25 19:56:34 2002 +0000

    Added support for vertical kerning.
    Release the FreeType2 library when the last font provider is released.

commit e4a333e81f9570ddc6996911517623175a040708
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 24 20:11:08 2002 +0000

    Fixed software driver pixelformat tables (NULL padding).
    
    Commented out old code in dfb_vt_shutdown.

commit 16a7aabe83d9ed0f42d1a9d65ec4941c16fd981c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 24 13:46:50 2002 +0000

    Do TIOCNOTTY on /dev/tty0 instead of file descriptor 0.
    This way XDirectFB works when started from linux console,
    but I don't know why only XDirectFB failed. Don't know either
    what TIOCNOTTY is, neither TIOCSCTTY. Time for a VT/TTY handling
    rewrite in DirectFB.
    
    However, I added perror messages in case TIOCNOTTY or TIOCSCTTY fails.
    
    Strange result (df_window and XDirectFB show same behaviour now):
    
    from xterm:                       both ioctls fail
    from linux console:               second ioctl fails
    from linux console (with strace): first ioctl fails
    
    
    Removed tcflush calls from PS/2 driver (inappropriate ioctl).

commit 0a31512139db792d35e6765828cd6957d3eaccb8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Mar 23 04:18:19 2002 +0000

    Fixed a bug that may have caused broken pulldown menus in GTK!
    
    handle_enter_leave_focus() did not check if the pointer is grabbed.

commit c58a746bbf93d8b123397f913cc0e4d1d65f185f
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Mar 22 19:21:24 2002 +0000

    Removed -disable-static from LIBADDs.

commit dade4c121038d74eeee6e4d16fad611f9fbbf7ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 22 19:21:08 2002 +0000

    Added Martin Mueller to "Thanks To" section.

commit a534c95527a981a327069c20c7e30ee3455d9f84
Author: mm <mm>
Date:   Fri Mar 22 18:30:17 2002 +0000

    Added brightness control to neomagic video overlay

commit d8aee35c23aa4e3aa9dfd0c2a19c58cc8d723141
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 21 22:03:19 2002 +0000

    added two lines

commit e400747012c5327f45ea15ce65739fc429c61e3c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 21 21:59:58 2002 +0000

    Fixed crashes that sometimes occur during window resizing when another
    thread is repainting the window stack.
    
    Print caution message after failing video instance reallocation only
    if there is no system instance. If there is a system instance mark it
    as valid.
    
    Removed redundant macro in 'layers.c'.
    
    Added same debug checks to gAcquire() as in dfb_gfxcard_state_acquire().
    
    Added dfb_get_millis() which returns the current time in milli seconds
    after DirectFB startup (after first call of the function actually).
    
    Added PID and milli seconds after DirectFB startup to debug messages.

commit 69923f4fd7ab06624e25cc1305c08a200cca0ff4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 18 21:05:08 2002 +0000

    Added dfb_sig_block_all() which blocks all signals and should be called
    at the beginning of each input thread. Otherwise signals may
    arrive at the input thread which in turn (in signal handler) cancels
    all input threads (including itself) during emergency shutdown.

commit 62774c5dc22e87c00f57c2262f21f9f468b63c19
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 06:25:52 2002 +0000

    Added scrolling or panning for virtual window/layer sizes.

commit 288a47c187973b802b2c283089aac20c0ac65ba0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 06:03:18 2002 +0000

    Treat windows with color keying enabled as transparent, so the background
    gets cleared.

commit 68d0e053d1e62fd5ff48c37f5acdff89120c69ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 05:32:10 2002 +0000

    Reading from a surface with auto video policy which is stored in video
    memory no longer pulls it into system memory.
    
    Changed surface reallocation behaviour. Surfaces already in video memory
    stay there after reallocation.

commit 1fd7149444c915d94088359e9dbdfc5d0d24c693
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 01:41:05 2002 +0000

    Removed color keyed window entry.

commit 9add3be4545bcacca791e9f0c0a4d6d2fce1c54e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 01:40:31 2002 +0000

    Added color keying for windows (e.g. for shaped windows).
    
    Added DFBWindowOptions having DWOP_COLORKEYING for now.
    Added IDirectFBWindow::SetOptions and SetColorKey(r,g,b).

commit 52c10bf0bdf2d586bc180a4e99591850ea9ab8e9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 01:34:05 2002 +0000

    Removed debug printf I forgot.

commit 8f3b8e6684d3f1818dee99aecc43d9e276c1868d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 17 01:23:27 2002 +0000

    Fixed colorkeying with simultaneous blending for ARGB surfaces
    in software and Matrox (G200+) driver.

commit 6fc577b390825d9485647663764901968c7647a8
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Mar 16 22:57:36 2002 +0000

    - removed the paragraph from README mentioning the aty128fb and nvidia patches.
    - removed neofb patch from Makefile.am

commit c5e0f68173314f88025aa77e710d62bfe7ab8d59
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 15 17:20:15 2002 +0000

    Deinitialize layers in emergency shutdown (e.g. segfault).

commit 8081642950608b191a62abdac98e962212535fa1
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Mar 14 01:57:53 2002 +0000

    - use lookup tables to convert rgb332 2/3bit color channels to precalculated 8bit values. now blending in rgb332 looks much better without affecting performance.

commit 1bdd7d76169f8b9b717aaaf3c6f9490a0af78f33
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 11 23:54:08 2002 +0000

    Finally neofb got itself into 2.4.19-pre3 ;)

commit 47883aef17661928d0262d6d6d976e586d4c5726
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 11 00:28:31 2002 +0000

    Sorry, the next time I will compile before committing.

commit fb2a87d28215f4686b3d76fad8e792ebadabb089
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 11 00:12:20 2002 +0000

    Removed to old lines that caused doubled and interlaced modes not work.

commit 04294d2509468c82efdad20d6ce27155fda79bd8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 10 06:02:13 2002 +0000

    Minor cleanup, converted defines to enums (CoreSurfaceHealth/Policy).

commit 90a1d2c30f7d918bcf0c5b6af6f38779afd15938
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Mar 9 01:51:53 2002 +0000

    Removed one ;)

commit 0186511929177764a81fe801fc729891a27741c8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Mar 9 01:49:58 2002 +0000

    Shift 8bit values to the right in RGB15 and RGB16.

commit b1a998298a8bdd52271d9d65b030572b922ebf12
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Mar 9 01:38:50 2002 +0000

    Implemented destination color keying.

commit a59b4e4c2a758add47f1ff0d0548c0315544761d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Mar 9 01:38:02 2002 +0000

    Changed internal parameters.

commit afb409bf8987ea6e65e4fcece2b53c197845b342
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Mar 9 00:00:44 2002 +0000

    Added destination colorkeying for display layers.
    Not implemented by any driver yet.
    
    IDirectFBDisplayLayer::SetColorKey() is now called
    IDirectFBDisplayLayer::SetSrcColorKey().
    
    Added IDirectFBDisplayLayer::SetDstColorKey().
    
    DLOP_COLORKEYING is DLOP_SRC_COLORKEY now.
    DLCAPS_COLORKEYING is DLCAPS_SRC_COLORKEY now.
    
    Added DLOP_DST_COLORKEY and DLCAPS_DST_COLORKEY.

commit 7b85900d1bc91c8115096d7107afc661ab5700b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 8 03:45:13 2002 +0000

    Added some more useful things needed before feature freeze.
    Updated ChangeLog (no, it's not a release yet ;)

commit 4099c9508b19e098f5bbcea7577d7775ef9e7f09
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 8 02:59:41 2002 +0000

    More important TODOs added for 1.0.

commit dbc51a67ccaae66da4419a0a57dabf8f95af20d1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Mar 8 01:41:00 2002 +0000

    Added window resizing wm hack, press 'CapsLock + Strg' to resize with the mouse.
    Fixed a deadlock in dfb_surface_reformat.
    Changed window stack update strategy when resizing,
    great thanks to Hallvar Helleseth <hallvar@ii.uib.no>.

commit 5e66812843765d9467935ace481d890b8774d297
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 7 23:18:08 2002 +0000

    Disable static libraries by default again, builds twice as fast.
    Added AM_CONDITIONAL for static library stuff in src/Makefile.am.

commit 8c015d5b480ac81f0c5d3cf186b7c77e59f9f5f7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Mar 7 23:01:21 2002 +0000

    Acquire locks for front and back buffer in dfb_surface_destroy before sending
    the destroy message and destroying it.
    
    Removed now obsoleted Unlock from IDirectFBSurface's surface listener.
    
    Made dfb_surface_reallocate_buffer use free/malloc again,
    realloc is too slow and the data will be foo anyway.
    
    Added 'CapsLock + D' which destroys the window under the cursor,
    this is the force version of 'CapsLock + C' (close).

commit 238d307d8f5f59dd281346a429d89d5030135ba2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 5 20:21:12 2002 +0000

    Fixed CheckState, it was broken for unsupported drawing/blitting functions.
    Reenabled workaround for blitting.

commit ea1b3af46739b2a4779591c95dec70b66164307f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Mar 5 19:50:52 2002 +0000

    Only check for libdl if shared libraries are enabled.
    Show shared/static in summary.
    Include "$LIBZ -lm" in libpng check.

commit 813eb86e1c8102b5df8d3462e07f9cf843bcac9a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 4 20:03:35 2002 +0000

    Check for empty region before calling update_region.
    Empty region check at beginning of recursive update_region is a DFB_ASSERT now.

commit ab8bee4afc46df015c7630119c6265cf41fb73bb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Mar 4 19:37:56 2002 +0000

    Added union parsing (treated like structs).

commit de5f5b443311a84c66dba6d12c6373c89d1ab502
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Mar 3 05:51:31 2002 +0000

    Wrote SonyPI Jogdial driver. Sony users with a Jogdial can now use their
    jogdial as a wheel (Z axis) and middle mouse button.

commit f3d93fe8b7b87eccc1b3222c108dbb625792352b
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Feb 25 21:08:02 2002 +0000

    removed aty128fb patch (it is included in 2.4.18)

commit 0aba6c295d2faf2474516edef7d7dc8893050893
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Feb 25 14:53:09 2002 +0000

    fixes for autoconf-2.5

commit 5f4705cc3f8a694818d79e2162612e9c00981663
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 25 04:21:28 2002 +0000

    Don't catch SIGPIPE.

commit 6acb7723863d829a686dba39d0472127217e4849
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Feb 24 20:24:54 2002 +0000

    Added IDirectFBWindow::PutAtop and IDirectFBWindow::PutBelow
    that can be used to restack a window relative to another one.
    
    Added DFB_ASSERT which prints an error message and causes a
    SIGTRAP if debug is enabled during configure.
    
    Cleaned up window restacking code in core. Reduced code size.
    
    Version is 0.9.10 now.

commit 4e631d9ad716af9ee7e9b8d1cd86876110af4d6b
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Feb 20 14:41:15 2002 +0000

    only build neomagic driver on i386 platforms. (let me know if there is a neomagic chip in a non-i386 system somewhere on this planet)

commit 74560c1e302af2834c7e9b1db782ad3ee14c6d80
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 20 14:39:45 2002 +0000

    Updated for 0.9.9.

commit a82b9e767a524b540c5d5cd0c4b44bcd547d8682
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Feb 19 20:03:20 2002 +0000

    some updates, could need more

commit 8ed8ab12720ba2386d933874ca551a04ada8d108
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 19 18:05:32 2002 +0000

    And here the complete log entry:
    
    Applied patch from Enno Brehm <enno@convergence.de> that adds dlopen'ing
    of the main library with RTLD_GLOBAL.

commit 9d281a92ba7996a62ba63a9d2ffc738aa28d92e1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 19 18:03:33 2002 +0000

    main library with RTLD_GLOBAL.

commit c344d81d0984a7ff184647a49f5e9b1905ef7805
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Feb 19 18:02:36 2002 +0000

    *** empty log message ***

commit 77195a08ba0bb862cc8f9e59f42873b7f0486ef0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 18 22:03:56 2002 +0000

    Reset display layer ID pool so the primary layer gets '0' even after
    reinitialization of DirectFB.

commit 72f1700276272f12d68b16c0eda9a16cc10b3b51
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 18 21:24:51 2002 +0000

    Forgot to add the new event class to two switches.

commit 7cf85726e390e90cc99bd54cfcde218722e76987
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 18 21:10:00 2002 +0000

    Forgot to assign function pointer.

commit d8c8ce289ce8d9d89227eb24cf1fe2b551611043
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 18 21:00:50 2002 +0000

    Added new event class DFEC_USER and a struct DFBUserEvent containing an
    unsigned integer and a pointer.
    Added IDirectFBEventBuffer::PostEvent which can be used for any event class.

commit ff6888be29a9f1306132d30e09ba2d8bd718fa2a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 18 14:15:20 2002 +0000

    Allow IDirectFB::CreateEventBuffer with DICAPS_NONE.

commit f6dae7cfc0bee23c4e819d44c68c99bf60fa65d0
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Feb 15 13:35:24 2002 +0000

    Even more keycodes for yet another remote control.

commit 859c8b1f00a9ccb5dd605abdda844c2811b5bab9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 15 12:23:49 2002 +0000

    Added NeoMagic YUV Overlay support ;)
    
    Added simple YUY2 -> YUY2 blitting for NeoMagic.

commit 994fc80e1f041fff6cd48f5ea8370086896b7335
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 14 16:38:25 2002 +0000

    More code beautification, more code documentation.
    Simplified some parts.
    Fixed setting primary layer's configuration that I broke last night.

commit 16a2cc9ec8e2d04652a2bf40924f1e6976264fda
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 14 03:32:49 2002 +0000

    Shrink SetConfiguration to 3 lines here, too.

commit d9cfb0964c36175df2fc8b8d549817d83b297c90
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 14 03:27:16 2002 +0000

    Added dfb_layer_set_configuration to simplify the driver's SetConfiguration.
    Beautified code a bit. Removed all shfree/shmalloc hacks (use shrealloc now).

commit d3697ac25d28f660059d96a1218f3e4fc5dffcf2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Feb 14 00:07:56 2002 +0000

    Grey pad keys get through now even if NumLock is off (div, mul, etc.)

commit 2a20c3ba5357725d61d8c88ab208458900f3592d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 13 16:42:46 2002 +0000

    Made 'no-sighandler' and 'no-deinit-check' overrideable
    via 'sighandler' and 'deinit-check'.

commit 95d830a62bcdd9e9e5e5f678240879fcc8dca1e7
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Feb 8 17:06:39 2002 +0000

    Removed special keycodes for the IPAQ and added some generic new ones.
    Remapped IPAQ keys.

commit d20df7e0c76e233a2572e59390620365231a78a4
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Feb 6 11:18:30 2002 +0000

    (IDirectFBSurface_TileBlit): fixed tiled blitting for subsurfaces.

commit bd19c56d83147f800999f427888539d6733d7c1b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Feb 6 06:20:53 2002 +0000

    Call graphics driver deinit in signal handler again.
    So overlays shouldn't stay visible after segfaulting now.

commit aaa7273542a2f7969353ed9defc229e0a8b30098
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 4 13:54:21 2002 +0000

    Wait for idle accelerator if software wants to write into a surface that
    has been read by hardware (read access by hardware may not be completed).

commit f420a5d20d1e85c139a89cdff35f2de913c30257
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Feb 4 11:51:31 2002 +0000

    Removed directfb-avifile.pc and directfb-swf.pc from EXTRA_DIST.

commit c38be4a889f7b7c2ac16e2bbf3c68b64323644b0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Feb 4 11:45:24 2002 +0000

    Applied patch from Till Adam <till@adam-lilienthal.de>.
    - Adds DFBInputDeviceLockState (DILS_SCROLL, DILS_NUM, DILS_CAPS)
    - Adds IDirectFBInputDevice::GetLockState()
    - Adds locks to input and window events
    - Keyboard driver handles locks and LEDs

commit ebcbe8bee66d872b3e13c2ee535a4c50426ea1eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Feb 2 00:57:28 2002 +0000

    Check pixelformat in CreateSurface.

commit 5b0bc27342e51e4f447c8d6e663e818906238961
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Feb 1 03:00:00 2002 +0000

    Fixed segfaults in reinitialization.

commit c8ba6ba67d32902ae32022ff616f877a8ae108ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 31 15:43:56 2002 +0000

    Removed shmalloc debug printf.

commit e71d89c1712d75d009bed54a9893825fbdab729c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 31 15:38:58 2002 +0000

    "ref_*" -> "fusion_ref_*" and code beautifications.

commit f31fce3221e4c2562a9824972c304f9d311137ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 29 17:08:06 2002 +0000

    Should have fixed DirectFBCreate after last IDirectFB::Release.

commit d2168e782a2735b4f983450f59921c36870e0fee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 29 16:58:53 2002 +0000

    Only include shmalloc sub library when building the multi app version.
    Thanks to Till.

commit 0c0299c88efad433a34a50ed3eb5024df33b8365
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 29 15:41:19 2002 +0000

    Completely rewritten shmalloc stuff based on libc5's GNU malloc.
    It now uses tmpfs (former shmfs) that needs to be mounted at /dev/shm:
    
    mount shm /dev/shm -tshm
    
    
    It uses open/mmap and ftruncate/mremap similar to brk ;)

commit e3f65da9a85fc83b26326dabbfd875fbc96b4e6d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 28 14:49:23 2002 +0000

    Builds with newest version libmpeg3 (1.5).

commit d1c250b20a520584c702f3e4c045577cb88d0f1f
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Jan 27 20:20:58 2002 +0000

    changed some comments to be (hopefully) more helpful

commit 86b8ed3b2619e7f0c5ece68ef945c4fbf029308a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 27 16:31:40 2002 +0000

    IPAQ button support by Ara Hacopian <ahacop@anthrotronix.com>.

commit b3ce1854b1d69d599f2563200d3bd94bb71c34ac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 25 00:38:59 2002 +0000

    neofb 0.3.1 is now in 2.5.3-pre4 ;)

commit afb5651e6136047bc5d1187c8c010064b3f2c0f1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 24 23:03:35 2002 +0000

    two variables removed

commit fa92dcbd3113f5459c9f7de31183ff0567416c5b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 24 21:15:03 2002 +0000

    directfb-avifile linking hack is no longer needed due to recent changes
    in module loading.

commit d03c0c2036aba94b2a6d0cd0190121c2e0a9f370
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jan 24 19:20:56 2002 +0000

    use waitidle again on ppc

commit bbbed9482ec086f8c6364a806c9cd297384cae2d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 23 16:09:11 2002 +0000

    New version, nothing important, just added module license (GPL of course).

commit 8a4df58565253899be4fafe3e8a42d9bf4ae5c7d
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jan 23 15:49:16 2002 +0000

    oops, forgot to remove a debugging printf

commit 5d18107c984d9ce0195b826ad1f719620ae0bb08
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jan 23 15:08:38 2002 +0000

    Changed DirectFB command-line parsing:
    The only recognized options are --dfb-help and --dfb: follow by a
    comma-separated list of DirectFB options. The format of the options
    is the same as used in the directfbrc file.

commit 676c3031ae325eb07eb57bbcfb0f272aa570ddac
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 22 15:42:09 2002 +0000

    Set $PREFIX only if it's unset.
    Take care of preset $CFLAGS.
    Use $PREFIX consequently.

commit 26f7835acdc8de0395041ef5b97bbdad130a4b82
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 22 14:48:19 2002 +0000

    Applied patch from Daniel Mack <daniel@convergence.de>.
    The environment variable "FRAMEBUFFER" is used now if set.

commit 0fad3330f0fb3778e8fccf909fbfdc05395438e5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 22 14:44:42 2002 +0000

    Applied patch from Topi Kanerva <topi.kanerva@eke.fi>.
    Under certain circumstances rectangles didn't get filled or drawn.

commit b5cc5f5529ad1d0e61f8ffcb4e07251b3918786b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 22 09:22:57 2002 +0000

    Build libmpeg3 provider using gcc, ld did not include our constructor.

commit 8085daf92b9bb080b292c99683ff5666486e414b
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 21 16:59:15 2002 +0000

    Try to access files before creating a video or font provider for them.

commit 5bf2651c13f1153908af552f6c8658e95180b401
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 21 15:25:25 2002 +0000

    No need for stdio.

commit c7f8af380f1f71e9093735e4cc9c0ed2b649f7ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 21 14:36:51 2002 +0000

    Replaced all "sprintf" calls with "snprintf" calls.

commit d04c25e331cfb739dbdfb2d44168acb82e458a8c
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 21 12:11:02 2002 +0000

    Don't parse --help out of the command-line arguments in order to allow
    applications to provide more useful help here.
    
    Added new function DirectFBUsageString() which returns a string
    describing the DirectFB command-line options.
    
    Output DirectFB usage information and quit if --dfb-help command-line
    option is given.

commit 25c48c57661939df874fe9be445803e755a48099
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 21 10:25:06 2002 +0000

    Added "static class Foo { public: Foo() {} } foo;" to have our C constructors
    included in the library.

commit b88c31d769fecc96453d7af47138d9b69c21810b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 20 22:08:36 2002 +0000

    fixed segfault

commit 63bff4ecb4e0311e6e9760746d896606ad520084
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 18 13:08:09 2002 +0000

    Fixed initial DWET_POSITION_SIZE event.

commit db8305f0dbac1d3742bba83456a00545ee5a2f35
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 17 14:46:02 2002 +0000

    Added static linking support. Minor changes to driver and interface modules.
    
    An example of how to link static applications with choosable drivers and
    interfaces is the script 'dfb_static_build_example'.

commit 4645addcf14f928958868fb9d99eb9cf8a0af21e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 16 15:11:48 2002 +0000

    updated EXTRA_DIST

commit a13b94a52a9094a14afdebfcd2e980584333517a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 16 14:45:54 2002 +0000

    two more includes

commit 312218cac8124dca58911ed5ddbe18e52abd63b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 16 14:42:43 2002 +0000

    Fixed stoned '.c' includes.

commit 5c2b06603590c8e422147e4e039235729cb033c2
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jan 15 21:33:48 2002 +0000

    Added new background mode DLBM_TILE that works similar to DLBM_IMAGE
    but tiles the background image instead of stretching it.
    Added new --bg-tile command line option.

commit c167d42d6413f9ebe217a205642827ea841ee16c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 15 18:08:35 2002 +0000

    Use CFLAGS again.

commit 38cbc362c020d521dc4d5876cf1632585350c30f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 15 18:01:25 2002 +0000

    Makefile.am cleanup

commit 7445357899adae42314f46403224fd2855fafa56
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 14 14:09:28 2002 +0000

    Added IDirectFBSurface::TileBlit. Takes the same parameters like Blit
    but tiles the source to the whole destination surface. Set a clipping
    region if you want to tile only parts of the destination surface.

commit 3c03ecbe552222e4562eb45519e42a0cb3bf3183
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 11:01:28 2002 +0000

    once again, id is a reserved keyword in objective c

commit fc12bf5a427fbd6dc69efd88ff24ae76c543c95b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 09:49:35 2002 +0000

    include reactor.h

commit 39268e6d9758cf1a5cbbd45ba1e2bf0c5e00a646
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 09:42:32 2002 +0000

    Use another assembler source file for testing.

commit 006dd38e8df6bd9a13187f1a142e7a40543ae436
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 05:53:00 2002 +0000

    Do a normal shutdown in atexit handler, not just an emergency shutdown.

commit 7ef4b0ba3584adc4c85a61cd9316a8127af0aa88
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 05:10:17 2002 +0000

    Put device id into event structure in dfb_input_dispatch.

commit f2239107da6c9e5b73dab270b18990140ad4f693
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 04:57:50 2002 +0000

    not needed anymore

commit d4a75319394a248f2a2b9ce53266127c7e94bdf2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 14 04:57:00 2002 +0000

    Cleanup of interface functions, many functions have been made static.
    
    Removed intel_cpu_features by using the new dfb_mm_accel function.
    
    Added DFBDisplayLayerID, DFBWindowID and DFBInputDeviceID.
    
    Added GetID functions to IDirectFBDisplayLayer,
    IDirectFBWindow and IDirectFBInputDevice.
    
    IDirectFBInputBuffer is an IDirectFBEventBuffer now.
    It handles events from input devices and windows.
    
    Removed WaitForEvent, GetEvent and PeekEvent from IDirectFBWindow.
    Added CreateEventBuffer and AttachEventBuffer to IDirectFBWindow.
    
    DFBInputEvent and DFBWindowEvent contain the ID of the event source.
    
    Added DFBEventClass to determine the specific event, i.e. input/window.
    
    Added DFBEvent that is a union of DFBEventClass, DFBInputEvent and
    DFBWindowEvent. Each event structure has a DFBEventClass first.
    
    IDirectFBEventBuffer::GetEvent can be called with a DFBEvent pointer.
    If a buffer is only used for one specific event class, the macro
    DFB_EVENT(e) can be used to pass DFBInputEvent or DFBWindowEvent directly.

commit 5d49fba86be7d4ec14d6bd3e9cc4b14164f3f615
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Jan 13 12:36:22 2002 +0000

    Removed useless stuff from directfb-avifile.pc.

commit e40b6f5fa0ca003045ea43a4a810954b70752094
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jan 12 01:48:29 2002 +0000

    Added cpu detection code for MMX, 3DNOW, MMXEXT, SSE, SSE2 and ALTIVEC.
    
    Added fast memcpy routine 'dfb_memcpy' that uses MMX, MMXEXT or SSE.
    
    DICAPS_AXIS is now called DICAPS_AXES to have a plural
    as in DICAPS_BUTTONS or DICAPS_KEYS.
    
    Removed bogus flag DFXL_DRAWSTRING.
    
    Enabled dithering for Matrox cards, looks nice.

commit 5368bc9c43d9ada2ebf57711742d1c473650e130
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Jan 11 21:31:43 2002 +0000

    added note that the patch is obsolete since it was merged in 2.4.18-pre3

commit 634b28be3fc75ff5fe4a2c0aed6e0d4a03bf7bb7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 10 23:29:27 2002 +0000

    As Hallvar pointed out, "G550" needed to be added to the device names, too.

commit 137d0e7d8c04851f026102ccc9a867619e324b40
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 10 21:27:17 2002 +0000

    It's now possible to specify the pixelformat for a window on creation.
    For windows with an alphachannel only DSPF_ARGB is currently allowed.
    For opaque windows even DSPF_ARGB is allowed, but it won't get blended
    to the background. Instead the data will just be copied or converted
    so it can act like a root window on transparent layers.
    
    Optimized graphics card state changes during window stack updates.
    
    Added a comment to dbox2 remote driver.
    
    Added "G550" to matrox driver name.

commit 0a4d533c844c1790bc8c648a93197aea0ef4210d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 10 15:36:57 2002 +0000

    All global DirectFB symbols have the prefix "dfb_" now.

commit c1a657e110d80f5e0200cabf58faf1a7eac3382d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 9 14:56:56 2002 +0000

    Use "-fomit-frame-pointer" only for src/gfx/generic.

commit aa4013553461f358884f029be0d305eb68a3600e
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jan 8 15:52:44 2002 +0000

    some code cleanup, no changes

commit 1625338c3f98f903d58668dd24a43ea941b72d63
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jan 8 13:22:44 2002 +0000

    us a saturating blend when compositing A8 surfaces with colorizing on
    ARGB surfaces

commit 2dcb3a47e0853d4608ce649305c6ce34442e53bb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 7 17:31:19 2002 +0000

    Removed a totally dumb "static int" that got increased each OpenDevice
    and made the driver crash when OpenDevice gets called again after CloseDevice.
    
    Readded Suspend/Resume implementation.

commit 1f7e447b5685179eb6ad2769db40db95be6940b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 7 14:23:18 2002 +0000

    Pass the filename to the Probe function of image providers.

commit 79fda2f2f61b9ad85ef9c6ae67738e9c5230486f
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jan 7 14:07:26 2002 +0000

    	* src/gfx/generic/generic.c (SET_ALPHA_PIXEL_ARGB): keep destination
    	alpha when blending A8 with color modulation onto ARGB surfaces.

commit c36da321ca2becf95a8c232435792cb0a70f884e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jan 7 12:11:08 2002 +0000

    Added Hallvar Helleseth <hallvar@ii.uib.no> to Thanks To section.

commit b7c8c648bfed5d6177425733171696e31dd12abd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 6 04:50:04 2002 +0000

    Added YV12 and I420 support.

commit 5433718aa2090c17f6cf2d21ceb18c4d464db5bd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jan 6 01:16:42 2002 +0000

    Added ATI Overlay support. Only YUY2 and UYVY yet.
    
    Fixed mmio in/out functions. We casted the base address to a non volatile
    pointer. That resulted in register polling loops that never returned.
    
    Maybe this fixes ATI idle waiting on PowerPC.

commit 7287bce94e2ca9fe59082b25c9c89ac1df4e7dd5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jan 4 23:33:08 2002 +0000

    Rewritten Libmpeg3 provider based on OpenQuicktime provider.
    Supports all RGB and YUV formats and does audio playback.

commit 3277e9417003432689ebb6e8b099078cc74d7a51
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 3 20:55:47 2002 +0000

    fixed minor bug introduced yesterday that made RGB15 unavailable

commit a7c690c26829b09f1cab1ee1d477b87cf4a7b5c0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 3 18:58:31 2002 +0000

    Removed CON2FBMAP todo. Added some others.

commit 0331308cb94b8191409dfdae960a1c6cb3fb49ec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jan 3 18:45:36 2002 +0000

    added raw15toraw24

commit b29be5e7af24a06db0a560828b0e64841cc8e81c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 2 01:52:01 2002 +0000

    Fixed a width/pitch bug.

commit 297d50b2542e58977710c2f642333775d20b6308
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 2 01:26:38 2002 +0000

    Apply the plane multiplier to end result instead of height.

commit 5d30a0e1f408ab26d2ceadb3199c08744b8d138c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jan 2 00:38:34 2002 +0000

    Added "DFB_BYTES_PER_LINE(f,w)" which should be used instead of
    "DFB_BYTES_PER_PIXEL(f)*w", it adds support for formats with bytes
    per pixel not being a decimal, e.g. packed monochrome.
    
    Added support for planar pixel formats by adding more information
    to the pixel format constants with two new macros:
    "DFB_PLANAR_PIXELFORMAT(fmt)" and "DFB_PLANE_MULTIPLY(fmt,height)".
    More details in the header and in the generated documentation.
    
    Added DSPF_I420 and DSPF_YV12, two planar YUV formats.
    
    I420: 8 bit Y plane followed by 8 bit 2x2 subsampled U and V planes.
    YV12: 8 bit Y plane followed by 8 bit 2x2 subsampled V and U planes.
    
    
    Added I420 and YV12 support for Matrox BES.
    
    Enum entries in the generated documentation have the original order now.
    
    Increased version number, 0.9.8 and 0.9.9 are binary incompatible.

commit 4abcac544a688c6d00b8fdb5eaf958927bd42a86
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 1 17:41:35 2002 +0000

    Only use the full color keying mask when in 8/16 bit mode.

commit 6d36abd16a30e0f42bf68652047af600c545537f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 1 13:20:12 2002 +0000

    New framebuffer based debugging method.
    When compiled with debug enabled and started with "--fbdebug=<device>" graphical
    debugging output is done on this additional device. Currently only the surface
    manager uses this feature to show the video memory allocations for surfaces
    in a "defrag" like style.

commit bc529165f6b24afe8a1d4439721e4e23581d7018
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jan 1 13:08:47 2002 +0000

    Updated README

commit 596362762803aa98d950d27e65de8e2b3c8de309
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Dec 31 11:19:28 2001 +0000

    forgot to add the file.

commit 671bb1c1dfca62c7db0d53d868f094c6765440b8
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Dec 30 21:55:37 2001 +0000

    - do not rely on gcc to define __BIG_ENDIAN__ or __LITTLE_ENDIAN__
      include <endian.h> and check __BYTE_ORDER. This resolves problem on
      parisc, where gcc does not define __BIG_ENDIAN__
    - added raw15toraw24 tool for making screenshots

commit 9c17cf6f2baf8cf064238e23db7873667b4f8681
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 27 17:24:33 2001 +0000

    New version of neofb, for Linux 2.4.17.
    
    Added console acceleration for NeoMagic 2200 and above.
    Added checking of maximum allowed dot clock.
    
    Changed accelerator IDs.

commit 3d638fe5dfcc6f5c5d12036e187cc40f2bb09b5e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 19 16:49:14 2001 +0000

    The macro PIXEL_RGB332 should always be defined.

commit 407634c694f4ea0d03c1b74c46f6e929c7d885ae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 19 01:34:08 2001 +0000

    Fixed color keying on older Matrox cards.
    
    Added RGB332 support for all Matrox cards,
    accelerated blended rectangles look very cool in 8bit.

commit e6e5222554e926ae9e82543caeb2da675ffe8e0d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 19 00:29:46 2001 +0000

    After setting the video mode check the virtual resolution (matroxfb does not
    return an error but decreases the virtual resolution). Return an error if
    the virtual resolution does not match the requested one. Fixes segfault of
    double buffered fullscreen applications in high resolutions on older cards.
    
    Print a more descriptive error message if setting the desktop buffer mode
    failed. Not only missing virtual resolution support but also insufficient
    graphics memory can cause it. Also try a fallback to system memory back
    buffer mode.

commit 6ed0d0264cdd802d4be44362dee6b20d73c3cd9f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 18 19:26:28 2001 +0000

    It's now possible to start single buffered applications with "--force-windowed".
    The implicitly created window is now centered on the screen.

commit b6a7fc1f25c59768aa9627e249d52066ac2abe91
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 18 17:59:38 2001 +0000

    The VT is now mapped to the specified framebuffer device.
    Thanks to Jiri Svoboda <Jiri.Svoboda@seznam.cz>.

commit 253868a29ae613197a932b0e68f66f6eef9a33b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 18 12:55:51 2001 +0000

    Moved all clipping functions to "src/gfx/clip.[ch]". Outlined 'sort_triangle'.
    
    Fixed bug when all four edges of a rectangle are outside the clip.
    Filled rectangles got discarded instead of filled.

commit 3c8c8b172c740aaa2e3787fe3d15d2b07f5676ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 18 12:03:31 2001 +0000

    fuction table cleanup

commit 01a115c55600f232e1aa0228512889f93ba49ba3
Author: holger <holger>
Date:   Tue Dec 18 10:25:58 2001 +0000

    dummy initialisation for IBM notebooks

commit e7a50014685ae01e5ace16045e133aa3bbe75dfb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 17 13:32:18 2001 +0000

    Applied patch from "W. Michael Petullo" <mike@flyn.org> that adds support
    for new-style device names '/dev/input/js*'.

commit 340ceff6731f94979635e8c7836ff2c10a53b843
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 17 10:57:38 2001 +0000

    New option "--disable-window-opacity" which forces window opacity to be 0 or 255

commit 8f547c9db36b1c36f22d159639f83d70c07b51d8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 17 09:29:30 2001 +0000

    Added option "--[no-]cursor" to enable/disable showing the default cursor
    on startup. Default is to show the cursor.

commit 6ef5998065df1df3cdf55c898d197326672ab5ba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 16 11:16:49 2001 +0000

    Forgot to remove that preallocated surface memory thing.

commit 238259a439ad306865d0b016630e33be2e6f2d76
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 16 11:13:47 2001 +0000

    'IDirectFB::CreateSurface' can now be used to create surfaces using a
    preallocated system memory buffer. Apps have to set 'DSDESC_PREALLOCATED'
    and the appropriate fields in the surface description. The buffer won't be
    freed if the surface gets destructed.
    The application has to use the 'Lock' method even to access the system
    memory buffer. Otherwise data coherency between system and video memory
    isn't guaranteed.

commit e83d5a7a943b8a0c37ef379ecee22d8fe913f35c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 16 10:23:01 2001 +0000

    Optimized usage of texture cache flushs and engine syncs,
    e.g. gfxcard_sync only gets called if the surface buffer that
    is to be accessed by software had been written to before by hardware.

commit 3f9c79f7dfa071cd9b3d51a8753c3bf1c3f0f1b9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 16 07:13:54 2001 +0000

    Runs with Linux 2.2.x or higher. Linux 2.4.x is not required.

commit d3c65cb0fde972883b062e8f80a5e1174ab7a567
Author: holger <holger>
Date:   Fri Dec 14 19:04:27 2001 +0000

    changed keycode: DIKC_ESCAPE->DIKC_VENDOR

commit 364e4b04c1eccae08ab0baf5c27da1e54011c495
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 14 13:15:00 2001 +0000

    Removed swapping of left and right mouse button (done).

commit 6b19ae09726d54afcd6cad7cb0dd58f751a1f00b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 14 11:18:57 2001 +0000

    #if 0'ed the unused config_cleanup function as the config should go away
    if the app is completely terminated. In that case the memory is freed anyway.

commit 091dd4c8ff1403d33c7b2e0316db32e75e89c92a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 14 10:55:49 2001 +0000

    Added new option "--lefty" that enables swapping of left and right button.

commit 0bf7b607154f64f618d847fe6d6c9eda6e6d9656
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 14 09:17:21 2001 +0000

    Added some TODOs. We should really use this file ;)

commit 50a3d79cf048377a6c1487c9491df53c69dddeec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 12 18:14:21 2001 +0000

    i admit, this null pointer change wasn't redundant ;P

commit de2d61fb950cc8aa0432594cd72cc0b2fabda0bb
Author: holger <holger>
Date:   Wed Dec 12 17:51:34 2001 +0000

    fix USB problems when no PS/2 port is present, allow multiple mice

commit 8fcbc99b9da8d576404296b4086c4992a5df5ea9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 12 01:49:06 2001 +0000

    more documentation on state handling

commit de701b2d6cb88de9dc1ecca769fe594cbd23dd5f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 11 21:06:36 2001 +0000

    more documentation

commit 315a13a96e4587b1cad9bc1463b5e3dc2f2ce189
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 11 20:11:10 2001 +0000

    documented gfxcard_check_state

commit 63676a3a2b54ddd2b257f1068f12fa8c0275d342
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 11 18:56:13 2001 +0000

    Chose this driver for a good example on writing input drivers.
    Added comments documenting the driver API.

commit ab431921e1c8f41956173ccb33576314bc7da872
Author: holger <holger>
Date:   Tue Dec 11 12:06:17 2001 +0000

    indent cosmetic

commit 3df803523e51a76b1617b196ec22fc870f64ad76
Author: holger <holger>
Date:   Tue Dec 11 12:04:25 2001 +0000

    code compaction

commit 8812cdd8b7791d9d477125a1b9f1d3efe43a33c8
Author: holger <holger>
Date:   Tue Dec 11 11:55:29 2001 +0000

    perform full initialisation on each device, this should get USB mices working on PC's, too

commit 7a9c62207a95d72ad42b0282f03b1e37bf068e6a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 10 19:01:46 2001 +0000

    Updated for 0.9.8.

commit b87761fb17c0b95c859a5a059362579d4c2b1195
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 10 18:55:32 2001 +0000

    Removed debug output in PS/2 driver.
    ATI fake texture[tm] for blended rectangles is available again.

commit 2dd0439d87b4925fd84affecbbef1c99df7754a8
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Dec 9 23:34:37 2001 +0000

    new aty128fb patch for linux 2.4.16

commit 993407a9492cf517a5e30dc81eba58f38ae57974
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 9 10:55:39 2001 +0000

    s/leightweight/lightweight/

commit c4d2832d44b82b5f800424a5861e9723d45945e7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Dec 9 10:54:13 2001 +0000

    removed rounding factor when blitting non-scaled with tmu,
    very big fonts looked incorrect

commit 4613b85d42edab09f9167717d4af18eaaf6b970c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 7 22:29:28 2001 +0000

    Use non-debug 'free' for freeing interfaces after failing construction.

commit 10903cb964de9f5f98933b398899c6d4b93efdeb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 7 17:49:17 2001 +0000

    Use a double buffered window for a primary only if
    the primary should be a flipping surface.

commit db17e3567bd964ee069bae29d4a2a42352cd38a6
Author: holger <holger>
Date:   Fri Dec 7 14:24:20 2001 +0000

    moved around tcflush() commands

commit e5828c1ef1bc620f61934a0e5723134101f6f976
Author: holger <holger>
Date:   Fri Dec 7 13:19:28 2001 +0000

    optimize DDA for speed

commit ab864429fd0cab6bd7b9485a4d9e82d564fab2b9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 7 03:58:11 2001 +0000

    typo in debug message

commit 8e7feb6cd8191a937b4d546adfc76e35753077a1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 7 03:38:12 2001 +0000

    compile fix

commit 03f9d510675c76a40fd40d9aeeba9f1cdd0cd38f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 7 01:33:02 2001 +0000

    Triangle rasterizer (used when hardware no triangle filling or clipping)
    now uses hardware accelerated rectangle filling if available.

commit 9bf70ee4a78d55c672658aa0ff6c656935c5b479
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Dec 7 01:04:23 2001 +0000

    Moved the hw clipping check before gfxcard_state_check/acquire when
    it comes to triangle filling. I haven't tested it before but the wrong
    order should have caused deadlocks when hardware is able to fill triangles
    but has no hw clipping.

commit fb6aef957417b7ba433614d75e369a5b2e7c130d
Author: holger <holger>
Date:   Thu Dec 6 21:22:05 2001 +0000

    fixed driver

commit 31c90dc29643164bb566faecb312076eb0049cbc
Author: holger <holger>
Date:   Thu Dec 6 21:06:23 2001 +0000

    new FillTriangle algorithm using DDA's

commit a413a656f557d79bc3cb2cbd2817e901c08b79d5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Dec 6 16:45:57 2001 +0000

    Added gfxcard_reserve_memory that can be called at init time by drivers
    for special purposes, e.g. fake texture or command overflow buffer.

commit 8df2b725bf9e00aea7354d0876ffa0092c218924
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Dec 6 16:07:49 2001 +0000

    initialize GetFont field in IDirectFBSurface (spotted by king@mizi.com)

commit 223ee60f46e5ca1c3027ef372adc66302d78ecbc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Dec 5 02:25:55 2001 +0000

    Don't generate window events from input when an app runs fullscreen.

commit 18031f5b711f7560c21cc020d9346f3e424da9d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 4 20:52:34 2001 +0000

    Applied patch from David Wood <DWood@daedalcorp.com>.
    Added him to AUTHORS for the Voodoo driver.

commit 6e371a3d623f42ea6f6c57ff12a5cb87e1e1e0fe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 4 18:52:51 2001 +0000

    Renamed 'BYTES_PER_PIXEL' to 'DFB_BYTES_PER_PIXEL'.
    Renamed 'BITS_PER_PIXEL' to 'DFB_BITS_PER_PIXEL'.
    Renamed 'PIXELFORMAT_INDEX' to 'DFB_PIXELFORMAT_INDEX'.
    
    Added 'DFB_DRAWING_FUNCTION(a)' that replaces the magic 'accel & 0xFFFF'.
    Added 'DFB_BLITTING_FUNCTION(a)' that replaces the magic 'accel & 0xFFFF0000'.

commit 1ef5564bbbfec9536c99c4e8c54cf4ae681f9931
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 4 17:43:37 2001 +0000

    Division by zero fix.

commit d5d5547d56bfa40eb95f9a05b602a4f848942c26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 4 17:42:47 2001 +0000

    renamed dbg_* functions to dfb_dbg_*

commit 0be7ae641e75ece7cdc2b2085fc4e7b97586f4eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 4 16:50:00 2001 +0000

    Applied patch from Holger Waechtler, gFillTriangle is removed and triangle
    filling/clipping is handled by 'gfxcard.c'. Triangles are filled by software
    if hardware/driver doesn't support triangles or doesn't support clipping.
    In the final version of this function triangles will be filled via accelerated
    rectangles if hardware has no triangle or clipping support but filled rectangles.

commit cdfcee5a0ddb3928a05f3994ae9b46b7e0bb3413
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Dec 4 16:42:25 2001 +0000

    commented out a debugging signal

commit 35a64af9ec15a5f17d70e38530b0a1279b74bc1c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 3 17:37:50 2001 +0000

    optimized offset handling for file internal data

commit f39f90c8d063938d9f381080cab66cbe1177ba92
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 3 14:04:52 2001 +0000

    Finally position independent code with real code sharing.
    No patch needed to build with dietlibc.

commit 1ac75046d1f171ce147832d3481585e9ac3666d8
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Dec 3 14:02:24 2001 +0000

    dont set the val field of semul at all when unsing the IPC_RMID semctl()

commit b66883d1d1f16d5b8680b8ecc64e4b7287e48db4
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Dec 3 04:04:44 2001 +0000

    in all SETVAL semctl()s, pass a union and set the val field instead of passing the
    value directly. this fixes multi appication core crashes on ppc. obviously
    this is the right way, however it worked too on i386 before the change.

commit c521677e48d99ebe27a6ffd9f2bfa5d0098ef26a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Dec 3 04:03:46 2001 +0000

    Matrox BES works again, writing to four dac registers subsequently didn't
    work after the base address got a local variable instead of a global.
    Strange gcc or cache behaviour i guess.

commit 74d8ab8b4ed792224076e78a6a4a4f22d91de8fe
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Dec 2 00:17:26 2001 +0000

    added "wm_hack" feature:
    press shift lock over a window and spin the mouse wheel to change the window
    opacity.

commit b87a5f31ba0ff40d3a494408b439aa1d4f482673
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Nov 30 19:03:21 2001 +0000

    Made all 'Sop -> Aop' functions 'Bop -> Aop' (source aliasing removed).
    This makes simple blitting 90% faster for very short scanlines, e.g. 2x200,
    because the "Sop_is_Bop" function is not needed.

commit d559201293793fc56d6100213df56a45d8d7e785
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 29 16:58:39 2001 +0000

    Fixed segfault when rendering pipeline is empty, e.g. using DSDRAW_BLEND
    with SrcFunc DSBF_ZERO and DstFunc DSBF_ONE.

commit d36dc01cee434262f84483eb877d26e52494fa33
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 29 16:51:45 2001 +0000

    Check for NULL pointer.

commit 9cc0e65dfe4f1f6a01b4a8e1e778f8c4ee0dd795
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Nov 29 16:12:27 2001 +0000

    Revived exit handler.

commit 9be8bbbcc3602599123ed8282b9cd07ee82e42c5
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Nov 29 14:28:54 2001 +0000

    build fix

commit d26e711dc1a68cb742f7a87a673ca2d9cc9b25c3
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Nov 29 14:19:06 2001 +0000

    added remote control driver for dbox2

commit 57fd6015f4812bf6f340d5d4f6ffeb32b4e639bf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 28 17:56:41 2001 +0000

    Removed "-O3" from default flags. It's added when debug is disabled.
    Added "-O0" to flags when debug is enabled.

commit ba61c9fb37d8f11d070266044329f8496e013b63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 28 17:06:28 2001 +0000

    In RGB332:
    Have all colors but black a bit transparent. Black is totally transparent.

commit fea914d4119cb4fc9afdfb09b31b633145909201
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 28 16:43:21 2001 +0000

    hmm, transp is inverted alpha ;)

commit c16f34ed4e62c7bb75ceff4659f531a6aafa6892
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Nov 28 15:58:30 2001 +0000

    In RGB332 mode initialize alpha values in palette.

commit 4fc1c660c5c87f61167dc2d6f81d13968217d605
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 27 20:42:36 2001 +0000

    Physical address is 'unsigned long' now.

commit dacba42883d71bc6ba26830193ce9688554202fc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 27 13:19:42 2001 +0000

    Create reactor before call to "driver->OpenDevice".

commit e7560c25053c8149202109f7b1f6809b43d1569a
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Nov 27 00:22:57 2001 +0000

    added DWET_WHEEL window event. Focused windows now receive events if the mouse wheel is used.

commit 60fa2ddf051144bfd7758d2b496c8baf8f79bad8
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Nov 27 00:15:56 2001 +0000

    bugfixes:
    when using a imps2 mice the packet array was accessed out of bounds
    added (__s8) cast to before assigning wheel motion data to dz.

commit 52972a68fb6ad4d743e60834f03d7c833bbfc94e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 12:13:56 2001 +0000

    Use calloc and strdup instead of malloc/memset and malloc/strcpy.

commit d18189186c74579b173b154cced54448f3b5e79e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 04:54:31 2001 +0000

    Free pending events on destruction of IDirectFBWindow.

commit b72a6a4c4a4f6517fded320024454a4619275362
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 04:48:19 2001 +0000

    Removed "#include <config.h>" from headers that get installed.
    "-DDFB_DEBUG" and "-DFUSION_FAKE" are now command line arguments.
    When debug is enabled "-DDFB_DEBUG" is contained in directfb-internal.pc.

commit 247dbcad4232ff271718075897125846c328e5e8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 04:30:03 2001 +0000

    Use DFBCALLOC for DFB_ALLOCATE_INTERFACE only if not in debug mode,
    because interfaces are not freed intentionally in debug mode.
    
    Free pending events on destruction of IDirectFBInputBuffer.

commit a72d2ecc6495967577a82a3438856acf56498256
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 02:50:18 2001 +0000

    Include SMF_SOURCE in SMF_ALL, could have caused blitting from the wrong
    source recently (longer for a very few drivers) when switching to another state.

commit e0a425359cbb4031ae47ce55293d27a85114e57e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 01:50:45 2001 +0000

    Add "-DFUSION_FAKE" to internal CFLAGS in package config file
    when compiling for single application core.

commit 0ed598c6e86c15a3def0af551860c337d6a2ffe4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 26 00:04:18 2001 +0000

    Made additional layers available again, but for single app core only yet.
    For a strange reason the Matrox BES doesn't get visible, until the old
    version has been used once.
    
    Readded 'surface_soft_lock' as a helper function
    that behaves like the one before.

commit cf1be1be7a22b9f068850300c7c9409e0e463cb2
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Nov 25 22:53:05 2001 +0000

    include string.h to avoid warnings with gcc-3.0

commit 6e16576996423dc602b1bc2cd6d844b015fa4d4d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 25 21:38:49 2001 +0000

    When an IDirectFBInputBuffer gets destructed it now detaches from
    all devices it was attached to. Not only the first one.

commit 5982ef209e4d1150d8c6d2eab9a2089b278e1ad4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 25 18:54:50 2001 +0000

    Device name is "Software Rasterizer" now, not "Generic".
    Vendor string is "Generic" or "MMX" so it prints "MMX Software Rasterizer"
    or "Generic Software Rasterizer".

commit 965bd5328c99e5df814e7df520d78933e155f98a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 25 03:32:19 2001 +0000

    Print device name & vendor instead name of driver.

commit f0ec56b7f93f5d12a366dc12c0eff3d642101d3f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Nov 25 02:23:07 2001 +0000

    Fixed "--fbdev=" option.

commit 1c05d9bcb5227b104766c6ceb9d2fc485d28a55d
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Nov 21 19:28:16 2001 +0000

    #include <asm/page.h>,
    fixes compile error on ppc (PAGE_SIZE was not defined)

commit b55013fb307c9cabad8587ed2f8a9d5f075322e3
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Nov 20 22:05:01 2001 +0000

    use malloc() and free() instead of alloca().
    this fixes a crash, when loading jpeg images that are larger than the surface rendered to.

commit 68ed11f3ce430d8e244e88324aec6a8cb1c93ceb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 20 20:45:50 2001 +0000

    Added support for IMPS/2 by Jason Gaiser <jasno@san.rr.com>.

commit 61b342d2be35310df32ed862a7b7023a345c750c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 20 14:46:15 2001 +0000

    These are in fusion now.

commit bd622572d9143771ba96efa479b105be266aca85
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 20 12:59:33 2001 +0000

    Ok, here it comes, not yet complete and far from being finished.
    Important things to do are resource cleanup (especially when apps get
    killed), safety, code cleanup and so on.
    This tree can build both the single and multi app core, you can switch
    at configure time with "--enable-multi".
    The single application version does not fully work like before yet,
    missing are Suspend/Resume and therefore VT switching during running.
    Also support for additional display layers is disabled because there
    need to be some changes to the internal layer handling.
    
    There are also enhancements, e.g. abi version handling for drivers.
    Graphics drivers are now ready for multi head support. Core code cleanup
    is in progress. 'gfxcard.[ch]' and 'input.[ch]' already have their private
    structures hidden.
    
    I am sorry for the changes to the graphics and input drivers, but it's
    much more clean now and drivers work with single and multi app core without
    rebuilding.
    
    You can checkout DirectFB at any time by specifying "-r DFB_BEFORE_MULTI".
    
    Any help in optimizing/finishing especially the src/core/fusion stuff is
    appreciated. Thank you!

commit 4ce740d0d1bf1d0475ba57ebb8d35668fab21a62
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 19 05:33:55 2001 +0000

    Added 320x240 and 400x300 double scan modes.

commit cd7549f12dd27e8015a551b149ea6e5f2446fa47
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Nov 13 07:36:03 2001 +0000

    Simple blitting support for nVidia cards.
    Thanks to Daniel Foesch <dfoesch@cs.nmsu.edu>.

commit 475d3155f039fea5742f894279940971337f1ffe
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Nov 8 00:53:25 2001 +0000

    fixed initialization of the RGB332 palette, white looked a bit like light coffe before (yes, dok you were right, that notebook tft was not)

commit 525a2d04253905aeebb92d886f48b8a394c346f1
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 5 23:29:52 2001 +0000

    - finished implementation of RGB332 support, still not optimized but complete.
    - changed version number of generic driver to 0.5, didnt change that number
    for a _long_ time.

commit 0c1b289e6d31274142cbddae1f5a10eab1c9e2eb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Nov 5 21:01:25 2001 +0000

    Restore current mode when resuming.

commit e7a7709ee1f2e5f945b4fcc4418af6d05bb2c19b
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Nov 5 00:52:43 2001 +0000

    implemented Sacc_to_Aop_rgb332(), Sop_rgb332_to_Dacc(), Sop_rgb332_Sto_Dacc()
    
    now blending in 8 bit works.

commit 1758deac0c70bd130aa3c276da18a51cc5b01e18
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 3 05:06:52 2001 +0000

    Added includes for types used in these headers.

commit f7f5ca6cf6dd84f580fc90a1ea2b68602a36ab1a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Nov 3 04:49:01 2001 +0000

    Fixed includes so that each header should compile on its own.
    Moved forward declaration of 'InputDevice' to 'coretypes.h'.

commit 0925771ad452be507dd6cfecab92c2e0f34f1cc3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 31 15:53:50 2001 +0000

    Default font location had changed, did also change in code.

commit cfa916691655ff8a01901da733310c5d96a5c04c
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 30 03:32:48 2001 +0000

    removed description of the examples.

commit bf28334c75e88082280dfdce781a6ead5642b426
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 30 02:18:36 2001 +0000

    Added OpenGL support via the new interface "IDirectFBGL".
    
    Added "IDirectFBSurface::GetGL",
    it will return the new interface if it has been installed (DirectFBGL).
    
    A call to "IDirectFBGL::MakeCurrent" sets the current OpenGL context.
    
    Added an optional "Allocate" function to interface implementations,
    the creator of the interface no longer needs to know its content.
    
    Activated DWCAPS_DOUBLEBUFFER for windows that got created implicitly
    by creating a primary surface in non-exclusive mode.
    
    The mouse cursor is now activated by default.
    
    Increased version number to "0.9.8".

commit 74c82a7471aeb2ea4df7c0f43f8e5ab676dc45eb
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Oct 30 01:27:58 2001 +0000

    - removed examples, moved them to DirectFB-examples.

commit 86180d221182007ee6d1436e3813ccdb135f1d34
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 29 23:07:40 2001 +0000

    implemented Sop_rgb332_SKto_Aop() for stretched color keyed blits.

commit 8b642d324f01b9959254b86dfac7662a6f51c984
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 28 21:29:39 2001 +0000

    fixed some includes

commit d4a3527700ab199657c01b749d86716d27b23d5d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 28 19:06:24 2001 +0000

    Fixed typo in comment.

commit 71040f99b71aaf98bac7209c8758d8fd568068ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 28 19:05:38 2001 +0000

    removed obsolete code

commit 70ae72267dde43a78de33fc22ccc4ec698bb7343
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 27 20:54:36 2001 +0000

    changed penguin's colorkey to green. now df_andi looks correct in 15 and 8
    bit (too much of the penguin was keyed before when runnig at lower bit
    depths)

commit 58d468b13c398d4c009ab7c3595feb65cd143c71
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 26 12:39:34 2001 +0000

    Updated for 0.9.7

commit e87e4763dc702529796540ba6775eb891d16d2c2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 25 15:17:30 2001 +0000

    Removed commented out code,
    wrote an explanation instead why the state isn't modified.

commit f2be27c5481d6346c539e553d8064154aebda0a8
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Oct 25 14:47:06 2001 +0000

    Adapted examples to latest API changes (surface->SetSrcColorKey).

commit f360be888d6f8326201fcdac066ac73c3daabe3b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Oct 25 14:33:16 2001 +0000

    Important API change:
    
    IDirectFBSurface::SetSrcColorKey has to be called on the source now,
    when blitting to a surface which has source color keying enabled.
    
    For IDirectFBSurface::SetSrcColorKey and IDirectFBSurface::SetDstColorKey:
    The color key is now specified by three values each 8bit: r, g and b.
    They will be converted to the pixelformat of the surface automatically.

commit e0f5c3beb39992d87ff5c5febc4540e48a61983d
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 22 17:53:48 2001 +0000

    forgot to change filenames.

commit d39fd0c4d5b5af82da95c9d5ffd9bd59219b7f4c
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 22 17:52:32 2001 +0000

    *** empty log message ***

commit 17ad8ca16ec51dad79a6069a4376eb91df37bb7f
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Oct 22 17:52:03 2001 +0000

    updated aty128fb framebuffer driver patch.
    
    the patch was tested with kernel versions from 2.4.7 - 2.4.12. It may work
    with older versions too.

commit 096f45160569193fb54c2e204d377e4a1538cc20
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 21 15:50:08 2001 +0000

    Added DSPF_UYVY and clarified description of both YUV formats.
    
    Added surface capability DSCAPS_INTERLACED which indicates that the surface
    contains interlaced video data (two fields of half the height of the surface
    are stored interleaved line by line). This capability will be set by drivers
    when a layer is configured with DLOP_INTERLACED enabled. Video providers are
    then able to notify the layer driver about field changes (for software driven
    field changes).
    
    Added surface notifications CSNF_SET_EVEN and CSNF_SET_ODD (internal),
    drivers can listen to them to support (de)interlacing with software driven
    field changes.
    
    Added DVCAPS_INTERLACED to indicate that a video provider supports
    notification of field changes if the destination has DSCAPS_INTERLACED set.
    
    V4L provider supports (de)interlacing and both YUV formats.
    
    Added support for (de)interlaced video with the Matrox Backend Scaler.
    
    Added support for YUY2 as a blitting source on the G200.
    
    Added support for YUY2 and UYVY as a blitting source on the G400.
    
    Made some features available on the G100, stretched blits and format conversion
    are now available, but for 15/16 bit sources only. Colorizing is available, too.
    Blending could be available, but only in stipple mode and no ARGB32;-(
    
    Added support for deinterlacing in df_layer, also demonstrating how to test
    layer configurations. Will fallback to UYVY or even take the current format.
    
    AviFile provider returns an error if support for YUY2 or UYVY is not available.
    
    Increased version number to 0.9.7.

commit c4a57ad2c754c4fe8f4facaecc9b262ce24a5ff9
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 20 23:41:46 2001 +0000

    optimized RGB15 and RGB16 color keyed blit (doubled performance on some
    cpus)
    
    df_dok benchmarks (MPixel/s):
    
    Apple PowerBook G3 400Mhz:
    15.2  -> 30.8
    
    Sony Vaio PIII 700 Mhz:
    69.5 -> 112.9
    
    PowerPC 823 66 Mhz:
    2.65 -> 3.49

commit 0cfcd032885edb90e9dba165e583c13a2923ebe1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 20 22:35:21 2001 +0000

    5 lines added to have G100 support as well ;)

commit ebc5ca5f8b2aa1367e4de649d30f6b885c8421e4
Author: Andreas Hundt <andi@directfb.org>
Date:   Sat Oct 20 15:01:27 2001 +0000

    - dont call fbdev_set_gamma_ramp() when using RGB332
    - allow RGB15 mode on fbdev drivers that report to use one bit for alpha

commit b92f249876c108445a2bf81d4e5b9cc2795de99f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 20 08:52:42 2001 +0000

    It's now possible to use the V4L Provider on YUV surfaces.

commit 0fa1dcc59ee68fbb3dba671ba048c3dc79dbb0ab
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 20 08:02:16 2001 +0000

    Added support for the following fb.modes options:
    
    'gsync true'   - Sync On Green enabled
    'csync high'   - Composite Sync high
    'extsync true' - External Sync

commit 3ab5d3da023bc08473fe6d36c689ae240cc7a8b0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 20 07:47:20 2001 +0000

    When reading the first 32 byte of a file in CreateImageProvider,
    open the file/device O_NONBLOCK! With a BTTV and DFBSee trying to create
    an image provider for /dev/video the read never returned.

commit 7334ea9cfdcbfa80a78544cf6aeed6fa54e01373
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Oct 20 06:49:50 2001 +0000

    Added acceleration for older Matrox cards (Mystique and Millenium I & II).
    Tested on a Mystique with SGRAM
    
    Supported are:
    - Solid rectangle/triangle filling
    - Solid line/rectangle drawing
    - Blitting with or without source color keying
    
    Mystique seems to has a texture mapping unit, but I didn't get it working
    correctly, scaled images looked tiled/interleaved, but it was slower than
    software anyway, so it propably wouldn't trade off.
    
    
    Fixed BCOL setting (colorkey mask), all 32 bit must be filled for these cards.
    
    Added second simple blitting function 'matroxBlit2D_Old',
    because BitBlt programming is too different between new and old cards.
    
    Source and destination surface offset handling is totally different, too.
    
    Cleaned up CheckState functions, optimized invalidation rules in SetState.
    (Don't know why source registers had been invalidated on destination changes).
    
    
    Tested on a Mystique with SGRAM on an Athlon 1.33GHz:
    - Rectangle Filling 823 MPixel/sec
    - Blitting 46 MPixel/sec (software was about 30)
    
    Without "--matrox-sgram" feature:
    - Rectangle Filling 94 MPixel/sec !

commit 9526323cca3e159c24ac55545153913bbe575c63
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 19 21:12:02 2001 +0000

    changed the default background color to a more "cooler" blue

commit d3e49eba971a86f232e57ffba10f5663ed6977cf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 19 21:07:04 2001 +0000

    Added option "--fbdev=<device>" which lets you
    specify another device than "/dev/fb0".

commit bb526019b27660f1b5084b937cd8e1035dfc6668
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 19 20:50:06 2001 +0000

    Renamed global symbol "vt" to "core_vt".

commit 9e2175119357828b0cdf09adfff6d5f30420410b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 19 20:30:42 2001 +0000

    Each interface con now have a long description, put it above DEFINE_INTERFACE.
    Description of structs is now put into types page.
    
    Added some text for IDirectFB.

commit 943754f50a62b0bddd24740d8f91e1e72a0bccd9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 15 02:29:00 2001 +0000

    After a window gets closed make sure another window gets the focus if any.

commit 3a6db05db001a8abcab56e6170bbb9ad65f720fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 15 00:55:31 2001 +0000

    Reenabled changing of controlling tty when vt switching is used.
    This is needed, otherwise mode switching ioctls have no effect.

commit b45b82d58c3239a507bb08a5c36315e0f4c54420
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 12 12:24:42 2001 +0000

    Use video alpha method when modifying destinations alpha channel.
    Text and blended blits look much better now when done on a window with alpha.

commit c045162ee3d7fa0cb131ac72a6076171945c837e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 12 00:03:04 2001 +0000

    Several enhancements make DirectFB now really usable with "--no-vt-switch",
    with this option you are able to run DirectFB programs without super user
    privileges. You need read/write access to /dev/fb and you should start it from
    the console, i.e. not within X.
    
    DirectFB now restores the palette during deinitialization.
    DirectFB now turns cursor and blanking back on.
    DirectFB now restores the terminal attributes like local echo.

commit 6a6dc0e18baded8e8f43cf7544c72885bf092384
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Oct 10 13:21:50 2001 +0000

    Added checks for supported source formats.

commit 0e8ba28f155e34eed93cc97dd3784198e629fa23
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 9 08:49:33 2001 +0000

    Better check for supported/unsupported pixelformats.

commit d518e865e5541a30a57cd91037859d8cac545ec7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Oct 8 07:08:46 2001 +0000

    Source surfaces are now locked before destination surfaces.
    Commented out error message of FreeType2 Font loader when
    the file could not be opened.

commit 885edeb232aff1529438ee82d84654fed47e1ebf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Oct 7 03:55:30 2001 +0000

    Ready for 2.4.10 neofb.

commit c509539543ab25dd28fd7388583e05633ce5b74f
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Oct 7 03:07:11 2001 +0000

    fixed warning

commit bb1d8763ab4f1b81b165078a01c8a4da1d97d928
Author: Andreas Hundt <andi@directfb.org>
Date:   Sun Oct 7 03:01:58 2001 +0000

    added 8bit RGB332 pixelformat. This is usefull to test DirectFB on old unix
    workstations which had 8-bit framebuffers on board (sparc,pa-risc,mips)
    Implementation in not complete yet.
    
    If you want RGB332 for any reason, you have to enable it at compile time using
     ./configure  --enable-rgb332

commit 56e3728eca88eea44118f28949eee40527f968ea
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Oct 5 19:27:21 2001 +0000

    fixed gcc-3.0 warnings.

commit 7d225e0b498a49a5ddbb2be22a9c558df95390b5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Oct 5 13:17:22 2001 +0000

    Do a more verbose error message if no supported modes were found in
    /etc/fb.modes and the current mode is not supported, too.
    Pixelformat of current mode is printed in this case.

commit eb7bab13392acbe2d5f01acc5a0f8979aa637846
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 2 22:07:52 2001 +0000

    R34D7 4 D4 R3L3453

commit 6b4f98844efdf45cad3747ca72315d37ee54e4cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 2 22:04:19 2001 +0000

    Added 'IDirectFBDisplayLayer::Set/GetColorAdjustment()' along with four
    capability flags for each adjustment (brightness, contrast, hue, saturation).
    
    Implemented color adjustment for Matrox BES
    (brightness and contrast supported in YUV only).

commit 5d3c9095555c8b7d02fc7e6eb58931199e2193b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 2 20:10:37 2001 +0000

    Fixed documentation generation according to distcheck's complains.

commit 364b8b0ff20ebbde50d98e1f5328b8ac3948d8d6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 2 15:38:42 2001 +0000

    Updated ChangeLog and summarized changes since 0.9.5 in NEWS.
    Changed version number to 0.9.6 by previous commit.

commit 89cc3f0689db45c9e8f81531cc9dc6fd49f54f06
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Oct 2 15:35:48 2001 +0000

    We now accept compatible pixelformats,
    e.g. IPAQ's RGB format is compatible with RGB16.
    
    Added evil workaround for automake using non substituted @AS@ like a gcc.
    
    Added stamp-h1 to .cvsignore

commit 19f2f467e0851252d4292e1344181b18c9a285df
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 27 03:56:13 2001 +0000

    Check enter/leave and focus after ungrabbing pointer.

commit 408edc2205b1049ad098898f11440ce81caf6631
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 26 18:20:46 2001 +0000

    Benchmark size is automatically shrinked to fit the screen, e.g. for 320x240.

commit c478fe0c659b639463cbb20eb195eb92d2ea8612
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 26 17:56:09 2001 +0000

    Eek, broke button press/release, fixed ;)

commit e52b138819af0abcb7f3bde75a0d989743887222
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 26 17:51:20 2001 +0000

    If there is no pressure, the x/y fields seem to be invalid.
    Check them only if there is pressure.

commit 86edba4110566931eaec72c5496e433b6b3a49ff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 26 17:31:33 2001 +0000

    Fixed handling of absolute axis coordinates in window stack cursor handling.

commit 76ce6ead53befac36ba52ee27da30859c3464763
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Sep 26 16:47:19 2001 +0000

    Added untested H3600 Touchscreen driver.
    
    Fixed definition of DFXL_ALL (DFXL_FILLTRIANGLE was missing).

commit ac463fe40c03c9f210c7a71e9e9ee27da9a22551
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Sep 23 04:33:00 2001 +0000

    Use 'DFBCALLOC' in 'DFB_ALLOCATE_INTERFACE', forgot that one.
    
    Fixed small event dispatching bug in window stack, a button event
    was sent to the focused window even if it's not under the cursor
    and doesn't grab the pointer.
    
    When CapsLock is hold down you can raise
    the window under the cursor with a click.
    
    
    
    The following changes fix problems related to heavy threading,
    e.g. more than 50 threads on my machine actively using DirectFB:
    
    Added 'surfacemanager_lock/unlock()' and divided surface manager functions
    into two groups: functions doing the lock themselves and functions that can
    only be called between lock/unlock. Functions doing the lock themself must
    not be called between lock/unlock.
    
    Added 'state_lock/unlock(state)' that are called in drawing/blitting functions
    from 'gfxcard.c'. Merged 'card->source_locked' and 'source_locked (generic.c)'
    into new 'state->source_locked'.
    
    Added 'buffer->video.locked' so the surface manager does not try to kick out
    surface buffers that are currently locked, which could end up in a dead lock.

commit bdec189bdf26ca618a733c91d82ea9a94897dd26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Sep 22 21:25:01 2001 +0000

    Added "-lm" for df_layer.

commit ae0c3f7618819f1593e07f9c2a68b7cb12a9ab47
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 21 21:34:12 2001 +0000

    Fixed "Could not disallocate VT" problem, exit handler calls normal
    deinit function now instead of the emergency deinit. Additionally
    input devices are deinitialized from emergency deinit.
    
    Fixed problem with malloc/free debugging that occured when exit handler
    for memory leak checking was called before exit handler of the core.
    Memory leak checking is now called at the end of the core exit
    handler if debugging is enabled.

commit 251dec9af7bdc797d2c0ab3131241408418964bc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 21 15:19:43 2001 +0000

    Fixed segfault when loading big PNGs, seems that there was a problem
    with alloca. However it works with malloc, but maybe the problem is that
    libpng has a bug that does no harm when using malloc, because of other
    address ranges.
    
    Also switched to 'png_read_image()' to have deinterlacing handled automatically.

commit 0b67da2772812ecd6f0a7e47fb9ce1a75286a780
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 21 00:37:30 2001 +0000

    Fixed surface manager bug. When surface gets kicked out of video memory,
    make sure that the system memory instance of the buffer is up to date.
    This fixes "missing font letters" for example.

commit 4926a68e0d20c35d1d7c85151809ff52dfd93c98
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 18 21:54:17 2001 +0000

    Added result 'DFB_DESTROYED' which is currently returned by 'IDirectFBWindow'
    and 'IDirectFBSurface' if the window or surface has been destroyed.
    
    Added window event type 'DWET_DESTROYED' and changed meaning of 'DWET_CLOSE'.
    -          DWET_CLOSE          = 0x00000004,  /* window got closed by window
    -                                                manager or the application
    -                                                itself */
    +          DWET_CLOSE          = 0x00000004,  /* closing this window has been
    +                                                requested only */
    +          DWET_DESTROYED      = 0x00000008,  /* window got destroyed by global
    +                                                deinitialization function or the
    +                                                application itself */
    
    Added 'IDirectFBWindow::Close()' that puts a 'DWET_CLOSE' event into the
    window's event queue. The event dispatcher thread can then decide to close it.
    
    Added 'IDirectFBWindow::Destroy()' which actually destroys the window after
    sending a 'DWET_DESTROYED' event, so the event dispatcher thread can notice and
    release any interfaces belonging to it.
    
    After a window has been destroyed by 'IDirectFBWindow::Destroy()' most functions
    of 'IDirectFBWindow' will return 'DFB_DESTROYED'.
    
    There is no need to destroy windows explicitly with this new function if no
    threads are doing 'WaitForEvent()'. If an 'IDirectFBWindow' has no more
    references after 'Release()' the window gets destroyed implicitly if it hasn't
    been destroyed before.
    
    
    If you hold down 'CapsLock' over a window (as if you want to move it) and press
    the key 'C' a 'DWET_CLOSE' will be sent to the window.

commit 183bbecc2c2f07c4736160e6cffd0b5a5b0719b0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Sep 16 09:46:51 2001 +0000

    Matrox Backend Scaler support added.
    YUY2 added.
    
    With a matrox try: df_layer <any.avi>

commit cd99ba0285874fc1ec5d554099e9aaf04d96ad60
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Sep 14 00:23:56 2001 +0000

    df_layer now links against $(AVIFILE_LIBS).

commit cc00d022b03213175ab0e31b9fed948cace4c15d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 13 23:49:27 2001 +0000

    Forgot to set DLCAPS_SURFACE for primary layer (fbdev).
    Just changed the name of a function parameter in 'layers.h'.

commit a53b8beb1e4467742880b7b1a755e5ce7ce58467
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 13 23:39:22 2001 +0000

    Added new window capability, from the header:
    
    DWCAPS_DOUBLEBUFFER ... /* The window's surface is double
                               buffered. This is very useful
                               to avoid visibility of content
                               that is still in preparation.
                               Normally a window's content can
                               get visible before an update if
                               there is another reason causing
                               a window stack repaint. */
    
    
    Use 'alloca()' in 'IDirectFB::CreateImageProvider()' instead of 'malloc()',
    return appropriate error if file could not be opened.

commit 5fde11e5f990ced53459a712d8b0756aff3c3241
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 13 22:41:40 2001 +0000

    Added simple layer example which plays a video onto the second layer.

commit 6aeaa1bb3d376dc2711e4f3145a0b3d75b82e23c
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri Sep 7 00:04:28 2001 +0000

    in driver_deinit() card is set a state, where the aty128fb driver should never
    hang.

commit 7b2e3eef289d9cc93c5a0ee2296fc7b727cd4fc7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 6 23:15:33 2001 +0000

    The file descriptor of the allocated VT is now closed before deallocation.
    Added error checking to deallocation code.

commit 23d8ccf08d9e55e81076e6d95bd6a9f1fbd528ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 6 22:48:08 2001 +0000

    Call 'sched_yield()' after mutex lock failed.
    Call graphics card driver deinit in emergency deinit.

commit 219c175c1cabf7890462b6433da10dde8f55ae10
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Sep 6 20:31:06 2001 +0000

    Wrote a summary of changes after 0.9.4.

commit d586de4e1907ceb33be948354d418965c167a330
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Sep 6 19:56:55 2001 +0000

    enumeration callbacks return DFBEnuerationResult now (no more warnings)

commit ee34e0dd5d8bd7c1a6a0f773eb316ae765c81846
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Sep 4 16:50:09 2001 +0000

    Added a return value type for enumeration callbacks: DFBEnumerationResult.
    There are two possible values: DFENUM_OK and DFENUM_CANCEL.

commit 89b800f933c5904ab0e2877cf8ab5ec70b17359d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Sep 3 01:15:33 2001 +0000

    Accept interlaced and double scan modes, 320x200 looks really cool in some way.
    
    Here is a 320x200 entry for fb.modes:
    
    mode "320x200-70"
        geometry 320 200 320 200 16
        timings 79440 16 16 20 4 48 1
        double true
    endmode

commit 1ee50193f3f31e8491580b3801e063c6f16f0589
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Sep 2 22:58:05 2001 +0000

    Don't use the ERRORMSG() macro in DirectFBCreate() to bail out in case of
    dfb_config == NULL because ERRORMSG() uses dfb_config->quiet.

commit ea292ae71cf8d11c9454b077cc5942a802ead56c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 30 07:28:17 2001 +0000

    Added the field "video_memory" to "DFBCardCapabilities" which specifies
    the amount of video memory in bytes.

commit c076231bbb1960fdfc2b88bf60da307883b28658
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 30 07:19:57 2001 +0000

    It's now possible to move the window under the cursor by holding down CapsLock.
    Should this be optional as it renders the key useless for windowed apps?

commit 7f2ac96c070eea077fc1384d5a8d2f99a645bda7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 30 06:54:12 2001 +0000

    Check for "card != NULL" and "vt != NULL" in emergency shutdown
    which can happen before these are initialized.

commit 11e07d411df2cccd7e3e064ff5f6cfbe8525f60c
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Aug 27 14:48:27 2001 +0000

    Added more keycodes to make the demos useable with remote controls.

commit 8b8853a73d1e86c718e648f441c513c1872be067
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 27 03:04:31 2001 +0000

    fill all 32 bit of FCOL

commit bbfd5d4917fdbb7209ee8821c7f9bd7977212a57
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 23 20:48:57 2001 +0000

    Reverted last patch that disabled deinit/init during suspend/resume.

commit 2f5a3381a4180a8291125c367b5479a296e4dc5b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 21 02:37:15 2001 +0000

    Release destination surface in destruct method if still playing.

commit ab394940984a2fc63c140633940535f3dde42f4e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 20 19:28:56 2001 +0000

    dont deinit/init input drivers during suspend/resume

commit 5c7b5fc3e0d1df1f9d47568934e547d2b9dfd7ca
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Aug 20 16:06:45 2001 +0000

    Added DFDESC_WIDTH and the appropriate field in the description to
    specify font widths differing from the height, e.g. for non-square pixels.

commit 1f914f019fcb6fb927ebfbdeb06ab20fe26e4b72
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 17 10:09:03 2001 +0000

    detach from reactor AFTER 'window_remove()' so we get the DWET_CLOSE event

commit 91eed47ac807b3452ef9cb226a215c2748923ba9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Aug 17 05:22:53 2001 +0000

    In 'core_deinit_emergency()', e.g. when a signal is caught, try to prohibit
    graphics hardware access by doing a 'gfxcard_sync()' and a
    'pthread_mutex_trylock()' on 'card->lock' up to 100 times,
    this may fail if the current thread locked it itself.
    
    Fixes corruption of X when moving the mouse cursor during a crash.

commit 2d28f191cac6383d9808772d955e37cd3bf91e40
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 16 21:32:46 2001 +0000

    When blitting with blending don't read the destination and don't add it
    to the source if DSBF_ZERO is set as the destination blend function.
    Some comments added in gAcquire for better getting-into-the-code-again :)

commit 546bc9325eed0acd700e01cf37189d424d1e7706
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 16 00:13:01 2001 +0000

    The transparent color index did not always refer to a unique color in the
    color table, i.e. it's just the index that makes the pixels transparent.
    Current version uses an artificial colorkey and preserves non-transparent
    pixels from being the same color as the key, at least for RGB565.
    Not the best solution yet though.

commit 02129a00c81c5c7a9ad77c5e6f7cd798a8cc9a39
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 12 01:20:51 2001 +0000

    DFBFontDescription's field 'attributes' was not of type 'DFBFontAttributes'.

commit b1553f22a6d230e44ac8e36c3c5c52e8c62f1d53
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 11 20:17:13 2001 +0000

    release font in deinitialization

commit 425951eac14b106528f29ebc7985ec913bd7882b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 11 17:30:22 2001 +0000

    Fixed segfault in 'fonts_destruct()' that occurs if no glyph
    has been loaded at all (check for font->glyph_infos != NULL).
    
    Added unlocking and font releasing to destruct functions of
    Window and Layer implementation of IDirectFBSurface, too.

commit 3a53e4c3af5c570751dfcd3cd21e9c729ee28c2e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 11 02:10:25 2001 +0000

    Added cleanup handler that stops capturing.
    This handler gets called by core_deinit() and core_deinit_emergency().
    The only way to keep it capturing is to kill it with signal 9
    or disable signal handling.

commit 8b09ee41f9079c9fc6f0acf9cc8a7ed0cf4683aa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 11 01:53:39 2001 +0000

    sig_remove_handlers was an implicit declaration, added it to the header

commit 94dd477280aebc815801c627ea6c875adb7d4650
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Aug 11 01:45:00 2001 +0000

    remove signal handlers in deinitialization, fixes the following bug message:
    
    (!) --->  CAUGHT SIGNAL 2  <---
     (!?!)  *** BUG ALERT [vt_close() multiple times] *** vt.c (77)

commit c737e3042372ff952de9ffd6a5e9329063d6dea0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Aug 9 23:00:31 2001 +0000

    Added 'IDirectFBImageProvider->GetImageDescription' which fills out
    a 'DFBImageDescription', it contains a 'DFBImageCapabilities' field
    with the flags 'DICAPS_ALPHACHANNEL' and 'DICAPS_COLORKEY' for now.
    Additionally the Image Description contains the colorkey if
    DICAPS_COLORKEY is set, e.g. when loading a transparent GIF.
    
    The GIF loader no longer generates an alphachannel from the colorkey,
    because it turned the transparent color into black.
    
    If you want to have transparent GIFs,
    use colorkeying which is way faster anyway.
    
    
    TODO: Turn 'IDirectFBSurface->SetSrcColorKey()' into a pixelformat
    independent function that is called on the source for keyed blitting
    to a destination, currently the colorkey of the source is set at the
    destination in the source's pixelformat.

commit 14ffa404c40dde53507fb97fa8e02885cfa462dc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Aug 7 23:44:22 2001 +0000

    - Major cleanup.
    - Blending state fixes.

commit 9534b0ea6a489b775fce0356e17332852b088423
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Aug 6 22:54:41 2001 +0000

    added more info to the header file (and thus to the generated documentation)

commit 2fe2320b4b974b2daea7cae4176941299990be2c
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Aug 6 11:58:34 2001 +0000

    compile fix for mips, alpha and sparc architectures. SIGUNUSED is not
    defined in asm/signal.h on these platforms.

commit 969b9ff8664c6cebf72d3e51050fa569b85f2089
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 5 19:37:50 2001 +0000

    Added character keys, only keys not in the list are F1 - F12,
    should we add them, too?

commit 192d32350e2b572a3ddc0b76679518852b4dbdfd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Aug 5 19:29:45 2001 +0000

    Added fiorst version of a LIRC input driver.
    
    Simply name your keys (in the lirc config file) like the DirectFB keycode
    enum does without the "DIKC_" prefix, e.g. "OK", "MENU" or "VOLUMEUP".

commit e1095b423a9472206fa73feaab6dc4fc4c254a24
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Aug 1 18:39:36 2001 +0000

    use surface width instead of pitch for texture width

commit 2dad9c30386deb9100587b351747d9aa6cfd98c5
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue Jul 31 16:24:44 2001 +0000

    fixed small render bug in StretchBlit()

commit ba8311a3fa9f80b24919f36a89097c65fdb597f9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jul 28 19:28:22 2001 +0000

    handle case where $target is not set at all (tested for "NONE" before)

commit b621310ea7f1608cf14193dca61be7cba3f6da7d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jul 28 07:03:20 2001 +0000

    Memory debugging is thread safe now.
    Instead of exitting send SIGTRAP to ourself, when inconsistency is detected.

commit ef06f19f99af36abc736e17655f70f849693d888
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 26 02:52:02 2001 +0000

    New memory allocation debugging code that prints out a list of unfreed
    areas with function name it was allocated in, file and line number.
    
    Deinitialization code cleaned up and reactivated.
    
    Much code cleanup (file internal functions made static and moved to the bottom).

commit 898e8fa23246d8891334e2a15d0c4aaac86adc49
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 25 20:22:22 2001 +0000

    If debug mode is enabled all 'malloc()', 'calloc()', 'realloc()' cause a
    debug message with size, function name, file, and line number.
    Replaced some 'malloc()'/'free()' pairs by 'alloca()'.
    
    After DirectFBInit/DirectFBCreate about 1500 bytes where allocated ;-)
    Rest of the initial memory size relies to libc/libdl/libpthread.

commit d0392b408b891e5bc4340291720e69cd6ef11561
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 25 16:36:20 2001 +0000

    Return DFB_INVARG if text is NULL in DrawString.
    Unlock the surface in IDirectFBSurface_Destruct if it's locked.

commit cfbf118eeb964631b591831e0691815d54670e35
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jul 24 16:29:22 2001 +0000

    Unified types used for key_ascii and key_unicode.
    Please note that no inputdriver sets the unicode field at the moment.

commit 1c923825655b18362fcf95d8ef6490613fbd8a80
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 24 14:43:15 2001 +0000

    Added internal surface locking flag CSLF_FORCE,
    that forces 'surface_hard_lock()' to try a video instance.
    'gfxcard_state_acquire()' uses the flag for the destination surface
    if the graphics operation is blitting.

commit d2a79e5d877f79796c89005fa793922458b26f84
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jul 23 20:48:05 2001 +0000

    bugfix: removed free()s after provider->Release() is called. This fixes segmentation fault when using a background image.

commit 44d56b3306d5a9fbec4c353a6a53f941ceb19a0f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 23 18:03:37 2001 +0000

    The pitch for system memory surface buffers
    is now aligned to a multpiple of 4 bytes.
    
    Do not set SCHED_RR for input threads, use normal scheduling
    now, highest priority there is ok.

commit c36a7ea73f83c60fa43b1e20914318ce0b6d4768
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon Jul 23 15:20:53 2001 +0000

    rewrote gamma initialization code, should work in all depths now.

commit ce7b71c7a1277f439b526d0c9e0a4d84ae13e394
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 22 04:45:39 2001 +0000

    New input event field "timestamp" which can be set by the driver.
    I also added the flag "DIEF_TIMESTAMP", PS2 driver makes already usage of it.
    I reenabled setting high priority for input threads.

commit d44e1ba68359182e2ac93863172cd938894dfe89
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jul 21 04:34:18 2001 +0000

    renamed global variable "display" to "fbdev"

commit c59ece931784915e04b19fd2be33e9df8dd47d95
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 19 22:55:10 2001 +0000

    ignore file

commit 75229ecb8087977cd3a5316318586cd849825942
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 19 22:54:46 2001 +0000

    First version of nVidia RIVA TNT/TNT2/GeForce driver.
    Accelerates FillRectangle, DrawRectangle, DrawLine, FillTriangle
    without blending, no blitting support at all.
    
    Tested on GeForce 256 SDRAM doing 830 MPixels/sec in FillRectangle.

commit 51f1a71e6c56164d3bb043643e2c65d340aee1ed
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jul 19 12:09:46 2001 +0000

    adapted Makefile to file changes

commit 94ffbafe4671aeca7d1175900a31e181350b30c5
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jul 18 17:22:49 2001 +0000

    ok, i will compress it...

commit baa50356ed313c3c47802fb1934ffcbd98a6ed50
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jul 18 17:10:32 2001 +0000

    made a new aty128fb patch based on the driver in benh's tree

commit 485435620c7a85781692c07db628840ac547a00f
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed Jul 18 13:19:01 2001 +0000

    initialize palette/gamma during initialization. this fixes the
    "strage-color-effect" in ati framebuffer drivers without the patch in
    DirectFB/patches. A new patch that fixes only the remaining problems is
    underway.

commit d9e2b3c8f3a25b6eb436d6a1a8b4eb8e8b8aa0da
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 18 12:18:11 2001 +0000

    fixed typos

commit d891d4b61527aa5251b3d5a89c9a1bd7115efdaf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 17 12:15:19 2001 +0000

    only check source format if source exists

commit 3f752c4886bbfa54c8f0a3a639434c43c7d4fc0f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 17 12:06:17 2001 +0000

    check source and destination format in CheckState,
    hopefully rejecting surfaces with width < 8 or height < 8 now.

commit 0d9469a007457a87909508518ab8400bf4e0b8af
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 16 22:45:59 2001 +0000

    use INTERFACE_GET_DATA macro (reduced codesize by 182 lines / 0.5%)

commit 1bf83db24ce8da9b14a05f8151212796495785d6
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 16 22:01:13 2001 +0000

    (IDirectFB[InputBuffer|Window]->WaitForEventWithTimeout)
    Try to lock the events_mutex and check if there are events. If no events
    are pending, get current time before locking the mutex. This way the time
    it takes to aquire the mutex is taken into account for the timeout.

commit 85c098928095b67fd985dbc55c31584dd69b2939
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 16 18:49:34 2001 +0000

    Added IDirectFB->CreateInputBuffer() that allows to easily create input
    buffers for specific events.
    
    Use the new function in a number of demos.
    
    Bumped version number to 0.9.5.

commit 36d3c50cafd57f00f38fd561a16f63fcacfd646a
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 16 17:20:17 2001 +0000

    Added some more keys (ESC, Q, BACK, STOP) that quit the demos to make them
    useable with remote controls.

commit cecc4c565d282665493a7ac3043505230b7e29a1
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 16 16:21:03 2001 +0000

    Attach all inputdevices to the window stack, not only those of type
    DIDTF_KEYBOARD and DIDTF_MOUSE. Let's see if this is a good idea...

commit d37196de009795cc9dc69e8b4c84eeed536d0229
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 16 15:41:11 2001 +0000

    do not sort struct entries alphabetically, keep them in the original order

commit 3cbb42db9822b59540c8bdc8bfbf59ef69824b78
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 15 00:22:01 2001 +0000

    Forced CCF_CLIPPING to 0x00000001, was 0 before (first enum value).
    No hardware clipping has been used while this bug existed.

commit 02d55298b58830428596d924dfb7f20c28e28f77
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 13 13:51:58 2001 +0000

    define SI_KERNEL for glibc 2.1.x

commit 77ca011935795ed5c1cd6df853220a7b4ab57546
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 11 18:45:34 2001 +0000

    Fixed a bug in 'primaryFlipBuffers()' that caused windowstack updates
    that are done on the whole windowstack not to get visible when buffer mode
    is DLBM_BACKSYSTEM. (e.g. df_window with software driver)

commit e886636e11f4eeecaea1c84fa7cae07a77892bff
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 10 23:07:33 2001 +0000

    If a mode has been set by 'fbdev_set_mode()' and the detected
    pixelformat is DSPF_RGB15, set mode->bpp to 15.
    If mode->bpp would be 16 bit, we won't find the mode afterwards,
    because we will search for a 15 bit mode if the current pixelformat
    is DSPF_RGB15.
    
    Fixes bogus "Setting primary layer buffer mode failed!" problems.

commit b00b341aa7c49a2199db2fd19a4275bd6bb91e4f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jul 10 01:05:23 2001 +0000

    Added 'IDirectFBInputDevice->AttachInputBuffer()'.
    You are now able to receive events from multiple
    input devices with one buffer, nice with 'WaitForEvent()'.
    
    CAUTION: Releasing an IDirectFBInputBuffer does only detach
    from the device it was created from, following input events
    will cause a crash! Will be fixed soon.

commit 417cb92fa8074bf332ba46b94b481df111803b26
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 8 13:47:54 2001 +0000

    Call 'surface_flip_buffers()' after panning instead of before.
    Do a 'gfxcard_sync()' before FBIO_WAITFORVSYNC, actually a hack to
    reduce the time between vertical retrace interrupt and pan, as panning
    does a 'gfxcard_sync()', too.
    
    Updated all patches for 2.4.6, made usage of new kernel macros like
    'interruptible_sleep_on()' in Matrox patch.

commit d6b1afe8b9d57e9da08cf25588db38c366c1dccc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 8 09:00:17 2001 +0000

    Renamed LIBDIR to MODULEDIR and exported it in the pkgconfig file.
    This is the base directory for installed modules
    ("$exec_prefix/lib/directfb"). When installing a graphics driver
    "/gfxdrivers" has to be added to that directory.
    
    To query: "pkg-config --variable=moduledir directfb-internal"

commit 45e38fbaf1ca9fb9cf8ff279b09ab3a534bedce7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 8 07:35:35 2001 +0000

    Internal headers (all except "directfb.h") are now installed to
    "$prefix/include/directfb-internal". Files from "include", that
    are "directfb_internals.h" and "directfb-version.h", will be
    installed directly into this directory along with "idirectfb.h"
    from "src". Other headers from "src" will be in the same
    subdirectory as in the "src" tree. This way the '#include's
    are the same whether a module is built within or outside of
    the DirectFB source tree. First step to make it easier to write
    third party DirectFB modules in a seperate package.
    
    There is a new pkgconfig file "directfb-internal.pc" which will
    tell the third party configure script where the internal headers
    are installed to. It will output "$prefix/include/directfb-internal"
    when pkgconfig is called with "--cflags".
    
    Next thing to do is version checking on modules, because it probably
    will crash when using a module compiled with 0.9.4 is used with 0.9.5.

commit 01b9532b20ee74b9ee5d0c27a04ff3718cffc6b6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jul 6 16:13:52 2001 +0000

    Added summary of changes between 0.9.3 and 0.9.4 to NEWS.
    Generated ChangeLog, maybe Mitch can generate the better one with LDAP support.

commit 5ece734794984b4f18935a7b89f32d80c7760e06
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jul 5 13:19:26 2001 +0000

    Removed 'Dop' as it was always set to 'Aop', besides the two filenames above
    all functions are called '... to_Aop()' now. Also made 'RUN_PIPELINE()' do a
    "do { (*funcs++)(); } while (*funcs);" instead of
    "while (*funcs) { (*funcs++)(); }".
    
    These gave up to 70% boost for drawing solid lines and rectangles on a P3 800.

commit e64d81b0e2ab4c9e3288088341bc822d07bffc53
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jul 4 10:20:04 2001 +0000

    First entry in our TODO file ;)

commit 319148093bd495684147b13a6c855b977aae636f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jul 3 12:11:52 2001 +0000

    reordered Cursor interface declarations to get nicer documentation

commit 819547dc440f6826bbfda831a7de842e3ec983dd
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jul 2 19:37:22 2001 +0000

    implemented Sop_a8_set_alphapixel_Dop_a8 (untested)

commit a6c6357332b89f2c636e97319d370f24b1ee70d6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 16:07:48 2001 +0000

    Do not return 'DFB_INVARG' in 'SetBackgroundMode()' on success,
    could irritate someone ;)

commit 1fdfde638e9ee9d5f6bb3e1c27c0d119004714c1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 12:04:45 2001 +0000

    compile, compile

commit 496729959159bad4eba35dc872e2cbd69b1a75ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 11:59:45 2001 +0000

    compile with recent changes to sub surface handling

commit b8c816912e09ed13b5000544f9fb4b3a5b91a896
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 11:25:37 2001 +0000

    killed one obsolete parameter and 4 FIXMEs regarding proper setting of it ;)

commit faa4ae0454fadf496833d8ec301ac25bce134657
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 11:12:06 2001 +0000

    initial support for axis motion events with absolute values

commit f9593f5285bd02a3d5746e0d2f3124b4aa1ef4fa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 08:38:34 2001 +0000

    Fixed a very bad bug, don't use 'realloc()' on structures containing data you
    already installed listeners for with a pointer to it as the context ;-)
    Interface constructors no longer use 'realloc()' for 'thiz->priv' to store their
    extra data, they do the (bigger) 'malloc()' themselves before calling the parent
    constructor. Each interface constructor should check for 'thiz->priv == NULL',
    if this is the case they should do the 'malloc()' and then call the parent
    constructor if one exists.
    This fixes nearly every possible bug, because listener functions wrote into
    memory where there shouldn't.
    
    New result code 'DFB_INVAREA' that is returned if a surface has no valid area
    or a region or rectangle specified does not match, e.g. SetClip returns it if
    the clipping region specified does not intersect with the current (sub) area.
    It is also returned by the drawing and blitting functions if the source or the
    destination has a current (sub) area of size 0x0. That can happen if the surface
    is a sub surface, e.g. at x = 900 and y = 600, and the surface gets resized to
    something below that.
    
    Enhanced sub surface handling, there are three rectangles along with an
    IDirectFBSurface, these are "wanted", "granted" and "current". The first one is
    the rectangle passed to 'GetSubSurface()', it doesn't matter if it's too large
    or has negative starting coordinates as long as it intersects with the "granted"
    rectangle of the parent. The "wanted" rectangle should be seen as the origin for
    operations on that surface. Non sub surfaces have a "wanted" rectangle of
    '{ 0, 0, width, height }'. The second one, "granted", is the intersection of the
    "wanted" rectangle and the "granted" one of the parent. If they do not intersect
    'DFB_INVAREA' is returned. For non sub surfaces its the same as the "wanted"
    rectangle, because it's the rectangle describing the whole surface. The "wanted"
    and "granted" are calculated just once at creation, the "current" rectangle is
    the intersection of the "granted" rectangle and the surface extents.
    'SetClip()' and many other functions are limited by that one.
    This way sub surface area information is preserved during surface resizing, e.g.
    when resizing a window. Calling 'SetClip()' with NULL causes the clipping region
    to exactly cover the "current" rectangle, also the flag 'clip_set' is cleared
    causing the clipping region to be set to the new "current" after resizing. If
    'SetClip()' is called with a clipping region specified, an intersection is done
    with the "wanted" rectangle that is then stored in 'clip_wanted' and 'clip_set'
    is set. However, if there is no intersection 'DFB_INVARG' is returned, otherwise
    another intersection is made with the "current" rectangle and gets applied to
    the surface's state. Each resize, after the "current" rectangle is updated, the
    clipping region is set to NULL or 'clip_wanted' depending on 'clip_set'.
    This way even clipping regions are restored or extended automatically.
    It's now possible to create a fullscreen primary and call 'SetVideoMode()' with
    different resolutions or pixelformats several times without the need for
    "updating" the primary surface by recreating it ;)
    
    So '->req_rect' is now replaced by '->area.wanted'
    and '->clip_rect' is replaced by '->area.current' for the most cases.
    
    'IDirectFBSurface->Lock()' now adds the "current" rectangle's offset to the base
    address, so applications should use 'GetVisibleRectangle()' before writing into a
    locked sub surface to get the offset from the "wanted" rectangle and the limits.
    If there is no "current" rectangle 'DFB_INVAREA' is returned.
    
    Added 'region_rectangle_intersect()' and did some minor optimizations.

commit b8c69347c91bf7cfa8d0283cc1d05e7967419c07
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jul 2 02:24:43 2001 +0000

    SetVideoMode keeps current buffer mode, this prevents an already created
    flipping primary surface from turning into a non flipping one.
    
    Fixed 'primarySetConfiguration()' and 'primaryTestConfiguration()' for
    15 bit modes, they were broken since layer API changes last week.
    
    If 'fbdev_set_mode()' no longer overwrites the primary layer's surface
    format with DSPF_UNKNOWN in case of an error in 'fbdev_get_pixelformat()'.
    It also restores the video mode before returning DFB_UNSUPPORTED.

commit 8c89046df179d49ae3c0d38c79f2ac8c124ca93d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 1 23:31:04 2001 +0000

    Added macro 'CAUTION' to "coredefs.h" that should be used when unimplemented
    features or unsolved problems have a serious impact on further execution,
    e.g. crashes or wrong behaviour.
    
    Added surface resize handling code in 'IDirectFBSurface_listener'.
    If the surface is a sub surface it's area will become the intersection
    of the old area and the new surface extents. Prints caution message if
    there is no intersection or the clipping rectangle is out of bounds.
    
    Disabled code in 'IDirectFBWindow->Resize()' that is unneeded now, because
    surface resizing is now handled in 'IDirectFBSurface_listener'.
    
    Removed 'memcmp()' in 'IDirectFBSurface->SetClip()', it's always marked as
    modified now, I hope some benchmarking will show which way is the best,
    but this mostly depends on how often 'SetClip()' is called with the same clip.
    
    Fixed typo or braino in listener attached by 'state_set_destination()'.
    
    Changes above not fully tested, will test GDK backend soon.

commit c58427eca124b2d9715b97ab81a2f3b0ffd4fec9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 1 20:21:32 2001 +0000

    VT switching by pressing Ctrl+Alt+<F?> is now disabled by default, because
    it makes debugging impossible with only one machine (you cannot switch back to
    the console where you started gdb until you kill the program). The code is
    very experimental and sometimes it hangs during 'input_resume()'.
    
    Added option "--[no-]vt-switching" and wrote a better description for the
    similar looking option "--no-vt-switch", maybe we should rename that old one.

commit a0b6b844a7aeb667ef3fc61884f2d8ddfee602d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jul 1 20:08:01 2001 +0000

    made the "nearly black" color (#020404) "nearly black" for RGB555 (#020804)

commit cf8a8ff426194ada9997c0da9595ecd56d65cd57
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 30 14:05:21 2001 +0000

    Added internal macro 'INTERFACE_GET_DATA(i)' which checks the 'thiz' pointer,
    declares 'i_data *data', checks 'thiz->data' and writes it into 'data'.
    About 200 code lines less now ;)
    
    Added result code 'DFB_THIZNULL' and 'DFB_IDNOTFOUND'
    (returned by 'GetInputDevice' and 'GetDisplayLayer').
    
    Added 'DirectFBErrorString(result)' which returns a description string for
    the result, internally used by 'DirectFBError(msg, result)'.
    
    Added some more argument checks.

commit 7b2ec632463e731f0fb1a6938c46752ceb9e9135
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 30 11:11:22 2001 +0000

    in CreateWindow: return DFB_INVARG if height == 0 or width == 0

commit ae124c864c877e24c69a09b3f490a7b03f1e2444
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 28 21:19:59 2001 +0000

    ooops, forgot to register the GetCapabilities method...

commit 27fd9ff761c67a2b6d09c1e6c7493f891c97bab0
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 28 10:58:54 2001 +0000

    don't try to set opacity on unexistant cursor_window

commit 33686cc5ac6c668c93ed5acfeaf3035dfd6284ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 28 00:50:49 2001 +0000

    call window_repaint() on the cursor window in layer_cursor_load_default
    (fixes the bug that the cursor is invisible after enable until it is moved
    or the window stack gets repainted)
    
    do window_set_opacity() after window_init()

commit 8ee31a44d44628a7b7e5fe778684ea70b4951474
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 28 00:01:16 2001 +0000

    added option "--[no-]sync" that enables/disables a call to
    "sync()" in "core_init()", default is no
    
    I will write a "sync" in my rc.

commit b2f3fdb3eda23c91e2263385639cfb2c65ba0575
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 23:20:41 2001 +0000

    sig.c:
    - signal handler does a kill with the received signal instead of SIGHUP
    
    vt.c:
    - if the signal source is not the kernel, call the previously installed
      signal handler for that signal (does not seem to work for Kaffe)
    - use other signals than SIGUSR1 and SIGUSR2 that does not collide with
      Kaffe's garbage collector, a bit dirty (SIGUNUSED+10/11), but works

commit 35130374ebf475226f5053749f11fdc9ff5df0dd
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 27 22:53:32 2001 +0000

    removed a trailing comma from an enum

commit e78b05ccb25a6802e11c12ce478ebb4bbf4b0535
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 20:22:38 2001 +0000

    fixed description of SetSrcColorKey
    added initial API support for streamed video providers

commit 72a9fad67232b6c931863fc1d83f84140f4924ce
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 17:52:36 2001 +0000

    also did the same mode checking fix for the current mode (e.g. with vesafb)

commit 34ce15ba61661ade9d1a8e28c1a8f55b82607bc5
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 27 17:49:32 2001 +0000

    Renamed color to saturation in DFBColorAdjustment and friends.

commit c0c575093b8a0d7b1c856f377d8ce9f316175a0f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 17:20:16 2001 +0000

    flickering in windowstack fixed, got broken tonight

commit 3543270c77bd3be3beac8f965dd078ec119b39e6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 17:11:20 2001 +0000

    fixed bug that caused an error "Could not set default mode!"
    if the first entry in fb.modes doesn't have 15, 16, 24 or 32 bit

commit 33aebdcfdf544f79283e399ab60a6f31c01cd54b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 17:09:59 2001 +0000

    applied patch from Joachim "roh" Steiger that adds missing
    pthread includes

commit 5b8832fb67705900e1794dab7c68b728c3ff5a72
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 13:59:28 2001 +0000

    should be 0.9.4 after recent API changes

commit 7870fa6a95b85007d073f2d75b880af02989217c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 27 13:58:30 2001 +0000

    Changed Display Layer Configuration API:
    - DFBDisplayLayerCapabilities extended now including color keying and other
    - removed DFBDisplayLayerModeFlags, added DFBDisplayLayerOptions instead
    - added IDirectFBDisplayLayer-> Get/Set/TestConfiguration that take the new
      DFBDisplayLayerConfig for almost all settings like pixel resolution, pixel
      format, DFBDisplayLayerOptions and more
    - TestConfiguration takes an additional DFBDisplayLayerConfigFlags to
      optionally write back the settings that failed
    - removed GetSize, SetBufferMode and SetMode
    - added SetColorKey and SetScreenLocation
    
    Followed API changes in IDirectFB, IDirectFBDislayLayer, IDirectFBSurface_Layer
    and some demos.
    Cleaned 'fbdev.c' (that handles the primary layer) to follow internal display
    layer driver API changes.

commit 5069d321c9844f4b4aedf41ea2164f72e6db8b93
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 27 13:32:39 2001 +0000

    check return values of new ioctl calls

commit 13d4b323c350647aeeaed5d13c2c22d2fd4277b2
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 27 11:04:18 2001 +0000

    Extended IDirectFBVideoProvider API:
      IDirectFBVideoProvider->GetCapabilities()  retrieves info about the provider
      IDirectFBVideoProvider->GetColorAdjustment()
      IDirectFBVideoProvider->SetColorAdjustment()  get and set values to
                                                    adjust the video colors
    
    The DFBColorAdjustment maps directly to the Video4Linux API. We might want
    to change it to take floating point values instead of __u16 ?!
    
    Output useful error message if doc generator dies.

commit 6eccc3037b17c3abef9a4e052c8ef87ed92efeae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 26 17:21:59 2001 +0000

    don't catch SIGPOLL (a.k.a. SIGIO)

commit 1e9d97eb27ac794ebab46d4ee19f38686d66a290
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 25 15:38:02 2001 +0000

    Reenabled key events for windows (we lost them while adding support for
    console switching).
    
    Changed cursor handling: Cursor can be enabled/disabled and opacity can
    be set independently. Also cursor appears centered now.
    
    Process key events in df_window: Cursor keys move active window.

commit 9c53a4df681b0b9bc915545f75dd3b17aa385a46
Author: Sven Neumann <neo@directfb.org>
Date:   Sun Jun 24 20:45:56 2001 +0000

    fixed transparency problems for large palettes (transparent index > 127)

commit a42cbd3754a5f66c1de06903815f2d5202b4a2c9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 23 13:05:28 2001 +0000

    Added console switching support during runtime!!!
    
    Experimental but working... use Ctrl+Alt + (F1 - F12) ;)
    Had to add much code to src/core/vt.c that does the
    biggest part of the job (reentrant signal handler ;-)
    Added VT_ACTIVATE code to the global keyboard handler
    in src/directfb.c, which handled Ctrl+Alt+Backspace so far.
    Also modified the keyboard driver, because vt switching
    code in src/core/vt.c already had to open the target tty.
    
    Turn on debugging during configure if you have problems with
    switching and mail the output to the developers list.
    
    
    Other fixes and additions:
    
    Another 'mga_waitfifo()' call corrected (10 -> 12).
    
    Fixed bug in 'surfacemanager_suspend()' that broke some surfaces,
    e.g. fonts. It did not assure a valid system memory instance.
    It still does not care about video only surfaces.
    
    Fixed 'reactor_dispatch()', RS_REMOVE was not handled.
    
    Added RS_DROP that tells 'reactor_dispatch()' not to do
    any further dispatching of the event.
    
    Do a 'kill (0, SIGHUP)' in signal handler instead of 'exit()',
    after all our handlers are removed, of course ;-)

commit c6f3478883d846d98258af0482e96f0dd4b27cc8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 23 03:49:56 2001 +0000

    Require working frame buffer device, not only compiled in.
    Fixed a typo.

commit 76786fdf6920138dd7beb3f5a6e8fc399db6bbff
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 22 20:25:52 2001 +0000

    fixed a bug in the fb switching code that made RGB32 modes fail

commit 951d64bd3719130416bd4c9c35042330ff0e2573
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 22 19:34:31 2001 +0000

    fixed another bug in copy_buffer_32().

commit b2cf5f965541c9bf6ebb766ec54d6264bd128695
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 22 19:29:12 2001 +0000

    Fixed a stupid bug in copy_buffer_32.
    
    The PNG provider ponly writes directly to destination surface if
    format == ARGB, not if bpp == 4.
    
    The GIF provider did not take destination pitch into account.

commit f05c548eb80586310e6ee637a7c14acac2bc62c2
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 22 19:05:42 2001 +0000

    optimzed copy_buffer_32()

commit 940de8cf7309deb1d91982a3b3ae9f6d3cce0531
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 22 17:59:55 2001 +0000

    Removed an unnecessary GetSurfaceDescription() call.

commit a2678a2c719acf50820712b25c02bd787178304d
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 22 17:44:17 2001 +0000

    Added alpha transparency support to GIF ImageProvider.
    
    Fixed alpha handling in scale_linear_32 and copy_buffer_32:
    If the destination format does not support alpha, blend the image data
    over a black background since most images have undefined color values in
    the transparent areas.

commit ea2443e07ad2b9739c3c9d141b4d272c9ec1a333
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 22 03:41:58 2001 +0000

    - df_dok accepts failing SetCooperativeLevel
    - df_andi and df_dok both ask the primary surface about its size
      and not the primary layer

commit b3aa77c72a2f027213271802f65194e256a28ba8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 22 03:19:08 2001 +0000

    Added option "force-windowed" which makes SetCooperativeLevel
    return DFB_ACCESSDENIED for other levels than DFSCL_NORMAL.
    
    df_andi, df_particle and pss don't abort anymore
    if setting the cooperative level fails.
    
    Check for 'argc <= 1' instead of 'argc == 1' in df_dok,
    because 'main()' can be called with argc set to 0 ;-)
    
    Moved global variables of df_window into the main function,
    removed layer enumeration that did not make any sense because
    the IDirectFBDisplayLayer has only been constructed for the primary
    layer, and that is DLID_PRIMARY just passed to GetDisplayLayer.

commit c773af56feeddf8e9808ace558f685b75c1ce065
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 21 23:24:45 2001 +0000

    initialize AVIFILE to "no"

commit 862c863656bd5b90a94f6fb10ee896921bacae0f
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 21 21:17:08 2001 +0000

    first check $target for system type, if $target == "NONE" check $host

commit e2a5632383f428b8dc77568a170f37a73dc7a77b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 21 20:47:12 2001 +0000

    hopefully fixed the alphachannel bug from gif loading
    (internal buffer was not set to '0xFF000000 | color')

commit dcc6bc2a46c0a5a977de7b7c9ccf79e36fa9d34d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 21 18:36:45 2001 +0000

    Use mga_in32 in mga_waitfifo rather than mga_in8.
    Added mga_waitfifo(1) in FlushTextureCache (I forgot).
    Problems with G200@ARM are gone now.

commit 560e4e7bb9d0d0015499782bc2401cc46467f8d8
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 21 12:43:26 2001 +0000

    forgot this one when changing the headers

commit 90ae2c304a6b666ad1a212bf614bd89e62885786
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 21 12:39:02 2001 +0000

    Great Header Cleanup (TM):
    collected typedefs in core/coretypes.h
    removed inclusion of headers from most headers

commit 677c11632c6873a1020f6358a8f7fc267ab61463
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 21 09:02:05 2001 +0000

    check for surfaces bigger than 2048x2048
    apply mask 0x7fff to pitch before setting it

commit a34eb374b5c0907e26a7382081783150e8e0a926
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 21 08:26:14 2001 +0000

    DIFFUSEDALPHA for BLIT_NOFX was wrong, ALPHACTRL programmed to 1 for BLIT_NOFX

commit 3c04c4996c112d4cd812797b1e3ba2f7d32b9cf8
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 20 16:05:40 2001 +0000

    fixed a braino and some compiler warnings

commit e2a8d35c782de98af3329571f6af856676b062bf
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 20 14:50:04 2001 +0000

    Removed -fexpensive-optimization from compiler flags since -O2 already
    has this. Added -fomit-frame-pointer unless debugging is turned on.

commit 3045ad9af272293736d6a8dab063e45f7e6ae4b9
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 19 17:22:28 2001 +0000

    optimized utf8_get_char() for the default case (7bit ASCII)

commit b3750267da7369f195e37b46670a05e6c8a6cb97
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 19 17:02:08 2001 +0000

    Reduced size of fast_keys array to 96 by skipping the first 32 entries
    (not used for glyphs in 7bit ASCII).

commit 1538be687788c27a7535a154f8836e45beecaa07
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 19 14:52:27 2001 +0000

    fixed 'read_modes()' and 'fbdev_set_mode()' for mode testing,
    'fbdev_get_pixelformat()' fails on some framebuffer drivers that
    do not fill out fbdev_var_screeninfo in FB_ACTIVATE_TEST mode.

commit 5dd672a897f3dddbc3664573ded896130609513e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 19 14:15:30 2001 +0000

    don't process click events either (if cursor is disabled)

commit b16fb855567a810b32c513275fcdd3fabe65a619
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 19 14:11:55 2001 +0000

    do not process mouse events if cursor is invisible

commit 8fd6e03fbbe7478080ec0f6eed95e0bc056755ed
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 18 17:24:45 2001 +0000

    Install a KillHandler for AviPlay and delete the object on interface
    destruction. Fixes the segfault in IDirectVideoProvider_AviFile_Destruct().

commit 0af28fda5d9e606a163d10630de00ef4b6e2795b
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 18 11:53:42 2001 +0000

    forgot to remove debugging output

commit 9ba126148e365a78185be4e7f0beb6d0fe25844f
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 18 11:47:47 2001 +0000

    Rewrote handling of CFLAGS and CXXFLAGS so we respect the values that have
    been set before configure is run.

commit 2eff15514a34b057a03b74c850456e9673719db5
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 18 09:33:03 2001 +0000

    Removed the utf8 optimizations (only call utf8_* funcs if c & 0x08) since
    they give no measurable speed improvement (0.0 - 0.05 %)  and may cause
    trouble for badly encoded strings.
    
    Do not insert values for fast keys into the binary tree. Free all values
    in the fast_keys array on tree destruction.

commit b7ccfbe2958c329ad0012dcccd46399bf0f43186
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 18 06:23:02 2001 +0000

    Default font loader did not set 'data->surface'.
    'gfxcard_draw_line()' is now 'gfxcard_draw_lines()'.
    Added 'IDirectFBSurface->DrawLines()'.
    df_dok uses 'DrawLines()' now for 10 lines each,
    added 'myrand()' that speeds up the benchmarks a bit, too.

commit 6893690eb092879f371dc7bfefdc60bf5c4a791e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 18 04:39:13 2001 +0000

    Killed a modulo, a division, an array lookup and an 'if'
    for each glyph in gfxcard_drawstring:
    
    CoreGlyphData->start now is the starting x coordinate within its surface.
    Added CoreGlyphData->surface that holds the surface the glyph is in.
    
    Again, 395 -> 410 KChars/sec here.

commit 12dda36baee042b0080d68e17fd439651aed1661
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 18 04:12:56 2001 +0000

    Only call 'utf8_get(&c)' if 'c & 0x80'.
    Added 128 "fast keys" to tree code,
    it's an array of values for a faster lookup of keys 0 - 127.
    
    These two optimizations should increase DrawString performance on slow
    machines (even on my Celeron 533 with Matrox G400: 374 -> 395 KChars/sec).

commit 50a167da639ce7b48394fe620c16b735fb27abd7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 18 01:59:38 2001 +0000

    Respective error message in DirectFBError for DFB_MISSINGIMAGE.
    (did a commit on 'idirectfb.c' last time instead of 'directfb.c')

commit c55b13d1631f6161b51b5289b638d714aee9521d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 18 01:56:41 2001 +0000

    SetBackgroundMode returns DFB_MISSINGIMAGE if DLBM_IMAGE has been set
    without a background image being set before.

commit e35b6231ecd65f1a4628b596c7455e01f1c5827a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 18 01:17:42 2001 +0000

    Do not use "-g" as default, add "-g3" to CXXFLAGS if in debug mode.
    
    Added new function GfxCard->FlushTextureCache: after the video memory
    has been written to by the CPU (e.g. modification of a texture) make
    sure the accelerator won't use cached texture data. This new function
    is called each surface_unlock (we should check if it was a soft lock
    to video memory).
    
    Implemented FlushTextureCache in Matrox driver, because font problems
    are solved if any TEXORGn register is written to. Maybe this is just
    a coincidence, but it works ;-)

commit c5ac13e6d6a19d9f6af9f7fd197bd1e9722056da
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 16 17:13:28 2001 +0000

    The long awaited killer feature: cursor movements are clipped by the desktop ;-)
    
    CoreWindowStack has a DFBRegion called "cursor_region",
    so we can add things like window clipped cursor during grab easily.

commit fa89e09909f3a361610ea7838700c7760c9d648b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 16 16:13:20 2001 +0000

    Replaced all identifiers "id", for Objective C and maybe other languages.

commit 6e59412338140ac131f81481c3457c0f2f34754c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 16 12:04:52 2001 +0000

    Applied patch from Till Adam <till@adam-lilienthal.de> that adds
    the IDirectFBWindow->WaitForEventWithTimeout that I forgot.

commit ebd51ecfc61e4320b3b997413dc25bde07310fef
Author: Michael Natterer <mitch@directfb.org>
Date:   Thu Jun 14 16:37:29 2001 +0000

    Updated ChangeLog.

commit f7c1e47573839d87e2323850ff1d44c64f9743ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 14 15:19:13 2001 +0000

    updated

commit b071df21d878fe90b681687bbebc640b2c01df61
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu Jun 14 01:40:09 2001 +0000

    compile fix for big endian machines

commit 2bd4ca80e54da14c984a0086c2ced8d432eec5ef
Author: Michael Natterer <mitch@directfb.org>
Date:   Wed Jun 13 20:20:45 2001 +0000

    Re-enabled and fixed two lines which close/reopen the input devices
    on Suspend()/Resume().

commit 844040693e3e7ff61838b607a2f8e3d13abe1703
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 13 15:26:05 2001 +0000

    Added DIDID_REMOTE to the list of predefined device IDs.
    Uniquify device IDs.

commit 6e32909bbbe09eee2dcdd046ee6c80e97951b9b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 13 06:13:13 2001 +0000

    - log2 had to return ret, always
    - optimized TMU calculations, better rounding, looks always good now

commit d5b31da1f6fa5f668e92274e2458a20d24a30b9f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 21:11:12 2001 +0000

    include Video4Linux video provider in the configure result list

commit d4ef28d42f2a5d249d0accc57725aff3dab02bc8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 21:01:46 2001 +0000

    call v4l_stop() in v4l_deinit() to eventually stop the v4l thread

commit 4dbcad078491aca3b5c1830009e957d3046e12d5
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 20:50:54 2001 +0000

    use correct variables for configure result list

commit b343ec672908f10f03523d688a22876f41c47c36
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 20:45:25 2001 +0000

    describe how to configure a serial mouse for DirectFB

commit 1c3da755c9df6138d39b839624b142dfd91a5558
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 20:44:29 2001 +0000

    use $JPEG and $PNG

commit b4383667156b0817aaf98a897ebfe6d5d2dd648c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 20:29:09 2001 +0000

    do not print "on" for MMX support

commit 6f6fc3ebdc19c9eae186b2acbd6acf6a07754e21
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 20:18:12 2001 +0000

    Prints summary of build options and built providers/drivers.

commit 4ac659a8731db4acd73d0f381ad41bddee3464fd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 18:24:30 2001 +0000

    added Joachim Steiger to "thanks to"

commit 16ca71f02595ef04846686242a7d102f5b527337
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 18:11:24 2001 +0000

    Check for <linux/fb.h>
    Check which gfxdrivers can be compiled by looking at <linux/fb.h>.

commit 612e94f83f7dc646f4a4615f081c0a7ae4c22c99
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 18:00:57 2001 +0000

    fixed typo added note about conditional build of providers

commit 92e1d7a4b7f7742b88f7a8dd0d7f980a940c7c18
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 12 17:58:30 2001 +0000

    updated

commit d027700f2e6887e60aea0525aba1d7c5c01f0d3a
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 17:24:38 2001 +0000

    update

commit 44935954080ff76ce61ef5365280350e71543ac3
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 17:23:57 2001 +0000

    Even more remote control keycodes.
    
    Allow conditional build of gif, jpeg and png image providers.
    Allow conditional build of freetype font provider.
    We strongly suggest you don't disable the build of these modules
    since the example code and most DirectFB apps depend on them.

commit 804ff88aace436b082f76adaf0ed87c466a81a63
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 14:40:36 2001 +0000

    added a few more remote control keycodes we might need

commit bada3147708b91cf65eafed4e6fbebf6965d272d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 13:05:05 2001 +0000

    Added tree_lock() and tree_unlock() to allow to use the tree in a thread-safe
    way. fonts_get_glyph_data() locks and unlocks the tree so it can be called
    from multiple threads. Unfortunately this brings down performance a little.

commit 0f11fcb5a03c38bbbcac50a06e9701741302d99b
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 12 11:17:08 2001 +0000

    include <sys/time.h> and <sys/types.h> for select()

commit 4611043d3dbb3d9856b829aa25a696529e7f13d0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 11 20:53:51 2001 +0000

    fixed license, oops

commit 8ce42ae9b3ecd033ae0824bade3f9990c78df243
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 11 18:36:01 2001 +0000

    The old implementation of the MouseMan protocol definitely did not
    work, this one might do the trick...

commit 1119186846261558439ac128e37bb516b3b657a9
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 11 18:17:26 2001 +0000

    Replaced old remote control keycodes with new unified keycodes.
    Removed special handling for remote control from keyboard driver.
    Decreased wait cycles in initialization of serial mouse driver.

commit 219e158ae0327cc934943f1593339e5f95f8a03b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 11 15:43:45 2001 +0000

    split up window_create and added window_init that has to be called after
    window_create. i split it up because the code in window_init generates
    events, but the reactor can only be attached to after window_create.
    this fixes the missing initial DWET_POSITION_SIZE event.

commit a7ec1bfd860672f6e79805c43e31d98c38d5d90c
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Jun 11 10:26:57 2001 +0000

    Fixed a bug in window_request_focus() where the wrong window was emitting
    the DWET_LOSTFOCUS event.
    
    Rewrote large parts of df_window to make it behave more like a windowing
    system as you know it. You can specify a video file on the command line
    to bring some live into the second window.

commit e32b87b009dd92d79f01e0c2576d159d145de60c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 11 02:59:28 2001 +0000

    ifdef for FB_ACCEL_MATROX_MGAG400

commit 71f2c71ad59c40a766ba0eb0b2adb2f3b8856a34
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 11 02:57:42 2001 +0000

    Removed signal handler for SIGSTKFLT as it is
    not available on all architectures.

commit b99b06f353ce516a1c28f0994e90f81f81e2dbba
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Jun 10 21:25:07 2001 +0000

    Added "Thanks to" section

commit 2ee12cf2ea20d4f342a8f689c56d85496c6c1e79
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 9 15:18:01 2001 +0000

    Finished update_region for windowstack repaints.
    Nothing will be drawn that is not visible after all.
    Every further windowstack optimizations have to be made in other
    functions like window_move (blitting within same surface, actually
    from front to back buffer, but that is default ;-)
    
    Fixed segfault in surface_destroy (many demos crashed at the end),
    df_porter did not run at all, because surface_destroy was called from
    font managering system.

commit 6646ac4952f601e071c06df8d8e1c7a9888f7514
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 9 15:03:39 2001 +0000

    added ltconfig
    
    any volunteer to fix DirectFB for the new autotools?

commit 3754a1f839118a178d0bb831817618fab7619155
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Jun 9 15:03:01 2001 +0000

    df_fire: use DirectFBSetOption to force a systemonly surface for the fire
    window (actually for all windows) instead of implicitly forcing it by
    setting the desktop buffer mode to backsystem.
    
    IDirectFBWindow: detach from reactor before destroying the window,
    return RS_REMOVE when DWET_CLOSE is received in reaction function.

commit 11dc1a2144b40fb9462111cc5e76ec2f7ff1203e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 8 23:31:33 2001 +0000

    rewrote windowstack_repaint, no performance gain yet, but this recursive
    function is designed to just pass the rectangles that are not covered by
    the opaque window of the iteration level (make update_region calls in all
    16 different cases).

commit 91ddd5217f3b77e39294c29029f7db3c409582e0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 8 22:32:44 2001 +0000

    Applied patch submitted by Till Adam <till@adam-lilienthal.de>
    with a check if DirectFBSetOption has been called before DirectFBCreate.
    Also added function to directfb.h.

commit 82579928a661c8e3f55750666233c35e93458f34
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 8 18:44:03 2001 +0000

    Added IDirectFBInputBuffer->WaitForEventWithTimeout (secs, nano_secs).

commit a75dca5d1f117bdf9b049c0317d80e912b2503db
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 8 15:48:59 2001 +0000

    fixed(?) handling of middle mouse button for MS3 protocol

commit 8b9b12a782fd39a8b9f5d79bf6ec6086d4fa683b
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 8 13:37:17 2001 +0000

    We now support the following serial mice:
    
      "MS"		   two buttons MS protocol
      "MS3"		   MS with ugly 3-button extension
      "MouseMan"       referred to as MS + Logitech extension in mouse(4)
      "MouseSystems"   most commonly used serial mouse protocol nowadays
    
    All this is highly experimental and needs more testing.

commit 07865ab2ca1ed2ff077b72452b36ef3cb85ed872
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 8 12:06:12 2001 +0000

    Small code cleanup in ps2mouse inputdriver.
    
    Added support for MS 3 button mouse protocol (this protocol sucks!) to the
    serial mouse inputdriver. Put "mouse-protocol=ms3" into your directfbrc.

commit 7ea9ae0a997fc02dbe659f72d668116a109761b4
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 8 11:30:59 2001 +0000

    typo fixed

commit 64935e4ab98b69286d61dc4e6d4f2d6d610d8446
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 8 08:50:45 2001 +0000

    Print init type message if an interface implementation is loaded.

commit 2886fcb4156270979f34614649b5d4dd3f9fcf24
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Jun 8 08:28:37 2001 +0000

    moved window event buffer into interface using pthread conditions
    windowing events are dispatched through reactors now
    (~100 lines stripped from core ;-)

commit 7531cc785696a90b3d11a8389d547097ce7bcfae
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 7 21:46:07 2001 +0000

    use pthread conditions

commit 62922355a116185bcf529d2c62f1a2f032d0a1f9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 7 20:39:19 2001 +0000

    fixed bug when blitting from 32bit without blending,
    e.g. --blit-convert in df_dok

commit 4b0433ba742f89d8977fea9ec439771d3387d0fd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 7 20:06:20 2001 +0000

    follow changes

commit 127efd7d2210cc4f909c8785c4f1769cd877e9f6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 7 20:04:19 2001 +0000

    API Change: The Input Device ID no longer contains the type of input device.
    
    Added DFBInputDeviceTypeFlags to DFBInputDeviceDescription that contains
    the type of the input device specified by one or more of the following flags:
    
    DIDTF_KEYBOARD      = 0x00000001,  /* can act as a keyboard */
    DIDTF_MOUSE         = 0x00000002,  /* can be used as a mouse */
    DIDTF_JOYSTICK      = 0x00000004,  /* can be used as a joystick */
    DIDTF_REMOTE        = 0x00000008   /* device is a remote control */
    
    
    Something like
    
    ...       DIDID_TYPE(id) == DIDT_MOUSE
    
    should be replaced by
    
    ...       desc.type & DIDTF_MOUSE

commit 481646b9098655690241b0b41319857c1699b9d3
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Jun 7 17:01:22 2001 +0000

    InputDevice info.driver_name/vendor are now pointers

commit 7e20ac12b43205da944a37be24eee0095925754f
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 7 16:00:20 2001 +0000

    s/msmouse/serialmouse/

commit 4b754161acdf13930f022b5cb6285806c0f4c892
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 7 15:17:56 2001 +0000

    Renamed msmouse inputdriver to serialmouse since this beast will support
    other more serial mouse protocols in the future.

commit c9c31a29046d5806b2861d55e1acffeaef4d4437
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 7 15:06:02 2001 +0000

    Added config option "mouse-protocol" (for serial mouse only). You need to
    specify the protocol type if you want to use a serial mouse.  At the moment
    only "ms" (2-button) is supported. I will add more serial mouse protocols
    later.
    
    Check if a mouse is attached to the serial port.

commit a08631348a58dd0f6c1a6e8a7e6f87d46007774f
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Jun 7 11:57:11 2001 +0000

    first working version of the MS Serial Mouse inputdriver

commit b43ef57d8dddd7152db7f2d3a88b98dd1c5326dd
Author: Michael Natterer <mitch@directfb.org>
Date:   Thu Jun 7 00:09:22 2001 +0000

    Updated ChangeLog.

commit 7b07b37557407b6d5432279dfb09419933d6226b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 6 23:49:38 2001 +0000

    surface listener ported to reactors

commit 808949c296c609c5d7268b4c33d9363597745ff4
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 21:40:49 2001 +0000

    added MS Serial Mouse inputdevice, disabled at the moment

commit 2b0c8cb41f0c2529c3f5c63b5fb3615dd3e2a677
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 6 19:36:13 2001 +0000

    added common event dispatching code in reactor.[ch]
    all input event listener handling and event dispatching
    done through reactors
    input driver code cleanup
    removed unneeded input driver headers

commit a9ba811a1c58198d11bd6fab8bd8a8b7c7353684
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 19:36:11 2001 +0000

    forgot to change config -> dfb_config here

commit ec6d7eb670a2522d7bcc596a80986505306a4546
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 19:27:25 2001 +0000

    renamed global variable config to dfb_config

commit 861cdfb7bbbcb8fe8085e90f04b1532fe90e84ab
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 18:59:32 2001 +0000

    removed some unused includes

commit 3e3f64a319a6d7cd05cab6fa44e1569f1e0d6b43
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 17:38:20 2001 +0000

    updated NEWS

commit 51881d29e17fd3d6c53efc8958bb1687bd50293a
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 16:19:57 2001 +0000

    restructured interfaces directory

commit e0c63211a67226351de9a047b5849a6ca4c01ffa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 6 16:11:14 2001 +0000

    purged now

commit 57e9aa06c42c6cc91840ffac75f8a79b716991cc
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 15:50:37 2001 +0000

    Tweaked Sop_a8_set_alphapixel_Dop_rgb* functions as suggested by Fefe.
    Speeds up DrawString by several percents.

commit 8f91e830d25e257b58795ce608e8b75287b6ea04
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 6 15:32:38 2001 +0000

    inputdrivers modularized

commit 31fa5aa792912778579ce4ee2233873ff52a842b
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 14:15:53 2001 +0000

    use calloc() instead of malloc();memset()

commit 9b14c2e93e0c9072506184431306600fcbff3529
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 14:02:45 2001 +0000

    use calloc() instead of malloc();memset();

commit e192bf1a7ee1ba55b49264f1da589ac1be4e22a9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 6 13:57:12 2001 +0000

    started to begin using calloc ;-)
    added core_load_modules( dir, callback, ctx ), a common function for
    loading modules in a directory, callback can return one of the following
    values: MODULE_LOADED_CONTINUE, MODULE_LOADED_STOP, MODULE_REJECTED
    made usage of the new function in gfxcard.c for driver loading

commit 7067593dbba2558a8eb9cd394133e4a4be40332f
Author: Sven Neumann <neo@directfb.org>
Date:   Wed Jun 6 11:28:04 2001 +0000

    I managed to put even more typos in here...

commit 49f43f423891f86337238f8b270a3e589cedd702
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Jun 6 00:26:02 2001 +0000

    s/Joachim/Johhanes/
    
    Sorry.

commit 1344a77b354fa846127ea4c58f3d271bfe742a8a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 5 23:58:30 2001 +0000

    set alpha value in state only if it's not the desired opacity
    removed comment from surfacemanager
    deallocate and allocate video buffers until proper reallocation
    method is present

commit 9dd587bbdb238759b570fcb9bd927019858e4f03
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 5 19:12:37 2001 +0000

    enhanced the suspend/resume hack
    added DFBAddSuspendResumeFunc and DFBRemoveSuspendResumeFunc
    registered functions are called in IDirectFB->Suspend/Resume
    V4l Provider closes video device in suspend and reopens it in resume

commit e0ad3d1b7e3da23bf5a5d36d7b9f8d1780a427ab
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 5 18:57:27 2001 +0000

    bumped version number to 0.9.3

commit 61e8fc73ae4997f587a6b104f22479870009b7df
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Jun 5 18:22:09 2001 +0000

    New internal function rectangle_union.
    
    New API function Font->GetStringExtends which allows to retrieve the
    logical and ink extents of a given string. Refer to the documentation
    in directfb.h.
    
    Modified gendoc.pl so it translates empty comment lines into paragraphs.

commit 0db8053ea7c3e7e1442bb291291d797da8a287cc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 5 16:57:51 2001 +0000

    disabled normal deinit code, mutex locking in exit handlers is evil!
    we have to rewrite all this deinit shit.

commit c706a4a361bc695cb705174ee65fe1360711e914
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Jun 5 15:48:36 2001 +0000

    send DWET_CLOSE event before destroying window
    how can we make sure that another thread that hangs on the mutex lock
    gets the event BEFORE destroying the window? maybe we should tear the event buffer
    off the window structure.

commit cbd8ee4f403a10151e040355f6d005b2e60a4785
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 4 15:02:26 2001 +0000

    fixed make clean ;)

commit a7234414ce25637fb5a8b989778bfafcaf501db8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 4 14:41:25 2001 +0000

    applied really nice patch from Sven that reenables
    the colorizing with a better calculation, too slow for you?

commit bc73a036e2fe69480502f27d59ba6778346fba25
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 4 13:39:14 2001 +0000

    patched the patch, ioctl should return -EINTR and not -ERESTARTSYS
    
    from linux/errno.h
    
    #ifdef __KERNEL__
    
    /* Should never be seen by user programs */
    #define ERESTARTSYS	512
    ...

commit 42ad2310d30a429732daceb82b9eb92d8310151e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 4 10:33:17 2001 +0000

    The real way[tm]! With mouse to rotate and keyboard to move a la Quake!

commit 6e4966a10d6b01bb141ae744e41212cd1011c1d7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon Jun 4 09:57:19 2001 +0000

    check for row_width > 0 before modulo

commit e2667e882f8d1b8e2889f51a8287b6a63024dd40
Author: Sven Neumann <neo@directfb.org>
Date:   Sat Jun 2 18:14:25 2001 +0000

    applied a patch provided by Johannes Zellner <johannes@zellner.org>
    that adds support for loading interlaced PNGs

commit d12c662616ea039dea64c40756241b8b4e733b08
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Jun 1 11:51:15 2001 +0000

    fixed compiler warnings in tools
    compile (but do not install) tools

commit 9a79747e472c18cb0c7dba7ef50ba1746cec16ef
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 31 16:59:32 2001 +0000

    more excessive use of long long

commit 04a75cf2ae602e52ab4666dd8fa1d89ef525b06c
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 31 16:44:45 2001 +0000

    does this fix the overflow problem ?

commit 8d83f9e66363cd51f502fe0b3059b93ce134be64
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 31 15:54:46 2001 +0000

    alalalalong

commit 5f0e1f15ea8950f81fc142d0f785525d11278d4d
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 31 15:24:23 2001 +0000

    use gettimeofday() instead of clock()
    small changes to the results page to make it fit on smaller screens

commit 4422570a2025c63b4bbc061448f2cb6b53ff5ee2
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 31 09:39:47 2001 +0000

    added support for loading fonts w/o antialiasing (DFFA_MONOCHROME)
    added span_a1_to_a8 and span_a1_to_argb functions

commit fd7503c6d14bc24e47de021140ee939b4141fbbf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 31 06:32:35 2001 +0000

    - rotation about y axis
    - perspective drawing

commit 7bce8ac6d665ebed72984ca7754e50ddb38ca2f0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 29 15:10:01 2001 +0000

    turn off console blanking
    do (w&1) instead of w -= 2 in loop

commit f937f20d87261913167b0fb0afd701992255f9a4
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 29 14:20:34 2001 +0000

    Allow to specify font attributes (DFFA_NOKERNING, DFFA_NOHINTING) when
    calling FontCreate() to control how fonts are loaded and layouted.
    
    Added new function IDirectFBSurface->GetFont().

commit 03afe0a7d29191940ebf5659e5f9e5d5d0259669
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 29 13:00:57 2001 +0000

    check elapsed time more often when running stretch-blit benchmark

commit acb264f87a672238209e864bef8f0cabdc0891f6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 29 12:30:58 2001 +0000

    same optimizations for Sop_rgb15_to_Dacc

commit bd98ebd0a0da2467c093fda5a2dca9eefd3e3b56
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 29 12:18:22 2001 +0000

    Sop_rgb16_to_Dacc does aligned 32bit reads now!
    Performance of FillRectangle(blend) went from 1.73 to 3.09 without MMX!
    
    Andi: Please test it on PowerPC!

commit f04a9af73a8f3e8792515f669826b16c3bed6119
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 29 11:35:46 2001 +0000

    print banner in DirectFBCreate instead of DirectFBInit

commit bd3be591e3b407286bbe93e21f9838c10b801f4a
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 29 11:32:37 2001 +0000

    renamed --blit-stretched option to --stretch-blit
    print usage information if wrong command-line options are given

commit 93b2dd6170e83606d1e8306aa2335c96b16cec45
Author: Sven Neumann <neo@directfb.org>
Date:   Mon May 28 23:07:44 2001 +0000

    allow to specify benchmarks on the command-line,
    no argument means all benchmarks

commit 5dbab7dbbe7d79c6524c7404e0de73c64ece870e
Author: Sven Neumann <neo@directfb.org>
Date:   Mon May 28 21:06:58 2001 +0000

    Restructured code to make it easier to add new benchmarks or other
    features. The functionality shouldn't have changed, but code size went
    down by more than 100 lines.

commit c298a55ba8fe949e4ad3bb1fa6ccea51df567950
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 28 19:21:06 2001 +0000

    interface modules are now installed into subdirectories depending on the type,
    e.g. /usr/local/lib/directfb/interfaces/IDirectFBFont/libidirectfbfont_ft2.so

commit 4031b5f69d989064986e7f2d3c60e5ed305b290a
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 28 19:15:59 2001 +0000

    fixes for C versions of Sacc_add_to_Dacc_C() and Cacc_add_to_Dacc_C(), this
    fixes the "falling corpse"-bug in ClanBomber on non-mmx machines.

commit d4327b4b47d37b73996e56d8cdbf5405748f7638
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 28 18:04:32 2001 +0000

    yet another started thing ;-)
    
    will be a 3d space shooter

commit 701d2fe7a954b16a59c2f4dde1290bc301d507b4
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 28 16:53:49 2001 +0000

    VT_ACTIVATE and VT_WAITACTIVE system calls are repeated if interrupted.

commit 4190f438d5d04c8ea01eb9e12b31283f47773dc6
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 28 15:35:17 2001 +0000

    added -lm for pss (compiles on ppc again)

commit 5e31bea8c91ced612bb9eb5bf358abf85feff5aa
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 27 21:47:44 2001 +0000

    fixed bug in gAcquire: src colorkey was not set when using src colorkeying
    and at least one of DSBLIT_BLEND_ALPHACHANNEL, DSBLIT_BLEND_COLORALPHA and
    DSBLIT_COLORIZE.
    
    Andi: Does this fix falling corpse parts on PowerPC?

commit 7e8aed2399c9747257bb6e342ce0d41ed730240a
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 27 21:31:15 2001 +0000

    check for source != NULL in Blit and StretchBlit

commit 56527f1a2d54f8cbb1636b3ba086853ce41b00d2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 27 20:05:50 2001 +0000

    Added "idirectfbvideoprovider_libmpeg3.c" to EXTRA_DIST

commit 89d43a0948268f354bad5b17346d5513cba23f02
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 27 06:23:52 2001 +0000

    Added a parsing feature: The description of interface functions
    is now split up into two parts devided by the first blank line.
    The first part is the headline and is printed in the interface overview
    and in the page of the funtion itself. The detailed information about
    the parameters and possible error values is only in the functions page.
    
    We can now write very long and good descriptions for the functions without
    bloating the index pages.

commit 1f4cac510b74881e9e36356591209db8e6e95ab5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat May 26 15:48:59 2001 +0000

    added IDirectFB->WaitForSync, blocks until next vertical retrace

commit b5beada3a15f788d2a35109fd6d2790f65232554
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 25 19:24:11 2001 +0000

    new demo, very early stage

commit 540bb81e888f95133cf2f1ea3aa34f2d4f26f578
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 23 19:42:39 2001 +0000

    grammatical clarification

commit f2a800567d49d7d9469eeede0d775a71bf202cf6
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 23 19:04:25 2001 +0000

    updated NEWS

commit 270f25da60aca52daf38e3f4f1361f4490720f52
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 23 18:53:39 2001 +0000

    updated ChangeLog and NEWS

commit aed93d68b743ba8ccda1c1b5a49481c462b75055
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 23 15:17:34 2001 +0000

    got it wrong last time, hopefully works now

commit accdbbc104a99d79d5088d2071e8526009446c2e
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 23 14:51:56 2001 +0000

    Loop MPEG so it behaves like the AVI provider.
    Timing is still badly broken if you use Stop() or SeekTo().

commit e47cc9116ea396d0e35865da74143fa4f777d32d
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 23 14:13:24 2001 +0000

    tried to fix image loading in 24bpp (can't test)

commit 33eea06ef2dd618607a160ca0e02932774221898
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 23 11:09:26 2001 +0000

    support von 15bpp in jpeg provider

commit 5385a67dbcfd890bc45871d8a4f8a89d71d4b89d
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 23 00:49:33 2001 +0000

    removed a spurious comment

commit 905019ca6fb70ea509be36ce118f3ce3bd4d085c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 22 23:46:48 2001 +0000

    tweaked Cop_to_Dop_24
    72.78 -> 73.30

commit 9bafdeb91e6543b93b9756738f00ef14c4a992bc
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 22 23:02:48 2001 +0000

    added --on-crack command-line option to df_neo

commit 7fd9888ff76fd486393e9910c3e5db3bc87f1828
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 22 22:55:18 2001 +0000

    Removed #ifdef, no unroll anymore, fastest result ever seen!
    121 MPixel/sec (Celeron 533), routine before had 119 MPixel.

commit fbcdef93562b509ca5075d4571b3517f9783501f
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 22 21:50:17 2001 +0000

    the rest of my optimizations that were not committed before

commit 231379d68d22ce813e4efcf8816ccb68f3eb9a01
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue May 22 21:39:11 2001 +0000

    added fefes code for non-i386 platforms, great improvement on my powerbook,
    use old code on i386

commit ed22e331466827f36958c186b9c2550b8e9600c5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 22 19:53:43 2001 +0000

    Fixed bug found by Falk Berger, in function keyboard_handle_code:
    event.flags should not set DIEF_KEYCODE only, but also DIEF_MODIFIER.

commit b366c59b0316264a4fb2efdb5e72f02dd5b87223
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue May 22 19:36:51 2001 +0000

    commited svens new SET_ALPHA_PIXEL_RGB16 and _RGB15 macros, performance
    improvements in DrawString() on i386 and powerpc

commit f59ac169b6f946011e17b7cd7b2fca7bf034f9c1
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 22 16:19:21 2001 +0000

    forgot to remove some lines we don't need here

commit 6fca116f2a080f0696979a54ae66e4afcbabcfb9
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 22 16:16:27 2001 +0000

    allow for automake 1.4-p1 and similar version numbers

commit 92bb00eb4892601c13d9611093c79dcf896f76ec
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 22 05:33:47 2001 +0000

    Added IDirectFB->WaitIdle() that waits for the graphics card being idle.
    
    df_dok calls WaitIdle before and after each benchmark.
    Now we see the real performance of the Savage3D.
    Besides that e.g. the blitting benchmark takes 9 seconds
    instead of 3 seconds defined in df_dok.c because it takes
    the hardware 6 additional seconds to complete all the buffered
    instructions. In this time (6 seconds!) the application can
    use the CPU for other things ;-)

commit 6f4b164cdbe396065efb9f004e70f58fadd95043
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 22 03:43:06 2001 +0000

    Do gfxcard_sync() in gfxcard_deinit(),
    fixes X crashes with Savage being busy during switch back to X.

commit b3a6619092821449185007dcd963c96e03d9a3bc
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 22 00:23:27 2001 +0000

    do pthread_testcancel() in input threads,
    print die message only if errno != EINTR

commit 72fd126ef45188c00ab11fcf9d3d1f3956ec20f5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 21 23:49:03 2001 +0000

    follow API change

commit a8c494f3eb068522f071473284c4df151d29dfd5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 21 23:48:34 2001 +0000

    missed one default label in pixelformat switch

commit 989a1a8fe75aa62c814ff95e49147421da683ac7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 21 23:43:42 2001 +0000

    added "-f" to rm ;)

commit d4b397ad1aae6f272dfc98f04ca365c61a9d80bb
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 21 23:21:04 2001 +0000

    FIXME hunting:
    - Added error code DFB_MISSINGFONT, returned by DrawString.
    - DFBGetInterface checks filename length before checking the extension
    - Wrote more details for FIXME about primary surface recreation.
    - fbdev_get_pixelformat now checks all channel's length and offset
    - gfxcard_check_state now rechecks if src/dst blend function changed
    - do at least clip_triangle_precheck for hardware without clipping support
    - if surface_reformat fails, restore values and already reformatted buffers
    - replaced hardcoded "7" with blitting flags in "Dacc_modulation[7] = ..."
    
    Other fixes:
    - bug messages in all drivers when an unexpected pixelformat is found
    - made avifile provider compile again with version from download/contrib
    - follow surface description API change in avifile and swf provider
    - some type fixes (unsigned int was used instead of the actual type)
    - fixed bug in gAcquire that caused DSBLIT_BLEND_COLORALPHA to be ignored
      when the source pixelformat is DSPF_A8 and DSBLIT_BLEND_ALPHACHANNEL and/or
      DSBLIT_COLORIZE has been set

commit 0d43da766fc13d91b775e081351aee32df9a3ec5
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 21 20:12:56 2001 +0000

    - API Change:
      removed bpp field from surface description, removed DSCAPS_ALPHA,
      added pixelformat field instead.
    - removed window stack repaint when new window is created (makes no sense
      since opacity for new windows is 0)
    - added support for 15bpp in v4l provider
    - v4l provider support for devfs (/dev/v4l/video*)

commit 741a59cc397a16208ef348b49e9308b218f83ac2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Mon May 21 17:51:12 2001 +0000

    You can use "Ctrl+Alt+Backspace" to exit DirectFB by killing it with SIGINT.

commit 90eaeccbf3cefdb6a73381896a8f5074384c4788
Author: Sven Neumann <neo@directfb.org>
Date:   Sun May 20 21:45:36 2001 +0000

    After my latest optimizations, line drawing was wrong under some
    circumstances. Fixed it without hurting the performance.

commit 4a5cc1185d3b0830b2a74f9c2b7a0272c15f8dbe
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun May 20 20:12:20 2001 +0000

    in CreateFont: allow desc == NULL if filename == NULL for default

commit 7fe335847be532da8602586c5272d930fb78bc31
Author: Sven Neumann <neo@directfb.org>
Date:   Sat May 19 20:46:11 2001 +0000

    bumped version number to 0.9.2 and updated README

commit 111592354e20ebf447ad1e59cd2c761309d259e1
Author: Sven Neumann <neo@directfb.org>
Date:   Sat May 19 19:30:48 2001 +0000

    updated NEWS

commit e4f71edfbec933709fa7137fd5a7400396aa26a8
Author: Sven Neumann <neo@directfb.org>
Date:   Sat May 19 18:44:10 2001 +0000

    Changed GetStringWidth() and DrawString() methods so they take an
    additional parameter "bytes" that specifies the number of bytes to
    interpret from the passed string. Pass -1 if you intend to use the
    complete NULL-terminated string.
    
    This has several advantages: Line-breaking algorithms can be implemented
    without copying the string and not NULL-terminated character arrays can
    be drawn. Unfortunately this changes the API once again.

commit 199ab2f1b508480987631e1df8ea8503345ad99e
Author: Sven Neumann <neo@directfb.org>
Date:   Sat May 19 17:46:51 2001 +0000

    - readded src/media/Makefile.am (forgot this one on my last commit)
    - added interfaces/idirectfbfont_default.c (this used to be the default font
    implementation in the core)
    - removed default font code from the core
    - changed interface loader so you get the default font if you call
    CreateFont() with a NULL filename

commit 985849b7fde6e3805244ff4573ba0f2acc545a38
Author: Sven Neumann <neo@directfb.org>
Date:   Sat May 19 17:24:18 2001 +0000

    - readded src/media directory to provide default font methods
    - changed IDirectFBSurface struct to take a pointer to an IDirectFBFont
    - made IDirectFBSurface call AddRef and Release on the font it owns
    - made DrawString method use GetStringWidth method as provided by IDirectFBFont
    - ditched default font completely; will add it back as a font interface

commit 68559c2f73382877a3779264002ef92bc0b1dc1b
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri May 18 16:44:52 2001 +0000

    renamed _noMMX functions to _C

commit 4f0f373ca78fa5cbd918ba1ba3015d282a6a0849
Author: Andreas Hundt <andi@directfb.org>
Date:   Fri May 18 16:19:57 2001 +0000

    replaced SET_ALPHA_PIXEL_RGB32 with fefe's code. DrawString() performance in
    32bit is more than twice as high than before (i386). no performance
    improvement on powerpc, dont know why. other platforms not tested yet.

commit 3e10d5d8e1e6a6827edf3f9f9f742d41c9146da6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 18 15:33:14 2001 +0000

    Fixed SeekTo (seconds*rate, not seconds/rate).
    Implemented GetLength and GetPos.

commit f179998b473213c6106dbac1c27afe70cc6bd940
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri May 18 14:43:42 2001 +0000

    #include <libmpeg3.h> instead of "libmpeg3.h"

commit b61d9adfa1efe332704834be3c12ec0274c05fdc
Author: Andreas Hundt <andi@directfb.org>
Date:   Thu May 17 14:11:09 2001 +0000

    Cop_to_Dop_16() uses 32-bit writes to the framebuffer. Makes no difference
    on i386, but ~30% performace increase on ppc.

commit 12a6c921c1b9ef46df253556e8c0e987cfe11df6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 16 20:01:34 2001 +0000

    Added libmpeg3 videoprovider, thanks to Kim JeongHoe for the source.
    
    To compile with libmpeg3 video provider use:
    
    ./configure --with-libmpeg3=<path>

commit 347e59ea55e9507c27e1e46d2722ced1fffaefbb
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 22:44:38 2001 +0000

    removed gprint

commit 74a75adc8a4bf3aa7f6baa2ad79b418a8b4d0d1a
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue May 15 20:01:54 2001 +0000

    allow use of kerning on non-i386 machines, seems to work on my powerpc again.

commit 3329ce2a9eec81c96a640c463f97d578d7052b10
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 20:01:15 2001 +0000

    forgot to remove src/media from here

commit 4cc89b66d5b21264e8fee753900c96a88c91ad75
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 18:41:09 2001 +0000

    Removed media/idirectfbfont.[ch] and implemented it all in the interface.
    Call FT_Done_Face() on freetype face object on font destruction.

commit f0b4f285c2e0de4814a2d431e9ef48eb1d596ccd
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 15 17:17:28 2001 +0000

    simple precheck clips text examining y(+height), clip y1/y2

commit d510eb73be00383f1f095b222932e30f91b9fee9
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue May 15 16:53:24 2001 +0000

    set state->source to NULL before returning

commit 5f9f414ca7294682f1e880915c36db0d17a15c6c
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 15:42:52 2001 +0000

    avoid endless looping on invalid UTF8 strings

commit 1fa5506e51fe25b67058867c9cf8aba0e66d10a8
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 14:48:57 2001 +0000

    fixed braino in GetStringWidth() func

commit 7e81ee96ee50bae6920267b84b0c7395278a47c9
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 14:46:11 2001 +0000

    indentation

commit f2609006c7f18e627c0fd1b2e61d754a9d2a18f2
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 14:45:37 2001 +0000

    - do not try to free NULL pointer in tree.c
    - some minor cleanups

commit e4020a17583020a033fe2276bc907c20e807430a
Author: Andreas Hundt <andi@directfb.org>
Date:   Tue May 15 14:32:38 2001 +0000

    - replaced ceil() calls in idirectfbsurface.c with ICEIL(), compiles on arm and ppc again. (without libm)
    
    - removed resolved BUGS from BUGS

commit 42a9e5a43823be6b1932498e6963e9de9ddece6d
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 13:42:57 2001 +0000

    added sanity checks so we never draw outside the surface boundaries
    corrected handling of face metrics

commit ade1d51bfebb4ae96ca0e157fb393c48feb0831b
Author: Sven Neumann <neo@directfb.org>
Date:   Tue May 15 01:48:19 2001 +0000

    Rewrote a good part of the font code:
    
    - surface->DrawString() now takes UTF-8 strings.
    - Fonts do not need to be loaded completely any longer. The core keeps
    an array of surfaces that grows when new glyphs are loaded. Information
    about the glyphs is kept in a balanced binary tree using the Unicode
    index of the glyph as the key.
    - Kerning tables are not any longer in the core font struct. We now use
    a callback from the core to the font provider and it can choose not to
    implement it all.
    
    Things left to do:
    - Add some checks so we don't crash on very large fonts.
    - Let the font provider specify the surface format and blitting flags.
    - Hook into font destruction and release the FT2 face.
    - Add DrawGlyph method to surface so we can use it from the GDK backend
    or from a Pango module.

commit cf993312956e3cb38876fc9e8bd4c6f5e15c9c61
Author: Sven Neumann <neo@directfb.org>
Date:   Mon May 14 21:28:06 2001 +0000

    don't use -fomit-frame-pointer if compiling with --enable-debug

commit e78561da12998e8dfb8ebb5fb6a73bd5a78aaceb
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 14 20:02:30 2001 +0000

    - implemented ceil and floor functions IFLOOR() and ICEIL(), to get rid of
      libm
    - added -lm to Makefiles of examples that need libm.

commit 72f9dea4cdcbc8a45f4df6d33e641ef94899ad82
Author: Sven Neumann <neo@directfb.org>
Date:   Fri May 11 19:07:21 2001 +0000

    optimized gDrawLine() further  -->  5% speedup

commit 5690c78b62584db8e5e169c176107f74542139fb
Author: Sven Neumann <neo@directfb.org>
Date:   Fri May 11 18:46:12 2001 +0000

    some optimizations on Drawline() --> about 10% faster

commit 48553034e11ff8d21e948b89581ac9776ac6c85d
Author: Sven Neumann <neo@directfb.org>
Date:   Fri May 11 13:14:47 2001 +0000

    removed leftover declaration of IDirectFBFont_Construct_TTF()

commit 56bdcf0ed3ae2199c152e5a7f647d50fa5382236
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 10 12:37:47 2001 +0000

    Changed help string so it mentions that these are DirectFB options and
    not app-specific. We need to change command-line parsing somehow since
    it can not be that DirectFBInit() exits the app if --help is found
    without giving the application a chance to output its help.

commit 86c72e08714975735bb4b9dd80b5126cbe25415e
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 9 18:26:40 2001 +0000

    applied patch from <js@convergence.de>
    
    - videos with few IFrames no longer rewind if using fast forward in dfbsee

commit f8c620570556a626f7de453b6515b72d8d5206fd
Author: Andreas Hundt <andi@directfb.org>
Date:   Wed May 9 17:05:53 2001 +0000

    vt.c opens /dev/tty0 or /dev/vc/0 (for devfs) instead of /dev/console,
    this makes DirectFB work on machines with serial console.

commit c41ce73ef352139667ce693af43ca463e42dce1e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed May 9 15:41:18 2001 +0000

    Print error message if DirectFBInit has been forgotten.

commit 85ba552609a60d5eb40fafb2e6716896bcc96496
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 7 20:07:24 2001 +0000

    fixed warnings that occured when compiling with gcc-3.0
    ("deprecated use of label at end of compound statement"
    and "undefined reference to memset")

commit 7e84ffe7a9f7d48ff2ea578233a4e4cb0789ebfe
Author: Andreas Hundt <andi@directfb.org>
Date:   Mon May 7 17:57:41 2001 +0000

    applied patch from Johannes Stezenbach <js@convergence.de> which
    adds the following functions.
    
    - IDirectFBVideoProvider::GetPos():    get current position in the stream
    - IDirectFBVideoProvider::GetLength(): get length in seconds
    
    the functions are currently implemented in the avifile provider only,
    v4l and swf providers return DFB_UNIMPLEMENTED.

commit fde334dfe437bc7ad0778f8c822794d5c5e2813e
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 3 21:47:33 2001 +0000

    Made 0.9.1 release

commit 92fb43b260bdd0f93490bb6f8255491758c49962
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 3 19:17:06 2001 +0000

    Changed clip_triangle_precheck() so it drops triangles that need to
    be clipped. This is a temporary workaround for the lack of proper
    clipping code and keeps us from trying to draw beyond the surface
    borders.
    
    Corrected scaling factor in df_knuckles.

commit 64a778d308c0d474d96bae7ba1e7687b7f5cfcea
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 3 18:39:33 2001 +0000

    allow to toggle BackfaceCulling using 'B' on your keyboard
    default to BackfaceCulling = False

commit 90ae5296c73fc90945a37b7a9a8db159143aa866
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 3 18:15:20 2001 +0000

    added a second light source, nightblue and static

commit 241f756c076c3202f69bd352333892540428b242
Author: Michael Natterer <mitch@directfb.org>
Date:   Thu May 3 17:23:12 2001 +0000

    Regenerated ChangeLog with a nicer script.

commit 5a7d4c1f561d8ba4cfebdac287a2aad5111dfdf0
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 3 17:04:11 2001 +0000

    removed empty NOTES file

commit 5c4a8ac23b751f5ea68a9b93cd7e983295ae3234
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 3 15:10:06 2001 +0000

    cleared NOTES, outdated

commit 0ef489c1da1f0a4a601501befebcf4fa8b831322
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 3 13:07:47 2001 +0000

    Added Sven's pkg-config additions to NEWS.

commit d554f27fc6089fc0a1ca813c0e2134618015de2c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 3 12:50:31 2001 +0000

    Generated ChangeLog.
    Wrote NEWS.
    Made DFBInputEvent.key_unicode an __u32.

commit 6fac0eb32e54aadc6f102bc934b1536537029c6e
Author: Sven Neumann <neo@directfb.org>
Date:   Thu May 3 11:57:22 2001 +0000

    added pkg-config files for the interfaces that get optionally installed
    so apps can test for their existence

commit 2f738040b395392953a73fb594d4e703a1cc7cf6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 3 11:46:11 2001 +0000

    Added my framebuffer driver for all NeoMagic PCI/AGP chips.

commit 111f4e7604b3a16cbba052cb4236021126b9eae7
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu May 3 11:27:03 2001 +0000

    Added IDirectFBInputDevice->GetButtonState() which returns the
    state of the specified button.
    Added DFBInputDeviceButtonState.

commit d99d7460d2c5fc0c09680b0a43115db73c87e886
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 2 11:17:32 2001 +0000

    allow to switch between FLAT_SHADED and WIRE_FRAME using Space

commit f97a8eeeb84247bbb93570695992c7b6349e915b
Author: Sven Neumann <neo@directfb.org>
Date:   Wed May 2 10:53:51 2001 +0000

    Introduced clip_triangle_precheck() that tests if a triangle needs to
    be drawn at all.
    
    Beautified line drawing examples in df_dok.

commit c7ae9484e54094ff1f65b2a3f100512f15d4b2a0
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 29 08:48:36 2001 +0000

    Implemented triangle filling in Matrox driver.
    Renamed utility macro SGN to SIGN.

commit 39c658fa5349f6b8abd427846b7d86a82d5f5df5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 29 06:02:48 2001 +0000

    yeah, rotating light!

commit 5ad7c7d04d4327a2e62a378ce0878b21120b5338
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 29 05:41:38 2001 +0000

    golden skull ;)

commit 03fe13cdbcecec872e32b9e5cd91fdbf8fcf4dea
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 29 05:14:58 2001 +0000

    Added new cool demo called df_knuckles, it's a port from Mark Vojkovich's
    skull demo for DGA and a good demonstration of triangles.
    
    Fixed CheckState in Matrox driver, it does not support all functions any more.
    Added rounding to fixed point triangle setup.

commit 308945bb1963fb246afca5a0ba988f02823598b1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 29 03:37:46 2001 +0000

    implemented triangle filling in generic driver
    moved utility function sort_triangle from tdfx driver to gfx/util.h
    added triangles to df_dok

commit d12a1c2b800ddbaf7ac276a003d2ba2e79abcf44
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sun Apr 29 01:13:09 2001 +0000

    compile with "-g3" if "--enable-debug" is passed to configure

commit 2579d65400a613fb2427ff501f3bf2104247609d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 27 14:43:53 2001 +0000

    fixed accelerator ids

commit f740f41821ff65005d28d6beb4fe9679d5f03c13
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Apr 26 23:36:52 2001 +0000

    Moved command-line parsing out of DirectFBCreate() into DirectFBInit().
    This means to inititalize DirectFB() there are now two calls necessary:
    
      DirectFBInit( &argc, &argv );
      DirectFBCreate( &dfb );
    
    This makes is possible to do further checks on the command-line before
    switching to graphics mode on DirectFBCreate.

commit fa3249dc57c0f62584039241186f1b439d6a4d1b
Author: Michael Natterer <mitch@directfb.org>
Date:   Thu Apr 26 22:47:50 2001 +0000

    - If we need argv[1] as video source, check for it instead of simply
      crashing if it's not there.
    - Release the video provider so DMA from the tuner hardware doesn't
      trash framebuffer memory after the demo finished.

commit 893ee69e897a34752f89522555ef62edf958a7ee
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 26 21:05:26 2001 +0000

    FillRectangle! But only on Voodoo, yet.
    Accepts drawing flag DSDRAW_BLEND.

commit 7a42d0f386fcb4dcf7a94338a29c6b58cf675c41
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Apr 26 20:30:56 2001 +0000

    forgot to remove the free's here

commit 02f48e08c3890aba1d6a8d37022fbe18c7035b72
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 26 11:44:08 2001 +0000

    free interfaces if reference counter reaches zero,
    disabled in debug mode to enable the feature of DFB_DEAD

commit e478aa82f9489e94c1f63f6601b37d337f16c056
Author: Michael Natterer <mitch@directfb.org>
Date:   Thu Apr 26 00:11:18 2001 +0000

    Fixed the check if avifile-config was found.

commit 7b5b31e0a6884e22eb35136d3524b6fcf302ece1
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 25 21:10:23 2001 +0000

    removed unused files

commit b2a15826add6eaeb04aec49aa3bc8856174fb4c7
Author: holger <holger>
Date:   Wed Apr 25 20:33:59 2001 +0000

    free interfaces if constuctor failed

commit 0c9ee2a440c5383308bdf1eb3a7cea0f2f987918
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 25 18:01:29 2001 +0000

    fixed caps passed to IDirectFBSurface_Layer_Construct

commit 473b007802afce63c0843004324e09d7a8df0855
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 24 13:34:54 2001 +0000

    Reset card state in suspend, some glitches still there.
    Generated changelog.

commit 305a9fee889f178bfec52bcca5727bb6ab4f05eb
Author: Sven Neumann <neo@directfb.org>
Date:   Tue Apr 24 13:14:20 2001 +0000

    Added Shockwave Flash videoprovider hacked by Roh.
    
    Uses libflash which can be found repackaged at
    http://www.directfb.org/download/. There is no acceleration yet, we just
    tell libflash to draw into a DirectFB surface. Sound and interaction are
    also disabled.
    
    Try to build avifile videoprovider by default. Can be disabled by passing
    --disable-avifile to configure.

commit af3abf37fe1212aa72ae3ce39b00d882a7cf69cb
Author: Sven Neumann <neo@directfb.org>
Date:   Mon Apr 23 17:04:36 2001 +0000

    Bumped version number to 0.9.1
    
    Added an avifile option to directfb-config that makes --libs output the
    suitable LDFLAGS so the avifile provider can be used with the linked
    application. Will need to figure out how to do this right in directfb.pc.

commit 16d699ca8a93a3fa62f98578bda4ff263c2551ed
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 20 19:15:54 2001 +0000

    Fixed the segfault that happens at exit in all applications using an
    IDirectFBDisplayLayer.
    
    more signed/unsigned cleanups, we need to check all code for that

commit 7c3725fa009725979049fe6a9dd08c8f1ea2eaa8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 20 18:52:18 2001 +0000

    signed/unsigned int cleanup

commit 70d33987eb1c84b799d19517a0d28a76caf21622
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 20 14:38:11 2001 +0000

    removed bogus test lines from driver

commit 3b37fd329bc2750daaf3397de00651aefafb94f0
Author: Sven Neumann <neo@directfb.org>
Date:   Thu Apr 19 20:57:54 2001 +0000

    do not enable the cursor by default
    explicitely enabled the cursor in df_fire

commit 963b4628d5030515b115ae8177adda2a2c311745
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Sat Apr 14 22:14:36 2001 +0000

    also support .asf

commit 0cae91379f36096825e8898c0ba4bd343178a4bf
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Fri Apr 13 07:07:52 2001 +0000

    Stop works now, actually doing a Pause (Stop crashes avifile).
    PlayTo no more stops the video before destination setup and
    checks if the video should be UnPaused, Started or left Playing.
    
    Works really fine to call PlayTo several times with different destinations.
    (Different surfaces on the fly not tested yet. Todo: Mutex PlayTo/DrawCallback)

commit 5e37db8d246b7fce6248c8c7396c33c230276a23
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 12 21:06:14 2001 +0000

    V4L Videoprovider Probe now checks if the filename bgeins with "/dev/video",
    so you have to pass e.g. "/dev/video0" to the provider and not NULL.
    Removed video4linux from core.
    V4L Provider still needs these:
    1. Clean up code.
    2. Add grabbing support.
    3. Do proper surface listening (resize, destroy, ...).

commit 6ec4cbc0d37fc983148806b9cb82595286a7406b
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 12 20:59:43 2001 +0000

    compiles with newest avifile version now

commit 3cb8e1410dba23f0024ed0babbfe33b122cd034e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Thu Apr 12 15:48:29 2001 +0000

    oops, directfb.h said "SetColor(a,r,g,b)", it is "r, g, b, a"

commit c85266af87b82531cd926758a3535071e8798d48
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 11 01:47:47 2001 +0000

    -removed composed blitting flags (DECAL,MODULATE,...)
    -precheck if destination format is supported in jpeg provider,
    image loading needs to be cleaned up badly (src/misc/gfx_util.c, too).

commit 030db92769e5951ceb91303acd379e5ea1e5d8e6
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Wed Apr 11 00:44:41 2001 +0000

    implemented flipping of general purpose surfaces (no layer, no window)
    a) that are subsurfaces
    b) with specified flip region
    c) with DSFLIP_BLIT flag

commit e0ebe46725106cf5d3567b1a6eb1ac4154d64ee5
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 23:48:23 2001 +0000

    fixed parsing of struct members and interface call parameters
    that have a type with spaces, e.g. "unsigned int".
    
    improved linking within types.html for struct members, e.g. flags

commit 75c058b2fd90d1f1b259bb6961132bb08ebda3b2
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 22:44:45 2001 +0000

    added missing "void *callbackdata" to callbacks:
    DFBInputDeviceCallback and DFBVideoModeCallback

commit f7c86c9e818558f38c961f88a22c41e3cc137e76
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 16:32:27 2001 +0000

    removed clipping from software drivers blitting functions, gfxcard.c does this
    removed debugging sleep from df_window

commit f24ad236aeb6ffb2603462862673d9f970a3c29e
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 14:04:29 2001 +0000

    added note about where to place this file

commit baf3d673f196c25239207117145a9e3ad442f9ad
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 13:27:36 2001 +0000

    added 768x576 mode (PAL), but at 75Hz

commit 779997a21584eeb8dc86ead1d8017fa68367868c
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 13:00:53 2001 +0000

    added #warning to help people compile the avifile provider
    with a newer version of avifile

commit 1a7f5c48ca04e6b581062f626c72315f8fdda9c8
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 12:58:00 2001 +0000

    standard files

commit 7f0e73d61230440c312aa80e686daf542911a18d
Author: Denis Oliver Kropp <dok@directfb.org>
Date:   Tue Apr 10 12:57:11 2001 +0000

    added missing files that got sorted out by .cvsignore

commit 3c0c679d473211afbe859ae84def8f1525fea1f2
Author: Sven Neumann <neo@directfb.org>
Date:   Fri Apr 6 20:34:30 2001 +0000

    Documented the release version number in the ChangeLog.

commit 25ff4234b1b752098ccc6b2eefe7fc1a6e21b686
Author: Michael Natterer <mitch@directfb.org>
Date:   Fri Apr 6 20:18:29 2001 +0000

    Initial revision
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/compile�����������������������������������������������������������������������������0000755�0001750�0001750�00000007173�10753066007�011530� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.

scriptversion=2005-05-14.22

# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.

case $1 in
  '')
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
     exit 1;
     ;;
  -h | --h*)
    cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]

Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.

If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.

Report bugs to <bug-automake@gnu.org>.
EOF
    exit $?
    ;;
  -v | --v*)
    echo "compile $scriptversion"
    exit $?
    ;;
esac

ofile=
cfile=
eat=

for arg
do
  if test -n "$eat"; then
    eat=
  else
    case $1 in
      -o)
	# configure might choose to run compile as `compile cc -o foo foo.c'.
	# So we strip `-o arg' only if arg is an object.
	eat=1
	case $2 in
	  *.o | *.obj)
	    ofile=$2
	    ;;
	  *)
	    set x "$@" -o "$2"
	    shift
	    ;;
	esac
	;;
      *.c)
	cfile=$1
	set x "$@" "$1"
	shift
	;;
      *)
	set x "$@" "$1"
	shift
	;;
    esac
  fi
  shift
done

if test -z "$ofile" || test -z "$cfile"; then
  # If no `-o' option was seen then we might have been invoked from a
  # pattern rule where we don't need one.  That is ok -- this is a
  # normal compilation that the losing compiler can handle.  If no
  # `.c' file was seen then we are probably linking.  That is also
  # ok.
  exec "$@"
fi

# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`

# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file.  Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
  if mkdir "$lockdir" >/dev/null 2>&1; then
    break
  fi
  sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15

# Run the compile.
"$@"
ret=$?

if test -f "$cofile"; then
  mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
  mv "${cofile}bj" "$ofile"
fi

rmdir "$lockdir"
exit $ret

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/directfb.spec.in��������������������������������������������������������������������0000644�0001750�0001750�00000006345�11164361026�013211� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������%define name directfb
%define version @VERSION@
%define oname DirectFB
%define libname lib%name

Summary:	Hardware graphics acceleration library
Name:		%name
Version:	%version
Release:	1
License:	LGPL
Group:		System/Libraries
Source0:        http://www.directfb.org/download/%{name}/%{oname}-%{version}.tar.gz
URL:		http://www.directfb.org/
BuildRequires:	libpng-devel >= 1.2.0
BuildRequires:	zlib-devel >= 1.1.3
BuildRequires:	libjpeg-devel >= 6b
BuildRequires:	freetype2-devel >= 2.0.2
BuildRoot:	%{_tmppath}/%{name}-%{version}

%description
%oname - A hardware-accelerated graphics library on top of the Linux frame buffer device.

%package -n %libname
Summary:        Shared library part of %oname
Group:		System/Libraries

%description -n %libname
%oname - A hardware-accelerated graphics library on top of the Linux frame buffer device.

%oname is a thin library that provides developers with hardware graphics
acceleration, input device handling and abstraction, an integrated windowing
system with support for translucent windows and multiple display layers on top
of the Linux frame buffer device. It is a complete hardware abstraction layer
with software fallbacks for every graphics operation that is not supported by
the underlying hardware.

%package -n %libname-devel
Group:		Development/C
Summary:	Header files for compiling %oname applications
Requires:	%{libname} = %{version}-%release
Provides:	lib%name-devel = %version-%release
Provides:	%oname-devel = %version-%release

%description -n %libname-devel
%oname header files needed for building applications based on %oname. 

%package doc
Summary:	%oname documentation
Group:		Development/Other

%description doc
%oname documentation in html format.

%prep
%setup  -q -n %oname-%version

%build
%configure \
        --enable-fbdev \
	--disable-maintainer-mode \
	--enable-shared \
	--disable-fast-install \
	--disable-debug \
	--program-transform-name=""  # is this hack needed?

%make

%install
rm -rf $RPM_BUILD_ROOT
%makeinstall_std

%clean
rm -rf $RPM_BUILD_ROOT

%post -n %libname -p /sbin/ldconfig
%postun -n %libname -p /sbin/ldconfig

%files -n %libname
%defattr(644,root,root,755)
%doc README* AUTHORS ChangeLog NEWS TODO
%attr(755,root,root) %{_libdir}/lib*.so.*
%{_libdir}/directfb-%version
%{_datadir}/directfb-%version
%{_mandir}/man5/*directfbrc.5*

%files -n %libname-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/*directfb-config
%attr(755,root,root) %{_bindir}/*directfb-csource
%attr(755,root,root) %{_bindir}/*dfbg
%{_includedir}/directfb
%{_includedir}/directfb-internal
%{_mandir}/man1/*directfb-csource.1*
%{_mandir}/man1/*dfbg.1*
%{_libdir}/pkgconfig/*
%{_libdir}/*.la
%{_libdir}/*.so

%files doc
%defattr(644,root,root,755)
%doc docs/html/*

%changelog
* Mon Jan 13 2003 Sven Neumann <neo@directfb.org> 0.9.16
- removed reference to avifile
- added rules for dfbg and its man-page

%changelog
* Sun Oct 27 2002 Sven Neumann <neo@directfb.org> 0.9.14
- added this file as directfb.spec.in to the DirectFB source tree
- moved directfbrc manpage to the main package

* Fri Aug 23 2002 Gtz Waschk <waschk@linux-mandrake.com> 0.9.13-1mdk
- add directfb-csource and man page
- 0.9.13

* Thu Jul 11 2002 Gtz Waschk <waschk@linux-mandrake.com> 0.9.12-1mdk
- initial package based on PLD effort
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/����������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522566�011740� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522566�012551� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/primary.c���������������������������������������������������������������0000644�0001750�0001750�00000043767�11245562152�014331� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>

#include <directfb.h>

#include <fusion/shmalloc.h>
#include <fusion/fusion.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <direct/memcpy.h>
#include <direct/messages.h>

#include <ApplicationServices/ApplicationServices.h>

#include "osx.h"
#include "primary.h"

extern DFBOSX  *dfb_osx;
extern CoreDFB *dfb_osx_core;

/******************************************************************************/

static DFBResult dfb_osx_set_video_mode( CoreDFB *core, CoreLayerRegionConfig *config );
static DFBResult dfb_osx_update_screen( CoreDFB *core, DFBRegion *region );
static DFBResult dfb_osx_set_palette( CorePalette *palette );

static DFBResult update_screen( CoreSurface *surface,
                                int x, int y, int w, int h );

static CGDirectDisplayID screen = NULL;

/******************************************************************************/

static DFBResult
primaryInitScreen( CoreScreen           *screen,
                   GraphicsDevice       *device,
                   void                 *driver_data,
                   void                 *screen_data,
                   DFBScreenDescription *description )
{
     /* Set the screen capabilities. */
     description->caps = DSCCAPS_NONE;

     /* Set the screen name. */
     snprintf( description->name,
               DFB_SCREEN_DESC_NAME_LENGTH, "OSX Primary Screen" );

     return DFB_OK;
}

static DFBResult
primaryGetScreenSize( CoreScreen *screen,
                      void       *driver_data,
                      void       *screen_data,
                      int        *ret_width,
                      int        *ret_height )
{
     D_ASSERT( dfb_osx != NULL );

     if (dfb_osx->primary) {
          *ret_width  = dfb_osx->primary->width;
          *ret_height = dfb_osx->primary->height;
     }
     else {
          if (dfb_config->mode.width)
               *ret_width  = dfb_config->mode.width;
          else
               *ret_width  = 640;

          if (dfb_config->mode.height)
               *ret_height = dfb_config->mode.height;
          else
               *ret_height = 480;
     }

     return DFB_OK;
}

ScreenFuncs osxPrimaryScreenFuncs = {
     .InitScreen    = primaryInitScreen,
     .GetScreenSize = primaryGetScreenSize,
};

/******************************************************************************/

static int
primaryLayerDataSize( void )
{
     return 0;
}

static int
primaryRegionDataSize( void )
{
     return 0;
}

static DFBResult
primaryInitLayer( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  DFBDisplayLayerDescription *description,
                  DFBDisplayLayerConfig      *config,
                  DFBColorAdjustment         *adjustment )
{
     /* set capabilities and type */
     description->caps = DLCAPS_SURFACE;
     description->type = DLTF_GRAPHICS;

     /* set name */
     snprintf( description->name,
               DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "OSX Primary Layer" );

     /* fill out the default configuration */
     config->flags       = DLCONF_WIDTH       | DLCONF_HEIGHT |
                           DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
     config->buffermode  = DLBM_FRONTONLY;

     if (dfb_config->mode.width)
          config->width  = dfb_config->mode.width;
     else
          config->width  = 640;

     if (dfb_config->mode.height)
          config->height = dfb_config->mode.height;
     else
          config->height = 480;

     if (dfb_config->mode.format != DSPF_UNKNOWN)
          config->pixelformat = dfb_config->mode.format;
     else if (dfb_config->mode.depth > 0)
          config->pixelformat = dfb_pixelformat_for_depth( dfb_config->mode.depth );
     else
          config->pixelformat = DSPF_ARGB1555;

     return DFB_OK;
}

static DFBResult
primaryTestRegion( CoreLayer                  *layer,
                   void                       *driver_data,
                   void                       *layer_data,
                   CoreLayerRegionConfig      *config,
                   CoreLayerRegionConfigFlags *failed )
{
     CoreLayerRegionConfigFlags fail = 0;

     switch (config->buffermode) {
          case DLBM_FRONTONLY:
          case DLBM_BACKSYSTEM:
          case DLBM_BACKVIDEO:
               break;

          default:
               fail |= CLRCF_BUFFERMODE;
               break;
     }

     if (config->options)
          fail |= CLRCF_OPTIONS;

     if (failed)
          *failed = fail;

     if (fail)
          return DFB_UNSUPPORTED;

     return DFB_OK;
}

static DFBResult
primaryAddRegion( CoreLayer             *layer,
                  void                  *driver_data,
                  void                  *layer_data,
                  void                  *region_data,
                  CoreLayerRegionConfig *config )
{
     return DFB_OK;
}

static DFBResult
primarySetRegion( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  void                       *region_data,
                  CoreLayerRegionConfig      *config,
                  CoreLayerRegionConfigFlags  updated,
                  CoreSurface                *surface,
                  CorePalette                *palette )
{
     DFBResult ret;

     if (surface)
          dfb_osx->primary = surface;

     ret = dfb_osx_set_video_mode( dfb_osx_core, config );
     if (ret)
          return ret;

     if (palette)
          dfb_osx_set_palette( palette );

     return DFB_OK;
}

static DFBResult
primaryRemoveRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data )
{
     dfb_osx->primary = NULL;

     return DFB_OK;
}

static DFBResult
primaryFlipRegion( CoreLayer           *layer,
                   void                *driver_data,
                   void                *layer_data,
                   void                *region_data,
                   CoreSurface         *surface,
                   DFBSurfaceFlipFlags  flags )
{
     dfb_surface_flip_buffers( surface, false );

     return dfb_osx_update_screen( dfb_osx_core, NULL );
}

static DFBResult
primaryUpdateRegion( CoreLayer           *layer,
                     void                *driver_data,
                     void                *layer_data,
                     void                *region_data,
                     CoreSurface         *surface,
                     const DFBRegion     *update )
{

     if (surface && (surface->caps & DSCAPS_FLIPPING)) {
          if (update) {
               DFBRegion region = *update;

               return dfb_osx_update_screen( dfb_osx_core, ®ion );
          }
          else
               return dfb_osx_update_screen( dfb_osx_core, NULL );
     }

     return DFB_OK;
}

static DFBResult
primaryAllocateSurface( CoreLayer              *layer,
                        void                   *driver_data,
                        void                   *layer_data,
                        void                   *region_data,
                        CoreLayerRegionConfig  *config,
                        CoreSurface           **ret_surface )
{
     DFBSurfaceCapabilities caps = DSCAPS_SYSTEMONLY;

     if (config->buffermode != DLBM_FRONTONLY) {
          caps |= DSCAPS_DOUBLE;
          return dfb_surface_create( NULL, config->width, config->height,
                                config->format, CSP_SYSTEMONLY,
                                caps, NULL, ret_surface );
     }
     else {
          DFBResult ret;
          CoreSurface *surface = NULL;

          surface = dfb_core_create_surface( NULL );
          if (!surface)
               return DFB_FAILURE;

          /* reallocation just needs an allocated buffer structure */
          surface->idle_buffer = surface->back_buffer = surface->front_buffer
                               = SHCALLOC( dfb_core_shmpool(dfb_osx_core), 1, sizeof(SurfaceBuffer) );

          surface->front_buffer->policy = CSP_SYSTEMONLY;
          surface->front_buffer->format = config->format;

          *ret_surface = surface;

          ret = dfb_surface_init( NULL, surface,
                             config->width, config->height,
                             config->format, caps, NULL );

          if (ret)
             return ret;

          /* activate object */
          fusion_object_activate( &surface->object );

          return ret;
     }
}

static DFBResult
primaryReallocateSurface( CoreLayer             *layer,
                          void                  *driver_data,
                          void                  *layer_data,
                          void                  *region_data,
                          CoreLayerRegionConfig *config,
                          CoreSurface           *surface )
{
     DFBResult ret;

     /* FIXME: write surface management functions
               for easier configuration changes */
     switch (config->buffermode) {
          case DLBM_BACKVIDEO:
          case DLBM_BACKSYSTEM:
               surface->caps |= DSCAPS_DOUBLE;

               ret = dfb_surface_reconfig( surface,
                                           CSP_SYSTEMONLY, CSP_SYSTEMONLY );
               break;

          case DLBM_FRONTONLY:
               surface->caps &= ~DSCAPS_DOUBLE;

               ret = dfb_surface_reconfig( surface,
                                           CSP_SYSTEMONLY, CSP_SYSTEMONLY );
               break;

          default:
               D_BUG("unknown buffermode");
               return DFB_BUG;
     }
     if (ret)
          return ret;

     ret = dfb_surface_reformat( NULL, surface, config->width,
                                 config->height, config->format );
     if (ret)
          return ret;


     if (DFB_PIXELFORMAT_IS_INDEXED(config->format) && !surface->palette) {
          DFBResult    ret;
          CorePalette *palette;

          ret = dfb_palette_create( NULL,    /* FIXME */
                                    1 << DFB_COLOR_BITS_PER_PIXEL( config->format ),
                                    &palette );
          if (ret)
               return ret;

          if (config->format == DSPF_LUT8)
               dfb_palette_generate_rgb332_map( palette );

          dfb_surface_set_palette( surface, palette );

          dfb_palette_unref( palette );
     }

     return DFB_OK;
}

DisplayLayerFuncs osxPrimaryLayerFuncs = {
     .LayerDataSize     = primaryLayerDataSize,
     .RegionDataSize    = primaryRegionDataSize,
     .InitLayer         = primaryInitLayer,

     .TestRegion        = primaryTestRegion,
     .AddRegion         = primaryAddRegion,
     .SetRegion         = primarySetRegion,
     .RemoveRegion      = primaryRemoveRegion,
     .FlipRegion        = primaryFlipRegion,
     .UpdateRegion      = primaryUpdateRegion,

     .AllocateSurface   = primaryAllocateSurface,
     .ReallocateSurface = primaryReallocateSurface,
};

/******************************************************************************/

static DFBResult
update_screen( CoreSurface *surface, int x, int y, int w, int h )
{
     int          i;
     void        *dst;
     void        *src;
     int          pitch;
     int          dst_pitch;
     DFBResult    ret;

     D_ASSERT( surface != NULL );
     ret = dfb_surface_soft_lock( dfb_osx_core, surface, DSLF_READ, &src, &pitch, true );
     if (ret) {
          D_ERROR( "DirectFB/OSX: Couldn't lock layer surface: %s\n",
                   DirectFBErrorString( ret ) );
          return ret;
     }

     dst = CGDisplayBaseAddress( screen );
     dst_pitch = CGDisplayBytesPerRow( screen );
     src += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * pitch;
     dst += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * dst_pitch;

     for (i=0; i<h; ++i) {
          direct_memcpy( dst, src, DFB_BYTES_PER_LINE( surface->config.format, w ) );

          src += pitch;
          dst += dst_pitch;
     }

     dfb_surface_unlock( surface, true );

     return DFB_OK;
}

/******************************************************************************/

typedef enum {
     OSX_SET_VIDEO_MODE,
     OSX_UPDATE_SCREEN,
     OSX_SET_PALETTE
} DFBOSXCall;

static DFBResult
dfb_osx_set_video_mode_handler( CoreLayerRegionConfig *config )
{
     boolean_t exactMatch;
     CFDictionaryRef mode;

     fusion_skirmish_prevail( &dfb_osx->lock );

     mode = CGDisplayBestModeForParameters( screen, DFB_BITS_PER_PIXEL(config->format),
                                           config->width, config->height, &exactMatch);
     if (!mode || !exactMatch)
     {
             D_ERROR( "DirectFB/OSX: Couldn't set %dx%dx%d video mode.\n",
                      config->width, config->height,
                      DFB_COLOR_BITS_PER_PIXEL(config->format));

             fusion_skirmish_dismiss( &dfb_osx->lock );

             return DFB_FAILURE;
     }
     CGDisplaySwitchToMode( screen, mode );
     CGDisplayCapture(screen);

     if (config->buffermode == DLBM_FRONTONLY) {
          /* update primary surface information */
          dfb_osx->primary->front_buffer->system.addr = CGDisplayBaseAddress( screen );
          dfb_osx->primary->front_buffer->system.pitch =  CGDisplayBytesPerRow( screen );
     }
     fusion_skirmish_dismiss( &dfb_osx->lock );

     return DFB_OK;
}

static DFBResult
dfb_osx_update_screen_handler( DFBRegion *region )
{
     DFBResult    ret;
     CoreSurface *surface = dfb_osx->primary;

     fusion_skirmish_prevail( &dfb_osx->lock );

     if (!region)
          ret = update_screen( surface, 0, 0, surface->config.size.w, surface->config.size.h );
     else
          ret = update_screen( surface,
                               region->x1,  region->y1,
                               region->x2 - region->x1 + 1,
                               region->y2 - region->y1 + 1 );

     fusion_skirmish_dismiss( &dfb_osx->lock );

     return DFB_OK;
}

static DFBResult
dfb_osx_set_palette_handler( CorePalette *palette )
{
     fusion_skirmish_prevail( &dfb_osx->lock );

// do something usefull
     fusion_skirmish_dismiss( &dfb_osx->lock );

     return DFB_OK;
}

FusionCallHandlerResult
dfb_osx_call_handler( int           caller,
                      int           call_arg,
                      void         *call_ptr,
                      void         *ctx,
                      unsigned int  serial,
                      int          *ret_val )
{
     switch (call_arg) {
          case OSX_SET_VIDEO_MODE:
               *ret_val = dfb_osx_set_video_mode_handler( call_ptr );
               break;

          case OSX_UPDATE_SCREEN:
               *ret_val = dfb_osx_update_screen_handler( call_ptr );
               break;

          case OSX_SET_PALETTE:
               *ret_val = dfb_osx_set_palette_handler( call_ptr );
               break;

          default:
               D_BUG( "unknown call" );
               *ret_val = DFB_BUG;
               break;
     }

     return FCHR_RETURN;
}

static DFBResult
dfb_osx_set_video_mode( CoreDFB *core, CoreLayerRegionConfig *config )
{
     int                    ret;
     CoreLayerRegionConfig *tmp = NULL;

     D_ASSERT( config != NULL );

     if (dfb_core_is_master( core ))
          return dfb_osx_set_video_mode_handler( config );

     if (!fusion_is_shared( dfb_core_world(core), config )) {
          tmp = SHMALLOC( dfb_core_shmpool(dfb_osx_core), sizeof(CoreLayerRegionConfig) );
          if (!tmp)
               return D_OOSHM();

          direct_memcpy( tmp, config, sizeof(CoreLayerRegionConfig) );
     }

     fusion_call_execute( &dfb_osx->call, FCEF_NONE, OSX_SET_VIDEO_MODE,
                          tmp ? tmp : config, &ret );

     if (tmp)
          SHFREE( dfb_core_shmpool(dfb_osx_core), tmp );

     return ret;
}

static DFBResult
dfb_osx_update_screen( CoreDFB *core, DFBRegion *region )
{
     int        ret;
     DFBRegion *tmp = NULL;

     if (dfb_core_is_master( core ))
          return dfb_osx_update_screen_handler( region );

     if (region) {
          if (!fusion_is_shared( dfb_core_world(core), region )) {
               tmp = SHMALLOC( dfb_core_shmpool(dfb_osx_core), sizeof(DFBRegion) );
               if (!tmp)
                    return D_OOSHM();

               direct_memcpy( tmp, region, sizeof(DFBRegion) );
          }
     }

     fusion_call_execute( &dfb_osx->call, FCEF_ONEWAY, OSX_UPDATE_SCREEN,
                          tmp ? tmp : region, &ret );

     if (tmp)
          SHFREE( dfb_core_shmpool(dfb_osx_core), tmp );

     return ret;
}

static DFBResult
dfb_osx_set_palette( CorePalette *palette )
{
     int ret;

     fusion_call_execute( &dfb_osx->call, FCEF_NONE, OSX_SET_PALETTE,
                          palette, &ret );

     return ret;
}

���������DirectFB-1.2.10/systems/osx/Makefile.am�������������������������������������������������������������0000644�0001750�0001750�00000002164�11164361026�014515� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/systems/osx

INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src

systemsdir = $(MODULEDIR)/systems

systems_LTLIBRARIES = libdirectfb_osx.la

if BUILD_STATIC
systems_DATA = libdirectfb_osx.o
endif


libdirectfb_osx_la_LDFLAGS = \
	-framework ApplicationServices	\
	-avoid-version	\
	-module

libdirectfb_osx_la_SOURCES = \
	primary.c	\
	primary.h	\
	osx.c		\
	osx.h

libdirectfb_osx_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

inputdriversdir = $(MODULEDIR)/inputdrivers

inputdrivers_LTLIBRARIES = libdirectfb_osxinput.la

if BUILD_STATIC
inputdrivers_DATA = libdirectfb_osxinput.o
endif


libdirectfb_osxinput_la_LDFLAGS = \
	-framework Carbon	\
	-avoid-version	\
	-module

libdirectfb_osxinput_la_SOURCES = \
	osxinput.c

libdirectfb_osxinput_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la


include $(top_srcdir)/rules/libobject.make	

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/Makefile.in�������������������������������������������������������������0000644�0001750�0001750�00000054670�11307521506�014537� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@


VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(top_srcdir)/rules/libobject.make
subdir = systems/osx
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(inputdriversdir)" \
	"$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(inputdriversdir)" \
	"$(DESTDIR)$(systemsdir)"
inputdriversLTLIBRARIES_INSTALL = $(INSTALL)
systemsLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(inputdrivers_LTLIBRARIES) $(systems_LTLIBRARIES)
libdirectfb_osx_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_osx_la_OBJECTS = primary.lo osx.lo
libdirectfb_osx_la_OBJECTS = $(am_libdirectfb_osx_la_OBJECTS)
libdirectfb_osx_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_osx_la_LDFLAGS) $(LDFLAGS) -o $@
libdirectfb_osxinput_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_osxinput_la_OBJECTS = osxinput.lo
libdirectfb_osxinput_la_OBJECTS =  \
	$(am_libdirectfb_osxinput_la_OBJECTS)
libdirectfb_osxinput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_osxinput_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
SOURCES = $(libdirectfb_osx_la_SOURCES) \
	$(libdirectfb_osxinput_la_SOURCES)
DIST_SOURCES = $(libdirectfb_osx_la_SOURCES) \
	$(libdirectfb_osxinput_la_SOURCES)
inputdriversDATA_INSTALL = $(INSTALL_DATA)
systemsDATA_INSTALL = $(INSTALL_DATA)
DATA = $(inputdrivers_DATA) $(systems_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src

systemsdir = $(MODULEDIR)/systems
systems_LTLIBRARIES = libdirectfb_osx.la
@BUILD_STATIC_TRUE@systems_DATA = libdirectfb_osx.o
libdirectfb_osx_la_LDFLAGS = \
	-framework ApplicationServices	\
	-avoid-version	\
	-module

libdirectfb_osx_la_SOURCES = \
	primary.c	\
	primary.h	\
	osx.c		\
	osx.h

libdirectfb_osx_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

inputdriversdir = $(MODULEDIR)/inputdrivers
inputdrivers_LTLIBRARIES = libdirectfb_osxinput.la
@BUILD_STATIC_TRUE@inputdrivers_DATA = libdirectfb_osxinput.o
libdirectfb_osxinput_la_LDFLAGS = \
	-framework Carbon	\
	-avoid-version	\
	-module

libdirectfb_osxinput_la_SOURCES = \
	osxinput.c

libdirectfb_osxinput_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/osx/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/osx/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-inputdriversLTLIBRARIES: $(inputdrivers_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(inputdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdriversdir)"
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(inputdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(inputdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(inputdriversdir)/$$f"; \
	  else :; fi; \
	done

uninstall-inputdriversLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(inputdriversdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(inputdriversdir)/$$p"; \
	done

clean-inputdriversLTLIBRARIES:
	-test -z "$(inputdrivers_LTLIBRARIES)" || rm -f $(inputdrivers_LTLIBRARIES)
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
install-systemsLTLIBRARIES: $(systems_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	  else :; fi; \
	done

uninstall-systemsLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(systemsdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(systemsdir)/$$p"; \
	done

clean-systemsLTLIBRARIES:
	-test -z "$(systems_LTLIBRARIES)" || rm -f $(systems_LTLIBRARIES)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libdirectfb_osx.la: $(libdirectfb_osx_la_OBJECTS) $(libdirectfb_osx_la_DEPENDENCIES) 
	$(libdirectfb_osx_la_LINK) -rpath $(systemsdir) $(libdirectfb_osx_la_OBJECTS) $(libdirectfb_osx_la_LIBADD) $(LIBS)
libdirectfb_osxinput.la: $(libdirectfb_osxinput_la_OBJECTS) $(libdirectfb_osxinput_la_DEPENDENCIES) 
	$(libdirectfb_osxinput_la_LINK) -rpath $(inputdriversdir) $(libdirectfb_osxinput_la_OBJECTS) $(libdirectfb_osxinput_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osxinput.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primary.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-inputdriversDATA: $(inputdrivers_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(inputdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdriversdir)"
	@list='$(inputdrivers_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(inputdriversDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	  $(inputdriversDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(inputdriversdir)/$$f"; \
	done

uninstall-inputdriversDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(inputdrivers_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(inputdriversdir)/$$f"; \
	done
install-systemsDATA: $(systems_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(systemsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	  $(systemsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	done

uninstall-systemsDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(systemsdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(systemsdir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
	for dir in "$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-inputdriversLTLIBRARIES clean-libtool \
	clean-systemsLTLIBRARIES mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-inputdriversDATA \
	install-inputdriversLTLIBRARIES install-systemsDATA \
	install-systemsLTLIBRARIES

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-inputdriversDATA \
	uninstall-inputdriversLTLIBRARIES uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-inputdriversLTLIBRARIES clean-libtool \
	clean-systemsLTLIBRARIES ctags distclean distclean-compile \
	distclean-generic distclean-libtool distclean-tags distdir dvi \
	dvi-am html html-am info info-am install install-am \
	install-data install-data-am install-dvi install-dvi-am \
	install-exec install-exec-am install-html install-html-am \
	install-info install-info-am install-inputdriversDATA \
	install-inputdriversLTLIBRARIES install-man install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	install-systemsDATA install-systemsLTLIBRARIES installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-inputdriversDATA \
	uninstall-inputdriversLTLIBRARIES uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

%.o: .libs/%.a %.la
	rm -f $<.tmp/*.o
	if test -d $<.tmp; then rmdir $<.tmp; fi
	mkdir $<.tmp
	(cd $<.tmp && $(AR) x ../../$<)
	$(LD) -o $@ -r $<.tmp/*.o
	rm -f $<.tmp/*.o && rmdir $<.tmp

.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/osx.c�������������������������������������������������������������������0000644�0001750�0001750�00000012227�11245562152�013442� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <directfb.h>

#include <fusion/arena.h>
#include <fusion/shmalloc.h>

#include <Carbon/Carbon.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <direct/messages.h>

#include "osx.h"
#include "primary.h"

#include <core/core_system.h>

DFB_CORE_SYSTEM( osx )


DFBOSX  *dfb_osx      = NULL;
CoreDFB *dfb_osx_core = NULL;


static void
system_get_info( CoreSystemInfo *info )
{
     info->type = CORE_OSX;

     snprintf( info->name, DFB_CORE_SYSTEM_INFO_NAME_LENGTH, "OSX" );
}

static DFBResult
system_initialize( CoreDFB *core, void **data )
{
     char       *driver;
     CoreScreen *screen;

     D_ASSERT( dfb_osx == NULL );

     dfb_osx = (DFBOSX*) SHCALLOC( dfb_core_shmpool(dfb_osx_core), 1, sizeof(DFBOSX) );
     if (!dfb_osx) {
          D_ERROR( "DirectFB/OSX: Couldn't allocate shared memory!\n" );
          return D_OOSHM();
     }

     dfb_osx_core = core;

     /* Initialize OSX */
     fusion_skirmish_init( &dfb_osx->lock, "OSX System", dfb_core_world(core) );

     fusion_call_init( &dfb_osx->call, dfb_osx_call_handler, NULL, dfb_core_world(core) );

     screen = dfb_screens_register( NULL, NULL, &osxPrimaryScreenFuncs );

     dfb_layers_register( screen, NULL, &osxPrimaryLayerFuncs );

     fusion_arena_add_shared_field( dfb_core_arena( core ), "OSX", dfb_osx );

     *data = dfb_osx;

     return DFB_OK;
}

static DFBResult
system_join( CoreDFB *core, void **data )
{
     void       *ret;
     CoreScreen *screen;

     D_ASSERT( dfb_osx == NULL );

     fusion_arena_get_shared_field( dfb_core_arena( core ), "OSX", &ret );

     dfb_osx = ret;
     dfb_osx_core = core;

     screen = dfb_screens_register( NULL, NULL, &osxPrimaryScreenFuncs );

     dfb_layers_register( screen, NULL, &osxPrimaryLayerFuncs );

     *data = dfb_osx;

     return DFB_OK;
}

static DFBResult
system_shutdown( bool emergency )
{
     D_ASSERT( dfb_osx != NULL );

     fusion_call_destroy( &dfb_osx->call );

     fusion_skirmish_prevail( &dfb_osx->lock );

     fusion_skirmish_destroy( &dfb_osx->lock );

     SHFREE( dfb_core_shmpool(dfb_osx_core), dfb_osx );
     dfb_osx = NULL;
     dfb_osx_core = NULL;

     return DFB_OK;
}

static DFBResult
system_leave( bool emergency )
{
     D_ASSERT( dfb_osx != NULL );

     dfb_osx = NULL;
     dfb_osx_core = NULL;

     return DFB_OK;
}

static DFBResult
system_suspend( void )
{
     return DFB_UNIMPLEMENTED;
}

static DFBResult
system_resume( void )
{
     return DFB_UNIMPLEMENTED;
}

static volatile void *
system_map_mmio( unsigned int    offset,
                 int             length )
{
    return NULL;
}

static void
system_unmap_mmio( volatile void  *addr,
                   int             length )
{
}

static int
system_get_accelerator( void )
{
     return -1;
}

static VideoMode *
system_get_modes( void )
{
     return NULL;
}

static VideoMode *
system_get_current_mode( void )
{
     return NULL;
}

static DFBResult
system_thread_init( void )
{
     return DFB_OK;
}

static bool
system_input_filter( CoreInputDevice   *device,
                     DFBInputEvent *event )
{
     return false;
}

static unsigned long
system_video_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_video_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_videoram_length( void )
{
     return 0;
}

static unsigned long
system_aux_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_aux_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_auxram_length( void )
{
     return 0;
}

static void
system_get_busid( int *ret_bus, int *ret_dev, int *ret_func )
{
     return;
}

static void
system_get_deviceid( unsigned int *ret_vendor_id,
                     unsigned int *ret_device_id )
{
     return;
}

�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/osxinput.c��������������������������������������������������������������0000644�0001750�0001750�00000020156�11245562152�014522� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <string.h>
#include <unistd.h>
#include <errno.h>

#include <directfb.h>


#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/input.h>
#include <core/system.h>

#include <direct/mem.h>
#include <direct/thread.h>

#include <Carbon/Carbon.h>

#include "osx.h"

#include <core/input_driver.h>


DFB_INPUT_DRIVER( osxinput )

/*
 * declaration of private data
 */
typedef struct {
     CoreInputDevice  *device;
     DirectThread *thread;
     DFBOSX       *dfb_osx;
     int           stop;
} OSXInputData;

static DFBInputEvent motionX = {
     .type    = DIET_UNKNOWN,
     .axisabs = 0,
};

static DFBInputEvent motionY = {
     .type    = DIET_UNKNOWN,
     .axisabs = 0,
};

static void
motion_compress( int x, int y )
{
     if (motionX.axisabs != x) {
          motionX.type    = DIET_AXISMOTION;
          motionX.flags   = DIEF_AXISABS;
          motionX.axis    = DIAI_X;
          motionX.axisabs = x;
     }

    if (motionY.axisabs != y) {
          motionY.type    = DIET_AXISMOTION;
          motionY.flags   = DIEF_AXISABS;
          motionY.axis    = DIAI_Y;
          motionY.axisabs = y;
     }
}

static void
motion_realize( OSXInputData *data )
{
     if (motionX.type != DIET_UNKNOWN) {
          dfb_input_dispatch( data->device, &motionX );

          motionX.type = DIET_UNKNOWN;
     }

     if (motionY.type != DIET_UNKNOWN) {
          dfb_input_dispatch( data->device, &motionY );

          motionY.type = DIET_UNKNOWN;
     }
}


static bool
translate_key( unsigned short key, DFBInputEvent *evt )
{
     unsigned char charcode = (unsigned char)key;
     unsigned char keycode  = (unsigned char)(key>>8);

     printf("keycode: %d char: %d\n",keycode,charcode);

     if (charcode) {
          evt->flags = DIEF_KEYSYMBOL;
          switch (charcode) {
               case 28:  evt->key_symbol = DIKS_CURSOR_LEFT; break;
               case 29:  evt->key_symbol = DIKS_CURSOR_RIGHT; break;
               case 30:  evt->key_symbol = DIKS_CURSOR_UP; break;
               case 31:  evt->key_symbol = DIKS_CURSOR_DOWN; break;
               default:
                   evt->key_symbol = charcode;
                   break;
          }
          return true;
     }
     else if (keycode) {
          evt->flags = DIEF_KEYID;
          evt->key_id = keycode;
          return true;
     }

     return false;
}

/*
 * Input thread reading from device.
 * Generates events on incoming data.
 */
static void*
osxEventThread( DirectThread *thread, void *driver_data )
{
     OSXInputData *data    = (OSXInputData*) driver_data;
     DFBOSX       *dfb_osx = data->dfb_osx;

     while (!data->stop) {
          DFBInputEvent evt;
          EventRecord   event;

          fusion_skirmish_prevail( &dfb_osx->lock );

          /* Check for events */
          while ( WaitNextEvent( everyEvent, &event, 0, nil) ) {
               fusion_skirmish_dismiss( &dfb_osx->lock );

               switch (event.what) {
                    case keyDown:
                    case keyUp:
                    case autoKey:
                         if (event.what == keyUp)
                              evt.type = DIET_KEYRELEASE;
                         else
                              evt.type = DIET_KEYPRESS;

                         if (translate_key( event.message & (charCodeMask | keyCodeMask), &evt )) {
                              dfb_input_dispatch( data->device, &evt );
                         }

                         break;
                    case mouseDown:
                         evt.type = DIET_BUTTONPRESS;
                         evt.button = DIBI_LEFT;
                         dfb_input_dispatch( data->device, &evt );
                         break;
                    case mouseUp:
                         evt.type = DIET_BUTTONRELEASE;
                         evt.button = DIBI_LEFT;
                         dfb_input_dispatch( data->device, &evt );
                         break;
                    default:
                         printf("%d\n",event.what);
                         break;
               }

               fusion_skirmish_prevail( &dfb_osx->lock );
          }

          fusion_skirmish_dismiss( &dfb_osx->lock );

          usleep(10000);

          direct_thread_testcancel( thread );
     }

     return NULL;
}

/* exported symbols */

/*
 * Return the number of available devices.
 * Called once during initialization of DirectFB.
 */
static int
driver_get_available( void )
{
     if (dfb_system_type() == CORE_OSX)
          return 1;

     return 0;
}

/*
 * Fill out general information about this driver.
 * Called once during initialization of DirectFB.
 */
static void
driver_get_info( InputDriverInfo *info )
{
     /* fill driver info structure */
     snprintf ( info->name,
                DFB_INPUT_DRIVER_INFO_NAME_LENGTH, "OSX Input Driver" );
     snprintf ( info->vendor,
                DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH, "Andreas Hundt" );

     info->version.major = 0;
     info->version.minor = 1;
}

/*
 * 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 )
{
     OSXInputData *data;
     DFBOSX       *dfb_osx = dfb_system_data();

     fusion_skirmish_prevail( &dfb_osx->lock );

     fusion_skirmish_dismiss( &dfb_osx->lock );

     /* set device name */
     snprintf( info->desc.name,
               DFB_INPUT_DEVICE_DESC_NAME_LENGTH, "OSX Input" );

     /* set device vendor */
     snprintf( info->desc.vendor,
               DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "OSX" );

     /* set one of the primary input device IDs */
     info->prefered_id = DIDID_KEYBOARD;

     /* set type flags */
     info->desc.type   = DIDTF_KEYBOARD | DIDTF_MOUSE;

     /* set capabilities */
     info->desc.caps   = DICAPS_ALL;

     /* allocate and fill private data */
     data = D_CALLOC( 1, sizeof(OSXInputData) );

     data->device  = device;
     data->dfb_osx = dfb_osx;

     /* start input thread */
     data->thread = direct_thread_create( DTT_INPUT, osxEventThread, data, "OSX Input" );

     /* set private data pointer */
     *driver_data = data;

     return DFB_OK;
}

/*
 * Fetch one entry from the device's keymap if supported.
 */
static DFBResult
driver_get_keymap_entry( CoreInputDevice           *device,
                         void                      *driver_data,
                         DFBInputDeviceKeymapEntry *entry )
{
     return DFB_UNSUPPORTED;
}

/*
 * End thread, close device and free private data.
 */
static void
driver_close_device( void *driver_data )
{
     OSXInputData *data = (OSXInputData*) driver_data;

     /* stop input thread */
     data->stop = 1;

     direct_thread_join( data->thread );
     direct_thread_destroy( data->thread );

     /* free private data */
     D_FREE ( data );
}
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/primary.h���������������������������������������������������������������0000644�0001750�0001750�00000003247�11245562152�014323� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __OSX__PRIMARY_H__
#define __OSX__PRIMARY_H__

#include <fusion/call.h>

#include <core/layers.h>
#include <core/screens.h>

extern ScreenFuncs       osxPrimaryScreenFuncs;
extern DisplayLayerFuncs osxPrimaryLayerFuncs;

FusionCallHandlerResult
dfb_osx_call_handler( int           caller,
                      int           call_arg,
                      void         *call_ptr,
                      void         *ctx,
                      unsigned int  serial,
                      int          *ret_val )

#endif

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/osx/osx.h�������������������������������������������������������������������0000644�0001750�0001750�00000002561�11245562152�013447� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __OSX__OSX_H__
#define __OSX__OSX_H__

#include <fusion/call.h>
#include <fusion/lock.h>

typedef struct {
     FusionSkirmish  lock;
     FusionCall      call;

     CoreSurface    *primary;
} DFBOSX;

#endif

�����������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/Makefile.am�����������������������������������������������������������������0000644�0001750�0001750�00000000655�11164361026�013707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/systems

if SDL_CORE
SDL_DIR = sdl
else
SDL_DIR =
endif

if OSX_CORE
OSX_DIR = osx
else
OSX_DIR =
endif

if X11_CORE
X11_DIR = x11
else
X11_DIR =
endif

if DEVMEM_CORE
DEVMEM_DIR = devmem
else
DEVMEM_DIR =
endif

if FBDEV_CORE
FBDEV_DIR = fbdev
else
FBDEV_DIR =
endif

if VNC_CORE
VNC_DIR = vnc
else
VNC_DIR =
endif
  

SUBDIRS = $(DEVMEM_DIR) $(FBDEV_DIR) $(X11_DIR) $(SDL_DIR) $(OSX_DIR) $(VNC_DIR)
�����������������������������������������������������������������������������������DirectFB-1.2.10/systems/Makefile.in�����������������������������������������������������������������0000644�0001750�0001750�00000041255�11307521506�013721� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = systems
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
	html-recursive info-recursive install-data-recursive \
	install-dvi-recursive install-exec-recursive \
	install-html-recursive install-info-recursive \
	install-pdf-recursive install-ps-recursive install-recursive \
	installcheck-recursive installdirs-recursive pdf-recursive \
	ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
  distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = devmem fbdev x11 sdl osx vnc
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@SDL_CORE_FALSE@SDL_DIR = 
@SDL_CORE_TRUE@SDL_DIR = sdl
@OSX_CORE_FALSE@OSX_DIR = 
@OSX_CORE_TRUE@OSX_DIR = osx
@X11_CORE_FALSE@X11_DIR = 
@X11_CORE_TRUE@X11_DIR = x11
@DEVMEM_CORE_FALSE@DEVMEM_DIR = 
@DEVMEM_CORE_TRUE@DEVMEM_DIR = devmem
@FBDEV_CORE_FALSE@FBDEV_DIR = 
@FBDEV_CORE_TRUE@FBDEV_DIR = fbdev
@VNC_CORE_FALSE@VNC_DIR = 
@VNC_CORE_TRUE@VNC_DIR = vnc
SUBDIRS = $(DEVMEM_DIR) $(FBDEV_DIR) $(X11_DIR) $(SDL_DIR) $(OSX_DIR) $(VNC_DIR)
all: all-recursive

.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs

# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
#     (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
	@failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"

$(RECURSIVE_CLEAN_TARGETS):
	@failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	case "$@" in \
	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
	  *) list='$(SUBDIRS)' ;; \
	esac; \
	rev=''; for subdir in $$list; do \
	  if test "$$subdir" = "."; then :; else \
	    rev="$$subdir $$rev"; \
	  fi; \
	done; \
	rev="$$rev ."; \
	target=`echo $@ | sed s/-recursive//`; \
	for subdir in $$rev; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done && test -z "$$fail"
tags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
	done
ctags-recursive:
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
	  include_option=--etags-include; \
	  empty_fix=.; \
	else \
	  include_option=--include; \
	  empty_fix=; \
	fi; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test ! -f $$subdir/TAGS || \
	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
	  fi; \
	done; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test -d "$(distdir)/$$subdir" \
	    || $(MKDIR_P) "$(distdir)/$$subdir" \
	    || exit 1; \
	    distdir=`$(am__cd) $(distdir) && pwd`; \
	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
	    (cd $$subdir && \
	      $(MAKE) $(AM_MAKEFLAGS) \
	        top_distdir="$$top_distdir" \
	        distdir="$$distdir/$$subdir" \
		am__remove_distdir=: \
		am__skip_length_check=: \
	        distdir) \
	      || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-recursive
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

info: info-recursive

info-am:

install-data-am:

install-dvi: install-dvi-recursive

install-exec-am:

install-html: install-html-recursive

install-info: install-info-recursive

install-man:

install-pdf: install-pdf-recursive

install-ps: install-ps-recursive

installcheck-am:

maintainer-clean: maintainer-clean-recursive
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-recursive

pdf-am:

ps: ps-recursive

ps-am:

uninstall-am:

.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
	install-strip

.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
	all all-am check check-am clean clean-generic clean-libtool \
	ctags ctags-recursive distclean distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-pdf install-pdf-am \
	install-ps install-ps-am install-strip installcheck \
	installcheck-am installdirs installdirs-am maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
	uninstall uninstall-am

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522566�012526� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/primary.c���������������������������������������������������������������0000644�0001750�0001750�00000074235�11245562152�014300� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

#include <directfb.h>

#include <fusion/fusion.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>
#include <core/input.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <direct/memcpy.h>
#include <direct/messages.h>
#include <direct/thread.h>

#include <rfb/rfb.h>
#include <rfb/keysym.h>
#include "vnc.h"
#include "primary.h"


/******************************************************************************/
/*VNC server setup*/
/* Here we create a structure so that every client has it's own pointer */

typedef struct ClientData {
  int oldButtonMask;
  int oldButton;
  int oldx,oldy;
} ClientData;

static void process_key_event(rfbBool down, rfbKeySym key, struct _rfbClientRec* cl);
static void process_pointer_event(int buttonMask, int x, int y, struct _rfbClientRec* cl);
static bool translate_key(rfbKeySym key, DFBInputEvent *evt );
static void clientgone(rfbClientPtr cl);
static enum rfbNewClientAction newclient(rfbClientPtr cl);



static DFBEnumerationResult attach_input_device( CoreInputDevice *device, void *ctx );

static DFBResult dfb_vnc_set_video_mode( CoreDFB* core, CoreLayerRegionConfig *config );
static DFBResult dfb_vnc_update_screen( CoreDFB *core, DFBRegion *region );
static DFBResult dfb_vnc_set_palette( CorePalette *palette );

static DFBResult update_screen( CoreSurface *surface,
                                int x, int y, int w, int h );

static void* vnc_server_thread( DirectThread *thread, void *data );

extern DFBVNC *dfb_vnc;
extern CoreDFB *dfb_vnc_core;
rfbScreenInfoPtr rfb_screen = NULL;
static CoreInputDevice *vncInputDevice;

/******************************************************************************/

static DFBResult
primaryInitScreen( CoreScreen           *screen,
                   CoreGraphicsDevice   *device,
                   void                 *driver_data,
                   void                 *screen_data,
                   DFBScreenDescription *description )
{
     /* Set the screen capabilities. */
     description->caps = DSCCAPS_NONE;

     /* Set the screen name. */
     snprintf( description->name,
               DFB_SCREEN_DESC_NAME_LENGTH, "VNC Primary Screen" );

     return DFB_OK;
}

static DFBResult
primaryGetScreenSize( CoreScreen *screen,
                      void       *driver_data,
                      void       *screen_data,
                      int        *ret_width,
                      int        *ret_height )
{
     D_ASSERT( dfb_vnc != NULL );

     if (dfb_vnc->primary) {
          *ret_width  = dfb_vnc->primary->config.size.w;
          *ret_height = dfb_vnc->primary->config.size.h;
     }
     else {
          if (dfb_config->mode.width)
               *ret_width  = dfb_config->mode.width;
          else
               *ret_width  = 640;

          if (dfb_config->mode.height)
               *ret_height = dfb_config->mode.height;
          else
               *ret_height = 480;
     }

     return DFB_OK;
}

ScreenFuncs vncPrimaryScreenFuncs = {
     .InitScreen    = primaryInitScreen,
     .GetScreenSize = primaryGetScreenSize,
};

/******************************************************************************/

static int
primaryLayerDataSize( void )
{
     return 0;
}

static int
primaryRegionDataSize( void )
{
     return 0;
}

static DFBResult
primaryInitLayer( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  DFBDisplayLayerDescription *description,
                  DFBDisplayLayerConfig      *config,
                  DFBColorAdjustment         *adjustment )
{
     D_DEBUG( "DirectFB/VNC: primaryInitLayer\n");
          
     /* set capabilities and type */
     description->caps = DLCAPS_SURFACE;
     description->type = DLTF_GRAPHICS;

     /* set name */
     snprintf( description->name,
               DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "VNC Primary Layer" );

     /* fill out the default configuration */
     config->flags       = DLCONF_WIDTH       | DLCONF_HEIGHT |
                           DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
     config->buffermode  = DLBM_FRONTONLY;

     if (dfb_config->mode.width)
          config->width  = dfb_config->mode.width;
     else
          config->width  = 640;

     if (dfb_config->mode.height)
          config->height = dfb_config->mode.height;
     else
          config->height = 480;

     if (dfb_config->mode.format != DSPF_UNKNOWN)
          config->pixelformat = dfb_config->mode.format;
     else if (dfb_config->mode.depth > 0)
          config->pixelformat = dfb_pixelformat_for_depth( dfb_config->mode.depth );
     else
          config->pixelformat = DSPF_RGB24;

     return DFB_OK;
}

static DFBResult
primaryTestRegion( CoreLayer                  *layer,
                   void                       *driver_data,
                   void                       *layer_data,
                   CoreLayerRegionConfig      *config,
                   CoreLayerRegionConfigFlags *failed )
{
     CoreLayerRegionConfigFlags fail = 0;

     switch (config->buffermode) {
          case DLBM_FRONTONLY:
          case DLBM_BACKSYSTEM:
          case DLBM_BACKVIDEO:
               break;

          default:
               fail |= CLRCF_BUFFERMODE;
               break;
     }

     if (config->options)
          fail |= CLRCF_OPTIONS;

     if (failed)
          *failed = fail;

     if (fail)
          return DFB_UNSUPPORTED;

     return DFB_OK;
}

static DFBResult
primaryAddRegion( CoreLayer             *layer,
                  void                  *driver_data,
                  void                  *layer_data,
                  void                  *region_data,
                  CoreLayerRegionConfig *config )
{
     return DFB_OK;
}

static DFBResult
primarySetRegion( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  void                       *region_data,
                  CoreLayerRegionConfig      *config,
                  CoreLayerRegionConfigFlags  updated,
                  CoreSurface                *surface,
                  CorePalette                *palette,
                  CoreSurfaceBufferLock      *lock )
{
     DFBResult ret;

     D_DEBUG( "DirectFB/VNC: primarySetRegion\n");

     ret = dfb_vnc_set_video_mode( dfb_vnc_core, config );
     if (ret)
          return ret;

     if (surface)
          dfb_vnc->primary = surface;

     if (palette)
          dfb_vnc_set_palette( palette );

     driver_data = (void*) rfb_screen; 
     
     return DFB_OK;
}

static DFBResult
primaryRemoveRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data )
{
     dfb_vnc->primary = NULL;

     return DFB_OK;
}

static DFBResult
primaryFlipRegion( CoreLayer             *layer,
                   void                  *driver_data,
                   void                  *layer_data,
                   void                  *region_data,
                   CoreSurface           *surface,
                   DFBSurfaceFlipFlags    flags,
                   CoreSurfaceBufferLock *lock )
{
     dfb_surface_flip( surface, false );

     return dfb_vnc_update_screen( dfb_vnc_core, NULL );
}

static DFBResult
primaryUpdateRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data,
                     CoreSurface           *surface,
                     const DFBRegion       *update,
                     CoreSurfaceBufferLock *lock )
{
     if (update) {
          DFBRegion region = *update;

          return dfb_vnc_update_screen( dfb_vnc_core, ®ion );
     }

     return dfb_vnc_update_screen( dfb_vnc_core, NULL );
}

static DFBResult
primaryAllocateSurface( CoreLayer              *layer,
                        void                   *driver_data,
                        void                   *layer_data,
                        void                   *region_data,
                        CoreLayerRegionConfig  *config,
                        CoreSurface           **ret_surface )
{
     CoreSurfaceConfig conf;

     conf.flags  = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_CAPS;
     conf.size.w = config->width;
     conf.size.h = config->height;
     conf.format = config->format;
     conf.caps   = DSCAPS_SYSTEMONLY;

     if (config->buffermode != DLBM_FRONTONLY)
          conf.caps |= DSCAPS_DOUBLE;

     return dfb_surface_create( dfb_vnc_core, &conf, CSTF_LAYER, DLID_PRIMARY, NULL, ret_surface );
}

static DFBResult
primaryReallocateSurface( CoreLayer             *layer,
                          void                  *driver_data,
                          void                  *layer_data,
                          void                  *region_data,
                          CoreLayerRegionConfig *config,
                          CoreSurface           *surface )
{
     DFBResult         ret;
     CoreSurfaceConfig conf;

     conf.flags  = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_CAPS;
     conf.size.w = config->width;
     conf.size.h = config->height;
     conf.format = config->format;
     conf.caps   = DSCAPS_SYSTEMONLY;

     if (config->buffermode != DLBM_FRONTONLY)
          conf.caps |= DSCAPS_DOUBLE;

     ret = dfb_surface_reconfig( surface, &conf );
     if (ret)
          return ret;

     if (DFB_PIXELFORMAT_IS_INDEXED(config->format) && !surface->palette) {
          DFBResult    ret;
          CorePalette *palette;

          ret = dfb_palette_create( NULL,    /* FIXME */
                                    1 << DFB_COLOR_BITS_PER_PIXEL( config->format ),
                                    &palette );
          if (ret)
               return ret;

          if (config->format == DSPF_LUT8)
               dfb_palette_generate_rgb332_map( palette );

          dfb_surface_set_palette( surface, palette );

          dfb_palette_unref( palette );
     }

     return DFB_OK;
}

DisplayLayerFuncs vncPrimaryLayerFuncs = {
     .LayerDataSize     = primaryLayerDataSize,
     .RegionDataSize    = primaryRegionDataSize,
     .InitLayer         = primaryInitLayer,

     .TestRegion        = primaryTestRegion,
     .AddRegion         = primaryAddRegion,
     .SetRegion         = primarySetRegion,
     .RemoveRegion      = primaryRemoveRegion,
     .FlipRegion        = primaryFlipRegion,
     .UpdateRegion      = primaryUpdateRegion,

     .AllocateSurface   = primaryAllocateSurface,
     .ReallocateSurface = primaryReallocateSurface,
};

/******************************************************************************/

static DFBResult
update_screen( CoreSurface *surface, int x, int y, int w, int h )
{
     DFBResult              ret;
     int                    i, j, k;
     void                  *dst, *p;
     void                  *src, *q;
     CoreSurfaceBufferLock  lock;

     D_ASSERT( surface != NULL );
     D_ASSERT( rfb_screen != NULL );
     D_ASSERT( rfb_screen->frameBuffer != NULL );

     ret = dfb_surface_lock_buffer( surface, CSBR_FRONT, CSAF_CPU_READ, &lock );
     if (ret) {
          D_DERROR( ret, "DirectFB/VNC: Couldn't lock layer surface!\n" );
          return ret;
     }

     src = lock.addr + DFB_BYTES_PER_LINE( surface->config.format, x ) + y * lock.pitch;

     dst = rfb_screen->frameBuffer + x * rfb_screen->depth/8 + y * rfb_screen->width * rfb_screen->depth/8;

     for (i=0; i<h; ++i) {
          /*direct_memcpy( dst, src, DFB_BYTES_PER_LINE( surface->config.format, w ) );*/
          for (j=0, p=src, q=dst; j<w; j++, 
              p += DFB_BYTES_PER_PIXEL(surface->config.format),
              q += rfb_screen->depth/8) {
               /*direct_memcpy( q, p, DFB_BYTES_PER_PIXEL(surface->config.format));*/
               /**(char*) q = *(char*) (p+2);
               *(char*) (q+1) = *(char*) (p+1);
               *(char*) (q+2) = *(char*) p;*/
               for (k=0; k<DFB_BYTES_PER_PIXEL(surface->config.format); k++)
                    *(char*) (q+k) = *(char*) (p+DFB_BYTES_PER_PIXEL(surface->config.format)-1-k);
          }

          src += lock.pitch;
          dst += rfb_screen->width * rfb_screen->depth/8;
     }

     rfbMarkRectAsModified ( rfb_screen, x, y, x+w, y+h );

     dfb_surface_unlock_buffer( surface, &lock );


#if 0 /* Mire test */

     maxx = screen->width ;
     maxy = screen->height ;
     bpp = screen->depth/8 ;
     buffer = screen->frameBuffer ;


      for(j=0;j<maxy;++j) {
         for(i=0;i<maxx;++i) {
                       buffer[(j*maxx+i)*bpp+0]=(i+j)*128/(maxx+maxy); /* red */
                         buffer[(j*maxx+i)*bpp+1]=i*128/maxx; /* green */
                           buffer[(j*maxx+i)*bpp+2]=j*256/maxy; /* blue */
                               }
                 buffer[j*maxx*bpp+0]=0xff;
                 buffer[j*maxx*bpp+1]=0xff;
                     buffer[j*maxx*bpp+2]=0xff;
                     buffer[j*maxx*bpp+3]=0xff;
                       }
     

       
       rfbMarkRectAsModified ( screen, 0, 0, 600, 800);
#endif
     
     return DFB_OK;
}

/******************************************************************************/

typedef enum {
     VNC_SET_VIDEO_MODE,
     VNC_UPDATE_SCREEN,
     VNC_SET_PALETTE
} DFBVNCCall;

static DFBResult
dfb_vnc_set_video_mode_handler( CoreLayerRegionConfig *config )
{
     int argc = 0;
     char** argv = NULL;

     D_DEBUG( "DirectFB/VNC: layer config properties\n");

     if(rfb_screen) /*!!! FIXME*/
         return DFB_OK;

     fusion_skirmish_prevail( &dfb_vnc->lock );

     /* Set video mode */
     rfb_screen = rfbGetScreen(&argc, argv, config->width, config->height, DFB_BITS_PER_PIXEL(config->format)/3, 3, 4);
     
     D_DEBUG( "DirectFB/VNC: rfbGetScreen parameters: width %d height %d bitspersample %d samplesperpixel %d bytesperpixel %d\n", config->width, config->height, DFB_BITS_PER_PIXEL(config->format)/3, 3, 4);
     
     /*screen = rfbGetScreen(&argc, argv, config->width, config->height, 8, 3, 4);*/

     if ( rfb_screen == NULL )
     {
             D_ERROR( "DirectFB/VNC: Couldn't set %dx%dx%d video mode\n",
                      config->width, config->height,
                      DFB_COLOR_BITS_PER_PIXEL(config->format) );

             fusion_skirmish_dismiss( &dfb_vnc->lock );

             return DFB_FAILURE;
     }

     if(DFB_COLOR_BITS_PER_PIXEL(config->format) == DSPF_RGB16)
     {
        rfb_screen->serverFormat.redShift = 11;
        rfb_screen->serverFormat.greenShift = 5;
        rfb_screen->serverFormat.blueShift = 0;
        rfb_screen->serverFormat.redMax = 31;
        rfb_screen->serverFormat.greenMax = 63;
        rfb_screen->serverFormat.blueMax = 31;
     }
    
     /* screen->serverFormat.trueColour=FALSE; */

     rfb_screen->frameBuffer = malloc(rfb_screen->width * rfb_screen->height * rfb_screen->depth / 8) ;
     
     if ( ! rfb_screen->frameBuffer )
     {
             fusion_skirmish_dismiss( &dfb_vnc->lock );

             return DFB_NOSYSTEMMEMORY;
     }

     /* Connect key handler */

     rfb_screen->kbdAddEvent = process_key_event;
     rfb_screen->ptrAddEvent = process_pointer_event;
     rfb_screen->newClientHook = newclient;
     
     /* Initialize VNC */
     
     rfbInitServer(rfb_screen);
     
     /* Now creating a thread to process the server */

     direct_thread_create( DTT_OUTPUT, vnc_server_thread, rfb_screen, "VNC Output" ); 
    
     fusion_skirmish_dismiss( &dfb_vnc->lock );

     return DFB_OK;
}

static void*
vnc_server_thread( DirectThread *thread, void *data )
{
   rfbRunEventLoop(rfb_screen, -1, FALSE); 
   return NULL;
}


static DFBResult
dfb_vnc_update_screen_handler( DFBRegion *region )
{
     DFBResult    ret;
     CoreSurface *surface;
      
      D_ASSERT(dfb_vnc);
      
      surface = dfb_vnc->primary;

     fusion_skirmish_prevail( &dfb_vnc->lock );

     if (!region)
          ret = update_screen( surface, 0, 0, surface->config.size.w, surface->config.size.h );
     else
          ret = update_screen( surface,
                               region->x1,  region->y1,
                               region->x2 - region->x1 + 1,
                               region->y2 - region->y1 + 1 );

     fusion_skirmish_dismiss( &dfb_vnc->lock );

     return DFB_OK;
}

static DFBResult
dfb_vnc_set_palette_handler( CorePalette *palette )
{
     unsigned int i;
     uint8_t* map;

     rfb_screen->colourMap.count = palette->num_entries;
     rfb_screen->colourMap.is16 = false;
     rfb_screen->serverFormat.trueColour=FALSE;

     D_DEBUG( "DirectFB/VNC: setting colourmap of size %d\n", palette->num_entries);
     
     if( (map = (uint8_t*) malloc(rfb_screen->colourMap.count*sizeof(uint8_t)*3)) == NULL )
          return DFB_NOSYSTEMMEMORY;

     for (i=0; i<palette->num_entries; i++) {
          *(map++) = palette->entries[i].r;
          *(map++) = palette->entries[i].g;
          *(map++) = palette->entries[i].b;
     }

     fusion_skirmish_prevail( &dfb_vnc->lock );

     if( rfb_screen->colourMap.data.bytes )
          free(rfb_screen->colourMap.data.bytes);
     rfb_screen->colourMap.data.bytes = map;

     fusion_skirmish_dismiss( &dfb_vnc->lock );

     return DFB_OK;
}

FusionCallHandlerResult
dfb_vnc_call_handler( int           caller,
                      int           call_arg,
                      void         *call_ptr,
                      void         *ctx,
                      unsigned int  serial,
                      int          *ret_val )
{
     switch (call_arg) {
          case VNC_SET_VIDEO_MODE:
               *ret_val = dfb_vnc_set_video_mode_handler( call_ptr );
               break;

          case VNC_UPDATE_SCREEN:
               *ret_val = dfb_vnc_update_screen_handler( call_ptr );
               break;

          case VNC_SET_PALETTE:
               *ret_val = dfb_vnc_set_palette_handler( call_ptr );
               break;

          default:
               D_BUG( "unknown call" );
               *ret_val = DFB_BUG;
               break;
     }

     return FCHR_RETURN;
}

static DFBResult
dfb_vnc_set_video_mode( CoreDFB *core, CoreLayerRegionConfig *config )
{
     int                    ret;
     CoreLayerRegionConfig *tmp = NULL;

     D_ASSERT( config != NULL );

     if (dfb_core_is_master( core ))
          return dfb_vnc_set_video_mode_handler( config );

     if (!fusion_is_shared( dfb_core_world(core), config )) {
          tmp = SHMALLOC( dfb_core_shmpool(core), sizeof(CoreLayerRegionConfig) );
          if (!tmp)
               return D_OOSHM();

          direct_memcpy( tmp, config, sizeof(CoreLayerRegionConfig) );
     }

     fusion_call_execute( &dfb_vnc->call, FCEF_NONE, VNC_SET_VIDEO_MODE,
                          tmp ? tmp : config, &ret );

     if (tmp)
          SHFREE( dfb_core_shmpool(core), tmp );

     return ret;
}

static DFBResult
dfb_vnc_update_screen( CoreDFB *core, DFBRegion *region )
{
     int        ret;
     DFBRegion *tmp = NULL;

     if (dfb_core_is_master( core ))
          return dfb_vnc_update_screen_handler( region );

     if (region) {
          if (!fusion_is_shared( dfb_core_world(core), region )) {
               tmp = SHMALLOC( dfb_core_shmpool(core), sizeof(DFBRegion) );
               if (!tmp)
                    return D_OOSHM();

               direct_memcpy( tmp, region, sizeof(DFBRegion) );
          }
     }

     fusion_call_execute( &dfb_vnc->call, FCEF_NONE, VNC_UPDATE_SCREEN,
                          tmp ? tmp : region, &ret );

     if (tmp)
          SHFREE( dfb_core_shmpool(core), tmp );

     return DFB_OK;
}

static DFBResult
dfb_vnc_set_palette( CorePalette *palette )
{
     int ret;

     fusion_call_execute( &dfb_vnc->call, FCEF_NONE, VNC_SET_PALETTE,
                          palette, &ret );

     return ret;
}

/**
  VNC Server setup
**/

static DFBEnumerationResult
attach_input_device( CoreInputDevice *device,
                      void            *ctx )
{
  vncInputDevice = device;
  return DFENUM_OK;
}

static void clientgone(rfbClientPtr cl)
{
  free(cl->clientData);
}

static enum rfbNewClientAction newclient(rfbClientPtr cl)
{
  cl->clientData = (void*)calloc(sizeof(ClientData),1);
  cl->clientGoneHook = clientgone;
  return RFB_CLIENT_ACCEPT;
}


static void 
process_pointer_event(int buttonMask, int x, int y, rfbClientPtr cl)
{

    DFBInputEvent evt;
    int button;

    if( vncInputDevice == NULL ){
        /* Attach to first input device */
        dfb_input_enumerate_devices( attach_input_device,NULL, DICAPS_ALL );
        D_ASSERT(vncInputDevice); 
    }

    ClientData* cd=cl->clientData;
    if(buttonMask != cd->oldButtonMask ) {
        int mask = buttonMask^cd->oldButtonMask;
        if( mask & (1 << 0)) { 
            button=DIBI_LEFT;
        } else if( mask & (1 << 1)) {
            button=DIBI_MIDDLE;
        } else if( mask & (1 << 2)) {
            button=DIBI_RIGHT;
        } else {
            return;
        }
        evt.flags = DIEF_NONE;
                
        if(cd->oldButton > button ) {
            evt.type = DIET_BUTTONRELEASE;
            evt.button=cd->oldButton;
            cd->oldButton=0;
        }else {
            evt.type = DIET_BUTTONPRESS;
            evt.button=button;
            cd->oldButton=button;
            cd->oldButtonMask=buttonMask;
        }
        dfb_input_dispatch( vncInputDevice, &evt );
        cd->oldx=x; 
        cd->oldy=y; 
        return;
    }

    evt.type    = DIET_AXISMOTION;
    evt.flags   = DIEF_AXISABS;

    if( cd->oldx != x ) {
          evt.axis    = DIAI_X;
          evt.axisabs = x;
          dfb_input_dispatch( vncInputDevice, &evt );
    }

    if( cd->oldy != y ) {
          evt.axis    = DIAI_Y;
          evt.axisabs = x;
          dfb_input_dispatch( vncInputDevice, &evt );
    }
    cd->oldx=x; 
    cd->oldy=y; 

    dfb_input_dispatch( vncInputDevice, &evt );
    rfbDefaultPtrAddEvent(buttonMask,x,y,cl);

}

/*
 * declaration of private data
 */
static void
process_key_event(rfbBool down, rfbKeySym key, rfbClientPtr cl)
{
    DFBInputEvent evt;
    if( vncInputDevice == NULL ){
        /* Attach to first input device */
        dfb_input_enumerate_devices( attach_input_device,NULL, DICAPS_ALL );
        D_ASSERT(vncInputDevice); 
    }
     if (down)
          evt.type = DIET_KEYPRESS;
     else
          evt.type = DIET_KEYRELEASE;
                                                                                  
     if (translate_key( key, &evt )) {
          dfb_input_dispatch( vncInputDevice, &evt );
     }

}


static bool
translate_key(rfbKeySym key, DFBInputEvent *evt )
{
     /* Unicode */
     if (key <= 0xf000) {
         evt->flags = DIEF_KEYSYMBOL;
         evt->key_symbol = key;
         return true;
     }

     /* Dead keys */
     /* todo */     

     /* Numeric keypad */
     if (key >= XK_KP_0  &&  key <= XK_KP_9) {
          evt->flags = DIEF_KEYID;
          evt->key_id = DIKI_KP_0 + key - XK_KP_0;
          return true;
     }

     /* Function keys */
     if (key >= XK_F1  &&  key <= XK_F11) {
          evt->flags = DIEF_KEYID;
          evt->key_id = DIKI_F1 + key - XK_F1;
          return true;
     }

     switch (key) {
          /* Numeric keypad */
          case XK_KP_Decimal:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_DECIMAL;
               break;

          case XK_KP_Separator:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_SEPARATOR;
               break;

          case XK_KP_Divide:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_DIV;
               break;

          case XK_KP_Multiply:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_MULT;
               break;

          case XK_KP_Subtract:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_MINUS;
               break;

          case XK_KP_Add:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_PLUS;
               break;

          case XK_KP_Enter:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_ENTER;
               break;

          case XK_KP_Equal:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_KP_EQUAL;
               break;


          /* Arrows + Home/End pad */
          case XK_Up:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_UP;
               break;

          case XK_Down:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_DOWN;
               break;

          case XK_Right:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_RIGHT;
               break;

          case XK_Left:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_LEFT;
               break;

          case XK_Insert:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_INSERT;
               break;
                                                                                
          case XK_Delete:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_DELETE;
               break;

          case XK_Home:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_HOME;
               break;

          case XK_End:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_END;
               break;

          case XK_Page_Up:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_PAGE_UP;
               break;

          case XK_Page_Down:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_PAGE_DOWN;
               break;


          /* Key state modifier keys */
          case XK_Num_Lock:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_NUM_LOCK;
               break;

          case XK_Caps_Lock:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_CAPS_LOCK;
               break;

          case XK_Scroll_Lock:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_SCROLL_LOCK;
               break;

          case XK_Shift_R:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_SHIFT_R;
               break;

          case XK_Shift_L:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_SHIFT_L;
               break;

          case XK_Control_R:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_CONTROL_R;
               break;

          case XK_Control_L:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_CONTROL_L;
               break;

          case XK_Alt_R:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_ALT_R;
               break;

          case XK_Alt_L:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_ALT_L;
               break;

          case XK_Meta_R:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_META_R;
               break;

          case XK_Meta_L:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_META_L;
               break;

          case XK_Super_L:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_SUPER_L;
               break;

          case XK_Super_R:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_SUPER_R;
               break;

          case XK_Hyper_L:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_HYPER_L;
               break;
                                                                                
          case XK_Hyper_R:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_HYPER_R;
               break;

          /*case ??:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_ALTGR;
               break;*/

          case XK_BackSpace:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_BACKSPACE;
               break;

          case XK_Tab:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_HYPER_L;
               break;

          case XK_Return:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_ENTER;
               break;

          case XK_Escape:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_ESCAPE;
                    break;

          case XK_Pause:
               evt->flags = DIEF_KEYID;
               evt->key_id = DIKI_PAUSE;
               break;

          /* Miscellaneous function keys */
          case XK_Help:
               evt->flags = DIEF_KEYSYMBOL;
               evt->key_symbol = DIKS_HELP;
               break;

          case XK_Print:
               evt->flags = DIEF_KEYSYMBOL;
               evt->key_symbol = DIKS_PRINT;
               break;

          case XK_Break:
               evt->flags = DIEF_KEYSYMBOL;
               evt->key_symbol = DIKS_BREAK;
               break;

          default:
               return false;
     }

     return true;
}

�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/vnc.c�������������������������������������������������������������������0000644�0001750�0001750�00000012161�11245562152�013371� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <directfb.h>

#include <fusion/arena.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <direct/messages.h>

#include <rfb/rfb.h>
#include "vnc.h"
#include "primary.h"

#include <core/core_system.h>


DFB_CORE_SYSTEM( vnc )


DFBVNC *dfb_vnc = NULL;
CoreDFB *dfb_vnc_core = NULL;

static void
system_get_info( CoreSystemInfo *info )
{
     info->type = CORE_VNC;

     snprintf( info->name, DFB_CORE_SYSTEM_INFO_NAME_LENGTH, "VNC" );
}

static DFBResult
system_initialize( CoreDFB *core, void **data )
{
     CoreScreen *core_screen;

     D_ASSERT( dfb_vnc == NULL );

     dfb_vnc = (DFBVNC*) SHCALLOC( dfb_core_shmpool(core), 1, sizeof(DFBVNC) );
     if (!dfb_vnc) {
          D_ERROR( "DirectFB/VNC: Couldn't allocate shared memory!\n" );
          return D_OOSHM();
     }

     dfb_vnc_core = core;

     fusion_skirmish_init( &dfb_vnc->lock, "VNC System", dfb_core_world(core) );

     fusion_call_init( &dfb_vnc->call, dfb_vnc_call_handler, NULL, dfb_core_world(core) );

     core_screen = dfb_screens_register( NULL, NULL, &vncPrimaryScreenFuncs );

     dfb_layers_register( core_screen, NULL, &vncPrimaryLayerFuncs );

     fusion_arena_add_shared_field( dfb_core_arena( core ), "vnc", dfb_vnc );

     *data = dfb_vnc;

     return DFB_OK;
}

static DFBResult
system_join( CoreDFB *core, void **data )
{
     void       *ret;
     CoreScreen *core_screen;

     D_ASSERT( dfb_vnc == NULL );

     fusion_arena_get_shared_field( dfb_core_arena( core ), "vnc", &ret );

     dfb_vnc = ret;
     dfb_vnc_core = core;

     core_screen = dfb_screens_register( NULL, NULL, &vncPrimaryScreenFuncs );

     dfb_layers_register( core_screen, NULL, &vncPrimaryLayerFuncs );

     *data = dfb_vnc;

     return DFB_OK;
}

static DFBResult
system_shutdown( bool emergency )
{
     D_ASSERT( dfb_vnc != NULL );

     fusion_call_destroy( &dfb_vnc->call );

     fusion_skirmish_prevail( &dfb_vnc->lock );

     fusion_skirmish_destroy( &dfb_vnc->lock );

     SHFREE( dfb_core_shmpool(dfb_vnc_core), dfb_vnc );
     dfb_vnc = NULL;
     dfb_vnc_core = NULL;

     return DFB_OK;
}

static DFBResult
system_leave( bool emergency )
{
     D_ASSERT( dfb_vnc != NULL );

     dfb_vnc = NULL;
     dfb_vnc_core = NULL;

     return DFB_OK;
}

static DFBResult
system_suspend( void )
{
     return DFB_UNIMPLEMENTED;
}

static DFBResult
system_resume( void )
{
     return DFB_UNIMPLEMENTED;
}


static int
system_get_accelerator( void )
{
     return -1;
}

static VideoMode *
system_get_modes( void )
{
     return NULL;
}

static VideoMode *
system_get_current_mode( void )
{
     return NULL;
}


static volatile void *
system_map_mmio( unsigned int    offset,
                 int             length )
{
    return NULL;
}

static void
system_unmap_mmio( volatile void  *addr,
                   int             length )
{
}

static DFBResult
system_thread_init( void )
{
     return DFB_OK;
}

static bool
system_input_filter( CoreInputDevice *device,
                     DFBInputEvent   *event )
{
     return false;
}



static unsigned long
system_video_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_video_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_videoram_length( void )
{
     return 0;
}

static unsigned long
system_aux_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_aux_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_auxram_length( void )
{
     return 0;
}

static void
system_get_busid( int *ret_bus, int *ret_dev, int *ret_func )
{
     return;
}

static void
system_get_deviceid( unsigned int *ret_vendor_id,
                     unsigned int *ret_device_id )
{
     return;
}

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/Makefile.am�������������������������������������������������������������0000644�0001750�0001750�00000002023�11164361026�014464� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/systems/vnc

INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src		\
	$(VNC_CFLAGS)

systemsdir = $(MODULEDIR)/systems

if BUILD_STATIC
systems_DATA = libdirectfb_vnc.o
endif

systems_LTLIBRARIES = libdirectfb_vnc.la

inputdriversdir = $(MODULEDIR)/inputdrivers

if BUILD_STATIC
inputdrivers_DATA = libdirectfb_vncinput.o
endif
inputdrivers_LTLIBRARIES = libdirectfb_vncinput.la

libdirectfb_vnc_la_LDFLAGS = \
	$(VNC_LIBS)	\
	-avoid-version	\
	-module

libdirectfb_vnc_la_SOURCES = \
	primary.c	\
	primary.h	\
	vnc.c		\
	vnc.h

libdirectfb_vnc_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

libdirectfb_vncinput_la_LDFLAGS = \
	$(VNC_LIBS)	\
	-avoid-version	\
	-module

libdirectfb_vncinput_la_SOURCES = \
	vncinput.c

libdirectfb_vncinput_la_LIBADD = \
	$(top_builddir)/src/libdirectfb.la


include $(top_srcdir)/rules/libobject.make

�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/Makefile.in�������������������������������������������������������������0000644�0001750�0001750�00000054405�11307521506�014510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@


VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(top_srcdir)/rules/libobject.make
subdir = systems/vnc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(inputdriversdir)" \
	"$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(inputdriversdir)" \
	"$(DESTDIR)$(systemsdir)"
inputdriversLTLIBRARIES_INSTALL = $(INSTALL)
systemsLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(inputdrivers_LTLIBRARIES) $(systems_LTLIBRARIES)
libdirectfb_vnc_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_vnc_la_OBJECTS = primary.lo vnc.lo
libdirectfb_vnc_la_OBJECTS = $(am_libdirectfb_vnc_la_OBJECTS)
libdirectfb_vnc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_vnc_la_LDFLAGS) $(LDFLAGS) -o $@
libdirectfb_vncinput_la_DEPENDENCIES =  \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_vncinput_la_OBJECTS = vncinput.lo
libdirectfb_vncinput_la_OBJECTS =  \
	$(am_libdirectfb_vncinput_la_OBJECTS)
libdirectfb_vncinput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_vncinput_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
SOURCES = $(libdirectfb_vnc_la_SOURCES) \
	$(libdirectfb_vncinput_la_SOURCES)
DIST_SOURCES = $(libdirectfb_vnc_la_SOURCES) \
	$(libdirectfb_vncinput_la_SOURCES)
inputdriversDATA_INSTALL = $(INSTALL_DATA)
systemsDATA_INSTALL = $(INSTALL_DATA)
DATA = $(inputdrivers_DATA) $(systems_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src		\
	$(VNC_CFLAGS)

systemsdir = $(MODULEDIR)/systems
@BUILD_STATIC_TRUE@systems_DATA = libdirectfb_vnc.o
systems_LTLIBRARIES = libdirectfb_vnc.la
inputdriversdir = $(MODULEDIR)/inputdrivers
@BUILD_STATIC_TRUE@inputdrivers_DATA = libdirectfb_vncinput.o
inputdrivers_LTLIBRARIES = libdirectfb_vncinput.la
libdirectfb_vnc_la_LDFLAGS = \
	$(VNC_LIBS)	\
	-avoid-version	\
	-module

libdirectfb_vnc_la_SOURCES = \
	primary.c	\
	primary.h	\
	vnc.c		\
	vnc.h

libdirectfb_vnc_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

libdirectfb_vncinput_la_LDFLAGS = \
	$(VNC_LIBS)	\
	-avoid-version	\
	-module

libdirectfb_vncinput_la_SOURCES = \
	vncinput.c

libdirectfb_vncinput_la_LIBADD = \
	$(top_builddir)/src/libdirectfb.la

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/vnc/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/vnc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-inputdriversLTLIBRARIES: $(inputdrivers_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(inputdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdriversdir)"
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(inputdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(inputdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(inputdriversdir)/$$f"; \
	  else :; fi; \
	done

uninstall-inputdriversLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(inputdriversdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(inputdriversdir)/$$p"; \
	done

clean-inputdriversLTLIBRARIES:
	-test -z "$(inputdrivers_LTLIBRARIES)" || rm -f $(inputdrivers_LTLIBRARIES)
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
install-systemsLTLIBRARIES: $(systems_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	  else :; fi; \
	done

uninstall-systemsLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(systemsdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(systemsdir)/$$p"; \
	done

clean-systemsLTLIBRARIES:
	-test -z "$(systems_LTLIBRARIES)" || rm -f $(systems_LTLIBRARIES)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libdirectfb_vnc.la: $(libdirectfb_vnc_la_OBJECTS) $(libdirectfb_vnc_la_DEPENDENCIES) 
	$(libdirectfb_vnc_la_LINK) -rpath $(systemsdir) $(libdirectfb_vnc_la_OBJECTS) $(libdirectfb_vnc_la_LIBADD) $(LIBS)
libdirectfb_vncinput.la: $(libdirectfb_vncinput_la_OBJECTS) $(libdirectfb_vncinput_la_DEPENDENCIES) 
	$(libdirectfb_vncinput_la_LINK) -rpath $(inputdriversdir) $(libdirectfb_vncinput_la_OBJECTS) $(libdirectfb_vncinput_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primary.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vnc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vncinput.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-inputdriversDATA: $(inputdrivers_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(inputdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdriversdir)"
	@list='$(inputdrivers_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(inputdriversDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	  $(inputdriversDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(inputdriversdir)/$$f"; \
	done

uninstall-inputdriversDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(inputdrivers_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(inputdriversdir)/$$f"; \
	done
install-systemsDATA: $(systems_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(systemsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	  $(systemsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	done

uninstall-systemsDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(systemsdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(systemsdir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
	for dir in "$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-inputdriversLTLIBRARIES clean-libtool \
	clean-systemsLTLIBRARIES mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-inputdriversDATA \
	install-inputdriversLTLIBRARIES install-systemsDATA \
	install-systemsLTLIBRARIES

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-inputdriversDATA \
	uninstall-inputdriversLTLIBRARIES uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-inputdriversLTLIBRARIES clean-libtool \
	clean-systemsLTLIBRARIES ctags distclean distclean-compile \
	distclean-generic distclean-libtool distclean-tags distdir dvi \
	dvi-am html html-am info info-am install install-am \
	install-data install-data-am install-dvi install-dvi-am \
	install-exec install-exec-am install-html install-html-am \
	install-info install-info-am install-inputdriversDATA \
	install-inputdriversLTLIBRARIES install-man install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	install-systemsDATA install-systemsLTLIBRARIES installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-inputdriversDATA \
	uninstall-inputdriversLTLIBRARIES uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

%.o: .libs/%.a %.la
	rm -f $<.tmp/*.o
	if test -d $<.tmp; then rmdir $<.tmp; fi
	mkdir $<.tmp
	(cd $<.tmp && $(AR) x ../../$<)
	$(LD) -o $@ -r $<.tmp/*.o
	rm -f $<.tmp/*.o && rmdir $<.tmp

.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/vnc.h�������������������������������������������������������������������0000644�0001750�0001750�00000002623�11245562152�013400� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __VNC__VNC_H__
#define __VNC__VNC_H__

#include <fusion/call.h>
#include <fusion/lock.h>

typedef struct {
     FusionSkirmish  lock;
     FusionCall      call;

     CoreSurface    *primary;
     CoreDFB        *core;
     
} DFBVNC;


#endif

�������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/primary.h���������������������������������������������������������������0000644�0001750�0001750�00000003250�11245562152�014272� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SDL__PRIMARY_H__
#define __SDL__PRIMARY_H__

#include <fusion/call.h>

#include <core/layers.h>
#include <core/screens.h>

extern ScreenFuncs       vncPrimaryScreenFuncs;
extern DisplayLayerFuncs vncPrimaryLayerFuncs;

FusionCallHandlerResult
dfb_vnc_call_handler( int           caller,
                      int           call_arg,
                      void         *call_ptr,
                      void         *ctx,
                      unsigned int  serial,
                      int          *ret_val );

#endif

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/vnc/vncinput.c��������������������������������������������������������������0000644�0001750�0001750�00000006260�11164361026�014451� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

#include <directfb.h>

#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>

#include <core/input_driver.h>

DFB_INPUT_DRIVER( vncinput )

/* exported symbols */

/*
 * Return the number of available devices.
 * Called once during initialization of DirectFB.
 */
static int
driver_get_available( void )
{
     if (dfb_system_type() == CORE_VNC)
          return 1;

     return 0;
}

/*
 * Fill out general information about this driver.
 * Called once during initialization of DirectFB.
 */
static void
driver_get_info( InputDriverInfo *info )
{
     /* fill driver info structure */
     snprintf ( info->name,
                DFB_INPUT_DRIVER_INFO_NAME_LENGTH, "VNC Input Driver" );
     snprintf ( info->vendor,
                DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH, "Leonard Schneider" );

     info->version.major = 0;
     info->version.minor = 1;
}

/*
 * 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 )
{
     /* set device name */
     snprintf( info->desc.name,
               DFB_INPUT_DEVICE_DESC_NAME_LENGTH, "VNC Input" );

     /* set device vendor */
     snprintf( info->desc.vendor,
               DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "VNC" );

     /* set one of the primary input device IDs */
     info->prefered_id = DIDID_KEYBOARD;

     /* set type flags */
     info->desc.type   = /*DIDTF_JOYSTICK |*/ DIDTF_KEYBOARD| DIDTF_MOUSE;

     /* set capabilities */
     info->desc.caps   = DICAPS_ALL;

     /* set private data pointer */
     /* *driver_data = device;*/

     return DFB_OK;
}

/*
 * Fetch one entry from the device's keymap if supported.
 */
static DFBResult
driver_get_keymap_entry( CoreInputDevice           *device,
                         void                      *driver_data,
                         DFBInputDeviceKeymapEntry *entry )
{
     return DFB_UNSUPPORTED;
}

/*
 * End thread, close device and free private data.
 */
static void
driver_close_device( void *driver_data )
{
}

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522565�012521� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/primary.c���������������������������������������������������������������0000644�0001750�0001750�00000045541�11245562152�014272� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>

#include <directfb.h>

#include <fusion/fusion.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/surface_buffer.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>
#include <misc/util.h>

#include <direct/debug.h>
#include <direct/memcpy.h>
#include <direct/messages.h>
#include <direct/thread.h>

#include <SDL.h>

#include "sdl.h"
#include "primary.h"

D_DEBUG_DOMAIN( SDL_Screen,  "SDL/Screen",  "SDL System Screen" );
D_DEBUG_DOMAIN( SDL_Updates, "SDL/Updates", "SDL System Screen Updates" );

/******************************************************************************/

static DFBResult update_screen( int x, int y, int w, int h );

/******************************************************************************/

static DFBResult
primaryInitScreen( CoreScreen           *screen,
                   CoreGraphicsDevice   *device,
                   void                 *driver_data,
                   void                 *screen_data,
                   DFBScreenDescription *description )
{
     /* Set the screen capabilities. */
     description->caps = DSCCAPS_NONE;

     /* Set the screen name. */
     snprintf( description->name,
               DFB_SCREEN_DESC_NAME_LENGTH, "SDL Primary Screen" );

     return DFB_OK;
}

static DFBResult
primaryGetScreenSize( CoreScreen *screen,
                      void       *driver_data,
                      void       *screen_data,
                      int        *ret_width,
                      int        *ret_height )
{
     D_ASSERT( dfb_sdl != NULL );

     if (dfb_sdl->primary) {
          *ret_width  = dfb_sdl->primary->config.size.w;
          *ret_height = dfb_sdl->primary->config.size.w;
     }
     else {
          if (dfb_config->mode.width)
               *ret_width  = dfb_config->mode.width;
          else
               *ret_width  = 640;

          if (dfb_config->mode.height)
               *ret_height = dfb_config->mode.height;
          else
               *ret_height = 480;
     }

     return DFB_OK;
}

ScreenFuncs sdlPrimaryScreenFuncs = {
     .InitScreen    = primaryInitScreen,
     .GetScreenSize = primaryGetScreenSize,
};

/******************************************************************************/

static void * ScreenUpdateLoop( DirectThread *thread, void *arg );

/******************************************************************************/

static int
primaryLayerDataSize( void )
{
     return 0;
}

static int
primaryRegionDataSize( void )
{
     return 0;
}

static DFBResult
primaryInitLayer( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  DFBDisplayLayerDescription *description,
                  DFBDisplayLayerConfig      *config,
                  DFBColorAdjustment         *adjustment )
{
     /* set capabilities and type */
     description->caps = DLCAPS_SURFACE;
     description->type = DLTF_GRAPHICS;

     /* set name */
     snprintf( description->name,
               DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "SDL Primary Layer" );

     /* fill out the default configuration */
     config->flags       = DLCONF_WIDTH       | DLCONF_HEIGHT |
                           DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
     config->buffermode  = DLBM_FRONTONLY;

     if (dfb_config->mode.width)
          config->width  = dfb_config->mode.width;
     else
          config->width  = 640;

     if (dfb_config->mode.height)
          config->height = dfb_config->mode.height;
     else
          config->height = 480;

     if (dfb_config->mode.format != DSPF_UNKNOWN)
          config->pixelformat = dfb_config->mode.format;
     else if (dfb_config->mode.depth > 0)
          config->pixelformat = dfb_pixelformat_for_depth( dfb_config->mode.depth );
     else
          config->pixelformat = DSPF_RGB16;

     /* Initialize update lock and condition. */
     pthread_mutex_init( &dfb_sdl->update.lock, NULL );
     pthread_cond_init( &dfb_sdl->update.cond, NULL );

     /* Start update thread. */
     dfb_sdl->update.thread = direct_thread_create( DTT_OUTPUT, ScreenUpdateLoop, NULL, "Screen Update" );
     if (!dfb_sdl->update.thread)
          return DFB_FAILURE;

     return DFB_OK;
}

static DFBResult
primaryTestRegion( CoreLayer                  *layer,
                   void                       *driver_data,
                   void                       *layer_data,
                   CoreLayerRegionConfig      *config,
                   CoreLayerRegionConfigFlags *failed )
{
     CoreLayerRegionConfigFlags fail = 0;

     switch (config->buffermode) {
          case DLBM_FRONTONLY:
          case DLBM_BACKSYSTEM:
          case DLBM_BACKVIDEO:
               break;

          default:
               fail |= CLRCF_BUFFERMODE;
               break;
     }

     if (config->options)
          fail |= CLRCF_OPTIONS;

     if (failed)
          *failed = fail;

     if (fail)
          return DFB_UNSUPPORTED;

     return DFB_OK;
}

static DFBResult
primaryAddRegion( CoreLayer             *layer,
                  void                  *driver_data,
                  void                  *layer_data,
                  void                  *region_data,
                  CoreLayerRegionConfig *config )
{
     return DFB_OK;
}

static DFBResult
primarySetRegion( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  void                       *region_data,
                  CoreLayerRegionConfig      *config,
                  CoreLayerRegionConfigFlags  updated,
                  CoreSurface                *surface,
                  CorePalette                *palette,
                  CoreSurfaceBufferLock      *lock )
{
     if (surface) {
          pthread_mutex_lock( &dfb_sdl->update.lock );
          dfb_sdl->primary = surface;
          dfb_sdl->update.pending = false;
          pthread_mutex_unlock( &dfb_sdl->update.lock );
     }

     if (palette)
          dfb_sdl_set_palette( palette );

     return DFB_OK;
}

static DFBResult
primaryRemoveRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data )
{
     D_DEBUG_AT( SDL_Updates, "%s( %p )\n", __FUNCTION__, layer );

     D_DEBUG_AT( SDL_Updates, "  -> locking sdl lock...\n" );

     fusion_skirmish_prevail( &dfb_sdl->lock );

     D_DEBUG_AT( SDL_Updates, "  -> setting primary to NULL...\n" );

     dfb_sdl->primary = NULL;

     D_DEBUG_AT( SDL_Updates, "  -> unlocking sdl lock...\n" );

     fusion_skirmish_dismiss( &dfb_sdl->lock );

     D_DEBUG_AT( SDL_Updates, "  -> done.\n" );

     return DFB_OK;
}

static DFBResult
primaryFlipRegion( CoreLayer             *layer,
                   void                  *driver_data,
                   void                  *layer_data,
                   void                  *region_data,
                   CoreSurface           *surface,
                   DFBSurfaceFlipFlags    flags,
                   CoreSurfaceBufferLock *lock )
{
     dfb_surface_flip( surface, false );

     return dfb_sdl_update_screen( dfb_sdl_core, NULL );
}

static DFBResult
primaryUpdateRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data,
                     CoreSurface           *surface,
                     const DFBRegion       *update,
                     CoreSurfaceBufferLock *lock )
{
     if (update) {
          DFBRegion region = *update;

          return dfb_sdl_update_screen( dfb_sdl_core, ®ion );
     }

     return dfb_sdl_update_screen( dfb_sdl_core, NULL );
}

DisplayLayerFuncs sdlPrimaryLayerFuncs = {
     .LayerDataSize     = primaryLayerDataSize,
     .RegionDataSize    = primaryRegionDataSize,
     .InitLayer         = primaryInitLayer,

     .TestRegion        = primaryTestRegion,
     .AddRegion         = primaryAddRegion,
     .SetRegion         = primarySetRegion,
     .RemoveRegion      = primaryRemoveRegion,
     .FlipRegion        = primaryFlipRegion,
     .UpdateRegion      = primaryUpdateRegion,
};

/******************************************************************************/

static DFBResult
update_screen( int x, int y, int w, int h )
{
#if 0
     int                    i, n;
     void                  *dst;
     void                  *src;
     DFBResult              ret;
     CoreSurface           *surface;
     CoreSurfaceBuffer     *buffer;
     CoreSurfaceBufferLock  lock;
     u16                   *src16, *dst16;
     u8                    *src8;
#endif

     D_DEBUG_AT( SDL_Updates, "%s( %d, %d, %d, %d )\n", __FUNCTION__, x, y, w, h );

     D_DEBUG_AT( SDL_Updates, "  -> locking sdl lock...\n" );

     fusion_skirmish_prevail( &dfb_sdl->lock );
#if 0
     surface = dfb_sdl->primary;
     D_MAGIC_ASSERT_IF( surface, CoreSurface );

     D_DEBUG_AT( SDL_Updates, "  -> primary is %p\n", surface );

     if (!surface) {
          D_DEBUG_AT( SDL_Updates, "  -> unlocking sdl lock...\n" );
          fusion_skirmish_dismiss( &dfb_sdl->lock );
          D_DEBUG_AT( SDL_Updates, "  -> done.\n" );
          return DFB_OK;
     }

     buffer = dfb_surface_get_buffer( surface, CSBR_FRONT );

     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     D_DEBUG_AT( SDL_Updates, "  -> locking sdl surface...\n" );

     if (SDL_LockSurface( screen ) < 0) {
          D_ERROR( "DirectFB/SDL: "
                   "Couldn't lock the display surface: %s\n", SDL_GetError() );
          fusion_skirmish_dismiss( &dfb_sdl->lock );
          return DFB_FAILURE;
     }

     D_DEBUG_AT( SDL_Updates, "  -> locking dfb surface...\n" );

     ret = dfb_surface_buffer_lock( buffer, CSAF_CPU_READ, &lock );
     if (ret) {
          D_ERROR( "DirectFB/SDL: Couldn't lock layer surface: %s\n",
                   DirectFBErrorString( ret ) );
          SDL_UnlockSurface(screen);
          fusion_skirmish_dismiss( &dfb_sdl->lock );
          return ret;
     }

     src = lock.addr;
     dst = screen->pixels;

     src += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * lock.pitch;
     dst += DFB_BYTES_PER_LINE( surface->config.format, x ) + y * screen->pitch;

     D_DEBUG_AT( SDL_Updates, "  -> copying pixels...\n" );

     switch (screen->format->BitsPerPixel) {
          case 16:
               dfb_convert_to_rgb16( surface->config.format,
                                     src, lock.pitch, surface->config.size.h,
                                     dst, screen->pitch, w, h );
               break;

          default:
               direct_memcpy( dst, src, DFB_BYTES_PER_LINE( surface->config.format, w ) );
     }

     D_DEBUG_AT( SDL_Updates, "  -> unlocking dfb surface...\n" );

     dfb_surface_buffer_unlock( &lock );

     D_DEBUG_AT( SDL_Updates, "  -> unlocking sdl surface...\n" );

     SDL_UnlockSurface( screen );
#endif
     D_DEBUG_AT( SDL_Updates, "  -> calling SDL_UpdateRect()...\n" );

     SDL_UpdateRect( dfb_sdl->screen, x, y, w, h );

     D_DEBUG_AT( SDL_Updates, "  -> unlocking sdl lock...\n" );

     fusion_skirmish_dismiss( &dfb_sdl->lock );

     D_DEBUG_AT( SDL_Updates, "  -> done.\n" );

     return DFB_OK;
}

static void *
ScreenUpdateLoop( DirectThread *thread, void *arg )
{
     pthread_mutex_lock( &dfb_sdl->update.lock );

     D_DEBUG_AT( SDL_Updates, "Entering %s()...\n", __FUNCTION__ );

     while (!dfb_sdl->update.quit) {
          if (dfb_sdl->update.pending) {
               DFBRectangle update = DFB_RECTANGLE_INIT_FROM_REGION( &dfb_sdl->update.region );

               dfb_sdl->update.pending = false;

               D_DEBUG_AT( SDL_Updates, "Got update %d,%d - %dx%d...\n", DFB_RECTANGLE_VALS( &update ) );

               pthread_mutex_unlock( &dfb_sdl->update.lock );


               update_screen( update.x, update.y, update.w, update.h );


               pthread_mutex_lock( &dfb_sdl->update.lock );
          }
          else
               pthread_cond_wait( &dfb_sdl->update.cond, &dfb_sdl->update.lock );
     }

     D_DEBUG_AT( SDL_Updates, "Returning from %s()...\n", __FUNCTION__ );

     pthread_mutex_unlock( &dfb_sdl->update.lock );

     return NULL;
}

/******************************************************************************/

typedef enum {
     SDL_SET_VIDEO_MODE,
     SDL_UPDATE_SCREEN,
     SDL_SET_PALETTE
} DFBSDLCall;

static inline int
get_pixelformat_target_depth( DFBSurfacePixelFormat format )
{
     switch (format) {
          case DSPF_NV16:
               return 16;

          default:
               break;
     }

     return DFB_BITS_PER_PIXEL( format );
}

static DFBResult
dfb_sdl_set_video_mode_handler( CoreSurfaceConfig *config )
{
     int          depth = get_pixelformat_target_depth( config->format );
     Uint32       flags = SDL_HWSURFACE | SDL_RESIZABLE;// | SDL_ASYNCBLIT | SDL_FULLSCREEN;
     SDL_Surface *screen;

     if (config->caps & DSCAPS_FLIPPING)
          flags |= SDL_DOUBLEBUF;

     fusion_skirmish_prevail( &dfb_sdl->lock );

     D_DEBUG_AT( SDL_Screen, "  -> SDL_SetVideoMode( %dx%d, %d, 0x%08x )\n",
                 config->size.w, config->size.h, DFB_BITS_PER_PIXEL(config->format), flags );

     /* Set video mode */
     screen = SDL_SetVideoMode( config->size.w, config->size.h, depth, flags );
     if (!screen) {
          D_ERROR( "DirectFB/SDL: Couldn't set %dx%dx%d video mode: %s\n",
                   config->size.w, config->size.h, depth, SDL_GetError());

          fusion_skirmish_dismiss( &dfb_sdl->lock );

          return DFB_FAILURE;
     }

     dfb_sdl->screen = screen;

     /* Hide SDL's cursor */
     SDL_ShowCursor( SDL_DISABLE );

     fusion_skirmish_dismiss( &dfb_sdl->lock );

     return DFB_OK;
}

static DFBResult
dfb_sdl_update_screen_handler( const DFBRegion *region )
{
     DFBRegion    update;
     CoreSurface *surface = dfb_sdl->primary;

     DFB_REGION_ASSERT_IF( region );

     if (region)
          update = *region;
     else {
          update.x1 = 0;
          update.y1 = 0;
          update.x2 = surface->config.size.w - 1;
          update.y2 = surface->config.size.h - 1;
     }

#if 0
     pthread_mutex_lock( &dfb_sdl->update.lock );

     if (dfb_sdl->update.pending)
          dfb_region_region_union( &dfb_sdl->update.region, &update );
     else {
          dfb_sdl->update.region  = update;
          dfb_sdl->update.pending = true;
     }

     pthread_cond_signal( &dfb_sdl->update.cond );

     pthread_mutex_unlock( &dfb_sdl->update.lock );
#else
     if (surface->config.caps & DSCAPS_FLIPPING)
          SDL_Flip( dfb_sdl->screen );
     else
          SDL_UpdateRect( dfb_sdl->screen, DFB_RECTANGLE_VALS_FROM_REGION(&update) );
#endif

     return DFB_OK;
}

static DFBResult
dfb_sdl_set_palette_handler( CorePalette *palette )
{
     unsigned int i;
     SDL_Color    colors[palette->num_entries];

     for (i=0; i<palette->num_entries; i++) {
          colors[i].r = palette->entries[i].r;
          colors[i].g = palette->entries[i].g;
          colors[i].b = palette->entries[i].b;
     }

     fusion_skirmish_prevail( &dfb_sdl->lock );

     SDL_SetColors( dfb_sdl->screen, colors, 0, palette->num_entries );

     fusion_skirmish_dismiss( &dfb_sdl->lock );

     return DFB_OK;
}

FusionCallHandlerResult
dfb_sdl_call_handler( int           caller,
                      int           call_arg,
                      void         *call_ptr,
                      void         *ctx,
                      unsigned int  serial,
                      int          *ret_val )
{
     switch (call_arg) {
          case SDL_SET_VIDEO_MODE:
               *ret_val = dfb_sdl_set_video_mode_handler( call_ptr );
               break;

          case SDL_UPDATE_SCREEN:
               *ret_val = dfb_sdl_update_screen_handler( call_ptr );
               break;

          case SDL_SET_PALETTE:
               *ret_val = dfb_sdl_set_palette_handler( call_ptr );
               break;

          default:
               D_BUG( "unknown call" );
               *ret_val = DFB_BUG;
               break;
     }

     return FCHR_RETURN;
}

DFBResult
dfb_sdl_set_video_mode( CoreDFB *core, CoreSurfaceConfig *config )
{
     int                ret;
     CoreSurfaceConfig *tmp = NULL;

     D_ASSERT( config != NULL );

     if (dfb_core_is_master( core ))
          return dfb_sdl_set_video_mode_handler( config );

     if (!fusion_is_shared( dfb_core_world(core), config )) {
          tmp = SHMALLOC( dfb_core_shmpool(core), sizeof(CoreSurfaceConfig) );
          if (!tmp)
               return D_OOSHM();

          direct_memcpy( tmp, config, sizeof(CoreSurfaceConfig) );
     }

     fusion_call_execute( &dfb_sdl->call, FCEF_NONE, SDL_SET_VIDEO_MODE,
                          tmp ? tmp : config, &ret );

     if (tmp)
          SHFREE( dfb_core_shmpool(core), tmp );

     return ret;
}

DFBResult
dfb_sdl_update_screen( CoreDFB *core, DFBRegion *region )
{
     int        ret;
     DFBRegion *tmp = NULL;

     if (dfb_core_is_master( core ))
          return dfb_sdl_update_screen_handler( region );

     if (region) {
          tmp = SHMALLOC( dfb_core_shmpool(core), sizeof(DFBRegion) );
          if (!tmp)
               return D_OOSHM();

          direct_memcpy( tmp, region, sizeof(DFBRegion) );
     }

     fusion_call_execute( &dfb_sdl->call, FCEF_NONE, SDL_UPDATE_SCREEN, tmp ? tmp : region, &ret );

     if (tmp)
          SHFREE( dfb_core_shmpool(core), tmp );

     return DFB_OK;
}

DFBResult
dfb_sdl_set_palette( CorePalette *palette )
{
     int ret;

     fusion_call_execute( &dfb_sdl->call, FCEF_NONE, SDL_SET_PALETTE, palette, &ret );

     return ret;
}

���������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/Makefile.am�������������������������������������������������������������0000644�0001750�0001750�00000003121�11164361026�014460� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/systems/sdl

INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src		\
	$(SDL_CFLAGS)


systemsdir = $(MODULEDIR)/systems

if BUILD_STATIC
systems_DATA = libdirectfb_sdl.o
endif

systems_LTLIBRARIES = libdirectfb_sdl.la


inputdriversdir = $(MODULEDIR)/inputdrivers

if BUILD_STATIC
inputdrivers_DATA = libdirectfb_sdlinput.o
endif

inputdrivers_LTLIBRARIES = libdirectfb_sdlinput.la


gfxdriversdir = $(MODULEDIR)/gfxdrivers

if BUILD_STATIC
gfxdrivers_DATA = libdirectfb_sdlgraphics.o
endif

gfxdrivers_LTLIBRARIES = libdirectfb_sdlgraphics.la


libdirectfb_sdl_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_sdl_la_SOURCES = \
	primary.c		\
	primary.h		\
	sdl.c			\
	sdl.h			\
	sdl_surface_pool.c

libdirectfb_sdl_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la \
	$(SDL_LIBS)


libdirectfb_sdlinput_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_sdlinput_la_SOURCES = \
	sdlinput.c

libdirectfb_sdlinput_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la \
	$(SDL_LIBS)


libdirectfb_sdlgraphics_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_sdlgraphics_la_SOURCES = \
	sdlgfx.c

libdirectfb_sdlgraphics_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la \
	$(SDL_LIBS)


include $(top_srcdir)/rules/libobject.make

�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/Makefile.in�������������������������������������������������������������0000644�0001750�0001750�00000064631�11307521506�014506� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@


VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(top_srcdir)/rules/libobject.make
subdir = systems/sdl
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(gfxdriversdir)" \
	"$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)" \
	"$(DESTDIR)$(gfxdriversdir)" "$(DESTDIR)$(inputdriversdir)" \
	"$(DESTDIR)$(systemsdir)"
gfxdriversLTLIBRARIES_INSTALL = $(INSTALL)
inputdriversLTLIBRARIES_INSTALL = $(INSTALL)
systemsLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(gfxdrivers_LTLIBRARIES) $(inputdrivers_LTLIBRARIES) \
	$(systems_LTLIBRARIES)
am__DEPENDENCIES_1 =
libdirectfb_sdl_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1)
am_libdirectfb_sdl_la_OBJECTS = primary.lo sdl.lo sdl_surface_pool.lo
libdirectfb_sdl_la_OBJECTS = $(am_libdirectfb_sdl_la_OBJECTS)
libdirectfb_sdl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_sdl_la_LDFLAGS) $(LDFLAGS) -o $@
libdirectfb_sdlgraphics_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1)
am_libdirectfb_sdlgraphics_la_OBJECTS = sdlgfx.lo
libdirectfb_sdlgraphics_la_OBJECTS =  \
	$(am_libdirectfb_sdlgraphics_la_OBJECTS)
libdirectfb_sdlgraphics_la_LINK = $(LIBTOOL) --tag=CC \
	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
	$(AM_CFLAGS) $(CFLAGS) $(libdirectfb_sdlgraphics_la_LDFLAGS) \
	$(LDFLAGS) -o $@
libdirectfb_sdlinput_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1)
am_libdirectfb_sdlinput_la_OBJECTS = sdlinput.lo
libdirectfb_sdlinput_la_OBJECTS =  \
	$(am_libdirectfb_sdlinput_la_OBJECTS)
libdirectfb_sdlinput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_sdlinput_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
SOURCES = $(libdirectfb_sdl_la_SOURCES) \
	$(libdirectfb_sdlgraphics_la_SOURCES) \
	$(libdirectfb_sdlinput_la_SOURCES)
DIST_SOURCES = $(libdirectfb_sdl_la_SOURCES) \
	$(libdirectfb_sdlgraphics_la_SOURCES) \
	$(libdirectfb_sdlinput_la_SOURCES)
gfxdriversDATA_INSTALL = $(INSTALL_DATA)
inputdriversDATA_INSTALL = $(INSTALL_DATA)
systemsDATA_INSTALL = $(INSTALL_DATA)
DATA = $(gfxdrivers_DATA) $(inputdrivers_DATA) $(systems_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src		\
	$(SDL_CFLAGS)

systemsdir = $(MODULEDIR)/systems
@BUILD_STATIC_TRUE@systems_DATA = libdirectfb_sdl.o
systems_LTLIBRARIES = libdirectfb_sdl.la
inputdriversdir = $(MODULEDIR)/inputdrivers
@BUILD_STATIC_TRUE@inputdrivers_DATA = libdirectfb_sdlinput.o
inputdrivers_LTLIBRARIES = libdirectfb_sdlinput.la
gfxdriversdir = $(MODULEDIR)/gfxdrivers
@BUILD_STATIC_TRUE@gfxdrivers_DATA = libdirectfb_sdlgraphics.o
gfxdrivers_LTLIBRARIES = libdirectfb_sdlgraphics.la
libdirectfb_sdl_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_sdl_la_SOURCES = \
	primary.c		\
	primary.h		\
	sdl.c			\
	sdl.h			\
	sdl_surface_pool.c

libdirectfb_sdl_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la \
	$(SDL_LIBS)

libdirectfb_sdlinput_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_sdlinput_la_SOURCES = \
	sdlinput.c

libdirectfb_sdlinput_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la \
	$(SDL_LIBS)

libdirectfb_sdlgraphics_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_sdlgraphics_la_SOURCES = \
	sdlgfx.c

libdirectfb_sdlgraphics_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la \
	$(SDL_LIBS)

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/sdl/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/sdl/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-gfxdriversLTLIBRARIES: $(gfxdrivers_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(gfxdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(gfxdriversdir)"
	@list='$(gfxdrivers_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(gfxdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(gfxdriversdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(gfxdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(gfxdriversdir)/$$f"; \
	  else :; fi; \
	done

uninstall-gfxdriversLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(gfxdrivers_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(gfxdriversdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(gfxdriversdir)/$$p"; \
	done

clean-gfxdriversLTLIBRARIES:
	-test -z "$(gfxdrivers_LTLIBRARIES)" || rm -f $(gfxdrivers_LTLIBRARIES)
	@list='$(gfxdrivers_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
install-inputdriversLTLIBRARIES: $(inputdrivers_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(inputdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdriversdir)"
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(inputdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(inputdriversLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(inputdriversdir)/$$f"; \
	  else :; fi; \
	done

uninstall-inputdriversLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(inputdriversdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(inputdriversdir)/$$p"; \
	done

clean-inputdriversLTLIBRARIES:
	-test -z "$(inputdrivers_LTLIBRARIES)" || rm -f $(inputdrivers_LTLIBRARIES)
	@list='$(inputdrivers_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
install-systemsLTLIBRARIES: $(systems_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	  else :; fi; \
	done

uninstall-systemsLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(systemsdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(systemsdir)/$$p"; \
	done

clean-systemsLTLIBRARIES:
	-test -z "$(systems_LTLIBRARIES)" || rm -f $(systems_LTLIBRARIES)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libdirectfb_sdl.la: $(libdirectfb_sdl_la_OBJECTS) $(libdirectfb_sdl_la_DEPENDENCIES) 
	$(libdirectfb_sdl_la_LINK) -rpath $(systemsdir) $(libdirectfb_sdl_la_OBJECTS) $(libdirectfb_sdl_la_LIBADD) $(LIBS)
libdirectfb_sdlgraphics.la: $(libdirectfb_sdlgraphics_la_OBJECTS) $(libdirectfb_sdlgraphics_la_DEPENDENCIES) 
	$(libdirectfb_sdlgraphics_la_LINK) -rpath $(gfxdriversdir) $(libdirectfb_sdlgraphics_la_OBJECTS) $(libdirectfb_sdlgraphics_la_LIBADD) $(LIBS)
libdirectfb_sdlinput.la: $(libdirectfb_sdlinput_la_OBJECTS) $(libdirectfb_sdlinput_la_DEPENDENCIES) 
	$(libdirectfb_sdlinput_la_LINK) -rpath $(inputdriversdir) $(libdirectfb_sdlinput_la_OBJECTS) $(libdirectfb_sdlinput_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primary.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdl_surface_pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdlgfx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdlinput.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-gfxdriversDATA: $(gfxdrivers_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(gfxdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(gfxdriversdir)"
	@list='$(gfxdrivers_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(gfxdriversDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(gfxdriversdir)/$$f'"; \
	  $(gfxdriversDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(gfxdriversdir)/$$f"; \
	done

uninstall-gfxdriversDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(gfxdrivers_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(gfxdriversdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(gfxdriversdir)/$$f"; \
	done
install-inputdriversDATA: $(inputdrivers_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(inputdriversdir)" || $(MKDIR_P) "$(DESTDIR)$(inputdriversdir)"
	@list='$(inputdrivers_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(inputdriversDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	  $(inputdriversDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(inputdriversdir)/$$f"; \
	done

uninstall-inputdriversDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(inputdrivers_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(inputdriversdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(inputdriversdir)/$$f"; \
	done
install-systemsDATA: $(systems_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(systemsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	  $(systemsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	done

uninstall-systemsDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(systemsdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(systemsdir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
	for dir in "$(DESTDIR)$(gfxdriversdir)" "$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(gfxdriversdir)" "$(DESTDIR)$(inputdriversdir)" "$(DESTDIR)$(systemsdir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-gfxdriversLTLIBRARIES \
	clean-inputdriversLTLIBRARIES clean-libtool \
	clean-systemsLTLIBRARIES mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-gfxdriversDATA install-gfxdriversLTLIBRARIES \
	install-inputdriversDATA install-inputdriversLTLIBRARIES \
	install-systemsDATA install-systemsLTLIBRARIES

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-gfxdriversDATA uninstall-gfxdriversLTLIBRARIES \
	uninstall-inputdriversDATA uninstall-inputdriversLTLIBRARIES \
	uninstall-systemsDATA uninstall-systemsLTLIBRARIES

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-gfxdriversLTLIBRARIES clean-inputdriversLTLIBRARIES \
	clean-libtool clean-systemsLTLIBRARIES ctags distclean \
	distclean-compile distclean-generic distclean-libtool \
	distclean-tags distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am \
	install-gfxdriversDATA install-gfxdriversLTLIBRARIES \
	install-html install-html-am install-info install-info-am \
	install-inputdriversDATA install-inputdriversLTLIBRARIES \
	install-man install-pdf install-pdf-am install-ps \
	install-ps-am install-strip install-systemsDATA \
	install-systemsLTLIBRARIES installcheck installcheck-am \
	installdirs maintainer-clean maintainer-clean-generic \
	mostlyclean mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
	uninstall-am uninstall-gfxdriversDATA \
	uninstall-gfxdriversLTLIBRARIES uninstall-inputdriversDATA \
	uninstall-inputdriversLTLIBRARIES uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

%.o: .libs/%.a %.la
	rm -f $<.tmp/*.o
	if test -d $<.tmp; then rmdir $<.tmp; fi
	mkdir $<.tmp
	(cd $<.tmp && $(AR) x ../../$<)
	$(LD) -o $@ -r $<.tmp/*.o
	rm -f $<.tmp/*.o && rmdir $<.tmp

.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
�������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/sdlgfx.c����������������������������������������������������������������0000644�0001750�0001750�00000020305�11245562152�014065� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

#include <directfb.h>

#include <SDL.h>

#include <core/coredefs.h>
#include <core/coretypes.h>

#include <core/state.h>
#include <core/gfxcard.h>
#include <core/windows.h>
#include <core/layers.h>
#include <core/screens.h>
#include <core/surface.h>

#include <gfx/convert.h>

#include <core/graphics_driver.h>

DFB_GRAPHICS_DRIVER( sdlgfx )

#include "sdl.h"

/* FIXME: support for destination color keying */

#define SDL_DRAWING_FLAGS \
               (DSDRAW_NOFX)

#define SDL_DRAWING_FUNCTIONS \
               (DFXL_FILLRECTANGLE)

#define SDL_BLITTING_FLAGS \
               (DSBLIT_SRC_COLORKEY)

#define SDL_BLITTING_FUNCTIONS \
               (DFXL_BLIT)

D_DEBUG_DOMAIN( SDL_GFX, "SDL/Graphics", "SDL Graphics" );

typedef struct {
} SDLDriverData;

typedef struct {
     SDL_Surface *dest;
     SDL_Surface *source;

     u32          color;

     bool         color_valid;
     bool         key_valid;
} SDLDeviceData;


static DFBResult sdlEngineSync( void *drv, void *dev )
{
     return DFB_OK;
}

static void sdlCheckState( void *drv, void *dev,
                           CardState *state, DFBAccelerationMask accel )
{
     /* check destination format first */
     switch (state->destination->config.format) {
          case DSPF_RGB16:
          case DSPF_RGB32:
               break;
          default:
               return;
     }

     if (DFB_DRAWING_FUNCTION( accel )) {
          /* if there are no other drawing flags than the supported */
          if (state->drawingflags & ~SDL_DRAWING_FLAGS)
               return;

          state->accel |= SDL_DRAWING_FUNCTIONS;
     }
     else {
          /* if there are no other blitting flags than the supported
             and the source and destination formats are the same */
          if (state->blittingflags & ~SDL_BLITTING_FLAGS)
               return;

          /* check source format */
          switch (state->source->config.format) {
               case DSPF_RGB16:
               case DSPF_RGB32:
                    break;
               default:
                    return;
          }

          state->accel |= SDL_BLITTING_FUNCTIONS;
     }
}

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;
}

static bool sdlFillRectangle( void *drv, void *dev, DFBRectangle *rect )
{
     SDLDeviceData *sdev = (SDLDeviceData*) dev;
     SDL_Rect       dr;

     dr.x = rect->x;
     dr.y = rect->y;
     dr.w = rect->w;
     dr.h = rect->h;

     return SDL_FillRect( sdev->dest, &dr, sdev->color ) == 0;
}

static bool sdlBlit( void *drv, void *dev, DFBRectangle *rect, int dx, int dy )
{
     SDLDeviceData *sdev = (SDLDeviceData*) dev;
     SDL_Rect       sr, dr;

     D_DEBUG_AT( SDL_GFX, "%s()\n", __FUNCTION__ );

     sr.x = rect->x;
     sr.y = rect->y;
     sr.w = rect->w;
     sr.h = rect->h;

     dr.x = dx;
     dr.y = dy;
     dr.w = rect->w;
     dr.h = rect->h;

     return SDL_BlitSurface( sdev->source, &sr, sdev->dest, &dr ) == 0;
}


/* exported symbols */

static int
driver_probe( CoreGraphicsDevice *device )
{
     return dfb_system_type() == CORE_SDL;
}

static void
driver_get_info( CoreGraphicsDevice *device,
                 GraphicsDriverInfo *info )
{
     /* fill driver info structure */
     snprintf( info->name,
               DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH,
               "SDL Graphics Driver" );

     snprintf( info->vendor,
               DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH,
               "directfb.org" );

     info->version.major = 0;
     info->version.minor = 1;

     info->driver_data_size = sizeof (SDLDriverData);
     info->device_data_size = sizeof (SDLDeviceData);
}

static DFBResult
driver_init_driver( CoreGraphicsDevice  *device,
                    GraphicsDeviceFuncs *funcs,
                    void                *driver_data,
                    void                *device_data,
                    CoreDFB             *core )
{
     /* fill acceleration function table */
     funcs->EngineSync    = sdlEngineSync;
     funcs->CheckState    = sdlCheckState;
     funcs->SetState      = sdlSetState;

     funcs->FillRectangle = sdlFillRectangle;
     funcs->Blit          = sdlBlit;

     return DFB_OK;
}

static DFBResult
driver_init_device( CoreGraphicsDevice *device,
                    GraphicsDeviceInfo *device_info,
                    void               *driver_data,
                    void               *device_data )
{
     /* fill device info */
     snprintf( device_info->name,
               DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "Graphics" );

     snprintf( device_info->vendor,
               DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "SDL" );


     device_info->caps.flags    = CCF_READSYSMEM;
     device_info->caps.accel    = SDL_DRAWING_FUNCTIONS |
                                  SDL_BLITTING_FUNCTIONS;
     device_info->caps.drawing  = SDL_DRAWING_FLAGS;
     device_info->caps.blitting = SDL_BLITTING_FLAGS;

     return DFB_OK;
}

static void
driver_close_device( CoreGraphicsDevice *device,
                     void               *driver_data,
                     void               *device_data )
{
}

static void
driver_close_driver( CoreGraphicsDevice *device,
                     void               *driver_data )
{
}

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/sdl_surface_pool.c������������������������������������������������������0000644�0001750�0001750�00000025300�11245562152�016121� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <SDL.h>

#include <direct/debug.h>
#include <direct/mem.h>

#include <core/surface_pool.h>

#include <gfx/convert.h>

#include <directfb_util.h>

#include "sdl.h"

D_DEBUG_DOMAIN( SDL_Pool, "SDL/Pool", "SDL Surface Pool" );

/**********************************************************************************************************************/

typedef struct {
} SDLPoolData;

typedef struct {
     int          magic;

     SDL_Surface *sdl_surf;
} SDLAllocationData;

/**********************************************************************************************************************/

static int
sdlPoolDataSize( void )
{
     return sizeof(SDLPoolData);
}

static int
sdlAllocationDataSize( void )
{
     return sizeof(SDLAllocationData);
}

static DFBResult
sdlInitPool( CoreDFB                    *core,
             CoreSurfacePool            *pool,
             void                       *pool_data,
             void                       *pool_local,
             void                       *system_data,
             CoreSurfacePoolDescription *ret_desc )
{
     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_ASSERT( ret_desc != NULL );

     ret_desc->caps     = CSPCAPS_NONE;
     ret_desc->access   = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE;
     ret_desc->types    = CSTF_LAYER | CSTF_WINDOW | CSTF_CURSOR | CSTF_FONT | CSTF_SHARED | CSTF_EXTERNAL;
     ret_desc->priority = CSPP_PREFERED;

     snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "SDL" );

     return DFB_OK;
}

static DFBResult
sdlDestroyPool( CoreSurfacePool *pool,
                void            *pool_data,
                void            *pool_local )
{
     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );

     return DFB_OK;
}

static DFBResult
sdlTestConfig( CoreSurfacePool         *pool,
               void                    *pool_data,
               void                    *pool_local,
               CoreSurfaceBuffer       *buffer,
               const CoreSurfaceConfig *config )
{
     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     switch (config->format) {
          case DSPF_A8:
          case DSPF_RGB16:
          case DSPF_RGB32:
          case DSPF_ARGB:
               break;

          default:
               return DFB_UNSUPPORTED;
     }

     return DFB_OK;
}

static DFBResult
sdlAllocateBuffer( CoreSurfacePool       *pool,
                   void                  *pool_data,
                   void                  *pool_local,
                   CoreSurfaceBuffer     *buffer,
                   CoreSurfaceAllocation *allocation,
                   void                  *alloc_data )
{
     DFBResult          ret;
     CoreSurface       *surface;
     SDLAllocationData *alloc = alloc_data;

     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     if (surface->type & CSTF_LAYER) {
          dfb_sdl->screen = NULL; /* clear? */

          ret = dfb_sdl_set_video_mode( dfb_sdl_core, &surface->config );
          if (ret) {
               D_DERROR( ret, "SDL/Surface: dfb_sdl_set_video_mode() failed!\n" );
               return ret;
          }

          D_ASSERT( dfb_sdl->screen != NULL );

          if (!dfb_sdl->screen) {
               D_ERROR( "SDL/Surface: No screen surface!?\n" );
               return DFB_BUG;
          }

          alloc->sdl_surf = dfb_sdl->screen;

          D_DEBUG_AT( SDL_Pool, "  -> screen surface  %dx%d, %d, 0x%08x, pitch %d\n",
                      dfb_sdl->screen->w, dfb_sdl->screen->h, dfb_sdl->screen->format->BitsPerPixel,
                      dfb_sdl->screen->flags, dfb_sdl->screen->pitch );

          allocation->flags |= CSALF_ONEFORALL;
     }
     else {
          DFBSurfacePixelFormat  format = surface->config.format;
          Uint32                 flags  = SDL_HWSURFACE;// | SDL_ASYNCBLIT | SDL_FULLSCREEN;
          Uint32                 rmask;
          Uint32                 gmask;
          Uint32                 bmask;
          Uint32                 amask;

          if (surface->config.caps & DSCAPS_FLIPPING)
               flags |= SDL_DOUBLEBUF;

          switch (format) {
               case DSPF_A8:
                    rmask = 0x00;
                    gmask = 0x00;
                    bmask = 0x00;
                    amask = 0xff;
                    break;

               case DSPF_RGB16:
                    rmask = 0xf800;
                    gmask = 0x07e0;
                    bmask = 0x001f;
                    amask = 0x0000;
                    break;

               case DSPF_RGB32:
                    rmask = 0x00ff0000;
                    gmask = 0x0000ff00;
                    bmask = 0x000000ff;
                    amask = 0x00000000;
                    break;

               case DSPF_ARGB:
                    rmask = 0x00ff0000;
                    gmask = 0x0000ff00;
                    bmask = 0x000000ff;
                    amask = 0xff000000;
                    break;

               default:
                    D_ERROR( "SDL/Surface: %s() has no support for %s!\n",
                             __FUNCTION__, dfb_pixelformat_name(format) );
                    return DFB_UNSUPPORTED;
          }

          D_DEBUG_AT( SDL_Pool, "  -> SDL_CreateRGBSurface( 0x%08x, "
                      "%dx%d, %d, 0x%08x, 0x%08x, 0x%08x, 0x%08x )\n",
                      flags, surface->config.size.w, surface->config.size.h,
                      DFB_BITS_PER_PIXEL(format), rmask, gmask, bmask, amask );

          alloc->sdl_surf = SDL_CreateRGBSurface( flags,
                                                  surface->config.size.w,
                                                  surface->config.size.h,
                                                  DFB_BITS_PER_PIXEL(format),
                                                  rmask, gmask, bmask, amask );
          if (!alloc->sdl_surf) {
               D_ERROR( "SDL/Surface: SDL_CreateRGBSurface( 0x%08x, "
                        "%dx%d, %d, 0x%08x, 0x%08x, 0x%08x, 0x%08x ) failed!\n",
                        flags, surface->config.size.w, surface->config.size.h,
                        DFB_BITS_PER_PIXEL(format), rmask, gmask, bmask, amask );

               return DFB_FAILURE;
          }
     }

     D_MAGIC_SET( alloc, SDLAllocationData );

     return DFB_OK;
}

static DFBResult
sdlDeallocateBuffer( CoreSurfacePool       *pool,
                     void                  *pool_data,
                     void                  *pool_local,
                     CoreSurfaceBuffer     *buffer,
                     CoreSurfaceAllocation *allocation,
                     void                  *alloc_data )
{
     SDLAllocationData *alloc = alloc_data;

     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( alloc, SDLAllocationData );

     SDL_FreeSurface( alloc->sdl_surf );

     D_MAGIC_CLEAR( alloc );

     return DFB_OK;
}

static DFBResult
sdlLock( CoreSurfacePool       *pool,
         void                  *pool_data,
         void                  *pool_local,
         CoreSurfaceAllocation *allocation,
         void                  *alloc_data,
         CoreSurfaceBufferLock *lock )
{
     SDLAllocationData *alloc = alloc_data;
     SDL_Surface       *sdl_surf;

//     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, SDLAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     sdl_surf = alloc->sdl_surf;
     D_ASSERT( sdl_surf != NULL );

     if (SDL_MUSTLOCK( sdl_surf ) && SDL_LockSurface( sdl_surf )) {
          D_ERROR( "SDL/Surface: SDL_LockSurface() on a %dx%dx surface failed!\n", sdl_surf->w, sdl_surf->h );
          return DFB_FAILURE;
     }

     D_ASSUME( sdl_surf->pixels != NULL );
     if (!sdl_surf->pixels)
          return DFB_UNSUPPORTED;

     D_ASSERT( sdl_surf->pitch > 0 );

     lock->addr   = sdl_surf->pixels;
     lock->pitch  = sdl_surf->pitch;
     lock->offset = sdl_surf->offset;
     lock->handle = sdl_surf;

     return DFB_OK;
}

static DFBResult
sdlUnlock( CoreSurfacePool       *pool,
           void                  *pool_data,
           void                  *pool_local,
           CoreSurfaceAllocation *allocation,
           void                  *alloc_data,
           CoreSurfaceBufferLock *lock )
{
     SDLAllocationData *alloc = alloc_data;
     SDL_Surface       *sdl_surf;

//     D_DEBUG_AT( SDL_Pool, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, SDLAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     sdl_surf = alloc->sdl_surf;
     D_ASSERT( sdl_surf != NULL );

     if (SDL_MUSTLOCK( sdl_surf ))
          SDL_UnlockSurface( sdl_surf );

     return DFB_OK;
}

const SurfacePoolFuncs sdlSurfacePoolFuncs = {
     .PoolDataSize       = sdlPoolDataSize,
     .AllocationDataSize = sdlAllocationDataSize,
     .InitPool           = sdlInitPool,
     .DestroyPool        = sdlDestroyPool,

     .TestConfig         = sdlTestConfig,

     .AllocateBuffer     = sdlAllocateBuffer,
     .DeallocateBuffer   = sdlDeallocateBuffer,

     .Lock               = sdlLock,
     .Unlock             = sdlUnlock,
};

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/sdl.h�������������������������������������������������������������������0000644�0001750�0001750�00000004063�11245562152�013370� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SDL__SDL_H__
#define __SDL__SDL_H__

#include <fusion/call.h>
#include <fusion/lock.h>

#include <core/surface_pool.h>
#include <core/system.h>

typedef struct {
     FusionSkirmish   lock;
     FusionCall       call;

     CoreSurface     *primary;
     CoreSurfacePool *sdl_pool;

     struct {
          pthread_mutex_t  lock;
          pthread_cond_t   cond;

          DirectThread    *thread;

          bool             pending;
          DFBRegion        region;

          bool             quit;
     } update;

     VideoMode            *modes;        /* linked list of valid video modes */

     SDL_Surface          *screen;
} DFBSDL;

extern DFBSDL  *dfb_sdl;
extern CoreDFB *dfb_sdl_core;

DFBResult dfb_sdl_set_video_mode( CoreDFB *core, CoreSurfaceConfig *config );
DFBResult dfb_sdl_update_screen( CoreDFB *core, DFBRegion *region );
DFBResult dfb_sdl_set_palette( CorePalette *palette );

#endif

�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/sdl.c�������������������������������������������������������������������0000644�0001750�0001750�00000024073�11245562152�013366� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <directfb.h>

#include <direct/memcpy.h>
#include <direct/messages.h>
#include <direct/thread.h>

#include <fusion/arena.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <SDL.h>

#include "sdl.h"
#include "primary.h"

#include <core/core_system.h>

DFB_CORE_SYSTEM( sdl )


DFBSDL  *dfb_sdl      = NULL;
CoreDFB *dfb_sdl_core = NULL;

extern const SurfacePoolFuncs sdlSurfacePoolFuncs;

static DFBResult dfb_fbdev_read_modes( void );


static void
system_get_info( CoreSystemInfo *info )
{
     info->type = CORE_SDL;
     info->caps = CSCAPS_ACCELERATION;

     snprintf( info->name, DFB_CORE_SYSTEM_INFO_NAME_LENGTH, "SDL" );
}

static DFBResult
system_initialize( CoreDFB *core, void **data )
{
     char       *driver;
     CoreScreen *screen;

     D_ASSERT( dfb_sdl == NULL );

     dfb_sdl = (DFBSDL*) SHCALLOC( dfb_core_shmpool(core), 1, sizeof(DFBSDL) );
     if (!dfb_sdl) {
          D_ERROR( "DirectFB/SDL: Couldn't allocate shared memory!\n" );
          return D_OOSHM();
     }

     dfb_sdl_core = core;

     dfb_fbdev_read_modes();  /* use same mode list as a fake */

     driver = getenv( "SDL_VIDEODRIVER" );
     if (driver && !strcasecmp( driver, "directfb" )) {
          D_INFO( "DirectFB/SDL: SDL_VIDEODRIVER is 'directfb', unsetting it.\n" );
          unsetenv( "SDL_VIDEODRIVER" );
     }

     /* Initialize SDL */
     if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
          D_ERROR( "DirectFB/SDL: Couldn't initialize SDL: %s\n", SDL_GetError() );

          SHFREE( dfb_core_shmpool(core), dfb_sdl );
          dfb_sdl = NULL;

          return DFB_INIT;
     }

     fusion_skirmish_init( &dfb_sdl->lock, "SDL System", dfb_core_world(core) );

     fusion_call_init( &dfb_sdl->call, dfb_sdl_call_handler, NULL, dfb_core_world(core) );

     screen = dfb_screens_register( NULL, NULL, &sdlPrimaryScreenFuncs );

     dfb_layers_register( screen, NULL, &sdlPrimaryLayerFuncs );

     fusion_arena_add_shared_field( dfb_core_arena( core ), "sdl", dfb_sdl );

     dfb_surface_pool_initialize( core, &sdlSurfacePoolFuncs, &dfb_sdl->sdl_pool );

     *data = dfb_sdl;

     return DFB_OK;
}

static DFBResult
system_join( CoreDFB *core, void **data )
{
     void       *ret;
     CoreScreen *screen;

     D_ASSERT( dfb_sdl == NULL );

     fusion_arena_get_shared_field( dfb_core_arena( core ), "sdl", &ret );

     dfb_sdl = ret;
     dfb_sdl_core = core;

     screen = dfb_screens_register( NULL, NULL, &sdlPrimaryScreenFuncs );

     dfb_layers_register( screen, NULL, &sdlPrimaryLayerFuncs );

     dfb_surface_pool_join( core, dfb_sdl->sdl_pool, &sdlSurfacePoolFuncs );

     *data = dfb_sdl;

     return DFB_OK;
}

static DFBResult
system_shutdown( bool emergency )
{
     FusionSHMPoolShared *pool;

     D_ASSERT( dfb_sdl != NULL );

     /* Stop update thread. */
     if (dfb_sdl->update.thread) {
          if (!emergency) {
               dfb_sdl->update.quit = true;

               pthread_cond_signal( &dfb_sdl->update.cond );

               direct_thread_join( dfb_sdl->update.thread );
          }

          direct_thread_destroy( dfb_sdl->update.thread );
     }

     dfb_surface_pool_destroy( dfb_sdl->sdl_pool );

     fusion_call_destroy( &dfb_sdl->call );

     fusion_skirmish_prevail( &dfb_sdl->lock );

     SDL_Quit();

     fusion_skirmish_destroy( &dfb_sdl->lock );

     pool = dfb_core_shmpool(dfb_sdl_core);

     while (dfb_sdl->modes) {
          VideoMode *next = dfb_sdl->modes->next;

          SHFREE( pool, dfb_sdl->modes );

          dfb_sdl->modes = next;
     }

     SHFREE( pool, dfb_sdl );
     dfb_sdl = NULL;
     dfb_sdl_core = NULL;

     return DFB_OK;
}

static DFBResult
system_leave( bool emergency )
{
     D_ASSERT( dfb_sdl != NULL );

     dfb_sdl = NULL;
     dfb_sdl_core = NULL;

     return DFB_OK;
}

static DFBResult
system_suspend( void )
{
     return DFB_UNIMPLEMENTED;
}

static DFBResult
system_resume( void )
{
     return DFB_UNIMPLEMENTED;
}

static volatile void *
system_map_mmio( unsigned int    offset,
                 int             length )
{
    return NULL;
}

static void
system_unmap_mmio( volatile void  *addr,
                   int             length )
{
}

static int
system_get_accelerator( void )
{
     return -1;
}

static VideoMode *
system_get_modes( void )
{
     return dfb_sdl->modes;
}

static VideoMode *
system_get_current_mode( void )
{
     return NULL;
}

static DFBResult
system_thread_init( void )
{
     return DFB_OK;
}

static bool
system_input_filter( CoreInputDevice *device,
                     DFBInputEvent   *event )
{
     return false;
}

static unsigned long
system_video_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_video_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_videoram_length( void )
{
     return 0;
}

static unsigned long
system_aux_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_aux_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_auxram_length( void )
{
     return 0;
}

static void
system_get_busid( int *ret_bus, int *ret_dev, int *ret_func )
{
     return;
}

static void
system_get_deviceid( unsigned int *ret_vendor_id,
                     unsigned int *ret_device_id )
{
     return;
}


/*
 * parses video modes in /etc/fb.modes and stores them in dfb_fbdev->shared->modes
 * (to be replaced by DirectFB's own config system
 */
static DFBResult dfb_fbdev_read_modes( void )
{
     FILE *fp;
     char line[80],label[32],value[16];
     int geometry=0, timings=0;
     int dummy;
     VideoMode temp_mode;
     VideoMode *m = dfb_sdl->modes;

     if (!(fp = fopen("/etc/fb.modes","r")))
          return errno2result( errno );

     while (fgets(line,79,fp)) {
          if (sscanf(line, "mode \"%31[^\"]\"",label) == 1) {
               memset( &temp_mode, 0, sizeof(VideoMode) );
               geometry = 0;
               timings = 0;
               while (fgets(line,79,fp) && !(strstr(line,"endmode"))) {
                    if (5 == sscanf(line," geometry %d %d %d %d %d", &temp_mode.xres, &temp_mode.yres, &dummy, &dummy, &temp_mode.bpp)) {
                         geometry = 1;
                    }
                    else if (7 == sscanf(line," timings %d %d %d %d %d %d %d", &temp_mode.pixclock, &temp_mode.left_margin,  &temp_mode.right_margin,
                                         &temp_mode.upper_margin, &temp_mode.lower_margin, &temp_mode.hsync_len,    &temp_mode.vsync_len)) {
                         timings = 1;
                    }
                    else if (1 == sscanf(line, " hsync %15s",value) && 0 == strcasecmp(value,"high")) {
                         temp_mode.hsync_high = 1;
                    }
                    else if (1 == sscanf(line, " vsync %15s",value) && 0 == strcasecmp(value,"high")) {
                         temp_mode.vsync_high = 1;
                    }
                    else if (1 == sscanf(line, " csync %15s",value) && 0 == strcasecmp(value,"high")) {
                         temp_mode.csync_high = 1;
                    }
                    else if (1 == sscanf(line, " laced %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.laced = 1;
                    }
                    else if (1 == sscanf(line, " double %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.doubled = 1;
                    }
                    else if (1 == sscanf(line, " gsync %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.sync_on_green = 1;
                    }
                    else if (1 == sscanf(line, " extsync %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.external_sync = 1;
                    }
                    else if (1 == sscanf(line, " bcast %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.broadcast = 1;
                    }
               }
               if (geometry && timings) {
                    if (!m) {
                         dfb_sdl->modes = SHCALLOC( dfb_core_shmpool(dfb_sdl_core), 1, sizeof(VideoMode) );
                         m = dfb_sdl->modes;
                    }
                    else {
                         m->next = SHCALLOC( dfb_core_shmpool(dfb_sdl_core), 1, sizeof(VideoMode) );
                         m = m->next;
                    }
                    direct_memcpy (m, &temp_mode, sizeof(VideoMode));
                    D_DEBUG( "DirectFB/FBDev: %20s %4dx%4d  %s%s\n", label, temp_mode.xres, temp_mode.yres,
                              temp_mode.laced ? "interlaced " : "", temp_mode.doubled ? "doublescan" : "" );
               }
          }
     }

     fclose (fp);

     return DFB_OK;
}

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/primary.h���������������������������������������������������������������0000644�0001750�0001750�00000003250�11245562152�014266� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SDL__PRIMARY_H__
#define __SDL__PRIMARY_H__

#include <fusion/call.h>

#include <core/layers.h>
#include <core/screens.h>

extern ScreenFuncs       sdlPrimaryScreenFuncs;
extern DisplayLayerFuncs sdlPrimaryLayerFuncs;

FusionCallHandlerResult
dfb_sdl_call_handler( int           caller,
                      int           call_arg,
                      void         *call_ptr,
                      void         *ctx,
                      unsigned int  serial,
                      int          *ret_val );

#endif

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/sdl/sdlinput.c��������������������������������������������������������������0000644�0001750�0001750�00000040642�11245562152�014446� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <string.h>
#include <unistd.h>
#include <errno.h>

#include <directfb.h>

#include <SDL.h>

#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/input.h>
#include <core/system.h>

#include <direct/mem.h>
#include <direct/thread.h>

#include "sdl.h"

#include <core/input_driver.h>


DFB_INPUT_DRIVER( sdlinput )

/*
 * declaration of private data
 */
typedef struct {
     CoreInputDevice *device;
     DirectThread    *thread;
     DFBSDL          *dfb_sdl;
     int              stop;
} SDLInputData;


static DFBInputEvent motionX = {
     .type    = DIET_UNKNOWN,
     .axisabs = 0,
};

static DFBInputEvent motionY = {
     .type    = DIET_UNKNOWN,
     .axisabs = 0,
};

static void
motion_compress( int x, int y )
{
     if (motionX.axisabs != x) {
          motionX.type    = DIET_AXISMOTION;
          motionX.flags   = DIEF_AXISABS;
          motionX.axis    = DIAI_X;
          motionX.axisabs = x;
     }

     if (motionY.axisabs != y) {
          motionY.type    = DIET_AXISMOTION;
          motionY.flags   = DIEF_AXISABS;
          motionY.axis    = DIAI_Y;
          motionY.axisabs = y;
     }
}

static void
motion_realize( SDLInputData *data )
{
     if (motionX.type != DIET_UNKNOWN) {
          if (motionY.type != DIET_UNKNOWN) {
               /* let DirectFB know two events are coming */
               motionX.flags  |= DIEF_FOLLOW;
          }

          dfb_input_dispatch( data->device, &motionX );

          motionX.type = DIET_UNKNOWN;
     }

     if (motionY.type != DIET_UNKNOWN) {
          dfb_input_dispatch( data->device, &motionY );

          motionY.type = DIET_UNKNOWN;
     }
}

static bool
translate_key( SDLKey key, DFBInputEvent *evt )
{
     evt->flags = DIEF_KEYID;
     /* Numeric keypad */
     if (key >= SDLK_KP0  &&  key <= SDLK_KP9) {
          evt->key_id = DIKI_KP_0 + key - SDLK_KP0;
          return true;
     }

     /* Function keys */
     if (key >= SDLK_F1  &&  key <= SDLK_F12) {
          evt->key_id = DIKI_F1 + key - SDLK_F1;
          return true;
     }

     /* letter keys */
     if (key >= SDLK_a  &&  key <= SDLK_z) {
          evt->key_id = DIKI_A + key - SDLK_a;
          return true;
     }

     if (key >= SDLK_0  &&  key <= SDLK_9) {
          evt->key_id = DIKI_0 + key - SDLK_0;
          return true;
     }

     switch (key) {
          case SDLK_QUOTE:
               evt->key_id = DIKI_QUOTE_RIGHT;
               return true;
          case SDLK_BACKQUOTE:
               evt->key_id = DIKI_QUOTE_LEFT;
               return true;
          case SDLK_COMMA:
               evt->key_id = DIKI_COMMA;
               return true;
          case SDLK_MINUS:
               evt->key_id = DIKI_MINUS_SIGN;
               return true;
          case SDLK_PERIOD:
               evt->key_id = DIKI_PERIOD;
               return true;
          case SDLK_SLASH:
               evt->key_id = DIKI_SLASH;
               return true;
          case SDLK_SEMICOLON:
               evt->key_id = DIKI_SEMICOLON;
               return true;
          case SDLK_LESS:
               evt->key_id = DIKI_LESS_SIGN;
               return true;
          case SDLK_EQUALS:
               evt->key_id = DIKI_EQUALS_SIGN;
               return true;
          case SDLK_LEFTBRACKET:
               evt->key_id = DIKI_BRACKET_LEFT;
               return true;
          case SDLK_RIGHTBRACKET:
               evt->key_id = DIKI_BRACKET_RIGHT;
               return true;
          case SDLK_BACKSLASH:
               evt->key_id = DIKI_BACKSLASH;
               return true;
          /* Numeric keypad */
          case SDLK_KP_PERIOD:
               evt->key_id = DIKI_KP_DECIMAL;
               return true;

          case SDLK_KP_DIVIDE:
               evt->key_id = DIKI_KP_DIV;
               return true;

          case SDLK_KP_MULTIPLY:
               evt->key_id = DIKI_KP_MULT;
               return true;

          case SDLK_KP_MINUS:
               evt->key_id = DIKI_KP_MINUS;
               return true;
          case SDLK_KP_PLUS:
               evt->key_id = DIKI_KP_PLUS;
               return true;
          case SDLK_KP_ENTER:
               evt->key_id = DIKI_KP_ENTER;
               return true;

          case SDLK_KP_EQUALS:
               evt->key_id = DIKI_KP_EQUAL;
               return true;
          case SDLK_ESCAPE:
               evt->key_id = DIKI_ESCAPE;
               return true;
          case SDLK_TAB:
               evt->key_id = DIKI_TAB;
               return true;
          case SDLK_RETURN:
               evt->key_id = DIKI_ENTER;
               return true;
          case SDLK_SPACE:
               evt->key_id = DIKI_SPACE;
               return true;
          case SDLK_BACKSPACE:
               evt->key_id = DIKI_BACKSPACE;
               return true;
          case SDLK_INSERT:
               evt->key_id = DIKI_INSERT;
               return true;
          case SDLK_DELETE:
               evt->key_id = DIKI_DELETE;
               return true;
          case SDLK_PRINT:
               evt->key_id = DIKI_PRINT;
               return true;
          case SDLK_PAUSE:
               evt->key_id = DIKI_PAUSE;
               return true;
          /* Arrows + Home/End pad */
          case SDLK_UP:
               evt->key_id = DIKI_UP;
               return true;

          case SDLK_DOWN:
               evt->key_id = DIKI_DOWN;
               return true;

          case SDLK_RIGHT:
               evt->key_id = DIKI_RIGHT;
               return true;
          case SDLK_LEFT:
               evt->key_id = DIKI_LEFT;
               return true;
          case SDLK_HOME:
               evt->key_id = DIKI_HOME;
               return true;
          case SDLK_END:
               evt->key_id = DIKI_END;
               return true;

          case SDLK_PAGEUP:
               evt->key_id = DIKI_PAGE_UP;
               return true;

          case SDLK_PAGEDOWN:
               evt->key_id = DIKI_PAGE_DOWN;
               return true;


          /* Key state modifier keys */
          case SDLK_NUMLOCK:
               evt->key_id = DIKI_NUM_LOCK;
               return true;

          case SDLK_CAPSLOCK:
               evt->key_id = DIKI_CAPS_LOCK;
               return true;
          case SDLK_SCROLLOCK:
               evt->key_id = DIKI_SCROLL_LOCK;
               return true;
          case SDLK_RSHIFT:
               evt->key_id = DIKI_SHIFT_R;
               return true;

          case SDLK_LSHIFT:
               evt->key_id = DIKI_SHIFT_L;
               return true;
          case SDLK_RCTRL:
               evt->key_id = DIKI_CONTROL_R;
               return true;

          case SDLK_LCTRL:
               evt->key_id = DIKI_CONTROL_L;
               return true;

          case SDLK_RALT:
               evt->key_id = DIKI_ALT_R;
               return true;

          case SDLK_LALT:
               evt->key_id = DIKI_ALT_L;
               return true;

          case SDLK_RMETA:
               evt->key_id = DIKI_META_R;
               return true;

          case SDLK_LMETA:
               evt->key_id = DIKI_META_L;
               return true;

          case SDLK_LSUPER:
               evt->key_id = DIKI_SUPER_L;
               return true;

          case SDLK_RSUPER:
               evt->key_id = DIKI_SUPER_R;
               return true;

          case SDLK_MODE:
               evt->key_id     = DIKI_ALT_R;
               evt->flags     |= DIEF_KEYSYMBOL;
               evt->key_symbol = DIKS_ALTGR;
               return true;
          default:
               break;
     }

     evt->flags = DIEF_NONE;
     return false;
}

/*
 * Input thread reading from device.
 * Generates events on incoming data.
 */
static void*
sdlEventThread( DirectThread *thread, void *driver_data )
{
     SDLInputData *data    = (SDLInputData*) driver_data;
     DFBSDL       *dfb_sdl = data->dfb_sdl;

     while (!data->stop) {
          DFBInputEvent evt;
          SDL_Event     event;

          fusion_skirmish_prevail( &dfb_sdl->lock );

          /* Check for events */
          while ( SDL_PollEvent(&event) ) {
               fusion_skirmish_dismiss( &dfb_sdl->lock );

               switch (event.type) {
                    case SDL_MOUSEMOTION:
                         motion_compress( event.motion.x, event.motion.y );
                         break;

                    case SDL_MOUSEBUTTONUP:
                    case SDL_MOUSEBUTTONDOWN:
                         motion_realize( data );

                         if (event.type == SDL_MOUSEBUTTONDOWN)
                              evt.type = DIET_BUTTONPRESS;
                         else
                              evt.type = DIET_BUTTONRELEASE;

                         evt.flags = DIEF_NONE;

                         switch (event.button.button) {
                              case SDL_BUTTON_LEFT:
                                   evt.button = DIBI_LEFT;
                                   break;
                              case SDL_BUTTON_MIDDLE:
                                   evt.button = DIBI_MIDDLE;
                                   break;
                              case SDL_BUTTON_RIGHT:
                                   evt.button = DIBI_RIGHT;
                                   break;
                              case SDL_BUTTON_WHEELUP:
                              case SDL_BUTTON_WHEELDOWN:
                                   if (event.type != SDL_MOUSEBUTTONDOWN) {
                                        fusion_skirmish_prevail( &dfb_sdl->lock );
                                        continue;
                                   }
                                   evt.type  = DIET_AXISMOTION;
                                   evt.flags = DIEF_AXISREL;
                                   evt.axis  = DIAI_Z;
                                   if (event.button.button == SDL_BUTTON_WHEELUP)
                                        evt.axisrel = -1;
                                   else
                                        evt.axisrel = 1;
                                   break;
                              default:
                                   fusion_skirmish_prevail( &dfb_sdl->lock );
                                   continue;
                         }

                         dfb_input_dispatch( data->device, &evt );
                         break;

                    case SDL_KEYUP:
                    case SDL_KEYDOWN:
                         if (event.type == SDL_KEYDOWN)
                              evt.type = DIET_KEYPRESS;
                         else
                              evt.type = DIET_KEYRELEASE;

                         /* Get a key id first */
                         translate_key( event.key.keysym.sym, &evt );

                         /* If SDL provided a symbol, use it */
                         if (event.key.keysym.unicode) {
                              evt.flags     |= DIEF_KEYSYMBOL;
                              evt.key_symbol = event.key.keysym.unicode;

                              /**
                               * Hack to translate the Control+[letter]
                               * combination to
                               * Modifier: CONTROL, Key Symbol: [letter]
                               * A side effect here is that Control+Backspace
                               * produces Control+h
                               */
                              if (evt.modifiers == DIMM_CONTROL &&
                                  evt.key_symbol >= 1 && evt.key_symbol <= ('z'-'a'+1))
                              {
                                  evt.key_symbol += 'a'-1;
                              }
                         }

                         dfb_input_dispatch( data->device, &evt );
                         break;
                    case SDL_QUIT:
                         evt.type       = DIET_KEYPRESS;
                         evt.flags      = DIEF_KEYSYMBOL;
                         evt.key_symbol = DIKS_ESCAPE;

                         dfb_input_dispatch( data->device, &evt );

                         evt.type       = DIET_KEYRELEASE;
                         evt.flags      = DIEF_KEYSYMBOL;
                         evt.key_symbol = DIKS_ESCAPE;

                         dfb_input_dispatch( data->device, &evt );
                         break;

                    default:
                         break;
               }

               fusion_skirmish_prevail( &dfb_sdl->lock );
          }

          fusion_skirmish_dismiss( &dfb_sdl->lock );

          motion_realize( data );

          usleep(10000);

          direct_thread_testcancel( thread );
     }

     return NULL;
}

/* exported symbols */

/*
 * Return the number of available devices.
 * Called once during initialization of DirectFB.
 */
static int
driver_get_available( void )
{
     if (dfb_system_type() == CORE_SDL)
          return 1;

     return 0;
}

/*
 * Fill out general information about this driver.
 * Called once during initialization of DirectFB.
 */
static void
driver_get_info( InputDriverInfo *info )
{
     /* fill driver info structure */
     snprintf ( info->name,
                DFB_INPUT_DRIVER_INFO_NAME_LENGTH, "SDL Input Driver" );
     snprintf ( info->vendor,
                DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH, "Denis Oliver Kropp" );

     info->version.major = 0;
     info->version.minor = 1;
}

/*
 * 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 )
{
     SDLInputData *data;
     DFBSDL       *dfb_sdl = dfb_system_data();

     fusion_skirmish_prevail( &dfb_sdl->lock );

     SDL_EnableUNICODE( true );

     SDL_EnableKeyRepeat( 250, 40 );

     fusion_skirmish_dismiss( &dfb_sdl->lock );

     /* set device name */
     snprintf( info->desc.name,
               DFB_INPUT_DEVICE_DESC_NAME_LENGTH, "SDL Input" );

     /* set device vendor */
     snprintf( info->desc.vendor,
               DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "SDL" );

     /* set one of the primary input device IDs */
     info->prefered_id = DIDID_KEYBOARD;

     /* set type flags */
     info->desc.type   = DIDTF_JOYSTICK | DIDTF_KEYBOARD | DIDTF_MOUSE;

     /* set capabilities */
     info->desc.caps   = DICAPS_ALL;


     /* allocate and fill private data */
     data = D_CALLOC( 1, sizeof(SDLInputData) );

     data->device  = device;
     data->dfb_sdl = dfb_sdl;

     /* start input thread */
     data->thread = direct_thread_create( DTT_INPUT, sdlEventThread, data, "SDL Input" );

     /* set private data pointer */
     *driver_data = data;

     return DFB_OK;
}

/*
 * Fetch one entry from the device's keymap if supported.
 */
static DFBResult
driver_get_keymap_entry( CoreInputDevice           *device,
                         void                      *driver_data,
                         DFBInputDeviceKeymapEntry *entry )
{
     return DFB_UNSUPPORTED;
}
/*
 * End thread, close device and free private data.
 */
static void
driver_close_device( void *driver_data )
{
     SDLInputData *data = (SDLInputData*) driver_data;

     /* stop input thread */
     data->stop = 1;

     direct_thread_join( data->thread );
     direct_thread_destroy( data->thread );

     /* free private data */
     D_FREE ( data );
}

����������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522565�012350� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/README������������������������������������������������������������������0000644�0001750�0001750�00000000433�11164361026�013136� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is an X11 system in very early stages, it is not really usable yet.
Tested with RGB16, ARGB1555 and ARGB mode.

BUGS
- occasional segfault during startup
- does not work with multi-application core

TODO
- support for RGB32
- test RGB24, RGB332, and palette mode
- code cleanup
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/primary.c���������������������������������������������������������������0000644�0001750�0001750�00000042607�11245562152�014121� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

//#define DIRECT_ENABLE_DEBUG

#include <config.h>

#include <fusion/types.h>

#include <stdio.h>

#include <directfb.h>
#include <directfb_util.h>

#include <fusion/fusion.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/surface_buffer.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <direct/memcpy.h>
#include <direct/messages.h>

#include <string.h>
#include <stdlib.h>

#include "xwindow.h"
#include "x11.h"
#include "primary.h"


D_DEBUG_DOMAIN( X11_Window, "X11/Window", "X11 Window" );
D_DEBUG_DOMAIN( X11_Update, "X11/Update", "X11 Update" );

/**********************************************************************************************************************/

static DFBResult
dfb_x11_create_window( DFBX11 *x11, const CoreLayerRegionConfig *config )
{
     int           ret;
     DFBX11Shared *shared = x11->shared;

     D_ASSERT( config != NULL );

     shared->setmode.config = *config;

     if (fusion_call_execute( &shared->call, FCEF_NONE, X11_CREATE_WINDOW, &shared->setmode, &ret ))
          return DFB_FUSION;

     return ret;
}

static DFBResult
dfb_x11_destroy_window( DFBX11 *x11 )
{
     int           ret;
     DFBX11Shared *shared = x11->shared;

     if (fusion_call_execute( &shared->call, FCEF_NONE, X11_DESTROY_WINDOW, NULL, &ret ))
          return DFB_FUSION;

     return ret;
}

static DFBResult
dfb_x11_update_screen( DFBX11 *x11, const DFBRegion *region, CoreSurfaceBufferLock *lock )
{
     int           ret;
     DFBX11Shared *shared = x11->shared;

     DFB_REGION_ASSERT( region );
     D_ASSERT( lock != NULL );

     /* FIXME: Just a hot fix! */
     while (shared->update.lock)
          usleep( 10000 );

     shared->update.region = *region;
     shared->update.lock   = lock;

     if (fusion_call_execute( &shared->call, FCEF_NONE, X11_UPDATE_SCREEN, &shared->update, &ret ))
          return DFB_FUSION;

     return ret;
}

static DFBResult
dfb_x11_set_palette( DFBX11 *x11, CorePalette *palette )
{
     int           ret;
     DFBX11Shared *shared = x11->shared;

     D_ASSERT( palette != NULL );

     if (fusion_call_execute( &shared->call, FCEF_NONE, X11_SET_PALETTE, palette, &ret ))
          return DFB_FUSION;

     return ret;
}

/**********************************************************************************************************************/

static DFBResult
primaryInitScreen( CoreScreen           *screen,
                   CoreGraphicsDevice   *device,
                   void                 *driver_data,
                   void                 *screen_data,
                   DFBScreenDescription *description )
{
     /* Set the screen capabilities. */
     description->caps = DSCCAPS_NONE;

     /* Set the screen name. */
     snprintf( description->name,
               DFB_SCREEN_DESC_NAME_LENGTH, "X11 Primary Screen" );

     return DFB_OK;
}

static DFBResult
primaryGetScreenSize( CoreScreen *screen,
                      void       *driver_data,
                      void       *screen_data,
                      int        *ret_width,
                      int        *ret_height )
{
     DFBX11       *x11    = driver_data;
     DFBX11Shared *shared = x11->shared;

     *ret_width  = shared->screen_size.w;
     *ret_height = shared->screen_size.h;

     return DFB_OK;
}

ScreenFuncs x11PrimaryScreenFuncs = {
     .InitScreen    = primaryInitScreen,
     .GetScreenSize = primaryGetScreenSize,
};

/******************************************************************************/

static int
primaryLayerDataSize( void )
{
     return 0;
}

static int
primaryRegionDataSize( void )
{
     return 0;
}

static DFBResult
primaryInitLayer( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  DFBDisplayLayerDescription *description,
                  DFBDisplayLayerConfig      *config,
                  DFBColorAdjustment         *adjustment )
{
     DFBX11       *x11    = driver_data;
     DFBX11Shared *shared = x11->shared;

     /* set capabilities and type */
     description->caps = DLCAPS_SURFACE;
     description->type = DLTF_GRAPHICS;

     /* set name */
     snprintf( description->name,
               DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "X11 Primary Layer" );

     /* fill out the default configuration */
     config->flags       = DLCONF_WIDTH       | DLCONF_HEIGHT |
                           DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
     config->buffermode  = DLBM_FRONTONLY;

     if (dfb_config->mode.width)
          config->width  = dfb_config->mode.width;
     else
          config->width  = shared->screen_size.w;

     if (dfb_config->mode.height)
          config->height = dfb_config->mode.height;
     else
          config->height = shared->screen_size.h;

     if (dfb_config->mode.format != DSPF_UNKNOWN)
          config->pixelformat = dfb_config->mode.format;
     else if (dfb_config->mode.depth > 0)
          config->pixelformat = dfb_pixelformat_for_depth( dfb_config->mode.depth );
     else {
          int depth = DefaultDepthOfScreen( x11->screenptr );

          switch (depth) {
               case 15:
                    config->pixelformat = DSPF_RGB555;
                    break;
               case 16:
                    config->pixelformat = DSPF_RGB16;
                    break;
               case 24:
                    config->pixelformat = DSPF_RGB32;
                    break;
               case 32:
                    config->pixelformat = DSPF_ARGB;
                    break;
               default:
                    printf(" Unsupported X11 screen depth %d \n",depth);
                    return DFB_UNSUPPORTED;
          }
     }

     return DFB_OK;
}

static DFBResult
primaryTestRegion( CoreLayer                  *layer,
                   void                       *driver_data,
                   void                       *layer_data,
                   CoreLayerRegionConfig      *config,
                   CoreLayerRegionConfigFlags *failed )
{
     CoreLayerRegionConfigFlags fail = 0;

     switch (config->buffermode) {
          case DLBM_FRONTONLY:
          case DLBM_BACKSYSTEM:
          case DLBM_BACKVIDEO:
          case DLBM_TRIPLE:
               break;

          default:
               fail |= CLRCF_BUFFERMODE;
               break;
     }

     switch (config->format) {
          case DSPF_RGB16:
          case DSPF_NV16:
          case DSPF_RGB444:
          case DSPF_ARGB4444:
          case DSPF_RGB555:
          case DSPF_ARGB1555:
          case DSPF_BGR555:
          case DSPF_RGB32:
          case DSPF_ARGB:
          case DSPF_AYUV:
               break;

          default:
               fail |= CLRCF_FORMAT;
               break;
     }

     if (config->options)
          fail |= CLRCF_OPTIONS;

     if (failed)
          *failed = fail;

     if (fail)
          return DFB_UNSUPPORTED;

     return DFB_OK;
}

static DFBResult
primaryAddRegion( CoreLayer             *layer,
                  void                  *driver_data,
                  void                  *layer_data,
                  void                  *region_data,
                  CoreLayerRegionConfig *config )
{
     return DFB_OK;
}

static DFBResult
primarySetRegion( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  void                       *region_data,
                  CoreLayerRegionConfig      *config,
                  CoreLayerRegionConfigFlags  updated,
                  CoreSurface                *surface,
                  CorePalette                *palette,
                  CoreSurfaceBufferLock      *lock )
{
     DFBResult  ret;
     DFBX11    *x11 = driver_data;

     ret = dfb_x11_create_window( x11, config );
     if (ret)
          return ret;

     if (palette)
          dfb_x11_set_palette( x11, palette );

     return DFB_OK;
}

static DFBResult
primaryRemoveRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data )
{
     DFBX11 *x11 = driver_data;

     dfb_x11_destroy_window( x11 );

     return DFB_OK;
}

static DFBResult
primaryFlipRegion( CoreLayer             *layer,
                   void                  *driver_data,
                   void                  *layer_data,
                   void                  *region_data,
                   CoreSurface           *surface,
                   DFBSurfaceFlipFlags    flags,
                   CoreSurfaceBufferLock *lock )
{
     DFBX11    *x11    = driver_data;
     DFBRegion  region = DFB_REGION_INIT_FROM_DIMENSION( &surface->config.size );

     dfb_surface_flip( surface, false );

     return dfb_x11_update_screen( x11, ®ion, lock );
}

static DFBResult
primaryUpdateRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data,
                     CoreSurface           *surface,
                     const DFBRegion       *update,
                     CoreSurfaceBufferLock *lock )
{
     DFBX11    *x11    = driver_data;
     DFBRegion  region = DFB_REGION_INIT_FROM_DIMENSION( &surface->config.size );

     if (update && !dfb_region_region_intersect( ®ion, update ))
          return DFB_OK;

     return dfb_x11_update_screen( x11, ®ion, lock );
}

DisplayLayerFuncs x11PrimaryLayerFuncs = {
     .LayerDataSize  = primaryLayerDataSize,
     .RegionDataSize = primaryRegionDataSize,
     .InitLayer      = primaryInitLayer,

     .TestRegion     = primaryTestRegion,
     .AddRegion      = primaryAddRegion,
     .SetRegion      = primarySetRegion,
     .RemoveRegion   = primaryRemoveRegion,
     .FlipRegion     = primaryFlipRegion,
     .UpdateRegion   = primaryUpdateRegion,
};

/******************************************************************************/

static DFBResult
update_screen( DFBX11 *x11, const DFBRectangle *clip, CoreSurfaceBufferLock *lock )
{
     void                  *dst;
     void                  *src;
     unsigned int           offset = 0;
     XWindow               *xw;
     XImage                *ximage;
     CoreSurface           *surface;
     CoreSurfaceAllocation *allocation;
     DFBX11Shared          *shared;
     DFBRectangle           rect;
     bool                   direct = false;

     D_ASSERT( x11 != NULL );
     DFB_RECTANGLE_ASSERT( clip );

     D_DEBUG_AT( X11_Update, "%s( %4d,%4d-%4dx%4d )\n", __FUNCTION__, DFB_RECTANGLE_VALS( clip ) );

     CORE_SURFACE_BUFFER_LOCK_ASSERT( lock );

     shared = x11->shared;
     D_ASSERT( shared != NULL );

     XLockDisplay( x11->display );

     xw = shared->xw;
     if (!xw) {
          XUnlockDisplay( x11->display );
          return DFB_OK;
     }

     allocation = lock->allocation;
     CORE_SURFACE_ALLOCATION_ASSERT( allocation );

     surface = allocation->buffer->surface;
     D_ASSERT( surface != NULL );


     rect.x = rect.y = 0;
     rect.w = xw->width;
     rect.h = xw->height;

     if (!dfb_rectangle_intersect( &rect, clip )) {
          XUnlockDisplay( x11->display );
          return DFB_OK;
     }

     D_DEBUG_AT( X11_Update, "  -> %4d,%4d-%4dx%4d\n", DFB_RECTANGLE_VALS( &rect ) );

     /* Check for our special native allocation... */
     if (allocation->pool == shared->x11image_pool && lock->handle) {
          x11Image *image = lock->handle;

          D_MAGIC_ASSERT( image, x11Image );

          /* ...and directly XShmPutImage from that. */
          ximage = image->ximage;

          direct = true;
     }
     else {
          /* ...or copy or convert into XShmImage or XImage allocated with the XWindow. */
          ximage = xw->ximage;
          offset = xw->ximage_offset;

          xw->ximage_offset = (offset ? 0 : ximage->height / 2);
          
          dst = xw->virtualscreen + rect.x * xw->bpp + (rect.y + offset) * ximage->bytes_per_line;
          src = lock->addr + DFB_BYTES_PER_LINE( surface->config.format, rect.x ) + rect.y * lock->pitch;

          switch (xw->depth) {
               case 32:
                    dfb_convert_to_argb( surface->config.format, src, lock->pitch,
                                         surface->config.size.h, dst, ximage->bytes_per_line, rect.w, rect.h );
                    break;

               case 24:
                    dfb_convert_to_rgb32( surface->config.format, src, lock->pitch,
                                          surface->config.size.h, dst, ximage->bytes_per_line, rect.w, rect.h );
                    break;

               case 16:
                    dfb_convert_to_rgb16( surface->config.format, src, lock->pitch,
                                          surface->config.size.h, dst, ximage->bytes_per_line, rect.w, rect.h );
                    break;

               case 15:
                    dfb_convert_to_rgb555( surface->config.format, src, lock->pitch,
                                           surface->config.size.h, dst, ximage->bytes_per_line, rect.w, rect.h );
                    break;

               default:
                    D_ONCE( "unsupported depth %d", xw->depth );
          }
     }

     D_ASSERT( ximage != NULL );


     /* Wait for previous data to be processed... */
     XSync( x11->display, False );

     /* ...and immediately queue or send the next! */
     if (x11->use_shm) {
          /* Just queue the command, it's XShm :) */
          XShmPutImage( xw->display, xw->window, xw->gc, ximage,
                        rect.x, rect.y + offset, rect.x, rect.y, rect.w, rect.h, False );

          /* Make sure the queue has really happened! */
          XFlush( x11->display );
     }
     else
          /* Initiate transfer of buffer... */
          XPutImage( xw->display, xw->window, xw->gc, ximage,
                     rect.x, rect.y + offset, rect.x, rect.y, rect.w, rect.h );

     /* Wait for display if single buffered and not converted... */
     if (direct && !(surface->config.caps & DSCAPS_FLIPPING))
          XSync( x11->display, False );

     XUnlockDisplay( x11->display );

     return DFB_OK;
}

/******************************************************************************/

DFBResult
dfb_x11_create_window_handler( DFBX11 *x11, CoreLayerRegionConfig *config )
{
     XWindow      *xw;
     DFBX11Shared *shared = x11->shared;

     D_DEBUG_AT( X11_Window, "%s( %p )\n", __FUNCTION__, config );

     D_DEBUG_AT( X11_Window, "  -> %4dx%4d %s\n", config->width, config->height, dfb_pixelformat_name(config->format) );

     XLockDisplay( x11->display );

     xw = shared->xw;
     if (xw != NULL) {
          if (xw->width == config->width && xw->height == config->height) {
               XUnlockDisplay( x11->display );
               return DFB_OK;
          }

          shared->xw = NULL;
          dfb_x11_close_window( x11, xw );
     }

     bool bSucces = dfb_x11_open_window( x11, &xw, 0, 0, config->width, config->height, config->format );

     /* Set video mode */
     if ( !bSucces ) {
          D_ERROR( "DirectFB/X11: Couldn't open %dx%d window!\n", config->width, config->height );

          XUnlockDisplay( x11->display );
          return DFB_FAILURE;
     }
     else
          shared->xw = xw;

     XUnlockDisplay( x11->display );
     return DFB_OK;
}

DFBResult
dfb_x11_destroy_window_handler( DFBX11 *x11 )
{
     DFBX11Shared *shared = x11->shared;

     D_DEBUG_AT( X11_Window, "%s()\n", __FUNCTION__ );

     XLockDisplay( x11->display );

     if (shared->xw) {
          XWindow *xw = shared->xw;

          shared->xw = NULL;

          dfb_x11_close_window( x11, xw );
     }

     XSync( x11->display, False );

     XUnlockDisplay( x11->display );

     return DFB_OK;
}

DFBResult
dfb_x11_update_screen_handler( DFBX11 *x11, UpdateScreenData *data )
{
     DFBRectangle rect;

     D_DEBUG_AT( X11_Update, "%s( %p )\n", __FUNCTION__, data );

     rect = DFB_RECTANGLE_INIT_FROM_REGION( &data->region );

     if (data->lock)
          update_screen( x11, &rect, data->lock );

     data->lock = NULL;

     return DFB_OK;
}

DFBResult
dfb_x11_set_palette_handler( DFBX11 *x11, CorePalette *palette )
{
     return DFB_OK;
}

�������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/x11_surface_pool.c������������������������������������������������������0000644�0001750�0001750�00000025175�11245562152�015611� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

//#define DIRECT_ENABLE_DEBUG

#include <config.h>

#include <direct/debug.h>
#include <direct/hash.h>
#include <direct/mem.h>

#include <fusion/shmalloc.h>

#include <core/surface_pool.h>

#include "x11.h"
#include "x11image.h"
#include "x11_surface_pool.h"

D_DEBUG_DOMAIN( X11_Surfaces, "X11/Surfaces", "X11 System Surface Pool" );

/**********************************************************************************************************************/

typedef struct {
} x11PoolData;

typedef struct {
     pthread_mutex_t  lock;
     DirectHash      *hash;

     DFBX11          *x11;
} x11PoolLocalData;

/**********************************************************************************************************************/

static int
x11PoolDataSize( void )
{
     return sizeof(x11PoolData);
}

static int
x11PoolLocalDataSize( void )
{
     return sizeof(x11PoolLocalData);
}

static int
x11AllocationDataSize( void )
{
     return sizeof(x11AllocationData);
}

static DFBResult
x11InitPool( CoreDFB                    *core,
             CoreSurfacePool            *pool,
             void                       *pool_data,
             void                       *pool_local,
             void                       *system_data,
             CoreSurfacePoolDescription *ret_desc )
{
     DFBResult         ret;
     x11PoolLocalData *local = pool_local;
     DFBX11           *x11   = system_data;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_ASSERT( ret_desc != NULL );

     local->x11 = x11;

     ret_desc->caps     = CSPCAPS_NONE;
     ret_desc->access   = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE | CSAF_SHARED;
     ret_desc->types    = CSTF_LAYER | CSTF_WINDOW | CSTF_CURSOR | CSTF_FONT | CSTF_SHARED | CSTF_EXTERNAL;
     ret_desc->priority = CSPP_PREFERED;

     snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "X11 Shm Images" );

     ret = direct_hash_create( 7, &local->hash );
     if (ret) {
          D_DERROR( ret, "X11/Surfaces: Could not create local hash table!\n" );
          return ret;
     }

     pthread_mutex_init( &local->lock, NULL );

     return DFB_OK;
}

static DFBResult
x11JoinPool( CoreDFB                    *core,
             CoreSurfacePool            *pool,
             void                       *pool_data,
             void                       *pool_local,
             void                       *system_data )
{
     DFBResult         ret;
     x11PoolLocalData *local = pool_local;
     DFBX11           *x11   = system_data;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );

     local->x11 = x11;

     ret = direct_hash_create( 7, &local->hash );
     if (ret) {
          D_DERROR( ret, "X11/Surfaces: Could not create local hash table!\n" );
          return ret;
     }

     pthread_mutex_init( &local->lock, NULL );

     return DFB_OK;
}

static DFBResult
x11DestroyPool( CoreSurfacePool *pool,
                void            *pool_data,
                void            *pool_local )
{
     x11PoolLocalData *local = pool_local;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );

     pthread_mutex_destroy( &local->lock );

     direct_hash_destroy( local->hash );

     return DFB_OK;
}

static DFBResult
x11LeavePool( CoreSurfacePool *pool,
              void            *pool_data,
              void            *pool_local )
{
     x11PoolLocalData *local = pool_local;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );

     pthread_mutex_destroy( &local->lock );

     direct_hash_destroy( local->hash );

     return DFB_OK;
}

static DFBResult
x11TestConfig( CoreSurfacePool         *pool,
               void                    *pool_data,
               void                    *pool_local,
               CoreSurfaceBuffer       *buffer,
               const CoreSurfaceConfig *config )
{
     x11PoolLocalData *local  = pool_local;
     DFBX11           *x11    = local->x11;
     DFBX11Shared     *shared = x11->shared;

     /* Provide a fallback only if no virtual physical pool is allocated... */
     if (!shared->vpsmem_length)
          return DFB_OK;
          
     /* Pass NULL image for probing */
     return x11ImageInit( x11, NULL, config->size.w, config->size.h, config->format );
}

static DFBResult
x11AllocateBuffer( CoreSurfacePool       *pool,
                   void                  *pool_data,
                   void                  *pool_local,
                   CoreSurfaceBuffer     *buffer,
                   CoreSurfaceAllocation *allocation,
                   void                  *alloc_data )
{
     CoreSurface       *surface;
     x11AllocationData *alloc = alloc_data;
     x11PoolLocalData  *local = pool_local;
     DFBX11            *x11   = local->x11;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     if (x11ImageInit( x11, &alloc->image, surface->config.size.w, surface->config.size.h, surface->config.format ) == DFB_OK) {
          alloc->real  = true;
          alloc->pitch = alloc->image.pitch;

          allocation->size = surface->config.size.h * alloc->image.pitch;
     }
     else
          dfb_surface_calc_buffer_size( surface, 8, 2, &alloc->pitch, &allocation->size );

     return DFB_OK;
}

static DFBResult
x11DeallocateBuffer( CoreSurfacePool       *pool,
                     void                  *pool_data,
                     void                  *pool_local,
                     CoreSurfaceBuffer     *buffer,
                     CoreSurfaceAllocation *allocation,
                     void                  *alloc_data )
{
     x11AllocationData *alloc  = alloc_data;
     x11PoolLocalData  *local  = pool_local;
     DFBX11            *x11    = local->x11;
     DFBX11Shared      *shared = x11->shared;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     CORE_SURFACE_ALLOCATION_ASSERT( allocation );

     if (alloc->real)
          return x11ImageDestroy( x11, &alloc->image );

     if (alloc->ptr)
          SHFREE( shared->data_shmpool, alloc->ptr );

     return DFB_OK;
}

static DFBResult
x11Lock( CoreSurfacePool       *pool,
         void                  *pool_data,
         void                  *pool_local,
         CoreSurfaceAllocation *allocation,
         void                  *alloc_data,
         CoreSurfaceBufferLock *lock )
{
     DFBResult          ret;
     x11PoolLocalData  *local  = pool_local;
     x11AllocationData *alloc  = alloc_data;
     DFBX11            *x11    = local->x11;
     DFBX11Shared      *shared = x11->shared;
     CoreSurfaceBuffer *buffer;
     CoreSurface       *surface;

     D_DEBUG_AT( X11_Surfaces, "%s( %p )\n", __FUNCTION__, allocation );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     buffer = allocation->buffer;
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     D_ASSERT( local->hash != NULL );

     pthread_mutex_lock( &local->lock );

     if (alloc->real) {
          void *addr = direct_hash_lookup( local->hash, alloc->image.seginfo.shmid );

          if (!addr) {
               ret = x11ImageAttach( &alloc->image, &addr );
               if (ret) {
                    D_DERROR( ret, "X11/Surfaces: x11ImageAttach() failed!\n" );
                    pthread_mutex_unlock( &local->lock );
                    return ret;
               }

               direct_hash_insert( local->hash, alloc->image.seginfo.shmid, addr );

               /* FIXME: When to remove/detach? */
          }

          lock->addr   = addr;
          lock->handle = &alloc->image;
     }
     else {
          if (!alloc->ptr) {
               alloc->ptr = SHCALLOC( shared->data_shmpool, 1, allocation->size );
               if (!alloc->ptr)
                    return D_OOSHM();
          }

          lock->addr = alloc->ptr;
     }

     lock->pitch = alloc->pitch;

     pthread_mutex_unlock( &local->lock );

     return DFB_OK;
}

static DFBResult
x11Unlock( CoreSurfacePool       *pool,
           void                  *pool_data,
           void                  *pool_local,
           CoreSurfaceAllocation *allocation,
           void                  *alloc_data,
           CoreSurfaceBufferLock *lock )
{
     D_DEBUG_AT( X11_Surfaces, "%s( %p )\n", __FUNCTION__, allocation );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     /* FIXME: Check overhead of attach/detach per lock/unlock. */

     return DFB_OK;
}

const SurfacePoolFuncs x11SurfacePoolFuncs = {
     .PoolDataSize       = x11PoolDataSize,
     .PoolLocalDataSize  = x11PoolLocalDataSize,
     .AllocationDataSize = x11AllocationDataSize,

     .InitPool           = x11InitPool,
     .JoinPool           = x11JoinPool,
     .DestroyPool        = x11DestroyPool,
     .LeavePool          = x11LeavePool,

     .TestConfig         = x11TestConfig,

     .AllocateBuffer     = x11AllocateBuffer,
     .DeallocateBuffer   = x11DeallocateBuffer,

     .Lock               = x11Lock,
     .Unlock             = x11Unlock,
};

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/x11image.h��������������������������������������������������������������0000644�0001750�0001750�00000004630�11245562152�014051� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __X11SYSTEM__X11IMAGE_H__
#define __X11SYSTEM__X11IMAGE_H__

#include <X11/Xlib.h>    /* fundamentals X datas structures */
#include <X11/Xutil.h>   /* datas definitions for various functions */
#include <X11/keysym.h>  /* for a perfect use of keyboard events */

#include <X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>

#include "x11types.h"


typedef struct {
     int                   magic;

     int                   width;
     int                   height;
     DFBSurfacePixelFormat format;

     int                   depth;
     Visual*               visual;

     XImage*               ximage;
     int                   pitch;

     XShmSegmentInfo       seginfo;
} x11Image;


DFBResult x11ImageInit   ( DFBX11                *x11,
                           x11Image              *image,
                           int                    width,
                           int                    height,
                           DFBSurfacePixelFormat  format );

DFBResult x11ImageDestroy( DFBX11                *x11,
                           x11Image              *image );

DFBResult x11ImageAttach ( x11Image              *image,
                           void                 **ret_addr );

#endif /* __X11SYSTEM__X11IMAGE_H__ */

��������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/Makefile.am�������������������������������������������������������������0000644�0001750�0001750�00000001614�11245562152�014317� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.am for DirectFB/systems/x11

INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src		\
	$(X11_CFLAGS)


systemsdir = $(MODULEDIR)/systems

if BUILD_STATIC
systems_DATA = libdirectfb_x11.o
endif

systems_LTLIBRARIES = libdirectfb_x11.la


libdirectfb_x11_la_LDFLAGS = \
	$(X11_LIBS)	\
	-avoid-version	\
	-module

libdirectfb_x11_la_SOURCES = \
	primary.c		\
	primary.h		\
	surfacemanager.c	\
	surfacemanager.h	\
	vpsmem_surface_pool.c	\
	vpsmem_surface_pool.h	\
	x11.c			\
	x11.h			\
	x11image.c		\
	x11image.h		\
	x11input.c		\
	x11_surface_pool.c	\
	x11_surface_pool.h	\
	x11types.h		\
	xwindow.h		\
	xwindow.c

libdirectfb_x11_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la


include $(top_srcdir)/rules/libobject.make

��������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/surfacemanager.h��������������������������������������������������������0000644�0001750�0001750�00000007562�11245562152�015427� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SURFACEMANAGER_H__
#define __SURFACEMANAGER_H__

#include <directfb.h>

#include <core/coretypes.h>

typedef struct _SurfaceManager SurfaceManager;
typedef struct _Chunk          Chunk;

/*
 * initially there is one big free chunk,
 * chunks are splitted into a free and an occupied chunk if memory is allocated,
 * two chunks are merged to one free chunk if memory is deallocated
 */
struct _Chunk {
     int                  magic;

     int                  offset;      /* offset in memory,
                                          is greater or equal to the heap offset */
     int                  length;      /* length of this chunk in bytes */

     int                  pitch;
     
     CoreSurfaceBuffer   *buffer;      /* pointer to surface buffer occupying
                                          this chunk, or NULL if chunk is free */
     CoreSurfaceAllocation *allocation;

     int                  tolerations; /* number of times this chunk was scanned
                                          occupied, resetted in assure_video */

     Chunk               *prev;
     Chunk               *next;
};

struct _SurfaceManager {
     int                  magic;

     FusionSHMPoolShared *shmpool;

     Chunk               *chunks;

     int                  offset;
     int                  length;         /* length of the heap in bytes */
     int                  avail;          /* amount of available memory in bytes */

     int                  min_toleration;
     
     bool                 suspended;
};


DFBResult dfb_surfacemanager_create ( CoreDFB             *core,
                                      unsigned int         length,
                                      SurfaceManager     **ret_manager );

void      dfb_surfacemanager_destroy( SurfaceManager      *manager );

/*
 * finds and allocates one for the surface or fails,
 * after success the video health is CSH_RESTORE.
 * NOTE: this does not notify the listeners
 */
DFBResult dfb_surfacemanager_allocate( CoreDFB                *core,
                                       SurfaceManager         *manager,
                                       CoreSurfaceBuffer      *buffer,
                                       CoreSurfaceAllocation  *allocation,
                                       Chunk                 **ret_chunk );

DFBResult dfb_surfacemanager_displace( CoreDFB           *core,
                                       SurfaceManager    *manager,
                                       CoreSurfaceBuffer *buffer );

/*
 * sets the video health to CSH_INVALID frees the chunk and
 * notifies the listeners
 */
DFBResult dfb_surfacemanager_deallocate( SurfaceManager *manager,
                                         Chunk          *chunk );

#endif

����������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/xwindow.h���������������������������������������������������������������0000644�0001750�0001750�00000004737�11245562152�014144� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SYSTEMS_XWINDOW_H__
#define __SYSTEMS_XWINDOW_H__

#include <X11/Xlib.h>    /* fundamentals X datas structures */
#include <X11/Xutil.h>   /* datas definitions for various functions */
#include <X11/keysym.h>  /* for a perfect use of keyboard events */

#include <X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>

#include "x11types.h"


typedef struct {
     Display*            display;
     Window              window;
     Screen*             screenptr;
     int                 screennum;
     Visual*             visual;
     GC                  gc;
     XImage*             ximage;
     int                 ximage_offset;
     Colormap            colormap;

     XShmSegmentInfo*    shmseginfo;
     unsigned char*      videomemory;

     char*               virtualscreen;
     int                 videoaccesstype;

     int                 width;
     int                 height;
     int                 depth;
     int                 bpp;

     /* (Null) cursor stuff*/
     Pixmap              pixmp1;
     Pixmap              pixmp2;
     Cursor              NullCursor;
} XWindow;

Bool dfb_x11_open_window ( DFBX11 *x11, XWindow** ppXW, int iXPos, int iYPos, int iWidth, int iHeight, DFBSurfacePixelFormat format );
void dfb_x11_close_window( DFBX11 *x11, XWindow* pXW );



#endif /* __SYSTEMS_XWINDOW_H__ */

���������������������������������DirectFB-1.2.10/systems/x11/x11input.c��������������������������������������������������������������0000644�0001750�0001750�00000065703�11245562152�014131� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <fusion/types.h>

#include <string.h>
#include <unistd.h>
#include <errno.h>

#include <directfb.h>

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>


#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/input.h>
#include <core/layer_context.h>
#include <core/layer_control.h>
#include <core/layers_internal.h>
#include <core/system.h>

#include <direct/mem.h>
#include <direct/thread.h>

#include "xwindow.h"

#include "primary.h"
#include "x11.h"

#include <core/input_driver.h>


DFB_INPUT_DRIVER( x11input )


/*
 * declaration of private data
 */
typedef struct {
     CoreInputDevice*    device;
     DirectThread*       thread;
     DFBX11*             x11;
     bool                stop;
} X11InputData;


static DFBInputEvent motionX = {
     .type    = DIET_UNKNOWN,
     .axisabs = 0,
};

static DFBInputEvent motionY = {
     .type    = DIET_UNKNOWN,
     .axisabs = 0,
};

static void
motion_compress( int x, int y, const XEvent *xEvent )
{
     if (motionX.axisabs != x) {
          motionX.type    = DIET_AXISMOTION;
          motionX.flags   = DIEF_AXISABS | DIEF_TIMESTAMP;
          motionX.axis    = DIAI_X;
          motionX.axisabs = x;

          motionX.timestamp.tv_sec  =  xEvent->xmotion.time / 1000;
          motionX.timestamp.tv_usec = (xEvent->xmotion.time % 1000) * 1000;
     }

     if (motionY.axisabs != y) {
          motionY.type    = DIET_AXISMOTION;
          motionY.flags   = DIEF_AXISABS | DIEF_TIMESTAMP;
          motionY.axis    = DIAI_Y;
          motionY.axisabs = y;

          motionY.timestamp.tv_sec  =  xEvent->xmotion.time / 1000;
          motionY.timestamp.tv_usec = (xEvent->xmotion.time % 1000) * 1000;
     }
}

static void
motion_realize( X11InputData *data )
{
     if (motionX.type != DIET_UNKNOWN) {
          if (motionY.type != DIET_UNKNOWN)
               motionX.flags |= DIEF_FOLLOW;

          dfb_input_dispatch( data->device, &motionX );

          motionX.type = DIET_UNKNOWN;
     }

     if (motionY.type != DIET_UNKNOWN) {
          dfb_input_dispatch( data->device, &motionY );

          motionY.type = DIET_UNKNOWN;
     }
}

static DFBInputDeviceKeyIdentifier
xsymbol_to_id( KeySym xKeySymbol )
{
     switch (xKeySymbol) {
          case XK_a                : return DIKI_A;     
          case XK_b                : return DIKI_B;     
          case XK_c                : return DIKI_C;     
          case XK_d                : return DIKI_D;     
          case XK_e                : return DIKI_E;     
          case XK_f                : return DIKI_F;     
          case XK_g                : return DIKI_G;     
          case XK_h                : return DIKI_H;     
          case XK_i                : return DIKI_I;     
          case XK_j                : return DIKI_J;     
          case XK_k                : return DIKI_K;     
          case XK_l                : return DIKI_L;     
          case XK_m                : return DIKI_M;     
          case XK_n                : return DIKI_N;     
          case XK_o                : return DIKI_O;     
          case XK_p                : return DIKI_P;     
          case XK_q                : return DIKI_Q;     
          case XK_r                : return DIKI_R;     
          case XK_s                : return DIKI_S;     
          case XK_t                : return DIKI_T;     
          case XK_u                : return DIKI_U;     
          case XK_v                : return DIKI_V;     
          case XK_w                : return DIKI_W;     
          case XK_x                : return DIKI_X;     
          case XK_y                : return DIKI_Y;     
          case XK_z                : return DIKI_Z;     
          case XK_0                : return DIKI_0;     
          case XK_1                : return DIKI_1;     
          case XK_2                : return DIKI_2;     
          case XK_3                : return DIKI_3;     
          case XK_4                : return DIKI_4;     
          case XK_5                : return DIKI_5;     
          case XK_6                : return DIKI_6;     
          case XK_7                : return DIKI_7;     
          case XK_8                : return DIKI_8;     
          case XK_9                : return DIKI_9;     
          case XK_F1               : return DIKI_F1;    
          case XK_F2               : return DIKI_F2;    
          case XK_F3               : return DIKI_F3;    
          case XK_F4               : return DIKI_F4;    
          case XK_F5               : return DIKI_F5;    
          case XK_F6               : return DIKI_F6;    
          case XK_F7               : return DIKI_F7;    
          case XK_F8               : return DIKI_F8;    
          case XK_F9               : return DIKI_F9;    
          case XK_F10              : return DIKI_F10;   
          case XK_F11              : return DIKI_F11;   
          case XK_F12              : return DIKI_F12;   

          case XK_Shift_L          : return DIKI_SHIFT_L;     
          case XK_Shift_R          : return DIKI_SHIFT_R;     
          case XK_Control_L        : return DIKI_CONTROL_L;   
          case XK_Control_R        : return DIKI_CONTROL_R;   
          case XK_Alt_L            : return DIKI_ALT_L;       
          case XK_Alt_R            : return DIKI_ALT_R;       
          case XK_Meta_L           : return DIKI_META_L;      
          case XK_Meta_R           : return DIKI_META_R;      
          case XK_Super_L          : return DIKI_SUPER_L;     
          case XK_Super_R          : return DIKI_SUPER_R;     
          case XK_Hyper_L          : return DIKI_HYPER_L;     
          case XK_Hyper_R          : return DIKI_HYPER_R;     
          case XK_Mode_switch      : return DIKI_ALT_R;

          case XK_Caps_Lock        : return DIKI_CAPS_LOCK;   
          case XK_Num_Lock         : return DIKI_NUM_LOCK;    
          case XK_Scroll_Lock      : return DIKI_SCROLL_LOCK; 

          case XK_Escape           : return DIKI_ESCAPE;      
          case XK_Left             : return DIKI_LEFT;        
          case XK_Right            : return DIKI_RIGHT;       
          case XK_Up               : return DIKI_UP;          
          case XK_Down             : return DIKI_DOWN;        

          case XK_Tab              : return DIKI_TAB;
          case XK_ISO_Left_Tab     : return DIKI_TAB;
          case XK_Return           : return DIKI_ENTER;       
          case XK_space            : return DIKI_SPACE;       
          case XK_BackSpace        : return DIKI_BACKSPACE;   
          case XK_Insert           : return DIKI_INSERT;      
          case XK_Delete           : return DIKI_DELETE;      
          case XK_Home             : return DIKI_HOME;       
          case XK_End              : return DIKI_END;        
          case XK_Page_Up          : return DIKI_PAGE_UP;    
          case XK_Page_Down        : return DIKI_PAGE_DOWN;  
          case XK_Print            : return DIKI_PRINT;
          case XK_Pause            : return DIKI_PAUSE;       

          /*  The labels on these keys depend on the type of keyboard.
           *  We've choosen the names from a US keyboard layout. The
           *  comments refer to the ISO 9995 terminology.
           */
          case XK_quoteleft        : return DIKI_QUOTE_LEFT;   /*  TLDE  */
          case XK_minus            : return DIKI_MINUS_SIGN;   /*  AE11  */
          case XK_equal            : return DIKI_EQUALS_SIGN;  /*  AE12  */
          case XK_bracketleft      : return DIKI_BRACKET_LEFT; /*  AD11  */
          case XK_bracketright     : return DIKI_BRACKET_RIGHT;/*  AD12  */
          case XK_backslash        : return DIKI_BACKSLASH;    /*  BKSL  */
          case XK_semicolon        : return DIKI_SEMICOLON;    /*  AC10  */
          case XK_quoteright       : return DIKI_QUOTE_RIGHT;  /*  AC11  */
          case XK_comma            : return DIKI_COMMA;        /*  AB08  */
          case XK_period           : return DIKI_PERIOD;       /*  AB09  */
          case XK_slash            : return DIKI_SLASH;        /*  AB10  */
          case XK_less             : return DIKI_LESS_SIGN;    /*  103rd  */

          case XK_KP_Divide        : return DIKI_KP_DIV;      
          case XK_KP_Multiply      : return DIKI_KP_MULT;     
          case XK_KP_Subtract      : return DIKI_KP_MINUS;    
          case XK_KP_Add           : return DIKI_KP_PLUS;     
          case XK_KP_Enter         : return DIKI_KP_ENTER;    
          case XK_KP_Space         : return DIKI_KP_SPACE;    
          case XK_KP_Tab           : return DIKI_KP_TAB;      
          case XK_KP_F1            : return DIKI_KP_F1;       
          case XK_KP_F2            : return DIKI_KP_F2;       
          case XK_KP_F3            : return DIKI_KP_F3;       
          case XK_KP_F4            : return DIKI_KP_F4;       
          case XK_KP_Equal         : return DIKI_KP_EQUAL;    
          case XK_KP_Separator     : return DIKI_KP_SEPARATOR;
                                   
          case XK_KP_Delete        : return DIKI_KP_DECIMAL;
          case XK_KP_Insert        : return DIKI_KP_0;      
          case XK_KP_End           : return DIKI_KP_1;      
          case XK_KP_Down          : return DIKI_KP_2;      
          case XK_KP_Page_Down     : return DIKI_KP_3;      
          case XK_KP_Left          : return DIKI_KP_4;      
          case XK_KP_Begin         : return DIKI_KP_5;      
          case XK_KP_Right         : return DIKI_KP_6;      
          case XK_KP_Home          : return DIKI_KP_7;      
          case XK_KP_Up            : return DIKI_KP_8;      
          case XK_KP_Page_Up       : return DIKI_KP_9;

          case XK_KP_Decimal       : return DIKI_KP_DECIMAL;
          case XK_KP_0             : return DIKI_KP_0;      
          case XK_KP_1             : return DIKI_KP_1;      
          case XK_KP_2             : return DIKI_KP_2;      
          case XK_KP_3             : return DIKI_KP_3;      
          case XK_KP_4             : return DIKI_KP_4;      
          case XK_KP_5             : return DIKI_KP_5;      
          case XK_KP_6             : return DIKI_KP_6;      
          case XK_KP_7             : return DIKI_KP_7;      
          case XK_KP_8             : return DIKI_KP_8;      
          case XK_KP_9             : return DIKI_KP_9;

          case 0                   : break;

          default:
               D_DEBUG("X11: Unknown key symbol 0x%lx\n", xKeySymbol);
     }    

     return DIKI_UNKNOWN;
}

static DFBInputDeviceKeySymbol
xsymbol_to_symbol( KeySym xKeySymbol )
{
     if (xKeySymbol >= 0x20 && xKeySymbol <= 0xff)
          return xKeySymbol;

     if (xKeySymbol >= XK_F1 && xKeySymbol <= XK_F35)
          return DFB_FUNCTION_KEY( xKeySymbol - XK_F1 + 1 );

     switch (xKeySymbol) {
          case XK_Shift_L          : return DIKS_SHIFT;
          case XK_Shift_R          : return DIKS_SHIFT;     
          case XK_Control_L        : return DIKS_CONTROL;   
          case XK_Control_R        : return DIKS_CONTROL;   
          case XK_Alt_L            : return DIKS_ALT;       
          case XK_Alt_R            : return DIKS_ALT;       
          case XK_Meta_L           : return DIKS_META;      
          case XK_Meta_R           : return DIKS_META;      
          case XK_Super_L          : return DIKS_SUPER;     
          case XK_Super_R          : return DIKS_SUPER;     
          case XK_Hyper_L          : return DIKS_HYPER;     
          case XK_Hyper_R          : return DIKS_HYPER;     
          case XK_Mode_switch      : return DIKS_ALTGR;

          case XK_Caps_Lock        : return DIKS_CAPS_LOCK;   
          case XK_Num_Lock         : return DIKS_NUM_LOCK;    
          case XK_Scroll_Lock      : return DIKS_SCROLL_LOCK; 

          case XK_Escape           : return DIKS_ESCAPE;      
          case XK_Left             : return DIKS_CURSOR_LEFT;
          case XK_Right            : return DIKS_CURSOR_RIGHT;       
          case XK_Up               : return DIKS_CURSOR_UP;          
          case XK_Down             : return DIKS_CURSOR_DOWN;        

          case XK_Tab              : return DIKS_TAB;
          case XK_ISO_Left_Tab     : return DIKS_TAB;
          case XK_Return           : return DIKS_ENTER;       
          case XK_space            : return DIKS_SPACE;       
          case XK_BackSpace        : return DIKS_BACKSPACE;   
          case XK_Insert           : return DIKS_INSERT;      
          case XK_Delete           : return DIKS_DELETE;      
          case XK_Home             : return DIKS_HOME;       
          case XK_End              : return DIKS_END;        
          case XK_Page_Up          : return DIKS_PAGE_UP;    
          case XK_Page_Down        : return DIKS_PAGE_DOWN;  
          case XK_Print            : return DIKS_PRINT;
          case XK_Pause            : return DIKS_PAUSE;       

          case XK_KP_Divide        : return DIKS_SLASH;
          case XK_KP_Multiply      : return DIKS_ASTERISK;     
          case XK_KP_Subtract      : return DIKS_MINUS_SIGN;    
          case XK_KP_Add           : return DIKS_PLUS_SIGN;     
          case XK_KP_Enter         : return DIKS_ENTER;    
          case XK_KP_Space         : return DIKS_SPACE;    
          case XK_KP_Tab           : return DIKS_TAB;      
          case XK_KP_F1            : return DIKS_F1;       
          case XK_KP_F2            : return DIKS_F2;       
          case XK_KP_F3            : return DIKS_F3;       
          case XK_KP_F4            : return DIKS_F4;       
          case XK_KP_Equal         : return DIKS_EQUALS_SIGN;    
          case XK_KP_Separator     : return DIKS_COLON; /* FIXME: what is a separator */
                                   
          case XK_KP_Delete        : return DIKS_DELETE;
          case XK_KP_Insert        : return DIKS_INSERT;      
          case XK_KP_End           : return DIKS_END;      
          case XK_KP_Down          : return DIKS_CURSOR_DOWN;      
          case XK_KP_Page_Down     : return DIKS_PAGE_DOWN;      
          case XK_KP_Left          : return DIKS_CURSOR_LEFT;      
          case XK_KP_Begin         : return DIKS_BEGIN;      
          case XK_KP_Right         : return DIKS_CURSOR_RIGHT;      
          case XK_KP_Home          : return DIKS_HOME;      
          case XK_KP_Up            : return DIKS_CURSOR_UP;      
          case XK_KP_Page_Up       : return DIKS_PAGE_UP;

          case XK_KP_Decimal       : return DIKS_PERIOD;
          case XK_KP_0             : return DIKS_0;      
          case XK_KP_1             : return DIKS_1;      
          case XK_KP_2             : return DIKS_2;      
          case XK_KP_3             : return DIKS_3;      
          case XK_KP_4             : return DIKS_4;      
          case XK_KP_5             : return DIKS_5;      
          case XK_KP_6             : return DIKS_6;      
          case XK_KP_7             : return DIKS_7;      
          case XK_KP_8             : return DIKS_8;      
          case XK_KP_9             : return DIKS_9;

          case 0                   : break;

          default:
               D_DEBUG("X11: Unknown key symbol 0x%lx\n", xKeySymbol);
     }    

     return DIKS_NULL;
}



static void handleMouseEvent(XEvent* pXEvent, X11InputData* pData)
{
     static int          iMouseEventCount = 0;
     DFBInputEvent  dfbEvent;
     if (pXEvent->type == MotionNotify) {
          motion_compress( pXEvent->xmotion.x, pXEvent->xmotion.y, pXEvent );
          ++iMouseEventCount;
     }

     if ( pXEvent->type == ButtonPress || pXEvent->type == ButtonRelease ) {
          if ( pXEvent->type == ButtonPress )
               dfbEvent.type = DIET_BUTTONPRESS;
          else
               dfbEvent.type = DIET_BUTTONRELEASE;

          dfbEvent.flags = DIEF_TIMESTAMP;

          /* Get pressed button */
          switch ( pXEvent->xbutton.button ) {
               case 1:
                    dfbEvent.button = DIBI_LEFT;
                    break;
               case 2:
                    dfbEvent.button = DIBI_MIDDLE;
                    break;
               case 3:
                    dfbEvent.button = DIBI_RIGHT;
                    break;
                    //Wheel events
               case 4: /*up*/
               case 5: /*down*/
               case 6: /*left*/
               case 7: /*right*/
                    if (pXEvent->type == ButtonPress) {
                         dfbEvent.type = DIET_AXISMOTION;
                         dfbEvent.flags = DIEF_AXISREL;
                         dfbEvent.axis = DIAI_Z;
                         /*SCROLL UP*/
                         if ( pXEvent->xbutton.button == 4 ) {
                              dfbEvent.axisrel = -1;
                         }
                         /*SCROLL DOWN */
                         else if (pXEvent->xbutton.button == 5) {
                              dfbEvent.axisrel = 1;
                         }
                         /*SCROLL LEFT*/
                         else if (pXEvent->xbutton.button == 6) {
                              dfbEvent.axis = DIAI_X;
                              dfbEvent.axisrel = -1;
                         }
                         /*SCROLL RIGHT*/
                         else if (pXEvent->xbutton.button == 7 ) {
                              dfbEvent.axis = DIAI_X;
                              dfbEvent.axisrel = 1;
                         }
                    }
                    else
                         return;
                    break;
               default:
                    break;
          }

          dfbEvent.timestamp.tv_sec  =  pXEvent->xbutton.time / 1000;
          dfbEvent.timestamp.tv_usec = (pXEvent->xbutton.time % 1000) * 1000;

          dfb_input_dispatch( pData->device, &dfbEvent );
          ++iMouseEventCount;
     }
}

static void
handle_expose( const XExposeEvent *expose )
{
     CoreLayer               *layer = dfb_layer_at( DLID_PRIMARY );
     const DisplayLayerFuncs *funcs = layer->funcs;
     CoreLayerContext        *context;

     D_ASSERT( funcs != NULL );
     D_ASSERT( funcs->UpdateRegion != NULL );

     /* Get the currently active context. */
     if (dfb_layer_get_active_context( layer, &context ) == DFB_OK) {
          CoreLayerRegion *region;

          /* Get the first region. */
          if (dfb_layer_context_get_primary_region( context,
                                                    false, ®ion ) == DFB_OK)
          {
               /* Lock the region to avoid tearing due to concurrent updates. */
               dfb_layer_region_lock( region );

               /* Get the surface of the region. */
               if (region->surface && region->surface_lock.buffer) {
                    DFBRegion update = { expose->x, expose->y,
                                         expose->x + expose->width  - 1,
                                         expose->y + expose->height - 1 };

                    funcs->UpdateRegion( layer, layer->driver_data, layer->layer_data,
                                         region->region_data, region->surface, &update, ®ion->surface_lock );
               }

               /* Unlock the region. */
               dfb_layer_region_unlock( region );

               /* Release the region. */
               dfb_layer_region_unref( region );
          }

          /* Release the context. */
          dfb_layer_context_unref( context );
     }
}

/*
 * Input thread reading from device.
 * Generates events on incoming data.
 */
static void*
x11EventThread( DirectThread *thread, void *driver_data )
{
     X11InputData *data   = driver_data;
     DFBX11       *x11    = data->x11;
     DFBX11Shared *shared = x11->shared;

     while (!data->stop) {
          unsigned int  pull = 23;
          XEvent        xEvent; 
          DFBInputEvent dfbEvent;

          /* FIXME: Detect key repeats, we're receiving KeyPress, KeyRelease, KeyPress, KeyRelease... !!?? */

          if (!shared->xw || !shared->xw->window) {
               /* no window, so no event */
               usleep( 50000 );
               continue;
          }

          usleep( 10000 );

          XLockDisplay( x11->display );

          while (!data->stop && pull-- && XPending( x11->display )) {
               XNextEvent( x11->display, &xEvent );

               XUnlockDisplay( x11->display );

               switch (xEvent.type) {
                    case ButtonPress:
                    case ButtonRelease:
                         motion_realize( data );
                    case MotionNotify:
                         handleMouseEvent( &xEvent, data ); // crash ???
                         break;

                    case KeyPress:
                    case KeyRelease: {
                         motion_realize( data );

                         dfbEvent.type     = (xEvent.type == KeyPress) ? DIET_KEYPRESS : DIET_KEYRELEASE;
                         dfbEvent.flags    = DIEF_KEYCODE | DIEF_TIMESTAMP;
                         dfbEvent.key_code = xEvent.xkey.keycode;

                         dfbEvent.timestamp.tv_sec  =  xEvent.xkey.time / 1000;
                         dfbEvent.timestamp.tv_usec = (xEvent.xkey.time % 1000) * 1000;

                         dfb_input_dispatch( data->device, &dfbEvent );
                         break;
                    }

                    case Expose:
                         handle_expose( &xEvent.xexpose );
                         break;

                    case DestroyNotify:
                         /* this event is mainly to unblock XNextEvent. */
                         break;

                    default:
                         break;
               }

               XLockDisplay( x11->display );
          }

          XUnlockDisplay( x11->display );

          if (!data->stop)
               motion_realize( data );
     }

     return NULL;
}

/* exported symbols */

/*
 * Return the number of available devices.
 * Called once during initialization of DirectFB.
 */
static int
driver_get_available( void )
{
     return dfb_system_type() == CORE_X11;
}

/*
 * Fill out general information about this driver.
 * Called once during initialization of DirectFB.
 */
static void
driver_get_info( InputDriverInfo *info )
{
     /* fill driver info structure */
     snprintf ( info->name,   DFB_INPUT_DRIVER_INFO_NAME_LENGTH, "X11 Input Driver" );
     snprintf ( info->vendor, DFB_INPUT_DRIVER_INFO_VENDOR_LENGTH, "directfb.org" );

     info->version.major = 0;
     info->version.minor = 1;
}

/*
 * 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 )
{
     X11InputData *data;
     DFBX11       *x11    = dfb_system_data();
     DFBX11Shared *shared = x11->shared;

     fusion_skirmish_prevail( &shared->lock );

     fusion_skirmish_dismiss( &shared->lock );

     /* set device vendor and name */
     snprintf( info->desc.vendor, DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH, "XServer" );
     snprintf( info->desc.name,   DFB_INPUT_DEVICE_DESC_NAME_LENGTH, "X11 Input" );

     /* set one of the primary input device IDs */
     info->prefered_id = DIDID_KEYBOARD;

     /* set type flags */
     info->desc.type   = DIDTF_JOYSTICK | DIDTF_KEYBOARD | DIDTF_MOUSE;

     /* set capabilities */
     info->desc.caps   = DICAPS_ALL;

     /* enable translation of fake raw hardware keycodes */
     info->desc.min_keycode = 8;
     info->desc.max_keycode = 255;


     /* allocate and fill private data */
     data = D_CALLOC( 1, sizeof(X11InputData) );

     data->device = device;
     data->x11    = x11;

     /* start input thread */
     data->thread = direct_thread_create( DTT_INPUT, x11EventThread, data, "X11 Input" );

     /* set private data pointer */
     *driver_data = data;

     return DFB_OK;
}

/*
 * Fetch one entry from the device's keymap if supported.
 * this does a fake mapping based on the orginal DFB code
 */
static DFBResult
driver_get_keymap_entry( CoreInputDevice           *device,
                         void                      *driver_data,
                         DFBInputDeviceKeymapEntry *entry )
{
     int           i;
     X11InputData *data = driver_data;
     DFBX11       *x11  = data->x11;

     XLockDisplay( x11->display );

     for (i=0; i<4; i++) {
          KeySym xSymbol = XKeycodeToKeysym( x11->display, entry->code, i );

          if (i == 0)
               entry->identifier = xsymbol_to_id( xSymbol );

          entry->symbols[i] = xsymbol_to_symbol( xSymbol );
     }

     XUnlockDisplay( x11->display );

     /* is CapsLock effective? */
     if (entry->identifier >= DIKI_A && entry->identifier <= DIKI_Z)
          entry->locks |= DILS_CAPS;

     /* is NumLock effective? */
     if (entry->identifier >= DIKI_KP_DECIMAL && entry->identifier <= DIKI_KP_9)
          entry->locks |= DILS_NUM;

     return DFB_OK;
}

/*
 * End thread, close device and free private data.
 */
static void
driver_close_device( void *driver_data )
{
     X11InputData *data   = driver_data;
     DFBX11       *x11    = data->x11;
     DFBX11Shared *shared = x11->shared;

     /* stop input thread */
     data->stop = true;

     XLockDisplay( x11->display );

     if (shared->xw) {
          XWindow *xw = shared->xw;

          shared->xw = NULL;

          /* the window must generate an event, otherwise the input thread will not end */
          dfb_x11_close_window( x11, xw );
     }

     XSync( x11->display, False );

     XUnlockDisplay( x11->display );

     /* it is possible that this "close" function is called from the same
      * thread that the input device is actually running on.
      * This happens when you e.g. click the close box with your mouse.
      * As a fix, we check if we are this thread. */
     if (data->thread != direct_thread_self()) {
          direct_thread_join( data->thread );
          direct_thread_destroy( data->thread );
     }

     /* free private data */
     D_FREE ( data );
}

�������������������������������������������������������������DirectFB-1.2.10/systems/x11/Makefile.in�������������������������������������������������������������0000644�0001750�0001750�00000046650�11307521507�014337� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@

# Makefile.am for DirectFB/systems/x11


VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
	$(top_srcdir)/rules/libobject.make
subdir = systems/x11
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(systemsdir)"
systemsLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(systems_LTLIBRARIES)
libdirectfb_x11_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_x11_la_OBJECTS = primary.lo surfacemanager.lo \
	vpsmem_surface_pool.lo x11.lo x11image.lo x11input.lo \
	x11_surface_pool.lo xwindow.lo
libdirectfb_x11_la_OBJECTS = $(am_libdirectfb_x11_la_OBJECTS)
libdirectfb_x11_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_x11_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
SOURCES = $(libdirectfb_x11_la_SOURCES)
DIST_SOURCES = $(libdirectfb_x11_la_SOURCES)
systemsDATA_INSTALL = $(INSTALL_DATA)
DATA = $(systems_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src		\
	$(X11_CFLAGS)

systemsdir = $(MODULEDIR)/systems
@BUILD_STATIC_TRUE@systems_DATA = libdirectfb_x11.o
systems_LTLIBRARIES = libdirectfb_x11.la
libdirectfb_x11_la_LDFLAGS = \
	$(X11_LIBS)	\
	-avoid-version	\
	-module

libdirectfb_x11_la_SOURCES = \
	primary.c		\
	primary.h		\
	surfacemanager.c	\
	surfacemanager.h	\
	vpsmem_surface_pool.c	\
	vpsmem_surface_pool.h	\
	x11.c			\
	x11.h			\
	x11image.c		\
	x11image.h		\
	x11input.c		\
	x11_surface_pool.c	\
	x11_surface_pool.h	\
	x11types.h		\
	xwindow.h		\
	xwindow.c

libdirectfb_x11_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/x11/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/x11/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-systemsLTLIBRARIES: $(systems_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	  else :; fi; \
	done

uninstall-systemsLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(systemsdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(systemsdir)/$$p"; \
	done

clean-systemsLTLIBRARIES:
	-test -z "$(systems_LTLIBRARIES)" || rm -f $(systems_LTLIBRARIES)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libdirectfb_x11.la: $(libdirectfb_x11_la_OBJECTS) $(libdirectfb_x11_la_DEPENDENCIES) 
	$(libdirectfb_x11_la_LINK) -rpath $(systemsdir) $(libdirectfb_x11_la_OBJECTS) $(libdirectfb_x11_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primary.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/surfacemanager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vpsmem_surface_pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11_surface_pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11image.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11input.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xwindow.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-systemsDATA: $(systems_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(systemsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	  $(systemsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	done

uninstall-systemsDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(systemsdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(systemsdir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
	for dir in "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(systemsdir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool clean-systemsLTLIBRARIES \
	mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-systemsDATA install-systemsLTLIBRARIES

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-systemsDATA uninstall-systemsLTLIBRARIES

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool clean-systemsLTLIBRARIES ctags distclean \
	distclean-compile distclean-generic distclean-libtool \
	distclean-tags distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip install-systemsDATA install-systemsLTLIBRARIES \
	installcheck installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

%.o: .libs/%.a %.la
	rm -f $<.tmp/*.o
	if test -d $<.tmp; then rmdir $<.tmp; fi
	mkdir $<.tmp
	(cd $<.tmp && $(AR) x ../../$<)
	$(LD) -o $@ -r $<.tmp/*.o
	rm -f $<.tmp/*.o && rmdir $<.tmp

.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
����������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/xwindow.c���������������������������������������������������������������0000644�0001750�0001750�00000022106�11245562152�014125� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#include <directfb_util.h>

#include <direct/mem.h>

#include "x11.h"


static bool use_shm = true;

static int
error_handler_shm( Display *display, XErrorEvent *event )
{
     if (use_shm) {
          D_INFO( "X11/Display: Error! Disabling XShm.\n" );

          use_shm = false;
     }

     return 0;
}


static int error_code = 0;

static int
error_handler( Display *display, XErrorEvent *event )
{
     char buf[512];

     XGetErrorText( display, event->error_code, buf, sizeof(buf) );

     D_ERROR( "X11/Display: Error! %s\n", buf );

     error_code = event->error_code;

     return 0;
}

Bool
dfb_x11_open_window( DFBX11 *x11, XWindow** ppXW, int iXPos, int iYPos, int iWidth, int iHeight, DFBSurfacePixelFormat format )
{
     XWindow              *xw;
     XSetWindowAttributes  attr = { .background_pixmap = 0 };

     D_INFO( "X11/Window: Creating %4dx%4d %s window...\n", iWidth, iHeight, dfb_pixelformat_name(format) );

     xw = D_CALLOC( 1, sizeof(XWindow) );
     if (!xw)
          return D_OOM();

     /* We set the structure as needed for our window */
     xw->width   = iWidth;
     xw->height  = iHeight;
     xw->display = x11->display;

     xw->screenptr = DefaultScreenOfDisplay(xw->display);
     xw->screennum = DefaultScreen(xw->display);
     xw->depth     = DFB_COLOR_BITS_PER_PIXEL(format) + DFB_ALPHA_BITS_PER_PIXEL(format);
     xw->visual    = x11->visuals[DFB_PIXELFORMAT_INDEX(format)] ?: DefaultVisualOfScreen(xw->screenptr);

     attr.event_mask = 
            ButtonPressMask
          | ButtonReleaseMask
          | PointerMotionMask
          | KeyPressMask
          | KeyReleaseMask
          | ExposureMask
          | StructureNotifyMask;

     XLockDisplay( x11->display );

     XSetErrorHandler( error_handler );

     error_code = 0;

     xw->window = XCreateWindow( xw->display,
                                 RootWindowOfScreen(xw->screenptr),
                                 iXPos, iYPos, iWidth, iHeight, 0, xw->depth, InputOutput,
                                 xw->visual, CWEventMask, &attr );
     XSync( xw->display, False );
     if (!xw->window || error_code) {
          D_FREE( xw );
          XUnlockDisplay( x11->display );
          return False;
     }


     XSizeHints Hints;

     /*
      * Here we inform the function of what we are going to change for the
      * window (there's also PPosition but it's obsolete)
      */
     Hints.flags    =    PSize | PMinSize | PMaxSize;

     /*
      * Now we set the structure to the values we need for width & height.
      * For esthetic reasons we set Width=MinWidth=MaxWidth.
      * The same goes for Height. You can try whith differents values, or
      * let's use Hints.flags=Psize; and resize your window..
      */
     Hints.min_width          =    Hints.max_width          =    Hints.base_width    =    xw->width;
     Hints.min_height    =    Hints.max_height    =    Hints.base_height   =    xw->height;

     /* Now we can set the size hints for the specified window */
     XSetWMNormalHints(xw->display,xw->window,&Hints);

     /* We change the title of the window (default:Untitled) */
     XStoreName(xw->display,xw->window,"DFB X11 system window");

     xw->gc = XCreateGC(xw->display, xw->window, 0, NULL);

     // Create a null cursor
     XColor  fore;
     XColor  back;
     char    zero = 0;

     xw->pixmp1     = XCreateBitmapFromData( xw->display, xw->window, &zero, 1, 1 );
     xw->pixmp2     = XCreateBitmapFromData( xw->display, xw->window, &zero, 1, 1 );

     xw->NullCursor = XCreatePixmapCursor( xw->display, xw->pixmp1, xw->pixmp2, &fore, &back, 0, 0 );

     XDefineCursor( xw->display, xw->window, xw->NullCursor );


     /* maps the window and raises it to the top of the stack */
     XMapRaised( xw->display, xw->window );


     if (x11->use_shm) {
          // Shared memory 	
          xw->shmseginfo=(XShmSegmentInfo *)D_CALLOC(1, sizeof(XShmSegmentInfo));
          if (!xw->shmseginfo) {
               x11->use_shm = false;
               goto no_shm;
          }

          xw->ximage=XShmCreateImage(xw->display, xw->visual, xw->depth, ZPixmap,
                                     NULL,xw->shmseginfo, xw->width, xw->height * 2);
          XSync( xw->display, False );
          if (!xw->ximage || error_code) {
               D_ERROR("X11: Error creating shared image (XShmCreateImage) \n");
               x11->use_shm = false;
               D_FREE(xw->shmseginfo);
               error_code = 0;
               goto no_shm;
          }

          xw->bpp = (xw->ximage->bits_per_pixel + 7) / 8;

          /* we firstly create our shared memory segment with the size we need, and
          correct permissions for the owner, the group and the world --> 0777 */
          xw->shmseginfo->shmid=shmget(IPC_PRIVATE, 
                                       xw->ximage->bytes_per_line * xw->ximage->height * 2,
                                       IPC_CREAT|0777);

          if (xw->shmseginfo->shmid<0) {
               x11->use_shm = false;
               XDestroyImage(xw->ximage);
               D_FREE(xw->shmseginfo);
               goto no_shm;
          }

          /* Then, we have to attach the segment to our process, and we let the
          function search the correct memory place --> NULL. It's safest ! */
          xw->shmseginfo->shmaddr = shmat( xw->shmseginfo->shmid, NULL, 0 );
          if (!xw->shmseginfo->shmaddr) {
               x11->use_shm = false;
               shmctl(xw->shmseginfo->shmid,IPC_RMID,NULL);
               XDestroyImage(xw->ximage);
               D_FREE(xw->shmseginfo);
               goto no_shm;
          }

          /* We set the buffer in Read and Write mode */
          xw->shmseginfo->readOnly=False;

          xw->virtualscreen= xw->ximage->data = xw->shmseginfo->shmaddr;


          XSetErrorHandler( error_handler_shm );

          XShmAttach(x11->display,xw->shmseginfo);

          XShmPutImage(x11->display, xw->window, xw->gc, xw->ximage,
                       0, 0, 0, 0, 1, 1, False);

          XSync(x11->display, False);

          XSetErrorHandler( error_handler );

          if (!x11->use_shm) {
               shmdt(xw->shmseginfo->shmaddr);
               shmctl(xw->shmseginfo->shmid,IPC_RMID,NULL);
               XDestroyImage(xw->ximage);
               D_FREE(xw->shmseginfo);
          }
     }

no_shm:
     if (!x11->use_shm) {
          int pitch;

          xw->bpp = (xw->depth > 16) ? 4 :
                    (xw->depth >  8) ? 2 : 1;

          pitch = (xw->bpp * xw->width + 3) & ~3;

          xw->virtualscreen = D_MALLOC( 2 * xw->height * pitch );

          xw->ximage = XCreateImage( xw->display, xw->visual, xw->depth, ZPixmap, 0,
                                     xw->virtualscreen, xw->width, xw->height * 2, 32, pitch );
          XSync( xw->display, False );
          if (!xw->ximage || error_code) {
               D_ERROR( "X11/Window: XCreateImage( Visual %02lu, depth %d, size %dx%d, buffer %p [%d] ) failed!\n",
                        xw->visual->visualid, xw->depth, xw->width, xw->height * 2, xw->virtualscreen, pitch );
               XFreeGC(xw->display,xw->gc);
               XDestroyWindow(xw->display,xw->window);
               XSetErrorHandler( NULL );
               XUnlockDisplay( x11->display );
               D_FREE( xw );
               return False;
          }
     }

     XSetErrorHandler( NULL );

     XUnlockDisplay( x11->display );

     D_INFO( "X11/Display: %ssing XShm.\n", x11->use_shm ? "U" : "Not u" );

     (*ppXW) = xw;

     return True;
}

void
dfb_x11_close_window( DFBX11 *x11, XWindow* xw )
{
     if (x11->use_shm) {
          XShmDetach(xw->display, xw->shmseginfo);
          shmdt(xw->shmseginfo->shmaddr);
          shmctl(xw->shmseginfo->shmid,IPC_RMID,NULL);
          D_FREE(xw->shmseginfo);
     }
     else
          D_FREE( xw->virtualscreen );

     XDestroyImage(xw->ximage);

     XFreeGC(xw->display,xw->gc);
     XDestroyWindow(xw->display,xw->window);
	
     D_FREE(xw);
}

����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/x11image.c��������������������������������������������������������������0000644�0001750�0001750�00000013725�11245562152�014051� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#include "x11.h"
#include "x11image.h"

/**********************************************************************************************************************/

DFBResult x11ImageInit( DFBX11                *x11,
                        x11Image              *image,
                        int                    width,
                        int                    height,
                        DFBSurfacePixelFormat  format )
{
     int           ret;
     Visual       *visual;
     DFBX11Shared *shared = x11->shared;

     if (!x11->use_shm)
          return DFB_UNSUPPORTED;

     /* Lookup visual. */
     visual = x11->visuals[DFB_PIXELFORMAT_INDEX(format)];
     if (!visual)
          return DFB_UNSUPPORTED;

     /* For probing. */
     if (!image)
          return DFB_OK;

     image->width  = width;
     image->height = height;
     image->format = format;
     image->depth  = DFB_COLOR_BITS_PER_PIXEL( format );

     D_MAGIC_SET( image, x11Image );

     if (fusion_call_execute( &shared->call, FCEF_NONE, X11_IMAGE_INIT, image, &ret )) {
          D_MAGIC_CLEAR( image );
          return DFB_FUSION;
     }

     if (ret) {
          D_DERROR( ret, "X11/Image: X11_IMAGE_INIT call failed!\n" );
          D_MAGIC_CLEAR( image );
          return ret;
     }

     return DFB_OK;
}

DFBResult
x11ImageDestroy( DFBX11   *x11,
                 x11Image *image )
{
     int           ret;
     DFBX11Shared *shared = x11->shared;

     D_MAGIC_ASSERT( image, x11Image );

     if (fusion_call_execute( &shared->call, FCEF_NONE, X11_IMAGE_DESTROY, image, &ret ))
          return DFB_FUSION;

     if (ret) {
          D_DERROR( ret, "X11/Image: X11_IMAGE_DESTROY call failed!\n" );
          return ret;
     }

     D_MAGIC_CLEAR( image );

     return DFB_OK;
}

DFBResult
x11ImageAttach( x11Image  *image,
                void     **ret_addr )
{
     void *addr;

     D_MAGIC_ASSERT( image, x11Image );
     D_ASSERT( ret_addr != NULL );

     /* FIXME: We also need to DETACH! */

     addr = shmat( image->seginfo.shmid, NULL, 0 );
     if (!addr) {
          int erno = errno;

          D_PERROR( "X11/Image: shmat( %d ) failed!\n", image->seginfo.shmid );

          return errno2result( erno );
     }

     *ret_addr = addr;

     return DFB_OK;
}

/**********************************************************************************************************************/

DFBResult
dfb_x11_image_init_handler( DFBX11 *x11, x11Image *image )
{
     Visual *visual;
     XImage *ximage;

     D_MAGIC_ASSERT( image, x11Image );

     if (!x11->use_shm)
          return DFB_UNSUPPORTED;

     /* Lookup visual. */
     visual = x11->visuals[DFB_PIXELFORMAT_INDEX(image->format)];
     if (!visual)
          return DFB_UNSUPPORTED;

     image->visual = visual;

     XLockDisplay( x11->display );

     ximage = XShmCreateImage( x11->display, image->visual, image->depth,
                               ZPixmap, NULL, &image->seginfo, image->width, image->height );
     if (!ximage) {
          D_ERROR( "X11/ShmImage: Error creating shared image (XShmCreateImage)!\n");
          XUnlockDisplay( x11->display );
          return DFB_FAILURE;
     }

     /* we firstly create our shared memory segment with the size we need, and
      correct permissions for the owner, the group and the world --> 0777 */
     image->seginfo.shmid = shmget( IPC_PRIVATE, 
                                    ximage->bytes_per_line * ximage->height,
                                    IPC_CREAT | 0777 );
     if (image->seginfo.shmid < 0)
          goto error;

     /* Then, we have to attach the segment to our process, and we let the
        function search the correct memory place --> NULL. It's safest ! */
     image->seginfo.shmaddr = shmat( image->seginfo.shmid, NULL, 0 );
     if (!image->seginfo.shmaddr)
          goto error_shmat;

     ximage->data = image->seginfo.shmaddr;

     /* We set the buffer in Read and Write mode */
     image->seginfo.readOnly = False;

     if (!XShmAttach( x11->display, &image->seginfo ))
          goto error_xshmattach;

     image->ximage = ximage;
     image->pitch  = ximage->bytes_per_line;

     XUnlockDisplay( x11->display );

     return DFB_OK;


error_xshmattach:
     shmdt( image->seginfo.shmaddr );

error_shmat:
     shmctl( image->seginfo.shmid, IPC_RMID, NULL );

error:
     XDestroyImage( ximage );

     XUnlockDisplay( x11->display );

     return DFB_FAILURE;
}

DFBResult
dfb_x11_image_destroy_handler( DFBX11 *x11, x11Image *image )
{
     D_MAGIC_ASSERT( image, x11Image );

     XLockDisplay( x11->display );

     XShmDetach( x11->display, &image->seginfo );

     XDestroyImage( image->ximage );

     XUnlockDisplay( x11->display );

     shmdt( image->seginfo.shmaddr );

     shmctl( image->seginfo.shmid, IPC_RMID, NULL );

     return DFB_OK;
}

�������������������������������������������DirectFB-1.2.10/systems/x11/x11types.h��������������������������������������������������������������0000644�0001750�0001750�00000002434�11245562152�014133� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SYSTEMS_X11TYPES_H__
#define __SYSTEMS_X11TYPES_H__

typedef struct __DFB_X11 DFBX11;

#endif /* __SYSTEMS_X11TYPES_H__ */

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/vpsmem_surface_pool.c���������������������������������������������������0000644�0001750�0001750�00000030541�11245562152�016500� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <direct/debug.h>
#include <direct/mem.h>

#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/surface_pool.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include "x11.h"
#include "surfacemanager.h"

D_DEBUG_DOMAIN( VPSMem_Surfaces, "VPSMem/Surfaces", "VPSMem Framebuffer Surface Pool" );
D_DEBUG_DOMAIN( VPSMem_SurfLock, "VPSMem/SurfLock", "VPSMem Framebuffer Surface Pool Locks" );

/**********************************************************************************************************************/

typedef struct {
     int             magic;

     SurfaceManager *manager;

     void           *mem;
     unsigned int    length;
} VPSMemPoolData;

typedef struct {
     int             magic;

     CoreDFB        *core;
} VPSMemPoolLocalData;

typedef struct {
     int   magic;

     int   offset;
     int   pitch;
     int   size;

     Chunk *chunk;
} VPSMemAllocationData;

/**********************************************************************************************************************/

static int
vpsmemPoolDataSize( void )
{
     return sizeof(VPSMemPoolData);
}

static int
vpsmemPoolLocalDataSize( void )
{
     return sizeof(VPSMemPoolLocalData);
}

static int
vpsmemAllocationDataSize( void )
{
     return sizeof(VPSMemAllocationData);
}

static DFBResult
vpsmemInitPool( CoreDFB                    *core,
                CoreSurfacePool            *pool,
                void                       *pool_data,
                void                       *pool_local,
                void                       *system_data,
                CoreSurfacePoolDescription *ret_desc )
{
     DFBResult            ret;
     VPSMemPoolData      *data   = pool_data;
     VPSMemPoolLocalData *local  = pool_local;
     DFBX11              *x11    = system_data;
     DFBX11Shared        *shared = x11->shared;

     D_DEBUG_AT( VPSMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_ASSERT( core != NULL );
     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_ASSERT( data != NULL );
     D_ASSERT( local != NULL );
     D_ASSERT( ret_desc != NULL );

     data->mem = SHMALLOC( shared->data_shmpool, shared->vpsmem_length );
     if (!data->mem) {
          shared->vpsmem_length = 0;
          return D_OOSHM();
     }

     data->length = shared->vpsmem_length;

     ret = dfb_surfacemanager_create( core, data->length, &data->manager );
     if (ret)
          return ret;

     ret_desc->caps     = CSPCAPS_NONE;
     ret_desc->access   = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE | CSAF_SHARED;
     ret_desc->types    = CSTF_LAYER | CSTF_WINDOW | CSTF_CURSOR | CSTF_FONT | CSTF_SHARED | CSTF_EXTERNAL;
     ret_desc->priority = CSPP_DEFAULT;
     ret_desc->size     = data->length;

     snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "Virtual Physical" );

     local->core = core;

     D_MAGIC_SET( data, VPSMemPoolData );
     D_MAGIC_SET( local, VPSMemPoolLocalData );

     return DFB_OK;
}

static DFBResult
vpsmemJoinPool( CoreDFB                    *core,
                CoreSurfacePool            *pool,
                void                       *pool_data,
                void                       *pool_local,
                void                       *system_data )
{
     VPSMemPoolData      *data  = pool_data;
     VPSMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( VPSMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_ASSERT( core != NULL );
     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_ASSERT( local != NULL );

     (void) data;

     local->core = core;

     D_MAGIC_SET( local, VPSMemPoolLocalData );

     return DFB_OK;
}

static DFBResult
vpsmemDestroyPool( CoreSurfacePool *pool,
                   void            *pool_data,
                   void            *pool_local )
{
     VPSMemPoolData      *data  = pool_data;
     VPSMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( VPSMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( local, VPSMemPoolLocalData );

     dfb_surfacemanager_destroy( data->manager );

     D_MAGIC_CLEAR( data );
     D_MAGIC_CLEAR( local );

     return DFB_OK;
}

static DFBResult
vpsmemLeavePool( CoreSurfacePool *pool,
                void            *pool_data,
                void            *pool_local )
{
     VPSMemPoolData      *data  = pool_data;
     VPSMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( VPSMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( local, VPSMemPoolLocalData );

     (void) data;

     D_MAGIC_CLEAR( local );

     return DFB_OK;
}

static DFBResult
vpsmemTestConfig( CoreSurfacePool         *pool,
                  void                    *pool_data,
                  void                    *pool_local,
                  CoreSurfaceBuffer       *buffer,
                  const CoreSurfaceConfig *config )
{
     DFBResult            ret;
     CoreSurface         *surface;
     VPSMemPoolData      *data  = pool_data;
     VPSMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( VPSMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( local, VPSMemPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     ret = dfb_surfacemanager_allocate( local->core, data->manager, buffer, NULL, NULL );

     D_DEBUG_AT( VPSMem_Surfaces, "  -> %s\n", DirectFBErrorString(ret) );

     return ret;
}

static DFBResult
vpsmemAllocateBuffer( CoreSurfacePool       *pool,
                      void                  *pool_data,
                      void                  *pool_local,
                      CoreSurfaceBuffer     *buffer,
                      CoreSurfaceAllocation *allocation,
                      void                  *alloc_data )
{
     DFBResult             ret;
     Chunk                *chunk;
     CoreSurface          *surface;
     VPSMemPoolData       *data  = pool_data;
     VPSMemPoolLocalData  *local = pool_local;
     VPSMemAllocationData *alloc = alloc_data;

     D_DEBUG_AT( VPSMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( local, VPSMemPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     ret = dfb_surfacemanager_allocate( local->core, data->manager, buffer, allocation, &chunk );
     if (ret)
          return ret;

     D_MAGIC_ASSERT( chunk, Chunk );

     alloc->offset = chunk->offset;
     alloc->pitch  = chunk->pitch;
     alloc->size   = surface->config.size.h * alloc->pitch;

     alloc->chunk  = chunk;

     D_DEBUG_AT( VPSMem_Surfaces, "  -> offset %d, pitch %d, size %d (%d)\n",
                 alloc->offset, alloc->pitch, alloc->size, chunk->length );

     D_ASSERT( chunk->length >= alloc->size );

     alloc->size = chunk->length;

     allocation->size   = alloc->size;
     allocation->offset = alloc->offset;

     D_MAGIC_SET( alloc, VPSMemAllocationData );

     return DFB_OK;
}

static DFBResult
vpsmemDeallocateBuffer( CoreSurfacePool       *pool,
                        void                  *pool_data,
                        void                  *pool_local,
                        CoreSurfaceBuffer     *buffer,
                        CoreSurfaceAllocation *allocation,
                        void                  *alloc_data )
{
     VPSMemPoolData       *data  = pool_data;
     VPSMemAllocationData *alloc = alloc_data;

     D_DEBUG_AT( VPSMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( alloc, VPSMemAllocationData );

     dfb_surfacemanager_deallocate( data->manager, alloc->chunk );

     D_MAGIC_CLEAR( alloc );

     return DFB_OK;
}

static DFBResult
vpsmemMuckOut( CoreSurfacePool   *pool,
               void              *pool_data,
               void              *pool_local,
               CoreSurfaceBuffer *buffer )
{
     CoreSurface           *surface;
     VPSMemPoolData        *data  = pool_data;
     VPSMemPoolLocalData   *local = pool_local;

     D_DEBUG_AT( VPSMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( local, VPSMemPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     return dfb_surfacemanager_displace( local->core, data->manager, buffer );
}

static DFBResult
vpsmemLock( CoreSurfacePool       *pool,
            void                  *pool_data,
            void                  *pool_local,
            CoreSurfaceAllocation *allocation,
            void                  *alloc_data,
            CoreSurfaceBufferLock *lock )
{
     VPSMemPoolData       *data  = pool_data;
     VPSMemAllocationData *alloc = alloc_data;

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, VPSMemPoolData );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, VPSMemAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     D_DEBUG_AT( VPSMem_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer );

     lock->pitch  = alloc->pitch;
     lock->offset = alloc->offset;
     lock->addr   = data->mem + alloc->offset;
     lock->phys   = dfb_config->video_phys + alloc->offset;

     D_DEBUG_AT( VPSMem_SurfLock, "  -> offset %lu, pitch %d, addr %p, phys 0x%08lx\n",
                 lock->offset, lock->pitch, lock->addr, lock->phys );

     return DFB_OK;
}

static DFBResult
vpsmemUnlock( CoreSurfacePool       *pool,
              void                  *pool_data,
              void                  *pool_local,
              CoreSurfaceAllocation *allocation,
              void                  *alloc_data,
              CoreSurfaceBufferLock *lock )
{
     VPSMemAllocationData *alloc = alloc_data;

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, VPSMemAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     D_DEBUG_AT( VPSMem_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer );

     (void) alloc;

     return DFB_OK;
}

const SurfacePoolFuncs vpsmemSurfacePoolFuncs = {
     .PoolDataSize       = vpsmemPoolDataSize,
     .PoolLocalDataSize  = vpsmemPoolLocalDataSize,
     .AllocationDataSize = vpsmemAllocationDataSize,

     .InitPool           = vpsmemInitPool,
     .JoinPool           = vpsmemJoinPool,
     .DestroyPool        = vpsmemDestroyPool,
     .LeavePool          = vpsmemLeavePool,

     .TestConfig         = vpsmemTestConfig,
     .AllocateBuffer     = vpsmemAllocateBuffer,
     .DeallocateBuffer   = vpsmemDeallocateBuffer,

     .MuckOut            = vpsmemMuckOut,

     .Lock               = vpsmemLock,
     .Unlock             = vpsmemUnlock,
};

���������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/x11_surface_pool.h������������������������������������������������������0000644�0001750�0001750�00000002733�11245562152�015611� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __X11SYSTEM__X11_SURFACE_POOL_H__
#define __X11SYSTEM__X11_SURFACE_POOL_H__

#include <core/surface_pool.h>

#include "x11image.h"

extern const SurfacePoolFuncs x11SurfacePoolFuncs;

typedef struct {
     bool      real;
     x11Image  image;

     void     *ptr;
     int       pitch;
} x11AllocationData;

#endif

�������������������������������������DirectFB-1.2.10/systems/x11/x11.h�������������������������������������������������������������������0000644�0001750�0001750�00000006131�11245562152�013044� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __X11SYSTEM__X11_H__
#define __X11SYSTEM__X11_H__

#include <fusion/call.h>
#include <fusion/lock.h>
#include <core/layers.h>
#include <core/surface.h>
#include <core/surface_buffer.h>
#include <core/surface_pool.h>

#include "x11image.h"
#include "xwindow.h"

typedef struct {
     CoreLayerRegionConfig  config;
} SetModeData;

typedef struct {
     DFBRegion              region;

     CoreSurfaceBufferLock *lock;
} UpdateScreenData;


typedef struct {
     UpdateScreenData     update;
     SetModeData          setmode;
                         
     FusionSkirmish       lock;
     FusionCall           call;

     FusionSHMPoolShared *data_shmpool;
 
     CoreSurfacePool     *x11image_pool;

     CoreSurfacePool     *vpsmem_pool;
     unsigned int         vpsmem_length;

     DFBDimension         screen_size;

     XWindow             *xw;
} DFBX11Shared;

struct __DFB_X11 {
     DFBX11Shared        *shared;

     CoreDFB             *core;
     CoreScreen          *screen;

     Bool                 use_shm;
     int                  xshm_major;
     int                  xshm_minor;
                         
     Display             *display;
     Screen              *screenptr;
     int                  screennum;
                     
     Visual              *visuals[DFB_NUM_PIXELFORMATS];
};

typedef enum {
     X11_CREATE_WINDOW,
     X11_UPDATE_SCREEN,
     X11_SET_PALETTE,
     X11_IMAGE_INIT,
     X11_IMAGE_DESTROY,
     X11_DESTROY_WINDOW,
} DFBX11Call;



DFBResult dfb_x11_create_window_handler ( DFBX11 *x11, CoreLayerRegionConfig *config );
DFBResult dfb_x11_destroy_window_handler( DFBX11 *x11 );

DFBResult dfb_x11_update_screen_handler ( DFBX11 *x11, UpdateScreenData *data );
DFBResult dfb_x11_set_palette_handler   ( DFBX11 *x11, CorePalette *palette );

DFBResult dfb_x11_image_init_handler    ( DFBX11 *x11, x11Image *image );
DFBResult dfb_x11_image_destroy_handler ( DFBX11 *x11, x11Image *image );


#endif //__X11SYSTEM__X11_H__

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/x11.c�������������������������������������������������������������������0000644�0001750�0001750�00000031734�11245562152�013046� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <fusion/types.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <directfb.h>

#include <fusion/arena.h>
#include <fusion/shmalloc.h>
#include <fusion/lock.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/palette.h>
#include <core/surface.h>
#include <core/system.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include <direct/messages.h>


#include "primary.h"
#include "xwindow.h"
#include "x11.h"
#include "x11_surface_pool.h"

#include "vpsmem_surface_pool.h"

#include <core/core_system.h>


DFB_CORE_SYSTEM( x11 )


static VideoMode modes[] = {
     { .xres =  320, .yres =  200 },
     { .xres =  320, .yres =  240 },
     { .xres =  512, .yres =  384 },
     { .xres =  640, .yres =  480 },
     { .xres =  768, .yres =  576 },

     { .xres = 1024, .yres =  576 },     // 16:9
     { .xres = 1024, .yres =  600 },     // Where does that mode come from? :-)
     { .xres = 1024, .yres =  768 },     // 4:3

     { .xres = 1280, .yres =  720 },     // 16:9
     { .xres = 1280, .yres =  960 },     // 4:3
     { .xres = 1280, .yres = 1024 },     // 5:4

     { .xres = 1440, .yres =  810 },     // 16:9
     { .xres = 1440, .yres = 1080 },     // 4:3

     { .xres = 1600, .yres =  900 },     // 16:9, obviously :)
     { .xres = 1600, .yres = 1200 },     // 4:3

     { .xres = 1920, .yres = 1080 },     // 16:9
     { .xres = 1920, .yres = 1200 },     // 16:10

     { .xres = 0, .yres = 0 }
};

/**********************************************************************************************************************/

static FusionCallHandlerResult call_handler( int           caller,
                                             int           call_arg,
                                             void         *call_ptr,
                                             void         *ctx,
                                             unsigned int  serial,
                                             int          *ret_val );

/**********************************************************************************************************************/

static DFBResult
InitLocal( DFBX11 *x11, DFBX11Shared *shared, CoreDFB *core )
{
     int i, n;

     XInitThreads();

     x11->shared = shared;
     x11->core   = core;

     x11->display = XOpenDisplay(getenv("DISPLAY"));
     if (!x11->display) {
          D_ERROR("X11: Error in XOpenDisplay for '%s'\n", getenv("DISPLAY"));
          return DFB_INIT;
     }

     x11->screenptr = DefaultScreenOfDisplay(x11->display);
     x11->screennum = DefaultScreen(x11->display);

     for (i=0; i<x11->screenptr->ndepths; i++) {
          const Depth *depth = &x11->screenptr->depths[i];

          for (n=0; n<depth->nvisuals; n++) {
               Visual *visual = &depth->visuals[n];

               D_DEBUG( "X11/Visual: [%2d] ID 0x%02lx, depth %d, red 0x%06lx, green 0x%06lx, blue 0x%06lx, %d bits/rgb, %d entries\n",
                        n, visual->visualid, depth->depth,
                        visual->red_mask, visual->green_mask, visual->blue_mask,
                        visual->bits_per_rgb, visual->map_entries );

               switch (depth->depth) {
                    case 32:
                         if (visual->red_mask   == 0xff0000 &&
                             visual->green_mask == 0x00ff00 &&
                             visual->blue_mask  == 0x0000ff &&
                             !x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_ARGB)])
                              x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_ARGB)] = visual;
                         break;

                    case 24:
                         if (visual->red_mask   == 0xff0000 &&
                             visual->green_mask == 0x00ff00 &&
                             visual->blue_mask  == 0x0000ff &&
                             !x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_RGB32)])
                              x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_RGB32)] = visual;
                         break;

                    case 16:
                         if (visual->red_mask   == 0xf800 &&
                             visual->green_mask == 0x07e0 &&
                             visual->blue_mask  == 0x001f &&
                             !x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_RGB16)])
                              x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_RGB16)] = visual;
                         break;

                    case 15:
                         if (visual->red_mask   == 0x7c00 &&
                             visual->green_mask == 0x03e0 &&
                             visual->blue_mask  == 0x001f &&
                             !x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_RGB555)])
                              x11->visuals[DFB_PIXELFORMAT_INDEX(DSPF_RGB555)] = visual;
                         break;
               }
          }
     }

     if (XShmQueryExtension( x11->display ))
          XShmQueryVersion( x11->display, &x11->xshm_major, &x11->xshm_minor, &x11->use_shm );


     x11->screen = dfb_screens_register( NULL, x11, &x11PrimaryScreenFuncs );

     dfb_layers_register( x11->screen, x11, &x11PrimaryLayerFuncs );

     return DFB_OK;
}

/**********************************************************************************************************************/

static void
system_get_info( CoreSystemInfo *info )
{
     info->type = CORE_X11;   
     info->caps = CSCAPS_ACCELERATION;

     snprintf( info->name, DFB_CORE_SYSTEM_INFO_NAME_LENGTH, "X11" );
}

static DFBResult
system_initialize( CoreDFB *core, void **data )
{
     DFBResult     ret;
     DFBX11       *x11;
     DFBX11Shared *shared;

     x11 = D_CALLOC( 1, sizeof(DFBX11) );
     if (!x11)
          return D_OOM();

     shared = SHCALLOC( dfb_core_shmpool( core ), 1, sizeof(DFBX11Shared) );
     if (!shared) {
          D_FREE( x11 );
          return D_OOSHM();
     }


     /*
      * Local init (master and slave)
      */
     ret = InitLocal( x11, shared, core );
     if (ret) {
          SHFREE( dfb_core_shmpool( core ), shared );
          D_FREE( x11 );
          return ret;
     }


     /*
      * Shared init (master only)
      */
     shared->data_shmpool = dfb_core_shmpool_data( core );

     shared->screen_size.w = x11->screenptr->width;
     shared->screen_size.h = x11->screenptr->height;

     fusion_skirmish_init( &shared->lock, "X11 System", dfb_core_world(core) );

     fusion_call_init( &shared->call, call_handler, x11, dfb_core_world(core) );


     /*
      * Must be set before initializing the pools!
      */
     *data = x11;


     /*
      * Master init
      */
     dfb_surface_pool_initialize( core, &x11SurfacePoolFuncs, &shared->x11image_pool );

     if (dfb_config->video_length) {
          shared->vpsmem_length = dfb_config->video_length;

          dfb_surface_pool_initialize( core, &vpsmemSurfacePoolFuncs, &shared->vpsmem_pool );
     }


     fusion_arena_add_shared_field( dfb_core_arena( core ), "x11", shared );

     return DFB_OK;
}

static DFBResult
system_join( CoreDFB *core, void **data )
{
     DFBResult     ret;
     void         *ptr;
     DFBX11       *x11;
     DFBX11Shared *shared;

     x11 = D_CALLOC( 1, sizeof(DFBX11) );
     if (!x11)
          return D_OOM();

     fusion_arena_get_shared_field( dfb_core_arena( core ), "x11", &ptr );
     shared = ptr;


     /*
      * Local init (master and slave)
      */
     ret = InitLocal( x11, shared, core );
     if (ret) {
          D_FREE( x11 );
          return ret;
     }


     /*
      * Must be set before joining the pools!
      */
     *data = x11;


     /*
      * Slave init
      */
     if (shared->x11image_pool)
          dfb_surface_pool_join( core, shared->x11image_pool, &x11SurfacePoolFuncs );

     if (shared->vpsmem_pool)
          dfb_surface_pool_join( core, shared->vpsmem_pool, &vpsmemSurfacePoolFuncs );

     return DFB_OK;
}

static DFBResult
system_shutdown( bool emergency )
{
     DFBX11       *x11    = dfb_system_data();
     DFBX11Shared *shared = x11->shared;

     /*
      * Master deinit
      */
     if (shared->vpsmem_pool)
          dfb_surface_pool_destroy( shared->vpsmem_pool );

     if (shared->x11image_pool)
          dfb_surface_pool_destroy( shared->x11image_pool );


     /*
      * Shared deinit (master only)
      */
     fusion_call_destroy( &shared->call );

     fusion_skirmish_prevail( &shared->lock );

     if (shared->xw)
         dfb_x11_close_window( x11, shared->xw );

     fusion_skirmish_destroy( &shared->lock );


     SHFREE( dfb_core_shmpool( x11->core ), shared );


     /*
      * Local deinit (master and slave)
      */
     if (x11->display)
         XCloseDisplay( x11->display );

     D_FREE( x11 );

     return DFB_OK;
}

static DFBResult
system_leave( bool emergency )
{
     DFBX11       *x11    = dfb_system_data();
     DFBX11Shared *shared = x11->shared;

     /*
      * Slave deinit
      */
     if (shared->vpsmem_pool)
          dfb_surface_pool_leave( shared->vpsmem_pool );

     if (shared->x11image_pool)
          dfb_surface_pool_leave( shared->x11image_pool );


     /*
      * Local deinit (master and slave)
      */
     if (x11->display)
         XCloseDisplay( x11->display );

     D_FREE( x11 );

     return DFB_OK;
}

static DFBResult
system_suspend( void )
{
     return DFB_UNIMPLEMENTED;
}

static DFBResult
system_resume( void )
{
     return DFB_UNIMPLEMENTED;
}

static volatile void *
system_map_mmio( unsigned int    offset,
                 int             length )
{
     return NULL;
}

static void
system_unmap_mmio( volatile void  *addr,
                   int             length )
{
}

static int
system_get_accelerator( void )
{
     return dfb_config->accelerator;
}

static VideoMode *
system_get_modes( void )
{
     return modes;
}

static VideoMode *
system_get_current_mode( void )
{
     return &modes[0];   /* FIXME */
}

static DFBResult
system_thread_init( void )
{
     return DFB_OK;
}

static bool
system_input_filter( CoreInputDevice *device,
                     DFBInputEvent   *event )
{
     return false;
}

static unsigned long
system_video_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_video_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_videoram_length( void )
{
     return 0;
}

static unsigned long
system_aux_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_aux_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_auxram_length( void )
{
     return 0;
}

static void
system_get_busid( int *ret_bus, int *ret_dev, int *ret_func )
{
}

static void
system_get_deviceid( unsigned int *ret_vendor_id,
                     unsigned int *ret_device_id )
{
}

static FusionCallHandlerResult
call_handler( int           caller,
              int           call_arg,
              void         *call_ptr,
              void         *ctx,
              unsigned int  serial,
              int          *ret_val )
{
     DFBX11 *x11 = ctx;

     switch (call_arg) {
          case X11_CREATE_WINDOW:
               *ret_val = dfb_x11_create_window_handler( x11, call_ptr );
               break;

          case X11_DESTROY_WINDOW:
               *ret_val = dfb_x11_destroy_window_handler( x11 );
               break;

          case X11_UPDATE_SCREEN:
               *ret_val = dfb_x11_update_screen_handler( x11, call_ptr );
               break;

          case X11_SET_PALETTE:
               *ret_val = dfb_x11_set_palette_handler( x11, call_ptr );
               break;

          case X11_IMAGE_INIT:
               *ret_val = dfb_x11_image_init_handler( x11, call_ptr );
               break;

          case X11_IMAGE_DESTROY:
               *ret_val = dfb_x11_image_destroy_handler( x11, call_ptr );
               break;

          default:
               D_BUG( "unknown call" );
               *ret_val = DFB_BUG;
               break;
     }

     return FCHR_RETURN;
}

������������������������������������DirectFB-1.2.10/systems/x11/surfacemanager.c��������������������������������������������������������0000644�0001750�0001750�00000042426�11245562152�015420� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <fusion/shmalloc.h>

#include <directfb.h>
#include <directfb_util.h>

#include <core/core.h>

#include <core/gfxcard.h>
#include <core/surface.h>
#include <core/surface_buffer.h>

#include <direct/debug.h>
#include <direct/messages.h>
#include <direct/util.h>

#include <gfx/convert.h>

#include "surfacemanager.h"

D_DEBUG_DOMAIN( SurfMan, "SurfaceManager", "DirectFB Surface Manager" );


static Chunk *split_chunk ( SurfaceManager *manager,
                            Chunk          *chunk,
                            int             length );

static Chunk *free_chunk  ( SurfaceManager *manager,
                            Chunk          *chunk );

static Chunk *occupy_chunk( SurfaceManager        *manager,
                            Chunk                 *chunk,
                            CoreSurfaceAllocation *allocation,
                            int                    length,
                            int                    pitch );


DFBResult
dfb_surfacemanager_create( CoreDFB         *core,
                           unsigned int     length,
                           SurfaceManager **ret_manager )
{
     FusionSHMPoolShared *pool;
     SurfaceManager      *manager;
     Chunk               *chunk;

     D_DEBUG_AT( SurfMan, "%s( %p, %d )\n", __FUNCTION__, core, length );

     D_ASSERT( core != NULL );
     D_ASSERT( ret_manager != NULL );

     pool = dfb_core_shmpool( core );

     manager = SHCALLOC( pool, 1, sizeof(SurfaceManager) );
     if (!manager)
          return D_OOSHM();

     chunk = SHCALLOC( pool, 1, sizeof(Chunk) );
     if (!chunk) {
          D_OOSHM();
          SHFREE( pool, manager );
          return DFB_NOSHAREDMEMORY;
     }

     manager->shmpool = pool;
     manager->chunks  = chunk;
     manager->offset  = 0;
     manager->length  = length;
     manager->avail   = manager->length - manager->offset;

     D_MAGIC_SET( manager, SurfaceManager );

     chunk->offset    = manager->offset;
     chunk->length    = manager->avail;

     D_MAGIC_SET( chunk, Chunk );

     D_DEBUG_AT( SurfMan, "  -> %p\n", manager );

     *ret_manager = manager;

     return DFB_OK;
}

void
dfb_surfacemanager_destroy( SurfaceManager *manager )
{
     Chunk *chunk;
     void  *next;

     D_DEBUG_AT( SurfMan, "%s( %p )\n", __FUNCTION__, manager );

     D_MAGIC_ASSERT( manager, SurfaceManager );

     /* Deallocate all video chunks. */
     chunk = manager->chunks;
     while (chunk) {
          next = chunk->next;

          D_MAGIC_CLEAR( chunk );

          SHFREE( manager->shmpool, chunk );

          chunk = next;
     }

     D_MAGIC_CLEAR( manager );

     /* Deallocate manager struct. */
     SHFREE( manager->shmpool, manager );
}

/** public functions NOT locking the surfacemanger theirself,
    to be called between lock/unlock of surfacemanager **/

DFBResult dfb_surfacemanager_allocate( CoreDFB                *core,
                                       SurfaceManager         *manager,
                                       CoreSurfaceBuffer      *buffer,
                                       CoreSurfaceAllocation  *allocation,
                                       Chunk                 **ret_chunk )
{
     int pitch;
     int length;
     Chunk *c;
     CoreGraphicsDevice *device;

     Chunk *best_free = NULL;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     if (ret_chunk)
          D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     else
          D_ASSUME( allocation == NULL );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     if (manager->suspended)
          return DFB_SUSPENDED;

     /* FIXME: Only one global device at the moment. */
     device = dfb_core_get_part( core, DFCP_GRAPHICS );
     D_ASSERT( device != NULL );

     dfb_gfxcard_calc_buffer_size( device, buffer, &pitch, &length );

     D_DEBUG_AT( SurfMan, "  -> pitch %d, length %d\n", pitch, length );

     if (manager->avail < length)
          return DFB_TEMPUNAVAIL;

     /* examine chunks */
     c = manager->chunks;
     D_MAGIC_ASSERT( c, Chunk );

     while (c) {
          D_MAGIC_ASSERT( c, Chunk );

          if (!c->buffer && c->length >= length) {
               /* NULL means check only. */
               if (!ret_chunk)
                    return DFB_OK;

               /* found a nice place to chill */
               if (!best_free  ||  best_free->length > c->length)
                    /* first found or better one? */
                    best_free = c;

               if (c->length == length)
                    break;
          }

          c = c->next;
     }

     /* if we found a place */
     if (best_free) {
          D_DEBUG_AT( SurfMan, "  -> found free (%d)\n", best_free->length );

          /* NULL means check only. */
          if (ret_chunk)
               *ret_chunk = occupy_chunk( manager, best_free, allocation, length, pitch );

          return DFB_OK;
     }

     D_DEBUG_AT( SurfMan, "  -> failed (%d/%d avail)\n", manager->avail, manager->length );

     /* no luck */
     return DFB_NOVIDEOMEMORY;
}

DFBResult dfb_surfacemanager_displace( CoreDFB           *core,
                                       SurfaceManager    *manager,
                                       CoreSurfaceBuffer *buffer )
{
     int                    length;
     Chunk                 *multi_start = NULL;
     int                    multi_size  = 0;
     int                    multi_tsize = 0;
     int                    multi_count = 0;
     Chunk                 *bestm_start = NULL;
     int                    bestm_count = 0;
     int                    bestm_size  = 0;
     int                    min_toleration;
     Chunk                 *chunk;
     CoreGraphicsDevice    *device;
     CoreSurfaceAllocation *smallest = NULL;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     /* FIXME: Only one global device at the moment. */
     device = dfb_core_get_part( core, DFCP_GRAPHICS );
     D_ASSERT( device != NULL );

     dfb_gfxcard_calc_buffer_size( dfb_core_get_part( core, DFCP_GRAPHICS ), buffer, NULL, &length );

     min_toleration = manager->min_toleration/8 + 2;

     D_DEBUG_AT( SurfMan, "  -> %7d required, min toleration %d\n", length, min_toleration );

     chunk = manager->chunks;
     while (chunk) {
          CoreSurfaceAllocation *allocation;

          D_MAGIC_ASSERT( chunk, Chunk );

          allocation = chunk->allocation;
          if (allocation) {
               CoreSurfaceBuffer *other;
               int                size;

               D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
               D_ASSERT( chunk->buffer == allocation->buffer );
               D_ASSERT( chunk->length >= allocation->size );

               other = allocation->buffer;
               D_MAGIC_ASSERT( other, CoreSurfaceBuffer );

               if (other->locked) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d locked %dx\n", allocation->size, other->locked );
                    goto next_reset;
               }

               if (other->policy > buffer->policy) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d policy %d > %d\n", allocation->size, other->policy, buffer->policy );
                    goto next_reset;
               }

               if (other->policy == CSP_VIDEOONLY) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d policy videoonly\n", allocation->size );
                    goto next_reset;
               }

               chunk->tolerations++;
               if (chunk->tolerations > 0xff)
                    chunk->tolerations = 0xff;

               if (other->policy == buffer->policy && chunk->tolerations < min_toleration) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d tolerations %d/%d\n",
                                allocation->size, chunk->tolerations, min_toleration );
                    goto next_reset;
               }

               size = allocation->size;

               if (chunk->prev && !chunk->prev->allocation)
                    size += chunk->prev->length;

               if (chunk->next && !chunk->next->allocation)
                    size += chunk->next->length;

               if (size >= length) {
                    if (!smallest || smallest->size > allocation->size) {
                         D_DEBUG_AT( SurfMan, "  => %7d [%d] < %d, tolerations %d\n",
                                     allocation->size, size, smallest ? smallest->size : 0, chunk->tolerations );

                         smallest = allocation;
                    }
                    else
                         D_DEBUG_AT( SurfMan, "  -> %7d [%d] > %d\n", allocation->size, size, smallest->size );
               }
               else
                    D_DEBUG_AT( SurfMan, "  -> %7d [%d]\n", allocation->size, size );
          }
          else
               D_DEBUG_AT( SurfMan, "  -  %7d free\n", chunk->length );


          if (!smallest) {
               if (!multi_start) {
                    multi_start = chunk;
                    multi_tsize = chunk->length;
                    multi_size  = chunk->allocation ? chunk->length : 0;
                    multi_count = chunk->allocation ? 1 : 0;
               }
               else {
                    multi_tsize += chunk->length;
                    multi_size  += chunk->allocation ? chunk->length : 0;
                    multi_count += chunk->allocation ? 1 : 0;

                    while (multi_tsize >= length && multi_count > 1) {
                         if (!bestm_start || bestm_size > multi_size * multi_count / bestm_count) {
                              D_DEBUG_AT( SurfMan, "                =====> %7d, %7d %2d used [%7d %2d]\n",
                                          multi_tsize, multi_size, multi_count, bestm_size, bestm_count );

                              bestm_size  = multi_size;
                              bestm_start = multi_start;
                              bestm_count = multi_count;
                         }
                         else
                              D_DEBUG_AT( SurfMan, "                -----> %7d, %7d %2d used\n",
                                          multi_tsize, multi_size, multi_count );

                         if (multi_count <= 2)
                              break;

                         if (!multi_start->allocation) {
                              multi_tsize -= multi_start->length;
                              multi_start  = multi_start->next;
                         }

                         D_ASSUME( multi_start->allocation != NULL );

                         multi_tsize -= multi_start->length;
                         multi_size  -= multi_start->allocation ? multi_start->length : 0;
                         multi_count -= multi_start->allocation ? 1 : 0;
                         multi_start  = multi_start->next;
                    }
               }
          }

          chunk = chunk->next;

          continue;


next_reset:
          multi_start = NULL;

          chunk = chunk->next;
     }

     if (smallest) {
          D_MAGIC_ASSERT( smallest, CoreSurfaceAllocation );
          D_MAGIC_ASSERT( smallest->buffer, CoreSurfaceBuffer );

          smallest->flags |= CSALF_MUCKOUT;

          D_DEBUG_AT( SurfMan, "  -> offset %lu, size %d\n", smallest->offset, smallest->size );

          return DFB_OK;
     }

     if (bestm_start) {
          chunk = bestm_start;

          while (bestm_count) {
               CoreSurfaceAllocation *allocation = chunk->allocation;

               if (allocation) {
                    D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
                    D_MAGIC_ASSERT( allocation->buffer, CoreSurfaceBuffer );
                    
                    allocation->flags |= CSALF_MUCKOUT;

                    bestm_count--;
               }

               D_DEBUG_AT( SurfMan, "  ---> offset %d, length %d\n", chunk->offset, chunk->length );

               chunk = chunk->next;
          }

          return DFB_OK;
     }

     return DFB_NOVIDEOMEMORY;
}

DFBResult dfb_surfacemanager_deallocate( SurfaceManager *manager,
                                         Chunk          *chunk )
{
     CoreSurfaceBuffer *buffer;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );

     buffer = chunk->buffer;
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     free_chunk( manager, chunk );

     return DFB_OK;
}

/** internal functions NOT locking the surfacemanager **/

static Chunk *
split_chunk( SurfaceManager *manager, Chunk *c, int length )
{
     Chunk *newchunk;

     D_MAGIC_ASSERT( c, Chunk );

     if (c->length == length)          /* does not need be splitted */
          return c;

     newchunk = (Chunk*) SHCALLOC( manager->shmpool, 1, sizeof(Chunk) );
     if (!newchunk) {
          D_OOSHM();
          return NULL;
     }

     /* calculate offsets and lengths of resulting chunks */
     newchunk->offset = c->offset + c->length - length;
     newchunk->length = length;
     c->length -= newchunk->length;

     /* insert newchunk after chunk c */
     newchunk->prev = c;
     newchunk->next = c->next;
     if (c->next)
          c->next->prev = newchunk;
     c->next = newchunk;

     D_MAGIC_SET( newchunk, Chunk );

     return newchunk;
}

static Chunk *
free_chunk( SurfaceManager *manager, Chunk *chunk )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );

     if (!chunk->buffer) {
          D_BUG( "freeing free chunk" );
          return chunk;
     }
     else {
          D_DEBUG_AT( SurfMan, "Deallocating %d bytes at offset %d.\n", chunk->length, chunk->offset );
     }

     if (chunk->buffer->policy == CSP_VIDEOONLY)
          manager->avail += chunk->length;

     chunk->allocation = NULL;
     chunk->buffer     = NULL;

     manager->min_toleration--;

     if (chunk->prev  &&  !chunk->prev->buffer) {
          Chunk *prev = chunk->prev;

          //D_DEBUG_AT( SurfMan, "  -> merging with previous chunk at %d\n", prev->offset );

          prev->length += chunk->length;

          prev->next = chunk->next;
          if (prev->next)
               prev->next->prev = prev;

          //D_DEBUG_AT( SurfMan, "  -> freeing %p (prev %p, next %p)\n", chunk, chunk->prev, chunk->next);

          D_MAGIC_CLEAR( chunk );

          SHFREE( manager->shmpool, chunk );
          chunk = prev;
     }

     if (chunk->next  &&  !chunk->next->buffer) {
          Chunk *next = chunk->next;

          //D_DEBUG_AT( SurfMan, "  -> merging with next chunk at %d\n", next->offset );

          chunk->length += next->length;

          chunk->next = next->next;
          if (chunk->next)
               chunk->next->prev = chunk;

          D_MAGIC_CLEAR( next );

          SHFREE( manager->shmpool, next );
     }

     return chunk;
}

static Chunk *
occupy_chunk( SurfaceManager *manager, Chunk *chunk, CoreSurfaceAllocation *allocation, int length, int pitch )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( allocation->buffer, CoreSurfaceBuffer );
     
     if (allocation->buffer->policy == CSP_VIDEOONLY)
          manager->avail -= length;

     chunk = split_chunk( manager, chunk, length );

     D_DEBUG_AT( SurfMan, "Allocating %d bytes at offset %d.\n", chunk->length, chunk->offset );

     chunk->allocation = allocation;
     chunk->buffer     = allocation->buffer;
     chunk->pitch      = pitch;

     manager->min_toleration++;

     return chunk;
}

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/primary.h���������������������������������������������������������������0000644�0001750�0001750�00000002577�11245562152�014130� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __X11__PRIMARY_H__
#define __X11__PRIMARY_H__

#include <core/layers.h>
#include <core/screens.h>

extern ScreenFuncs       x11PrimaryScreenFuncs;
extern DisplayLayerFuncs x11PrimaryLayerFuncs;

#endif // __X11__PRIMARY_H__

���������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/x11/vpsmem_surface_pool.h���������������������������������������������������0000644�0001750�0001750�00000002520�11245562152�016501� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __X11SYSTEM__VPSMEM_SURFACE_POOL_H__
#define __X11SYSTEM__VPSMEM_SURFACE_POOL_H__

#include <core/surface_pool.h>

extern const SurfacePoolFuncs vpsmemSurfacePoolFuncs;

#endif

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/���������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522565�013214� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/devmem.c�������������������������������������������������������������0000644�0001750�0001750�00000021373�11245562152�014554� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <fcntl.h>
#include <sys/mman.h>

#include <directfb.h>

#include <direct/mem.h>

#include <fusion/arena.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/surface_pool.h>

#include <misc/conf.h>

#include "devmem.h"
#include "surfacemanager.h"


#include <core/core_system.h>

DFB_CORE_SYSTEM( devmem )

/**********************************************************************************************************************/

static DevMemData *m_data;    /* FIXME: Fix Core System API to pass data in all functions. */

/**********************************************************************************************************************/

static DFBResult
MapMemAndReg( DevMemData    *data,
              unsigned long  mem_phys,
              unsigned int   mem_length,
              unsigned long  reg_phys,
              unsigned int   reg_length )
{
     int fd;

     fd = open( DEV_MEM, O_RDWR | O_SYNC );
     if (fd < 0) {
          D_PERROR( "System/DevMem: Opening '%s' failed!\n", DEV_MEM );
          return DFB_INIT;
     }

     data->mem = mmap( NULL, mem_length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, mem_phys );
     if (data->mem == MAP_FAILED) {
          D_PERROR( "System/DevMem: Mapping %d bytes at 0x%08lx via '%s' failed!\n", mem_length, mem_phys, DEV_MEM );
          return DFB_INIT;
     }

     if (reg_phys && reg_length) {
          data->reg = mmap( NULL, reg_length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, reg_phys );
          if (data->reg == MAP_FAILED) {
               D_PERROR( "System/DevMem: Mapping %d bytes at 0x%08lx via '%s' failed!\n", reg_length, reg_phys, DEV_MEM );
               munmap( data->mem, mem_length );
               close( fd );
               return DFB_INIT;
          }
     }

     close( fd );

     return DFB_OK;
}

static void
UnmapMemAndReg( DevMemData   *data,
                unsigned int  mem_length,
                unsigned int  reg_length )
{
     munmap( data->mem, mem_length );

     if (reg_length)
          munmap( (void*) data->reg, reg_length );
}

/**********************************************************************************************************************/

static void
system_get_info( CoreSystemInfo *info )
{
     info->type = CORE_DEVMEM;
     info->caps = CSCAPS_ACCELERATION;

     snprintf( info->name, DFB_CORE_SYSTEM_INFO_NAME_LENGTH, "DevMem" );
}

static DFBResult
system_initialize( CoreDFB *core, void **ret_data )
{
     DFBResult            ret;
     DevMemData          *data;
     DevMemDataShared    *shared;
     FusionSHMPoolShared *pool;

     D_ASSERT( m_data == NULL );

     if (!dfb_config->video_phys || !dfb_config->video_length) {
          D_ERROR( "System/DevMem: Please supply 'video-phys = 0xXXXXXXXX' and 'video-length = XXXX' options!\n" );
          return DFB_INVARG;
     }

     if (dfb_config->mmio_phys && !dfb_config->mmio_length) {
          D_ERROR( "System/DevMem: Please supply both 'mmio-phys = 0xXXXXXXXX' and 'mmio-length = XXXX' options or none!\n" );
          return DFB_INVARG;
     }

     data = D_CALLOC( 1, sizeof(DevMemData) );
     if (!data)
          return D_OOM();

     pool = dfb_core_shmpool( core );

     shared = SHCALLOC( pool, 1, sizeof(DevMemDataShared) );
     if (!shared) {
          D_FREE( data );
          return D_OOSHM();
     }

     shared->shmpool = pool;

     data->shared = shared;

     ret = MapMemAndReg( data,
                         dfb_config->video_phys, dfb_config->video_length,
                         dfb_config->mmio_phys,  dfb_config->mmio_length );
     if (ret) {
          SHFREE( pool, shared );
          D_FREE( data );
          return ret;
     }


     *ret_data = m_data = data;

     dfb_surface_pool_initialize( core, &devmemSurfacePoolFuncs, &shared->pool );

     fusion_arena_add_shared_field( dfb_core_arena( core ), "devmem", shared );

     return DFB_OK;
}

static DFBResult
system_join( CoreDFB *core, void **ret_data )
{
     DFBResult         ret;
     void             *tmp;
     DevMemData       *data;
     DevMemDataShared *shared;

     D_ASSERT( m_data == NULL );

     if (!dfb_config->video_phys || !dfb_config->video_length) {
          D_ERROR( "System/DevMem: Please supply 'video-phys = 0xXXXXXXXX' and 'video-length = XXXX' options!\n" );
          return DFB_INVARG;
     }

     if (dfb_config->mmio_phys && !dfb_config->mmio_length) {
          D_ERROR( "System/DevMem: Please supply both 'mmio-phys = 0xXXXXXXXX' and 'mmio-length = XXXX' options or none!\n" );
          return DFB_INVARG;
     }

     data = D_CALLOC( 1, sizeof(DevMemData) );
     if (!data)
          return D_OOM();

     ret = fusion_arena_get_shared_field( dfb_core_arena( core ), "devmem", &tmp );
     if (ret) {
          D_FREE( data );
          return ret;
     }

     data->shared = shared = tmp;

     ret = MapMemAndReg( data,
                         dfb_config->video_phys, dfb_config->video_length,
                         dfb_config->mmio_phys,  dfb_config->mmio_length );
     if (ret) {
          D_FREE( data );
          return ret;
     }

     *ret_data = m_data = data;

     dfb_surface_pool_join( core, shared->pool, &devmemSurfacePoolFuncs );

     return DFB_OK;
}

static DFBResult
system_shutdown( bool emergency )
{
     DevMemDataShared *shared;

     D_ASSERT( m_data != NULL );

     shared = m_data->shared;
     D_ASSERT( shared != NULL );

     dfb_surface_pool_destroy( shared->pool );

     UnmapMemAndReg( m_data, dfb_config->video_length, dfb_config->mmio_length );

     SHFREE( shared->shmpool, shared );

     D_FREE( m_data );
     m_data = NULL;

     return DFB_OK;
}

static DFBResult
system_leave( bool emergency )
{
     DevMemDataShared *shared;

     D_ASSERT( m_data != NULL );

     shared = m_data->shared;
     D_ASSERT( shared != NULL );

     dfb_surface_pool_leave( shared->pool );

     UnmapMemAndReg( m_data, dfb_config->video_length, dfb_config->mmio_length );

     D_FREE( m_data );
     m_data = NULL;

     return DFB_OK;
}

static DFBResult
system_suspend( void )
{
     D_ASSERT( m_data != NULL );

     return DFB_OK;
}

static DFBResult
system_resume( void )
{
     D_ASSERT( m_data != NULL );

     return DFB_OK;
}

static volatile void *
system_map_mmio( unsigned int    offset,
                 int             length )
{
     D_ASSERT( m_data != NULL );

     return m_data->reg + offset;
}

static void
system_unmap_mmio( volatile void  *addr,
                   int             length )
{
}

static int
system_get_accelerator( void )
{
     return dfb_config->accelerator;
}

static VideoMode *
system_get_modes( void )
{
     return NULL;
}

static VideoMode *
system_get_current_mode( void )
{
     return NULL;
}

static DFBResult
system_thread_init( void )
{
     return DFB_OK;
}

static bool
system_input_filter( CoreInputDevice *device,
                     DFBInputEvent   *event )
{
     return false;
}

static unsigned long
system_video_memory_physical( unsigned int offset )
{
     return dfb_config->video_phys + offset;
}

static void *
system_video_memory_virtual( unsigned int offset )
{
     D_ASSERT( m_data != NULL );

     return m_data->mem + offset;
}

static unsigned int
system_videoram_length( void )
{
     return dfb_config->video_length;
}

static unsigned long
system_aux_memory_physical( unsigned int offset )
{
     return 0;
}

static void *
system_aux_memory_virtual( unsigned int offset )
{
     return NULL;
}

static unsigned int
system_auxram_length( void )
{
     return 0;
}

static void
system_get_busid( int *ret_bus, int *ret_dev, int *ret_func )
{
     return;
}

static void
system_get_deviceid( unsigned int *ret_vendor_id,
                     unsigned int *ret_device_id )
{
     return;
}

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/Makefile.am����������������������������������������������������������0000644�0001750�0001750�00000001426�11164361026�015161� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/systems/devmem

INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src


internalincludedir = $(INTERNALINCLUDEDIR)/devmem

internalinclude_HEADERS = \
	devmem.h		\
	surfacemanager.h


systemsdir = $(MODULEDIR)/systems

if BUILD_STATIC
systems_DATA = libdirectfb_devmem.o
endif
systems_LTLIBRARIES = libdirectfb_devmem.la

libdirectfb_devmem_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_devmem_la_SOURCES = \
	devmem.c		\
	devmem_surface_pool.c	\
	surfacemanager.c

libdirectfb_devmem_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la


include $(top_srcdir)/rules/libobject.make
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/surfacemanager.h�����������������������������������������������������0000644�0001750�0001750�00000007562�11245562152�016273� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SURFACEMANAGER_H__
#define __SURFACEMANAGER_H__

#include <directfb.h>

#include <core/coretypes.h>

typedef struct _SurfaceManager SurfaceManager;
typedef struct _Chunk          Chunk;

/*
 * initially there is one big free chunk,
 * chunks are splitted into a free and an occupied chunk if memory is allocated,
 * two chunks are merged to one free chunk if memory is deallocated
 */
struct _Chunk {
     int                  magic;

     int                  offset;      /* offset in memory,
                                          is greater or equal to the heap offset */
     int                  length;      /* length of this chunk in bytes */

     int                  pitch;
     
     CoreSurfaceBuffer   *buffer;      /* pointer to surface buffer occupying
                                          this chunk, or NULL if chunk is free */
     CoreSurfaceAllocation *allocation;

     int                  tolerations; /* number of times this chunk was scanned
                                          occupied, resetted in assure_video */

     Chunk               *prev;
     Chunk               *next;
};

struct _SurfaceManager {
     int                  magic;

     FusionSHMPoolShared *shmpool;

     Chunk               *chunks;

     int                  offset;
     int                  length;         /* length of the heap in bytes */
     int                  avail;          /* amount of available memory in bytes */

     int                  min_toleration;
     
     bool                 suspended;
};


DFBResult dfb_surfacemanager_create ( CoreDFB             *core,
                                      unsigned int         length,
                                      SurfaceManager     **ret_manager );

void      dfb_surfacemanager_destroy( SurfaceManager      *manager );

/*
 * finds and allocates one for the surface or fails,
 * after success the video health is CSH_RESTORE.
 * NOTE: this does not notify the listeners
 */
DFBResult dfb_surfacemanager_allocate( CoreDFB                *core,
                                       SurfaceManager         *manager,
                                       CoreSurfaceBuffer      *buffer,
                                       CoreSurfaceAllocation  *allocation,
                                       Chunk                 **ret_chunk );

DFBResult dfb_surfacemanager_displace( CoreDFB           *core,
                                       SurfaceManager    *manager,
                                       CoreSurfaceBuffer *buffer );

/*
 * sets the video health to CSH_INVALID frees the chunk and
 * notifies the listeners
 */
DFBResult dfb_surfacemanager_deallocate( SurfaceManager *manager,
                                         Chunk          *chunk );

#endif

����������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/Makefile.in����������������������������������������������������������0000644�0001750�0001750�00000047666�11307521506�015212� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@



VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(internalinclude_HEADERS) $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in $(top_srcdir)/rules/libobject.make
subdir = systems/devmem
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(systemsdir)" \
	"$(DESTDIR)$(internalincludedir)"
systemsLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(systems_LTLIBRARIES)
libdirectfb_devmem_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_devmem_la_OBJECTS = devmem.lo devmem_surface_pool.lo \
	surfacemanager.lo
libdirectfb_devmem_la_OBJECTS = $(am_libdirectfb_devmem_la_OBJECTS)
libdirectfb_devmem_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_devmem_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
SOURCES = $(libdirectfb_devmem_la_SOURCES)
DIST_SOURCES = $(libdirectfb_devmem_la_SOURCES)
systemsDATA_INSTALL = $(INSTALL_DATA)
DATA = $(systems_DATA)
internalincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(internalinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src

internalincludedir = $(INTERNALINCLUDEDIR)/devmem
internalinclude_HEADERS = \
	devmem.h		\
	surfacemanager.h

systemsdir = $(MODULEDIR)/systems
@BUILD_STATIC_TRUE@systems_DATA = libdirectfb_devmem.o
systems_LTLIBRARIES = libdirectfb_devmem.la
libdirectfb_devmem_la_LDFLAGS = \
	-avoid-version	\
	-module

libdirectfb_devmem_la_SOURCES = \
	devmem.c		\
	devmem_surface_pool.c	\
	surfacemanager.c

libdirectfb_devmem_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/devmem/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/devmem/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-systemsLTLIBRARIES: $(systems_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	  else :; fi; \
	done

uninstall-systemsLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(systemsdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(systemsdir)/$$p"; \
	done

clean-systemsLTLIBRARIES:
	-test -z "$(systems_LTLIBRARIES)" || rm -f $(systems_LTLIBRARIES)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libdirectfb_devmem.la: $(libdirectfb_devmem_la_OBJECTS) $(libdirectfb_devmem_la_DEPENDENCIES) 
	$(libdirectfb_devmem_la_LINK) -rpath $(systemsdir) $(libdirectfb_devmem_la_OBJECTS) $(libdirectfb_devmem_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devmem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devmem_surface_pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/surfacemanager.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-systemsDATA: $(systems_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(systemsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	  $(systemsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	done

uninstall-systemsDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(systemsdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(systemsdir)/$$f"; \
	done
install-internalincludeHEADERS: $(internalinclude_HEADERS)
	@$(NORMAL_INSTALL)
	test -z "$(internalincludedir)" || $(MKDIR_P) "$(DESTDIR)$(internalincludedir)"
	@list='$(internalinclude_HEADERS)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(internalincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(internalincludedir)/$$f'"; \
	  $(internalincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(internalincludedir)/$$f"; \
	done

uninstall-internalincludeHEADERS:
	@$(NORMAL_UNINSTALL)
	@list='$(internalinclude_HEADERS)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(internalincludedir)/$$f'"; \
	  rm -f "$(DESTDIR)$(internalincludedir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
installdirs:
	for dir in "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(internalincludedir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool clean-systemsLTLIBRARIES \
	mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-internalincludeHEADERS install-systemsDATA \
	install-systemsLTLIBRARIES

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-internalincludeHEADERS uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool clean-systemsLTLIBRARIES ctags distclean \
	distclean-compile distclean-generic distclean-libtool \
	distclean-tags distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am \
	install-internalincludeHEADERS install-man install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	install-systemsDATA install-systemsLTLIBRARIES installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-internalincludeHEADERS \
	uninstall-systemsDATA uninstall-systemsLTLIBRARIES

%.o: .libs/%.a %.la
	rm -f $<.tmp/*.o
	if test -d $<.tmp; then rmdir $<.tmp; fi
	mkdir $<.tmp
	(cd $<.tmp && $(AR) x ../../$<)
	$(LD) -o $@ -r $<.tmp/*.o
	rm -f $<.tmp/*.o && rmdir $<.tmp

.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
��������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/devmem_surface_pool.c������������������������������������������������0000644�0001750�0001750�00000026665�11245562152�017326� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <direct/debug.h>
#include <direct/mem.h>

#include <core/surface_pool.h>

#include <gfx/convert.h>

#include <misc/conf.h>

#include "devmem.h"
#include "surfacemanager.h"

D_DEBUG_DOMAIN( DevMem_Surfaces, "DevMem/Surfaces", "DevMem Framebuffer Surface Pool" );
D_DEBUG_DOMAIN( DevMem_SurfLock, "DevMem/SurfLock", "DevMem Framebuffer Surface Pool Locks" );

/**********************************************************************************************************************/

typedef struct {
     int             magic;

     SurfaceManager *manager;
} DevMemPoolData;

typedef struct {
     int             magic;

     CoreDFB        *core;
     void           *mem;
} DevMemPoolLocalData;

typedef struct {
     int   magic;

     int   offset;
     int   pitch;
     int   size;

     Chunk *chunk;
} DevMemAllocationData;

/**********************************************************************************************************************/

static int
devmemPoolDataSize( void )
{
     return sizeof(DevMemPoolData);
}

static int
devmemPoolLocalDataSize( void )
{
     return sizeof(DevMemPoolLocalData);
}

static int
devmemAllocationDataSize( void )
{
     return sizeof(DevMemAllocationData);
}

static DFBResult
devmemInitPool( CoreDFB                    *core,
               CoreSurfacePool            *pool,
               void                       *pool_data,
               void                       *pool_local,
               void                       *system_data,
               CoreSurfacePoolDescription *ret_desc )
{
     DFBResult            ret;
     DevMemPoolData      *data   = pool_data;
     DevMemPoolLocalData *local  = pool_local;
     DevMemData          *devmem = system_data;

     D_DEBUG_AT( DevMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_ASSERT( core != NULL );
     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_ASSERT( data != NULL );
     D_ASSERT( local != NULL );
     D_ASSERT( devmem != NULL );
     D_ASSERT( devmem->shared != NULL );
     D_ASSERT( ret_desc != NULL );

     ret = dfb_surfacemanager_create( core, dfb_config->video_length, &data->manager );
     if (ret)
          return ret;

     ret_desc->caps     = CSPCAPS_NONE;
     ret_desc->access   = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE | CSAF_SHARED;
     ret_desc->types    = CSTF_LAYER | CSTF_WINDOW | CSTF_CURSOR | CSTF_FONT | CSTF_SHARED | CSTF_EXTERNAL;
     ret_desc->priority = CSPP_DEFAULT;
     ret_desc->size     = dfb_config->video_length;

     snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "/dev/mem" );

     local->core = core;
     local->mem  = devmem->mem;

     D_MAGIC_SET( data, DevMemPoolData );
     D_MAGIC_SET( local, DevMemPoolLocalData );

     devmem->shared->manager = data->manager;

     return DFB_OK;
}

static DFBResult
devmemJoinPool( CoreDFB                    *core,
               CoreSurfacePool            *pool,
               void                       *pool_data,
               void                       *pool_local,
               void                       *system_data )
{
     DevMemPoolData      *data   = pool_data;
     DevMemPoolLocalData *local  = pool_local;
     DevMemData          *devmem = system_data;

     D_DEBUG_AT( DevMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_ASSERT( core != NULL );
     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, DevMemPoolData );
     D_ASSERT( local != NULL );
     D_ASSERT( devmem != NULL );
     D_ASSERT( devmem->shared != NULL );

     (void) data;

     local->core = core;
     local->mem  = devmem->mem;

     D_MAGIC_SET( local, DevMemPoolLocalData );

     return DFB_OK;
}

static DFBResult
devmemDestroyPool( CoreSurfacePool *pool,
                  void            *pool_data,
                  void            *pool_local )
{
     DevMemPoolData      *data  = pool_data;
     DevMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( DevMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, DevMemPoolData );
     D_MAGIC_ASSERT( local, DevMemPoolLocalData );

     dfb_surfacemanager_destroy( data->manager );

     D_MAGIC_CLEAR( data );
     D_MAGIC_CLEAR( local );

     return DFB_OK;
}

static DFBResult
devmemLeavePool( CoreSurfacePool *pool,
                void            *pool_data,
                void            *pool_local )
{
     DevMemPoolData      *data  = pool_data;
     DevMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( DevMem_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, DevMemPoolData );
     D_MAGIC_ASSERT( local, DevMemPoolLocalData );

     (void) data;

     D_MAGIC_CLEAR( local );

     return DFB_OK;
}

static DFBResult
devmemTestConfig( CoreSurfacePool         *pool,
                 void                    *pool_data,
                 void                    *pool_local,
                 CoreSurfaceBuffer       *buffer,
                 const CoreSurfaceConfig *config )
{
     DFBResult           ret;
     CoreSurface        *surface;
     DevMemPoolData      *data  = pool_data;
     DevMemPoolLocalData *local = pool_local;

     D_DEBUG_AT( DevMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, DevMemPoolData );
     D_MAGIC_ASSERT( local, DevMemPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     if (surface->type & CSTF_LAYER)
          return DFB_OK;

     ret = dfb_surfacemanager_allocate( local->core, data->manager, buffer, NULL, NULL );

     D_DEBUG_AT( DevMem_Surfaces, "  -> %s\n", DirectFBErrorString(ret) );

     return ret;
}

static DFBResult
devmemAllocateBuffer( CoreSurfacePool       *pool,
                     void                  *pool_data,
                     void                  *pool_local,
                     CoreSurfaceBuffer     *buffer,
                     CoreSurfaceAllocation *allocation,
                     void                  *alloc_data )
{
     DFBResult             ret;
     Chunk                *chunk;
     CoreSurface          *surface;
     DevMemPoolData       *data  = pool_data;
     DevMemPoolLocalData  *local = pool_local;
     DevMemAllocationData *alloc = alloc_data;

     D_DEBUG_AT( DevMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, DevMemPoolData );
     D_MAGIC_ASSERT( local, DevMemPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     ret = dfb_surfacemanager_allocate( local->core, data->manager, buffer, allocation, &chunk );
     if (ret)
          return ret;

     D_MAGIC_ASSERT( chunk, Chunk );

     alloc->offset = chunk->offset;
     alloc->pitch  = chunk->pitch;
     alloc->size   = chunk->length;

     alloc->chunk  = chunk;

     D_DEBUG_AT( DevMem_Surfaces, "  -> offset %d, pitch %d, size %d\n", alloc->offset, alloc->pitch, alloc->size );

     allocation->size   = alloc->size;
     allocation->offset = alloc->offset;

     D_MAGIC_SET( alloc, DevMemAllocationData );

     return DFB_OK;
}

static DFBResult
devmemDeallocateBuffer( CoreSurfacePool       *pool,
                       void                  *pool_data,
                       void                  *pool_local,
                       CoreSurfaceBuffer     *buffer,
                       CoreSurfaceAllocation *allocation,
                       void                  *alloc_data )
{
     DevMemPoolData       *data  = pool_data;
     DevMemAllocationData *alloc = alloc_data;

     D_DEBUG_AT( DevMem_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, DevMemPoolData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( alloc, DevMemAllocationData );

     if (alloc->chunk)
          dfb_surfacemanager_deallocate( data->manager, alloc->chunk );

     D_MAGIC_CLEAR( alloc );

     return DFB_OK;
}

static DFBResult
devmemLock( CoreSurfacePool       *pool,
            void                  *pool_data,
            void                  *pool_local,
            CoreSurfaceAllocation *allocation,
            void                  *alloc_data,
            CoreSurfaceBufferLock *lock )
{
     DevMemPoolLocalData  *local = pool_local;
     DevMemAllocationData *alloc = alloc_data;

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, DevMemAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     D_DEBUG_AT( DevMem_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer );

     lock->pitch  = alloc->pitch;
     lock->offset = alloc->offset;
     lock->addr   = local->mem + alloc->offset;
     lock->phys   = dfb_config->video_phys + alloc->offset;

     D_DEBUG_AT( DevMem_SurfLock, "  -> offset %lu, pitch %d, addr %p, phys 0x%08lx\n",
                 lock->offset, lock->pitch, lock->addr, lock->phys );

     return DFB_OK;
}

static DFBResult
devmemUnlock( CoreSurfacePool       *pool,
             void                  *pool_data,
             void                  *pool_local,
             CoreSurfaceAllocation *allocation,
             void                  *alloc_data,
             CoreSurfaceBufferLock *lock )
{
     DevMemAllocationData *alloc = alloc_data;

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, DevMemAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     D_DEBUG_AT( DevMem_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer );

     (void) alloc;

     return DFB_OK;
}

const SurfacePoolFuncs devmemSurfacePoolFuncs = {
     .PoolDataSize       = devmemPoolDataSize,
     .PoolLocalDataSize  = devmemPoolLocalDataSize,
     .AllocationDataSize = devmemAllocationDataSize,

     .InitPool           = devmemInitPool,
     .JoinPool           = devmemJoinPool,
     .DestroyPool        = devmemDestroyPool,
     .LeavePool          = devmemLeavePool,

     .TestConfig         = devmemTestConfig,
     .AllocateBuffer     = devmemAllocateBuffer,
     .DeallocateBuffer   = devmemDeallocateBuffer,

     .Lock               = devmemLock,
     .Unlock             = devmemUnlock,
};

���������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/surfacemanager.c�����������������������������������������������������0000644�0001750�0001750�00000043361�11245562152�016263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <fusion/shmalloc.h>

#include <directfb.h>
#include <directfb_util.h>

#include <core/core.h>

#include <core/gfxcard.h>
#include <core/surface.h>
#include <core/surface_buffer.h>

#include <direct/debug.h>
#include <direct/messages.h>
#include <direct/util.h>

#include <gfx/convert.h>

#include "surfacemanager.h"

D_DEBUG_DOMAIN( SurfMan, "SurfaceManager", "DirectFB Surface Manager" );


static Chunk *split_chunk ( SurfaceManager *manager,
                            Chunk          *chunk,
                            int             length );

static Chunk *free_chunk  ( SurfaceManager *manager,
                            Chunk          *chunk );

static Chunk *occupy_chunk( SurfaceManager        *manager,
                            Chunk                 *chunk,
                            CoreSurfaceAllocation *allocation,
                            int                    length,
                            int                    pitch );


DFBResult
dfb_surfacemanager_create( CoreDFB         *core,
                           unsigned int     length,
                           SurfaceManager **ret_manager )
{
     FusionSHMPoolShared *pool;
     SurfaceManager      *manager;
     Chunk               *chunk;

     D_DEBUG_AT( SurfMan, "%s( %p, %d )\n", __FUNCTION__, core, length );

     D_ASSERT( core != NULL );
     D_ASSERT( ret_manager != NULL );

     pool = dfb_core_shmpool( core );

     manager = SHCALLOC( pool, 1, sizeof(SurfaceManager) );
     if (!manager)
          return D_OOSHM();

     chunk = SHCALLOC( pool, 1, sizeof(Chunk) );
     if (!chunk) {
          D_OOSHM();
          SHFREE( pool, manager );
          return DFB_NOSHAREDMEMORY;
     }

     manager->shmpool = pool;
     manager->chunks  = chunk;
     manager->offset  = 0;
     manager->length  = length;
     manager->avail   = manager->length - manager->offset;

     D_MAGIC_SET( manager, SurfaceManager );

     chunk->offset    = manager->offset;
     chunk->length    = manager->avail;

     D_MAGIC_SET( chunk, Chunk );

     D_DEBUG_AT( SurfMan, "  -> %p\n", manager );

     *ret_manager = manager;

     return DFB_OK;
}

void
dfb_surfacemanager_destroy( SurfaceManager *manager )
{
     Chunk *chunk;
     void  *next;

     D_DEBUG_AT( SurfMan, "%s( %p )\n", __FUNCTION__, manager );

     D_MAGIC_ASSERT( manager, SurfaceManager );

     /* Deallocate all video chunks. */
     chunk = manager->chunks;
     while (chunk) {
          next = chunk->next;

          D_MAGIC_CLEAR( chunk );

          SHFREE( manager->shmpool, chunk );

          chunk = next;
     }

     D_MAGIC_CLEAR( manager );

     /* Deallocate manager struct. */
     SHFREE( manager->shmpool, manager );
}

/** public functions NOT locking the surfacemanger theirself,
    to be called between lock/unlock of surfacemanager **/

DFBResult dfb_surfacemanager_allocate( CoreDFB                *core,
                                       SurfaceManager         *manager,
                                       CoreSurfaceBuffer      *buffer,
                                       CoreSurfaceAllocation  *allocation,
                                       Chunk                 **ret_chunk )
{
     int pitch;
     int length;
     Chunk *c;
     CoreGraphicsDevice *device;

     Chunk *best_free = NULL;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     if (ret_chunk)
          D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     else
          D_ASSUME( allocation == NULL );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     if (manager->suspended)
          return DFB_SUSPENDED;

     /* FIXME: Only one global device at the moment. */
     device = dfb_core_get_part( core, DFCP_GRAPHICS );
     D_ASSERT( device != NULL );

     dfb_gfxcard_calc_buffer_size( device, buffer, &pitch, &length );

     D_DEBUG_AT( SurfMan, "  -> pitch %d, length %d\n", pitch, length );

     if (manager->avail < length)
          return DFB_TEMPUNAVAIL;

     /* examine chunks */
     c = manager->chunks;
     D_MAGIC_ASSERT( c, Chunk );

     /* FIXME_SC_2  Workaround creation happening before graphics driver initialization. */
     if (!c->next) {
          int length = dfb_gfxcard_memory_length();

          if (c->length != length - manager->offset) {
               D_WARN( "workaround" );

               manager->length = length;
               manager->avail  = length - manager->offset;

               c->length = length - manager->offset;
          }
     }

     while (c) {
          D_MAGIC_ASSERT( c, Chunk );

          if (!c->buffer && c->length >= length) {
               /* NULL means check only. */
               if (!ret_chunk)
                    return DFB_OK;

               /* found a nice place to chill */
               if (!best_free  ||  best_free->length > c->length)
                    /* first found or better one? */
                    best_free = c;

               if (c->length == length)
                    break;
          }

          c = c->next;
     }

     /* if we found a place */
     if (best_free) {
          D_DEBUG_AT( SurfMan, "  -> found free (%d)\n", best_free->length );

          /* NULL means check only. */
          if (ret_chunk)
               *ret_chunk = occupy_chunk( manager, best_free, allocation, length, pitch );

          return DFB_OK;
     }

     D_DEBUG_AT( SurfMan, "  -> failed (%d/%d avail)\n", manager->avail, manager->length );

     /* no luck */
     return DFB_NOVIDEOMEMORY;
}

DFBResult dfb_surfacemanager_displace( CoreDFB           *core,
                                       SurfaceManager    *manager,
                                       CoreSurfaceBuffer *buffer )
{
     int                    length;
     Chunk                 *multi_start = NULL;
     int                    multi_size  = 0;
     int                    multi_tsize = 0;
     int                    multi_count = 0;
     Chunk                 *bestm_start = NULL;
     int                    bestm_count = 0;
     int                    bestm_size  = 0;
     int                    min_toleration;
     Chunk                 *chunk;
     CoreGraphicsDevice    *device;
     CoreSurfaceAllocation *smallest = NULL;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     /* FIXME: Only one global device at the moment. */
     device = dfb_core_get_part( core, DFCP_GRAPHICS );
     D_ASSERT( device != NULL );

     dfb_gfxcard_calc_buffer_size( dfb_core_get_part( core, DFCP_GRAPHICS ), buffer, NULL, &length );

     min_toleration = manager->min_toleration/8 + 2;

     D_DEBUG_AT( SurfMan, "  -> %7d required, min toleration %d\n", length, min_toleration );

     chunk = manager->chunks;
     while (chunk) {
          CoreSurfaceAllocation *allocation;

          D_MAGIC_ASSERT( chunk, Chunk );

          allocation = chunk->allocation;
          if (allocation) {
               CoreSurfaceBuffer *other;
               int                size;

               D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
               D_ASSERT( chunk->buffer == allocation->buffer );
               D_ASSERT( chunk->length >= allocation->size );

               other = allocation->buffer;
               D_MAGIC_ASSERT( other, CoreSurfaceBuffer );

               if (other->locked) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d locked %dx\n", allocation->size, other->locked );
                    goto next_reset;
               }

               if (other->policy > buffer->policy) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d policy %d > %d\n", allocation->size, other->policy, buffer->policy );
                    goto next_reset;
               }

               if (other->policy == CSP_VIDEOONLY) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d policy videoonly\n", allocation->size );
                    goto next_reset;
               }

               chunk->tolerations++;
               if (chunk->tolerations > 0xff)
                    chunk->tolerations = 0xff;

               if (other->policy == buffer->policy && chunk->tolerations < min_toleration) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d tolerations %d/%d\n",
                                allocation->size, chunk->tolerations, min_toleration );
                    goto next_reset;
               }

               size = allocation->size;

               if (chunk->prev && !chunk->prev->allocation)
                    size += chunk->prev->length;

               if (chunk->next && !chunk->next->allocation)
                    size += chunk->next->length;

               if (size >= length) {
                    if (!smallest || smallest->size > allocation->size) {
                         D_DEBUG_AT( SurfMan, "  => %7d [%d] < %d, tolerations %d\n",
                                     allocation->size, size, smallest ? smallest->size : 0, chunk->tolerations );

                         smallest = allocation;
                    }
                    else
                         D_DEBUG_AT( SurfMan, "  -> %7d [%d] > %d\n", allocation->size, size, smallest->size );
               }
               else
                    D_DEBUG_AT( SurfMan, "  -> %7d [%d]\n", allocation->size, size );
          }
          else
               D_DEBUG_AT( SurfMan, "  -  %7d free\n", chunk->length );


          if (!smallest) {
               if (!multi_start) {
                    multi_start = chunk;
                    multi_tsize = chunk->length;
                    multi_size  = chunk->allocation ? chunk->length : 0;
                    multi_count = chunk->allocation ? 1 : 0;
               }
               else {
                    multi_tsize += chunk->length;
                    multi_size  += chunk->allocation ? chunk->length : 0;
                    multi_count += chunk->allocation ? 1 : 0;

                    while (multi_tsize >= length && multi_count > 1) {
                         if (!bestm_start || bestm_size > multi_size * multi_count / bestm_count) {
                              D_DEBUG_AT( SurfMan, "                =====> %7d, %7d %2d used [%7d %2d]\n",
                                          multi_tsize, multi_size, multi_count, bestm_size, bestm_count );

                              bestm_size  = multi_size;
                              bestm_start = multi_start;
                              bestm_count = multi_count;
                         }
                         else
                              D_DEBUG_AT( SurfMan, "                -----> %7d, %7d %2d used\n",
                                          multi_tsize, multi_size, multi_count );

                         if (multi_count <= 2)
                              break;

                         if (!multi_start->allocation) {
                              multi_tsize -= multi_start->length;
                              multi_start  = multi_start->next;
                         }

                         D_ASSUME( multi_start->allocation != NULL );

                         multi_tsize -= multi_start->length;
                         multi_size  -= multi_start->allocation ? multi_start->length : 0;
                         multi_count -= multi_start->allocation ? 1 : 0;
                         multi_start  = multi_start->next;
                    }
               }
          }

          chunk = chunk->next;

          continue;


next_reset:
          multi_start = NULL;

          chunk = chunk->next;
     }

     if (smallest) {
          D_MAGIC_ASSERT( smallest, CoreSurfaceAllocation );
          D_MAGIC_ASSERT( smallest->buffer, CoreSurfaceBuffer );

          smallest->flags |= CSALF_MUCKOUT;

          D_DEBUG_AT( SurfMan, "  -> offset %lu, size %d\n", smallest->offset, smallest->size );

          return DFB_OK;
     }

     if (bestm_start) {
          chunk = bestm_start;

          while (bestm_count) {
               CoreSurfaceAllocation *allocation = chunk->allocation;

               if (allocation) {
                    D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
                    D_MAGIC_ASSERT( allocation->buffer, CoreSurfaceBuffer );
                    
                    allocation->flags |= CSALF_MUCKOUT;

                    bestm_count--;
               }

               D_DEBUG_AT( SurfMan, "  ---> offset %d, length %d\n", chunk->offset, chunk->length );

               chunk = chunk->next;
          }

          return DFB_OK;
     }

     return DFB_NOVIDEOMEMORY;
}

DFBResult dfb_surfacemanager_deallocate( SurfaceManager *manager,
                                         Chunk          *chunk )
{
     CoreSurfaceBuffer *buffer;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );

     buffer = chunk->buffer;
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     free_chunk( manager, chunk );

     return DFB_OK;
}

/** internal functions NOT locking the surfacemanager **/

static Chunk *
split_chunk( SurfaceManager *manager, Chunk *c, int length )
{
     Chunk *newchunk;

     D_MAGIC_ASSERT( c, Chunk );

     if (c->length == length)          /* does not need be splitted */
          return c;

     newchunk = (Chunk*) SHCALLOC( manager->shmpool, 1, sizeof(Chunk) );
     if (!newchunk) {
          D_OOSHM();
          return NULL;
     }

     /* calculate offsets and lengths of resulting chunks */
     newchunk->offset = c->offset + c->length - length;
     newchunk->length = length;
     c->length -= newchunk->length;

     /* insert newchunk after chunk c */
     newchunk->prev = c;
     newchunk->next = c->next;
     if (c->next)
          c->next->prev = newchunk;
     c->next = newchunk;

     D_MAGIC_SET( newchunk, Chunk );

     return newchunk;
}

static Chunk *
free_chunk( SurfaceManager *manager, Chunk *chunk )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );

     if (!chunk->buffer) {
          D_BUG( "freeing free chunk" );
          return chunk;
     }
     else {
          D_DEBUG_AT( SurfMan, "Deallocating %d bytes at offset %d.\n", chunk->length, chunk->offset );
     }

     if (chunk->buffer->policy == CSP_VIDEOONLY)
          manager->avail += chunk->length;

     chunk->allocation = NULL;
     chunk->buffer     = NULL;

     manager->min_toleration--;

     if (chunk->prev  &&  !chunk->prev->buffer) {
          Chunk *prev = chunk->prev;

          //D_DEBUG_AT( SurfMan, "  -> merging with previous chunk at %d\n", prev->offset );

          prev->length += chunk->length;

          prev->next = chunk->next;
          if (prev->next)
               prev->next->prev = prev;

          //D_DEBUG_AT( SurfMan, "  -> freeing %p (prev %p, next %p)\n", chunk, chunk->prev, chunk->next);

          D_MAGIC_CLEAR( chunk );

          SHFREE( manager->shmpool, chunk );
          chunk = prev;
     }

     if (chunk->next  &&  !chunk->next->buffer) {
          Chunk *next = chunk->next;

          //D_DEBUG_AT( SurfMan, "  -> merging with next chunk at %d\n", next->offset );

          chunk->length += next->length;

          chunk->next = next->next;
          if (chunk->next)
               chunk->next->prev = chunk;

          D_MAGIC_CLEAR( next );

          SHFREE( manager->shmpool, next );
     }

     return chunk;
}

static Chunk *
occupy_chunk( SurfaceManager *manager, Chunk *chunk, CoreSurfaceAllocation *allocation, int length, int pitch )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( allocation->buffer, CoreSurfaceBuffer );
     
     if (allocation->buffer->policy == CSP_VIDEOONLY)
          manager->avail -= length;

     chunk = split_chunk( manager, chunk, length );
     if (!chunk)
          return NULL;

     D_DEBUG_AT( SurfMan, "Allocating %d bytes at offset %d.\n", chunk->length, chunk->offset );

     chunk->allocation = allocation;
     chunk->buffer     = allocation->buffer;
     chunk->pitch      = pitch;

     manager->min_toleration++;

     return chunk;
}

�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/devmem/devmem.h�������������������������������������������������������������0000644�0001750�0001750�00000003232�11245562152�014553� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DEVMEM_DEVMEM_H__
#define __DEVMEM_DEVMEM_H__

#include <fusion/shmalloc.h>

#include <core/surface_pool.h>

#include "surfacemanager.h"


#define DEV_MEM     "/dev/mem"

extern const SurfacePoolFuncs devmemSurfacePoolFuncs;


typedef struct {
     FusionSHMPoolShared *shmpool;

     CoreSurfacePool     *pool;
     SurfaceManager      *manager;
} DevMemDataShared;

typedef struct {
     DevMemDataShared    *shared;

     void                *mem;
     volatile void       *reg;
} DevMemData;


#endif

����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/����������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522565�013025� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/vt.c������������������������������������������������������������������0000644�0001750�0001750�00000040454�11245562152�013542� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <asm/types.h>    /* Needs to be included before dfb_types.h */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/vt.h>
#include <sys/kd.h>
#include <errno.h>
#include <pthread.h>

#include <directfb.h>

#include <misc/conf.h>
#include <misc/util.h>

#include <direct/debug.h>
#include <direct/mem.h>
#include <direct/messages.h>
#include <direct/thread.h>
#include <direct/util.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/gfxcard.h>

#include "fbdev.h"
#include "fb.h"
#include "vt.h"

D_DEBUG_DOMAIN( VT, "FBDev/VT", "FBDev System Module VT Handling" );

/*
 *  FIXME: the following looks like a bad hack.
 *
 *  SIGUNUSED is no longer unused, but is defined for backwards compatibility.
 *  sparc, mips and alpha signal.h however do not define SIGUNUSED.
 */

#ifdef SIGUNUSED
     #define SIG_SWITCH_FROM  (SIGUNUSED + 10)
     #define SIG_SWITCH_TO    (SIGUNUSED + 11)
#else
     #define SIG_SWITCH_FROM  (31 + 10)
     #define SIG_SWITCH_TO    (31 + 11)
#endif

#ifndef SI_KERNEL
/* glibc 2.1.x doesn't have this in /usr/include/bits/siginfo.h */
     #define SI_KERNEL 0x80
#endif


extern FBDev *dfb_fbdev;

static VirtualTerminal *dfb_vt = NULL;

static DFBResult vt_init_switching( void );
static int       vt_get_fb( int vt );
static void      vt_set_fb( int vt, int fb );
static void     *vt_thread( DirectThread *thread, void *arg );

DFBResult
dfb_vt_initialize( void )
{
     DFBResult ret;
     struct vt_stat vs;

     D_DEBUG_AT( VT, "%s()\n", __FUNCTION__ );

     dfb_vt = D_CALLOC( 1, sizeof(VirtualTerminal) );
     if (!dfb_vt)
          return D_OOM();

     setsid();
     dfb_vt->fd0 = open( "/dev/tty0", O_RDONLY | O_NOCTTY );
     if (dfb_vt->fd0 < 0) {
          if (errno == ENOENT) {
               dfb_vt->fd0 = open( "/dev/vc/0", O_RDONLY | O_NOCTTY );
               if (dfb_vt->fd0 < 0) {
                    if (errno == ENOENT) {
                         D_PERROR( "DirectFB/core/vt: Couldn't open "
                                    "neither `/dev/tty0' nor `/dev/vc/0'!\n" );
                    }
                    else {
                         D_PERROR( "DirectFB/core/vt: "
                                    "Error opening `/dev/vc/0'!\n" );
                    }

                    D_FREE( dfb_vt );
                    dfb_vt = NULL;

                    return DFB_INIT;
               }
          }
          else {
               D_PERROR( "DirectFB/core/vt: Error opening `/dev/tty0'!\n");

               D_FREE( dfb_vt );
               dfb_vt = NULL;

               return DFB_INIT;
          }
     }

     if (ioctl( dfb_vt->fd0, VT_GETSTATE, &vs ) < 0) {
          D_PERROR( "DirectFB/core/vt: VT_GETSTATE failed!\n" );
          close( dfb_vt->fd0 );
          D_FREE( dfb_vt );
          dfb_vt = NULL;
          return DFB_INIT;
     }

     dfb_vt->prev = vs.v_active;


     if (!dfb_config->vt_switch) {
          if (dfb_config->vt_num != -1)
               dfb_vt->num = dfb_config->vt_num;
          else
               dfb_vt->num = dfb_vt->prev;

          /* move vt to framebuffer */
          dfb_vt->old_fb = vt_get_fb( dfb_vt->num );
          vt_set_fb( dfb_vt->num, -1 );
     }
     else {
          if (dfb_config->vt_num == -1) {
               int n;

               n = ioctl( dfb_vt->fd0, VT_OPENQRY, &dfb_vt->num );
               if (n < 0 || dfb_vt->num == -1) {
                    D_PERROR( "DirectFB/core/vt: Cannot allocate VT!\n" );
                    close( dfb_vt->fd0 );
                    D_FREE( dfb_vt );
                    dfb_vt = NULL;
                    return DFB_INIT;
               }
          }
          else {
               dfb_vt->num = dfb_config->vt_num;
          }

          /* move vt to framebuffer */
          dfb_vt->old_fb = vt_get_fb( dfb_vt->num );
          vt_set_fb( dfb_vt->num, -1 );

          /* switch to vt */
          while (ioctl( dfb_vt->fd0, VT_ACTIVATE, dfb_vt->num ) < 0) {
               if (errno == EINTR)
                    continue;
               D_PERROR( "DirectFB/core/vt: VT_ACTIVATE failed!\n" );
               close( dfb_vt->fd0 );
               D_FREE( dfb_vt );
               dfb_vt = NULL;
               return DFB_INIT;
          }

          while (ioctl( dfb_vt->fd0, VT_WAITACTIVE, dfb_vt->num ) < 0) {
               if (errno == EINTR)
                    continue;
               D_PERROR( "DirectFB/core/vt: VT_WAITACTIVE failed!\n" );
               close( dfb_vt->fd0 );
               D_FREE( dfb_vt );
               dfb_vt = NULL;
               return DFB_INIT;
          }

          usleep( 40000 );
     }

     ret = vt_init_switching();
     if (ret) {
          if (dfb_config->vt_switch) {
               D_DEBUG_AT( VT, "  -> switching back...\n" );
               ioctl( dfb_vt->fd0, VT_ACTIVATE, dfb_vt->prev );
               ioctl( dfb_vt->fd0, VT_WAITACTIVE, dfb_vt->prev );
               D_DEBUG_AT( VT, "  -> ...switched back\n" );
               ioctl( dfb_vt->fd0, VT_DISALLOCATE, dfb_vt->num );
          }

          close( dfb_vt->fd0 );
          D_FREE( dfb_vt );
          dfb_vt = NULL;
          return ret;
     }

     dfb_fbdev->vt = dfb_vt;

     return DFB_OK;
}

DFBResult
dfb_vt_join( void )
{
     D_DEBUG_AT( VT, "%s()\n", __FUNCTION__ );

     dfb_vt_detach( true );

     return DFB_OK;
}

DFBResult
dfb_vt_shutdown( bool emergency )
{
     const char cursoron_str[] = "\033[?0;0;0c";
     const char blankon_str[] = "\033[9;10]";

     D_DEBUG_AT( VT, "%s()\n", __FUNCTION__ );

     if (!dfb_vt)
          return DFB_OK;

     if (dfb_config->vt_switching) {
          if (ioctl( dfb_vt->fd, VT_SETMODE, &dfb_vt->vt_mode ) < 0)
               D_PERROR( "DirectFB/fbdev/vt: Unable to restore VT mode!!!\n" );

          sigaction( SIG_SWITCH_FROM, &dfb_vt->sig_usr1, NULL );
          sigaction( SIG_SWITCH_TO, &dfb_vt->sig_usr2, NULL );

          direct_thread_cancel( dfb_vt->thread );
          direct_thread_join( dfb_vt->thread );
          direct_thread_destroy( dfb_vt->thread );

          pthread_mutex_destroy( &dfb_vt->lock );
          pthread_cond_destroy( &dfb_vt->wait );
     }

     if (dfb_config->kd_graphics) {
          if (ioctl( dfb_vt->fd, KDSETMODE, KD_TEXT ) < 0)
               D_PERROR( "DirectFB/Keyboard: KD_TEXT failed!\n" );
     }
     else {
          write( dfb_vt->fd, blankon_str, sizeof(blankon_str) );
     }
     write( dfb_vt->fd, cursoron_str, sizeof(cursoron_str) );

     if (dfb_config->vt_switch) {
          D_DEBUG_AT( VT, "  -> switching back...\n" );

          if (ioctl( dfb_vt->fd0, VT_ACTIVATE, dfb_vt->prev ) < 0)
               D_PERROR( "DirectFB/core/vt: VT_ACTIVATE" );

          if (ioctl( dfb_vt->fd0, VT_WAITACTIVE, dfb_vt->prev ) < 0)
               D_PERROR( "DirectFB/core/vt: VT_WAITACTIVE" );

          D_DEBUG_AT( VT, "  -> switched back...\n" );

          usleep( 40000 );

          /* restore con2fbmap */
          vt_set_fb( dfb_vt->num, dfb_vt->old_fb );

          if (close( dfb_vt->fd ) < 0)
               D_PERROR( "DirectFB/core/vt: Unable to "
                          "close file descriptor of allocated VT!\n" );

          if (ioctl( dfb_vt->fd0, VT_DISALLOCATE, dfb_vt->num ) < 0)
               D_PERROR( "DirectFB/core/vt: Unable to disallocate VT!\n" );
     }
     else {
          /* restore con2fbmap */
          vt_set_fb( dfb_vt->num, dfb_vt->old_fb );

          if (close( dfb_vt->fd ) < 0)
               D_PERROR( "DirectFB/core/vt: Unable to "
                          "close file descriptor of current VT!\n" );
     }

     if (close( dfb_vt->fd0 ) < 0)
          D_PERROR( "DirectFB/core/vt: Unable to "
                     "close file descriptor of tty0!\n" );

     D_FREE( dfb_vt );
     dfb_vt = dfb_fbdev->vt = NULL;

     return DFB_OK;
}

DFBResult
dfb_vt_leave( bool emergency )
{
     D_DEBUG_AT( VT, "%s()\n", __FUNCTION__ );

     return DFB_OK;
}

DFBResult
dfb_vt_detach( bool force )
{
     D_DEBUG_AT( VT, "%s()\n", __FUNCTION__ );

     if (dfb_config->vt_switch || force) {
          int            fd;
          struct vt_stat vt_state;

          fd = open( "/dev/tty", O_RDONLY | O_NOCTTY );
          if (fd < 0) {
               if (errno == ENXIO)
                    return DFB_OK;

               D_PERROR( "DirectFB/VT: Opening /dev/tty failed!\n" );
               return errno2result( errno );
          }

          if (ioctl( fd, VT_GETSTATE, &vt_state )) {
               close( fd );
               return DFB_OK;
          }

          if (ioctl( fd, TIOCNOTTY )) {
               D_PERROR( "DirectFB/VT: TIOCNOTTY on /dev/tty failed\n" );
               close( fd );
               return errno2result( errno );
          }

          close( fd );
     }

     return DFB_OK;
}

bool
dfb_vt_switch( int num )
{
     D_DEBUG_AT( VT, "%s( %d )\n", __FUNCTION__, num );

     if (!dfb_config->vt_switching)
          return false;

     D_DEBUG_AT( VT, "  -> switching to vt %d...\n", num );

     if (ioctl( dfb_vt->fd0, VT_ACTIVATE, num ) < 0)
          D_PERROR( "DirectFB/fbdev/vt: VT_ACTIVATE failed\n" );

     return true;
}

static void *
vt_thread( DirectThread *thread, void *arg )
{
     D_DEBUG_AT( VT, "%s( %p, %p )\n", __FUNCTION__, thread, arg );

     pthread_mutex_lock( &dfb_vt->lock );

     while (true) {
          direct_thread_testcancel( thread );

          D_DEBUG_AT( VT, "...%s (signal %d)\n", __FUNCTION__, dfb_vt->vt_sig);

          switch (dfb_vt->vt_sig) {
               default:
                    D_BUG( "unexpected vt_sig" );
                    /* fall through */

               case -1:
                    pthread_cond_wait( &dfb_vt->wait, &dfb_vt->lock );
                    continue;

               case SIG_SWITCH_FROM:
                    if (dfb_core_suspend( dfb_fbdev->core ) == DFB_OK) {
                         if (ioctl( dfb_vt->fd, VT_RELDISP, VT_ACKACQ ) < 0)
                              D_PERROR( "DirectFB/fbdev/vt: VT_RELDISP failed\n" );
                    }

                    break;

               case SIG_SWITCH_TO:
                    if (dfb_core_resume( dfb_fbdev->core ) == DFB_OK) {
                         if (ioctl( dfb_vt->fd, VT_RELDISP, VT_ACKACQ ) < 0)
                              D_PERROR( "DirectFB/fbdev/vt: VT_RELDISP failed\n" );

                         if (dfb_config->kd_graphics) {
                              if (ioctl( dfb_vt->fd, KDSETMODE, KD_GRAPHICS ) < 0)
                                   D_PERROR( "DirectFB/fbdev/vt: KD_GRAPHICS failed!\n" );
                         }
                    }

                    break;
          }

          dfb_vt->vt_sig = -1;

          pthread_cond_signal( &dfb_vt->wait );
     }

     return NULL;
}

static void
vt_switch_handler( int signum )
{
     D_DEBUG_AT( VT, "%s( %d )\n", __FUNCTION__, signum );

     pthread_mutex_lock( &dfb_vt->lock );

     while (dfb_vt->vt_sig != -1)
          pthread_cond_wait( &dfb_vt->wait, &dfb_vt->lock );

     dfb_vt->vt_sig = signum;

     pthread_cond_signal( &dfb_vt->wait );

     pthread_mutex_unlock( &dfb_vt->lock );
}

static DFBResult
vt_init_switching( void )
{
     const char cursoroff_str[] = "\033[?1;0;0c";
     const char blankoff_str[] = "\033[9;0]";
     char buf[32];

     D_DEBUG_AT( VT, "%s()\n", __FUNCTION__ );

     /* FIXME: Opening the device should be moved out of this function. */

     snprintf(buf, 32, "/dev/tty%d", dfb_vt->num);
     dfb_vt->fd = open( buf, O_RDWR | O_NOCTTY );
     if (dfb_vt->fd < 0) {
          if (errno == ENOENT) {
               snprintf(buf, 32, "/dev/vc/%d", dfb_vt->num);
               dfb_vt->fd = open( buf, O_RDWR | O_NOCTTY );
               if (dfb_vt->fd < 0) {
                    if (errno == ENOENT) {
                         D_PERROR( "DirectFB/core/vt: Couldn't open "
                                    "neither `/dev/tty%d' nor `/dev/vc/%d'!\n",
                                    dfb_vt->num, dfb_vt->num );
                    }
                    else {
                         D_PERROR( "DirectFB/core/vt: "
                                    "Error opening `%s'!\n", buf );
                    }

                    return errno2result( errno );
               }
          }
          else {
               D_PERROR( "DirectFB/core/vt: Error opening `%s'!\n", buf );
               return errno2result( errno );
          }
     }

     /* attach to the new TTY before doing anything like KDSETMODE with it,
        otherwise we'd get access denied error: */
     ioctl( dfb_vt->fd, TIOCSCTTY, 0 );

     write( dfb_vt->fd, cursoroff_str, sizeof(cursoroff_str) );
     if (dfb_config->kd_graphics) {
          if (ioctl( dfb_vt->fd, KDSETMODE, KD_GRAPHICS ) < 0) {
               D_PERROR( "DirectFB/fbdev/vt: KD_GRAPHICS failed!\n" );
               close( dfb_vt->fd );
               return DFB_INIT;
          }
     }
     else {
          write( dfb_vt->fd, blankoff_str, sizeof(blankoff_str) );
     }

     if (dfb_config->vt_switching) {
          struct vt_mode vt;
          struct sigaction sig_tty;

          memset( &sig_tty, 0, sizeof( sig_tty ) );
          sig_tty.sa_handler = vt_switch_handler;
          sigfillset( &sig_tty.sa_mask );

          if (sigaction( SIG_SWITCH_FROM, &sig_tty, &dfb_vt->sig_usr1 ) ||
              sigaction( SIG_SWITCH_TO, &sig_tty, &dfb_vt->sig_usr2 )) {
               D_PERROR( "DirectFB/fbdev/vt: sigaction failed!\n" );
               close( dfb_vt->fd );
               return DFB_INIT;
          }


          vt.mode   = VT_PROCESS;
          vt.waitv  = 0;
          vt.relsig = SIG_SWITCH_FROM;
          vt.acqsig = SIG_SWITCH_TO;

          if (ioctl( dfb_vt->fd, VT_SETMODE, &vt ) < 0) {
               D_PERROR( "DirectFB/fbdev/vt: VT_SETMODE failed!\n" );

               sigaction( SIG_SWITCH_FROM, &dfb_vt->sig_usr1, NULL );
               sigaction( SIG_SWITCH_TO, &dfb_vt->sig_usr2, NULL );

               close( dfb_vt->fd );

               return DFB_INIT;
          }

          direct_util_recursive_pthread_mutex_init( &dfb_vt->lock );

          pthread_cond_init( &dfb_vt->wait, NULL );

          dfb_vt->vt_sig = -1;

          dfb_vt->thread = direct_thread_create( DTT_CRITICAL, vt_thread, NULL, "VT Switcher" );
     }

     return DFB_OK;
}

static int
vt_get_fb( int vt )
{
     struct fb_con2fbmap c2m;

     D_DEBUG_AT( VT, "%s( %d )\n", __FUNCTION__, vt );

     c2m.console = vt;

     if (ioctl( dfb_fbdev->fd, FBIOGET_CON2FBMAP, &c2m )) {
          D_PERROR( "DirectFB/FBDev/vt: "
                     "FBIOGET_CON2FBMAP failed!\n" );
          return 0;
     }

     D_DEBUG_AT( VT, "  -> %d\n", c2m.framebuffer );

     return c2m.framebuffer;
}

static void
vt_set_fb( int vt, int fb )
{
     struct fb_con2fbmap c2m;
     struct stat         sbf;

     D_DEBUG_AT( VT, "%s( %d, %d )\n", __FUNCTION__, vt, fb );

     if (fstat( dfb_fbdev->fd, &sbf )) {
          D_PERROR( "DirectFB/FBDev/vt: Could not fstat fb device!\n" );
          return;
     }

     if (fb >= 0)
          c2m.framebuffer = fb;
     else
          c2m.framebuffer = (sbf.st_rdev & 0xFF) >> 5;

     c2m.console = vt;

     if (ioctl( dfb_fbdev->fd, FBIOPUT_CON2FBMAP, &c2m ) < 0) {
          D_PERROR( "DirectFB/FBDev/vt: "
                     "FBIOPUT_CON2FBMAP failed!\n" );
     }
}

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/Makefile.am�����������������������������������������������������������0000644�0001750�0001750�00000001562�11164361026�014773� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/systems/fbdev

INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src

AM_CPPFLAGS = -D_XOPEN_SOURCE=500


internalincludedir = $(INTERNALINCLUDEDIR)/fbdev

internalinclude_HEADERS = \
	agp.h			\
	fb.h			\
	fbdev.h			\
	surfacemanager.h	\
	vt.h


systemsdir = $(MODULEDIR)/systems

if BUILD_STATIC
systems_DATA = libdirectfb_fbdev.o
endif
systems_LTLIBRARIES = libdirectfb_fbdev.la

libdirectfb_fbdev_la_LDFLAGS = \
	-avoid-version	\
	-module	\
	$(SYSFS_LIBS)

libdirectfb_fbdev_la_SOURCES = \
	agp.c			\
	fbdev.c			\
	fbdev_surface_pool.c	\
	surfacemanager.c	\
	vt.c

libdirectfb_fbdev_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la


include $(top_srcdir)/rules/libobject.make
����������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/surfacemanager.h������������������������������������������������������0000644�0001750�0001750�00000010200�11245562152�016063� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __SURFACEMANAGER_H__
#define __SURFACEMANAGER_H__

#include <directfb.h>

#include <core/coretypes.h>

typedef struct _SurfaceManager SurfaceManager;
typedef struct _Chunk          Chunk;

/*
 * initially there is one big free chunk,
 * chunks are splitted into a free and an occupied chunk if memory is allocated,
 * two chunks are merged to one free chunk if memory is deallocated
 */
struct _Chunk {
     int                  magic;

     int                  offset;      /* offset in memory,
                                          is greater or equal to the heap offset */
     int                  length;      /* length of this chunk in bytes */

     int                  pitch;
     
     CoreSurfaceBuffer   *buffer;      /* pointer to surface buffer occupying
                                          this chunk, or NULL if chunk is free */
     CoreSurfaceAllocation *allocation;

     int                  tolerations; /* number of times this chunk was scanned
                                          occupied, resetted in assure_video */

     Chunk               *prev;
     Chunk               *next;
};

struct _SurfaceManager {
     int                  magic;

     FusionSHMPoolShared *shmpool;

     Chunk               *chunks;

     int                  offset;
     int                  length;         /* length of the heap in bytes */
     int                  avail;          /* amount of available memory in bytes */

     int                  min_toleration;
     
     bool                 suspended;
};


DFBResult dfb_surfacemanager_create ( CoreDFB             *core,
                                      unsigned int         length,
                                      SurfaceManager     **ret_manager );

void      dfb_surfacemanager_destroy( SurfaceManager      *manager );

/*
 * adjust the offset within the framebuffer for surface storage,
 * needs to be called after a resolution switch
 */
DFBResult dfb_surfacemanager_adjust_heap_offset( SurfaceManager *manager,
                                                 int             offset );

/*
 * finds and allocates one for the surface or fails,
 * after success the video health is CSH_RESTORE.
 * NOTE: this does not notify the listeners
 */
DFBResult dfb_surfacemanager_allocate( CoreDFB                *core,
                                       SurfaceManager         *manager,
                                       CoreSurfaceBuffer      *buffer,
                                       CoreSurfaceAllocation  *allocation,
                                       Chunk                 **ret_chunk );

DFBResult dfb_surfacemanager_displace( CoreDFB           *core,
                                       SurfaceManager    *manager,
                                       CoreSurfaceBuffer *buffer );

/*
 * sets the video health to CSH_INVALID frees the chunk and
 * notifies the listeners
 */
DFBResult dfb_surfacemanager_deallocate( SurfaceManager *manager,
                                         Chunk          *chunk );

#endif

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/Makefile.in�����������������������������������������������������������0000644�0001750�0001750�00000050221�11307521506�015000� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@



VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
DIST_COMMON = $(internalinclude_HEADERS) $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in $(top_srcdir)/rules/libobject.make
subdir = systems/fbdev
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(systemsdir)" \
	"$(DESTDIR)$(internalincludedir)"
systemsLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(systems_LTLIBRARIES)
libdirectfb_fbdev_la_DEPENDENCIES =  \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la
am_libdirectfb_fbdev_la_OBJECTS = agp.lo fbdev.lo \
	fbdev_surface_pool.lo surfacemanager.lo vt.lo
libdirectfb_fbdev_la_OBJECTS = $(am_libdirectfb_fbdev_la_OBJECTS)
libdirectfb_fbdev_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
	$(libdirectfb_fbdev_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
	$(LDFLAGS) -o $@
SOURCES = $(libdirectfb_fbdev_la_SOURCES)
DIST_SOURCES = $(libdirectfb_fbdev_la_SOURCES)
systemsDATA_INSTALL = $(INSTALL_DATA)
DATA = $(systems_DATA)
internalincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(internalinclude_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
	-I$(top_srcdir)/include		\
	-I$(top_builddir)/include	\
	-I$(top_builddir)/lib		\
	-I$(top_srcdir)/lib		\
	-I$(top_srcdir)/src

AM_CPPFLAGS = -D_XOPEN_SOURCE=500
internalincludedir = $(INTERNALINCLUDEDIR)/fbdev
internalinclude_HEADERS = \
	agp.h			\
	fb.h			\
	fbdev.h			\
	surfacemanager.h	\
	vt.h

systemsdir = $(MODULEDIR)/systems
@BUILD_STATIC_TRUE@systems_DATA = libdirectfb_fbdev.o
systems_LTLIBRARIES = libdirectfb_fbdev.la
libdirectfb_fbdev_la_LDFLAGS = \
	-avoid-version	\
	-module	\
	$(SYSFS_LIBS)

libdirectfb_fbdev_la_SOURCES = \
	agp.c			\
	fbdev.c			\
	fbdev_surface_pool.c	\
	surfacemanager.c	\
	vt.c

libdirectfb_fbdev_la_LIBADD = \
	$(top_builddir)/lib/direct/libdirect.la \
	$(top_builddir)/lib/fusion/libfusion.la \
	$(top_builddir)/src/libdirectfb.la

all: all-am

.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  systems/fbdev/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  systems/fbdev/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-systemsLTLIBRARIES: $(systems_LTLIBRARIES)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    f=$(am__strip_dir) \
	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(systemsLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	  else :; fi; \
	done

uninstall-systemsLTLIBRARIES:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  p=$(am__strip_dir) \
	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(systemsdir)/$$p'"; \
	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(systemsdir)/$$p"; \
	done

clean-systemsLTLIBRARIES:
	-test -z "$(systems_LTLIBRARIES)" || rm -f $(systems_LTLIBRARIES)
	@list='$(systems_LTLIBRARIES)'; for p in $$list; do \
	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
	  test "$$dir" != "$$p" || dir=.; \
	  echo "rm -f \"$${dir}/so_locations\""; \
	  rm -f "$${dir}/so_locations"; \
	done
libdirectfb_fbdev.la: $(libdirectfb_fbdev_la_OBJECTS) $(libdirectfb_fbdev_la_DEPENDENCIES) 
	$(libdirectfb_fbdev_la_LINK) -rpath $(systemsdir) $(libdirectfb_fbdev_la_OBJECTS) $(libdirectfb_fbdev_la_LIBADD) $(LIBS)

mostlyclean-compile:
	-rm -f *.$(OBJEXT)

distclean-compile:
	-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbdev.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbdev_surface_pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/surfacemanager.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vt.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c $<

.c.obj:
@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`

.c.lo:
@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-systemsDATA: $(systems_DATA)
	@$(NORMAL_INSTALL)
	test -z "$(systemsdir)" || $(MKDIR_P) "$(DESTDIR)$(systemsdir)"
	@list='$(systems_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(systemsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(systemsdir)/$$f'"; \
	  $(systemsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(systemsdir)/$$f"; \
	done

uninstall-systemsDATA:
	@$(NORMAL_UNINSTALL)
	@list='$(systems_DATA)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(systemsdir)/$$f'"; \
	  rm -f "$(DESTDIR)$(systemsdir)/$$f"; \
	done
install-internalincludeHEADERS: $(internalinclude_HEADERS)
	@$(NORMAL_INSTALL)
	test -z "$(internalincludedir)" || $(MKDIR_P) "$(DESTDIR)$(internalincludedir)"
	@list='$(internalinclude_HEADERS)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(internalincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(internalincludedir)/$$f'"; \
	  $(internalincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(internalincludedir)/$$f"; \
	done

uninstall-internalincludeHEADERS:
	@$(NORMAL_UNINSTALL)
	@list='$(internalinclude_HEADERS)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(internalincludedir)/$$f'"; \
	  rm -f "$(DESTDIR)$(internalincludedir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
installdirs:
	for dir in "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(systemsdir)" "$(DESTDIR)$(internalincludedir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool clean-systemsLTLIBRARIES \
	mostlyclean-am

distclean: distclean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-internalincludeHEADERS install-systemsDATA \
	install-systemsLTLIBRARIES

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-compile mostlyclean-generic \
	mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-internalincludeHEADERS uninstall-systemsDATA \
	uninstall-systemsLTLIBRARIES

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool clean-systemsLTLIBRARIES ctags distclean \
	distclean-compile distclean-generic distclean-libtool \
	distclean-tags distdir dvi dvi-am html html-am info info-am \
	install install-am install-data install-data-am install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am \
	install-internalincludeHEADERS install-man install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	install-systemsDATA install-systemsLTLIBRARIES installcheck \
	installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-compile \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags uninstall uninstall-am uninstall-internalincludeHEADERS \
	uninstall-systemsDATA uninstall-systemsLTLIBRARIES

%.o: .libs/%.a %.la
	rm -f $<.tmp/*.o
	if test -d $<.tmp; then rmdir $<.tmp; fi
	mkdir $<.tmp
	(cd $<.tmp && $(AR) x ../../$<)
	$(LD) -o $@ -r $<.tmp/*.o
	rm -f $<.tmp/*.o && rmdir $<.tmp

.PHONY: $(LTLIBRARIES:%.la=.libs/%.a)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/fbdev.c���������������������������������������������������������������0000644�0001750�0001750�00000252537�11245562152�014206� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <asm/types.h>    /* Needs to be included before dfb_types.h */

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#if defined(HAVE_SYSIO)
# include <sys/io.h>
#endif
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/kd.h>

#include <pthread.h>

#ifdef USE_SYSFS
# include <sysfs/libsysfs.h>
#endif

#include <fusion/arena.h>
#include <fusion/fusion.h>
#include <fusion/reactor.h>
#include <fusion/shmalloc.h>

#include <directfb.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>

#include <core/layer_control.h>
#include <core/layers.h>
#include <core/gfxcard.h>
#include <core/palette.h>
#include <core/screen.h>
#include <core/screens.h>
#include <core/surface.h>
#include <core/surface_buffer.h>
#include <core/surface_pool.h>
#include <core/state.h>
#include <core/windows.h>

#include <gfx/convert.h>

#include <direct/mem.h>
#include <direct/memcpy.h>
#include <direct/messages.h>
#include <direct/signals.h>
#include <direct/system.h>
#include <direct/util.h>

#include <misc/conf.h>
#include <misc/util.h>

#include "fbdev.h"
#include "fb.h"
#include "vt.h"
#include "agp.h"

#include <core/core_system.h>

DFB_CORE_SYSTEM( fbdev )


D_DEBUG_DOMAIN( FBDev_Mode, "FBDev/Mode", "FBDev System Module Mode Switching" );

/******************************************************************************/

extern const SurfacePoolFuncs fbdevSurfacePoolFuncs;

static FusionCallHandlerResult
fbdev_ioctl_call_handler( int           caller,
                          int           call_arg,
                          void         *call_ptr,
                          void         *ctx,
                          unsigned int  serial,
                          int          *ret_val );

static int fbdev_ioctl( int request, void *arg, int arg_size );

#define FBDEV_IOCTL(request,arg)   fbdev_ioctl( request, arg, sizeof(*(arg)) )

FBDev *dfb_fbdev = NULL;

/******************************************************************************/

static int       primaryLayerDataSize ( void );

static int       primaryRegionDataSize( void );

static DFBResult primaryInitLayer     ( CoreLayer                  *layer,
                                        void                       *driver_data,
                                        void                       *layer_data,
                                        DFBDisplayLayerDescription *description,
                                        DFBDisplayLayerConfig      *config,
                                        DFBColorAdjustment         *adjustment );

static DFBResult primarySetColorAdjustment( CoreLayer              *layer,
                                            void                   *driver_data,
                                            void                   *layer_data,
                                            DFBColorAdjustment     *adjustment );

static DFBResult primaryTestRegion    ( CoreLayer                  *layer,
                                        void                       *driver_data,
                                        void                       *layer_data,
                                        CoreLayerRegionConfig      *config,
                                        CoreLayerRegionConfigFlags *failed );

static DFBResult primaryAddRegion     ( CoreLayer                  *layer,
                                        void                       *driver_data,
                                        void                       *layer_data,
                                        void                       *region_data,
                                        CoreLayerRegionConfig      *config );

static DFBResult primarySetRegion     ( CoreLayer                  *layer,
                                        void                       *driver_data,
                                        void                       *layer_data,
                                        void                       *region_data,
                                        CoreLayerRegionConfig      *config,
                                        CoreLayerRegionConfigFlags  updated,
                                        CoreSurface                *surface,
                                        CorePalette                *palette,
                                        CoreSurfaceBufferLock      *lock );

static DFBResult primaryRemoveRegion  ( CoreLayer                  *layer,
                                        void                       *driver_data,
                                        void                       *layer_data,
                                        void                       *region_data );

static DFBResult primaryFlipRegion    ( CoreLayer                  *layer,
                                        void                       *driver_data,
                                        void                       *layer_data,
                                        void                       *region_data,
                                        CoreSurface                *surface,
                                        DFBSurfaceFlipFlags         flags,
                                        CoreSurfaceBufferLock      *lock );


static DisplayLayerFuncs primaryLayerFuncs = {
     .LayerDataSize      = primaryLayerDataSize,
     .RegionDataSize     = primaryRegionDataSize,
     .InitLayer          = primaryInitLayer,

     .SetColorAdjustment = primarySetColorAdjustment,

     .TestRegion         = primaryTestRegion,
     .AddRegion          = primaryAddRegion,
     .SetRegion          = primarySetRegion,
     .RemoveRegion       = primaryRemoveRegion,
     .FlipRegion         = primaryFlipRegion,
};

/******************************************************************************/

static DFBResult primaryInitScreen  ( CoreScreen           *screen,
                                      CoreGraphicsDevice   *device,
                                      void                 *driver_data,
                                      void                 *screen_data,
                                      DFBScreenDescription *description );

static DFBResult primarySetPowerMode( CoreScreen           *screen,
                                      void                 *driver_data,
                                      void                 *screen_data,
                                      DFBScreenPowerMode    mode );

static DFBResult primaryWaitVSync   ( CoreScreen           *screen,
                                      void                 *driver_data,
                                      void                 *layer_data );

static DFBResult primaryGetScreenSize( CoreScreen           *screen,
                                       void                 *driver_data,
                                       void                 *screen_data,
                                       int                  *ret_width,
                                       int                  *ret_height );

static ScreenFuncs primaryScreenFuncs = {
     .InitScreen    = primaryInitScreen,
     .SetPowerMode  = primarySetPowerMode,
     .WaitVSync     = primaryWaitVSync,
     .GetScreenSize = primaryGetScreenSize,
};

/******************************************************************************/

static DFBResult dfb_fbdev_read_modes( void );
static DFBResult dfb_fbdev_set_gamma_ramp( DFBSurfacePixelFormat format );
static DFBResult dfb_fbdev_set_palette( CorePalette *palette );
static DFBResult dfb_fbdev_set_rgb332_palette( void );
static DFBResult dfb_fbdev_pan( int xoffset, int yoffset, bool onsync );
static DFBResult dfb_fbdev_blank( int level );
static void      dfb_fbdev_var_to_mode( const struct fb_var_screeninfo *var,
                                        VideoMode                      *mode );

/******************************************************************************/

static inline
void waitretrace (void)
{
#if defined(HAVE_INB_OUTB_IOPL)
     if (iopl(3))
          return;

     if (!(inb (0x3cc) & 1)) {
          while ((inb (0x3ba) & 0x8))
               ;

          while (!(inb (0x3ba) & 0x8))
               ;
     }
     else {
          while ((inb (0x3da) & 0x8))
               ;

          while (!(inb (0x3da) & 0x8))
               ;
     }
#endif
}

/******************************************************************************/

static DFBResult dfb_fbdev_open( void )
{
     DFBResult error_result = DFB_FAILURE;

     if (dfb_config->fb_device) {
          dfb_fbdev->fd = open( dfb_config->fb_device, O_RDWR );
          if (dfb_fbdev->fd < 0) {
               D_PERROR( "DirectFB/FBDev: Error opening '%s'!\n",
                         dfb_config->fb_device);

               error_result = errno2result( errno );
               goto error;
          }
     }
     else if (getenv( "FRAMEBUFFER" ) && *getenv( "FRAMEBUFFER" ) != '\0') {
          dfb_fbdev->fd = open( getenv ("FRAMEBUFFER"), O_RDWR );
          if (dfb_fbdev->fd < 0) {
               D_PERROR( "DirectFB/FBDev: Error opening '%s'!\n",
                          getenv ("FRAMEBUFFER"));

               error_result = errno2result( errno );
               goto error;
          }
     }
     else {
          dfb_fbdev->fd = direct_try_open( "/dev/fb0", "/dev/fb/0", O_RDWR, true );
          if (dfb_fbdev->fd < 0) {
               D_ERROR( "DirectFB/FBDev: Error opening framebuffer device!\n" );
               D_ERROR( "DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.\n" );
               error_result = DFB_INIT;
               goto error;
          }
     }

     /* should be closed automatically in children upon exec(...) */
     if (fcntl( dfb_fbdev->fd, F_SETFD, FD_CLOEXEC ) < 0)
     {
          D_PERROR( "Fusion/Init: Setting FD_CLOEXEC flag failed!\n" );
          goto error;
     }

     return DFB_OK;
error:
     return error_result;
}

/******************************************************************************/

static void
dfb_fbdev_get_pci_info( FBDevShared *shared )
{
     char buf[512];
     int  vendor = -1;
     int  model  = -1;

#ifdef USE_SYSFS
     if (!sysfs_get_mnt_path( buf, 512 )) {
          struct sysfs_class_device *classdev;
          struct sysfs_device       *device;
          struct sysfs_attribute    *attr;
          char                      *fbdev;
          char                       dev[5] = { 'f', 'b', '0', 0, 0 };

          fbdev = dfb_config->fb_device;
          if (!fbdev)
               fbdev = getenv( "FRAMEBUFFER" );

          if (fbdev) {
               if (!strncmp( fbdev, "/dev/fb/", 8 ))
                    snprintf( dev, 5, "fb%s", fbdev+8 );
               else if (!strncmp( fbdev, "/dev/fb", 7 ))
                    snprintf( dev, 5, "fb%s", fbdev+7 );
          }

          classdev = sysfs_open_class_device( "graphics", dev );
          if (classdev) {
               device = sysfs_get_classdev_device( classdev );

               if (device) {
                    attr = sysfs_get_device_attr( device, "vendor" );
                    if (attr)
                           sscanf( attr->value, "0x%04x", &vendor );

                    attr = sysfs_get_device_attr( device, "device" );
                    if (attr)
                         sscanf( attr->value, "0x%04x", &model );

                    if (vendor != -1 && model != -1) {
                         sscanf( device->name, "0000:%02x:%02x.%1x",
                                 &shared->pci.bus,
                                 &shared->pci.dev,
                                 &shared->pci.func );

                         shared->device.vendor = vendor;
                         shared->device.model  = model;
                    }
               }

               sysfs_close_class_device( classdev );
          }
     }
#endif /* USE_SYSFS */

     /* try /proc interface */
     if (vendor == -1 || model == -1) {
          FILE *fp;
          int   id;
          int   bus;
          int   dev;
          int   func;

          fp = fopen( "/proc/bus/pci/devices", "r" );
          if (!fp) {
               D_DEBUG( "DirectFB/FBDev: "
                        "couldn't access /proc/bus/pci/devices!\n" );
               return;
          }

          while (fgets( buf, 512, fp )) {
               if (sscanf( buf, "%04x\t%04x%04x", &id, &vendor, &model ) == 3) {
                    bus  = (id & 0xff00) >> 8;
                    dev  = (id & 0x00ff) >> 3;
                    func = (id & 0x0007);

                    if (bus  == dfb_config->pci.bus &&
                        dev  == dfb_config->pci.dev &&
                        func == dfb_config->pci.func)
                    {
                         shared->pci.bus  = bus;
                         shared->pci.dev  = dev;
                         shared->pci.func = func;

                         shared->device.vendor = vendor;
                         shared->device.model  = model;

                         break;
                    }
               }
          }

          fclose( fp );
     }
}


/** public **/

static void
system_get_info( CoreSystemInfo *info )
{
     info->type = CORE_FBDEV;
     info->caps = CSCAPS_ACCELERATION;

     snprintf( info->name, DFB_CORE_SYSTEM_INFO_NAME_LENGTH, "FBDev" );
}

static DFBResult
system_initialize( CoreDFB *core, void **data )
{
     DFBResult            ret;
     CoreScreen          *screen;
     long                 page_size;
     FBDevShared         *shared = NULL;
     FusionSHMPoolShared *pool;
     FusionSHMPoolShared *pool_data;

     D_ASSERT( dfb_fbdev == NULL );

     pool      = dfb_core_shmpool( core );
     pool_data = dfb_core_shmpool_data( core );

     dfb_fbdev = D_CALLOC( 1, sizeof(FBDev) );
     if (!dfb_fbdev)
          return D_OOM();

     dfb_fbdev->fd = -1;

     shared = (FBDevShared*) SHCALLOC( pool, 1, sizeof(FBDevShared) );
     if (!shared) {
          ret = D_OOSHM();
          goto error;
     }

     shared->shmpool      = pool;
     shared->shmpool_data = pool_data;

     fusion_arena_add_shared_field( dfb_core_arena( core ), "fbdev", shared );

     dfb_fbdev->core   = core;
     dfb_fbdev->shared = shared;

     page_size = direct_pagesize();

     shared->page_mask = page_size < 0 ? 0 : (page_size - 1);

     ret = dfb_fbdev_open();
     if (ret)
          goto error;

     if (dfb_config->vt) {
          ret = dfb_vt_initialize();
          if (ret)
               goto error;
     }

     ret = DFB_INIT;

     /* Retrieve fixed informations like video ram size */
     if (ioctl( dfb_fbdev->fd, FBIOGET_FSCREENINFO, &shared->fix ) < 0) {
          D_PERROR( "DirectFB/FBDev: "
                    "Could not get fixed screen information!\n" );
          goto error;
     }

     /* Map the framebuffer */
     dfb_fbdev->framebuffer_base = mmap( NULL, shared->fix.smem_len,
                                         PROT_READ | PROT_WRITE, MAP_SHARED,
                                         dfb_fbdev->fd, 0 );
     if (dfb_fbdev->framebuffer_base == MAP_FAILED) {
          D_PERROR( "DirectFB/FBDev: "
                    "Could not mmap the framebuffer!\n");
          dfb_fbdev->framebuffer_base = NULL;
          goto error;
     }

     if (ioctl( dfb_fbdev->fd, FBIOGET_VSCREENINFO, &shared->orig_var ) < 0) {
          D_PERROR( "DirectFB/FBDev: "
                    "Could not get variable screen information!\n" );
          goto error;
     }

     shared->current_var = shared->orig_var;
     shared->current_var.accel_flags = 0;

     if (ioctl( dfb_fbdev->fd, FBIOPUT_VSCREENINFO, &shared->current_var ) < 0) {
          D_PERROR( "DirectFB/FBDev: "
                    "Could not disable console acceleration!\n" );
          goto error;
     }

     dfb_fbdev_var_to_mode( &shared->current_var,
                            &shared->current_mode );

     shared->orig_cmap_memory = SHMALLOC( pool_data, 256 * 2 * 4 );
     if (!shared->orig_cmap_memory) {
          ret = D_OOSHM();
          goto error;
     }

     shared->orig_cmap.start  = 0;
     shared->orig_cmap.len    = 256;
     shared->orig_cmap.red    = shared->orig_cmap_memory + 256 * 2 * 0;
     shared->orig_cmap.green  = shared->orig_cmap_memory + 256 * 2 * 1;
     shared->orig_cmap.blue   = shared->orig_cmap_memory + 256 * 2 * 2;
     shared->orig_cmap.transp = shared->orig_cmap_memory + 256 * 2 * 3;

     if (ioctl( dfb_fbdev->fd, FBIOGETCMAP, &shared->orig_cmap ) < 0) {
          D_DEBUG( "DirectFB/FBDev: "
                   "Could not retrieve palette for backup!\n" );

          memset( &shared->orig_cmap, 0, sizeof(shared->orig_cmap) );

          SHFREE( pool_data, shared->orig_cmap_memory );
          shared->orig_cmap_memory = NULL;
     }

     shared->temp_cmap_memory = SHMALLOC( pool_data, 256 * 2 * 4 );
     if (!shared->temp_cmap_memory) {
          ret = D_OOSHM();
          goto error;
     }

     shared->temp_cmap.start  = 0;
     shared->temp_cmap.len    = 256;
     shared->temp_cmap.red    = shared->temp_cmap_memory + 256 * 2 * 0;
     shared->temp_cmap.green  = shared->temp_cmap_memory + 256 * 2 * 1;
     shared->temp_cmap.blue   = shared->temp_cmap_memory + 256 * 2 * 2;
     shared->temp_cmap.transp = shared->temp_cmap_memory + 256 * 2 * 3;

     shared->current_cmap_memory = SHMALLOC( pool_data, 256 * 2 * 4 );
     if (!shared->current_cmap_memory) {
          ret = D_OOSHM();
          goto error;
     }

     shared->current_cmap.start  = 0;
     shared->current_cmap.len    = 256;
     shared->current_cmap.red    = shared->current_cmap_memory + 256 * 2 * 0;
     shared->current_cmap.green  = shared->current_cmap_memory + 256 * 2 * 1;
     shared->current_cmap.blue   = shared->current_cmap_memory + 256 * 2 * 2;
     shared->current_cmap.transp = shared->current_cmap_memory + 256 * 2 * 3;

     dfb_fbdev_get_pci_info( shared );

     if (dfb_config->agp) {
          /* Do not fail here, AGP slot could be unavailable */
          ret = dfb_agp_initialize();
          if (ret) {
               D_DEBUG( "DirectFB/FBDev: dfb_agp_initialize()\n\t->%s\n",
                         DirectFBErrorString( ret ) );
               ret = DFB_OK;
          }
     }

     fusion_call_init( &shared->fbdev_ioctl,
                       fbdev_ioctl_call_handler, NULL, dfb_core_world(core) );

     dfb_surface_pool_initialize( core, &fbdevSurfacePoolFuncs, &dfb_fbdev->shared->pool );

     /* Register primary screen functions */
     screen = dfb_screens_register( NULL, NULL, &primaryScreenFuncs );

     /* Register primary layer functions */
     dfb_layers_register( screen, NULL, &primaryLayerFuncs );

     *data = dfb_fbdev;

     return DFB_OK;


error:
     if (shared) {
          if (shared->orig_cmap_memory)
               SHFREE( pool_data, shared->orig_cmap_memory );

          if (shared->temp_cmap_memory)
               SHFREE( pool_data, shared->temp_cmap_memory );

          if (shared->current_cmap_memory)
               SHFREE( pool_data, shared->current_cmap_memory );

          SHFREE( pool, shared );
     }

     if (dfb_fbdev->framebuffer_base)
          munmap( dfb_fbdev->framebuffer_base, shared->fix.smem_len );

     if (dfb_fbdev->fd != -1)
          close( dfb_fbdev->fd );

     D_FREE( dfb_fbdev );
     dfb_fbdev = NULL;

     return ret;
}

static DFBResult
system_join( CoreDFB *core, void **data )
{
     DFBResult   ret;
     CoreScreen *screen;
     void       *shared;

     D_ASSERT( dfb_fbdev == NULL );

     if (dfb_config->vt) {
          ret = dfb_vt_join();
          if (ret)
               return ret;
     }

     dfb_fbdev = D_CALLOC( 1, sizeof(FBDev) );
     if (!dfb_fbdev)
          return D_OOM();

     fusion_arena_get_shared_field( dfb_core_arena( core ),
                                    "fbdev", &shared );

     dfb_fbdev->core = core;
     dfb_fbdev->shared = shared;

     /* Open framebuffer device */
     ret = dfb_fbdev_open();
     if (ret) {
          D_FREE( dfb_fbdev );
          dfb_fbdev = NULL;
          return ret;
     }

     /* Map the framebuffer */
     dfb_fbdev->framebuffer_base = mmap( NULL, dfb_fbdev->shared->fix.smem_len,
                                         PROT_READ | PROT_WRITE, MAP_SHARED,
                                         dfb_fbdev->fd, 0 );
     if (dfb_fbdev->framebuffer_base == MAP_FAILED) {
          D_PERROR( "DirectFB/FBDev: "
                    "Could not mmap the framebuffer!\n");
          close( dfb_fbdev->fd );
          D_FREE( dfb_fbdev );
          dfb_fbdev = NULL;

          return DFB_INIT;
     }

     /* Open AGP device */
     ret = dfb_agp_join();
     if (ret) {
          D_ERROR( "DirectFB/FBDev: Could not join AGP!\n" );
          munmap( dfb_fbdev->framebuffer_base,
                  dfb_fbdev->shared->fix.smem_len );
          close( dfb_fbdev->fd );
          D_FREE( dfb_fbdev );
          dfb_fbdev = NULL;

          return ret;
     }

     dfb_surface_pool_join( core, dfb_fbdev->shared->pool, &fbdevSurfacePoolFuncs );

     /* Register primary screen functions */
     screen = dfb_screens_register( NULL, NULL, &primaryScreenFuncs );

     /* Register primary layer functions */
     dfb_layers_register( screen, NULL, &primaryLayerFuncs );

     *data = dfb_fbdev;

     return DFB_OK;
}

static DFBResult
system_shutdown( bool emergency )
{
     DFBResult            ret;
     VideoMode           *m;
     FBDevShared         *shared;
     FusionSHMPoolShared *pool;

     D_ASSERT( dfb_fbdev != NULL );

     shared = dfb_fbdev->shared;

     D_ASSERT( shared != NULL );

     pool = shared->shmpool;

     D_ASSERT( pool != NULL );

     m = shared->modes;
     while (m) {
          VideoMode *next = m->next;
          SHFREE( pool, m );
          m = next;
     }

     if (ioctl( dfb_fbdev->fd, FBIOPUT_VSCREENINFO, &shared->orig_var ) < 0) {
          D_PERROR( "DirectFB/FBDev: "
                    "Could not restore variable screen information!\n" );
     }

     if (shared->orig_cmap.len) {
          if (ioctl( dfb_fbdev->fd, FBIOPUTCMAP, &shared->orig_cmap ) < 0)
               D_DEBUG( "DirectFB/FBDev: "
                        "Could not restore palette!\n" );
     }

     if (shared->orig_cmap_memory)
          SHFREE( shared->shmpool_data, shared->orig_cmap_memory );

     if (shared->temp_cmap_memory)
          SHFREE( shared->shmpool_data, shared->temp_cmap_memory );

     if (shared->current_cmap_memory)
          SHFREE( shared->shmpool_data, shared->current_cmap_memory );

     fusion_call_destroy( &shared->fbdev_ioctl );

     dfb_agp_shutdown();

     dfb_surface_pool_destroy( dfb_fbdev->shared->pool );

     munmap( dfb_fbdev->framebuffer_base, shared->fix.smem_len );

     if (dfb_config->vt) {
          ret = dfb_vt_shutdown( emergency );
          if (ret)
               return ret;
     }

     close( dfb_fbdev->fd );

     SHFREE( pool, shared );
     D_FREE( dfb_fbdev );
     dfb_fbdev = NULL;

     return DFB_OK;
}

static DFBResult
system_leave( bool emergency )
{
     DFBResult ret;

     D_ASSERT( dfb_fbdev != NULL );

     dfb_agp_leave();

     dfb_surface_pool_leave( dfb_fbdev->shared->pool );

     munmap( dfb_fbdev->framebuffer_base,
             dfb_fbdev->shared->fix.smem_len );

     if (dfb_config->vt) {
          ret = dfb_vt_leave( emergency );
          if (ret)
               return ret;
     }

     close( dfb_fbdev->fd );

     D_FREE( dfb_fbdev );
     dfb_fbdev = NULL;

     return DFB_OK;
}

static DFBResult
system_suspend( void )
{
     return DFB_OK;
}

static DFBResult
system_resume( void )
{
     return DFB_OK;
}

/******************************************************************************/

static volatile void *
system_map_mmio( unsigned int    offset,
                 int             length )
{
     void *addr;

     if (length <= 0)
          length = dfb_fbdev->shared->fix.mmio_len;

     addr = mmap( NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED,
                  dfb_fbdev->fd, dfb_fbdev->shared->fix.smem_len + offset );
     if (addr == MAP_FAILED) {
          D_PERROR( "DirectFB/FBDev: Could not mmap MMIO region "
                     "(offset %d, length %d)!\n", offset, length );
          return NULL;
     }

     return(volatile void*) ((u8*) addr + (dfb_fbdev->shared->fix.mmio_start &
                                           dfb_fbdev->shared->page_mask));
}

static void
system_unmap_mmio( volatile void  *addr,
                   int             length )
{
     if (length <= 0)
          length = dfb_fbdev->shared->fix.mmio_len;

     if (munmap( (void*) ((u8*) addr - (dfb_fbdev->shared->fix.mmio_start &
                                        dfb_fbdev->shared->page_mask)), length ) < 0)
          D_PERROR( "DirectFB/FBDev: Could not unmap MMIO region "
                     "at %p (length %d)!\n", addr, length );
}

static int
system_get_accelerator( void )
{
#ifdef FB_ACCEL_MATROX_MGAG400
     if (!strcmp( dfb_fbdev->shared->fix.id, "MATROX DH" ))
          return FB_ACCEL_MATROX_MGAG400;
#endif
#ifdef FB_ACCEL_EP9X
     if (!strcmp( dfb_fbdev->shared->fix.id, "ep9xfb" ))
	  return FB_ACCEL_EP9X;
#endif

     if (dfb_fbdev->shared->fix.mmio_len > 0)
          return dfb_fbdev->shared->fix.accel;
     return -1;
}

static VideoMode *
system_get_modes( void )
{
     return dfb_fbdev->shared->modes;
}

static VideoMode *
system_get_current_mode( void )
{
     return &dfb_fbdev->shared->current_mode;
}

static DFBResult
system_thread_init( void )
{
     if (dfb_config->block_all_signals)
          direct_signals_block_all();

     return DFB_OK;
}

static bool
system_input_filter( CoreInputDevice *device,
                     DFBInputEvent   *event )
{
     if (dfb_config->vt && dfb_config->vt_switching) {
          switch (event->type) {
               case DIET_KEYPRESS:
                    if (DFB_KEY_TYPE(event->key_symbol) == DIKT_FUNCTION &&
                        event->modifiers == (DIMM_CONTROL | DIMM_ALT))
                         return dfb_vt_switch( event->key_symbol - DIKS_F1 + 1 );

                    break;

               case DIET_KEYRELEASE:
                    if (DFB_KEY_TYPE(event->key_symbol) == DIKT_FUNCTION &&
                        event->modifiers == (DIMM_CONTROL | DIMM_ALT))
                         return true;

                    break;

               default:
                    break;
          }
     }

     return false;
}

static unsigned long
system_video_memory_physical( unsigned int offset )
{
     return dfb_fbdev->shared->fix.smem_start + offset;
}

static void *
system_video_memory_virtual( unsigned int offset )
{
     return(void*)((u8*)(dfb_fbdev->framebuffer_base) + offset);
}

static unsigned int
system_videoram_length( void )
{
     return dfb_fbdev->shared->fix.smem_len;
}

static unsigned long
system_aux_memory_physical( unsigned int offset )
{
     if (dfb_fbdev->shared->agp)
          return dfb_fbdev->shared->agp->info.aper_base + offset;
     return 0;
}

static void *
system_aux_memory_virtual( unsigned int offset )
{
     if (dfb_fbdev->agp)
          return (void*)(u8*)dfb_fbdev->agp->base + offset;
     return NULL;
}

static unsigned int
system_auxram_length( void )
{
     if (dfb_fbdev->shared->agp)
          return dfb_fbdev->shared->agp->agp_mem;
     return 0;
}

static void
system_get_busid( int *ret_bus, int *ret_dev, int *ret_func )
{
     *ret_bus  = dfb_fbdev->shared->pci.bus;
     *ret_dev  = dfb_fbdev->shared->pci.dev;
     *ret_func = dfb_fbdev->shared->pci.func;
}

static void
system_get_deviceid( unsigned int *ret_vendor_id,
                     unsigned int *ret_device_id )
{
     *ret_vendor_id = dfb_fbdev->shared->device.vendor;
     *ret_device_id = dfb_fbdev->shared->device.model;
}

/******************************************************************************/

static DFBResult
init_modes( void )
{
     dfb_fbdev_read_modes();

     if (!dfb_fbdev->shared->modes) {
          /* try to use current mode*/
          dfb_fbdev->shared->modes = (VideoMode*) SHCALLOC( dfb_fbdev->shared->shmpool,
                                                            1, sizeof(VideoMode) );
          if (!dfb_fbdev->shared->modes)
               return D_OOSHM();

          *dfb_fbdev->shared->modes = dfb_fbdev->shared->current_mode;

          if (dfb_fbdev_test_mode_simple(dfb_fbdev->shared->modes)) {
               D_ERROR("DirectFB/FBDev: "
                        "No supported modes found in /etc/fb.modes and "
                        "current mode not supported!\n");

               D_ERROR( "DirectFB/FBDev: Current mode's pixelformat: "
                         "rgba %d/%d, %d/%d, %d/%d, %d/%d (%dbit)\n",
                         dfb_fbdev->shared->orig_var.red.length,
                         dfb_fbdev->shared->orig_var.red.offset,
                         dfb_fbdev->shared->orig_var.green.length,
                         dfb_fbdev->shared->orig_var.green.offset,
                         dfb_fbdev->shared->orig_var.blue.length,
                         dfb_fbdev->shared->orig_var.blue.offset,
                         dfb_fbdev->shared->orig_var.transp.length,
                         dfb_fbdev->shared->orig_var.transp.offset,
                         dfb_fbdev->shared->orig_var.bits_per_pixel );

               return DFB_INIT;
          }
     }

     return DFB_OK;
}

/******************************************************************************/

static DFBResult
primaryInitScreen( CoreScreen           *screen,
                   CoreGraphicsDevice   *device,
                   void                 *driver_data,
                   void                 *screen_data,
                   DFBScreenDescription *description )
{
     /* Set the screen capabilities. */
     description->caps = DSCCAPS_VSYNC | DSCCAPS_POWER_MANAGEMENT;

     /* Set the screen name. */
     snprintf( description->name,
               DFB_SCREEN_DESC_NAME_LENGTH, "FBDev Primary Screen" );

     return DFB_OK;
}

static DFBResult
primarySetPowerMode( CoreScreen         *screen,
                     void               *driver_data,
                     void               *screen_data,
                     DFBScreenPowerMode  mode )
{
     int level;

     switch (mode) {
          case DSPM_OFF:
               level = 4;
               break;
          case DSPM_SUSPEND:
               level = 3;
               break;
          case DSPM_STANDBY:
               level = 2;
               break;
          case DSPM_ON:
               level = 0;
               break;
          default:
               return DFB_INVARG;
     }

     return dfb_fbdev_blank( level );
}

static DFBResult
primaryWaitVSync( CoreScreen *screen,
                  void       *driver_data,
                  void       *screen_data )
{
     static const int zero = 0;

     if (dfb_config->pollvsync_none)
          return DFB_OK;

     if (ioctl( dfb_fbdev->fd, FBIO_WAITFORVSYNC, &zero ))
          waitretrace();

     return DFB_OK;
}

static DFBResult
primaryGetScreenSize( CoreScreen *screen,
                      void       *driver_data,
                      void       *screen_data,
                      int        *ret_width,
                      int        *ret_height )
{
     D_ASSERT( dfb_fbdev != NULL );
     D_ASSERT( dfb_fbdev->shared != NULL );

     *ret_width  = dfb_fbdev->shared->current_mode.xres;
     *ret_height = dfb_fbdev->shared->current_mode.yres;

     return DFB_OK;
}

/******************************************************************************/

static int
primaryLayerDataSize( void )
{
     return 0;
}

static int
primaryRegionDataSize( void )
{
     return 0;
}

static DFBResult
primaryInitLayer( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  DFBDisplayLayerDescription *description,
                  DFBDisplayLayerConfig      *config,
                  DFBColorAdjustment         *adjustment )
{
     DFBResult  ret;
     VideoMode *default_mode;

     /* initialize mode table */
     ret = init_modes();
     if (ret)
          return ret;

     default_mode = dfb_fbdev->shared->modes;

     /* set capabilities and type */
     description->caps = DLCAPS_SURFACE    | DLCAPS_CONTRAST |
                         DLCAPS_SATURATION | DLCAPS_BRIGHTNESS;
     description->type = DLTF_GRAPHICS;

     /* set name */
     snprintf( description->name,
               DFB_DISPLAY_LAYER_DESC_NAME_LENGTH, "FBDev Primary Layer" );

     /* fill out default color adjustment */
     adjustment->flags      = DCAF_BRIGHTNESS | DCAF_CONTRAST | DCAF_SATURATION;
     adjustment->brightness = 0x8000;
     adjustment->contrast   = 0x8000;
     adjustment->saturation = 0x8000;

     /* fill out the default configuration */
     config->flags      = DLCONF_WIDTH       | DLCONF_HEIGHT |
                          DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
     config->buffermode = DLBM_FRONTONLY;
     config->width      = dfb_config->mode.width  ? dfb_config->mode.width  : default_mode->xres;
     config->height     = dfb_config->mode.height ? dfb_config->mode.height : default_mode->yres;

     if (dfb_config->mode.format)
          config->pixelformat = dfb_config->mode.format;
     else
          config->pixelformat = dfb_pixelformat_for_depth( default_mode->bpp );

     return DFB_OK;
}

static DFBResult
primarySetColorAdjustment( CoreLayer          *layer,
                           void               *driver_data,
                           void               *layer_data,
                           DFBColorAdjustment *adjustment )
{
     struct fb_cmap *cmap       = &dfb_fbdev->shared->current_cmap;
     struct fb_cmap *temp       = &dfb_fbdev->shared->temp_cmap;
     int             contrast   = adjustment->contrast >> 8;
     int             brightness = (adjustment->brightness >> 8) - 128;
     int             saturation = adjustment->saturation >> 8;
     int             r, g, b, i;

     if (dfb_fbdev->shared->fix.visual != FB_VISUAL_DIRECTCOLOR)
          return DFB_UNIMPLEMENTED;

     /* Use gamma ramp to set color attributes */
     for (i = 0; i < (int)cmap->len; i++) {
          r = cmap->red[i];
          g = cmap->green[i];
          b = cmap->blue[i];
          r >>= 8;
          g >>= 8;
          b >>= 8;

          /*
        * Brightness Adjustment: Increase/Decrease each color channels
        * by a constant amount as specified by value of brightness.
        */
          if (adjustment->flags & DCAF_BRIGHTNESS) {
               r += brightness;
               g += brightness;
               b += brightness;

               r = CLAMP( r, 0, 255 );
               g = CLAMP( g, 0, 255 );
               b = CLAMP( b, 0, 255 );
          }

          /*
           * Contrast Adjustment:  We increase/decrease the "separation"
           * between colors in proportion to the value specified by the
           * contrast control. Decreasing the contrast has a side effect
           * of decreasing the brightness.
           */

          if (adjustment->flags & DCAF_CONTRAST) {
               /* Increase contrast */
               if (contrast > 128) {
                    int c = contrast - 128;

                    r = ((r + c/2)/c) * c;
                    g = ((g + c/2)/c) * c;
                    b = ((b + c/2)/c) * c;
               }
               /* Decrease contrast */
               else if (contrast < 127) {
                    r = (r * contrast) >> 7;
                    g = (g * contrast) >> 7;
                    b = (b * contrast) >> 7;
               }

               r = CLAMP( r, 0, 255 );
               g = CLAMP( g, 0, 255 );
               b = CLAMP( b, 0, 255 );
          }

          /*
           * Saturation Adjustment:  This is is a better implementation.
           * Saturation is implemented by "mixing" a proportion of medium
           * gray to the color value.  On the other side, "removing"
           * a proportion of medium gray oversaturates the color.
           */
          if (adjustment->flags & DCAF_SATURATION) {
               if (saturation > 128) {
                    int gray = saturation - 128;
                    int color = 128 - gray;

                    r = ((r - gray) << 7) / color;
                    g = ((g - gray) << 7) / color;
                    b = ((b - gray) << 7) / color;
               }
               else if (saturation < 128) {
                    int color = saturation;
                    int gray = 128 - color;

                    r = ((r * color) >> 7) + gray;
                    g = ((g * color) >> 7) + gray;
                    b = ((b * color) >> 7) + gray;
               }

               r = CLAMP( r, 0, 255 );
               g = CLAMP( g, 0, 255 );
               b = CLAMP( b, 0, 255 );
          }
          r |= r << 8;
          g |= g << 8;
          b |= b << 8;

          temp->red[i]   =  (unsigned short)r;
          temp->green[i] =  (unsigned short)g;
          temp->blue[i]  =  (unsigned short)b;
     }

     temp->len = cmap->len;
     temp->start = cmap->start;
     if (FBDEV_IOCTL( FBIOPUTCMAP, temp ) < 0) {
          D_PERROR( "DirectFB/FBDev: Could not set the palette!\n" );

          return errno2result(errno);
     }

     return DFB_OK;
}

const VideoMode *
dfb_fbdev_find_mode( int width, int height )
{
     FBDevShared     *shared    = dfb_fbdev->shared;
     const VideoMode *videomode = shared->modes;
     const VideoMode *highest   = NULL;

     while (videomode) {
          if (videomode->xres == width && videomode->yres == height) {
               if (!highest || highest->priority < videomode->priority)
                    highest = videomode;
          }

          videomode = videomode->next;
     }

     if (!highest)
          D_ERROR( "FBDev/Mode: No mode found for %dx%d!\n", width, height );

     return highest;
}

static DFBResult
primaryTestRegion( CoreLayer                  *layer,
                   void                       *driver_data,
                   void                       *layer_data,
                   CoreLayerRegionConfig      *config,
                   CoreLayerRegionConfigFlags *failed )
{
     FBDevShared                *shared = dfb_fbdev->shared;
     CoreLayerRegionConfigFlags  fail   = CLRCF_NONE;
     const VideoMode            *mode;

     D_DEBUG_AT( FBDev_Mode, "%s( %dx%d, %s )\n", __FUNCTION__,
                 config->source.w, config->source.h, dfb_pixelformat_name(config->format) );

     mode = dfb_fbdev_find_mode( config->source.w, config->source.h );

     if (!mode || dfb_fbdev_test_mode( mode, config ))
          fail |= CLRCF_WIDTH | CLRCF_HEIGHT | CLRCF_FORMAT | CLRCF_BUFFERMODE;

     if (config->options)
          fail |= CLRCF_OPTIONS;

     if ((config->source.x && !shared->fix.xpanstep) ||
         (config->source.y && !shared->fix.ypanstep && !shared->fix.ywrapstep))
          fail |= CLRCF_SOURCE;

     if (failed)
          *failed = fail;

     if (fail)
          return DFB_UNSUPPORTED;

     return DFB_OK;
}

static DFBResult
primaryAddRegion( CoreLayer             *layer,
                  void                  *driver_data,
                  void                  *layer_data,
                  void                  *region_data,
                  CoreLayerRegionConfig *config )
{
     return DFB_OK;
}

static DFBResult
primarySetRegion( CoreLayer                  *layer,
                  void                       *driver_data,
                  void                       *layer_data,
                  void                       *region_data,
                  CoreLayerRegionConfig      *config,
                  CoreLayerRegionConfigFlags  updated,
                  CoreSurface                *surface,
                  CorePalette                *palette,
                  CoreSurfaceBufferLock      *lock )
{
     DFBResult    ret;
     FBDevShared *shared = dfb_fbdev->shared;

     if (updated & CLRCF_SOURCE) {
          if (config->source.w == shared->current_var.xres && config->source.h == shared->current_var.yres) {
               ret = dfb_fbdev_pan( config->source.x, lock->offset / lock->pitch + config->source.y, true );
               if (ret)
                    return ret;
          }
          else {
               const VideoMode *mode;

               D_INFO( "FBDev/Mode: Setting %dx%d %s\n", config->source.w, config->source.h,
                       dfb_pixelformat_name( surface->config.format ) );

               mode = dfb_fbdev_find_mode( config->source.w, config->source.h );
               if (!mode)
                    return DFB_UNSUPPORTED;

               ret = dfb_fbdev_set_mode( mode, surface, config->source.x,
                                         lock->offset / lock->pitch + config->source.y );
               if (ret)
                    return ret;
          }
     }

     if ((updated & CLRCF_PALETTE) && palette)
          dfb_fbdev_set_palette( palette );

     /* remember configuration */
     shared->config = *config;

     return DFB_OK;
}

static DFBResult
primaryRemoveRegion( CoreLayer             *layer,
                     void                  *driver_data,
                     void                  *layer_data,
                     void                  *region_data )
{
     return DFB_OK;
}

static DFBResult
primaryFlipRegion( CoreLayer             *layer,
                   void                  *driver_data,
                   void                  *layer_data,
                   void                  *region_data,
                   CoreSurface           *surface,
                   DFBSurfaceFlipFlags    flags,
                   CoreSurfaceBufferLock *lock )
{
     DFBResult ret;
     CoreLayerRegionConfig *config = &dfb_fbdev->shared->config;

     if (((flags & DSFLIP_WAITFORSYNC) == DSFLIP_WAITFORSYNC) &&
         !dfb_config->pollvsync_after)
          dfb_screen_wait_vsync( dfb_screens_at(DSCID_PRIMARY) );

     ret = dfb_fbdev_pan( config->source.x,
                          lock->offset / lock->pitch + config->source.y,
                          (flags & DSFLIP_WAITFORSYNC) == DSFLIP_ONSYNC );
     if (ret)
          return ret;

     if ((flags & DSFLIP_WAIT) &&
         (dfb_config->pollvsync_after || !(flags & DSFLIP_ONSYNC)))
          dfb_screen_wait_vsync( dfb_screens_at(DSCID_PRIMARY) );

     dfb_surface_flip( surface, false );

     return DFB_OK;
}

/** fbdev internal **/

static void
dfb_fbdev_var_to_mode( const struct fb_var_screeninfo *var,
                       VideoMode                      *mode )
{
     mode->xres          = var->xres;
     mode->yres          = var->yres;
     mode->bpp           = var->bits_per_pixel;
     mode->hsync_len     = var->hsync_len;
     mode->vsync_len     = var->vsync_len;
     mode->left_margin   = var->left_margin;
     mode->right_margin  = var->right_margin;
     mode->upper_margin  = var->upper_margin;
     mode->lower_margin  = var->lower_margin;
     mode->pixclock      = var->pixclock;
     mode->hsync_high    = (var->sync & FB_SYNC_HOR_HIGH_ACT) ? 1 : 0;
     mode->vsync_high    = (var->sync & FB_SYNC_VERT_HIGH_ACT) ? 1 : 0;
     mode->csync_high    = (var->sync & FB_SYNC_COMP_HIGH_ACT) ? 1 : 0;
     mode->sync_on_green = (var->sync & FB_SYNC_ON_GREEN) ? 1 : 0;
     mode->external_sync = (var->sync & FB_SYNC_EXT) ? 1 : 0;
     mode->broadcast     = (var->sync & FB_SYNC_BROADCAST) ? 1 : 0;
     mode->laced         = (var->vmode & FB_VMODE_INTERLACED) ? 1 : 0;
     mode->doubled       = (var->vmode & FB_VMODE_DOUBLE) ? 1 : 0;
}

#if 0
static int dfb_fbdev_compatible_format( struct fb_var_screeninfo *var,
                                        int al, int rl, int gl, int bl,
                                        int ao, int ro, int go, int bo )
{
     int ah, rh, gh, bh;
     int vah, vrh, vgh, vbh;

     ah = al + ao - 1;
     rh = rl + ro - 1;
     gh = gl + go - 1;
     bh = bl + bo - 1;

     vah = var->transp.length + var->transp.offset - 1;
     vrh = var->red.length + var->red.offset - 1;
     vgh = var->green.length + var->green.offset - 1;
     vbh = var->blue.length + var->blue.offset - 1;

     if ((!al || (ah == vah && al >= (int)var->transp.length)) &&
         (!rl || (rh == vrh && rl >= (int)var->red.length)) &&
         (!gl || (gh == vgh && gl >= (int)var->green.length)) &&
         (!bl || (bh == vbh && bl >= (int)var->blue.length)))
          return 1;

     return 0;
}

static DFBSurfacePixelFormat dfb_fbdev_get_pixelformat( struct fb_var_screeninfo *var )
{
     switch (var->bits_per_pixel) {

          case 8:
/*
               This check is omitted, since we want to use RGB332 even if the
               hardware uses a palette (in that case we initialize a calculated
               one to have correct colors)

               if (fbdev_compatible_format( var, 0, 3, 3, 2, 0, 5, 2, 0 ))*/

               return DSPF_RGB332;

          case 15:
               if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 10, 5, 0 ))
                    return DSPF_RGB555;

               if(dfb_fbdev_compatible_format( var, 1, 5, 5, 5, 15, 10, 5, 0 ))
                   return DSPF_ARGB1555;

               if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 0, 5, 10 )){
                    return DSPF_BGR555;
          }

               break;

         case 16:
               if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 10, 5, 0 ))
                    return DSPF_RGB555;

               if(dfb_fbdev_compatible_format( var, 1, 5, 5, 5, 15, 10, 5, 0 ))
                   return DSPF_ARGB1555;

               if (dfb_fbdev_compatible_format( var, 4, 4, 4, 4, 12, 8, 4, 0 ))
                    return DSPF_ARGB4444;

               if (dfb_fbdev_compatible_format( var, 0, 4, 4, 4, 0, 8, 4, 0 ))
                    return DSPF_RGB444;

               if (dfb_fbdev_compatible_format( var, 0, 5, 6, 5, 0, 11, 5, 0 ))
                    return DSPF_RGB16;

               if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 0, 5, 10 )){
			return DSPF_BGR555;
		}

               break;

          case 18:
               if (dfb_fbdev_compatible_format( var, 1, 6, 6, 6, 18, 12, 6, 0 ))
                    return DSPF_ARGB1666;

               if (dfb_fbdev_compatible_format( var, 6, 6, 6, 6, 18, 12, 6, 0 ))
                    return DSPF_ARGB6666;

               if (dfb_fbdev_compatible_format( var, 0, 6, 6, 6, 0, 12, 6, 0 ))
                    return DSPF_RGB18;
               break;

          case 24:
               if (dfb_fbdev_compatible_format( var, 0, 8, 8, 8, 0, 16, 8, 0 ))
                    return DSPF_RGB24;

               if (dfb_fbdev_compatible_format( var, 6, 6, 6, 6, 18, 12, 6, 0 ))
                    return DSPF_ARGB6666;
               break;

          case 32:
               if (dfb_fbdev_compatible_format( var, 0, 8, 8, 8, 0, 16, 8, 0 ))
                    return DSPF_RGB32;

               if (dfb_fbdev_compatible_format( var, 8, 8, 8, 8, 24, 16, 8, 0 ))
                    return DSPF_ARGB;

               break;
     }

     D_ERROR( "DirectFB/FBDev: Unsupported pixelformat: "
               "rgba %d/%d, %d/%d, %d/%d, %d/%d (%dbit)\n",
               var->red.length,    var->red.offset,
               var->green.length,  var->green.offset,
               var->blue.length,   var->blue.offset,
               var->transp.length, var->transp.offset,
               var->bits_per_pixel );

     return DSPF_UNKNOWN;
}
#endif

/*
 * pans display (flips buffer) using fbdev ioctl
 */
static DFBResult
dfb_fbdev_pan( int xoffset, int yoffset, bool onsync )
{
//     DFBResult                 ret;
     int                       result;
     struct fb_var_screeninfo *var;
     FBDevShared              *shared = dfb_fbdev->shared;

     if (!shared->fix.xpanstep && !shared->fix.ypanstep && !shared->fix.ywrapstep)
          return DFB_OK;

     var = &shared->current_var;

     if (var->xres_virtual < xoffset + var->xres) {
          D_ERROR( "DirectFB/FBDev: xres %d, vxres %d, xoffset %d\n",
                    var->xres, var->xres_virtual, xoffset );
          D_BUG( "panning buffer out of range" );
          return DFB_BUG;
     }

     if (var->yres_virtual < yoffset + var->yres) {
          D_ERROR( "DirectFB/FBDev: yres %d, vyres %d, offset %d\n",
                    var->yres, var->yres_virtual, yoffset );
          D_BUG( "panning buffer out of range" );
          return DFB_BUG;
     }

     if (shared->fix.xpanstep)
          var->xoffset = xoffset - (xoffset % shared->fix.xpanstep);
     else
          var->xoffset = 0;

     if (shared->fix.ywrapstep) {
          var->yoffset = yoffset - (yoffset % shared->fix.ywrapstep);
          var->vmode |= FB_VMODE_YWRAP;
     }
     else if (shared->fix.ypanstep) {
          var->yoffset = yoffset - (yoffset % shared->fix.ypanstep);
          var->vmode &= ~FB_VMODE_YWRAP;
     }
     else {
          var->yoffset = 0;
     }

     var->activate = onsync ? FB_ACTIVATE_VBL : FB_ACTIVATE_NOW;

#if 0
     ret = fusion_call_execute( &shared->fbdev_ioctl, FCEF_NONE, FBIOPAN_DISPLAY, var, &result );
     if (ret)
          return DFB_FUSION;

     if (result) {
          errno = result;
#else
     if (ioctl( dfb_fbdev->fd, FBIOPAN_DISPLAY, var ) < 0) {
          result = errno;
#endif
          D_PERROR( "DirectFB/FBDev: Panning display failed (x=%u y=%u ywrap=%d vbl=%d)!\n",
                    var->xoffset, var->yoffset,
                    (var->vmode & FB_VMODE_YWRAP) ? 1 : 0,
                    (var->activate & FB_ACTIVATE_VBL) ? 1 : 0);

          return errno2result(result);
     }

     return DFB_OK;
}

/*
 * blanks display using fbdev ioctl
 */
static DFBResult
dfb_fbdev_blank( int level )
{
     if (ioctl( dfb_fbdev->fd, FBIOBLANK, level ) < 0) {
          D_PERROR( "DirectFB/FBDev: Display blanking failed!\n" );

          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_fbdev_mode_to_var( const VideoMode           *mode,
                       DFBSurfacePixelFormat      pixelformat,
                       unsigned int               vxres,
                       unsigned int               vyres,
                       unsigned int               xoffset,
                       unsigned int               yoffset,
                       DFBDisplayLayerBufferMode  buffermode,
                       struct fb_var_screeninfo  *ret_var )
{
     struct fb_var_screeninfo  var;
     FBDevShared              *shared = dfb_fbdev->shared;

     D_DEBUG_AT( FBDev_Mode, "%s( mode: %p )\n", __FUNCTION__, mode );

     D_ASSERT( mode != NULL );
     D_ASSERT( ret_var != NULL );

     D_DEBUG_AT( FBDev_Mode, "  -> resolution   %dx%d\n", mode->xres, mode->yres );
     D_DEBUG_AT( FBDev_Mode, "  -> virtual      %dx%d\n", vxres, vyres );
     D_DEBUG_AT( FBDev_Mode, "  -> pixelformat  %s\n", dfb_pixelformat_name(pixelformat) );
     D_DEBUG_AT( FBDev_Mode, "  -> buffermode   %s\n",
                 buffermode == DLBM_FRONTONLY  ? "FRONTONLY"  :
                 buffermode == DLBM_BACKVIDEO  ? "BACKVIDEO"  :
                 buffermode == DLBM_BACKSYSTEM ? "BACKSYSTEM" :
                 buffermode == DLBM_TRIPLE     ? "TRIPLE"     : "invalid!" );

     /* Start from current information */
     var              = shared->current_var;
     var.activate     = FB_ACTIVATE_NOW;

     /* Set timings */
     var.pixclock     = mode->pixclock;
     var.left_margin  = mode->left_margin;
     var.right_margin = mode->right_margin;
     var.upper_margin = mode->upper_margin;
     var.lower_margin = mode->lower_margin;
     var.hsync_len    = mode->hsync_len;
     var.vsync_len    = mode->vsync_len;

     /* Set resolution */
     var.xres         = mode->xres;
     var.yres         = mode->yres;
     var.xres_virtual = vxres;
     var.yres_virtual = vyres;

     if (shared->fix.xpanstep)
          var.xoffset = xoffset - (xoffset % shared->fix.xpanstep);
     else
          var.xoffset = 0;

     if (shared->fix.ywrapstep)
          var.yoffset = yoffset - (yoffset % shared->fix.ywrapstep);
     else if (shared->fix.ypanstep)
          var.yoffset = yoffset - (yoffset % shared->fix.ypanstep);
     else
          var.yoffset = 0;

     /* Set buffer mode */
     switch (buffermode) {
          case DLBM_TRIPLE:
               if (shared->fix.ypanstep == 0 && shared->fix.ywrapstep == 0)
                    return DFB_UNSUPPORTED;

               var.yres_virtual *= 3;
               break;

          case DLBM_BACKVIDEO:
               if (shared->fix.ypanstep == 0 && shared->fix.ywrapstep == 0)
                    return DFB_UNSUPPORTED;

               var.yres_virtual *= 2;
               break;

          case DLBM_BACKSYSTEM:
          case DLBM_FRONTONLY:
               break;

          default:
               return DFB_UNSUPPORTED;
     }

     /* Set pixel format */
     var.bits_per_pixel = DFB_BITS_PER_PIXEL(pixelformat);
     var.transp.length  = var.transp.offset = 0;

     switch (pixelformat) {
          case DSPF_ARGB1555:
               var.transp.length = 1;
               var.red.length    = 5;
               var.green.length  = 5;
               var.blue.length   = 5;
               var.transp.offset = 15;
               var.red.offset    = 10;
               var.green.offset  = 5;
               var.blue.offset   = 0;
               break;

          case DSPF_RGB555:
               var.red.length    = 5;
               var.green.length  = 5;
               var.blue.length   = 5;
               var.red.offset    = 10;
               var.green.offset  = 5;
               var.blue.offset   = 0;
               break;

          case DSPF_BGR555:
               var.red.length    = 5;
               var.green.length  = 5;
               var.blue.length   = 5;
               var.red.offset    = 0;
               var.green.offset  = 5;
               var.blue.offset   = 10;
               break;

          case DSPF_ARGB4444:
               var.transp.length = 4;
               var.red.length    = 4;
               var.green.length  = 4;
               var.blue.length   = 4;
               var.transp.offset = 12;
               var.red.offset    = 8;
               var.green.offset  = 4;
               var.blue.offset   = 0;
               break;

         case DSPF_RGB444:
               var.red.length    = 4;
               var.green.length  = 4;
               var.blue.length   = 4;
               var.red.offset    = 8;
               var.green.offset  = 4;
               var.blue.offset   = 0;
               break;

         case DSPF_RGB32:
               var.red.length    = 8;
               var.green.length  = 8;
               var.blue.length   = 8;
               var.red.offset    = 16;
               var.green.offset  = 8;
               var.blue.offset   = 0;
               break;

          case DSPF_RGB16:
               var.red.length    = 5;
               var.green.length  = 6;
               var.blue.length   = 5;
               var.red.offset    = 11;
               var.green.offset  = 5;
               var.blue.offset   = 0;
               break;

          case DSPF_ARGB:
          case DSPF_AiRGB:
               var.transp.length = 8;
               var.red.length    = 8;
               var.green.length  = 8;
               var.blue.length   = 8;
               var.transp.offset = 24;
               var.red.offset    = 16;
               var.green.offset  = 8;
               var.blue.offset   = 0;
               break;

          case DSPF_LUT8:
          case DSPF_RGB24:
          case DSPF_RGB332:
               break;

          case DSPF_ARGB1666:
               var.transp.length = 1;
               var.red.length    = 6;
               var.green.length  = 6;
               var.blue.length   = 6;
               var.transp.offset = 18;
               var.red.offset    = 12;
               var.green.offset  = 6;
               var.blue.offset   = 0;
               break;

          case DSPF_ARGB6666:
               var.transp.length = 6;
               var.red.length    = 6;
               var.green.length  = 6;
               var.blue.length   = 6;
               var.transp.offset = 18;
               var.red.offset    = 12;
               var.green.offset  = 6;
               var.blue.offset   = 0;
               break;

          case DSPF_RGB18:
               var.red.length    = 6;
               var.green.length  = 6;
               var.blue.length   = 6;
               var.red.offset    = 12;
               var.green.offset  = 6;
               var.blue.offset   = 0;
               break;

          default:
               return DFB_UNSUPPORTED;
     }

     /* Set sync options */
     var.sync = 0;
     if (mode->hsync_high)
          var.sync |= FB_SYNC_HOR_HIGH_ACT;
     if (mode->vsync_high)
          var.sync |= FB_SYNC_VERT_HIGH_ACT;
     if (mode->csync_high)
          var.sync |= FB_SYNC_COMP_HIGH_ACT;
     if (mode->sync_on_green)
          var.sync |= FB_SYNC_ON_GREEN;
     if (mode->external_sync)
          var.sync |= FB_SYNC_EXT;
     if (mode->broadcast)
          var.sync |= FB_SYNC_BROADCAST;

     /* Set interlace/linedouble */
     var.vmode = 0;
     if (mode->laced)
          var.vmode |= FB_VMODE_INTERLACED;
     if (mode->doubled)
          var.vmode |= FB_VMODE_DOUBLE;

     *ret_var = var;

     return DFB_OK;
}

DFBResult
dfb_fbdev_test_mode( const VideoMode             *mode,
                     const CoreLayerRegionConfig *config )
{
     DFBResult                  ret;
     struct fb_var_screeninfo   var;
     FBDevShared               *shared = dfb_fbdev->shared;
     const DFBRectangle        *source = &config->source;

     D_DEBUG_AT( FBDev_Mode, "%s( mode: %p, config: %p )\n", __FUNCTION__, mode, config );

     D_ASSERT( mode != NULL );
     D_ASSERT( config != NULL );

     /* Is panning supported? */
     if (source->w != mode->xres && shared->fix.xpanstep == 0)
          return DFB_UNSUPPORTED;
     if (source->h != mode->yres && shared->fix.ypanstep == 0 && shared->fix.ywrapstep == 0)
          return DFB_UNSUPPORTED;

     ret = dfb_fbdev_mode_to_var( mode, config->format, config->width, config->height,
                                  0, 0, config->buffermode, &var );
     if (ret)
          return ret;

     /* Enable test mode */
     var.activate = FB_ACTIVATE_TEST;


     dfb_gfxcard_lock( GDLF_WAIT | GDLF_SYNC | GDLF_RESET | GDLF_INVALIDATE );

     if (FBDEV_IOCTL( FBIOPUT_VSCREENINFO, &var ) < 0) {
          int erno = errno;
          dfb_gfxcard_unlock();
          D_DEBUG_AT( FBDev_Mode, "  => FAILED!\n" );
          return errno2result( erno );
     }

     dfb_gfxcard_unlock();

     D_DEBUG_AT( FBDev_Mode, "  => SUCCESS\n" );

     return DFB_OK;
}

DFBResult
dfb_fbdev_test_mode_simple( const VideoMode *mode )
{
     DFBResult                ret;
     struct fb_var_screeninfo var;

     D_DEBUG_AT( FBDev_Mode, "%s( mode: %p )\n", __FUNCTION__, mode );

     D_ASSERT( mode != NULL );

     ret = dfb_fbdev_mode_to_var( mode, dfb_pixelformat_for_depth(mode->bpp), mode->xres, mode->yres,
                                  0, 0, DLBM_FRONTONLY, &var );
     if (ret)
          return ret;

     /* Enable test mode */
     var.activate = FB_ACTIVATE_TEST;

     if (FBDEV_IOCTL( FBIOPUT_VSCREENINFO, &var ) < 0) {
          D_DEBUG_AT( FBDev_Mode, "  => FAILED!\n" );
          return errno2result( errno );
     }

     D_DEBUG_AT( FBDev_Mode, "  => SUCCESS\n" );

     return DFB_OK;
}

static int num_video_buffers( CoreSurface *surface )
{
      int i;

      for (i = 0; i < surface->num_buffers; i++) {
           if (surface->buffers[i]->policy == CSP_SYSTEMONLY)
                break;
      }

      return i;
}

DFBResult
dfb_fbdev_set_mode( const VideoMode         *mode,
                    CoreSurface             *surface,
                    unsigned int             xoffset,
                    unsigned int             yoffset )
{
     DFBResult                  ret;
     struct fb_var_screeninfo   var;
     FBDevShared               *shared     = dfb_fbdev->shared;
     DFBDisplayLayerBufferMode  buffermode = DLBM_FRONTONLY;
     const CoreSurfaceConfig   *config     = &surface->config ;

     D_DEBUG_AT( FBDev_Mode, "%s( mode: %p, config: %p )\n", __FUNCTION__, mode, config );

     D_ASSERT( mode != NULL );
     D_ASSERT( config != NULL );

     switch (num_video_buffers( surface )) {
     case 3:
          buffermode = DLBM_TRIPLE;
          break;
     case 2:
          buffermode = DLBM_BACKVIDEO;
          break;
     case 1:
          buffermode = DLBM_FRONTONLY;
          break;
     default:
          D_BUG( "dfb_fbdev_set_mode() called with %d video buffers!", num_video_buffers( surface ) );
          return DFB_BUG;
     }

     ret = dfb_fbdev_mode_to_var( mode, config->format, config->size.w, config->size.h,
                                  xoffset, yoffset, buffermode, &var );
     if (ret) {
          D_ERROR( "FBDev/Mode: Failed to switch to %dx%d %s (buffermode %d)\n",
                   config->size.w, config->size.h, dfb_pixelformat_name(config->format), buffermode );
          return ret;
     }


     dfb_gfxcard_lock( GDLF_WAIT | GDLF_SYNC | GDLF_RESET | GDLF_INVALIDATE );

     if (FBDEV_IOCTL( FBIOPUT_VSCREENINFO, &var ) < 0) {
          int erno = errno;

          dfb_gfxcard_unlock();

          D_DEBUG_AT( FBDev_Mode, "  => FAILED!\n" );

          D_ERROR( "FBDev/Mode: Failed to switched to %dx%d (virtual %dx%d) at %d bit (%s)!\n",
                   var.xres, var.yres, var.xres_virtual, var.yres_virtual, var.bits_per_pixel,
                   dfb_pixelformat_name(config->format) );

          return errno2result( erno );
     }

     D_DEBUG_AT( FBDev_Mode, "  => SUCCESS\n" );

     shared->current_var = var;
     dfb_fbdev_var_to_mode( &var, &shared->current_mode );

     /* To get the new pitch */
     FBDEV_IOCTL( FBIOGET_FSCREENINFO, &shared->fix );

     D_INFO( "FBDev/Mode: Switched to %dx%d (virtual %dx%d) at %d bit (%s), pitch %d\n",
             var.xres, var.yres, var.xres_virtual, var.yres_virtual, var.bits_per_pixel,
             dfb_pixelformat_name(config->format), shared->fix.line_length );

     if (config->format == DSPF_RGB332)
          dfb_fbdev_set_rgb332_palette();
     else
          dfb_fbdev_set_gamma_ramp( config->format );

     /* invalidate original pan offset */
     shared->orig_var.xoffset = 0;
     shared->orig_var.yoffset = 0;

     dfb_surfacemanager_adjust_heap_offset( dfb_fbdev->shared->manager,
                                            var.yres_virtual * shared->fix.line_length );

     dfb_gfxcard_after_set_var();

     dfb_gfxcard_unlock();

     return DFB_OK;
}


#if 0
DFBResult
dfb_fbdev_set_mode( CoreSurface           *surface,
                    VideoMode             *mode,
                    CoreLayerRegionConfig *config )
{
     unsigned int              vxres, vyres;
     struct fb_var_screeninfo  var;
     FBDevShared              *shared = dfb_fbdev->shared;
     DFBSurfacePixelFormat     format;

     D_DEBUG("DirectFB/FBDev: dfb_fbdev_set_mode (surface: %p, "
              "mode: %p, buffermode: %d)\n", surface, mode,
              config ? config->buffermode : DLBM_FRONTONLY);

     if (!mode)
          mode = &shared->current_mode;

     var = shared->current_var;

     if (config) {
          DFBRectangle *source = &config->source;

          /* Is panning supported? */
          if (source->w != mode->xres && shared->fix.xpanstep == 0)
               return DFB_UNSUPPORTED;
          if (source->h != mode->yres && shared->fix.ypanstep == 0 && shared->fix.ywrapstep == 0)
               return DFB_UNSUPPORTED;

          vxres = config->width;
          vyres = config->height;

          var.xoffset = source->x;
          var.yoffset = source->y;

          switch (config->buffermode) {
               case DLBM_TRIPLE:
                    if (shared->fix.ypanstep == 0 && shared->fix.ywrapstep == 0)
                         return DFB_UNSUPPORTED;
                    vyres *= 3;
                    break;

               case DLBM_BACKVIDEO:
                    if (shared->fix.ypanstep == 0 && shared->fix.ywrapstep == 0)
                         return DFB_UNSUPPORTED;
                    vyres *= 2;
                    break;

               case DLBM_BACKSYSTEM:
               case DLBM_FRONTONLY:
                    break;

               default:
                    return DFB_UNSUPPORTED;
          }

          var.bits_per_pixel = DFB_BYTES_PER_PIXEL(config->format) * 8;

          var.transp.length = var.transp.offset = 0;

          switch (config->format) {
               case DSPF_ARGB1555:
                    var.transp.length = 1;
                    var.red.length    = 5;
                    var.green.length  = 5;
                    var.blue.length   = 5;
                    var.transp.offset = 15;
                    var.red.offset    = 10;
                    var.green.offset  = 5;
                    var.blue.offset   = 0;
                    break;

               case DSPF_RGB555:
                    var.red.length    = 5;
                    var.green.length  = 5;
                    var.blue.length   = 5;
                    var.red.offset    = 10;
                    var.green.offset  = 5;
                    var.blue.offset   = 0;
                    break;

               case DSPF_BGR555:
                    var.red.length    = 5;
                    var.green.length  = 5;
                    var.blue.length   = 5;
                    var.red.offset    = 0;
                    var.green.offset  = 5;
                    var.blue.offset   = 10;
                    break;

               case DSPF_ARGB4444:
                    var.transp.length = 4;
                    var.red.length    = 4;
                    var.green.length  = 4;
                    var.blue.length   = 4;
                    var.transp.offset = 12;
                    var.red.offset    = 8;
                    var.green.offset  = 4;
                    var.blue.offset   = 0;
                    break;

              case DSPF_RGB444:
                    var.red.length = 4;
                    var.green.length = 4;
                    var.blue.length = 4;
                    var.red.offset = 8;
                    var.green.offset = 4;
                    var.blue.offset =  0;
                    break;

              case DSPF_RGB32:
                   var.red.length    = 8;
                   var.green.length  = 8;
                   var.blue.length   = 8;
                   var.red.offset    = 16;
                   var.green.offset  = 8;
                   var.blue.offset   = 0;
                   break;

               case DSPF_RGB16:
                    var.red.length    = 5;
                    var.green.length  = 6;
                    var.blue.length   = 5;
                    var.red.offset    = 11;
                    var.green.offset  = 5;
                    var.blue.offset   = 0;
                    break;

               case DSPF_ARGB:
               case DSPF_AiRGB:
                    var.transp.length = 8;
                    var.red.length    = 8;
                    var.green.length  = 8;
                    var.blue.length   = 8;
                    var.transp.offset = 24;
                    var.red.offset    = 16;
                    var.green.offset  = 8;
                    var.blue.offset   = 0;
                    break;

               case DSPF_LUT8:
               case DSPF_RGB24:
               case DSPF_RGB332:
                    break;

               case DSPF_ARGB1666:
                    var.transp.length = 1;
                    var.red.length    = 6;
                    var.green.length  = 6;
                    var.blue.length   = 6;
                    var.transp.offset = 18;
                    var.red.offset    = 12;
                    var.green.offset  = 6;
                    var.blue.offset   = 0;
                    break;

               case DSPF_ARGB6666:
                    var.transp.length = 6;
                    var.red.length    = 6;
                    var.green.length  = 6;
                    var.blue.length   = 6;
                    var.transp.offset = 18;
                    var.red.offset    = 12;
                    var.green.offset  = 6;
                    var.blue.offset   = 0;
                    break;

               case DSPF_RGB18:
                    var.red.length    = 6;
                    var.green.length  = 6;
                    var.blue.length   = 6;
                    var.red.offset    = 12;
                    var.green.offset  = 6;
                    var.blue.offset   = 0;
                    break;

               default:
                    return DFB_UNSUPPORTED;
          }
     }
     else {
          vxres = mode->xres;
          vyres = mode->yres;

          var.xoffset = 0;
          var.yoffset = 0;

          var.bits_per_pixel = mode->bpp;
     }

     var.activate = surface ? FB_ACTIVATE_NOW : FB_ACTIVATE_TEST;

     var.xres = mode->xres;
     var.yres = mode->yres;
     var.xres_virtual = vxres;
     var.yres_virtual = vyres;

     var.pixclock = mode->pixclock;
     var.left_margin = mode->left_margin;
     var.right_margin = mode->right_margin;
     var.upper_margin = mode->upper_margin;
     var.lower_margin = mode->lower_margin;
     var.hsync_len = mode->hsync_len;
     var.vsync_len = mode->vsync_len;

     var.sync = 0;
     if (mode->hsync_high)
          var.sync |= FB_SYNC_HOR_HIGH_ACT;
     if (mode->vsync_high)
          var.sync |= FB_SYNC_VERT_HIGH_ACT;
     if (mode->csync_high)
          var.sync |= FB_SYNC_COMP_HIGH_ACT;
     if (mode->sync_on_green)
          var.sync |= FB_SYNC_ON_GREEN;
     if (mode->external_sync)
          var.sync |= FB_SYNC_EXT;
     if (mode->broadcast)
          var.sync |= FB_SYNC_BROADCAST;

     var.vmode = 0;
     if (mode->laced)
          var.vmode |= FB_VMODE_INTERLACED;
     if (mode->doubled)
          var.vmode |= FB_VMODE_DOUBLE;

     dfb_gfxcard_lock( GDLF_WAIT | GDLF_SYNC | GDLF_RESET | GDLF_INVALIDATE );

     if (FBDEV_IOCTL( FBIOPUT_VSCREENINFO, &var ) < 0) {
          int erno = errno;

          if (surface)
               D_PERROR( "DirectFB/FBDev: "
                          "Could not set video mode (FBIOPUT_VSCREENINFO)!\n" );

          dfb_gfxcard_unlock();

          return errno2result( erno );
     }

     /*
      * the video mode was set successfully, check if there is enough
      * video ram (for buggy framebuffer drivers)
      */

     if (shared->fix.smem_len < (var.yres_virtual *
                                 var.xres_virtual *
                                 var.bits_per_pixel >> 3)
         || (var.xres_virtual < vxres)
         || (var.yres_virtual < vyres))
     {
          if (surface) {
               D_PERROR( "DirectFB/FBDev: "
                          "Could not set video mode (not enough video ram)!\n" );

               /* restore mode */
               FBDEV_IOCTL( FBIOPUT_VSCREENINFO, &shared->current_var );
          }

          dfb_gfxcard_unlock();

          return DFB_INVARG;
     }

     /* If surface is NULL the mode was only tested, otherwise apply changes. */
     if (surface) {
          struct fb_fix_screeninfo  fix;

          FBDEV_IOCTL( FBIOGET_VSCREENINFO, &var );

          vxres = var.xres_virtual;
          switch (config->buffermode) {
          case DLBM_TRIPLE:
               vyres = var.yres_virtual / 3;
               break;
          case DLBM_BACKVIDEO:
               vyres = var.yres_virtual / 2;
               break;
          default:
               vyres = var.yres_virtual;
               break;
          }

          format = dfb_fbdev_get_pixelformat( &var );
          if (format == DSPF_UNKNOWN) {
               D_WARN( "unknown format" );

               /* restore mode */
               FBDEV_IOCTL( FBIOPUT_VSCREENINFO, &shared->current_var );

               dfb_gfxcard_unlock();

               return DFB_UNSUPPORTED;
          }

          if (!config) {
               dfb_gfxcard_unlock();

               return DFB_OK;
          }

          if (format != config->format) {
               if (DFB_BYTES_PER_PIXEL(format) == 1                      ||
                  (format == DSPF_RGB32 && config->format == DSPF_ARGB)  ||
                  (format == DSPF_RGB32 && config->format == DSPF_AiRGB) ||
                  (format == DSPF_ARGB  && config->format == DSPF_AiRGB))
                    format = config->format;
          }

          if (config->format == DSPF_RGB332)
               dfb_fbdev_set_rgb332_palette();
          else
               dfb_fbdev_set_gamma_ramp( config->format );

          shared->current_var = var;
          dfb_fbdev_var_to_mode( &var, &shared->current_mode );

          /* invalidate original pan offset */
          shared->orig_var.xoffset = 0;
          shared->orig_var.yoffset = 0;

          surface->config.size.w  = vxres;
          surface->config.size.h = vyres;
          surface->config.format = format;

          /* To get the new pitch */
          FBDEV_IOCTL( FBIOGET_FSCREENINFO, &fix );

          D_INFO( "FBDev/Mode: Switched to %dx%d (%dx%d) at %d bit %s (wanted %s).\n",
                  var.xres, var.yres, var.xres_virtual, var.yres_virtual, var.bits_per_pixel,
                  dfb_pixelformat_name(format), dfb_pixelformat_name(config->format) );

          /* ++Tony: Other information (such as visual formats) will also change */
          shared->fix = fix;

          dfb_surfacemanager_adjust_heap_offset( dfb_fbdev->shared->manager,
                                                 var.yres_virtual * fix.line_length );

          if (shared->fix.xpanstep || shared->fix.ypanstep || shared->fix.ywrapstep)
               dfb_fbdev_pan( var.xoffset, var.yoffset, false );

          dfb_gfxcard_after_set_var();

          dfb_surface_notify( surface,
                              CSNF_SIZEFORMAT | CSNF_FLIP |
                              CSNF_VIDEO      | CSNF_SYSTEM );
     }

     dfb_gfxcard_unlock();

     return DFB_OK;
}
#endif

/*
 * parses video modes in /etc/fb.modes and stores them in dfb_fbdev->shared->modes
 * (to be replaced by DirectFB's own config system
 */
static DFBResult
dfb_fbdev_read_modes( void )
{
     FILE        *fp;
     char         line[80],label[32],value[16];
     int          geometry=0, timings=0;
     int          dummy;
     VideoMode    temp_mode;
     FBDevShared *shared = dfb_fbdev->shared;
     VideoMode   *prev   = shared->modes;

     D_DEBUG_AT( FBDev_Mode, "%s()\n", __FUNCTION__ );

     if (!(fp = fopen("/etc/fb.modes","r")))
          return errno2result( errno );

     while (fgets(line,79,fp)) {
          if (sscanf(line, "mode \"%31[^\"]\"",label) == 1) {
               memset( &temp_mode, 0, sizeof(VideoMode) );

               geometry = 0;
               timings = 0;

               while (fgets(line,79,fp) && !(strstr(line,"endmode"))) {
                    if (5 == sscanf(line," geometry %d %d %d %d %d", &temp_mode.xres, &temp_mode.yres, &dummy, &dummy, &temp_mode.bpp)) {
                         geometry = 1;
                    }
                    else if (7 == sscanf(line," timings %d %d %d %d %d %d %d", &temp_mode.pixclock, &temp_mode.left_margin,  &temp_mode.right_margin,
                                         &temp_mode.upper_margin, &temp_mode.lower_margin, &temp_mode.hsync_len,    &temp_mode.vsync_len)) {
                         timings = 1;
                    }
                    else if (1 == sscanf(line, " hsync %15s",value) && 0 == strcasecmp(value,"high")) {
                         temp_mode.hsync_high = 1;
                    }
                    else if (1 == sscanf(line, " vsync %15s",value) && 0 == strcasecmp(value,"high")) {
                         temp_mode.vsync_high = 1;
                    }
                    else if (1 == sscanf(line, " csync %15s",value) && 0 == strcasecmp(value,"high")) {
                         temp_mode.csync_high = 1;
                    }
                    else if (1 == sscanf(line, " laced %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.laced = 1;
                    }
                    else if (1 == sscanf(line, " double %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.doubled = 1;
                    }
                    else if (1 == sscanf(line, " gsync %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.sync_on_green = 1;
                    }
                    else if (1 == sscanf(line, " extsync %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.external_sync = 1;
                    }
                    else if (1 == sscanf(line, " bcast %15s",value) && 0 == strcasecmp(value,"true")) {
                         temp_mode.broadcast = 1;
                    }
               }

               if (geometry && timings && !dfb_fbdev_test_mode_simple(&temp_mode)) {
                    VideoMode *mode = SHCALLOC( shared->shmpool, 1, sizeof(VideoMode) );
                    if (!mode) {
                         D_OOSHM();
                         continue;
                    }

                    if (!prev)
                         shared->modes = mode;
                    else
                         prev->next = mode;

                    direct_memcpy (mode, &temp_mode, sizeof(VideoMode));

                    prev = mode;

                    D_DEBUG_AT( FBDev_Mode, " +-> %16s %4dx%4d  %s%s\n", label, temp_mode.xres, temp_mode.yres,
                                temp_mode.laced ? "interlaced " : "", temp_mode.doubled ? "doublescan" : "" );
               }
          }
     }

     fclose (fp);

     return DFB_OK;
}

/*
 * some fbdev drivers use the palette as gamma ramp in >8bpp modes, to have
 * correct colors, the gamme ramp has to be initialized.
 */

static u16
dfb_fbdev_calc_gamma(int n, int max)
{
     int ret = 65535 * n / max;
     return CLAMP( ret, 0, 65535 );
}

static DFBResult
dfb_fbdev_set_gamma_ramp( DFBSurfacePixelFormat format )
{
     int i;

     int red_size   = 0;
     int green_size = 0;
     int blue_size  = 0;
     int red_max    = 0;
     int green_max  = 0;
     int blue_max   = 0;

     struct fb_cmap *cmap;

     if (!dfb_fbdev) {
          D_BUG( "dfb_fbdev_set_gamma_ramp() called while dfb_fbdev == NULL!" );

          return DFB_BUG;
     }

     switch (format) {
          case DSPF_ARGB1555:
          case DSPF_RGB555:
	   case DSPF_BGR555:
               red_size   = 32;
               green_size = 32;
               blue_size  = 32;
               break;
          case DSPF_ARGB4444:
          case DSPF_RGB444:
               red_size   = 16;
               green_size = 16;
               blue_size  = 16;
               break;
          case DSPF_RGB16:
               red_size   = 32;
               green_size = 64;
               blue_size  = 32;
               break;
          case DSPF_RGB24:
          case DSPF_RGB32:
          case DSPF_ARGB:
               red_size   = 256;
               green_size = 256;
               blue_size  = 256;
               break;
          default:
               return DFB_OK;
     }

     /*
      * ++Tony: The gamma ramp must be set differently if in DirectColor,
      *         ie, to mimic TrueColor, index == color[index].
      */
     if (dfb_fbdev->shared->fix.visual == FB_VISUAL_DIRECTCOLOR) {
          red_max   = 65536 / (256/red_size);
          green_max = 65536 / (256/green_size);
          blue_max  = 65536 / (256/blue_size);
     }
     else {
          red_max   = red_size;
          green_max = green_size;
          blue_max  = blue_size;
     }

     cmap = &dfb_fbdev->shared->current_cmap;

     /* assume green to have most weight */
     cmap->len = green_size;

     for (i = 0; i < red_size; i++)
          cmap->red[i] = dfb_fbdev_calc_gamma( i, red_max );

     for (i = 0; i < green_size; i++)
          cmap->green[i] = dfb_fbdev_calc_gamma( i, green_max );

     for (i = 0; i < blue_size; i++)
          cmap->blue[i] = dfb_fbdev_calc_gamma( i, blue_max );

     /* ++Tony: Some drivers use the upper byte, some use the lower */
     if (dfb_fbdev->shared->fix.visual == FB_VISUAL_DIRECTCOLOR) {
          for (i = 0; i < red_size; i++)
               cmap->red[i] |= cmap->red[i] << 8;

          for (i = 0; i < green_size; i++)
               cmap->green[i] |= cmap->green[i] << 8;

          for (i = 0; i < blue_size; i++)
               cmap->blue[i] |= cmap->blue[i] << 8;
     }

     if (FBDEV_IOCTL( FBIOPUTCMAP, cmap ) < 0) {
          D_PERROR( "DirectFB/FBDev: "
                     "Could not set gamma ramp" );

          return errno2result(errno);
     }

     return DFB_OK;
}

static DFBResult
dfb_fbdev_set_palette( CorePalette *palette )
{
     int             i;
     struct fb_cmap *cmap = &dfb_fbdev->shared->current_cmap;

     D_ASSERT( palette != NULL );

     cmap->len = palette->num_entries <= 256 ? palette->num_entries : 256;

     for (i = 0; i < (int)cmap->len; i++) {
          cmap->red[i]     = palette->entries[i].r;
          cmap->green[i]   = palette->entries[i].g;
          cmap->blue[i]    = palette->entries[i].b;
          cmap->transp[i]  = 0xff - palette->entries[i].a;

          cmap->red[i]    |= cmap->red[i] << 8;
          cmap->green[i]  |= cmap->green[i] << 8;
          cmap->blue[i]   |= cmap->blue[i] << 8;
          cmap->transp[i] |= cmap->transp[i] << 8;
     }

     if (FBDEV_IOCTL( FBIOPUTCMAP, cmap ) < 0) {
          D_PERROR( "DirectFB/FBDev: Could not set the palette!\n" );

          return errno2result(errno);
     }

     return DFB_OK;
}

static DFBResult
dfb_fbdev_set_rgb332_palette( void )
{
     DFBResult ret = DFB_OK;
     int red_val;
     int green_val;
     int blue_val;
     int i = 0;
     FusionSHMPoolShared *pool = dfb_fbdev->shared->shmpool_data;

     struct fb_cmap cmap;

     if (!dfb_fbdev) {
          D_BUG( "dfb_fbdev_set_rgb332_palette() called while dfb_fbdev == NULL!" );

          return DFB_BUG;
     }

     cmap.start  = 0;
     cmap.len    = 256;
     cmap.red    = (u16*)SHMALLOC( pool, 2 * 256 );
     if (!cmap.red) {
          return D_OOSHM();
     }
     cmap.green  = (u16*)SHMALLOC( pool, 2 * 256 );
     if (!cmap.green) {
          ret = D_OOSHM();
          goto free_red;
     }
     cmap.blue   = (u16*)SHMALLOC( pool, 2 * 256 );
     if (!cmap.blue) {
          ret = D_OOSHM();
          goto free_green;
     }
     cmap.transp = (u16*)SHMALLOC( pool, 2 * 256 );
     if (!cmap.transp) {
          ret = D_OOSHM();
          goto free_blue;
     }

     for (red_val = 0; red_val  < 8 ; red_val++) {
          for (green_val = 0; green_val  < 8 ; green_val++) {
               for (blue_val = 0; blue_val  < 4 ; blue_val++) {
                    cmap.red[i]    = dfb_fbdev_calc_gamma( red_val, 7 );
                    cmap.green[i]  = dfb_fbdev_calc_gamma( green_val, 7 );
                    cmap.blue[i]   = dfb_fbdev_calc_gamma( blue_val, 3 );
                    cmap.transp[i] = (i ? 0x2000 : 0xffff);
                    i++;
               }
          }
     }

     if (FBDEV_IOCTL( FBIOPUTCMAP, &cmap ) < 0) {
          D_PERROR( "DirectFB/FBDev: "
                     "Could not set rgb332 palette" );
          ret = errno2result(errno);
          goto free_transp;
     }

 free_transp:
     SHFREE( pool, cmap.transp );
 free_blue:
     SHFREE( pool, cmap.blue );
 free_green:
     SHFREE( pool, cmap.green );
 free_red:
     SHFREE( pool, cmap.red );

     return ret;
}

static FusionCallHandlerResult
fbdev_ioctl_call_handler( int           caller,
                          int           call_arg,
                          void         *call_ptr,
                          void         *ctx,
                          unsigned int  serial,
                          int          *ret_val )
{
     int        ret;
     const char cursoroff_str[] = "\033[?1;0;0c";
     const char blankoff_str[] = "\033[9;0]";

     if (dfb_config->vt) {
          if (!dfb_config->kd_graphics && call_arg == FBIOPUT_VSCREENINFO)
               ioctl( dfb_fbdev->vt->fd, KDSETMODE, KD_GRAPHICS );
     }

     ret = ioctl( dfb_fbdev->fd, call_arg, call_ptr );
     if (ret)
          ret = errno;

     if (dfb_config->vt) {
          if (call_arg == FBIOPUT_VSCREENINFO) {
               if (!dfb_config->kd_graphics) {
                    ioctl( dfb_fbdev->vt->fd, KDSETMODE, KD_TEXT );
                    write( dfb_fbdev->vt->fd, cursoroff_str, strlen(cursoroff_str) );
                    write( dfb_fbdev->vt->fd, blankoff_str, strlen(blankoff_str) );
               }
          }
     }

     *ret_val = ret;

     return FCHR_RETURN;
}

static int
fbdev_ioctl( int request, void *arg, int arg_size )
{
     int          ret;
     int          erno;
     void        *tmp_shm = NULL;
     FBDevShared *shared;

     D_ASSERT( dfb_fbdev != NULL );

     shared = dfb_fbdev->shared;

     D_ASSERT( shared != NULL );

     if (dfb_core_is_master( dfb_fbdev->core )) {
          fbdev_ioctl_call_handler( 1, request, arg, NULL, 0, &ret );
          return ret;
     }

     if (arg) {
          if (!fusion_is_shared( dfb_core_world(dfb_fbdev->core), arg )) {
               tmp_shm = SHMALLOC( shared->shmpool, arg_size );
               if (!tmp_shm) {
                    errno = ENOMEM;
                    return -1;
               }

               direct_memcpy( tmp_shm, arg, arg_size );
          }
     }

     ret = fusion_call_execute( &shared->fbdev_ioctl, FCEF_NONE,
                                request, tmp_shm ? tmp_shm : arg, &erno );

     if (tmp_shm) {
          direct_memcpy( arg, tmp_shm, arg_size );
          SHFREE( shared->shmpool, tmp_shm );
     }

     errno = erno;

     return errno ? -1 : 0;
}

�����������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/agp.h�����������������������������������������������������������������0000644�0001750�0001750�00000003074�11245562152�013662� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __AGP_H__
#define __AGP_H__

#include <linux/agpgart.h>

typedef struct {
     unsigned int  agp_mem;
     int           agp_key;
     agp_info      info;
} AGPShared;

typedef struct {
     int           fd;
     void         *base;
} AGPDevice;


DFBResult dfb_agp_initialize( void );
DFBResult dfb_agp_shutdown( void );

DFBResult dfb_agp_join( void );
DFBResult dfb_agp_leave( void );

#endif /* __AGP_H__ */

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/vt.h������������������������������������������������������������������0000644�0001750�0001750�00000005002�11245562152�013535� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __VT_H__
#define __VT_H__

#include <signal.h>
#include <linux/vt.h>

#include <directfb.h>

typedef struct {
     int fd0;                      /* file descriptor of /dev/tty0 */
     int fd;                       /* file descriptor of /dev/ttyN
                                      where N is the number of the allocated VT,
                                      may be equal to 'fd0' if VT allocation
                                      is disabled by "--no-vt-switch" */

     int num;                      /* number of vt where DirectFB runs */
     int prev;                     /* number of vt DirectFB was started from */

     int old_fb;                   /* original fb mapped to vt */

     struct sigaction sig_usr1;    /* previous signal handler for USR1 */
     struct sigaction sig_usr2;    /* previous signal handler for USR2 */

     struct vt_mode   vt_mode;     /* previous VT mode */

     DirectThread    *thread;
     pthread_mutex_t  lock;
     pthread_cond_t   wait;

     int              vt_sig;
} VirtualTerminal;

/*
 * allocates and switches to a new virtual terminal
 */
DFBResult dfb_vt_initialize( void );
DFBResult dfb_vt_join( void );

/*
 * deallocates virtual terminal
 */
DFBResult dfb_vt_shutdown( bool emergency );
DFBResult dfb_vt_leave( bool emergency );

DFBResult dfb_vt_detach( bool force );

bool dfb_vt_switch( int num );

#endif
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/agp.c�����������������������������������������������������������������0000644�0001750�0001750�00000030104�11245562152�013647� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <errno.h>

#include <asm/types.h>    /* Needs to be included before dfb_types.h */

#include <directfb.h>

#include <direct/mem.h>
#include <direct/messages.h>
#include <direct/util.h>

#include <fusion/fusion.h>
#include <fusion/shmalloc.h>

#include <core/core.h>
#include <core/coredefs.h>
#include <core/coretypes.h>

#include <misc/conf.h>

#include "fbdev.h"
#include "agp.h"

#define PAGE_SIZE direct_pagesize()

/*****************************************************************************/

extern FBDev *dfb_fbdev;

static AGPDevice *dfb_agp = NULL;

/*****************************************************************************/

static DFBResult
dfb_agp_info( agp_info *info )
{
     D_ASSERT( info != NULL );

     if (ioctl( dfb_agp->fd, AGPIOC_INFO, info )) {
          D_PERROR( "DirectFB/FBDev/agp: Could not get AGP info!\n" );
          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_agp_setup( u32 mode )
{
     agp_setup setup;

     setup.agp_mode = mode;

     if (ioctl( dfb_agp->fd, AGPIOC_SETUP, &setup )) {
          D_PERROR( "DirectFB/FBDev/agp: AGP setup failed!\n" );
          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_agp_acquire( void )
{
     if (ioctl( dfb_agp->fd, AGPIOC_ACQUIRE, 0 )) {
          D_PERROR( "DirectFB/FBDev/agp: Acquire failed!\n" );
          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_agp_release( void )
{
     if (ioctl( dfb_agp->fd, AGPIOC_RELEASE, 0 )) {
          D_PERROR( "DirectFB/FBDev/agp: Release failed!\n" );
          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_agp_allocate( unsigned long size, int *key )
{
     agp_allocate alloc;
     int          pages;

     D_ASSERT( key != NULL );

     pages = size / PAGE_SIZE;
     if (pages % PAGE_SIZE)
          pages++;

     if (pages == 0) {
          D_BUG( "attempted to allocate 0 pages!");
          return DFB_BUG;
     }

     alloc.pg_count = pages;
     alloc.type     = 0;

     if (ioctl( dfb_agp->fd, AGPIOC_ALLOCATE, &alloc )) {
          D_PERROR( "DirectFB/FBDev/agp: "
                    "Could not allocate %d pages!\n", pages );
          return errno2result( errno );
     }

     *key = alloc.key;

     return DFB_OK;
}

static DFBResult
dfb_agp_deallocate( int key )
{
     if (ioctl( dfb_agp->fd, AGPIOC_DEALLOCATE, key )) {
          D_PERROR( "DirectFB/FBDev/agp: "
                    "Deallocate failed (key = %d)!\n", key );
          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_agp_bind( unsigned int offset, int key )
{
     agp_bind bind;

     if (offset % PAGE_SIZE) {
          D_BUG( "offset is not page-aligned!" );
          return DFB_BUG;
     }

     bind.pg_start = offset / PAGE_SIZE;
     bind.key      = key;

     if (ioctl( dfb_agp->fd, AGPIOC_BIND, &bind )) {
          D_PERROR( "DirectFB/FBDev/agp: "
                    "Bind failed (key = %d, offset = 0x%x)!\n",
                    key, offset );
          return errno2result( errno );
     }

     return DFB_OK;
}

static DFBResult
dfb_agp_unbind( int key )
{
     agp_unbind unbind;

     unbind.priority = 0;
     unbind.key      = key;

     if (ioctl( dfb_agp->fd, AGPIOC_UNBIND, &unbind )) {
          D_PERROR( "DirectFB/FBDev/agp: "
                    "Unbind failed (key = %d)!\n",
                    key );
          return errno2result( errno );
     }

     return DFB_OK;
}

/*****************************************************************************/

static inline u16
pci_read_word( int fd, int pos )
{
    u8 b[2];

    if (pread( fd, b, 2, pos ) < 2)
         return 0;

    return b[0] | (b[1] << 8);
}

static inline u8
pci_read_byte( int fd, int pos )
{
     u8 b;

     if (pread( fd, &b, 1, pos ) < 1)
          return 0;

     return b;
}

#define PCI_STATUS            0x06
#define  PCI_STATUS_CAP_LIST  0x10
#define PCI_CAPABILITY_LIST   0x34
#define  PCI_CAP_ID_AGP       0x02

static bool
dfb_agp_capable( int bus, int dev, int func )
{
     bool found = false;
     char path[22];
     int  fd;

     /* XXX: the following detection method requires suid root */

     snprintf( path, sizeof(path),
               "/proc/bus/pci/%02x/%02x.%01x", bus, dev, func );

     fd = open( path, O_RDONLY | O_SYNC );
     if (fd < 0) {
          D_PERROR( "DirectFB/FBDev/agp: "
                    "Couldn't open '%s'!\n", path );
          return false;
     }

     /* stolen from linux/drivers/pci/pci.c */
     if (pci_read_word( fd, PCI_STATUS ) & PCI_STATUS_CAP_LIST) {
          int pos, id;
          int ttl = 48;

          pos = pci_read_byte( fd, PCI_CAPABILITY_LIST );
          while (ttl-- && pos >= 0x40) {
               pos &= ~3;

               id = pci_read_byte( fd, pos );
               if (id == 0xff)
                    break;
               if (id == PCI_CAP_ID_AGP) {
                    found = true;
                    break;
               }

               pos = pci_read_byte( fd, pos+1 );
          }
     }

     close( fd );

     return found;
}

/*****************************************************************************/

DFBResult
dfb_agp_initialize( void )
{
     AGPShared     *shared;
     unsigned int   agp_avail;
     DFBResult      ret = DFB_FAILURE;

     if (dfb_agp) {
          D_BUG( "dfb_agp_initialize() already called!" );
          return DFB_BUG;
     }

     /* Precheck for AGP capable device. */
     if (!dfb_agp_capable( dfb_fbdev->shared->pci.bus,
                           dfb_fbdev->shared->pci.dev,
                           dfb_fbdev->shared->pci.func ))
          return DFB_UNSUPPORTED;

     dfb_agp = D_CALLOC( 1, sizeof(AGPDevice) );
     if (!dfb_agp)
          return D_OOM();

     shared = SHCALLOC( dfb_fbdev->shared->shmpool, 1, sizeof(AGPShared) );
     if (!shared) {
          D_ERROR( "DirectFB/FBDev/agp: Could not allocate shared memory!\n" );
          ret = DFB_NOSHAREDMEMORY;
          goto error0;
     }

     dfb_agp->fd = direct_try_open( "/dev/agpgart",
                                    "/dev/misc/agpgart", O_RDWR, true );
     if (dfb_agp->fd < 0) {
          ret = errno2result( errno );
          D_ERROR( "DirectFB/FBDev/agp: Error opening AGP device!\n" );
          goto error1;
     }

     ret = dfb_agp_acquire();
     if (ret)
          goto error2;

     ret = dfb_agp_info( &shared->info );
     if (ret)
          goto error2;

     D_DEBUG( "DirectFB/FBDev/agp: "
              "Bridge supports: AGP%s%s%s%s%s%s\n",
              shared->info.agp_mode & 0x001 ? " 1X" : "",
              shared->info.agp_mode & 0x002 ? " 2X" : "",
              shared->info.agp_mode & 0x004 ? " 4X" : "",
              shared->info.agp_mode & 0x008 ? " 8X" : "",
              shared->info.agp_mode & 0x200 ? ", SBA" : "",
              shared->info.agp_mode & 0x010 ? ", FW" : "" );

     shared->info.agp_mode &= ~0xf;
     shared->info.agp_mode |= dfb_config->agp;
     shared->info.agp_mode |= dfb_config->agp - 1;

     ret = dfb_agp_setup( shared->info.agp_mode );
     if (ret)
          goto error2;
     dfb_agp_info( &shared->info );

     D_DEBUG( "DirectFB/FBDev/agp: "
              "AGP aperture at 0x%x (%zu MB)\n",
              (unsigned int)shared->info.aper_base, shared->info.aper_size );

     agp_avail = (shared->info.pg_total - shared->info.pg_used) * PAGE_SIZE;
     if (agp_avail == 0) {
          D_ERROR( "DirectFB/FBDev/agp: No AGP memory available!\n" );
          ret = DFB_INIT;
          goto error2;
     }

     shared->agp_mem = shared->info.aper_size << 20;
     if (shared->agp_mem > agp_avail)
          shared->agp_mem = agp_avail;

     ret = dfb_agp_allocate( shared->agp_mem, &shared->agp_key );
     if (ret)
          goto error3;

     ret = dfb_agp_bind( shared->agp_key, 0 );
     if (ret)
          goto error4;

     dfb_agp->base = mmap( NULL, shared->info.aper_size << 20,
                           PROT_READ | PROT_WRITE, MAP_SHARED,
                           dfb_agp->fd, 0 );
     if (dfb_agp->base == MAP_FAILED) {
          D_PERROR( "DirectFB/FBDev/agp: Could not mmap the AGP aperture!\n" );
          ret = DFB_INIT;
          goto error5;
     }

     dfb_agp_release();

     dfb_fbdev->agp = dfb_agp;
     dfb_fbdev->shared->agp = shared;

     return DFB_OK;

error5:
     dfb_agp_unbind( shared->agp_key );
error4:
     dfb_agp_deallocate( shared->agp_key );
error3:
     dfb_agp_release();
error2:
     close( dfb_agp->fd );
error1:
     SHFREE( dfb_fbdev->shared->shmpool, shared );
error0:
     D_FREE( dfb_agp );
     dfb_agp = NULL;

     return ret;
}

DFBResult
dfb_agp_join( void )
{
     AGPShared *shared;
     DFBResult  ret    = DFB_FAILURE;

     if (dfb_agp) {
          D_BUG( "dfb_agp_join() already called!" );
          return DFB_BUG;
     }

     shared = dfb_fbdev->shared->agp;
     if (!shared)
          return DFB_OK;

     dfb_agp = D_CALLOC( 1, sizeof(AGPDevice) );
     if (!dfb_agp)
          return D_OOM();

     dfb_agp->fd = direct_try_open( "/dev/agpgart",
                                    "/dev/misc/agpgart", O_RDWR, true );
     if (dfb_agp->fd < 0) {
          ret = errno2result( errno );
          D_ERROR( "DirectFB/FBDev/agp: Error opening AGP device!\n" );
          goto error0;
     }

     ret = dfb_agp_acquire();
     if (ret)
          goto error1;

     dfb_agp->base = mmap( NULL, shared->info.aper_size << 20,
                           PROT_READ | PROT_WRITE, MAP_SHARED,
                           dfb_agp->fd, 0 );
     if (dfb_agp->base == MAP_FAILED) {
          D_PERROR( "DirectFB/FBDev/agp: Could not mmap the AGP aperture!\n" );
          ret = DFB_INIT;
          goto error2;
     }

     D_DEBUG( "DirectFB/FBDev/agp: AGP aperture mapped at %p\n", dfb_agp->base );

     dfb_agp_release();

     dfb_fbdev->agp = dfb_agp;

     return DFB_OK;

error2:
     dfb_agp_release();
error1:
     close( dfb_agp->fd );
error0:
     D_FREE( dfb_agp );
     dfb_agp = NULL;

     return ret;
}

DFBResult
dfb_agp_shutdown( void )
{
     AGPShared *shared;

     if (!dfb_agp)
          return DFB_INVARG;

     shared = dfb_fbdev->shared->agp;

     dfb_agp_acquire();

     munmap( dfb_agp->base, shared->info.aper_size << 20 );

     dfb_agp_unbind( shared->agp_key );
     dfb_agp_deallocate( shared->agp_key );

     dfb_agp_release();
     close( dfb_agp->fd );

     SHFREE( dfb_fbdev->shared->shmpool, shared );
     D_FREE( dfb_agp );

     dfb_fbdev->shared->agp = NULL;
     dfb_fbdev->agp = dfb_agp = NULL;

     return DFB_OK;
}

DFBResult
dfb_agp_leave( void )
{
     AGPShared *shared;

     if (!dfb_agp)
          return DFB_INVARG;

     shared = dfb_fbdev->shared->agp;

     dfb_agp_acquire();

     munmap( dfb_agp->base, shared->info.aper_size << 20 );

     dfb_agp_release();

     close( dfb_agp->fd );
     D_FREE( dfb_agp );

     dfb_fbdev->agp = dfb_agp = NULL;

     return DFB_OK;
}

������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/surfacemanager.c������������������������������������������������������0000644�0001750�0001750�00000046265�11245562152�016102� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <config.h>

#include <fusion/shmalloc.h>

#include <directfb.h>
#include <directfb_util.h>

#include <core/core.h>

#include <core/gfxcard.h>
#include <core/surface.h>
#include <core/surface_buffer.h>

#include <direct/debug.h>
#include <direct/messages.h>
#include <direct/util.h>

#include <gfx/convert.h>

#include "surfacemanager.h"

D_DEBUG_DOMAIN( SurfMan, "SurfaceManager", "DirectFB Surface Manager" );


static Chunk *split_chunk ( SurfaceManager *manager,
                            Chunk          *chunk,
                            int             length );

static Chunk *free_chunk  ( SurfaceManager *manager,
                            Chunk          *chunk );

static Chunk *occupy_chunk( SurfaceManager        *manager,
                            Chunk                 *chunk,
                            CoreSurfaceAllocation *allocation,
                            int                    length,
                            int                    pitch );


DFBResult
dfb_surfacemanager_create( CoreDFB         *core,
                           unsigned int     length,
                           SurfaceManager **ret_manager )
{
     FusionSHMPoolShared *pool;
     SurfaceManager      *manager;
     Chunk               *chunk;

     D_DEBUG_AT( SurfMan, "%s( %p, %d )\n", __FUNCTION__, core, length );

     D_ASSERT( core != NULL );
     D_ASSERT( ret_manager != NULL );

     pool = dfb_core_shmpool( core );

     manager = SHCALLOC( pool, 1, sizeof(SurfaceManager) );
     if (!manager)
          return D_OOSHM();

     chunk = SHCALLOC( pool, 1, sizeof(Chunk) );
     if (!chunk) {
          D_OOSHM();
          SHFREE( pool, manager );
          return DFB_NOSHAREDMEMORY;
     }

     manager->shmpool = pool;
     manager->chunks  = chunk;
     manager->offset  = 0;
     manager->length  = length;
     manager->avail   = manager->length - manager->offset;

     D_MAGIC_SET( manager, SurfaceManager );

     chunk->offset    = manager->offset;
     chunk->length    = manager->avail;

     D_MAGIC_SET( chunk, Chunk );

     D_DEBUG_AT( SurfMan, "  -> %p\n", manager );

     *ret_manager = manager;

     return DFB_OK;
}

void
dfb_surfacemanager_destroy( SurfaceManager *manager )
{
     Chunk *chunk;
     void  *next;

     D_DEBUG_AT( SurfMan, "%s( %p )\n", __FUNCTION__, manager );

     D_MAGIC_ASSERT( manager, SurfaceManager );

     /* Deallocate all video chunks. */
     chunk = manager->chunks;
     while (chunk) {
          next = chunk->next;

          D_MAGIC_CLEAR( chunk );

          SHFREE( manager->shmpool, chunk );

          chunk = next;
     }

     D_MAGIC_CLEAR( manager );

     /* Deallocate manager struct. */
     SHFREE( manager->shmpool, manager );
}

DFBResult dfb_surfacemanager_adjust_heap_offset( SurfaceManager *manager,
                                                 int             offset )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_ASSERT( offset >= 0 );

     D_DEBUG_AT( SurfMan, "%s( %p, %d )\n", __FUNCTION__, manager, offset );

/*FIXME_SC_2     if (manager->limits.surface_byteoffset_alignment > 1) {
          offset += manager->limits.surface_byteoffset_alignment - 1;
          offset -= offset % manager->limits.surface_byteoffset_alignment;
     }
*/
     /*
      * Adjust the offset of the heap.
      */
     if (manager->chunks->buffer == NULL) {
          /* first chunk is free */
          if (offset <= manager->chunks->offset + manager->chunks->length) {
               /* ok, just recalculate offset and length */
               manager->chunks->length = manager->chunks->offset +
                                         manager->chunks->length - offset;
               manager->chunks->offset = offset;
          }
          else {
               D_WARN("unable to adjust heap offset");
               /* more space needed than free at the beginning */
               /* TODO: move/destroy instances */
          }
     }
     else {
          D_WARN("unable to adjust heap offset");
          /* very rare case that the first chunk is occupied */
          /* TODO: move/destroy instances */
     }

     manager->avail -= offset - manager->offset;
     manager->offset = offset;

     return DFB_OK;
}

/** public functions NOT locking the surfacemanger theirself,
    to be called between lock/unlock of surfacemanager **/

DFBResult dfb_surfacemanager_allocate( CoreDFB                *core,
                                       SurfaceManager         *manager,
                                       CoreSurfaceBuffer      *buffer,
                                       CoreSurfaceAllocation  *allocation,
                                       Chunk                 **ret_chunk )
{
     int pitch;
     int length;
     Chunk *c;
     CoreGraphicsDevice *device;

     Chunk *best_free = NULL;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     if (ret_chunk)
          D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     else
          D_ASSUME( allocation == NULL );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     if (manager->suspended)
          return DFB_SUSPENDED;

     /* FIXME: Only one global device at the moment. */
     device = dfb_core_get_part( core, DFCP_GRAPHICS );
     D_ASSERT( device != NULL );

     dfb_gfxcard_calc_buffer_size( device, buffer, &pitch, &length );

     D_DEBUG_AT( SurfMan, "  -> pitch %d, length %d\n", pitch, length );

     if (manager->avail < length)
          return DFB_TEMPUNAVAIL;

     /* examine chunks */
     c = manager->chunks;
     D_MAGIC_ASSERT( c, Chunk );

     /* FIXME_SC_2  Workaround creation happening before graphics driver initialization. */
     if (!c->next) {
          int length = dfb_gfxcard_memory_length();

          if (c->length != length - manager->offset) {
               D_WARN( "workaround" );

               manager->length = length;
               manager->avail  = length - manager->offset;

               c->length = length - manager->offset;
          }
     }

     while (c) {
          D_MAGIC_ASSERT( c, Chunk );

          if (!c->buffer && c->length >= length) {
               /* NULL means check only. */
               if (!ret_chunk)
                    return DFB_OK;

               /* found a nice place to chill */
               if (!best_free  ||  best_free->length > c->length)
                    /* first found or better one? */
                    best_free = c;

               if (c->length == length)
                    break;
          }

          c = c->next;
     }

     /* if we found a place */
     if (best_free) {
          D_DEBUG_AT( SurfMan, "  -> found free (%d)\n", best_free->length );

          /* NULL means check only. */
          if (ret_chunk)
               *ret_chunk = occupy_chunk( manager, best_free, allocation, length, pitch );

          return DFB_OK;
     }

     D_DEBUG_AT( SurfMan, "  -> failed (%d/%d avail)\n", manager->avail, manager->length );

     /* no luck */
     return DFB_NOVIDEOMEMORY;
}

DFBResult dfb_surfacemanager_displace( CoreDFB           *core,
                                       SurfaceManager    *manager,
                                       CoreSurfaceBuffer *buffer )
{
     int                    length;
     Chunk                 *multi_start = NULL;
     int                    multi_size  = 0;
     int                    multi_tsize = 0;
     int                    multi_count = 0;
     Chunk                 *bestm_start = NULL;
     int                    bestm_count = 0;
     int                    bestm_size  = 0;
     int                    min_toleration;
     Chunk                 *chunk;
     CoreGraphicsDevice    *device;
     CoreSurfaceAllocation *smallest = NULL;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     /* FIXME: Only one global device at the moment. */
     device = dfb_core_get_part( core, DFCP_GRAPHICS );
     D_ASSERT( device != NULL );

     dfb_gfxcard_calc_buffer_size( dfb_core_get_part( core, DFCP_GRAPHICS ), buffer, NULL, &length );

     min_toleration = manager->min_toleration/8 + 2;

     D_DEBUG_AT( SurfMan, "  -> %7d required, min toleration %d\n", length, min_toleration );

     chunk = manager->chunks;
     while (chunk) {
          CoreSurfaceAllocation *allocation;

          D_MAGIC_ASSERT( chunk, Chunk );

          allocation = chunk->allocation;
          if (allocation) {
               CoreSurfaceBuffer *other;
               int                size;

               D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
               D_ASSERT( chunk->buffer == allocation->buffer );
               D_ASSERT( chunk->length >= allocation->size );

               other = allocation->buffer;
               D_MAGIC_ASSERT( other, CoreSurfaceBuffer );

               if (other->locked) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d locked %dx\n", allocation->size, other->locked );
                    goto next_reset;
               }

               if (other->policy > buffer->policy) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d policy %d > %d\n", allocation->size, other->policy, buffer->policy );
                    goto next_reset;
               }

               if (other->policy == CSP_VIDEOONLY) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d policy videoonly\n", allocation->size );
                    goto next_reset;
               }

               chunk->tolerations++;
               if (chunk->tolerations > 0xff)
                    chunk->tolerations = 0xff;

               if (other->policy == buffer->policy && chunk->tolerations < min_toleration) {
                    D_DEBUG_AT( SurfMan, "  ++ %7d tolerations %d/%d\n",
                                allocation->size, chunk->tolerations, min_toleration );
                    goto next_reset;
               }

               size = allocation->size;

               if (chunk->prev && !chunk->prev->allocation)
                    size += chunk->prev->length;

               if (chunk->next && !chunk->next->allocation)
                    size += chunk->next->length;

               if (size >= length) {
                    if (!smallest || smallest->size > allocation->size) {
                         D_DEBUG_AT( SurfMan, "  => %7d [%d] < %d, tolerations %d\n",
                                     allocation->size, size, smallest ? smallest->size : 0, chunk->tolerations );

                         smallest = allocation;
                    }
                    else
                         D_DEBUG_AT( SurfMan, "  -> %7d [%d] > %d\n", allocation->size, size, smallest->size );
               }
               else
                    D_DEBUG_AT( SurfMan, "  -> %7d [%d]\n", allocation->size, size );
          }
          else
               D_DEBUG_AT( SurfMan, "  -  %7d free\n", chunk->length );


          if (!smallest) {
               if (!multi_start) {
                    multi_start = chunk;
                    multi_tsize = chunk->length;
                    multi_size  = chunk->allocation ? chunk->length : 0;
                    multi_count = chunk->allocation ? 1 : 0;
               }
               else {
                    multi_tsize += chunk->length;
                    multi_size  += chunk->allocation ? chunk->length : 0;
                    multi_count += chunk->allocation ? 1 : 0;

                    while (multi_tsize >= length && multi_count > 1) {
                         if (!bestm_start || bestm_size > multi_size * multi_count / bestm_count) {
                              D_DEBUG_AT( SurfMan, "                =====> %7d, %7d %2d used [%7d %2d]\n",
                                          multi_tsize, multi_size, multi_count, bestm_size, bestm_count );

                              bestm_size  = multi_size;
                              bestm_start = multi_start;
                              bestm_count = multi_count;
                         }
                         else
                              D_DEBUG_AT( SurfMan, "                -----> %7d, %7d %2d used\n",
                                          multi_tsize, multi_size, multi_count );

                         if (multi_count <= 2)
                              break;

                         if (!multi_start->allocation) {
                              multi_tsize -= multi_start->length;
                              multi_start  = multi_start->next;
                         }

                         D_ASSUME( multi_start->allocation != NULL );

                         multi_tsize -= multi_start->length;
                         multi_size  -= multi_start->allocation ? multi_start->length : 0;
                         multi_count -= multi_start->allocation ? 1 : 0;
                         multi_start  = multi_start->next;
                    }
               }
          }

          chunk = chunk->next;

          continue;


next_reset:
          multi_start = NULL;

          chunk = chunk->next;
     }

     if (smallest) {
          D_MAGIC_ASSERT( smallest, CoreSurfaceAllocation );
          D_MAGIC_ASSERT( smallest->buffer, CoreSurfaceBuffer );

          smallest->flags |= CSALF_MUCKOUT;

          D_DEBUG_AT( SurfMan, "  -> offset %lu, size %d\n", smallest->offset, smallest->size );

          return DFB_OK;
     }

     if (bestm_start) {
          chunk = bestm_start;

          while (bestm_count) {
               CoreSurfaceAllocation *allocation = chunk->allocation;

               if (allocation) {
                    D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
                    D_MAGIC_ASSERT( allocation->buffer, CoreSurfaceBuffer );

                    allocation->flags |= CSALF_MUCKOUT;

                    bestm_count--;
               }

               D_DEBUG_AT( SurfMan, "  ---> offset %d, length %d\n", chunk->offset, chunk->length );

               chunk = chunk->next;
          }

          return DFB_OK;
     }

     return DFB_NOVIDEOMEMORY;
}

DFBResult dfb_surfacemanager_deallocate( SurfaceManager *manager,
                                         Chunk          *chunk )
{
     CoreSurfaceBuffer *buffer;

     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );

     buffer = chunk->buffer;
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( buffer->surface, CoreSurface );

     D_DEBUG_AT( SurfMan, "%s( %p ) <- %dx%d %s\n", __FUNCTION__, buffer,
                 buffer->surface->config.size.w, buffer->surface->config.size.h,
                 dfb_pixelformat_name( buffer->surface->config.format ) );

     free_chunk( manager, chunk );

     return DFB_OK;
}

/** internal functions NOT locking the surfacemanager **/

static Chunk *
split_chunk( SurfaceManager *manager, Chunk *c, int length )
{
     Chunk *newchunk;

     D_MAGIC_ASSERT( c, Chunk );

     if (c->length == length)          /* does not need be splitted */
          return c;

     newchunk = (Chunk*) SHCALLOC( manager->shmpool, 1, sizeof(Chunk) );
     if (!newchunk) {
          D_OOSHM();
          return NULL;
     }

     /* calculate offsets and lengths of resulting chunks */
     newchunk->offset = c->offset + c->length - length;
     newchunk->length = length;
     c->length -= newchunk->length;

     /* insert newchunk after chunk c */
     newchunk->prev = c;
     newchunk->next = c->next;
     if (c->next)
          c->next->prev = newchunk;
     c->next = newchunk;

     D_MAGIC_SET( newchunk, Chunk );

     return newchunk;
}

static Chunk *
free_chunk( SurfaceManager *manager, Chunk *chunk )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );

     if (!chunk->buffer) {
          D_BUG( "freeing free chunk" );
          return chunk;
     }
     else {
          D_DEBUG_AT( SurfMan, "Deallocating %d bytes at offset %d.\n", chunk->length, chunk->offset );
     }

     if (chunk->buffer->policy == CSP_VIDEOONLY)
          manager->avail += chunk->length;

     chunk->allocation = NULL;
     chunk->buffer     = NULL;

     manager->min_toleration--;

     if (chunk->prev  &&  !chunk->prev->buffer) {
          Chunk *prev = chunk->prev;

          //D_DEBUG_AT( SurfMan, "  -> merging with previous chunk at %d\n", prev->offset );

          prev->length += chunk->length;

          prev->next = chunk->next;
          if (prev->next)
               prev->next->prev = prev;

          //D_DEBUG_AT( SurfMan, "  -> freeing %p (prev %p, next %p)\n", chunk, chunk->prev, chunk->next);

          D_MAGIC_CLEAR( chunk );

          SHFREE( manager->shmpool, chunk );
          chunk = prev;
     }

     if (chunk->next  &&  !chunk->next->buffer) {
          Chunk *next = chunk->next;

          //D_DEBUG_AT( SurfMan, "  -> merging with next chunk at %d\n", next->offset );

          chunk->length += next->length;

          chunk->next = next->next;
          if (chunk->next)
               chunk->next->prev = chunk;

          D_MAGIC_CLEAR( next );

          SHFREE( manager->shmpool, next );
     }

     return chunk;
}

static Chunk *
occupy_chunk( SurfaceManager *manager, Chunk *chunk, CoreSurfaceAllocation *allocation, int length, int pitch )
{
     D_MAGIC_ASSERT( manager, SurfaceManager );
     D_MAGIC_ASSERT( chunk, Chunk );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( allocation->buffer, CoreSurfaceBuffer );

     if (allocation->buffer->policy == CSP_VIDEOONLY)
          manager->avail -= length;

     chunk = split_chunk( manager, chunk, length );
     if (!chunk)
          return NULL;

     D_DEBUG_AT( SurfMan, "Allocating %d bytes at offset %d.\n", chunk->length, chunk->offset );

     chunk->allocation = allocation;
     chunk->buffer     = allocation->buffer;
     chunk->pitch      = pitch;

     manager->min_toleration++;

     return chunk;
}

�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/fbdev_surface_pool.c��������������������������������������������������0000644�0001750�0001750�00000031241�11245562152�016732� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#include <asm/types.h>

#include <config.h>

#include <direct/debug.h>
#include <direct/mem.h>

#include <core/surface_pool.h>

#include <gfx/convert.h>

#include "fbdev.h"
#include "surfacemanager.h"

extern FBDev *dfb_fbdev;

D_DEBUG_DOMAIN( FBDev_Surfaces, "FBDev/Surfaces", "FBDev Framebuffer Surface Pool" );
D_DEBUG_DOMAIN( FBDev_SurfLock, "FBDev/SurfLock", "FBDev Framebuffer Surface Pool Locks" );

/**********************************************************************************************************************/

typedef struct {
     int             magic;

     SurfaceManager *manager;
} FBDevPoolData;

typedef struct {
     int             magic;

     CoreDFB        *core;
} FBDevPoolLocalData;

typedef struct {
     int   magic;

     int   offset;
     int   pitch;
     int   size;

     Chunk *chunk;
} FBDevAllocationData;

/**********************************************************************************************************************/

static int
fbdevPoolDataSize( void )
{
     return sizeof(FBDevPoolData);
}

static int
fbdevPoolLocalDataSize( void )
{
     return sizeof(FBDevPoolLocalData);
}

static int
fbdevAllocationDataSize( void )
{
     return sizeof(FBDevAllocationData);
}

static DFBResult
fbdevInitPool( CoreDFB                    *core,
               CoreSurfacePool            *pool,
               void                       *pool_data,
               void                       *pool_local,
               void                       *system_data,
               CoreSurfacePoolDescription *ret_desc )
{
     DFBResult           ret;
     FBDevPoolData      *data  = pool_data;
     FBDevPoolLocalData *local = pool_local;

     D_DEBUG_AT( FBDev_Surfaces, "%s()\n", __FUNCTION__ );

     D_ASSERT( core != NULL );
     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_ASSERT( data != NULL );
     D_ASSERT( local != NULL );
     D_ASSERT( ret_desc != NULL );

     ret = dfb_surfacemanager_create( core, dfb_fbdev->shared->fix.smem_len, &data->manager );
     if (ret)
          return ret;

     ret_desc->caps     = CSPCAPS_NONE;
     ret_desc->access   = CSAF_CPU_READ | CSAF_CPU_WRITE | CSAF_GPU_READ | CSAF_GPU_WRITE | CSAF_SHARED;
     ret_desc->types    = CSTF_LAYER | CSTF_WINDOW | CSTF_CURSOR | CSTF_FONT | CSTF_SHARED | CSTF_EXTERNAL;
     ret_desc->priority = CSPP_DEFAULT;

     snprintf( ret_desc->name, DFB_SURFACE_POOL_DESC_NAME_LENGTH, "Frame Buffer Memory" );

     local->core = core;

     D_MAGIC_SET( data, FBDevPoolData );
     D_MAGIC_SET( local, FBDevPoolLocalData );


     D_ASSERT( dfb_fbdev != NULL );
     D_ASSERT( dfb_fbdev->shared != NULL );

     dfb_fbdev->shared->manager = data->manager;

     return DFB_OK;
}

static DFBResult
fbdevJoinPool( CoreDFB                    *core,
               CoreSurfacePool            *pool,
               void                       *pool_data,
               void                       *pool_local,
               void                       *system_data )
{
     FBDevPoolData      *data  = pool_data;
     FBDevPoolLocalData *local = pool_local;

     D_DEBUG_AT( FBDev_Surfaces, "%s()\n", __FUNCTION__ );

     D_ASSERT( core != NULL );
     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, FBDevPoolData );
     D_ASSERT( local != NULL );

     (void) data;

     local->core = core;

     D_MAGIC_SET( local, FBDevPoolLocalData );

     return DFB_OK;
}

static DFBResult
fbdevDestroyPool( CoreSurfacePool *pool,
                  void            *pool_data,
                  void            *pool_local )
{
     FBDevPoolData      *data  = pool_data;
     FBDevPoolLocalData *local = pool_local;

     D_DEBUG_AT( FBDev_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, FBDevPoolData );
     D_MAGIC_ASSERT( local, FBDevPoolLocalData );

     dfb_surfacemanager_destroy( data->manager );

     D_MAGIC_CLEAR( data );
     D_MAGIC_CLEAR( local );

     return DFB_OK;
}

static DFBResult
fbdevLeavePool( CoreSurfacePool *pool,
                void            *pool_data,
                void            *pool_local )
{
     FBDevPoolData      *data  = pool_data;
     FBDevPoolLocalData *local = pool_local;

     D_DEBUG_AT( FBDev_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, FBDevPoolData );
     D_MAGIC_ASSERT( local, FBDevPoolLocalData );

     (void) data;

     D_MAGIC_CLEAR( local );

     return DFB_OK;
}

static DFBResult
fbdevTestConfig( CoreSurfacePool         *pool,
                 void                    *pool_data,
                 void                    *pool_local,
                 CoreSurfaceBuffer       *buffer,
                 const CoreSurfaceConfig *config )
{
     DFBResult           ret;
     CoreSurface        *surface;
     FBDevPoolData      *data  = pool_data;
     FBDevPoolLocalData *local = pool_local;

     D_DEBUG_AT( FBDev_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, FBDevPoolData );
     D_MAGIC_ASSERT( local, FBDevPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     if (surface->type & CSTF_LAYER)
          return DFB_OK;

     ret = dfb_surfacemanager_allocate( local->core, data->manager, buffer, NULL, NULL );

     D_DEBUG_AT( FBDev_Surfaces, "  -> %s\n", DirectFBErrorString(ret) );

     return ret;
}

static DFBResult
fbdevAllocateBuffer( CoreSurfacePool       *pool,
                     void                  *pool_data,
                     void                  *pool_local,
                     CoreSurfaceBuffer     *buffer,
                     CoreSurfaceAllocation *allocation,
                     void                  *alloc_data )
{
     DFBResult            ret;
     CoreSurface         *surface;
     FBDevPoolData       *data  = pool_data;
     FBDevPoolLocalData  *local = pool_local;
     FBDevAllocationData *alloc = alloc_data;

     D_DEBUG_AT( FBDev_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, FBDevPoolData );
     D_MAGIC_ASSERT( local, FBDevPoolLocalData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );

     surface = buffer->surface;
     D_MAGIC_ASSERT( surface, CoreSurface );

     if ((surface->type & CSTF_LAYER) && surface->resource_id == DLID_PRIMARY) {
          FBDevShared *shared = dfb_fbdev->shared;
          int          index  = dfb_surface_buffer_index( buffer );

          D_DEBUG_AT( FBDev_Surfaces, "  -> primary layer buffer (index %d)\n", index );

          if (( (surface->config.caps & DSCAPS_FLIPPING) && index == 1) ||
              (!(surface->config.caps & DSCAPS_FLIPPING) && index == 0) )
          {
               const VideoMode *highest;
               /* FIXME: this should use source.w/source.h from layer region config! */
               unsigned int     width  = surface->config.size.w;
               unsigned int     height = surface->config.size.h;

               D_INFO( "FBDev/Mode: Setting %dx%d %s\n", width, height, dfb_pixelformat_name(surface->config.format) );

               highest = dfb_fbdev_find_mode( width, height );
               if (!highest)
                    return DFB_UNSUPPORTED;

               ret = dfb_fbdev_set_mode( highest, surface, 0, 0 );
               if (ret)
                    return ret;
          }

          alloc->pitch  = shared->fix.line_length;
          alloc->size   = surface->config.size.h * alloc->pitch;
          alloc->offset = index * alloc->size;

          D_INFO( "FBDev/Surface: Allocated %dx%d %d bit %s buffer (index %d) at offset %d and pitch %d.\n",
                  surface->config.size.w, surface->config.size.h, shared->current_var.bits_per_pixel,
                  dfb_pixelformat_name(buffer->format), index, alloc->offset, alloc->pitch );
     }
     else {
          Chunk *chunk;

          ret = dfb_surfacemanager_allocate( local->core, data->manager, buffer, allocation, &chunk );
          if (ret)
               return ret;

          D_MAGIC_ASSERT( chunk, Chunk );

          alloc->offset = chunk->offset;
          alloc->pitch  = chunk->pitch;
          alloc->size   = chunk->length;

          alloc->chunk  = chunk;
     }

     D_DEBUG_AT( FBDev_Surfaces, "  -> offset %d, pitch %d, size %d\n", alloc->offset, alloc->pitch, alloc->size );

     allocation->size   = alloc->size;
     allocation->offset = alloc->offset;

     D_MAGIC_SET( alloc, FBDevAllocationData );

     return DFB_OK;
}

static DFBResult
fbdevDeallocateBuffer( CoreSurfacePool       *pool,
                       void                  *pool_data,
                       void                  *pool_local,
                       CoreSurfaceBuffer     *buffer,
                       CoreSurfaceAllocation *allocation,
                       void                  *alloc_data )
{
     FBDevPoolData       *data  = pool_data;
     FBDevAllocationData *alloc = alloc_data;

     D_DEBUG_AT( FBDev_Surfaces, "%s( %p )\n", __FUNCTION__, buffer );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( data, FBDevPoolData );
     D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
     D_MAGIC_ASSERT( alloc, FBDevAllocationData );

     if (alloc->chunk)
          dfb_surfacemanager_deallocate( data->manager, alloc->chunk );

     D_MAGIC_CLEAR( alloc );

     return DFB_OK;
}

static DFBResult
fbdevLock( CoreSurfacePool       *pool,
           void                  *pool_data,
           void                  *pool_local,
           CoreSurfaceAllocation *allocation,
           void                  *alloc_data,
           CoreSurfaceBufferLock *lock )
{
     FBDevAllocationData *alloc = alloc_data;

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, FBDevAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     D_DEBUG_AT( FBDev_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer );

     lock->pitch  = alloc->pitch;
     lock->offset = alloc->offset;
     lock->addr   = dfb_fbdev->framebuffer_base + alloc->offset;
     lock->phys   = dfb_fbdev->shared->fix.smem_start + alloc->offset;

     D_DEBUG_AT( FBDev_SurfLock, "  -> offset %lu, pitch %d, addr %p, phys 0x%08lx\n",
                 lock->offset, lock->pitch, lock->addr, lock->phys );

     return DFB_OK;
}

static DFBResult
fbdevUnlock( CoreSurfacePool       *pool,
             void                  *pool_data,
             void                  *pool_local,
             CoreSurfaceAllocation *allocation,
             void                  *alloc_data,
             CoreSurfaceBufferLock *lock )
{
     FBDevAllocationData *alloc = alloc_data;

     D_MAGIC_ASSERT( pool, CoreSurfacePool );
     D_MAGIC_ASSERT( allocation, CoreSurfaceAllocation );
     D_MAGIC_ASSERT( alloc, FBDevAllocationData );
     D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock );

     D_DEBUG_AT( FBDev_SurfLock, "%s( %p )\n", __FUNCTION__, lock->buffer );

     (void) alloc;

     return DFB_OK;
}

const SurfacePoolFuncs fbdevSurfacePoolFuncs = {
     .PoolDataSize       = fbdevPoolDataSize,
     .PoolLocalDataSize  = fbdevPoolLocalDataSize,
     .AllocationDataSize = fbdevAllocationDataSize,

     .InitPool           = fbdevInitPool,
     .JoinPool           = fbdevJoinPool,
     .DestroyPool        = fbdevDestroyPool,
     .LeavePool          = fbdevLeavePool,

     .TestConfig         = fbdevTestConfig,
     .AllocateBuffer     = fbdevAllocateBuffer,
     .DeallocateBuffer   = fbdevDeallocateBuffer,

     .Lock               = fbdevLock,
     .Unlock             = fbdevUnlock,
};

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/fbdev.h���������������������������������������������������������������0000644�0001750�0001750�00000011221�11245562152�014172� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __CORE__FBDEV_H__
#define __CORE__FBDEV_H__

#include <asm/types.h>    /* Needs to be included before dfb_types.h */

#include <core/coretypes.h>

#include <core/layers_internal.h>

#include <core/system.h>

#include <fusion/call.h>
#include <fusion/reactor.h>

#include "agp.h"
#include "fb.h"
#include "surfacemanager.h"
#include "vt.h"

#ifndef FBIO_WAITFORVSYNC
#define FBIO_WAITFORVSYNC	_IOW('F', 0x20, u_int32_t)
#endif


typedef struct {
     /* fbdev fixed screeninfo, contains infos about memory and type of card */
     struct fb_fix_screeninfo fix;

     VideoMode                *modes;        /* linked list of valid
                                                video modes */
     VideoMode                 current_mode; /* current video mode */

     struct fb_var_screeninfo current_var;   /* fbdev variable screeninfo
                                                set by DirectFB */
     struct fb_var_screeninfo orig_var;      /* fbdev variable screeninfo
                                                before DirectFB was started */

     void                    *orig_cmap_memory;
     void                    *temp_cmap_memory;
     void                    *current_cmap_memory;

     struct fb_cmap           orig_cmap;     /* original palette */

     struct fb_cmap           current_cmap;  /* our copy of the cmap */

     struct fb_cmap           temp_cmap;     /* scratch */

     FusionCall               fbdev_ioctl;   /* ioctl rpc */

     unsigned long            page_mask;     /* PAGE_SIZE - 1 */

     CoreSurfacePool          *pool;
     
     struct {
          int                 bus;
          int                 dev;
          int                 func;
     } pci;                                  /* PCI Bus ID of graphics device */
     
     struct {
          unsigned short      vendor;        /* Graphics device vendor id */
          unsigned short      model;         /* Graphics device model id */
     } device;

     AGPShared               *agp;

     FusionSHMPoolShared     *shmpool;
     FusionSHMPoolShared     *shmpool_data;

     CoreLayerRegionConfig    config;

     SurfaceManager          *manager;
} FBDevShared;

typedef struct {
     FBDevShared             *shared;

     CoreDFB                 *core;

     /* virtual framebuffer address */
     void                    *framebuffer_base;

     int                      fd;            /* file descriptor for /dev/fb */

     VirtualTerminal         *vt;

     AGPDevice               *agp;
} FBDev;

/*
 * core init function, opens /dev/fb, get fbdev screeninfo
 * disables font acceleration, reads mode list
 */
DFBResult dfb_fbdev_initialize( void );
DFBResult dfb_fbdev_join( void );

/*
 * deinitializes DirectFB fbdev stuff and restores fbdev settings
 */
DFBResult dfb_fbdev_shutdown( bool emergency );
DFBResult dfb_fbdev_leave   ( bool emergency );

const VideoMode *dfb_fbdev_find_mode( int                          width,
                                      int                          height );
DFBResult dfb_fbdev_test_mode       ( const VideoMode             *mode,
                                      const CoreLayerRegionConfig *config );
DFBResult dfb_fbdev_test_mode_simple( const VideoMode             *mode );

DFBResult dfb_fbdev_set_mode        ( const VideoMode             *mode,
                                      CoreSurface                 *surface,
                                      unsigned int                 xoffset,
                                      unsigned int                 yoffset );

#endif
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/systems/fbdev/fb.h������������������������������������������������������������������0000644�0001750�0001750�00000034154�11164361026�013502� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef _LINUX_FB_H
#define _LINUX_FB_H

#include <dfb_types.h>

/* Definitions of frame buffers						*/

#define FB_MAJOR		29
#define FB_MAX			32	/* sufficient for now */

/* ioctls
   0x46 is 'F'								*/
#define FBIOGET_VSCREENINFO	0x4600
#define FBIOPUT_VSCREENINFO	0x4601
#define FBIOGET_FSCREENINFO	0x4602
#define FBIOGETCMAP		0x4604
#define FBIOPUTCMAP		0x4605
#define FBIOPAN_DISPLAY		0x4606
#define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor)
/* 0x4607-0x460B are defined below */
/* #define FBIOGET_MONITORSPEC	0x460C */
/* #define FBIOPUT_MONITORSPEC	0x460D */
/* #define FBIOSWITCH_MONIBIT	0x460E */
#define FBIOGET_CON2FBMAP	0x460F
#define FBIOPUT_CON2FBMAP	0x4610
#define FBIOBLANK		0x4611		/* arg: 0 or vesa level + 1 */
#define FBIOGET_VBLANK		_IOR('F', 0x12, struct fb_vblank)
#define FBIO_ALLOC              0x4613
#define FBIO_FREE               0x4614
#define FBIOGET_GLYPH           0x4615
#define FBIOGET_HWCINFO         0x4616
#define FBIOPUT_MODEINFO        0x4617
#define FBIOGET_DISPINFO        0x4618


#define FB_TYPE_PACKED_PIXELS		0	/* Packed Pixels	*/
#define FB_TYPE_PLANES			1	/* Non interleaved planes */
#define FB_TYPE_INTERLEAVED_PLANES	2	/* Interleaved planes	*/
#define FB_TYPE_TEXT			3	/* Text/attributes	*/
#define FB_TYPE_VGA_PLANES		4	/* EGA/VGA planes	*/

#define FB_AUX_TEXT_MDA		0	/* Monochrome text */
#define FB_AUX_TEXT_CGA		1	/* CGA/EGA/VGA Color text */
#define FB_AUX_TEXT_S3_MMIO	2	/* S3 MMIO fasttext */
#define FB_AUX_TEXT_MGA_STEP16	3	/* MGA Millenium I: text, attr, 14 reserved bytes */
#define FB_AUX_TEXT_MGA_STEP8	4	/* other MGAs:      text, attr,  6 reserved bytes */

#define FB_AUX_VGA_PLANES_VGA4		0	/* 16 color planes (EGA/VGA) */
#define FB_AUX_VGA_PLANES_CFB4		1	/* CFB4 in planes (VGA) */
#define FB_AUX_VGA_PLANES_CFB8		2	/* CFB8 in planes (VGA) */

#define FB_VISUAL_MONO01		0	/* Monochr. 1=Black 0=White */
#define FB_VISUAL_MONO10		1	/* Monochr. 1=White 0=Black */
#define FB_VISUAL_TRUECOLOR		2	/* True color	*/
#define FB_VISUAL_PSEUDOCOLOR		3	/* Pseudo color (like atari) */
#define FB_VISUAL_DIRECTCOLOR		4	/* Direct color */
#define FB_VISUAL_STATIC_PSEUDOCOLOR	5	/* Pseudo color readonly */

#define FB_ACCEL_NONE		0	/* no hardware accelerator	*/
#define FB_ACCEL_ATARIBLITT	1	/* Atari Blitter		*/
#define FB_ACCEL_AMIGABLITT	2	/* Amiga Blitter                */
#define FB_ACCEL_S3_TRIO64	3	/* Cybervision64 (S3 Trio64)    */
#define FB_ACCEL_NCR_77C32BLT	4	/* RetinaZ3 (NCR 77C32BLT)      */
#define FB_ACCEL_S3_VIRGE	5	/* Cybervision64/3D (S3 ViRGE)	*/
#define FB_ACCEL_ATI_MACH64GX	6	/* ATI Mach 64GX family		*/
#define FB_ACCEL_DEC_TGA	7	/* DEC 21030 TGA		*/
#define FB_ACCEL_ATI_MACH64CT	8	/* ATI Mach 64CT family		*/
#define FB_ACCEL_ATI_MACH64VT	9	/* ATI Mach 64CT family VT class */
#define FB_ACCEL_ATI_MACH64GT	10	/* ATI Mach 64CT family GT class */
#define FB_ACCEL_SUN_CREATOR	11	/* Sun Creator/Creator3D	*/
#define FB_ACCEL_SUN_CGSIX	12	/* Sun cg6			*/
#define FB_ACCEL_SUN_LEO	13	/* Sun leo/zx			*/
#define FB_ACCEL_IMS_TWINTURBO	14	/* IMS Twin Turbo		*/
#define FB_ACCEL_3DLABS_PERMEDIA2 15	/* 3Dlabs Permedia 2		*/
#define FB_ACCEL_MATROX_MGA2064W 16	/* Matrox MGA2064W (Millenium)	*/
#define FB_ACCEL_MATROX_MGA1064SG 17	/* Matrox MGA1064SG (Mystique)	*/
#define FB_ACCEL_MATROX_MGA2164W 18	/* Matrox MGA2164W (Millenium II) */
#define FB_ACCEL_MATROX_MGA2164W_AGP 19	/* Matrox MGA2164W (Millenium II) */
#define FB_ACCEL_MATROX_MGAG100	20	/* Matrox G100 (Productiva G100) */
#define FB_ACCEL_MATROX_MGAG200	21	/* Matrox G200 (Myst, Mill, ...) */
#define FB_ACCEL_SUN_CG14	22	/* Sun cgfourteen		 */
#define FB_ACCEL_SUN_BWTWO	23	/* Sun bwtwo			*/
#define FB_ACCEL_SUN_CGTHREE	24	/* Sun cgthree			*/
#define FB_ACCEL_SUN_TCX	25	/* Sun tcx			*/
#define FB_ACCEL_MATROX_MGAG400	26	/* Matrox G400			*/
#define FB_ACCEL_NV3		27	/* nVidia RIVA 128              */
#define FB_ACCEL_NV4		28	/* nVidia RIVA TNT		*/
#define FB_ACCEL_NV5		29	/* nVidia RIVA TNT2		*/
#define FB_ACCEL_CT_6555x	30	/* C&T 6555x			*/
#define FB_ACCEL_3DFX_BANSHEE	31	/* 3Dfx Banshee			*/
#define FB_ACCEL_ATI_RAGE128	32	/* ATI Rage128 family		*/
#define FB_ACCEL_IGS_CYBER2000	33	/* CyberPro 2000		*/
#define FB_ACCEL_IGS_CYBER2010	34	/* CyberPro 2010		*/
#define FB_ACCEL_IGS_CYBER5000	35	/* CyberPro 5000		*/
#define FB_ACCEL_SIS_GLAMOUR    36	/* SiS 300/630/540              */
#define FB_ACCEL_3DLABS_PERMEDIA3 37	/* 3Dlabs Permedia 3		*/
#define FB_ACCEL_ATI_RADEON	38	/* ATI Radeon family		*/
#define FB_ACCEL_I810           39      /* Intel 810/815                */
#define FB_ACCEL_SIS_GLAMOUR_2  40	/* SiS 315, 650, 740		*/
#define FB_ACCEL_SIS_XABRE      41	/* SiS 330 ("Xabre")		*/
#define FB_ACCEL_I830           42      /* Intel 830M/845G/85x/865G     */
#define FB_ACCEL_NV_10          43      /* nVidia Arch 10               */
#define FB_ACCEL_NV_20          44      /* nVidia Arch 20               */
#define FB_ACCEL_NV_30          45      /* nVidia Arch 30               */
#define FB_ACCEL_NV_40          46      /* nVidia Arch 40               */
#define FB_ACCEL_XGI_VOLARI_V	47	/* XGI Volari V3XT, V5, V8      */
#define FB_ACCEL_XGI_VOLARI_Z	48	/* XGI Volari Z7                */
#define FB_ACCEL_NEOMAGIC_NM2070 90	/* NeoMagic NM2070              */
#define FB_ACCEL_NEOMAGIC_NM2090 91	/* NeoMagic NM2090              */
#define FB_ACCEL_NEOMAGIC_NM2093 92	/* NeoMagic NM2093              */
#define FB_ACCEL_NEOMAGIC_NM2097 93	/* NeoMagic NM2097              */
#define FB_ACCEL_NEOMAGIC_NM2160 94	/* NeoMagic NM2160              */
#define FB_ACCEL_NEOMAGIC_NM2200 95	/* NeoMagic NM2200              */
#define FB_ACCEL_NEOMAGIC_NM2230 96	/* NeoMagic NM2230              */
#define FB_ACCEL_NEOMAGIC_NM2360 97	/* NeoMagic NM2360              */
#define FB_ACCEL_NEOMAGIC_NM2380 98	/* NeoMagic NM2380              */
#define FB_ACCEL_EP9X            99     /* CirrusLogic EP9X family      */

#define FB_ACCEL_SAVAGE4        0x80	/* S3 Savage4                   */
#define FB_ACCEL_SAVAGE3D       0x81	/* S3 Savage3D                  */
#define FB_ACCEL_SAVAGE3D_MV    0x82	/* S3 Savage3D-MV               */
#define FB_ACCEL_SAVAGE2000     0x83	/* S3 Savage2000                */
#define FB_ACCEL_SAVAGE_MX_MV   0x84	/* S3 Savage/MX-MV              */
#define FB_ACCEL_SAVAGE_MX      0x85	/* S3 Savage/MX                 */
#define FB_ACCEL_SAVAGE_IX_MV   0x86	/* S3 Savage/IX-MV              */
#define FB_ACCEL_SAVAGE_IX      0x87	/* S3 Savage/IX                 */
#define FB_ACCEL_PROSAVAGE_PM   0x88	/* S3 ProSavage PM133           */
#define FB_ACCEL_PROSAVAGE_KM   0x89	/* S3 ProSavage KM133           */
#define FB_ACCEL_S3TWISTER_P    0x8a	/* S3 Twister                   */
#define FB_ACCEL_S3TWISTER_K    0x8b	/* S3 TwisterK                  */
#define FB_ACCEL_SUPERSAVAGE    0x8c    /* S3 Supersavage               */
#define FB_ACCEL_PROSAVAGE_DDR  0x8d	/* S3 ProSavage DDR             */
#define FB_ACCEL_PROSAVAGE_DDRK 0x8e	/* S3 ProSavage DDR-K           */

struct fb_fix_screeninfo {
	char id[16];			/* identification string eg "TT Builtin" */
	unsigned long smem_start;	/* Start of frame buffer mem */
					/* (physical address) */
	u32 smem_len;			/* Length of frame buffer mem */
	u32 type;			/* see FB_TYPE_*		*/
	u32 type_aux;			/* Interleave for interleaved Planes */
	u32 visual;			/* see FB_VISUAL_*		*/
	u16 xpanstep;			/* zero if no hardware panning  */
	u16 ypanstep;			/* zero if no hardware panning  */
	u16 ywrapstep;			/* zero if no hardware ywrap    */
	u32 line_length;		/* length of a line in bytes    */
	unsigned long mmio_start;	/* Start of Memory Mapped I/O   */
					/* (physical address) */
	u32 mmio_len;			/* Length of Memory Mapped I/O  */
	u32 accel;			/* Indicate to driver which	*/
					/*  specific chip/card we have	*/
	u16 reserved[3];		/* Reserved for future compatibility */
};

/* Interpretation of offset for color fields: All offsets are from the right,
 * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you
 * can use the offset as right argument to <<). A pixel afterwards is a bit
 * stream and is written to video memory as that unmodified. This implies
 * big-endian byte order if bits_per_pixel is greater than 8.
 */
struct fb_bitfield {
	u32 offset;			/* beginning of bitfield	*/
	u32 length;			/* length of bitfield		*/
	u32 msb_right;			/* != 0 : Most significant bit is */
					/* right */ 
};

#define FB_NONSTD_HAM		1	/* Hold-And-Modify (HAM)        */

#define FB_ACTIVATE_NOW		0	/* set values immediately (or vbl)*/
#define FB_ACTIVATE_NXTOPEN	1	/* activate on next open	*/
#define FB_ACTIVATE_TEST	2	/* don't set, round up impossible */
#define FB_ACTIVATE_MASK       15
					/* values			*/
#define FB_ACTIVATE_VBL	       16	/* activate values on next vbl  */
#define FB_CHANGE_CMAP_VBL     32	/* change colormap on vbl	*/
#define FB_ACTIVATE_ALL	       64	/* change all VCs on this fb	*/
#define FB_ACTIVATE_FORCE     128	/* force apply even when no change*/
#define FB_ACTIVATE_INV_MODE  256       /* invalidate videomode */

#define FB_ACCELF_TEXT		1	/* (OBSOLETE) see fb_info.flags and vc_mode */

#define FB_SYNC_HOR_HIGH_ACT	1	/* horizontal sync high active	*/
#define FB_SYNC_VERT_HIGH_ACT	2	/* vertical sync high active	*/
#define FB_SYNC_EXT		4	/* external sync		*/
#define FB_SYNC_COMP_HIGH_ACT	8	/* composite sync high active   */
#define FB_SYNC_BROADCAST	16	/* broadcast video timings      */
					/* vtotal = 144d/288n/576i => PAL  */
					/* vtotal = 121d/242n/484i => NTSC */
#define FB_SYNC_ON_GREEN	32	/* sync on green */

#define FB_VMODE_NONINTERLACED  0	/* non interlaced */
#define FB_VMODE_INTERLACED	1	/* interlaced	*/
#define FB_VMODE_DOUBLE		2	/* double scan */
#define FB_VMODE_MASK		255

#define FB_VMODE_YWRAP		256	/* ywrap instead of panning     */
#define FB_VMODE_SMOOTH_XPAN	512	/* smooth xpan possible (internally used) */
#define FB_VMODE_CONUPDATE	512	/* don't update x/yoffset	*/

/*
 * Display rotation support
 */
#define FB_ROTATE_UR      0
#define FB_ROTATE_CW      1
#define FB_ROTATE_UD      2
#define FB_ROTATE_CCW     3

#define PICOS2KHZ(a) (1000000000UL/(a))
#define KHZ2PICOS(a) (1000000000UL/(a))

struct fb_var_screeninfo {
	u32 xres;			/* visible resolution		*/
	u32 yres;
	u32 xres_virtual;		/* virtual resolution		*/
	u32 yres_virtual;
	u32 xoffset;			/* offset from virtual to visible */
	u32 yoffset;			/* resolution			*/

	u32 bits_per_pixel;		/* guess what			*/
	u32 grayscale;			/* != 0 Graylevels instead of colors */

	struct fb_bitfield red;		/* bitfield in fb mem if true color, */
	struct fb_bitfield green;	/* else only length is significant */
	struct fb_bitfield blue;
	struct fb_bitfield transp;	/* transparency			*/	

	u32 nonstd;			/* != 0 Non standard pixel format */

	u32 activate;			/* see FB_ACTIVATE_*		*/

	u32 height;			/* height of picture in mm    */
	u32 width;			/* width of picture in mm     */

	u32 accel_flags;		/* (OBSOLETE) see fb_info.flags */

	/* Timing: All values in pixclocks, except pixclock (of course) */
	u32 pixclock;			/* pixel clock in ps (pico seconds) */
	u32 left_margin;		/* time from sync to picture	*/
	u32 right_margin;		/* time from picture to sync	*/
	u32 upper_margin;		/* time from sync to picture	*/
	u32 lower_margin;
	u32 hsync_len;			/* length of horizontal sync	*/
	u32 vsync_len;			/* length of vertical sync	*/
	u32 sync;			/* see FB_SYNC_*		*/
	u32 vmode;			/* see FB_VMODE_*		*/
	u32 rotate;			/* angle we rotate counter clockwise */
	u32 reserved[5];		/* Reserved for future compatibility */
};

struct fb_cmap {
	u32 start;			/* First entry	*/
	u32 len;			/* Number of entries */
	u16 *red;			/* Red values	*/
	u16 *green;
	u16 *blue;
	u16 *transp;			/* transparency, can be NULL */
};

struct fb_con2fbmap {
	u32 console;
	u32 framebuffer;
};

/* VESA Blanking Levels */
#define VESA_NO_BLANKING        0
#define VESA_VSYNC_SUSPEND      1
#define VESA_HSYNC_SUSPEND      2
#define VESA_POWERDOWN          3


enum {
	/* screen: unblanked, hsync: on,  vsync: on */
	FB_BLANK_UNBLANK       = VESA_NO_BLANKING,

	/* screen: blanked,   hsync: on,  vsync: on */
	FB_BLANK_NORMAL        = VESA_NO_BLANKING + 1,

	/* screen: blanked,   hsync: on,  vsync: off */
	FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,

	/* screen: blanked,   hsync: off, vsync: on */
	FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,

	/* screen: blanked,   hsync: off, vsync: off */
	FB_BLANK_POWERDOWN     = VESA_POWERDOWN + 1
};

#define FB_VBLANK_VBLANKING	0x001	/* currently in a vertical blank */
#define FB_VBLANK_HBLANKING	0x002	/* currently in a horizontal blank */
#define FB_VBLANK_HAVE_VBLANK	0x004	/* vertical blanks can be detected */
#define FB_VBLANK_HAVE_HBLANK	0x008	/* horizontal blanks can be detected */
#define FB_VBLANK_HAVE_COUNT	0x010	/* global retrace counter is available */
#define FB_VBLANK_HAVE_VCOUNT	0x020	/* the vcount field is valid */
#define FB_VBLANK_HAVE_HCOUNT	0x040	/* the hcount field is valid */
#define FB_VBLANK_VSYNCING	0x080	/* currently in a vsync */
#define FB_VBLANK_HAVE_VSYNC	0x100	/* verical syncs can be detected */

struct fb_vblank {
	u32 flags;			/* FB_VBLANK flags */
	u32 count;			/* counter of retraces since boot */
	u32 vcount;			/* current scanline position */
	u32 hcount;			/* current scandot position */
	u32 reserved[4];		/* reserved for future compatibility */
};

/* Internal HW accel */
#define ROP_COPY 0
#define ROP_XOR  1

struct fb_copyarea {
	u32 dx;
	u32 dy;
	u32 width;
	u32 height;
	u32 sx;
	u32 sy;
};

struct fb_fillrect {
	u32 dx;		/* screen-relative */
	u32 dy;
	u32 width;
	u32 height;
	u32 color;
	u32 rop;
};

struct fb_image {
	u32 dx;			/* Where to place image */
	u32 dy;
	u32 width;		/* Size of image */
	u32 height;
	u32 fg_color;		/* Only used when a mono bitmap */
	u32 bg_color;
	u8  depth;		/* Depth of the image */
	const char *data;	/* Pointer to image data */
	struct fb_cmap cmap;	/* color map info */
};

/*
 * hardware cursor control
 */

#define FB_CUR_SETIMAGE 0x01
#define FB_CUR_SETPOS   0x02
#define FB_CUR_SETHOT   0x04
#define FB_CUR_SETCMAP  0x08
#define FB_CUR_SETSHAPE 0x10
#define FB_CUR_SETSIZE	0x20
#define FB_CUR_SETALL   0xFF

struct fbcurpos {
	u16 x, y;
};

struct fb_cursor {
	u16 set;		/* what to set */
	u16 enable;		/* cursor on/off */
	u16 rop;		/* bitop operation */
	const char *mask;	/* cursor mask bits */
	struct fbcurpos hot;	/* cursor hot spot */
	struct fb_image	image;	/* Cursor image */
};

#endif /* _LINUX_FB_H */
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/����������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11307522564�011652� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb_strings.h����������������������������������������������������������0000644�0001750�0001750�00000034640�11307521532�015273� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef __DIRECTFB_STRINGS_H__
#define __DIRECTFB_STRINGS_H__


struct DFBPixelFormatName {
     DFBSurfacePixelFormat format;
     const char *name;
};

#define DirectFBPixelFormatNames(Identifier) struct DFBPixelFormatName Identifier[] = { \
     { DSPF_ARGB1555, "ARGB1555" }, \
     { DSPF_RGB16, "RGB16" }, \
     { DSPF_RGB24, "RGB24" }, \
     { DSPF_RGB32, "RGB32" }, \
     { DSPF_ARGB, "ARGB" }, \
     { DSPF_A8, "A8" }, \
     { DSPF_YUY2, "YUY2" }, \
     { DSPF_RGB332, "RGB332" }, \
     { DSPF_UYVY, "UYVY" }, \
     { DSPF_I420, "I420" }, \
     { DSPF_YV12, "YV12" }, \
     { DSPF_LUT8, "LUT8" }, \
     { DSPF_ALUT44, "ALUT44" }, \
     { DSPF_AiRGB, "AiRGB" }, \
     { DSPF_A1, "A1" }, \
     { DSPF_NV12, "NV12" }, \
     { DSPF_NV16, "NV16" }, \
     { DSPF_ARGB2554, "ARGB2554" }, \
     { DSPF_ARGB4444, "ARGB4444" }, \
     { DSPF_NV21, "NV21" }, \
     { DSPF_AYUV, "AYUV" }, \
     { DSPF_A4, "A4" }, \
     { DSPF_ARGB1666, "ARGB1666" }, \
     { DSPF_ARGB6666, "ARGB6666" }, \
     { DSPF_RGB18, "RGB18" }, \
     { DSPF_LUT2, "LUT2" }, \
     { DSPF_RGB444, "RGB444" }, \
     { DSPF_RGB555, "RGB555" }, \
     { DSPF_BGR555, "BGR555" }, \
     { DSPF_UNKNOWN, "UNKNOWN" } \
};


struct DFBInputDeviceTypeFlagsName {
     DFBInputDeviceTypeFlags type;
     const char *name;
};

#define DirectFBInputDeviceTypeFlagsNames(Identifier) struct DFBInputDeviceTypeFlagsName Identifier[] = { \
     { DIDTF_KEYBOARD, "KEYBOARD" }, \
     { DIDTF_MOUSE, "MOUSE" }, \
     { DIDTF_JOYSTICK, "JOYSTICK" }, \
     { DIDTF_REMOTE, "REMOTE" }, \
     { DIDTF_VIRTUAL, "VIRTUAL" }, \
     { DIDTF_NONE, "NONE" } \
};


struct DFBSurfaceDrawingFlagsName {
     DFBSurfaceDrawingFlags flag;
     const char *name;
};

#define DirectFBSurfaceDrawingFlagsNames(Identifier) struct DFBSurfaceDrawingFlagsName Identifier[] = { \
     { DSDRAW_BLEND, "BLEND" }, \
     { DSDRAW_DST_COLORKEY, "DST_COLORKEY" }, \
     { DSDRAW_SRC_PREMULTIPLY, "SRC_PREMULTIPLY" }, \
     { DSDRAW_DST_PREMULTIPLY, "DST_PREMULTIPLY" }, \
     { DSDRAW_DEMULTIPLY, "DEMULTIPLY" }, \
     { DSDRAW_XOR, "XOR" }, \
     { DSDRAW_NOFX, "NOFX" } \
};


struct DFBSurfaceBlittingFlagsName {
     DFBSurfaceBlittingFlags flag;
     const char *name;
};

#define DirectFBSurfaceBlittingFlagsNames(Identifier) struct DFBSurfaceBlittingFlagsName Identifier[] = { \
     { DSBLIT_BLEND_ALPHACHANNEL, "BLEND_ALPHACHANNEL" }, \
     { DSBLIT_BLEND_COLORALPHA, "BLEND_COLORALPHA" }, \
     { DSBLIT_COLORIZE, "COLORIZE" }, \
     { DSBLIT_SRC_COLORKEY, "SRC_COLORKEY" }, \
     { DSBLIT_DST_COLORKEY, "DST_COLORKEY" }, \
     { DSBLIT_SRC_PREMULTIPLY, "SRC_PREMULTIPLY" }, \
     { DSBLIT_DST_PREMULTIPLY, "DST_PREMULTIPLY" }, \
     { DSBLIT_DEMULTIPLY, "DEMULTIPLY" }, \
     { DSBLIT_DEINTERLACE, "DEINTERLACE" }, \
     { DSBLIT_SRC_PREMULTCOLOR, "SRC_PREMULTCOLOR" }, \
     { DSBLIT_XOR, "XOR" }, \
     { DSBLIT_INDEX_TRANSLATION, "INDEX_TRANSLATION" }, \
     { DSBLIT_ROTATE180, "ROTATE180" }, \
     { DSBLIT_COLORKEY_PROTECT, "COLORKEY_PROTECT" }, \
     { DSBLIT_SRC_MASK_ALPHA, "SRC_MASK_ALPHA" }, \
     { DSBLIT_SRC_MASK_COLOR, "SRC_MASK_COLOR" }, \
     { DSBLIT_NOFX, "NOFX" } \
};


struct DFBSurfaceBlendFunctionName {
     DFBSurfaceBlendFunction function;
     const char *name;
};

#define DirectFBSurfaceBlendFunctionNames(Identifier) struct DFBSurfaceBlendFunctionName Identifier[] = { \
     { DSBF_ZERO, "ZERO" }, \
     { DSBF_ONE, "ONE" }, \
     { DSBF_SRCCOLOR, "SRCCOLOR" }, \
     { DSBF_INVSRCCOLOR, "INVSRCCOLOR" }, \
     { DSBF_SRCALPHA, "SRCALPHA" }, \
     { DSBF_INVSRCALPHA, "INVSRCALPHA" }, \
     { DSBF_DESTALPHA, "DESTALPHA" }, \
     { DSBF_INVDESTALPHA, "INVDESTALPHA" }, \
     { DSBF_DESTCOLOR, "DESTCOLOR" }, \
     { DSBF_INVDESTCOLOR, "INVDESTCOLOR" }, \
     { DSBF_SRCALPHASAT, "SRCALPHASAT" }, \
     { DSBF_UNKNOWN, "UNKNOWN" } \
};


struct DFBInputDeviceCapabilitiesName {
     DFBInputDeviceCapabilities capability;
     const char *name;
};

#define DirectFBInputDeviceCapabilitiesNames(Identifier) struct DFBInputDeviceCapabilitiesName Identifier[] = { \
     { DICAPS_KEYS, "KEYS" }, \
     { DICAPS_AXES, "AXES" }, \
     { DICAPS_BUTTONS, "BUTTONS" }, \
     { DICAPS_NONE, "NONE" } \
};


struct DFBDisplayLayerTypeFlagsName {
     DFBDisplayLayerTypeFlags type;
     const char *name;
};

#define DirectFBDisplayLayerTypeFlagsNames(Identifier) struct DFBDisplayLayerTypeFlagsName Identifier[] = { \
     { DLTF_GRAPHICS, "GRAPHICS" }, \
     { DLTF_VIDEO, "VIDEO" }, \
     { DLTF_STILL_PICTURE, "STILL_PICTURE" }, \
     { DLTF_BACKGROUND, "BACKGROUND" }, \
     { DLTF_NONE, "NONE" } \
};


struct DFBDisplayLayerCapabilitiesName {
     DFBDisplayLayerCapabilities capability;
     const char *name;
};

#define DirectFBDisplayLayerCapabilitiesNames(Identifier) struct DFBDisplayLayerCapabilitiesName Identifier[] = { \
     { DLCAPS_SURFACE, "SURFACE" }, \
     { DLCAPS_OPACITY, "OPACITY" }, \
     { DLCAPS_ALPHACHANNEL, "ALPHACHANNEL" }, \
     { DLCAPS_SCREEN_LOCATION, "SCREEN_LOCATION" }, \
     { DLCAPS_FLICKER_FILTERING, "FLICKER_FILTERING" }, \
     { DLCAPS_DEINTERLACING, "DEINTERLACING" }, \
     { DLCAPS_SRC_COLORKEY, "SRC_COLORKEY" }, \
     { DLCAPS_DST_COLORKEY, "DST_COLORKEY" }, \
     { DLCAPS_BRIGHTNESS, "BRIGHTNESS" }, \
     { DLCAPS_CONTRAST, "CONTRAST" }, \
     { DLCAPS_HUE, "HUE" }, \
     { DLCAPS_SATURATION, "SATURATION" }, \
     { DLCAPS_LEVELS, "LEVELS" }, \
     { DLCAPS_FIELD_PARITY, "FIELD_PARITY" }, \
     { DLCAPS_WINDOWS, "WINDOWS" }, \
     { DLCAPS_SOURCES, "SOURCES" }, \
     { DLCAPS_ALPHA_RAMP, "ALPHA_RAMP" }, \
     { DLCAPS_PREMULTIPLIED, "PREMULTIPLIED" }, \
     { DLCAPS_SCREEN_POSITION, "SCREEN_POSITION" }, \
     { DLCAPS_SCREEN_SIZE, "SCREEN_SIZE" }, \
     { DLCAPS_CLIP_REGIONS, "CLIP_REGIONS" }, \
     { DLCAPS_NONE, "NONE" } \
};


struct DFBDisplayLayerBufferModeName {
     DFBDisplayLayerBufferMode mode;
     const char *name;
};

#define DirectFBDisplayLayerBufferModeNames(Identifier) struct DFBDisplayLayerBufferModeName Identifier[] = { \
     { DLBM_FRONTONLY, "FRONTONLY" }, \
     { DLBM_BACKVIDEO, "BACKVIDEO" }, \
     { DLBM_BACKSYSTEM, "BACKSYSTEM" }, \
     { DLBM_TRIPLE, "TRIPLE" }, \
     { DLBM_WINDOWS, "WINDOWS" }, \
     { DLBM_UNKNOWN, "UNKNOWN" } \
};


struct DFBWindowCapabilitiesName {
     DFBWindowCapabilities capability;
     const char *name;
};

#define DirectFBWindowCapabilitiesNames(Identifier) struct DFBWindowCapabilitiesName Identifier[] = { \
     { DWCAPS_ALPHACHANNEL, "ALPHACHANNEL" }, \
     { DWCAPS_DOUBLEBUFFER, "DOUBLEBUFFER" }, \
     { DWCAPS_INPUTONLY, "INPUTONLY" }, \
     { DWCAPS_NODECORATION, "NODECORATION" }, \
     { DWCAPS_COLOR, "COLOR" }, \
     { DWCAPS_NOFOCUS, "NOFOCUS" }, \
     { DWCAPS_NONE, "NONE" } \
};


struct DFBWindowOptionsName {
     DFBWindowOptions option;
     const char *name;
};

#define DirectFBWindowOptionsNames(Identifier) struct DFBWindowOptionsName Identifier[] = { \
     { DWOP_COLORKEYING, "COLORKEYING" }, \
     { DWOP_ALPHACHANNEL, "ALPHACHANNEL" }, \
     { DWOP_OPAQUE_REGION, "OPAQUE_REGION" }, \
     { DWOP_SHAPED, "SHAPED" }, \
     { DWOP_ALPHACHANNEL, "ALPHACHANNEL" }, \
     { DWOP_KEEP_POSITION, "KEEP_POSITION" }, \
     { DWOP_KEEP_SIZE, "KEEP_SIZE" }, \
     { DWOP_KEEP_STACKING, "KEEP_STACKING" }, \
     { DWOP_GHOST, "GHOST" }, \
     { DWOP_INDESTRUCTIBLE, "INDESTRUCTIBLE" }, \
     { DWOP_SCALE, "SCALE" }, \
     { DWOP_KEEP_ABOVE, "KEEP_ABOVE" }, \
     { DWOP_KEEP_UNDER, "KEEP_UNDER" }, \
     { DWOP_NONE, "NONE" } \
};


struct DFBScreenCapabilitiesName {
     DFBScreenCapabilities capability;
     const char *name;
};

#define DirectFBScreenCapabilitiesNames(Identifier) struct DFBScreenCapabilitiesName Identifier[] = { \
     { DSCCAPS_VSYNC, "VSYNC" }, \
     { DSCCAPS_POWER_MANAGEMENT, "POWER_MANAGEMENT" }, \
     { DSCCAPS_MIXERS, "MIXERS" }, \
     { DSCCAPS_ENCODERS, "ENCODERS" }, \
     { DSCCAPS_OUTPUTS, "OUTPUTS" }, \
     { DSCCAPS_NONE, "NONE" } \
};


struct DFBScreenEncoderCapabilitiesName {
     DFBScreenEncoderCapabilities capability;
     const char *name;
};

#define DirectFBScreenEncoderCapabilitiesNames(Identifier) struct DFBScreenEncoderCapabilitiesName Identifier[] = { \
     { DSECAPS_TV_STANDARDS, "TV_STANDARDS" }, \
     { DSECAPS_TEST_PICTURE, "TEST_PICTURE" }, \
     { DSECAPS_MIXER_SEL, "MIXER_SEL" }, \
     { DSECAPS_OUT_SIGNALS, "OUT_SIGNALS" }, \
     { DSECAPS_SCANMODE, "SCANMODE" }, \
     { DSECAPS_FREQUENCY, "FREQUENCY" }, \
     { DSECAPS_BRIGHTNESS, "BRIGHTNESS" }, \
     { DSECAPS_CONTRAST, "CONTRAST" }, \
     { DSECAPS_HUE, "HUE" }, \
     { DSECAPS_SATURATION, "SATURATION" }, \
     { DSECAPS_CONNECTORS, "CONNECTORS" }, \
     { DSECAPS_SLOW_BLANKING, "SLOW_BLANKING" }, \
     { DSECAPS_RESOLUTION, "RESOLUTION" }, \
     { DSECAPS_NONE, "NONE" } \
};


struct DFBScreenEncoderTypeName {
     DFBScreenEncoderType type;
     const char *name;
};

#define DirectFBScreenEncoderTypeNames(Identifier) struct DFBScreenEncoderTypeName Identifier[] = { \
     { DSET_CRTC, "CRTC" }, \
     { DSET_TV, "TV" }, \
     { DSET_DIGITAL, "DIGITAL" }, \
     { DSET_UNKNOWN, "UNKNOWN" } \
};


struct DFBScreenEncoderTVStandardsName {
     DFBScreenEncoderTVStandards standard;
     const char *name;
};

#define DirectFBScreenEncoderTVStandardsNames(Identifier) struct DFBScreenEncoderTVStandardsName Identifier[] = { \
     { DSETV_PAL, "PAL" }, \
     { DSETV_NTSC, "NTSC" }, \
     { DSETV_SECAM, "SECAM" }, \
     { DSETV_PAL_60, "PAL_60" }, \
     { DSETV_PAL_BG, "PAL_BG" }, \
     { DSETV_PAL_I, "PAL_I" }, \
     { DSETV_PAL_M, "PAL_M" }, \
     { DSETV_PAL_N, "PAL_N" }, \
     { DSETV_PAL_NC, "PAL_NC" }, \
     { DSETV_NTSC_M_JPN, "NTSC_M_JPN" }, \
     { DSETV_DIGITAL, "DIGITAL" }, \
     { DSETV_UNKNOWN, "UNKNOWN" } \
};


struct DFBScreenOutputCapabilitiesName {
     DFBScreenOutputCapabilities capability;
     const char *name;
};

#define DirectFBScreenOutputCapabilitiesNames(Identifier) struct DFBScreenOutputCapabilitiesName Identifier[] = { \
     { DSOCAPS_CONNECTORS, "CONNECTORS" }, \
     { DSOCAPS_ENCODER_SEL, "ENCODER_SEL" }, \
     { DSOCAPS_SIGNAL_SEL, "SIGNAL_SEL" }, \
     { DSOCAPS_CONNECTOR_SEL, "CONNECTOR_SEL" }, \
     { DSOCAPS_SLOW_BLANKING, "SLOW_BLANKING" }, \
     { DSOCAPS_RESOLUTION, "RESOLUTION" }, \
     { DSOCAPS_NONE, "NONE" } \
};


struct DFBScreenOutputConnectorsName {
     DFBScreenOutputConnectors connector;
     const char *name;
};

#define DirectFBScreenOutputConnectorsNames(Identifier) struct DFBScreenOutputConnectorsName Identifier[] = { \
     { DSOC_VGA, "VGA" }, \
     { DSOC_SCART, "SCART" }, \
     { DSOC_YC, "YC" }, \
     { DSOC_CVBS, "CVBS" }, \
     { DSOC_SCART2, "SCART2" }, \
     { DSOC_COMPONENT, "COMPONENT" }, \
     { DSOC_HDMI, "HDMI" }, \
     { DSOC_UNKNOWN, "UNKNOWN" } \
};


struct DFBScreenOutputSignalsName {
     DFBScreenOutputSignals signal;
     const char *name;
};

#define DirectFBScreenOutputSignalsNames(Identifier) struct DFBScreenOutputSignalsName Identifier[] = { \
     { DSOS_VGA, "VGA" }, \
     { DSOS_YC, "YC" }, \
     { DSOS_CVBS, "CVBS" }, \
     { DSOS_RGB, "RGB" }, \
     { DSOS_YCBCR, "YCBCR" }, \
     { DSOS_HDMI, "HDMI" }, \
     { DSOS_656, "656" }, \
     { DSOS_NONE, "NONE" } \
};


struct DFBScreenOutputSlowBlankingSignalsName {
     DFBScreenOutputSlowBlankingSignals slow_signal;
     const char *name;
};

#define DirectFBScreenOutputSlowBlankingSignalsNames(Identifier) struct DFBScreenOutputSlowBlankingSignalsName Identifier[] = { \
     { DSOSB_16x9, "16x9" }, \
     { DSOSB_4x3, "4x3" }, \
     { DSOSB_FOLLOW, "FOLLOW" }, \
     { DSOSB_MONITOR, "MONITOR" }, \
     { DSOSB_OFF, "OFF" } \
};


struct DFBScreenOutputResolutionName {
     DFBScreenOutputResolution resolution;
     const char *name;
};

#define DirectFBScreenOutputResolutionNames(Identifier) struct DFBScreenOutputResolutionName Identifier[] = { \
     { DSOR_640_480, "640_480" }, \
     { DSOR_720_480, "720_480" }, \
     { DSOR_720_576, "720_576" }, \
     { DSOR_800_600, "800_600" }, \
     { DSOR_1024_768, "1024_768" }, \
     { DSOR_1152_864, "1152_864" }, \
     { DSOR_1280_720, "1280_720" }, \
     { DSOR_1280_768, "1280_768" }, \
     { DSOR_1280_960, "1280_960" }, \
     { DSOR_1280_1024, "1280_1024" }, \
     { DSOR_1400_1050, "1400_1050" }, \
     { DSOR_1600_1200, "1600_1200" }, \
     { DSOR_1920_1080, "1920_1080" }, \
     { DSOR_UNKNOWN, "UNKNOWN" } \
};


struct DFBScreenMixerCapabilitiesName {
     DFBScreenMixerCapabilities capability;
     const char *name;
};

#define DirectFBScreenMixerCapabilitiesNames(Identifier) struct DFBScreenMixerCapabilitiesName Identifier[] = { \
     { DSMCAPS_FULL, "FULL" }, \
     { DSMCAPS_SUB_LEVEL, "SUB_LEVEL" }, \
     { DSMCAPS_SUB_LAYERS, "SUB_LAYERS" }, \
     { DSMCAPS_BACKGROUND, "BACKGROUND" }, \
     { DSMCAPS_NONE, "NONE" } \
};


struct DFBScreenMixerTreeName {
     DFBScreenMixerTree tree;
     const char *name;
};

#define DirectFBScreenMixerTreeNames(Identifier) struct DFBScreenMixerTreeName Identifier[] = { \
     { DSMT_FULL, "FULL" }, \
     { DSMT_SUB_LEVEL, "SUB_LEVEL" }, \
     { DSMT_SUB_LAYERS, "SUB_LAYERS" }, \
     { DSMT_UNKNOWN, "UNKNOWN" } \
};


struct DFBScreenEncoderTestPictureName {
     DFBScreenEncoderTestPicture test_picture;
     const char *name;
};

#define DirectFBScreenEncoderTestPictureNames(Identifier) struct DFBScreenEncoderTestPictureName Identifier[] = { \
     { DSETP_MULTI, "MULTI" }, \
     { DSETP_SINGLE, "SINGLE" }, \
     { DSETP_WHITE, "WHITE" }, \
     { DSETP_YELLOW, "YELLOW" }, \
     { DSETP_CYAN, "CYAN" }, \
     { DSETP_GREEN, "GREEN" }, \
     { DSETP_MAGENTA, "MAGENTA" }, \
     { DSETP_RED, "RED" }, \
     { DSETP_BLUE, "BLUE" }, \
     { DSETP_BLACK, "BLACK" }, \
     { DSETP_OFF, "OFF" } \
};


struct DFBScreenEncoderScanModeName {
     DFBScreenEncoderScanMode scan_mode;
     const char *name;
};

#define DirectFBScreenEncoderScanModeNames(Identifier) struct DFBScreenEncoderScanModeName Identifier[] = { \
     { DSESM_INTERLACED, "INTERLACED" }, \
     { DSESM_PROGRESSIVE, "PROGRESSIVE" }, \
     { DSESM_UNKNOWN, "UNKNOWN" } \
};


struct DFBAccelerationMaskName {
     DFBAccelerationMask mask;
     const char *name;
};

#define DirectFBAccelerationMaskNames(Identifier) struct DFBAccelerationMaskName Identifier[] = { \
     { DFXL_FILLRECTANGLE, "FILLRECTANGLE" }, \
     { DFXL_DRAWRECTANGLE, "DRAWRECTANGLE" }, \
     { DFXL_DRAWLINE, "DRAWLINE" }, \
     { DFXL_FILLTRIANGLE, "FILLTRIANGLE" }, \
     { DFXL_BLIT, "BLIT" }, \
     { DFXL_STRETCHBLIT, "STRETCHBLIT" }, \
     { DFXL_TEXTRIANGLES, "TEXTRIANGLES" }, \
     { DFXL_DRAWSTRING, "DRAWSTRING" }, \
     { DFXL_NONE, "NONE" } \
};

#endif
������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb_version.h.in�������������������������������������������������������0000644�0001750�0001750�00000003012�11164361026�015662� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2007  The DirectFB Organization (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIRECTFB_VERSION_H__
#define __DIRECTFB_VERSION_H__

#define DIRECTFB_MAJOR_VERSION  (@DIRECTFB_MAJOR_VERSION@)
#define DIRECTFB_MINOR_VERSION  (@DIRECTFB_MINOR_VERSION@)
#define DIRECTFB_MICRO_VERSION  (@DIRECTFB_MICRO_VERSION@)
#define DIRECTFB_BINARY_AGE     (@DIRECTFB_BINARY_AGE@)
#define DIRECTFB_INTERFACE_AGE  (@DIRECTFB_INTERFACE_AGE@)

#endif /* __DIRECTFB_VERSION_H__ */
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb_keynames.h���������������������������������������������������������0000644�0001750�0001750�00000040466�11307521531�015420� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#ifndef __DIRECTFB_KEYNAMES_H__
#define __DIRECTFB_KEYNAMES_H__


struct DFBKeySymbolName {
     DFBInputDeviceKeySymbol symbol;
     const char *name;
};

#define DirectFBKeySymbolNames(Identifier) struct DFBKeySymbolName Identifier[] = { \
     { DIKS_BACKSPACE, "BACKSPACE" }, \
     { DIKS_TAB, "TAB" }, \
     { DIKS_RETURN, "RETURN" }, \
     { DIKS_CANCEL, "CANCEL" }, \
     { DIKS_ESCAPE, "ESCAPE" }, \
     { DIKS_SPACE, "SPACE" }, \
     { DIKS_EXCLAMATION_MARK, "EXCLAMATION_MARK" }, \
     { DIKS_QUOTATION, "QUOTATION" }, \
     { DIKS_NUMBER_SIGN, "NUMBER_SIGN" }, \
     { DIKS_DOLLAR_SIGN, "DOLLAR_SIGN" }, \
     { DIKS_PERCENT_SIGN, "PERCENT_SIGN" }, \
     { DIKS_AMPERSAND, "AMPERSAND" }, \
     { DIKS_APOSTROPHE, "APOSTROPHE" }, \
     { DIKS_PARENTHESIS_LEFT, "PARENTHESIS_LEFT" }, \
     { DIKS_PARENTHESIS_RIGHT, "PARENTHESIS_RIGHT" }, \
     { DIKS_ASTERISK, "ASTERISK" }, \
     { DIKS_PLUS_SIGN, "PLUS_SIGN" }, \
     { DIKS_COMMA, "COMMA" }, \
     { DIKS_MINUS_SIGN, "MINUS_SIGN" }, \
     { DIKS_PERIOD, "PERIOD" }, \
     { DIKS_SLASH, "SLASH" }, \
     { DIKS_0, "0" }, \
     { DIKS_1, "1" }, \
     { DIKS_2, "2" }, \
     { DIKS_3, "3" }, \
     { DIKS_4, "4" }, \
     { DIKS_5, "5" }, \
     { DIKS_6, "6" }, \
     { DIKS_7, "7" }, \
     { DIKS_8, "8" }, \
     { DIKS_9, "9" }, \
     { DIKS_COLON, "COLON" }, \
     { DIKS_SEMICOLON, "SEMICOLON" }, \
     { DIKS_LESS_THAN_SIGN, "LESS_THAN_SIGN" }, \
     { DIKS_EQUALS_SIGN, "EQUALS_SIGN" }, \
     { DIKS_GREATER_THAN_SIGN, "GREATER_THAN_SIGN" }, \
     { DIKS_QUESTION_MARK, "QUESTION_MARK" }, \
     { DIKS_AT, "AT" }, \
     { DIKS_CAPITAL_A, "CAPITAL_A" }, \
     { DIKS_CAPITAL_B, "CAPITAL_B" }, \
     { DIKS_CAPITAL_C, "CAPITAL_C" }, \
     { DIKS_CAPITAL_D, "CAPITAL_D" }, \
     { DIKS_CAPITAL_E, "CAPITAL_E" }, \
     { DIKS_CAPITAL_F, "CAPITAL_F" }, \
     { DIKS_CAPITAL_G, "CAPITAL_G" }, \
     { DIKS_CAPITAL_H, "CAPITAL_H" }, \
     { DIKS_CAPITAL_I, "CAPITAL_I" }, \
     { DIKS_CAPITAL_J, "CAPITAL_J" }, \
     { DIKS_CAPITAL_K, "CAPITAL_K" }, \
     { DIKS_CAPITAL_L, "CAPITAL_L" }, \
     { DIKS_CAPITAL_M, "CAPITAL_M" }, \
     { DIKS_CAPITAL_N, "CAPITAL_N" }, \
     { DIKS_CAPITAL_O, "CAPITAL_O" }, \
     { DIKS_CAPITAL_P, "CAPITAL_P" }, \
     { DIKS_CAPITAL_Q, "CAPITAL_Q" }, \
     { DIKS_CAPITAL_R, "CAPITAL_R" }, \
     { DIKS_CAPITAL_S, "CAPITAL_S" }, \
     { DIKS_CAPITAL_T, "CAPITAL_T" }, \
     { DIKS_CAPITAL_U, "CAPITAL_U" }, \
     { DIKS_CAPITAL_V, "CAPITAL_V" }, \
     { DIKS_CAPITAL_W, "CAPITAL_W" }, \
     { DIKS_CAPITAL_X, "CAPITAL_X" }, \
     { DIKS_CAPITAL_Y, "CAPITAL_Y" }, \
     { DIKS_CAPITAL_Z, "CAPITAL_Z" }, \
     { DIKS_SQUARE_BRACKET_LEFT, "SQUARE_BRACKET_LEFT" }, \
     { DIKS_BACKSLASH, "BACKSLASH" }, \
     { DIKS_SQUARE_BRACKET_RIGHT, "SQUARE_BRACKET_RIGHT" }, \
     { DIKS_CIRCUMFLEX_ACCENT, "CIRCUMFLEX_ACCENT" }, \
     { DIKS_UNDERSCORE, "UNDERSCORE" }, \
     { DIKS_GRAVE_ACCENT, "GRAVE_ACCENT" }, \
     { DIKS_SMALL_A, "SMALL_A" }, \
     { DIKS_SMALL_B, "SMALL_B" }, \
     { DIKS_SMALL_C, "SMALL_C" }, \
     { DIKS_SMALL_D, "SMALL_D" }, \
     { DIKS_SMALL_E, "SMALL_E" }, \
     { DIKS_SMALL_F, "SMALL_F" }, \
     { DIKS_SMALL_G, "SMALL_G" }, \
     { DIKS_SMALL_H, "SMALL_H" }, \
     { DIKS_SMALL_I, "SMALL_I" }, \
     { DIKS_SMALL_J, "SMALL_J" }, \
     { DIKS_SMALL_K, "SMALL_K" }, \
     { DIKS_SMALL_L, "SMALL_L" }, \
     { DIKS_SMALL_M, "SMALL_M" }, \
     { DIKS_SMALL_N, "SMALL_N" }, \
     { DIKS_SMALL_O, "SMALL_O" }, \
     { DIKS_SMALL_P, "SMALL_P" }, \
     { DIKS_SMALL_Q, "SMALL_Q" }, \
     { DIKS_SMALL_R, "SMALL_R" }, \
     { DIKS_SMALL_S, "SMALL_S" }, \
     { DIKS_SMALL_T, "SMALL_T" }, \
     { DIKS_SMALL_U, "SMALL_U" }, \
     { DIKS_SMALL_V, "SMALL_V" }, \
     { DIKS_SMALL_W, "SMALL_W" }, \
     { DIKS_SMALL_X, "SMALL_X" }, \
     { DIKS_SMALL_Y, "SMALL_Y" }, \
     { DIKS_SMALL_Z, "SMALL_Z" }, \
     { DIKS_CURLY_BRACKET_LEFT, "CURLY_BRACKET_LEFT" }, \
     { DIKS_VERTICAL_BAR, "VERTICAL_BAR" }, \
     { DIKS_CURLY_BRACKET_RIGHT, "CURLY_BRACKET_RIGHT" }, \
     { DIKS_TILDE, "TILDE" }, \
     { DIKS_DELETE, "DELETE" }, \
     { DIKS_CURSOR_LEFT, "CURSOR_LEFT" }, \
     { DIKS_CURSOR_RIGHT, "CURSOR_RIGHT" }, \
     { DIKS_CURSOR_UP, "CURSOR_UP" }, \
     { DIKS_CURSOR_DOWN, "CURSOR_DOWN" }, \
     { DIKS_INSERT, "INSERT" }, \
     { DIKS_HOME, "HOME" }, \
     { DIKS_END, "END" }, \
     { DIKS_PAGE_UP, "PAGE_UP" }, \
     { DIKS_PAGE_DOWN, "PAGE_DOWN" }, \
     { DIKS_PRINT, "PRINT" }, \
     { DIKS_PAUSE, "PAUSE" }, \
     { DIKS_OK, "OK" }, \
     { DIKS_SELECT, "SELECT" }, \
     { DIKS_GOTO, "GOTO" }, \
     { DIKS_CLEAR, "CLEAR" }, \
     { DIKS_POWER, "POWER" }, \
     { DIKS_POWER2, "POWER2" }, \
     { DIKS_OPTION, "OPTION" }, \
     { DIKS_MENU, "MENU" }, \
     { DIKS_HELP, "HELP" }, \
     { DIKS_INFO, "INFO" }, \
     { DIKS_TIME, "TIME" }, \
     { DIKS_VENDOR, "VENDOR" }, \
     { DIKS_ARCHIVE, "ARCHIVE" }, \
     { DIKS_PROGRAM, "PROGRAM" }, \
     { DIKS_CHANNEL, "CHANNEL" }, \
     { DIKS_FAVORITES, "FAVORITES" }, \
     { DIKS_EPG, "EPG" }, \
     { DIKS_PVR, "PVR" }, \
     { DIKS_MHP, "MHP" }, \
     { DIKS_LANGUAGE, "LANGUAGE" }, \
     { DIKS_TITLE, "TITLE" }, \
     { DIKS_SUBTITLE, "SUBTITLE" }, \
     { DIKS_ANGLE, "ANGLE" }, \
     { DIKS_ZOOM, "ZOOM" }, \
     { DIKS_MODE, "MODE" }, \
     { DIKS_KEYBOARD, "KEYBOARD" }, \
     { DIKS_PC, "PC" }, \
     { DIKS_SCREEN, "SCREEN" }, \
     { DIKS_TV, "TV" }, \
     { DIKS_TV2, "TV2" }, \
     { DIKS_VCR, "VCR" }, \
     { DIKS_VCR2, "VCR2" }, \
     { DIKS_SAT, "SAT" }, \
     { DIKS_SAT2, "SAT2" }, \
     { DIKS_CD, "CD" }, \
     { DIKS_TAPE, "TAPE" }, \
     { DIKS_RADIO, "RADIO" }, \
     { DIKS_TUNER, "TUNER" }, \
     { DIKS_PLAYER, "PLAYER" }, \
     { DIKS_TEXT, "TEXT" }, \
     { DIKS_DVD, "DVD" }, \
     { DIKS_AUX, "AUX" }, \
     { DIKS_MP3, "MP3" }, \
     { DIKS_PHONE, "PHONE" }, \
     { DIKS_AUDIO, "AUDIO" }, \
     { DIKS_VIDEO, "VIDEO" }, \
     { DIKS_INTERNET, "INTERNET" }, \
     { DIKS_MAIL, "MAIL" }, \
     { DIKS_NEWS, "NEWS" }, \
     { DIKS_DIRECTORY, "DIRECTORY" }, \
     { DIKS_LIST, "LIST" }, \
     { DIKS_CALCULATOR, "CALCULATOR" }, \
     { DIKS_MEMO, "MEMO" }, \
     { DIKS_CALENDAR, "CALENDAR" }, \
     { DIKS_EDITOR, "EDITOR" }, \
     { DIKS_RED, "RED" }, \
     { DIKS_GREEN, "GREEN" }, \
     { DIKS_YELLOW, "YELLOW" }, \
     { DIKS_BLUE, "BLUE" }, \
     { DIKS_CHANNEL_UP, "CHANNEL_UP" }, \
     { DIKS_CHANNEL_DOWN, "CHANNEL_DOWN" }, \
     { DIKS_BACK, "BACK" }, \
     { DIKS_FORWARD, "FORWARD" }, \
     { DIKS_FIRST, "FIRST" }, \
     { DIKS_LAST, "LAST" }, \
     { DIKS_VOLUME_UP, "VOLUME_UP" }, \
     { DIKS_VOLUME_DOWN, "VOLUME_DOWN" }, \
     { DIKS_MUTE, "MUTE" }, \
     { DIKS_AB, "AB" }, \
     { DIKS_PLAYPAUSE, "PLAYPAUSE" }, \
     { DIKS_PLAY, "PLAY" }, \
     { DIKS_STOP, "STOP" }, \
     { DIKS_RESTART, "RESTART" }, \
     { DIKS_SLOW, "SLOW" }, \
     { DIKS_FAST, "FAST" }, \
     { DIKS_RECORD, "RECORD" }, \
     { DIKS_EJECT, "EJECT" }, \
     { DIKS_SHUFFLE, "SHUFFLE" }, \
     { DIKS_REWIND, "REWIND" }, \
     { DIKS_FASTFORWARD, "FASTFORWARD" }, \
     { DIKS_PREVIOUS, "PREVIOUS" }, \
     { DIKS_NEXT, "NEXT" }, \
     { DIKS_BEGIN, "BEGIN" }, \
     { DIKS_DIGITS, "DIGITS" }, \
     { DIKS_TEEN, "TEEN" }, \
     { DIKS_TWEN, "TWEN" }, \
     { DIKS_BREAK, "BREAK" }, \
     { DIKS_EXIT, "EXIT" }, \
     { DIKS_SETUP, "SETUP" }, \
     { DIKS_CURSOR_LEFT_UP, "CURSOR_LEFT_UP" }, \
     { DIKS_CURSOR_LEFT_DOWN, "CURSOR_LEFT_DOWN" }, \
     { DIKS_CURSOR_UP_RIGHT, "CURSOR_UP_RIGHT" }, \
     { DIKS_CURSOR_DOWN_RIGHT, "CURSOR_DOWN_RIGHT" }, \
     { DIKS_F1, "F1" }, \
     { DIKS_F2, "F2" }, \
     { DIKS_F3, "F3" }, \
     { DIKS_F4, "F4" }, \
     { DIKS_F5, "F5" }, \
     { DIKS_F6, "F6" }, \
     { DIKS_F7, "F7" }, \
     { DIKS_F8, "F8" }, \
     { DIKS_F9, "F9" }, \
     { DIKS_F10, "F10" }, \
     { DIKS_F11, "F11" }, \
     { DIKS_F12, "F12" }, \
     { DIKS_SHIFT, "SHIFT" }, \
     { DIKS_CONTROL, "CONTROL" }, \
     { DIKS_ALT, "ALT" }, \
     { DIKS_ALTGR, "ALTGR" }, \
     { DIKS_META, "META" }, \
     { DIKS_SUPER, "SUPER" }, \
     { DIKS_HYPER, "HYPER" }, \
     { DIKS_CAPS_LOCK, "CAPS_LOCK" }, \
     { DIKS_NUM_LOCK, "NUM_LOCK" }, \
     { DIKS_SCROLL_LOCK, "SCROLL_LOCK" }, \
     { DIKS_DEAD_ABOVEDOT, "DEAD_ABOVEDOT" }, \
     { DIKS_DEAD_ABOVERING, "DEAD_ABOVERING" }, \
     { DIKS_DEAD_ACUTE, "DEAD_ACUTE" }, \
     { DIKS_DEAD_BREVE, "DEAD_BREVE" }, \
     { DIKS_DEAD_CARON, "DEAD_CARON" }, \
     { DIKS_DEAD_CEDILLA, "DEAD_CEDILLA" }, \
     { DIKS_DEAD_CIRCUMFLEX, "DEAD_CIRCUMFLEX" }, \
     { DIKS_DEAD_DIAERESIS, "DEAD_DIAERESIS" }, \
     { DIKS_DEAD_DOUBLEACUTE, "DEAD_DOUBLEACUTE" }, \
     { DIKS_DEAD_GRAVE, "DEAD_GRAVE" }, \
     { DIKS_DEAD_IOTA, "DEAD_IOTA" }, \
     { DIKS_DEAD_MACRON, "DEAD_MACRON" }, \
     { DIKS_DEAD_OGONEK, "DEAD_OGONEK" }, \
     { DIKS_DEAD_SEMIVOICED_SOUND, "DEAD_SEMIVOICED_SOUND" }, \
     { DIKS_DEAD_TILDE, "DEAD_TILDE" }, \
     { DIKS_DEAD_VOICED_SOUND, "DEAD_VOICED_SOUND" }, \
     { DIKS_CUSTOM0, "CUSTOM0" }, \
     { DIKS_CUSTOM1, "CUSTOM1" }, \
     { DIKS_CUSTOM2, "CUSTOM2" }, \
     { DIKS_CUSTOM3, "CUSTOM3" }, \
     { DIKS_CUSTOM4, "CUSTOM4" }, \
     { DIKS_CUSTOM5, "CUSTOM5" }, \
     { DIKS_CUSTOM6, "CUSTOM6" }, \
     { DIKS_CUSTOM7, "CUSTOM7" }, \
     { DIKS_CUSTOM8, "CUSTOM8" }, \
     { DIKS_CUSTOM9, "CUSTOM9" }, \
     { DIKS_CUSTOM10, "CUSTOM10" }, \
     { DIKS_CUSTOM11, "CUSTOM11" }, \
     { DIKS_CUSTOM12, "CUSTOM12" }, \
     { DIKS_CUSTOM13, "CUSTOM13" }, \
     { DIKS_CUSTOM14, "CUSTOM14" }, \
     { DIKS_CUSTOM15, "CUSTOM15" }, \
     { DIKS_CUSTOM16, "CUSTOM16" }, \
     { DIKS_CUSTOM17, "CUSTOM17" }, \
     { DIKS_CUSTOM18, "CUSTOM18" }, \
     { DIKS_CUSTOM19, "CUSTOM19" }, \
     { DIKS_CUSTOM20, "CUSTOM20" }, \
     { DIKS_CUSTOM21, "CUSTOM21" }, \
     { DIKS_CUSTOM22, "CUSTOM22" }, \
     { DIKS_CUSTOM23, "CUSTOM23" }, \
     { DIKS_CUSTOM24, "CUSTOM24" }, \
     { DIKS_CUSTOM25, "CUSTOM25" }, \
     { DIKS_CUSTOM26, "CUSTOM26" }, \
     { DIKS_CUSTOM27, "CUSTOM27" }, \
     { DIKS_CUSTOM28, "CUSTOM28" }, \
     { DIKS_CUSTOM29, "CUSTOM29" }, \
     { DIKS_CUSTOM30, "CUSTOM30" }, \
     { DIKS_CUSTOM31, "CUSTOM31" }, \
     { DIKS_CUSTOM32, "CUSTOM32" }, \
     { DIKS_CUSTOM33, "CUSTOM33" }, \
     { DIKS_CUSTOM34, "CUSTOM34" }, \
     { DIKS_CUSTOM35, "CUSTOM35" }, \
     { DIKS_CUSTOM36, "CUSTOM36" }, \
     { DIKS_CUSTOM37, "CUSTOM37" }, \
     { DIKS_CUSTOM38, "CUSTOM38" }, \
     { DIKS_CUSTOM39, "CUSTOM39" }, \
     { DIKS_CUSTOM40, "CUSTOM40" }, \
     { DIKS_CUSTOM41, "CUSTOM41" }, \
     { DIKS_CUSTOM42, "CUSTOM42" }, \
     { DIKS_CUSTOM43, "CUSTOM43" }, \
     { DIKS_CUSTOM44, "CUSTOM44" }, \
     { DIKS_CUSTOM45, "CUSTOM45" }, \
     { DIKS_CUSTOM46, "CUSTOM46" }, \
     { DIKS_CUSTOM47, "CUSTOM47" }, \
     { DIKS_CUSTOM48, "CUSTOM48" }, \
     { DIKS_CUSTOM49, "CUSTOM49" }, \
     { DIKS_CUSTOM50, "CUSTOM50" }, \
     { DIKS_CUSTOM51, "CUSTOM51" }, \
     { DIKS_CUSTOM52, "CUSTOM52" }, \
     { DIKS_CUSTOM53, "CUSTOM53" }, \
     { DIKS_CUSTOM54, "CUSTOM54" }, \
     { DIKS_CUSTOM55, "CUSTOM55" }, \
     { DIKS_CUSTOM56, "CUSTOM56" }, \
     { DIKS_CUSTOM57, "CUSTOM57" }, \
     { DIKS_CUSTOM58, "CUSTOM58" }, \
     { DIKS_CUSTOM59, "CUSTOM59" }, \
     { DIKS_CUSTOM60, "CUSTOM60" }, \
     { DIKS_CUSTOM61, "CUSTOM61" }, \
     { DIKS_CUSTOM62, "CUSTOM62" }, \
     { DIKS_CUSTOM63, "CUSTOM63" }, \
     { DIKS_CUSTOM64, "CUSTOM64" }, \
     { DIKS_CUSTOM65, "CUSTOM65" }, \
     { DIKS_CUSTOM66, "CUSTOM66" }, \
     { DIKS_CUSTOM67, "CUSTOM67" }, \
     { DIKS_CUSTOM68, "CUSTOM68" }, \
     { DIKS_CUSTOM69, "CUSTOM69" }, \
     { DIKS_CUSTOM70, "CUSTOM70" }, \
     { DIKS_CUSTOM71, "CUSTOM71" }, \
     { DIKS_CUSTOM72, "CUSTOM72" }, \
     { DIKS_CUSTOM73, "CUSTOM73" }, \
     { DIKS_CUSTOM74, "CUSTOM74" }, \
     { DIKS_CUSTOM75, "CUSTOM75" }, \
     { DIKS_CUSTOM76, "CUSTOM76" }, \
     { DIKS_CUSTOM77, "CUSTOM77" }, \
     { DIKS_CUSTOM78, "CUSTOM78" }, \
     { DIKS_CUSTOM79, "CUSTOM79" }, \
     { DIKS_CUSTOM80, "CUSTOM80" }, \
     { DIKS_CUSTOM81, "CUSTOM81" }, \
     { DIKS_CUSTOM82, "CUSTOM82" }, \
     { DIKS_CUSTOM83, "CUSTOM83" }, \
     { DIKS_CUSTOM84, "CUSTOM84" }, \
     { DIKS_CUSTOM85, "CUSTOM85" }, \
     { DIKS_CUSTOM86, "CUSTOM86" }, \
     { DIKS_CUSTOM87, "CUSTOM87" }, \
     { DIKS_CUSTOM88, "CUSTOM88" }, \
     { DIKS_CUSTOM89, "CUSTOM89" }, \
     { DIKS_CUSTOM90, "CUSTOM90" }, \
     { DIKS_CUSTOM91, "CUSTOM91" }, \
     { DIKS_CUSTOM92, "CUSTOM92" }, \
     { DIKS_CUSTOM93, "CUSTOM93" }, \
     { DIKS_CUSTOM94, "CUSTOM94" }, \
     { DIKS_CUSTOM95, "CUSTOM95" }, \
     { DIKS_CUSTOM96, "CUSTOM96" }, \
     { DIKS_CUSTOM97, "CUSTOM97" }, \
     { DIKS_CUSTOM98, "CUSTOM98" }, \
     { DIKS_CUSTOM99, "CUSTOM99" }, \
     { DIKS_NULL, "NULL" } \
};


struct DFBKeyIdentifierName {
     DFBInputDeviceKeyIdentifier identifier;
     const char *name;
};

#define DirectFBKeyIdentifierNames(Identifier) struct DFBKeyIdentifierName Identifier[] = { \
     { DIKI_A, "A" }, \
     { DIKI_B, "B" }, \
     { DIKI_C, "C" }, \
     { DIKI_D, "D" }, \
     { DIKI_E, "E" }, \
     { DIKI_F, "F" }, \
     { DIKI_G, "G" }, \
     { DIKI_H, "H" }, \
     { DIKI_I, "I" }, \
     { DIKI_J, "J" }, \
     { DIKI_K, "K" }, \
     { DIKI_L, "L" }, \
     { DIKI_M, "M" }, \
     { DIKI_N, "N" }, \
     { DIKI_O, "O" }, \
     { DIKI_P, "P" }, \
     { DIKI_Q, "Q" }, \
     { DIKI_R, "R" }, \
     { DIKI_S, "S" }, \
     { DIKI_T, "T" }, \
     { DIKI_U, "U" }, \
     { DIKI_V, "V" }, \
     { DIKI_W, "W" }, \
     { DIKI_X, "X" }, \
     { DIKI_Y, "Y" }, \
     { DIKI_Z, "Z" }, \
     { DIKI_0, "0" }, \
     { DIKI_1, "1" }, \
     { DIKI_2, "2" }, \
     { DIKI_3, "3" }, \
     { DIKI_4, "4" }, \
     { DIKI_5, "5" }, \
     { DIKI_6, "6" }, \
     { DIKI_7, "7" }, \
     { DIKI_8, "8" }, \
     { DIKI_9, "9" }, \
     { DIKI_F1, "F1" }, \
     { DIKI_F2, "F2" }, \
     { DIKI_F3, "F3" }, \
     { DIKI_F4, "F4" }, \
     { DIKI_F5, "F5" }, \
     { DIKI_F6, "F6" }, \
     { DIKI_F7, "F7" }, \
     { DIKI_F8, "F8" }, \
     { DIKI_F9, "F9" }, \
     { DIKI_F10, "F10" }, \
     { DIKI_F11, "F11" }, \
     { DIKI_F12, "F12" }, \
     { DIKI_SHIFT_L, "SHIFT_L" }, \
     { DIKI_SHIFT_R, "SHIFT_R" }, \
     { DIKI_CONTROL_L, "CONTROL_L" }, \
     { DIKI_CONTROL_R, "CONTROL_R" }, \
     { DIKI_ALT_L, "ALT_L" }, \
     { DIKI_ALT_R, "ALT_R" }, \
     { DIKI_META_L, "META_L" }, \
     { DIKI_META_R, "META_R" }, \
     { DIKI_SUPER_L, "SUPER_L" }, \
     { DIKI_SUPER_R, "SUPER_R" }, \
     { DIKI_HYPER_L, "HYPER_L" }, \
     { DIKI_HYPER_R, "HYPER_R" }, \
     { DIKI_CAPS_LOCK, "CAPS_LOCK" }, \
     { DIKI_NUM_LOCK, "NUM_LOCK" }, \
     { DIKI_SCROLL_LOCK, "SCROLL_LOCK" }, \
     { DIKI_ESCAPE, "ESCAPE" }, \
     { DIKI_LEFT, "LEFT" }, \
     { DIKI_RIGHT, "RIGHT" }, \
     { DIKI_UP, "UP" }, \
     { DIKI_DOWN, "DOWN" }, \
     { DIKI_TAB, "TAB" }, \
     { DIKI_ENTER, "ENTER" }, \
     { DIKI_SPACE, "SPACE" }, \
     { DIKI_BACKSPACE, "BACKSPACE" }, \
     { DIKI_INSERT, "INSERT" }, \
     { DIKI_DELETE, "DELETE" }, \
     { DIKI_HOME, "HOME" }, \
     { DIKI_END, "END" }, \
     { DIKI_PAGE_UP, "PAGE_UP" }, \
     { DIKI_PAGE_DOWN, "PAGE_DOWN" }, \
     { DIKI_PRINT, "PRINT" }, \
     { DIKI_PAUSE, "PAUSE" }, \
     { DIKI_QUOTE_LEFT, "QUOTE_LEFT" }, \
     { DIKI_MINUS_SIGN, "MINUS_SIGN" }, \
     { DIKI_EQUALS_SIGN, "EQUALS_SIGN" }, \
     { DIKI_BRACKET_LEFT, "BRACKET_LEFT" }, \
     { DIKI_BRACKET_RIGHT, "BRACKET_RIGHT" }, \
     { DIKI_BACKSLASH, "BACKSLASH" }, \
     { DIKI_SEMICOLON, "SEMICOLON" }, \
     { DIKI_QUOTE_RIGHT, "QUOTE_RIGHT" }, \
     { DIKI_COMMA, "COMMA" }, \
     { DIKI_PERIOD, "PERIOD" }, \
     { DIKI_SLASH, "SLASH" }, \
     { DIKI_LESS_SIGN, "LESS_SIGN" }, \
     { DIKI_KP_DIV, "KP_DIV" }, \
     { DIKI_KP_MULT, "KP_MULT" }, \
     { DIKI_KP_MINUS, "KP_MINUS" }, \
     { DIKI_KP_PLUS, "KP_PLUS" }, \
     { DIKI_KP_ENTER, "KP_ENTER" }, \
     { DIKI_KP_SPACE, "KP_SPACE" }, \
     { DIKI_KP_TAB, "KP_TAB" }, \
     { DIKI_KP_F1, "KP_F1" }, \
     { DIKI_KP_F2, "KP_F2" }, \
     { DIKI_KP_F3, "KP_F3" }, \
     { DIKI_KP_F4, "KP_F4" }, \
     { DIKI_KP_EQUAL, "KP_EQUAL" }, \
     { DIKI_KP_SEPARATOR, "KP_SEPARATOR" }, \
     { DIKI_KP_DECIMAL, "KP_DECIMAL" }, \
     { DIKI_KP_0, "KP_0" }, \
     { DIKI_KP_1, "KP_1" }, \
     { DIKI_KP_2, "KP_2" }, \
     { DIKI_KP_3, "KP_3" }, \
     { DIKI_KP_4, "KP_4" }, \
     { DIKI_KP_5, "KP_5" }, \
     { DIKI_KP_6, "KP_6" }, \
     { DIKI_KP_7, "KP_7" }, \
     { DIKI_KP_8, "KP_8" }, \
     { DIKI_KP_9, "KP_9" }, \
     { DIKI_UNKNOWN, "UNKNOWN" } \
};

#endif
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb.h������������������������������������������������������������������0000644�0001750�0001750�00000662707�11307512434�013536� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIRECTFB_H__
#define __DIRECTFB_H__


#ifdef __cplusplus
extern "C"
{
#endif

#include <dfb_types.h>
#include <sys/time.h> /* struct timeval */

#include <directfb_keyboard.h>

#include <direct/interface.h>

/*
 * Version handling.
 */
extern const unsigned int directfb_major_version;
extern const unsigned int directfb_minor_version;
extern const unsigned int directfb_micro_version;
extern const unsigned int directfb_binary_age;
extern const unsigned int directfb_interface_age;

/*
 * Check for a certain DirectFB version.
 * In case of an error a message is returned describing the mismatch.
 */
const char * DirectFBCheckVersion( unsigned int required_major,
                                   unsigned int required_minor,
                                   unsigned int required_micro );


/*
 * Main interface of DirectFB, created by DirectFBCreate().
 */
DECLARE_INTERFACE( IDirectFB )

/*
 * Interface to a surface object, being a graphics context for rendering and state control,
 * buffer operations, palette access and sub area translate'n'clip logic.
 */
DECLARE_INTERFACE( IDirectFBSurface )

/*
 * Interface for read/write access to the colors of a palette object and for cloning it.
 */
DECLARE_INTERFACE( IDirectFBPalette )

/*
 * Input device interface for keymap access, event buffers and state queries.
 */
DECLARE_INTERFACE( IDirectFBInputDevice )

/*
 * Layer interface for configuration, window stack usage or direct surface access, with shared/exclusive context.
 */
DECLARE_INTERFACE( IDirectFBDisplayLayer )

/*
 * Interface to a window object, controlling appearance and focus, positioning and stacking,
 * event buffers and surface access.
 */
DECLARE_INTERFACE( IDirectFBWindow )

/*
 * Interface to a local event buffer to send/receive events, wait for events, abort waiting or reset buffer.
 */
DECLARE_INTERFACE( IDirectFBEventBuffer )

/*
 * Font interface for getting metrics, measuring strings or single characters, query/choose encodings.
 */
DECLARE_INTERFACE( IDirectFBFont )

/*
 * Interface to an image provider, retrieving information about the image and rendering it to a surface.
 */
DECLARE_INTERFACE( IDirectFBImageProvider )

/*
 * Interface to a video provider for playback with advanced control and basic stream information.
 */
DECLARE_INTERFACE( IDirectFBVideoProvider )

/*
 * Data buffer interface, providing unified access to different kinds of data storage and live feed.
 */
DECLARE_INTERFACE( IDirectFBDataBuffer )

/*
 * Interface to different display outputs, encoders, connector settings, power management and synchronization.
 */
DECLARE_INTERFACE( IDirectFBScreen )

/*
 * OpenGL context of a surface.
 */
DECLARE_INTERFACE( IDirectFBGL )


/*
 * Return code of all interface methods and most functions
 *
 * Whenever a method has to return any information, it is done via output parameters. These are pointers to
 * primitive types such as <i>int *ret_num</i>, enumerated types like <i>DFBBoolean *ret_enabled</i>, structures
 * as in <i>DFBDisplayLayerConfig *ret_config</i>, just <i>void **ret_data</i> or other types...
 */
typedef enum {
     /*
      * Aliases for backward compatibility and uniform look in DirectFB code
      */
     DFB_OK              = DR_OK,                 /* No error occured. */
     DFB_FAILURE         = DR_FAILURE,            /* A general or unknown error occured. */
     DFB_INIT            = DR_INIT,               /* A general initialization error occured. */
     DFB_BUG             = DR_BUG,                /* Internal bug or inconsistency has been detected. */
     DFB_DEAD            = DR_DEAD,               /* Interface has a zero reference counter (available in debug mode). */
     DFB_UNSUPPORTED     = DR_UNSUPPORTED,        /* The requested operation or an argument is (currently) not supported. */
     DFB_UNIMPLEMENTED   = DR_UNIMPLEMENTED,      /* The requested operation is not implemented, yet. */
     DFB_ACCESSDENIED    = DR_ACCESSDENIED,       /* Access to the resource is denied. */
     DFB_INVAREA         = DR_INVAREA,            /* An invalid area has been specified or detected. */
     DFB_INVARG          = DR_INVARG,             /* An invalid argument has been specified. */
     DFB_NOSYSTEMMEMORY  = DR_NOLOCALMEMORY,      /* There's not enough system memory. */
     DFB_NOSHAREDMEMORY  = DR_NOSHAREDMEMORY,     /* There's not enough shared memory. */
     DFB_LOCKED          = DR_LOCKED,             /* The resource is (already) locked. */
     DFB_BUFFEREMPTY     = DR_BUFFEREMPTY,        /* The buffer is empty. */
     DFB_FILENOTFOUND    = DR_FILENOTFOUND,       /* The specified file has not been found. */
     DFB_IO              = DR_IO,                 /* A general I/O error occured. */
     DFB_BUSY            = DR_BUSY,               /* The resource or device is busy. */
     DFB_NOIMPL          = DR_NOIMPL,             /* No implementation for this interface or content type has been found. */
     DFB_TIMEOUT         = DR_TIMEOUT,            /* The operation timed out. */
     DFB_THIZNULL        = DR_THIZNULL,           /* 'thiz' pointer is NULL. */
     DFB_IDNOTFOUND      = DR_IDNOTFOUND,         /* No resource has been found by the specified id. */
     DFB_DESTROYED       = DR_DESTROYED,          /* The underlying object (e.g. a window or surface) has been destroyed. */
     DFB_FUSION          = DR_FUSION,             /* Internal fusion error detected, most likely related to IPC resources. */
     DFB_BUFFERTOOLARGE  = DR_BUFFERTOOLARGE,     /* Buffer is too large. */
     DFB_INTERRUPTED     = DR_INTERRUPTED,        /* The operation has been interrupted. */
     DFB_NOCONTEXT       = DR_NOCONTEXT,          /* No context available. */
     DFB_TEMPUNAVAIL     = DR_TEMPUNAVAIL,        /* Temporarily unavailable. */
     DFB_LIMITEXCEEDED   = DR_LIMITEXCEEDED,      /* Attempted to exceed limit, i.e. any kind of maximum size, count etc. */
     DFB_NOSUCHMETHOD    = DR_NOSUCHMETHOD,       /* Requested method is not known, e.g. to remote site. */
     DFB_NOSUCHINSTANCE  = DR_NOSUCHINSTANCE,     /* Requested instance is not known, e.g. to remote site. */
     DFB_ITEMNOTFOUND    = DR_ITEMNOTFOUND,       /* No such item found. */
     DFB_VERSIONMISMATCH = DR_VERSIONMISMATCH,    /* Some versions didn't match. */
     DFB_EOF             = DR_EOF,                /* Reached end of file. */
     DFB_SUSPENDED       = DR_SUSPENDED,          /* The requested object is suspended. */
     DFB_INCOMPLETE      = DR_INCOMPLETE,         /* The operation has been executed, but not completely. */
     DFB_NOCORE          = DR_NOCORE,             /* Core part not available. */

     /*
      * DirectFB specific result codes starting at (after) this offset
      */
     DFB__RESULT_OFFSET  = D_RESULT_TYPE_BASE( 'D','F','B' ),

     DFB_NOVIDEOMEMORY,  /* There's not enough video memory. */
     DFB_MISSINGFONT,    /* No font has been set. */
     DFB_MISSINGIMAGE,   /* No image has been set. */
} DFBResult;

/*
 * A boolean.
 */
typedef enum {
     DFB_FALSE = 0,
     DFB_TRUE  = !DFB_FALSE
} DFBBoolean;

/*
 * A point specified by x/y coordinates.
 */
typedef struct {
     int            x;   /* X coordinate of it */
     int            y;   /* Y coordinate of it */
} DFBPoint;

/*
 * A horizontal line specified by x and width.
 */
typedef struct {
     int            x;   /* X coordinate */
     int            w;   /* width of span */
} DFBSpan;

/*
 * A dimension specified by width and height.
 */
typedef struct {
     int            w;   /* width of it */
     int            h;   /* height of it */
} DFBDimension;

/*
 * A rectangle specified by a point and a dimension.
 */
typedef struct {
     int            x;   /* X coordinate of its top-left point */
     int            y;   /* Y coordinate of its top-left point */
     int            w;   /* width of it */
     int            h;   /* height of it */
} DFBRectangle;

/*
 * A rectangle specified by normalized coordinates.
 *
 * E.g. using 0.0, 0.0, 1.0, 1.0 would specify the whole screen.
 */
typedef struct {
     float          x;   /* normalized X coordinate */
     float          y;   /* normalized Y coordinate */
     float          w;   /* normalized width */
     float          h;   /* normalized height */
} DFBLocation;

/*
 * A region specified by two points.
 *
 * The defined region includes both endpoints.
 */
typedef struct {
     int            x1;  /* X coordinate of top-left point */
     int            y1;  /* Y coordinate of top-left point */
     int            x2;  /* X coordinate of lower-right point */
     int            y2;  /* Y coordinate of lower-right point */
} DFBRegion;

/*
 * Insets specify a distance from each edge of a rectangle.
 *
 * Positive values always mean 'outside'.
 */
typedef struct {
     int            l;   /* distance from left edge */
     int            t;   /* distance from top edge */
     int            r;   /* distance from right edge */
     int            b;   /* distance from bottom edge */
} DFBInsets;

/*
 * A triangle specified by three points.
 */
typedef struct {
     int            x1;  /* X coordinate of first edge */
     int            y1;  /* Y coordinate of first edge */
     int            x2;  /* X coordinate of second edge */
     int            y2;  /* Y coordinate of second edge */
     int            x3;  /* X coordinate of third edge */
     int            y3;  /* Y coordinate of third edge */
} DFBTriangle;

/*
 * A color defined by channels with 8bit each.
 */
typedef struct {
     u8             a;   /* alpha channel */
     u8             r;   /* red channel */
     u8             g;   /* green channel */
     u8             b;   /* blue channel */
} DFBColor;

/*
 * A color key defined by R,G,B and eventually a color index.
 */
typedef struct {
     u8             index;    /* color index */
     u8             r;        /* red channel */
     u8             g;        /* green channel */
     u8             b;        /* blue channel */
} DFBColorKey;

/*
 * A color defined by channels with 8bit each.
 */
typedef struct {
     u8             a;   /* alpha channel */
     u8             y;   /* luma channel */
     u8             u;   /* chroma channel */
     u8             v;   /* chroma channel */
} DFBColorYUV;

/*
 * Macro to compare two points.
 */
#define DFB_POINT_EQUAL(a,b)  ((a).x == (b).x &&  \
                               (a).y == (b).y)

/*
 * Macro to compare two rectangles.
 */
#define DFB_RECTANGLE_EQUAL(a,b)  ((a).x == (b).x &&  \
                                   (a).y == (b).y &&  \
                                   (a).w == (b).w &&  \
                                   (a).h == (b).h)

/*
 * Macro to compare two locations.
 */
#define DFB_LOCATION_EQUAL(a,b)  ((a).x == (b).x &&  \
                                  (a).y == (b).y &&  \
                                  (a).w == (b).w &&  \
                                  (a).h == (b).h)

/*
 * Macro to compare two regions.
 */
#define DFB_REGION_EQUAL(a,b)  ((a).x1 == (b).x1 &&  \
                                (a).y1 == (b).y1 &&  \
                                (a).x2 == (b).x2 &&  \
                                (a).y2 == (b).y2)

/*
 * Macro to compare two colors.
 */
#define DFB_COLOR_EQUAL(x,y)  ((x).a == (y).a &&  \
                               (x).r == (y).r &&  \
                               (x).g == (y).g &&  \
                               (x).b == (y).b)

/*
 * Macro to compare two color keys.
 */
#define DFB_COLORKEY_EQUAL(x,y) ((x).index == (y).index &&  \
                                 (x).r == (y).r &&  \
                                 (x).g == (y).g &&  \
                                 (x).b == (y).b)

/*
 * Print a description of the result code along with an
 * optional message that is put in front with a colon.
 */
DFBResult DirectFBError(
                             const char  *msg,    /* optional message */
                             DFBResult    result  /* result code to interpret */
                       );

/*
 * Behaves like DirectFBError, but shuts down the calling application.
 */
DFBResult DirectFBErrorFatal(
                             const char  *msg,    /* optional message */
                             DFBResult    result  /* result code to interpret */
                            );

/*
 * Returns a string describing 'result'.
 */
const char *DirectFBErrorString(
                         DFBResult    result
                      );

/*
 * Retrieves information about supported command-line flags in the
 * form of a user-readable string formatted suitable to be printed
 * as usage information.
 */
const char *DirectFBUsageString( void );

/*
 * Parses the command-line and initializes some variables. You
 * absolutely need to call this before doing anything else.
 * Removes all options used by DirectFB from argv.
 */
DFBResult DirectFBInit(
                         int         *argc,    /* pointer to main()'s argc */
                         char      *(*argv[])  /* pointer to main()'s argv */
                      );

/*
 * Sets configuration parameters supported on command line and in
 * config file. Can only be called before DirectFBCreate but after
 * DirectFBInit.
 */
DFBResult DirectFBSetOption(
                         const char  *name,
                         const char  *value
                      );

/*
 * Creates the super interface.
 */
DFBResult DirectFBCreate(
                          IDirectFB **interface  /* pointer to the
                                                    created interface */
                        );


typedef unsigned int DFBScreenID;
typedef unsigned int DFBDisplayLayerID;
typedef unsigned int DFBDisplayLayerSourceID;
typedef unsigned int DFBWindowID;
typedef unsigned int DFBInputDeviceID;
typedef unsigned int DFBTextEncodingID;

typedef u32 DFBDisplayLayerIDs;

/*
 * Maximum number of layer ids.
 */
#define DFB_DISPLAYLAYER_IDS_MAX             32

/*
 * Adds the id to the bitmask of layer ids.
 */
#define DFB_DISPLAYLAYER_IDS_ADD(ids,id)     (ids) |=  (1 << (id))

/*
 * Removes the id from the bitmask of layer ids.
 */
#define DFB_DISPLAYLAYER_IDS_REMOVE(ids,id)  (ids) &= ~(1 << (id))

/*
 * Checks if the bitmask of layer ids contains the id.
 */
#define DFB_DISPLAYLAYER_IDS_HAVE(ids,id)    ((ids) & (1 << (id)))

/*
 * Empties (clears) the bitmask of layer ids.
 */
#define DFB_DISPLAYLAYER_IDS_EMPTY(ids)      (ids) = 0

/*
 * Predefined text encoding IDs.
 */
#define DTEID_UTF8  0
#define DTEID_OTHER 1

/*
 * The cooperative level controls the super interface's behaviour
 * in functions like SetVideoMode or CreateSurface for the primary.
 */
typedef enum {
     DFSCL_NORMAL        = 0x00000000,  /* Normal shared access, primary
                                           surface will be the buffer of an
                                           implicitly created window at the
                                           resolution given by SetVideoMode().
                                           */
     DFSCL_FULLSCREEN,                  /* Application grabs the primary layer,
                                           SetVideoMode automates layer
                                           control. Primary surface is the
                                           primary layer surface. */
     DFSCL_EXCLUSIVE                    /* All but the primary layer will be
                                           disabled, the application has full
                                           control over layers if desired,
                                           other applications have no
                                           input/output/control. Primary
                                           surface is the primary layer
                                           surface. */
} DFBCooperativeLevel;

/*
 * Capabilities of a display layer.
 */
typedef enum {
     DLCAPS_NONE              = 0x00000000,

     DLCAPS_SURFACE           = 0x00000001,  /* The layer has a surface that can be drawn to. This
                                                may not be provided by layers that display realtime
                                                data, e.g. from an MPEG decoder chip. Playback
                                                control may be provided by an external API. */
     DLCAPS_OPACITY           = 0x00000002,  /* The layer supports blending with layer(s) below
                                                based on a global alpha factor. */
     DLCAPS_ALPHACHANNEL      = 0x00000004,  /* The layer supports blending with layer(s) below
                                                based on each pixel's alpha value. */
     DLCAPS_SCREEN_LOCATION   = 0x00000008,  /* The layer location on the screen can be changed,
                                                this includes position and size as normalized
                                                values. The default is 0.0f, 0.0f, 1.0f, 1.0f. */
     DLCAPS_FLICKER_FILTERING = 0x00000010,  /* Flicker filtering can be enabled for smooth output
                                                on interlaced display devices. */
     DLCAPS_DEINTERLACING     = 0x00000020,  /* The layer provides optional deinterlacing for
                                                displaying interlaced video data on progressive
                                                display devices. */
     DLCAPS_SRC_COLORKEY      = 0x00000040,  /* A specific color can be declared as transparent. */
     DLCAPS_DST_COLORKEY      = 0x00000080,  /* A specific color of layers below can be specified
                                                as the color of the only locations where the layer
                                                is visible. */
     DLCAPS_BRIGHTNESS        = 0x00000100,  /* Adjustment of brightness is supported. */
     DLCAPS_CONTRAST          = 0x00000200,  /* Adjustment of contrast is supported. */
     DLCAPS_HUE               = 0x00000400,  /* Adjustment of hue is supported. */
     DLCAPS_SATURATION        = 0x00000800,  /* Adjustment of saturation is supported. */
     DLCAPS_LEVELS            = 0x00001000,  /* Adjustment of the layer's level
                                                (z position) is supported. */
     DLCAPS_FIELD_PARITY      = 0x00002000,  /* Field parity can be selected */
     DLCAPS_WINDOWS           = 0x00004000,  /* Hardware window support. */
     DLCAPS_SOURCES           = 0x00008000,  /* Sources can be selected. */
     DLCAPS_ALPHA_RAMP        = 0x00010000,  /* Alpha values for formats with one or two alpha bits
                                                can be chosen, i.e. using ARGB1555 or ARGB2554 the
                                                user can define the meaning of the two or four
                                                possibilities. In short, this feature provides a
                                                lookup table for the alpha bits of these formats.
                                                See also IDirectFBSurface::SetAlphaRamp(). */
     DLCAPS_PREMULTIPLIED     = 0x00020000,  /* Surfaces with premultiplied alpha are supported. */

     DLCAPS_SCREEN_POSITION   = 0x00100000,
     DLCAPS_SCREEN_SIZE       = 0x00200000,

     DLCAPS_CLIP_REGIONS      = 0x00400000,  /* Supports IDirectFBDisplayLayer::SetClipRegions(). */

     DLCAPS_ALL               = 0x0073FFFF
} DFBDisplayLayerCapabilities;

/*
 * Capabilities of a screen.
 */
typedef enum {
     DSCCAPS_NONE             = 0x00000000,

     DSCCAPS_VSYNC            = 0x00000001,  /* Synchronization with the
                                                vertical retrace supported. */
     DSCCAPS_POWER_MANAGEMENT = 0x00000002,  /* Power management supported. */

     DSCCAPS_MIXERS           = 0x00000010,  /* Has mixers. */
     DSCCAPS_ENCODERS         = 0x00000020,  /* Has encoders. */
     DSCCAPS_OUTPUTS          = 0x00000040,  /* Has outputs. */

     DSCCAPS_ALL              = 0x00000073
} DFBScreenCapabilities;

/*
 * Used to enable some capabilities like flicker filtering or colorkeying.
 */
typedef enum {
     DLOP_NONE                = 0x00000000,  /* None of these. */
     DLOP_ALPHACHANNEL        = 0x00000001,  /* Make usage of alpha channel
                                                for blending on a pixel per
                                                pixel basis. */
     DLOP_FLICKER_FILTERING   = 0x00000002,  /* Enable flicker filtering. */
     DLOP_DEINTERLACING       = 0x00000004,  /* Enable deinterlacing of an
                                                interlaced (video) source. */
     DLOP_SRC_COLORKEY        = 0x00000008,  /* Enable source color key. */
     DLOP_DST_COLORKEY        = 0x00000010,  /* Enable dest. color key. */
     DLOP_OPACITY             = 0x00000020,  /* Make usage of the global alpha
                                                factor set by SetOpacity. */
     DLOP_FIELD_PARITY        = 0x00000040   /* Set field parity */
} DFBDisplayLayerOptions;

/*
 * Layer Buffer Mode.
 */
typedef enum {
     DLBM_UNKNOWN    = 0x00000000,

     DLBM_FRONTONLY  = 0x00000001,      /* no backbuffer */
     DLBM_BACKVIDEO  = 0x00000002,      /* backbuffer in video memory */
     DLBM_BACKSYSTEM = 0x00000004,      /* backbuffer in system memory */
     DLBM_TRIPLE     = 0x00000008,      /* triple buffering */
     DLBM_WINDOWS    = 0x00000010       /* no layer buffers at all,
                                           using buffer of each window */
} DFBDisplayLayerBufferMode;

/*
 * Flags defining which fields of a DFBSurfaceDescription are valid.
 */
typedef enum {
     DSDESC_NONE         = 0x00000000,  /* none of these */

     DSDESC_CAPS         = 0x00000001,  /* caps field is valid */
     DSDESC_WIDTH        = 0x00000002,  /* width field is valid */
     DSDESC_HEIGHT       = 0x00000004,  /* height field is valid */
     DSDESC_PIXELFORMAT  = 0x00000008,  /* pixelformat field is valid */
     DSDESC_PREALLOCATED = 0x00000010,  /* Surface uses data that has been
                                           preallocated by the application.
                                           The field array 'preallocated'
                                           has to be set using the first
                                           element for the front buffer
                                           and eventually the second one
                                           for the back buffer. */
     DSDESC_PALETTE      = 0x00000020,  /* Initialize the surfaces palette
                                           with the entries specified in the
                                           description. */

     DSDESC_RESOURCE_ID  = 0x00000100,  /* user defined resource id for general purpose
                                           surfaces is specified, or resource id of window,
                                           layer, user is returned */

     DSDESC_ALL          = 0x0000013F   /* all of these */
} DFBSurfaceDescriptionFlags;

/*
 * Flags defining which fields of a DFBPaletteDescription are valid.
 */
typedef enum {
     DPDESC_CAPS         = 0x00000001,  /* Specify palette capabilities. */
     DPDESC_SIZE         = 0x00000002,  /* Specify number of entries. */
     DPDESC_ENTRIES      = 0x00000004   /* Initialize the palette with the
                                           entries specified in the
                                           description. */
} DFBPaletteDescriptionFlags;

/*
 * The surface capabilities.
 */
typedef enum {
     DSCAPS_NONE          = 0x00000000,  /* None of these. */

     DSCAPS_PRIMARY       = 0x00000001,  /* It's the primary surface. */
     DSCAPS_SYSTEMONLY    = 0x00000002,  /* Surface data is permanently stored in system memory.<br>
                                            There's no video memory allocation/storage. */
     DSCAPS_VIDEOONLY     = 0x00000004,  /* Surface data is permanently stored in video memory.<br>
                                            There's no system memory allocation/storage. */
     DSCAPS_DOUBLE        = 0x00000010,  /* Surface is double buffered */
     DSCAPS_SUBSURFACE    = 0x00000020,  /* Surface is just a sub area of another
                                            one sharing the surface data. */
     DSCAPS_INTERLACED    = 0x00000040,  /* Each buffer contains interlaced video (or graphics)
                                            data consisting of two fields.<br>
                                            Their lines are stored interleaved. One field's height
                                            is a half of the surface's height. */
     DSCAPS_SEPARATED     = 0x00000080,  /* For usage with DSCAPS_INTERLACED.<br>
                                            DSCAPS_SEPARATED specifies that the fields are NOT
                                            interleaved line by line in the buffer.<br>
                                            The first field is followed by the second one. */
     DSCAPS_STATIC_ALLOC  = 0x00000100,  /* The amount of video or system memory allocated for the
                                            surface is never less than its initial value. This way
                                            a surface can be resized (smaller and bigger up to the
                                            initial size) without reallocation of the buffers. It's
                                            useful for surfaces that need a guaranteed space in
                                            video memory after resizing. */
     DSCAPS_TRIPLE        = 0x00000200,  /* Surface is triple buffered. */

     DSCAPS_PREMULTIPLIED = 0x00001000,  /* Surface stores data with premultiplied alpha. */

     DSCAPS_DEPTH         = 0x00010000,  /* A depth buffer is allocated. */

     DSCAPS_SHARED        = 0x00100000,  /* The surface will be accessible among processes. */

     DSCAPS_ALL           = 0x001113F7,  /* All of these. */


     DSCAPS_FLIPPING      = DSCAPS_DOUBLE | DSCAPS_TRIPLE /* Surface needs Flip() calls to make
                                                             updates/changes visible/usable. */
} DFBSurfaceCapabilities;

/*
 * The palette capabilities.
 */
typedef enum {
     DPCAPS_NONE         = 0x00000000   /* None of these. */
} DFBPaletteCapabilities;

/*
 * Flags controlling drawing commands.
 */
typedef enum {
     DSDRAW_NOFX               = 0x00000000, /* uses none of the effects */
     DSDRAW_BLEND              = 0x00000001, /* uses alpha from color */
     DSDRAW_DST_COLORKEY       = 0x00000002, /* write to destination only if the destination pixel
                                                matches the destination color key */
     DSDRAW_SRC_PREMULTIPLY    = 0x00000004, /* multiplies the color's rgb channels by the alpha
                                                channel before drawing */
     DSDRAW_DST_PREMULTIPLY    = 0x00000008, /* modulates the dest. color with the dest. alpha */
     DSDRAW_DEMULTIPLY         = 0x00000010, /* divides the color by the alpha before writing the
                                                data to the destination */
     DSDRAW_XOR                = 0x00000020  /* bitwise xor the destination pixels with the
                                                specified color after premultiplication */
} DFBSurfaceDrawingFlags;

/*
 * Flags controlling blitting commands.
 */
typedef enum {
     DSBLIT_NOFX               = 0x00000000, /* uses none of the effects */
     DSBLIT_BLEND_ALPHACHANNEL = 0x00000001, /* enables blending and uses
                                                alphachannel from source */
     DSBLIT_BLEND_COLORALPHA   = 0x00000002, /* enables blending and uses
                                                alpha value from color */
     DSBLIT_COLORIZE           = 0x00000004, /* modulates source color with
                                                the color's r/g/b values */
     DSBLIT_SRC_COLORKEY       = 0x00000008, /* don't blit pixels matching the source color key */
     DSBLIT_DST_COLORKEY       = 0x00000010, /* write to destination only if the destination pixel
                                                matches the destination color key */
     DSBLIT_SRC_PREMULTIPLY    = 0x00000020, /* modulates the source color with the (modulated)
                                                source alpha */
     DSBLIT_DST_PREMULTIPLY    = 0x00000040, /* modulates the dest. color with the dest. alpha */
     DSBLIT_DEMULTIPLY         = 0x00000080, /* divides the color by the alpha before writing the
                                                data to the destination */
     DSBLIT_DEINTERLACE        = 0x00000100, /* deinterlaces the source during blitting by reading
                                                only one field (every second line of full
                                                image) scaling it vertically by factor two */
     DSBLIT_SRC_PREMULTCOLOR   = 0x00000200, /* modulates the source color with the color alpha */
     DSBLIT_XOR                = 0x00000400, /* bitwise xor the destination pixels with the
                                                source pixels after premultiplication */
     DSBLIT_INDEX_TRANSLATION  = 0x00000800, /* do fast indexed to indexed translation,
                                                this flag is mutual exclusive with all others */
     DSBLIT_ROTATE180          = 0x00001000, /* rotate the image by 180 degree */
     DSBLIT_COLORKEY_PROTECT   = 0x00010000, /* make sure written pixels don't match color key (internal only ATM) */
     DSBLIT_SRC_MASK_ALPHA     = 0x00100000, /* modulate source alpha channel with alpha channel from source mask,
                                                see also IDirectFBSurface::SetSourceMask() */
     DSBLIT_SRC_MASK_COLOR     = 0x00200000, /* modulate source color channels with color channels from source mask,
                                                see also IDirectFBSurface::SetSourceMask() */
} DFBSurfaceBlittingFlags;

/*
 * Options for drawing and blitting operations. Not mandatory for acceleration.
 */
typedef enum {
     DSRO_NONE                 = 0x00000000, /* None of these. */

     DSRO_SMOOTH_UPSCALE       = 0x00000001, /* Use interpolation for upscale StretchBlit(). */
     DSRO_SMOOTH_DOWNSCALE     = 0x00000002, /* Use interpolation for downscale StretchBlit(). */
     DSRO_MATRIX               = 0x00000004, /* Use the transformation matrix set via IDirectFBSurface::SetMatrix(). */
     DSRO_ANTIALIAS            = 0x00000008, /* Enable anti-aliasing for edges (alphablend must be enabled). */

     DSRO_ALL                  = 0x0000000F  /* All of these. */
} DFBSurfaceRenderOptions;

/*
 * Mask of accelerated functions.
 */
typedef enum {
     DFXL_NONE           = 0x00000000,  /* None of these. */

     DFXL_FILLRECTANGLE  = 0x00000001,  /* FillRectangle() is accelerated. */
     DFXL_DRAWRECTANGLE  = 0x00000002,  /* DrawRectangle() is accelerated. */
     DFXL_DRAWLINE       = 0x00000004,  /* DrawLine() is accelerated. */
     DFXL_FILLTRIANGLE   = 0x00000008,  /* FillTriangle() is accelerated. */

     DFXL_BLIT           = 0x00010000,  /* Blit() and TileBlit() are accelerated. */
     DFXL_STRETCHBLIT    = 0x00020000,  /* StretchBlit() is accelerated. */
     DFXL_TEXTRIANGLES   = 0x00040000,  /* TextureTriangles() is accelerated. */

     DFXL_DRAWSTRING     = 0x01000000,  /* DrawString() and DrawGlyph() are accelerated. */


     DFXL_ALL            = 0x0107000F,  /* All drawing/blitting functions. */
     DFXL_ALL_DRAW       = 0x0000000F,  /* All drawing functions. */
     DFXL_ALL_BLIT       = 0x01070000,  /* All blitting functions. */
} DFBAccelerationMask;


/*
 * @internal
 */
#define DFB_DRAWING_FUNCTION(a)    ((a) & 0x0000FFFF)

/*
 * @internal
 */
#define DFB_BLITTING_FUNCTION(a)   ((a) & 0xFFFF0000)

/*
 * Type of display layer for basic classification.
 * Values may be or'ed together.
 */
typedef enum {
     DLTF_NONE           = 0x00000000,  /* Unclassified, no specific type. */

     DLTF_GRAPHICS       = 0x00000001,  /* Can be used for graphics output. */
     DLTF_VIDEO          = 0x00000002,  /* Can be used for live video output.*/
     DLTF_STILL_PICTURE  = 0x00000004,  /* Can be used for single frames. */
     DLTF_BACKGROUND     = 0x00000008,  /* Can be used as a background layer.*/

     DLTF_ALL            = 0x0000000F   /* All type flags set. */
} DFBDisplayLayerTypeFlags;

/*
 * Type of input device for basic classification.
 * Values may be or'ed together.
 */
typedef enum {
     DIDTF_NONE          = 0x00000000,  /* Unclassified, no specific type. */

     DIDTF_KEYBOARD      = 0x00000001,  /* Can act as a keyboard. */
     DIDTF_MOUSE         = 0x00000002,  /* Can be used as a mouse. */
     DIDTF_JOYSTICK      = 0x00000004,  /* Can be used as a joystick. */
     DIDTF_REMOTE        = 0x00000008,  /* Is a remote control. */
     DIDTF_VIRTUAL       = 0x00000010,  /* Is a virtual input device. */

     DIDTF_ALL           = 0x0000001F   /* All type flags set. */
} DFBInputDeviceTypeFlags;

/*
 * Basic input device features.
 */
typedef enum {
     DICAPS_KEYS         = 0x00000001,  /* device supports key events */
     DICAPS_AXES         = 0x00000002,  /* device supports axis events */
     DICAPS_BUTTONS      = 0x00000004,  /* device supports button events */

     DICAPS_ALL          = 0x00000007   /* all capabilities */
} DFBInputDeviceCapabilities;

/*
 * Identifier (index) for e.g. mouse or joystick buttons.
 */
typedef enum {
     DIBI_LEFT           = 0x00000000,  /* left mouse button */
     DIBI_RIGHT          = 0x00000001,  /* right mouse button */
     DIBI_MIDDLE         = 0x00000002,  /* middle mouse button */

     DIBI_FIRST          = DIBI_LEFT,   /* other buttons:
                                           DIBI_FIRST + zero based index */
     DIBI_LAST           = 0x0000001F   /* 32 buttons maximum */
} DFBInputDeviceButtonIdentifier;

/*
 * Axis identifier (index) for e.g. mouse or joystick.
 *
 * The X, Y and Z axis are predefined. To access other axes,
 * use DIAI_FIRST plus a zero based index, e.g. the 4th axis
 * would be (DIAI_FIRST + 3).
 */
typedef enum {
     DIAI_X              = 0x00000000,  /* X axis */
     DIAI_Y              = 0x00000001,  /* Y axis */
     DIAI_Z              = 0x00000002,  /* Z axis */

     DIAI_FIRST          = DIAI_X,      /* other axis:
                                           DIAI_FIRST + zero based index */
     DIAI_LAST           = 0x0000001F   /* 32 axes maximum */
} DFBInputDeviceAxisIdentifier;

/*
 * Flags defining which fields of a DFBWindowDescription are valid.
 */
typedef enum {
     DWDESC_CAPS         = 0x00000001,  /* caps field is valid */
     DWDESC_WIDTH        = 0x00000002,  /* width field is valid */
     DWDESC_HEIGHT       = 0x00000004,  /* height field is valid */
     DWDESC_PIXELFORMAT  = 0x00000008,  /* pixelformat field is valid */
     DWDESC_POSX         = 0x00000010,  /* posx field is valid */
     DWDESC_POSY         = 0x00000020,  /* posy field is valid */
     DWDESC_SURFACE_CAPS = 0x00000040,  /* Create the window surface with
                                           special capabilities. */
     DWDESC_PARENT       = 0x00000080,  /* This window has a parent according to parent_id field. */
     DWDESC_OPTIONS      = 0x00000100,  /* Initial window options have been set. */
     DWDESC_STACKING     = 0x00000200,  /* Initial stacking class has been set. */

     DWDESC_RESOURCE_ID  = 0x00001000,  /* Resource id for window surface creation has been set. */
} DFBWindowDescriptionFlags;

/*
 * Flags defining which fields of a DFBDataBufferDescription are valid.
 */
typedef enum {
     DBDESC_FILE         = 0x00000001,  /* Create a static buffer for the
                                           specified filename. */
     DBDESC_MEMORY       = 0x00000002   /* Create a static buffer for the
                                           specified memory area. */
} DFBDataBufferDescriptionFlags;

/*
 * Capabilities a window can have.
 */
typedef enum {
     DWCAPS_NONE         = 0x00000000,  /* None of these. */
     DWCAPS_ALPHACHANNEL = 0x00000001,  /* The window has an alphachannel
                                           for pixel-per-pixel blending. */
     DWCAPS_DOUBLEBUFFER = 0x00000002,  /* The window's surface is double
                                           buffered. This is very useful
                                           to avoid visibility of content
                                           that is still in preparation.
                                           Normally a window's content can
                                           get visible before an update if
                                           there is another reason causing
                                           a window stack repaint. */
     DWCAPS_INPUTONLY    = 0x00000004,  /* The window has no surface.
                                           You can not draw to it but it
                                           receives events */
     DWCAPS_NODECORATION = 0x00000008,  /* The window won't be decorated. */

     DWCAPS_COLOR        = 0x00000020,  /* The window has no buffer;
                                           it consumes no backing store.
                                           It is filled with a constant color
                                           and it receives events */

     DWCAPS_NOFOCUS      = 0x00000100,  /* Window will never get focus or receive key events, unless it grabs them. */

     DWCAPS_ALL          = 0x0000012F   /* All of these. */
} DFBWindowCapabilities;

/*
 * Flags controlling the appearance and behaviour of the window.
 */
typedef enum {
     DWOP_NONE           = 0x00000000,  /* none of these */
     DWOP_COLORKEYING    = 0x00000001,  /* enable color key */
     DWOP_ALPHACHANNEL   = 0x00000002,  /* enable alpha blending using the
                                           window's alpha channel */
     DWOP_OPAQUE_REGION  = 0x00000004,  /* overrides DWOP_ALPHACHANNEL for the
                                           region set by SetOpaqueRegion() */
     DWOP_SHAPED         = 0x00000008,  /* window doesn't receive mouse events for
                                           invisible regions, must be used with
                                           DWOP_ALPHACHANNEL or DWOP_COLORKEYING */
     DWOP_KEEP_POSITION  = 0x00000010,  /* window can't be moved
                                           with the mouse */
     DWOP_KEEP_SIZE      = 0x00000020,  /* window can't be resized
                                           with the mouse */
     DWOP_KEEP_STACKING  = 0x00000040,  /* window can't be raised
                                           or lowered with the mouse */
     DWOP_GHOST          = 0x00001000,  /* never get focus or input,
                                           clicks will go through,
                                           implies DWOP_KEEP... */
     DWOP_INDESTRUCTIBLE = 0x00002000,  /* window can't be destroyed
                                           by internal shortcut */
     DWOP_SCALE          = 0x00010000,  /* Surface won't be changed if window size on screen changes. The surface
                                           can be resized separately using IDirectFBWindow::ResizeSurface(). */

     DWOP_KEEP_ABOVE     = 0x00100000,  /* Keep window above parent window. */
     DWOP_KEEP_UNDER     = 0x00200000,  /* Keep window under parent window. */

     DWOP_ALL            = 0x0031307F   /* all possible options */
} DFBWindowOptions;

/*
 * The stacking class restricts the stacking order of windows.
 */
typedef enum {
     DWSC_MIDDLE         = 0x00000000,  /* This is the default stacking
                                           class of new windows. */
     DWSC_UPPER          = 0x00000001,  /* Window is always above windows
                                           in the middle stacking class.
                                           Only windows that are also in
                                           the upper stacking class can
                                           get above them. */
     DWSC_LOWER          = 0x00000002   /* Window is always below windows
                                           in the middle stacking class.
                                           Only windows that are also in
                                           the lower stacking class can
                                           get below them. */
} DFBWindowStackingClass;


/*
 * Flags describing how to load a font.
 *
 * These flags describe how a font is loaded and affect how the
 * glyphs are drawn. There is no way to change this after the font
 * has been loaded. If you need to render a font with different
 * attributes, you have to create multiple FontProviders of the
 * same font file.
 */
typedef enum {
     DFFA_NONE           = 0x00000000,  /* none of these flags */
     DFFA_NOKERNING      = 0x00000001,  /* don't use kerning */
     DFFA_NOHINTING      = 0x00000002,  /* don't use hinting */
     DFFA_MONOCHROME     = 0x00000004,  /* don't use anti-aliasing */
     DFFA_NOCHARMAP      = 0x00000008,  /* no char map, glyph indices are
                                           specified directly */
     DFFA_FIXEDCLIP      = 0x00000010   /* width fixed advance, clip to it */
} DFBFontAttributes;

/*
 * Flags defining which fields of a DFBFontDescription are valid.
 */
typedef enum {
     DFDESC_ATTRIBUTES   = 0x00000001,  /* attributes field is valid */
     DFDESC_HEIGHT       = 0x00000002,  /* height is specified */
     DFDESC_WIDTH        = 0x00000004,  /* width is specified */
     DFDESC_INDEX        = 0x00000008,  /* index is specified */
     DFDESC_FIXEDADVANCE = 0x00000010,  /* specify a fixed advance overriding
                                           any character advance of fixed or
                                           proportional fonts */
     DFDESC_FRACT_HEIGHT = 0x00000020,  /* fractional height is set */
     DFDESC_FRACT_WIDTH  = 0x00000040,  /* fractional width is set */
} DFBFontDescriptionFlags;

/*
 * Description of how to load glyphs from a font file.
 *
 * The attributes control how the glyphs are rendered. Width and height can be used to specify the
 * desired face size in pixels. If you are loading a non-scalable font, you shouldn't specify a
 * font size.
 *
 * Please note that the height value in the DFBFontDescription doesn't correspond to the height
 * returned by IDirectFBFont::GetHeight().
 *
 * The index field controls which face is loaded from a font file that provides a collection of
 * faces. This is rarely needed.
 *
 * Fractional sizes (fract_height and fract_width) are 26.6 fixed point integers and override
 * the pixel sizes if both are specified.
 */
typedef struct {
     DFBFontDescriptionFlags            flags;

     DFBFontAttributes                  attributes;
     int                                height;
     int                                width;
     unsigned int                       index;
     int                                fixed_advance;

     int                                fract_height;
     int                                fract_width;
} DFBFontDescription;

/*
 * @internal
 *
 * Encodes format constants in the following way (bit 31 - 0):
 *
 * lkjj:hhgg | gfff:eeed | cccc:bbbb | baaa:aaaa
 *
 * a) pixelformat index<br>
 * b) effective color (or index) bits per pixel of format<br>
 * c) effective alpha bits per pixel of format<br>
 * d) alpha channel present<br>
 * e) bytes per "pixel in a row" (1/8 fragment, i.e. bits)<br>
 * f) bytes per "pixel in a row" (decimal part, i.e. bytes)<br>
 * g) smallest number of pixels aligned to byte boundary (minus one)<br>
 * h) multiplier for planes minus one (1/4 fragment)<br>
 * j) multiplier for planes minus one (decimal part)<br>
 * k) color and/or alpha lookup table present<br>
 * l) alpha channel is inverted
 */
#define DFB_SURFACE_PIXELFORMAT( index, color_bits, alpha_bits, has_alpha,     \
                                 row_bits, row_bytes, align, mul_f, mul_d,     \
                                 has_lut, inv_alpha )                          \
     ( (((index     ) & 0x7F)      ) |                                         \
       (((color_bits) & 0x1F) <<  7) |                                         \
       (((alpha_bits) & 0x0F) << 12) |                                         \
       (((has_alpha ) ? 1 :0) << 16) |                                         \
       (((row_bits  ) & 0x07) << 17) |                                         \
       (((row_bytes ) & 0x07) << 20) |                                         \
       (((align     ) & 0x07) << 23) |                                         \
       (((mul_f     ) & 0x03) << 26) |                                         \
       (((mul_d     ) & 0x03) << 28) |                                         \
       (((has_lut   ) ? 1 :0) << 30) |                                         \
       (((inv_alpha ) ? 1 :0) << 31) )

/*
 * Pixel format of a surface.
 */
typedef enum {
     DSPF_UNKNOWN   = 0x00000000,  /* unknown or unspecified format */

     /* 16 bit  ARGB (2 byte, alpha 1@15, red 5@10, green 5@5, blue 5@0) */
     DSPF_ARGB1555  = DFB_SURFACE_PIXELFORMAT(  0, 15, 1, 1, 0, 2, 0, 0, 0, 0, 0 ),

     /* 16 bit   RGB (2 byte, red 5@11, green 6@5, blue 5@0) */
     DSPF_RGB16     = DFB_SURFACE_PIXELFORMAT(  1, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),

     /* 24 bit   RGB (3 byte, red 8@16, green 8@8, blue 8@0) */
     DSPF_RGB24     = DFB_SURFACE_PIXELFORMAT(  2, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0 ),

     /* 24 bit   RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0) */
     DSPF_RGB32     = DFB_SURFACE_PIXELFORMAT(  3, 24, 0, 0, 0, 4, 0, 0, 0, 0, 0 ),

     /* 32 bit  ARGB (4 byte, alpha 8@24, red 8@16, green 8@8, blue 8@0) */
     DSPF_ARGB      = DFB_SURFACE_PIXELFORMAT(  4, 24, 8, 1, 0, 4, 0, 0, 0, 0, 0 ),

     /*  8 bit alpha (1 byte, alpha 8@0), e.g. anti-aliased glyphs */
     DSPF_A8        = DFB_SURFACE_PIXELFORMAT(  5,  0, 8, 1, 0, 1, 0, 0, 0, 0, 0 ),

     /* 16 bit   YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
     DSPF_YUY2      = DFB_SURFACE_PIXELFORMAT(  6, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),

     /*  8 bit   RGB (1 byte, red 3@5, green 3@2, blue 2@0) */
     DSPF_RGB332    = DFB_SURFACE_PIXELFORMAT(  7,  8, 0, 0, 0, 1, 0, 0, 0, 0, 0 ),

     /* 16 bit   YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
     DSPF_UYVY      = DFB_SURFACE_PIXELFORMAT(  8, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),

     /* 12 bit   YUV (8 bit Y plane followed by 8 bit quarter size U/V planes) */
     DSPF_I420      = DFB_SURFACE_PIXELFORMAT(  9, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),

     /* 12 bit   YUV (8 bit Y plane followed by 8 bit quarter size V/U planes) */
     DSPF_YV12      = DFB_SURFACE_PIXELFORMAT( 10, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),

     /*  8 bit   LUT (8 bit color and alpha lookup from palette) */
     DSPF_LUT8      = DFB_SURFACE_PIXELFORMAT( 11,  8, 0, 1, 0, 1, 0, 0, 0, 1, 0 ),

     /*  8 bit  ALUT (1 byte, alpha 4@4, color lookup 4@0) */
     DSPF_ALUT44    = DFB_SURFACE_PIXELFORMAT( 12,  4, 4, 1, 0, 1, 0, 0, 0, 1, 0 ),

     /* 32 bit  ARGB (4 byte, inv. alpha 8@24, red 8@16, green 8@8, blue 8@0) */
     DSPF_AiRGB     = DFB_SURFACE_PIXELFORMAT( 13, 24, 8, 1, 0, 4, 0, 0, 0, 0, 1 ),

     /*  1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */
     DSPF_A1        = DFB_SURFACE_PIXELFORMAT( 14,  0, 1, 1, 1, 0, 7, 0, 0, 0, 0 ),

     /* 12 bit   YUV (8 bit Y plane followed by one 16 bit quarter size Cb|Cr [7:0|7:0] plane) */
     DSPF_NV12      = DFB_SURFACE_PIXELFORMAT( 15, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),

     /* 16 bit   YUV (8 bit Y plane followed by one 16 bit half width Cb|Cr [7:0|7:0] plane) */
     DSPF_NV16      = DFB_SURFACE_PIXELFORMAT( 16, 24, 0, 0, 0, 1, 0, 0, 1, 0, 0 ),

     /* 16 bit  ARGB (2 byte, alpha 2@14, red 5@9, green 5@4, blue 4@0) */
     DSPF_ARGB2554  = DFB_SURFACE_PIXELFORMAT( 17, 14, 2, 1, 0, 2, 0, 0, 0, 0, 0 ),

     /* 16 bit  ARGB (2 byte, alpha 4@12, red 4@8, green 4@4, blue 4@0) */
     DSPF_ARGB4444  = DFB_SURFACE_PIXELFORMAT( 18, 12, 4, 1, 0, 2, 0, 0, 0, 0, 0 ),

     /* 12 bit   YUV (8 bit Y plane followed by one 16 bit quarter size Cr|Cb [7:0|7:0] plane) */
     DSPF_NV21      = DFB_SURFACE_PIXELFORMAT( 19, 12, 0, 0, 0, 1, 0, 2, 0, 0, 0 ),

     /* 32 bit  AYUV (4 byte, alpha 8@24, Y 8@16, Cb 8@8, Cr 8@0) */
     DSPF_AYUV      = DFB_SURFACE_PIXELFORMAT( 20, 24, 8, 1, 0, 4, 0, 0, 0, 0, 0 ),

     /*  4 bit alpha (1 byte/ 2 pixel, more significant nibble used first) */
     DSPF_A4        = DFB_SURFACE_PIXELFORMAT( 21,  0, 4, 1, 4, 0, 1, 0, 0, 0, 0 ),

     /*  1 bit alpha (3 byte/  alpha 1@18, red 6@16, green 6@6, blue 6@0) */
     DSPF_ARGB1666  = DFB_SURFACE_PIXELFORMAT( 22, 18, 1, 1, 0, 3, 0, 0, 0, 0, 0 ),

     /*  6 bit alpha (3 byte/  alpha 6@18, red 6@16, green 6@6, blue 6@0) */
     DSPF_ARGB6666  = DFB_SURFACE_PIXELFORMAT( 23, 18, 6, 1, 0, 3, 0, 0, 0, 0, 0 ),

     /*  6 bit   RGB (3 byte/   red 6@16, green 6@6, blue 6@0) */
     DSPF_RGB18     = DFB_SURFACE_PIXELFORMAT( 24, 18, 0, 0, 0, 3, 0, 0, 0, 0, 0 ),

     /*  2 bit   LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from palette) */
     DSPF_LUT2      = DFB_SURFACE_PIXELFORMAT( 25,  2, 0, 1, 2, 0, 3, 0, 0, 1, 0 ),

     /* 16 bit   RGB (2 byte, nothing @12, red 4@8, green 4@4, blue 4@0) */
     DSPF_RGB444    = DFB_SURFACE_PIXELFORMAT( 26, 12, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),

     /* 16 bit   RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) */
     DSPF_RGB555    = DFB_SURFACE_PIXELFORMAT( 27, 15, 0, 0, 0, 2, 0, 0, 0, 0, 0 ),

     /* 16 bit   BGR (2 byte, nothing @15, blue 5@10, green 5@5, red 5@0) */
     DSPF_BGR555    = DFB_SURFACE_PIXELFORMAT( 28, 15, 0, 0, 0, 2, 0, 0, 0, 0, 0 )

} DFBSurfacePixelFormat;

/* Number of pixelformats defined */
#define DFB_NUM_PIXELFORMATS            29

/* These macros extract information about the pixel format. */
#define DFB_PIXELFORMAT_INDEX(fmt)      (((fmt) & 0x0000007F)      )

#define DFB_COLOR_BITS_PER_PIXEL(fmt)   (((fmt) & 0x00000F80) >>  7)

#define DFB_ALPHA_BITS_PER_PIXEL(fmt)   (((fmt) & 0x0000F000) >> 12)

#define DFB_PIXELFORMAT_HAS_ALPHA(fmt)  (((fmt) & 0x00010000) !=  0)

#define DFB_BITS_PER_PIXEL(fmt)         (((fmt) & 0x007E0000) >> 17)

#define DFB_BYTES_PER_PIXEL(fmt)        (((fmt) & 0x00700000) >> 20)

#define DFB_BYTES_PER_LINE(fmt,width)   (((((fmt) & 0x007E0000) >> 17) * (width) + 7) >> 3)

#define DFB_PIXELFORMAT_ALIGNMENT(fmt)  (((fmt) & 0x03800000) >> 23)

#define DFB_PLANE_MULTIPLY(fmt,height)  ((((((fmt) & 0x3C000000) >> 26) + 4) * (height)) >> 2)

#define DFB_PIXELFORMAT_IS_INDEXED(fmt) (((fmt) & 0x40000000) !=  0)

#define DFB_PLANAR_PIXELFORMAT(fmt)     (((fmt) & 0x3C000000) !=  0)

#define DFB_PIXELFORMAT_INV_ALPHA(fmt)  (((fmt) & 0x80000000) !=  0)


/*
 * Description of the surface that is to be created.
 */
typedef struct {
     DFBSurfaceDescriptionFlags         flags;       /* field validation */

     DFBSurfaceCapabilities             caps;        /* capabilities */
     int                                width;       /* pixel width */
     int                                height;      /* pixel height */
     DFBSurfacePixelFormat              pixelformat; /* pixel format */

     struct {
          void                         *data;        /* data pointer of existing buffer */
          int                           pitch;       /* pitch of buffer */
     } preallocated[2];

     struct {
          const DFBColor               *entries;
          unsigned int                  size;
     } palette;                                      /* initial palette */

     unsigned long                      resource_id;   /* universal resource id, either user specified for general
                                                          purpose surfaces or id of layer or window */
} DFBSurfaceDescription;

/*
 * Description of the palette that is to be created.
 */
typedef struct {
     DFBPaletteDescriptionFlags         flags;       /* Validation of fields. */

     DFBPaletteCapabilities             caps;        /* Palette capabilities. */
     unsigned int                       size;        /* Number of entries. */
     const DFBColor                    *entries;     /* Preset palette
                                                        entries. */
} DFBPaletteDescription;


#define DFB_DISPLAY_LAYER_DESC_NAME_LENGTH   32

/*
 * Description of the display layer capabilities.
 */
typedef struct {
     DFBDisplayLayerTypeFlags           type;          /* Classification of the display layer. */
     DFBDisplayLayerCapabilities        caps;          /* Capability flags of the display layer. */

     char name[DFB_DISPLAY_LAYER_DESC_NAME_LENGTH];    /* Display layer name. */

     int                                level;         /* Default level. */
     int                                regions;       /* Number of concurrent regions supported.<br>
                                                           -1 = unlimited,
                                                            0 = unknown/one,
                                                           >0 = actual number */
     int                                sources;       /* Number of selectable sources. */
     int                                clip_regions;  /* Number of clipping regions. */
} DFBDisplayLayerDescription;

/*
 * Capabilities of a display layer source.
 */
typedef enum {
     DDLSCAPS_NONE       = 0x00000000,  /* none of these */

     DDLSCAPS_SURFACE    = 0x00000001,  /* source has an accessable surface */

     DDLSCAPS_ALL        = 0x00000001   /* all of these */
} DFBDisplayLayerSourceCaps;

#define DFB_DISPLAY_LAYER_SOURCE_DESC_NAME_LENGTH    24

/*
 * Description of a display layer source.
 */
typedef struct {
     DFBDisplayLayerSourceID            source_id;          /* ID of the source. */

     char name[DFB_DISPLAY_LAYER_SOURCE_DESC_NAME_LENGTH];  /* Name of the source. */

     DFBDisplayLayerSourceCaps          caps;               /* Capabilites of the source. */
} DFBDisplayLayerSourceDescription;


#define DFB_SCREEN_DESC_NAME_LENGTH          32

/*
 * Description of the display encoder capabilities.
 */
typedef struct {
     DFBScreenCapabilities              caps;        /* Capability flags of
                                                        the screen. */

     char name[DFB_SCREEN_DESC_NAME_LENGTH];         /* Rough description. */

     int                                mixers;      /* Number of mixers
                                                        available. */
     int                                encoders;    /* Number of display
                                                        encoders available. */
     int                                outputs;     /* Number of output
                                                        connectors available. */
} DFBScreenDescription;


#define DFB_INPUT_DEVICE_DESC_NAME_LENGTH    32
#define DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH  40

/*
 * Description of the input device capabilities.
 */
typedef struct {
     DFBInputDeviceTypeFlags            type;        /* classification of
                                                        input device */
     DFBInputDeviceCapabilities         caps;        /* capabilities,
                                                        validates the
                                                        following fields */

     int                                min_keycode; /* minimum hardware
                                                        keycode or -1 if
                                                        no differentiation
                                                        between hardware
                                                        keys is made */
     int                                max_keycode; /* maximum hardware
                                                        keycode or -1 if
                                                        no differentiation
                                                        between hardware
                                                        keys is made */
     DFBInputDeviceAxisIdentifier       max_axis;    /* highest axis
                                                        identifier */
     DFBInputDeviceButtonIdentifier     max_button;  /* highest button
                                                        identifier */

     char name[DFB_INPUT_DEVICE_DESC_NAME_LENGTH];   /* Device name */

     char vendor[DFB_INPUT_DEVICE_DESC_VENDOR_LENGTH]; /* Device vendor */
} DFBInputDeviceDescription;

typedef enum {
     DIAIF_NONE                    = 0x00000000,

     DIAIF_ABS_MIN                 = 0x00000001,
     DIAIF_ABS_MAX                 = 0x00000002,

     DIAIF_ALL                     = 0x00000003
} DFBInputDeviceAxisInfoFlags;

typedef struct {
     DFBInputDeviceAxisInfoFlags   flags;
     int                           abs_min;
     int                           abs_max;
} DFBInputDeviceAxisInfo;

#define DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH    40
#define DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH  60

typedef struct {
     int  major;                                          /* Major version */
     int  minor;                                          /* Minor version */

     char name[DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH];     /* Driver name */
     char vendor[DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH]; /* Driver vendor */
} DFBGraphicsDriverInfo;

#define DFB_GRAPHICS_DEVICE_DESC_NAME_LENGTH    48
#define DFB_GRAPHICS_DEVICE_DESC_VENDOR_LENGTH  64

/*
 * Description of the graphics device capabilities.
 */
typedef struct {
     DFBAccelerationMask      acceleration_mask;          /* Accelerated functions */

     DFBSurfaceBlittingFlags  blitting_flags;             /* Supported blitting flags */
     DFBSurfaceDrawingFlags   drawing_flags;              /* Supported drawing flags */

     unsigned int             video_memory;               /* Amount of video memory in bytes */

     char name[DFB_GRAPHICS_DEVICE_DESC_NAME_LENGTH];     /* Device/Chipset name */
     char vendor[DFB_GRAPHICS_DEVICE_DESC_VENDOR_LENGTH]; /* Device vendor */

     DFBGraphicsDriverInfo    driver;
} DFBGraphicsDeviceDescription;

/*
 * Description of the window that is to be created.
 */
typedef struct {
     DFBWindowDescriptionFlags          flags;        /* field validation */

     DFBWindowCapabilities              caps;         /* capabilities */
     int                                width;        /* pixel width */
     int                                height;       /* pixel height */
     DFBSurfacePixelFormat              pixelformat;  /* pixel format */
     int                                posx;         /* distance from left layer border */
     int                                posy;         /* distance from upper layer border */
     DFBSurfaceCapabilities             surface_caps; /* pixel format */
     DFBWindowID                        parent_id;    /* window id of parent window */
     DFBWindowOptions                   options;      /* initial window options */
     DFBWindowStackingClass             stacking;     /* initial stacking class */

     unsigned long                      resource_id;  /* resource id used to create the window surface */
} DFBWindowDescription;

/*
 * Description of a data buffer that is to be created.
 */
typedef struct {
     DFBDataBufferDescriptionFlags      flags;       /* field validation */

     const char                        *file;        /* for file based data buffers */

     struct {
          const void                   *data;        /* static data pointer */
          unsigned int                  length;      /* length of buffer */
     } memory;                                       /* memory based buffers */
} DFBDataBufferDescription;

/*
 * Return value of callback function of enumerations.
 */
typedef enum {
     DFENUM_OK           = 0x00000000,  /* Proceed with enumeration */
     DFENUM_CANCEL       = 0x00000001   /* Cancel enumeration */
} DFBEnumerationResult;

/*
 * Called for each supported video mode.
 */
typedef DFBEnumerationResult (*DFBVideoModeCallback) (
     int                       width,
     int                       height,
     int                       bpp,
     void                     *callbackdata
);

/*
 * Called for each existing screen.
 * "screen_id" can be used to get an interface to the screen.
 */
typedef DFBEnumerationResult (*DFBScreenCallback) (
     DFBScreenID                        screen_id,
     DFBScreenDescription               desc,
     void                              *callbackdata
);

/*
 * Called for each existing display layer.
 * "layer_id" can be used to get an interface to the layer.
 */
typedef DFBEnumerationResult (*DFBDisplayLayerCallback) (
     DFBDisplayLayerID                  layer_id,
     DFBDisplayLayerDescription         desc,
     void                              *callbackdata
);

/*
 * Called for each existing input device.
 * "device_id" can be used to get an interface to the device.
 */
typedef DFBEnumerationResult (*DFBInputDeviceCallback) (
     DFBInputDeviceID                   device_id,
     DFBInputDeviceDescription          desc,
     void                              *callbackdata
);

/*
 * Called for each block of continous data requested, e.g. by a
 * Video Provider. Write as many data as you can but not more
 * than specified by length. Return the number of bytes written
 * or 'EOF' if no data is available anymore.
 */
typedef int (*DFBGetDataCallback) (
     void                              *buffer,
     unsigned int                       length,
     void                              *callbackdata
);

/*
 * Information about an IDirectFBVideoProvider.
 */
typedef enum {
     DVCAPS_BASIC       = 0x00000000,  /* basic ops (PlayTo, Stop)         */
     DVCAPS_SEEK        = 0x00000001,  /* supports SeekTo                  */
     DVCAPS_SCALE       = 0x00000002,  /* can scale the video              */
     DVCAPS_INTERLACED  = 0x00000004,  /* supports interlaced surfaces     */
     DVCAPS_SPEED       = 0x00000008,  /* supports changing playback speed */
     DVCAPS_BRIGHTNESS  = 0x00000010,  /* supports Brightness adjustment   */
     DVCAPS_CONTRAST    = 0x00000020,  /* supports Contrast adjustment     */
     DVCAPS_HUE         = 0x00000040,  /* supports Hue adjustment          */
     DVCAPS_SATURATION  = 0x00000080,  /* supports Saturation adjustment   */
     DVCAPS_INTERACTIVE = 0x00000100,  /* supports SendEvent               */
     DVCAPS_VOLUME      = 0x00000200,  /* supports Volume adjustment       */
     DVCAPS_EVENT       = 0x00000400,  /* supports the sending of events as video/audio data changes.*/
     DVCAPS_ATTRIBUTES  = 0x00000800,  /* supports dynamic changing of atrributes.*/
     DVCAPS_AUDIO_SEL   = 0x00001000,  /* Supportes chosing audio outputs.*/
} DFBVideoProviderCapabilities;

/*
 * Information about the status of an IDirectFBVideoProvider.
 */
typedef enum {
     DVSTATE_UNKNOWN    = 0x00000000, /* unknown status               */
     DVSTATE_PLAY       = 0x00000001, /* video provider is playing    */
     DVSTATE_STOP       = 0x00000002, /* playback was stopped         */
     DVSTATE_FINISHED   = 0x00000003, /* playback is finished         */
     DVSTATE_BUFFERING  = 0x00000004  /* video provider is buffering,
                                         playback is running          */
} DFBVideoProviderStatus;

/*
 * Flags controlling playback mode of a IDirectFBVideoProvider.
 */
typedef enum {
     DVPLAY_NOFX        = 0x00000000, /* normal playback           */
     DVPLAY_REWIND      = 0x00000001, /* reverse playback          */
     DVPLAY_LOOPING     = 0x00000002  /* automatically restart 
                                         playback when end-of-stream
                                         is reached (gapless).     */
} DFBVideoProviderPlaybackFlags;

/*
 * Flags to allow Audio Unit selection.
 */
typedef enum {
     DVAUDIOUNIT_NONE   = 0x00000000, /* No Audio Unit            */
     DVAUDIOUNIT_ONE    = 0x00000001, /* Audio Unit One           */
     DVAUDIOUNIT_TWO    = 0x00000002, /* Audio Unit Two           */
     DVAUDIOUNIT_THREE  = 0x00000004, /* Audio Unit Three         */
     DVAUDIOUNIT_FOUR   = 0x00000008, /* Audio Unit Four          */
     DVAUDIOUNIT_ALL    = 0x0000000F, /* Audio Unit One           */
} DFBVideoProviderAudioUnits;


/*
 * Flags defining which fields of a DFBColorAdjustment are valid.
 */
typedef enum {
     DCAF_NONE         = 0x00000000,  /* none of these              */
     DCAF_BRIGHTNESS   = 0x00000001,  /* brightness field is valid  */
     DCAF_CONTRAST     = 0x00000002,  /* contrast field is valid    */
     DCAF_HUE          = 0x00000004,  /* hue field is valid         */
     DCAF_SATURATION   = 0x00000008,  /* saturation field is valid  */
     DCAF_ALL          = 0x0000000F   /* all of these               */
} DFBColorAdjustmentFlags;

/*
 * Color Adjustment used to adjust video colors.
 *
 * All fields are in the range 0x0 to 0xFFFF with
 * 0x8000 as the default value (no adjustment).
 */
typedef struct {
     DFBColorAdjustmentFlags  flags;

     u16                      brightness;
     u16                      contrast;
     u16                      hue;
     u16                      saturation;
} DFBColorAdjustment;


/*
 * <i><b>IDirectFB</b></i> is the main interface. It can be
 * retrieved by a call to <i>DirectFBCreate</i>. It's the only
 * interface with a global creation facility. Other interfaces
 * are created by this interface or interfaces created by it.
 *
 * <b>Hardware capabilities</b> such as the amount of video
 * memory or a list of supported drawing/blitting functions and
 * flags can be retrieved.  It also provides enumeration of all
 * supported video modes.
 *
 * <b>Input devices</b> and <b>display layers</b> that are
 * present can be enumerated via a callback mechanism. The
 * callback is given the capabilities and the device or layer
 * ID. An interface to specific input devices or display layers
 * can be retrieved by passing the device or layer ID to the
 * corresponding method.
 *
 * <b>Surfaces</b> for general purpose use can be created via
 * <i>CreateSurface</i>. These surfaces are so called "offscreen
 * surfaces" and could be used for sprites or icons.
 *
 * The <b>primary surface</b> is an abstraction and API shortcut
 * for getting a surface for visual output. Fullscreen games for
 * example have the whole screen as their primary
 * surface. Alternatively fullscreen applications can be forced
 * to run in a window. The primary surface is also created via
 * <i>CreateSurface</i> but with the special capability
 * DSCAPS_PRIMARY.
 *
 * The <b>cooperative level</b> selects the type of the primary
 * surface.  With a call to <i>SetCooperativeLevel</i> the
 * application can choose between the surface of an implicitly
 * created window and the surface of the primary layer
 * (deactivating the window stack). The application doesn't need
 * to have any extra functionality to run in a window. If the
 * application is forced to run in a window the call to
 * <i>SetCooperativeLevel</i> fails with DFB_ACCESSDENIED.
 * Applications that want to be "window aware" shouldn't exit on
 * this error.
 *
 * The <b>video mode</b> can be changed via <i>SetVideoMode</i>
 * and is the size and depth of the primary surface, i.e. the
 * screen when in exclusive cooperative level. Without exclusive
 * access <i>SetVideoMode</i> sets the size of the implicitly
 * created window.
 *
 * <b>Event buffers</b> can be created with an option to
 * automatically attach input devices matching the specified
 * capabilities. If DICAPS_NONE is passed an event buffer with
 * nothing attached to is created. An event buffer can be
 * attached to input devices and windows.
 *
 * <b>Fonts, images and videos</b> are created by this
 * interface. There are different implementations for different
 * content types. On creation a suitable implementation is
 * automatically chosen.
 */
DEFINE_INTERFACE(   IDirectFB,

   /** Cooperative level, video mode **/

     /*
      * Puts the interface into the specified cooperative level.
      *
      * Function fails with DFB_LOCKED if another instance already
      * is in a cooperative level other than DFSCL_NORMAL.
      */
     DFBResult (*SetCooperativeLevel) (
          IDirectFB                *thiz,
          DFBCooperativeLevel       level
     );

     /*
      * Switch the current video mode (primary layer).
      *
      * If in shared cooperative level this function sets the
      * resolution of the window that is created implicitly for
      * the primary surface.
      */
     DFBResult (*SetVideoMode) (
          IDirectFB                *thiz,
          int                       width,
          int                       height,
          int                       bpp
     );


   /** Hardware capabilities **/

     /*
      * Get a description of the graphics device.
      *
      * For more detailed information use
      * IDirectFBSurface::GetAccelerationMask().
      */
     DFBResult (*GetDeviceDescription) (
          IDirectFB                    *thiz,
          DFBGraphicsDeviceDescription *ret_desc
     );

     /*
      * Enumerate supported video modes.
      *
      * Calls the given callback for all available video modes.
      * Useful to select a certain mode to be used with
      * IDirectFB::SetVideoMode().
      */
     DFBResult (*EnumVideoModes) (
          IDirectFB                *thiz,
          DFBVideoModeCallback      callback,
          void                     *callbackdata
     );


   /** Surfaces & Palettes **/

     /*
      * Create a surface matching the specified description.
      */
     DFBResult (*CreateSurface) (
          IDirectFB                     *thiz,
          const DFBSurfaceDescription   *desc,
          IDirectFBSurface             **ret_interface
     );

     /*
      * Create a palette matching the specified description.
      *
      * Passing a NULL description creates a default palette with
      * 256 entries filled with colors matching the RGB332 format.
      */
     DFBResult (*CreatePalette) (
          IDirectFB                    *thiz,
          const DFBPaletteDescription  *desc,
          IDirectFBPalette            **ret_interface
     );


   /** Screens **/

     /*
      * Enumerate all existing screen.
      *
      * Calls the given callback for each available screen.
      * The callback is passed the screen id that can be
      * used to retrieve an interface to a specific screen using
      * IDirectFB::GetScreen().
      */
     DFBResult (*EnumScreens) (
          IDirectFB                *thiz,
          DFBScreenCallback         callback,
          void                     *callbackdata
     );

     /*
      * Retrieve an interface to a specific screen.
      */
     DFBResult (*GetScreen) (
          IDirectFB                *thiz,
          DFBScreenID               screen_id,
          IDirectFBScreen         **ret_interface
     );


   /** Display Layers **/

     /*
      * Enumerate all existing display layers.
      *
      * Calls the given callback for each available display
      * layer. The callback is passed the layer id that can be
      * used to retrieve an interface to a specific layer using
      * IDirectFB::GetDisplayLayer().
      */
     DFBResult (*EnumDisplayLayers) (
          IDirectFB                *thiz,
          DFBDisplayLayerCallback   callback,
          void                     *callbackdata
     );

     /*
      * Retrieve an interface to a specific display layer.
      *
      * The default <i>layer_id</i> is DLID_PRIMARY.
      * Others can be obtained using IDirectFB::EnumDisplayLayers().
      */
     DFBResult (*GetDisplayLayer) (
          IDirectFB                *thiz,
          DFBDisplayLayerID         layer_id,
          IDirectFBDisplayLayer   **ret_interface
     );


   /** Input Devices **/

     /*
      * Enumerate all existing input devices.
      *
      * Calls the given callback for all available input devices.
      * The callback is passed the device id that can be used to
      * retrieve an interface on a specific device using
      * IDirectFB::GetInputDevice().
      */
     DFBResult (*EnumInputDevices) (
          IDirectFB                *thiz,
          DFBInputDeviceCallback    callback,
          void                     *callbackdata
     );

     /*
      * Retrieve an interface to a specific input device.
      */
     DFBResult (*GetInputDevice) (
          IDirectFB                *thiz,
          DFBInputDeviceID          device_id,
          IDirectFBInputDevice    **ret_interface
     );

     /*
      * Create a buffer for events.
      *
      * Creates an empty event buffer without event sources connected to it.
      */
     DFBResult (*CreateEventBuffer) (
          IDirectFB                   *thiz,
          IDirectFBEventBuffer       **ret_buffer
     );

     /*
      * Create a buffer for events with input devices connected.
      *
      * Creates an event buffer and attaches all input devices
      * with matching capabilities. If no input devices match,
      * e.g. by specifying DICAPS_NONE, a buffer will be returned
      * that has no event sources connected to it.
      *
      * If global is DFB_FALSE events will only be delivered if this
      * instance of IDirectFB has a focused primary (either running fullscreen
      * or running in windowed mode with the window being focused).
      *
      * If global is DFB_TRUE no event will be discarded.
      */
     DFBResult (*CreateInputEventBuffer) (
          IDirectFB                   *thiz,
          DFBInputDeviceCapabilities   caps,
          DFBBoolean                   global,
          IDirectFBEventBuffer       **ret_buffer
     );



   /** Media **/

     /*
      * Create an image provider for the specified file.
      */
     DFBResult (*CreateImageProvider) (
          IDirectFB                *thiz,
          const char               *filename,
          IDirectFBImageProvider  **ret_interface
     );

     /*
      * Create a video provider.
      */
     DFBResult (*CreateVideoProvider) (
          IDirectFB                *thiz,
          const char               *filename,
          IDirectFBVideoProvider  **ret_interface
     );

     /*
      * Load a font from the specified file given a description
      * of how to load the glyphs.
      */
     DFBResult (*CreateFont) (
          IDirectFB                     *thiz,
          const char                    *filename,
          const DFBFontDescription      *desc,
          IDirectFBFont                **ret_interface
     );

     /*
      * Create a data buffer.
      *
      * If no description is specified (NULL) a streamed data buffer
      * is created.
      */
     DFBResult (*CreateDataBuffer) (
          IDirectFB                       *thiz,
          const DFBDataBufferDescription  *desc,
          IDirectFBDataBuffer            **ret_interface
     );


   /** Clipboard **/

     /*
      * Set clipboard content.
      *
      * This is an experimental and intermediate API call that is
      * supposed to change soon.
      *
      * If timestamp is non null DirectFB returns the time stamp
      * that it associated with the new data.
      */
     DFBResult (*SetClipboardData) (
          IDirectFB                *thiz,
          const char               *mime_type,
          const void               *data,
          unsigned int              size,
          struct timeval           *ret_timestamp
     );

     /*
      * Get clipboard content.
      *
      * Memory returned in *ret_mimetype and *ret_data has to be freed.
      *
      * This is an experimental and intermediate API call that is
      * supposed to change soon.
      */
     DFBResult (*GetClipboardData) (
          IDirectFB                *thiz,
          char                    **ret_mimetype,
          void                    **ret_data,
          unsigned int             *ret_size
     );

     /*
      * Get time stamp of last SetClipboardData call.
      *
      * This is an experimental and intermediate API call that is
      * supposed to change soon.
      */
     DFBResult (*GetClipboardTimeStamp) (
          IDirectFB                *thiz,
          struct timeval           *ret_timestamp
     );


   /** Misc **/

     /*
      * Suspend DirectFB, no other calls to DirectFB are allowed
      * until Resume has been called.
      */
     DFBResult (*Suspend) (
          IDirectFB                *thiz
     );

     /*
      * Resume DirectFB, only to be called after Suspend.
      */
     DFBResult (*Resume) (
          IDirectFB                *thiz
     );

     /*
      * Wait until graphics card is idle,
      * i.e. finish all drawing/blitting functions.
      */
     DFBResult (*WaitIdle) (
          IDirectFB                *thiz
     );

     /*
      * Wait for next vertical retrace.
      */
     DFBResult (*WaitForSync) (
          IDirectFB                *thiz
     );


   /** Extensions **/

     /*
      * Load an implementation of a specific interface type.
      *
      * This methods loads an interface implementation of the specified
      * <b>type</b> of interface, e.g. "IFusionSound".
      *
      * A specific implementation can be forced with the optional
      * <b>implementation</b> argument.
      *
      * Implementations are passed <b>arg</b> during probing and construction.
      *
      * If an implementation has been successfully probed and the interface
      * has been constructed, the resulting interface pointer is stored in
      * <b>interface</b>.
      */
     DFBResult (*GetInterface) (
          IDirectFB                *thiz,
          const char               *type,
          const char               *implementation,
          void                     *arg,
          void                    **ret_interface
     );
)

/* predefined layer ids */
#define DLID_PRIMARY          0x0000

/* predefined layer source ids */
#define DLSID_SURFACE         0x0000

/* predefined screen ids */
#define DSCID_PRIMARY         0x0000

/* predefined input device ids */
#define DIDID_KEYBOARD        0x0000    /* primary keyboard       */
#define DIDID_MOUSE           0x0001    /* primary mouse          */
#define DIDID_JOYSTICK        0x0002    /* primary joystick       */
#define DIDID_REMOTE          0x0003    /* primary remote control */
#define DIDID_ANY             0x0010    /* no primary device      */


/*
 * Cooperative level handling the access permissions.
 */
typedef enum {
     DLSCL_SHARED             = 0, /* shared access */
     DLSCL_EXCLUSIVE,              /* exclusive access,
                                      fullscreen/mode switching */
     DLSCL_ADMINISTRATIVE          /* administrative access,
                                      enumerate windows, control them */
} DFBDisplayLayerCooperativeLevel;

/*
 * Background mode defining how to erase/initialize the area
 * for a windowstack repaint
 */
typedef enum {
     DLBM_DONTCARE            = 0, /* do not clear the layer before
                                      repainting the windowstack */
     DLBM_COLOR,                   /* fill with solid color
                                      (SetBackgroundColor) */
     DLBM_IMAGE,                   /* use an image (SetBackgroundImage) */
     DLBM_TILE                     /* use a tiled image (SetBackgroundImage) */
} DFBDisplayLayerBackgroundMode;

/*
 * Layer configuration flags
 */
typedef enum {
     DLCONF_NONE              = 0x00000000,

     DLCONF_WIDTH             = 0x00000001,
     DLCONF_HEIGHT            = 0x00000002,
     DLCONF_PIXELFORMAT       = 0x00000004,
     DLCONF_BUFFERMODE        = 0x00000008,
     DLCONF_OPTIONS           = 0x00000010,
     DLCONF_SOURCE            = 0x00000020,
     DLCONF_SURFACE_CAPS      = 0x00000040,

     DLCONF_ALL               = 0x0000007F
} DFBDisplayLayerConfigFlags;

/*
 * Layer configuration
 */
typedef struct {
     DFBDisplayLayerConfigFlags    flags;         /* Which fields of the configuration are set */

     int                           width;         /* Pixel width */
     int                           height;        /* Pixel height */
     DFBSurfacePixelFormat         pixelformat;   /* Pixel format */
     DFBDisplayLayerBufferMode     buffermode;    /* Buffer mode */
     DFBDisplayLayerOptions        options;       /* Enable capabilities */
     DFBDisplayLayerSourceID       source;        /* Selected layer source */

     DFBSurfaceCapabilities        surface_caps;  /* Choose surface capabilities, available:
                                                     INTERLACED, SEPARATED, PREMULTIPLIED. */
} DFBDisplayLayerConfig;

/*
 * Screen Power Mode.
 */
typedef enum {
     DSPM_ON        = 0,
     DSPM_STANDBY,
     DSPM_SUSPEND,
     DSPM_OFF
} DFBScreenPowerMode;


/*
 * Capabilities of a mixer.
 */
typedef enum {
     DSMCAPS_NONE         = 0x00000000, /* None of these. */

     DSMCAPS_FULL         = 0x00000001, /* Can mix full tree as specified in the description. */
     DSMCAPS_SUB_LEVEL    = 0x00000002, /* Can set a maximum layer level, e.g. to exclude an OSD from VCR output. */
     DSMCAPS_SUB_LAYERS   = 0x00000004, /* Can select a number of layers individually as specified in the description. */
     DSMCAPS_BACKGROUND   = 0x00000008  /* Background color is configurable. */
} DFBScreenMixerCapabilities;


#define DFB_SCREEN_MIXER_DESC_NAME_LENGTH    24

/*
 * Description of a mixer.
 */
typedef struct {
     DFBScreenMixerCapabilities  caps;

     DFBDisplayLayerIDs          layers;             /* Visible layers if the
                                                        full tree is selected. */

     int                         sub_num;            /* Number of layers that can
                                                        be selected in sub mode. */
     DFBDisplayLayerIDs          sub_layers;         /* Layers available for sub mode
                                                        with layer selection. */

     char name[DFB_SCREEN_MIXER_DESC_NAME_LENGTH];   /* Mixer name */
} DFBScreenMixerDescription;

/*
 * Flags for mixer configuration.
 */
typedef enum {
     DSMCONF_NONE         = 0x00000000, /* None of these. */

     DSMCONF_TREE         = 0x00000001, /* (Sub) tree is selected. */
     DSMCONF_LEVEL        = 0x00000002, /* Level is specified. */
     DSMCONF_LAYERS       = 0x00000004, /* Layer selection is set. */

     DSMCONF_BACKGROUND   = 0x00000010, /* Background color is set. */

     DSMCONF_ALL          = 0x00000017
} DFBScreenMixerConfigFlags;

/*
 * (Sub) tree selection.
 */
typedef enum {
     DSMT_UNKNOWN         = 0x00000000, /* Unknown mode */

     DSMT_FULL            = 0x00000001, /* Full tree. */
     DSMT_SUB_LEVEL       = 0x00000002, /* Sub tree via maximum level. */
     DSMT_SUB_LAYERS      = 0x00000003  /* Sub tree via layer selection. */
} DFBScreenMixerTree;

/*
 * Configuration of a mixer.
 */
typedef struct {
     DFBScreenMixerConfigFlags   flags;      /* Validates struct members. */

     DFBScreenMixerTree          tree;       /* Selected (sub) tree. */

     int                         level;      /* Max. level of sub level mode. */
     DFBDisplayLayerIDs          layers;     /* Layers for sub layers mode. */

     DFBColor                    background; /* Background color. */
} DFBScreenMixerConfig;


/*
 * Capabilities of an output.
 */
typedef enum {
     DSOCAPS_NONE          = 0x00000000, /* None of these. */

     DSOCAPS_CONNECTORS    = 0x00000001, /* Output connectors are available. */

     DSOCAPS_ENCODER_SEL   = 0x00000010, /* Encoder can be selected. */
     DSOCAPS_SIGNAL_SEL    = 0x00000020, /* Signal(s) can be selected. */
     DSOCAPS_CONNECTOR_SEL = 0x00000040, /* Connector(s) can be selected. */
     DSOCAPS_SLOW_BLANKING = 0x00000080, /* Slow Blanking on outputs is supported. */
     DSOCAPS_RESOLUTION    = 0x00000100, /* Output Resolution can be changed. (global screen size)*/
     DSOCAPS_ALL           = 0x000001F1
} DFBScreenOutputCapabilities;

/*
 * Type of output connector.
 */
typedef enum {
     DSOC_UNKNOWN        = 0x00000000, /* Unknown type */

     DSOC_VGA            = 0x00000001, /* VGA connector */
     DSOC_SCART          = 0x00000002, /* SCART connector */
     DSOC_YC             = 0x00000004, /* Y/C connector */
     DSOC_CVBS           = 0x00000008, /* CVBS connector */
     DSOC_SCART2         = 0x00000010, /* 2nd SCART connector */
     DSOC_COMPONENT      = 0x00000020, /* Component video connector */
     DSOC_HDMI           = 0x00000040  /* HDMI connector */
} DFBScreenOutputConnectors;

/*
 * Type of output signal.
 */
typedef enum {
     DSOS_NONE           = 0x00000000, /* No signal */

     DSOS_VGA            = 0x00000001, /* VGA signal */
     DSOS_YC             = 0x00000002, /* Y/C signal */
     DSOS_CVBS           = 0x00000004, /* CVBS signal */
     DSOS_RGB            = 0x00000008, /* R/G/B signal */
     DSOS_YCBCR          = 0x00000010, /* Y/Cb/Cr signal */
     DSOS_HDMI           = 0x00000020, /* HDMI signal */
     DSOS_656            = 0x00000040  /* 656 Digital output signal */
} DFBScreenOutputSignals;


/*
 * Type of slow blanking signalling.
 */
typedef enum {
     DSOSB_OFF           = 0x00000000, /* No signal */
     DSOSB_16x9          = 0x00000001, /* 16*9 Widescreen signalling */
     DSOSB_4x3           = 0x00000002, /* 4*3 widescreen signalling */
     DSOSB_FOLLOW        = 0x00000004, /* Follow signalling */
     DSOSB_MONITOR       = 0x00000008  /* Monitor */
} DFBScreenOutputSlowBlankingSignals;

/**
 * Resolutions.  TV Standards implies too many things:
 *               resolution / encoding / frequency.
 */
typedef enum {
    DSOR_UNKNOWN   = 0x00000000, /* Unknown Resolution */
    DSOR_640_480   = 0x00000001, /* 640x480 Resolution */
    DSOR_720_480   = 0x00000002, /* 720x480 Resolution */
    DSOR_720_576   = 0x00000004, /* 720x576 Resolution */
    DSOR_800_600   = 0x00000008, /* 800x600 Resolution */
    DSOR_1024_768  = 0x00000010, /* 1024x768 Resolution */
    DSOR_1152_864  = 0x00000020, /* 1152x864 Resolution */
    DSOR_1280_720  = 0x00000040, /* 1280x720 Resolution */
    DSOR_1280_768  = 0x00000080, /* 1280x768 Resolution */
    DSOR_1280_960  = 0x00000100, /* 1280x960 Resolution */
    DSOR_1280_1024 = 0x00000200, /* 1280x1024 Resolution */
    DSOR_1400_1050 = 0x00000400, /* 1400x1050 Resolution */
    DSOR_1600_1200 = 0x00000800, /* 1600x1200 Resolution */
    DSOR_1920_1080 = 0x00001000, /* 1920x1080 Resolution */
    DSOR_ALL       = 0x00001FFF  /* All Resolution */
} DFBScreenOutputResolution;


#define DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH    24

/*
 * Description of a screen output.
 */
typedef struct {
     DFBScreenOutputCapabilities   caps;             /* Screen capabilities. */

     DFBScreenOutputConnectors     all_connectors;   /* Output connectors. */
     DFBScreenOutputSignals        all_signals;      /* Output signals. */
     DFBScreenOutputResolution     all_resolutions;  /* Output Resolutions */

     char name[DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH];  /* Output name */
} DFBScreenOutputDescription;

/*
 * Flags for screen output configuration.
 */
typedef enum {
     DSOCONF_NONE         = 0x00000000, /* None of these. */

     DSOCONF_ENCODER      = 0x00000001, /* Set encoder the signal(s) comes from. */
     DSOCONF_SIGNALS      = 0x00000002, /* Select signal(s) from encoder. */
     DSOCONF_CONNECTORS   = 0x00000004, /* Select output connector(s). */
     DSOCONF_SLOW_BLANKING= 0x00000008, /* Can select slow blanking support. */
     DSOCONF_RESOLUTION   = 0x00000010, /* Can change output resolution */
     
     DSOCONF_ALL          = 0x0000001F
} DFBScreenOutputConfigFlags;

/*
 * Configuration of an output.
 */
typedef struct {
     DFBScreenOutputConfigFlags  flags;          /* Validates struct members. */

     int                         encoder;        /* Chosen encoder. */
     DFBScreenOutputSignals      out_signals;    /* Selected encoder signal(s). */
     DFBScreenOutputConnectors   out_connectors; /* Selected output connector(s). */
     DFBScreenOutputSlowBlankingSignals     slow_blanking;/* Slow Blanking signals. */
     DFBScreenOutputResolution   resolution;     /* Output Resolution */
} DFBScreenOutputConfig;


/*
 * Capabilities of a display encoder.
 */
typedef enum {
     DSECAPS_NONE         = 0x00000000, /* None of these. */

     DSECAPS_TV_STANDARDS = 0x00000001, /* TV standards can be selected. */
     DSECAPS_TEST_PICTURE = 0x00000002, /* Test picture generation supported. */
     DSECAPS_MIXER_SEL    = 0x00000004, /* Mixer can be selected. */
     DSECAPS_OUT_SIGNALS  = 0x00000008, /* Different output signals are supported. */
     DSECAPS_SCANMODE     = 0x00000010, /* Can switch between interlaced and progressive output. */
     DSECAPS_FREQUENCY    = 0x00000020, /* Can switch between different frequencies. */

     DSECAPS_BRIGHTNESS   = 0x00000100, /* Adjustment of brightness is supported. */
     DSECAPS_CONTRAST     = 0x00000200, /* Adjustment of contrast is supported. */
     DSECAPS_HUE          = 0x00000400, /* Adjustment of hue is supported. */
     DSECAPS_SATURATION   = 0x00000800, /* Adjustment of saturation is supported. */

     DSECAPS_CONNECTORS   = 0x00001000, /* Select output connector(s). */
     DSECAPS_SLOW_BLANKING = 0x00002000, /* Slow Blanking on outputs is supported. */
     DSECAPS_RESOLUTION   = 0x00004000, /* Different encoder resolutions supported */

     DSECAPS_ALL          = 0x00007f3f
} DFBScreenEncoderCapabilities;

/*
 * Type of display encoder.
 */
typedef enum {
     DSET_UNKNOWN         = 0x00000000, /* Unknown type */

     DSET_CRTC            = 0x00000001, /* Encoder is a CRTC. */
     DSET_TV              = 0x00000002, /* TV output encoder. */
     DSET_DIGITAL         = 0x00000004  /* Support signals other than SD TV standards. */
} DFBScreenEncoderType;

/*
 * TV standards.
 */
typedef enum {
     DSETV_UNKNOWN        = 0x00000000, /* Unknown standard */

     DSETV_PAL            = 0x00000001, /* PAL */
     DSETV_NTSC           = 0x00000002, /* NTSC */
     DSETV_SECAM          = 0x00000004, /* SECAM */
     DSETV_PAL_60         = 0x00000008, /* PAL-60 */
     DSETV_PAL_BG         = 0x00000010, /* PAL BG support (specific) */
     DSETV_PAL_I          = 0x00000020, /* PAL I support (specific) */
     DSETV_PAL_M          = 0x00000040, /* PAL M support (specific) */
     DSETV_PAL_N          = 0x00000080, /* PAL N support (specific) */
     DSETV_PAL_NC         = 0x00000100, /* PAL NC support (specific) */
     DSETV_NTSC_M_JPN     = 0x00000200, /* NTSC_JPN support */
     DSETV_DIGITAL        = 0x00000400, /* TV standards from the digital domain.  specify resolution, scantype, frequency.*/
     DSETV_ALL            = 0x000007FF  /* All TV Standards*/
} DFBScreenEncoderTVStandards;

/*
 * Scan modes.
 */
typedef enum {
     DSESM_UNKNOWN        = 0x00000000, /* Unknown mode */

     DSESM_INTERLACED     = 0x00000001, /* Interlaced scan mode */
     DSESM_PROGRESSIVE    = 0x00000002  /* Progressive scan mode */
} DFBScreenEncoderScanMode;

/*
 * Frequency of output signal.
 */
typedef enum {
     DSEF_UNKNOWN        = 0x00000000, /* Unknown Frequency */

     DSEF_25HZ           = 0x00000001, /* 25 Hz Output. */
     DSEF_29_97HZ        = 0x00000002, /* 29.97 Hz Output. */
     DSEF_50HZ           = 0x00000004, /* 50 Hz Output. */
     DSEF_59_94HZ        = 0x00000008, /* 59.94 Hz Output. */
     DSEF_60HZ           = 0x00000010, /* 60 Hz Output. */
     DSEF_75HZ           = 0x00000020, /* 75 Hz Output. */
} DFBScreenEncoderFrequency;

#define DFB_SCREEN_ENCODER_DESC_NAME_LENGTH    24

/*
 * Description of a display encoder.
 */
typedef struct {
     DFBScreenEncoderCapabilities  caps;               /* Encoder capabilities. */
     DFBScreenEncoderType          type;               /* Type of encoder. */

     DFBScreenEncoderTVStandards   tv_standards;       /* Supported TV standards. */
     DFBScreenOutputSignals        out_signals;        /* Supported output signals. */
     DFBScreenOutputConnectors     all_connectors;     /* Supported output connectors */
     DFBScreenOutputResolution     all_resolutions;    /* Supported Resolutions*/

     char name[DFB_SCREEN_ENCODER_DESC_NAME_LENGTH];   /* Encoder name */
} DFBScreenEncoderDescription;

/*
 * Flags for display encoder configuration.
 */
typedef enum {
     DSECONF_NONE         = 0x00000000, /* None of these. */

     DSECONF_TV_STANDARD  = 0x00000001, /* Set TV standard. */
     DSECONF_TEST_PICTURE = 0x00000002, /* Set test picture mode. */
     DSECONF_MIXER        = 0x00000004, /* Select mixer. */
     DSECONF_OUT_SIGNALS  = 0x00000008, /* Select generated output signal(s). */
     DSECONF_SCANMODE     = 0x00000010, /* Select interlaced or progressive output. */
     DSECONF_TEST_COLOR   = 0x00000020, /* Set color for DSETP_SINGLE. */
     DSECONF_ADJUSTMENT   = 0x00000040, /* Set color adjustment. */
     DSECONF_FREQUENCY    = 0x00000080, /* Set Output Frequency*/

     DSECONF_CONNECTORS   = 0x00000100, /* Select output connector(s). */
     DSECONF_SLOW_BLANKING = 0x00000200, /* Can select slow blanking support. */
     DSECONF_RESOLUTION    = 0x00000400, /* Can change resolution of the encoder.*/
     
     DSECONF_ALL          = 0x000007FF
} DFBScreenEncoderConfigFlags;

/*
 * Test picture mode.
 */
typedef enum {
     DSETP_OFF      = 0x00000000,  /* Disable test picture. */

     DSETP_MULTI    = 0x00000001,  /* Show color bars. */
     DSETP_SINGLE   = 0x00000002,  /* Whole screen as defined in configuration. */

     DSETP_WHITE    = 0x00000010,  /* Whole screen (ff, ff, ff). */
     DSETP_YELLOW   = 0x00000020,  /* Whole screen (ff, ff, 00). */
     DSETP_CYAN     = 0x00000030,  /* Whole screen (00, ff, ff). */
     DSETP_GREEN    = 0x00000040,  /* Whole screen (00, ff, 00). */
     DSETP_MAGENTA  = 0x00000050,  /* Whole screen (ff, 00, ff). */
     DSETP_RED      = 0x00000060,  /* Whole screen (ff, 00, 00). */
     DSETP_BLUE     = 0x00000070,  /* Whole screen (00, 00, ff). */
     DSETP_BLACK    = 0x00000080   /* Whole screen (00, 00, 00). */
} DFBScreenEncoderTestPicture;

/*
 * Configuration of a display encoder.
 */
typedef struct {
     DFBScreenEncoderConfigFlags   flags;         /* Validates struct members. */

     DFBScreenEncoderTVStandards   tv_standard;   /* TV standard. */
     DFBScreenEncoderTestPicture   test_picture;  /* Test picture mode. */
     int                           mixer;         /* Selected mixer. */
     DFBScreenOutputSignals        out_signals;   /* Generated output signals. */
     DFBScreenOutputConnectors     out_connectors; /* Selected output connector(s). */
     DFBScreenOutputSlowBlankingSignals     slow_blanking;/* Slow Blanking signals. */

     DFBScreenEncoderScanMode      scanmode;      /* Interlaced or progressive output. */

     DFBColor                      test_color;    /* Color for DSETP_SINGLE. */

     DFBColorAdjustment            adjustment;    /* Color adjustment. */

     DFBScreenEncoderFrequency     frequency;     /* Selected Output Frequency*/
     DFBScreenOutputResolution     resolution;    /* Selected Output resolution*/
} DFBScreenEncoderConfig;


/*******************
 * IDirectFBScreen *
 *******************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBScreen,

   /** Retrieving information **/

     /*
      * Get the unique screen ID.
      */
     DFBResult (*GetID) (
          IDirectFBScreen                    *thiz,
          DFBScreenID                        *ret_screen_id
     );

     /*
      * Get a description of this screen, i.e. the capabilities.
      */
     DFBResult (*GetDescription) (
          IDirectFBScreen                    *thiz,
          DFBScreenDescription               *ret_desc
     );
     
     /*
      * Get the screen's width and height in pixels.
      */
     DFBResult (*GetSize) (
          IDirectFBScreen                    *thiz,
          int                                *ret_width,
          int                                *ret_height
     );


   /** Display Layers **/

     /*
      * Enumerate all existing display layers for this screen.
      *
      * Calls the given callback for each available display
      * layer. The callback is passed the layer id that can be
      * used to retrieve an interface to a specific layer using
      * IDirectFB::GetDisplayLayer().
      */
     DFBResult (*EnumDisplayLayers) (
          IDirectFBScreen                    *thiz,
          DFBDisplayLayerCallback             callback,
          void                               *callbackdata
     );


   /** Power management **/

     /*
      * Set screen power mode.
      */
     DFBResult (*SetPowerMode) (
          IDirectFBScreen                    *thiz,
          DFBScreenPowerMode                  mode
     );


   /** Synchronization **/

     /*
      * Wait for next vertical retrace.
      */
     DFBResult (*WaitForSync) (
          IDirectFBScreen                    *thiz
     );


   /** Mixers **/

     /*
      * Get a description of available mixers.
      *
      * All descriptions are written to the array pointed to by
      * <b>ret_descriptions</b>. The number of mixers is returned by
      * IDirectFBScreen::GetDescription().
      */
     DFBResult (*GetMixerDescriptions) (
          IDirectFBScreen                    *thiz,
          DFBScreenMixerDescription          *ret_descriptions
     );

     /*
      * Get current mixer configuration.
      */
     DFBResult (*GetMixerConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 mixer,
          DFBScreenMixerConfig               *ret_config
     );

     /*
      * Test mixer configuration.
      *
      * If configuration fails and 'ret_failed' is not NULL it will
      * indicate which fields of the configuration caused the error.
      */
     DFBResult (*TestMixerConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 mixer,
          const DFBScreenMixerConfig         *config,
          DFBScreenMixerConfigFlags          *ret_failed
     );

     /*
      * Set mixer configuration.
      */
     DFBResult (*SetMixerConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 mixer,
          const DFBScreenMixerConfig         *config
     );


   /** Encoders **/

     /*
      * Get a description of available display encoders.
      *
      * All descriptions are written to the array pointed to by
      * <b>ret_descriptions</b>. The number of encoders is returned by
      * IDirectFBScreen::GetDescription().
      */
     DFBResult (*GetEncoderDescriptions) (
          IDirectFBScreen                    *thiz,
          DFBScreenEncoderDescription        *ret_descriptions
     );

     /*
      * Get current encoder configuration.
      */
     DFBResult (*GetEncoderConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 encoder,
          DFBScreenEncoderConfig             *ret_config
     );

     /*
      * Test encoder configuration.
      *
      * If configuration fails and 'ret_failed' is not NULL it will
      * indicate which fields of the configuration caused the
      * error.
      */
     DFBResult (*TestEncoderConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 encoder,
          const DFBScreenEncoderConfig       *config,
          DFBScreenEncoderConfigFlags        *ret_failed
     );

     /*
      * Set encoder configuration.
      */
     DFBResult (*SetEncoderConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 encoder,
          const DFBScreenEncoderConfig       *config
     );


   /** Outputs **/

     /*
      * Get a description of available outputs.
      *
      * All descriptions are written to the array pointed to by
      * <b>ret_descriptions</b>. The number of outputs is returned by
      * IDirectFBScreen::GetDescription().
      */
     DFBResult (*GetOutputDescriptions) (
          IDirectFBScreen                    *thiz,
          DFBScreenOutputDescription         *ret_descriptions
     );

     /*
      * Get current output configuration.
      */
     DFBResult (*GetOutputConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 output,
          DFBScreenOutputConfig              *ret_config
     );

     /*
      * Test output configuration.
      *
      * If configuration fails and 'ret_failed' is not NULL it will
      * indicate which fields of the configuration caused the error.
      */
     DFBResult (*TestOutputConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 output,
          const DFBScreenOutputConfig        *config,
          DFBScreenOutputConfigFlags         *ret_failed
     );

     /*
      * Set output configuration.
      */
     DFBResult (*SetOutputConfiguration) (
          IDirectFBScreen                    *thiz,
          int                                 output,
          const DFBScreenOutputConfig        *config
     );
)


/*************************
 * IDirectFBDisplayLayer *
 *************************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBDisplayLayer,

   /** Information **/

     /*
      * Get the unique layer ID.
      */
     DFBResult (*GetID) (
          IDirectFBDisplayLayer              *thiz,
          DFBDisplayLayerID                  *ret_layer_id
     );

     /*
      * Get a description of this display layer, i.e. the capabilities.
      */
     DFBResult (*GetDescription) (
          IDirectFBDisplayLayer              *thiz,
          DFBDisplayLayerDescription         *ret_desc
     );

     /*
      * Get a description of available sources.
      *
      * All descriptions are written to the array pointed to by
      * <b>ret_descriptions</b>. The number of sources is returned by
      * IDirectFBDisplayLayer::GetDescription().
      */
     DFBResult (*GetSourceDescriptions) (
          IDirectFBDisplayLayer              *thiz,
          DFBDisplayLayerSourceDescription   *ret_descriptions
     );

     /*
      * For an interlaced display, this returns the currently inactive
      * field: 0 for the top field, and 1 for the bottom field.
      *
      * The inactive field is the one you should draw to next to avoid
      * tearing, the active field is the one currently being displayed.
      *
      * For a progressive output, this should always return 0.  We should
      * also have some other call to indicate whether the display layer
      * is interlaced or progressive, but this is a start.
      */
     DFBResult (*GetCurrentOutputField) (
          IDirectFBDisplayLayer              *thiz,
          int                                *ret_field
     );


   /** Interfaces **/

     /*
      * Get an interface to layer's surface.
      *
      * Only available in exclusive mode.
      */
     DFBResult (*GetSurface) (
          IDirectFBDisplayLayer              *thiz,
          IDirectFBSurface                  **ret_interface
     );

     /*
      * Get an interface to the screen to which the layer belongs.
      */
     DFBResult (*GetScreen) (
          IDirectFBDisplayLayer              *thiz,
          IDirectFBScreen                   **ret_interface
     );


   /** Configuration **/

     /*
      * Set cooperative level to get control over the layer
      * or the windows within this layer.
      */
     DFBResult (*SetCooperativeLevel) (
          IDirectFBDisplayLayer              *thiz,
          DFBDisplayLayerCooperativeLevel     level
     );

     /*
      * Get current layer configuration.
      */
     DFBResult (*GetConfiguration) (
          IDirectFBDisplayLayer              *thiz,
          DFBDisplayLayerConfig              *ret_config
     );

     /*
      * Test layer configuration.
      *
      * If configuration fails and 'failed' is not NULL it will
      * indicate which fields of the configuration caused the
      * error.
      */
     DFBResult (*TestConfiguration) (
          IDirectFBDisplayLayer              *thiz,
          const DFBDisplayLayerConfig        *config,
          DFBDisplayLayerConfigFlags         *ret_failed
     );

     /*
      * Set layer configuration.
      *
      * Only available in exclusive or administrative mode.
      */
     DFBResult (*SetConfiguration) (
          IDirectFBDisplayLayer              *thiz,
          const DFBDisplayLayerConfig        *config
     );


   /** Layout **/

     /*
      * Set location on screen as normalized values.
      *
      * So the whole screen is 0.0, 0.0, -1.0, 1.0.
      */
     DFBResult (*SetScreenLocation) (
          IDirectFBDisplayLayer              *thiz,
          float                               x,
          float                               y,
          float                               width,
          float                               height
     );

     /*
      * Set location on screen in pixels.
      */
     DFBResult (*SetScreenPosition) (
          IDirectFBDisplayLayer              *thiz,
          int                                 x,
          int                                 y
     );

     /*
      * Set location on screen in pixels.
      */
     DFBResult (*SetScreenRectangle) (
          IDirectFBDisplayLayer              *thiz,
          int                                 x,
          int                                 y,
          int                                 width,
          int                                 height
     );


   /** Misc Settings **/

     /*
      * Set global alpha factor for blending with layer(s) below.
      */
     DFBResult (*SetOpacity) (
          IDirectFBDisplayLayer              *thiz,
          u8                                  opacity
     );

     /*
      * Set the source rectangle.
      *
      * Only this part of the layer will be displayed.
      */
     DFBResult (*SetSourceRectangle) (
          IDirectFBDisplayLayer              *thiz,
          int                                 x,
          int                                 y,
          int                                 width,
          int                                 height
     );

     /*
      * For an interlaced display, this sets the field parity.
      *
      * field: 0 for top field first, and 1 for bottom field first.
      */
     DFBResult (*SetFieldParity) (
          IDirectFBDisplayLayer              *thiz,
          int                                 field
     );

     /*
      * Set the clipping region(s).
      *
      * If supported, this method sets the clipping <b>regions</b> that are used to
      * to enable or disable visibility of parts of the layer. The <b>num_regions</b>
      * must not exceed the limit as stated in the display layer description.
      *
      * If <b>positive</b> is DFB_TRUE the layer will be shown only in these regions,
      * otherwise it's shown as usual except in these regions.
      *
      * Also see IDirectFBDisplayLayer::GetDescription().
      */
     DFBResult (*SetClipRegions) (
          IDirectFBDisplayLayer              *thiz,
          const DFBRegion                    *regions,
          int                                 num_regions,
          DFBBoolean                          positive
     );


   /** Color keys **/

     /*
      * Set the source color key.
      *
      * If a pixel of the layer matches this color the underlying
      * pixel is visible at this point.
      */
     DFBResult (*SetSrcColorKey) (
          IDirectFBDisplayLayer              *thiz,
          u8                                  r,
          u8                                  g,
          u8                                  b
     );

     /*
      * Set the destination color key.
      *
      * The layer is only visible at points where the underlying
      * pixel matches this color.
      */
     DFBResult (*SetDstColorKey) (
          IDirectFBDisplayLayer              *thiz,
          u8                                  r,
          u8                                  g,
          u8                                  b
     );


   /** Z Order **/

     /*
      * Get the current display layer level.
      *
      * The level describes the z axis position of a layer. The
      * primary layer is always on level zero unless a special
      * driver adds support for level adjustment on the primary
      * layer.  Layers above have a positive level, e.g. video
      * overlays.  Layers below have a negative level, e.g. video
      * underlays or background layers.
      */
     DFBResult (*GetLevel) (
          IDirectFBDisplayLayer              *thiz,
          int                                *ret_level
     );

     /*
      * Set the display layer level.
      *
      * Moves the layer to the specified level. The order of all
      * other layers won't be changed. Note that only a few
      * layers support level adjustment which is reflected by
      * their capabilities.
      */
     DFBResult (*SetLevel) (
          IDirectFBDisplayLayer              *thiz,
          int                                 level
     );


   /** Background handling **/

     /*
      * Set the erase behaviour for windowstack repaints.
      *
      * Only available in exclusive or administrative mode.
      */
     DFBResult (*SetBackgroundMode) (
          IDirectFBDisplayLayer              *thiz,
          DFBDisplayLayerBackgroundMode       mode
     );

     /*
      * Set the background image for the imaged background mode.
      *
      * Only available in exclusive or administrative mode.
      */
     DFBResult (*SetBackgroundImage) (
          IDirectFBDisplayLayer              *thiz,
          IDirectFBSurface                   *surface
     );

     /*
      * Set the color for a solid colored background.
      *
      * Only available in exclusive or administrative mode.
      */
     DFBResult (*SetBackgroundColor) (
          IDirectFBDisplayLayer              *thiz,
          u8                                  r,
          u8                                  g,
          u8                                  b,
          u8                                  a
     );

   /** Color adjustment **/

     /*
      * Get the layers color adjustment.
      */
     DFBResult (*GetColorAdjustment) (
          IDirectFBDisplayLayer              *thiz,
          DFBColorAdjustment                 *ret_adj
     );

     /*
      * Set the layers color adjustment.
      *
      * Only available in exclusive or administrative mode.
      *
      * This function only has an effect if the underlying
      * hardware supports this operation. Check the layers
      * capabilities to find out if this is the case.
      */
     DFBResult (*SetColorAdjustment) (
          IDirectFBDisplayLayer              *thiz,
          const DFBColorAdjustment           *adj
     );


   /** Windows **/

     /*
      * Create a window within this layer given a
      * description of the window that is to be created.
      */
     DFBResult (*CreateWindow) (
          IDirectFBDisplayLayer              *thiz,
          const DFBWindowDescription         *desc,
          IDirectFBWindow                   **ret_interface
     );

     /*
      * Retrieve an interface to an existing window.
      *
      * The window is identified by its window id.
      */
     DFBResult (*GetWindow) (
          IDirectFBDisplayLayer              *thiz,
          DFBWindowID                         window_id,
          IDirectFBWindow                   **ret_interface
     );


   /** Cursor handling **/

     /*
      * Enable/disable the mouse cursor for this layer.
      *
      * Windows on a layer will only receive motion events if
      * the cursor is enabled. This function is only available
      * in exclusive/administrative mode.
      */
     DFBResult (*EnableCursor) (
          IDirectFBDisplayLayer              *thiz,
          int                                 enable
     );

     /*
      * Returns the x/y coordinates of the layer's mouse cursor.
      */
     DFBResult (*GetCursorPosition) (
          IDirectFBDisplayLayer              *thiz,
          int                                *ret_x,
          int                                *ret_y
     );

     /*
      * Move cursor to specified position.
      *
      * Handles movement like a real one, i.e. generates events.
      */
     DFBResult (*WarpCursor) (
          IDirectFBDisplayLayer              *thiz,
          int                                 x,
          int                                 y
     );

     /*
      * Set cursor acceleration.
      *
      * Sets the acceleration of cursor movements. The amount
      * beyond the 'threshold' will be multiplied with the
      * acceleration factor. The acceleration factor is
      * 'numerator/denominator'.
      */
     DFBResult (*SetCursorAcceleration) (
          IDirectFBDisplayLayer              *thiz,
          int                                 numerator,
          int                                 denominator,
          int                                 threshold
     );

     /*
      * Set the cursor shape and the hotspot.
      */
     DFBResult (*SetCursorShape) (
          IDirectFBDisplayLayer              *thiz,
          IDirectFBSurface                   *shape,
          int                                 hot_x,
          int                                 hot_y
     );

     /*
      * Set the cursor opacity.
      *
      * This function is especially useful if you want
      * to hide the cursor but still want windows on this
      * display layer to receive motion events. In this
      * case, simply set the cursor opacity to zero.
      */
     DFBResult (*SetCursorOpacity) (
          IDirectFBDisplayLayer              *thiz,
          u8                                  opacity
     );


   /** Synchronization **/

     /*
      * Wait for next vertical retrace.
      */
     DFBResult (*WaitForSync) (
          IDirectFBDisplayLayer              *thiz
     );


   /** Contexts **/

     /*
      * Switch the layer context.
      *
      * Switches to the shared context unless <b>exclusive</b> is DFB_TRUE
      * and the cooperative level of this interface is DLSCL_EXCLUSIVE.
      */
     DFBResult (*SwitchContext) (
          IDirectFBDisplayLayer              *thiz,
          DFBBoolean                          exclusive
     );


   /** Rotation **/

     /*
      * Set the rotation of data within the layer.
      *
      * Only available in exclusive or administrative mode.
      *
      * Any <b>rotation</b> other than 0 or 180 is not supported yet.
      *
      * No layer hardware feature usage, only rotated blitting yet.
      */
     DFBResult (*SetRotation) (
          IDirectFBDisplayLayer              *thiz,
          int                                 rotation
     );
)


/*
 * Flipping flags controlling the behaviour of IDirectFBSurface::Flip().
 */
typedef enum {
     DSFLIP_NONE         = 0x00000000,  /* None of these. */

     DSFLIP_WAIT         = 0x00000001,  /* Flip() returns upon vertical sync. Flipping is still done
                                           immediately unless DSFLIP_ONSYNC is specified, too.  */
     DSFLIP_BLIT         = 0x00000002,  /* Copy from back buffer to front buffer rather than
                                           just swapping these buffers. This behaviour is enforced
                                           if the region passed to Flip() is not NULL or if the
                                           surface being flipped is a sub surface. */
     DSFLIP_ONSYNC       = 0x00000004,  /* Do the actual flipping upon the next vertical sync.
                                           The Flip() method will still return immediately unless
                                           DSFLIP_WAIT is specified, too. */

     DSFLIP_PIPELINE     = 0x00000008,

     DSFLIP_ONCE         = 0x00000010,

     DSFLIP_WAITFORSYNC  = DSFLIP_WAIT | DSFLIP_ONSYNC
} DFBSurfaceFlipFlags;

/*
 * Flags controlling the text layout.
 */
typedef enum {
     DSTF_LEFT           = 0x00000000,  /* left aligned */
     DSTF_CENTER         = 0x00000001,  /* horizontally centered */
     DSTF_RIGHT          = 0x00000002,  /* right aligned */

     DSTF_TOP            = 0x00000004,  /* y specifies the top
                                           instead of the baseline */
     DSTF_BOTTOM         = 0x00000008,  /* y specifies the bottom
                                           instead of the baseline */

     DSTF_TOPLEFT        = DSTF_TOP | DSTF_LEFT,
     DSTF_TOPCENTER      = DSTF_TOP | DSTF_CENTER,
     DSTF_TOPRIGHT       = DSTF_TOP | DSTF_RIGHT,

     DSTF_BOTTOMLEFT     = DSTF_BOTTOM | DSTF_LEFT,
     DSTF_BOTTOMCENTER   = DSTF_BOTTOM | DSTF_CENTER,
     DSTF_BOTTOMRIGHT    = DSTF_BOTTOM | DSTF_RIGHT
} DFBSurfaceTextFlags;

/*
 * Flags defining the type of data access.
 * These are important for surface swapping management.
 */
typedef enum {
     DSLF_READ           = 0x00000001,  /* request read access while
                                           surface is locked */
     DSLF_WRITE          = 0x00000002   /* request write access */
} DFBSurfaceLockFlags;

/*
 * Available Porter/Duff rules.
 */
typedef enum {
                               /* pixel = (source * fs + destination * fd),
                                  sa = source alpha,
                                  da = destination alpha */
     DSPD_NONE           =  0, /* fs: sa      fd: 1.0-sa (defaults) */
     DSPD_CLEAR          =  1, /* fs: 0.0     fd: 0.0    */
     DSPD_SRC            =  2, /* fs: 1.0     fd: 0.0    */
     DSPD_SRC_OVER       =  3, /* fs: 1.0     fd: 1.0-sa */
     DSPD_DST_OVER       =  4, /* fs: 1.0-da  fd: 1.0    */
     DSPD_SRC_IN         =  5, /* fs: da      fd: 0.0    */
     DSPD_DST_IN         =  6, /* fs: 0.0     fd: sa     */
     DSPD_SRC_OUT        =  7, /* fs: 1.0-da  fd: 0.0    */
     DSPD_DST_OUT        =  8, /* fs: 0.0     fd: 1.0-sa */
     DSPD_SRC_ATOP       =  9, /* fs: da      fd: 1.0-sa */
     DSPD_DST_ATOP       = 10, /* fs: 1.0-da  fd: sa     */
     DSPD_ADD            = 11, /* fs: 1.0     fd: 1.0    */
     DSPD_XOR            = 12, /* fs: 1.0-da  fd: 1.0-sa */
     DSPD_DST            = 13, /* fs: 0.0     fd: 1.0    */
} DFBSurfacePorterDuffRule;

/*
 * Blend functions to use for source and destination blending
 */
typedef enum {
     /*
      * pixel color = sc * cf[sf] + dc * cf[df]
      * pixel alpha = sa * af[sf] + da * af[df]
      * sc = source color
      * sa = source alpha
      * dc = destination color
      * da = destination alpha
      * sf = source blend function
      * df = destination blend function
      * cf[x] = color factor for blend function x
      * af[x] = alpha factor for blend function x
      */
     DSBF_UNKNOWN            = 0,  /*                             */
     DSBF_ZERO               = 1,  /* cf:    0           af:    0 */
     DSBF_ONE                = 2,  /* cf:    1           af:    1 */
     DSBF_SRCCOLOR           = 3,  /* cf:   sc           af:   sa */
     DSBF_INVSRCCOLOR        = 4,  /* cf: 1-sc           af: 1-sa */
     DSBF_SRCALPHA           = 5,  /* cf:   sa           af:   sa */
     DSBF_INVSRCALPHA        = 6,  /* cf: 1-sa           af: 1-sa */
     DSBF_DESTALPHA          = 7,  /* cf:   da           af:   da */
     DSBF_INVDESTALPHA       = 8,  /* cf: 1-da           af: 1-da */
     DSBF_DESTCOLOR          = 9,  /* cf:   dc           af:   da */
     DSBF_INVDESTCOLOR       = 10, /* cf: 1-dc           af: 1-da */
     DSBF_SRCALPHASAT        = 11, /* cf: min(sa, 1-da)  af:    1 */
} DFBSurfaceBlendFunction;

/*
 * Transformed vertex of a textured triangle.
 */
typedef struct {
     float x;   /* Destination X coordinate (in pixels) */
     float y;   /* Destination Y coordinate (in pixels) */
     float z;   /* Z coordinate */
     float w;   /* W coordinate */

     float s;   /* Texture S coordinate */
     float t;   /* Texture T coordinate */
} DFBVertex;

/*
 * Way of building triangles from the list of vertices.
 */
typedef enum {
     DTTF_LIST,  /* 0/1/2  3/4/5  6/7/8 ... */
     DTTF_STRIP, /* 0/1/2  1/2/3  2/3/4 ... */
     DTTF_FAN    /* 0/1/2  0/2/3  0/3/4 ... */
} DFBTriangleFormation;

/*
 * Flags controlling surface masks set via IDirectFBSurface::SetSourceMask().
 */
typedef enum {
     DSMF_NONE      = 0x00000000,  /* None of these. */

     DSMF_STENCIL   = 0x00000001,  /* Take <b>x</b> and <b>y</b> as fixed start coordinates in the mask. */

     DSMF_ALL       = 0x00000001,  /* All of these. */
} DFBSurfaceMaskFlags;

/********************
 * IDirectFBSurface *
 ********************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBSurface,

   /** Retrieving information **/

     /*
      * Return the capabilities of this surface.
      */
     DFBResult (*GetCapabilities) (
          IDirectFBSurface         *thiz,
          DFBSurfaceCapabilities   *ret_caps
     );

     /*
      * Get the surface's position in pixels.
      */
     DFBResult (*GetPosition) (
          IDirectFBSurface         *thiz,
          int                      *ret_x,
          int                      *ret_y
     );

     /*
      * Get the surface's width and height in pixels.
      */
     DFBResult (*GetSize) (
          IDirectFBSurface         *thiz,
          int                      *ret_width,
          int                      *ret_height
     );

     /*
      * Created sub surfaces might be clipped by their parents,
      * this function returns the resulting rectangle relative
      * to this surface.
      *
      * For non sub surfaces this function returns
      * { 0, 0, width, height }.
      */
     DFBResult (*GetVisibleRectangle) (
          IDirectFBSurface         *thiz,
          DFBRectangle             *ret_rect
     );

     /*
      * Get the current pixel format.
      */
     DFBResult (*GetPixelFormat) (
          IDirectFBSurface         *thiz,
          DFBSurfacePixelFormat    *ret_format
     );

     /*
      * Get a mask of drawing functions that are hardware
      * accelerated with the current settings.
      *
      * If a source surface is specified the mask will also
      * contain accelerated blitting functions.  Note that there
      * is no guarantee that these will actually be accelerated
      * since the surface storage (video/system) is examined only
      * when something actually gets drawn or blitted.
      */
     DFBResult (*GetAccelerationMask) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *source,
          DFBAccelerationMask      *ret_mask
     );


   /** Palette & Alpha Ramp **/

     /*
      * Get access to the surface's palette.
      *
      * Returns an interface that can be used to gain
      * read and/or write access to the surface's palette.
      */
     DFBResult (*GetPalette) (
          IDirectFBSurface         *thiz,
          IDirectFBPalette        **ret_interface
     );

     /*
      * Change the surface's palette.
      */
     DFBResult (*SetPalette) (
          IDirectFBSurface         *thiz,
          IDirectFBPalette         *palette
     );

     /*
      * Set the alpha ramp for formats with one or two alpha bits.
      *
      * Either all four values or the first and the
      * last one are used, depending on the format.
      * Default values are: 0x00, 0x55, 0xaa, 0xff.
      */
     DFBResult (*SetAlphaRamp) (
          IDirectFBSurface         *thiz,
          u8                        a0,
          u8                        a1,
          u8                        a2,
          u8                        a3
     );


   /** Buffer operations **/

     /*
      * Lock the surface for the access type specified.
      *
      * Returns a data pointer and the line pitch of it.
      */
     DFBResult (*Lock) (
          IDirectFBSurface         *thiz,
          DFBSurfaceLockFlags       flags,
          void                    **ret_ptr,
          int                      *ret_pitch
     );

     /*
      * Returns the framebuffer offset of a locked surface.
      *
      * The surface must exist in video memory.
      */
     DFBResult (*GetFramebufferOffset) (
          IDirectFBSurface *thiz,
          int              *offset
     );

     /*
      * Unlock the surface after direct access.
      */
     DFBResult (*Unlock) (
          IDirectFBSurface         *thiz
     );

     /*
      * Flip/Update surface buffers.
      *
      * If no region is specified the whole surface is flipped,
      * otherwise blitting is used to update the region.
      * If surface capabilities don't include DSCAPS_FLIPPING,
      * this method has the effect to make visible changes
      * made to the surface contents.
      */
     DFBResult (*Flip) (
          IDirectFBSurface         *thiz,
          const DFBRegion          *region,
          DFBSurfaceFlipFlags       flags
     );

     /*
      * Set the active field.
      *
      * Interlaced surfaces consist of two fields. Software driven
      * deinterlacing uses this method to manually switch the field
      * that is displayed, e.g. scaled up vertically by two.
      */
     DFBResult (*SetField) (
          IDirectFBSurface         *thiz,
          int                       field
     );

     /*
      * Clear the surface and its depth buffer if existent.
      *
      * Fills the whole (sub) surface with the specified color while ignoring
      * drawing flags and color of the current state, but limited to the current clip.
      *
      * As with all drawing and blitting functions the backbuffer is written to.
      * If you are initializing a double buffered surface you may want to clear both
      * buffers by doing a Clear-Flip-Clear sequence.
      */
     DFBResult (*Clear) (
          IDirectFBSurface         *thiz,
          u8                        r,
          u8                        g,
          u8                        b,
          u8                        a
     );


   /** Drawing/blitting control **/

     /*
      * Set the clipping region used to limit the area for
      * drawing, blitting and text functions.
      *
      * If no region is specified (NULL passed) the clip is set
      * to the surface extents (initial clip).
      */
     DFBResult (*SetClip) (
          IDirectFBSurface         *thiz,
          const DFBRegion          *clip
     );

     /*
      * Get the clipping region used to limit the area for
      * drawing, blitting and text functions.
      */
     DFBResult (*GetClip) (
          IDirectFBSurface         *thiz,
          DFBRegion                *ret_clip
     );

     /*
      * Set the color used for drawing/text functions or
      * alpha/color modulation (blitting functions).
      *
      * If you are not using the alpha value it should be set to
      * 0xff to ensure visibility when the code is ported to or
      * used for surfaces with an alpha channel.
      *
      * This method should be avoided for surfaces with an indexed
      * pixelformat, e.g. DSPF_LUT8, otherwise an expensive search
      * in the color/alpha lookup table occurs.
      */
     DFBResult (*SetColor) (
          IDirectFBSurface         *thiz,
          u8                        r,
          u8                        g,
          u8                        b,
          u8                        a
     );

     /*
      * Set the color like with SetColor() but using
      * an index to the color/alpha lookup table.
      *
      * This method is only supported by surfaces with an
      * indexed pixelformat, e.g. DSPF_LUT8. For these formats
      * this method should be used instead of SetColor().
      */
     DFBResult (*SetColorIndex) (
          IDirectFBSurface         *thiz,
          unsigned int              index
     );

     /*
      * Set the blend function that applies to the source.
      */
     DFBResult (*SetSrcBlendFunction) (
          IDirectFBSurface         *thiz,
          DFBSurfaceBlendFunction   function
     );

     /*
      * Set the blend function that applies to the destination.
      */
     DFBResult (*SetDstBlendFunction) (
          IDirectFBSurface         *thiz,
          DFBSurfaceBlendFunction   function
     );

     /*
      * Set the source and destination blend function by
      * specifying a Porter/Duff rule.
      */
     DFBResult (*SetPorterDuff) (
          IDirectFBSurface         *thiz,
          DFBSurfacePorterDuffRule  rule
     );

     /*
      * Set the source color key, i.e. the color that is excluded
      * when blitting FROM this surface TO another that has
      * source color keying enabled.
      */
     DFBResult (*SetSrcColorKey) (
          IDirectFBSurface         *thiz,
          u8                        r,
          u8                        g,
          u8                        b
     );

     /*
      * Set the source color key like with SetSrcColorKey() but using
      * an index to the color/alpha lookup table.
      *
      * This method is only supported by surfaces with an
      * indexed pixelformat, e.g. DSPF_LUT8. For these formats
      * this method should be used instead of SetSrcColorKey().
      */
     DFBResult (*SetSrcColorKeyIndex) (
          IDirectFBSurface         *thiz,
          unsigned int              index
     );

     /*
      * Set the destination color key, i.e. the only color that
      * gets overwritten by drawing and blitting to this surface
      * when destination color keying is enabled.
      */
     DFBResult (*SetDstColorKey) (
          IDirectFBSurface         *thiz,
          u8                        r,
          u8                        g,
          u8                        b
     );

     /*
      * Set the destination color key like with SetDstColorKey() but using
      * an index to the color/alpha lookup table.
      *
      * This method is only supported by surfaces with an
      * indexed pixelformat, e.g. DSPF_LUT8. For these formats
      * this method should be used instead of SetDstColorKey().
      */
     DFBResult (*SetDstColorKeyIndex) (
          IDirectFBSurface         *thiz,
          unsigned int              index
     );



   /** Blitting functions **/

     /*
      * Set the flags for all subsequent blitting commands.
      */
     DFBResult (*SetBlittingFlags) (
          IDirectFBSurface         *thiz,
          DFBSurfaceBlittingFlags   flags
     );

     /*
      * Blit an area from the source to this surface.
      *
      * Pass a NULL rectangle to use the whole source surface.
      * Source may be the same surface.
      */
     DFBResult (*Blit) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *source,
          const DFBRectangle       *source_rect,
          int                       x,
          int                       y
     );

     /*
      * Blit an area from the source tiled to this surface.
      *
      * Pass a NULL rectangle to use the whole source surface.
      * Source may be the same surface.
      */
     DFBResult (*TileBlit) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *source,
          const DFBRectangle       *source_rect,
          int                       x,
          int                       y
     );

     /*
      * Blit a bunch of areas at once.
      *
      * Source may be the same surface.
      */
     DFBResult (*BatchBlit) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *source,
          const DFBRectangle       *source_rects,
          const DFBPoint           *dest_points,
          int                       num
     );

     /*
      * Blit an area scaled from the source to the destination
      * rectangle.
      *
      * Pass a NULL rectangle to use the whole source surface.
      */
     DFBResult (*StretchBlit) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *source,
          const DFBRectangle       *source_rect,
          const DFBRectangle       *destination_rect
     );

     /*
      * Preliminary texture mapping support.
      *
      * Maps a <b>texture</b> onto triangles being built
      * from <b>vertices</b> according to the chosen <b>formation</b>.
      *
      * Optional <b>indices</b> can be used to avoid rearrangement of vertex lists,
      * otherwise the vertex list is processed consecutively, i.e. as if <b>indices</b>
      * are ascending numbers starting at zero.
      *
      * Either the number of <b>indices</b> (if non NULL) or the number of <b>vertices</b> is
      * specified by <b>num</b> and has to be three at least. If the chosen <b>formation</b>
      * is DTTF_LIST it also has to be a multiple of three.
      */
     DFBResult (*TextureTriangles) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *texture,
          const DFBVertex          *vertices,
          const int                *indices,
          int                       num,
          DFBTriangleFormation      formation
     );


   /** Drawing functions **/

     /*
      * Set the flags for all subsequent drawing commands.
      */
     DFBResult (*SetDrawingFlags) (
          IDirectFBSurface         *thiz,
          DFBSurfaceDrawingFlags    flags
     );

     /*
      * Fill the specified rectangle with the given color
      * following the specified flags.
      */
     DFBResult (*FillRectangle) (
          IDirectFBSurface         *thiz,
          int                       x,
          int                       y,
          int                       w,
          int                       h
     );

     /*
      * Draw an outline of the specified rectangle with the given
      * color following the specified flags.
      */
     DFBResult (*DrawRectangle) (
          IDirectFBSurface         *thiz,
          int                       x,
          int                       y,
          int                       w,
          int                       h
     );

     /*
      * Draw a line from one point to the other with the given color
      * following the drawing flags.
      */
     DFBResult (*DrawLine) (
          IDirectFBSurface         *thiz,
          int                       x1,
          int                       y1,
          int                       x2,
          int                       y2
     );

     /*
      * Draw 'num_lines' lines with the given color following the
      * drawing flags. Each line specified by a DFBRegion.
      */
     DFBResult (*DrawLines) (
          IDirectFBSurface         *thiz,
          const DFBRegion          *lines,
          unsigned int              num_lines
     );

     /*
      * Fill a non-textured triangle.
      */
     DFBResult (*FillTriangle) (
          IDirectFBSurface         *thiz,
          int                       x1,
          int                       y1,
          int                       x2,
          int                       y2,
          int                       x3,
          int                       y3
     );

     /*
      * Fill a bunch of rectangles with a single call.
      *
      * Fill <b>num</b> rectangles with the current color following the
      * drawing flags. Each rectangle specified by a DFBRectangle.
      */
     DFBResult (*FillRectangles) (
          IDirectFBSurface         *thiz,
          const DFBRectangle       *rects,
          unsigned int              num
     );

     /*
      * Fill spans specified by x and width.
      *
      * Fill <b>num</b> spans with the given color following the
      * drawing flags. Each span is specified by a DFBSpan.
      */
     DFBResult (*FillSpans) (
          IDirectFBSurface         *thiz,
          int                       y,
          const DFBSpan            *spans,
          unsigned int              num
     );
     
     /*
      * Fill a bunch of triangles with a single call.
      *
      * Fill <b>num</b> triangles with the current color following the
      * drawing flags. Each triangle specified by a DFBTriangle.
      */
     DFBResult (*FillTriangles) (
          IDirectFBSurface         *thiz,
          const DFBTriangle        *tris,
          unsigned int              num
     );


   /** Text functions **/

     /*
      * Set the font used by DrawString() and DrawGlyph().
      * You can pass NULL here to unset the font.
      */
     DFBResult (*SetFont) (
          IDirectFBSurface         *thiz,
          IDirectFBFont            *font
     );

     /*
      * Get the font associated with a surface.
      *
      * This function increases the font's reference count.
      */
     DFBResult (*GetFont) (
          IDirectFBSurface         *thiz,
          IDirectFBFont           **ret_font
     );

     /*
      * Draw a string at the specified position with the
      * given color following the specified flags.
      *
      * Bytes specifies the number of bytes to take from the
      * string or -1 for the complete NULL-terminated string. You
      * need to set a font using the SetFont() method before
      * calling this function.
      */
     DFBResult (*DrawString) (
          IDirectFBSurface         *thiz,
          const char               *text,
          int                       bytes,
          int                       x,
          int                       y,
          DFBSurfaceTextFlags       flags
     );

     /*
      * Draw a single glyph specified by its character code at the
      * specified position with the given color following the
      * specified flags.
      *
      * If font was loaded with the DFFA_NOCHARMAP flag, index specifies
      * the raw glyph index in the font.
      *
      * You need to set a font using the SetFont() method before
      * calling this function.
      */
     DFBResult (*DrawGlyph) (
          IDirectFBSurface         *thiz,
          unsigned int              character,
          int                       x,
          int                       y,
          DFBSurfaceTextFlags       flags
     );

     /*
      * Change the encoding used for text rendering.
      */
     DFBResult (*SetEncoding) (
          IDirectFBSurface         *thiz,
          DFBTextEncodingID         encoding
     );


   /** Lightweight helpers **/

     /*
      * Get an interface to a sub area of this surface.
      *
      * No image data is duplicated, this is a clipped graphics
      * within the original surface. This is very helpful for
      * lightweight components in a GUI toolkit.  The new
      * surface's state (color, drawingflags, etc.) is
      * independent from this one. So it's a handy graphics
      * context.  If no rectangle is specified, the whole surface
      * (or a part if this surface is a subsurface itself) is
      * represented by the new one.
      */
     DFBResult (*GetSubSurface) (
          IDirectFBSurface         *thiz,
          const DFBRectangle       *rect,
          IDirectFBSurface        **ret_interface
     );


   /** OpenGL **/

     /*
      * Get an OpenGL context for this surface.
      */
     DFBResult (*GetGL) (
          IDirectFBSurface         *thiz,
          IDirectFBGL             **ret_interface
     );


   /** Debug **/

     /*
      * Dump the contents of the surface to one or two files.
      *
      * Creates a PPM file containing the RGB data and a PGM file with
      * the alpha data if present.
      *
      * The complete filenames will be
      * <b>directory</b>/<b>prefix</b>_<i>####</i>.ppm for RGB and
      * <b>directory</b>/<b>prefix</b>_<i>####</i>.pgm for the alpha channel
      * if present. Example: "/directory/prefix_0000.ppm". No existing files
      * will be overwritten.
      */
     DFBResult (*Dump) (
          IDirectFBSurface         *thiz,
          const char               *directory,
          const char               *prefix
     );

     /*
      * Disable hardware acceleration.
      *
      * If any function in <b>mask</b> is set, acceleration will not be used for it.<br/>
      * Default is DFXL_NONE.
      */
     DFBResult (*DisableAcceleration) (
          IDirectFBSurface         *thiz,
          DFBAccelerationMask       mask
     );


   /** Resources **/

     /*
      * Release possible reference to source surface.
      *
      * For performance reasons the last surface that has been used for Blit() and others stays
      * attached to the state of the destination surface to save the overhead of reprogramming
      * the same values each time.
      *
      * That leads to the last source being still around regardless of it being released
      * via its own interface. The worst case is generation of thumbnails using StretchBlit()
      * from a huge surface to a small one. The small thumbnail surface keeps the big one alive,
      * because no other blitting will be done to the small surface afterwards.
      *
      * To solve this, here's the method applications should use in such a case.
      */
     DFBResult (*ReleaseSource) (
          IDirectFBSurface         *thiz
     );


   /** Blitting control **/

     /*
      * Set index translation table.
      *
      * Set the translation table used for fast indexed to indexed
      * pixel format conversion.
      *
      * A negative index means that the pixel will not be written.
      *
      * Undefined indices will be treated like negative ones.
      */
     DFBResult (*SetIndexTranslation) (
          IDirectFBSurface         *thiz,
          const int                *indices,
          int                       num_indices
     );


   /** Rendering **/

     /*
      * Set options affecting the output of drawing and blitting operations.
      *
      * None of these is mandatory and therefore unsupported flags will not
      * cause a software fallback.
      */
     DFBResult (*SetRenderOptions) (
          IDirectFBSurface         *thiz,
          DFBSurfaceRenderOptions   options
     );


   /** Drawing/blitting control **/

     /*
      * Set the transformation matrix.
      *
      * Enable usage of this matrix by setting DSRO_MATRIX via IDirectFBSurface::SetRenderOptions().
      *
      * The matrix consists of 3x3 fixed point 16.16 values.
      * The order in the array is from left to right and from top to bottom.
      *
      * All drawing and blitting will be transformed:
      *
      * <pre>
      *        X' = (X * v0 + Y * v1 + v2) / (X * v6 + Y * v7 + v8)
      *        Y' = (X * v3 + Y * v4 + v5) / (X * v6 + Y * v7 + v8)
      * </pre>
      */
     DFBResult (*SetMatrix) (
          IDirectFBSurface         *thiz,
          const s32                *matrix
     );

     /*
      * Set the surface to be used as a mask for blitting.
      *
      * The <b>mask</b> applies when DSBLIT_SRC_MASK_ALPHA or DSBLIT_SRC_MASK_COLOR is used.
      *
      * Depending on the <b>flags</b> reading either starts at a fixed location in the mask with
      * absolute <b>x</b> and <b>y</b>, or at the same location as in the source, with <b>x</b>
      * and <b>y</b> used as an offset.
      *
      * <i>Example with DSMF_STENCIL:</i>
      * <pre>
      *        Blit from <b>19,  6</b> in the source
      *              and <b> 0,  0</b> in the mask (<b>x =  0, y =  0</b>)
      *               or <b>-5, 17</b>             (<b>x = -5, y = 17</b>)
      *               or <b>23, 42</b>             (<b>x = 23, y = 42</b>)
      * </pre>
      *
      * <i>Example without:</i>
      * <pre>
      *        Blit from <b>19,  6</b> in the source
      *              and <b>19,  6</b> in the mask (<b>x =  0, y =  0</b>)
      *               or <b>14, 23</b>             (<b>x = -5, y = 17</b>)
      *               or <b>42, 48</b>             (<b>x = 23, y = 42</b>)
      * </pre>
      *
      * See also IDirectFBSurface::SetBlittingFlags().
      */
     DFBResult (*SetSourceMask) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *mask,
          int                       x,
          int                       y,
          DFBSurfaceMaskFlags       flags
     );


   /** Lightweight helpers **/

     /*
      * Make this a sub surface or adjust the rectangle of this sub surface.
      */
     DFBResult (*MakeSubSurface) (
          IDirectFBSurface         *thiz,
          IDirectFBSurface         *from,
          const DFBRectangle       *rect
     );


   /** Direct Write/Read **/

     /*
      * Write to the surface without the need for (Un)Lock.
      * 
      * <b>rect</b> defines the area inside the surface.
      * <br><b>ptr</b> and <b>pitch</b> specify the source.
      * <br>The format of the surface and the source data must be the same.
      */
     DFBResult (*Write) (
          IDirectFBSurface         *thiz,
          const DFBRectangle       *rect,
          const void               *ptr,
          int                       pitch
     );

     /*
      * Read from the surface without the need for (Un)Lock.
      * 
      * <b>rect</b> defines the area inside the surface to be read.
      * <br><b>ptr</b> and <b>pitch</b> specify the destination.
      * <br>The destination data will have the same format as the surface.
      */
     DFBResult (*Read) (
          IDirectFBSurface         *thiz,
          const DFBRectangle       *rect,
          void                     *ptr,
          int                       pitch
     );
)


/********************
 * IDirectFBPalette *
 ********************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBPalette,

   /** Retrieving information **/

     /*
      * Return the capabilities of this palette.
      */
     DFBResult (*GetCapabilities) (
          IDirectFBPalette         *thiz,
          DFBPaletteCapabilities   *ret_caps
     );

     /*
      * Get the number of entries in the palette.
      */
     DFBResult (*GetSize) (
          IDirectFBPalette         *thiz,
          unsigned int             *ret_size
     );


   /** Palette entries **/

     /*
      * Write entries to the palette.
      *
      * Writes the specified number of entries to the palette at the
      * specified offset.
      */
     DFBResult (*SetEntries) (
          IDirectFBPalette         *thiz,
          const DFBColor           *entries,
          unsigned int              num_entries,
          unsigned int              offset
     );

     /*
      * Read entries from the palette.
      *
      * Reads the specified number of entries from the palette at the
      * specified offset.
      */
     DFBResult (*GetEntries) (
          IDirectFBPalette         *thiz,
          DFBColor                 *ret_entries,
          unsigned int              num_entries,
          unsigned int              offset
     );

     /*
      * Find the best matching entry.
      *
      * Searches the map for an entry which best matches the specified color.
      */
     DFBResult (*FindBestMatch) (
          IDirectFBPalette         *thiz,
          u8                        r,
          u8                        g,
          u8                        b,
          u8                        a,
          unsigned int             *ret_index
     );


   /** Clone **/

     /*
      * Create a copy of the palette.
      */
     DFBResult (*CreateCopy) (
          IDirectFBPalette         *thiz,
          IDirectFBPalette        **ret_interface
     );


   /** YUV Palette **/

     /*
      * Write entries to the palette.
      *
      * Writes the specified number of entries to the palette at the
      * specified offset.
      */
     DFBResult (*SetEntriesYUV) (
          IDirectFBPalette         *thiz,
          const DFBColorYUV        *entries,
          unsigned int              num_entries,
          unsigned int              offset
     );

     /*
      * Read entries from the palette.
      *
      * Reads the specified number of entries from the palette at the
      * specified offset.
      */
     DFBResult (*GetEntriesYUV) (
          IDirectFBPalette         *thiz,
          DFBColorYUV              *ret_entries,
          unsigned int              num_entries,
          unsigned int              offset
     );

     /*
      * Find the best matching entry.
      *
      * Searches the map for an entry which best matches the specified color.
      */
     DFBResult (*FindBestMatchYUV) (
          IDirectFBPalette         *thiz,
          u8                        y,
          u8                        u,
          u8                        v,
          u8                        a,
          unsigned int             *ret_index
     );
)


/*
 * Specifies whether a key is currently down.
 */
typedef enum {
     DIKS_UP             = 0x00000000,  /* key is not pressed */
     DIKS_DOWN           = 0x00000001   /* key is pressed */
} DFBInputDeviceKeyState;

/*
 * Specifies whether a button is currently pressed.
 */
typedef enum {
     DIBS_UP             = 0x00000000,  /* button is not pressed */
     DIBS_DOWN           = 0x00000001   /* button is pressed */
} DFBInputDeviceButtonState;

/*
 * Flags specifying which buttons are currently down.
 */
typedef enum {
     DIBM_LEFT           = 0x00000001,  /* left mouse button */
     DIBM_RIGHT          = 0x00000002,  /* right mouse button */
     DIBM_MIDDLE         = 0x00000004   /* middle mouse button */
} DFBInputDeviceButtonMask;

/*
 * Flags specifying which modifiers are currently pressed.
 */
typedef enum {
     DIMM_SHIFT     = (1 << DIMKI_SHIFT),    /* Shift key is pressed */
     DIMM_CONTROL   = (1 << DIMKI_CONTROL),  /* Control key is pressed */
     DIMM_ALT       = (1 << DIMKI_ALT),      /* Alt key is pressed */
     DIMM_ALTGR     = (1 << DIMKI_ALTGR),    /* AltGr key is pressed */
     DIMM_META      = (1 << DIMKI_META),     /* Meta key is pressed */
     DIMM_SUPER     = (1 << DIMKI_SUPER),    /* Super key is pressed */
     DIMM_HYPER     = (1 << DIMKI_HYPER)     /* Hyper key is pressed */
} DFBInputDeviceModifierMask;


/************************
 * IDirectFBInputDevice *
 ************************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBInputDevice,

   /** Retrieving information **/

     /*
      * Get the unique device ID.
      */
     DFBResult (*GetID) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceID              *ret_device_id
     );

     /*
      * Get a description of this device, i.e. the capabilities.
      */
     DFBResult (*GetDescription) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceDescription     *ret_desc
     );


   /** Key mapping **/

     /*
      * Fetch one entry from the keymap for a specific hardware keycode.
      */
     DFBResult (*GetKeymapEntry) (
          IDirectFBInputDevice          *thiz,
          int                            keycode,
          DFBInputDeviceKeymapEntry     *ret_entry
     );


   /** Event buffers **/

     /*
      * Create an event buffer for this device and attach it.
      */
     DFBResult (*CreateEventBuffer) (
          IDirectFBInputDevice          *thiz,
          IDirectFBEventBuffer         **ret_buffer
     );

     /*
      * Attach an existing event buffer to this device.
      *
      * NOTE: Attaching multiple times generates multiple events.
      *
      */
     DFBResult (*AttachEventBuffer) (
          IDirectFBInputDevice          *thiz,
          IDirectFBEventBuffer          *buffer
     );
     
     /*
      * Detach an event buffer from this device.
      */
     DFBResult (*DetachEventBuffer) (
          IDirectFBInputDevice          *thiz,
          IDirectFBEventBuffer          *buffer
     );


   /** General state queries **/

     /*
      * Get the current state of one key.
      */
     DFBResult (*GetKeyState) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceKeyIdentifier    key_id,
          DFBInputDeviceKeyState        *ret_state
     );

     /*
      * Get the current modifier mask.
      */
     DFBResult (*GetModifiers) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceModifierMask    *ret_modifiers
     );

     /*
      * Get the current state of the key locks.
      */
     DFBResult (*GetLockState) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceLockState       *ret_locks
     );

     /*
      * Get a mask of currently pressed buttons.
      *
      * The first button corrensponds to the right most bit.
      */
     DFBResult (*GetButtons) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceButtonMask      *ret_buttons
     );

     /*
      * Get the state of a button.
      */
     DFBResult (*GetButtonState) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceButtonIdentifier button,
          DFBInputDeviceButtonState     *ret_state
     );

     /*
      * Get the current value of the specified axis.
      */
     DFBResult (*GetAxis) (
          IDirectFBInputDevice          *thiz,
          DFBInputDeviceAxisIdentifier   axis,
          int                           *ret_pos
     );


   /** Specialized queries **/

     /*
      * Utility function combining two calls to GetAxis().
      *
      * You may leave one of the x/y arguments NULL.
      */
     DFBResult (*GetXY) (
          IDirectFBInputDevice          *thiz,
          int                           *ret_x,
          int                           *ret_y
     );
)


/*
 * Event class.
 */
typedef enum {
     DFEC_NONE           = 0x00,   /* none of these */
     DFEC_INPUT          = 0x01,   /* raw input event */
     DFEC_WINDOW         = 0x02,   /* windowing event */
     DFEC_USER           = 0x03,   /* custom event for the user of this library */
     DFEC_UNIVERSAL      = 0x04,   /* universal event for custom usage with variable size */
     DFEC_VIDEOPROVIDER  = 0x05    /* video provider event */
} DFBEventClass;

/*
 * The type of an input event.
 */
typedef enum {
     DIET_UNKNOWN        = 0,      /* unknown event */
     DIET_KEYPRESS,                /* a key is been pressed */
     DIET_KEYRELEASE,              /* a key is been released */
     DIET_BUTTONPRESS,             /* a (mouse) button is been pressed */
     DIET_BUTTONRELEASE,           /* a (mouse) button is been released */
     DIET_AXISMOTION               /* mouse/joystick movement */
} DFBInputEventType;

/*
 * Flags defining which additional (optional) event fields are valid.
 */
typedef enum {
     DIEF_NONE           = 0x0000,   /* no additional fields */
     DIEF_TIMESTAMP      = 0x0001,   /* timestamp is valid */
     DIEF_AXISABS        = 0x0002,   /* axis and axisabs are valid */
     DIEF_AXISREL        = 0x0004,   /* axis and axisrel are valid */

     DIEF_KEYCODE        = 0x0008,   /* used internally by the input core,
                                        always set at application level */
     DIEF_KEYID          = 0x0010,   /* used internally by the input core,
                                        always set at application level */
     DIEF_KEYSYMBOL      = 0x0020,   /* used internally by the input core,
                                        always set at application level */
     DIEF_MODIFIERS      = 0x0040,   /* used internally by the input core,
                                        always set at application level */
     DIEF_LOCKS          = 0x0080,   /* used internally by the input core,
                                        always set at application level */
     DIEF_BUTTONS        = 0x0100,   /* used internally by the input core,
                                        always set at application level */
     DIEF_GLOBAL         = 0x0200,   /* Only for event buffers creates by
                                        IDirectFB::CreateInputEventBuffer()
                                        with global events enabled.
                                        Indicates that the event would have been
                                        filtered if the buffer hadn't been
                                        global. */
     DIEF_REPEAT         = 0x0400,   /* repeated event, e.g. key or button press */
     DIEF_FOLLOW         = 0x0800,   /* another event will follow immediately, e.g. x/y axis */

     DIEF_MIN            = 0x1000,   /* minimum value is set, e.g. for absolute axis motion */
     DIEF_MAX            = 0x2000,   /* maximum value is set, e.g. for absolute axis motion */
} DFBInputEventFlags;

/*
 * An input event, item of an input buffer.
 */
typedef struct {
     DFBEventClass                   clazz;      /* clazz of event */

     DFBInputEventType               type;       /* type of event */
     DFBInputDeviceID                device_id;  /* source of event */
     DFBInputEventFlags              flags;      /* which optional fields
                                                    are valid? */

     /* additionally (check flags) */
     struct timeval                  timestamp;  /* time of event creation */

/* DIET_KEYPRESS, DIET_KEYRELEASE */
     int                             key_code;   /* hardware keycode, no
                                                    mapping, -1 if device
                                                    doesn't differentiate
                                                    between several keys */
     DFBInputDeviceKeyIdentifier     key_id;     /* basic mapping,
                                                    modifier independent */
     DFBInputDeviceKeySymbol         key_symbol; /* advanced mapping,
                                                    unicode compatible,
                                                    modifier dependent */
     /* additionally (check flags) */
     DFBInputDeviceModifierMask      modifiers;  /* pressed modifiers
                                                    (optional) */
     DFBInputDeviceLockState         locks;      /* active locks
                                                    (optional) */

/* DIET_BUTTONPRESS, DIET_BUTTONRELEASE */
     DFBInputDeviceButtonIdentifier  button;     /* in case of a button
                                                    event */
     DFBInputDeviceButtonMask        buttons;    /* mask of currently
                                                    pressed buttons */

/* DIET_AXISMOTION */
     DFBInputDeviceAxisIdentifier    axis;       /* in case of an axis
                                                    event */
     /* one of these two (check flags) */
     int                             axisabs;    /* absolute mouse/
                                                    joystick coordinate */
     int                             axisrel;    /* relative mouse/
                                                    joystick movement */

     /* general information */
     int                             min;        /* minimum possible value */
     int                             max;        /* maximum possible value */
} DFBInputEvent;

/*
 * Window Event Types - can also be used as flags for event filters.
 */
typedef enum {
     DWET_NONE           = 0x00000000,

     DWET_POSITION       = 0x00000001,  /* window has been moved by
                                           window manager or the
                                           application itself */
     DWET_SIZE           = 0x00000002,  /* window has been resized
                                           by window manager or the
                                           application itself */
     DWET_CLOSE          = 0x00000004,  /* closing this window has been
                                           requested only */
     DWET_DESTROYED      = 0x00000008,  /* window got destroyed by global
                                           deinitialization function or
                                           the application itself */
     DWET_GOTFOCUS       = 0x00000010,  /* window got focus */
     DWET_LOSTFOCUS      = 0x00000020,  /* window lost focus */

     DWET_KEYDOWN        = 0x00000100,  /* a key has gone down while
                                           window has focus */
     DWET_KEYUP          = 0x00000200,  /* a key has gone up while
                                           window has focus */

     DWET_BUTTONDOWN     = 0x00010000,  /* mouse button went down in
                                           the window */
     DWET_BUTTONUP       = 0x00020000,  /* mouse button went up in
                                           the window */
     DWET_MOTION         = 0x00040000,  /* mouse cursor changed its
                                           position in window */
     DWET_ENTER          = 0x00080000,  /* mouse cursor entered
                                           the window */
     DWET_LEAVE          = 0x00100000,  /* mouse cursor left the window */

     DWET_WHEEL          = 0x00200000,  /* mouse wheel was moved while
                                           window has focus */

     DWET_POSITION_SIZE  = DWET_POSITION | DWET_SIZE,/* initially sent to
                                                        window when it's
                                                        created */

     DWET_ALL            = 0x003F033F   /* all event types */
} DFBWindowEventType;

/*
 * Flags for a window event.
 */
typedef enum {
     DWEF_NONE           = 0x00000000,  /* none of these */

     DWEF_RETURNED       = 0x00000001,  /* This is a returned event, e.g. unconsumed key. */
     DWEF_REPEAT         = 0x00000010,  /* repeat event, e.g. repeating key */

     DWEF_ALL            = 0x00000011   /* all of these */
} DFBWindowEventFlags;

/*
 * Video Provider Event Types - can also be used as flags for event filters.
 */
typedef enum {
     DVPET_NONE           = 0x00000000,
     DVPET_STARTED        = 0x00000001,  /* The video provider has started the playback     */
     DVPET_STOPPED        = 0x00000002,  /* The video provider has stopped the playback     */
     DVPET_SPEEDCHANGE    = 0x00000004,  /* A speed change has occured                      */
     DVPET_STREAMCHANGE   = 0x00000008,  /* A stream description change has occured         */
     DVPET_FATALERROR     = 0x00000010,  /* A fatal error has occured: restart must be done */
     DVPET_FINISHED       = 0x00000020,  /* The video provider has finished the playback    */
     DVPET_SURFACECHANGE  = 0x00000040,  /* A surface description change has occured        */
     DVPET_FRAMEDECODED   = 0x00000080,  /* A frame has been decoded by the decoder         */
     DVPET_FRAMEDISPLAYED = 0x00000100,  /* A frame has been rendered to the output         */
     DVPET_DATAEXHAUSTED  = 0x00000200,  /* There is no more data available for consumption */
     DVPET_VIDEOACTION    = 0x00000400,  /* An action is required on the video provider     */
     DVPET_DATALOW        = 0x00000800,  /* The stream buffer is running low in data (threshold defined by implementation). */
     DVPET_DATAHIGH       = 0x00001000,  /* The stream buffer is high. */
     DVPET_BUFFERTIMELOW  = 0x00002000,  /* The stream buffer has less than requested playout time buffered. */
     DVPET_BUFFERTIMEHIGH = 0x00004000,  /* The stream buffer has more than requested playout time buffered. */
     DVPET_ALL            = 0x00007FFF   /* All event types */
} DFBVideoProviderEventType;

/*
 * Event from the windowing system.
 */
typedef struct {
     DFBEventClass                   clazz;      /* clazz of event */

     DFBWindowEventType              type;       /* type of event */

     /* used by DWET_KEYDOWN, DWET_KEYUP */
     DFBWindowEventFlags             flags;      /* event flags */

     DFBWindowID                     window_id;  /* source of event */

     /* used by DWET_MOVE, DWET_MOTION, DWET_BUTTONDOWN, DWET_BUTTONUP,
        DWET_ENTER, DWET_LEAVE */
     int                             x;          /* x position of window
                                                    or coordinate within
                                                    window */
     int                             y;          /* y position of window
                                                    or coordinate within
                                                    window */

     /* used by DWET_MOTION, DWET_BUTTONDOWN, DWET_BUTTONUP,
        DWET_ENTER, DWET_LEAVE */
     int                             cx;         /* x cursor position */
     int                             cy;         /* y cursor position */

     /* used by DWET_WHEEL */
     int                             step;       /* wheel step */

     /* used by DWET_RESIZE */
     int                             w;          /* width of window */
     int                             h;          /* height of window */

     /* used by DWET_KEYDOWN, DWET_KEYUP */
     int                             key_code;   /* hardware keycode, no
                                                    mapping, -1 if device
                                                    doesn't differentiate
                                                    between several keys */
     DFBInputDeviceKeyIdentifier     key_id;     /* basic mapping,
                                                    modifier independent */
     DFBInputDeviceKeySymbol         key_symbol; /* advanced mapping,
                                                    unicode compatible,
                                                    modifier dependent */
     DFBInputDeviceModifierMask      modifiers;  /* pressed modifiers */
     DFBInputDeviceLockState         locks;      /* active locks */

     /* used by DWET_BUTTONDOWN, DWET_BUTTONUP */
     DFBInputDeviceButtonIdentifier  button;     /* button being
                                                    pressed or released */
     /* used by DWET_MOTION, DWET_BUTTONDOWN, DWET_BUTTONUP */
     DFBInputDeviceButtonMask        buttons;    /* mask of currently
                                                    pressed buttons */

     struct timeval                  timestamp;  /* always set */
} DFBWindowEvent;

/*
 * Video Provider Event Types - can also be used as flags for event filters.
 */
typedef enum {
     DVPEDST_UNKNOWN      = 0x00000000, /* Event is valid for unknown Data   */
     DVPEDST_AUDIO        = 0x00000001, /* Event is valid for Audio Data     */
     DVPEDST_VIDEO        = 0x00000002, /* Event is valid for Video Data     */
     DVPEDST_DATA         = 0x00000004, /* Event is valid for Data types     */
     DVPEDST_ALL          = 0x00000007, /* Event is valid for all Data types */

} DFBVideoProviderEventDataSubType;

/*
 * Event from the video provider
 */
typedef struct {
     DFBEventClass                    clazz;      /* clazz of event */

     DFBVideoProviderEventType        type;       /* type of event */
     DFBVideoProviderEventDataSubType data_type;  /* data type that this event is applicable for. */

     int                              data[4];    /* custom data - large enough for 4 ints so that in most cases
                                                     memory allocation will not be needed */
} DFBVideoProviderEvent;

/*
 * Event for usage by the user of this library.
 */
typedef struct {
     DFBEventClass                   clazz;      /* clazz of event */

     unsigned int                    type;       /* custom type */
     void                           *data;       /* custom data */
} DFBUserEvent;

/*
 * Universal event for custom usage with variable size.
 */
typedef struct {
     DFBEventClass                   clazz;      /* clazz of event (DFEC_UNIVERSAL) */
     unsigned int                    size;       /* size of this event, minimum is sizeof(DFBUniversalEvent),
                                                    e.g. 8 bytes (on 32bit architectures) */


     /* custom data follows, size of this data is 'size' - sizeof(DFBUniversalEvent) */
} DFBUniversalEvent;

/*
 * General container for a DirectFB Event.
 */
typedef union {
     DFBEventClass                   clazz;         /* clazz of event */
     DFBInputEvent                   input;         /* field for input events */
     DFBWindowEvent                  window;        /* field for window events */
     DFBUserEvent                    user;          /* field for user-defined events */
     DFBUniversalEvent               universal;     /* field for universal events */
     DFBVideoProviderEvent           videoprovider; /* field for video provider */
} DFBEvent;

#define DFB_EVENT(e)          ((DFBEvent *) (e))

/*
 * Statistics about event buffer queue.
 */
typedef struct {
     unsigned int   num_events;              /* Total number of events in the queue. */

     unsigned int   DFEC_INPUT;              /* Number of input events. */
     unsigned int   DFEC_WINDOW;             /* Number of window events. */
     unsigned int   DFEC_USER;               /* Number of user events. */
     unsigned int   DFEC_UNIVERSAL;          /* Number of universal events. */
     unsigned int   DFEC_VIDEOPROVIDER;      /* Number of universal events. */

     unsigned int   DIET_KEYPRESS;
     unsigned int   DIET_KEYRELEASE;
     unsigned int   DIET_BUTTONPRESS;
     unsigned int   DIET_BUTTONRELEASE;
     unsigned int   DIET_AXISMOTION;

     unsigned int   DWET_POSITION;
     unsigned int   DWET_SIZE;
     unsigned int   DWET_CLOSE;
     unsigned int   DWET_DESTROYED;
     unsigned int   DWET_GOTFOCUS;
     unsigned int   DWET_LOSTFOCUS;
     unsigned int   DWET_KEYDOWN;
     unsigned int   DWET_KEYUP;
     unsigned int   DWET_BUTTONDOWN;
     unsigned int   DWET_BUTTONUP;
     unsigned int   DWET_MOTION;
     unsigned int   DWET_ENTER;
     unsigned int   DWET_LEAVE;
     unsigned int   DWET_WHEEL;
     unsigned int   DWET_POSITION_SIZE;

     unsigned int   DVPET_STARTED;
     unsigned int   DVPET_STOPPED;
     unsigned int   DVPET_SPEEDCHANGE;
     unsigned int   DVPET_STREAMCHANGE;
     unsigned int   DVPET_FATALERROR;
     unsigned int   DVPET_FINISHED;
     unsigned int   DVPET_SURFACECHANGE;
     unsigned int   DVPET_FRAMEDECODED;
     unsigned int   DVPET_FRAMEDISPLAYED;
     unsigned int   DVPET_DATAEXHAUSTED;
     unsigned int   DVPET_DATALOW;
     unsigned int   DVPET_VIDEOACTION;
     unsigned int   DVPET_DATAHIGH;
     unsigned int   DVPET_BUFFERTIMELOW;
     unsigned int   DVPET_BUFFERTIMEHIGH;
} DFBEventBufferStats;


/************************
 * IDirectFBEventBuffer *
 ************************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBEventBuffer,


   /** Buffer handling **/

     /*
      * Clear all events stored in this buffer.
      */
     DFBResult (*Reset) (
          IDirectFBEventBuffer     *thiz
     );


   /** Waiting for events **/

     /*
      * Wait for the next event to occur.
      * Thread is idle in the meantime.
      */
     DFBResult (*WaitForEvent) (
          IDirectFBEventBuffer     *thiz
     );

     /*
      * Block until next event to occur or timeout is reached.
      * Thread is idle in the meantime.
      */
     DFBResult (*WaitForEventWithTimeout) (
          IDirectFBEventBuffer     *thiz,
          unsigned int              seconds,
          unsigned int              milli_seconds
     );


   /** Fetching events **/

     /*
      * Get the next event and remove it from the FIFO.
      */
     DFBResult (*GetEvent) (
          IDirectFBEventBuffer     *thiz,
          DFBEvent                 *ret_event
     );

     /*
      * Get the next event but leave it there, i.e. do a preview.
      */
     DFBResult (*PeekEvent) (
          IDirectFBEventBuffer     *thiz,
          DFBEvent                 *ret_event
     );

     /*
      * Check if there is a pending event in the queue. This
      * function returns DFB_OK if there is at least one event,
      * DFB_BUFFER_EMPTY otherwise.
      */
     DFBResult (*HasEvent) (
          IDirectFBEventBuffer     *thiz
     );


   /** Sending events **/

     /*
      * Put an event into the FIFO.
      *
      * This function does not wait until the event got fetched.
      */
     DFBResult (*PostEvent) (
          IDirectFBEventBuffer     *thiz,
          const DFBEvent           *event
     );

     /*
      * Wake up any thread waiting for events in this buffer.
      *
      * This method causes any IDirectFBEventBuffer::WaitForEvent() or
      * IDirectFBEventBuffer::WaitForEventWithTimeout() call to return with DFB_INTERRUPTED.
      *
      * It should be used rather than sending wake up messages which
      * may pollute the queue and consume lots of CPU and memory compared to
      * this 'single code line method'.
      */
     DFBResult (*WakeUp) (
          IDirectFBEventBuffer     *thiz
     );


   /** Special handling **/

     /*
      * Create a file descriptor for reading events.
      *
      * This method provides an alternative for reading events from an event buffer.
      * It creates a file descriptor which can be used in select(), poll() or read().
      *
      * In general only non-threaded applications which already use select() or poll() need it.
      *
      * <b>Note:</b> This method flushes the event buffer. After calling this method all other
      * methods except IDirectFBEventBuffer::PostEvent() will return DFB_UNSUPPORTED.
      * Calling this method again will return DFB_BUSY.
      */
     DFBResult (*CreateFileDescriptor) (
          IDirectFBEventBuffer     *thiz,
          int                      *ret_fd
     );


   /** Statistics **/

     /*
      * Enable/disable collection of event buffer statistics.
      */
     DFBResult (*EnableStatistics) (
          IDirectFBEventBuffer     *thiz,
          DFBBoolean                enable
     );

     /*
      * Query collected event buffer statistics.
      */
     DFBResult (*GetStatistics) (
          IDirectFBEventBuffer     *thiz,
          DFBEventBufferStats      *ret_stats
     );
)

/*
 * The key selection defines a mode for filtering keys while the window is having the focus.
 */
typedef enum {
     DWKS_ALL            = 0x00000000,  /* Select all keys (default). */
     DWKS_NONE           = 0x00000001,  /* Don't select any key. */
     DWKS_LIST           = 0x00000002   /* Select a list of keys. */
} DFBWindowKeySelection;

typedef enum {
     DWGM_DEFAULT        = 0x00000000,  /* Use default values. */
     DWGM_FOLLOW         = 0x00000001,  /* Use values of parent window. */
     DWGM_RECTANGLE      = 0x00000002,  /* Use pixel values as defined. */
     DWGM_LOCATION       = 0x00000003   /* Use relative values as defined. */
} DFBWindowGeometryMode;

typedef struct {
     DFBWindowGeometryMode    mode;

     DFBRectangle             rectangle;
     DFBLocation              location;
} DFBWindowGeometry;

/*******************
 * IDirectFBWindow *
 *******************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBWindow,

   /** Retrieving information **/

     /*
      * Get the unique window ID.
      */
     DFBResult (*GetID) (
          IDirectFBWindow               *thiz,
          DFBWindowID                   *ret_window_id
     );

     /*
      * Get the current position of this window.
      */
     DFBResult (*GetPosition) (
          IDirectFBWindow               *thiz,
          int                           *ret_x,
          int                           *ret_y
     );

     /*
      * Get the size of the window in pixels.
      */
     DFBResult (*GetSize) (
          IDirectFBWindow               *thiz,
          int                           *ret_width,
          int                           *ret_height
     );


   /** Event handling **/

     /*
      * Create an event buffer for this window and attach it.
      */
     DFBResult (*CreateEventBuffer) (
          IDirectFBWindow               *thiz,
          IDirectFBEventBuffer         **ret_buffer
     );

     /*
      * Attach an existing event buffer to this window.
      *
      * NOTE: Attaching multiple times generates multiple events.
      *
      */
     DFBResult (*AttachEventBuffer) (
          IDirectFBWindow               *thiz,
          IDirectFBEventBuffer          *buffer
     );
     
     /*
      * Detach an event buffer from this window.
      */
     DFBResult (*DetachEventBuffer) (
          IDirectFBWindow               *thiz,
          IDirectFBEventBuffer          *buffer
     );

     /*
      * Enable specific events to be sent to the window.
      *
      * The argument is a mask of events that will be set in the
      * window's event mask. The default event mask is DWET_ALL.
      */
     DFBResult (*EnableEvents) (
          IDirectFBWindow               *thiz,
          DFBWindowEventType             mask
     );

     /*
      * Disable specific events from being sent to the window.
      *
      * The argument is a mask of events that will be cleared in
      * the window's event mask. The default event mask is DWET_ALL.
      */
     DFBResult (*DisableEvents) (
          IDirectFBWindow               *thiz,
          DFBWindowEventType             mask
     );


   /** Surface handling **/

     /*
      * Get an interface to the backing store surface.
      *
      * This surface has to be flipped to make previous drawing
      * commands visible, i.e. to repaint the windowstack for
      * that region.
      */
     DFBResult (*GetSurface) (
          IDirectFBWindow               *thiz,
          IDirectFBSurface             **ret_surface
     );


   /** Appearance and Behaviour **/

     /*
      * Set property controlling appearance and behaviour of the window.
      */
     DFBResult (*SetProperty) (
          IDirectFBWindow               *thiz,
          const char                    *key,
          void                          *value,
          void                         **ret_old_value
     );

     /*
      * Get property controlling appearance and behaviour of the window.
      */
     DFBResult (*GetProperty) (
          IDirectFBWindow               *thiz,
          const char                    *key,
          void                         **ret_value
     );

     /*
      * Remove property controlling appearance and behaviour of the window.
      */
     DFBResult (*RemoveProperty) (
          IDirectFBWindow               *thiz,
          const char                    *key,
          void                         **ret_value
     );

     /*
      * Set options controlling appearance and behaviour of the window.
      */
     DFBResult (*SetOptions) (
          IDirectFBWindow               *thiz,
          DFBWindowOptions               options
     );

     /*
      * Get options controlling appearance and behaviour of the window.
      */
     DFBResult (*GetOptions) (
          IDirectFBWindow               *thiz,
          DFBWindowOptions              *ret_options
     );

     /*
      * Set the window color, or colorises the window.
      *
      * In case you specified DWCAPS_COLOR, this sets the window draw color.
      * In case you didn't, it colorises the window with this color; this will darken the window.
      * no DWCAPS_COLOR and an opacity of 0 means: no effect.
      */
     DFBResult (*SetColor) (
          IDirectFBWindow               *thiz,
          u8                             r,
          u8                             g,
          u8                             b,
          u8                             a
     );

     /*
      * Set the window color key.
      *
      * If a pixel of the window matches this color the
      * underlying window or the background is visible at this
      * point.
      */
     DFBResult (*SetColorKey) (
          IDirectFBWindow               *thiz,
          u8                             r,
          u8                             g,
          u8                             b
     );

     /*
      * Set the window color key (indexed).
      *
      * If a pixel (indexed format) of the window matches this
      * color index the underlying window or the background is
      * visible at this point.
      */
     DFBResult (*SetColorKeyIndex) (
          IDirectFBWindow               *thiz,
          unsigned int                   index
     );

     /*
      * Set the window's global opacity factor.
      *
      * Set it to "0" to hide a window.
      * Setting it to "0xFF" makes the window opaque if
      * it has no alpha channel.
      */
     DFBResult (*SetOpacity) (
          IDirectFBWindow               *thiz,
          u8                             opacity
     );

     /*
      * Disable alpha channel blending for one region of the window.
      *
      * If DWOP_ALPHACHANNEL and DWOP_OPAQUE_REGION are set but not DWOP_COLORKEYING
      * and the opacity of the window is 255 the window gets rendered
      * without alpha blending within the specified region.
      *
      * This is extremely useful for alpha blended window decorations while
      * the main content stays opaque and gets rendered faster.
      */
     DFBResult (*SetOpaqueRegion) (
          IDirectFBWindow               *thiz,
          int                            x1,
          int                            y1,
          int                            x2,
          int                            y2
     );

     /*
      * Get the current opacity factor of this window.
      */
     DFBResult (*GetOpacity) (
          IDirectFBWindow               *thiz,
          u8                            *ret_opacity
     );

     /*
      * Bind a cursor shape to this window.
      *
      * This method will set a per-window cursor shape. Everytime
      * the cursor enters this window, the specified shape is set.
      *
      * Passing NULL will unbind a set shape and release its surface.
      */
     DFBResult (*SetCursorShape) (
          IDirectFBWindow               *thiz,
          IDirectFBSurface              *shape,
          int                            hot_x,
          int                            hot_y
     );


   /** Focus handling **/

     /*
      * Pass the focus to this window.
      */
     DFBResult (*RequestFocus) (
          IDirectFBWindow               *thiz
     );

     /*
      * Grab the keyboard, i.e. all following keyboard events are
      * sent to this window ignoring the focus.
      */
     DFBResult (*GrabKeyboard) (
          IDirectFBWindow               *thiz
     );

     /*
      * Ungrab the keyboard, i.e. switch to standard key event
      * dispatching.
      */
     DFBResult (*UngrabKeyboard) (
          IDirectFBWindow               *thiz
     );

     /*
      * Grab the pointer, i.e. all following mouse events are
      * sent to this window ignoring the focus.
      */
     DFBResult (*GrabPointer) (
          IDirectFBWindow               *thiz
     );

     /*
      * Ungrab the pointer, i.e. switch to standard mouse event
      * dispatching.
      */
     DFBResult (*UngrabPointer) (
          IDirectFBWindow               *thiz
     );

     /*
      * Grab a specific key, i.e. all following events of this key are
      * sent to this window ignoring the focus.
      */
     DFBResult (*GrabKey) (
          IDirectFBWindow               *thiz,
          DFBInputDeviceKeySymbol        symbol,
          DFBInputDeviceModifierMask     modifiers
     );

     /*
      * Ungrab a specific key, i.e. switch to standard key event
      * dispatching.
      */
     DFBResult (*UngrabKey) (
          IDirectFBWindow               *thiz,
          DFBInputDeviceKeySymbol        symbol,
          DFBInputDeviceModifierMask     modifiers
     );


   /** Position and Size **/

     /*
      * Move the window by the specified distance.
      */
     DFBResult (*Move) (
          IDirectFBWindow               *thiz,
          int                            dx,
          int                            dy
     );

     /*
      * Move the window to the specified coordinates.
      */
     DFBResult (*MoveTo) (
          IDirectFBWindow               *thiz,
          int                            x,
          int                            y
     );

     /*
      * Resize the window.
      */
     DFBResult (*Resize) (
          IDirectFBWindow               *thiz,
          int                            width,
          int                            height
     );


   /** Stacking **/

     /*
      * Put the window into a specific stacking class.
      */
     DFBResult (*SetStackingClass) (
          IDirectFBWindow               *thiz,
          DFBWindowStackingClass         stacking_class
     );

     /*
      * Raise the window by one within the window stack.
      */
     DFBResult (*Raise) (
          IDirectFBWindow               *thiz
     );

     /*
      * Lower the window by one within the window stack.
      */
     DFBResult (*Lower) (
          IDirectFBWindow               *thiz
     );

     /*
      * Put the window on the top of the window stack.
      */
     DFBResult (*RaiseToTop) (
          IDirectFBWindow               *thiz
     );

     /*
      * Send a window to the bottom of the window stack.
      */
     DFBResult (*LowerToBottom) (
          IDirectFBWindow               *thiz
     );

     /*
      * Put a window on top of another window.
      */
     DFBResult (*PutAtop) (
          IDirectFBWindow               *thiz,
          IDirectFBWindow               *lower
     );

     /*
      * Put a window below another window.
      */
     DFBResult (*PutBelow) (
          IDirectFBWindow               *thiz,
          IDirectFBWindow               *upper
     );


   /** Closing **/

     /*
      * Send a close message to the window.
      *
      * This function sends a message of type DWET_CLOSE to the window.
      * It does NOT actually close it.
      */
     DFBResult (*Close) (
          IDirectFBWindow               *thiz
     );

     /*
      * Destroys the window and sends a destruction message.
      *
      * This function sends a message of type DWET_DESTROY to
      * the window after removing it from the window stack and
      * freeing its data.  Some functions called from this
      * interface will return DFB_DESTROYED after that.
      */
     DFBResult (*Destroy) (
          IDirectFBWindow               *thiz
     );


   /** Geometry **/

     /*
      * Set position and size in one step.
      */
     DFBResult (*SetBounds) (
          IDirectFBWindow               *thiz,
          int                            x,
          int                            y,
          int                            width,
          int                            height
     );


   /** Scaling **/

     /*
      * Resize the surface of a scalable window.
      *
      * This requires the option DWOP_SCALE.
      * See IDirectFBWindow::SetOptions().
      */
     DFBResult (*ResizeSurface) (
          IDirectFBWindow               *thiz,
          int                            width,
          int                            height
     );


   /** Binding **/
     
     /*
      * Bind a window at the specified position of this window.
      *
      * After binding, bound window will be automatically moved
      * when this window moves to a new position.<br>
      * Binding the same window to multiple windows is not supported.
      * Subsequent call to Bind() automatically unbounds the bound window
      * before binding it again.<br>
      * To move the bound window to a new position call Bind() again 
      * with the new coordinates.
      */
     DFBResult (*Bind) (
          IDirectFBWindow               *thiz,
          IDirectFBWindow               *window,
          int                            x,
          int                            y
     );

     /*
      * Unbind a window from this window.
      */
     DFBResult (*Unbind) (
          IDirectFBWindow               *thiz,
          IDirectFBWindow               *window
     );


   /** Key selection **/

     /*
      * Selects a mode for filtering keys while being focused.
      *
      * The <b>selection</b> defines whether all, none or a specific set (list) of keys is selected.
      * In case of a specific set, the <b>keys</b> array with <b>num_keys</b> has to be provided.
      *
      * Multiple calls to this method are possible. Each overrides all settings from the previous call.
      */
     DFBResult (*SetKeySelection) (
          IDirectFBWindow               *thiz,
          DFBWindowKeySelection          selection,
          const DFBInputDeviceKeySymbol *keys,
          unsigned int                   num_keys
     );

     /*
      * Grab all unselected (filtered out) keys.
      *
      * Unselected keys are those not selected by the focused window. These keys won't be sent
      * to that window. Instead one window in the stack can collect them.
      *
      * See also IDirectFBWindow::UngrabUnselectedKeys() and IDirectFBWindow::SetKeySelection().
      */
     DFBResult (*GrabUnselectedKeys) (
          IDirectFBWindow               *thiz
     );

     /*
      * Release the grab of unselected (filtered out) keys.
      *
      * See also IDirectFBWindow::GrabUnselectedKeys() and IDirectFBWindow::SetKeySelection().
      */
     DFBResult (*UngrabUnselectedKeys) (
          IDirectFBWindow               *thiz
     );


   /** Advanced Geometry **/

     /*
      * Set area of surface to be shown in window.
      *
      * Default and maximum is to show whole surface.
      */
     DFBResult (*SetSrcGeometry) (
          IDirectFBWindow               *thiz,
          const DFBWindowGeometry       *geometry
     );

     /*
      * Set destination location of window within its bounds.
      *
      * Default and maximum is to fill whole bounds.
      */
     DFBResult (*SetDstGeometry) (
          IDirectFBWindow               *thiz,
          const DFBWindowGeometry       *geometry
     );

   /** Association **/

     /*
      * Change the window association.
      *
      * If <b>window_id</b> is 0, the window will be dissociated.
      */
     DFBResult (*SetAssociation) (
          IDirectFBWindow               *thiz,
          DFBWindowID                    window_id
     );

   /** Application ID **/

     /*
      * Set application ID.
      * 
      * The usage of the application ID is not imposed by DirectFB 
      * and can be used at will by the application. Any change will
      * be notified, and as such, an application manager using SaWMan
      * can be used to act on any change.
      */
     DFBResult (*SetApplicationID) (
          IDirectFBWindow               *thiz,
          unsigned long                  application_id
     );

     /*
      * Get current application ID.
      */
     DFBResult (*GetApplicationID) (
          IDirectFBWindow               *thiz,
          unsigned long                 *ret_application_id
     );
)


/*
 * Called for each provided text encoding.
 */
typedef DFBEnumerationResult (*DFBTextEncodingCallback) (
     DFBTextEncodingID    encoding_id,
     const char          *name,
     void                *context
);

/*****************
 * IDirectFBFont *
 *****************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBFont,

   /** Retrieving information **/

     /*
      * Get the distance from the baseline to the top of the
      * logical extents of this font.
      */
     DFBResult (*GetAscender) (
          IDirectFBFont            *thiz,
          int                      *ret_ascender
     );

     /*
      * Get the distance from the baseline to the bottom of
      * the logical extents of this font.
      *
      * This is a negative value!
      */
     DFBResult (*GetDescender) (
          IDirectFBFont            *thiz,
          int                      *ret_descender
     );

     /*
      * Get the logical height of this font. This is the vertical
      * distance from one baseline to the next when writing
      * several lines of text. Note that this value does not
      * correspond the height value specified when loading the
      * font.
      */
     DFBResult (*GetHeight) (
          IDirectFBFont            *thiz,
          int                      *ret_height
     );

     /*
      * Get the maximum character width.
      *
      * This is a somewhat dubious value. Not all fonts
      * specify it correcly. It can give you an idea of
      * the maximum expected width of a rendered string.
      */
     DFBResult (*GetMaxAdvance) (
          IDirectFBFont            *thiz,
          int                      *ret_maxadvance
     );

     /*
      * Get the kerning to apply between two glyphs specified by
      * their character codes.
      */
     DFBResult (*GetKerning) (
          IDirectFBFont            *thiz,
          unsigned int              prev,
          unsigned int              current,
          int                      *ret_kern_x,
          int                      *ret_kern_y
     );

   /** Measurements **/

     /*
      * Get the logical width of the specified string
      * as if it were drawn with this font.
      *
      * Bytes specifies the number of bytes to take from the
      * string or -1 for the complete NULL-terminated string.
      *
      * The returned width may be different than the actual drawn
      * width of the text since this function returns the logical
      * width that should be used to layout the text. A negative
      * width indicates right-to-left rendering.
      */
     DFBResult (*GetStringWidth) (
          IDirectFBFont            *thiz,
          const char               *text,
          int                       bytes,
          int                      *ret_width
     );

     /*
      * Get the logical and real extents of the specified
      * string as if it were drawn with this font.
      *
      * Bytes specifies the number of bytes to take from the
      * string or -1 for the complete NULL-terminated string.
      *
      * The logical rectangle describes the typographic extents
      * and should be used to layout text. The ink rectangle
      * describes the smallest rectangle containing all pixels
      * that are touched when drawing the string. If you only
      * need one of the rectangles, pass NULL for the other one.
      *
      * The ink rectangle is guaranteed to be a valid rectangle
      * with positive width and height, while the logical
      * rectangle may have negative width indicating right-to-left
      * layout.
      *
      * The rectangle offsets are reported relative to the
      * baseline and refer to the text being drawn using
      * DSTF_LEFT.
      */
     DFBResult (*GetStringExtents) (
          IDirectFBFont            *thiz,
          const char               *text,
          int                       bytes,
          DFBRectangle             *ret_logical_rect,
          DFBRectangle             *ret_ink_rect
     );

     /*
      * Get the extents of a glyph specified by its character code.
      *
      * The rectangle describes the the smallest rectangle
      * containing all pixels that are touched when drawing the
      * glyph. It is reported relative to the baseline. If you
      * only need the advance, pass NULL for the rectangle.
      *
      * The advance describes the horizontal offset to the next
      * glyph (without kerning applied). It may be a negative
      * value indicating left-to-right rendering. If you don't
      * need this value, pass NULL for advance.
      */
     DFBResult (*GetGlyphExtents) (
          IDirectFBFont            *thiz,
          unsigned int              character,
          DFBRectangle             *ret_rect,
          int                      *ret_advance
     );

     /*
      * Get the next explicit or automatic break within a string
      * along with the logical width of the text, the string length,
      * and a pointer to the next text line.
      *  
      * The bytes specifies the maximum number of bytes to take from the
      * string or -1 for complete NULL-terminated string.
      *
      * The max_width specifies logical width of column onto which 
      * the text will be drawn. Then the logical width of fitted
      * text is returned in ret_width. The returned width may overlap
      * the max width specified if there's only one character 
      * that fits.
      *
      * The number of characters that fit into this column is
      * returned by the ret_str_length. This value can be used as 
      * the number of bytes to take when using DrawString().
      *
      * In ret_next_line a pointer to the next line of text is returned. This 
      * will point to NULL or the end of the string if there's no more break.
      */
     DFBResult (*GetStringBreak) (
          IDirectFBFont            *thiz,
          const char               *text,
          int                       bytes,
          int                       max_width,
          int                      *ret_width,
          int                      *ret_str_length,
          const char              **ret_next_line
     );

   /** Encodings **/

     /*
      * Change the default encoding used when the font is set at a surface.
      *
      * It's also the encoding used for the measurement functions
      * of this interface, e.g. IDirectFBFont::GetStringExtents().
      */
     DFBResult (*SetEncoding) (
          IDirectFBFont            *thiz,
          DFBTextEncodingID         encoding
     );

     /*
      * Enumerate all provided text encodings.
      */
     DFBResult (*EnumEncodings) (
          IDirectFBFont            *thiz,
          DFBTextEncodingCallback   callback,
          void                     *context
     );

     /*
      * Find an encoding by its name.
      */
     DFBResult (*FindEncoding) (
          IDirectFBFont            *thiz,
          const char               *name,
          DFBTextEncodingID        *ret_encoding
     );
)

/*
 * Capabilities of an image.
 */
typedef enum {
     DICAPS_NONE            = 0x00000000,  /* None of these.            */
     DICAPS_ALPHACHANNEL    = 0x00000001,  /* The image data contains an
                                              alphachannel.             */
     DICAPS_COLORKEY        = 0x00000002   /* The image has a colorkey,
                                              e.g. the transparent color
                                              of a GIF image.           */
} DFBImageCapabilities;

/*
 * Information about an image including capabilities and values
 * belonging to available capabilities.
 */
typedef struct {
     DFBImageCapabilities     caps;        /* capabilities              */

     u8                       colorkey_r;  /* colorkey red channel      */
     u8                       colorkey_g;  /* colorkey green channel    */
     u8                       colorkey_b;  /* colorkey blue channel     */
} DFBImageDescription;


typedef enum {
        DIRCR_OK,
        DIRCR_ABORT
} DIRenderCallbackResult;
/*
 * Called whenever a chunk of the image is decoded.
 * Has to be registered with IDirectFBImageProvider::SetRenderCallback().
 */
typedef DIRenderCallbackResult (*DIRenderCallback)(DFBRectangle *rect, void *ctx);

/**************************
 * IDirectFBImageProvider *
 **************************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBImageProvider,

   /** Retrieving information **/

     /*
      * Get a surface description that best matches the image
      * contained in the file.
      *
      * For opaque image formats the pixel format of the primary
      * layer is used. For images with alpha channel an ARGB
      * surface description is returned.
      */
     DFBResult (*GetSurfaceDescription) (
          IDirectFBImageProvider   *thiz,
          DFBSurfaceDescription    *ret_dsc
     );

     /*
      * Get a description of the image.
      *
      * This includes stuff that does not belong into the surface
      * description, e.g. a colorkey of a transparent GIF.
      */
     DFBResult (*GetImageDescription) (
          IDirectFBImageProvider   *thiz,
          DFBImageDescription      *ret_dsc
     );


   /** Rendering **/

     /*
      * Render the file contents into the destination contents
      * doing automatic scaling and color format conversion.
      *
      * If the image file has an alpha channel it is rendered
      * with alpha channel if the destination surface is of the
      * ARGB pixelformat. Otherwise, transparent areas are
      * blended over a black background.
      *
      * If a destination rectangle is specified, the rectangle is
      * clipped to the destination surface. If NULL is passed as
      * destination rectangle, the whole destination surface is
      * taken. The image is stretched to fill the rectangle.
      */
     DFBResult (*RenderTo) (
          IDirectFBImageProvider   *thiz,
          IDirectFBSurface         *destination,
          const DFBRectangle       *destination_rect
     );

     /*
      * Registers a callback for progressive image loading.
      *
      * The function is called each time a chunk of the image is decoded.
      */
     DFBResult (*SetRenderCallback) (
          IDirectFBImageProvider   *thiz,
          DIRenderCallback          callback,
          void                     *callback_data
     );


   /** Encoding **/

     /*
      * Encode a portion of a surface.
      */
     DFBResult (*WriteBack) (
          IDirectFBImageProvider   *thiz,
          IDirectFBSurface         *surface,
          const DFBRectangle       *src_rect,
          const char               *filename
     );
)

/*
 * Capabilities of an audio/video stream.
 */
typedef enum {
     DVSCAPS_NONE         = 0x00000000, /* None of these.         */
     DVSCAPS_VIDEO        = 0x00000001, /* Stream contains video. */
     DVSCAPS_AUDIO        = 0x00000002  /* Stream contains audio. */
     /* DVSCAPS_SUBPICTURE ?! */
} DFBStreamCapabilities;

#define DFB_STREAM_DESC_ENCODING_LENGTH   30

#define DFB_STREAM_DESC_TITLE_LENGTH     255

#define DFB_STREAM_DESC_AUTHOR_LENGTH    255

#define DFB_STREAM_DESC_ALBUM_LENGTH     255

#define DFB_STREAM_DESC_GENRE_LENGTH      32

#define DFB_STREAM_DESC_COMMENT_LENGTH   255

/*
 * Informations about an audio/video stream.
 */
typedef struct {
     DFBStreamCapabilities  caps;         /* capabilities */

     struct {
          char              encoding[DFB_STREAM_DESC_ENCODING_LENGTH]; /* encoding (e.g. "MPEG4") */
          double            framerate;    /* number of frames per second */
          double            aspect;       /* frame aspect ratio */
          int               bitrate;      /* amount of bits per second */
    	  int               afd;          /* Active Format Descriptor */
    	  int               width;        /* Width as reported by Sequence Header */
    	  int               height;       /* Height as reported by Sequence Header */
     } video;                             /* struct containing the above encoding properties for video */

     struct {
          char              encoding[DFB_STREAM_DESC_ENCODING_LENGTH]; /* encoding (e.g. "AAC") */
          int               samplerate;   /* number of samples per second */
          int               channels;     /* number of channels per sample */
          int               bitrate;      /* amount of bits per second */
     } audio;                             /* struct containing the above four encoding properties for audio */

     char                   title[DFB_STREAM_DESC_TITLE_LENGTH];     /* title   */
     char                   author[DFB_STREAM_DESC_AUTHOR_LENGTH];   /* author  */
     char                   album[DFB_STREAM_DESC_ALBUM_LENGTH];     /* album   */
     short                  year;                                    /* year    */
     char                   genre[DFB_STREAM_DESC_GENRE_LENGTH];     /* genre   */
     char                   comment[DFB_STREAM_DESC_COMMENT_LENGTH]; /* comment */
} DFBStreamDescription;

/*
 * Type of an audio stream.
 */
typedef enum {
     DSF_ES         = 0x00000000, /* ES.  */
     DSF_PES        = 0x00000001, /* PES. */
} DFBStreamFormat;

/*
 * Stream attributes for an audio/video stream.
 */
typedef struct {
     struct {
          char            encoding[DFB_STREAM_DESC_ENCODING_LENGTH]; /* encoding (e.g. "MPEG4") */
          DFBStreamFormat format;                                    /* format of the video stream */
     } video;                           /* struct containing the above two encoding properties for video */
     
     struct {
          char            encoding[DFB_STREAM_DESC_ENCODING_LENGTH]; /* encoding (e.g. "AAC") */
          DFBStreamFormat format;                                    /* format of the audio stream */
     } audio;                           /* struct containing the above two encoding properties for audio */
} DFBStreamAttributes;

/*
 * Buffer levels and occupancy for Audio/Video input buffers.
 */
typedef struct {
     DFBStreamCapabilities valid;        /* Which of the Audio / Video sections are valid. */

     struct {
         unsigned int  buffer_size;      /* Size in bytes of the input buffer to video decoder */
         unsigned int  minimum_level;    /* The level at which a DVPET_DATALOW event will be generated. */
         unsigned int  maximum_level;    /* The level at which a DVPET_DATAHIGH event will be generated. */
         unsigned int  current_level;    /* Current fill level of video input buffer.*/
     } video;

     struct {
         unsigned int  buffer_size;      /* Size in bytes of the input buffer to audio decoder */
         unsigned int  minimum_level;    /* The level at which a DVPET_DATALOW event will be generated. */
         unsigned int  maximum_level;    /* The level at which a DVPET_DATAHIGH event will be generated. */
         unsigned int  current_level;    /* Current fill level of audio input buffer.*/
     } audio;
} DFBBufferOccupancy;

/*
 * Buffer thresholds for Audio and Video.
 */
typedef struct {
     DFBStreamCapabilities selection;    /* Which of the Audio / Video are we setting? */

     struct {
          unsigned int  minimum_level;   /* The level at which a DVPET_DATALOW event will be generated. */
          unsigned int  maximum_level;   /* The level at which a DVPET_DATAHIGH event will be generated. */
          unsigned int  minimum_time;    /* The level at which a DVPET_BUFFERTIMELOW event will be generated. */
          unsigned int  maximum_time;    /* The level at which a DVPET_BUFFERTIMEHIGH event will be generated. */
     } video;

     struct {
          unsigned int  minimum_level;   /* The level at which a DVPET_DATALOW event will be generated. */
          unsigned int  maximum_level;   /* The level at which a DVPET_DATAHIGH event will be generated. */
          unsigned int  minimum_time;    /* The level at which a DVPET_BUFFERTIMELOW event will be generated. */
          unsigned int  maximum_time;    /* The level at which a DVPET_BUFFERTIMEHIGH event will be generated. */
     } audio;
} DFBBufferThresholds;

/*
 * Called for each written frame.
 */
typedef void (*DVFrameCallback)(void *ctx);


/**************************
 * IDirectFBVideoProvider *
 **************************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBVideoProvider,

   /** Retrieving information **/

     /*
      * Retrieve information about the video provider's
      * capabilities.
      */
     DFBResult (*GetCapabilities) (
          IDirectFBVideoProvider        *thiz,
          DFBVideoProviderCapabilities  *ret_caps
     );

     /*
      * Get a surface description that best matches the video
      * contained in the file.
      */
     DFBResult (*GetSurfaceDescription) (
          IDirectFBVideoProvider   *thiz,
          DFBSurfaceDescription    *ret_dsc
     );

     /*
      * Get a description of the video stream.
      */
     DFBResult (*GetStreamDescription) (
          IDirectFBVideoProvider   *thiz,
          DFBStreamDescription     *ret_dsc
     );


   /** Playback **/

     /*
      * Play the video rendering it into the specified rectangle
      * of the destination surface.
      *
      * Optionally a callback can be registered that is called
      * for each rendered frame. This is especially important if
      * you are playing to a flipping surface. In this case, you
      * should flip the destination surface in your callback.
      */
     DFBResult (*PlayTo) (
          IDirectFBVideoProvider   *thiz,
          IDirectFBSurface         *destination,
          const DFBRectangle       *destination_rect,
          DVFrameCallback           callback,
          void                     *ctx
     );

     /*
      * Stop rendering into the destination surface.
      */
     DFBResult (*Stop) (
          IDirectFBVideoProvider   *thiz
     );

     /*
      * Get the status of the playback.
      */
     DFBResult (*GetStatus) (
          IDirectFBVideoProvider   *thiz,
          DFBVideoProviderStatus   *ret_status
     );


   /** Media Control **/

     /*
      * Seeks to a position within the stream.
      */
     DFBResult (*SeekTo) (
          IDirectFBVideoProvider   *thiz,
          double                    seconds
     );

     /*
      * Gets current position within the stream.
      */
     DFBResult (*GetPos) (
          IDirectFBVideoProvider   *thiz,
          double                   *ret_seconds
     );

     /*
      * Gets the length of the stream.
      */
     DFBResult (*GetLength) (
          IDirectFBVideoProvider   *thiz,
          double                   *ret_seconds
     );

   /** Color Adjustment **/

     /*
      * Gets the current video color settings.
      */
     DFBResult (*GetColorAdjustment) (
          IDirectFBVideoProvider   *thiz,
          DFBColorAdjustment       *ret_adj
     );

     /*
      * Adjusts the video colors.
      *
      * This function only has an effect if the video provider
      * supports this operation. Check the providers capabilities
      * to find out if this is the case.
      */
     DFBResult (*SetColorAdjustment) (
          IDirectFBVideoProvider   *thiz,
          const DFBColorAdjustment *adj
     );

   /** Interactivity **/

     /*
      * Send an input or window event.
      *
      * This method allows to redirect events to an interactive
      * video provider. Events must be relative to the specified
      * rectangle of the destination surface.
      */
     DFBResult (*SendEvent) (
          IDirectFBVideoProvider   *thiz,
          const DFBEvent           *event
     );

   /** Advanced control **/
   
     /*
      * Set the flags controlling playback mode.
      */
     DFBResult (*SetPlaybackFlags) (
          IDirectFBVideoProvider        *thiz,
          DFBVideoProviderPlaybackFlags  flags
     );
     
     /*
      * Set the speed multiplier.
      *
      * Values below 1.0 reduce playback speed 
      * while values over 1.0 increase it.<br>
      * Specifying a value of 0.0 has the effect of
      * putting the playback in pause mode without 
      * stopping the video provider.
      */
     DFBResult (*SetSpeed) (
          IDirectFBVideoProvider   *thiz,
          double                    multiplier
     );
     
     /*
      * Get current speed multiplier.
      */
     DFBResult (*GetSpeed) (
          IDirectFBVideoProvider   *thiz,
          double                   *ret_multiplier
     );
     
     /*
      * Set volume level.
      *
      * Values between 0.0f and 1.0f adjust the volume level.
      * Values over 1.0f increase the amplification level.
      */
     DFBResult (*SetVolume) (
          IDirectFBVideoProvider   *thiz,
          float                     level
     );

     /*
      * Get volume level.
      */
     DFBResult (*GetVolume) (
          IDirectFBVideoProvider   *thiz,
          float                    *ret_level
     );

     /*
      * Set the stream attributes.
      * May have a wrapper with different media types types encapsulated.
      * Can use this method to indicate the content type.
      */
     DFBResult (*SetStreamAttributes) (
          IDirectFBVideoProvider   *thiz,
          DFBStreamAttributes       attr
     );

     /*
      * Set the audio units that are being used for output.
      * May have multiple audio outputs and need to configure them on/off
      * dynamically. 
      */
     DFBResult (*SetAudioOutputs) (
          IDirectFBVideoProvider     *thiz,
          DFBVideoProviderAudioUnits *audioUnits
     );

     /*
      * Get the audio units that are being used for output.
      */
     DFBResult (*GetAudioOutputs) (
          IDirectFBVideoProvider     *thiz,
          DFBVideoProviderAudioUnits *audioUnits
     );

     /*
      * Set the audio delay
      *
      * The parameter is in microseconds. Values < 0 make audio earlier, > 0 make audio later.
      */
      DFBResult (*SetAudioDelay) (
          IDirectFBVideoProvider     *thiz,
          long                        delay
      );


  /** Event buffers **/

     /*
      * Create an event buffer for this video provider and attach it.
      */
     DFBResult (*CreateEventBuffer) (
          IDirectFBVideoProvider     *thiz,
          IDirectFBEventBuffer      **ret_buffer
     );

     /*
      * Attach an existing event buffer to this video provider.
      *
      * NOTE: Attaching multiple times generates multiple events.
      */
     DFBResult (*AttachEventBuffer) (
          IDirectFBVideoProvider     *thiz,
          IDirectFBEventBuffer       *buffer
     );

     /*
      * Enable specific events to be sent from the video provider.
      *
      * The argument is a mask of events that will be set in the
      * videoproviders's event mask. The default event mask is DVPET_ALL.
      */
     DFBResult (*EnableEvents) (
          IDirectFBVideoProvider     *thiz,
          DFBVideoProviderEventType   mask
     );

     /*
      * Disable specific events from being sent from the video provider
      *
      * The argument is a mask of events that will be cleared in
      * the video providers's event mask. The default event mask is DWET_ALL.
      */
     DFBResult (*DisableEvents) (
          IDirectFBVideoProvider     *thiz,
          DFBVideoProviderEventType   mask
     );

     /*
      * Detach an event buffer from this video provider.
      */
     DFBResult (*DetachEventBuffer) (
          IDirectFBVideoProvider     *thiz,
          IDirectFBEventBuffer       *buffer
     );


  /** Buffer control **/

     /*
      * Get buffer occupancy (A/V) when playing this stream.
      */
     DFBResult (*GetBufferOccupancy) (
          IDirectFBVideoProvider   *thiz,
          DFBBufferOccupancy       *ret_occ
     );

     /*
      * Set buffer thresholds for the Audio / Video playback.
      */
     DFBResult (*SetBufferThresholds) (
          IDirectFBVideoProvider   *thiz,
          DFBBufferThresholds       thresh
     );

     /*
      * Get buffer thresholds for the Audio / Video playback.
      */
     DFBResult (*GetBufferThresholds) (
          IDirectFBVideoProvider   *thiz,
          DFBBufferThresholds      *ret_thresh
     );
)

/***********************
 * IDirectFBDataBuffer *
 ***********************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBDataBuffer,


   /** Buffer handling **/

     /*
      * Flushes all data in this buffer.
      *
      * This method only applies to streaming buffers.
      */
     DFBResult (*Flush) (
          IDirectFBDataBuffer      *thiz
     );

     /*
      * Finish writing into a streaming buffer.
      *
      * Subsequent calls to PutData will fail,
      * while attempts to fetch data from the buffer will return EOF
      * unless there is still data available.
      */
     DFBResult (*Finish) (
          IDirectFBDataBuffer      *thiz
     );

     /*
      * Seeks to a given byte position.
      *
      * This method only applies to static buffers.
      */
     DFBResult (*SeekTo) (
          IDirectFBDataBuffer      *thiz,
          unsigned int              offset
     );

     /*
      * Get the current byte position within a static buffer.
      *
      * This method only applies to static buffers.
      */
     DFBResult (*GetPosition) (
          IDirectFBDataBuffer      *thiz,
          unsigned int             *ret_offset
     );

     /*
      * Get the length of a static or streaming buffer in bytes.
      *
      * The length of a static buffer is its static size.
      * A streaming buffer has a variable length reflecting
      * the amount of buffered data.
      */
     DFBResult (*GetLength) (
          IDirectFBDataBuffer      *thiz,
          unsigned int             *ret_length
     );

   /** Waiting for data **/

     /*
      * Wait for data to be available.
      * Thread is idle in the meantime.
      *
      * This method blocks until at least the specified number of bytes
      * is available.
      */
     DFBResult (*WaitForData) (
          IDirectFBDataBuffer      *thiz,
          unsigned int              length
     );

     /*
      * Wait for data to be available within an amount of time.
      * Thread is idle in the meantime.
      *
      * This method blocks until at least the specified number of bytes
      * is available or the timeout is reached.
      */
     DFBResult (*WaitForDataWithTimeout) (
          IDirectFBDataBuffer      *thiz,
          unsigned int              length,
          unsigned int              seconds,
          unsigned int              milli_seconds
     );


   /** Retrieving data **/

     /*
      * Fetch data from a streaming or static buffer.
      *
      * Static buffers will increase the data pointer.
      * Streaming buffers will flush the data portion.
      *
      * The maximum number of bytes to fetch is specified by "length",
      * the actual number of bytes fetched is returned via "read".
      */
     DFBResult (*GetData) (
          IDirectFBDataBuffer      *thiz,
          unsigned int              length,
          void                     *ret_data,
          unsigned int             *ret_read
     );

     /*
      * Peek data from a streaming or static buffer.
      *
      * Unlike GetData() this method won't increase the data
      * pointer or flush any portions of the data held.
      *
      * Additionally an offset relative to the current data pointer
      * or beginning of the streaming buffer can be specified.
      *
      * The maximum number of bytes to peek is specified by "length",
      * the actual number of bytes peeked is returned via "read".
      */
     DFBResult (*PeekData) (
          IDirectFBDataBuffer      *thiz,
          unsigned int              length,
          int                       offset,
          void                     *ret_data,
          unsigned int             *ret_read
     );

     /*
      * Check if there is data available.
      *
      * This method returns DFB_OK if there is data available,
      * DFB_BUFFER_EMPTY otherwise.
      */
     DFBResult (*HasData) (
          IDirectFBDataBuffer      *thiz
     );


   /** Providing data **/

     /*
      * Appends a block of data to a streaming buffer.
      *
      * This method does not wait until the data got fetched.
      *
      * Static buffers don't support this method.
      */
     DFBResult (*PutData) (
          IDirectFBDataBuffer      *thiz,
          const void               *data,
          unsigned int              length
     );


   /** Media from data **/

     /*
      * Creates an image provider using the buffers data.
      */
     DFBResult (*CreateImageProvider) (
          IDirectFBDataBuffer      *thiz,
          IDirectFBImageProvider  **interface
     );

     /*
      * Creates a video provider using the buffers data.
      */
     DFBResult (*CreateVideoProvider) (
          IDirectFBDataBuffer      *thiz,
          IDirectFBVideoProvider  **interface
     );
)

#ifdef __cplusplus
}
#endif

#endif
���������������������������������������������������������DirectFB-1.2.10/include/Makefile.am�����������������������������������������������������������������0000644�0001750�0001750�00000010662�11164361026�013622� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for DirectFB/include

includedir = @INCLUDEDIR@

DISTCLEANFILES = directfb_keynames.h directfb_strings.h

include_HEADERS = \
	directfb.h		\
	directfb_keyboard.h	\
	directfb_keynames.h	\
	directfb_strings.h	\
	directfb_util.h		\
	directfb_version.h	\
	directfbgl.h		\
	dfb_types.h		\
	dfiff.h			\
	dgiff.h

MKNAMES = $(top_srcdir)/tools/mknames.sh
INCP = $(srcdir)

distclean-local:
	rm -f directfb_keynames.h directfb_strings.h

directfb_keynames.h: directfb_keyboard.h $(MKNAMES) Makefile
	@echo '#ifndef __DIRECTFB_KEYNAMES_H__' > $@
	@echo '#define __DIRECTFB_KEYNAMES_H__' >> $@

	$(MKNAMES) DFBInputDeviceKeySymbol DIKS NULL KeySymbol symbol $(INCP)/directfb_keyboard.h \
	   | grep -v DIKS_ENTER >> $@

	$(MKNAMES) DFBInputDeviceKeyIdentifier DIKI UNKNOWN KeyIdentifier identifier $(INCP)/directfb_keyboard.h \
	   | grep -v DIKI_NUMBER_OF_KEYS | grep -v DIKI_KEYDEF_END >> $@

	@echo '' >> $@
	@echo '#endif' >> $@


directfb_strings.h: directfb.h $(MKNAMES) Makefile
	@echo '#ifndef __DIRECTFB_STRINGS_H__' > $@
	@echo '#define __DIRECTFB_STRINGS_H__' >> $@

	$(MKNAMES) DFBSurfacePixelFormat DSPF UNKNOWN PixelFormat format $(INCP)/directfb.h >> $@

	$(MKNAMES) DFBInputDeviceTypeFlags DIDTF NONE InputDeviceTypeFlags type $(INCP)/directfb.h \
	   | grep -v DIDTF_ALL >> $@

	$(MKNAMES) DFBSurfaceDrawingFlags DSDRAW NOFX SurfaceDrawingFlags flag $(INCP)/directfb.h \
	   | grep -v DSDRAW_ALL >> $@

	$(MKNAMES) DFBSurfaceBlittingFlags DSBLIT NOFX SurfaceBlittingFlags flag $(INCP)/directfb.h \
	   | grep -v DSBLIT_ALL >> $@

	$(MKNAMES) DFBSurfaceBlendFunction DSBF UNKNOWN SurfaceBlendFunction function $(INCP)/directfb.h \
	   >> $@

	@echo FIXME: Use DIMCAPS prefix for DFBImageCapabilities
	$(MKNAMES) DFBInputDeviceCapabilities DICAPS NONE InputDeviceCapabilities capability $(INCP)/directfb.h \
	   | grep -v DICAPS_ALL | grep -v DICAPS_ALPHACHANNEL | grep -v DICAPS_COLORKEY >> $@

	$(MKNAMES) DFBDisplayLayerTypeFlags DLTF NONE DisplayLayerTypeFlags type $(INCP)/directfb.h \
	   | grep -v DLTF_ALL >> $@

	$(MKNAMES) DFBDisplayLayerCapabilities DLCAPS NONE DisplayLayerCapabilities capability $(INCP)/directfb.h \
	   | grep -v DLCAPS_ALL >> $@

	$(MKNAMES) DFBDisplayLayerBufferMode DLBM UNKNOWN DisplayLayerBufferMode mode $(INCP)/directfb.h \
	   | grep -v DLBM_DONTCARE | grep -v DLBM_COLOR | grep -v DLBM_IMAGE | grep -v DLBM_TILE >> $@

	$(MKNAMES) DFBWindowCapabilities DWCAPS NONE WindowCapabilities capability $(INCP)/directfb.h \
	   | grep -v DWCAPS_ALL >> $@

	$(MKNAMES) DFBWindowOptions DWOP NONE WindowOptions option $(INCP)/directfb.h \
	   | grep -v DWOP_ALL >> $@

	$(MKNAMES) DFBScreenCapabilities DSCCAPS NONE ScreenCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSCCAPS_ALL >> $@

	$(MKNAMES) DFBScreenEncoderCapabilities DSECAPS NONE ScreenEncoderCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSECAPS_ALL >> $@

	$(MKNAMES) DFBScreenEncoderType DSET UNKNOWN ScreenEncoderType type $(INCP)/directfb.h \
	   | grep -v DSET_ALL >> $@

	$(MKNAMES) DFBScreenEncoderTVStandards DSETV UNKNOWN ScreenEncoderTVStandards standard $(INCP)/directfb.h \
	   | grep -v DSETV_ALL >> $@

	$(MKNAMES) DFBScreenOutputCapabilities DSOCAPS NONE ScreenOutputCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSOCAPS_ALL >> $@

	$(MKNAMES) DFBScreenOutputConnectors DSOC UNKNOWN ScreenOutputConnectors connector $(INCP)/directfb.h \
	   | grep -v DSOC_ALL >> $@

	$(MKNAMES) DFBScreenOutputSignals DSOS NONE ScreenOutputSignals signal $(INCP)/directfb.h \
	   | grep -v DSOS_ALL >> $@

	$(MKNAMES) DFBScreenOutputSlowBlankingSignals DSOSB OFF ScreenOutputSlowBlankingSignals slow_signal $(INCP)/directfb.h \
	   | grep -v DSOSB_ALL >> $@

	$(MKNAMES) DFBScreenOutputResolution DSOR UNKNOWN ScreenOutputResolution resolution $(INCP)/directfb.h \
	   | grep -v DSOR_ALL >> $@

	$(MKNAMES) DFBScreenMixerCapabilities DSMCAPS NONE ScreenMixerCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSMCAPS_ALL >> $@

	$(MKNAMES) DFBScreenMixerTree DSMT UNKNOWN ScreenMixerTree tree $(INCP)/directfb.h \
	   | grep -v DSMT_ALL >> $@

	$(MKNAMES) DFBScreenEncoderTestPicture DSETP OFF ScreenEncoderTestPicture test_picture $(INCP)/directfb.h \
	   | grep -v DSETP_ALL >> $@

	$(MKNAMES) DFBScreenEncoderScanMode DSESM UNKNOWN ScreenEncoderScanMode scan_mode $(INCP)/directfb.h \
	   | grep -v DSESM_ALL >> $@

	$(MKNAMES) DFBAccelerationMask DFXL NONE AccelerationMask mask $(INCP)/directfb.h \
	   | grep -v DFXL_ALL >> $@

	@echo '' >> $@
	@echo '#endif' >> $@
������������������������������������������������������������������������������DirectFB-1.2.10/include/Makefile.in�����������������������������������������������������������������0000644�0001750�0001750�00000044242�11307521501�013627� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

@SET_MAKE@

VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = include
DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in $(srcdir)/directfb_version.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \
	$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = directfb_version.h
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(includedir)"
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
ASFLAGS = @ASFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIR = @DATADIR@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@
DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@
DFB_LDFLAGS = @DFB_LDFLAGS@
DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@
DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@
DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@
DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@
DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@
DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@
DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@
DIRECTFB_VERSION = @DIRECTFB_VERSION@
DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@
DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@
DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@
DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@
DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@
DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@
DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@
DSYMUTIL = @DSYMUTIL@
DYNLIB = @DYNLIB@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
FREETYPE_LIBS = @FREETYPE_LIBS@
FREETYPE_PROVIDER = @FREETYPE_PROVIDER@
FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GIF_PROVIDER = @GIF_PROVIDER@
GREP = @GREP@
HAVE_LINUX = @HAVE_LINUX@
INCLUDEDIR = @INCLUDEDIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@
JPEG_PROVIDER = @JPEG_PROVIDER@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBJPEG = @LIBJPEG@
LIBOBJS = @LIBOBJS@
LIBPNG = @LIBPNG@
LIBPNG_CONFIG = @LIBPNG_CONFIG@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_BINARY = @LT_BINARY@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN2HTML = @MAN2HTML@
MKDIR_P = @MKDIR_P@
MODULEDIR = @MODULEDIR@
MODULEDIRNAME = @MODULEDIRNAME@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OSX_LIBS = @OSX_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PNG_PROVIDER = @PNG_PROVIDER@
RANLIB = @RANLIB@
RUNTIME_SYSROOT = @RUNTIME_SYSROOT@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOPATH = @SOPATH@
STRIP = @STRIP@
SYSCONFDIR = @SYSCONFDIR@
SYSFS_LIBS = @SYSFS_LIBS@
THREADFLAGS = @THREADFLAGS@
THREADLIB = @THREADLIB@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
VERSION = @VERSION@
VNC_CFLAGS = @VNC_CFLAGS@
VNC_CONFIG = @VNC_CONFIG@
VNC_LIBS = @VNC_LIBS@
X11_CFLAGS = @X11_CFLAGS@
X11_LIBS = @X11_LIBS@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @INCLUDEDIR@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DISTCLEANFILES = directfb_keynames.h directfb_strings.h
include_HEADERS = \
	directfb.h		\
	directfb_keyboard.h	\
	directfb_keynames.h	\
	directfb_strings.h	\
	directfb_util.h		\
	directfb_version.h	\
	directfbgl.h		\
	dfb_types.h		\
	dfiff.h			\
	dgiff.h

MKNAMES = $(top_srcdir)/tools/mknames.sh
INCP = $(srcdir)
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
		&& exit 0; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  include/Makefile'; \
	cd $(top_srcdir) && \
	  $(AUTOMAKE) --gnu  include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
directfb_version.h: $(top_builddir)/config.status $(srcdir)/directfb_version.h.in
	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-includeHEADERS: $(include_HEADERS)
	@$(NORMAL_INSTALL)
	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
	@list='$(include_HEADERS)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
	  f=$(am__strip_dir) \
	  echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
	  $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
	done

uninstall-includeHEADERS:
	@$(NORMAL_UNINSTALL)
	@list='$(include_HEADERS)'; for p in $$list; do \
	  f=$(am__strip_dir) \
	  echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
	  rm -f "$(DESTDIR)$(includedir)/$$f"; \
	done

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	    $$tags $$unique; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	tags=; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$tags$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$tags $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && cd $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) $$here

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
	    fi; \
	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
	  else \
	    test -f $(distdir)/$$file \
	    || cp -p $$d/$$file $(distdir)/$$file \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
	for dir in "$(DESTDIR)$(includedir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-local \
	distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

info: info-am

info-am:

install-data-am: install-includeHEADERS

install-dvi: install-dvi-am

install-exec-am:

install-html: install-html-am

install-info: install-info-am

install-man:

install-pdf: install-pdf-am

install-ps: install-ps-am

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-includeHEADERS

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool ctags distclean distclean-generic \
	distclean-libtool distclean-local distclean-tags distdir dvi \
	dvi-am html html-am info info-am install install-am \
	install-data install-data-am install-dvi install-dvi-am \
	install-exec install-exec-am install-html install-html-am \
	install-includeHEADERS install-info install-info-am \
	install-man install-pdf install-pdf-am install-ps \
	install-ps-am install-strip installcheck installcheck-am \
	installdirs maintainer-clean maintainer-clean-generic \
	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
	ps ps-am tags uninstall uninstall-am uninstall-includeHEADERS


distclean-local:
	rm -f directfb_keynames.h directfb_strings.h

directfb_keynames.h: directfb_keyboard.h $(MKNAMES) Makefile
	@echo '#ifndef __DIRECTFB_KEYNAMES_H__' > $@
	@echo '#define __DIRECTFB_KEYNAMES_H__' >> $@

	$(MKNAMES) DFBInputDeviceKeySymbol DIKS NULL KeySymbol symbol $(INCP)/directfb_keyboard.h \
	   | grep -v DIKS_ENTER >> $@

	$(MKNAMES) DFBInputDeviceKeyIdentifier DIKI UNKNOWN KeyIdentifier identifier $(INCP)/directfb_keyboard.h \
	   | grep -v DIKI_NUMBER_OF_KEYS | grep -v DIKI_KEYDEF_END >> $@

	@echo '' >> $@
	@echo '#endif' >> $@

directfb_strings.h: directfb.h $(MKNAMES) Makefile
	@echo '#ifndef __DIRECTFB_STRINGS_H__' > $@
	@echo '#define __DIRECTFB_STRINGS_H__' >> $@

	$(MKNAMES) DFBSurfacePixelFormat DSPF UNKNOWN PixelFormat format $(INCP)/directfb.h >> $@

	$(MKNAMES) DFBInputDeviceTypeFlags DIDTF NONE InputDeviceTypeFlags type $(INCP)/directfb.h \
	   | grep -v DIDTF_ALL >> $@

	$(MKNAMES) DFBSurfaceDrawingFlags DSDRAW NOFX SurfaceDrawingFlags flag $(INCP)/directfb.h \
	   | grep -v DSDRAW_ALL >> $@

	$(MKNAMES) DFBSurfaceBlittingFlags DSBLIT NOFX SurfaceBlittingFlags flag $(INCP)/directfb.h \
	   | grep -v DSBLIT_ALL >> $@

	$(MKNAMES) DFBSurfaceBlendFunction DSBF UNKNOWN SurfaceBlendFunction function $(INCP)/directfb.h \
	   >> $@

	@echo FIXME: Use DIMCAPS prefix for DFBImageCapabilities
	$(MKNAMES) DFBInputDeviceCapabilities DICAPS NONE InputDeviceCapabilities capability $(INCP)/directfb.h \
	   | grep -v DICAPS_ALL | grep -v DICAPS_ALPHACHANNEL | grep -v DICAPS_COLORKEY >> $@

	$(MKNAMES) DFBDisplayLayerTypeFlags DLTF NONE DisplayLayerTypeFlags type $(INCP)/directfb.h \
	   | grep -v DLTF_ALL >> $@

	$(MKNAMES) DFBDisplayLayerCapabilities DLCAPS NONE DisplayLayerCapabilities capability $(INCP)/directfb.h \
	   | grep -v DLCAPS_ALL >> $@

	$(MKNAMES) DFBDisplayLayerBufferMode DLBM UNKNOWN DisplayLayerBufferMode mode $(INCP)/directfb.h \
	   | grep -v DLBM_DONTCARE | grep -v DLBM_COLOR | grep -v DLBM_IMAGE | grep -v DLBM_TILE >> $@

	$(MKNAMES) DFBWindowCapabilities DWCAPS NONE WindowCapabilities capability $(INCP)/directfb.h \
	   | grep -v DWCAPS_ALL >> $@

	$(MKNAMES) DFBWindowOptions DWOP NONE WindowOptions option $(INCP)/directfb.h \
	   | grep -v DWOP_ALL >> $@

	$(MKNAMES) DFBScreenCapabilities DSCCAPS NONE ScreenCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSCCAPS_ALL >> $@

	$(MKNAMES) DFBScreenEncoderCapabilities DSECAPS NONE ScreenEncoderCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSECAPS_ALL >> $@

	$(MKNAMES) DFBScreenEncoderType DSET UNKNOWN ScreenEncoderType type $(INCP)/directfb.h \
	   | grep -v DSET_ALL >> $@

	$(MKNAMES) DFBScreenEncoderTVStandards DSETV UNKNOWN ScreenEncoderTVStandards standard $(INCP)/directfb.h \
	   | grep -v DSETV_ALL >> $@

	$(MKNAMES) DFBScreenOutputCapabilities DSOCAPS NONE ScreenOutputCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSOCAPS_ALL >> $@

	$(MKNAMES) DFBScreenOutputConnectors DSOC UNKNOWN ScreenOutputConnectors connector $(INCP)/directfb.h \
	   | grep -v DSOC_ALL >> $@

	$(MKNAMES) DFBScreenOutputSignals DSOS NONE ScreenOutputSignals signal $(INCP)/directfb.h \
	   | grep -v DSOS_ALL >> $@

	$(MKNAMES) DFBScreenOutputSlowBlankingSignals DSOSB OFF ScreenOutputSlowBlankingSignals slow_signal $(INCP)/directfb.h \
	   | grep -v DSOSB_ALL >> $@

	$(MKNAMES) DFBScreenOutputResolution DSOR UNKNOWN ScreenOutputResolution resolution $(INCP)/directfb.h \
	   | grep -v DSOR_ALL >> $@

	$(MKNAMES) DFBScreenMixerCapabilities DSMCAPS NONE ScreenMixerCapabilities capability $(INCP)/directfb.h \
	   | grep -v DSMCAPS_ALL >> $@

	$(MKNAMES) DFBScreenMixerTree DSMT UNKNOWN ScreenMixerTree tree $(INCP)/directfb.h \
	   | grep -v DSMT_ALL >> $@

	$(MKNAMES) DFBScreenEncoderTestPicture DSETP OFF ScreenEncoderTestPicture test_picture $(INCP)/directfb.h \
	   | grep -v DSETP_ALL >> $@

	$(MKNAMES) DFBScreenEncoderScanMode DSESM UNKNOWN ScreenEncoderScanMode scan_mode $(INCP)/directfb.h \
	   | grep -v DSESM_ALL >> $@

	$(MKNAMES) DFBAccelerationMask DFXL NONE AccelerationMask mask $(INCP)/directfb.h \
	   | grep -v DFXL_ALL >> $@

	@echo '' >> $@
	@echo '#endif' >> $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfbgl.h����������������������������������������������������������������0000644�0001750�0001750�00000005271�11245562152�014047� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIRECTFBGL_H__
#define __DIRECTFBGL_H__

#include <directfb.h>

#ifdef __cplusplus
extern "C"
{
#endif

/*
 * The DirectFBGL interface version.
 */
#define DIRECTFBGL_INTERFACE_VERSION  1


/* 
 * Attributes of an OpenGL context.
 */
typedef struct {
     int        buffer_size;
     int        depth_size;
     int        stencil_size;
     int        aux_buffers;
    
     int        red_size;
     int        green_size;
     int        blue_size;
     int        alpha_size;

     int        accum_red_size;
     int        accum_green_size;
     int        accum_blue_size;
     int        accum_alpha_size;

     DFBBoolean double_buffer;
     DFBBoolean stereo;
} DFBGLAttributes;


/***************
 * IDirectFBGL *
 ***************/

/*
 * <i>No summary yet...</i>
 */
DEFINE_INTERFACE(   IDirectFBGL,

   /** Context handling **/

     /*
      * Acquire the hardware lock.
      */
     DFBResult (*Lock) (
          IDirectFBGL              *thiz
     );

     /*
      * Release the lock.
      */
     DFBResult (*Unlock) (
          IDirectFBGL              *thiz
     );

     /*
      * Query the OpenGL attributes.
      */
     DFBResult (*GetAttributes) (
          IDirectFBGL              *thiz,
          DFBGLAttributes          *attributes
     );
     
     /*
      * Get the address of an OpenGL function.
      */
     DFBResult (*GetProcAddress) (
          IDirectFBGL              *thiz,
          const char               *name,
          void                    **ret_address
     );
)


#ifdef __cplusplus
}
#endif

#endif

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb_util.h�������������������������������������������������������������0000644�0001750�0001750�00000035152�11307506423�014560� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIRECTFB_UTIL_H__
#define __DIRECTFB_UTIL_H__

#include <stdlib.h>
#include <errno.h>

#include <directfb.h>

#ifdef __cplusplus
extern "C"
{
#endif

#include <directfb_strings.h>

#include <direct/types.h>
#include <direct/debug.h>

bool dfb_region_intersect( DFBRegion *region,
                           int x1, int y1, int x2, int y2 );

bool dfb_region_region_intersect( DFBRegion       *region,
                                  const DFBRegion *clip );

bool dfb_region_rectangle_intersect( DFBRegion          *region,
                                     const DFBRectangle *rect );

bool dfb_unsafe_region_intersect( DFBRegion *region,
                                  int x1, int y1, int x2, int y2 );

bool dfb_unsafe_region_rectangle_intersect( DFBRegion          *region,
                                            const DFBRectangle *rect );

bool dfb_rectangle_intersect_by_unsafe_region( DFBRectangle *rectangle,
                                               DFBRegion    *region );

bool dfb_rectangle_intersect_by_region( DFBRectangle    *rectangle,
                                        const DFBRegion *region );

bool dfb_rectangle_intersect( DFBRectangle       *rectangle,
                              const DFBRectangle *clip );

/* returns the result in the first rectangle */
void dfb_rectangle_union ( DFBRectangle       *rect1,
                           const DFBRectangle *rect2 );


#define DFB_RECTANGLE_ASSERT(r)              \
     do {                                    \
          D_ASSERT( (r) != NULL );           \
          D_ASSERT( (r)->w >= 0 );           \
          D_ASSERT( (r)->h >= 0 );           \
     } while (0)

#define DFB_RECTANGLE_ASSERT_IF(r)           \
     do {                                    \
          if ((r) != NULL) {                 \
               D_ASSERT( (r)->w >= 0 );      \
               D_ASSERT( (r)->h >= 0 );      \
          }                                  \
     } while (0)

#define DFB_RECTANGLE_VALS(r)                (r)->x, (r)->y, (r)->w, (r)->h
#define DFB_RECTANGLE_VALS_FROM_REGION(r)    (r)->x1, (r)->y1, (r)->x2-(r)->x1+1, (r)->y2-(r)->y1+1
#define DFB_RECTANGLE_INIT_FROM_REGION(r)    (DFBRectangle){ DFB_RECTANGLE_VALS_FROM_REGION(r) }
#define DFB_RECTANGLE_CONTAINS_POINT(r,X,Y)  (((X) >= (r)->x) && ((X) < (r)->x + (r)->w) && \
                                              ((Y) >= (r)->y) && ((Y) < (r)->y + (r)->h))

#define DFB_RECTANGLES_DEBUG_AT( Domain, rects, num )                                                         \
     do {                                                                                                     \
          unsigned int i;                                                                                     \
                                                                                                              \
          for (i=0; i<(num); i++)                                                                             \
               D_DEBUG_AT( Domain, "  -> [%2d] %4d,%4d-%4dx%4d\n", i, DFB_RECTANGLE_VALS(&(rects)[i]) );      \
     } while (0)


#define DFB_TRIANGLE_VALS(t)                 (t)->x1, (t)->y1, (t)->x2, (t)->y2, (t)->x3, (t)->y3

#define DFB_COLORKEY_VALS(c)                 (c)->r, (c)->g, (c)->b, (c)->index

#define DFB_REGION_CHECK(r)     \
      ((r) != NULL &&           \
       (r)->x1 <= (r)->x2 &&    \
       (r)->y1 <= (r)->y2)

#define DFB_REGION_CHECK_IF(r)  \
      ((r) == NULL ||           \
       ((r)->x1 <= (r)->x2 &&   \
        (r)->y1 <= (r)->y2))

#define DFB_REGION_ASSERT(r)                 \
     do {                                    \
          D_ASSERT( (r) != NULL );           \
          D_ASSERT( (r)->x1 <= (r)->x2 );    \
          D_ASSERT( (r)->y1 <= (r)->y2 );    \
     } while (0)

#define DFB_REGION_ASSERT_IF(r)                   \
     do {                                         \
          if ((r) != NULL) {                      \
               D_ASSERT( (r)->x1 <= (r)->x2 );    \
               D_ASSERT( (r)->y1 <= (r)->y2 );    \
          }                                       \
     } while (0)


#define DFB_REGION_VALS(r)                   (r)->x1, (r)->y1, (r)->x2, (r)->y2

#define DFB_REGION_VALS_FROM_DIMENSION(d)    0, 0, (d)->w-1, (d)->h-1
#define DFB_REGION_INIT_FROM_DIMENSION(d)    (DFBRegion){ DFB_REGION_VALS_FROM_DIMENSION(d) }

#define DFB_REGION_VALS_FROM_RECTANGLE(r)    (r)->x, (r)->y, (r)->x+(r)->w-1, (r)->y+(r)->h-1
#define DFB_REGION_INIT_FROM_RECTANGLE(r)    (DFBRegion){ DFB_REGION_VALS_FROM_RECTANGLE(r) }

#define DFB_REGION_VALS_FROM_RECTANGLE_VALS(x,y,w,h)   (x), (y), (x)+(w)-1, (y)+(h)-1
#define DFB_REGION_INIT_FROM_RECTANGLE_VALS(x,y,w,h)   (DFBRegion){ DFB_REGION_VALS_FROM_RECTANGLE_VALS(x,y,w,h) }

#define DFB_REGION_VALS_TRANSLATED(r,x,y)    (r)->x1 + x, (r)->y1 + y, (r)->x2 + x, (r)->y2 + y
#define DFB_REGION_INIT_TRANSLATED(r,x,y)    (DFBRegion){ DFB_REGION_VALS_TRANSLATED(r,x,y) }

#define DFB_REGION_VALS_INTERSECTED(r,X1,Y1,X2,Y2)   (r)->x1 > (X1) ? (r)->x1 : (X1),      \
                                                     (r)->y1 > (Y1) ? (r)->y1 : (Y1),      \
                                                     (r)->x2 < (X2) ? (r)->x2 : (X2),      \
                                                     (r)->y2 < (Y2) ? (r)->y2 : (Y2)
#define DFB_REGION_INIT_INTERSECTED(r,X1,Y1,X2,Y2)   (DFBRegion){ DFB_REGION_VALS_INTERSECTED(r,X1,Y1,X2,Y2) }


#define DFB_REGION_CONTAINS_POINT(r,X,Y)     (((X) >= (r)->x1) && ((X) <= (r)->x2) && \
                                              ((Y) >= (r)->y1) && ((Y) <= (r)->y2))

static inline void dfb_rectangle_from_region( DFBRectangle    *rect,
                                              const DFBRegion *region )
{
     D_ASSERT( rect != NULL );

     DFB_REGION_ASSERT( region );

     rect->x = region->x1;
     rect->y = region->y1;
     rect->w = region->x2 - region->x1 + 1;
     rect->h = region->y2 - region->y1 + 1;
}

static inline void dfb_rectangle_from_rectangle_plus_insets( DFBRectangle       *rect,
                                                             const DFBRectangle *inner,
                                                             const DFBInsets    *insets )
{
     D_ASSERT( rect != NULL );
     D_ASSERT( insets != NULL );

     DFB_RECTANGLE_ASSERT( inner );

     rect->x = inner->x - insets->l;
     rect->y = inner->y - insets->t;
     rect->w = inner->w + insets->l + insets->r;
     rect->h = inner->h + insets->t + insets->b;
}

static inline void dfb_region_from_rectangle( DFBRegion          *region,
                                              const DFBRectangle *rect )
{
     D_ASSERT( region != NULL );

     DFB_RECTANGLE_ASSERT( rect );

     D_ASSERT( rect->w > 0 );
     D_ASSERT( rect->h > 0 );

     region->x1 = rect->x;
     region->y1 = rect->y;
     region->x2 = rect->x + rect->w - 1;
     region->y2 = rect->y + rect->h - 1;
}


static inline void dfb_rectangle_translate( DFBRectangle *rect,
                                            int           dx,
                                            int           dy )
{
     DFB_RECTANGLE_ASSERT( rect );

     rect->x += dx;
     rect->y += dy;
}

static inline void dfb_region_translate( DFBRegion *region,
                                         int        dx,
                                         int        dy )
{
     DFB_REGION_ASSERT( region );

     region->x1 += dx;
     region->y1 += dy;
     region->x2 += dx;
     region->y2 += dy;
}

static inline void dfb_rectangle_resize( DFBRectangle *rect,
                                         int           width,
                                         int           height )
{
     DFB_RECTANGLE_ASSERT( rect );

     D_ASSERT( width >= 0 );
     D_ASSERT( height >= 0 );

     rect->w = width;
     rect->h = height;
}

static inline void dfb_region_resize( DFBRegion *region,
                                      int        width,
                                      int        height )
{
     DFB_REGION_ASSERT( region );

     D_ASSERT( width >= 0 );
     D_ASSERT( height >= 0 );

     region->x2 = region->x1 + width - 1;
     region->y2 = region->y1 + height - 1;
}

static inline bool dfb_region_intersects( const DFBRegion *region,
                                          int              x1,
                                          int              y1,
                                          int              x2,
                                          int              y2 )
{
     DFB_REGION_ASSERT( region );

     D_ASSERT( x1 <= x2 );
     D_ASSERT( y1 <= y2 );

     return (region->x1 <= x2 &&
             region->y1 <= y2 &&
             region->x2 >= x1 &&
             region->y2 >= y1);
}

static inline bool dfb_region_region_intersects( const DFBRegion *region,
                                                 const DFBRegion *other )
{
     DFB_REGION_ASSERT( region );
     DFB_REGION_ASSERT( other );

     return (region->x1 <= other->x2 &&
             region->y1 <= other->y2 &&
             region->x2 >= other->x1 &&
             region->y2 >= other->y1);
}

static inline bool dfb_region_region_extends( const DFBRegion *a,
                                              const DFBRegion *b )
{
     if (a->x1 == b->x1 && a->x2 == b->x2)
          return (a->y1 == b->y2 - 1) || (a->y2 == b->y1 - 1);

     if (a->y1 == b->y1 && a->y2 == b->y2)
          return (a->x1 == b->x2 - 1) || (a->x2 == b->x1 - 1);

     return false;
}

static inline void dfb_region_region_union( DFBRegion       *region,
                                            const DFBRegion *other )
{
     DFB_REGION_ASSERT( region );
     DFB_REGION_ASSERT( other );

     if (region->x1 > other->x1)
          region->x1 = other->x1;

     if (region->y1 > other->y1)
          region->y1 = other->y1;

     if (region->x2 < other->x2)
          region->x2 = other->x2;

     if (region->y2 < other->y2)
          region->y2 = other->y2;
}

static inline bool dfb_rectangle_region_intersects( const DFBRectangle *rect,
                                                    const DFBRegion    *region )
{
     DFB_RECTANGLE_ASSERT( rect );

     DFB_REGION_ASSERT( region );

     return (rect->x <= region->x2 &&
             rect->y <= region->y2 &&
             rect->x + rect->w > region->x1 &&
             rect->y + rect->h > region->y1);
}

static inline void dfb_region_clip( DFBRegion *region,
                                    int        x1,
                                    int        y1,
                                    int        x2,
                                    int        y2 )
{
     DFB_REGION_ASSERT( region );

     D_ASSERT( dfb_region_intersects( region, x1, y1, x2, y2 ) );

     if (region->x1 < x1)
          region->x1 = x1;

     if (region->y1 < y1)
          region->y1 = y1;

     if (region->x2 > x2)
          region->x2 = x2;

     if (region->y2 > y2)
          region->y2 = y2;
}

static inline void dfb_rectangle_subtract( DFBRectangle    *rect, 
                                           const DFBInsets *insets )
{
     D_ASSERT( rect != NULL );
     D_ASSERT( insets != NULL );
     
     rect->x += insets->l;
     rect->y += insets->t;
     rect->w -= insets->l + insets->r;
     rect->h -= insets->t + insets->b;
     
     if (rect->w <= 0 || rect->h <= 0)
          rect->w = rect->h = 0;
}

/*
 * Compute line segment intersection. 
 * Return true if intersection point exists within the given segment.
 */
static inline bool dfb_line_segment_intersect( const DFBRegion *line, 
                                               const DFBRegion *seg, 
                                               int             *x, 
                                               int             *y )
{
     int x1, x2, x3, x4;
     int y1, y2, y3, y4;
     int num, den;
     
     D_ASSERT( line != NULL );
     D_ASSERT( seg != NULL );
     
     x1 = seg->x1;  y1 = seg->y1;  x2 = seg->y2;  y2 = seg->y2;
     x3 = line->x1; y3 = line->y1; x4 = line->x2; y4 = line->y2;
     
     num = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
     den = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);

     if (!den) /* parallel */
          return false;
          
     if (num && ((num < 0) != (den < 0) || abs(num) > abs(den))) /* not within segment */
          return false;
     
     if (x)
          *x = (s64)(x2 - x1) * num / den + x1;
     if (y)
          *y = (s64)(y2 - y1) * num / den + y1;
     
     return true;
}


/*
 * Copied declaration of DFBPixelFormatName from directfb_strings.h
 */
extern const struct DFBPixelFormatName dfb_pixelformat_names[];


const char *dfb_input_event_type_name ( DFBInputEventType     type );
const char *dfb_pixelformat_name      ( DFBSurfacePixelFormat format );
const char *dfb_window_event_type_name( DFBWindowEventType    type );



typedef struct {
     int        magic;

     DFBRegion *regions;
     int        max_regions;
     int        num_regions;

     DFBRegion  bounding;
} DFBUpdates;


void dfb_updates_init( DFBUpdates      *updates,
                       DFBRegion       *regions,
                       int              max_regions );

void dfb_updates_add ( DFBUpdates      *updates,
                       const DFBRegion *region );

void dfb_updates_stat( DFBUpdates      *updates,
                       int             *ret_total,
                       int             *ret_bounding );


static inline void
dfb_updates_reset( DFBUpdates *updates )
{
     D_MAGIC_ASSERT( updates, DFBUpdates );

     updates->num_regions = 0;
}

static inline void
dfb_updates_deinit( DFBUpdates *updates )
{
     D_MAGIC_ASSERT( updates, DFBUpdates );

     D_MAGIC_CLEAR( updates );
}

#ifdef __cplusplus
}
#endif

#endif
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/dgiff.h���������������������������������������������������������������������0000644�0001750�0001750�00000005635�11245562152�013025� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This file is subject to the terms and conditions of the MIT License:

   Permission is hereby granted, free of charge, to any person
   obtaining a copy of this software and associated documentation
   files (the "Software"), to deal in the Software without restriction,
   including without limitation the rights to use, copy, modify, merge,
   publish, distribute, sublicense, and/or sell copies of the Software,
   and to permit persons to whom the Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be
   included in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef __DGIFF_H__
#define __DGIFF_H__

#include <inttypes.h>

#define DGIFF_FLAG_LITTLE_ENDIAN   0x01

typedef struct {
     unsigned char  magic[5];      /* "DGIFF" magic */

     unsigned char  major;         /* Major version number */
     unsigned char  minor;         /* Minor version number */

     unsigned char  flags;         /* Some flags like endianess */

     /* From now on endianess matters... */

     uint32_t       num_faces;

     uint32_t       __pad;
} DGIFFHeader;

typedef struct {
     int32_t        next_face;     /* byte offset from this to next face */

     int32_t        size;

     int32_t        ascender;
     int32_t        descender;
     int32_t        height;

     int32_t        max_advance;

     uint32_t       pixelformat;

     uint32_t       num_glyphs;
     uint32_t       num_rows;

     uint32_t       __pad;
} DGIFFFaceHeader;

typedef struct {
     uint32_t       unicode;

     uint32_t       row;

     int32_t        offset;
     int32_t        width;
     int32_t        height;

     int32_t        left;
     int32_t        top;
     int32_t        advance;
} DGIFFGlyphInfo;

typedef struct {
     int32_t        width;
     int32_t        height;
     int32_t        pitch;         /* Preferably 8 byte aligned */

     uint32_t       __pad;

     /* Raw pixel data follows, "height * pitch" bytes. */
} DGIFFGlyphRow;

#endif

���������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb_keyboard.h���������������������������������������������������������0000644�0001750�0001750�00000072044�11245562152�015406� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIRECTFB_KEYBOARD_H__
#define __DIRECTFB_KEYBOARD_H__

#ifdef __cplusplus
extern "C"
{
#endif


/*
 * DirectFB key types (for advanced mapping)
 */
typedef enum {
     DIKT_UNICODE        = 0x0000,     /* Unicode 3.x character
                                           (compatible to Latin-1) */
     DIKT_SPECIAL        = 0xF000,     /* Special key (e.g. Cursor Up or Menu) */
     DIKT_FUNCTION       = 0xF100,     /* Function key (F1 - Fn) */
     DIKT_MODIFIER       = 0xF200,     /* Modifier key */
     DIKT_LOCK           = 0xF300,     /* Lock key (e.g. CapsLock) */
     DIKT_DEAD           = 0xF400,     /* Dead key (e.g. dead grave) */
     DIKT_CUSTOM         = 0xF500,     /* Custom key (vendor specific) */
     DIKT_IDENTIFIER     = 0xF600      /* DirectFB key identifier */
} DFBInputDeviceKeyType;

#define DFB_KEY(type,index)        ((DIKT_##type) | (index))

#define DFB_KEY_TYPE(symbol)       ((((symbol) & ~0xFFF) == 0xF000) ? (symbol) & 0xFF00 : DIKT_UNICODE)
#define DFB_KEY_INDEX(symbol)      ((symbol) & 0x00FF)

#define DFB_KEY_IS_ASCII(symbol)   ((symbol) < 128)

#define DFB_FUNCTION_KEY(n)        (DFB_KEY( FUNCTION, n ))
#define DFB_MODIFIER_KEY(i)        (DFB_KEY( MODIFIER, (1 << i) ))
#define DFB_CUSTOM_KEY(n)          (DFB_KEY( CUSTOM, n ))

#define DFB_LOWER_CASE(symbol)     (((symbol) >= 'A' && (symbol) <= 'Z') ?\
                                    ((symbol) | 0x20) : (symbol))
#define DFB_UPPER_CASE(symbol)     (((symbol) >= 'a' && (symbol) <= 'z') ?\
                                    ((symbol) & ~0x20) : (symbol))

/*
 * DirectFB modifier key identifiers (for advanced mapping)
 */
typedef enum {
     DIMKI_SHIFT,                       /* Shift modifier key */
     DIMKI_CONTROL,                     /* Control modifier key */
     DIMKI_ALT,                         /* Alt modifier key */
     DIMKI_ALTGR,                       /* AltGr modifier key */
     DIMKI_META,                        /* Meta modifier key */
     DIMKI_SUPER,                       /* Super modifier key */
     DIMKI_HYPER,                       /* Hyper modifier key */

     DIMKI_FIRST    = DIMKI_SHIFT,
     DIMKI_LAST     = DIMKI_HYPER
} DFBInputDeviceModifierKeyIdentifier;

/*
 * DirectFB key identifiers (for basic mapping)
 */
typedef enum {
     DIKI_UNKNOWN = DFB_KEY( IDENTIFIER, 0 ),

     DIKI_A,
     DIKI_B,
     DIKI_C,
     DIKI_D,
     DIKI_E,
     DIKI_F,
     DIKI_G,
     DIKI_H,
     DIKI_I,
     DIKI_J,
     DIKI_K,
     DIKI_L,
     DIKI_M,
     DIKI_N,
     DIKI_O,
     DIKI_P,
     DIKI_Q,
     DIKI_R,
     DIKI_S,
     DIKI_T,
     DIKI_U,
     DIKI_V,
     DIKI_W,
     DIKI_X,
     DIKI_Y,
     DIKI_Z,

     DIKI_0,
     DIKI_1,
     DIKI_2,
     DIKI_3,
     DIKI_4,
     DIKI_5,
     DIKI_6,
     DIKI_7,
     DIKI_8,
     DIKI_9,

     DIKI_F1,
     DIKI_F2,
     DIKI_F3,
     DIKI_F4,
     DIKI_F5,
     DIKI_F6,
     DIKI_F7,
     DIKI_F8,
     DIKI_F9,
     DIKI_F10,
     DIKI_F11,
     DIKI_F12,

     DIKI_SHIFT_L,
     DIKI_SHIFT_R,
     DIKI_CONTROL_L,
     DIKI_CONTROL_R,
     DIKI_ALT_L,
     DIKI_ALT_R,
     DIKI_META_L,
     DIKI_META_R,
     DIKI_SUPER_L,
     DIKI_SUPER_R,
     DIKI_HYPER_L,
     DIKI_HYPER_R,

     DIKI_CAPS_LOCK,
     DIKI_NUM_LOCK,
     DIKI_SCROLL_LOCK,

     DIKI_ESCAPE,
     DIKI_LEFT,
     DIKI_RIGHT,
     DIKI_UP,
     DIKI_DOWN,
     DIKI_TAB,
     DIKI_ENTER,
     DIKI_SPACE,
     DIKI_BACKSPACE,
     DIKI_INSERT,
     DIKI_DELETE,
     DIKI_HOME,
     DIKI_END,
     DIKI_PAGE_UP,
     DIKI_PAGE_DOWN,
     DIKI_PRINT,
     DIKI_PAUSE,

     /*  The labels on these keys depend on the type of keyboard.
      *  We've choosen the names from a US keyboard layout. The
      *  comments refer to the ISO 9995 terminology.
      */
     DIKI_QUOTE_LEFT,    /*  TLDE  */
     DIKI_MINUS_SIGN,    /*  AE11  */
     DIKI_EQUALS_SIGN,   /*  AE12  */
     DIKI_BRACKET_LEFT,  /*  AD11  */
     DIKI_BRACKET_RIGHT, /*  AD12  */
     DIKI_BACKSLASH,     /*  BKSL  */
     DIKI_SEMICOLON,     /*  AC10  */
     DIKI_QUOTE_RIGHT,   /*  AC11  */
     DIKI_COMMA,         /*  AB08  */
     DIKI_PERIOD,        /*  AB09  */
     DIKI_SLASH,         /*  AB10  */

     DIKI_LESS_SIGN,     /*  103rd  */

     DIKI_KP_DIV,
     DIKI_KP_MULT,
     DIKI_KP_MINUS,
     DIKI_KP_PLUS,
     DIKI_KP_ENTER,
     DIKI_KP_SPACE,
     DIKI_KP_TAB,
     DIKI_KP_F1,
     DIKI_KP_F2,
     DIKI_KP_F3,
     DIKI_KP_F4,
     DIKI_KP_EQUAL,
     DIKI_KP_SEPARATOR,

     DIKI_KP_DECIMAL,
     DIKI_KP_0,
     DIKI_KP_1,
     DIKI_KP_2,
     DIKI_KP_3,
     DIKI_KP_4,
     DIKI_KP_5,
     DIKI_KP_6,
     DIKI_KP_7,
     DIKI_KP_8,
     DIKI_KP_9,

     DIKI_KEYDEF_END,
     DIKI_NUMBER_OF_KEYS = DIKI_KEYDEF_END - DFB_KEY( IDENTIFIER, 0 )

} DFBInputDeviceKeyIdentifier;

/*
 * DirectFB key symbols (for advanced mapping)
 */
typedef enum {
     /*
      * Unicode excerpt - Controls and Basic Latin
      *
      * Any Unicode 3.x character can be used as a DirectFB key symbol,
      * the values of this enum are compatible with Unicode.
      */
     DIKS_NULL                     = DFB_KEY( UNICODE, 0x00 ),
     DIKS_BACKSPACE                = DFB_KEY( UNICODE, 0x08 ),
     DIKS_TAB                      = DFB_KEY( UNICODE, 0x09 ),
     DIKS_RETURN                   = DFB_KEY( UNICODE, 0x0D ),
     DIKS_CANCEL                   = DFB_KEY( UNICODE, 0x18 ),
     DIKS_ESCAPE                   = DFB_KEY( UNICODE, 0x1B ),
     DIKS_SPACE                    = DFB_KEY( UNICODE, 0x20 ),
     DIKS_EXCLAMATION_MARK         = DFB_KEY( UNICODE, 0x21 ),
     DIKS_QUOTATION                = DFB_KEY( UNICODE, 0x22 ),
     DIKS_NUMBER_SIGN              = DFB_KEY( UNICODE, 0x23 ),
     DIKS_DOLLAR_SIGN              = DFB_KEY( UNICODE, 0x24 ),
     DIKS_PERCENT_SIGN             = DFB_KEY( UNICODE, 0x25 ),
     DIKS_AMPERSAND                = DFB_KEY( UNICODE, 0x26 ),
     DIKS_APOSTROPHE               = DFB_KEY( UNICODE, 0x27 ),
     DIKS_PARENTHESIS_LEFT         = DFB_KEY( UNICODE, 0x28 ),
     DIKS_PARENTHESIS_RIGHT        = DFB_KEY( UNICODE, 0x29 ),
     DIKS_ASTERISK                 = DFB_KEY( UNICODE, 0x2A ),
     DIKS_PLUS_SIGN                = DFB_KEY( UNICODE, 0x2B ),
     DIKS_COMMA                    = DFB_KEY( UNICODE, 0x2C ),
     DIKS_MINUS_SIGN               = DFB_KEY( UNICODE, 0x2D ),
     DIKS_PERIOD                   = DFB_KEY( UNICODE, 0x2E ),
     DIKS_SLASH                    = DFB_KEY( UNICODE, 0x2F ),
     DIKS_0                        = DFB_KEY( UNICODE, 0x30 ),
     DIKS_1                        = DFB_KEY( UNICODE, 0x31 ),
     DIKS_2                        = DFB_KEY( UNICODE, 0x32 ),
     DIKS_3                        = DFB_KEY( UNICODE, 0x33 ),
     DIKS_4                        = DFB_KEY( UNICODE, 0x34 ),
     DIKS_5                        = DFB_KEY( UNICODE, 0x35 ),
     DIKS_6                        = DFB_KEY( UNICODE, 0x36 ),
     DIKS_7                        = DFB_KEY( UNICODE, 0x37 ),
     DIKS_8                        = DFB_KEY( UNICODE, 0x38 ),
     DIKS_9                        = DFB_KEY( UNICODE, 0x39 ),
     DIKS_COLON                    = DFB_KEY( UNICODE, 0x3A ),
     DIKS_SEMICOLON                = DFB_KEY( UNICODE, 0x3B ),
     DIKS_LESS_THAN_SIGN           = DFB_KEY( UNICODE, 0x3C ),
     DIKS_EQUALS_SIGN              = DFB_KEY( UNICODE, 0x3D ),
     DIKS_GREATER_THAN_SIGN        = DFB_KEY( UNICODE, 0x3E ),
     DIKS_QUESTION_MARK            = DFB_KEY( UNICODE, 0x3F ),
     DIKS_AT                       = DFB_KEY( UNICODE, 0x40 ),
     DIKS_CAPITAL_A                = DFB_KEY( UNICODE, 0x41 ),
     DIKS_CAPITAL_B                = DFB_KEY( UNICODE, 0x42 ),
     DIKS_CAPITAL_C                = DFB_KEY( UNICODE, 0x43 ),
     DIKS_CAPITAL_D                = DFB_KEY( UNICODE, 0x44 ),
     DIKS_CAPITAL_E                = DFB_KEY( UNICODE, 0x45 ),
     DIKS_CAPITAL_F                = DFB_KEY( UNICODE, 0x46 ),
     DIKS_CAPITAL_G                = DFB_KEY( UNICODE, 0x47 ),
     DIKS_CAPITAL_H                = DFB_KEY( UNICODE, 0x48 ),
     DIKS_CAPITAL_I                = DFB_KEY( UNICODE, 0x49 ),
     DIKS_CAPITAL_J                = DFB_KEY( UNICODE, 0x4A ),
     DIKS_CAPITAL_K                = DFB_KEY( UNICODE, 0x4B ),
     DIKS_CAPITAL_L                = DFB_KEY( UNICODE, 0x4C ),
     DIKS_CAPITAL_M                = DFB_KEY( UNICODE, 0x4D ),
     DIKS_CAPITAL_N                = DFB_KEY( UNICODE, 0x4E ),
     DIKS_CAPITAL_O                = DFB_KEY( UNICODE, 0x4F ),
     DIKS_CAPITAL_P                = DFB_KEY( UNICODE, 0x50 ),
     DIKS_CAPITAL_Q                = DFB_KEY( UNICODE, 0x51 ),
     DIKS_CAPITAL_R                = DFB_KEY( UNICODE, 0x52 ),
     DIKS_CAPITAL_S                = DFB_KEY( UNICODE, 0x53 ),
     DIKS_CAPITAL_T                = DFB_KEY( UNICODE, 0x54 ),
     DIKS_CAPITAL_U                = DFB_KEY( UNICODE, 0x55 ),
     DIKS_CAPITAL_V                = DFB_KEY( UNICODE, 0x56 ),
     DIKS_CAPITAL_W                = DFB_KEY( UNICODE, 0x57 ),
     DIKS_CAPITAL_X                = DFB_KEY( UNICODE, 0x58 ),
     DIKS_CAPITAL_Y                = DFB_KEY( UNICODE, 0x59 ),
     DIKS_CAPITAL_Z                = DFB_KEY( UNICODE, 0x5A ),
     DIKS_SQUARE_BRACKET_LEFT      = DFB_KEY( UNICODE, 0x5B ),
     DIKS_BACKSLASH                = DFB_KEY( UNICODE, 0x5C ),
     DIKS_SQUARE_BRACKET_RIGHT     = DFB_KEY( UNICODE, 0x5D ),
     DIKS_CIRCUMFLEX_ACCENT        = DFB_KEY( UNICODE, 0x5E ),
     DIKS_UNDERSCORE               = DFB_KEY( UNICODE, 0x5F ),
     DIKS_GRAVE_ACCENT             = DFB_KEY( UNICODE, 0x60 ),
     DIKS_SMALL_A                  = DFB_KEY( UNICODE, 0x61 ),
     DIKS_SMALL_B                  = DFB_KEY( UNICODE, 0x62 ),
     DIKS_SMALL_C                  = DFB_KEY( UNICODE, 0x63 ),
     DIKS_SMALL_D                  = DFB_KEY( UNICODE, 0x64 ),
     DIKS_SMALL_E                  = DFB_KEY( UNICODE, 0x65 ),
     DIKS_SMALL_F                  = DFB_KEY( UNICODE, 0x66 ),
     DIKS_SMALL_G                  = DFB_KEY( UNICODE, 0x67 ),
     DIKS_SMALL_H                  = DFB_KEY( UNICODE, 0x68 ),
     DIKS_SMALL_I                  = DFB_KEY( UNICODE, 0x69 ),
     DIKS_SMALL_J                  = DFB_KEY( UNICODE, 0x6A ),
     DIKS_SMALL_K                  = DFB_KEY( UNICODE, 0x6B ),
     DIKS_SMALL_L                  = DFB_KEY( UNICODE, 0x6C ),
     DIKS_SMALL_M                  = DFB_KEY( UNICODE, 0x6D ),
     DIKS_SMALL_N                  = DFB_KEY( UNICODE, 0x6E ),
     DIKS_SMALL_O                  = DFB_KEY( UNICODE, 0x6F ),
     DIKS_SMALL_P                  = DFB_KEY( UNICODE, 0x70 ),
     DIKS_SMALL_Q                  = DFB_KEY( UNICODE, 0x71 ),
     DIKS_SMALL_R                  = DFB_KEY( UNICODE, 0x72 ),
     DIKS_SMALL_S                  = DFB_KEY( UNICODE, 0x73 ),
     DIKS_SMALL_T                  = DFB_KEY( UNICODE, 0x74 ),
     DIKS_SMALL_U                  = DFB_KEY( UNICODE, 0x75 ),
     DIKS_SMALL_V                  = DFB_KEY( UNICODE, 0x76 ),
     DIKS_SMALL_W                  = DFB_KEY( UNICODE, 0x77 ),
     DIKS_SMALL_X                  = DFB_KEY( UNICODE, 0x78 ),
     DIKS_SMALL_Y                  = DFB_KEY( UNICODE, 0x79 ),
     DIKS_SMALL_Z                  = DFB_KEY( UNICODE, 0x7A ),
     DIKS_CURLY_BRACKET_LEFT       = DFB_KEY( UNICODE, 0x7B ),
     DIKS_VERTICAL_BAR             = DFB_KEY( UNICODE, 0x7C ),
     DIKS_CURLY_BRACKET_RIGHT      = DFB_KEY( UNICODE, 0x7D ),
     DIKS_TILDE                    = DFB_KEY( UNICODE, 0x7E ),
     DIKS_DELETE                   = DFB_KEY( UNICODE, 0x7F ),

     DIKS_ENTER                    = DIKS_RETURN,

     /*
      * Unicode private area - DirectFB Special keys
      */
     DIKS_CURSOR_LEFT              = DFB_KEY( SPECIAL, 0x00 ),
     DIKS_CURSOR_RIGHT             = DFB_KEY( SPECIAL, 0x01 ),
     DIKS_CURSOR_UP                = DFB_KEY( SPECIAL, 0x02 ),
     DIKS_CURSOR_DOWN              = DFB_KEY( SPECIAL, 0x03 ),
     DIKS_INSERT                   = DFB_KEY( SPECIAL, 0x04 ),
     DIKS_HOME                     = DFB_KEY( SPECIAL, 0x05 ),
     DIKS_END                      = DFB_KEY( SPECIAL, 0x06 ),
     DIKS_PAGE_UP                  = DFB_KEY( SPECIAL, 0x07 ),
     DIKS_PAGE_DOWN                = DFB_KEY( SPECIAL, 0x08 ),
     DIKS_PRINT                    = DFB_KEY( SPECIAL, 0x09 ),
     DIKS_PAUSE                    = DFB_KEY( SPECIAL, 0x0A ),
     DIKS_OK                       = DFB_KEY( SPECIAL, 0x0B ),
     DIKS_SELECT                   = DFB_KEY( SPECIAL, 0x0C ),
     DIKS_GOTO                     = DFB_KEY( SPECIAL, 0x0D ),
     DIKS_CLEAR                    = DFB_KEY( SPECIAL, 0x0E ),
     DIKS_POWER                    = DFB_KEY( SPECIAL, 0x0F ),
     DIKS_POWER2                   = DFB_KEY( SPECIAL, 0x10 ),
     DIKS_OPTION                   = DFB_KEY( SPECIAL, 0x11 ),
     DIKS_MENU                     = DFB_KEY( SPECIAL, 0x12 ),
     DIKS_HELP                     = DFB_KEY( SPECIAL, 0x13 ),
     DIKS_INFO                     = DFB_KEY( SPECIAL, 0x14 ),
     DIKS_TIME                     = DFB_KEY( SPECIAL, 0x15 ),
     DIKS_VENDOR                   = DFB_KEY( SPECIAL, 0x16 ),

     DIKS_ARCHIVE                  = DFB_KEY( SPECIAL, 0x17 ),
     DIKS_PROGRAM                  = DFB_KEY( SPECIAL, 0x18 ),
     DIKS_CHANNEL                  = DFB_KEY( SPECIAL, 0x19 ),
     DIKS_FAVORITES                = DFB_KEY( SPECIAL, 0x1A ),
     DIKS_EPG                      = DFB_KEY( SPECIAL, 0x1B ),
     DIKS_PVR                      = DFB_KEY( SPECIAL, 0x1C ),
     DIKS_MHP                      = DFB_KEY( SPECIAL, 0x1D ),
     DIKS_LANGUAGE                 = DFB_KEY( SPECIAL, 0x1E ),
     DIKS_TITLE                    = DFB_KEY( SPECIAL, 0x1F ),
     DIKS_SUBTITLE                 = DFB_KEY( SPECIAL, 0x20 ),
     DIKS_ANGLE                    = DFB_KEY( SPECIAL, 0x21 ),
     DIKS_ZOOM                     = DFB_KEY( SPECIAL, 0x22 ),
     DIKS_MODE                     = DFB_KEY( SPECIAL, 0x23 ),
     DIKS_KEYBOARD                 = DFB_KEY( SPECIAL, 0x24 ),
     DIKS_PC                       = DFB_KEY( SPECIAL, 0x25 ),
     DIKS_SCREEN                   = DFB_KEY( SPECIAL, 0x26 ),

     DIKS_TV                       = DFB_KEY( SPECIAL, 0x27 ),
     DIKS_TV2                      = DFB_KEY( SPECIAL, 0x28 ),
     DIKS_VCR                      = DFB_KEY( SPECIAL, 0x29 ),
     DIKS_VCR2                     = DFB_KEY( SPECIAL, 0x2A ),
     DIKS_SAT                      = DFB_KEY( SPECIAL, 0x2B ),
     DIKS_SAT2                     = DFB_KEY( SPECIAL, 0x2C ),
     DIKS_CD                       = DFB_KEY( SPECIAL, 0x2D ),
     DIKS_TAPE                     = DFB_KEY( SPECIAL, 0x2E ),
     DIKS_RADIO                    = DFB_KEY( SPECIAL, 0x2F ),
     DIKS_TUNER                    = DFB_KEY( SPECIAL, 0x30 ),
     DIKS_PLAYER                   = DFB_KEY( SPECIAL, 0x31 ),
     DIKS_TEXT                     = DFB_KEY( SPECIAL, 0x32 ),
     DIKS_DVD                      = DFB_KEY( SPECIAL, 0x33 ),
     DIKS_AUX                      = DFB_KEY( SPECIAL, 0x34 ),
     DIKS_MP3                      = DFB_KEY( SPECIAL, 0x35 ),
     DIKS_PHONE                    = DFB_KEY( SPECIAL, 0x36 ),
     DIKS_AUDIO                    = DFB_KEY( SPECIAL, 0x37 ),
     DIKS_VIDEO                    = DFB_KEY( SPECIAL, 0x38 ),

     DIKS_INTERNET                 = DFB_KEY( SPECIAL, 0x39 ),
     DIKS_MAIL                     = DFB_KEY( SPECIAL, 0x3A ),
     DIKS_NEWS                     = DFB_KEY( SPECIAL, 0x3B ),
     DIKS_DIRECTORY                = DFB_KEY( SPECIAL, 0x3C ),
     DIKS_LIST                     = DFB_KEY( SPECIAL, 0x3D ),
     DIKS_CALCULATOR               = DFB_KEY( SPECIAL, 0x3E ),
     DIKS_MEMO                     = DFB_KEY( SPECIAL, 0x3F ),
     DIKS_CALENDAR                 = DFB_KEY( SPECIAL, 0x40 ),
     DIKS_EDITOR                   = DFB_KEY( SPECIAL, 0x41 ),

     DIKS_RED                      = DFB_KEY( SPECIAL, 0x42 ),
     DIKS_GREEN                    = DFB_KEY( SPECIAL, 0x43 ),
     DIKS_YELLOW                   = DFB_KEY( SPECIAL, 0x44 ),
     DIKS_BLUE                     = DFB_KEY( SPECIAL, 0x45 ),

     DIKS_CHANNEL_UP               = DFB_KEY( SPECIAL, 0x46 ),
     DIKS_CHANNEL_DOWN             = DFB_KEY( SPECIAL, 0x47 ),
     DIKS_BACK                     = DFB_KEY( SPECIAL, 0x48 ),
     DIKS_FORWARD                  = DFB_KEY( SPECIAL, 0x49 ),
     DIKS_FIRST                    = DFB_KEY( SPECIAL, 0x4A ),
     DIKS_LAST                     = DFB_KEY( SPECIAL, 0x4B ),
     DIKS_VOLUME_UP                = DFB_KEY( SPECIAL, 0x4C ),
     DIKS_VOLUME_DOWN              = DFB_KEY( SPECIAL, 0x4D ),
     DIKS_MUTE                     = DFB_KEY( SPECIAL, 0x4E ),
     DIKS_AB                       = DFB_KEY( SPECIAL, 0x4F ),
     DIKS_PLAYPAUSE                = DFB_KEY( SPECIAL, 0x50 ),
     DIKS_PLAY                     = DFB_KEY( SPECIAL, 0x51 ),
     DIKS_STOP                     = DFB_KEY( SPECIAL, 0x52 ),
     DIKS_RESTART                  = DFB_KEY( SPECIAL, 0x53 ),
     DIKS_SLOW                     = DFB_KEY( SPECIAL, 0x54 ),
     DIKS_FAST                     = DFB_KEY( SPECIAL, 0x55 ),
     DIKS_RECORD                   = DFB_KEY( SPECIAL, 0x56 ),
     DIKS_EJECT                    = DFB_KEY( SPECIAL, 0x57 ),
     DIKS_SHUFFLE                  = DFB_KEY( SPECIAL, 0x58 ),
     DIKS_REWIND                   = DFB_KEY( SPECIAL, 0x59 ),
     DIKS_FASTFORWARD              = DFB_KEY( SPECIAL, 0x5A ),
     DIKS_PREVIOUS                 = DFB_KEY( SPECIAL, 0x5B ),
     DIKS_NEXT                     = DFB_KEY( SPECIAL, 0x5C ),
     DIKS_BEGIN                    = DFB_KEY( SPECIAL, 0x5D ),

     DIKS_DIGITS                   = DFB_KEY( SPECIAL, 0x5E ),
     DIKS_TEEN                     = DFB_KEY( SPECIAL, 0x5F ),
     DIKS_TWEN                     = DFB_KEY( SPECIAL, 0x60 ),

     DIKS_BREAK                    = DFB_KEY( SPECIAL, 0x61 ),
     DIKS_EXIT                     = DFB_KEY( SPECIAL, 0x62 ),
     DIKS_SETUP                    = DFB_KEY( SPECIAL, 0x63 ),

     DIKS_CURSOR_LEFT_UP           = DFB_KEY( SPECIAL, 0x64 ),
     DIKS_CURSOR_LEFT_DOWN         = DFB_KEY( SPECIAL, 0x65 ),
     DIKS_CURSOR_UP_RIGHT          = DFB_KEY( SPECIAL, 0x66 ),
     DIKS_CURSOR_DOWN_RIGHT        = DFB_KEY( SPECIAL, 0x67 ),

     /*
      * Unicode private area - DirectFB Function keys
      *
      * More function keys are available via DFB_FUNCTION_KEY(n).
      */
     DIKS_F1                       = DFB_FUNCTION_KEY(  1 ),
     DIKS_F2                       = DFB_FUNCTION_KEY(  2 ),
     DIKS_F3                       = DFB_FUNCTION_KEY(  3 ),
     DIKS_F4                       = DFB_FUNCTION_KEY(  4 ),
     DIKS_F5                       = DFB_FUNCTION_KEY(  5 ),
     DIKS_F6                       = DFB_FUNCTION_KEY(  6 ),
     DIKS_F7                       = DFB_FUNCTION_KEY(  7 ),
     DIKS_F8                       = DFB_FUNCTION_KEY(  8 ),
     DIKS_F9                       = DFB_FUNCTION_KEY(  9 ),
     DIKS_F10                      = DFB_FUNCTION_KEY( 10 ),
     DIKS_F11                      = DFB_FUNCTION_KEY( 11 ),
     DIKS_F12                      = DFB_FUNCTION_KEY( 12 ),

     /*
      * Unicode private area - DirectFB Modifier keys
      */
     DIKS_SHIFT                    = DFB_MODIFIER_KEY( DIMKI_SHIFT ),
     DIKS_CONTROL                  = DFB_MODIFIER_KEY( DIMKI_CONTROL ),
     DIKS_ALT                      = DFB_MODIFIER_KEY( DIMKI_ALT ),
     DIKS_ALTGR                    = DFB_MODIFIER_KEY( DIMKI_ALTGR ),
     DIKS_META                     = DFB_MODIFIER_KEY( DIMKI_META ),
     DIKS_SUPER                    = DFB_MODIFIER_KEY( DIMKI_SUPER ),
     DIKS_HYPER                    = DFB_MODIFIER_KEY( DIMKI_HYPER ),

     /*
      * Unicode private area - DirectFB Lock keys
      */
     DIKS_CAPS_LOCK                = DFB_KEY( LOCK, 0x00 ),
     DIKS_NUM_LOCK                 = DFB_KEY( LOCK, 0x01 ),
     DIKS_SCROLL_LOCK              = DFB_KEY( LOCK, 0x02 ),

     /*
      * Unicode private area - DirectFB Dead keys
      */
     DIKS_DEAD_ABOVEDOT            = DFB_KEY( DEAD, 0x00 ),
     DIKS_DEAD_ABOVERING           = DFB_KEY( DEAD, 0x01 ),
     DIKS_DEAD_ACUTE               = DFB_KEY( DEAD, 0x02 ),
     DIKS_DEAD_BREVE               = DFB_KEY( DEAD, 0x03 ),
     DIKS_DEAD_CARON               = DFB_KEY( DEAD, 0x04 ),
     DIKS_DEAD_CEDILLA             = DFB_KEY( DEAD, 0x05 ),
     DIKS_DEAD_CIRCUMFLEX          = DFB_KEY( DEAD, 0x06 ),
     DIKS_DEAD_DIAERESIS           = DFB_KEY( DEAD, 0x07 ),
     DIKS_DEAD_DOUBLEACUTE         = DFB_KEY( DEAD, 0x08 ),
     DIKS_DEAD_GRAVE               = DFB_KEY( DEAD, 0x09 ),
     DIKS_DEAD_IOTA                = DFB_KEY( DEAD, 0x0A ),
     DIKS_DEAD_MACRON              = DFB_KEY( DEAD, 0x0B ),
     DIKS_DEAD_OGONEK              = DFB_KEY( DEAD, 0x0C ),
     DIKS_DEAD_SEMIVOICED_SOUND    = DFB_KEY( DEAD, 0x0D ),
     DIKS_DEAD_TILDE               = DFB_KEY( DEAD, 0x0E ),
     DIKS_DEAD_VOICED_SOUND        = DFB_KEY( DEAD, 0x0F ),

     /*
      * Unicode private area - DirectFB Custom keys
      *
      * More custom keys are available via DFB_CUSTOM_KEY(n).
      */
     DIKS_CUSTOM0                  = DFB_CUSTOM_KEY( 0 ),
     DIKS_CUSTOM1                  = DFB_CUSTOM_KEY( 1 ),
     DIKS_CUSTOM2                  = DFB_CUSTOM_KEY( 2 ),
     DIKS_CUSTOM3                  = DFB_CUSTOM_KEY( 3 ),
     DIKS_CUSTOM4                  = DFB_CUSTOM_KEY( 4 ),
     DIKS_CUSTOM5                  = DFB_CUSTOM_KEY( 5 ),
     DIKS_CUSTOM6                  = DFB_CUSTOM_KEY( 6 ),
     DIKS_CUSTOM7                  = DFB_CUSTOM_KEY( 7 ),
     DIKS_CUSTOM8                  = DFB_CUSTOM_KEY( 8 ),
     DIKS_CUSTOM9                  = DFB_CUSTOM_KEY( 9 ),
     DIKS_CUSTOM10                 = DFB_CUSTOM_KEY( 10 ),
     DIKS_CUSTOM11                 = DFB_CUSTOM_KEY( 11 ),
     DIKS_CUSTOM12                 = DFB_CUSTOM_KEY( 12 ),
     DIKS_CUSTOM13                 = DFB_CUSTOM_KEY( 13 ),
     DIKS_CUSTOM14                 = DFB_CUSTOM_KEY( 14 ),
     DIKS_CUSTOM15                 = DFB_CUSTOM_KEY( 15 ),
     DIKS_CUSTOM16                 = DFB_CUSTOM_KEY( 16 ),
     DIKS_CUSTOM17                 = DFB_CUSTOM_KEY( 17 ),
     DIKS_CUSTOM18                 = DFB_CUSTOM_KEY( 18 ),
     DIKS_CUSTOM19                 = DFB_CUSTOM_KEY( 19 ),
     DIKS_CUSTOM20                 = DFB_CUSTOM_KEY( 20 ),
     DIKS_CUSTOM21                 = DFB_CUSTOM_KEY( 21 ),
     DIKS_CUSTOM22                 = DFB_CUSTOM_KEY( 22 ),
     DIKS_CUSTOM23                 = DFB_CUSTOM_KEY( 23 ),
     DIKS_CUSTOM24                 = DFB_CUSTOM_KEY( 24 ),
     DIKS_CUSTOM25                 = DFB_CUSTOM_KEY( 25 ),
     DIKS_CUSTOM26                 = DFB_CUSTOM_KEY( 26 ),
     DIKS_CUSTOM27                 = DFB_CUSTOM_KEY( 27 ),
     DIKS_CUSTOM28                 = DFB_CUSTOM_KEY( 28 ),
     DIKS_CUSTOM29                 = DFB_CUSTOM_KEY( 29 ),
     DIKS_CUSTOM30                 = DFB_CUSTOM_KEY( 30 ),
     DIKS_CUSTOM31                 = DFB_CUSTOM_KEY( 31 ),
     DIKS_CUSTOM32                 = DFB_CUSTOM_KEY( 32 ),
     DIKS_CUSTOM33                 = DFB_CUSTOM_KEY( 33 ),
     DIKS_CUSTOM34                 = DFB_CUSTOM_KEY( 34 ),
     DIKS_CUSTOM35                 = DFB_CUSTOM_KEY( 35 ),
     DIKS_CUSTOM36                 = DFB_CUSTOM_KEY( 36 ),
     DIKS_CUSTOM37                 = DFB_CUSTOM_KEY( 37 ),
     DIKS_CUSTOM38                 = DFB_CUSTOM_KEY( 38 ),
     DIKS_CUSTOM39                 = DFB_CUSTOM_KEY( 39 ),
     DIKS_CUSTOM40                 = DFB_CUSTOM_KEY( 40 ),
     DIKS_CUSTOM41                 = DFB_CUSTOM_KEY( 41 ),
     DIKS_CUSTOM42                 = DFB_CUSTOM_KEY( 42 ),
     DIKS_CUSTOM43                 = DFB_CUSTOM_KEY( 43 ),
     DIKS_CUSTOM44                 = DFB_CUSTOM_KEY( 44 ),
     DIKS_CUSTOM45                 = DFB_CUSTOM_KEY( 45 ),
     DIKS_CUSTOM46                 = DFB_CUSTOM_KEY( 46 ),
     DIKS_CUSTOM47                 = DFB_CUSTOM_KEY( 47 ),
     DIKS_CUSTOM48                 = DFB_CUSTOM_KEY( 48 ),
     DIKS_CUSTOM49                 = DFB_CUSTOM_KEY( 49 ),
     DIKS_CUSTOM50                 = DFB_CUSTOM_KEY( 50 ),
     DIKS_CUSTOM51                 = DFB_CUSTOM_KEY( 51 ),
     DIKS_CUSTOM52                 = DFB_CUSTOM_KEY( 52 ),
     DIKS_CUSTOM53                 = DFB_CUSTOM_KEY( 53 ),
     DIKS_CUSTOM54                 = DFB_CUSTOM_KEY( 54 ),
     DIKS_CUSTOM55                 = DFB_CUSTOM_KEY( 55 ),
     DIKS_CUSTOM56                 = DFB_CUSTOM_KEY( 56 ),
     DIKS_CUSTOM57                 = DFB_CUSTOM_KEY( 57 ),
     DIKS_CUSTOM58                 = DFB_CUSTOM_KEY( 58 ),
     DIKS_CUSTOM59                 = DFB_CUSTOM_KEY( 59 ),
     DIKS_CUSTOM60                 = DFB_CUSTOM_KEY( 60 ),
     DIKS_CUSTOM61                 = DFB_CUSTOM_KEY( 61 ),
     DIKS_CUSTOM62                 = DFB_CUSTOM_KEY( 62 ),
     DIKS_CUSTOM63                 = DFB_CUSTOM_KEY( 63 ),
     DIKS_CUSTOM64                 = DFB_CUSTOM_KEY( 64 ),
     DIKS_CUSTOM65                 = DFB_CUSTOM_KEY( 65 ),
     DIKS_CUSTOM66                 = DFB_CUSTOM_KEY( 66 ),
     DIKS_CUSTOM67                 = DFB_CUSTOM_KEY( 67 ),
     DIKS_CUSTOM68                 = DFB_CUSTOM_KEY( 68 ),
     DIKS_CUSTOM69                 = DFB_CUSTOM_KEY( 69 ),
     DIKS_CUSTOM70                 = DFB_CUSTOM_KEY( 70 ),
     DIKS_CUSTOM71                 = DFB_CUSTOM_KEY( 71 ),
     DIKS_CUSTOM72                 = DFB_CUSTOM_KEY( 72 ),
     DIKS_CUSTOM73                 = DFB_CUSTOM_KEY( 73 ),
     DIKS_CUSTOM74                 = DFB_CUSTOM_KEY( 74 ),
     DIKS_CUSTOM75                 = DFB_CUSTOM_KEY( 75 ),
     DIKS_CUSTOM76                 = DFB_CUSTOM_KEY( 76 ),
     DIKS_CUSTOM77                 = DFB_CUSTOM_KEY( 77 ),
     DIKS_CUSTOM78                 = DFB_CUSTOM_KEY( 78 ),
     DIKS_CUSTOM79                 = DFB_CUSTOM_KEY( 79 ),
     DIKS_CUSTOM80                 = DFB_CUSTOM_KEY( 80 ),
     DIKS_CUSTOM81                 = DFB_CUSTOM_KEY( 81 ),
     DIKS_CUSTOM82                 = DFB_CUSTOM_KEY( 82 ),
     DIKS_CUSTOM83                 = DFB_CUSTOM_KEY( 83 ),
     DIKS_CUSTOM84                 = DFB_CUSTOM_KEY( 84 ),
     DIKS_CUSTOM85                 = DFB_CUSTOM_KEY( 85 ),
     DIKS_CUSTOM86                 = DFB_CUSTOM_KEY( 86 ),
     DIKS_CUSTOM87                 = DFB_CUSTOM_KEY( 87 ),
     DIKS_CUSTOM88                 = DFB_CUSTOM_KEY( 88 ),
     DIKS_CUSTOM89                 = DFB_CUSTOM_KEY( 89 ),
     DIKS_CUSTOM90                 = DFB_CUSTOM_KEY( 90 ),
     DIKS_CUSTOM91                 = DFB_CUSTOM_KEY( 91 ),
     DIKS_CUSTOM92                 = DFB_CUSTOM_KEY( 92 ),
     DIKS_CUSTOM93                 = DFB_CUSTOM_KEY( 93 ),
     DIKS_CUSTOM94                 = DFB_CUSTOM_KEY( 94 ),
     DIKS_CUSTOM95                 = DFB_CUSTOM_KEY( 95 ),
     DIKS_CUSTOM96                 = DFB_CUSTOM_KEY( 96 ),
     DIKS_CUSTOM97                 = DFB_CUSTOM_KEY( 97 ),
     DIKS_CUSTOM98                 = DFB_CUSTOM_KEY( 98 ),
     DIKS_CUSTOM99                 = DFB_CUSTOM_KEY( 99 )
} DFBInputDeviceKeySymbol;

/*
 * Flags specifying the key locks that are currently active.
 */
typedef enum {
     DILS_SCROLL         = 0x00000001,  /* scroll-lock active? */
     DILS_NUM            = 0x00000002,  /* num-lock active? */
     DILS_CAPS           = 0x00000004   /* caps-lock active? */
} DFBInputDeviceLockState;

/*
 * Groups and levels as an index to the symbol array.
 */
typedef enum {
     DIKSI_BASE          = 0x00,   /* base group, base level
                                      (no modifier pressed) */
     DIKSI_BASE_SHIFT    = 0x01,   /* base group, shifted level
                                      (with Shift pressed) */
     DIKSI_ALT           = 0x02,   /* alternative group, base level
                                      (with AltGr pressed) */
     DIKSI_ALT_SHIFT     = 0x03,   /* alternative group, shifted level
                                      (with AltGr and Shift pressed) */

     DIKSI_LAST          = DIKSI_ALT_SHIFT
} DFBInputDeviceKeymapSymbolIndex;

/*
 * One entry in the keymap of an input device.
 */
typedef struct {
     int                         code;                  /* hardware
                                                           key code */
     DFBInputDeviceLockState     locks;                 /* locks activating
                                                           shifted level */
     DFBInputDeviceKeyIdentifier identifier;            /* basic mapping */
     DFBInputDeviceKeySymbol     symbols[DIKSI_LAST+1]; /* advanced key
                                                           mapping */
} DFBInputDeviceKeymapEntry;


#ifdef __cplusplus
}
#endif

#endif

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/dfb_types.h�����������������������������������������������������������������0000644�0001750�0001750�00000002652�11245562152�013721� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DFB_TYPES_H__
#define __DFB_TYPES_H__

#include <direct/types.h>


#ifdef DIRECTFB_ENABLE_DEPRECATED
#define __u8   u8
#define __u16  u16
#define __u32  u32
#define __u64  u64
#define __s8   s8
#define __s16  s16
#define __s32  s32
#define __s64  s64
#endif

#endif
��������������������������������������������������������������������������������������DirectFB-1.2.10/include/directfb_version.h����������������������������������������������������������0000644�0001750�0001750�00000002633�11307521521�015262� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2007  The DirectFB Organization (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef __DIRECTFB_VERSION_H__
#define __DIRECTFB_VERSION_H__

#define DIRECTFB_MAJOR_VERSION  (1)
#define DIRECTFB_MINOR_VERSION  (2)
#define DIRECTFB_MICRO_VERSION  (10)
#define DIRECTFB_BINARY_AGE     (1)
#define DIRECTFB_INTERFACE_AGE  (1)

#endif /* __DIRECTFB_VERSION_H__ */
�����������������������������������������������������������������������������������������������������DirectFB-1.2.10/include/dfiff.h���������������������������������������������������������������������0000644�0001750�0001750�00000004173�11245562152�013020� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*
   (c) Copyright 2001-2008  The world wide DirectFB Open Source Community (directfb.org)
   (c) Copyright 2000-2004  Convergence (integrated media) GmbH

   All rights reserved.

   Written by Denis Oliver Kropp <dok@directfb.org>,
              Andreas Hundt <andi@fischlustig.de>,
              Sven Neumann <neo@directfb.org>,
              Ville Syrjälä <syrjala@sci.fi> and
              Claudio Ciccani <klan@users.sf.net>.

   This file is subject to the terms and conditions of the MIT License:

   Permission is hereby granted, free of charge, to any person
   obtaining a copy of this software and associated documentation
   files (the "Software"), to deal in the Software without restriction,
   including without limitation the rights to use, copy, modify, merge,
   publish, distribute, sublicense, and/or sell copies of the Software,
   and to permit persons to whom the Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be
   included in all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
   CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef __DFIFF_H__
#define __DFIFF_H__

#include <inttypes.h>

#define DFIFF_FLAG_LITTLE_ENDIAN   0x01

typedef struct {
     unsigned char magic[5];      /* "DFIFF" magic */

     unsigned char major;         /* Major version number */
     unsigned char minor;         /* Minor version number */

     unsigned char flags;         /* Some flags like endianess */

     /* From now on endianess matters... */

     uint32_t                 width;
     uint32_t                 height;
     DFBSurfacePixelFormat    format;
     uint32_t                 pitch;
} DFIFFHeader;


#endif

�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������